aboutsummaryrefslogtreecommitdiff
path: root/forth/system
diff options
context:
space:
mode:
authorAndreas Färber <andreas.faerber@web.de>2010-10-09 10:16:33 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-10-09 10:16:33 +0000
commit43221313e3b5ef74b1e4e41338ef7926f5f6bc1a (patch)
tree6982c98fdaffaafc4591b21ef03975fcb4535260 /forth/system
parentb3d98a9189a21bf02e0607b732b5c6c24da676a3 (diff)
downloadopenbios-43221313e3b5ef74b1e4e41338ef7926f5f6bc1a.zip
openbios-43221313e3b5ef74b1e4e41338ef7926f5f6bc1a.tar.gz
openbios-43221313e3b5ef74b1e4e41338ef7926f5f6bc1a.tar.bz2
Fix getprop return value
According to IEEE 1275, "Size is either the actual size of the property, or –1 if name does not exist." The property might be larger than the client's buffer, so don't dup the min used for writing into the buffer but the original proplen value. Insert a comment to show what's going on. Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@894 f158a5a8-5612-0410-a976-696ce0be7e32
Diffstat (limited to 'forth/system')
-rw-r--r--forth/system/ciface.fs5
1 files changed, 3 insertions, 2 deletions
diff --git a/forth/system/ciface.fs b/forth/system/ciface.fs
index d7b5c25..ff87608 100644
--- a/forth/system/ciface.fs
+++ b/forth/system/ciface.fs
@@ -97,8 +97,9 @@ external
over cstrlen swap
?phandle get-package-property if 2drop -1 exit then
( buflen buf prop proplen )
- >r swap rot r> min
- dup >r move r>
+ >r swap rot r>
+ ( prop buf buflen proplen )
+ dup >r min move r>
;
\ 1 OK, 0 no more prop, -1 prev invalid