diff --git a/arch/nios2/include/kernel_arch_data.h b/arch/nios2/include/kernel_arch_data.h index d55d8cf1cca..288e4f7dd47 100644 --- a/arch/nios2/include/kernel_arch_data.h +++ b/arch/nios2/include/kernel_arch_data.h @@ -50,10 +50,10 @@ extern "C" { /* nios2 bitmask definitions for the struct k_thread->flags bit field */ /* 1 = executing context is interrupt handler */ -#define INT_ACTIVE (1 << 1) +#define INT_ACTIVE (1 << 31) /* 1 = executing context is exception handler */ -#define EXC_ACTIVE (1 << 2) +#define EXC_ACTIVE (1 << 30) /* stacks */ diff --git a/arch/x86/include/kernel_arch_data.h b/arch/x86/include/kernel_arch_data.h index 15a9b37b44e..c3edbe1bdaa 100644 --- a/arch/x86/include/kernel_arch_data.h +++ b/arch/x86/include/kernel_arch_data.h @@ -55,16 +55,16 @@ /* x86 Bitmask definitions for the struct k_thread->flags bit field */ /* executing context is interrupt handler */ -#define INT_ACTIVE (1 << 1) +#define INT_ACTIVE (1 << 31) /* executing context is exception handler */ -#define EXC_ACTIVE (1 << 2) +#define EXC_ACTIVE (1 << 30) #define INT_OR_EXC_MASK (INT_ACTIVE | EXC_ACTIVE) #if defined(CONFIG_FP_SHARING) && defined(CONFIG_SSE) /* thread uses SSEx (and also FP) registers */ -#define K_SSE_REGS (1 << 5) +#define K_SSE_REGS (1 << 29) #endif #if defined(CONFIG_FP_SHARING) && defined(CONFIG_SSE) diff --git a/kernel/include/kernel_structs.h b/kernel/include/kernel_structs.h index 4de35ab3563..1e63f04aa6e 100644 --- a/kernel/include/kernel_structs.h +++ b/kernel/include/kernel_structs.h @@ -31,31 +31,31 @@ */ /* thread is defined statically */ -#define K_STATIC (1 << 8) +#define K_STATIC (1 << 0) /* Thread is waiting on an object */ -#define K_PENDING (1 << 13) +#define K_PENDING (1 << 1) /* Thread has not yet started */ -#define K_PRESTART (1 << 14) +#define K_PRESTART (1 << 2) /* Thread has terminated */ -#define K_DEAD (1 << 15) +#define K_DEAD (1 << 3) /* Thread is suspended */ -#define K_SUSPENDED (1 << 16) +#define K_SUSPENDED (1 << 4) /* Not a real thread */ -#define K_DUMMY (1 << 17) +#define K_DUMMY (1 << 5) + +/* system thread that must not abort */ +#define K_ESSENTIAL (1 << 6) #if defined(CONFIG_FP_SHARING) /* thread uses floating point registers */ -#define K_FP_REGS (1 << 4) +#define K_FP_REGS (1 << 7) #endif -/* system thread that must not abort */ -#define K_ESSENTIAL (1 << 9) - #include #if !defined(_ASMLANGUAGE) @@ -76,7 +76,7 @@ struct _thread_base { sys_dnode_t k_q_node; /* execution flags */ - int flags; + uint32_t flags; /* thread priority used to sort linked list */ int prio;