- Enable placing kernel functions in the .INIT section (GCC only, MSVC is TBD). This allows them to be freed from memory after initialization is finished.

- PspMapSystemDll and IopDisplayLoadingMessage are called from non-initialization code, so don't put them in .INIT. CmpHiveRootSecurityDescriptor is called from initialization code, but too late in boot, so don't discard it either.
- Trying to enable this for HAL as well leads to a weird crash very early in boot. Investigation is ongoing. Until then we will just have to keep the huge PCI Class/Vendor tables in memory...
- Enable it for Win32k though as it seems to work fine there.
- Remove INIT_FUNCTION from function prototypes, it serves no purpose there.
See issue 10097 for more details.

svn path=/trunk/; revision=68937
This commit is contained in:
Stefan Ginsberg 2015-09-03 15:31:09 +00:00
parent 42a15c9829
commit 72a849ff44
7 changed files with 12 additions and 20 deletions

View file

@ -16,9 +16,9 @@
/* FUNCTIONS *****************************************************************/
//INIT_FUNCTION
PSECURITY_DESCRIPTOR
NTAPI
INIT_FUNCTION
CmpHiveRootSecurityDescriptor(VOID)
{
NTSTATUS Status;

View file

@ -47,7 +47,6 @@
#endif
VOID
INIT_FUNCTION
NTAPI
DbgkInitialize(
VOID

View file

@ -662,7 +662,6 @@ IoDestroyDriverList(
);
NTSTATUS
INIT_FUNCTION
IopInitPlugPlayEvents(VOID);
NTSTATUS

View file

@ -3,17 +3,16 @@
/*
* Use these to place a function in a specific section of the executable
*/
#define PLACE_IN_SECTION(s) __attribute__((section (s)))
#ifdef __GNUC__
#define INIT_FUNCTION
#define PAGE_LOCKED_FUNCTION PLACE_IN_SECTION("pagelk")
#define PAGE_UNLOCKED_FUNCTION PLACE_IN_SECTION("pagepo")
#define INIT_SECTION __attribute__((section ("INIT")))
#define INIT_FUNCTION INIT_SECTION
#else
#define INIT_FUNCTION
#define PAGE_LOCKED_FUNCTION
#define PAGE_UNLOCKED_FUNCTION
#define INIT_SECTION /* Done via alloc_text for MSC */
#define INIT_FUNCTION INIT_SECTION
#endif
#ifdef _NTOSKRNL_
#ifndef _ARM_

View file

@ -197,7 +197,6 @@ IopSuffixUnicodeString(
*/
VOID
FASTCALL
INIT_FUNCTION
IopDisplayLoadingMessage(PUNICODE_STRING ServiceName)
{
CHAR TextBuffer[256];

View file

@ -242,7 +242,6 @@ PspLookupKernelUserEntryPoints(VOID)
NTSTATUS
NTAPI
INIT_FUNCTION
PspMapSystemDll(IN PEPROCESS Process,
IN PVOID *DllBase,
IN BOOLEAN UseLargePages)

View file

@ -10,15 +10,12 @@
#pragma once
#if 0
#ifndef _MSC_VER
#define PLACE_IN_SECTION(s) __attribute__((section(s)))
#define INIT_FUNCTION PLACE_IN_SECTION("INIT")
#ifdef __GNUC__
#define INIT_SECTION __attribute__((section ("INIT")))
#define INIT_FUNCTION INIT_SECTION
#else
#define INIT_FUNCTION
#endif
#else
#define INIT_FUNCTION
#define INIT_SECTION /* Done via alloc_text for MSC */
#define INIT_FUNCTION INIT_SECTION
#endif
/* Enable debugging features */