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
41 ; turn off unused serial ports
79 mov r10,r2 ;machine number passed from DRAMloader
81 mcr p15, 0, r0, c8, c7, 0x00 ;/* invalidate I+D TLB */
82 mrc p15, 0, r0, c2, c0, 0
86 ; they skipped this, unnecessary? seems like we need to do this
88 mcr p15, 0, r0, c7, c5, 0 ;/* invalidate i cache & BTB */
91 mcr p15, 0, r0, c13, c0, 0
92 mrc p15, 0, r0, c2, c0, 0
96 ; This is needed to get Linux 2.6 booting
98 mcr p15, 0, r0, c7, c10, 4 ; Drain write buffer
99 mcr p15, 0, r0, c7, c7, 0 ; invalidate I+D & BTB
101 mrc p15, 0, r0, c1, c0, 0
102 bic r0, r0, #5 ; MMU & Dcache off
103 bic r0, r0, #0x1000 ; Icache off
104 mcr p15, 0, r0, c1, c0, 0 ; disable the MMU & caches
105 mrc p15, 0, r0, c2, c0, 0
111 mcr p15, 0, r0, c13, c0, 0 ; clear PID
112 mcr p15, 0, r0, c8, c7, 0 ; invalidate I+D TLB
113 mrc p15, 0, r0, c2, c0, 0
117 ;Set parameters for kernel
123 ; Jump into the kernel:
128 ENDP ; |?do_it@@YAXXZ|, do_it