mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-28 01:58:39 +08:00
2008-08-05 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libmisc/monitor/monitor.h, rtems/include/rtems/rtems/tasks.h, score/include/rtems/score/thread.h, score/src/threadreset.c, score/src/threadrestart.c, score/src/threadstart.c: New type Thread_Entry_numeric_type for numeric arguments in thread entry functions with at least one numeric argument.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2008-08-04 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
|
* posix/src/mqueuetimedreceive.c, posix/src/mqueuetimedsend.c: Fix
|
||||||
|
warnings.
|
||||||
|
|
||||||
2008-08-07 Joel Sherrill <joel.sherrill@OARcorp.com>
|
2008-08-07 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||||
|
|
||||||
* score/include/rtems/score/sysstate.h,
|
* score/include/rtems/score/sysstate.h,
|
||||||
|
|||||||
@@ -94,22 +94,22 @@ typedef struct {
|
|||||||
* Task
|
* Task
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
rtems_id id;
|
rtems_id id;
|
||||||
rtems_name name;
|
rtems_name name;
|
||||||
/* end of common portion */
|
/* end of common portion */
|
||||||
Thread_Entry entry;
|
Thread_Entry entry;
|
||||||
uint32_t argument;
|
Thread_Entry_numeric_type argument;
|
||||||
void *stack;
|
void *stack;
|
||||||
uint32_t stack_size;
|
uint32_t stack_size;
|
||||||
rtems_task_priority priority;
|
rtems_task_priority priority;
|
||||||
States_Control state;
|
States_Control state;
|
||||||
rtems_event_set events;
|
rtems_event_set events;
|
||||||
rtems_mode modes;
|
rtems_mode modes;
|
||||||
rtems_attribute attributes;
|
rtems_attribute attributes;
|
||||||
uint32_t notepad[RTEMS_NUMBER_NOTEPADS];
|
uint32_t notepad[RTEMS_NUMBER_NOTEPADS];
|
||||||
rtems_id wait_id;
|
rtems_id wait_id;
|
||||||
uint32_t wait_args;
|
uint32_t wait_args;
|
||||||
uint32_t ticks;
|
uint32_t ticks;
|
||||||
} rtems_monitor_task_t;
|
} rtems_monitor_task_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ typedef void rtems_task;
|
|||||||
/**
|
/**
|
||||||
* The following defines the argument to an RTEMS task.
|
* The following defines the argument to an RTEMS task.
|
||||||
*/
|
*/
|
||||||
typedef uintptr_t rtems_task_argument;
|
typedef Thread_Entry_numeric_type rtems_task_argument;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The following defines the type for the entry point of an RTEMS task.
|
* The following defines the type for the entry point of an RTEMS task.
|
||||||
|
|||||||
@@ -77,6 +77,17 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
typedef void *Thread;
|
typedef void *Thread;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Type of the numeric argument of a thread entry function with at
|
||||||
|
* least one numeric argument.
|
||||||
|
*
|
||||||
|
* This numeric argument type designates an unsigned integer type with the
|
||||||
|
* property that any valid pointer to void can be converted to this type and
|
||||||
|
* then converted back to a pointer to void. The result will compare equal to
|
||||||
|
* the original pointer.
|
||||||
|
*/
|
||||||
|
typedef uintptr_t Thread_Entry_numeric_type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The following defines the ways in which the entry point for a
|
* The following defines the ways in which the entry point for a
|
||||||
* thread can be invoked. Basically, it can be passed any
|
* thread can be invoked. Basically, it can be passed any
|
||||||
@@ -97,7 +108,7 @@ typedef Thread ( *Thread_Entry )( void ); /* basic type */
|
|||||||
/** This type corresponds to a thread entry point which takes a single
|
/** This type corresponds to a thread entry point which takes a single
|
||||||
* unsigned thirty-two bit integer as an argument.
|
* unsigned thirty-two bit integer as an argument.
|
||||||
*/
|
*/
|
||||||
typedef Thread ( *Thread_Entry_numeric )( uint32_t );
|
typedef Thread ( *Thread_Entry_numeric )( Thread_Entry_numeric_type );
|
||||||
|
|
||||||
/** This type corresponds to a thread entry point which takes a single
|
/** This type corresponds to a thread entry point which takes a single
|
||||||
* untyped pointer as an argument.
|
* untyped pointer as an argument.
|
||||||
@@ -107,13 +118,13 @@ typedef Thread ( *Thread_Entry_pointer )( void * );
|
|||||||
/** This type corresponds to a thread entry point which takes a single
|
/** This type corresponds to a thread entry point which takes a single
|
||||||
* untyped pointer and an unsigned thirty-two bit integer as arguments.
|
* untyped pointer and an unsigned thirty-two bit integer as arguments.
|
||||||
*/
|
*/
|
||||||
typedef Thread ( *Thread_Entry_both_pointer_first )( void *, uint32_t );
|
typedef Thread ( *Thread_Entry_both_pointer_first )( void *, Thread_Entry_numeric_type );
|
||||||
|
|
||||||
/** This type corresponds to a thread entry point which takes a single
|
/** This type corresponds to a thread entry point which takes a single
|
||||||
* unsigned thirty-two bit integer and an untyped pointer and an
|
* unsigned thirty-two bit integer and an untyped pointer and an
|
||||||
* as arguments.
|
* as arguments.
|
||||||
*/
|
*/
|
||||||
typedef Thread ( *Thread_Entry_both_numeric_first )( uint32_t , void * );
|
typedef Thread ( *Thread_Entry_both_numeric_first )( Thread_Entry_numeric_type, void * );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The following lists the algorithms used to manage the thread cpu budget.
|
* The following lists the algorithms used to manage the thread cpu budget.
|
||||||
@@ -169,39 +180,39 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/** This field is the starting address for the thread. */
|
/** This field is the starting address for the thread. */
|
||||||
Thread_Entry entry_point;
|
Thread_Entry entry_point;
|
||||||
/** This field indicates the how task is invoked. */
|
/** This field indicates the how task is invoked. */
|
||||||
Thread_Start_types prototype;
|
Thread_Start_types prototype;
|
||||||
/** This field is the pointer argument passed at thread start. */
|
/** This field is the pointer argument passed at thread start. */
|
||||||
void *pointer_argument;
|
void *pointer_argument;
|
||||||
/** This field is the numeric argument passed at thread start. */
|
/** This field is the numeric argument passed at thread start. */
|
||||||
uint32_t numeric_argument;
|
Thread_Entry_numeric_type numeric_argument;
|
||||||
/*-------------- initial execution modes ----------------- */
|
/*-------------- initial execution modes ----------------- */
|
||||||
/** This field indicates whether the thread was preemptible when
|
/** This field indicates whether the thread was preemptible when
|
||||||
* it started.
|
* it started.
|
||||||
*/
|
*/
|
||||||
boolean is_preemptible;
|
boolean is_preemptible;
|
||||||
/** This field indicates the CPU budget algorith. */
|
/** This field indicates the CPU budget algorith. */
|
||||||
Thread_CPU_budget_algorithms budget_algorithm;
|
Thread_CPU_budget_algorithms budget_algorithm;
|
||||||
/** This field is the routine to invoke when the CPU allotment is
|
/** This field is the routine to invoke when the CPU allotment is
|
||||||
* consumed.
|
* consumed.
|
||||||
*/
|
*/
|
||||||
Thread_CPU_budget_algorithm_callout budget_callout;
|
Thread_CPU_budget_algorithm_callout budget_callout;
|
||||||
/** This field is the initial ISR disable level of this thread. */
|
/** This field is the initial ISR disable level of this thread. */
|
||||||
uint32_t isr_level;
|
uint32_t isr_level;
|
||||||
/** This field is the initial priority. */
|
/** This field is the initial priority. */
|
||||||
Priority_Control initial_priority;
|
Priority_Control initial_priority;
|
||||||
/** This field indicates whether the SuperCore allocated the stack. */
|
/** This field indicates whether the SuperCore allocated the stack. */
|
||||||
boolean core_allocated_stack;
|
boolean core_allocated_stack;
|
||||||
/** This field is the stack information. */
|
/** This field is the stack information. */
|
||||||
Stack_Control Initial_stack;
|
Stack_Control Initial_stack;
|
||||||
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
|
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
|
||||||
/** This field is the initial FP context area address. */
|
/** This field is the initial FP context area address. */
|
||||||
Context_Control_fp *fp_context;
|
Context_Control_fp *fp_context;
|
||||||
#endif
|
#endif
|
||||||
/** This field is the initial stack area address. */
|
/** This field is the initial stack area address. */
|
||||||
void *stack;
|
void *stack;
|
||||||
} Thread_Start_information;
|
} Thread_Start_information;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The following structure contains the information necessary to manage
|
* The following structure contains the information necessary to manage
|
||||||
@@ -579,11 +590,11 @@ boolean _Thread_Initialize(
|
|||||||
* thread competes with all other threads for CPU time.
|
* thread competes with all other threads for CPU time.
|
||||||
*/
|
*/
|
||||||
boolean _Thread_Start(
|
boolean _Thread_Start(
|
||||||
Thread_Control *the_thread,
|
Thread_Control *the_thread,
|
||||||
Thread_Start_types the_prototype,
|
Thread_Start_types the_prototype,
|
||||||
void *entry_point,
|
void *entry_point,
|
||||||
void *pointer_argument,
|
void *pointer_argument,
|
||||||
uint32_t numeric_argument
|
Thread_Entry_numeric_type numeric_argument
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -594,9 +605,9 @@ boolean _Thread_Start(
|
|||||||
* TODO: multiple task arg profiles
|
* TODO: multiple task arg profiles
|
||||||
*/
|
*/
|
||||||
boolean _Thread_Restart(
|
boolean _Thread_Restart(
|
||||||
Thread_Control *the_thread,
|
Thread_Control *the_thread,
|
||||||
void *pointer_argument,
|
void *pointer_argument,
|
||||||
uint32_t numeric_argument
|
Thread_Entry_numeric_type numeric_argument
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -604,9 +615,9 @@ boolean _Thread_Restart(
|
|||||||
* not restart it.
|
* not restart it.
|
||||||
*/
|
*/
|
||||||
void _Thread_Reset(
|
void _Thread_Reset(
|
||||||
Thread_Control *the_thread,
|
Thread_Control *the_thread,
|
||||||
void *pointer_argument,
|
void *pointer_argument,
|
||||||
uint32_t numeric_argument
|
Thread_Entry_numeric_type numeric_argument
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -41,9 +41,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void _Thread_Reset(
|
void _Thread_Reset(
|
||||||
Thread_Control *the_thread,
|
Thread_Control *the_thread,
|
||||||
void *pointer_argument,
|
void *pointer_argument,
|
||||||
uint32_t numeric_argument
|
Thread_Entry_numeric_type numeric_argument
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
the_thread->resource_count = 0;
|
the_thread->resource_count = 0;
|
||||||
|
|||||||
@@ -41,9 +41,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
boolean _Thread_Restart(
|
boolean _Thread_Restart(
|
||||||
Thread_Control *the_thread,
|
Thread_Control *the_thread,
|
||||||
void *pointer_argument,
|
void *pointer_argument,
|
||||||
uint32_t numeric_argument
|
Thread_Entry_numeric_type numeric_argument
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if ( !_States_Is_dormant( the_thread->current_state ) ) {
|
if ( !_States_Is_dormant( the_thread->current_state ) ) {
|
||||||
|
|||||||
@@ -41,11 +41,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
boolean _Thread_Start(
|
boolean _Thread_Start(
|
||||||
Thread_Control *the_thread,
|
Thread_Control *the_thread,
|
||||||
Thread_Start_types the_prototype,
|
Thread_Start_types the_prototype,
|
||||||
void *entry_point,
|
void *entry_point,
|
||||||
void *pointer_argument,
|
void *pointer_argument,
|
||||||
uint32_t numeric_argument
|
Thread_Entry_numeric_type numeric_argument
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if ( _States_Is_dormant( the_thread->current_state ) ) {
|
if ( _States_Is_dormant( the_thread->current_state ) ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user