From 7bad11f4131e79f445c66b68aabb43b7b1392731 Mon Sep 17 00:00:00 2001
From: BALATON Zoltan <balaton@eik.bme.hu>
Date: Sat, 10 Sep 2022 13:58:12 +0200
Subject: [PATCH v2] Rename parse-hex to parse-1hex
To: openbios@openbios.org

This word does not appear in OpenFirmware nor OpenBoot but Apple OF
has a word called parse-1hex which is used by code running on that
OF implementation. Rename parse-hex accordingly for compatibility.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
v2: Drop pci debug changes that were accidentally included

 arch/amd64/init.fs        | 2 +-
 arch/ia64/init.fs         | 2 +-
 arch/ppc/briq/briq.fs     | 2 +-
 arch/ppc/mol/mol.fs       | 2 +-
 arch/ppc/mol/tree.fs      | 2 +-
 arch/ppc/pearpc/pearpc.fs | 2 +-
 arch/ppc/qemu/tree.fs     | 2 +-
 arch/sparc64/tree.fs      | 4 ++--
 arch/unix/tree.fs         | 4 ++--
 arch/x86/init.fs          | 2 +-
 drivers/esp.fs            | 4 ++--
 drivers/ide.c             | 2 +-
 drivers/lsi.c             | 2 +-
 drivers/sbus.fs           | 4 ++--
 forth/admin/nvram.fs      | 4 ++--
 forth/device/pathres.fs   | 2 +-
 forth/device/tree.fs      | 2 +-
 forth/lib/string.fs       | 2 +-
 18 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/arch/amd64/init.fs b/arch/amd64/init.fs
index fda3acd..0a06383 100644
--- a/arch/amd64/init.fs
+++ b/arch/amd64/init.fs
@@ -26,7 +26,7 @@ new-device
   external
   : open true ;
   : close ;
-  : decode-unit parse-hex ;
+  : decode-unit parse-1hex ;
 
 finish-device
 
diff --git a/arch/ia64/init.fs b/arch/ia64/init.fs
index 5b65dd1..c7c83f6 100644
--- a/arch/ia64/init.fs
+++ b/arch/ia64/init.fs
@@ -24,7 +24,7 @@ new-device
   external
   : open true ;
   : close ;
-  : decode-unit parse-hex ;
+  : decode-unit parse-1hex ;
 
 finish-device
 
diff --git a/arch/ppc/briq/briq.fs b/arch/ppc/briq/briq.fs
index 78d7797..c8e0502 100644
--- a/arch/ppc/briq/briq.fs
+++ b/arch/ppc/briq/briq.fs
@@ -58,7 +58,7 @@
       
         over active-package!
         case
