Commit 51859b8e authored by Benjamin Walsh's avatar Benjamin Walsh Committed by Anas Nashif
Browse files

kernel/arch: move common thread.flags definitions to common file



Also remove NO_METRIC, which is not referenced anywhere anymore.

Change-Id: Ieaedf075af070a13aa3d975fee9b6b332203bfec
Signed-off-by: default avatarBenjamin Walsh <benjamin.walsh@windriver.com>
parent 7aa53678
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -128,24 +128,6 @@ typedef struct _callee_saved_stack _callee_saved_stack_t;

#endif /* _ASMLANGUAGE */

/* Bitmask definitions for the struct tcs->flags bit field */

#define K_STATIC  0x00000800

#define K_READY              0x00000000    /* Thread is ready to run */
#define K_TIMING             0x00001000    /* Thread is waiting on a timeout */
#define K_PENDING            0x00002000    /* Thread is waiting on an object */
#define K_PRESTART           0x00004000    /* Thread has not yet started */
#define K_DEAD               0x00008000    /* Thread has terminated */
#define K_SUSPENDED          0x00010000    /* Thread is suspended */
#define K_DUMMY              0x00020000    /* Not a real thread */
#define K_EXECUTION_MASK    (K_TIMING | K_PENDING | K_PRESTART | \
			     K_DEAD | K_SUSPENDED | K_DUMMY)

#define K_FP_REGS      0x010 /* 1 = thread uses floating point registers */
#define K_ESSENTIAL    0x200 /* 1 = system thread that must not abort */
#define NO_METRICS     0x400 /* 1 = _Swap() not to update task metrics */

/* stacks */

#define STACK_ALIGN_SIZE 4
+0 −18
Original line number Diff line number Diff line
@@ -86,24 +86,6 @@ typedef struct __esf _esf_t;

#endif /* _ASMLANGUAGE */

/* Bitmask definitions for the struct tcs.flags bit field */

#define K_STATIC  0x00000800

#define K_READY              0x00000000    /* Thread is ready to run */
#define K_TIMING             0x00001000    /* Thread is waiting on a timeout */
#define K_PENDING            0x00002000    /* Thread is waiting on an object */
#define K_PRESTART           0x00004000    /* Thread has not yet started */
#define K_DEAD               0x00008000    /* Thread has terminated */
#define K_SUSPENDED          0x00010000    /* Thread is suspended */
#define K_DUMMY              0x00020000    /* Not a real thread */
#define K_EXECUTION_MASK \
	(K_TIMING | K_PENDING | K_PRESTART | K_DEAD | K_SUSPENDED | K_DUMMY)

#define K_FP_REGS 0x010	   /* 1 = thread uses floating point registers */
#define K_ESSENTIAL 0x200  /* 1 = system thread that must not abort */
#define NO_METRICS 0x400 /* 1 = _Swap() not to update task metrics */

/* stacks */

#define STACK_ROUND_UP(x) ROUND_UP(x, STACK_ALIGN_SIZE)
+7 −18
Original line number Diff line number Diff line
@@ -47,24 +47,13 @@ extern "C" {
#include <misc/dlist.h>
#endif

/* Bitmask definitions for the struct tcs->flags bit field */
#define K_STATIC  0x00000800

#define K_READY              0x00000000    /* Thread is ready to run */
#define K_TIMING             0x00001000    /* Thread is waiting on a timeout */
#define K_PENDING            0x00002000    /* Thread is waiting on an object */
#define K_PRESTART           0x00004000    /* Thread has not yet started */
#define K_DEAD               0x00008000    /* Thread has terminated */
#define K_SUSPENDED          0x00010000    /* Thread is suspended */
#define K_DUMMY              0x00020000    /* Not a real thread */
#define K_EXECUTION_MASK    (K_TIMING | K_PENDING | K_PRESTART | \
			     K_DEAD | K_SUSPENDED | K_DUMMY)

#define INT_ACTIVE     0x002 /* 1 = executing context is interrupt handler */
#define EXC_ACTIVE     0x004 /* 1 = executing context is exception handler */
#define K_FP_REGS      0x010 /* 1 = thread uses floating point registers */
#define K_ESSENTIAL    0x200 /* 1 = system thread that must not abort */
#define NO_METRICS     0x400 /* 1 = _Swap() not to update task metrics */
/* nios2 bitmask definitions for the struct k_thread->flags bit field */

/* 1 = executing context is interrupt handler */
#define INT_ACTIVE (1 << 1)

/* 1 = executing context is exception handler */
#define EXC_ACTIVE (1 << 2)

/* stacks */

+0 −4
Original line number Diff line number Diff line
@@ -312,10 +312,6 @@ alreadyOnIntStack:
	 * _Swap() to determine whether non-floating registers need to be
	 * preserved using the lazy save/restore algorithm, or to indicate to
	 * debug tools that a preemptive context switch has occurred.
	 *
	 * Setting the NO_METRICS bit tells _Swap() that the per-execution context
	 * [totalRunTime] calculation has already been performed and that
	 * there is no need to do it again.
	 */

#if defined(CONFIG_FP_SHARING) ||  defined(CONFIG_GDB_INFO)
+11 −26
Original line number Diff line number Diff line
@@ -52,36 +52,21 @@

#define STACK_ALIGN_SIZE 4

/*
 * Bitmask definitions for the struct k_thread->flags bit field
 */
/* x86 Bitmask definitions for the struct k_thread->flags bit field */

#define K_STATIC  0x00000800

#define K_READY              0x00000000    /* Thread is ready to run */
#define K_TIMING             0x00001000    /* Thread is waiting on a timeout */
#define K_PENDING            0x00002000    /* Thread is waiting on an object */
#define K_PRESTART           0x00004000    /* Thread has not yet started */
#define K_DEAD               0x00008000    /* Thread has terminated */
#define K_SUSPENDED          0x00010000    /* Thread is suspended */
#define K_DUMMY              0x00020000    /* Not a real thread */
#define K_EXECUTION_MASK    (K_TIMING | K_PENDING | K_PRESTART | \
			     K_DEAD | K_SUSPENDED | K_DUMMY)

#define INT_ACTIVE 0x2     /* 1 = executing context is interrupt handler */
#define EXC_ACTIVE 0x4     /* 1 = executing context is exception handler */
#if defined(CONFIG_FP_SHARING)
#define K_FP_REGS  0x10    /* 1 = thread uses floating point registers */
#endif
#if defined(CONFIG_FP_SHARING) && defined(CONFIG_SSE)
#define K_SSE_REGS 0x20    /* 1 = thread uses SSEx (and also FP) registers */
#endif
#define K_ESSENTIAL 0x200  /* 1 = system thread that must not abort */
#define NO_METRICS 0x400   /* 1 = _Swap() not to update task metrics */
#define NO_METRICS_BIT_OFFSET 0xa /* Bit position of NO_METRICS */
/* executing context is interrupt handler */
#define INT_ACTIVE (1 << 1)

/* executing context is exception handler */
#define EXC_ACTIVE (1 << 2)

#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)
#endif

#if defined(CONFIG_FP_SHARING) && defined(CONFIG_SSE)
#define _FP_USER_MASK (K_FP_REGS | K_SSE_REGS)
#elif defined(CONFIG_FP_SHARING)
Loading