MOVW $1, R1
MCR CpSC, 0, R1, C(CpSPM), C(CpSPMperf), CpSPMctl
+ /* first arg to main is saved R2 */
+ MOVW R10, R0
+
/*
* call main and loop forever if it returns
*/
MOVW $1, R1
MCR CpSC, 0, R1, C(CpCLD), C(CpCLDena), CpCLDenapmnc
+ /* first arg to main is saved R2 */
+ MOVW R10, R0
+
/*
* call main and loop forever if it returns
*/
uintptr len;
/*
- * kernel gets DTB/ATAGS pointer in R0 on entry
+ * kernel gets DTB/ATAGS pointer on entry
*/
if(pa != 0 && (len = cankaddr(pa)) != 0){
void *va = KADDR(pa);
* other cpus enter at cpureset in armv7.s
*/
TEXT _start(SB), 1, $-4
+ /* save R2 in extern register R10 (Mach *m) */
+ MOVW R2, R10
+
/*
* load physical base for SB addressing while mmu is off
* keep a handy zero in R0 until first function call
}
void
-main(void)
+main(uintptr arg0)
{
extern char edata[], end[];
uint fw, board;
memset(edata, 0, end - edata); /* clear bss */
mach0init();
quotefmtinstall();
- bootargsinit(0);
+ bootargsinit(arg0);
confinit(); /* figures out amount of memory */
xinit();
uartconsinit();
BEQ dowfi /* if zero, wait again */
bootcpu:
+ MOVW $0, R2 /* no ATAGS/DTB pointer */
BIC $KSEGM, R8 /* entry to physical */
ORR $PHYSDRAM, R8
BL (R8)