- 论坛徽章:
- 0
|
最近在看head.S 基于 http://bbs.chinaunix.net/thread-2039668-1-1.html ,问题真不少。。。
00167: mcr p15, 0, r4, c2, c0, 0 @ load page table pointer
00168: b __turn_mmu_on
00169:
00170: /*
00171: * Enable the MMU. This completely changes the structure of the visible
00172: * memory space. You will not be able to trace execution through this.
00173: * If you have an enquiry about this, *please* check the linux-arm-kernel
00174: * mailing list archives BEFORE sending another post to the list.
00175: *
00176: * r0 = cp#15 control register
00177: * r13 = *virtual* address to jump to upon completion
00178: *
00179: * other registers depend on the function called upon completion
00180: */
00181: .align 5
00182: .type __turn_mmu_on, %function
00183: __turn_mmu_on:
00184: mov r0, r0
00185: mcr p15, 0, r0, c1, c0, 0 @ write control reg
00186: mrc p15, 0, r3, c0, c0, 0 @ read id reg
00187: mov r3, r3
00188: mov r3, r3
00189: mov pc, r13
有关00181: .align 5
作者解释“是我们要把打开mmu的操作放到一个单独的cache line上. 而在之前的"启动条件"一节我们说了,I Cache是可以打开也可以关闭的,这里这么做的原因是要保证在I Cache打开的时候,打开mmu的操作也能正常执行.”
我的问题是, 即使不在一个cache line,又会有什么问题呢?
另外,对于 00186: mrc p15, 0, r3, c0, c0, 0 @ read id reg 这行也不理解,如果为了凑等待ttb set的周期,后面nop2个周期应该就够了,不理解在这里是为啥? |
|