diff --git a/arch/arc/include/swap_macros.h b/arch/arc/include/swap_macros.h index 16dd27e3867..23fc2018ce3 100644 --- a/arch/arc/include/swap_macros.h +++ b/arch/arc/include/swap_macros.h @@ -76,13 +76,13 @@ extern "C" { #endif - /* save stack pointer in struct tcs */ + /* save stack pointer in struct k_thread */ st sp, [r2, _thread_offset_to_sp] .endm /* entering this macro, current is in r2 */ .macro _load_callee_saved_regs - /* restore stack pointer from struct tcs */ + /* restore stack pointer from struct k_thread */ ld sp, [r2, _thread_offset_to_sp] #ifdef CONFIG_FP_SHARING diff --git a/arch/nios2/core/offsets/offsets.c b/arch/nios2/core/offsets/offsets.c index faf3211cc4b..ea62f498786 100644 --- a/arch/nios2/core/offsets/offsets.c +++ b/arch/nios2/core/offsets/offsets.c @@ -63,7 +63,10 @@ GEN_OFFSET_SYM(NANO_ESF, estatus); GEN_OFFSET_SYM(NANO_ESF, instr); GEN_ABSOLUTE_SYM(__NANO_ESF_SIZEOF, sizeof(NANO_ESF)); -/* size of the struct tcs structure sans save area for floating point regs */ +/* + * size of the struct k_thread structure sans save area for floating + * point regs + */ GEN_ABSOLUTE_SYM(_K_THREAD_NO_FLOAT_SIZEOF, sizeof(struct k_thread)); GEN_ABS_SYM_END diff --git a/arch/riscv32/core/offsets/offsets.c b/arch/riscv32/core/offsets/offsets.c index 2ad84a8b5d8..eb6ba821cd2 100644 --- a/arch/riscv32/core/offsets/offsets.c +++ b/arch/riscv32/core/offsets/offsets.c @@ -75,7 +75,10 @@ GEN_OFFSET_SYM(NANO_ESF, lpcount1); */ GEN_ABSOLUTE_SYM(__NANO_ESF_SIZEOF, STACK_ROUND_UP(sizeof(NANO_ESF))); -/* size of the struct tcs structure sans save area for floating point regs */ +/* + * size of the struct k_thread structure sans save area for floating + * point regs + */ GEN_ABSOLUTE_SYM(_K_THREAD_NO_FLOAT_SIZEOF, STACK_ROUND_UP(sizeof(struct k_thread))); diff --git a/arch/x86/core/float.c b/arch/x86/core/float.c index 317c40ec04e..34c8f9cac7b 100644 --- a/arch/x86/core/float.c +++ b/arch/x86/core/float.c @@ -57,15 +57,15 @@ extern u32_t _sse_mxcsr_default_value; * specified thread control block. The SSE registers are saved only if the * thread is actually using them. */ -static void _FpCtxSave(struct tcs *tcs) +static void _FpCtxSave(struct k_thread *thread) { #ifdef CONFIG_SSE - if (tcs->base.user_options & K_SSE_REGS) { - _do_fp_and_sse_regs_save(&tcs->arch.preempFloatReg); + if (thread->base.user_options & K_SSE_REGS) { + _do_fp_and_sse_regs_save(&thread->arch.preempFloatReg); return; } #endif - _do_fp_regs_save(&tcs->arch.preempFloatReg); + _do_fp_regs_save(&thread->arch.preempFloatReg); } /* @@ -74,11 +74,11 @@ static void _FpCtxSave(struct tcs *tcs) * This routine initializes the system's "live" floating point context. * The SSE registers are initialized only if the thread is actually using them. */ -static inline void _FpCtxInit(struct tcs *tcs) +static inline void _FpCtxInit(struct k_thread *thread) { _do_fp_regs_init(); #ifdef CONFIG_SSE - if (tcs->base.user_options & K_SSE_REGS) { + if (thread->base.user_options & K_SSE_REGS) { _do_sse_regs_init(); } #endif @@ -93,10 +93,10 @@ static inline void _FpCtxInit(struct tcs *tcs) * The locking isn't really needed when the routine is called by a cooperative * thread (since context switching can't occur), but it is harmless. */ -void k_float_enable(struct tcs *tcs, unsigned int options) +void k_float_enable(struct k_thread *thread, unsigned int options) { unsigned int imask; - struct tcs *fp_owner; + struct k_thread *fp_owner; /* Ensure a preemptive context switch does not occur */ @@ -104,7 +104,7 @@ void k_float_enable(struct tcs *tcs, unsigned int options) /* Indicate thread requires floating point context saving */ - tcs->base.user_options |= (u8_t)options; + thread->base.user_options |= (u8_t)options; /* * The current thread might not allow FP instructions, so clear CR0[TS] @@ -129,11 +129,11 @@ void k_float_enable(struct tcs *tcs, unsigned int options) /* Now create a virgin FP context */ - _FpCtxInit(tcs); + _FpCtxInit(thread); /* Associate the new FP context with the specified thread */ - if (tcs == _current) { + if (thread == _current) { /* * When enabling FP support for the current thread, just claim * ownership of the FPU and leave CR0[TS] unset. @@ -141,7 +141,7 @@ void k_float_enable(struct tcs *tcs, unsigned int options) * (The FP context is "live" in hardware, not saved in TCS.) */ - _kernel.current_fp = tcs; + _kernel.current_fp = thread; } else { /* * When enabling FP support for someone else, assign ownership @@ -156,7 +156,7 @@ void k_float_enable(struct tcs *tcs, unsigned int options) * to its original state. */ - _kernel.current_fp = tcs; + _kernel.current_fp = thread; _FpAccessDisable(); } else { /* @@ -176,7 +176,7 @@ void k_float_enable(struct tcs *tcs, unsigned int options) * handling an interrupt or exception.) */ - _FpCtxSave(tcs); + _FpCtxSave(thread); } } @@ -192,7 +192,7 @@ void k_float_enable(struct tcs *tcs, unsigned int options) * The locking isn't really needed when the routine is called by a cooperative * thread (since context switching can't occur), but it is harmless. */ -void k_float_disable(struct tcs *tcs) +void k_float_disable(struct k_thread *thread) { unsigned int imask; @@ -202,14 +202,14 @@ void k_float_disable(struct tcs *tcs) /* Disable all floating point capabilities for the thread */ - tcs->base.user_options &= ~_FP_USER_MASK; + thread->base.user_options &= ~_FP_USER_MASK; - if (tcs == _current) { + if (thread == _current) { _FpAccessDisable(); - _kernel.current_fp = (struct tcs *)0; + _kernel.current_fp = (struct k_thread *)0; } else { - if (_kernel.current_fp == tcs) - _kernel.current_fp = (struct tcs *)0; + if (_kernel.current_fp == thread) + _kernel.current_fp = (struct k_thread *)0; } irq_unlock(imask); diff --git a/arch/x86/core/offsets/offsets.c b/arch/x86/core/offsets/offsets.c index b036e1a1adb..d964beaa531 100644 --- a/arch/x86/core/offsets/offsets.c +++ b/arch/x86/core/offsets/offsets.c @@ -39,7 +39,10 @@ GEN_OFFSET_SYM(_thread_arch_t, excNestCount); GEN_OFFSET_SYM(_thread_arch_t, coopFloatReg); GEN_OFFSET_SYM(_thread_arch_t, preempFloatReg); -/* size of the struct tcs structure sans save area for floating point regs */ +/** + * size of the struct k_thread structure sans save area for floating + * point regs + */ GEN_ABSOLUTE_SYM(_K_THREAD_NO_FLOAT_SIZEOF, sizeof(struct k_thread) - sizeof(tCoopFloatReg) - diff --git a/arch/x86/include/asm_inline_gcc.h b/arch/x86/include/asm_inline_gcc.h index 5293b5d3666..6ba3a22e81a 100644 --- a/arch/x86/include/asm_inline_gcc.h +++ b/arch/x86/include/asm_inline_gcc.h @@ -72,7 +72,7 @@ static inline void _FpAccessDisable(void) * This routine saves the system's "live" non-integer context into the * specified area. If the specified thread supports SSE then * x87/MMX/SSEx thread info is saved, otherwise only x87/MMX thread is saved. - * Function is invoked by _FpCtxSave(struct tcs *tcs) + * Function is invoked by _FpCtxSave(struct k_thread *thread) * * @return N/A */ @@ -92,7 +92,7 @@ static inline void _do_fp_regs_save(void *preemp_float_reg) * This routine saves the system's "live" non-integer context into the * specified area. If the specified thread supports SSE then * x87/MMX/SSEx thread info is saved, otherwise only x87/MMX thread is saved. - * Function is invoked by _FpCtxSave(struct tcs *tcs) + * Function is invoked by _FpCtxSave(struct k_thread *thread) * * @return N/A */ diff --git a/arch/x86/include/kernel_arch_thread.h b/arch/x86/include/kernel_arch_thread.h index efe849c2ce3..1f6ee89dee8 100644 --- a/arch/x86/include/kernel_arch_thread.h +++ b/arch/x86/include/kernel_arch_thread.h @@ -252,7 +252,7 @@ struct _thread_arch { /* * The location of all floating point related structures/fields MUST be - * located at the end of struct tcs. This way only the + * located at the end of struct k_thread. This way only the * threads that actually utilize non-integer capabilities need to * account for the increased memory required for storing FP state when * sizing stacks. diff --git a/include/kernel.h b/include/kernel.h index 0b48debe6e8..942a417477a 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -576,7 +576,6 @@ struct k_thread { typedef struct k_thread _thread_t; typedef struct k_thread *k_tid_t; -#define tcs k_thread enum execution_context_types { K_ISR = 0,