mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
created. replace usercall.asm
svn path=/trunk/; revision=292
This commit is contained in:
parent
ee4c094831
commit
a0945c2aa2
1 changed files with 71 additions and 0 deletions
71
reactos/ntoskrnl/hal/x86/usercall.c
Normal file
71
reactos/ntoskrnl/hal/x86/usercall.c
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
#include <windows.h>
|
||||||
|
#include <internal/ntoskrnl.h>
|
||||||
|
#include <internal/ke.h>
|
||||||
|
#include <internal/symbol.h>
|
||||||
|
#include <internal/i386/segment.h>
|
||||||
|
#include <internal/mmhal.h>
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
|
#include <internal/debug.h>
|
||||||
|
|
||||||
|
|
||||||
|
#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");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue