[ros-diffs] [tkreuzer] 49657: [NTOSKRNL] Convert assembly to new sytax

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sat Nov 20 11:09:32 UTC 2010


Author: tkreuzer
Date: Sat Nov 20 11:09:32 2010
New Revision: 49657

URL: http://svn.reactos.org/svn/reactos?rev=49657&view=rev
Log:
[NTOSKRNL]
Convert assembly to new sytax

Modified:
    branches/cmake-bringup/ntoskrnl/ex/i386/fastinterlck_asm.S
    branches/cmake-bringup/ntoskrnl/ex/i386/interlck_asm.S
    branches/cmake-bringup/ntoskrnl/ex/i386/ioport.S
    branches/cmake-bringup/ntoskrnl/include/internal/i386/asmmacro.S
    branches/cmake-bringup/ntoskrnl/kdbg/amd64/kdb_help.S
    branches/cmake-bringup/ntoskrnl/kdbg/i386/kdb_help.S
    branches/cmake-bringup/ntoskrnl/ke/amd64/boot.S
    branches/cmake-bringup/ntoskrnl/ke/amd64/ctxswitch.S
    branches/cmake-bringup/ntoskrnl/ke/amd64/trap.S
    branches/cmake-bringup/ntoskrnl/ke/i386/cpu.c
    branches/cmake-bringup/ntoskrnl/ke/i386/ctxswitch.S
    branches/cmake-bringup/ntoskrnl/ke/i386/trap.s
    branches/cmake-bringup/ntoskrnl/ke/i386/usercall_asm.S
    branches/cmake-bringup/ntoskrnl/rtl/i386/stack.S

Modified: branches/cmake-bringup/ntoskrnl/ex/i386/fastinterlck_asm.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/ex/i386/fastinterlck_asm.S?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/ex/i386/fastinterlck_asm.S [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/ex/i386/fastinterlck_asm.S [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -8,14 +8,13 @@
  
 /* INCLUDES ******************************************************************/
 
-#include <reactos/asm.h>
-#include <ndk/asm.h>
+#include <asm.inc>
+#include <ks386.inc>
 #include <internal/i386/asmmacro.S>
 
 /* FUNCTIONS ****************************************************************/
 
 .code32
-.text
 
 /*
  * NOTE: These functions must obey the following rules:
@@ -30,7 +29,7 @@
  *ExInterlockedAddLargeStatistic(IN PLARGE_INTEGER Addend,
  *                               IN ULONG Increment)
  */
-.global @ExInterlockedAddLargeStatistic at 8
+PUBLIC @ExInterlockedAddLargeStatistic at 8
 @ExInterlockedAddLargeStatistic at 8:
 
 #ifdef CONFIG_SMP
@@ -38,10 +37,10 @@
     lock add [ecx], edx
 
     /* Check for carry bit and return */
-    jb 1f
-    ret
-
-1:
+    jb .l1
+    ret
+
+.l1:
     /* Add carry */
     lock adc dword ptr [ecx+4], 0
 #else
@@ -58,7 +57,7 @@
  *                       IN ULONG Increment,
  *                       IN PKSPIN_LOCK Lock)
  */
-.global @ExfInterlockedAddUlong at 12
+PUBLIC @ExfInterlockedAddUlong at 12
 @ExfInterlockedAddUlong at 12:
 
     /* Save flags */
@@ -103,7 +102,7 @@
  *                             IN PLIST_ENTRY ListEntry,
  *                             IN PKSPIN_LOCK Lock)
  */
-.global @ExfInterlockedInsertHeadList at 12
+PUBLIC @ExfInterlockedInsertHeadList at 12
 @ExfInterlockedInsertHeadList at 12:
 
 #ifdef CONFIG_SMP
@@ -139,11 +138,11 @@
 
     /* Check if list was empty */
     xor eax, ecx
-    jz 2f
+    jz .l2
 
     /* Return list pointer */
     xor eax, ecx
-2:
+.l2:
     ret 4
 
 #ifdef CONFIG_SMP
@@ -159,7 +158,7 @@
  *                            IN PLIST_ENTRY ListEntry,
  *                            IN PKSPIN_LOCK Lock)
  */
-.global @ExfInterlockedInsertTailList at 12
+PUBLIC @ExfInterlockedInsertTailList at 12
 @ExfInterlockedInsertTailList at 12:
 
 #ifdef CONFIG_SMP
@@ -195,11 +194,11 @@
 
     /* Check if list was empty */
     xor eax, ecx
-    jz 2f
+    jz .l3
 
     /* Return list pointer */
     xor eax, ecx
-2:
+.l3:
     ret 4
 
 #ifdef CONFIG_SMP
@@ -214,7 +213,7 @@
  *ExfInterlockedRemoveHeadList(IN PLIST_ENTRY ListHead,
  *                             IN PKSPIN_LOCK Lock)
  */
-.global @ExfInterlockedRemoveHeadList at 8
+PUBLIC @ExfInterlockedRemoveHeadList at 8
 @ExfInterlockedRemoveHeadList at 8:
 
     /* Save flags and disable interrupts */
@@ -228,7 +227,7 @@
 
     /* Check if it's empty */
     cmp eax, ecx
-    je 2f
+    je .l4
 
     /* Get the next entry and do the deletion */
 #ifdef CONFIG_SMP
@@ -254,7 +253,7 @@
     /* Return */
     ret
 
-2:
+.l4:
     /* Release lock */
     RELEASE_SPINLOCK(edx)
 
@@ -276,7 +275,7 @@
  *ExfInterlockedPopEntryList(IN PSINGLE_LIST_ENTRY ListHead,
  *                           IN PKSPIN_LOCK Lock)
  */
-.global @ExfInterlockedPopEntryList at 8
+PUBLIC @ExfInterlockedPopEntryList at 8
 @ExfInterlockedPopEntryList at 8:
 
     /* Save flags and disable interrupts */
@@ -290,7 +289,7 @@
 
     /* Check if it's empty */
     or eax, eax
-    je 3f
+    je .l6
 
     /* Get next entry and do deletion */
 #ifdef CONFIG_SMP
@@ -302,7 +301,7 @@
     pop edx
 #endif
 
-2:
+.l5:
     /* Release lock */
     RELEASE_SPINLOCK(edx)
 
@@ -312,10 +311,10 @@
     /* Return */
     ret
 
-3:
+.l6:
     /* Return empty list */
     xor eax, eax
-    jmp 2b
+    jmp .l5
 
 #ifdef CONFIG_SMP
 .spin5:
@@ -329,7 +328,7 @@
  *                            IN PSINGLE_LIST_ENTRY ListEntry,
  *                            IN PKSPIN_LOCK Lock)
  */
-.global @ExfInterlockedPushEntryList at 12
+PUBLIC @ExfInterlockedPushEntryList at 12
 @ExfInterlockedPushEntryList at 12:
 
     /* Save flags */
@@ -383,11 +382,11 @@
  *ExInterlockedPopEntrySList(IN PSINGLE_LIST_ENTRY ListHead,
  *                           IN PKSPIN_LOCK Lock)
  */
-.global @ExInterlockedPopEntrySList at 8
-.global @InterlockedPopEntrySList at 4
-.global _ExpInterlockedPopEntrySListResume at 0
-.global _ExpInterlockedPopEntrySListFault at 0
-.global _ExpInterlockedPopEntrySListEnd at 0
+PUBLIC @ExInterlockedPopEntrySList at 8
+PUBLIC @InterlockedPopEntrySList at 4
+PUBLIC _ExpInterlockedPopEntrySListResume at 0
+PUBLIC _ExpInterlockedPopEntrySListFault at 0
+PUBLIC _ExpInterlockedPopEntrySListEnd at 0
 @ExInterlockedPopEntrySList at 8:
 @InterlockedPopEntrySList at 4:
 
@@ -405,7 +404,7 @@
 
     /* Check if the list is empty */
     or eax, eax
-    jz 2f
+    jz .l7
 
     /* Copy sequence number and adjust it */
     lea ecx, [edx-1]
@@ -418,7 +417,7 @@
     jnz _ExpInterlockedPopEntrySListResume at 0
 
     /* Restore registers and return */
-2:
+.l7:
     pop ebp
     pop ebx
     ret
@@ -429,13 +428,13 @@
  *                            IN PSINGLE_LIST_ENTRY ListEntry,
  *                            IN PKSPIN_LOCK Lock)
  */
-.global @ExInterlockedPushEntrySList at 12
+PUBLIC @ExInterlockedPushEntrySList at 12
 @ExInterlockedPushEntrySList at 12:
 
     /* So we can fall through below */
     pop [esp]
 
-.global @InterlockedPushEntrySList at 8
+PUBLIC @InterlockedPushEntrySList at 8
 @InterlockedPushEntrySList at 8:
 
     /* Save registers */
@@ -450,19 +449,18 @@
     mov edx, [ebp+4]
     mov eax, [ebp]
 
-1:
+.l8:
     /* Set link pointer */
     mov [ebx], eax
 
     /* Copy sequence number and adjust it */
-    lea ecx, [edx+0x10001]
+    lea ecx, [edx + HEX(10001)]
 
     /* Do the exchange */
     LOCK cmpxchg8b qword ptr [ebp]
-    jnz 1b
+    jnz .l8
 
     /* Restore registers and return */
-2:
     pop ebp
     pop ebx
     ret
@@ -471,7 +469,7 @@
  *FASTCALL
  *ExInterlockedFlushSList(IN PSINGLE_LIST_ENTRY ListHead)
  */
-.global @ExInterlockedFlushSList at 4
+PUBLIC @ExInterlockedFlushSList at 4
 @ExInterlockedFlushSList at 4:
 
     /* Save registers */
@@ -488,10 +486,10 @@
     mov edx, [ebp+4]
     mov eax, [ebp]
 
-1:
+.l9:
     /* Check if the list is empty */
     or eax, eax
-    jz 2f
+    jz .l10
 
     /* Clear sequence and pointer */
     mov ecx, edx
@@ -499,10 +497,10 @@
 
     /* Do the exchange */
     LOCK cmpxchg8b qword ptr [ebp]
-    jnz 1b
+    jnz .l9
 
     /* Restore registers and return */
-2:
+.l10:
     pop ebp
     pop ebx
     ret
@@ -511,7 +509,7 @@
  *FASTCALL
  *Exfi386InterlockedIncrementLong(IN PLONG Addend)
  */
-.global @Exfi386InterlockedIncrementLong at 4
+PUBLIC @Exfi386InterlockedIncrementLong at 4
 @Exfi386InterlockedIncrementLong at 4:
 
     /* Do the op */
@@ -526,7 +524,7 @@
  *FASTCALL
  *Exfi386InterlockedDecrementLong(IN PLONG Addend)
  */
-.global @Exfi386InterlockedDecrementLong at 4
+PUBLIC @Exfi386InterlockedDecrementLong at 4
 @Exfi386InterlockedDecrementLong at 4:
 
     /* Do the op */
@@ -542,7 +540,7 @@
  *Exfi386InterlockedExchangeUlong(IN PULONG Taget,
  *                                IN ULONG Value)
  */
-.global @Exfi386InterlockedExchangeUlong at 8
+PUBLIC @Exfi386InterlockedExchangeUlong at 8
 @Exfi386InterlockedExchangeUlong at 8:
 
 #ifdef CONFIG_SMP
@@ -552,9 +550,9 @@
 #else
     /* On UP, use cmpxchg */
     mov eax, [ecx]
-1:
+.l11:
     cmpxchg [ecx], edx
-    jnz 1b
+    jnz .l11
 #endif
 
     /* Return */
@@ -566,7 +564,7 @@
  *                                IN PLONGLONG Exchange,
  *                                IN PLONGLONG Comperand)
  */
-.global @ExfInterlockedCompareExchange64 at 12
+PUBLIC @ExfInterlockedCompareExchange64 at 12
 @ExfInterlockedCompareExchange64 at 12:
 
     /* Save registers */
@@ -598,7 +596,7 @@
  *                                IN PLONGLONG Comperand,
  *                                IN PKSPIN_LOCK Lock)
  */
-.global @ExInterlockedCompareExchange64 at 16
+PUBLIC @ExInterlockedCompareExchange64 at 16
 @ExInterlockedCompareExchange64 at 16:
 
     /* Save registers */
@@ -630,7 +628,7 @@
  *ExfInterlockedPopEntrySList(IN PSINGLE_LIST_ENTRY ListHead,
  *                            IN PKSPIN_LOCK Lock)
  */
-.global @ExfInterlockedPopEntrySList at 8
+PUBLIC @ExfInterlockedPopEntrySList at 8
 @ExfInterlockedPopEntrySList at 8:
 
     /* Save flags */
@@ -646,7 +644,7 @@
     /* Get the next link and check if it's empty */
     mov eax, [ecx]
     or eax, eax
-    jz 1f
+    jz .l12
 
     /* Get address of the next link and store it */
     push [eax]
@@ -655,7 +653,7 @@
     /* Decrement list depth */
     dec dword ptr [ecx+4]
 
-1:
+.l12:
 #ifdef CONFIG_SMP
     /* Release spinlock */
     RELEASE_SPINLOCK(edx)
@@ -678,7 +676,7 @@
  *                             IN PSINGLE_LIST_ENTRY ListEntry,
  *                             IN PKSPIN_LOCK Lock)
  */
-.global @ExfInterlockedPushEntrySList at 12
+PUBLIC @ExfInterlockedPushEntrySList at 12
 @ExfInterlockedPushEntrySList at 12:
 
     /* Save flags */
@@ -727,7 +725,7 @@
  *                                IN PLONGLONG Comperand,
  *                                IN PKSPIN_LOCK Lock)
  */
-.global @ExpInterlockedCompareExchange64 at 16
+PUBLIC @ExpInterlockedCompareExchange64 at 16
 @ExpInterlockedCompareExchange64 at 16:
 
     /* Save registers */
@@ -802,4 +800,6 @@
     pushfd
     SPIN_ON_LOCK(esi, .startc)
 #endif
+
+END
 /* EOF */

Modified: branches/cmake-bringup/ntoskrnl/ex/i386/interlck_asm.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/ex/i386/interlck_asm.S?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/ex/i386/interlck_asm.S [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/ex/i386/interlck_asm.S [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -8,14 +8,13 @@
  
 /* INCLUDES ******************************************************************/
 
-#include <reactos/asm.h>
-#include <ndk/asm.h>
+#include <asm.inc>
+#include <ks386.inc>
 #include <internal/i386/asmmacro.S>
 
 /* FUNCTIONS ****************************************************************/
 
 .code32
-.text
 
 /*
  * NOTE: These functions must obey the following rules:
@@ -31,7 +30,7 @@
  *                             IN PLIST_ENTRY ListEntry,
  *                             IN PKSPIN_LOCK Lock)
  */
-.global _ExInterlockedAddLargeInteger at 16
+PUBLIC _ExInterlockedAddLargeInteger at 16
 _ExInterlockedAddLargeInteger at 16:
 
     /* Prepare stack frame */
@@ -97,7 +96,7 @@
  *                            IN PLIST_ENTRY ListEntry,
  *                            IN PKSPIN_LOCK Lock)
  */
-.global _ExInterlockedAddUlong at 12
+PUBLIC _ExInterlockedAddUlong at 12
 _ExInterlockedAddUlong at 12:
 
     /* Save flags and disable interrupts */
@@ -153,7 +152,7 @@
  *                            IN PLIST_ENTRY ListEntry,
  *                            IN PKSPIN_LOCK Lock)
  */
-.global _ExInterlockedInsertHeadList at 12
+PUBLIC _ExInterlockedInsertHeadList at 12
 _ExInterlockedInsertHeadList at 12:
 
     /* Save lock pointer */
@@ -189,12 +188,12 @@
 
     /* check if the list was empty and return NULL */
     xor eax, edx
-    jz 2f
+    jz .l2
 
     /* Return pointer */
     mov eax, edx
 
-2:
+.l2:
     ret 12
 
 #ifdef CONFIG_SMP
@@ -209,7 +208,7 @@
  *                            IN PLIST_ENTRY ListEntry,
  *                            IN PKSPIN_LOCK Lock)
  */
-.global _ExInterlockedInsertTailList at 12
+PUBLIC _ExInterlockedInsertTailList at 12
 _ExInterlockedInsertTailList at 12:
 
     /* Save lock pointer */
@@ -245,12 +244,12 @@
 
     /* Check if the list was empty and return NULL */
     xor eax, edx
-    jz 2f
+    jz .l3
 
     /* Return pointer */
     mov eax, edx
 
-2:
+.l3:
     ret 12
 
 #ifdef CONFIG_SMP
@@ -264,7 +263,7 @@
  *ExInterlockedRemoveHeadList(IN PLIST_ENTRY ListHead,
  *                            IN PKSPIN_LOCK Lock)
  */
-.global _ExInterlockedRemoveHeadList at 8
+PUBLIC _ExInterlockedRemoveHeadList at 8
 _ExInterlockedRemoveHeadList at 8:
 
     /* Save lock pointer */
@@ -284,7 +283,7 @@
 
     /* Check if it's empty */
     cmp eax, edx
-    je 2f
+    je .l4
 
     /* Get next entry and do deletion */
     mov ecx, [eax]
@@ -303,7 +302,7 @@
     /* Return */
     ret 8
 
-2:
+.l4:
     /* Release lock */
 #ifdef CONFIG_SMP
     mov edx, [esp+12]
@@ -328,7 +327,7 @@
  *ExInterlockedPopEntryList(IN PSINGLE_LIST_ENTRY ListHead,
  *                          IN PKSPIN_LOCK Lock)
  */
-.global _ExInterlockedPopEntryList at 8
+PUBLIC _ExInterlockedPopEntryList at 8
 _ExInterlockedPopEntryList at 8:
 
     /* Save lock pointer */
@@ -348,13 +347,13 @@
 
     /* Check if it's empty */
     or eax, eax
-    je 3f
+    je .l6
 
     /* Get next entry and do deletion */
     mov edx, [eax]
     mov [ecx], edx
 
-2:
+.l5:
     /* Release lock */
 #ifdef CONFIG_SMP
     mov ecx, [esp+12]
@@ -367,10 +366,10 @@
     /* Return */
     ret 8
 
-3:
+.l6:
     /* Return empty list */
     xor eax, eax
-    jmp 2b
+    jmp .l5
 
 #ifdef CONFIG_SMP
 .spin6:
@@ -384,7 +383,7 @@
  *                           IN PSINGLE_LIST_ENTRY ListEntry,
  *                           IN PKSPIN_LOCK Lock)
  */
-.global _ExInterlockedPushEntryList at 12
+PUBLIC _ExInterlockedPushEntryList at 12
 _ExInterlockedPushEntryList at 12:
 
     /* Save lock pointer */
@@ -430,7 +429,7 @@
  *ExInterlockedIncrementLong(IN PLONG Addend,
  *                           IN PKSPIN_LOCK Lock)
  */
-.global _ExInterlockedIncrementLong at 8
+PUBLIC _ExInterlockedIncrementLong at 8
 _ExInterlockedIncrementLong at 8:
 
     /* Get addend */
@@ -449,7 +448,7 @@
  *ExInterlockedDecrementLong(IN PLONG Addend,
  *                           IN PKSPIN_LOCK Lock)
  */
-.global _ExInterlockedDecrementLong at 8
+PUBLIC _ExInterlockedDecrementLong at 8
 _ExInterlockedDecrementLong at 8:
 
     /* Get addend */
@@ -469,7 +468,7 @@
  *                           IN ULONG Value,
  *                           IN PKSPIN_LOCK Lock)
  */
-.global _ExInterlockedExchangeUlong at 12
+PUBLIC _ExInterlockedExchangeUlong at 12
 _ExInterlockedExchangeUlong at 12:
 
     /* Get pointers */
