[SLOF] [PATCH] rtas: Improve rtas-do-config-@ and rtas-do-config-! a little bit
Thomas Huth
thuth at redhat.com
Thu Oct 6 01:11:05 AEDT 2016
As soon as we are booting with at least one PCI device, the
rtas-do-config-@ Forth word is called quite often, so it
makes sense that we look up the corresponding RTAS token
only once instead of each time the function is called.
Also the "ffffffff and" operation on the lower half of the
PUID is not really required and can be removed, since the
"l!" Forth word is storing the lower four bytes only anyway.
Signed-off-by: Thomas Huth <thuth at redhat.com>
---
board-qemu/slof/rtas.fs | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/board-qemu/slof/rtas.fs b/board-qemu/slof/rtas.fs
index 2e10b0a..54d3929 100644
--- a/board-qemu/slof/rtas.fs
+++ b/board-qemu/slof/rtas.fs
@@ -108,12 +108,11 @@ find-qemu-rtas
0 value puid
: rtas-do-config-@ ( config-addr size -- value)
- \ We really want to cache this !
- " ibm,read-pci-config" rtas-get-token rtas-cb rtas>token l!
+ [ s" ibm,read-pci-config" rtas-get-token ] LITERAL rtas-cb rtas>token l!
4 rtas-cb rtas>nargs l!
2 rtas-cb rtas>nret l!
( addr size ) rtas-cb rtas>args3 l!
- puid ffffffff and rtas-cb rtas>args2 l!
+ puid rtas-cb rtas>args2 l!
puid 20 rshift rtas-cb rtas>args1 l!
( addr ) rtas-cb rtas>args0 l!
enter-rtas
@@ -127,12 +126,11 @@ find-qemu-rtas
;
: rtas-do-config-! ( value config-addr size )
- \ We really want to cache this !
- " ibm,write-pci-config" rtas-get-token rtas-cb rtas>token l!
+ [ s" ibm,write-pci-config" rtas-get-token ] LITERAL rtas-cb rtas>token l!
5 rtas-cb rtas>nargs l!
1 rtas-cb rtas>nret l!
( value addr size ) rtas-cb rtas>args3 l!
- puid ffffffff and rtas-cb rtas>args2 l!
+ puid rtas-cb rtas>args2 l!
puid 20 rshift rtas-cb rtas>args1 l!
( value addr ) rtas-cb rtas>args0 l!
( value ) rtas-cb rtas>args4 l!
--
1.8.3.1
More information about the SLOF
mailing list