- Merge 26782, 26783, 26785, 26786

- Merge 26842, 26847, 26861, 26867
- Merge 26958

svn path=/branches/winldr/; revision=28287
This commit is contained in:
Aleksey Bragin
2007-08-11 14:32:39 +00:00
parent 6cac5e3b52
commit d39eaeec7b
32 changed files with 71 additions and 117 deletions
+41 -43
View File
@@ -19,8 +19,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
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;
}
}
}
+1 -1
View File
@@ -47,7 +47,7 @@ FindApmBios(VOID)
return TRUE;
}
printf("No APM BIOS found\n");
DbgPrint((DPRINT_HWDETECT, "No APM BIOS found\n"));
return FALSE;
}
+2 -2
View File
@@ -121,7 +121,7 @@ static BOOLEAN PcDiskReadLogicalSectorsLBA(ULONG DriveNumber, ULONGLONG SectorNu
}
// If we get here then the read failed
DiskError("Disk Read Failed", RegsOut.b.ah);
DiskError("Disk Read Failed in LBA mode", RegsOut.b.ah);
return FALSE;
}
@@ -244,7 +244,7 @@ static BOOLEAN PcDiskReadLogicalSectorsCHS(ULONG DriveNumber, ULONGLONG SectorNu
// If we retried 3 times then fail
if (RetryCount >= 3)
{
DiskError("Disk Read Failed", RegsOut.b.ah);
DiskError("Disk Read Failed in CHS mode, after retrying 3 times", RegsOut.b.ah);
return FALSE;
}
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
// Returns a pointer to a CACHE_BLOCK structure
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
///////////////////////////////////////////////////////////////////////////////////////
+6
View File
@@ -356,4 +356,10 @@ VOID DebugDumpBuffer(ULONG Mask, PVOID Buffer, ULONG Length)
}
}
#else
VOID DebugPrint(ULONG Mask, char *format, ...)
{
}
#endif // defined DBG
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
#undef UNIMPLEMENTED
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
BOOLEAN DiskGetActivePartitionEntry(ULONG DriveNumber,
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
#ifdef __i386__
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
VOID BootMain(LPSTR CmdLine)
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
GEOMETRY Ext2DiskGeometry; // Ext2 file system disk geometry
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
ULONG BytesPerSector; /* Number of bytes per sector */
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
/////////////////////////////////////////////////////////////////////////////////////////////
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
/////////////////////////////////////////////////////////////////////////////////////////////
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
#define SECTORSIZE 2048
-2
View File
@@ -24,8 +24,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
PNTFS_BOOTSECTOR NtfsBootSector;
+19 -18
View File
@@ -21,29 +21,30 @@
#ifndef __DEBUG_H
#define __DEBUG_H
#define DPRINT_NONE 0x00000000 // No debug print
#define DPRINT_WARNING 0x00000001 // OR this with DebugPrintMask to enable debugger messages and other misc stuff
#define DPRINT_MEMORY 0x00000002 // OR this with DebugPrintMask to enable memory management messages
#define DPRINT_FILESYSTEM 0x00000004 // OR this with DebugPrintMask to enable file system messages
#define DPRINT_INIFILE 0x00000008 // OR this with DebugPrintMask to enable .ini file messages
#define DPRINT_UI 0x00000010 // OR this with DebugPrintMask to enable user interface messages
#define DPRINT_DISK 0x00000020 // OR this with DebugPrintMask to enable disk messages
#define DPRINT_CACHE 0x00000040 // OR this with DebugPrintMask to enable cache messages
#define DPRINT_REGISTRY 0x00000080 // OR this with DebugPrintMask to enable registry messages
#define DPRINT_REACTOS 0x00000100 // OR this with DebugPrintMask to enable ReactOS messages
#define DPRINT_LINUX 0x00000200 // OR this with DebugPrintMask to enable Linux messages
#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
#define DPRINT_NONE 0x00000000 // No debug print
#define DPRINT_WARNING 0x00000001 // OR this with DebugPrintMask to enable debugger messages and other misc stuff
#define DPRINT_MEMORY 0x00000002 // OR this with DebugPrintMask to enable memory management messages
#define DPRINT_FILESYSTEM 0x00000004 // OR this with DebugPrintMask to enable file system messages
#define DPRINT_INIFILE 0x00000008 // OR this with DebugPrintMask to enable .ini file messages
#define DPRINT_UI 0x00000010 // OR this with DebugPrintMask to enable user interface messages
#define DPRINT_DISK 0x00000020 // OR this with DebugPrintMask to enable disk messages
#define DPRINT_CACHE 0x00000040 // OR this with DebugPrintMask to enable cache messages
#define DPRINT_REGISTRY 0x00000080 // OR this with DebugPrintMask to enable registry messages
#define DPRINT_REACTOS 0x00000100 // OR this with DebugPrintMask to enable ReactOS messages
#define DPRINT_LINUX 0x00000200 // OR this with DebugPrintMask to enable Linux messages
#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 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,8 +78,8 @@ void MEMORY_WRITE_BREAKPOINT4(unsigned long addr);
#else
#define DebugInit()
#define DbgPrint(_x_)
#define DPRINT1(_x_)
#define DbgPrint(_x_) { if (0) DebugPrint _x_; }
#define DPRINT1(_x_) { if (0) printf _x_; }
#define BugCheck(_x_)
#define DbgDumpBuffer(_x_, _y_, _z_)
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
BOOLEAN IniOpenSection(PCSTR SectionName, ULONG* SectionId)
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
PINI_SECTION IniFileSectionListHead = NULL;
-2
View File
@@ -19,8 +19,6 @@
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
#ifdef __i386__
-2
View File
@@ -19,8 +19,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
#ifdef DBG
+1 -3
View File
@@ -19,13 +19,11 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
#ifdef DBG
ULONG AllocationCount = 0;
#ifdef DBG
VOID VerifyHeap(VOID);
VOID DumpMemoryAllocMap(VOID);
VOID IncrementAllocationCount(VOID);
-2
View File
@@ -21,8 +21,6 @@
#include <freeldr.h>
#include <cmlib.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS ****************************************************************/
-2
View File
@@ -20,8 +20,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
ROS_LOADER_PARAMETER_BLOCK LoaderBlock;
-2
View File
@@ -19,8 +19,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
static FRLDRHKEY RootKey;
+1
View File
@@ -19,6 +19,7 @@
*/
#include <freeldr.h>
#include <debug.h>
ROS_LOADER_PARAMETER_BLOCK LoaderBlock;
char reactos_kernel_cmdline[255]; // Command line passed to kernel
-2
View File
@@ -18,8 +18,6 @@
*/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
-2
View File
@@ -11,8 +11,6 @@
#include <freeldr.h>
//#include <ndk/ldrtypes.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS **************************************************************/
-2
View File
@@ -15,8 +15,6 @@
/* INCLUDES ***************************************************************/
#include <freeldr.h>
//#define NDEBUG
#include <debug.h>
-2
View File
@@ -22,8 +22,6 @@
#include <freeldr.h>
#include <ndk/ldrtypes.h>
//#define NDEBUG
#include <debug.h>
//FIXME: Do a better way to retrieve Arc disk information
-2
View File
@@ -11,8 +11,6 @@
#include <freeldr.h>
#include <ndk/asm.h>
#define NDEBUG
#include <debug.h>
extern ULONG TotalNLSSize;
-2
View File
@@ -9,8 +9,6 @@
/* INCLUDES ***************************************************************/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
// The only global var here, used to mark mem pages as NLS in WinLdrTurnOnPaging()