The IEEE-1275 interpose specification suggests that interposed packages should
not be visible unless an interpose-aware Forth word is used.
Commit 247c6169 "Fix for interpose problem" realised this by converting the romvec
obp_inst2pkg() function over to use ihandle>non-interposed-phandle but didn't make
the same change to the equivalent CIF call instance-to-path (which is presumably
correct since the interpose specification also states that interposed packages are
only visible to a new instance-to-interposed-path CIF call).
Here we add a new instance-to-package word as a wrapper to
ihandle>non-interposed-phandle and update obp_inst2pkg() and instance-to-path to
use it accordingly.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
---
arch/sparc32/romvec.c | 2 +-
forth/device/package.fs | 4 ++++
forth/system/ciface.fs | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/sparc32/romvec.c b/arch/sparc32/romvec.c
index 8757c28..7a01035 100644
--- a/arch/sparc32/romvec.c
+++ b/arch/sparc32/romvec.c
@@ -372,7 +372,7 @@ int obp_inst2pkg(int dev_desc)
int ret;
PUSH(dev_desc);
- fword("ihandle>non-interposed-phandle");
+ fword("instance-to-package");
ret = POP();
DPRINTF("obp_inst2pkg(fd 0x%x) = 0x%x\n", dev_desc, ret);
diff --git a/forth/device/package.fs b/forth/device/package.fs
index d5b52c3..3056c1d 100644
--- a/forth/device/package.fs
+++ b/forth/device/package.fs
@@ -32,6 +32,10 @@
>in.device-node @
;
+: instance-to-package ( ihandle -- phandle )
+ dup 0<> if ihandle>non-interposed-phandle then
+;
+
: ihandle>phandle ( ihandle -- phandle )
>in.device-node @
;
diff --git a/forth/system/ciface.fs b/forth/system/ciface.fs
index 85a6076..9dc433c 100644
--- a/forth/system/ciface.fs
+++ b/forth/system/ciface.fs
@@ -159,7 +159,7 @@ external
;
: instance-to-package ( ihandle -- phandle )
- ?ihandle ihandle>phandle
+ ?ihandle instance-to-package
;
: package-to-path ( buflen buf phandle -- length )
--
1.7.10.4
Now that QEMU 2.10 is out, here's the next set of patches in preparation
for improving the NIC support for PPC Mac machines (sungem) and sun4u
machines (sunhme).
Also included is a little rework of the Forth ob_pci_bus_map_in() so PCI
BARs can be mapped within the various _cb C functions which is needed to
extract the MAC address from the sungem hardware and add it to the DT.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Mark Cave-Ayland (6):
pci: move pci_decode_pci_addr() towards the top of pci.c
pci: split the PCI mapping code out of ob_pci_bus_map_in() into
ob_pci_map()
pci: add basic support for Apple SunGEM
pci: add ob_pci_unmap() to unmap PCI memory
pci: add SUN hme network device
pci: add Intel e1000 network device to PCI database
drivers/pci.c | 134 ++++++++++++++++++++++++++++++++++--------------
drivers/pci_database.c | 18 +++++++
drivers/pci_database.h | 2 +
include/drivers/pci.h | 3 ++
4 files changed, 118 insertions(+), 39 deletions(-)
--
1.7.10.4