aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Schnelle <svens@stackframe.org>2019-03-05 16:32:36 +0100
committerSven Schnelle <svens@stackframe.org>2019-03-10 14:07:45 +0100
commit60ad71be1d22dba5c4352bd4ff87ebf19c7c0b86 (patch)
tree9c39e40810e2365551bffde0819a199539c30d6d
parent3e8192724b0b7f4e80cd4199b69c2d0aa5d95906 (diff)
downloadseabios-hppa-60ad71be1d22dba5c4352bd4ff87ebf19c7c0b86.zip
seabios-hppa-60ad71be1d22dba5c4352bd4ff87ebf19c7c0b86.tar.gz
seabios-hppa-60ad71be1d22dba5c4352bd4ff87ebf19c7c0b86.tar.bz2
parisc: move PDC_MODEL to its own function
Signed-off-by: Sven Schnelle <svens@stackframe.org>
-rw-r--r--src/parisc/parisc.c74
1 files changed, 41 insertions, 33 deletions
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c
index 052aa98..ab784df 100644
--- a/src/parisc/parisc.c
+++ b/src/parisc/parisc.c
@@ -704,14 +704,51 @@ static int pdc_pim(unsigned int *arg)
return PDC_BAD_PROC;
}
+static int pdc_model(unsigned int *arg)
+{
+ static unsigned long model[] = { PARISC_PDC_MODEL };
+ static const char model_str[] = PARISC_MODEL;
+ unsigned long option = ARG1;
+ unsigned long *result = (unsigned long *)ARG2;
+
+ switch (option) {
+ case PDC_MODEL_INFO:
+ memcpy(result, model, sizeof(model));
+ return PDC_OK;
+ case PDC_MODEL_VERSIONS:
+ switch (ARG3) {
+ case 0: /* return CPU0 version */
+ result[0] = 35; // TODO! ???
+ return PDC_OK;
+ case 1: /* return PDC version */
+ result[0] = PARISC_PDC_VERSION;
+ return PDC_OK;
+ }
+ return -4; // invalid c_index
+ case PDC_MODEL_SYSMODEL:
+ result[0] = sizeof(model_str) - 1;
+ strtcpy((char *)ARG4, model_str, sizeof(model_str));
+ return PDC_OK;
+ case PDC_MODEL_CPU_ID:
+ result[0] = PARISC_PDC_CPUID;
+ return PDC_OK;
+ case PDC_MODEL_CAPABILITIES:
+ result[0] = PARISC_PDC_CAPABILITIES;
+ return PDC_OK;
+ case PDC_MODEL_GET_INSTALL_KERNEL:
+ // No need to provide a special install kernel during installation of HP-UX
+ return PDC_BAD_OPTION;
+ }
+ dprintf(0, "\n\nSeaBIOS: Unimplemented PDC_MODEL function %d %x %x %x %x\n", ARG1, ARG2, ARG3, ARG4, ARG5);
+ return PDC_BAD_OPTION;
+}
+
int __VISIBLE parisc_pdc_entry(unsigned int *arg FUNC_MANY_ARGS)
{
static unsigned long psw_defaults = PDC_PSW_ENDIAN_BIT;
static unsigned long cache_info[] = { PARISC_PDC_CACHE_INFO };
static struct pdc_cache_info *machine_cache_info
= (struct pdc_cache_info *) &cache_info;
- static unsigned long model[] = { PARISC_PDC_MODEL };
- static const char model_str[] = PARISC_MODEL;
unsigned long proc = ARG0;
unsigned long option = ARG1;
@@ -741,37 +778,8 @@ int __VISIBLE parisc_pdc_entry(unsigned int *arg FUNC_MANY_ARGS)
return pdc_pim(arg);
case PDC_MODEL: /* model information */
- switch (option) {
- case PDC_MODEL_INFO:
- memcpy(result, model, sizeof(model));
- return PDC_OK;
- case PDC_MODEL_VERSIONS:
- switch (ARG3) {
- case 0: /* return CPU0 version */
- result[0] = 35; // TODO! ???
- return PDC_OK;
- case 1: /* return PDC version */
- result[0] = PARISC_PDC_VERSION;
- return PDC_OK;
- }
- return -4; // invalid c_index
- case PDC_MODEL_SYSMODEL:
- result[0] = sizeof(model_str) - 1;
- strtcpy((char *)ARG4, model_str, sizeof(model_str));
- return PDC_OK;
- case PDC_MODEL_CPU_ID:
- result[0] = PARISC_PDC_CPUID;
- return PDC_OK;
- case PDC_MODEL_CAPABILITIES:
- result[0] = PARISC_PDC_CAPABILITIES;
- return PDC_OK;
- case PDC_MODEL_GET_INSTALL_KERNEL:
- // No need to provide a special install kernel during installation of HP-UX
- return PDC_BAD_OPTION;
- }
- dprintf(0, "\n\nSeaBIOS: Unimplemented PDC_MODEL function %d %x %x %x %x\n", ARG1, ARG2, ARG3, ARG4, ARG5);
- return PDC_BAD_OPTION;
- case PDC_CACHE:
+ return pdc_model(arg);
+ case PDC_CACHE:
switch (option) {
case PDC_CACHE_INFO:
BUG_ON(sizeof(cache_info) != sizeof(*machine_cache_info));