- 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
#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")
// 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:
//
#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)
// 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
#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
#define VERTRES_350_SCANLINES 0x01
#define VERTRES_400_SCANLINES 0x02
+#include <pshpack2.h>
typedef struct
{
USHORT ModeAttributes; /* mode attributes (see #00080) */
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 */
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);
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);
#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);
VOID
MachVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
{
- return MachVtbl.VideoGetDisplaySize(Width, Height, Depth);
+ MachVtbl.VideoGetDisplaySize(Width, Height, Depth);
}
ULONG
VOID
MachVideoSetTextCursorPosition(ULONG X, ULONG Y)
{
- return MachVtbl.VideoSetTextCursorPosition(X, Y);
+ MachVtbl.VideoSetTextCursorPosition(X, Y);
}
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
NTAPI
CmpFree (PVOID Ptr, IN ULONG Quota)
{
- return MmHeapFree(Ptr);
+ MmHeapFree(Ptr);
}
static BOOLEAN
NULL };
CHAR FileName[256];
- HINF InfHandle;
- ULONG ErrorLine;
- INFCONTEXT InfContext;
+ HINF InfHandle;
+ ULONG ErrorLine;
+ INFCONTEXT InfContext;
PIMAGE_NT_HEADERS NtHeader;
PVOID LoadBase;
+ extern BOOLEAN FrLdrBootType;
/* Setup multiboot information structure */
LoaderBlock.CommandLine = reactos_kernel_cmdline;
#endif
UiDrawStatusText("");
- extern BOOLEAN FrLdrBootType;
- FrLdrBootType = TRUE;
+ FrLdrBootType = TRUE;
/* Detect hardware */
UiDrawStatusText("Detecting hardware...");
RtlpFreeMemory(PVOID Mem,
ULONG Tag)
{
- return MmHeapFree(Mem);
+ MmHeapFree(Mem);
}
*/
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++)))
{
{
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++)
{