Author: tkreuzer
Date: Fri May 13 19:51:09 2011
New Revision: 51708
URL:
http://svn.reactos.org/svn/reactos?rev=51708&view=rev
Log:
[FREELDR/HAL/NTOSKRNL]
Merge asm changes from cmake branch. No code change, only MSVC compatibility fixes
Modified:
trunk/reactos/boot/freeldr/freeldr/include/arch.h
trunk/reactos/boot/freeldr/freeldr/include/multiboot.h
trunk/reactos/boot/freeldr/freeldr/include/ver.h
trunk/reactos/hal/halx86/mp/i386/mps.S
trunk/reactos/ntoskrnl/ex/zw.S
trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S
trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/arch.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch.h [iso-8859-1] Fri May 13 19:51:09
2011
@@ -17,7 +17,13 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifndef __ASM__
#pragma once
+#endif
+
+#ifndef HEX
+#define HEX(y) 0x##y
+#endif
#ifdef _M_AMD64
#include <arch/amd64/amd64.h>
@@ -25,18 +31,18 @@
#if defined (_M_IX86)
/* Defines needed for switching between real and protected mode */
-#define NULL_DESC 0x00 /* NULL descriptor */
-#define PMODE_CS 0x08 /* PMode code selector, base 0 limit 4g */
-#define PMODE_DS 0x10 /* PMode data selector, base 0 limit 4g */
-#define RMODE_CS 0x18 /* RMode code selector, base 0 limit 64k */
-#define RMODE_DS 0x20 /* RMode data selector, base 0 limit 64k */
+#define NULL_DESC HEX(00) /* NULL descriptor */
+#define PMODE_CS HEX(08) /* PMode code selector, base 0 limit 4g */
+#define PMODE_DS HEX(10) /* PMode data selector, base 0 limit 4g */
+#define RMODE_CS HEX(18) /* RMode code selector, base 0 limit 64k */
+#define RMODE_DS HEX(20) /* RMode data selector, base 0 limit 64k */
#endif
-#define CR0_PE_SET 0x00000001 /* OR this value with CR0 to enable pmode */
-#define CR0_PE_CLR 0xFFFFFFFE /* AND this value with CR0 to disable pmode */
+#define CR0_PE_SET HEX(00000001) /* OR this value with CR0 to enable pmode */
+#define CR0_PE_CLR HEX(FFFFFFFE) /* AND this value with CR0 to disable pmode */
-#define STACK16ADDR 0x7000 /* The 16-bit stack top will be at 0000:7000 */
-#define STACK32ADDR 0x78000 /* The 32-bit stack top will be at 7000:8000, or 0x78000 */
+#define STACK16ADDR HEX(7000) /* The 16-bit stack top will be at 0000:7000 */
+#define STACK32ADDR HEX(78000) /* The 32-bit stack top will be at 7000:8000, or 0x78000
*/
#if defined (_M_IX86) || defined (_M_AMD64)
#define BIOSCALLBUFFER 0x78000 /* Buffer to store temporary data for any Int386() call
*/
@@ -59,21 +65,21 @@
// Flag Masks
-#define I386FLAG_CF 0x0001 // Carry Flag
-#define I386FLAG_RESV1 0x0002 // Reserved - Must be 1
-#define I386FLAG_PF 0x0004 // Parity Flag
-#define I386FLAG_RESV2 0x0008 // Reserved - Must be 0
-#define I386FLAG_AF 0x0010 // Auxiliary Flag
-#define I386FLAG_RESV3 0x0020 // Reserved - Must be 0
-#define I386FLAG_ZF 0x0040 // Zero Flag
-#define I386FLAG_SF 0x0080 // Sign Flag
-#define I386FLAG_TF 0x0100 // Trap Flag (Single Step)
-#define I386FLAG_IF 0x0200 // Interrupt Flag
-#define I386FLAG_DF 0x0400 // Direction Flag
-#define I386FLAG_OF 0x0800 // Overflow Flag
+#define I386FLAG_CF HEX(0001) // Carry Flag
+#define I386FLAG_RESV1 HEX(0002) // Reserved - Must be 1
+#define I386FLAG_PF HEX(0004) // Parity Flag
+#define I386FLAG_RESV2 HEX(0008) // Reserved - Must be 0
+#define I386FLAG_AF HEX(0010) // Auxiliary Flag
+#define I386FLAG_RESV3 HEX(0020) // Reserved - Must be 0
+#define I386FLAG_ZF HEX(0040) // Zero Flag
+#define I386FLAG_SF HEX(0080) // Sign Flag
+#define I386FLAG_TF HEX(0100) // Trap Flag (Single Step)
+#define I386FLAG_IF HEX(0200) // Interrupt Flag
+#define I386FLAG_DF HEX(0400) // Direction Flag
+#define I386FLAG_OF HEX(0800) // Overflow Flag
-#ifndef ASM
+#ifndef __ASM__
#include <pshpack1.h>
typedef struct
@@ -172,4 +178,4 @@
VOID DetectHardware(VOID); // Implemented in hardware.c
-#endif /* ! ASM */
+#endif /* ! __ASM__ */
Modified: trunk/reactos/boot/freeldr/freeldr/include/multiboot.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/multiboot.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/multiboot.h [iso-8859-1] Fri May 13
19:51:09 2011
@@ -16,18 +16,20 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifndef __ASM__
#pragma once
+#endif
/* Macros. */
/* The magic number for the Multiboot header. */
-#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
+#define MULTIBOOT_HEADER_MAGIC HEX(1BADB002)
/* The flags for the Multiboot header. */
-#define MULTIBOOT_HEADER_FLAGS 0x00010003
+#define MULTIBOOT_HEADER_FLAGS HEX(00010003)
/* The magic number passed by a Multiboot-compliant boot loader. */
-#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
+#define MULTIBOOT_BOOTLOADER_MAGIC HEX(2BADB002)
/* The size of our stack (16KB). */
#define STACK_SIZE 0x4000
@@ -39,20 +41,20 @@
# define EXT_C(sym) sym
#endif
-#define MB_INFO_FLAG_MEM_SIZE 0x00000001
-#define MB_INFO_FLAG_BOOT_DEVICE 0x00000002
-#define MB_INFO_FLAG_COMMAND_LINE 0x00000004
-#define MB_INFO_FLAG_MODULES 0x00000008
-#define MB_INFO_FLAG_AOUT_SYMS 0x00000010
-#define MB_INFO_FLAG_ELF_SYMS 0x00000020
-#define MB_INFO_FLAG_MEMORY_MAP 0x00000040
-#define MB_INFO_FLAG_DRIVES 0x00000080
-#define MB_INFO_FLAG_CONFIG_TABLE 0x00000100
-#define MB_INFO_FLAG_BOOT_LOADER_NAME 0x00000200
-#define MB_INFO_FLAG_APM_TABLE 0x00000400
-#define MB_INFO_FLAG_GRAPHICS_TABLE 0x00000800
+#define MB_INFO_FLAG_MEM_SIZE HEX(00000001)
+#define MB_INFO_FLAG_BOOT_DEVICE HEX(00000002)
+#define MB_INFO_FLAG_COMMAND_LINE HEX(00000004)
+#define MB_INFO_FLAG_MODULES HEX(00000008)
+#define MB_INFO_FLAG_AOUT_SYMS HEX(00000010)
+#define MB_INFO_FLAG_ELF_SYMS HEX(00000020)
+#define MB_INFO_FLAG_MEMORY_MAP HEX(00000040)
+#define MB_INFO_FLAG_DRIVES HEX(00000080)
+#define MB_INFO_FLAG_CONFIG_TABLE HEX(00000100)
+#define MB_INFO_FLAG_BOOT_LOADER_NAME HEX(00000200)
+#define MB_INFO_FLAG_APM_TABLE HEX(00000400)
+#define MB_INFO_FLAG_GRAPHICS_TABLE HEX(00000800)
-#ifndef ASM
+#ifndef __ASM__
/* Do not include here in boot.S. */
/* Types. */
@@ -101,4 +103,4 @@
unsigned long reserved;
} memory_map_t;
-#endif /* ! ASM */
+#endif /* ! __ASM__ */
Modified: trunk/reactos/boot/freeldr/freeldr/include/ver.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/ver.h [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/ver.h [iso-8859-1] Fri May 13 19:51:09
2011
@@ -17,7 +17,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifndef __ASM__
#pragma once
+#endif
/* just some stuff */
#define VERSION "FreeLoader v3.0"
@@ -37,8 +39,8 @@
#define FREELOADER_PATCH_VERSION 0
-#ifndef ASM
+#ifndef __ASM__
PCHAR GetFreeLoaderVersionString(VOID);
-#endif // ASM
+#endif // __ASM__
Modified: trunk/reactos/hal/halx86/mp/i386/mps.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/mp/i386/mps.S?r…
==============================================================================
--- trunk/reactos/hal/halx86/mp/i386/mps.S [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/mp/i386/mps.S [iso-8859-1] Fri May 13 19:51:09 2011
@@ -11,7 +11,9 @@
/* INCLUDES ******************************************************************/
-#include <ndk/asm.h>
+#include <asm.inc>
+
+#include <ks386.inc>
/* FUNCTIONS *****************************************************************/
Modified: trunk/reactos/ntoskrnl/ex/zw.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/zw.S?rev=51708…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/zw.S [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/zw.S [iso-8859-1] Fri May 13 19:51:09 2011
@@ -1,6 +1,12 @@
#include <asm.inc>
#include <syscalls.inc>
+
+#ifdef _M_IX86
+EXTERN _KiSystemService:PROC
+#elif defined(_M_AMD64)
+EXTERN KiSystemService:PROC
+#endif
.code
Modified: trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/asmmacro.S [iso-8859-1] Fri May 13
19:51:09 2011
@@ -6,7 +6,7 @@
* PROGRAMMERS: Alex Ionescu (alex(a)relsoft.net)
* Timo Kreuzer (timo.kreuzer(a)reactos.org)
*/
-
+
// Arguments for idt
#define INT_32_DPL0 HEX(08E00)
#define INT_32_DPL3 HEX(0EE00)
@@ -43,7 +43,7 @@
#else
#define LOCK
#define ACQUIRE_SPINLOCK(x, y)
-#define RELEASE_SPINLOCK(x)
+#define RELEASE_SPINLOCK(x)
#endif
//
@@ -138,7 +138,7 @@
if (Flags AND KI_DONT_SAVE_SEGS)
/* Initialize TrapFrame segment registers with sane values */
- mov eax, 0x23
+ mov eax, KGDT_R3_DATA OR 3
mov ecx, fs
mov [esp + KTRAP_FRAME_DS], eax
mov [esp + KTRAP_FRAME_ES], eax
Modified: trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/usercall_…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/usercall_asm.S [iso-8859-1] Fri May 13 19:51:09 2011
@@ -15,6 +15,8 @@
EXTERN _MmGrowKernelStack@4:PROC
EXTERN _KeUserCallbackDispatcher:PROC
EXTERN @KiServiceExit@8:PROC
+EXTERN _KeGetCurrentIrql@0:PROC
+EXTERN _KeBugCheckEx@20:PROC
/* FUNCTIONS ****************************************************************/
.code
@@ -30,7 +32,7 @@
/*++
- * @name KiCallUserMode
+ * @name KiCallUserMode
*
* The KiSwitchToUserMode routine sets up a Trap Frame and a Callback stack
* for the purpose of switching to user mode. The actual final jump is done
@@ -406,7 +408,7 @@
ret 12
/*++
- * @name KeSwitchKernelStack
+ * @name KeSwitchKernelStack
*
* The KeSwitchKernelStack routine switches from the current thread's stack
* to the new specified base and limit.
@@ -419,7 +421,7 @@
*
* @return The previous Stack Base of the thread.
*
- * @remark This routine should typically only be used when converting from a
+ * @remark This routine should typically only be used when converting from a
* non-GUI to a GUI Thread. The caller is responsible for freeing the
* previous stack. The new stack values MUST be valid before calling
* this routine.