
D10V support was removed years ago, but the gdb.base/d10vovly.c file stayed behind. Looking a bit closer, I can't find anywhere that references gdb.base/m32rovly.c either. Both gdb.base/m32rovly.c and gdb.base/d10vovly.c seem to be older copies of gdb.base/ovlymgr.c, that are exactly the same, except for some cosmetic differences, and for missing _ovly_debug_event. Note that gdb.base/ovlymgr.c has the #ifdef __M32R__ bits too. Note also that gdb.base/overlays.exp is currently only supported on m32r, and that uses ovlymgr.c not gdb.base/m32rovly.c. gdb/testsuite/ChangeLog: * gdb.base/d10vovly.c: Delete. * gdb.base/m32rovly.c: Delete. * gdb.base/ovlymgr.c: Remove all code guarded by __D10V__.
100 lines
2.5 KiB
C
100 lines
2.5 KiB
C
|
|
/*
|
|
* Ovlymgr.c -- Runtime Overlay Manager for the GDB testsuite.
|
|
*/
|
|
|
|
#include "ovlymgr.h"
|
|
|
|
/* Local functions and data: */
|
|
|
|
extern unsigned long _ovly_table[][4];
|
|
extern unsigned long _novlys __attribute__ ((section (".data")));
|
|
enum ovly_index { VMA, SIZE, LMA, MAPPED};
|
|
|
|
static void ovly_copy (unsigned long dst, unsigned long src, long size);
|
|
|
|
/* Flush the data and instruction caches at address START for SIZE bytes.
|
|
Support for each new port must be added here. */
|
|
/* FIXME: Might be better to have a standard libgloss function that
|
|
ports provide that we can then use. Use libgloss instead of newlib
|
|
since libgloss is the one intended to handle low level system issues.
|
|
I would suggest something like _flush_cache to avoid the user's namespace
|
|
but not be completely obscure as other things may need this facility. */
|
|
|
|
static void
|
|
FlushCache (void)
|
|
{
|
|
#ifdef __M32R__
|
|
volatile char *mspr = (char *) 0xfffffff7;
|
|
*mspr = 1;
|
|
#endif
|
|
}
|
|
|
|
/* _ovly_debug_event:
|
|
* Debuggers may set a breakpoint here, to be notified
|
|
* when the overlay table has been modified.
|
|
*/
|
|
static void
|
|
_ovly_debug_event (void)
|
|
{
|
|
}
|
|
|
|
/* OverlayLoad:
|
|
* Copy the overlay into its runtime region,
|
|
* and mark the overlay as "mapped".
|
|
*/
|
|
|
|
bool
|
|
OverlayLoad (unsigned long ovlyno)
|
|
{
|
|
unsigned long i;
|
|
|
|
if (ovlyno < 0 || ovlyno >= _novlys)
|
|
exit (-1); /* fail, bad ovly number */
|
|
|
|
if (_ovly_table[ovlyno][MAPPED])
|
|
return TRUE; /* this overlay already mapped -- nothing to do! */
|
|
|
|
for (i = 0; i < _novlys; i++)
|
|
if (i == ovlyno)
|
|
_ovly_table[i][MAPPED] = 1; /* this one now mapped */
|
|
else if (_ovly_table[i][VMA] == _ovly_table[ovlyno][VMA])
|
|
_ovly_table[i][MAPPED] = 0; /* this one now un-mapped */
|
|
|
|
ovly_copy (_ovly_table[ovlyno][VMA],
|
|
_ovly_table[ovlyno][LMA],
|
|
_ovly_table[ovlyno][SIZE]);
|
|
|
|
FlushCache ();
|
|
_ovly_debug_event ();
|
|
return TRUE;
|
|
}
|
|
|
|
/* OverlayUnload:
|
|
* Copy the overlay back into its "load" region.
|
|
* Does NOT mark overlay as "unmapped", therefore may be called
|
|
* more than once for the same mapped overlay.
|
|
*/
|
|
|
|
bool
|
|
OverlayUnload (unsigned long ovlyno)
|
|
{
|
|
if (ovlyno < 0 || ovlyno >= _novlys)
|
|
exit (-1); /* fail, bad ovly number */
|
|
|
|
if (!_ovly_table[ovlyno][MAPPED])
|
|
exit (-1); /* error, can't copy out a segment that's not "in" */
|
|
|
|
ovly_copy (_ovly_table[ovlyno][LMA],
|
|
_ovly_table[ovlyno][VMA],
|
|
_ovly_table[ovlyno][SIZE]);
|
|
|
|
_ovly_debug_event ();
|
|
return TRUE;
|
|
}
|
|
|
|
static void
|
|
ovly_copy (unsigned long dst, unsigned long src, long size)
|
|
{
|
|
memcpy ((void *) dst, (void *) src, size);
|
|
}
|