Skip to content

Commit 5930e9d

Browse files
Andy Grossgalak
Andy Gross
authored andcommitted
arm: mpu: Adjust to use opaque kernel data types
This patch adjusts the ARM MPU implementation to be compliant to the recent changes that introduced the opaque kernel data types. Signed-off-by: Andy Gross <[email protected]>
1 parent 6962ae8 commit 5930e9d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

arch/arm/core/thread.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ void _new_thread(struct k_thread *thread, k_thread_stack_t stack,
6464

6565
char *stackEnd = pStackMem + stackSize;
6666
struct __esf *pInitCtx;
67-
_new_thread_init(thread, K_THREAD_STACK_BUFFER(pStackMem), stackSize,
68-
priority, options);
67+
_new_thread_init(thread, pStackMem, stackSize, priority, options);
6968

7069
/* carve the thread entry struct from the "base" of the stack */
7170

include/arch/arm/arch.h

+7-4
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ extern "C" {
6969
* @param size Size of the stack memory region
7070
*/
7171
#define _ARCH_THREAD_STACK_DEFINE(sym, size) \
72-
char __noinit __aligned(STACK_ALIGN) sym[size+STACK_ALIGN]
72+
struct _k_thread_stack_element __noinit __aligned(STACK_ALIGN) \
73+
sym[size+STACK_ALIGN]
7374

7475
/**
7576
* @brief Declare a toplevel array of thread stack memory regions
@@ -85,7 +86,8 @@ extern "C" {
8586
* @param size Size of the stack memory region
8687
*/
8788
#define _ARCH_THREAD_STACK_ARRAY_DEFINE(sym, nmemb, size) \
88-
char __noinit __aligned(STACK_ALIGN) sym[nmemb][size+STACK_ALIGN]
89+
struct _k_thread_stack_element __noinit __aligned(STACK_ALIGN) \
90+
sym[nmemb][size+STACK_ALIGN]
8991

9092
/**
9193
* @brief Declare an embedded stack memory region
@@ -100,7 +102,8 @@ extern "C" {
100102
* @param size Size of the stack memory region
101103
*/
102104
#define _ARCH_THREAD_STACK_MEMBER(sym, size) \
103-
char __aligned(STACK_ALIGN) sym[size+STACK_ALIGN]
105+
struct _k_thread_stack_element __aligned(STACK_ALIGN) \
106+
sym[size+STACK_ALIGN]
104107

105108
/**
106109
* @brief Return the size in bytes of a stack memory region
@@ -128,7 +131,7 @@ extern "C" {
128131
* @param sym Declared stack symbol name
129132
* @return The buffer itself, a char *
130133
*/
131-
#define _ARCH_THREAD_STACK_BUFFER(sym) (sym + STACK_ALIGN)
134+
#define _ARCH_THREAD_STACK_BUFFER(sym) ((char *)(sym + STACK_ALIGN))
132135

133136
#ifdef __cplusplus
134137
}

0 commit comments

Comments
 (0)