hOn Fri, 3 Sep 1999, Paul Koning wrote:

> >>>>> "Philip" == Philip Blundell <[EMAIL PROTECTED]> writes:
> 
>  >> 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.
> 
>  Philip> I don't quite understand what you're trying to do.  Are you
>  Philip> saying you want to arrange for certain functions to have a
>  Philip> non-standard calling sequence where all regs are clobbered
>  Philip> and a greater than usual number are used for args and return
>  Philip> values?
> 
>  Philip> If so, this isn't possible without some hacking of the
>  Philip> compiler. 
> 
> Couldn't you do it with the extended form of the asm statement that
> GCC supports?  That gives a whole lot of control over how parameters
> are passed in and out of the asm block.  If the asm block in turn is a 
> function call (or syscall) instruction, that may do the job.
>
        This would be fine but how do you make the function call without
saving registers? Ideally we would associate all registers used with
variables then write the syscall in C. The probablem is the calling
standard will save register which are scratch anyway which represends
wasted cycles. There isn't much point of register only arguments if they
have to be stacked to call C from the asm exception entry point.
        I noticed that the SWI handler in linux has a comment saying still
have a problem with >4 argument functions. hat is this refering too?
Syscall functions? Also isn't checking the SWI constant expensive? You
pollute your data cache with code, why check this when the syscall number
is in a register?

        Cheers Adam

unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]

Reply via email to