From 38c0692926bf2827d08239b7801b36223c5c19af Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Fri, 22 Mar 2024 11:43:48 +0100 Subject: parisc: Allow PDC functions to act if called in narrow mode Some PDC functions need to know at runtime if they were called in narrow mode. Add infrastructure to hand over this information to parisc_pdc_entry(). The background is, that the MPE IPL boot loader calls PDC_MODEL and provides a very small return buffer, followed in memory by the stack. So, when pdc_model writes 32 x 8 bytes in 64-bit mode, the stack of IPL boot will be trashed. Signed-off-by: Helge Deller --- src/parisc/head.S | 3 +++ src/parisc/parisc.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parisc/head.S b/src/parisc/head.S index 8734704..c4df7f0 100644 --- a/src/parisc/head.S +++ b/src/parisc/head.S @@ -512,6 +512,7 @@ ENTRY(pdc_entry_32) /* 32-bit PDC */ stw %arg2,-44(%sp) stw %arg3,-48(%sp) ldo -FRAME_SIZE(%sp),%arg0 + ldi 1,%arg1 /* called with wide-bit cleared (narrow mode) */ loadgp load32 MEM_PDC_ENTRY + 1f - pdc_entry_table,%rp @@ -566,6 +567,7 @@ ENTRY(pdc_entry_64_32) /* 32-bit call on 64-bit PDC */ std %arg0, -0x58(%sp) ldo -0x58(%sp),%arg0 /* points to arg7 */ + ldi 1,%arg1 /* called with wide-bit cleared (narrow mode) */ loadgp load32_firmware parisc_pdc_entry,%r1 @@ -614,6 +616,7 @@ ENTRY(pdc_entry_64_64) /* 64-bit call on 64-bit PDC */ std %r20, -0x50(%sp) std %r19, -0x58(%sp) ldo -0x58(%sp),%arg0 /* points to arg7 */ + ldi 0,%arg1 /* called with wide-bit set (not narrow) */ loadgp b,l parisc_pdc_entry, %rp diff --git a/src/parisc/parisc.c b/src/parisc/parisc.c index 1a0c97e..1c7b109 100644 --- a/src/parisc/parisc.c +++ b/src/parisc/parisc.c @@ -2364,7 +2364,7 @@ static int pdc_pat_mem(unsigned long *arg) } -int __VISIBLE parisc_pdc_entry(unsigned long *arg) +int __VISIBLE parisc_pdc_entry(unsigned long *arg, unsigned long narrow_mode) { unsigned long proc = ARG0; unsigned long option = ARG1; -- cgit v1.1