[Skiboot] [PATCH] Clarify documentation on OPAL parameters (up to 8), fix opal_entry

Stewart Smith stewart at linux.vnet.ibm.com
Wed May 13 09:17:27 AEST 2015


OpenPower ABI mentions (2.2.1.1 Register Roles) that r11 is not used for
parameter passing, and again in 2.2.3 (Parameter Passing in Registers)
that only 8 registers are available, with the rest spilling to stack.

Incorrectly, we had documented that we use r11 for a 9th parameter
and we were storing and loading r11 as part of OPAL_TRACE_ENTRY.

Github-issue: https://github.com/open-power/skiboot/issues/12
Reported-by: Andrei Warkentin <andrey.warkentin at gmail.com>
Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 asm/head.S        |    2 --
 doc/opal-spec.txt |    4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/asm/head.S b/asm/head.S
index 955c3b5..3f74b69 100644
--- a/asm/head.S
+++ b/asm/head.S
@@ -829,7 +829,6 @@ opal_entry:
 	std	%r8,STACK_GPR8(%r1)
 	std	%r9,STACK_GPR9(%r1)
 	std	%r10,STACK_GPR10(%r1)
-	std	%r11,STACK_GPR11(%r1)
 #endif
 	/* Save Token (r0), LR and r13 */
 	mflr	%r12
@@ -869,7 +868,6 @@ opal_entry:
 	ld	%r8,STACK_GPR8(%r1)
 	ld	%r9,STACK_GPR9(%r1)
 	ld	%r10,STACK_GPR10(%r1)
-	ld	%r11,STACK_GPR11(%r1)
 #endif /* OPAL_TRACE_ENTRY */
 
 	/* Convert our token into a table entry and get the
diff --git a/doc/opal-spec.txt b/doc/opal-spec.txt
index 5f95557..9dcad31 100644
--- a/doc/opal-spec.txt
+++ b/doc/opal-spec.txt
@@ -122,7 +122,7 @@ Operating System via a standard interface.
 An OPAL call is made by calling opal_entry with:
  *       r0: OPAL Token
  *       r2: OPAL Base
- *  r3..r11: Args
+ *  r3..r10: Args (up to 8)
 
 The OPAL API is defined in skiboot/doc/opal-api/
 
@@ -133,7 +133,7 @@ token was called is okay, as compliant host Operating Systems should use
 OPAL_CHECK_TOKEN to test for optional functionality.
 
 All parameters to OPAL calls are big endian. Little endian hosts MUST
-appropriately convert parameters before passing them to OPAL. 
+appropriately convert parameters before passing them to OPAL.
 
 Detecting OPAL Support
 ----------------------
-- 
1.7.10.4



More information about the Skiboot mailing list