[OpenBIOS] [commit] r894 - trunk/openbios-devel/forth/system

repository service svn at openbios.org
Sat Oct 9 12:16:34 CEST 2010


Author: blueswirl
Date: Sat Oct  9 12:16:33 2010
New Revision: 894
URL: http://tracker.coreboot.org/trac/openbios/changeset/894

Log:
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 at web.de>
Signed-off-by: Blue Swirl <blauwirbel at gmail.com>

Modified:
   trunk/openbios-devel/forth/system/ciface.fs

Modified: trunk/openbios-devel/forth/system/ciface.fs
==============================================================================
--- trunk/openbios-devel/forth/system/ciface.fs	Sat Oct  9 12:16:29 2010	(r893)
+++ trunk/openbios-devel/forth/system/ciface.fs	Sat Oct  9 12:16:33 2010	(r894)
@@ -97,8 +97,9 @@
   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



More information about the OpenBIOS mailing list