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:
Andrew Boie 2020-03-11 06:56:58 -07:00 committed by Andrew Boie
commit 4bad34e749
12 changed files with 30 additions and 30 deletions

View file

@ -6,7 +6,7 @@ Kernel Objects
A kernel object can be one of three classes of data:
* 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()`
* A device driver instance (struct device) that belongs to one of a defined
set of subsystems

View file

@ -139,17 +139,17 @@ extern "C" {
#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)) \
sym[ARCH_THREAD_STACK_LEN(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)) \
sym[nmemb][Z_ARC_THREAD_STACK_ARRAY_LEN(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)) \
sym[ARCH_THREAD_STACK_LEN(size)]

View file

@ -198,11 +198,11 @@ extern "C" {
#if defined(CONFIG_USERSPACE) && \
defined(CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT)
#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)]
#else
#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]
#endif
@ -216,12 +216,12 @@ extern "C" {
#if defined(CONFIG_USERSPACE) && \
defined(CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT)
#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)) \
sym[nmemb][ARCH_THREAD_STACK_LEN(size)]
#else
#define ARCH_THREAD_STACK_ARRAY_DEFINE(sym, nmemb, size) \
struct _k_thread_stack_element __noinit \
struct z_thread_stack_element __noinit \
__aligned(STACK_ALIGN) \
sym[nmemb][ARCH_THREAD_STACK_LEN(size)]
#endif
@ -229,11 +229,11 @@ extern "C" {
#if defined(CONFIG_USERSPACE) && \
defined(CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT)
#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)]
#else
#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]
#endif

View file

@ -199,7 +199,7 @@ struct z_x86_thread_stack_header {
sizeof(struct z_x86_thread_stack_header)
#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) \
sym[ROUND_UP((size), Z_X86_STACK_SIZE_ALIGN) + \
ARCH_THREAD_STACK_RESERVED]
@ -211,12 +211,12 @@ struct z_x86_thread_stack_header {
ARCH_THREAD_STACK_RESERVED)
#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) \
sym[nmemb][ARCH_THREAD_STACK_LEN(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) + \
ARCH_THREAD_STACK_RESERVED]

View file

@ -174,7 +174,7 @@ union z_object_data {
/* Numerical thread ID for K_OBJ_THREAD */
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;
/* 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().
*/
struct __packed _k_thread_stack_element {
struct __packed z_thread_stack_element {
char data;
};
/**
* @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
*/
#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
@ -5185,7 +5185,7 @@ static inline char *Z_THREAD_STACK_BUFFER(k_thread_stack_t *sym)
* @req K-TSTACK-001
*/
#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)]
/**
@ -5202,7 +5202,7 @@ static inline char *Z_THREAD_STACK_BUFFER(k_thread_stack_t *sym)
* @req K-TSTACK-001
*/
#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

View file

@ -41,7 +41,7 @@ extern "C" {
struct k_thread;
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);

View file

@ -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));
stack_object = z_object_find(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,
"bad stack object"));

View file

@ -242,7 +242,7 @@ void *z_impl_k_object_alloc(enum k_objects otype)
* to request memory that is aligned
*/
__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");
dyn_obj = z_thread_malloc(sizeof(*dyn_obj) + obj_size_get(otype));

View file

@ -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)
{
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));
return z_impl_k_object_alloc(otype);

View file

@ -24,7 +24,7 @@ def subsystem_to_enum(subsys):
def kobject_to_enum(kobj):
if kobj.startswith("k_") or kobj.startswith("_k_"):
if kobj.startswith("k_") or kobj.startswith("z_"):
name = kobj[2:]
else:
name = kobj
@ -34,7 +34,7 @@ def kobject_to_enum(kobj):
DW_OP_addr = 0x3
DW_OP_fbreg = 0x91
STACK_TYPE = "_k_thread_stack_element"
STACK_TYPE = "z_thread_stack_element"
thread_counter = 0
sys_mutex_counter = 0
futex_counter = 0

View file

@ -85,7 +85,7 @@ kobjects = OrderedDict([
("k_stack", (None, False)),
("k_thread", (None, False)),
("k_timer", (None, False)),
("_k_thread_stack_element", (None, False)),
("z_thread_stack_element", (None, False)),
("device", (None, False)),
("sys_mutex", (None, True)),
("k_futex", (None, True))
@ -146,7 +146,7 @@ void z_object_wordlist_foreach(_wordlist_cb_func_t func, void *context)
metadata_names = {
"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_FUTEX" : "futex_data"
}
@ -312,7 +312,7 @@ def write_kobj_size_output(fp):
dep, _ = obj_info
# device handled by default case. Stacks are not currently handled,
# 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
if dep:

View file

@ -27,7 +27,7 @@ import struct
from elf_helper import ElfHelper
kobjects = {
"_k_thread_stack_element": (None, False)
"z_thread_stack_element": (None, False)
}