From a0945c2aa225c9e8bf08e3f1dcf785ec1825317f Mon Sep 17 00:00:00 2001 From: jean Date: Fri, 12 Mar 1999 16:00:10 +0000 Subject: [PATCH] created. replace usercall.asm svn path=/trunk/; revision=292 --- reactos/ntoskrnl/hal/x86/usercall.c | 71 +++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 reactos/ntoskrnl/hal/x86/usercall.c diff --git a/reactos/ntoskrnl/hal/x86/usercall.c b/reactos/ntoskrnl/hal/x86/usercall.c new file mode 100644 index 00000000000..d2e5c7ca16c --- /dev/null +++ b/reactos/ntoskrnl/hal/x86/usercall.c @@ -0,0 +1,71 @@ +#include +#include +#include +#include +#include +#include + +#define NDEBUG +#include + + +#define _STR(x) #x +#define STR(x) _STR(x) + +void PsBeginThreadWithContextInternal(void); + __asm__("\n\t.global _PsBeginThreadWithContextInternal\n\t" + "_PsBeginThreadWithContextInternal:\n\t" + "pushl $0\n\t" + "call _KeLowerIrql\n\t" + "popl %eax\n\t" + "popl %eax\n\t" + "popl %eax\n\t" + "popl %eax\n\t" + "popl %eax\n\t" + "popl %eax\n\t" + "popl %eax\n\t" + "popl %eax\n\t" + "addl $112,%esp\n\t" + "popl %gs\n\t" + "popl %fs\n\t" + "popl %es\n\t" + "popl %ds\n\t" + "popl %edi\n\t" + "popl %esi\n\t" + "popl %ebx\n\t" + "popl %edx\n\t" + "popl %ecx\n\t" + "popl %eax\n\t" + "popl %ebp\n\t" + "iret\n\t"); + +void interrupt_handler2e(void); + __asm__("\n\t.global _interrupt_handler2e\n\t" + "_interrupt_handler2e:\n\t" + "pushl %ds\n\t" + "pushl %es\n\t" + "pushl %esi\n\t" + "pushl %edi\n\t" + "pushl %ebp\n\t" + "pushl %ebx\n\t" + "movw $"STR(KERNEL_DS)",%bx\n\t" + "movw %bx,%es\n\t" + "movl %esp,%ebp\n\t" + "movl %edx,%esi\n\t" + "movl %es:__SystemServiceTable(,%eax,8),%ecx\n\t" + "subl %ecx,%esp\n\t" + "movl %esp,%edi\n\t" + "rep\n\tmovsb\n\t" + "movw %bx,%ds\n\t" + "movl %ds:__SystemServiceTable+4(,%eax,8),%eax\n\t" + "call %eax\n\t" + "movl %ebp,%esp\n\t" + "popl %ebx\n\t" + "popl %ebp\n\t" + "popl %edi\n\t" + "popl %esi\n\t" + "popl %es\n\t" + "popl %ds\n\t" + "iret\n\t"); + +