Skip to content

Commit

Permalink
[NTOS:PNP][HALX86] Remove firmware mapper from the kernel
Browse files Browse the repository at this point in the history
And put its functionality into legacy x86 HAL
  • Loading branch information
Extravert-ir committed Jun 29, 2023
1 parent 1f49d86 commit 3a6a974
Show file tree
Hide file tree
Showing 13 changed files with 127 additions and 358 deletions.
1 change: 0 additions & 1 deletion hal/halx86/acpi/halacpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ ULONG HalpInvalidAcpiTable;
ULONG HalpPicVectorRedirect[] = {0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15};

/* This determines the HAL type */
BOOLEAN HalDisableFirmwareMapper = TRUE;
PWCHAR HalHardwareIdString = L"acpipic_up";
PWCHAR HalName = L"ACPI Compatible Eisa/Isa HAL";

Expand Down
48 changes: 0 additions & 48 deletions hal/halx86/generic/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,54 +51,6 @@ HalpReportSerialNumber(VOID)
}
}

CODE_SEG("INIT")
NTSTATUS
NTAPI
HalpMarkAcpiHal(VOID)
{
NTSTATUS Status;
UNICODE_STRING KeyString;
HANDLE KeyHandle;
HANDLE Handle;
ULONG Value = HalDisableFirmwareMapper ? 1 : 0;

/* Open the control set key */
RtlInitUnicodeString(&KeyString,
L"\\REGISTRY\\MACHINE\\SYSTEM\\CURRENTCONTROLSET");
Status = HalpOpenRegistryKey(&Handle, 0, &KeyString, KEY_ALL_ACCESS, FALSE);
if (NT_SUCCESS(Status))
{
/* Open the PNP key */
RtlInitUnicodeString(&KeyString, L"Control\\Pnp");
Status = HalpOpenRegistryKey(&KeyHandle,
Handle,
&KeyString,
KEY_ALL_ACCESS,
TRUE);
/* Close root key */
ZwClose(Handle);

/* Check if PNP BIOS key exists */
if (NT_SUCCESS(Status))
{
/* Set the disable value to false -- we need the mapper */
RtlInitUnicodeString(&KeyString, L"DisableFirmwareMapper");
Status = ZwSetValueKey(KeyHandle,
&KeyString,
0,
REG_DWORD,
&Value,
sizeof(Value));

/* Close subkey */
ZwClose(KeyHandle);
}
}

/* Return status */
return Status;
}

NTSTATUS
NTAPI
HalpOpenRegistryKey(IN PHANDLE KeyHandle,
Expand Down
3 changes: 0 additions & 3 deletions hal/halx86/generic/usage.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,9 +531,6 @@ HalpReportResourceUsage(IN PUNICODE_STRING HalName,
TranslatedFull = (PCM_FULL_RESOURCE_DESCRIPTOR)CurrentTranslated;
}

/* Mark this is an ACPI system, if it is */
HalpMarkAcpiHal();

/* Tell the kernel about all this */
IoReportHalResourceUsage(HalName,
RawList,
Expand Down
8 changes: 0 additions & 8 deletions hal/halx86/include/halp.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,6 @@ HalpReportSerialNumber(
VOID
);

CODE_SEG("INIT")
NTSTATUS
NTAPI
HalpMarkAcpiHal(
VOID
);

CODE_SEG("INIT")
VOID
NTAPI
Expand Down Expand Up @@ -582,7 +575,6 @@ extern LARGE_INTEGER HalpPerfCounter;

extern KAFFINITY HalpActiveProcessors;

extern BOOLEAN HalDisableFirmwareMapper;
extern PWCHAR HalName;

extern KAFFINITY HalpDefaultInterruptAffinity;
Expand Down
1 change: 1 addition & 0 deletions hal/halx86/legacy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ list(APPEND HAL_LEGACY_SOURCE
${CMAKE_CURRENT_BINARY_DIR}/pci_classes.c
${CMAKE_CURRENT_BINARY_DIR}/pci_vendors.c
legacy/bus/sysbus.c
legacy/arcmap.c
legacy/bussupp.c
legacy/halpnpdd.c
legacy/halpcat.c
Expand Down
Loading

0 comments on commit 3a6a974

Please sign in to comment.