diff options
author | Helge Deller <deller@gmx.de> | 2023-10-17 07:27:02 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2023-10-31 08:26:22 +0100 |
commit | 63a9007616f3a570b1ceef4a4fa3cdf4cf278d38 (patch) | |
tree | 74cc943acb5235114f96bc335a2ab002e2a221ef | |
parent | fd5b6cf82369a1e53d68302fb6ede2b9e2afccd1 (diff) | |
download | seabios-hppa-63a9007616f3a570b1ceef4a4fa3cdf4cf278d38.zip seabios-hppa-63a9007616f3a570b1ceef4a4fa3cdf4cf278d38.tar.gz seabios-hppa-63a9007616f3a570b1ceef4a4fa3cdf4cf278d38.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.c | 5 |
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; |