annotate src/entry-osx.S @ 94:d876c9a65239 default tip

impl mac os target
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Wed, 23 Oct 2019 14:31:38 +0900
parents 0bbeb1a284e2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
1 #include "arm.h"
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
2 #include "memlayout.h"
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
3
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
4 .text
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
5 .code 32
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
6
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
7 .global _start
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
8
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
9 _start:
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
10 # clear the entry bss section, the svc stack, and kernel page table
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
11 LDR r1, =edata_entry
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
12 LDR r2, =end_entry
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
13 MOV r3, #0x00
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
14
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
15 1:
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
16 CMP r1, r2
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
17 STMIALT r1!, {r3}
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
18 BLT 1b
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
19
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
20 # initialize stack pointers for svc modes
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
21 MSR CPSR_cxsf, #(SVC_MODE|NO_INT)
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
22 LDR sp, =svc_stktop
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
23
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
24 BL start
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
25 B .
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
26
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
27 # during startup, kernel stack uses user address, now switch it to kernel addr
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
28 .global jump_stack
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
29 jump_stack:
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
30 MOV r0, sp
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
31 ADD r0, r0, #KERNBASE
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
32 MOV sp, r0
0bbeb1a284e2 fix entry asmcode
tobaru
parents:
diff changeset
33 MOV pc, lr