📄 mmu.s
字号:
#/*************************************************************************/
#/* */
#/* FILE NAME VERSION */
#/* */
#/* mmu.s PLUS/MPC860/D 1.3 */
#/* */
#/* COMPONENT */
#/* */
#/* MMU Initialization */
#/* */
#/* DESCRIPTION */
#/* */
#/* This file contains support functions for setting MMU registers. */
#/* */
#/* AUTHOR */
#/* */
#/* Barry Sellew, Accelerated Technology, Inc. */
#/* */
#/* DATA STRUCTURES */
#/* */
#/* None */
#/* */
#/* FUNCTIONS */
#/* Set_MI_AP */
#/* Set_MD_AP */
#/* Set_MI_CTR */
#/* Set_MD_CTR */
#/* Set_I_TLB */
#/* Set_D_TLB */
#/* Enable_MMU */
#/* */
#/* DEPENDENCIES */
#/* */
#/* None */
#/* */
#/* HISTORY */
#/* */
#/* NAME DATE REMARKS */
#/* */
#/* B. Sellew 06-16-1997 Created and verified ver. 1.1 */
#/* B. Sellew 09-10-1997 Created and verified ver. 1.2 */
#/* B. Sellew 02-02-1998 Created and verified ver. 1.3 */
#/* */
#/*************************************************************************/
.file "mmu.s"
#/************************************************************************/
#/* */
#/* Set_MI_AP */
#/* */
#/* Writes the first argument to the MI_AP register */
#/* */
#/************************************************************************/
.text
.align 2
.globl Set_MI_AP
Set_MI_AP:
mtspr MI_AP,r3
blr
#/************************************************************************/
#/* */
#/* Set_MD_AP */
#/* */
#/* Writes the first argument to the MD_AP register */
#/* */
#/************************************************************************/
.text
.align 2
.globl Set_MD_AP
Set_MD_AP:
mtspr MD_AP,r3
blr
#/************************************************************************/
#/* */
#/* Set_MI_CTR */
#/* */
#/* Writes the first argument to the MI_CTR register */
#/* */
#/************************************************************************/
.text
.align 2
.globl Set_MI_CTR
Set_MI_CTR:
mtspr MI_CTR,r3
blr
#/************************************************************************/
#/* */
#/* Set_MD_CTR */
#/* */
#/* Writes the first argument to the MD_CTR register */
#/* */
#/************************************************************************/
.text
.align 2
.globl Set_MD_CTR
Set_MD_CTR:
mtspr MD_CTR,r3
blr
#/************************************************************************/
#/* */
#/* Enable_MMU */
#/* */
#/* Sets the IR and DR bits of the MSR, enabling the instruction MMU */
#/* and data MMU. */
#/* */
#/************************************************************************/
.text
.align 2
.globl Enable_MMU
Enable_MMU:
mfmsr r3
ori r3,r3,0x0030
mtmsr r3
isync
sync
blr
#/************************************************************************/
#/* */
#/* Set_I_TLB */
#/* */
#/* Sets an instruction TLB entry to the address and attributes */
#/* specified by the parameters. */
#/* */
#/************************************************************************/
.text
.align 2
.globl Set_I_TLB
Set_I_TLB:
mfspr r7,MI_CTR
rlwinm r7,r7,0,24,18
slwi r6,r6,8
or r7,r7,r6
mtspr MI_CTR,r7
mtspr MI_EPN,r3
mtspr MI_TWC,r4
mtspr MI_RPN,r5
blr
#/************************************************************************/
#/* */
#/* Set_D_TLB */
#/* */
#/* Sets a data TLB entry to the address and attributes specified by */
#/* the parameters. */
#/* */
#/************************************************************************/
.text
.align 2
.globl Set_D_TLB
Set_D_TLB:
mfspr r7,MD_CTR
rlwinm r7,r7,0,24,18
slwi r6,r6,8
or r7,r7,r6
mtspr MD_CTR,r7
mtspr MD_EPN,r3
mtspr MD_TWC,r4
mtspr MD_RPN,r5
blr
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -