aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2024-03-22 11:43:48 +0100
committerHelge Deller <deller@gmx.de>2024-04-02 14:22:45 +0200
commit38c0692926bf2827d08239b7801b36223c5c19af (patch)
treee8dae8d5b02439868324c803e88d4df484bc112f
parentfe15f9300e42096d84506e654b2a7aea93430a6c (diff)
downloadseabios-hppa-38c0692926bf2827d08239b7801b36223c5c19af.zip
seabios-hppa-38c0692926bf2827d08239b7801b36223c5c19af.tar.gz
seabios-hppa-38c0692926bf2827d08239b7801b36223c5c19af.tar.bz2
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 <deller@gmx.de>
-rw-r--r--src/parisc/head.S3
-rw-r--r--src/parisc/parisc.c2
2 files changed, 4 insertions, 1 deletions
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;