diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-12-09 13:57:51 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-02-12 09:08:36 +0100 |
commit | a08dcb2f7c7c883559e10c389404a4dc751376fa (patch) | |
tree | 6cea52738a5a38cc7a2fc3260e88fe2a9a37e287 /cpukit/score/src/mpci.c | |
parent | score: Split stack allocator configuration (diff) | |
download | rtems-a08dcb2f7c7c883559e10c389404a4dc751376fa.tar.bz2 |
score: Add Thread_Configuration
Add the Thread_Configuration structure to reduce the parameter count of
_Thread_Initialize(). This makes it easier to add more parameters in
the future. It simplifies the code generation since most architectures
do not have that many registers available for function parameters.
Update #3835.
Diffstat (limited to 'cpukit/score/src/mpci.c')
-rw-r--r-- | cpukit/score/src/mpci.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c index 513d096480..32489ac0cf 100644 --- a/cpukit/score/src/mpci.c +++ b/cpukit/score/src/mpci.c @@ -29,6 +29,8 @@ #include <rtems/score/threadqimpl.h> #include <rtems/sysinit.h> +#include <string.h> + RTEMS_STATIC_ASSERT( sizeof(MPCI_Internal_packet) <= MP_PACKET_MINIMUM_PACKET_SIZE, MPCI_Internal_packet @@ -111,8 +113,8 @@ static void _MPCI_Create_server( void ) } } }; - ISR_lock_Context lock_context; - Objects_Name name; + Thread_Configuration config; + ISR_lock_Context lock_context; if ( !_System_state_Is_multiprocessing ) @@ -123,24 +125,19 @@ static void _MPCI_Create_server( void ) */ _MPCI_Receive_server_tcb = _Thread_Internal_allocate(); - - name.name_u32 = _Objects_Build_name( 'M', 'P', 'C', 'I' ); - _Thread_Initialize( - &_Thread_Information, - _MPCI_Receive_server_tcb, - &_Scheduler_Table[ 0 ], - NULL, /* allocate the stack */ - _Stack_Minimum() + - CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + - _MPCI_Configuration.extra_mpci_receive_server_stack, - CPU_ALL_TASKS_ARE_FP, - PRIORITY_PSEUDO_ISR, - false, /* no preempt */ - THREAD_CPU_BUDGET_ALGORITHM_NONE, - NULL, /* no budget algorithm callout */ - 0, /* all interrupts enabled */ - name - ); + _Assert( _MPCI_Receive_server_tcb != NULL ); + + memset( &config, 0, sizeof( config ) ); + config.scheduler = &_Scheduler_Table[ 0 ]; + config.stack_size = _Stack_Minimum() + + CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + + _MPCI_Configuration.extra_mpci_receive_server_stack; + config.name.name_u32 = _Objects_Build_name( 'M', 'P', 'C', 'I' ); + config.priority = PRIORITY_PSEUDO_ISR; + config.budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; + config.is_fp = CPU_ALL_TASKS_ARE_FP; + + _Thread_Initialize( &_Thread_Information, _MPCI_Receive_server_tcb, &config ); _ISR_lock_ISR_disable( &lock_context ); _Thread_Start( _MPCI_Receive_server_tcb, &entry, &lock_context ); |