diff options
author | Daniel Jacobowitz <drow@false.org> | 2006-02-02 01:48:16 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2006-02-02 01:48:16 +0000 |
commit | eeea466063f288e4ee96c7a0b94772a22b73ad79 (patch) | |
tree | 1c38b708498682d569274d433db68774fb04e597 /sim/arm/armos.c | |
parent | 9c703ebff4e646a77e62f7af68c190a063c7496a (diff) | |
download | gdb-eeea466063f288e4ee96c7a0b94772a22b73ad79.zip gdb-eeea466063f288e4ee96c7a0b94772a22b73ad79.tar.gz gdb-eeea466063f288e4ee96c7a0b94772a22b73ad79.tar.bz2 |
* armos.c (ARMul_OSHandleSWI): Handle the RedBoot system
call meminfo. Return ENOSYS for unhandled RedBoot syscalls.
Diffstat (limited to 'sim/arm/armos.c')
-rw-r--r-- | sim/arm/armos.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sim/arm/armos.c b/sim/arm/armos.c index 5f5ead7..8e346c7 100644 --- a/sim/arm/armos.c +++ b/sim/arm/armos.c @@ -859,9 +859,26 @@ ARMul_OSHandleSWI (ARMul_State * state, ARMword number) case 18: /* Time. */ sim_callback->printf_filtered (sim_callback, - "sim: unhandled RedBoot syscall '%d' encountered - ignoring\n", + "sim: unhandled RedBoot syscall `%d' encountered - " + "returning ENOSYS\n", state->Reg[0]); - return FALSE; + state->Reg[0] = -1; + OSptr->ErrorNo = cb_host_to_target_errno + (sim_callback, ENOSYS); + break; + case 1001: /* Meminfo. */ + { + ARMword totmem = state->Reg[1], + topmem = state->Reg[2]; + ARMword stack = state->MemSize > 0 + ? state->MemSize : ADDRUSERSTACK; + if (totmem != 0) + ARMul_WriteWord (state, totmem, stack); + if (topmem != 0) + ARMul_WriteWord (state, topmem, stack); + state->Reg[0] = 0; + break; + } default: sim_callback->printf_filtered |