diff mbox series

client: Load initramdisk location

Message ID 20191108083439.103275-1-aik@ozlabs.ru
State Superseded
Headers show
Series client: Load initramdisk location | expand

Commit Message

Alexey Kardashevskiy Nov. 8, 2019, 8:34 a.m. UTC
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(+)

Comments

Segher Boessenkool Nov. 8, 2019, 10:26 a.m. UTC | #1
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
Alexey Kardashevskiy Nov. 11, 2019, 1:31 a.m. UTC | #2
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 mbox series

Patch

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