* sim/arm RedBoot meminfo syscall [PATCH]
@ 2005-12-17 22:46 Shaun Jackman
2006-01-23 2:01 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Shaun Jackman @ 2005-12-17 22:46 UTC (permalink / raw)
To: gdb-patches
This patch implements the RedBoot meminfo syscall. In addition, rather
than ignoring unhandled syscalls, it sets errno to ENOSYS and returns
-1. This makes it possible to run "Hello, world!" compiled using
newlib and a RedBoot libgloss.
Cheers,
Shaun
2005-12-14 Shaun Jackman <sjackman@gmail.com>
* sim/arm/armos.c (ARMul_OSHandleSWI): Handle the RedBoot system
call meminfo. Return ENOSYS for unhandled RedBoot syscalls.
Index: armos.c
===================================================================
RCS file: /cvs/src/src/sim/arm/armos.c,v
retrieving revision 1.23
diff -u -r1.23 armos.c
--- armos.c 17 Nov 2005 04:23:03 -0000 1.23
+++ armos.c 14 Dec 2005 18:36:19 -0000
@@ -859,9 +859,26 @@
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sim/arm RedBoot meminfo syscall [PATCH]
2005-12-17 22:46 sim/arm RedBoot meminfo syscall [PATCH] Shaun Jackman
@ 2006-01-23 2:01 ` Daniel Jacobowitz
2006-01-23 15:57 ` Richard Earnshaw
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2006-01-23 2:01 UTC (permalink / raw)
To: Shaun Jackman, Richard Earnshaw; +Cc: gdb-patches
On Wed, Dec 14, 2005 at 11:40:28AM -0700, Shaun Jackman wrote:
> This patch implements the RedBoot meminfo syscall. In addition, rather
> than ignoring unhandled syscalls, it sets errno to ENOSYS and returns
> -1. This makes it possible to run "Hello, world!" compiled using
> newlib and a RedBoot libgloss.
>
> Cheers,
> Shaun
>
> 2005-12-14 Shaun Jackman <sjackman@gmail.com>
>
> * sim/arm/armos.c (ARMul_OSHandleSWI): Handle the RedBoot system
> call meminfo. Return ENOSYS for unhandled RedBoot syscalls.
This looks totally plausible to me but I don't know much about it;
Richard, any opinion on it before I approve it?
>
> Index: armos.c
> ===================================================================
> RCS file: /cvs/src/src/sim/arm/armos.c,v
> retrieving revision 1.23
> diff -u -r1.23 armos.c
> --- armos.c 17 Nov 2005 04:23:03 -0000 1.23
> +++ armos.c 14 Dec 2005 18:36:19 -0000
> @@ -859,9 +859,26 @@
> 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
>
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sim/arm RedBoot meminfo syscall [PATCH]
2006-01-23 2:01 ` Daniel Jacobowitz
@ 2006-01-23 15:57 ` Richard Earnshaw
2006-01-23 16:03 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Richard Earnshaw @ 2006-01-23 15:57 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Shaun Jackman, gdb-patches
On Mon, 2006-01-23 at 02:01, Daniel Jacobowitz wrote:
> On Wed, Dec 14, 2005 at 11:40:28AM -0700, Shaun Jackman wrote:
> > This patch implements the RedBoot meminfo syscall. In addition, rather
> > than ignoring unhandled syscalls, it sets errno to ENOSYS and returns
> > -1. This makes it possible to run "Hello, world!" compiled using
> > newlib and a RedBoot libgloss.
> >
> > Cheers,
> > Shaun
> >
> > 2005-12-14 Shaun Jackman <sjackman@gmail.com>
> >
> > * sim/arm/armos.c (ARMul_OSHandleSWI): Handle the RedBoot system
> > call meminfo. Return ENOSYS for unhandled RedBoot syscalls.
>
> This looks totally plausible to me but I don't know much about it;
> Richard, any opinion on it before I approve it?
I've no objections. The SWI code has already been grabbed, so it
doesn't really extend the interface any further.
As a general principle, however, I'd be against adding more 'top-level'
swi codes without cleaning up the interface to this module so that you
can carefully select from the command line the set of SWIs in force.
R.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sim/arm RedBoot meminfo syscall [PATCH]
2006-01-23 15:57 ` Richard Earnshaw
@ 2006-01-23 16:03 ` Daniel Jacobowitz
2006-01-24 23:19 ` Shaun Jackman
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2006-01-23 16:03 UTC (permalink / raw)
To: Richard Earnshaw; +Cc: Shaun Jackman, gdb-patches
On Mon, Jan 23, 2006 at 03:56:27PM +0000, Richard Earnshaw wrote:
> On Mon, 2006-01-23 at 02:01, Daniel Jacobowitz wrote:
> > On Wed, Dec 14, 2005 at 11:40:28AM -0700, Shaun Jackman wrote:
> > > This patch implements the RedBoot meminfo syscall. In addition, rather
> > > than ignoring unhandled syscalls, it sets errno to ENOSYS and returns
> > > -1. This makes it possible to run "Hello, world!" compiled using
> > > newlib and a RedBoot libgloss.
> > >
> > > Cheers,
> > > Shaun
> > >
> > > 2005-12-14 Shaun Jackman <sjackman@gmail.com>
> > >
> > > * sim/arm/armos.c (ARMul_OSHandleSWI): Handle the RedBoot system
> > > call meminfo. Return ENOSYS for unhandled RedBoot syscalls.
> >
> > This looks totally plausible to me but I don't know much about it;
> > Richard, any opinion on it before I approve it?
> I've no objections. The SWI code has already been grabbed, so it
> doesn't really extend the interface any further.
>
> As a general principle, however, I'd be against adding more 'top-level'
> swi codes without cleaning up the interface to this module so that you
> can carefully select from the command line the set of SWIs in force.
Makes sense. Shaun, your patch is OK to commit.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sim/arm RedBoot meminfo syscall [PATCH]
2006-01-23 16:03 ` Daniel Jacobowitz
@ 2006-01-24 23:19 ` Shaun Jackman
2006-02-02 1:49 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Shaun Jackman @ 2006-01-24 23:19 UTC (permalink / raw)
To: Richard Earnshaw, Shaun Jackman, gdb-patches
On 1/23/06, Daniel Jacobowitz <drow@false.org> wrote:
> Makes sense. Shaun, your patch is OK to commit.
Great! Is the patch applied?
Cheers,
Shaun
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sim/arm RedBoot meminfo syscall [PATCH]
2006-01-24 23:19 ` Shaun Jackman
@ 2006-02-02 1:49 ` Daniel Jacobowitz
2006-02-02 13:49 ` Shaun Jackman
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2006-02-02 1:49 UTC (permalink / raw)
To: Shaun Jackman; +Cc: Richard Earnshaw, gdb-patches
On Tue, Jan 24, 2006 at 04:19:38PM -0700, Shaun Jackman wrote:
> On 1/23/06, Daniel Jacobowitz <drow@false.org> wrote:
> > Makes sense. Shaun, your patch is OK to commit.
>
> Great! Is the patch applied?
Sorry, I forgot that you didn't have write access. I've checked it in.
Small comment, since there's a changelog in sim/arm/, you don't need
sim/arm/ on front of the log entry.
If you'd like to have write access for the future, fill out the form on
sourceware.org (search for "handy dandy little form") and list me as
your approval.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sim/arm RedBoot meminfo syscall [PATCH]
2006-02-02 1:49 ` Daniel Jacobowitz
@ 2006-02-02 13:49 ` Shaun Jackman
0 siblings, 0 replies; 7+ messages in thread
From: Shaun Jackman @ 2006-02-02 13:49 UTC (permalink / raw)
To: gdb-patches
On 2/1/06, Daniel Jacobowitz <drow@false.org> wrote:
> Sorry, I forgot that you didn't have write access. I've checked it in.
> Small comment, since there's a changelog in sim/arm/, you don't need
> sim/arm/ on front of the log entry.
Thanks, Daniel.
> If you'd like to have write access for the future, fill out the form on
> sourceware.org (search for "handy dandy little form") and list me as
> your approval.
OK. Will do. I have a patch sitting around for some simple Linux
syscall support for sim/arm/armos.c. Perhaps I'll use that for my
first check in, after approval of course.
Cheers,
Shaun
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-02-02 13:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-17 22:46 sim/arm RedBoot meminfo syscall [PATCH] Shaun Jackman
2006-01-23 2:01 ` Daniel Jacobowitz
2006-01-23 15:57 ` Richard Earnshaw
2006-01-23 16:03 ` Daniel Jacobowitz
2006-01-24 23:19 ` Shaun Jackman
2006-02-02 1:49 ` Daniel Jacobowitz
2006-02-02 13:49 ` Shaun Jackman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox