Author: tkreuzer
Date: Sun Nov 14 13:36:25 2010
New Revision: 49583
URL:
http://svn.reactos.org/svn/reactos?rev=49583&view=rev
Log:
[FREELDR]
- Use macro __ASM__ instead of ASM
- guard #pragma once against inclusion in asm files
- Use the HEX() macro for constants for the asm files
Modified:
branches/cmake-bringup/boot/freeldr/freeldr/include/arch.h
branches/cmake-bringup/boot/freeldr/freeldr/include/multiboot.h
branches/cmake-bringup/boot/freeldr/freeldr/include/ver.h
Modified: branches/cmake-bringup/boot/freeldr/freeldr/include/arch.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/boot/freeldr/free…
==============================================================================
--- branches/cmake-bringup/boot/freeldr/freeldr/include/arch.h [iso-8859-1] (original)
+++ branches/cmake-bringup/boot/freeldr/freeldr/include/arch.h [iso-8859-1] Sun Nov 14
13:36:25 2010
@@ -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: branches/cmake-bringup/boot/freeldr/freeldr/include/multiboot.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/boot/freeldr/free…
==============================================================================
--- branches/cmake-bringup/boot/freeldr/freeldr/include/multiboot.h [iso-8859-1]
(original)
+++ branches/cmake-bringup/boot/freeldr/freeldr/include/multiboot.h [iso-8859-1] Sun Nov
14 13:36:25 2010
@@ -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: branches/cmake-bringup/boot/freeldr/freeldr/include/ver.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/boot/freeldr/free…
==============================================================================
--- branches/cmake-bringup/boot/freeldr/freeldr/include/ver.h [iso-8859-1] (original)
+++ branches/cmake-bringup/boot/freeldr/freeldr/include/ver.h [iso-8859-1] Sun Nov 14
13:36:25 2010
@@ -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__