summaryrefslogtreecommitdiffstats
path: root/perl-install/c/sbus.c
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-06-20 16:25:33 +0000
committerFrancois Pons <fpons@mandriva.com>2000-06-20 16:25:33 +0000
commit7f7a9b7b58dbef59e2e1a09afe682983dc7806f8 (patch)
tree8b7d537f31d92c3ba63acf1a67dd73c58ea84ab8 /perl-install/c/sbus.c
parente61090daf9ed3cfcb837287cf6717161d1179bf5 (diff)
downloaddrakx-7f7a9b7b58dbef59e2e1a09afe682983dc7806f8.tar
drakx-7f7a9b7b58dbef59e2e1a09afe682983dc7806f8.tar.gz
drakx-7f7a9b7b58dbef59e2e1a09afe682983dc7806f8.tar.bz2
drakx-7f7a9b7b58dbef59e2e1a09afe682983dc7806f8.tar.xz
drakx-7f7a9b7b58dbef59e2e1a09afe682983dc7806f8.zip
*** empty log message ***
Diffstat (limited to 'perl-install/c/sbus.c')
-rw-r--r--perl-install/c/sbus.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/perl-install/c/sbus.c b/perl-install/c/sbus.c
index 3de75fca2..85d44fa79 100644
--- a/perl-install/c/sbus.c
+++ b/perl-install/c/sbus.c
@@ -19,12 +19,11 @@
*
*/
-#include <stdlib.h>
-
#ifdef __sparc__
#include <fcntl.h>
#include <unistd.h>
+#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <asm/openpromio.h>
@@ -87,6 +86,25 @@ int prom_getchild(int node)
return *(int *)op->oprom_array;
}
+char *prom_getopt(char *var, int *lenp)
+{
+ DECL_OP(MAX_VAL);
+
+ strcpy (op->oprom_array, var);
+ if (ioctl (promfd, OPROMGETOPT, op) < 0)
+ return 0;
+ if (lenp) *lenp = op->oprom_size;
+ return op->oprom_array;
+}
+
+void prom_setopt(char *var, char *value) {
+ DECL_OP(MAX_VAL);
+
+ strcpy (op->oprom_array, var);
+ strcpy (op->oprom_array + strlen (var) + 1, value);
+ ioctl (promfd, OPROMSETOPT, op);
+}
+
char *prom_getproperty(char *prop, int *lenp)
{
DECL_OP(MAX_VAL);
@@ -114,11 +132,25 @@ int prom_getbool(char *prop)
}
}
+int prom_pci2node(int bus, int devfn) {
+ DECL_OP(2*sizeof(int));
+
+ ((int *)op->oprom_array)[0] = bus;
+ ((int *)op->oprom_array)[1] = devfn;
+ if (ioctl (promfd, OPROMPCI2NODE, op) < 0)
+ return 0;
+ prom_current_node = *(int *)op->oprom_array;
+ return *(int *)op->oprom_array;
+}
+
#else
int prom_open() { return 0; }
void prom_close() {}
int prom_getsibling(int node) { return 0; }
int prom_getchild(int node) { return 0; }
-char *prom_getproperty(char *prop, int *lenp) { return NULL; }
+char *prom_getopt(char *var, int *lenp) { return 0; /* NULL */ }
+void prom_setopt(char *var, char *value) {}
+char *prom_getproperty(char *prop, int *lenp) { return 0; /* NULL */ }
int prom_getbool(char *prop) { return 0; }
+int prom_pci2node(int bus, int devfn) { return 0; }
#endif /* __sparc__ */