aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2024-01-18 16:46:27 +0100
committerHelge Deller <deller@gmx.de>2024-01-18 16:46:27 +0100
commit293f9922f48a214f49db887a322ba980b4698c90 (patch)
tree50fcd03c435f49cb9dce16dcd8fba07383c3532a
parent05078517652ce875de9e5406b20ccfe92c714ec3 (diff)
downloadseabios-hppa-293f9922f48a214f49db887a322ba980b4698c90.zip
seabios-hppa-293f9922f48a214f49db887a322ba980b4698c90.tar.gz
seabios-hppa-293f9922f48a214f49db887a322ba980b4698c90.tar.bz2
parisc: Add various helpers to check for 64-bit PDC and 64-bit CPU
Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--src/parisc/parisc.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index 2e8f25c..9efca29 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -53,13 +53,24 @@ union {
} pim_toc_data[HPPA_MAX_CPUS] __VISIBLE __aligned(8);
#if defined(__LP64__)
-# define is_64bit() 1 /* 64-bit PDC */
-# define cpu_bit_width 64
+# define cpu_bit_width 64
+# define is_64bit_PDC() 1 /* 64-bit PDC */
#else
-# define is_64bit() 0 /* 32-bit PDC */
char cpu_bit_width;
+# define is_64bit_PDC() 0 /* 32-bit PDC */
#endif
+#define is_64bit() is_64bit_PDC()
+#define is_64bit_CPU() (cpu_bit_width == 64) /* 64-bit CPU? */
+
+/* running 64-bit PDC, but called from 32-bit app */
+#define is_compat_mode() (is_64bit_PDC() && ((psw_defaults & PDC_PSW_WIDE_BIT) == 0))
+
+#define COMPAT_VAL(val) ((long)(int)(val)) // (is_compat_mode() ? (long)(int)(val) : (val))
+
+/* Do not write back result buffer in compat mode */
+#define NO_COMPAT_RETURN_VALUE(res) { res = 0; }
+
u8 BiosChecksum;
char zonefseg_start, zonefseg_end; // SYMBOLS
@@ -140,8 +151,8 @@ unsigned long hppa_port_pci_data = (PCI_HPA + DINO_CONFIG_DATA);
unsigned int show_boot_menu;
unsigned int interact_ipl;
-static int firmware_width_locked;
-static unsigned long psw_defaults;
+unsigned int __VISIBLE firmware_width_locked; /* no 64-bit calls allowed */
+unsigned int __VISIBLE psw_defaults;
unsigned long PORT_QEMU_CFG_CTL;
unsigned int tlb_entries = 256;