[ros-diffs] [sir_richard] 49463: [HAL]: Add INIT_FUNCTION where needed. Will save 860KB later.

sir_richard at svn.reactos.org sir_richard at svn.reactos.org
Thu Nov 4 01:28:10 UTC 2010


Author: sir_richard
Date: Thu Nov  4 01:28:09 2010
New Revision: 49463

URL: http://svn.reactos.org/svn/reactos?rev=49463&view=rev
Log:
[HAL]: Add INIT_FUNCTION where needed. Will save 860KB later.

Added:
    trunk/reactos/hal/halx86/generic/legacy/bus/libpcidata.a   (with props)
Modified:
    trunk/reactos/hal/halx86/generic/cmos.c
    trunk/reactos/hal/halx86/generic/dma.c
    trunk/reactos/hal/halx86/generic/halinit.c
    trunk/reactos/hal/halx86/generic/legacy/bus/pcibus.c
    trunk/reactos/hal/halx86/generic/legacy/bus/pcidata.c
    trunk/reactos/hal/halx86/generic/legacy/bussupp.c
    trunk/reactos/hal/halx86/generic/legacy/halpcat.c
    trunk/reactos/hal/halx86/generic/memory.c
    trunk/reactos/hal/halx86/generic/misc.c
    trunk/reactos/hal/halx86/generic/timer.c
    trunk/reactos/hal/halx86/generic/usage.c
    trunk/reactos/hal/halx86/include/halp.h

