Hi,
Got a query regarding the definition between architectures of pt_regs.
Under Intel I get the ebx, ecx, edx variables declared in the pt_regs
structure found in asm/ptrace.h. However, under Sparc they are not
there. Am I attempting to do Intel only things on a Sparc by using the
wrong do_execve()?
Thanks in advance,
Chris
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <asm/ptrace.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
int (*o_execve)(struct pt_regs regs);
extern void *sys_call_table[];
asmlinkage int n_execve(struct pt_regs regs) {
do_execve(getname((char *)regs.ebx), (char **)regs.ecx, (char
**)regs.edx, ®s);
return(0);
}
int init_module(void) {
o_execve = sys_call_table[__NR_execve];
sys_call_table[__NR_execve] = n_execve;
return(0);
}
void cleanup_module(void) {
sys_call_table[__NR_execve] = o_execve;
}
Attachment:
smime.p7s
Description: S/MIME cryptographic signature