-          1 of ['] parse-hex " decode-unit" is-xt-func endof
+          1 of ['] parse-1hex " decode-unit" is-xt-func endof
           3 of
             " bus-range" active-package get-package-property 0= if
               decode-int nip nip
diff --git a/arch/ppc/mol/mol.fs b/arch/ppc/mol/mol.fs
index 10c99bd..2e1be19 100644
--- a/arch/ppc/mol/mol.fs
+++ b/arch/ppc/mol/mol.fs
@@ -51,7 +51,7 @@
       
         over active-package!
         case
-          1 of ['] parse-hex " decode-unit" is-xt-func endof
+          1 of ['] parse-1hex " decode-unit" is-xt-func endof
           3 of
             " bus-range" active-package get-package-property 0= if
               decode-int nip nip
diff --git a/arch/ppc/mol/tree.fs b/arch/ppc/mol/tree.fs
index 228163f..434033b 100644
--- a/arch/ppc/mol/tree.fs
+++ b/arch/ppc/mol/tree.fs
@@ -64,7 +64,7 @@ new-device
 	external
 	: open true ;
 	: close ;
-	: decode-unit parse-hex ;
+	: decode-unit parse-1hex ;
 
 finish-device
 
diff --git a/arch/ppc/pearpc/pearpc.fs b/arch/ppc/pearpc/pearpc.fs
index 0d018b1..8201f17 100644
--- a/arch/ppc/pearpc/pearpc.fs
+++ b/arch/ppc/pearpc/pearpc.fs
@@ -59,7 +59,7 @@
       
         over active-package!
         case
-          1 of ['] parse-hex " decode-unit" is-xt-func endof
+          1 of ['] parse-1hex " decode-unit" is-xt-func endof
           3 of
             " bus-range" active-package get-package-property 0= if
               decode-int nip nip
diff --git a/arch/ppc/qemu/tree.fs b/arch/ppc/qemu/tree.fs
index 06583ab..dc6f501 100644
--- a/arch/ppc/qemu/tree.fs
+++ b/arch/ppc/qemu/tree.fs
@@ -64,7 +64,7 @@ new-device
 	;
 
 	: decode-unit ( str len -- unit )
-		parse-hex
+		parse-1hex
 	;
 
 finish-device
diff --git a/arch/sparc64/tree.fs b/arch/sparc64/tree.fs
index af8948d..a1f2fc0 100644
--- a/arch/sparc64/tree.fs
+++ b/arch/sparc64/tree.fs
@@ -7,8 +7,8 @@ include config.fs
 : decode-unit-upa ( str len -- id lun )
   ascii , left-split
   ( addr-R len-R addr-L len-L )
-  parse-hex
-  -rot parse-hex
+  parse-1hex
+  -rot parse-1hex
   swap
 ;
 
diff --git a/arch/unix/tree.fs b/arch/unix/tree.fs
index a7529b0..3326b9b 100644
--- a/arch/unix/tree.fs
+++ b/arch/unix/tree.fs
@@ -22,7 +22,7 @@ new-device
   external
   : open true ;
   : close ;
-  : decode-unit parse-hex ;
+  : decode-unit parse-1hex ;
 
 finish-device
 
@@ -95,7 +95,7 @@ new-device
 	external
   : open true ;
   : close ;
-  : decode-unit parse-hex ;
+  : decode-unit parse-1hex ;
 
 \ testnode
 \ new-device
diff --git a/arch/x86/init.fs b/arch/x86/init.fs
index eef72e9..220bec0 100644
--- a/arch/x86/init.fs
+++ b/arch/x86/init.fs
@@ -26,7 +26,7 @@ new-device
   external
   : open true ;
   : close ;
-  : decode-unit parse-hex ;
+  : decode-unit parse-1hex ;
 
 finish-device
 
diff --git a/drivers/esp.fs b/drivers/esp.fs
index 9e37c0a..6f78ee4 100644
--- a/drivers/esp.fs
+++ b/drivers/esp.fs
@@ -5,8 +5,8 @@
 : decode-unit-scsi ( str len -- id lun )
   ascii , left-split
   ( addr-R len-R addr-L len-L )
-  parse-hex
-  -rot parse-hex
+  parse-1hex
+  -rot parse-1hex
   swap
 ;
 
diff --git a/drivers/ide.c b/drivers/ide.c
index 4cc572c..79ea8dd 100644
--- a/drivers/ide.c
+++ b/drivers/ide.c
@@ -1284,7 +1284,7 @@ NODE_METHODS(ob_ide) = {
 static void
 ob_ide_ctrl_decodeunit(int *idx)
 {
-	fword("parse-hex");
+	fword("parse-1hex");
 }
 
 static void
diff --git a/drivers/lsi.c b/drivers/lsi.c
index 51a541c..e5b09b3 100644
--- a/drivers/lsi.c
+++ b/drivers/lsi.c
@@ -590,7 +590,7 @@ static void
 ob_lsi_decodeunit(__attribute__((unused)) lsi_private_t **lsi_p)
 {
     /* ( str len -- id ) */
-    fword("parse-hex");
+    fword("parse-1hex");
 }
 
 static void
diff --git a/drivers/sbus.fs b/drivers/sbus.fs
index b84a3ac..cea2f14 100644
--- a/drivers/sbus.fs
+++ b/drivers/sbus.fs
@@ -5,8 +5,8 @@
 : decode-unit-sbus ( str len -- id lun )
   ascii , left-split
   ( addr-R len-R addr-L len-L )
-  parse-hex
-  -rot parse-hex
+  parse-1hex
+  -rot parse-1hex
   swap
 ;
 
diff --git a/forth/admin/nvram.fs b/forth/admin/nvram.fs
index 3fbd935..d543a5e 100644
--- a/forth/admin/nvram.fs
+++ b/forth/admin/nvram.fs
@@ -104,7 +104,7 @@ constant config-info.size
 
 : exec-int-conf ( str len -- value )
   \ fixme
-  parse-hex
+  parse-1hex
 ;
 : check-int-conf ( str len -- str len valid? )
   true
@@ -145,7 +145,7 @@ constant config-info.size
   2dup s" false" strcmp 0= if 2drop false exit then
   2dup s" TRUE" strcmp 0= if 2drop false exit then
   2dup s" FALSE" strcmp 0= if 2drop false exit then
-  parse-hex 0<>
+  parse-1hex 0<>
 ;
 
 : check-bool-conf ( name len -- str len valid? )
diff --git a/forth/device/pathres.fs b/forth/device/pathres.fs
index a185b95..7976d78 100644
--- a/forth/device/pathres.fs
+++ b/forth/device/pathres.fs
@@ -179,7 +179,7 @@ constant sinfo.size
 
 \ used if package lacks a decode-unit method
 : def-decode-unit ( str len -- unitaddr ... )
-  parse-hex
+  parse-1hex
 ;
 
 : get-decode-unit-xt ( phandle -- xt )
diff --git a/forth/device/tree.fs b/forth/device/tree.fs
index 6a4cb35..34c01e7 100644
--- a/forth/device/tree.fs
+++ b/forth/device/tree.fs
@@ -15,7 +15,7 @@ new-device
   1 encode-int " #address-cells" property
   : open true ;
   : close ;
-  : decode-unit parse-hex ;
+  : decode-unit parse-1hex ;
   : encode-unit ( addr -- str len )
     pocket tohexstr
   ;
diff --git a/forth/lib/string.fs b/forth/lib/string.fs
index f97db23..55b24fc 100644
--- a/forth/lib/string.fs
+++ b/forth/lib/string.fs
@@ -122,7 +122,7 @@
 \ string to number conversion
 \ -----------------------------------------------------
 
-: parse-hex ( str len -- value )
+: parse-1hex ( str len -- value )
   base @ hex -rot $number if 0 then swap base !
 ;
 
-- 
2.30.4

