mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-05 23:26:51 +08:00
configure.in: add -DTARGET_SKY for mips64r5900-sky-elf configure.
sim-main.h: Define regs for sky if -DTARGET_SKY interp.c: Initial register upload/download support for sky.
This commit is contained in:
@ -202,7 +202,7 @@ AC_SUBST(sim_gen)
|
|||||||
case "${target}" in
|
case "${target}" in
|
||||||
# start-sanitize-sky
|
# start-sanitize-sky
|
||||||
mips64r59*-sky-*) mips_extra_objs='$(SIM_SKY_OBJS)' ;
|
mips64r59*-sky-*) mips_extra_objs='$(SIM_SKY_OBJS)' ;
|
||||||
SIM_SUBTARGET="-DWITH_DEVICES=1 -DDEVICE_INIT=1";;
|
SIM_SUBTARGET="-DTARGET_SKY -DWITH_DEVICES=1 -DDEVICE_INIT=1";;
|
||||||
|
|
||||||
# end-sanitize-sky
|
# end-sanitize-sky
|
||||||
*) mips_extra_objs="" ;;
|
*) mips_extra_objs="" ;;
|
||||||
|
@ -255,13 +255,20 @@ interrupt_event (SIM_DESC sd, void *data)
|
|||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/*-- Device registration hook -----------------------------------------------*/
|
/*-- Device registration hook -----------------------------------------------*/
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
static device_init(SIM_DESC sd) {
|
static void device_init(SIM_DESC sd) {
|
||||||
#ifdef DEVICE_INIT
|
#ifdef DEVICE_INIT
|
||||||
extern void register_devices(SIM_DESC);
|
extern void register_devices(SIM_DESC);
|
||||||
register_devices(sd);
|
register_devices(sd);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* start-sanitize-sky */
|
||||||
|
static struct {
|
||||||
|
short i[16];
|
||||||
|
int f[NUM_VU_REGS - 16];
|
||||||
|
} vu_regs[2];
|
||||||
|
/* end-sanitize-sky */
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/*-- GDB simulator interface ------------------------------------------------*/
|
/*-- GDB simulator interface ------------------------------------------------*/
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
@ -369,6 +376,41 @@ sim_open (kind, cb, abfd, argv)
|
|||||||
for( rn = LAST_EMBED_REGNUM+1; rn < NUM_REGS; rn++)
|
for( rn = LAST_EMBED_REGNUM+1; rn < NUM_REGS; rn++)
|
||||||
cpu->register_widths[rn] = 64;
|
cpu->register_widths[rn] = 64;
|
||||||
/* end-sanitize-r5900 */
|
/* end-sanitize-r5900 */
|
||||||
|
|
||||||
|
/* start-sanitize-sky */
|
||||||
|
#ifdef TARGET_SKY
|
||||||
|
/* Now the VU registers */
|
||||||
|
for( rn = 0; rn < 16; rn++ ) { /* first the integer registers */
|
||||||
|
cpu->register_widths[rn + NUM_R5900_REGS] = 16;
|
||||||
|
cpu->register_widths[rn + NUM_R5900_REGS + NUM_VU_REGS] = 16;
|
||||||
|
|
||||||
|
/* Hack for now - to test gdb interface */
|
||||||
|
vu_regs[0].i[rn] = rn + 0x100;
|
||||||
|
vu_regs[1].i[rn] = rn + 0x200;
|
||||||
|
}
|
||||||
|
|
||||||
|
for( rn = 16; rn < NUM_VU_REGS; rn++ ) { /* then the FP registers */
|
||||||
|
float f;
|
||||||
|
|
||||||
|
cpu->register_widths[rn + NUM_R5900_REGS] = 32;
|
||||||
|
cpu->register_widths[rn + NUM_R5900_REGS + NUM_VU_REGS] = 32;
|
||||||
|
|
||||||
|
/* Hack for now - to test gdb interface */
|
||||||
|
if( rn < 24 ) {
|
||||||
|
f = rn - 16 + 100.0;
|
||||||
|
vu_regs[0].f[rn-16] = *((unsigned *) &f);
|
||||||
|
f = rn - 16 + 200.0;
|
||||||
|
vu_regs[1].f[rn-16] = *((unsigned *) &f);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
f = (rn - 24)/4 + (rn - 24)%4 + 1000.0;
|
||||||
|
vu_regs[0].f[rn-16] = *((unsigned *) &f);
|
||||||
|
f = (rn - 24)/4 + (rn - 24)%4 + 2000.0;
|
||||||
|
vu_regs[1].f[rn-16] = *((unsigned *) &f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/* end-sanitize-sky */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(TRACE)
|
#if defined(TRACE)
|
||||||
@ -561,6 +603,28 @@ sim_store_register (sd,rn,memory)
|
|||||||
|
|
||||||
if (cpu->register_widths[rn] == 0)
|
if (cpu->register_widths[rn] == 0)
|
||||||
sim_io_eprintf(sd,"Invalid register width for %d (register store ignored)\n",rn);
|
sim_io_eprintf(sd,"Invalid register width for %d (register store ignored)\n",rn);
|
||||||
|
/* start-sanitize-sky */
|
||||||
|
#ifdef TARGET_SKY
|
||||||
|
else if( rn > NUM_R5900_REGS ) {
|
||||||
|
rn = rn - NUM_R5900_REGS;
|
||||||
|
|
||||||
|
if( rn < 16 )
|
||||||
|
vu_regs[0].i[rn] = T2H_2( *(unsigned short *) memory );
|
||||||
|
else if( rn < NUM_VU_REGS )
|
||||||
|
vu_regs[0].f[rn - 16] = T2H_4( *(unsigned int *) memory );
|
||||||
|
else {
|
||||||
|
rn = rn - NUM_VU_REGS;
|
||||||
|
|
||||||
|
if( rn < 16 )
|
||||||
|
vu_regs[1].i[rn] = T2H_2( *(unsigned short *) memory );
|
||||||
|
else if( rn < NUM_VU_REGS )
|
||||||
|
vu_regs[1].f[rn - 16] = T2H_4( *(unsigned int *) memory );
|
||||||
|
else
|
||||||
|
sim_io_eprintf( sd, "Invalid VU register (register store ignored)\n" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/* end-sanitize-sky */
|
||||||
/* start-sanitize-r5900 */
|
/* start-sanitize-r5900 */
|
||||||
else if (rn == REGISTER_SA)
|
else if (rn == REGISTER_SA)
|
||||||
SA = T2H_8(*(unsigned64*)memory);
|
SA = T2H_8(*(unsigned64*)memory);
|
||||||
@ -597,6 +661,28 @@ sim_fetch_register (sd,rn,memory)
|
|||||||
|
|
||||||
if (cpu->register_widths[rn] == 0)
|
if (cpu->register_widths[rn] == 0)
|
||||||
sim_io_eprintf(sd,"Invalid register width for %d (register fetch ignored)\n",rn);
|
sim_io_eprintf(sd,"Invalid register width for %d (register fetch ignored)\n",rn);
|
||||||
|
/* start-sanitize-sky */
|
||||||
|
#ifdef TARGET_SKY
|
||||||
|
else if( rn > NUM_R5900_REGS ) {
|
||||||
|
rn = rn - NUM_R5900_REGS;
|
||||||
|
|
||||||
|
if( rn < 16 )
|
||||||
|
*((unsigned short *) memory) = H2T_2( vu_regs[0].i[rn] );
|
||||||
|
else if( rn < NUM_VU_REGS )
|
||||||
|
*((unsigned int *) memory) = H2T_4( vu_regs[0].f[rn - 16] );
|
||||||
|
else {
|
||||||
|
rn = rn - NUM_VU_REGS;
|
||||||
|
|
||||||
|
if( rn < 16 )
|
||||||
|
(*(unsigned short *) memory) = H2T_2( vu_regs[1].i[rn] );
|
||||||
|
else if( rn < NUM_VU_REGS )
|
||||||
|
(*(unsigned int *) memory) = H2T_4( vu_regs[1].f[rn - 16] );
|
||||||
|
else
|
||||||
|
sim_io_eprintf( sd, "Invalid VU register (register fetch ignored)\n" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/* end-sanitize-sky */
|
||||||
/* start-sanitize-r5900 */
|
/* start-sanitize-r5900 */
|
||||||
else if (rn == REGISTER_SA)
|
else if (rn == REGISTER_SA)
|
||||||
*((unsigned64*)memory) = H2T_8(SA);
|
*((unsigned64*)memory) = H2T_8(SA);
|
||||||
|
Reference in New Issue
Block a user