https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8056081c2f6764bfe401e819b484612ea861be6b

commit 8056081c2f6764bfe401e819b484612ea861be6b
Author:     Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org>
AuthorDate: Sat Jul 20 22:15:47 2024 +0200
Commit:     Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org>
CommitDate: Mon Aug 12 12:16:56 2024 +0200

    [SETUPLIB] Store a machine architecture type
    
    It will be used to determine how the bootloader has to be installed, etc.
    
    Currently hardcoded for XBOX, or rnutime-determined for NEC PC-98 and 
BIOS-based PC-AT.
    More thorough runtime determination will be added in the future.
---
 base/setup/lib/setuplib.c | 11 +++++++++++
 base/setup/lib/setuplib.h | 11 +++++++++++
 2 files changed, 22 insertions(+)

diff --git a/base/setup/lib/setuplib.c b/base/setup/lib/setuplib.c
index c8767c09375..ea190cece3c 100644
--- a/base/setup/lib/setuplib.c
+++ b/base/setup/lib/setuplib.c
@@ -1028,6 +1028,17 @@ InitializeSetup(
         DPRINT1("SourceRootPath (2): '%wZ'\n", &pSetupData->SourceRootPath);
         DPRINT1("SourceRootDir (2): '%wZ'\n", &pSetupData->SourceRootDir);
 
+        /* Retrieve the target machine architecture type */
+        // FIXME: This should be determined at runtime!!
+        // FIXME: Allow for (pre-)installing on an architecture
+        //        different from the current one?
+#if defined(SARCH_XBOX)
+        pSetupData->ArchType = ARCH_Xbox;
+// #elif defined(SARCH_PC98)
+#else // TODO: Arc, UEFI
+        pSetupData->ArchType = (IsNEC_98 ? ARCH_NEC98x86 : ARCH_PcAT);
+#endif
+
         return ERROR_SUCCESS;
     }
 
diff --git a/base/setup/lib/setuplib.h b/base/setup/lib/setuplib.h
index 79a1692eea6..99c02ba86a1 100644
--- a/base/setup/lib/setuplib.h
+++ b/base/setup/lib/setuplib.h
@@ -66,6 +66,16 @@ struct _USETUP_DATA;
 typedef VOID
 (__cdecl *PSETUP_ERROR_ROUTINE)(IN struct _USETUP_DATA*, ...);
 
+typedef enum _ARCHITECTURE_TYPE
+{
+    ARCH_PcAT,      //< Standard BIOS-based PC-AT
+    ARCH_NEC98x86,  //< NEC PC-98
+    ARCH_Xbox,      //< Original Xbox
+    ARCH_Arc,       //< ARC-based (MIPS, SGI)
+    ARCH_Efi,       //< EFI and UEFI
+// Place other architectures supported by the Setup below.
+} ARCHITECTURE_TYPE;
+
 typedef struct _USETUP_DATA
 {
 /* Error handling *****/
@@ -123,6 +133,7 @@ typedef struct _USETUP_DATA
     PGENERIC_LIST LanguageList;
 
 /* Settings *****/
+    ARCHITECTURE_TYPE ArchType; //< Target architecture (MachineType)
     PCWSTR ComputerType;
     PCWSTR DisplayType;
     // PCWSTR KeyboardDriver;

Reply via email to