diff options
author | Daniel Jacobowitz <dan@debian.org> | 2006-02-02 01:48:16 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2006-02-02 01:48:16 +0000 |
commit | 45cb2089ef8fe9385914831cfcfc8a800e6f3449 (patch) | |
tree | ebeb4e5624bd8541ed54a4297dbe447645090905 /sim/arm | |
parent | 07495811ddc33260ab4b0461c9071c27957c5564 (diff) | |
download | gdb-45cb2089ef8fe9385914831cfcfc8a800e6f3449.tar.gz |
* armos.c (ARMul_OSHandleSWI): Handle the RedBoot system
call meminfo. Return ENOSYS for unhandled RedBoot syscalls.
Diffstat (limited to 'sim/arm')
-rw-r--r-- | sim/arm/ChangeLog | 7 | ||||
-rw-r--r-- | sim/arm/armos.c | 21 |
2 files changed, 25 insertions, 3 deletions
diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index 84bdf6ecf65..df88ef1c42a 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,8 @@ +2006-02-01 Shaun Jackman <sjackman@gmail.com> + + * armos.c (ARMul_OSHandleSWI): Handle the RedBoot system + call meminfo. Return ENOSYS for unhandled RedBoot syscalls. + 2005-11-23 Mark Mitchell <mark@codesourcery.com> * wrapper.c (gdb/signals.h): Include it. @@ -7,7 +12,7 @@ 2005-11-16 Shaun Jackman <sjackman@gmail.com> - * sim/arm/armos.c: Include limits.h + * armos.c: Include limits.h (unlink): Remove this macro. It is unused in this file and conflicts with sim_callback->unlink. (PATH_MAX): Define as 1024 if not already defined. diff --git a/sim/arm/armos.c b/sim/arm/armos.c index 5f5ead7e640..8e346c73784 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 |