aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Schnelle <svens@stackframe.org>2019-03-12 19:22:50 +0100
committerSven Schnelle <svens@stackframe.org>2019-03-12 19:22:50 +0100
commit56b24e8ee828157f3145ac4c772599c4aca4ff3c (patch)
tree3e687f202d514dc799e8870e9f1cfe04849fb895
parent0dca9da1278714825e78d2443ea23a4dbc9a7e79 (diff)
downloadseabios-hppa-56b24e8ee828157f3145ac4c772599c4aca4ff3c.zip
seabios-hppa-56b24e8ee828157f3145ac4c772599c4aca4ff3c.tar.gz
seabios-hppa-56b24e8ee828157f3145ac4c772599c4aca4ff3c.tar.bz2
parisc: fix PDC_COPROCESSOR
The bits in the coprocessor bitmask are count from the left, and have only 8 bits representing 8 coprocessors. So also adjust HPPA_MAX_CPUS to reflect that. This changes makes HP-UX and ODE recognize the FPU. Signed-off-by: Sven Schnelle <svens@stackframe.org>
-rw-r--r--src/parisc/hppa_hardware.h2
-rw-r--r--src/parisc/parisc.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/src/parisc/hppa_hardware.h b/src/parisc/hppa_hardware.h
index abda332..919cf60 100644
--- a/src/parisc/hppa_hardware.h
+++ b/src/parisc/hppa_hardware.h
@@ -48,7 +48,7 @@
#define PORT_SERIAL1 (DINO_UART_HPA + 0x800)
#define PORT_SERIAL2 (LASI_UART_HPA + 0x800)
-#define HPPA_MAX_CPUS 32 /* max. number of SMP CPUs */
+#define HPPA_MAX_CPUS 8 /* max. number of SMP CPUs */
#define CPU_CLOCK_MHZ 250 /* emulate a 250 MHz CPU */
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index c67b89e..d472697 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -807,13 +807,15 @@ static int pdc_coproc(unsigned int *arg)
{
unsigned long option = ARG1;
unsigned long *result = (unsigned long *)ARG2;
-
+ unsigned char mask;
switch (option) {
case PDC_COPROC_CFG:
memset(result, 0, 32 * sizeof(unsigned long));
+ mask = ~((1 << (8-smp_cpus))-1);
/* set bit per cpu in ccr_functional and ccr_present: */
- result[0] = result[1] = (smp_cpus <= 1) ? 1 : (1ULL << smp_cpus) - 1;
- mtctl(result[0], 10); /* initialize cr10 */
+ mtctl(mask, 10); /* initialize cr10 */
+ result[0] = mask;
+ result[1] = mask;
result[17] = 1; // Revision
result[18] = 19; // Model
return PDC_OK;