]> git.ozlabs.org Git - yaboot.git/commitdiff
prom setprop primatives
authorPaul Nasrat <pnasrat@redhat.com>
Thu, 19 Apr 2007 09:11:19 +0000 (10:11 +0100)
committerPaul Nasrat <pauln@enki.eridu>
Thu, 19 Apr 2007 09:11:19 +0000 (10:11 +0100)
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 <dustin.kirkland@us.ibm.com>
include/prom.h
second/prom.c

index a0f277cdc49da1aa7dcd61aa98200e74e704fa28..e7ee4a9a2651aa9dc90a0c588734ae1b95d601cc 100644 (file)
@@ -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);
index d23b8a6a3d552dd91b4827c99dba2c4efb44f3ad..3407e5ace7d936425503ad149b69ce3b40e99103 100644 (file)
@@ -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)
 {