MPU(Memory Protection Units) 《ARM System Developer's Guide》Chapter-13

本文介绍了ARM处理器中的Memory Protection Unit (MPU),它提供了硬件级别的内存保护。MPU通过region进行内存分区,每个region具有不同的访问权限。初始化MPU涉及设置region的大小、位置、访问权限和缓存属性。ARM740T、ARM946E-S等处理器支持8个保护区域,而ARM940T支持16个。MPU允许region重叠,根据优先级决定访问属性。初始化MPU涉及多个CP15寄存器的操作,包括定义region、设置访问权限、启用缓存和MPU。
摘要由CSDN通过智能技术生成

一些嵌入式系统都具有多任务的能力,在这些系统上会涉及到多个任务对于系统资源的使用,对这些系统资源的保护,也就是本章的主题。

有两种方法控制对系统资源的访问。第一种是unprotected:这种系统依赖于软件层面对于资源的保护,没有专用的硬件监管内存和外设的使用。第二种是protected system:通过软件和硬件对系统资源进行保护,具有专用的硬件确认和限制对资源的访问。在这种系统中,任务行为需要符合运行环境定义的一系列规则也要接受硬件的制约,硬件层面给程序监控资源提供了特权。因此第二种方法比第一种方法具有更好的保护能力。

ARM提供了一系列具有硬件层面保护系统资源的处理器。分为2类,第一类是配备了MPU(memory protection units)的处理器, hardware protection over several software-designated regions.第二类是配备MMU的处理器,提供了硬件保护并且增加了虚拟内存的能力。

本章就是讲述MPU的处理器,下一章再讲解MMU。

本章内容如下
1. Protected Regions
2. Initializing the MPU, Caches , and Write buffer
3. Demonstration of an MPU System

在开始本章之前先大致讲解一下region是什么,才能进一步讲解MPU是如何在regions的基础上提供硬件保护能力的。

Region

A region is a set of attributes associated with an area of memory.The processor core holds these attributes in several CP15 registers and identifies each region by a number, which ranges between 0 and 7.

A region’s memory boundaries are configured using two attributes,

attributes
the starting address
its length which can be any power of two between 4 KB and 4 GB

the operation system assigns additional attributes to these regions

additional attributes
access rights The access to a region in memory is set as read-write, read-only, or no access and is subject to additional rights based on the current processor mode, which is either privileged or user.
the cache and write buffer policies which controls cache and write buffer attributes.

For example, one region can be set to access memory using a writethrough policy, while another operates as noncached and nonbuffered.

访问region过程:

When the processor accesses a region in main memory, the MPU compares the region’s access permission attributes with the current processor mode to determine what action it will take. If the request satisfies the region access criteria, the core is allowed to read or write to main memory. However, if the memory request results in a memory access violation, the MPU will generate an abort signal.
abort handler会决定abort类型是prefetch or data abort。

region生命周期

region可以被创建并且持续整个嵌入式系统的生命周期,又或者临时创建用来满足某一特殊的操作然后就移除。

如何安排和创建regions就是接下来一节的内容。

Protected Regions

当前的ARM产品中包含MPU的有如下几个:

the ARM740T, ARM940T, ARM946E-S, and the ARM1026EJ-S.
The ARM740T, ARM946E-S,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

猎羽

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值