2007-09-05 08:40:50

by Jaswinder Singh

[permalink] [raw]
Subject: _syscall0 exists or obsolete in 2.6

Hello all,

I am trying to add syscall in include/asm/unistd.h:

static inline _syscall0(int,my_sys_call);

But I am getting following errors :

AS arch/arm/kernel/entry-common.o
include/asm/unistd.h: Assembler messages:
include/asm/unistd.h:622: Error: bad instruction `static inline int
my_sys_call(void){register long __res_r0 __asm__("r0")'
include/asm/unistd.h:622: Error: bad instruction `long __res'
include/asm/unistd.h:622: Error: bad instruction `__asm__
__volatile__("swi\t""(0x900000+322)""":"=r"(__res_r0)::"memory")'
include/asm/unistd.h:622: Error: bad instruction `do {if((unsigned
long)(__res)>=(unsigned long)(-129)){errno=-(__res)'
include/asm/unistd.h:622: Error: junk at end of line, first
unrecognized character is `}'
include/asm/unistd.h:622: Error: junk at end of line, first
unrecognized character is `}'
include/asm/unistd.h:622: Error: junk at end of line, first
unrecognized character is `}'
make[1]: *** [arch/arm/kernel/entry-common.o] Error 1
make: *** [arch/arm/kernel] Error 2


This was working in older versions.

I am curious _syscall0 still exists or obsolete in 2.6 linux.

And I have noticed even if I commented _syscall0 macro, I do not get
any errors so no body is using it , then why _syscall0 is in kernel
header files and what is the substitute of _syscall0.

Thanks for help,

Jaswinder Singh.


2007-09-05 09:18:30

by Miguel Ojeda

[permalink] [raw]
Subject: Re: _syscall0 exists or obsolete in 2.6

On 9/5/07, Jaswinder Singh <[email protected]> wrote:
> Hello all,
>
> I am trying to add syscall in include/asm/unistd.h:

Which platform?

>
> static inline _syscall0(int,my_sys_call);
>
> But I am getting following errors :
>
> AS arch/arm/kernel/entry-common.o

Assuming arm, I don't see that include/asm-arm/unistd.h has 622 lines.

> include/asm/unistd.h: Assembler messages:
> include/asm/unistd.h:622: Error: bad instruction `static inline int
> my_sys_call(void){register long __res_r0 __asm__("r0")'
> include/asm/unistd.h:622: Error: bad instruction `long __res'
> include/asm/unistd.h:622: Error: bad instruction `__asm__
> __volatile__("swi\t""(0x900000+322)""":"=r"(__res_r0)::"memory")'
> include/asm/unistd.h:622: Error: bad instruction `do {if((unsigned
> long)(__res)>=(unsigned long)(-129)){errno=-(__res)'
> include/asm/unistd.h:622: Error: junk at end of line, first
> unrecognized character is `}'
> include/asm/unistd.h:622: Error: junk at end of line, first
> unrecognized character is `}'
> include/asm/unistd.h:622: Error: junk at end of line, first
> unrecognized character is `}'
> make[1]: *** [arch/arm/kernel/entry-common.o] Error 1
> make: *** [arch/arm/kernel] Error 2
>
>
> This was working in older versions.
>
> I am curious _syscall0 still exists or obsolete in 2.6 linux.
>
> And I have noticed even if I commented _syscall0 macro, I do not get
> any errors so no body is using it , then why _syscall0 is in kernel
> header files and what is the substitute of _syscall0.

Well, if you look at

http://lxr.linux.no/ident?i=_syscall0

it seems it is pretty obsolete.

--
Miguel Ojeda
http://maxextreme.googlepages.com/index.htm