Implement OF_interpret.
Obtained from: netbsd
This commit is contained in:
parent
498c24eea5
commit
2c7df6a555
@ -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()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user