kernel: rename _k_thread_stack_element
Private data type, prefix with z_. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
f2734ab022
commit
4bad34e749
12 changed files with 30 additions and 30 deletions
|
@ -6,7 +6,7 @@ Kernel Objects
|
||||||
A kernel object can be one of three classes of data:
|
A kernel object can be one of three classes of data:
|
||||||
|
|
||||||
* A core kernel object, such as a semaphore, thread, pipe, etc.
|
* A core kernel object, such as a semaphore, thread, pipe, etc.
|
||||||
* A thread stack, which is an array of :c:type:`struct _k_thread_stack_element`
|
* A thread stack, which is an array of :c:type:`struct z_thread_stack_element`
|
||||||
and declared with :c:macro:`K_THREAD_STACK_DEFINE()`
|
and declared with :c:macro:`K_THREAD_STACK_DEFINE()`
|
||||||
* A device driver instance (struct device) that belongs to one of a defined
|
* A device driver instance (struct device) that belongs to one of a defined
|
||||||
set of subsystems
|
set of subsystems
|
||||||
|
|
|
@ -139,17 +139,17 @@ extern "C" {
|
||||||
|
|
||||||
|
|
||||||
#define ARCH_THREAD_STACK_DEFINE(sym, size) \
|
#define ARCH_THREAD_STACK_DEFINE(sym, size) \
|
||||||
struct _k_thread_stack_element __noinit \
|
struct z_thread_stack_element __noinit \
|
||||||
__aligned(Z_ARC_THREAD_STACK_ALIGN(size)) \
|
__aligned(Z_ARC_THREAD_STACK_ALIGN(size)) \
|
||||||
sym[ARCH_THREAD_STACK_LEN(size)]
|
sym[ARCH_THREAD_STACK_LEN(size)]
|
||||||
|
|
||||||
#define ARCH_THREAD_STACK_ARRAY_DEFINE(sym, nmemb, size) \
|
#define ARCH_THREAD_STACK_ARRAY_DEFINE(sym, nmemb, size) \
|
||||||
struct _k_thread_stack_element __noinit \
|
struct z_thread_stack_element __noinit \
|
||||||
__aligned(Z_ARC_THREAD_STACK_ALIGN(size)) \
|
__aligned(Z_ARC_THREAD_STACK_ALIGN(size)) \
|
||||||
sym[nmemb][Z_ARC_THREAD_STACK_ARRAY_LEN(size)]
|
sym[nmemb][Z_ARC_THREAD_STACK_ARRAY_LEN(size)]
|
||||||
|
|
||||||
#define ARCH_THREAD_STACK_MEMBER(sym, size) \
|
#define ARCH_THREAD_STACK_MEMBER(sym, size) \
|
||||||
struct _k_thread_stack_element \
|
struct z_thread_stack_element \
|
||||||
__aligned(Z_ARC_THREAD_STACK_ALIGN(size)) \
|
__aligned(Z_ARC_THREAD_STACK_ALIGN(size)) \
|
||||||
sym[ARCH_THREAD_STACK_LEN(size)]
|
sym[ARCH_THREAD_STACK_LEN(size)]
|
||||||
|
|
||||||
|
|
|
@ -198,11 +198,11 @@ extern "C" {
|
||||||
#if defined(CONFIG_USERSPACE) && \
|
#if defined(CONFIG_USERSPACE) && \
|
||||||
defined(CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT)
|
defined(CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT)
|
||||||
#define ARCH_THREAD_STACK_DEFINE(sym, size) \
|
#define ARCH_THREAD_STACK_DEFINE(sym, size) \
|
||||||
struct _k_thread_stack_element __noinit \
|
struct z_thread_stack_element __noinit \
|
||||||
__aligned(POW2_CEIL(size)) sym[POW2_CEIL(size)]
|
__aligned(POW2_CEIL(size)) sym[POW2_CEIL(size)]
|
||||||
#else
|
#else
|
||||||
#define ARCH_THREAD_STACK_DEFINE(sym, size) \
|
#define ARCH_THREAD_STACK_DEFINE(sym, size) \
|
||||||
struct _k_thread_stack_element __noinit __aligned(STACK_ALIGN) \
|
struct z_thread_stack_element __noinit __aligned(STACK_ALIGN) \
|
||||||
sym[size+MPU_GUARD_ALIGN_AND_SIZE]
|
sym[size+MPU_GUARD_ALIGN_AND_SIZE]
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -216,12 +216,12 @@ extern "C" {
|
||||||
#if defined(CONFIG_USERSPACE) && \
|
#if defined(CONFIG_USERSPACE) && \
|
||||||
defined(CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT)
|
defined(CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT)
|
||||||
#define ARCH_THREAD_STACK_ARRAY_DEFINE(sym, nmemb, size) \
|
#define ARCH_THREAD_STACK_ARRAY_DEFINE(sym, nmemb, size) \
|
||||||
struct _k_thread_stack_element __noinit \
|
struct z_thread_stack_element __noinit \
|
||||||
__aligned(POW2_CEIL(size)) \
|
__aligned(POW2_CEIL(size)) \
|
||||||
sym[nmemb][ARCH_THREAD_STACK_LEN(size)]
|
sym[nmemb][ARCH_THREAD_STACK_LEN(size)]
|
||||||
#else
|
#else
|
||||||
#define ARCH_THREAD_STACK_ARRAY_DEFINE(sym, nmemb, size) \
|
#define ARCH_THREAD_STACK_ARRAY_DEFINE(sym, nmemb, size) \
|
||||||
struct _k_thread_stack_element __noinit \
|
struct z_thread_stack_element __noinit \
|
||||||
__aligned(STACK_ALIGN) \
|
__aligned(STACK_ALIGN) \
|
||||||
sym[nmemb][ARCH_THREAD_STACK_LEN(size)]
|
sym[nmemb][ARCH_THREAD_STACK_LEN(size)]
|
||||||
#endif
|
#endif
|
||||||
|
@ -229,11 +229,11 @@ extern "C" {
|
||||||
#if defined(CONFIG_USERSPACE) && \
|
#if defined(CONFIG_USERSPACE) && \
|
||||||
defined(CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT)
|
defined(CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT)
|
||||||
#define ARCH_THREAD_STACK_MEMBER(sym, size) \
|
#define ARCH_THREAD_STACK_MEMBER(sym, size) \
|
||||||
struct _k_thread_stack_element __aligned(POW2_CEIL(size)) \
|
struct z_thread_stack_element __aligned(POW2_CEIL(size)) \
|
||||||
sym[POW2_CEIL(size)]
|
sym[POW2_CEIL(size)]
|
||||||
#else
|
#else
|
||||||
#define ARCH_THREAD_STACK_MEMBER(sym, size) \
|
#define ARCH_THREAD_STACK_MEMBER(sym, size) \
|
||||||
struct _k_thread_stack_element __aligned(STACK_ALIGN) \
|
struct z_thread_stack_element __aligned(STACK_ALIGN) \
|
||||||
sym[size+MPU_GUARD_ALIGN_AND_SIZE]
|
sym[size+MPU_GUARD_ALIGN_AND_SIZE]
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ struct z_x86_thread_stack_header {
|
||||||
sizeof(struct z_x86_thread_stack_header)
|
sizeof(struct z_x86_thread_stack_header)
|
||||||
|
|
||||||
#define ARCH_THREAD_STACK_DEFINE(sym, size) \
|
#define ARCH_THREAD_STACK_DEFINE(sym, size) \
|
||||||
struct _k_thread_stack_element __noinit \
|
struct z_thread_stack_element __noinit \
|
||||||
__aligned(Z_X86_STACK_BASE_ALIGN) \
|
__aligned(Z_X86_STACK_BASE_ALIGN) \
|
||||||
sym[ROUND_UP((size), Z_X86_STACK_SIZE_ALIGN) + \
|
sym[ROUND_UP((size), Z_X86_STACK_SIZE_ALIGN) + \
|
||||||
ARCH_THREAD_STACK_RESERVED]
|
ARCH_THREAD_STACK_RESERVED]
|
||||||
|
@ -211,12 +211,12 @@ struct z_x86_thread_stack_header {
|
||||||
ARCH_THREAD_STACK_RESERVED)
|
ARCH_THREAD_STACK_RESERVED)
|
||||||
|
|
||||||
#define ARCH_THREAD_STACK_ARRAY_DEFINE(sym, nmemb, size) \
|
#define ARCH_THREAD_STACK_ARRAY_DEFINE(sym, nmemb, size) \
|
||||||
struct _k_thread_stack_element __noinit \
|
struct z_thread_stack_element __noinit \
|
||||||
__aligned(Z_X86_STACK_BASE_ALIGN) \
|
__aligned(Z_X86_STACK_BASE_ALIGN) \
|
||||||
sym[nmemb][ARCH_THREAD_STACK_LEN(size)]
|
sym[nmemb][ARCH_THREAD_STACK_LEN(size)]
|
||||||
|
|
||||||
#define ARCH_THREAD_STACK_MEMBER(sym, size) \
|
#define ARCH_THREAD_STACK_MEMBER(sym, size) \
|
||||||
struct _k_thread_stack_element __aligned(Z_X86_STACK_BASE_ALIGN) \
|
struct z_thread_stack_element __aligned(Z_X86_STACK_BASE_ALIGN) \
|
||||||
sym[ROUND_UP((size), Z_X86_STACK_SIZE_ALIGN) + \
|
sym[ROUND_UP((size), Z_X86_STACK_SIZE_ALIGN) + \
|
||||||
ARCH_THREAD_STACK_RESERVED]
|
ARCH_THREAD_STACK_RESERVED]
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ union z_object_data {
|
||||||
/* Numerical thread ID for K_OBJ_THREAD */
|
/* Numerical thread ID for K_OBJ_THREAD */
|
||||||
unsigned int thread_id;
|
unsigned int thread_id;
|
||||||
|
|
||||||
/* Stack buffer size for K_OBJ__THREAD_STACK_ELEMENT */
|
/* Stack buffer size for K_OBJ_THREAD_STACK_ELEMENT */
|
||||||
size_t stack_size;
|
size_t stack_size;
|
||||||
|
|
||||||
/* Futex wait queue and spinlock for K_OBJ_FUTEX */
|
/* Futex wait queue and spinlock for K_OBJ_FUTEX */
|
||||||
|
@ -403,15 +403,15 @@ static inline void k_obj_free(void *obj)
|
||||||
*
|
*
|
||||||
* Stacks should always be created with K_THREAD_STACK_DEFINE().
|
* Stacks should always be created with K_THREAD_STACK_DEFINE().
|
||||||
*/
|
*/
|
||||||
struct __packed _k_thread_stack_element {
|
struct __packed z_thread_stack_element {
|
||||||
char data;
|
char data;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef k_thread_stack_t
|
* @typedef k_thread_stack_t
|
||||||
* @brief Typedef of struct _k_thread_stack_element
|
* @brief Typedef of struct z_thread_stack_element
|
||||||
*
|
*
|
||||||
* @see _k_thread_stack_element
|
* @see z_thread_stack_element
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5155,7 +5155,7 @@ static inline char *Z_THREAD_STACK_BUFFER(k_thread_stack_t *sym)
|
||||||
* @req K-TSTACK-001
|
* @req K-TSTACK-001
|
||||||
*/
|
*/
|
||||||
#define K_THREAD_STACK_DEFINE(sym, size) \
|
#define K_THREAD_STACK_DEFINE(sym, size) \
|
||||||
struct _k_thread_stack_element __noinit __aligned(STACK_ALIGN) sym[size]
|
struct z_thread_stack_element __noinit __aligned(STACK_ALIGN) sym[size]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Calculate size of stacks to be allocated in a stack array
|
* @brief Calculate size of stacks to be allocated in a stack array
|
||||||
|
@ -5185,7 +5185,7 @@ static inline char *Z_THREAD_STACK_BUFFER(k_thread_stack_t *sym)
|
||||||
* @req K-TSTACK-001
|
* @req K-TSTACK-001
|
||||||
*/
|
*/
|
||||||
#define K_THREAD_STACK_ARRAY_DEFINE(sym, nmemb, size) \
|
#define K_THREAD_STACK_ARRAY_DEFINE(sym, nmemb, size) \
|
||||||
struct _k_thread_stack_element __noinit \
|
struct z_thread_stack_element __noinit \
|
||||||
__aligned(STACK_ALIGN) sym[nmemb][K_THREAD_STACK_LEN(size)]
|
__aligned(STACK_ALIGN) sym[nmemb][K_THREAD_STACK_LEN(size)]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5202,7 +5202,7 @@ static inline char *Z_THREAD_STACK_BUFFER(k_thread_stack_t *sym)
|
||||||
* @req K-TSTACK-001
|
* @req K-TSTACK-001
|
||||||
*/
|
*/
|
||||||
#define K_THREAD_STACK_MEMBER(sym, size) \
|
#define K_THREAD_STACK_MEMBER(sym, size) \
|
||||||
struct _k_thread_stack_element __aligned(STACK_ALIGN) sym[size]
|
struct z_thread_stack_element __aligned(STACK_ALIGN) sym[size]
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return the size in bytes of a stack memory region
|
* @brief Return the size in bytes of a stack memory region
|
||||||
|
|
|
@ -41,7 +41,7 @@ extern "C" {
|
||||||
struct k_thread;
|
struct k_thread;
|
||||||
struct k_mem_domain;
|
struct k_mem_domain;
|
||||||
|
|
||||||
typedef struct _k_thread_stack_element k_thread_stack_t;
|
typedef struct z_thread_stack_element k_thread_stack_t;
|
||||||
|
|
||||||
typedef void (*k_thread_entry_t)(void *p1, void *p2, void *p3);
|
typedef void (*k_thread_entry_t)(void *p1, void *p2, void *p3);
|
||||||
|
|
||||||
|
|
|
@ -648,7 +648,7 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread,
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_NEVER_INIT(new_thread, K_OBJ_THREAD));
|
Z_OOPS(Z_SYSCALL_OBJ_NEVER_INIT(new_thread, K_OBJ_THREAD));
|
||||||
stack_object = z_object_find(stack);
|
stack_object = z_object_find(stack);
|
||||||
Z_OOPS(Z_SYSCALL_VERIFY_MSG(z_obj_validation_check(stack_object, stack,
|
Z_OOPS(Z_SYSCALL_VERIFY_MSG(z_obj_validation_check(stack_object, stack,
|
||||||
K_OBJ__THREAD_STACK_ELEMENT,
|
K_OBJ_THREAD_STACK_ELEMENT,
|
||||||
_OBJ_INIT_FALSE) == 0,
|
_OBJ_INIT_FALSE) == 0,
|
||||||
"bad stack object"));
|
"bad stack object"));
|
||||||
|
|
||||||
|
|
|
@ -242,7 +242,7 @@ void *z_impl_k_object_alloc(enum k_objects otype)
|
||||||
* to request memory that is aligned
|
* to request memory that is aligned
|
||||||
*/
|
*/
|
||||||
__ASSERT(otype > K_OBJ_ANY && otype < K_OBJ_LAST &&
|
__ASSERT(otype > K_OBJ_ANY && otype < K_OBJ_LAST &&
|
||||||
otype != K_OBJ__THREAD_STACK_ELEMENT,
|
otype != K_OBJ_THREAD_STACK_ELEMENT,
|
||||||
"bad object type requested");
|
"bad object type requested");
|
||||||
|
|
||||||
dyn_obj = z_thread_malloc(sizeof(*dyn_obj) + obj_size_get(otype));
|
dyn_obj = z_thread_malloc(sizeof(*dyn_obj) + obj_size_get(otype));
|
||||||
|
|
|
@ -63,7 +63,7 @@ static inline void z_vrfy_k_object_release(void *object)
|
||||||
static inline void *z_vrfy_k_object_alloc(enum k_objects otype)
|
static inline void *z_vrfy_k_object_alloc(enum k_objects otype)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_VERIFY_MSG(otype > K_OBJ_ANY && otype < K_OBJ_LAST &&
|
Z_OOPS(Z_SYSCALL_VERIFY_MSG(otype > K_OBJ_ANY && otype < K_OBJ_LAST &&
|
||||||
otype != K_OBJ__THREAD_STACK_ELEMENT,
|
otype != K_OBJ_THREAD_STACK_ELEMENT,
|
||||||
"bad object type %d requested", otype));
|
"bad object type %d requested", otype));
|
||||||
|
|
||||||
return z_impl_k_object_alloc(otype);
|
return z_impl_k_object_alloc(otype);
|
||||||
|
|
|
@ -24,7 +24,7 @@ def subsystem_to_enum(subsys):
|
||||||
|
|
||||||
|
|
||||||
def kobject_to_enum(kobj):
|
def kobject_to_enum(kobj):
|
||||||
if kobj.startswith("k_") or kobj.startswith("_k_"):
|
if kobj.startswith("k_") or kobj.startswith("z_"):
|
||||||
name = kobj[2:]
|
name = kobj[2:]
|
||||||
else:
|
else:
|
||||||
name = kobj
|
name = kobj
|
||||||
|
@ -34,7 +34,7 @@ def kobject_to_enum(kobj):
|
||||||
|
|
||||||
DW_OP_addr = 0x3
|
DW_OP_addr = 0x3
|
||||||
DW_OP_fbreg = 0x91
|
DW_OP_fbreg = 0x91
|
||||||
STACK_TYPE = "_k_thread_stack_element"
|
STACK_TYPE = "z_thread_stack_element"
|
||||||
thread_counter = 0
|
thread_counter = 0
|
||||||
sys_mutex_counter = 0
|
sys_mutex_counter = 0
|
||||||
futex_counter = 0
|
futex_counter = 0
|
||||||
|
|
|
@ -85,7 +85,7 @@ kobjects = OrderedDict([
|
||||||
("k_stack", (None, False)),
|
("k_stack", (None, False)),
|
||||||
("k_thread", (None, False)),
|
("k_thread", (None, False)),
|
||||||
("k_timer", (None, False)),
|
("k_timer", (None, False)),
|
||||||
("_k_thread_stack_element", (None, False)),
|
("z_thread_stack_element", (None, False)),
|
||||||
("device", (None, False)),
|
("device", (None, False)),
|
||||||
("sys_mutex", (None, True)),
|
("sys_mutex", (None, True)),
|
||||||
("k_futex", (None, True))
|
("k_futex", (None, True))
|
||||||
|
@ -146,7 +146,7 @@ void z_object_wordlist_foreach(_wordlist_cb_func_t func, void *context)
|
||||||
|
|
||||||
metadata_names = {
|
metadata_names = {
|
||||||
"K_OBJ_THREAD" : "thread_id",
|
"K_OBJ_THREAD" : "thread_id",
|
||||||
"K_OBJ__THREAD_STACK_ELEMENT" : "stack_size",
|
"K_OBJ_THREAD_STACK_ELEMENT" : "stack_size",
|
||||||
"K_OBJ_SYS_MUTEX" : "mutex",
|
"K_OBJ_SYS_MUTEX" : "mutex",
|
||||||
"K_OBJ_FUTEX" : "futex_data"
|
"K_OBJ_FUTEX" : "futex_data"
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,7 @@ def write_kobj_size_output(fp):
|
||||||
dep, _ = obj_info
|
dep, _ = obj_info
|
||||||
# device handled by default case. Stacks are not currently handled,
|
# device handled by default case. Stacks are not currently handled,
|
||||||
# if they eventually are it will be a special case.
|
# if they eventually are it will be a special case.
|
||||||
if kobj in {"device", "_k_thread_stack_element"}:
|
if kobj in {"device", "z_thread_stack_element"}:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if dep:
|
if dep:
|
||||||
|
|
|
@ -27,7 +27,7 @@ import struct
|
||||||
from elf_helper import ElfHelper
|
from elf_helper import ElfHelper
|
||||||
|
|
||||||
kobjects = {
|
kobjects = {
|
||||||
"_k_thread_stack_element": (None, False)
|
"z_thread_stack_element": (None, False)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue