remove whitespace from end of lines

svn path=/trunk/; revision=15107
This commit is contained in:
Steven Edwards 2005-05-08 02:15:21 +00:00
parent 476cbed37c
commit 1e81d3ff1f
55 changed files with 403 additions and 403 deletions

View file

@ -57,7 +57,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
@ -65,9 +65,9 @@ int APIENTRY WinMain(HINSTANCE hInstance,
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_FDEBUG);
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
@ -96,7 +96,7 @@ ATOM MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)WndProc;
@ -156,7 +156,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
NONCLIENTMETRICS ncm;
HFONT hFont;
switch (message)
switch (message)
{
case WM_CREATE:
@ -174,7 +174,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
if (lParam == (LPARAM)hEditWnd && wmEvent == EN_CHANGE)
@ -312,7 +312,7 @@ LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
@ -340,7 +340,7 @@ LRESULT CALLBACK ConnectionDialogProc(HWND hDlg, UINT message, WPARAM wParam, LP
GetWindowText(GetDlgItem(hDlg, IDC_BAUTRATE), strBaudRate, MAX_PATH);
}
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
@ -392,7 +392,7 @@ LRESULT CALLBACK CaptureDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARA
GetWindowText(GetDlgItem(hDlg, IDC_CAPTUREFILENAME), strCaptureFileName, MAX_PATH);
}
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;

View file

@ -29,7 +29,7 @@
#define IDC_STATIC -1
// Next default values for new objects
//
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 132

View file

@ -83,16 +83,16 @@ BOOL Rs232ClosePortWin32(VOID)
// [in] Pointer to a null-terminated string that specifies device-control information.
// The string must have the same form as the mode command's command-line arguments.
//
// For example, the following string specifies a baud rate of 1200, no parity, 8 data bits, and 1 stop bit:
// For example, the following string specifies a baud rate of 1200, no parity, 8 data bits, and 1 stop bit:
// "baud=1200 parity=N data=8 stop=1"
//
// The following string specifies a baud rate of 115200, no parity, 8 data bits, and 1 stop bit:
// "115200,n,8,1"
//
// The device name is ignored if it is included in the string, but it must specify a valid device, as follows:
// The device name is ignored if it is included in the string, but it must specify a valid device, as follows:
// "COM1: baud=1200 parity=N data=8 stop=1"
//
// For further information on mode command syntax, refer to the end-user documentation for your operating system.
// For further information on mode command syntax, refer to the end-user documentation for your operating system.
BOOL Rs232ConfigurePortWin32(TCHAR* DeviceControlString)
{
DCB dcb;
@ -157,28 +157,28 @@ BOOL Rs232ConfigurePortWin32(TCHAR* DeviceControlString)
}
// Members
// ReadIntervalTimeout
// Specifies the maximum time, in milliseconds, allowed to elapse between the arrival of two characters on the communications line. During a ReadFile operation, the time period begins when the first character is received. If the interval between the arrival of any two characters exceeds this amount, the ReadFile operation is completed and any buffered data is returned. A value of zero indicates that interval time-outs are not used.
// A value of MAXDWORD, combined with zero values for both the ReadTotalTimeoutConstant and ReadTotalTimeoutMultiplier members, specifies that the read operation is to return immediately with the characters that have already been received, even if no characters have been received.
//
// ReadTotalTimeoutMultiplier
// Specifies the multiplier, in milliseconds, used to calculate the total time-out period for read operations. For each read operation, this value is multiplied by the requested number of bytes to be read.
// ReadTotalTimeoutConstant
// Specifies the constant, in milliseconds, used to calculate the total time-out period for read operations. For each read operation, this value is added to the product of the ReadTotalTimeoutMultiplier member and the requested number of bytes.
// A value of zero for both the ReadTotalTimeoutMultiplier and ReadTotalTimeoutConstant members indicates that total time-outs are not used for read operations.
//
// WriteTotalTimeoutMultiplier
// Specifies the multiplier, in milliseconds, used to calculate the total time-out period for write operations. For each write operation, this value is multiplied by the number of bytes to be written.
// WriteTotalTimeoutConstant
// Specifies the constant, in milliseconds, used to calculate the total time-out period for write operations. For each write operation, this value is added to the product of the WriteTotalTimeoutMultiplier member and the number of bytes to be written.
// A value of zero for both the WriteTotalTimeoutMultiplier and WriteTotalTimeoutConstant members indicates that total time-outs are not used for write operations.
//
// ReadIntervalTimeout
// Specifies the maximum time, in milliseconds, allowed to elapse between the arrival of two characters on the communications line. During a ReadFile operation, the time period begins when the first character is received. If the interval between the arrival of any two characters exceeds this amount, the ReadFile operation is completed and any buffered data is returned. A value of zero indicates that interval time-outs are not used.
// A value of MAXDWORD, combined with zero values for both the ReadTotalTimeoutConstant and ReadTotalTimeoutMultiplier members, specifies that the read operation is to return immediately with the characters that have already been received, even if no characters have been received.
//
// ReadTotalTimeoutMultiplier
// Specifies the multiplier, in milliseconds, used to calculate the total time-out period for read operations. For each read operation, this value is multiplied by the requested number of bytes to be read.
// ReadTotalTimeoutConstant
// Specifies the constant, in milliseconds, used to calculate the total time-out period for read operations. For each read operation, this value is added to the product of the ReadTotalTimeoutMultiplier member and the requested number of bytes.
// A value of zero for both the ReadTotalTimeoutMultiplier and ReadTotalTimeoutConstant members indicates that total time-outs are not used for read operations.
//
// WriteTotalTimeoutMultiplier
// Specifies the multiplier, in milliseconds, used to calculate the total time-out period for write operations. For each write operation, this value is multiplied by the number of bytes to be written.
// WriteTotalTimeoutConstant
// Specifies the constant, in milliseconds, used to calculate the total time-out period for write operations. For each write operation, this value is added to the product of the WriteTotalTimeoutMultiplier member and the number of bytes to be written.
// A value of zero for both the WriteTotalTimeoutMultiplier and WriteTotalTimeoutConstant members indicates that total time-outs are not used for write operations.
//
// Remarks
// If an application sets ReadIntervalTimeout and ReadTotalTimeoutMultiplier to MAXDWORD and sets ReadTotalTimeoutConstant to a value greater than zero and less than MAXDWORD, one of the following occurs when the ReadFile function is called:
//
// If there are any characters in the input buffer, ReadFile returns immediately with the characters in the buffer.
// If there are no characters in the input buffer, ReadFile waits until a character arrives and then returns immediately.
// If no character arrives within the time specified by ReadTotalTimeoutConstant, ReadFile times out.
// If an application sets ReadIntervalTimeout and ReadTotalTimeoutMultiplier to MAXDWORD and sets ReadTotalTimeoutConstant to a value greater than zero and less than MAXDWORD, one of the following occurs when the ReadFile function is called:
//
// If there are any characters in the input buffer, ReadFile returns immediately with the characters in the buffer.
// If there are no characters in the input buffer, ReadFile waits until a character arrives and then returns immediately.
// If no character arrives within the time specified by ReadTotalTimeoutConstant, ReadFile times out.
BOOL Rs232SetCommunicationTimeoutsWin32(DWORD ReadIntervalTimeout, DWORD ReadTotalTimeoutMultiplier, DWORD ReadTotalTimeoutConstant, DWORD WriteTotalTimeoutMultiplier, DWORD WriteTotalTimeoutConstant)
{
COMMTIMEOUTS ct;

View file

@ -197,44 +197,44 @@ HalpCalibrateStallExecution(VOID)
WRITE_PORT_UCHAR((PUCHAR)0x43, 0x34); /* binary, mode 2, LSB/MSB, ch 0 */
WRITE_PORT_UCHAR((PUCHAR)0x40, LATCH & 0xff); /* LSB */
WRITE_PORT_UCHAR((PUCHAR)0x40, LATCH >> 8); /* MSB */
/* Stage 1: Coarse calibration */
WaitFor8254Wraparound();
delay_count = 1;
do {
delay_count <<= 1; /* Next delay count to try */
WaitFor8254Wraparound();
__StallExecutionProcessor(delay_count); /* Do the delay */
CurCount = Read8254Timer();
} while (CurCount > LATCH / 2);
delay_count >>= 1; /* Get bottom value for delay */
/* Stage 2: Fine calibration */
calib_bit = delay_count; /* Which bit are we going to test */
for(i=0;i<PRECISION;i++) {
calib_bit >>= 1; /* Next bit to calibrate */
if(!calib_bit) break; /* If we have done all bits, stop */
delay_count |= calib_bit; /* Set the bit in delay_count */
WaitFor8254Wraparound();
__StallExecutionProcessor(delay_count); /* Do the delay */
CurCount = Read8254Timer();
if (CurCount <= LATCH / 2) /* If a tick has passed, turn the */
delay_count &= ~calib_bit; /* calibrated bit back off */
}
/* We're finished: Do the finishing touches */
delay_count /= (MILLISEC / 2); /* Calculate delay_count for 1ms */
}

View file