@@ -498,7 +497,7 @@
  *Exi386InterlockedIncrementLong(IN PLONG Addend,
  *                               IN PKSPIN_LOCK Lock)
  */
-.global _Exi386InterlockedIncrementLong at 4
+PUBLIC _Exi386InterlockedIncrementLong at 4
 _Exi386InterlockedIncrementLong at 4:
 
     /* Get addend */
@@ -517,7 +516,7 @@
  *Exi386InterlockedDecrementLong(IN PLONG Addend,
  *                               IN PKSPIN_LOCK Lock)
  */
-.global _Exi386InterlockedDecrementLong at 4
+PUBLIC _Exi386InterlockedDecrementLong at 4
 _Exi386InterlockedDecrementLong at 4:
 
     /* Get addend */
@@ -537,7 +536,7 @@
  *                               IN ULONG Value,
  *                               IN PKSPIN_LOCK Lock)
  */
-.global _Exi386InterlockedExchangeUlong at 12
+PUBLIC _Exi386InterlockedExchangeUlong at 12
 _Exi386InterlockedExchangeUlong at 12:
 
     /* Get pointers */
@@ -560,5 +559,6 @@
 
     /* Return */
     ret 8
-	
+
+END
 /* EOF */

Modified: branches/cmake-bringup/ntoskrnl/ex/i386/ioport.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/ex/i386/ioport.S?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/ex/i386/ioport.S [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/ex/i386/ioport.S [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -8,54 +8,52 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ndk/asm.h>
-.intel_syntax noprefix
+#include <asm.inc>
+#include <ks386.inc>
 
 /* GLOBALS *******************************************************************/
 
-.globl _READ_REGISTER_UCHAR at 4
-.globl _READ_REGISTER_USHORT at 4
-.globl _READ_REGISTER_ULONG at 4
-.globl _READ_REGISTER_BUFFER_UCHAR at 12
-.globl _READ_REGISTER_BUFFER_USHORT at 12
-.globl _READ_REGISTER_BUFFER_ULONG at 12
-.globl _WRITE_REGISTER_UCHAR at 8
-.globl _WRITE_REGISTER_USHORT at 8
-.globl _WRITE_REGISTER_ULONG at 8
-.globl _WRITE_REGISTER_BUFFER_UCHAR at 12
-.globl _WRITE_REGISTER_BUFFER_USHORT at 12
-.globl _WRITE_REGISTER_BUFFER_ULONG at 12
+PUBLIC _READ_REGISTER_UCHAR at 4
+PUBLIC _READ_REGISTER_USHORT at 4
+PUBLIC _READ_REGISTER_ULONG at 4
+PUBLIC _READ_REGISTER_BUFFER_UCHAR at 12
+PUBLIC _READ_REGISTER_BUFFER_USHORT at 12
+PUBLIC _READ_REGISTER_BUFFER_ULONG at 12
+PUBLIC _WRITE_REGISTER_UCHAR at 8
+PUBLIC _WRITE_REGISTER_USHORT at 8
+PUBLIC _WRITE_REGISTER_ULONG at 8
+PUBLIC _WRITE_REGISTER_BUFFER_UCHAR at 12
+PUBLIC _WRITE_REGISTER_BUFFER_USHORT at 12
+PUBLIC _WRITE_REGISTER_BUFFER_ULONG at 12
 
 /* FUNCTIONS *****************************************************************/
 
-.func READ_REGISTER_UCHAR at 4
+.code
+
 _READ_REGISTER_UCHAR at 4:
 
     /* Return the requested memory location */
     mov edx, [esp+4]
     mov al, [edx]
     ret 4
-.endfunc
-
-.func READ_REGISTER_USHORT at 4
+
+
 _READ_REGISTER_USHORT at 4:
 
     /* Return the requested memory location */
     mov edx, [esp+4]
     mov ax, [edx]
     ret 4
-.endfunc
-
-.func READ_REGISTER_ULONG at 4
+
+
 _READ_REGISTER_ULONG at 4:
 
     /* Return the requested memory location */
     mov edx, [esp+4]
     mov eax, [edx]
     ret 4
-.endfunc
-
-.func READ_REGISTER_BUFFER_UCHAR at 12
+
+
 _READ_REGISTER_BUFFER_UCHAR at 12:
 
     /* Save volatiles */
@@ -72,9 +70,8 @@
     mov edi, edx
     mov esi, eax
     ret 12
-.endfunc
-
-.func READ_REGISTER_BUFFER_USHORT at 12
+
+
 _READ_REGISTER_BUFFER_USHORT at 12:
 
     /* Save volatiles */
@@ -91,9 +88,8 @@
     mov edi, edx
     mov esi, eax
     ret 12
-.endfunc
-
-.func READ_REGISTER_BUFFER_ULONG at 12
+
+
 _READ_REGISTER_BUFFER_ULONG at 12:
 
     /* Save volatiles */
@@ -110,9 +106,8 @@
     mov edi, edx
     mov esi, eax
     ret 12
-.endfunc
-
-.func WRITE_REGISTER_UCHAR at 8
+
+
 _WRITE_REGISTER_UCHAR at 8:
 
     /* Write to memory */
@@ -123,9 +118,8 @@
     /* Flush posted write buffers and return */
     lock or [esp+4], edx
     ret 8
-.endfunc
-
-.func WRITE_REGISTER_USHORT at 8
+
+
 _WRITE_REGISTER_USHORT at 8:
 
     /* Write to memory */
@@ -136,9 +130,8 @@
     /* Flush posted write buffers and return */
     lock or [esp+4], edx
     ret 8
-.endfunc
-
-.func WRITE_REGISTER_ULONG at 8
+
+
 _WRITE_REGISTER_ULONG at 8:
 
     /* Write to memory */
@@ -149,9 +142,8 @@
     /* Flush posted write buffers and return */
     lock or [esp+4], edx
     ret 8
-.endfunc
-
-.func WRITE_REGISTER_BUFFER_UCHAR at 12
+
+
 _WRITE_REGISTER_BUFFER_UCHAR at 12:
 
     /* Save volatiles */
@@ -171,9 +163,8 @@
     mov edi, edx
     mov esi, eax
     ret 12
-.endfunc
-
-.func WRITE_REGISTER_BUFFER_USHORT at 12
+
+
 _WRITE_REGISTER_BUFFER_USHORT at 12:
 
     /* Save volatiles */
@@ -193,9 +184,8 @@
     mov edi, edx
     mov esi, eax
     ret 12
-.endfunc
-
-.func WRITE_REGISTER_BUFFER_ULONG at 12
+
+
 _WRITE_REGISTER_BUFFER_ULONG at 12:
 
     /* Save volatiles */
@@ -215,6 +205,6 @@
     mov edi, edx
     mov esi, eax
     ret 12
-.endfunc
-
+
+END
 /* EOF */

Modified: branches/cmake-bringup/ntoskrnl/include/internal/i386/asmmacro.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/include/internal/i386/asmmacro.S?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/include/internal/i386/asmmacro.S [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/include/internal/i386/asmmacro.S [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -60,8 +60,8 @@
 // @remark None.
 //
 MACRO(idt, Handler, Bits)
-    .long \Handler
-    .short \Bits
+    .long VAL(Handler)
+    .short VAL(Bits)
     .short KGDT_R0_CODE
 ENDM
 
@@ -128,17 +128,17 @@
     mov [esp + KTRAP_FRAME_EAX], eax
 
     /* Does the caller want nonvolatiles only? */
-    if ((Flags AND KI_NONVOLATILES_ONLY) == 0)
+    if (NOT (Flags AND KI_NONVOLATILES_ONLY))
         /* Otherwise, save the volatiles as well */
         mov [esp + KTRAP_FRAME_ECX], ecx
         mov [esp + KTRAP_FRAME_EDX], edx
     endif
 
     /* Save segment registers? */
-    if ((Flags AND KI_DONT_SAVE_SEGS) == 0)
+    if (NOT (Flags AND KI_DONT_SAVE_SEGS))
 
         /* Check for V86 mode */
-        test byte ptr [esp + KTRAP_FRAME_EFLAGS + 2], (EFLAGS_V86_MASK >> 16)
+        test byte ptr [esp + KTRAP_FRAME_EFLAGS + 2], (EFLAGS_V86_MASK / HEX(10000))
         jz not_v86_trap
 
             /* Restore V8086 segments into Protected Mode segments */
@@ -173,7 +173,7 @@
     mov es, ax
 
     /* Fast system calls have fs already fixed */
-    if ((Flags AND KI_FAST_SYSTEM_CALL) == 0)
+    if (NOT (Flags AND KI_FAST_SYSTEM_CALL))
         /* Otherwise fix fs now */
         mov ax, KGDT_R0_PCR
         mov fs, ax
@@ -296,7 +296,7 @@
         mov ecx, [esp - OffsetEsp + KTRAP_FRAME_ESP]
 
         /* Keep interrupts disabled until the sti / sysexit */
-        and byte ptr [esp - OffsetEsp + KTRAP_FRAME_EFLAGS + 1], ~(EFLAGS_INTERRUPT_MASK >> 8)
+        and byte ptr [esp - OffsetEsp + KTRAP_FRAME_EFLAGS + 1], NOT (EFLAGS_INTERRUPT_MASK / HEX(100))
 
     endif
 

Modified: branches/cmake-bringup/ntoskrnl/kdbg/amd64/kdb_help.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/kdbg/amd64/kdb_help.S?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/kdbg/amd64/kdb_help.S [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/kdbg/amd64/kdb_help.S [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -1,7 +1,9 @@
-#include <reactos/asm.h>
-#include <ndk/amd64/asm.h>
 
-.globl KdbEnter
+#include <asm.inc>
+
+#include <ksamd64.inc>
+
+PUBLIC KdbEnter
 KdbEnter:
 
     /* save flags */
@@ -149,4 +151,6 @@
     mov rsp, rax
 
     /* Return */
-    ret
+    ret
+
+END

Modified: branches/cmake-bringup/ntoskrnl/kdbg/i386/kdb_help.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/kdbg/i386/kdb_help.S?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/kdbg/i386/kdb_help.S [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/kdbg/i386/kdb_help.S [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -1,68 +1,72 @@
-#include <ndk/asm.h>
 
-.text
+#include <asm.inc>
+#include <ks386.inc>
 
-.globl _KdbEnter
+EXTERN _KdbEnterDebuggerException:PROC
+
+.code
+
+PUBLIC _KdbEnter
 _KdbEnter:
     /*
      * Set up a trap frame
      */
-    pushfl                      /* Eflags */
-    pushl   %cs                 /* Cs */
-    pushl   $0                  /* ErrorCode */
-    pushl   %ebp                /* Ebp */
-    pushl   %ebx                /* Ebx */
-    movl    20(%esp), %ebp      /* Eip */
-    movl    16(%esp), %ebx      /* Eflags */
-    movl    %ebx, 20(%esp)
-    movl    12(%esp), %ebx      /* Cs */
-    movl    %ebx, 16(%esp)
-    movl    %ebp, 12(%esp)
-    pushl   %esi                /* Esi */
-    pushl   %edi                /* Edi */
-    pushl   %fs                 /* Fs */
-    pushl   $0                  /* ExceptionList */
-    pushl   $0                  /* PreviousMode */
-    pushl   %eax                /* Eax */
-    pushl   %ecx                /* Ecx */
-    pushl   %edx                /* Edx */
-    pushl   %ds                 /* Ds */
-    pushl   %es                 /* Es */
-    pushl   %gs                 /* Gs */
-    movl    %dr7, %eax
-    pushl   %eax                /* Dr7 */
+    pushf                      /* Eflags */
+    push cs                 /* Cs */
+    push 0                  /* ErrorCode */
+    push ebp                /* Ebp */
+    push ebx                /* Ebx */
+    mov ebp, [esp + 20]      /* Eip */
+    mov ebx, [esp + 16]      /* Eflags */
+    mov [esp + 20], ebx
+    mov ebx, [esp + 12]      /* Cs */
+    mov [esp + 16], ebx
+    mov [esp + 12], ebp
+    push esi                /* Esi */
+    push edi                /* Edi */
+    push fs                 /* Fs */
+    push 0                  /* ExceptionList */
+    push 0                  /* PreviousMode */
+    push eax                /* Eax */
+    push ecx                /* Ecx */
+    push edx                /* Edx */
+    push ds                 /* Ds */
+    push es                 /* Es */
+    push gs                 /* Gs */
+    mov eax, dr7
+    push eax                /* Dr7 */
 
     /* Clear all breakpoint enables in dr7. */
-    andl    $0xFFFF0000, %eax
-    movl    %eax, %dr7
-    movl    %dr6, %eax
-    pushl   %eax                /* Dr6 */
-    movl    %dr3, %eax
-    pushl   %eax                /* Dr3 */
-    movl    %dr2, %eax
-    pushl   %eax                /* Dr2 */
-    movl    %dr1, %eax
-    pushl   %eax                /* Dr1 */
-    movl    %dr0, %eax
-    pushl   %eax                /* Dr0 */
-    leal    0x58(%esp), %eax
-    pushl   %eax                /* TempEsp */
-    pushl   %ss                 /* TempSegSs */
-    pushl   $0                  /* DebugPointer */
-    pushl   $3                  /* DebugArgMark (Exception number) */
-    pushl   0x60(%esp)          /* DebugEip */
-    pushl   %ebp                /* DebugEbp */
+    and eax, HEX(0FFFF0000)
+    mov dr7, eax
+    mov eax, dr6
+    push eax                /* Dr6 */
+    mov eax, dr3
+    push eax                /* Dr3 */
+    mov eax, dr2
+    push eax                /* Dr2 */
+    mov eax, dr1
+    push eax                /* Dr1 */
+    mov eax, dr0
+    push eax                /* Dr0 */
+    lea eax, [esp + HEX(58)]
+    push eax                /* TempEsp */
+    push ss                 /* TempSegSs */
+    push 0                  /* DebugPointer */
+    push 3                  /* DebugArgMark (Exception number) */
+    push [esp + HEX(60)]          /* DebugEip */
+    push ebp                /* DebugEbp */
 
     /*
      * Call KDB
      */
-    movl    %esp, %eax
-    pushl   $1                  /* FirstChance */
-    pushl   %eax                /* Push a pointer to the trap frame */
-    pushl   $0                  /* Context */
-    pushl   $0                  /* PreviousMode (KernelMode) */
-    pushl   $0                  /* ExceptionRecord */
-    call    _KdbEnterDebuggerException
+    mov eax, esp
+    push 1                  /* FirstChance */
+    push eax                /* Push a pointer to the trap frame */
+    push 0                  /* Context */
+    push 0                  /* PreviousMode (KernelMode) */
+    push 0                  /* ExceptionRecord */
+    call _KdbEnterDebuggerException
 
     /*
      * Pop the arguments and unused portions of the trap frame:
@@ -73,41 +77,41 @@
      *   TempSegSs
      *   TempEsp
      */
-    addl    $(11*4), %esp
+    add esp, 11*4
 
     /*
      * Restore/update debugging registers.
      */
-    popl    %eax            /* Dr0 */
-    movl    %eax, %dr0
-    popl    %eax            /* Dr1 */
-    movl    %eax, %dr1
-    popl    %eax            /* Dr2 */
-    movl    %eax, %dr2
-    popl    %eax            /* Dr3 */
-    movl    %eax, %dr3
-    popl    %eax            /* Dr6 */
-    movl    %eax, %dr6
-    popl    %eax            /* Dr7 */
-    movl    %eax, %dr7
+    pop eax            /* Dr0 */
+    mov dr0, eax
+    pop eax            /* Dr1 */
+    mov dr1, eax
+    pop eax            /* Dr2 */
+    mov dr2, eax
+    pop eax            /* Dr3 */
+    mov dr3, eax
+    pop eax            /* Dr6 */
+    mov dr6, eax
+    pop eax            /* Dr7 */
+    mov dr7, eax
 
     /*
      * Restore registers including any that might have been changed
      * inside the debugger.
      */
-    popl    %gs         /* Gs */
-    popl    %es         /* Es */
-    popl    %ds         /* Ds */
-    popl    %edx        /* Edx */
-    popl    %ecx        /* Ecx */
-    popl    %eax        /* Eax */
-    addl    $8, %esp    /* PreviousMode, ExceptionList */
-    popl    %fs         /* Fs */
-    popl    %edi        /* Edi */
-    popl    %esi        /* Esi */
-    popl    %ebx        /* Ebx */
-    popl    %ebp        /* Ebp */
-    addl    $4, %esp    /* ErrorCode */
+    pop gs         /* Gs */
+    pop es         /* Es */
+    pop ds         /* Ds */
+    pop edx        /* Edx */
+    pop ecx        /* Ecx */
+    pop eax        /* Eax */
+    add esp, 8    /* PreviousMode, ExceptionList */
+    pop fs         /* Fs */
+    pop edi        /* Edi */
+    pop esi        /* Esi */
+    pop ebx        /* Ebx */
+    pop ebp        /* Ebp */
+    add esp, 4    /* ErrorCode */
 
     /*
      * Return to the caller.
@@ -115,26 +119,27 @@
     iret
 
 
-.globl _KdbpStackSwitchAndCall at 8
+PUBLIC _KdbpStackSwitchAndCall at 8
 _KdbpStackSwitchAndCall at 8:
-    pushl   %ebp
-    movl    %esp, %ebp
+    push ebp
+    mov ebp, esp
 
-    movl    0x8(%esp), %eax         /* New stack */
-    movl    0xC(%esp), %ecx         /* Function to call */
-    movl    %esp, %edx              /* Old stack */
+    mov eax, [esp + 8]         /* New stack */
+    mov ecx, [esp + 12]         /* Function to call */
+    mov edx, esp              /* Old stack */
 
     /* Switch stack */
-    movl    %eax, %esp
-    pushl   %edx
+    mov esp, eax
+    push edx
 
     /* Call function */
-    call    *%ecx
+    call ecx
 
     /* Switch back to old stack */
-    popl    %esp
+    pop esp
 
     /* Return */
-    popl    %ebp
-    ret     $8
+    pop ebp
+    ret 8
 
+END

Modified: branches/cmake-bringup/ntoskrnl/ke/amd64/boot.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/ke/amd64/boot.S?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/ke/amd64/boot.S [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/ke/amd64/boot.S [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -2,14 +2,14 @@
  * FILE:            ntoskrnl/ke/i386/boot.S
  * COPYRIGHT:       See COPYING in the top level directory
  * PURPOSE:         FreeLDR Wrapper Bootstrap Code and Bootstrap Trampoline
- * PROGRAMMERs:     Alex Ionescu (alex at relsoft.net)
- *                  Thomas Weidenmueller <w3seek at reactos.org>
+ * PROGRAMMER:      Timo Kreuzer (timo.kreuzer at reactos.org)
  */
 
 /* INCLUDES ******************************************************************/
 
-#include <reactos/asm.h>
-#include <ndk/amd64/asm.h>
+#include <asm.inc>
+
+#include <ksamd64.inc>
 
 EXTERN KiInitializeKernelAndGotoIdleLoop:PROC
 

Modified: branches/cmake-bringup/ntoskrnl/ke/amd64/ctxswitch.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/ke/amd64/ctxswitch.S?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/ke/amd64/ctxswitch.S [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/ke/amd64/ctxswitch.S [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -9,8 +9,9 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <reactos/asm.h>
-#include <ndk/amd64/asm.h>
+#include <asm.inc>
+
+#include <ksamd64.inc>
 
 /* FUNCTIONS ****************************************************************/
 

Modified: branches/cmake-bringup/ntoskrnl/ke/amd64/trap.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/ke/amd64/trap.S?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/ke/amd64/trap.S [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/ke/amd64/trap.S [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -7,8 +7,9 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <reactos/asm.h>
-#include <ndk/amd64/asm.h>
+#include <asm.inc>
+
+#include <ksamd64.inc>
 
 EXTERN KiDispatchException:PROC
 EXTERN FrLdrDbgPrint:DWORD

Modified: branches/cmake-bringup/ntoskrnl/ke/i386/cpu.c
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/ke/i386/cpu.c?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/ke/i386/cpu.c [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/ke/i386/cpu.c [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -109,7 +109,13 @@
 #define CX86_CCR1 0xc1
 
 /* NSC/Cyrix CPU indexed register access macros */
-#define getCx86(reg) ({ WRITE_PORT_UCHAR((PUCHAR)(ULONG_PTR)0x22,(reg)); READ_PORT_UCHAR((PUCHAR)(ULONG_PTR)0x23); })
+static __inline
+ULONG
+getCx86(UCHAR reg)
+{
+    WRITE_PORT_UCHAR((PUCHAR)(ULONG_PTR)0x22, reg);
+    return READ_PORT_UCHAR((PUCHAR)(ULONG_PTR)0x23);
+}
 
 #define setCx86(reg, data) do { \
    WRITE_PORT_UCHAR((PUCHAR)(ULONG_PTR)0x22,(reg)); \

Modified: branches/cmake-bringup/ntoskrnl/ke/i386/ctxswitch.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/ke/i386/ctxswitch.S?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/ke/i386/ctxswitch.S [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/ke/i386/ctxswitch.S [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -10,22 +10,27 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ndk/asm.h>
-.intel_syntax noprefix
+#include <asm.inc>
+#include <ks386.inc>
+
+EXTERN @KiSwapContextEntry at 8:PROC
+EXTERN @KiSwapContextExit at 8:PROC
+EXTERN @KiRetireDpcList at 4:PROC
+EXTERN @KiEnterV86Mode at 4:PROC
+EXTERN @KiExitV86Mode at 4:PROC
 
 /* FUNCTIONS ****************************************************************/
+.code
 
-.globl @KiSwapContextInternal at 0
-.func @KiSwapContextInternal at 0, @KiSwapContextInternal at 0
+PUBLIC @KiSwapContextInternal at 0
 @KiSwapContextInternal at 0:
     /* Build switch frame */
     sub esp, 2 * 4
     mov ecx, esp
     jmp @KiSwapContextEntry at 8
-.endfunc
 
-.globl @KiSwapContext at 8
-.func @KiSwapContext at 8, @KiSwapContext at 8
+
+PUBLIC @KiSwapContext at 8
 @KiSwapContext at 8:
     /* Save 4 registers */
     sub esp, 4 * 4
@@ -51,10 +56,9 @@
     /* Clean stack */
     add esp, 4 * 4
     ret
-.endfunc
 
-.globl @KiSwitchThreads at 8
-.func @KiSwitchThreads at 8, @KiSwitchThreads at 8
+
+PUBLIC @KiSwitchThreads at 8
 @KiSwitchThreads at 8:
     /* Load the new kernel stack and switch OS to new thread */
     mov esp, edx
@@ -63,10 +67,9 @@
     /* Now we're on the new thread. Return to the caller to restore registers */
     add esp, 2 * 4
     ret
-.endfunc
 
-.globl @KiRetireDpcListInDpcStack at 8
-.func @KiRetireDpcListInDpcStack at 8, @KiRetireDpcListInDpcStack at 8
+
+PUBLIC @KiRetireDpcListInDpcStack at 8
 @KiRetireDpcListInDpcStack at 8:
     /* Switch stacks and retire DPCs */
     mov eax, esp
@@ -77,11 +80,10 @@
     /* Return on original stack */
     pop esp
     ret
-.endfunc
+
 
 /* FIXFIX: Move to C code ****/
-.globl _Ki386SetupAndExitToV86Mode at 4
-.func Ki386SetupAndExitToV86Mode at 4
+PUBLIC _Ki386SetupAndExitToV86Mode at 4
 _Ki386SetupAndExitToV86Mode at 4:
 
     /* Enter V8086 mode */
@@ -90,9 +92,9 @@
     mov ecx, esp
     call @KiEnterV86Mode at 4
     jmp $
-.endfunc
 
-.globl @Ki386BiosCallReturnAddress at 4
+
+PUBLIC @Ki386BiosCallReturnAddress at 4
 @Ki386BiosCallReturnAddress at 4:
 
     /* Exit V8086 mode */
@@ -102,3 +104,4 @@
     popad
     ret 4
 
+END

Modified: branches/cmake-bringup/ntoskrnl/ke/i386/trap.s
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/ke/i386/trap.s?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/ke/i386/trap.s [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/ke/i386/trap.s [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -9,8 +9,8 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <reactos/asm.h>
-#include <ndk/i386/asm.h>
+#include <asm.inc>
+#include <ks386.inc>
 #include <internal/i386/asmmacro.S>
 
 MACRO(GENERATE_IDT_STUB, Number)
@@ -18,16 +18,19 @@
 ENDM
 
 MACRO(GENERATE_INT_HANDLER, Number)
-.func KiUnexpectedInterrupt&Number
+//.func KiUnexpectedInterrupt&Number
 _KiUnexpectedInterrupt&Number:
     push PRIMARY_VECTOR_BASE + Number
     jmp _KiEndUnexpectedRange at 0
-.endfunc
+//.endfunc
 ENDM
+
+EXTERN _KiTrap02:PROC
 
 /* GLOBALS *******************************************************************/
 
 .data
+ASSUME nothing
 
 PUBLIC _KiIdt
 _KiIdt:
@@ -52,9 +55,9 @@
 idt _KiTrap11,         INT_32_DPL0  /* INT 11: Align Check Exception (#AC)  */
 idt _KiTrap0F,         INT_32_DPL0  /* INT 12: Machine Check Exception (#MC)*/
 idt _KiTrap0F,         INT_32_DPL0  /* INT 13: SIMD FPU Exception (#XF)     */
-.rept 22
+REPEAT 22
 idt _KiTrap0F,         INT_32_DPL0  /* INT 14-29: UNDEFINED INTERRUPTS      */
-.endr
+ENDR
 idt _KiGetTickCount,   INT_32_DPL3  /* INT 2A: Get Tick Count Handler       */
 idt _KiCallbackReturn, INT_32_DPL3  /* INT 2B: User-Mode Callback Return    */
 idt _KiRaiseAssertion, INT_32_DPL3  /* INT 2C: Debug Assertion Handler      */
@@ -62,15 +65,15 @@
 idt _KiSystemService,  INT_32_DPL3  /* INT 2E: System Call Service Handler  */
 idt _KiTrap0F,         INT_32_DPL0  /* INT 2F: RESERVED                     */
 i = 0
-.rept 208
+REPEAT 208
     GENERATE_IDT_STUB %i
     i = i + 1
-.endr
+ENDR
 
 PUBLIC _KiIdtDescriptor
 _KiIdtDescriptor:
     .short 0
-    .short 0x7FF
+    .short HEX(7FF)
     .long _KiIdt
 
 PUBLIC _KiUnexpectedEntrySize
@@ -78,8 +81,7 @@
     .long _KiUnexpectedInterrupt1 - _KiUnexpectedInterrupt0
 
 /******************************************************************************/
-.code32
-.text
+.code
 
 TRAP_ENTRY KiTrap00, KI_PUSH_FAKE_ERROR_CODE
 TRAP_ENTRY KiTrap01, KI_PUSH_FAKE_ERROR_CODE
@@ -106,7 +108,7 @@
 TRAP_ENTRY KiUnexpectedInterruptTail, 0
 
 ALIGN 4
-EXTERN @KiInterruptTemplateHandler at 8
+EXTERN @KiInterruptTemplateHandler at 8:PROC
 PUBLIC _KiInterruptTemplate
 _KiInterruptTemplate:
     KiEnterTrap KI_PUSH_FAKE_ERROR_CODE
@@ -135,10 +137,10 @@
 PUBLIC _KiStartUnexpectedRange at 0
 _KiStartUnexpectedRange at 0:
 i = 0
-.rept 208
+REPEAT 208
     GENERATE_INT_HANDLER %i
     i = i + 1
-.endr
+ENDR
 PUBLIC _KiEndUnexpectedRange at 0
 _KiEndUnexpectedRange at 0:
     jmp _KiUnexpectedInterruptTail

Modified: branches/cmake-bringup/ntoskrnl/ke/i386/usercall_asm.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/ke/i386/usercall_asm.S?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/ke/i386/usercall_asm.S [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/ke/i386/usercall_asm.S [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -8,17 +8,18 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <reactos/asm.h>
-#include <ndk/i386/asm.h>
+#include <asm.inc>
+#include <ks386.inc>
 #include <internal/i386/asmmacro.S>
 
+EXTERN _MmGrowKernelStack at 4:PROC
+EXTERN _KeUserCallbackDispatcher:PROC
+EXTERN @KiServiceExit at 8:PROC
+
 /* FUNCTIONS ****************************************************************/
-
-.code32
-.text
-
-.globl _KiGetUserModeStackAddress at 0
-.func KiGetUserModeStackAddress at 0
+.code
+
+PUBLIC _KiGetUserModeStackAddress at 0
 _KiGetUserModeStackAddress at 0:
 
     /* Get the current thread's trapframe and return the esp */
@@ -27,7 +28,6 @@
     lea eax, [eax+KTRAP_FRAME_ESP]
     ret
 
-.endfunc
 
 /*++
  * @name KiCallUserMode 
@@ -53,8 +53,7 @@
  *         This call MUST be paired by interrupt 0x2B or NtCallbackReturn.
  *
  *--*/
-.globl _KiCallUserMode at 8
-.func KiCallUserMode at 8
+PUBLIC _KiCallUserMode at 8
 _KiCallUserMode at 8:
 
     /* Save volatile registers */
@@ -102,7 +101,7 @@
 #endif
 
     /* Get the lowest stack limit and check if we can handle it */
-    lea eax, [esp-0x3000]
+    lea eax, [esp-HEX(3000)]
     cmp eax, [ebx+KTHREAD_STACK_LIMIT]
     jnb StackOk
 
@@ -130,7 +129,7 @@
     mov [ebx+KTHREAD_CALLBACK_STACK], esp
 
     /* Align stack on 16-byte boundary */
-    and esp, ~15
+    and esp, NOT 15
     mov edi, esp
 
     /* Set destination and origin NPX Areas */
@@ -181,7 +180,7 @@
 
     /* Copy DR7 */
     mov edi, [edx+KTRAP_FRAME_DR7]
-    test edi, ~DR7_RESERVED_MASK
+    test edi, NOT DR7_RESERVED_MASK
     mov [esp+KTRAP_FRAME_DR7], edi
 
     /* Check if we need to save debug registers */
@@ -226,7 +225,6 @@
     /* Return */
     ret 8
 
-.endfunc
 
 /*++
  * @name NtCallbackReturn
@@ -251,8 +249,7 @@
  * @remark This call MUST be paired with KeUserModeCallback.
  *
  *--*/
-.globl _NtCallbackReturn at 12
-.func NtCallbackReturn at 12
+PUBLIC _NtCallbackReturn at 12
 _NtCallbackReturn at 12:
 
     /* Get the current thread and make sure we have a callback stack */
@@ -316,7 +313,7 @@
     and dword ptr [edi+KTRAP_FRAME_DR7], 0
 
     /* Check if debugging was active */
-    test byte ptr [eax+KTHREAD_DEBUG_ACTIVE], 0xFF
+    test byte ptr [eax+KTHREAD_DEBUG_ACTIVE], HEX(0FF)
     jnz RestoreDebug
 
 RestoreStack:
@@ -407,7 +404,6 @@
     /* Return failure */
     mov eax, STATUS_NO_CALLBACK_ACTIVE
     ret 12
-.endfunc
 
 /*++
  * @name KeSwitchKernelStack 
@@ -429,8 +425,7 @@
  *         this routine.
  *
  *--*/
-.globl _KeSwitchKernelStack at 8
-.func KeSwitchKernelStack at 8
+PUBLIC _KeSwitchKernelStack at 8
 _KeSwitchKernelStack at 8:
 
     /* Save volatiles */
@@ -515,4 +510,5 @@
     pop edi
     pop esi
     ret 8
-.endfunc
+
+END

Modified: branches/cmake-bringup/ntoskrnl/rtl/i386/stack.S
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/ntoskrnl/rtl/i386/stack.S?rev=49657&r1=49656&r2=49657&view=diff
==============================================================================
--- branches/cmake-bringup/ntoskrnl/rtl/i386/stack.S [iso-8859-1] (original)
+++ branches/cmake-bringup/ntoskrnl/rtl/i386/stack.S [iso-8859-1] Sat Nov 20 11:09:32 2010
@@ -8,13 +8,13 @@
 
 /* INCLUDES ******************************************************************/
 
-#include <ndk/asm.h>
-.intel_syntax noprefix
+#include <asm.inc>
+#include <ks386.inc>
 
 /* FUNCTIONS *****************************************************************/
+.code
 
-.func RtlpGetStackLimits at 8
-.globl _RtlpGetStackLimits at 8
+PUBLIC _RtlpGetStackLimits at 8
 _RtlpGetStackLimits at 8:
 
     /* Get the current thread */
@@ -34,4 +34,5 @@
 
     /* return */
     ret 8
-.endfunc
+
+END




More information about the Ros-diffs mailing list