]> git.zerfleddert.de Git - linexec-j720/blob - asm/asmstuff.asm
e737febe875176a94f2dbb55bf52f91fe1454219
[linexec-j720] / asm / asmstuff.asm
1 TTL C:\pocket\asmstuff\asmstuff.cpp
2
3 AREA |.drectve|, DRECTVE
4 DCB "-defaultlib:coredll.lib "
5 DCB "-defaultlib:corelibc.lib "
6
7 EXPORT |?read_mmu@@YAHXZ| ; read_mmu
8 AREA |.pdata|, PDATA
9 |$T231| DCD |?read_mmu@@YAHXZ|
10 DCD 0x40000200
11 AREA |.text|, CODE
12 |?read_mmu@@YAHXZ| PROC ; read_mmu
13 |$M229|
14
15 mrc p15, 0, r0, c2, c0, 0
16 mov pc, lr
17
18 |$M230|
19 ENDP ; |?read_mmu@@YAHXZ|, read_mmu
20
21 EXPORT |?IntOff@@YAXXZ| ; IntOff
22 AREA |.pdata|, PDATA
23 |$T235| DCD |?IntOff@@YAXXZ|
24 DCD 0x40000100
25 AREA |.text|, CODE
26 |?IntOff@@YAXXZ| PROC ; IntOff
27 |$M233|
28
29 mrs r4,cpsr
30 orr r1,r4,#0xef
31 msr cpsr_c,r1
32 mov pc, lr
33
34 |$M234|
35 ENDP ; |?IntOff@@YAXXZ|, IntOff
36
37
38 EXPORT |?DRAMloader@@YAXII@Z| ; DRAMloader
39 AREA |.pdata|, PDATA
40 |$T239| DCD |?DRAMloader@@YAXII@Z|
41 DCD 0x40001004
42 AREA |.text|, CODE
43 |?DRAMloader@@YAXII@Z| PROC ; DRAMloader
44
45 mov r12, sp
46 stmdb sp!, {r0, r1} ; stmfd
47 stmdb sp!, {r12, lr} ; stmfd
48 sub sp, sp, #8
49
50 |$M237|
51
52 ldr r3, [sp, #0x10] ; 0x10 = 16
53 str r3, [sp]
54 ldr r2, [sp, #0x14] ; 0x14 = 20
55 str r2, [sp, #4]
56
57 ldr r1, [sp] ; jump address
58 ldr r2, [sp, #4] ; machine number
59
60 ldr r0, =0x3fff
61 mcr p15, 0, r0, c7, c10, 4 ;Enable access
62 mrc p15, 0, r0, c2, c0, 0
63 mov r0, r0
64
65 mrc p15, 0, r3, c1, c0, 0 ;/* disable the MMU */
66 and r3, r3, #0xfffffffe ; xscale says p needs to be 0 ???
67 mov r3, #0x120
68 mcr p15, 0, r3, c1, c0, 0 ;/* disable the MMU */
69 mrc p15, 0, r0, c2, c0, 0
70 mov r0, r0
71
72 ; Jump into do_it and the kernel
73 mov pc,r1 ; machine number is in register r2
74
75 |$M238|
76 ENDP ; |?DRAMloader@@YAXII@Z|, DRAMloader
77 END
78
Impressum, Datenschutz