/boot/trunk/arch/sparc64/loader/asm.S |
---|
26,6 → 26,10 |
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
# |
#define STACK_WINDOW_SAVE_AREA_SIZE (16*8) |
#define PSTATE_AM_BIT 8 |
.text |
.global halt |
94,6 → 98,24 |
mov %o1, %o0 |
jump_to_kernel: |
set ofw, %l0 |
set ofw_cif, %l0 |
jmp %o0 ! jump to kernel |
ldx [%l0], %o4 ! pass OpenFirmware address in %o4 |
.global ofw |
ofw: |
save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp |
set ofw_cif, %l0 |
ldx [%l0], %l0 |
rdpr %pstate, %l1 |
and %l1, ~PSTATE_AM_BIT, %l2 |
wrpr %l2, 0, %pstate |
jmpl %l0, %o7 |
mov %i0, %o0 |
wrpr %l1, 0, %pstate |
ret |
restore %o0, 0, %o0 |
/boot/trunk/arch/sparc64/loader/boot.S |
---|
28,6 → 28,8 |
#define INITIAL_STACK 0x0 |
#define PSTATE_IE_BIT 2 |
.register %g2, #scratch |
.register %g3, #scratch |
.register %g6, #scratch |
52,9 → 54,16 |
1: |
flushw |
/* |
* Disable interrupts. |
*/ |
rdpr %pstate, %g2 |
and %g2, ~PSTATE_IE_BIT, %g2 ! mask the Interrupt Enable bit |
wrpr %g2, 0, %pstate |
# TODO: set initial stack |
set ofw, %l0 |
set ofw_cif, %l0 |
call init ! initialize OpenFirmware |
stx %o4, [%l0] |
/boot/trunk/arch/sparc64/loader/main.c |
---|
51,12 → 51,6 |
for (i = 0; i < COMPONENTS; i++) |
printf(" %L: %s image (size %d bytes)\n", components[i].start, components[i].name, components[i].size); |
screen_t scr; |
ofw_screen(&scr); |
printf("\n%P: fb, %dx%dx%d\n", ofw_translate(scr.addr), scr.width, scr.height, scr.bpp); |
printf("\nCopying components\n"); |
unsigned int top = 0; |
bootinfo.cnt = 0; |
/boot/trunk/arch/sparc64/loader/ofw.c |
---|
39,3 → 39,8 |
ofw_write(&str[i], 1); |
} |
} |
int ofw_translate_failed(ofw_arg_t flag) |
{ |
return flag != -1; |
} |
/boot/trunk/arch/ppc32/loader/boot.S |
---|
33,8 → 33,8 |
.global start |
start: |
lis r4, ofw@ha |
addi r4, r4, ofw@l |
lis r4, ofw_cif@ha |
addi r4, r4, ofw_cif@l |
stw r5, 0(r4) |
bl init |
/boot/trunk/arch/ppc32/loader/main.c |
---|
156,5 → 156,5 |
fix_overlap(&bootinfo, &bootinfo_pa, "boot info", &top); |
printf("\nBooting the kernel...\n"); |
jump_to_kernel(bootinfo_pa, sizeof(bootinfo), trans_pa, pages << PAGE_WIDTH, real_mode_pa, bootinfo.screen.addr, bootinfo.screen.scanline); |
jump_to_kernel(bootinfo_pa, sizeof(bootinfo), trans_pa, pages << PAGE_WIDTH, real_mode_pa, (void *) bootinfo.screen.addr, bootinfo.screen.scanline); |
} |
/boot/trunk/arch/ppc32/loader/ofw.c |
---|
29,6 → 29,13 |
#include <ofw.h> |
#include <printf.h> |
typedef int (* ofw_entry_t)(ofw_args_t *args); |
int ofw(ofw_args_t *args) |
{ |
return ((ofw_entry_t) ofw_cif)(args); |
} |
void write(const char *str, const int len) |
{ |
ofw_write(str, len); |
48,8 → 55,13 |
pci_reg_t macio; |
if (ofw_get_property(device, "assigned-addresses", &macio, sizeof(macio)) <= 0) |
return false; |
keyboard->addr = (void *) macio.addr.addr_lo; |
keyboard->addr = macio.addr.addr_lo; |
keyboard->size = macio.size_lo; |
return true; |
} |
int ofw_translate_failed(ofw_arg_t flag) |
{ |
return 0; |
} |
/boot/trunk/arch/ppc64/loader/boot.S |
---|
33,8 → 33,8 |
.global start |
start: |
lis r4, ofw@ha |
addi r4, r4, ofw@l |
lis r4, ofw_cif@ha |
addi r4, r4, ofw_cif@l |
stw r5, 0(r4) |
bl init |
/boot/trunk/arch/ppc64/loader/ofw.c |
---|
29,6 → 29,13 |
#include <ofw.h> |
#include <printf.h> |
typedef int (* ofw_entry_t)(ofw_args_t *args); |
int ofw(ofw_args_t *args) |
{ |
return ((ofw_entry_t) ofw_cif)(args); |
} |
void write(const char *str, const int len) |
{ |
ofw_write(str, len); |
53,3 → 60,8 |
return true; |
} |
int ofw_translate_failed(ofw_arg_t flag) |
{ |
return 0; |
} |