Message ID | 20191108083439.103275-1-aik@ozlabs.ru |
---|---|
State | Superseded |
Headers | show |
Series | client: Load initramdisk location | expand |
On Fri, Nov 08, 2019 at 07:34:39PM +1100, Alexey Kardashevskiy wrote: > + s" linux,initrd-end" get-chosen IF decode-int -rot 2drop ELSE 0 THEN > + s" linux,initrd-start" get-chosen IF decode-int -rot 2drop ELSE 0 THEN I'd write -rot 2drop as nip nip . Dunno if you find that simpler to read as well though :-) > + 2dup - dup IF > + ciregs >r4 ! > + ciregs >r3 ! > + drop > + ELSE > + 3drop > + THEN ( end start ) 2dup <> IF tuck - ( start len ) ciregs >r4 ! ciregs >r3 ! THEN ? Segher
On 08/11/2019 21:26, Segher Boessenkool wrote: > On Fri, Nov 08, 2019 at 07:34:39PM +1100, Alexey Kardashevskiy wrote: >> + s" linux,initrd-end" get-chosen IF decode-int -rot 2drop ELSE 0 THEN >> + s" linux,initrd-start" get-chosen IF decode-int -rot 2drop ELSE 0 THEN > > I'd write -rot 2drop as nip nip . Dunno if you find that simpler to > read as well though :-) Equally bad so I'll take yours since at least somebody finds it easier :) > >> + 2dup - dup IF >> + ciregs >r4 ! >> + ciregs >r3 ! >> + drop >> + ELSE >> + 3drop >> + THEN > > ( end start ) > 2dup <> IF > tuck - ( start len ) > ciregs >r4 ! > ciregs >r3 ! > THEN > > ? Looks better, thanks for the review! > > > Segher >
diff --git a/slof/fs/client.fs b/slof/fs/client.fs index 8a7f6ac4326d..138177e4c2a3 100644 --- a/slof/fs/client.fs +++ b/slof/fs/client.fs @@ -45,6 +45,17 @@ VARIABLE client-callback \ Address of client's callback function >r ciregs >r7 ! ciregs >r6 ! client-entry-point @ ciregs >r5 ! \ Initialise client-stack-pointer cistack ciregs >r1 ! + + s" linux,initrd-end" get-chosen IF decode-int -rot 2drop ELSE 0 THEN + s" linux,initrd-start" get-chosen IF decode-int -rot 2drop ELSE 0 THEN + 2dup - dup IF + ciregs >r4 ! + ciregs >r3 ! + drop + ELSE + 3drop + THEN + \ jump-client maps to call_client in slof/entry.S \ When jump-client returns, R3 holds the address of a NUL-terminated string \ that holds the client interface word the client wants to call, R4 holds
This allows passing zImage via -kernel in the QEMU command line. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> --- slof/fs/client.fs | 11 +++++++++++ 1 file changed, 11 insertions(+)