All of lore.kernel.org
 help / color / mirror / Atom feed
* syscall macro fails upon compilation
@ 2007-07-05 22:09 Gautam Singaraju
  2007-07-05 22:13 ` H. Peter Anvin
  2007-07-05 22:17 ` Davide Libenzi
  0 siblings, 2 replies; 9+ messages in thread
From: Gautam Singaraju @ 2007-07-05 22:09 UTC (permalink / raw)
  To: linux-kernel

I have been adding a syscall to the kernel (v 2.6.21); I am able to
compile and boot into the kernel. However, the userspace macro fails
to compile with the following message: "error: expected declaration
specifiers or â...â before âmycallâ". I could not find any solution
using google. I use the _syscall0 macro. Any suggestion would help.
Thanks!
---
Gautam Singaraju

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: syscall macro fails upon compilation
  2007-07-05 22:09 syscall macro fails upon compilation Gautam Singaraju
@ 2007-07-05 22:13 ` H. Peter Anvin
  2007-07-06 11:53   ` Andi Kleen
  2007-07-05 22:17 ` Davide Libenzi
  1 sibling, 1 reply; 9+ messages in thread
From: H. Peter Anvin @ 2007-07-05 22:13 UTC (permalink / raw)
  To: Gautam Singaraju; +Cc: linux-kernel

Gautam Singaraju wrote:
> I use the _syscall0 macro.

Don't.  The _syscall*() macros have been unsupported for ages, and
broken for ever longer.

	-hpa

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: syscall macro fails upon compilation
  2007-07-05 22:09 syscall macro fails upon compilation Gautam Singaraju
  2007-07-05 22:13 ` H. Peter Anvin
@ 2007-07-05 22:17 ` Davide Libenzi
  1 sibling, 0 replies; 9+ messages in thread
From: Davide Libenzi @ 2007-07-05 22:17 UTC (permalink / raw)
  To: Gautam Singaraju; +Cc: linux-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 444 bytes --]

On Thu, 5 Jul 2007, Gautam Singaraju wrote:

> I have been adding a syscall to the kernel (v 2.6.21); I am able to
> compile and boot into the kernel. However, the userspace macro fails
> to compile with the following message: "error: expected declaration
> specifiers or â...â before âmycallâ". I could not find any solution
> using google. I use the _syscall0 macro. Any suggestion would help.

Try a `man syscall`



- Davide


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: syscall macro fails upon compilation
  2007-07-05 22:13 ` H. Peter Anvin
@ 2007-07-06 11:53   ` Andi Kleen
  2007-07-06 15:55     ` Gautam Singaraju
  2007-07-06 16:11     ` H. Peter Anvin
  0 siblings, 2 replies; 9+ messages in thread
From: Andi Kleen @ 2007-07-06 11:53 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Gautam Singaraju, linux-kernel

"H. Peter Anvin" <hpa@zytor.com> writes:

> Gautam Singaraju wrote:
> > I use the _syscall0 macro.
> 
> Don't.  The _syscall*() macros have been unsupported for ages,

That's not true. I supported them on x86 before they were removed against
my objections.

> and broken for ever longer.

Well, most syscall() versions get 6 argument calls wrong
(not sure if that is finally fixed). _syscall*() didn't support
-fPIC for larger argument counts (_syscall0-2 never had a problem) 

So all alternatives short of writing your own stub had various
issues. If you needed 6 argument calls _syscall* was typically
the best alternative.

-Andi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: syscall macro fails upon compilation
  2007-07-06 11:53   ` Andi Kleen
