diff options
author | Sven Schnelle <svens@stackframe.org> | 2019-03-05 16:26:02 +0100 |
---|---|---|
committer | Sven Schnelle <svens@stackframe.org> | 2019-03-10 14:07:45 +0100 |
commit | 7fefb064d45f414da34b41056bb581fbee9d1eaa (patch) | |
tree | 2933c14b6ecbdda2ed2ccfffed6066497742e1a2 | |
parent | fb70959064e3b582d4597f392a326c471d7221ff (diff) | |
download | seabios-hppa-7fefb064d45f414da34b41056bb581fbee9d1eaa.zip seabios-hppa-7fefb064d45f414da34b41056bb581fbee9d1eaa.tar.gz seabios-hppa-7fefb064d45f414da34b41056bb581fbee9d1eaa.tar.bz2 |
parisc: move PDC_CHASSIS to its own function
Signed-off-by: Sven Schnelle <svens@stackframe.org>
-rw-r--r-- | src/parisc/parisc.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c index fca0ca6..5f99b6a 100644 --- a/src/parisc/parisc.c +++ b/src/parisc/parisc.c @@ -659,6 +659,30 @@ static const char *pdc_name(unsigned long num) return "UNKNOWN!"; } +static int pdc_chassis(unsigned int *arg) +{ + unsigned long option = ARG1; + unsigned long *result = (unsigned long *)ARG2; + + switch (option) { + case PDC_CHASSIS_DISP: + ARG3 = ARG2; + result = (unsigned long *)&ARG4; // do not write to ARG2, use &ARG4 instead + // fall through + case PDC_CHASSIS_DISPWARN: + ARG4 = (ARG3 >> 17) & 7; + chassis_code = ARG3 & 0xffff; + if (0) printf("\nPDC_CHASSIS: %s (%d), %sCHASSIS %0x\n", + systat[ARG4], ARG4, (ARG3>>16)&1 ? "blank display, ":"", chassis_code); + // fall through + case PDC_CHASSIS_WARN: + // return warnings regarding fans, batteries and temperature: None! + result[0] = 0; + return PDC_OK; + } + return PDC_BAD_PROC; +} + int __VISIBLE parisc_pdc_entry(unsigned int *arg FUNC_MANY_ARGS) { static unsigned long psw_defaults = PDC_PSW_ENDIAN_BIT; @@ -689,23 +713,7 @@ int __VISIBLE parisc_pdc_entry(unsigned int *arg FUNC_MANY_ARGS) case PDC_POW_FAIL: break; case PDC_CHASSIS: /* chassis functions */ - switch (option) { - case PDC_CHASSIS_DISP: - ARG3 = ARG2; - result = (unsigned long *)&ARG4; // do not write to ARG2, use &ARG4 instead - // fall through - case PDC_CHASSIS_DISPWARN: - ARG4 = (ARG3 >> 17) & 7; - chassis_code = ARG3 & 0xffff; - if (0) printf("\nPDC_CHASSIS: %s (%d), %sCHASSIS %0x\n", - systat[ARG4], ARG4, (ARG3>>16)&1 ? "blank display, ":"", chassis_code); - // fall through - case PDC_CHASSIS_WARN: - // return warnings regarding fans, batteries and temperature: None! - result[0] = 0; - return PDC_OK; - } - return PDC_BAD_PROC; + return pdc_chassis(arg); case PDC_PIM: switch (option) { case PDC_PIM_HPMC: |