FreeBSD kernel amd64 OFW device code
ofw_standard.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/systm.h>
#include <machine/stdarg.h>
#include <dev/ofw/ofwvar.h>
#include <dev/ofw/openfirm.h>
#include "ofw_if.h"
Include dependency graph for ofw_standard.c:

Go to the source code of this file.

Functions

 __FBSDID ("$FreeBSD$")
 
static int ofw_std_init (ofw_t ofw, void *openfirm)
 
static int ofw_std_test (ofw_t ofw, const char *name)
 
static int ofw_std_interpret (ofw_t ofw, const char *cmd, int nreturns, cell_t *returns)
 
static phandle_t ofw_std_peer (ofw_t ofw, phandle_t node)
 
static phandle_t ofw_std_child (ofw_t ofw, phandle_t node)
 
static phandle_t ofw_std_parent (ofw_t ofw, phandle_t node)
 
static phandle_t ofw_std_instance_to_package (ofw_t ofw, ihandle_t instance)
 
static ssize_t ofw_std_getproplen (ofw_t ofw, phandle_t package, const char *propname)
 
static ssize_t ofw_std_getprop (ofw_t ofw, phandle_t package, const char *propname, void *buf, size_t buflen)
 
static int ofw_std_nextprop (ofw_t ofw, phandle_t package, const char *previous, char *buf, size_t)
 
static int ofw_std_setprop (ofw_t ofw, phandle_t package, const char *propname, const void *buf, size_t len)
 
static ssize_t ofw_std_canon (ofw_t ofw, const char *device, char *buf, size_t len)
 
static phandle_t ofw_std_finddevice (ofw_t ofw, const char *device)
 
static ssize_t ofw_std_instance_to_path (ofw_t ofw, ihandle_t instance, char *buf, size_t len)
 
static ssize_t ofw_std_package_to_path (ofw_t ofw, phandle_t package, char *buf, size_t len)
 
static int ofw_std_call_method (ofw_t ofw, ihandle_t instance, const char *method, int nargs, int nreturns, cell_t *args_and_returns)
 
static ihandle_t ofw_std_open (ofw_t ofw, const char *device)
 
static void ofw_std_close (ofw_t ofw, ihandle_t instance)
 
static ssize_t ofw_std_read (ofw_t ofw, ihandle_t instance, void *addr, size_t len)
 
static ssize_t ofw_std_write (ofw_t ofw, ihandle_t instance, const void *addr, size_t len)
 
static int ofw_std_seek (ofw_t ofw, ihandle_t instance, uint64_t pos)
 
static caddr_t ofw_std_claim (ofw_t ofw, void *virt, size_t size, u_int align)
 
static void ofw_std_release (ofw_t ofw, void *virt, size_t size)
 
static void ofw_std_enter (ofw_t ofw)
 
static void ofw_std_exit (ofw_t ofw)
 
 OFW_DEF (ofw_std)
 

Variables

static ofw_method_t ofw_std_methods []
 
static ofw_def_t ofw_std
 
static int(* openfirmware )(void *)
 

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ OFW_DEF()

OFW_DEF ( ofw_std  )

◆ ofw_std_call_method()

static int ofw_std_call_method ( ofw_t  ofw,
ihandle_t  instance,
const char *  method,
int  nargs,
int  nreturns,
cell_t *  args_and_returns 
)
static

Definition at line 516 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_canon()

static ssize_t ofw_std_canon ( ofw_t  ofw,
const char *  device,
char *  buf,
size_t  len 
)
static

Definition at line 416 of file ofw_standard.c.

References openfirmware, and size.

◆ ofw_std_child()

static phandle_t ofw_std_child ( ofw_t  ofw,
phandle_t  node 
)
static

Definition at line 240 of file ofw_standard.c.

References child, and openfirmware.

◆ ofw_std_claim()

static caddr_t ofw_std_claim ( ofw_t  ofw,
void *  virt,
size_t  size,
u_int  align 
)
static

Definition at line 683 of file ofw_standard.c.

References openfirmware, and size.

◆ ofw_std_close()

static void ofw_std_close ( ofw_t  ofw,
ihandle_t  instance 
)
static

Definition at line 581 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_enter()

static void ofw_std_enter ( ofw_t  ofw)
static

Definition at line 734 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_exit()

static void ofw_std_exit ( ofw_t  ofw)
static

Definition at line 752 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_finddevice()

static phandle_t ofw_std_finddevice ( ofw_t  ofw,
const char *  device 
)
static

