aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-10-17 07:27:02 +0200
committerHelge Deller <deller@gmx.de>2023-10-17 07:27:02 +0200
commit84f4c0fb5c6dd9396cbadb532068f9fb34982527 (patch)
tree74cc943acb5235114f96bc335a2ab002e2a221ef
parentfd5b6cf82369a1e53d68302fb6ede2b9e2afccd1 (diff)
downloadseabios-hppa-84f4c0fb5c6dd9396cbadb532068f9fb34982527.zip
seabios-hppa-84f4c0fb5c6dd9396cbadb532068f9fb34982527.tar.gz
seabios-hppa-84f4c0fb5c6dd9396cbadb532068f9fb34982527.tar.bz2
parisc: Fix mfctl,w instruction and thus 64-bit detection
Use the wide version of mfctl to read the %sar register. Only the w-version is able to detect if we run on a 64-bit CPU. Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--src/parisc/parisc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index 50dc3c3..11b433f 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -2662,8 +2662,9 @@ void __VISIBLE start_parisc_firmware(void)
// value is 63 this is a 64-bit capable CPU.
// A 32-bit only CPU returns 31.
mtctl(-1UL, 11);
- cpu_bit_width = (mfctl(11) == 63) ? 64 : 32;
- // cpu_bit_width = 64; /* XXX HACK */
+ /* this is: mfctl,w sar,r1: */
+ asm(".word 0x016048a0 + 1 ! copy %%r1,%0\n" : "=r" (i): : "r1");
+ cpu_bit_width = (i == 63) ? 64 : 32;
if (smp_cpus > HPPA_MAX_CPUS)
smp_cpus = HPPA_MAX_CPUS;