Modified: trunk/reactos/hal/halx86/generic/cmos.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/cmos.c?rev=49463&r1=49462&r2=49463&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/cmos.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/cmos.c [iso-8859-1] Thu Nov  4 01:28:09 2010
@@ -152,6 +152,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpInitializeCmos(VOID)
 {
     /* Set default century offset byte */

Modified: trunk/reactos/hal/halx86/generic/dma.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/dma.c?rev=49463&r1=49462&r2=49463&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/dma.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/dma.c [iso-8859-1] Thu Nov  4 01:28:09 2010
@@ -126,6 +126,7 @@
 
 #ifndef _MINIHAL_
 VOID
+INIT_FUNCTION
 HalpInitDma(VOID)
 {
     /*

Modified: trunk/reactos/hal/halx86/generic/halinit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/halinit.c?rev=49463&r1=49462&r2=49463&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/halinit.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/halinit.c [iso-8859-1] Thu Nov  4 01:28:09 2010
@@ -20,6 +20,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpGetParameters(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
 {
     PCHAR CommandLine;
@@ -45,6 +46,7 @@
  */
 BOOLEAN
 NTAPI
+INIT_FUNCTION
 HalInitSystem(IN ULONG BootPhase,
               IN PLOADER_PARAMETER_BLOCK LoaderBlock)
 {

Added: trunk/reactos/hal/halx86/generic/legacy/bus/libpcidata.a
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/legacy/bus/libpcidata.a?rev=49463&view=auto
==============================================================================
Binary file - no diff available.

Propchange: trunk/reactos/hal/halx86/generic/legacy/bus/libpcidata.a
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: trunk/reactos/hal/halx86/generic/legacy/bus/pcibus.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/legacy/bus/pcibus.c?rev=49463&r1=49462&r2=49463&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/legacy/bus/pcibus.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/legacy/bus/pcibus.c [iso-8859-1] Thu Nov  4 01:28:09 2010
@@ -600,6 +600,7 @@
 
 NTSTATUS
 NTAPI
+INIT_FUNCTION
 HalpSetupPciDeviceForDebugging(IN PVOID LoaderBlock,
                                IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice)
 {
@@ -609,6 +610,7 @@
 
 NTSTATUS
 NTAPI
+INIT_FUNCTION
 HalpReleasePciDeviceForDebugging(IN OUT PDEBUG_DEVICE_DESCRIPTOR PciDevice)
 {
     DPRINT1("Unimplemented!\n");
@@ -617,6 +619,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpRegisterPciDebuggingDeviceInfo(VOID)
 {
     BOOLEAN Found = FALSE;
@@ -853,6 +856,7 @@
 
 PPCI_REGISTRY_INFO_INTERNAL
 NTAPI
+INIT_FUNCTION
 HalpQueryPciRegistryInfo(VOID)
 {
 #ifndef _MINIHAL_
@@ -1085,6 +1089,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpInitializePciStubs(VOID)
 {
     PPCI_REGISTRY_INFO_INTERNAL PciRegistryInfo;

Modified: trunk/reactos/hal/halx86/generic/legacy/bus/pcidata.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/legacy/bus/pcidata.c?rev=49463&r1=49462&r2=49463&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/legacy/bus/pcidata.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/legacy/bus/pcidata.c [iso-8859-1] Thu Nov  4 01:28:09 2010
@@ -15,7 +15,7 @@
 /* GLOBALS *******************************************************************/
 
 #ifndef _MINIHAL_
-CHAR ClassTable[3922] =
+INIT_FUNCTION CHAR ClassTable[3922] =
 {
     0x43, 0x20, 0x30, 0x30, 0x20, 0x20, 0x55, 0x6E, 0x63, 0x6C, 0x61, 0x73, 0x73, 0x69, 0x66, 0x69, 
     0x65, 0x64, 0x20, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x0D, 0x0A, 0x09, 0x30, 0x30, 0x20, 0x20, 
@@ -265,7 +265,7 @@
     0x72, 0x00, 
 };
 
-CHAR VendorTable[642355] =
+INIT_FUNCTION CHAR VendorTable[642355] =
 {
     0x30, 0x30, 0x30, 0x30, 0x20, 0x20, 0x47, 0x61, 0x6D, 0x6D, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 
     0x78, 0x2C, 0x20, 0x49, 0x6E, 0x63, 0x2E, 0x20, 0x28, 0x6F, 0x72, 0x20, 0x6D, 0x69, 0x73, 0x73, 

Modified: trunk/reactos/hal/halx86/generic/legacy/bussupp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/legacy/bussupp.c?rev=49463&r1=49462&r2=49463&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/legacy/bussupp.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/legacy/bussupp.c [iso-8859-1] Thu Nov  4 01:28:09 2010
@@ -65,6 +65,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpRegisterInternalBusHandlers(VOID)
 {
     PBUS_HANDLER Bus;
@@ -139,6 +140,7 @@
 #ifndef _MINIHAL_
 NTSTATUS
 NTAPI
+INIT_FUNCTION
 HalpMarkChipsetDecode(BOOLEAN OverrideEnable)
 {
     NTSTATUS Status;
@@ -186,6 +188,7 @@
 
 PBUS_HANDLER
 NTAPI
+INIT_FUNCTION
 HalpAllocateAndInitPciBusHandler(IN ULONG PciType,
                                  IN ULONG BusNo,
                                  IN BOOLEAN TestAllocation)
@@ -270,6 +273,7 @@
 
 BOOLEAN
 NTAPI
+INIT_FUNCTION
 HalpIsValidPCIDevice(IN PBUS_HANDLER BusHandler,
                      IN PCI_SLOT_NUMBER Slot)
 {
@@ -331,6 +335,7 @@
 
 NTSTATUS
 NTAPI
+INIT_FUNCTION
 HalpGetChipHacks(IN USHORT VendorId,
                  IN USHORT DeviceId,
                  IN UCHAR RevisionId,
@@ -394,6 +399,7 @@
 
 BOOLEAN
 NTAPI
+INIT_FUNCTION
 HalpIsRecognizedCard(IN PPCI_REGISTRY_INFO_INTERNAL PciRegistryInfo,
                      IN PPCI_COMMON_CONFIG PciData,
                      IN ULONG Flags)
@@ -474,6 +480,7 @@
 
 BOOLEAN
 NTAPI
+INIT_FUNCTION
 HalpIsIdeDevice(IN PPCI_COMMON_CONFIG PciData)
 {
     /* Simple test first */
@@ -526,6 +533,7 @@
 
 BOOLEAN
 NTAPI
+INIT_FUNCTION
 HalpIsBridgeDevice(IN PPCI_COMMON_CONFIG PciData)
 {
     /* Either this is a PCI-to-PCI Bridge, or a CardBUS Bridge */
@@ -539,6 +547,7 @@
     
 BOOLEAN
 NTAPI
+INIT_FUNCTION
 HalpGetPciBridgeConfig(IN ULONG PciType,
                        IN PUCHAR BusCount)
 {
@@ -591,6 +600,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpFixupPciSupportedRanges(IN ULONG BusCount)
 {
     ULONG i;
@@ -653,6 +663,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 ShowSize(ULONG x)
 {
     if (!x) return;
@@ -678,6 +689,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpDebugPciDumpBus(IN ULONG i,
                     IN ULONG j,
                     IN ULONG k,
@@ -829,6 +841,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpInitializePciBus(VOID)
 {
 #ifndef _MINIHAL_
@@ -1093,6 +1106,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpInitBusHandlers(VOID)
 {
     /* Register the HAL Bus Handler support */
@@ -1101,6 +1115,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpRegisterKdSupportFunctions(VOID)
 {
     /* Register PCI Device Functions */

Modified: trunk/reactos/hal/halx86/generic/legacy/halpcat.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/legacy/halpcat.c?rev=49463&r1=49462&r2=49463&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/legacy/halpcat.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/legacy/halpcat.c [iso-8859-1] Thu Nov  4 01:28:09 2010
@@ -23,6 +23,7 @@
 
 NTSTATUS
 NTAPI
+INIT_FUNCTION
 HalpSetupAcpiPhase0(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
 {
     /* There is no ACPI on these HALs */
@@ -31,6 +32,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpBuildAddressMap(VOID)
 {
     /* FIXME: Inherit ROM blocks from the registry */
@@ -42,6 +44,7 @@
 
 BOOLEAN
 NTAPI
+INIT_FUNCTION
 HalpGetDebugPortTable(VOID)
 {
     /* No ACPI */
@@ -50,6 +53,7 @@
 
 ULONG
 NTAPI
+INIT_FUNCTION
 HalpIs16BitPortDecodeSupported(VOID)
 {
     /* Only EISA systems support this */
@@ -58,9 +62,11 @@
 
 NTSTATUS
 NTAPI
+INIT_FUNCTION
 HaliInitPnpDriver(VOID)
 {
     /* On PC-AT, this will interface with the PCI driver */
+    //HalpDebugPciBus();
     return STATUS_SUCCESS;
 }
 
@@ -69,6 +75,7 @@
  */
 VOID
 NTAPI
+INIT_FUNCTION
 HalReportResourceUsage(VOID)
 {
     INTERFACE_TYPE InterfaceType;

Modified: trunk/reactos/hal/halx86/generic/memory.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/memory.c?rev=49463&r1=49462&r2=49463&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/memory.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/memory.c [iso-8859-1] Thu Nov  4 01:28:09 2010
@@ -24,7 +24,6 @@
 
 
 /* PRIVATE FUNCTIONS *********************************************************/
-
 
 ULONG
 NTAPI

Modified: trunk/reactos/hal/halx86/generic/misc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/misc.c?rev=49463&r1=49462&r2=49463&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/misc.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/misc.c [iso-8859-1] Thu Nov  4 01:28:09 2010
@@ -24,6 +24,7 @@
 #ifndef _MINIHAL_
 VOID
 NTAPI
+INIT_FUNCTION
 HalpReportSerialNumber(VOID)
 {
     NTSTATUS Status;
@@ -54,6 +55,7 @@
 
 NTSTATUS
 NTAPI
+INIT_FUNCTION
 HalpMarkAcpiHal(VOID)
 {
     NTSTATUS Status;

Modified: trunk/reactos/hal/halx86/generic/timer.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/timer.c?rev=49463&r1=49462&r2=49463&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/timer.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/timer.c [iso-8859-1] Thu Nov  4 01:28:09 2010
@@ -44,6 +44,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpInitializeClock(VOID)
 {
     PKPRCB Prcb = KeGetCurrentPrcb();

Modified: trunk/reactos/hal/halx86/generic/usage.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/generic/usage.c?rev=49463&r1=49462&r2=49463&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/generic/usage.c [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/generic/usage.c [iso-8859-1] Thu Nov  4 01:28:09 2010
@@ -63,6 +63,7 @@
 #ifndef _MINIHAL_
 VOID
 NTAPI
+INIT_FUNCTION
 HalpGetResourceSortValue(IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor,
                          OUT PULONG Scale,
                          OUT PLARGE_INTEGER Value)
@@ -102,6 +103,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpBuildPartialFromIdt(IN ULONG Entry,
                         IN PCM_PARTIAL_RESOURCE_DESCRIPTOR RawDescriptor,
                         IN PCM_PARTIAL_RESOURCE_DESCRIPTOR TranslatedDescriptor)
@@ -139,6 +141,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpBuildPartialFromAddress(IN INTERFACE_TYPE Interface,
                             IN PADDRESS_USAGE CurrentAddress,
                             IN ULONG Element,
@@ -206,6 +209,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpReportResourceUsage(IN PUNICODE_STRING HalName,
                         IN INTERFACE_TYPE InterfaceType)
 {
@@ -484,6 +488,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpRegisterVector(IN UCHAR Flags,
                    IN ULONG BusVector,
                    IN ULONG SystemVector,
@@ -500,6 +505,7 @@
 #ifndef _MINIHAL_
 VOID
 NTAPI
+INIT_FUNCTION
 HalpEnableInterruptHandler(IN UCHAR Flags,
                            IN ULONG BusVector,
                            IN ULONG SystemVector,
@@ -522,6 +528,7 @@
 
 VOID
 NTAPI
+INIT_FUNCTION
 HalpGetNMICrashFlag(VOID)
 {
     UNICODE_STRING ValueName;

Modified: trunk/reactos/hal/halx86/include/halp.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/include/halp.h?rev=49463&r1=49462&r2=49463&view=diff
==============================================================================
--- trunk/reactos/hal/halx86/include/halp.h [iso-8859-1] (original)
+++ trunk/reactos/hal/halx86/include/halp.h [iso-8859-1] Thu Nov  4 01:28:09 2010
@@ -4,6 +4,16 @@
 
 #pragma once
 
+#define PLACE_IN_SECTION(s)	__attribute__((section (s)))
+#ifdef __GNUC__
+#define INIT_FUNCTION		PLACE_IN_SECTION("init")
+#define PAGE_LOCKED_FUNCTION	PLACE_IN_SECTION("pagelk")
+#define PAGE_UNLOCKED_FUNCTION	PLACE_IN_SECTION("pagepo")
+#else
+#define INIT_FUNCTION
+#define PAGE_LOCKED_FUNCTION	
+#define PAGE_UNLOCKED_FUNCTION	
+#endif
 
 #ifdef _MSC_VER
 #define REGISTERCALL FASTCALL




More information about the Ros-diffs mailing list