Add support for /dev/openfirm.

Add OF_nextprop support.
This commit is contained in:
matt 2000-11-14 21:22:43 +00:00
parent 8c16eca0e9
commit 58645ba248
2 changed files with 34 additions and 2 deletions

View File

@ -1,8 +1,10 @@
# $NetBSD: files.ofw,v 1.3 1999/02/15 04:29:33 hubertf Exp $
# $NetBSD: files.ofw,v 1.4 2000/11/14 21:22:43 matt Exp $
file arch/powerpc/powerpc/ofw_machdep.c
file arch/powerpc/powerpc/ofwmagic.S
file arch/powerpc/powerpc/openfirm.c
defpseudo openfirm
file dev/ofw/openfirmio.c openfirm needs-flag
# Firmworks OpenFirmware Bug Workarounds
file arch/powerpc/powerpc/ofwreal.S firmworksbugs

View File

@ -1,4 +1,4 @@
/* $NetBSD: openfirm.c,v 1.4 1999/01/10 10:24:16 tsubai Exp $ */
/* $NetBSD: openfirm.c,v 1.5 2000/11/14 21:22:44 matt Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -198,6 +198,36 @@ OF_getprop(handle, prop, buf, buflen)
return args.size;
}
int
OF_nextprop(handle, prop, nextprop)
int handle;
char *prop;
char *nextprop;
{
static struct {
char *name;
int nargs;
int nreturns;
int phandle;
char *prop;
char *buf;
int flag;
} args = {
"nextprop",
3,
1,
};
ofw_stack();
args.phandle = handle;
args.prop = prop;
args.buf = OF_buf;
if (openfirmware(&args) == -1)
return -1;
strncpy(nextprop, OF_buf, 32);
return args.flag;
}
int
OF_finddevice(name)
char *name;