On Fri, 3 Sep 1999, Philip Blundell wrote:
> > Its probably not the best way of going about things but I'm
> >participating in a C implimentation of a micro-kernel who's syscalls in
> >general have more then 4 arguments and return more then one. Its important
> >to avoid copying. The ABI defines which registers are what and that all
> >registers less the user SP are undefined after the syscall except where
> >they are allocated for results from the syscall.
>
> I don't quite understand what you're trying to do. Are you saying you want to
> arrange for certain functions to have a non-standard calling sequence where
> all regs are clobbered and a greater than usual number are used for args and
> return values?
Yes, For example the IPC system call only leaves the user stack
pointer untouched all other registers are IPC arguments and most are
return values. Since the kernel being implimentated here is in C it seems
you have to have a fair bit of messy inline asm and something like a
no-return attribute to avoid the function call saving and restoring the
saved registers of the calling convention.
>
> If so, this isn't possible without some hacking of the compiler. It wouldn't
> be especially hard to add a new configuration with these quirks though. Under
> Linux the compiler doesn't know anything at all about syscalls and the C
> library does all the necessary magic.
for user space or inside the kernel?
>
> If you can explain what the exact mechanism for syscalls under your kernel is,
> that would probably help.
Syscalls are register only arguments and return values. Inline
ASM is used to call them from user code. The heaviest syscal (ipc) uses
all registers as arguments and return values less the user SP. Usually the
kernel is implimented totally in assembly so there is no problem. Since
this is a research implimentation its written in a high level language and
the calling standard is getting in the way a bit.
How does linux impliment its system calls?
Cheers Adam > > p. >
>
> unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]
>
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]