FreeBSD/sys/dev/ofw/ofw_standard.c
/* Get the value of a property of a package. */
Get the value of a property of a package.
Get the value of a property of a package .
static ssize_t
ofw_std_getprop(ofw_t ofw, phandle_t package, const char *propname, void *buf,
    size_t buflen)
{
	struct {
		cell_t name;
		cell_t nargs;
		cell_t nreturns;
		cell_t package;
		cell_t propname;
		cell_t buf;
		cell_t buflen;
		cell_t size;
	} args = {
		(cell_t)"getprop",
		4,
		1,
	};
	args.package = package;
	args.propname = (cell_t)propname;
	args.buf = (cell_t)buf;
	args.buflen = buflen;
	if (openfirmware(&args) == -1)
		return (-1);
	return (args.size);
}
static ssize_t ofw_std_getprop ( ofw_t ofw , phandle_t package , const char * propname , void * buf , size_t buflen ) { struct { cell_t name ; cell_t nargs ; cell_t nreturns ; cell_t package ; cell_t propname ; cell_t buf ; cell_t buflen ; cell_t size ; } args = { ( cell_t ) " " , 4 , 1 , } ; args . package = package ; args . propname = ( cell_t ) propname ; args . buf = ( cell_t ) buf ; args . buflen = buflen ; if ( openfirmware ( & args ) == -1 ) return ( -1 ) ; return ( args . size ) ; }
Get the value of a property of a package.
Get the value of a property of a package .