Author: wmb
Date: Wed Jul 4 18:18:52 2012
New Revision: 3038
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3038
Log:
PCI bus driver - fixed a problem introduced by svn 3021 (the code change to make phandles relative wasn't complete).
Modified:
dev/pcibus.fth
ofw/core/ofwcore.fth
Modified: dev/pcibus.fth
==============================================================================
--- dev/pcibus.fth Wed Jul 4 06:30:17 2012 (r3037)
+++ dev/pcibus.fth Wed Jul 4 18:18:52 2012 (r3038)
@@ -1048,27 +1048,12 @@
then
;
-\ XXX In order to implement put-package-property with standard words,
-\ we would have to:
-\ a) Save my-self and set it to 0
-\ b) Get the package's "reg" property value with get-package-property
-\ c) Convert the first entry therein to a string of the form "@D,F"
-\ d) Pass that string to find-device to make that package the active package
-\ e) Create the property
-\ f) Restore my-self
-
-: put-package-property ( value$ name$ phandle -- )
- current token@ >r context token@ >r execute ( value$ name$ )
- (property)
- r> context token! r> current token!
-;
-
0 value aa-adr
0 value aa-len
: init-aa-property ( -- ) 0 0 encode-bytes to aa-len to aa-adr ;
: finish-aa-property ( phandle -- )
aa-len if
- >r aa-adr aa-len " assigned-addresses" r> put-package-property
+ >r aa-adr aa-len " assigned-addresses" r> set-package-property
else
drop
then
Modified: ofw/core/ofwcore.fth
==============================================================================
--- ofw/core/ofwcore.fth Wed Jul 4 06:30:17 2012 (r3037)
+++ ofw/core/ofwcore.fth Wed Jul 4 18:18:52 2012 (r3038)
@@ -2162,6 +2162,12 @@
(push-package) get-property (pop-package)
;
+: set-package-property ( value$ name$ phandle -- )
+ current token@ >r context token@ >r (select-package) ( value$ name$ )
+ (property)
+ r> context token! r> current token!
+;
+
\ Used when executing from an open package instance. Finds a property
\ associated with the current package.
: get-my-property ( adr len -- true | adr' len' false )