MSVC compatibility for NCITool, fix more svn:ignore stuff..., enable
interrupts during APC delivery and syscall calling, because the
functions are probably expecting them to be enabled at that time.
Modified: trunk/reactos/ntoskrnl/ke/i386/syscall.S
Modified: trunk/reactos/tools/nci/ncitool.c
Property changes on: trunk/reactos/lib/psapi
___________________________________________________________________
Name: svn:ignore
- temp.exp
*.tmp
*.sym
*.coff
*.dll
*.o
*.a
*.d
*.map
*.gch
+ temp.exp
*.tmp
*.sym
*.coff
*.dll
*.o
*.a
*.d
*.map
*.gch
misc
_____
Modified: trunk/reactos/ntoskrnl/ke/i386/syscall.S
--- trunk/reactos/ntoskrnl/ke/i386/syscall.S 2005-01-18 03:35:37 UTC
(rev 13109)
+++ trunk/reactos/ntoskrnl/ke/i386/syscall.S 2005-01-18 04:02:49 UTC
(rev 13110)
@@ -105,10 +105,10 @@
#endif
/* Load the segment registers */
+ sti
movw $KERNEL_DS, %bx
movw %bx, %ds
movw %bx, %es
- movw %bx, %gs
/* Save the old trap frame pointer where EDX would be saved */
movl KTHREAD_TRAP_FRAME(%esi), %ebx
@@ -192,6 +192,7 @@
_KiServiceExit:
/* Get the Current Thread */
+ cli
movl %fs:KPCR_CURRENT_THREAD, %esi
/* Deliver APCs only if we were called from user mode */
@@ -213,10 +214,12 @@
pushl %eax
/* Deliver APCs */
+ sti
pushl %ebx
pushl $0
pushl $UserMode
call _KiDeliverApc@12
+ cli
/* Return to old IRQL */
popl %ecx
_____
Modified: trunk/reactos/tools/nci/ncitool.c
--- trunk/reactos/tools/nci/ncitool.c 2005-01-18 03:35:37 UTC (rev
13109)
+++ trunk/reactos/tools/nci/ncitool.c 2005-01-18 04:02:49 UTC (rev
13110)
@@ -46,21 +46,45 @@
* This stubs calls into KUSER_SHARED_DATA where either a
* sysenter or interrupt is performed, depending on CPU support.
*/
+#if defined(__GNUC__)
#define UserModeStub_x86 " movl $0x%x, %%eax\n" \
" movl $KUSER_SHARED_SYSCALL, %%ecx\n" \
" call *%%ecx\n" \
" ret $0x%x\n\n"
+#elif defined(_MSC_VER)
+#define UserModeStub_x86 " asm { \n" \
+ " mov eax, %xh\n" \
+ " mov ecx, KUSER_SHARED_SYSCALL\n" \
+ " call [ecx]\n" \
+ " ret %xh\n" \
+ " }\n"
+#else
+#error Unknown compiler for inline assembler
+#endif
/*
* This stub calls KiSystemService directly with a fake INT2E stack.
* Because EIP is pushed during the call, the handler will return here.
*/
+#if defined(__GNUC__)
#define KernelModeStub_x86 " movl $0x%x, %%eax\n" \
" leal 4(%%esp), %%edx\n" \
" pushfl\n" \
" pushl $KERNEL_CS\n" \
" call _KiSystemService\n" \
" ret $0x%x\n\n"
+#elif defined(_MSC_VER)
+#define KernelModeStub_x86 " asm { \n" \
+ " mov eax, %xh\n" \
+ " lea edx, [esp+4]\n" \
+ " pushf\n" \
+ " push KERNEL_CS\n" \
+ " call _KiSystemService\n" \
+ " ret %xh\n" \
+ " }\n"
+#else
+#error Unknown compiler for inline assembler
+#endif
/***** Arch Dependent Stuff ******/
//#ifdef _M_IX86