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