@ -464,7 +464,7 @@ GetMpConfigurationTable(PMP_FLOATING_POINT_TABLE FpTable)
if (ConfigTable->Signature != MP_CT_SIGNATURE)
return NULL;
DbgPrint((DPRINT_HWDETECT,
DbgPrint((DPRINT_HWDETECT,
"MP Configuration Table at: %x\n",
(ULONG)ConfigTable));
@ -538,7 +538,7 @@ DetectMps(FRLDRHKEY CpuKey,
CpuEntry = (PMP_PROCESSOR_ENTRY)Ptr;
DbgPrint((DPRINT_HWDETECT, "Processor Entry\n"));
DbgPrint((DPRINT_HWDETECT,
DbgPrint((DPRINT_HWDETECT,
"APIC Id %u APIC Version %u Flags %x Signature %x Feature %x\n",
CpuEntry->LocalApicId,
CpuEntry->LocalApicVersion,

View file

@ -168,7 +168,7 @@ BOOL DiskGetExtendedDriveParameters(ULONG DriveNumber, PVOID Buffer, USHORT Buff
return TRUE;
}
BOOL i386DiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType)
BOOL i386DiskGetBootVolume(PULONG DriveNumber, PULONGLONG StartSector, PULONGLONG SectorCount, int *FsType)
{
PARTITION_TABLE_ENTRY PartitionTableEntry;
UCHAR VolumeType;

View file

@ -47,12 +47,12 @@ void delay(unsigned msec)
// interrupt from the AT real-time clock chip which is available on INT 70;
// because newer BIOSes may have much more precise timers available, it is
// not possible to use this function accurately for very short delays unless
// the precise behavior of the BIOS is known (or found through testing)
// the precise behavior of the BIOS is known (or found through testing)
while (msec)
{
msec_this = msec;
if (msec_this > 4000)
{
msec_this = 4000;

View file

@ -88,7 +88,7 @@ typedef struct
// A search must then be made to find them, FFFFh will also terminate this
// second list. In some cases, only a "stub" VBE may be present, supporting
// only AX=4F00h; this case may be assumed if the list of supported video modes
// is empty (consisting of a single word of FFFFh)
// is empty (consisting of a single word of FFFFh)
VOID BiosSetVideoFont8x16(VOID)
{

View file

@ -136,7 +136,7 @@ PcVideoDetectVideoCard(VOID)
* CH = feature connector bits
* CL = switch settings
* AH destroyed (at least by Tseng ET4000 BIOS v8.00n)
*
*
* Installation check;EGA
*/
Regs.b.ah = 0x12;
@ -161,7 +161,7 @@ PcVideoDetectVideoCard(VOID)
* This function is commonly used to check for the presence of a VGA.
*
* Installation check;VGA
*
*
* Values for display combination code:
* 00h no display
* 01h monochrome adapter w/ monochrome display
@ -309,15 +309,15 @@ PcVideoDefineCursor(ULONG StartScanLine, ULONG EndScanLine)
* CL = bottom scan line containing cursor (bits 0-4)
* Return:
* Nothing
*
*
* Specify the starting and ending scan lines to be occupied
* by the hardware cursor in text modes.
*
* AMI 386 BIOS and AST Premier 386 BIOS will lock up the
* system if AL is not equal to the current video mode.
*
*
* Bitfields for cursor start and options:
*
*
* Bit(s) Description
* 7 should be zero
* 6,5 cursor blink
@ -460,7 +460,7 @@ PcVideoVesaGetSVGAModeInformation(USHORT Mode, PSVGA_MODE_INFORMATION ModeInform
*
* Note: While VBE 1.1 and higher will zero out all unused bytes
* of the buffer, v1.0 did not, so applications that want to be
* backward compatible should clear the buffer before calling
* backward compatible should clear the buffer before calling
*/
Regs.w.ax = 0x4F01;
Regs.w.cx = Mode;
@ -563,7 +563,7 @@ PcVideoSetBiosVesaMode(USHORT Mode)
* 121h 1600x1200x32K
* 122h 1600x1200x64K
* 81FFh special full-memory access mode
*
*
* Notes: The special mode 81FFh preserves the contents of the video memory and gives
* access to all of the memory; VESA recommends that the special mode be a packed-pixel
* mode. For VBE 2.0+, it is required that the VBE implement the mode, but not place it

View file

@ -58,8 +58,8 @@ READ_PORT_BUFFER_UCHAR (PUCHAR Port,
PUCHAR Buffer,
ULONG Count)
{
__asm__ __volatile__ ("cld ; rep ; insb\n\t"
: "=D" (Buffer), "=c" (Count)
__asm__ __volatile__ ("cld ; rep ; insb\n\t"
: "=D" (Buffer), "=c" (Count)
: "d" (Port),"0" (Buffer),"1" (Count));
}
@ -71,7 +71,7 @@ READ_PORT_BUFFER_USHORT (USHORT* Port,
ULONG Count)
{
__asm__ __volatile__ ("cld ; rep ; insw"
: "=D" (Buffer), "=c" (Count)
: "=D" (Buffer), "=c" (Count)
: "d" (Port),"0" (Buffer),"1" (Count));
}
@ -83,17 +83,17 @@ READ_PORT_BUFFER_ULONG (ULONG* Port,
ULONG Count)
{
__asm__ __volatile__ ("cld ; rep ; insl"
: "=D" (Buffer), "=c" (Count)
: "=D" (Buffer), "=c" (Count)
: "d" (Port),"0" (Buffer),"1" (Count));
}
#undef READ_PORT_UCHAR
UCHAR
UCHAR
STDCALL
READ_PORT_UCHAR (PUCHAR Port)
{
UCHAR Value;
__asm__("inb %w1, %0\n\t"
: "=a" (Value)
: "d" (Port));
@ -107,7 +107,7 @@ STDCALL
READ_PORT_USHORT (USHORT* Port)
{
USHORT Value;
__asm__("inw %w1, %0\n\t"
: "=a" (Value)
: "d" (Port));
@ -121,7 +121,7 @@ STDCALL
READ_PORT_ULONG (ULONG* Port)
{
ULONG Value;
__asm__("inl %w1, %0\n\t"
: "=a" (Value)
: "d" (Port));
@ -130,14 +130,14 @@ READ_PORT_ULONG (ULONG* Port)
}
#undef WRITE_PORT_BUFFER_UCHAR
VOID
VOID
STDCALL
WRITE_PORT_BUFFER_UCHAR (PUCHAR Port,
PUCHAR Buffer,
ULONG Count)
{
__asm__ __volatile__ ("cld ; rep ; outsb"
: "=S" (Buffer), "=c" (Count)
__asm__ __volatile__ ("cld ; rep ; outsb"
: "=S" (Buffer), "=c" (Count)
: "d" (Port),"0" (Buffer),"1" (Count));
}
@ -149,7 +149,7 @@ WRITE_PORT_BUFFER_USHORT (USHORT* Port,
ULONG Count)
{
__asm__ __volatile__ ("cld ; rep ; outsw"
: "=S" (Buffer), "=c" (Count)
: "=S" (Buffer), "=c" (Count)
: "d" (Port),"0" (Buffer),"1" (Count));
}
@ -160,8 +160,8 @@ WRITE_PORT_BUFFER_ULONG (ULONG* Port,
ULONG* Buffer,
ULONG Count)
{
__asm__ __volatile__ ("cld ; rep ; outsl"
: "=S" (Buffer), "=c" (Count)
__asm__ __volatile__ ("cld ; rep ; outsl"
: "=S" (Buffer), "=c" (Count)
: "d" (Port),"0" (Buffer),"1" (Count));
}
@ -172,7 +172,7 @@ WRITE_PORT_UCHAR (PUCHAR Port,
UCHAR Value)
{
__asm__("outb %0, %w1\n\t"
:
:
: "a" (Value),
"d" (Port));
SLOW_DOWN_IO;
@ -185,7 +185,7 @@ WRITE_PORT_USHORT (USHORT* Port,
USHORT Value)
{
__asm__("outw %0, %w1\n\t"
:
:
: "a" (Value),
"d" (Port));
SLOW_DOWN_IO;
@ -198,7 +198,7 @@ WRITE_PORT_ULONG (ULONG* Port,
ULONG Value)
{
__asm__("outl %0, %w1\n\t"
:
:
: "a" (Value),
"d" (Port));
SLOW_DOWN_IO;

View file

@ -149,7 +149,7 @@ static struct
#define IDEWriteDMAStatus(Address, Data) \
(WRITE_PORT_UCHAR((PUCHAR)((Address) + 2), (Data)))
#define IDEWritePRDTable(Address, Data) \
(WRITE_PORT_ULONG((PULONG)((Address) + 4), (Data)))
(WRITE_PORT_ULONG((PULONG)((Address) + 4), (Data)))
/*
* Data block read and write commands

View file

@ -31,11 +31,11 @@ static int chosen_package, stdin_handle;
BOOLEAN AcpiPresent = FALSE;
char BootPath[0x100];
void le_swap( const void *start_addr_v,
const void *end_addr_v,
void le_swap( const void *start_addr_v,
const void *end_addr_v,
const void *target_addr_v ) {
long *start_addr = (long *)ROUND_DOWN((long)start_addr_v,8),
*end_addr = (long *)ROUND_UP((long)end_addr_v,8),
long *start_addr = (long *)ROUND_DOWN((long)start_addr_v,8),
*end_addr = (long *)ROUND_UP((long)end_addr_v,8),
*target_addr = (long *)ROUND_DOWN((long)target_addr_v,8);
long tmp;
while( start_addr <= end_addr ) {
@ -107,7 +107,7 @@ void ofw_print_number( int num ) {
void PpcPutChar( int ch ) {
char buf[3];
if( ch == 0x0a ) { buf[0] = 0x0d; buf[1] = 0x0a; }
if( ch == 0x0a ) { buf[0] = 0x0d; buf[1] = 0x0a; }
else { buf[0] = ch; buf[1] = 0; }
buf[2] = 0;
ofw_print_string( buf );
@ -167,12 +167,12 @@ BOOL PpcVideoIsPaletteFixed() {
return FALSE;
}
VOID PpcVideoSetPaletteColor( UCHAR Color,
VOID PpcVideoSetPaletteColor( UCHAR Color,
UCHAR Red, UCHAR Green, UCHAR Blue ) {
printf( "SetPaletteColor(%x,%x,%x,%x)\n", Color, Red, Green, Blue );
}
VOID PpcVideoGetPaletteColor( UCHAR Color,
VOID PpcVideoGetPaletteColor( UCHAR Color,
UCHAR *Red, UCHAR *Green, UCHAR *Blue ) {
printf( "GetPaletteColor(%x)\n", Color);
}
@ -198,7 +198,7 @@ ULONG PpcGetMemoryMap( PBIOS_MEMORY_MAP BiosMemoryMap,
BiosMemoryMap[0].BaseAddress = 0;
BiosMemoryMap[0].Length = 32 * 1024 * 1024; /* Assume 32 meg for now */
printf( "Returning memory map (%dk total)\n",
printf( "Returning memory map (%dk total)\n",
(int)BiosMemoryMap[0].Length / 1024 );
return 1;
@ -226,7 +226,7 @@ ULONG PpcDiskGetCacheableBlockCount( ULONG DriveNumber ) {
return 0;
}
VOID PpcRTCGetCurrentDateTime( PULONG Hear, PULONG Month, PULONG Day,
VOID PpcRTCGetCurrentDateTime( PULONG Hear, PULONG Month, PULONG Day,
PULONG Hour, PULONG Minute, PULONG Second ) {
printf("RTCGeturrentDateTime\n");
}
@ -256,7 +256,7 @@ void PpcInit( of_proxy the_ofproxy ) {
MachVtbl.VideoSetTextCursorPosition = PpcVideoSetTextCursorPosition;
MachVtbl.VideoHideShowTextCursor = PpcVideoHideShowTextCursor;
MachVtbl.VideoPutChar = PpcVideoPutChar;
MachVtbl.VideoCopyOffScreenBufferToVRAM =
MachVtbl.VideoCopyOffScreenBufferToVRAM =
PpcVideoCopyOffScreenBufferToVRAM;
MachVtbl.VideoIsPaletteFixed = PpcVideoIsPaletteFixed;
MachVtbl.VideoSetPaletteColor = PpcVideoSetPaletteColor;
@ -276,13 +276,13 @@ void PpcInit( of_proxy the_ofproxy ) {
MachVtbl.HwDetect = PpcHwDetect;
printf( "FreeLDR version [%s]\n", GetFreeLoaderVersionString() );
BootMain("freeldr-ppc");
BootMain("freeldr-ppc");
}
void MachInit(char *CmdLine) {
int len;
printf( "Determining boot device:\n" );
len = ofw_getprop(chosen_package, "bootpath",
len = ofw_getprop(chosen_package, "bootpath",
BootPath, sizeof(BootPath));
printf( "Got %d bytes of path\n", len );
BootPath[len] = 0;

View file

@ -89,7 +89,7 @@ PCACHE_BLOCK CacheInternalFindBlock(PCACHE_DRIVE CacheDrive, ULONG BlockNumber)
CacheBlock = (PCACHE_BLOCK)RtlListGetNext((PLIST_ITEM)CacheBlock);
}
}
return NULL;
}

View file

@ -18,7 +18,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <freeldr.h>
#include <cmdline.h>
#include <rtl.h>

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <rtl.h>
#include <ui.h>

View file

@ -109,7 +109,7 @@ BOOL DiskGetPartitionEntry(ULONG DriveNumber, ULONG PartitionNumber, PPARTITION_
// They want an extended partition entry so we will need
// to loop through all the extended partitions on the disk
// and return the one they want.
ExtendedPartitionNumber = PartitionNumber - 5;
// Set the initial relative starting sector to 0

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <drivemap.h>
#include <rtl.h>
@ -120,7 +120,7 @@ VOID DriveMapMapDrivesInSection(PCHAR SectionName)
BOOL DriveMapIsValidDriveString(PCHAR DriveString)
{
ULONG Index;
// Now verify that the user has given us appropriate strings
if ((strlen(DriveString) < 3) ||
((DriveString[0] != 'f') && (DriveString[0] != 'F') && (DriveString[0] != 'h') && (DriveString[0] != 'H')) ||

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <rtl.h>
#include <arch.h>

View file

@ -949,7 +949,7 @@ BOOL Ext2ReadInode(ULONG Inode, PEXT2_INODE InodeBuffer)
{
return FALSE;
}
// Copy the data to their buffer
RtlCopyMemory(InodeBuffer, (PVOID)(FILESYSBUFFER + (InodeOffsetInBlock * EXT3_INODE_SIZE(Ext2SuperBlock))), sizeof(EXT2_INODE));

View file

@ -318,8 +318,8 @@ ULONG FatDetermineFatType(PFAT_BOOTSECTOR FatBootSector, ULONG PartitionSectorCo
SectorsPerFat = FatBootSector->SectorsPerFat ? FatBootSector->SectorsPerFat : Fat32BootSector->SectorsPerFatBig;
TotalSectors = FatBootSector->TotalSectors ? FatBootSector->TotalSectors : FatBootSector->TotalSectorsBig;
DataSectorCount = TotalSectors - (FatBootSector->ReservedSectors + (FatBootSector->NumberOfFats * SectorsPerFat) + RootDirSectors);
//mjl
//mjl
if (FatBootSector->SectorsPerCluster == 0)
CountOfClusters = 0;
else
@ -861,7 +861,7 @@ BOOL FatGetFatEntry(ULONG Cluster, ULONG* ClusterPointer)
}
fat = *((USHORT *) ((PVOID)FILESYSBUFFER + ThisFatEntOffset));
if (Cluster & 0x0001)
if (Cluster & 0x0001)
fat = fat >> 4; /* Cluster number is ODD */
else
fat = fat & 0x0FFF; /* Cluster number is EVEN */
@ -870,7 +870,7 @@ BOOL FatGetFatEntry(ULONG Cluster, ULONG* ClusterPointer)
case FAT16:
case FATX16:
FatOffset = (Cluster * 2);
ThisFatSecNum = ActiveFatSectorStart + (FatOffset / BytesPerSector);
ThisFatEntOffset = (FatOffset % BytesPerSector);
@ -1111,7 +1111,7 @@ BOOL FatReadClusterChain(ULONG StartClusterNumber, ULONG NumberOfClusters, PVOID
break;
}
}
return TRUE;
}

View file

@ -46,7 +46,7 @@ typedef struct _FAT_BOOTSECTOR
UCHAR BootCodeAndData[448]; // The remainder of the boot sector
USHORT BootSectorMagic; // 0xAA55
} PACKED FAT_BOOTSECTOR, *PFAT_BOOTSECTOR;
typedef struct _FAT32_BOOTSECTOR
@ -82,7 +82,7 @@ typedef struct _FAT32_BOOTSECTOR
UCHAR BootCodeAndData[420]; // The remainder of the boot sector
USHORT BootSectorMagic; // 0xAA55
} PACKED FAT32_BOOTSECTOR, *PFAT32_BOOTSECTOR;
typedef struct _FATX_BOOTSECTOR
@ -93,7 +93,7 @@ typedef struct _FATX_BOOTSECTOR
USHORT NumberOfFats; /* Number of FAT tables */
ULONG Unknown; /* Always 0? */
UCHAR Unused[494]; /* Actually size should be 4078 (boot block is 4096 bytes) */
} PACKED FATX_BOOTSECTOR, *PFATX_BOOTSECTOR;
/*

View file

@ -139,7 +139,7 @@ PFILE FsOpenFile(PCHAR FileName)
{
FileName++;
}
//
// Check file system type and pass off to appropriate handler
//

View file

@ -110,7 +110,7 @@ BOOL NtfsFindAttribute(PNTFS_ATTR_CONTEXT Context, PNTFS_MFT_RECORD MftRecord, U
{
AttrName = (PWCHAR)((PCHAR)AttrRecord + AttrRecord->NameOffset);
if (!RtlCompareMemory(AttrName, Name, NameLength << 1))
{
{
/* Found it, fill up the context and return. */
Context->Record = AttrRecord;
if (AttrRecord->IsNonResident)
@ -125,7 +125,7 @@ BOOL NtfsFindAttribute(PNTFS_ATTR_CONTEXT Context, PNTFS_MFT_RECORD MftRecord, U
if (DataRunOffset != -1)
{
/* Normal run. */
Context->CacheRunStartLCN =
Context->CacheRunStartLCN =
Context->CacheRunLastLCN = DataRunOffset;
}
else
@ -200,7 +200,7 @@ ULONGLONG NtfsReadAttribute(PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, PCHAR
ULONGLONG CurrentOffset;
ULONGLONG ReadLength;
ULONGLONG AlreadyRead;
if (!Context->Record->IsNonResident)
{
if (Offset > Context->Record->Resident.ValueLength)
@ -286,7 +286,7 @@ ULONGLONG NtfsReadAttribute(PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, PCHAR
/*
* Go to next run in the list.
*/
if (*DataRun == 0)
break;
DataRun = NtfsDecodeRun(DataRun, &DataRunOffset, &DataRunLength);
@ -341,7 +341,7 @@ BOOL NtfsFixupRecord(PNTFS_RECORD Record)
BOOL NtfsReadMftRecord(ULONG MFTIndex, PNTFS_MFT_RECORD Buffer)
{
ULONGLONG BytesRead;
BytesRead = NtfsReadAttribute(&NtfsMFTContext, MFTIndex * NtfsMftRecordSize, (PCHAR)Buffer, NtfsMftRecordSize);
if (BytesRead != NtfsMftRecordSize)
return FALSE;
@ -433,7 +433,7 @@ BOOL NtfsFindMftRecord(ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIndex)
MmFreeMemory(MftRecord);
return FALSE;
}
IndexRecord = MmAllocateMemory(NtfsIndexRecordSize);
if (IndexRecord == NULL)
{
@ -514,7 +514,7 @@ BOOL NtfsFindMftRecord(ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIndex)
break;
RecordOffset += IndexBlockSize;
}
if (RecordOffset >= IndexAllocationSize)
{
break;
@ -533,7 +533,7 @@ BOOL NtfsFindMftRecord(ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIndex)
while (IndexEntry < IndexEntryEnd &&
!(IndexEntry->Flags & NTFS_INDEX_ENTRY_END))
{
{
if (NtfsCompareFileName(FileName, IndexEntry))
{
DbgPrint((DPRINT_FILESYSTEM, "File found\n"));
@ -551,7 +551,7 @@ BOOL NtfsFindMftRecord(ULONG MFTIndex, PCHAR FileName, ULONG *OutMFTIndex)
MmFreeMemory(BitmapData);
}
MmFreeMemory(IndexRecord);
}
else

View file

@ -57,7 +57,7 @@
#define NTFS_FILE_NAME_POSIX 0
#define NTFS_FILE_NAME_WIN32 1
#define NTFS_FILE_NAME_DOS 2
#define NTFS_FILE_NAME_WIN32_AND_DOS 3
#define NTFS_FILE_NAME_WIN32_AND_DOS 3
typedef struct
{

View file

@ -37,7 +37,7 @@
#define ROUND_UP(N, S) (((N) + (S) - 1) & ~((S) - 1))
#define ROUND_DOWN(N, S) ((N) & ~((S) - 1))
#define Ke386EraseFlags(x) __asm__ __volatile__("pushl $0 ; popfl\n")
extern BOOL UserInterfaceUp; /* Tells us if the user interface is displayed */
VOID BootMain(LPSTR CmdLine);

View file

@ -102,9 +102,9 @@ typedef struct
ULONG Code32Start; // here loaders can put a different
// start address for 32-bit code.
//
//
// 0x1000 = default for zImage
//
//
// 0x100000 = default for big kernel
ULONG RamdiskAddress; // address of loaded ramdisk image

View file

@ -39,7 +39,7 @@ typedef struct tagMACHVTBL
VOID (*ConsPutChar)(int Ch);
BOOL (*ConsKbHit)(VOID);
int (*ConsGetCh)(VOID);
VOID (*VideoClearScreen)(UCHAR Attr);
VIDEODISPLAYMODE (*VideoSetDisplayMode)(char *DisplayMode, BOOL Init);
VOID (*VideoGetDisplaySize)(PULONG Width, PULONG Height, PULONG Depth);

View file

@ -1,16 +1,16 @@
/* multiboot.h - the header for Multiboot */
/* Copyright (C) 1999 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
@ -157,48 +157,48 @@ ULONG_PTR
STDCALL
FrLdrCreateModule(LPSTR ModuleName);
ULONG_PTR
STDCALL
FrLdrLoadModule(FILE *ModuleImage,
LPSTR ModuleName,
ULONG_PTR
STDCALL
FrLdrLoadModule(FILE *ModuleImage,
LPSTR ModuleName,
PULONG ModuleSize);
BOOL
STDCALL
FrLdrLoadKernel(PCHAR szFileName,
INT nPos);
BOOL
FrLdrLoadNlsFile(PCHAR szSystemRoot,
FrLdrLoadNlsFile(PCHAR szSystemRoot,
PCHAR szErrorOut);
BOOL
FrLdrLoadDriver(PCHAR szFileName,
FrLdrLoadDriver(PCHAR szFileName,
INT nPos);
BOOL
LoadSymbolFile(PCHAR szSystemRoot,
PCHAR ModuleName,
INT nPos);
VOID
FrLdrLoadBootDrivers(PCHAR szSystemRoot,
FrLdrLoadBootDrivers(PCHAR szSystemRoot,
INT nPos);
BOOL
STDCALL
FrLdrCloseModule(ULONG_PTR ModuleBase,
FrLdrCloseModule(ULONG_PTR ModuleBase,
ULONG dwModuleSize);
VOID
STDCALL
STDCALL
FrLdrStartup(ULONG Magic);
VOID
FASTCALL
VOID
FASTCALL
FrLdrGetKernelBase(VOID);
VOID
FASTCALL
VOID
FASTCALL
FrLdrSetupPae(ULONG Magic);
VOID
@ -206,7 +206,7 @@ FASTCALL
FrLdrGetPaeMode(VOID);
VOID
FASTCALL
FASTCALL
FrLdrSetupPageDirectory(VOID);
VOID

View file

@ -88,7 +88,7 @@ typedef struct _LIST_ITEM
{
struct _LIST_ITEM* ListPrev;
struct _LIST_ITEM* ListNext;
} LIST_ITEM, *PLIST_ITEM;
VOID RtlListInitializeHead(PLIST_ITEM ListHead); // Initializes a doubly linked list

View file

@ -113,7 +113,7 @@ BOOL IniParseFile(PCHAR IniFileData, ULONG IniFileSize)
{
RtlListInsertTail((PLIST_ITEM)IniFileSectionListHead, (PLIST_ITEM)CurrentSection);
}
CurrentLineNumber++;
continue;
}

View file

@ -17,7 +17,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <arch.h>
#include <disk.h>

View file

@ -140,7 +140,7 @@ extern int target_flags;
/* Compile using ret insn that pops args.
This will not work unless you use prototypes at least
for all functions that can take varying numbers of args. */
for all functions that can take varying numbers of args. */
#define TARGET_RTD (target_flags & MASK_RTD)
/* Align doubles to a two word boundary. This breaks compatibility with
@ -671,7 +671,7 @@ extern int ix86_arch;
/* Define for XFmode or TFmode extended real floating point support.
This will automatically cause REAL_ARITHMETIC to be defined.
The XFmode is specified by i386 ABI, while TFmode may be faster
due to alignment and simplifications in the address calculations.
*/
@ -767,7 +767,7 @@ extern int ix86_arch;
and all fundamental data types supported by the hardware
might need to be aligned. No data type wants to be aligned
rounder than this.
Pentium+ preferrs DFmode values to be aligned to 64 bit boundary
and Pentium Pro XFmode values at 128 bit boundaries. */
@ -881,7 +881,7 @@ extern int ix86_arch;
/* 1 for registers that have pervasive standard uses
and are not available for the register allocator.
On the 80386, the stack pointer is such, as is the arg pointer.
The value is an mask - bit 1 is set for fixed registers
for 32bit target, while 2 is set for fixed registers for 64bit.
Proper value is computed in the CONDITIONAL_REGISTER_USAGE.
@ -899,15 +899,15 @@ extern int ix86_arch;
1, 1, 1, 1, 1, 1, 1, 1, \
/*xmm8,xmm9,xmm10,xmm11,xmm12,xmm13,xmm14,xmm15*/ \
1, 1, 1, 1, 1, 1, 1, 1}
/* 1 for registers not available across function calls.
These must include the FIXED_REGISTERS and also any
registers that can be used without being saved.
The latter must include the registers where values are returned
and the register where structure-value addresses are passed.
Aside from that, you can include as many other registers as you like.
Aside from that, you can include as many other registers as you like.
The value is an mask - bit 1 is set for call used
for 32bit target, while 2 is set for call used for 64bit.
Proper value is computed in the CONDITIONAL_REGISTER_USAGE.
@ -993,7 +993,7 @@ do { \
This is ordinarily the length in words of a value of mode MODE
but can be less for certain modes in special long registers.
Actually there are no two word move instructions for consecutive
Actually there are no two word move instructions for consecutive
registers. And only registers 0-3 may have mov byte instructions
applied to them.
*/
@ -1100,7 +1100,7 @@ do { \
#define FIRST_SSE_REG (FRAME_POINTER_REGNUM + 1)
#define LAST_SSE_REG (FIRST_SSE_REG + 7)
#define FIRST_MMX_REG (LAST_SSE_REG + 1)
#define LAST_MMX_REG (FIRST_MMX_REG + 7)
@ -1340,7 +1340,7 @@ enum reg_class
#define MMX_REGNO_P(N) ((N) >= FIRST_MMX_REG && (N) <= LAST_MMX_REG)
#define MMX_REG_P(XOP) (REG_P (XOP) && MMX_REGNO_P (REGNO (XOP)))
#define STACK_REG_P(XOP) \
(REG_P (XOP) && \
REGNO (XOP) >= FIRST_STACK_REG && \
@ -1471,7 +1471,7 @@ enum reg_class
ix86_secondary_memory_needed ((CLASS1), (CLASS2), (MODE), 1)
/* QImode spills from non-QI registers need a scratch. This does not
happen often -- the only example so far requires an uninitialized
happen often -- the only example so far requires an uninitialized
pseudo. */
#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, OUT) \
@ -1518,7 +1518,7 @@ enum reg_class
|| ((CLASS) == DIREG))
/* A C statement that adds to CLOBBERS any hard regs the port wishes
to automatically clobber for all asms.
to automatically clobber for all asms.
We do this in the new i386 backend to maintain source compatibility
with the old cc0-based compiler. */
@ -1556,7 +1556,7 @@ enum reg_class
On 386 pushw decrements by exactly 2 no matter what the position was.
On the 386 there is no pushb; we use pushw instead, and this
has the effect of rounding up to 2.
For 64bit ABI we round up to 8 bytes.
*/
@ -1777,7 +1777,7 @@ do { \
the stack pointer does not matter. The value is tested only in
functions that have frame pointers.
No definition is equivalent to always zero. */
/* Note on the 386 it might be more efficient not to define this since
/* Note on the 386 it might be more efficient not to define this since
we have to restore it ourselves from the frame pointer, in order to
use pop */
@ -1999,7 +1999,7 @@ do { \
#define REWRITE_ADDRESS(X) rewrite_address (X)
/* Nonzero if the constant value X is a legitimate general operand
when generating PIC code. It is given that flag_pic is on and
when generating PIC code. It is given that flag_pic is on and
that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
#define LEGITIMATE_PIC_OPERAND_P(X) \
@ -2191,7 +2191,7 @@ enum ix86_builtins
IX86_BUILTIN_RSQRTSS,
IX86_BUILTIN_SQRTPS,
IX86_BUILTIN_SQRTSS,
IX86_BUILTIN_UNPCKHPS,
IX86_BUILTIN_UNPCKLPS,
@ -2385,7 +2385,7 @@ do { \
precise value of the constant, which is available for examination
in X, and the rtx code of the expression in which it is contained,
found in OUTER_CODE.
CODE is the expression code--redundant, since it can be obtained
with `GET_CODE (X)'. */
@ -2709,8 +2709,8 @@ do { \
/* Add any extra modes needed to represent the condition code.
For the i386, we need separate modes when floating-point
equality comparisons are being done.
equality comparisons are being done.
Add CCNO to indicate comparisons against zero that requires
Overflow flag to be unset. Sign bit test is used instead and
thus can be used to form "a&b>0" type of tests.
@ -2769,7 +2769,7 @@ do { \
For float regs, the stack top is sometimes referred to as "%st(0)"
instead of just "%st". PRINT_REG handles this with the "y" code. */
#undef HI_REGISTER_NAMES
#undef HI_REGISTER_NAMES
#define HI_REGISTER_NAMES \
{"ax","dx","cx","bx","si","di","bp","sp", \
"st","st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)","", \
@ -2819,7 +2819,7 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
/* Before the prologue, RA is at 0(%esp). */
#define INCOMING_RETURN_ADDR_RTX \
gen_rtx_MEM (VOIDmode, gen_rtx_REG (VOIDmode, STACK_POINTER_REGNUM))
/* After the prologue, RA is at -4(AP) in the current frame. */
#define RETURN_ADDR_RTX(COUNT, FRAME) \
((COUNT) == 0 \
@ -2892,7 +2892,7 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
#define JUMP_TABLES_IN_TEXT_SECTION \
(!TARGET_64BIT && flag_pic && !HAVE_AS_GOTOFF_IN_DATA)
/* A C statement that outputs an address constant appropriate to
/* A C statement that outputs an address constant appropriate to
for DWARF debugging. */
#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE, X) \
@ -3081,7 +3081,7 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
CM_MEDIUM is model assuming that code fits in the first 31bits of address
space. Size of data is unlimited.
CM_LARGE is model making no assumptions about size of particular sections.
CM_SMALL_PIC is model for PIC libraries assuming that code+data+got/plt
tables first in 31bits of address space.
*/
@ -3134,12 +3134,12 @@ extern enum reg_class const regclass_map[FIRST_PSEUDO_REGISTER]; /* smalled clas
redundant computation of new control word by the mode switching pass.
The fldcw instructions are still emitted redundantly, but this is probably
not going to be noticeable problem, as most CPUs do have fast path for
the sequence.
the sequence.
The machinery is to emit simple truncation instructions and split them
before reload to instructions having USEs of two memory locations that
are filled by this code to old and new control word.
Post-reload pass may be later used to eliminate the redundant fildcw if
needed. */

View file

@ -140,7 +140,7 @@ extern int target_flags;
/* Compile using ret insn that pops args.
This will not work unless you use prototypes at least
for all functions that can take varying numbers of args. */
for all functions that can take varying numbers of args. */
#define TARGET_RTD (target_flags & MASK_RTD)
/* Align doubles to a two word boundary. This breaks compatibility with
@ -676,7 +676,7 @@ extern int ix86_arch;
/* Define for XFmode or TFmode extended real floating point support.
This will automatically cause REAL_ARITHMETIC to be defined.
The XFmode is specified by i386 ABI, while TFmode may be faster
due to alignment and simplifications in the address calculations.
*/
@ -768,7 +768,7 @@ extern int ix86_arch;
and all fundamental data types supported by the hardware
might need to be aligned. No data type wants to be aligned
rounder than this.
Pentium+ preferrs DFmode values to be aligned to 64 bit boundary
and Pentium Pro XFmode values at 128 bit boundaries. */
@ -882,7 +882,7 @@ extern int ix86_arch;
/* 1 for registers that have pervasive standard uses
and are not available for the register allocator.
On the 80386, the stack pointer is such, as is the arg pointer.
The value is an mask - bit 1 is set for fixed registers
for 32bit target, while 2 is set for fixed registers for 64bit.
Proper value is computed in the CONDITIONAL_REGISTER_USAGE.
@ -900,15 +900,15 @@ extern int ix86_arch;
1, 1, 1, 1, 1, 1, 1, 1, \
/*xmm8,xmm9,xmm10,xmm11,xmm12,xmm13,xmm14,xmm15*/ \
1, 1, 1, 1, 1, 1, 1, 1}
/* 1 for registers not available across function calls.
These must include the FIXED_REGISTERS and also any
registers that can be used without being saved.
The latter must include the registers where values are returned
and the register where structure-value addresses are passed.
Aside from that, you can include as many other registers as you like.
Aside from that, you can include as many other registers as you like.
The value is an mask - bit 1 is set for call used
for 32bit target, while 2 is set for call used for 64bit.
Proper value is computed in the CONDITIONAL_REGISTER_USAGE.
@ -994,7 +994,7 @@ do { \
This is ordinarily the length in words of a value of mode MODE
but can be less for certain modes in special long registers.
Actually there are no two word move instructions for consecutive
Actually there are no two word move instructions for consecutive
registers. And only registers 0-3 may have mov byte instructions
applied to them.
*/
@ -1101,7 +1101,7 @@ do { \
#define FIRST_SSE_REG (FRAME_POINTER_REGNUM + 1)
#define LAST_SSE_REG (FIRST_SSE_REG + 7)
#define FIRST_MMX_REG (LAST_SSE_REG + 1)
#define LAST_MMX_REG (FIRST_MMX_REG + 7)
@ -1341,7 +1341,7 @@ enum reg_class
#define MMX_REGNO_P(N) ((N) >= FIRST_MMX_REG && (N) <= LAST_MMX_REG)
#define MMX_REG_P(XOP) (REG_P (XOP) && MMX_REGNO_P (REGNO (XOP)))
#define STACK_REG_P(XOP) \
(REG_P (XOP) && \
REGNO (XOP) >= FIRST_STACK_REG && \
@ -1472,7 +1472,7 @@ enum reg_class
ix86_secondary_memory_needed ((CLASS1), (CLASS2), (MODE), 1)
/* QImode spills from non-QI registers need a scratch. This does not
happen often -- the only example so far requires an uninitialized
happen often -- the only example so far requires an uninitialized
pseudo. */
#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, OUT) \
@ -1519,7 +1519,7 @@ enum reg_class
|| ((CLASS) == DIREG))
/* A C statement that adds to CLOBBERS any hard regs the port wishes
to automatically clobber for all asms.
to automatically clobber for all asms.
We do this in the new i386 backend to maintain source compatibility
with the old cc0-based compiler. */
@ -1557,7 +1557,7 @@ enum reg_class
On 386 pushw decrements by exactly 2 no matter what the position was.
On the 386 there is no pushb; we use pushw instead, and this
has the effect of rounding up to 2.
For 64bit ABI we round up to 8 bytes.
*/
@ -1778,7 +1778,7 @@ do { \
the stack pointer does not matter. The value is tested only in
functions that have frame pointers.
No definition is equivalent to always zero. */
/* Note on the 386 it might be more efficient not to define this since
/* Note on the 386 it might be more efficient not to define this since
we have to restore it ourselves from the frame pointer, in order to
use pop */
@ -2000,7 +2000,7 @@ do { \
#define REWRITE_ADDRESS(X) rewrite_address (X)
/* Nonzero if the constant value X is a legitimate general operand
when generating PIC code. It is given that flag_pic is on and
when generating PIC code. It is given that flag_pic is on and
that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
#define LEGITIMATE_PIC_OPERAND_P(X) \
@ -2192,7 +2192,7 @@ enum ix86_builtins
IX86_BUILTIN_RSQRTSS,
IX86_BUILTIN_SQRTPS,
IX86_BUILTIN_SQRTSS,
IX86_BUILTIN_UNPCKHPS,
IX86_BUILTIN_UNPCKLPS,
@ -2386,7 +2386,7 @@ do { \
precise value of the constant, which is available for examination
in X, and the rtx code of the expression in which it is contained,
found in OUTER_CODE.
CODE is the expression code--redundant, since it can be obtained
with `GET_CODE (X)'. */
@ -2710,8 +2710,8 @@ do { \
/* Add any extra modes needed to represent the condition code.
For the i386, we need separate modes when floating-point
equality comparisons are being done.
equality comparisons are being done.
Add CCNO to indicate comparisons against zero that requires
Overflow flag to be unset. Sign bit test is used instead and
thus can be used to form "a&b>0" type of tests.
@ -2770,7 +2770,7 @@ do { \
For float regs, the stack top is sometimes referred to as "%st(0)"
instead of just "%st". PRINT_REG handles this with the "y" code. */
#undef HI_REGISTER_NAMES
#undef HI_REGISTER_NAMES
#define HI_REGISTER_NAMES \
{"ax","dx","cx","bx","si","di","bp","sp", \
"st","st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)","", \
@ -2820,7 +2820,7 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
/* Before the prologue, RA is at 0(%esp). */
#define INCOMING_RETURN_ADDR_RTX \
gen_rtx_MEM (VOIDmode, gen_rtx_REG (VOIDmode, STACK_POINTER_REGNUM))
/* After the prologue, RA is at -4(AP) in the current frame. */
#define RETURN_ADDR_RTX(COUNT, FRAME) \
((COUNT) == 0 \
@ -2893,7 +2893,7 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
#define JUMP_TABLES_IN_TEXT_SECTION \
(!TARGET_64BIT && flag_pic && !HAVE_AS_GOTOFF_IN_DATA)
/* A C statement that outputs an address constant appropriate to
/* A C statement that outputs an address constant appropriate to
for DWARF debugging. */
#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE, X) \
@ -3082,7 +3082,7 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER];
CM_MEDIUM is model assuming that code fits in the first 31bits of address
space. Size of data is unlimited.
CM_LARGE is model making no assumptions about size of particular sections.
CM_SMALL_PIC is model for PIC libraries assuming that code+data+got/plt
tables first in 31bits of address space.
*/
@ -3135,12 +3135,12 @@ extern enum reg_class const regclass_map[FIRST_PSEUDO_REGISTER]; /* smalled clas
redundant computation of new control word by the mode switching pass.
The fldcw instructions are still emitted redundantly, but this is probably
not going to be noticeable problem, as most CPUs do have fast path for
the sequence.
the sequence.
The machinery is to emit simple truncation instructions and split them
before reload to instructions having USEs of two memory locations that
are filled by this code to old and new control word.
Post-reload pass may be later used to eliminate the redundant fildcw if
needed. */

View file

@ -116,7 +116,7 @@ PUCHAR MmGetSystemMemoryMapTypeString(ULONG Type)
return MemoryTypeArray[Index].TypeString;
}
}
return MemoryTypeArray[0].TypeString;
}
#endif

View file

@ -23,15 +23,15 @@
#define PDE_SHIFT 20
#define PDE_SHIFT_PAE 18
/* Converts a Relative Address read from the Kernel into a Physical Address */
#define RaToPa(p) \
(ULONG_PTR)((ULONG_PTR)p + KERNEL_BASE_PHYS)
/* Converts a Phsyical Address Pointer into a Page Frame Number */
#define PaPtrToPfn(p) \
(((ULONG_PTR)&p) >> PFN_SHIFT)
/* Converts a Phsyical Address into a Page Frame Number */
#define PaToPfn(p) \
((p) >> PFN_SHIFT)
@ -40,7 +40,7 @@
#define HYPERSPACE_BASE 0xF0800000
#define APIC_BASE 0xFEC00000
#define KPCR_BASE 0xFF000000
#define LowMemPageTableIndex 0
#define StartupPageTableIndex (STARTUP_BASE >> 20) / sizeof(HARDWARE_PTE_X86)
#define HyperspacePageTableIndex (HYPERSPACE_BASE >> 20) / sizeof(HARDWARE_PTE_X86)
@ -139,7 +139,7 @@ typedef struct _PAGE_DIRECTORY_TABLE_X64 {
/* FUNCTIONS *****************************************************************/
/*++
* FrLdrStartup
* FrLdrStartup
* INTERNAL
*
* Prepares the system for loading the Kernel.
@ -157,25 +157,25 @@ typedef struct _PAGE_DIRECTORY_TABLE_X64 {
VOID
STDCALL
FrLdrStartup(ULONG Magic)
{
{
/* Disable Interrupts */
Ke386DisableInterrupts();
/* Re-initalize EFLAGS */
Ke386EraseFlags();
/* Get the PAE Mode */
FrLdrGetPaeMode();
/* Initialize the page directory */
FrLdrSetupPageDirectory();
/* Initialize Paging, Write-Protection and Load NTOSKRNL */
FrLdrSetupPae(Magic);
}
/*++
* FrLdrSetupPae
* FrLdrSetupPae
* INTERNAL
*
* Configures PAE on a MP System, and sets the PDBR if it's supported, or if
@ -201,24 +201,24 @@ FrLdrSetupPae(ULONG Magic)
if (PaeModeEnabled)
{
PageDirectoryBaseAddress = (ULONG_PTR)&startup_pagedirectorytable_pae;
/* Enable PAE */
Ke386SetCr4(Ke386GetCr4() | X86_CR4_PAE);
}
}
/* Set the PDBR */
Ke386SetPageTableDirectory(PageDirectoryBaseAddress);
/* Enable Paging and Write Protect*/
Ke386SetCr0(Ke386GetCr0() | X86_CR0_PG | X86_CR0_WP);
/* Jump to Kernel */
PagedJump = (ASMCODE)KernelEntryPoint;
PagedJump(Magic, &LoaderBlock);
}
/*++
* FrLdrGetKernelBase
* FrLdrGetKernelBase
* INTERNAL
*
* Gets the Kernel Base to use.
@ -238,17 +238,17 @@ FASTCALL
FrLdrGetKernelBase(VOID)
{
PCHAR p;
/* Read Command Line */
p = (PCHAR)LoaderBlock.CommandLine;
while ((p = strchr(p, '/')) != NULL) {
/* Find "/3GB" */
if (!strnicmp(p + 1, "3GB", 3)) {
/* Make sure there's nothing following it */
if (p[4] == ' ' || p[4] == 0) {
/* Use 3GB */
KernelBase = 0xC0000000;
}
@ -256,13 +256,13 @@ FrLdrGetKernelBase(VOID)
p++;
}
/* Set KernelBase */
LoaderBlock.KernelBase = KernelBase;
}
/*++
* FrLdrGetPaeMode
* FrLdrGetPaeMode
* INTERNAL
*
* Determines whether PAE mode shoudl be enabled or not.
@ -290,7 +290,7 @@ FrLdrGetPaeMode(VOID)
}
/*++
* FrLdrSetupPageDirectory
* FrLdrSetupPageDirectory
* INTERNAL
*
* Sets up the ReactOS Startup Page Directory.
@ -317,7 +317,7 @@ FrLdrSetupPageDirectory(VOID)
ULONG i;
if (PaeModeEnabled) {
/* Get the Kernel Table Index */
KernelPageTableIndex = (KernelBase >> 21);
@ -349,7 +349,7 @@ FrLdrSetupPageDirectory(VOID)
PageDirPae->Pde[KernelPageTableIndex + i].Write = 1;
PageDirPae->Pde[KernelPageTableIndex + i].PageFrameNumber = PaPtrToPfn(kernel_pagetable_pae) + i;
}
/* Set up the Startup PDE */
for (i = 0; i < 4; i++)
{
@ -357,7 +357,7 @@ FrLdrSetupPageDirectory(VOID)
PageDirPae->Pde[StartupPageTableIndexPae + i].Write = 1;
PageDirPae->Pde[StartupPageTableIndexPae + i].PageFrameNumber = PaPtrToPfn(startup_pagedirectory_pae) + i;
}
/* Set up the Hyperspace PDE */
for (i = 0; i < 2; i++)
{
@ -365,39 +365,39 @@ FrLdrSetupPageDirectory(VOID)
PageDirPae->Pde[HyperspacePageTableIndexPae + i].Write = 1;
PageDirPae->Pde[HyperspacePageTableIndexPae + i].PageFrameNumber = PaPtrToPfn(hyperspace_pagetable_pae) + i;
}
/* Set up the Apic PDE */
/* Set up the Apic PDE */
for (i = 0; i < 2; i++)
{
PageDirPae->Pde[ApicPageTableIndexPae + i].Valid = 1;
PageDirPae->Pde[ApicPageTableIndexPae + i].Write = 1;
PageDirPae->Pde[ApicPageTableIndexPae + i].PageFrameNumber = PaPtrToPfn(apic_pagetable_pae) + i;
}
/* Set up the KPCR PDE */
PageDirPae->Pde[KpcrPageTableIndexPae].Valid = 1;
PageDirPae->Pde[KpcrPageTableIndexPae].Write = 1;
PageDirPae->Pde[KpcrPageTableIndexPae].PageFrameNumber = PaPtrToPfn(kpcr_pagetable_pae);
/* Set up Low Memory PTEs */
PageDirPae = (PPAGE_DIRECTORY_X64)&lowmem_pagetable_pae;
for (i=0; i<1024; i++) {
PageDirPae->Pde[i].Valid = 1;
PageDirPae->Pde[i].Write = 1;
PageDirPae->Pde[i].Owner = 1;
PageDirPae->Pde[i].PageFrameNumber = i;
}
/* Set up Kernel PTEs */
PageDirPae = (PPAGE_DIRECTORY_X64)&kernel_pagetable_pae;
for (i=0; i<1536; i++) {
PageDirPae->Pde[i].Valid = 1;
PageDirPae->Pde[i].Write = 1;
PageDirPae->Pde[i].PageFrameNumber = PaToPfn(KERNEL_BASE_PHYS) + i;
}
/* Set up APIC PTEs */
PageDirPae = (PPAGE_DIRECTORY_X64)&apic_pagetable_pae;
PageDirPae->Pde[0].Valid = 1;
@ -410,26 +410,26 @@ FrLdrSetupPageDirectory(VOID)
PageDirPae->Pde[0x200].CacheDisable = 1;
PageDirPae->Pde[0x200].WriteThrough = 1;
PageDirPae->Pde[0x200].PageFrameNumber = PaToPfn(APIC_BASE + KERNEL_BASE_PHYS);
/* Set up KPCR PTEs */
PageDirPae = (PPAGE_DIRECTORY_X64)&kpcr_pagetable_pae;
PageDirPae->Pde[0].Valid = 1;
PageDirPae->Pde[0].Write = 1;
PageDirPae->Pde[0].PageFrameNumber = 1;
PageDirPae->Pde[0].PageFrameNumber = 1;
} else {
/* Get the Kernel Table Index */
KernelPageTableIndex = (KernelBase >> PDE_SHIFT) / sizeof(HARDWARE_PTE_X86);
/* Get the Startup Page Directory */
PageDir = (PPAGE_DIRECTORY_X86)&startup_pagedirectory;
/* Set up the Low Memory PDE */
PageDir->Pde[LowMemPageTableIndex].Valid = 1;
PageDir->Pde[LowMemPageTableIndex].Write = 1;
PageDir->Pde[LowMemPageTableIndex].PageFrameNumber = PaPtrToPfn(lowmem_pagetable);
/* Set up the Kernel PDEs */
PageDir->Pde[KernelPageTableIndex].Valid = 1;
PageDir->Pde[KernelPageTableIndex].Write = 1;
@ -437,46 +437,46 @@ FrLdrSetupPageDirectory(VOID)
PageDir->Pde[KernelPageTableIndex + 1].Valid = 1;
PageDir->Pde[KernelPageTableIndex + 1].Write = 1;
PageDir->Pde[KernelPageTableIndex + 1].PageFrameNumber = PaPtrToPfn(kernel_pagetable + 4096);
/* Set up the Startup PDE */
PageDir->Pde[StartupPageTableIndex].Valid = 1;
PageDir->Pde[StartupPageTableIndex].Write = 1;
PageDir->Pde[StartupPageTableIndex].PageFrameNumber = PaPtrToPfn(startup_pagedirectory);
/* Set up the Hyperspace PDE */
PageDir->Pde[HyperspacePageTableIndex].Valid = 1;
PageDir->Pde[HyperspacePageTableIndex].Write = 1;
PageDir->Pde[HyperspacePageTableIndex].PageFrameNumber = PaPtrToPfn(hyperspace_pagetable);
/* Set up the Apic PDE */
/* Set up the Apic PDE */
PageDir->Pde[ApicPageTableIndex].Valid = 1;
PageDir->Pde[ApicPageTableIndex].Write = 1;
PageDir->Pde[ApicPageTableIndex].PageFrameNumber = PaPtrToPfn(apic_pagetable);
/* Set up the KPCR PDE */
PageDir->Pde[KpcrPageTableIndex].Valid = 1;
PageDir->Pde[KpcrPageTableIndex].Write = 1;
PageDir->Pde[KpcrPageTableIndex].PageFrameNumber = PaPtrToPfn(kpcr_pagetable);
/* Set up Low Memory PTEs */
PageDir = (PPAGE_DIRECTORY_X86)&lowmem_pagetable;
for (i=0; i<1024; i++) {
PageDir->Pde[i].Valid = 1;
PageDir->Pde[i].Write = 1;
PageDir->Pde[i].Owner = 1;
PageDir->Pde[i].PageFrameNumber = PaToPfn(i * PAGE_SIZE);
}
/* Set up Kernel PTEs */
PageDir = (PPAGE_DIRECTORY_X86)&kernel_pagetable;
for (i=0; i<1536; i++) {
PageDir->Pde[i].Valid = 1;
PageDir->Pde[i].Write = 1;
PageDir->Pde[i].PageFrameNumber = PaToPfn(KERNEL_BASE_PHYS + i * PAGE_SIZE);
}
/* Set up APIC PTEs */
PageDir = (PPAGE_DIRECTORY_X86)&apic_pagetable;
PageDir->Pde[0].Valid = 1;
@ -489,18 +489,18 @@ FrLdrSetupPageDirectory(VOID)
PageDir->Pde[0x200].CacheDisable = 1;
PageDir->Pde[0x200].WriteThrough = 1;
PageDir->Pde[0x200].PageFrameNumber = PaToPfn(APIC_BASE + KERNEL_BASE_PHYS);
/* Set up KPCR PTEs */
PageDir = (PPAGE_DIRECTORY_X86)&kpcr_pagetable;
PageDir->Pde[0].Valid = 1;
PageDir->Pde[0].Write = 1;
PageDir->Pde[0].PageFrameNumber = 1;
PageDir->Pde[0].PageFrameNumber = 1;
}
return;
}
/*++
* FrLdrMapKernel
* FrLdrMapKernel
* INTERNAL
*
* Maps the Kernel into memory, does PE Section Mapping, initalizes the
@ -540,10 +540,10 @@ FrLdrMapKernel(FILE *KernelImage)
/* Allocate 1024 bytes for PE Header */
ImageHeader = (PIMAGE_DOS_HEADER)MmAllocateMemory(1024);
/* Make sure it was succesful */
if (ImageHeader == NULL) {
return FALSE;
}
@ -557,17 +557,17 @@ FrLdrMapKernel(FILE *KernelImage)
/* Now read the MZ header to get the offset to the PE Header */
NtHeader = (PIMAGE_NT_HEADERS)((PCHAR)ImageHeader + ImageHeader->e_lfanew);
/* Get Kernel Base */
KernelBase = NtHeader->OptionalHeader.ImageBase;
KernelBase = NtHeader->OptionalHeader.ImageBase;
FrLdrGetKernelBase();
/* Save Entrypoint */
KernelEntry = RaToPa(NtHeader->OptionalHeader.AddressOfEntryPoint);
/* Save the Image Size */
ImageSize = NtHeader->OptionalHeader.SizeOfImage;
/* Free the Header */
MmFreeMemory(ImageHeader);
@ -576,75 +576,75 @@ FrLdrMapKernel(FILE *KernelImage)
/* Load the file image */
FsReadFile(KernelImage, ImageSize, NULL, (PVOID)KERNEL_BASE_PHYS);
/* Reload the NT Header */
NtHeader = (PIMAGE_NT_HEADERS)((PCHAR)KERNEL_BASE_PHYS + ImageHeader->e_lfanew);
/* Load the first section */
Section = IMAGE_FIRST_SECTION(NtHeader);
SectionCount = NtHeader->FileHeader.NumberOfSections - 1;
/* Now go to the last section */
Section += SectionCount;
/* Walk each section backwards */
/* Walk each section backwards */
for (i=SectionCount; i >= 0; i--, Section--) {
/* Get the disk location and the memory location, and the size */
/* Get the disk location and the memory location, and the size */
SourceSection = RaToPa(Section->PointerToRawData);
TargetSection = RaToPa(Section->VirtualAddress);
SectionSize = Section->SizeOfRawData;
/* If the section is already mapped correctly, go to the next */
if (SourceSection == TargetSection) continue;
/* Load it into memory */
memmove((PVOID)TargetSection, (PVOID)SourceSection, SectionSize);
/* Check for unitilizated data */
if (Section->SizeOfRawData < Section->Misc.VirtualSize) {
/* Zero it out */
memset((PVOID)RaToPa(Section->VirtualAddress + Section->SizeOfRawData),
memset((PVOID)RaToPa(Section->VirtualAddress + Section->SizeOfRawData),
0,
Section->Misc.VirtualSize - Section->SizeOfRawData);
}
}
/* Get the Relocation Data Directory */
RelocationDDir = &NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC];
/* Get the Relocation Section Start and End*/
RelocationDir = (PIMAGE_BASE_RELOCATION)(KERNEL_BASE_PHYS + RelocationDDir->VirtualAddress);
RelocationEnd = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)RelocationDir + RelocationDDir->Size);
/* Calculate Difference between Real Base and Compiled Base*/
Delta = KernelBase - NtHeader->OptionalHeader.ImageBase;;
Delta = KernelBase - NtHeader->OptionalHeader.ImageBase;
/* Determine how far we shoudl relocate */
MaxAddress = KERNEL_BASE_PHYS + ImageSize;
/* Relocate until we've processed all the blocks */
while (RelocationDir < RelocationEnd && RelocationDir->SizeOfBlock > 0) {
/* See how many Relocation Blocks we have */
Count = (RelocationDir->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION)) / sizeof(USHORT);
/* Calculate the Address of this Directory */
Address = KERNEL_BASE_PHYS + RelocationDir->VirtualAddress;
/* Calculate the Offset of the Type */
TypeOffset = (PUSHORT)(RelocationDir + 1);
for (i = 0; i < Count; i++) {
ShortPtr = (PUSHORT)(Address + (*TypeOffset & 0xFFF));
/* Don't relocate after the end of the loaded driver */
if ((ULONG_PTR)ShortPtr >= MaxAddress) break;
switch (*TypeOffset >> 12) {
case IMAGE_REL_BASED_ABSOLUTE:
break;
@ -661,14 +661,14 @@ FrLdrMapKernel(FILE *KernelImage)
*LongPtr += Delta;
break;
}
TypeOffset++;
}
/* Move to the next Relocation Table */
RelocationDir = (PIMAGE_BASE_RELOCATION)((ULONG_PTR)RelocationDir + RelocationDir->SizeOfBlock);
}
/* Increase the next Load Base */
NextModuleBase = ROUND_UP(KERNEL_BASE_PHYS + ImageSize, PAGE_SIZE);
@ -678,8 +678,8 @@ FrLdrMapKernel(FILE *KernelImage)
ULONG_PTR
STDCALL
FrLdrLoadModule(FILE *ModuleImage,
LPSTR ModuleName,
FrLdrLoadModule(FILE *ModuleImage,
LPSTR ModuleName,
PULONG ModuleSize)
{
ULONG LocalModuleSize;
@ -689,12 +689,12 @@ FrLdrLoadModule(FILE *ModuleImage,
/* Get current module data structure and module name string array */
ModuleData = &multiboot_modules[LoaderBlock.ModsCount];
/* Get only the Module Name */
do {
TempName = strchr(ModuleName, '\\');
if(TempName) {
ModuleName = TempName + 1;
}
@ -704,11 +704,11 @@ FrLdrLoadModule(FILE *ModuleImage,
/* Get Module Size */
LocalModuleSize = FsGetFileSize(ModuleImage);
/* Fill out Module Data Structure */
ModuleData->ModuleStart = NextModuleBase;
ModuleData->ModuleEnd = NextModuleBase + LocalModuleSize;
/* Save name */
strcpy(NameBuffer, ModuleName);
ModuleData->ModuleName = NameBuffer;
@ -742,7 +742,7 @@ FrLdrCreateModule(LPSTR ModuleName)
/* Set up the structure */
ModuleData->ModuleStart = NextModuleBase;
ModuleData->ModuleEnd = -1;
/* Copy the name */
strcpy(NameBuffer, ModuleName);
ModuleData->ModuleName = NameBuffer;
@ -756,24 +756,24 @@ FrLdrCreateModule(LPSTR ModuleName)
BOOL
STDCALL
FrLdrCloseModule(ULONG_PTR ModuleBase,
FrLdrCloseModule(ULONG_PTR ModuleBase,
ULONG ModuleSize)
{
PFRLDR_MODULE ModuleData = CurrentModule;
/* Make sure a module is opened */
if (ModuleData) {
/* Make sure this is the right module and that it hasn't been closed */
if ((ModuleBase == ModuleData->ModuleStart) && (ModuleData->ModuleEnd == -1)) {
/* Close the Module */
ModuleData->ModuleEnd = ModuleData->ModuleStart + ModuleSize;
/* Set the next Module Base and increase the number of modules */
NextModuleBase = ROUND_UP(ModuleData->ModuleEnd, PAGE_SIZE);
LoaderBlock.ModsCount++;
/* Close the currently opened module */
CurrentModule = NULL;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <rtl.h>
#include <ui.h>

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <inifile.h>
#include <oslist.h>
@ -92,7 +92,7 @@ ULONG CountOperatingSystems(ULONG SectionId)
CHAR SettingValue[260];
ULONG OperatingSystemCount = 0;
ULONG SectionSettingCount;
//
// Loop through and count the operating systems
//
@ -126,7 +126,7 @@ BOOL AllocateListMemory(PCHAR **SectionNamesPointer, PCHAR **DisplayNamesPointer
//
OperatingSystemSectionNames = MmAllocateMemory( sizeof(PCHAR) * OperatingSystemCount);
OperatingSystemDisplayNames = MmAllocateMemory( sizeof(PCHAR) * OperatingSystemCount);
//
// If either allocation failed then return FALSE
//

View file

@ -840,7 +840,7 @@ CmiAllocateHashTableCell (PREGISTRY_HIVE Hive,
ULONG NewHashSize;
BOOL Status;
NewHashSize = sizeof(HASH_TABLE_CELL) +
NewHashSize = sizeof(HASH_TABLE_CELL) +
(SubKeyCount * sizeof(HASH_RECORD));
Status = CmiAllocateCell (Hive,
NewHashSize,

View file

@ -27,22 +27,22 @@ FrLdrLoadKernel(PCHAR szFileName,
/* Extract Kernel filename without path */
szShortName = strrchr(szFileName, '\\');
if (szShortName == NULL) {
/* No path, leave it alone */
szShortName = szFileName;
} else {
/* Skip the path */
szShortName = szShortName + 1;
}
/* Open the Kernel */
FilePointer = FsOpenFile(szFileName);
/* Make sure it worked */
if (FilePointer == NULL) {
/* Return failure on the short name */
strcpy(szBuffer, szShortName);
strcat(szBuffer, " not found.");
@ -79,7 +79,7 @@ static BOOLEAN
FreeldrReadFile(PVOID FileContext, PVOID Buffer, ULONG Size)
{
ULONG BytesRead;
return FsReadFile((PFILE) FileContext, (ULONG) Size, &BytesRead, Buffer)
&& Size == BytesRead;
}
@ -124,9 +124,9 @@ LoadKernelSymbols(PCHAR szKernelName, int nPos)
RosSymDelete(RosSymInfo);
return TRUE;
}
BOOL
FrLdrLoadNlsFile(PCHAR szFileName,
FrLdrLoadNlsFile(PCHAR szFileName,
PCHAR szModuleName)
{
PFILE FilePointer;
@ -135,10 +135,10 @@ FrLdrLoadNlsFile(PCHAR szFileName,
/* Open the Driver */
FilePointer = FsOpenFile(szFileName);
/* Make sure we did */
if (FilePointer == NULL) {
/* Fail if file wasn't opened */
strcpy(value, szFileName);
strcat(value, " not found.");
@ -150,11 +150,11 @@ FrLdrLoadNlsFile(PCHAR szFileName,
strcpy(value, "Reading ");
p = strrchr(szFileName, '\\');
if (p == NULL) {
strcat(value, szFileName);
} else {
strcat(value, p + 1);
}
UiDrawStatusText(value);
@ -165,7 +165,7 @@ FrLdrLoadNlsFile(PCHAR szFileName,
}
BOOL
FrLdrLoadNlsFiles(PCHAR szSystemRoot,
FrLdrLoadNlsFiles(PCHAR szSystemRoot,
PCHAR szErrorOut)
{
LONG rc = ERROR_SUCCESS;
@ -180,16 +180,16 @@ FrLdrLoadNlsFiles(PCHAR szSystemRoot,
"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage",
&hKey);
if (rc != ERROR_SUCCESS) {
strcpy(szErrorOut, "Couldn't open CodePage registry key");
return(FALSE);
}
/* get ANSI codepage */
BufferSize = 80;
rc = RegQueryValue(hKey, "ACP", NULL, (PUCHAR)szIdBuffer, &BufferSize);
if (rc != ERROR_SUCCESS) {
strcpy(szErrorOut, "Couldn't get ACP NLS setting");
return(FALSE);
}
@ -197,7 +197,7 @@ FrLdrLoadNlsFiles(PCHAR szSystemRoot,
BufferSize = 80;
rc = RegQueryValue(hKey, szIdBuffer, NULL, (PUCHAR)szNameBuffer, &BufferSize);
if (rc != ERROR_SUCCESS) {
strcpy(szErrorOut, "ACP NLS Setting exists, but isn't readable");
return(FALSE);
}
@ -208,7 +208,7 @@ FrLdrLoadNlsFiles(PCHAR szSystemRoot,
strcat(szFileName, szNameBuffer);
DbgPrint((DPRINT_REACTOS, "ANSI file: %s\n", szFileName));
if (!FrLdrLoadNlsFile(szFileName, "ansi.nls")) {
strcpy(szErrorOut, "Couldn't load ansi.nls");
return(FALSE);
}
@ -217,7 +217,7 @@ FrLdrLoadNlsFiles(PCHAR szSystemRoot,
BufferSize = 80;
rc = RegQueryValue(hKey, "OEMCP", NULL, (PUCHAR)szIdBuffer, &BufferSize);
if (rc != ERROR_SUCCESS) {
strcpy(szErrorOut, "Couldn't get OEMCP NLS setting");
return(FALSE);
}
@ -225,7 +225,7 @@ FrLdrLoadNlsFiles(PCHAR szSystemRoot,
BufferSize = 80;
rc = RegQueryValue(hKey, szIdBuffer, NULL, (PUCHAR)szNameBuffer, &BufferSize);
if (rc != ERROR_SUCCESS) {
strcpy(szErrorOut, "OEMCP NLS setting exists, but isn't readable");
return(FALSE);
}
@ -236,7 +236,7 @@ FrLdrLoadNlsFiles(PCHAR szSystemRoot,
strcat(szFileName, szNameBuffer);
DbgPrint((DPRINT_REACTOS, "Oem file: %s\n", szFileName));
if (!FrLdrLoadNlsFile(szFileName, "oem.nls")) {
strcpy(szErrorOut, "Couldn't load oem.nls");
return(FALSE);
}
@ -246,7 +246,7 @@ FrLdrLoadNlsFiles(PCHAR szSystemRoot,
"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\Language",
&hKey);
if (rc != ERROR_SUCCESS) {
strcpy(szErrorOut, "Couldn't open Language registry key");
return(FALSE);
}
@ -255,7 +255,7 @@ FrLdrLoadNlsFiles(PCHAR szSystemRoot,
BufferSize = 80;
rc = RegQueryValue(hKey, "Default", NULL, (PUCHAR)szIdBuffer, &BufferSize);
if (rc != ERROR_SUCCESS) {
strcpy(szErrorOut, "Couldn't get Language Default setting");
return(FALSE);
}
@ -263,7 +263,7 @@ FrLdrLoadNlsFiles(PCHAR szSystemRoot,
BufferSize = 80;
rc = RegQueryValue(hKey, szIdBuffer, NULL, (PUCHAR)szNameBuffer, &BufferSize);
if (rc != ERROR_SUCCESS) {
strcpy(szErrorOut, "Language Default setting exists, but isn't readable");
return(FALSE);
}
@ -274,7 +274,7 @@ FrLdrLoadNlsFiles(PCHAR szSystemRoot,
strcat(szFileName, szNameBuffer);
DbgPrint((DPRINT_REACTOS, "Casemap file: %s\n", szFileName));
if (!FrLdrLoadNlsFile(szFileName, "casemap.nls")) {
strcpy(szErrorOut, "casemap.nls");
return(FALSE);
}
@ -283,7 +283,7 @@ FrLdrLoadNlsFiles(PCHAR szSystemRoot,
}
BOOL
FrLdrLoadDriver(PCHAR szFileName,
FrLdrLoadDriver(PCHAR szFileName,
INT nPos)
{
PFILE FilePointer;
@ -292,10 +292,10 @@ FrLdrLoadDriver(PCHAR szFileName,
/* Open the Driver */
FilePointer = FsOpenFile(szFileName);
/* Make sure we did */
if (FilePointer == NULL) {
/* Fail if file wasn't opened */
strcpy(value, szFileName);
strcat(value, " not found.");
@ -307,13 +307,13 @@ FrLdrLoadDriver(PCHAR szFileName,
strcpy(value, "Reading ");
p = strrchr(szFileName, '\\');
if (p == NULL) {
strcat(value, szFileName);
} else {
strcat(value, p + 1);
}
UiDrawStatusText(value);
@ -326,7 +326,7 @@ FrLdrLoadDriver(PCHAR szFileName,
}
VOID
FrLdrLoadBootDrivers(PCHAR szSystemRoot,
FrLdrLoadBootDrivers(PCHAR szSystemRoot,
INT nPos)
{
LONG rc = 0;
@ -354,17 +354,17 @@ FrLdrLoadBootDrivers(PCHAR szSystemRoot,
"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\ServiceGroupOrder",
&hGroupKey);
if (rc != ERROR_SUCCESS) {
DbgPrint((DPRINT_REACTOS, "Failed to open the 'ServiceGroupOrder' key (rc %d)\n", (int)rc));
return;
}
/* get 'group order list' key */
rc = RegOpenKey(NULL,
"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\GroupOrderList",
&hOrderKey);
if (rc != ERROR_SUCCESS) {
DbgPrint((DPRINT_REACTOS, "Failed to open the 'GroupOrderList' key (rc %d)\n", (int)rc));
return;
}
@ -374,7 +374,7 @@ FrLdrLoadBootDrivers(PCHAR szSystemRoot,
"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services",
&hServiceKey);
if (rc != ERROR_SUCCESS) {
DbgPrint((DPRINT_REACTOS, "Failed to open the 'Services' key (rc %d)\n", (int)rc));
return;
}
@ -396,19 +396,19 @@ FrLdrLoadBootDrivers(PCHAR szSystemRoot,
BufferSize = sizeof(OrderList);
rc = RegQueryValue(hOrderKey, GroupName, NULL, (PUCHAR)OrderList, &BufferSize);
if (rc != ERROR_SUCCESS) OrderList[0] = 0;
/* enumerate all drivers */
for (TagIndex = 1; TagIndex <= OrderList[0]; TagIndex++) {
Index = 0;
while (TRUE) {
/* Get the Driver's Name */
ValueSize = sizeof(ServiceName);
rc = RegEnumKey(hServiceKey, Index, ServiceName, &ValueSize);
DbgPrint((DPRINT_REACTOS, "RegEnumKey(): rc %d\n", (int)rc));
/* Makre sure it's valid, and check if we're done */
if (rc == ERROR_NO_MORE_ITEMS) break;
if (rc != ERROR_SUCCESS) return;
@ -434,14 +434,14 @@ FrLdrLoadBootDrivers(PCHAR szSystemRoot,
DbgPrint((DPRINT_REACTOS, " Group: '%s' \n", DriverGroup));
/* Make sure it should be started */
if ((StartValue == 0) &&
(TagValue == OrderList[TagIndex]) &&
if ((StartValue == 0) &&
(TagValue == OrderList[TagIndex]) &&
(stricmp(DriverGroup, GroupName) == 0)) {
/* Get the Driver's Location */
ValueSize = 256;
rc = RegQueryValue(hDriverKey, "ImagePath", NULL, (PUCHAR)TempImagePath, &ValueSize);
/* Write the whole path if it suceeded, else prepare to fail */
if (rc != ERROR_SUCCESS) {
DbgPrint((DPRINT_REACTOS, " ImagePath: not found\n"));
@ -456,31 +456,31 @@ FrLdrLoadBootDrivers(PCHAR szSystemRoot,
strcpy(ImagePath, TempImagePath);
DbgPrint((DPRINT_REACTOS, " ImagePath: '%s'\n", ImagePath));
}
DbgPrint((DPRINT_REACTOS, " Loading driver: '%s'\n", ImagePath));
/* Update the position if needed */
if (nPos < 100) nPos += 5;
FrLdrLoadDriver(ImagePath, nPos);
} else {
DbgPrint((DPRINT_REACTOS, " Skipping driver '%s' with Start %d, Tag %d and Group '%s' (Current Tag %d, current group '%s')\n",
ServiceName, StartValue, TagValue, DriverGroup, OrderList[TagIndex], GroupName));
}
Index++;
}
}
}
Index = 0;
while (TRUE) {
/* Get the Driver's Name */
ValueSize = sizeof(ServiceName);
rc = RegEnumKey(hServiceKey, Index, ServiceName, &ValueSize);
DbgPrint((DPRINT_REACTOS, "RegEnumKey(): rc %d\n", (int)rc));
if (rc == ERROR_NO_MORE_ITEMS) break;
if (rc != ERROR_SUCCESS) return;
@ -508,11 +508,11 @@ FrLdrLoadBootDrivers(PCHAR szSystemRoot,
for (TagIndex = 1; TagIndex <= OrderList[0]; TagIndex++) {
if (TagValue == OrderList[TagIndex]) break;
}
if ((StartValue == 0) &&
(TagIndex > OrderList[0]) &&
if ((StartValue == 0) &&
(TagIndex > OrderList[0]) &&
(stricmp(DriverGroup, GroupName) == 0)) {
ValueSize = 256;
rc = RegQueryValue(hDriverKey, "ImagePath", NULL, (PUCHAR)TempImagePath, &ValueSize);
if (rc != ERROR_SUCCESS) {
@ -529,17 +529,17 @@ FrLdrLoadBootDrivers(PCHAR szSystemRoot,
DbgPrint((DPRINT_REACTOS, " ImagePath: '%s'\n", ImagePath));
}
DbgPrint((DPRINT_REACTOS, " Loading driver: '%s'\n", ImagePath));
if (nPos < 100) nPos += 5;
FrLdrLoadDriver(ImagePath, nPos);
FrLdrLoadDriver(ImagePath, nPos);
} else {
DbgPrint((DPRINT_REACTOS, " Skipping driver '%s' with Start %d, Tag %d and Group '%s' (Current group '%s')\n",
ServiceName, StartValue, TagValue, DriverGroup, GroupName));
}
Index++;
}
@ -565,7 +565,7 @@ LoadAndBootReactOS(PCHAR OperatingSystemName)
ULONG_PTR Base;
ULONG Size;
extern ULONG PageDirectoryStart;
extern ULONG PageDirectoryEnd;
extern BOOLEAN AcpiPresent;
@ -616,8 +616,8 @@ LoadAndBootReactOS(PCHAR OperatingSystemName)
{
LoaderBlock.MemHigher = (multiboot_memory_map[i].base_addr_low + multiboot_memory_map[i].length_low) / 1024 - 1024;
}
DbgPrint((DPRINT_REACTOS, "start: %x\t size: %x\t type %d\n",
multiboot_memory_map[i].base_addr_low,
DbgPrint((DPRINT_REACTOS, "start: %x\t size: %x\t type %d\n",
multiboot_memory_map[i].base_addr_low,
multiboot_memory_map[i].length_low,
multiboot_memory_map[i].type));
}
@ -724,7 +724,7 @@ LoadAndBootReactOS(PCHAR OperatingSystemName)
}
if (!FrLdrLoadKernel(szKernelName, 5)) return;
/*
* Find the HAL image name
* and try to load the kernel off the disk

View file

@ -244,7 +244,7 @@ VOID RunLoader(VOID)
HINF InfHandle;
ULONG ErrorLine;
INFCONTEXT InfContext;
extern ULONG PageDirectoryStart;
extern ULONG PageDirectoryEnd;
@ -280,8 +280,8 @@ VOID RunLoader(VOID)
LoaderBlock.MemHigher = (multiboot_memory_map[i].base_addr_low + multiboot_memory_map[i].length_low) / 1024 - 1024;
}
#if 0
printf("start: %x\t size: %x\t type %d\n",
multiboot_memory_map[i].base_addr_low,
printf("start: %x\t size: %x\t type %d\n",
multiboot_memory_map[i].base_addr_low,
multiboot_memory_map[i].length_low,
multiboot_memory_map[i].type);
#endif

View file

@ -29,7 +29,7 @@ void *memset(void *src, int val, size_t count)
"rep\t\n" \
"stosb\t\n" \
".L1:\n\t"
:
:
: "D" (src), "c" (count), "a" (val));
return src;
}

View file

@ -142,7 +142,7 @@ void sprintf(char *buffer, char *format, ... )
{
*convert_to_ascii(str, c, va_arg(ap, unsigned long)) = 0;
}
ptr = str;
while (*ptr)

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <ui.h>
#include "gui.h"

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <ui.h>
#include "tui.h"

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <rtl.h>
#include <ui.h>
@ -139,7 +139,7 @@ BOOL TuiDisplayMenu(PCHAR MenuItemList[], ULONG MenuItemCount, ULONG DefaultMenu
{
*SelectedMenuItem = MenuInformation.SelectedMenuItem;
}
return TRUE;
}
@ -385,7 +385,7 @@ ULONG TuiProcessMenuKeyboardEvent(PTUI_MENU_INFO MenuInfo, UiMenuKeyPressFilterC
switch (KeyEvent)
{
case KEY_UP:
if (MenuInfo->SelectedMenuItem > 0)
{
MenuInfo->SelectedMenuItem--;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <ui.h>
#include "tui.h"
@ -75,7 +75,7 @@ BOOL UiInitialize(BOOLEAN ShowGui)
UserInterfaceUp = FALSE;
return TRUE;
}
DbgPrint((DPRINT_UI, "Initializing User Interface.\n"));
DbgPrint((DPRINT_UI, "Reading in UI settings from [Display] section.\n"));
@ -193,7 +193,7 @@ BOOL UiInitialize(BOOLEAN ShowGui)
// Draw the backdrop and fade it in if special effects are enabled
UiFadeInBackdrop();
UserInterfaceUp = TRUE;
DbgPrint((DPRINT_UI, "UiInitialize() returning TRUE.\n"));
@ -221,7 +221,7 @@ VOID UiUnInitialize(PCHAR BootText)
VOID UiDrawBackdrop(VOID)
{
if (!UserInterfaceUp) return;
if (VideoTextMode == UiDisplayMode)
{
TuiDrawBackdrop();
@ -301,7 +301,7 @@ VOID UiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCHAR
VOID UiDrawStatusText(PCHAR StatusText)
{
if (!UserInterfaceUp) return;
if (VideoTextMode == UiDisplayMode)
{
TuiDrawStatusText(StatusText);
@ -468,7 +468,7 @@ UCHAR UiTextToFillStyle(PCHAR FillStyleText)
VOID UiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
{
if (!UserInterfaceUp) return;
if (VideoTextMode == UiDisplayMode)
{
TuiDrawProgressBarCenter(Position, Range, ProgressText);
@ -515,7 +515,7 @@ VOID UiShowMessageBoxesInSection(PCHAR SectionName)
for (Idx=0; Idx<IniGetNumSectionItems(SectionId); Idx++)
{
IniReadSettingByNumber(SectionId, Idx, SettingName, 79, SettingValue, 79);
if (stricmp(SettingName, "MessageBox") == 0)
{
// Get the real length of the MessageBox text

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <version.h>
#include <rtl.h>

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <video.h>
#include <comm.h>

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <video.h>
#include <machine.h>

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <video.h>
#include <machine.h>

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <video.h>
#include <portio.h>

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <freeldr.h>
#include <video.h>
#include <portio.h>

View file

@ -13,7 +13,7 @@ typedef struct
//unsigned short NumberOfHeads;
//unsigned long Reserved1;
//unsigned long Reserved2;
unsigned long Ext2VolumeStartSector; // Start sector of the ext2 volume
unsigned long Ext2BlockSize; // Block size in sectors
unsigned long Ext2BlockSizeInBytes; // Block size in bytes

View file

@ -90,7 +90,7 @@ BOOL ReadVolumeSector(ULONG SectorNumber, PVOID SectorBuffer)
_tprintf(_T("SetFilePointer() failed. Error code %ld.\n"), GetLastError());
return FALSE;
}
bRetVal = ReadFile(hDiskVolume, SectorBuffer, 512, &dwNumberOfBytesRead, NULL);
if (!bRetVal || (dwNumberOfBytesRead != 512))
{
@ -122,7 +122,7 @@ BOOL WriteVolumeSector(ULONG SectorNumber, PVOID SectorBuffer)
_tprintf(_T("SetFilePointer() failed. Error code %ld.\n"), GetLastError());
return FALSE;
}
bRetVal = WriteFile(hDiskVolume, SectorBuffer, 512, &dwNumberOfBytesWritten, NULL);
if (!bRetVal || (dwNumberOfBytesWritten != 512))
{

View file

@ -21,7 +21,7 @@ char newpatch[] = {0x3b, 0x05, 0x58, 0x5e };
void patch_image(char *filename)
{
int i,size;
view_only = 0;
f = open(filename, O_RDWR | O_BINARY);
if (f < 0) {
@ -30,7 +30,7 @@ void patch_image(char *filename)
perror(filename);
return;
}
view_only = 1;
view_only = 1;
}
lseek(f, search_base, SEEK_SET);
@ -61,7 +61,7 @@ int main(int argc, char **argv)
char filename[256];
char buf1[256];
char file2[256];
if (argc != 1) { /* If they specify names, patch them, exit */
for(i=1; i<argc; i++)
patch_image(argv[i]);
@ -74,11 +74,11 @@ int main(int argc, char **argv)
strcpy(file2,filename);
strcat(filename,"\\system32\\ntvdm.exe");
strcat(file2,"\\system32\\dllcache\\ntvdm.exe");
sprintf(buf1,"copy %s %s\\system32\\ntvdm.ori",filename,getenv("SYSTEMROOT"));
printf("%s\n",buf1);
system(buf1);
patch_image(file2);
patch_image(filename);
return 0;