On 10/09/2022 12:58, BALATON Zoltan wrote:
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
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/pci.c | 4 ++++ drivers/sbus.fs | 4 ++-- forth/admin/nvram.fs | 4 ++-- forth/device/pathres.fs | 2 +- forth/device/tree.fs | 2 +- forth/lib/string.fs | 2 +- 19 files changed, 27 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/pci.c b/drivers/pci.c index 787fa93..1691e6d 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -1072,11 +1072,13 @@ int vga_config_cb (const pci_config_t *config) uint32_t rom_size, size, bar; phandle_t ph; #endif
PCI_DPRINTF("%s 0x%x\n", __func__, config->assigned[0]); if (config->assigned[0] != 0x00000000) { setup_video();
#ifdef CONFIG_PPC if (config->assigned[6]) {
PCI_DPRINTF("%s Checking ROM\n", __func__); rom = pci_bus_addr_to_host_addr(MEMORY_SPACE_32, config->assigned[6] & ~0x0000000F); rom_size = config->sizes[6];
@@ -1092,10 +1094,12 @@ int vga_config_cb (const pci_config_t *config) p = (const char *)rom; if (p[0] == 'N' && p[1] == 'D' && p[2] == 'R' && p[3] == 'V') { size = *(uint32_t*)(p + 4);
PCI_DPRINTF("%s Found NDRV, size=%u\n", __func__, size); set_property(ph, "driver,AAPL,MacOS,PowerPC", p + 8, size); } else if (p[0] == 'J' && p[1] == 'o' && p[2] == 'y' && p[3] == '!') {
PCI_DPRINTF("%s Found PEF, size=%u\n", __func__, rom_size); set_property(ph, "driver,AAPL,MacOS,PowerPC", p, rom_size); }
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 ! ;
I'd be wary of using Apple's Open Firmware as the baseline standard since it has a number of bugs and incompatibilities with the OF specification. Is there any significance to the digit 1 in parse-1hex? If not, I'd be inclined to add a simple ": parse-1hex parse-hex ;" somewhere in the PPC-specific part of OpenBIOS and use that instead.
ATB,
Mark.