1 TTL C:\pocket\test\asm.cpp
3 AREA |.drectve|, DRECTVE
4 DCB "-defaultlib:coredll.lib "
5 DCB "-defaultlib:corelibc.lib "
7 EXPORT |?do_it@@YAXXZ| ; do_it
9 |$T222| DCD |?do_it@@YAXXZ|
12 |?do_it@@YAXXZ| PROC ; do_it
16 mcr p15, 0, r0, c7, c5, 0 ;/* invalidate i cache & BTB */
17 mrc p15, 0, r0, c2, c0, 0
22 ; turn off LCD controller...
23 ; I couldn't figure out how to use armasm.exe conditional with variables
36 ; turn off unused serial ports
74 mov r10,r2 ;machine number passed from DRAMloader
76 mcr p15, 0, r0, c8, c7, 0x00 ;/* invalidate I+D TLB */
77 mrc p15, 0, r0, c2, c0, 0
81 ; they skipped this, unnecessary? seems like we need to do this
83 mcr p15, 0, r0, c7, c5, 0 ;/* invalidate i cache & BTB */
86 mcr p15, 0, r0, c13, c0, 0
87 mrc p15, 0, r0, c2, c0, 0
91 ; This is needed to get Linux 2.6 booting
93 mcr p15, 0, r0, c7, c10, 4 ; Drain write buffer
94 mcr p15, 0, r0, c7, c7, 0 ; invalidate I+D & BTB
96 mrc p15, 0, r0, c1, c0, 0
97 bic r0, r0, #5 ; MMU & Dcache off
98 bic r0, r0, #0x1000 ; Icache off
99 mcr p15, 0, r0, c1, c0, 0 ; disable the MMU & caches
100 mrc p15, 0, r0, c2, c0, 0
106 mcr p15, 0, r0, c13, c0, 0 ; clear PID
107 mcr p15, 0, r0, c8, c7, 0 ; invalidate I+D TLB
108 mrc p15, 0, r0, c2, c0, 0
112 ;Set parameters for kernel
118 ; Jump into the kernel:
123 ENDP ; |?do_it@@YAXXZ|, do_it