NanoPayload

Change of stage2/cpu.c

111:ff38ea1d8e69
stage2/cpu.c stage2-non-pic
     1.1 --- a/stage2/cpu.c	Mon Feb 22 17:07:10 2016 +0100
     1.2 +++ b/stage2/cpu.c	Mon Feb 22 17:07:55 2016 +0100
     1.3 @@ -81,7 +81,6 @@
     1.4  {
     1.5  	asm volatile(
     1.6  		"mfc0 $t3, $12\n" /* CP0_STATUS */
     1.7 -		"nop\n"
     1.8  		"li $t4, 0xfffffffb\n" /* ERL = 0 */
     1.9  		"and $t3, $t3, $t4\n"
    1.10  		"mtc0 $t3, $12\n"
    1.11 @@ -92,7 +91,6 @@
    1.12  {
    1.13  	asm volatile(
    1.14  		"mfc0 $t3, $12\n" /* CP0_STATUS */
    1.15 -		"nop\n"
    1.16  		"li $t4, 0x0000fc01\n" /* IE = enable interrupts */
    1.17  		"or $t3, $t3, $t4\n"
    1.18  		"mtc0 $t3, $12\n"
    1.19 @@ -105,13 +103,10 @@
    1.20  
    1.21  	asm volatile(
    1.22  		"mtc0 $zero, $18\n"	/* CP0_WATCHLO */
    1.23 -		"nop\n"
    1.24  		"li $t3, 0x00800000\n"	/* IV = 1 (use 0x80000200 for interrupts) */
    1.25  		"mtc0 $t3, $13\n"	/* CP0_CAUSE */
    1.26 -		"nop\n"
    1.27 -		"mfc0 $t3, $12\n" 	/* CP0_STATUS */
    1.28 -		"nop\n"
    1.29 -		"li $t4, 0xffbfffff\n"	/* BEV=0 */
    1.30 +		"mfc0 $t4, $12\n" 	/* CP0_STATUS */
    1.31 +		"li $t3, 0xffbfffff\n"	/* BEV=0 */
    1.32  		"and $t3, $t3, $t4\n"
    1.33  		"mtc0 $t3, $12\n"
    1.34  		"nop\n");
    1.35 @@ -122,24 +117,19 @@
    1.36  	asm volatile(
    1.37  		"li $t0, 0x01ffe000\n"	/* 16MB */
    1.38  		"mtc0 $t0, $5\n"	/* CP0_PAGEMASK */
    1.39 -		"nop\n"
    1.40 -		"li $t0, 2\n"		/* index of first randomly-replaced entry */
    1.41 -		"mtc0 $t0, $6\n"	/* CP0_WIRED */
    1.42 -		"nop\n"
    1.43 +		"li $t1, 2\n"		/* index of first randomly-replaced entry */
    1.44 +		"mtc0 $t1, $6\n"	/* CP0_WIRED */
    1.45  
    1.46  		/* 0x80000000..0x82000000 -> 0x00000000..0x02000000 */
    1.47  
    1.48  		"mtc0 $zero, $0\n"	/* CP0_INDEX */
    1.49 -		"nop\n"
    1.50  
    1.51  		/* Set physical address. */
    1.52  
    1.53  		"li $t0, 0x0000001f\n"	/* 0x00000000, C=3, dirty, global, valid */
    1.54  		"mtc0 $t0, $2\n"	/* CP0_ENTRYLO0 */
    1.55 -		"nop\n"
    1.56 -		"li $t0, 0x0004001f\n"	/* 0x01000000, C=3, dirty, global, valid */
    1.57 -		"mtc0 $t0, $3\n"	/* CP0_ENTRYLO1 */
    1.58 -		"nop\n"
    1.59 +		"li $t1, 0x0004001f\n"	/* 0x01000000, C=3, dirty, global, valid */
    1.60 +		"mtc0 $t1, $3\n"	/* CP0_ENTRYLO1 */
    1.61  
    1.62  		/* Set virtual address. */
    1.63  
    1.64 @@ -160,10 +150,8 @@
    1.65  
    1.66  		"li $t0, 0x0000001f\n"	/* 0x00000000, C=3, dirty, global, valid */
    1.67  		"mtc0 $t0, $2\n"	/* CP0_ENTRYLO0 */
    1.68 -		"nop\n"
    1.69 -		"li $t0, 0x0004001f\n"	/* 0x01000000, C=3, dirty, global, valid */
    1.70 -		"mtc0 $t0, $3\n"	/* CP0_ENTRYLO1 */
    1.71 -		"nop\n"
    1.72 +		"li $t1, 0x0004001f\n"	/* 0x01000000, C=3, dirty, global, valid */
    1.73 +		"mtc0 $t1, $3\n"	/* CP0_ENTRYLO1 */
    1.74  
    1.75  		/* Set virtual address. */
    1.76