/trunk/boot/genarch/ofw.h |
---|
46,46 → 46,46 |
* |
*/ |
typedef struct { |
const char *service; /**< Command name */ |
unsigned long nargs; /**< Number of in arguments */ |
unsigned long nret; /**< Number of out arguments */ |
ofw_arg_t args[MAX_OFW_ARGS]; /**< List of arguments */ |
ofw_arg_t service; /**< Command name. */ |
ofw_arg_t nargs; /**< Number of in arguments. */ |
ofw_arg_t nret; /**< Number of out arguments. */ |
ofw_arg_t args[MAX_OFW_ARGS]; /**< List of arguments. */ |
} ofw_args_t; |
typedef struct { |
void *start; |
unsigned int size; |
uint32_t size; |
} memzone_t; |
typedef struct { |
unsigned int total; |
unsigned int count; |
uint32_t total; |
uint32_t count; |
memzone_t zones[MEMMAP_MAX_RECORDS]; |
} memmap_t; |
typedef struct { |
void *addr; |
unsigned int width; |
unsigned int height; |
unsigned int bpp; |
unsigned int scanline; |
uint32_t width; |
uint32_t height; |
uint32_t bpp; |
uint32_t scanline; |
} screen_t; |
typedef struct { |
void *addr; |
unsigned int size; |
uint32_t size; |
} keyboard_t; |
typedef struct { |
unsigned int info; |
unsigned int addr_hi; |
unsigned int addr_lo; |
uint32_t info; |
uint32_t addr_hi; |
uint32_t addr_lo; |
} pci_addr_t; |
typedef struct { |
pci_addr_t addr; |
unsigned int size_hi; |
unsigned int size_lo; |
uint32_t size_hi; |
uint32_t size_lo; |
} pci_reg_t; |
extern uintptr_t ofw_cif; |
/trunk/boot/genarch/ofw.c |
---|
74,7 → 74,15 |
} |
} |
/** Perform a call to OpenFirmware client interface. |
* |
* @param service String identifying the service requested. |
* @param nargs Number of input arguments. |
* @param nret Number of output arguments. This includes the return value. |
* @param rets Buffer for output arguments or NULL. The buffer must accommodate nret - 1 items. |
* |
* @return Return value returned by the client interface. |
*/ |
static unsigned long ofw_call(const char *service, const int nargs, const int nret, ofw_arg_t *rets, ...) |
{ |
va_list list; |
81,7 → 89,7 |
ofw_args_t args; |
int i; |
args.service = service; |
args.service = (ofw_arg_t) service; |
args.nargs = nargs; |
args.nret = nret; |