https://git.reactos.org/?p=reactos.git;a=commitdiff;h=85616bc8b2dad302417d3…
commit 85616bc8b2dad302417d32ee3cac8933ed47cd6d
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sat Jul 27 09:56:37 2019 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sun Sep 8 10:42:16 2019 +0200
[SETUP] Add support for archtitcure specific inf sections and use it for x64 computer
type
---
base/setup/lib/settings.c | 54 ++++++++++++++++++++++++++++++++++------------
boot/bootdata/txtsetup.sif | 14 ++++++++++--
2 files changed, 52 insertions(+), 16 deletions(-)
diff --git a/base/setup/lib/settings.c b/base/setup/lib/settings.c
index 2d1c4e1c349..cafe247c05c 100644
--- a/base/setup/lib/settings.c
+++ b/base/setup/lib/settings.c
@@ -433,16 +433,18 @@ DefaultProcessEntry(
}
-PGENERIC_LIST
-CreateComputerTypeList(
- IN HINF InfFile)
+BOOLEAN
+AddComputerTypeEntries(
+ _In_ HINF InfFile,
+ PGENERIC_LIST List,
+ _In_ PWSTR SectionName)
{
- PGENERIC_LIST List;
INFCONTEXT Context;
PCWSTR KeyName;
PCWSTR KeyValue;
WCHAR ComputerIdentifier[128];
WCHAR ComputerKey[32];
+ ULONG Count1, Count2;
/* Get the computer identification */
if (!GetComputerIdentifier(ComputerIdentifier, 128))
@@ -453,10 +455,10 @@ CreateComputerTypeList(
DPRINT("Computer identifier: '%S'\n", ComputerIdentifier);
/* Search for matching device identifier */
- if (!SpInfFindFirstLine(InfFile, L"Map.Computer", NULL, &Context))
+ if (!SpInfFindFirstLine(InfFile, SectionName, NULL, &Context))
{
/* FIXME: error message */
- return NULL;
+ return FALSE;
}
do
@@ -467,7 +469,7 @@ CreateComputerTypeList(
{
/* FIXME: Handle error! */
DPRINT("INF_GetDataField() failed\n");
- return NULL;
+ return FALSE;
}
DPRINT("KeyValue: %S\n", KeyValue);
@@ -481,7 +483,7 @@ CreateComputerTypeList(
{
/* FIXME: Handle error! */
DPRINT("INF_GetDataField() failed\n");
- return NULL;
+ return FALSE;
}
DPRINT("Computer key: %S\n", KeyName);
@@ -489,16 +491,40 @@ CreateComputerTypeList(
INF_FreeData(KeyName);
} while (SpInfFindNextLine(&Context, &Context));
+ Count1 = AddEntriesFromInfSection(List,
+ InfFile,
+ L"Computer",
+ &Context,
+ DefaultProcessEntry,
+ ComputerKey);
+ Count2 = AddEntriesFromInfSection(List,
+ InfFile,
+ L"Computer.NT" INF_ARCH,
+ &Context,
+ DefaultProcessEntry,
+ ComputerKey);
+ if ((Count1 == -1) && (Count2 == -1))
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+PGENERIC_LIST
+CreateComputerTypeList(
+ IN HINF InfFile)
+{
+ PGENERIC_LIST List;
+ BOOLEAN Success;
+
List = CreateGenericList();
if (List == NULL)
return NULL;
- if (AddEntriesFromInfSection(List,
- InfFile,
- L"Computer",
- &Context,
- DefaultProcessEntry,
- ComputerKey) == -1)
+ Success = AddComputerTypeEntries(InfFile, List, L"Map.Computer");
+ Success |= AddComputerTypeEntries(InfFile, List, L"Map.Computer.NT"
INF_ARCH);
+ if (!Success)
{
DestroyGenericList(List, TRUE);
return NULL;
diff --git a/boot/bootdata/txtsetup.sif b/boot/bootdata/txtsetup.sif
index 8b662ef7177..82247b5a154 100644
--- a/boot/bootdata/txtsetup.sif
+++ b/boot/bootdata/txtsetup.sif
@@ -220,14 +220,17 @@ UnicodeCasetable = l_intl.nls
DefaultLayout = 00000409
DefaultLanguage = 00000409
-[Computer]
+[Computer.NTx86]
pci_up = "Standard PC Uniprocessor"
;pci_mp = "Standard PC Multiprocessor"
acpi_up = "ACPI PC Uniprocessor"
;acpi_mp = "ACPI PC Multiprocessor"
xbox = "Original Xbox"
-[Map.Computer]
+[Computer.NTamd64]
+x64_up = "Standard x64 Uniprocessor"
+
+[Map.Computer.NTx86]
;<id> = <pnp id string>
pci_up = "PC UP"
;pci_mp = "PC MP"
@@ -235,6 +238,9 @@ acpi_up = "ACPI UP"
;acpi_mp = "ACPI MP"
xbox = "Xbox"
+[Map.Computer.NTamd64]
+x64_up = "ACPI UP"
+
[Files.pci_up]
ntoskrnl.exe = 1,,,,,,,2,,,,1,2
hal.dll = 1,,,,,,,2,,,,1,2
@@ -255,6 +261,10 @@ halacpi.dll = 1,,,,,,,2,,,hal.dll,1,2
ntoskrnl.exe = 1,,,,,,,2,,,,1,2
halxbox.dll = 1,,,,,,,2,,,hal.dll,1,2
+[Files.x64_up]
+ntoskrnl.exe = 1,,,,,,,2,,,,1,2
+hal.dll = 1,,,,,,,2,,,,1,2
+
[Display]
;<id> = <user friendly name>,<spare>,<service key
name>,<height>,<width>,<bpp>
vga = "VGA Display (640x480x4)",,Vga,640,480,4