mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 13:13:00 +00:00
[NDK][NTOS] Add global definition of INIT_FUNCTION/INIT_SECTION (#779)
* Add an NDK header to define INIT_FUNCTION/INIT_SECTION globally * Use _declspec(allocate(x)) and _declspec(code_seg(x)) on MSVC versions that support it * Use INIT_FUNCTION on functions only and INIT_SECTION on data only (required by MSVC) * Place INIT_FUNCTION before the return type (required by MSVC) * Make sure declarations and implementations share the same modifiers (required by MSVC) * Add a global linker option to suppress warnings about defined but unused INIT section * Merge INIT section into .text in freeldr
This commit is contained in:
parent
7c66247343
commit
71fefa32db
108 changed files with 522 additions and 296 deletions
|
@ -12,6 +12,7 @@
|
|||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
INIT_FUNCTION
|
||||
VOID
|
||||
NTAPI
|
||||
HalpGetResourceSortValue(
|
||||
|
@ -20,6 +21,7 @@ HalpGetResourceSortValue(
|
|||
OUT PLARGE_INTEGER Value
|
||||
);
|
||||
|
||||
INIT_FUNCTION
|
||||
VOID
|
||||
NTAPI
|
||||
HalpBuildPartialFromIdt(
|
||||
|
@ -28,6 +30,7 @@ HalpBuildPartialFromIdt(
|
|||
IN PCM_PARTIAL_RESOURCE_DESCRIPTOR TranslatedDescriptor
|
||||
);
|
||||
|
||||
INIT_FUNCTION
|
||||
VOID
|
||||
NTAPI
|
||||
HalpBuildPartialFromAddress(
|
||||
|
@ -97,7 +100,7 @@ ADDRESS_USAGE HalpDefaultIoSpace =
|
|||
/* FUNCTIONS ******************************************************************/
|
||||
|
||||
#ifndef _MINIHAL_
|
||||
INIT_SECTION
|
||||
INIT_FUNCTION
|
||||
VOID
|
||||
NTAPI
|
||||
HalpGetResourceSortValue(IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor,
|
||||
|
@ -137,7 +140,7 @@ HalpGetResourceSortValue(IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor,
|
|||
}
|
||||
}
|
||||
|
||||
INIT_SECTION
|
||||
INIT_FUNCTION
|
||||
VOID
|
||||
NTAPI
|
||||
HalpBuildPartialFromIdt(IN ULONG Entry,
|
||||
|
@ -175,7 +178,7 @@ HalpBuildPartialFromIdt(IN ULONG Entry,
|
|||
TranslatedDescriptor->u.Interrupt.Level = HalpIDTUsage[Entry].Irql;
|
||||
}
|
||||
|
||||
INIT_SECTION
|
||||
INIT_FUNCTION
|
||||
VOID
|
||||
NTAPI
|
||||
HalpBuildPartialFromAddress(IN INTERFACE_TYPE Interface,
|
||||
|
@ -243,7 +246,7 @@ HalpBuildPartialFromAddress(IN INTERFACE_TYPE Interface,
|
|||
}
|
||||
}
|
||||
|
||||
INIT_SECTION
|
||||
INIT_FUNCTION
|
||||
VOID
|
||||
NTAPI
|
||||
HalpReportResourceUsage(IN PUNICODE_STRING HalName,
|
||||
|
@ -522,7 +525,7 @@ HalpReportResourceUsage(IN PUNICODE_STRING HalName,
|
|||
}
|
||||
#endif
|
||||
|
||||
INIT_SECTION
|
||||
INIT_FUNCTION
|
||||
VOID
|
||||
NTAPI
|
||||
HalpRegisterVector(IN UCHAR Flags,
|
||||
|
@ -539,7 +542,7 @@ HalpRegisterVector(IN UCHAR Flags,
|
|||
}
|
||||
|
||||
#ifndef _MINIHAL_
|
||||
INIT_SECTION
|
||||
INIT_FUNCTION
|
||||
VOID
|
||||
NTAPI
|
||||
HalpEnableInterruptHandler(IN UCHAR Flags,
|
||||
|
@ -562,7 +565,7 @@ HalpEnableInterruptHandler(IN UCHAR Flags,
|
|||
HalEnableSystemInterrupt(SystemVector, Irql, Mode);
|
||||
}
|
||||
|
||||
INIT_SECTION
|
||||
INIT_FUNCTION
|
||||
VOID
|
||||
NTAPI
|
||||
HalpGetNMICrashFlag(VOID)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue