FreeBSD kernel amd64 OFW device code
ofw - KObj methods for Open Firmware RTAS implementations

A set of methods to implement the Open Firmware client side interface. More...

Variables

INTERFACE ofw
 
METHOD int init
 Initialize OFW client interface. More...
 
void * _cookie
 
METHOD phandle_t peer
 Return next sibling of node. More...
 
phandle_t _node
 
METHOD phandle_t parent
 Return parent of node. More...
 
METHOD phandle_t child
 Return first child of node. More...
 
METHOD phandle_t instance_to_package
 Return package corresponding to instance. More...
 
ihandle_t _handle
 
METHOD ssize_t getproplen
 Return length of node property. More...
 
const char * _prop
 
METHOD ssize_t getprop
 Read node property. More...
 
void * _buf
 
size_t _size
 
METHOD int nextprop
 Get next property name. More...
 
METHOD int setprop
 Set property. More...
 
METHOD ssize_t canon
 Canonicalize path. More...
 
const char * _path
 
METHOD phandle_t finddevice
 Return phandle for named device. More...
 
METHOD ssize_t instance_to_path
 Return path for node instance. More...
 
METHOD ssize_t package_to_path
 Return path for node. More...
 
METHOD int test
 Test to see if a service exists. More...
 
const char * _name
 
METHOD int call_method
 Call method belonging to an instance handle. More...
 
ihandle_t _instance
 
const char * _method
 
int _nargs
 
int _nreturns
 
cell_t * _args_and_returns
 
METHOD int interpret
 Interpret a forth command. More...
 
const char * _cmd
 
cell_t * _returns
 
METHOD ihandle_t open
 Open node, returning instance handle. More...
 
METHOD void close
 Close node instance. More...
 
METHOD ssize_t read
 Read from device. More...
 
size_t size
 
METHOD ssize_t write
 Write to device. More...
 
METHOD int seek
 Seek device. More...
 
uint64_t _off
 
METHOD caddr_t claim
 Claim virtual memory. More...
 
void * _addr
 
u_int _align
 
METHOD void release
 Release virtual memory. More...
 
METHOD void enter
 Temporarily return control to firmware. More...
 
METHOD void exit
 Halt and return control to firmware. More...
 

Detailed Description

A set of methods to implement the Open Firmware client side interface.

Variable Documentation

◆ _addr

void * _addr

Definition at line 323 of file ofw_if.m.

◆ _align

u_int _align

Definition at line 325 of file ofw_if.m.

◆ _args_and_returns

cell_t* _args_and_returns

Definition at line 232 of file ofw_if.m.

◆ _buf

const void * _buf

Definition at line 115 of file ofw_if.m.

◆ _cmd

const char* _cmd

Definition at line 245 of file ofw_if.m.

◆ _cookie

void* _cookie

Definition at line 48 of file ofw_if.m.

◆ _handle

ihandle_t _handle

Definition at line 88 of file ofw_if.m.

◆ _instance

ihandle_t _instance

Definition at line 227 of file ofw_if.m.

◆ _method

const char* _method

Definition at line 228 of file ofw_if.m.

◆ _name

const char* _name

Definition at line 212 of file ofw_if.m.

◆ _nargs

int _nargs

Definition at line 229 of file ofw_if.m.

◆ _node

phandle_t _node

Definition at line 58 of file ofw_if.m.

◆ _nreturns

int _nreturns

Definition at line 230 of file ofw_if.m.

◆ _off

uint64_t _off

Definition at line 309 of file ofw_if.m.

◆ _path

const char * _path

Definition at line 160 of file ofw_if.m.

◆ _prop

const char * _prop

Definition at line 100 of file ofw_if.m.

◆ _returns

cell_t* _returns

Definition at line 247 of file ofw_if.m.

◆ _size

size_t _size

Definition at line 116 of file ofw_if.m.

◆ call_method

METHOD int call_method
Initial value:
{
ofw_t _ofw

Call method belonging to an instance handle.

Parameters
_instanceInstance handle
_methodMethod name
_nargsNumber of arguments
_nreturnsNumber of return values
_args_and_returnsValues for arguments, followed by returns

Definition at line 225 of file ofw_if.m.

◆ canon

METHOD ssize_t canon
Initial value:
{
ofw_t _ofw

Canonicalize path.

Parameters
_pathPath to canonicalize
_bufBuffer for canonicalized path
_sizeSize of buffer

Definition at line 158 of file ofw_if.m.

◆ child

◆ claim

METHOD caddr_t claim
Initial value:
{
ofw_t _ofw

Claim virtual memory.

Parameters
_addrRequested memory location (NULL for first available)
_sizeRequested size in bytes
_alignRequested alignment

Definition at line 321 of file ofw_if.m.

◆ close

METHOD void close
Initial value:
{
ofw_t _ofw

Close node instance.

Parameters
_instanceInstance to close

Definition at line 267 of file ofw_if.m.

◆ enter

METHOD void enter
Initial value:
{
ofw_t _ofw

Temporarily return control to firmware.

Definition at line 345 of file ofw_if.m.

◆ exit

METHOD void exit
Initial value:
{
ofw_t _ofw

Halt and return control to firmware.

Definition at line 352 of file ofw_if.m.

◆ finddevice

METHOD phandle_t finddevice
Initial value:
{
ofw_t _ofw

Return phandle for named device.

Parameters
_pathDevice path

Definition at line 170 of file ofw_if.m.

◆ getprop

METHOD ssize_t getprop
Initial value:
{
ofw_t _ofw

Read node property.

Parameters
_nodeSelected node
_propProperty name
_bufPointer to buffer
_sizeSize of buffer

Definition at line 111 of file ofw_if.m.

◆ getproplen

METHOD ssize_t getproplen
Initial value:
{
ofw_t _ofw

Return length of node property.

Parameters
_nodeSelected node
_propProperty name

Definition at line 97 of file ofw_if.m.

◆ init

METHOD int init
Initial value:
{
ofw_t _ofw

Initialize OFW client interface.

Parameters
_cookieA handle to the client interface, generally the OF callback routine.

Definition at line 46 of file ofw_if.m.

◆ instance_to_package

METHOD phandle_t instance_to_package
Initial value:
{
ofw_t _ofw

Return package corresponding to instance.

Parameters
_handleSelected instance

Definition at line 86 of file ofw_if.m.

◆ instance_to_path

METHOD ssize_t instance_to_path
Initial value:
{
ofw_t _ofw

Return path for node instance.

Parameters
_handleInstance handle
_pathBuffer for path
_sizeSize of buffer

Definition at line 182 of file ofw_if.m.

◆ interpret

METHOD int interpret
Initial value:
{
ofw_t _ofw

Interpret a forth command.

Parameters
_cmdCommand
_nreturnsNumber of return values
_returnsValues for returns

Definition at line 243 of file ofw_if.m.

◆ nextprop

METHOD int nextprop
Initial value:
{
ofw_t _ofw

Get next property name.

Parameters
_nodeSelected node
_propCurrent property name
_bufBuffer for next property name
_sizeSize of buffer

Definition at line 127 of file ofw_if.m.

◆ ofw

INTERFACE ofw

Definition at line 38 of file ofw_if.m.

Referenced by ofw_fdt_interpret().

◆ open

METHOD ihandle_t open
Initial value:
{
ofw_t _ofw

Open node, returning instance handle.

Parameters
_pathPath to node

Definition at line 257 of file ofw_if.m.

◆ package_to_path

METHOD ssize_t package_to_path
Initial value:
{
ofw_t _ofw

Return path for node.

Parameters
_nodePackage node
_pathBuffer for path
_sizeSize of buffer

Definition at line 196 of file ofw_if.m.

◆ parent

METHOD phandle_t parent
Initial value:
{
ofw_t _ofw

Return parent of node.

Parameters
_nodeSelected node

Definition at line 66 of file ofw_if.m.

Referenced by OF_child_xref_phandle(), ofw_bus_search_intrmap(), ofw_pci_probe(), ofw_reg_to_paddr(), ofw_std_parent(), and ofwbus_identify().

◆ peer

METHOD phandle_t peer
Initial value:
{
ofw_t _ofw

Return next sibling of node.

Parameters
_nodeSelected node

Definition at line 56 of file ofw_if.m.

◆ read

METHOD ssize_t read
Initial value:
{
ofw_t _ofw

Read from device.

Parameters
_instanceDevice instance
_bufBuffer to read to
_sizeSize of buffer

Definition at line 279 of file ofw_if.m.

◆ release

METHOD void release
Initial value:
{
ofw_t _ofw

Release virtual memory.

Parameters
_addrMemory location
_sizeSize in bytes

Definition at line 334 of file ofw_if.m.

◆ seek

METHOD int seek
Initial value:
{
ofw_t _ofw

Seek device.

Parameters
_instanceDevice instance
_offOffset to which to seek

Definition at line 306 of file ofw_if.m.

◆ setprop

METHOD int setprop
Initial value:
{
ofw_t _ofw

Set property.

Parameters
_nodeSelected node
_propProperty name
_bufValue to set
_sizeSize of buffer

Definition at line 143 of file ofw_if.m.

◆ size

◆ test

METHOD int test
Initial value:
{
ofw_t _ofw

Test to see if a service exists.

Parameters
_namename of the service

Definition at line 210 of file ofw_if.m.

◆ write

METHOD ssize_t write
Initial value:
{
ofw_t _ofw

Write to device.

Parameters
_instanceDevice instance
_bufBuffer to write from
_sizeSize of buffer

Definition at line 293 of file ofw_if.m.