/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; |
/trunk/boot/arch/sparc64/loader/asm.S |
---|
98,9 → 98,11 |
mov %o1, %o0 |
jump_to_kernel: |
set ofw_cif, %l0 |
jmp %o0 ! jump to kernel |
ldx [%l0], %o4 ! pass OpenFirmware address in %o4 |
mov %o0, %l1 |
mov %o1, %o0 |
mov %o2, %o1 |
jmp %l1 ! jump to kernel |
nop |
.global ofw |
ofw: |
/trunk/boot/arch/sparc64/loader/main.c |
---|
80,15 → 80,17 |
printf("\nCopying components\n"); |
unsigned int top = 0; |
bootinfo.cnt = 0; |
bootinfo.taskmap.count = 0; |
for (i = 0; i < COMPONENTS; i++) { |
void * base = (void *) KERNEL_VIRTUAL_ADDRESS; |
printf(" %s...", components[i].name); |
top = ALIGN_UP(top, PAGE_SIZE); |
memcpy(((void *) KERNEL_VIRTUAL_ADDRESS) + top, components[i].start, components[i].size); |
memcpy(base + top, components[i].start, components[i].size); |
if (i > 0) { |
bootinfo.tasks[bootinfo.cnt].addr = ((void *) KERNEL_VIRTUAL_ADDRESS) + top; |
bootinfo.tasks[bootinfo.cnt].size = components[i].size; |
bootinfo.cnt++; |
bootinfo.taskmap.tasks[bootinfo.taskmap.count].addr = base + top; |
bootinfo.taskmap.tasks[bootinfo.taskmap.count].size = components[i].size; |
bootinfo.taskmap.count++; |
} |
top += components[i].size; |
printf("done.\n"); |
/trunk/boot/arch/sparc64/loader/main.h |
---|
30,17 → 30,22 |
#define BOOT_sparc64_MAIN_H_ |
#include <ofw.h> |
#include <types.h> |
#define TASKMAP_MAX_RECORDS 32 |
typedef struct { |
void *addr; |
unsigned int size; |
uint32_t size; |
} task_t; |
typedef struct { |
unsigned int cnt; |
uint32_t count; |
task_t tasks[TASKMAP_MAX_RECORDS]; |
} taskmap_t; |
typedef struct { |
taskmap_t taskmap; |
memmap_t memmap; |
screen_t screen; |
keyboard_t keyboard; |