diff options
| author | Jake Burkholder <jake@FreeBSD.org> | 2003-06-07 18:34:04 +0000 |
|---|---|---|
| committer | Jake Burkholder <jake@FreeBSD.org> | 2003-06-07 18:34:04 +0000 |
| commit | 2c7df6a555a9f297cf60e9e83c1e384ed11b47e0 (patch) | |
| tree | 90a401e65fb20e15d7ff2f139ca82453524f6685 /sys/dev/ofw | |
| parent | 498c24eea5dc86203aedd52ea9917988f2aaa57e (diff) | |
Notes
Diffstat (limited to 'sys/dev/ofw')
| -rw-r--r-- | sys/dev/ofw/openfirm.c | 32 | ||||
| -rw-r--r-- | sys/dev/ofw/openfirm.h | 4 |
2 files changed, 34 insertions, 2 deletions
diff --git a/sys/dev/ofw/openfirm.c b/sys/dev/ofw/openfirm.c index 7704109b44a3..472cd67b25c8 100644 --- a/sys/dev/ofw/openfirm.c +++ b/sys/dev/ofw/openfirm.c @@ -127,6 +127,38 @@ OF_test(char *name) return args.missing; } +int +OF_interpret(char *cmd, int nreturns, ...) +{ + va_list ap; + static struct { + cell_t name; + cell_t nargs; + cell_t nreturns; + cell_t slot[16]; + } args = { + (cell_t)"interpret", + 1 + }; + cell_t status; + int i = 0; + + args.nreturns = ++nreturns; + args.slot[i++] = (cell_t)cmd; + va_start(ap, nreturns); + while (i < 1) + args.slot[i++] = va_arg(ap, cell_t); + if (openfirmware(&args) == -1) { + va_end(ap); + return (-1); + } + status = args.slot[i++]; + while (i < 1 + nreturns) + *va_arg(ap, cell_t *) = args.slot[i++]; + va_end(ap); + return (status); +} + /* Return firmware millisecond count. */ int OF_milliseconds() diff --git a/sys/dev/ofw/openfirm.h b/sys/dev/ofw/openfirm.h index 903b452c7522..77223c87c34e 100644 --- a/sys/dev/ofw/openfirm.h +++ b/sys/dev/ofw/openfirm.h @@ -128,9 +128,9 @@ void OF_exit(void) __attribute__((noreturn)); void OF_chain(void *, u_int, void (*)(void *, u_int, void *, void *, u_int), void *, u_int); -#if 0 /* User interface functions */ -/* OF_interpret */ +int OF_interpret(char *, int, ...); +#if 0 void *OF_set_callback(void *); void OF_set_symbol_lookup(void *, void *); #endif |
