aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2023-10-28 20:24:26 +0200
committerHelge Deller <deller@gmx.de>2023-10-31 08:26:22 +0100
commit32b534f62ec7ac4ffb4814f2cf4df8658f4d7a29 (patch)
treed19bd4ea402d13ac2dc5f7848c8ef744c27afe60
parentb8b8d000344efbe0ae1b8d7cf640099550850571 (diff)
downloadseabios-hppa-32b534f62ec7ac4ffb4814f2cf4df8658f4d7a29.zip
seabios-hppa-32b534f62ec7ac4ffb4814f2cf4df8658f4d7a29.tar.gz
seabios-hppa-32b534f62ec7ac4ffb4814f2cf4df8658f4d7a29.tar.bz2
parisc: Add PDC_PAT_CPU function
Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--src/parisc/parisc.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index 87200bd..729afc7 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -1290,6 +1290,10 @@ static const char *pdc_name(unsigned long num)
DO(PDC_PCI_INDEX)
DO(PDC_RELOCATE)
DO(PDC_INITIATOR)
+ DO(PDC_PAT_CELL)
+ DO(PDC_PAT_CHASSIS_LOG)
+ DO(PDC_PAT_CPU)
+ DO(PDC_PAT_PD)
DO(PDC_LINK)
#undef DO
return "UNKNOWN!";
@@ -2083,9 +2087,11 @@ static int pdc_pat_cell(unsigned int *arg)
switch (option) {
case PDC_PAT_CELL_GET_NUMBER:
- cell_info->cell_num = 0;
- cell_info->cell_loc = 0;
+ // cell_info->cell_num = cell_info->cell_loc = 0;
+ memset(cell_info, 0, 32*sizeof(long long));
return PDC_OK;
+ case PDC_PAT_CELL_GET_INFO:
+ return PDC_BAD_OPTION; /* optional on single-cell machines */
default:
break;
}
@@ -2093,6 +2099,34 @@ static int pdc_pat_cell(unsigned int *arg)
return PDC_BAD_OPTION;
}
+static int pdc_pat_cpu(unsigned int *arg)
+{
+ unsigned long option = ARG1;
+ unsigned long *result = (unsigned long *)ARG2;
+ unsigned long hpa;
+
+ switch (option) {
+ case PDC_PAT_CPU_GET_NUMBER:
+ hpa = ARG3;
+ result[0] = index_of_CPU_HPA(hpa);
+ result[1] = hpa; /* location */
+ result[2] = 0; /* num siblings */
+ return PDC_OK;
+ case PDC_PAT_CPU_GET_HPA:
+ if ((unsigned long)ARG3 >= smp_cpus)
+ return PDC_INVALID_ARG;
+ hpa = CPU_HPA_IDX(ARG3);
+ result[0] = hpa;
+ result[1] = hpa; /* location */
+ result[2] = 0; /* num siblings */
+ return PDC_OK;
+ default:
+ break;
+ }
+ dprintf(0, "\n\nSeaBIOS: Unimplemented PDC_PAT_CPU OPTION %lu called with ARG2=%x ARG3=%x ARG4=%x\n", option, ARG2, ARG3, ARG4);
+ return PDC_BAD_OPTION;
+}
+
static int pdc_pat_pd(unsigned int *arg)
{
unsigned long option = ARG1;
@@ -2254,6 +2288,9 @@ int __VISIBLE parisc_pdc_entry(unsigned int *arg FUNC_MANY_ARGS)
dprintf(0, "\n\nSeaBIOS: PDC_PAT_CHASSIS_LOG OPTION %lu called with ARG2=%x ARG3=%x ARG4=%x\n", option, ARG2, ARG3, ARG4);
return PDC_BAD_PROC;
+ case PDC_PAT_CPU:
+ return pdc_pat_cpu(arg);
+
case PDC_PAT_PD:
return pdc_pat_pd(arg);
}