parisc: Add -fw_cfg opt/OS64,string=1 option
This option is only relevant when booting a 64-bit machine and the value
defaults to enabled (1).
When OS64 is set to 0, the firmware will tell the OS that 64-bit
firmware calls are not supported.
Effectively, this prevents the OS to install a 64-bit OS (on the 64-bit
machine).
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index 64fda0f..fe8ff36 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -203,6 +203,9 @@
int powersw_nop;
int *powersw_ptr;
+/* allow 64-bit OS installation on 64-bit firmware */
+int enable_OS64 = 1;
+
/*
* Real time clock emulation
* Either LASI or Astro will provide access to an emulated RTC clock.
@@ -1556,8 +1559,8 @@
/* unlock pdc call if running wide. */
firmware_width_locked = !(psw_defaults & PDC_PSW_WIDE_BIT);
result[0] = current_machine->pdc_caps;
- result[0] |= PDC_MODEL_OS32; /* we only support 32-bit PDC for now. */
- if (is_64bit_PDC()) /* and maybe 64-bit */
+ result[0] |= PDC_MODEL_OS32; /* we always support 32-bit PDC */
+ if (is_64bit_PDC() && enable_OS64) /* and maybe 64-bit */
result[0] |= PDC_MODEL_OS64; /* this means 64-bit PDC calls are supported */
else
result[0] &= ~PDC_MODEL_OS64;
@@ -3114,6 +3117,9 @@
powersw_ptr = NULL;
}
+ /* possibility to disable 64-bit OS installation: "-fw_cfg opt/OS64,string=0" */
+ enable_OS64 = romfile_loadstring_to_int("opt/OS64", enable_OS64);
+
/* real-time-clock addr */
rtc_ptr = (int *) F_EXTEND(romfile_loadint("/etc/hppa/rtc-addr", (int) LASI_RTC_HPA));
// dprintf(0, "RTC PTR 0x%p\n", rtc_ptr);