assert(strncmp(ELFMAG, ehdr->e_ident, sizeof(ELFMAG)-1) == 0);
printk("Elf Entry: %08x\n", ehdr->e_entry);
-
-
int i, j;
for(i=0; i<ehdr->e_phnum; ++i)
{
}
}
+
load_cr3(current);
disable_irq();
#endif
regs->eip = (unsigned long)ehdr->e_entry;
regs->edx = regs->eip;
- regs->ecx = (0xC0000000 - 16);
+ regs->ecx = KRNLADDR; //(0xC0000000 - 16);
//kfree(buf);
asm("movl %%cr2,%%eax":"=a"(addr));
- printk("do page fault errcode %x addr %08x [%08x]\n", errcode, addr, current);
+ //printk("do page fault errcode %x addr %08x [%08x]\n", errcode, addr, current);
//assert(errcode != 2 && errcode != 6);
"sysenter;" \
"1:"
-static int __syscall0(int nr)
+static int __volatile__ __syscall0(int nr)
{
int __sysc_ret__ = 0;
asm(SYSENTER_ASM:"=a"(__sysc_ret__):"a"(nr));
return __sysc_ret__;
}
-static int __syscall1(int nr, unsigned long a)
+static int __volatile__ __syscall1(int nr, unsigned long a)
{
int __sysc_ret__ = 0;
asm(SYSENTER_ASM:"=a"(__sysc_ret__):"a"(nr), "b"(a));
return __sysc_ret__;
}
-static int __syscall2(int nr, unsigned long a, unsigned long b)
+static int __volatile__ __syscall2(int nr, unsigned long a, unsigned long b)
{
int __sysc_ret__ = 0;
asm(SYSENTER_ASM:"=a"(__sysc_ret__):"a"(nr), "b"(a), "c"(b));
return __sysc_ret__;
}
-static int __syscall3(int nr, unsigned long a, unsigned long b, unsigned long c)
+static int __volatile__ __syscall3(int nr, unsigned long a, unsigned long b, unsigned long c)
{
int __sysc_ret__ = 0;
asm(SYSENTER_ASM:"=a"(__sysc_ret__):"a"(nr), "b"(a), "c"(b), "d"(c));
return __sysc_ret__;
}
-static int __syscall4(int nr, unsigned long a, unsigned long b, unsigned long c, unsigned long d)
+static int __volatile__ __syscall4(int nr, unsigned long a, unsigned long b, unsigned long c, unsigned long d)
{
int __sysc_ret__ = 0;
asm(SYSENTER_ASM:"=a"(__sysc_ret__):"a"(nr), "b"(a), "c"(b), "d"(c), "S"(d));