aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2002-05-09 10:29:08 +0000
committerNick Clifton <nickc@redhat.com>2002-05-09 10:29:08 +0000
commitace4f296f5117c6ebd23e95191c6c1f11203a153 (patch)
tree31e19582f23cfa16698b1b7d6a0fef45a4ac1971
parentd8512e6afd44188f82f21ce5d997e2374763d47c (diff)
downloadgdb-ace4f296f5117c6ebd23e95191c6c1f11203a153.zip
gdb-ace4f296f5117c6ebd23e95191c6c1f11203a153.tar.gz
gdb-ace4f296f5117c6ebd23e95191c6c1f11203a153.tar.bz2
Uses sim callback interface for system calls in RedBoot SWI support.
-rw-r--r--sim/arm/armos.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sim/arm/armos.c b/sim/arm/armos.c
index bdc53d4..d833665 100644
--- a/sim/arm/armos.c
+++ b/sim/arm/armos.c
@@ -171,7 +171,8 @@ ARMul_OSInit (ARMul_State * state)
instr = 0xe59ff000 | (ADDRSOFTVECTORS - 8); /* Load pc from soft vector */
for (i = ARMul_ResetV; i <= ARMFIQV; i += 4)
- ARMul_WriteWord (state, i, instr); /* Write hardware vectors. */
+ /* Write hardware vectors. */
+ ARMul_WriteWord (state, i, instr);
SWI_vector_installed = 0;
@@ -658,8 +659,8 @@ ARMul_OSHandleSWI (ARMul_State * state, ARMword number)
return TRUE;
case 3: /* Close. */
- state->Reg[0] = close (state->Reg[1]);
- OSptr->ErrorNo = errno;
+ state->Reg[0] = sim_callback->close (sim_callback, state->Reg[1]);
+ OSptr->ErrorNo = sim_callback->get_errno (sim_callback);
return TRUE;
case 4: /* Read. */
@@ -671,14 +672,18 @@ ARMul_OSHandleSWI (ARMul_State * state, ARMword number)
return TRUE;
case 6: /* Lseek. */
- state->Reg[0] = lseek (state->Reg[1], state->Reg[2], state->Reg[3]);
- OSptr->ErrorNo = errno;
+ state->Reg[0] = sim_callback->lseek (sim_callback,
+ state->Reg[1],
+ state->Reg[2],
+ state->Reg[3]);
+ OSptr->ErrorNo = sim_callback->get_errno (sim_callback);
return TRUE;
case 17: /* Utime. */
- state->Reg[0] = (ARMword) time (state->Reg[1]);
- OSptr->ErrorNo = errno;
- return (TRUE);
+ state->Reg[0] = (ARMword) sim_callback->time (sim_callback,
+ (long *) state->Reg[1]);
+ OSptr->ErrorNo = sim_callback->get_errno (sim_callback);
+ return TRUE;
case 7: /* Unlink. */
case 8: /* Getpid. */