From 41624f4f99fc02bee285bb9da13144cbb2a10c3d Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Mon, 21 May 2007 23:12:16 +0000 Subject: [PATCH] - fix the release build for Colin. - clean up formatting of a file I was playing with. svn path=/trunk/; revision=26861 --- .../boot/freeldr/freeldr/arch/i386/hwacpi.c | 84 +++++++++---------- reactos/boot/freeldr/freeldr/include/debug.h | 7 +- 2 files changed, 45 insertions(+), 46 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c b/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c index 51403262bdf..36e7b770a66 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c @@ -19,8 +19,6 @@ */ #include - -#define NDEBUG #include BOOLEAN AcpiPresent = FALSE; @@ -28,49 +26,49 @@ BOOLEAN AcpiPresent = FALSE; static BOOLEAN FindAcpiBios(VOID) { - PUCHAR Ptr; + PUCHAR Ptr; - /* Find the 'Root System Descriptor Table Pointer' */ - Ptr = (PUCHAR)0xE0000; - while ((ULONG)Ptr < 0x100000) + /* Find the 'Root System Descriptor Table Pointer' */ + Ptr = (PUCHAR)0xE0000; + while ((ULONG)Ptr < 0x100000) { - if (!memcmp(Ptr, "RSD PTR ", 8)) - { - DbgPrint((DPRINT_HWDETECT, "ACPI supported\n")); + if (!memcmp(Ptr, "RSD PTR ", 8)) + { + DbgPrint((DPRINT_HWDETECT, "ACPI supported\n")); - return TRUE; - } + return TRUE; + } - Ptr = (PUCHAR)((ULONG)Ptr + 0x10); + Ptr = (PUCHAR)((ULONG)Ptr + 0x10); } - DbgPrint((DPRINT_HWDETECT, "ACPI not supported\n")); + DbgPrint((DPRINT_HWDETECT, "ACPI not supported\n")); - return FALSE; + return FALSE; } VOID DetectAcpiBios(FRLDRHKEY SystemKey, ULONG *BusNumber) { - WCHAR Buffer[80]; - FRLDRHKEY BiosKey; - LONG Error; + WCHAR Buffer[80]; + FRLDRHKEY BiosKey; + LONG Error; - if (FindAcpiBios()) + if (FindAcpiBios()) { - AcpiPresent = TRUE; - /* Create new bus key */ - swprintf(Buffer, - L"MultifunctionAdapter\\%u", *BusNumber); - Error = RegCreateKey(SystemKey, - Buffer, - &BiosKey); - if (Error != ERROR_SUCCESS) - { - DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error)); - return; - } + AcpiPresent = TRUE; + /* Create new bus key */ + swprintf(Buffer, + L"MultifunctionAdapter\\%u", *BusNumber); + Error = RegCreateKey(SystemKey, + Buffer, + &BiosKey); + if (Error != ERROR_SUCCESS) + { + DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error)); + return; + } #if 0 /* Set 'Component Information' */ @@ -80,20 +78,20 @@ DetectAcpiBios(FRLDRHKEY SystemKey, ULONG *BusNumber) 0xFFFFFFFF); #endif - /* Increment bus number */ - (*BusNumber)++; + /* Increment bus number */ + (*BusNumber)++; - /* Set 'Identifier' value */ - Error = RegSetValue(BiosKey, - L"Identifier", - REG_SZ, - (PCHAR)L"ACPI BIOS", - 10 * sizeof(WCHAR)); - if (Error != ERROR_SUCCESS) - { - DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error)); - return; - } + /* Set 'Identifier' value */ + Error = RegSetValue(BiosKey, + L"Identifier", + REG_SZ, + (PCHAR)L"ACPI BIOS", + 10 * sizeof(WCHAR)); + if (Error != ERROR_SUCCESS) + { + DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error)); + return; + } } } diff --git a/reactos/boot/freeldr/freeldr/include/debug.h b/reactos/boot/freeldr/freeldr/include/debug.h index e43b9f7a0cc..a1b19beff2e 100644 --- a/reactos/boot/freeldr/freeldr/include/debug.h +++ b/reactos/boot/freeldr/freeldr/include/debug.h @@ -35,15 +35,16 @@ #define DPRINT_HWDETECT 0x00000400 // OR this with DebugPrintMask to enable hardware detection messages #define DPRINT_WINDOWS 0x00000800 // OR this with DebugPrintMask to enable messages from Windows loader +VOID DebugPrint(ULONG Mask, char *format, ...); + #ifdef DBG VOID DebugInit(VOID); - VOID DebugPrint(ULONG Mask, char *format, ...); VOID DebugPrint1(char *format, ...); VOID DebugDumpBuffer(ULONG Mask, PVOID Buffer, ULONG Length); #define DbgPrint(_x_) DebugPrint _x_ ; - #define DPRINT1 DebugPrint1 + #define DPRINT1 DebugPrint1 #define BugCheck(_x_) { DebugPrint(DPRINT_WARNING, "Fatal Error: %s:%d(%s)\n", __FILE__, __LINE__, __FUNCTION__); DebugPrint _x_ ; for (;;); } #define DbgDumpBuffer(_x_, _y_, _z_) DebugDumpBuffer(_x_, _y_, _z_) @@ -77,7 +78,7 @@ void MEMORY_WRITE_BREAKPOINT4(unsigned long addr); #else #define DebugInit() - #define DbgPrint(_x_) { if (0) DebugPrint _x_; } + #define DbgPrint(_x_) { if (0) DebugPrint _x_; } #define DPRINT1(_x_) { if (0) printf _x_; } #define BugCheck(_x_) #define DbgDumpBuffer(_x_, _y_, _z_)