Definition at line 442 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_getprop()

static ssize_t ofw_std_getprop ( ofw_t  ofw,
phandle_t  package,
const char *  propname,
void *  buf,
size_t  buflen 
)
static

Definition at line 330 of file ofw_standard.c.

References openfirmware, and size.

◆ ofw_std_getproplen()

static ssize_t ofw_std_getproplen ( ofw_t  ofw,
phandle_t  package,
const char *  propname 
)
static

Definition at line 306 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_init()

static int ofw_std_init ( ofw_t  ofw,
void *  openfirm 
)
static

Definition at line 154 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_instance_to_package()

static phandle_t ofw_std_instance_to_package ( ofw_t  ofw,
ihandle_t  instance 
)
static

Definition at line 284 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_instance_to_path()

static ssize_t ofw_std_instance_to_path ( ofw_t  ofw,
ihandle_t  instance,
char *  buf,
size_t  len 
)
static

Definition at line 464 of file ofw_standard.c.

References openfirmware, and size.

◆ ofw_std_interpret()

static int ofw_std_interpret ( ofw_t  ofw,
const char *  cmd,
int  nreturns,
cell_t *  returns 
)
static

Definition at line 188 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_nextprop()

static int ofw_std_nextprop ( ofw_t  ofw,
phandle_t  package,
const char *  previous,
char *  buf,
size_t  size 
)
static

Definition at line 359 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_open()

static ihandle_t ofw_std_open ( ofw_t  ofw,
const char *  device 
)
static

Definition at line 559 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_package_to_path()

static ssize_t ofw_std_package_to_path ( ofw_t  ofw,
phandle_t  package,
char *  buf,
size_t  len 
)
static

Definition at line 490 of file ofw_standard.c.

References openfirmware, and size.

◆ ofw_std_parent()

static phandle_t ofw_std_parent ( ofw_t  ofw,
phandle_t  node 
)
static

Definition at line 262 of file ofw_standard.c.

References openfirmware, and parent.

◆ ofw_std_peer()

static phandle_t ofw_std_peer ( ofw_t  ofw,
phandle_t  node 
)
static

Definition at line 218 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_read()

static ssize_t ofw_std_read ( ofw_t  ofw,
ihandle_t  instance,
void *  addr,
size_t  len 
)
static

Definition at line 600 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_release()

static void ofw_std_release ( ofw_t  ofw,
void *  virt,
size_t  size 
)
static

Definition at line 709 of file ofw_standard.c.

References openfirmware, and size.

◆ ofw_std_seek()

static int ofw_std_seek ( ofw_t  ofw,
ihandle_t  instance,
uint64_t  pos 
)
static

Definition at line 653 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_setprop()

static int ofw_std_setprop ( ofw_t  ofw,
phandle_t  package,
const char *  propname,
const void *  buf,
size_t  len 
)
static

Definition at line 387 of file ofw_standard.c.

References openfirmware, and size.

◆ ofw_std_test()

static int ofw_std_test ( ofw_t  ofw,
const char *  name 
)
static

Definition at line 167 of file ofw_standard.c.

References openfirmware.

◆ ofw_std_write()

static ssize_t ofw_std_write ( ofw_t  ofw,
ihandle_t  instance,
const void *  addr,
size_t  len 
)
static

Definition at line 627 of file ofw_standard.c.

References openfirmware.

Variable Documentation

◆ ofw_std

ofw_def_t ofw_std
static
Initial value:
= {
0
}
static ofw_method_t ofw_std_methods[]
Definition: ofw_standard.c:112
#define OFW_STD_DIRECT
Definition: openfirm.h:95

Definition at line 142 of file ofw_standard.c.

◆ ofw_std_methods

