2003-11-10 15:36:38

by Chris Friesen

[permalink] [raw]
Subject: syscall numbers larger than 255?


Just a quick and simple question for someone that knows the answer.

Stock 2.4.20 for i386 uses syscalls up to 252. I want to add about a
half-dozen new syscalls (forward porting stuff that we've got on 2.4.18).

Does x86 support syscall numbers > 255? If yes, do I have to do
anything special to use them? If not, what are my options?

Thanks,

Chris

--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: [email protected]


2003-11-10 15:57:08

by Richard B. Johnson

[permalink] [raw]
Subject: Re: syscall numbers larger than 255?

On Mon, 10 Nov 2003, Chris Friesen wrote:

>
> Just a quick and simple question for someone that knows the answer.
>
> Stock 2.4.20 for i386 uses syscalls up to 252. I want to add about a
> half-dozen new syscalls (forward porting stuff that we've got on 2.4.18).
>
> Does x86 support syscall numbers > 255? If yes, do I have to do
> anything special to use them? If not, what are my options?
>
> Thanks,
>
> Chris

Sure. With the old int 0x80 calling convention, the syscall number
is just put into the EAX register which can contain 32 bits. There
may be some mask on the kernel side to limit 'damage', but you
can change this if you are adding system-calls. The newer calling
convention also has just the 32 bit limitation.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.


2003-11-10 16:36:20

by Davide Libenzi

[permalink] [raw]
Subject: Re: syscall numbers larger than 255?

On Mon, 10 Nov 2003, Chris Friesen wrote:

>
> Just a quick and simple question for someone that knows the answer.
>
> Stock 2.4.20 for i386 uses syscalls up to 252. I want to add about a
> half-dozen new syscalls (forward porting stuff that we've got on 2.4.18).
>
> Does x86 support syscall numbers > 255? If yes, do I have to do
> anything special to use them? If not, what are my options?

Currently there's a discrepancy between include/asm-i386/unistd.h and
arch/i386/kernel/entry.S. While the first define function numbers up to
252, the entry.S file fill up the table up to 258 (epoll crosses the 255
boundary :).



- Davide


2003-11-18 13:48:47

by Andi Kleen

[permalink] [raw]
Subject: Re: syscall numbers larger than 255?

Chris Friesen <[email protected]> writes:

> Just a quick and simple question for someone that knows the answer.
>
> Stock 2.4.20 for i386 uses syscalls up to 252. I want to add about a
> half-dozen new syscalls (forward porting stuff that we've got on
> 2.4.18).
>
> Does x86 support syscall numbers > 255? If yes, do I have to do
> anything special to use them? If not, what are my options?

They should work fine on x86.

-Andi