Zephyr Project API
3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
arc_core_mpu.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 Synopsys.
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
#ifndef ZEPHYR_INCLUDE_ARCH_ARC_V2_MPU_ARC_CORE_MPU_H_
7
#define ZEPHYR_INCLUDE_ARCH_ARC_V2_MPU_ARC_CORE_MPU_H_
8
9
#ifdef __cplusplus
10
extern
"C"
{
11
#endif
12
13
/*
14
* The defines below represent the region types. The MPU driver is responsible
15
* to allocate the region accordingly to the type and set the correct
16
* attributes.
17
*
18
* Each MPU is different and has a different set of attributes, hence instead
19
* of having the attributes at this level the arc_mpu_core defines the intent
20
* types.
21
* An intent type (i.e. THREAD_STACK_GUARD) can correspond to a different set
22
* of operations and attributes for each MPU and it is responsibility of the
23
* MPU driver to select the correct ones.
24
*
25
* The intent based configuration can't fail hence at this level no error
26
* is returned by the configuration functions.
27
* If one of the operations corresponding to an intent fails the error has to
28
* be managed inside the MPU driver and not escalated.
29
*/
30
/* Thread Region Intent Type */
31
#define THREAD_STACK_USER_REGION 0x0
32
#define THREAD_STACK_REGION 0x1
33
#define THREAD_APP_DATA_REGION 0x2
34
#define THREAD_STACK_GUARD_REGION 0x3
35
#define THREAD_DOMAIN_PARTITION_REGION 0x4
36
37
#if defined(CONFIG_ARC_CORE_MPU)
38
/* ARC Core MPU Driver API */
39
40
/*
41
* This API has to be implemented by all the MPU drivers that have
42
* ARC_CORE_MPU support.
43
*/
44
48
void
arc_core_mpu_enable(
void
);
49
53
void
arc_core_mpu_disable(
void
);
54
60
void
arc_core_mpu_configure_thread(
struct
k_thread
*
thread
);
61
62
/*
63
* Before configure the MPU regions, MPU should be disabled
64
*/
70
void
arc_core_mpu_default(
uint32_t
region_attr);
71
80
int
arc_core_mpu_region(
uint32_t
index
,
uint32_t
base,
uint32_t
size,
81
uint32_t
region_attr);
82
83
#endif
/* CONFIG_ARC_CORE_MPU */
84
85
#if defined(CONFIG_USERSPACE)
86
void
arc_core_mpu_configure_mem_domain
(
struct
k_thread
*
thread
);
87
void
arc_core_mpu_remove_mem_domain
(
struct
k_mem_domain
*mem_domain);
88
void
arc_core_mpu_remove_mem_partition
(
struct
k_mem_domain
*domain,
89
uint32_t
partition_id);
90
int
arc_core_mpu_get_max_domain_partition_regions
(
void
);
91
int
arc_core_mpu_buffer_validate
(
const
void
*addr,
size_t
size,
int
write);
92
93
#endif
94
95
void
configure_mpu_thread
(
struct
k_thread
*
thread
);
96
97
#ifdef __cplusplus
98
}
99
#endif
100
101
#endif
/* ZEPHYR_INCLUDE_ARCH_ARC_V2_MPU_ARC_CORE_MPU_H_ */
arc_core_mpu_remove_mem_partition
void arc_core_mpu_remove_mem_partition(struct k_mem_domain *domain, uint32_t partition_id)
configure_mpu_thread
void configure_mpu_thread(struct k_thread *thread)
arc_core_mpu_configure_mem_domain
void arc_core_mpu_configure_mem_domain(struct k_thread *thread)
arc_core_mpu_remove_mem_domain
void arc_core_mpu_remove_mem_domain(struct k_mem_domain *mem_domain)
arc_core_mpu_buffer_validate
int arc_core_mpu_buffer_validate(const void *addr, size_t size, int write)
arc_core_mpu_get_max_domain_partition_regions
int arc_core_mpu_get_max_domain_partition_regions(void)
thread
static struct k_thread thread[2]
Definition
atomic.c:26
index
ZTEST_BMEM int index[(3)]
Definition
main.c:32
uint32_t
__UINT32_TYPE__ uint32_t
Definition
stdint.h:90
k_mem_domain
Memory Domain.
Definition
mem_domain.h:80
k_thread
Thread Structure.
Definition
thread.h:259
include
zephyr
arch
arc
v2
mpu
arc_core_mpu.h
Generated on Sun Sep 15 2024 17:01:29 for Zephyr Project API by
1.9.8