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>
prom_handle prom_finddevice (char *name);
prom_handle prom_findpackage (char *path);
int prom_getprop (prom_handle dev, char *name, void *buf, int len);
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);
int prom_getproplen(prom_handle, const char *);
int prom_get_devtype (char *device);
int prom_get_chosen (char *name, void *mem, int len);
int prom_get_options (char *name, void *mem, int len);
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);
extern int prom_getms(void);
extern void prom_pause(void);
return (int)call_prom("getproplen", 2, 1, pack, 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)
{
int
prom_get_chosen (char *name, void *mem, int len)
{
return prom_getprop (prom_options, name, mem, 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)
{
int
prom_get_devtype (char *device)
{