From: Paul Nasrat Date: Thu, 19 Apr 2007 09:11:19 +0000 (+0100) Subject: prom setprop primatives X-Git-Tag: yaboot-1.3.14rc2~12 X-Git-Url: http://git.ozlabs.org/?p=yaboot.git;a=commitdiff_plain;h=5d4289bddaef010cc14bcbeecfd13d5068b50a8e;ds=sidebyside prom setprop primatives This patch creates the prom_set_options() and prom_setprop() functions. These are precise mirrors of their read-only brothers, prom_get_options() and prom_getprop(), implemented as defined in the Open Firmware 1275 spec. The prom_set_options() function will be used to zero out the boot-once label unconditionally after reading it. Signed-off-by: Dustin Kirkland --- diff --git a/include/prom.h b/include/prom.h index a0f277c..e7ee4a9 100644 --- a/include/prom.h +++ b/include/prom.h @@ -93,6 +93,7 @@ void prom_map (void *phys, void *virt, int size); prom_handle prom_finddevice (char *name); prom_handle prom_findpackage (char *path); int prom_getprop (prom_handle dev, char *name, void *buf, int len); +int prom_setprop (prom_handle dev, char *name, void *buf, int len); int prom_getproplen(prom_handle, const char *); int prom_get_devtype (char *device); @@ -109,6 +110,7 @@ int prom_interpret (char *forth); int prom_get_chosen (char *name, void *mem, int len); int prom_get_options (char *name, void *mem, int len); +int prom_set_options (char *name, void *mem, int len); extern int prom_getms(void); extern void prom_pause(void); diff --git a/second/prom.c b/second/prom.c index d23b8a6..3407e5a 100644 --- a/second/prom.c +++ b/second/prom.c @@ -159,6 +159,12 @@ prom_getproplen(prom_handle pack, const char *name) return (int)call_prom("getproplen", 2, 1, pack, name); } +int +prom_setprop (prom_handle pack, char *name, void *mem, int len) +{ + return (int)call_prom ("setprop", 4, 1, pack, name, mem, len); +} + int prom_get_chosen (char *name, void *mem, int len) { @@ -173,6 +179,14 @@ prom_get_options (char *name, void *mem, int len) return prom_getprop (prom_options, name, mem, len); } +int +prom_set_options (char *name, void *mem, int len) +{ + if (prom_options == (void *)-1) + return -1; + return prom_setprop (prom_options, name, mem, len); +} + int prom_get_devtype (char *device) {