Lines Matching refs:fd

43 #define	OFW_IOCTL(fd, cmd, val)	do {					\  argument
44 if (ioctl(fd, cmd, val) == -1) \
51 int fd; in ofw_open() local
53 if ((fd = open(PATH_DEV_OPENFIRM, mode)) == -1) in ofw_open()
55 return (fd); in ofw_open()
59 ofw_close(int fd) in ofw_close() argument
62 close(fd); in ofw_close()
66 ofw_root(int fd) in ofw_root() argument
69 return (ofw_peer(fd, 0)); in ofw_root()
73 ofw_optnode(int fd) in ofw_optnode() argument
77 OFW_IOCTL(fd, OFIOCGETOPTNODE, &rv); in ofw_optnode()
82 ofw_peer(int fd, phandle_t node) in ofw_peer() argument
87 OFW_IOCTL(fd, OFIOCGETNEXT, &rv); in ofw_peer()
92 ofw_child(int fd, phandle_t node) in ofw_child() argument
97 OFW_IOCTL(fd, OFIOCGETCHILD, &rv); in ofw_child()
102 ofw_finddevice(int fd, const char *name) in ofw_finddevice() argument
111 if (ioctl(fd, OFIOCFINDDEVICE, &d) == -1) { in ofw_finddevice()
122 ofw_firstprop(int fd, phandle_t node, char *buf, int buflen) in ofw_firstprop() argument
125 return (ofw_nextprop(fd, node, NULL, buf, buflen)); in ofw_firstprop()
129 ofw_nextprop(int fd, phandle_t node, const char *prev, char *buf, int buflen) in ofw_nextprop() argument
138 if (ioctl(fd, OFIOCNEXTPROP, &d) == -1) { in ofw_nextprop()
158 ofw_getprop(int fd, phandle_t node, const char *name, void *buf, int buflen) in ofw_getprop() argument
167 OFW_IOCTL(fd, OFIOCGET, &d); in ofw_getprop()
172 ofw_setprop(int fd, phandle_t node, const char *name, const void *buf, in ofw_setprop() argument
183 OFW_IOCTL(fd, OFIOCSET, &d); in ofw_setprop()
189 ofw_getproplen(int fd, phandle_t node, const char *name) in ofw_getproplen() argument
196 OFW_IOCTL(fd, OFIOCGETPROPLEN, &d); in ofw_getproplen()
201 ofw_getprop_alloc(int fd, phandle_t node, const char *name, void **buf, in ofw_getprop_alloc() argument
208 len = ofw_getproplen(fd, node, name); in ofw_getprop_alloc()
222 rv = ioctl(fd, OFIOCGET, &d); in ofw_getprop_alloc()