Re: [PATCH] arch: avr32: add dummy syscalls

From: Hans-Christian Egtvedt
Date: Sun Jan 27 2013 - 15:40:05 EST


Around Sun 27 Jan 2013 20:30:09 +0000 or thereabout, Al Viro wrote:
> On Sun, Jan 27, 2013 at 08:57:14PM +0100, Hans-Christian Egtvedt wrote:
>> Around Sun 27 Jan 2013 13:50:15 +0100 or thereabout, Matthias Brugger wrote:
>> > This patch adds dummy syscalls so that compiling
>> > for this architecture does not provoke warnings when
>> > checksyscalls.sh is called.
>>
>> Does any of these syscalls take more than 5 arguments? If so, it is also
>> needed to do some stack handling. I would rather not add syscalls that cause
>> the kernel to misbehave.
>
> BTW, it might make sense to teach SYSCALL_DEFINE6 to generate such a wrapper
> on avr32. How about something along the lines of
> * SYSCALL_DEFINE6(foo, ...) generating (via asm volatile, right next to
> sys_foo())
> __sys_##foo:
> pushm lr
> st.w --sp, r3
> call sys_##foo
> sub sp, -4
> popm pc
> * SYSCALL_DEFINE[0..5](foo, ...) generating
> SYSCALL_ALIAS(__sys_foo, sys_foo)
> * syscall_table.S beginning with
> .section .rodata,"a",@progbits
> .type sys_call_table,@object
> .global sys_call_table
> .align 2
> #define SYS(name) __sys_##name
> sys_call_table:
> SYS(restart_syscall)
> SYS(exit)
> SYS(fork)
> ...
>
> If you are OK with going that way, I could probably put together patches doing
> just that. Note that for rt_sigsuspend/rt_sigreturn/sigaltstack the wrappers
> are not needed at all - they can just use current_pt_regs() in syscall body.
> IOW, all of syscall-stubs.S could be killed.

Nice, could you put together the preprocessor stuff in a patch? It would be
great to not having to write a re-occuring stub for each syscall that has 6+
arguments.

Thanks for looking at this.

--
mvh
Hans-Christian Egtvedt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/