ofw_method_t ofw_std_methods[]
static
Initial value:
= {
OFWMETHOD(ofw_init, ofw_std_init),
OFWMETHOD(ofw_peer, ofw_std_peer),
OFWMETHOD(ofw_child, ofw_std_child),
OFWMETHOD(ofw_parent, ofw_std_parent),
OFWMETHOD(ofw_instance_to_package, ofw_std_instance_to_package),
OFWMETHOD(ofw_getproplen, ofw_std_getproplen),
OFWMETHOD(ofw_getprop, ofw_std_getprop),
OFWMETHOD(ofw_nextprop, ofw_std_nextprop),
OFWMETHOD(ofw_setprop, ofw_std_setprop),
OFWMETHOD(ofw_canon, ofw_std_canon),
OFWMETHOD(ofw_finddevice, ofw_std_finddevice),
OFWMETHOD(ofw_instance_to_path, ofw_std_instance_to_path),
OFWMETHOD(ofw_package_to_path, ofw_std_package_to_path),
OFWMETHOD(ofw_test, ofw_std_test),
OFWMETHOD(ofw_call_method, ofw_std_call_method),
OFWMETHOD(ofw_interpret, ofw_std_interpret),
OFWMETHOD(ofw_open, ofw_std_open),
OFWMETHOD(ofw_close, ofw_std_close),
OFWMETHOD(ofw_read, ofw_std_read),
OFWMETHOD(ofw_write, ofw_std_write),
OFWMETHOD(ofw_seek, ofw_std_seek),
OFWMETHOD(ofw_claim, ofw_std_claim),
OFWMETHOD(ofw_release, ofw_std_release),
OFWMETHOD(ofw_enter, ofw_std_enter),
OFWMETHOD(ofw_exit, ofw_std_exit),
{ 0, 0 }
}
static ssize_t ofw_std_canon(ofw_t ofw, const char *device, char *buf, size_t len)
Definition: ofw_standard.c:416
static phandle_t ofw_std_instance_to_package(ofw_t ofw, ihandle_t instance)
Definition: ofw_standard.c:284
static phandle_t ofw_std_finddevice(ofw_t ofw, const char *device)
Definition: ofw_standard.c:442
static void ofw_std_release(ofw_t ofw, void *virt, size_t size)
Definition: ofw_standard.c:709
static ssize_t ofw_std_read(ofw_t ofw, ihandle_t instance, void *addr, size_t len)
Definition: ofw_standard.c:600
static ssize_t ofw_std_instance_to_path(ofw_t ofw, ihandle_t instance, char *buf, size_t len)
Definition: ofw_standard.c:464
static int ofw_std_seek(ofw_t ofw, ihandle_t instance, uint64_t pos)
Definition: ofw_standard.c:653
static ssize_t ofw_std_package_to_path(ofw_t ofw, phandle_t package, char *buf, size_t len)
Definition: ofw_standard.c:490
static int ofw_std_test(ofw_t ofw, const char *name)
Definition: ofw_standard.c:167
static void ofw_std_exit(ofw_t ofw)
Definition: ofw_standard.c:752
static phandle_t ofw_std_peer(ofw_t ofw, phandle_t node)
Definition: ofw_standard.c:218
static int ofw_std_interpret(ofw_t ofw, const char *cmd, int nreturns, cell_t *returns)
Definition: ofw_standard.c:188
static void ofw_std_close(ofw_t ofw, ihandle_t instance)
Definition: ofw_standard.c:581
static caddr_t ofw_std_claim(ofw_t ofw, void *virt, size_t size, u_int align)
Definition: ofw_standard.c:683
static phandle_t ofw_std_parent(ofw_t ofw, phandle_t node)
Definition: ofw_standard.c:262
static void ofw_std_enter(ofw_t ofw)
Definition: ofw_standard.c:734
static int ofw_std_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf, size_t)
Definition: ofw_standard.c:359
static phandle_t ofw_std_child(ofw_t ofw, phandle_t node)
Definition: ofw_standard.c:240
static int ofw_std_init(ofw_t ofw, void *openfirm)
Definition: ofw_standard.c:154
static ssize_t ofw_std_getproplen(ofw_t ofw, phandle_t package, const char *propname)
Definition: ofw_standard.c:306
static int ofw_std_setprop(ofw_t ofw, phandle_t package, const char *propname, const void *buf, size_t len)
Definition: ofw_standard.c:387
static int ofw_std_call_method(ofw_t ofw, ihandle_t instance, const char *method, int nargs, int nreturns, cell_t *args_and_returns)
Definition: ofw_standard.c:516
static ssize_t ofw_std_getprop(ofw_t ofw, phandle_t package, const char *propname, void *buf, size_t buflen)
Definition: ofw_standard.c:330
static ssize_t ofw_std_write(ofw_t ofw, ihandle_t instance, const void *addr, size_t len)
Definition: ofw_standard.c:627
static ihandle_t ofw_std_open(ofw_t ofw, const char *device)
Definition: ofw_standard.c:559
#define OFWMETHOD
Definition: ofwvar.h:87

Definition at line 112 of file ofw_standard.c.

◆ openfirmware