ABI question, porting ports to amd64
Marco van de Voort
marcov at stack.nl
Mon May 17 07:54:01 PDT 2004
> > > Or, we'd declare the syscall prototypes with an explicit override
> > > of the register parameter assignments or something. (bad luck
> > > though if you neglect to use the right #includes for your code and
> > > miss out a prototype)
> >
> > I was always curious why the (basic) *nix syscalls weren't inlined?
> > Can't gcc do that?
>
> The errno handling is the sticky point. Error return is indicated by
> the 'carry' bit set in the flags register. At which point the return
> value of the syscall is copied to the 'errno' variable and the function
> returns -1.
Hmm, but the x86-64 can surely branch further than the size of procedure?
int bla()
{
...
...
syscall
jb .bla_cerror
..
..
}
.bla_cerror: jmp .cerror
?
More information about the freebsd-amd64
mailing list