mirror of
https://github.com/reactos/reactos.git
synced 2024-06-28 17:01:28 +00:00
- Fix most freeldr compilation issues, most notably:
- Define structure packing correctly for msvc. - Define Ke386EraseFlags for msvc too. - Don't return a function returning void in a function returning void. - VideoFadeIn: Don't rely on some fishy gcc extension for allocating memory from the stack -- just use the heap instead. - Winldr remains svn path=/trunk/; revision=42218
This commit is contained in:
parent
849236d3ac
commit
45934cfbe5
|
@ -22,12 +22,7 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
/* non-standard specifier from windef.h -- please deprecate */
|
||||
#undef PACKED
|
||||
#ifdef __GNUC__
|
||||
#define PACKED __attribute__((packed))
|
||||
#endif
|
||||
|
||||
#include <pshpack2.h>
|
||||
typedef struct
|
||||
{
|
||||
UCHAR Signature[4]; // (ret) signature ("VESA")
|
||||
|
@ -55,7 +50,8 @@ typedef struct
|
|||
// accelerated video modes (list of words terminated with FFFFh)
|
||||
UCHAR Reserved[216]; // reserved for VBE implementation
|
||||
UCHAR ScratchPad[256]; // OEM scratchpad (for OEM strings, etc.)
|
||||
} PACKED VESA_SVGA_INFO, *PVESA_SVGA_INFO;
|
||||
} VESA_SVGA_INFO, *PVESA_SVGA_INFO;
|
||||
#include <poppack.h>
|
||||
|
||||
// Bitfields for VESA capabilities:
|
||||
//
|
||||
|
|
|
@ -22,12 +22,7 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
/* non-standard specifier from windef.h -- please deprecate */
|
||||
#undef PACKED
|
||||
#ifdef __GNUC__
|
||||
#define PACKED __attribute__((packed))
|
||||
#endif
|
||||
|
||||
#include <pshpack2.h>
|
||||
typedef struct
|
||||
{
|
||||
UCHAR PacketSize; // 00h - Size of packet (10h or 18h)
|
||||
|
@ -40,7 +35,8 @@ typedef struct
|
|||
// used if DWORD at 04h is FFFFh:FFFFh
|
||||
// Commented since some earlier BIOSes refuse to work with
|
||||
// such extended structure
|
||||
} PACKED I386_DISK_ADDRESS_PACKET, *PI386_DISK_ADDRESS_PACKET;
|
||||
} I386_DISK_ADDRESS_PACKET, *PI386_DISK_ADDRESS_PACKET;
|
||||
#include <poppack.h>
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// FUNCTIONS
|
||||
|
|
|
@ -22,12 +22,6 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
/* non-standard specifier from windef.h -- please deprecate */
|
||||
#undef PACKED
|
||||
#ifdef __GNUC__
|
||||
#define PACKED __attribute__((packed))
|
||||
#endif
|
||||
|
||||
#define VIDEOPORT_PALETTE_READ 0x03C7
|
||||
#define VIDEOPORT_PALETTE_WRITE 0x03C8
|
||||
#define VIDEOPORT_PALETTE_DATA 0x03C9
|
||||
|
@ -57,6 +51,7 @@
|
|||
#define VERTRES_350_SCANLINES 0x01
|
||||
#define VERTRES_400_SCANLINES 0x02
|
||||
|
||||
#include <pshpack2.h>
|
||||
typedef struct
|
||||
{
|
||||
USHORT ModeAttributes; /* mode attributes (see #00080) */
|
||||
|
@ -110,7 +105,8 @@ typedef struct
|
|||
UCHAR LinearReservedMaskPosition; /* linear modes:Bit position of reserved mask LSB */
|
||||
ULONG MaximumPixelClock; /* maximum pixel clock for graphics video mode, in Hz */
|
||||
UCHAR Reserved2[190]; /* 190 BYTEs reserved (0) */
|
||||
} PACKED SVGA_MODE_INFORMATION, *PSVGA_MODE_INFORMATION;
|
||||
} SVGA_MODE_INFORMATION, *PSVGA_MODE_INFORMATION;
|
||||
#include <poppack.h>
|
||||
|
||||
static ULONG BiosVideoMode; /* Current video mode as known by BIOS */
|
||||
static ULONG ScreenWidth = 80; /* Screen Width in characters */
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
VOID PcMachInit(const char *CmdLine);
|
||||
|
||||
VOID PcConsPutChar(int Ch);
|
||||
BOOLEAN PcConsKbHit();
|
||||
int PcConsGetCh();
|
||||
BOOLEAN PcConsKbHit(VOID);
|
||||
int PcConsGetCh(VOID);
|
||||
|
||||
VOID PcVideoClearScreen(UCHAR Attr);
|
||||
VIDEODISPLAYMODE PcVideoSetDisplayMode(char *DisplayMode, BOOLEAN Init);
|
||||
|
|
|
@ -29,8 +29,8 @@ UCHAR XboxFont8x16[256 * 16];
|
|||
VOID XboxMachInit(const char *CmdLine);
|
||||
|
||||
VOID XboxConsPutChar(int Ch);
|
||||
BOOLEAN XboxConsKbHit();
|
||||
int XboxConsGetCh();
|
||||
BOOLEAN XboxConsKbHit(VOID);
|
||||
int XboxConsGetCh(VOID);
|
||||
|
||||
VOID XboxVideoInit(VOID);
|
||||
VOID XboxVideoClearScreen(UCHAR Attr);
|
||||
|
|
|
@ -110,12 +110,22 @@
|
|||
#include <bytesex.h>
|
||||
|
||||
/* arch defines */
|
||||
#ifdef __GNUC__
|
||||
#ifdef _X86_
|
||||
#define Ke386EraseFlags(x) __asm__ __volatile__("pushl $0 ; popfl\n")
|
||||
#define Ke386EraseFlags() __asm__ __volatile__("pushl $0 ; popfl\n")
|
||||
#endif
|
||||
|
||||
#ifdef _M_AMD64
|
||||
#define KeAmd64EraseFlags(x) __asm__ __volatile__("pushq $0 ; popfq\n")
|
||||
#define KeAmd64EraseFlags() __asm__ __volatile__("pushq $0 ; popfq\n")
|
||||
#endif
|
||||
#else
|
||||
#ifdef _X86_
|
||||
#define Ke386EraseFlags() __asm push 0; __asm popf;
|
||||
#endif
|
||||
|
||||
#ifdef _M_AMD64
|
||||
#error FIXME
|
||||
#endif
|
||||
#endif
|
||||
|
||||
VOID BootMain(LPSTR CmdLine);
|
||||
|
|
|
@ -83,7 +83,7 @@ MachVideoSetDisplayMode(char *DisplayMode, BOOLEAN Init)
|
|||
VOID
|
||||
MachVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
|
||||
{
|
||||
return MachVtbl.VideoGetDisplaySize(Width, Height, Depth);
|
||||
MachVtbl.VideoGetDisplaySize(Width, Height, Depth);
|
||||
}
|
||||
|
||||
ULONG
|
||||
|
@ -95,7 +95,7 @@ MachVideoGetBufferSize(VOID)
|
|||
VOID
|
||||
MachVideoSetTextCursorPosition(ULONG X, ULONG Y)
|
||||
{
|
||||
return MachVtbl.VideoSetTextCursorPosition(X, Y);
|
||||
MachVtbl.VideoSetTextCursorPosition(X, Y);
|
||||
}
|
||||
|
||||
VOID
|
||||
|
@ -125,13 +125,13 @@ MachVideoIsPaletteFixed(VOID)
|
|||
VOID
|
||||
MachVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
|
||||
{
|
||||
return MachVtbl.VideoSetPaletteColor(Color, Red, Green, Blue);
|
||||
MachVtbl.VideoSetPaletteColor(Color, Red, Green, Blue);
|
||||
}
|
||||
|
||||
VOID
|
||||
MachVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
|
||||
{
|
||||
return MachVtbl.VideoGetPaletteColor(Color, Red, Green, Blue);
|
||||
MachVtbl.VideoGetPaletteColor(Color, Red, Green, Blue);
|
||||
}
|
||||
|
||||
VOID
|
||||
|
|
|
@ -40,7 +40,7 @@ static VOID
|
|||
NTAPI
|
||||
CmpFree (PVOID Ptr, IN ULONG Quota)
|
||||
{
|
||||
return MmHeapFree(Ptr);
|
||||
MmHeapFree(Ptr);
|
||||
}
|
||||
|
||||
static BOOLEAN
|
||||
|
|
|
@ -65,6 +65,7 @@ VOID LoadReactOSSetup(VOID)
|
|||
INFCONTEXT InfContext;
|
||||
PIMAGE_NT_HEADERS NtHeader;
|
||||
PVOID LoadBase;
|
||||
extern BOOLEAN FrLdrBootType;
|
||||
|
||||
/* Setup multiboot information structure */
|
||||
LoaderBlock.CommandLine = reactos_kernel_cmdline;
|
||||
|
@ -108,7 +109,6 @@ VOID LoadReactOSSetup(VOID)
|
|||
#endif
|
||||
UiDrawStatusText("");
|
||||
|
||||
extern BOOLEAN FrLdrBootType;
|
||||
FrLdrBootType = TRUE;
|
||||
|
||||
/* Detect hardware */
|
||||
|
|
|
@ -42,5 +42,5 @@ NTAPI
|
|||
RtlpFreeMemory(PVOID Mem,
|
||||
ULONG Tag)
|
||||
{
|
||||
return MmHeapFree(Mem);
|
||||
MmHeapFree(Mem);
|
||||
}
|
||||
|
|
|
@ -27,9 +27,9 @@ PVOID TextVideoBuffer = NULL;
|
|||
*/
|
||||
int TuiPrintf(const char *format, ... )
|
||||
{
|
||||
char c, *ptr, str[16];
|
||||
va_list ap;
|
||||
va_start(ap,format);
|
||||
char c, *ptr, str[16];
|
||||
|
||||
while ((c = *(format++)))
|
||||
{
|
||||
|
|
|
@ -38,7 +38,10 @@ VOID VideoFadeIn(PPALETTE_ENTRY Palette, ULONG ColorCount)
|
|||
{
|
||||
ULONG Index;
|
||||
ULONG Color;
|
||||
PALETTE_ENTRY PaletteColors[ColorCount];
|
||||
PPALETTE_ENTRY PaletteColors;
|
||||
|
||||
PaletteColors = MmHeapAlloc(sizeof(PALETTE_ENTRY) * ColorCount);
|
||||
if (!PaletteColors) return;
|
||||
|
||||
for (Index=0; Index<RGB_MAX; Index++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue