Greetings,

I am running 2.2.10-rmk2-stk1 on an ebsa-285 like board.  I have
implemented my own system call which reads out some data stored in the
kernel, or lets the user change this data depending on what arguments
they pass in.  It takes 4 arguments:

asmlinkage int sys_vend_param(void *old, size_t *oldlen,
                                void *new, size_t newlen)

What I've found is that if I set it up this way, and call the system
call using syscall() as follows:

---
#define OS_VERSION      9
#define VP_SYSCALL      (191 ^ (OS_VERSION << 20))

struct vend_params my_vp;
size_t my_vp_size = sizeof(struct vend_params);

if ((i = syscall(VP_SYSCALL, &my_vp, &my_vp_size, 0, 0)) < 0)
---

what appears to happen is that the first argument passed to my system
call is actually VP_SYSCALL.  I don't think this is right.  But, looking
at the wrapper for sys_syscall in entry-common.S, I saw the following:

@ r0 = syscall number
@ r5 = syscall table
SYMBOL_NAME(sys_syscall):
        eor     r6, r0, #OS_NUMBER << 20
        cmp     r6, #NR_syscalls        @ check range
        ldmleib sp, {r0 - r4}           @ get our args
        strle   r4, [sp]                @ Put our arg on the stack
        ldrle   pc, [r5, r6, lsl #2]
        mov     r0, #-ENOSYS
        mov     pc, lr

It looks like it actually pushes all 5 arguments passed to it onto the
stack, and thus the reason for the syscall number being the first
argument to my sys_vend_param() function.  If I put a dummy int as the
first argument to my sys_vend_param() routine, things seem to work fine.

Is this expected behaviour?

--
Kyle Mestery                    | StorageTek's Storage Networking Group
[EMAIL PROTECTED]                | http://www.freebsd.org/
[EMAIL PROTECTED]           | http://www.netwinder.org/
        Protect your right to privacy: www.freecrypto.org


unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]

Reply via email to