@ 2007-07-06 15:55     ` Gautam Singaraju
  2007-07-06 16:12       ` H. Peter Anvin
  2007-07-06 16:11     ` H. Peter Anvin
  1 sibling, 1 reply; 9+ messages in thread
From: Gautam Singaraju @ 2007-07-06 15:55 UTC (permalink / raw)
  To: Andi Kleen; +Cc: H. Peter Anvin, linux-kernel

I am surprised that syscalls have been removed. Anyway, I plan to
write a device node with read and write functions just so that I can
call a method from a user space. What are my other choices?
--
Gautam

On 06 Jul 2007 13:53:41 +0200, Andi Kleen <andi@firstfloor.org> wrote:
> "H. Peter Anvin" <hpa@zytor.com> writes:
>
> > Gautam Singaraju wrote:
> > > I use the _syscall0 macro.
> >
> > Don't.  The _syscall*() macros have been unsupported for ages,
>
> That's not true. I supported them on x86 before they were removed against
> my objections.
>
> > and broken for ever longer.
>
> Well, most syscall() versions get 6 argument calls wrong
> (not sure if that is finally fixed). _syscall*() didn't support
> -fPIC for larger argument counts (_syscall0-2 never had a problem)
>
> So all alternatives short of writing your own stub had various
> issues. If you needed 6 argument calls _syscall* was typically
> the best alternative.
>
> -Andi
>


-- 
---
Gautam

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: syscall macro fails upon compilation
  2007-07-06 11:53   ` Andi Kleen
  2007-07-06 15:55     ` Gautam Singaraju
@ 2007-07-06 16:11     ` H. Peter Anvin
  2007-07-06 17:05       ` Andi Kleen
  1 sibling, 1 reply; 9+ messages in thread
From: H. Peter Anvin @ 2007-07-06 16:11 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Gautam Singaraju, linux-kernel

Andi Kleen wrote:
> "H. Peter Anvin" <hpa@zytor.com> writes:
> 
>> Gautam Singaraju wrote:
>>> I use the _syscall0 macro.
>> Don't.  The _syscall*() macros have been unsupported for ages,
> 
> That's not true. I supported them on x86 before they were removed against
> my objections.
> 
>> and broken for ever longer.
> 
> Well, most syscall() versions get 6 argument calls wrong
> (not sure if that is finally fixed). _syscall*() didn't support
> -fPIC for larger argument counts (_syscall0-2 never had a problem) 
> 
> So all alternatives short of writing your own stub had various
> issues. If you needed 6 argument calls _syscall* was typically
> the best alternative.
> 

They were *always* broken for 64-bit arguments on 32-bit machines, however.

	-hpa

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: syscall macro fails upon compilation
  2007-07-06 15:55     ` Gautam Singaraju
@ 2007-07-06 16:12       ` H. Peter Anvin
  0 siblings, 0 replies; 9+ messages in thread
From: H. Peter Anvin @ 2007-07-06 16:12 UTC (permalink / raw)
  To: Gautam Singaraju; +Cc: Andi Kleen, linux-kernel

Gautam Singaraju wrote:
> I am surprised that syscalls have been removed. Anyway, I plan to
> write a device node with read and write functions just so that I can
> call a method from a user space. What are my other choices?

man syscall

	-hpa

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: syscall macro fails upon compilation
  2007-07-06 16:11     ` H. Peter Anvin
@ 2007-07-06 17:05       ` Andi Kleen
  2007-07-06 17:19         ` H. Peter Anvin
  0 siblings, 1 reply; 9+ messages in thread
From: Andi Kleen @ 2007-07-06 17:05 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Andi Kleen, Gautam Singaraju, linux-kernel

> They were *always* broken for 64-bit arguments on 32-bit machines, however.

Well syscall() doesn't support that at all (unless you split by hand)

-Andi

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: syscall macro fails upon compilation
  2007-07-06 17:05       ` Andi Kleen
@ 2007-07-06 17:19         ` H. Peter Anvin
  0 siblings, 0 replies; 9+ messages in thread
From: H. Peter Anvin @ 2007-07-06 17:19 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Gautam Singaraju, linux-kernel

Andi Kleen wrote:
>> They were *always* broken for 64-bit arguments on 32-bit machines, however.
> 
> Well syscall() doesn't support that at all (unless you split by hand)
> 

On i386 it just happens to work, because the calling convention is
equivalent.  On some other 32-bit platforms it works that way as well;
on others, it fails.

To do it right you need a proper assembly stub generator.

	-hpa


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-07-06 17:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-05 22:09 syscall macro fails upon compilation Gautam Singaraju
2007-07-05 22:13 ` H. Peter Anvin
2007-07-06 11:53   ` Andi Kleen
2007-07-06 15:55     ` Gautam Singaraju
2007-07-06 16:12       ` H. Peter Anvin
2007-07-06 16:11     ` H. Peter Anvin
2007-07-06 17:05       ` Andi Kleen
2007-07-06 17:19         ` H. Peter Anvin
2007-07-05 22:17 ` Davide Libenzi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.