15 addi %r1,%r1,16384 - 0x10
27 /* Store ofw call addr */
30 stw %r5,ofw_call_addr - _start@l(%r10)
32 lis %r4,_binary_freeldr_tmp_end@ha
33 addi %r4,%r4,_binary_freeldr_tmp_end@l
34 lis %r3,_binary_freeldr_tmp_start@ha
35 addi %r3,%r3,_binary_freeldr_tmp_start@l
45 addi %r3,%r3,freeldr_banner - _start
62 addi %r3,%r3,call_ofw - _start
67 * lifted from ppc/boot/openfirmware/misc.S
68 * Copyright (C) Paul Mackerras 1997.
70 * This program is free software; you can redistribute it and/or
71 * modify it under the terms of the GNU General Public License
72 * as published by the Free Software Foundation ; either version
73 * 2 of the License, or (at your option) any later version.
77 * Use the BAT2 & 3 registers to map the 1st 16MB of RAM to
78 * the address given as the 1st argument.
82 rlwinm 5,5,16,16,31 /* r3 = 1 for 601, 4 for 604 */
86 mtibatl 3,0 /* invalidate BAT first */
87 ori 3,3,4 /* set up BAT registers for 601 */
96 4: mtdbatu 3,0 /* invalidate BATs first */
98 ori 3,3,0xff /* set up BAT registers for 604 */
116 /* Get the address of the functions list --
118 * Because of little endian switch we must use an even number of
119 * instructions here.. Pad with a nop if needed. */
126 /* Note that this is little-endian from here on */
132 /* R3 has the function offset to call (n * 4)
133 * Other arg registers are unchanged.
134 * Note that these 4 instructions are in reverse order due to
135 * little-endian convention */
139 /* Now normal ordering resumes */
150 lwz %r3,ofw_functions - _start@l(%r9)
159 /* Goto the swapped function */
170 /* Ok, go back to little endian */
175 /* Note that this is little-endian from here on */
248 ofw_print_string_hook:
253 /* Reserve some stack space */
259 /* Save the lr, a scratch register */
264 /* Load the package name */
266 addi %r3,%r3,ofw_chosen_name - _start
271 /* Load up for getprop */
275 addi %r4,%r4,ofw_stdout_name - _start
283 /* Measure the string and remember the length */
291 /* Write the string */
302 /* Print 8 hex digits representing a number in r3 */
313 /* Set up and, devide, shift */
315 lis %r6,0xf0000000@ha
316 lis %r7,0x10000000@ha
322 beq ofw_number_return
325 /* Body: isolate digit, divide, print */
334 bge ofw_number_letter
336 b ofw_number_digit_out
339 addi %r4,%r4,'A' - 10
341 ofw_number_digit_out:
420 /* Construct ofw exit call */
478 /* Body, print the regname, then the register */
482 beq ofw_register_special
484 addi %r3,%r3,freeldr_reg_init - _start
523 ofw_register_special:
526 addi %r3,%r3,freeldr_reg_lr - _start
535 addi %r3,%r3,freeldr_reg_cr - _start
544 addi %r3,%r3,freeldr_reg_ctr - _start
553 addi %r3,%r3,freeldr_reg_msr - _start
592 /* Reserve stack space ...
593 * 20 bytes for the ofw call,
597 /* Store r8, r9, lr */
603 /* Get finddevice name */
605 addi %r9,%r8,ofw_finddevice_name - _start
608 /* 1 Argument and 1 return */
615 /* Load up the call address */
616 lwz %r9,ofw_call_addr - _start(%r8)
627 /* Restore registers */
639 /* Reserve stack space ...
640 * 20 bytes for the ofw call,
644 /* Store r8, r9, lr */
652 addi %r9,%r8,ofw_open_name - _start
655 /* 1 Argument and 1 return */
662 /* Load up the call address */
663 lwz %r9,ofw_call_addr - _start(%r8)
674 /* Restore registers */
686 /* Reserve stack space:
687 * 32 bytes for the ofw call
688 * 12 bytes for r8, r9, lr
690 /* Reserve stack space ...
691 * 20 bytes for the ofw call,
695 /* Store r8, r9, lr */
701 /* Get getprop name */
703 addi %r9,%r8,ofw_getprop_name - _start
706 /* 4 Argument and 1 return */
712 stw %r3,12(%r1) /* Package */
713 stw %r4,16(%r1) /* Property */
714 stw %r5,20(%r1) /* Return buffer */
715 stw %r6,24(%r1) /* Buffer size */
717 /* Load up the call address */
718 lwz %r9,ofw_call_addr - _start(%r8)
727 /* Workaround to a wierd crash ... not sure what causes it.
728 * XXX investigate me */
734 /* Restore registers */
746 /* Reserve stack space:
747 * 32 bytes for the ofw call
748 * 12 bytes for r8, r9, lr
750 /* Reserve stack space ...
751 * 20 bytes for the ofw call,
755 /* Store r8, r9, lr */
761 /* Get getprop name */
763 addi %r9,%r8,ofw_getprop_name - _start
766 /* 4 Argument and 1 return */
772 stw %r3,12(%r1) /* Package */
773 stw %r4,16(%r1) /* Property */
774 stw %r5,20(%r1) /* Return buffer */
775 stw %r6,24(%r1) /* Buffer size */
777 /* Load up the call address */
778 lwz %r9,ofw_call_addr - _start(%r8)
790 /* Restore registers */
803 /* Reserve stack space:
804 * 28 bytes for the ofw call
805 * 12 bytes for r8, r9, lr
807 /* Reserve stack space ...
808 * 20 bytes for the ofw call,
814 /* Store r8, r9, lr */
822 addi %r9,%r8,ofw_write_name - _start
825 /* 3 Arguments and 1 return */
835 /* Load up the call address */
836 lwz %r9,ofw_call_addr - _start(%r8)
848 /* Restore registers */
860 /* Reserve stack space:
861 * 28 bytes for the ofw call
862 * 12 bytes for r8, r9, lr
864 /* Reserve stack space ...
865 * 20 bytes for the ofw call,
871 /* Store r8, r9, lr */
879 addi %r9,%r8,ofw_read_name - _start
882 /* 3 Arguments and 1 return */
892 /* Load up the call address */
893 lwz %r9,ofw_call_addr - _start(%r8)
905 /* Restore registers */
918 addi %r3,%r3,freeldr_halt - _start
925 /* Load the exit name */
927 addi %r9,%r8,ofw_exit_name - _start
930 /* Zero args, zero returns */
935 /* Load up the call address */
936 lwz %r9,ofw_call_addr - _start(%r8)
943 /* No return from exit */
946 /* Reserve stack space ...
947 * 20 bytes for the ofw call,
951 /* Store r8, r9, lr */
959 addi %r9,%r8,ofw_child_name - _start
962 /* 1 Argument and 1 return */
969 /* Load up the call address */
970 lwz %r9,ofw_call_addr - _start(%r8)
981 /* Restore registers */
993 /* Reserve stack space ...
994 * 20 bytes for the ofw call,
998 /* Store r8, r9, lr */
1006 addi %r9,%r8,ofw_peer_name - _start
1009 /* 1 Argument and 1 return */
1016 /* Load up the call address */
1017 lwz %r9,ofw_call_addr - _start(%r8)
1028 /* Restore registers */
1040 /* Reserve stack space ...
1041 * 20 bytes for the ofw call,
1045 /* Store r8, r9, lr */
1053 addi %r9,%r8,ofw_seek_name - _start
1056 /* 3 Arguments and 1 return */
1066 /* Load up the call address */
1067 lwz %r9,ofw_call_addr - _start(%r8)
1078 /* Restore registers */
1103 addi %r12,%r12,0x300
1104 addi %r9,%r8,dsi_exc - _start
1105 addi %r10,%r8,dsi_end - _start
1127 andi. %r12,%r12,0xffbf
1164 .ascii "ReactOS OpenFirmware Boot Program\r\n\0"
1167 .ascii "ReactOS OpenFirmware Boot Program Halting\r\n\0"
1189 ofw_finddevice_name:
1190 .ascii "finddevice\0"
1223 .ascii "/memory@0\0"
1229 .long ofw_finddevice_hook
1230 .long ofw_getprop_hook
1234 .long ofw_print_regs
1235 .long ofw_print_string
1236 .long ofw_print_number