diff options
author | Helge Deller <deller@gmx.de> | 2022-10-18 16:57:26 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2022-10-18 16:57:26 +0200 |
commit | 2d4b24d905f5073336c85503c1329d8d54a120d6 (patch) | |
tree | 9d9f10574cc2445f68745868a2cad4e14b15966a /src | |
parent | 62f2bb0ef46a14cb3a3b069e27fdf1edb28a167e (diff) | |
download | seabios-hppa-2d4b24d905f5073336c85503c1329d8d54a120d6.zip seabios-hppa-2d4b24d905f5073336c85503c1329d8d54a120d6.tar.gz seabios-hppa-2d4b24d905f5073336c85503c1329d8d54a120d6.tar.bz2 |
parisc: Clean up register saving/restoring at PDC/IODC entry
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/parisc/head.S | 34 | ||||
-rw-r--r-- | src/parisc/parisc.c | 35 |
2 files changed, 31 insertions, 38 deletions
diff --git a/src/parisc/head.S b/src/parisc/head.S index f320b87..0eabe40 100644 --- a/src/parisc/head.S +++ b/src/parisc/head.S @@ -76,6 +76,17 @@ name: .endm .macro save_general + + /* save arguments */ + stw %arg0,-36(%sp) + stw %arg1,-40(%sp) + stw %arg2,-44(%sp) + stw %arg3,-48(%sp) + ldo -36(%sp),%arg0 /* save as input ptr */ + + /* make room to store registers */ + ldo 2*FRAME_SIZE(%sp),%sp + save_reg 2 save_reg 3 save_reg 4 @@ -117,6 +128,7 @@ name: restore_reg 18 restore_reg 27 restore_reg 30 + ldo -2*FRAME_SIZE(%sp),%sp .endm .import $global$ @@ -383,16 +395,8 @@ END(smp_ivt) *******************************************************/ ENTRY(pdc_entry) - ldo 2*FRAME_SIZE(%sp),%sp save_general - /* save arguments */ - stw %arg0,-36(%sp) - stw %arg1,-40(%sp) - stw %arg2,-44(%sp) - stw %arg3,-48(%sp) - ldo -FRAME_SIZE(%sp),%arg0 - loadgp b,l parisc_pdc_entry, %rp ldo FRAME_SIZE(%sp),%sp @@ -400,7 +404,7 @@ ENTRY(pdc_entry) ldo -FRAME_SIZE(%sp),%sp rest_general bv %r0(%rp) - ldo -2*FRAME_SIZE(%sp),%sp + nop END(pdc_entry) /* pdc_entry_table will be copied into low memory. */ @@ -422,13 +426,7 @@ END(iodc_entry_table) ENTRY(iodc_entry) load32 parisc_iodc_ENTRY_IO, %r1 - stw %rp,-20(%sp) - stw %dp,-32(%sp) - stw %arg0,-36(%sp) - stw %arg1,-40(%sp) - stw %arg2,-44(%sp) - stw %arg3,-48(%sp) - ldo -FRAME_SIZE(%sp),%arg0 + save_general loadgp load32 .iodc_ret, %rp @@ -436,9 +434,9 @@ ENTRY(iodc_entry) ldo FRAME_SIZE(%sp),%sp .iodc_ret: ldo -FRAME_SIZE(%sp),%sp - ldw -20(%sp),%rp + rest_general bv %r0(%rp) - ldw -32(%sp),%dp + nop END(iodc_entry) .data diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c index d2eca58..914c776 100644 --- a/src/parisc/parisc.c +++ b/src/parisc/parisc.c @@ -136,14 +136,14 @@ extern char iodc_entry[512]; extern char iodc_entry_table[14*4]; /* args as handed over for firmware calls */ -#define ARG0 arg[7-0] -#define ARG1 arg[7-1] -#define ARG2 arg[7-2] -#define ARG3 arg[7-3] -#define ARG4 arg[7-4] -#define ARG5 arg[7-5] -#define ARG6 arg[7-6] -#define ARG7 arg[7-7] +#define ARG0 arg[0] +#define ARG1 arg[-1] +#define ARG2 arg[-2] +#define ARG3 arg[-3] +#define ARG4 arg[-4] +#define ARG5 arg[-5] +#define ARG6 arg[-6] +#define ARG7 arg[-7] /* size of I/O block used in HP firmware */ #define FW_BLOCKSIZE 2048 @@ -584,12 +584,7 @@ void iodc_log_call(unsigned int *arg, const char *func) } } -#define FUNC_MANY_ARGS , \ - int a0, int a1, int a2, int a3, int a4, int a5, int a6, \ - int a7, int a8, int a9, int a10, int a11, int a12 - - -int __VISIBLE parisc_iodc_ENTRY_IO(unsigned int *arg FUNC_MANY_ARGS) +int __VISIBLE parisc_iodc_ENTRY_IO(unsigned int *arg) { unsigned long hpa = ARG0; unsigned long option = ARG1; @@ -661,7 +656,7 @@ int __VISIBLE parisc_iodc_ENTRY_IO(unsigned int *arg FUNC_MANY_ARGS) } -int __VISIBLE parisc_iodc_ENTRY_INIT(unsigned int *arg FUNC_MANY_ARGS) +int __VISIBLE parisc_iodc_ENTRY_INIT(unsigned int *arg) { unsigned long hpa = ARG0; unsigned long option = ARG1; @@ -699,19 +694,19 @@ int __VISIBLE parisc_iodc_ENTRY_INIT(unsigned int *arg FUNC_MANY_ARGS) return PDC_BAD_OPTION; } -int __VISIBLE parisc_iodc_ENTRY_SPA(unsigned int *arg FUNC_MANY_ARGS) +int __VISIBLE parisc_iodc_ENTRY_SPA(unsigned int *arg) { iodc_log_call(arg, __FUNCTION__); return PDC_BAD_OPTION; } -int __VISIBLE parisc_iodc_ENTRY_CONFIG(unsigned int *arg FUNC_MANY_ARGS) +int __VISIBLE parisc_iodc_ENTRY_CONFIG(unsigned int *arg) { iodc_log_call(arg, __FUNCTION__); return PDC_BAD_OPTION; } -int __VISIBLE parisc_iodc_ENTRY_TEST(unsigned int *arg FUNC_MANY_ARGS) +int __VISIBLE parisc_iodc_ENTRY_TEST(unsigned int *arg) { unsigned long hpa = ARG0; unsigned long option = ARG1; @@ -741,7 +736,7 @@ int __VISIBLE parisc_iodc_ENTRY_TEST(unsigned int *arg FUNC_MANY_ARGS) return PDC_BAD_OPTION; } -int __VISIBLE parisc_iodc_ENTRY_TLB(unsigned int *arg FUNC_MANY_ARGS) +int __VISIBLE parisc_iodc_ENTRY_TLB(unsigned int *arg) { unsigned long option = ARG1; unsigned long *result = (unsigned long *)ARG4; @@ -1517,7 +1512,7 @@ static int pdc_initiator(unsigned int *arg) } -int __VISIBLE parisc_pdc_entry(unsigned int *arg FUNC_MANY_ARGS) +int __VISIBLE parisc_pdc_entry(unsigned int *arg) { unsigned long proc = ARG0; unsigned long option = ARG1; |