Author: sginsberg Date: Tue Sep 15 11:07:28 2015 New Revision: 69240
URL: http://svn.reactos.org/svn/reactos?rev=69240&view=rev Log: [FREELDR] Fix a whole bunch of assumptions about default calling convention being cdecl, mostly in code called from/to assembly. Freeldr now links with /Gz (standard calling convention as stdcall), which is what this is all about
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386idt.c trunk/reactos/boot/freeldr/freeldr/freeldr.c trunk/reactos/boot/freeldr/freeldr/fs/pxe.c trunk/reactos/boot/freeldr/freeldr/include/arch/i386/i386.h trunk/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pcbios.h trunk/reactos/boot/freeldr/freeldr/include/freeldr.h trunk/reactos/boot/freeldr/freeldr/include/linux.h
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/i386idt.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/i386idt.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/i386idt.c [iso-8859-1] Tue Sep 15 11:07:28 2015 @@ -19,6 +19,7 @@ }
void +__cdecl InitIdt(void) { InitIdtVector(0, i386DivideByZero, 0x8e00);
Modified: trunk/reactos/boot/freeldr/freeldr/freeldr.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/freeld... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/freeldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/freeldr.c [iso-8859-1] Tue Sep 15 11:07:28 2015 @@ -26,7 +26,7 @@
/* FUNCTIONS ******************************************************************/
-VOID BootMain(LPSTR CmdLine) +VOID __cdecl BootMain(LPSTR CmdLine) { CmdLineParse(CmdLine); MachInit(CmdLine);
Modified: trunk/reactos/boot/freeldr/freeldr/fs/pxe.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/fs/pxe... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/fs/pxe.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/fs/pxe.c [iso-8859-1] Tue Sep 15 11:07:28 2015 @@ -84,7 +84,7 @@ return pPxe; }
-extern PXENV_EXIT PxeCallApi(UINT16 Segment, UINT16 Offset, UINT16 Service, VOID *Parameter); +extern PXENV_EXIT __cdecl PxeCallApi(UINT16 Segment, UINT16 Offset, UINT16 Service, VOID *Parameter); BOOLEAN CallPxe(UINT16 Service, PVOID Parameter) { PPXE pxe;
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/i386.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/i386.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/i386.h [iso-8859-1] Tue Sep 15 11:07:28 2015 @@ -50,23 +50,23 @@ HARDWARE_PTE Pde[1024]; } PAGE_DIRECTORY_X86, *PPAGE_DIRECTORY_X86;
-void i386DivideByZero(void); -void i386DebugException(void); -void i386NMIException(void); -void i386Breakpoint(void); -void i386Overflow(void); -void i386BoundException(void); -void i386InvalidOpcode(void); -void i386FPUNotAvailable(void); -void i386DoubleFault(void); -void i386CoprocessorSegment(void); -void i386InvalidTSS(void); -void i386SegmentNotPresent(void); -void i386StackException(void); -void i386GeneralProtectionFault(void); -void i386PageFault(void); -void i386CoprocessorError(void); -void i386AlignmentCheck(void); -void i386MachineCheck(void); +void __cdecl i386DivideByZero(void); +void __cdecl i386DebugException(void); +void __cdecl i386NMIException(void); +void __cdecl i386Breakpoint(void); +void __cdecl i386Overflow(void); +void __cdecl i386BoundException(void); +void __cdecl i386InvalidOpcode(void); +void __cdecl i386FPUNotAvailable(void); +void __cdecl i386DoubleFault(void); +void __cdecl i386CoprocessorSegment(void); +void __cdecl i386InvalidTSS(void); +void __cdecl i386SegmentNotPresent(void); +void __cdecl i386StackException(void); +void __cdecl i386GeneralProtectionFault(void); +void __cdecl i386PageFault(void); +void __cdecl i386CoprocessorError(void); +void __cdecl i386AlignmentCheck(void); +void __cdecl i386MachineCheck(void);
/* EOF */
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/pc/hardware.h [iso-8859-1] Tue Sep 15 11:07:28 2015 @@ -44,13 +44,13 @@ VOID DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber);
/* i386pnp.S */ -ULONG_PTR PnpBiosSupported(VOID); -ULONG PnpBiosGetDeviceNodeCount(ULONG *NodeSize, +ULONG_PTR __cdecl PnpBiosSupported(VOID); +ULONG __cdecl PnpBiosGetDeviceNodeCount(ULONG *NodeSize, ULONG *NodeCount); -ULONG PnpBiosGetDeviceNode(UCHAR *NodeId, +ULONG __cdecl PnpBiosGetDeviceNode(UCHAR *NodeId, UCHAR *NodeBuffer);
/* i386pxe.S */ -USHORT PxeCallApi(USHORT Segment, USHORT Offset, USHORT Service, VOID* Parameter); +USHORT __cdecl PxeCallApi(USHORT Segment, USHORT Offset, USHORT Service, VOID* Parameter);
/* EOF */
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pcbios.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pcbios.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/pc/pcbios.h [iso-8859-1] Tue Sep 15 11:07:28 2015 @@ -114,16 +114,16 @@ // Make sure all memory pointers are in SEG:OFFS format and // not linear addresses, unless the interrupt handler // specifically handles linear addresses. -int Int386(int ivec, REGS* in, REGS* out); +int __cdecl Int386(int ivec, REGS* in, REGS* out);
// This macro tests the Carry Flag // If CF is set then the call failed (usually) #define INT386_SUCCESS(regs) ((regs.x.eflags & EFLAGS_CF) == 0)
void EnableA20(void); -VOID ChainLoadBiosBootSectorCode(VOID); // Implemented in boot.S -VOID Reboot(VOID); // Implemented in boot.S -VOID DetectHardware(VOID); // Implemented in hardware.c +VOID __cdecl ChainLoadBiosBootSectorCode(VOID); // Implemented in boot.S +VOID __cdecl Reboot(VOID); // Implemented in boot.S +VOID DetectHardware(VOID); // Implemented in hardware.c
#endif /* ! __ASM__ */
Modified: trunk/reactos/boot/freeldr/freeldr/include/freeldr.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] Tue Sep 15 11:07:28 2015 @@ -119,7 +119,7 @@ #include <arch/mips/arcbios.h> #endif
-VOID BootMain(LPSTR CmdLine); +VOID __cdecl BootMain(LPSTR CmdLine); VOID LoadOperatingSystem(IN OperatingSystemItem* OperatingSystem); VOID RunLoader(VOID); VOID FrLdrCheckCpuCompatiblity(VOID);
Modified: trunk/reactos/boot/freeldr/freeldr/include/linux.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/linux.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/linux.h [iso-8859-1] Tue Sep 15 11:07:28 2015 @@ -128,8 +128,8 @@ } LINUX_SETUPSECTOR, *PLINUX_SETUPSECTOR; #include <poppack.h>
-VOID BootNewLinuxKernel(VOID); // Implemented in linux.S -VOID BootOldLinuxKernel(ULONG KernelSize); // Implemented in linux.S +VOID __cdecl BootNewLinuxKernel(VOID); // Implemented in linux.S +VOID __cdecl BootOldLinuxKernel(ULONG KernelSize); // Implemented in linux.S
VOID LoadAndBootLinux(IN OperatingSystemItem* OperatingSystem,