summaryrefslogtreecommitdiff
path: root/pal.S
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@me.com>2021-06-02 20:53:17 -0700
committerRichard Henderson <richard.henderson@linaro.org>2021-06-06 13:26:29 -0700
commit5e915346477f4f2f33345c7dbe711be828b58730 (patch)
tree4b7eea9639a68b7a5dddf8272ffb3a8b582d8303 /pal.S
parentb5bee8227775b91e12c0b6635977d44f2d7fa376 (diff)
downloadqemu-palcode-5e915346477f4f2f33345c7dbe711be828b58730.zip
qemu-palcode-5e915346477f4f2f33345c7dbe711be828b58730.tar.gz
qemu-palcode-5e915346477f4f2f33345c7dbe711be828b58730.tar.bz2
Fixes for secondary CPU start-up.
Changes to make secondary CPU start-up work on NetBSD, which depends on some specific behavior in the architecture specification: - Change the internal swppal() function to take the new VPTPTR and Procedure Value as explicit arguments. Adapt do_start() to the new the new swppal() signature. - In do_start_wait(), extract the new VPTPTR and PV from the relevant HWRPB fields, which will have been initialized by the OS, and pass them to swppal(). - In the SWPPAL PAL call, get the value to stuff into PV (r27) from a4 (r20), and add a comment describing why this implementation detail is allowed by the architecture specification. Signed-off-by: Jason Thorpe <thorpej@me.com> Message-Id: <20210603035317.6814-9-thorpej@me.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'pal.S')
-rw-r--r--pal.S13
1 files changed, 9 insertions, 4 deletions
diff --git a/pal.S b/pal.S
index 015a829..8d55a0a 100644
--- a/pal.S
+++ b/pal.S
@@ -566,6 +566,8 @@ ENDFN CallPal_Cserve_Cont
* r17 (a1) = New PC
* r18 (a2) = New PCB
* r19 (a3) = New VptPtr
+ * r20 (a4) = New Procedure Value (to place into $27)
+ * (Non-standard; See note below.)
*
* OUTPUT PARAMETERS:
*
@@ -574,11 +576,14 @@ ENDFN CallPal_Cserve_Cont
* 1 - Unknown PALcode variant
* 2 - Known PALcode variant, but PALcode not loaded
*
- * r26 (ra) = r27 (pv) = New PC
+ * r26 (ra) = New PC
+ * r27 (pv) = From r20
* Note that this is non-architected, but is relied on by
* the usage of SwpPal within our own console code in order
- * to simplify its use within C code.
- *
+ * to simplify its use within C code. We can get away with
+ * the extra non-standard argument (in $20) because as
+ * architected, all registers except SP and R0 are
+ * UNPREDICTABLE; therefore private internal usage is fine.
*/
ORG_CALL_PAL_PRIV(0x0A)
CallPal_SwpPal:
@@ -624,7 +629,7 @@ CallPal_SwpPal_Cont:
mtpr $31, qemu_tbia // Flush TLB for new PTBR
mov a1, $26
- mov a1, $27
+ mov a4, $27
hw_ret (a1)
ENDFN CallPal_SwpPal_Cont
.previous