On Wed, Jul 16, 2008 at 11:57 PM, Asim <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I suspect this may be because it is using the fast call calling
> convention calling the function in the driver. (I'm using this to call
> functions in the driver). But I dont see any fastcall decleration in
> the kernel code (I'm using it to call get_stats for a network driver
> for example). Can anyone help me here?
>
correct me please, are u intending to write assembly for 64 or 32 bit
CPU (intel or AMD does not matter)?
Your previous post on PAGE_NX implied 64bit, but here below the
assembly is for 32 bit.
In userspace, if u have 32bit packages on the 64bit kernel, u can
still execute and run 32bit applications.
But not in kernel, as all must be the same bit size.
> Below is the code for intel machines. it is for calling a function
> using arguments for the stack. Any obvious mistakes for an AMD
> machine. Is there any recourse for me for calling kernel driver
> functions? Please help.
>
> #define FUNCTONCALL(f, n, r) \
> asm ( \
> "movl %0, %%eax\n" \
> "subl %%eax, %%esp\n" \
> "pushl %%esi\n" \
> "pushl %%edi\n" \
> "movl %%esp, %%edi\n" \
> "movl %%ebp, %%esi\n" \
> "addl $8, %%edi\n" \
> "addl $8, %%esi\n" \
> "shr $2, %%eax\n" \
> "movl %%eax, %%ecx\n" \
> "repz movsd\n" \
> "popl %%edi\n" \
> "popl %%esi\n" \
> : : "r" (n*4) : "esi","edi","eax","ecx","esp" ); \
> r ( (int (*)(void)) f)(); \
> asm ("addl %0, %%esp\n" : : "r" (n*4))
>
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