Mistake on this page?
Report an issue in GitHub or email us
mpu_test.h
1 /* mbed Microcontroller Library
2  * Copyright (c) 2018-2018 ARM Limited
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 /** \addtogroup hal_mpu_tests
19  * @{
20  */
21 
22 #ifndef MBED_MPU_TEST_H
23 #define MBED_MPU_TEST_H
24 
25 #if DEVICE_MPU
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 /** Test that ::mbed_mpu_init can be called multiple times.
32  *
33  * Given board provides MPU.
34  * When ::mbed_mpu_init is called multiple times.
35  * Then ::mbed_mpu_init are successfully performed (no exception is generated).
36  *
37  */
38 void mpu_init_test(void);
39 
40 /** Test that ::mbed_mpu_free disables the MPU
41  *
42  * Given board provides MPU.
43  * When ::mbed_mpu_free is called.
44  * Then execution from RAM is allowed.
45  *
46  */
47 void mpu_free_test(void);
48 
49 /** Test that MPU protection works for global data
50  *
51  * Given board provides MPU.
52  * When RAM execution is disabled with a call to ::mbed_mpu_enable_ram_xn.
53  * Then execution from global initialized data results in a fault.
54  *
55  */
56 void mpu_fault_test_data(void);
57 
58 /** Test that MPU protection works for zero initialized data
59  *
60  * Given board provides MPU.
61  * When RAM execution is disabled with a call to ::mbed_mpu_enable_ram_xn.
62  * Then execution from global uninitialized data results in a fault.
63  *
64  */
65 void mpu_fault_test_bss(void);
66 
67 /** Test that MPU protection works for the stack
68  *
69  * Given board provides MPU.
70  * When RAM execution is disabled with a call to ::mbed_mpu_enable_ram_xn.
71  * Then execution from stack memory results in a fault.
72  *
73  */
74 void mpu_fault_test_stack(void);
75 
76 /** Test that MPU protection works for the heap
77  *
78  * Given board provides MPU.
79  * When RAM execution is disabled with a call to ::mbed_mpu_enable_ram_xn.
80  * Then execution from heap memory results in a fault.
81  *
82  */
83 void mpu_fault_test_heap(void);
84 
85 /**@}*/
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif
92 
93 #endif
94 
95 /** @}*/
void mpu_fault_test_heap(void)
Test that MPU protection works for the heap.
void mpu_init_test(void)
Test that mbed_mpu_init can be called multiple times.
void mpu_fault_test_stack(void)
Test that MPU protection works for the stack.
void mpu_fault_test_data(void)
Test that MPU protection works for global data.
void mpu_free_test(void)
Test that mbed_mpu_free disables the MPU.
void mpu_fault_test_bss(void)
Test that MPU protection works for zero initialized data.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.