forked from Imagelibrary/rtems
Remove stray white spaces.
This commit is contained in:
@@ -70,11 +70,11 @@ void rtems_debug_enable (
|
||||
*
|
||||
* This routine disables the specified types of debug checks.
|
||||
*/
|
||||
|
||||
|
||||
void rtems_debug_disable (
|
||||
rtems_debug_control to_be_disabled
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* _Debug_Is_enabled
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
* The control structure which defines the points at which an API
|
||||
* can add an extension to the system initialization thread.
|
||||
*/
|
||||
|
||||
|
||||
typedef void (*API_extensions_Predriver_hook)(void);
|
||||
typedef void (*API_extensions_Postdriver_hook)(void);
|
||||
typedef void (*API_extensions_Postswitch_hook)(
|
||||
Thread_Control *
|
||||
);
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
Chain_Node Node;
|
||||
@@ -41,7 +41,7 @@ typedef struct {
|
||||
/*
|
||||
* This is the list of API extensions to the system initialization.
|
||||
*/
|
||||
|
||||
|
||||
SCORE_EXTERN Chain_Control _API_extensions_List;
|
||||
|
||||
/*
|
||||
@@ -52,9 +52,9 @@ SCORE_EXTERN Chain_Control _API_extensions_List;
|
||||
* This routine initializes the API extension handler.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
void _API_extensions_Initialization( void );
|
||||
|
||||
|
||||
/*
|
||||
* _API_extensions_Add
|
||||
*
|
||||
@@ -62,7 +62,7 @@ void _API_extensions_Initialization( void );
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
|
||||
void _API_extensions_Add(
|
||||
API_extensions_Control *the_extension
|
||||
);
|
||||
@@ -74,7 +74,7 @@ void _API_extensions_Add(
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
|
||||
void _API_extensions_Run_predriver( void );
|
||||
|
||||
/*
|
||||
|
||||
@@ -109,7 +109,7 @@ SCORE_EXTERN Objects_Information _API_Mutex_Information;
|
||||
_CORE_mutex_Seize( \
|
||||
&(_the_mutex)->Mutex, (_the_mutex)->Object.id, TRUE, 0, (_level) ); \
|
||||
} while (0)
|
||||
|
||||
|
||||
/*
|
||||
* _API_Mutex_Unlock
|
||||
*
|
||||
|
||||
@@ -61,7 +61,7 @@ const unsigned char __log2table[256] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
|
||||
|
||||
@@ -85,7 +85,7 @@ void _Chain_Initialize(
|
||||
/*
|
||||
* _Chain_Get_first_unprotected
|
||||
*/
|
||||
|
||||
|
||||
#ifndef RTEMS_INLINES
|
||||
Chain_Node *_Chain_Get_first_unprotected(
|
||||
Chain_Control *the_chain
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __RTEMS_CORE_MESSAGE_QUEUE_h
|
||||
#define __RTEMS_CORE_MESSAGE_QUEUE_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -25,12 +25,12 @@ extern "C" {
|
||||
#include <rtems/score/threadq.h>
|
||||
#include <rtems/score/priority.h>
|
||||
#include <rtems/score/watchdog.h>
|
||||
|
||||
|
||||
/*
|
||||
* The following type defines the callout which the API provides
|
||||
* to support global/multiprocessor operations on message_queues.
|
||||
*/
|
||||
|
||||
|
||||
typedef void ( *CORE_message_queue_API_mp_support_callout )(
|
||||
Thread_Control *,
|
||||
Objects_Id
|
||||
@@ -43,17 +43,17 @@ typedef void ( *CORE_message_queue_API_mp_support_callout )(
|
||||
* NOTE: The buffer field is normally longer than a single uint32_t .
|
||||
* but since messages are variable length we just make a ptr to 1.
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint32_t size;
|
||||
uint32_t buffer[1];
|
||||
} CORE_message_queue_Buffer;
|
||||
|
||||
|
||||
/*
|
||||
* The following records define the organization of a message
|
||||
* buffer.
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
Chain_Node Node;
|
||||
int priority;
|
||||
@@ -81,13 +81,13 @@ typedef enum {
|
||||
|
||||
#define CORE_MESSAGE_QUEUE_SEND_REQUEST INT_MAX
|
||||
#define CORE_MESSAGE_QUEUE_URGENT_REQUEST INT_MIN
|
||||
|
||||
|
||||
typedef int CORE_message_queue_Submit_types;
|
||||
|
||||
/*
|
||||
* Core Message queue handler return statuses.
|
||||
*/
|
||||
|
||||
|
||||
typedef enum {
|
||||
CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL,
|
||||
CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE,
|
||||
@@ -107,7 +107,7 @@ typedef enum {
|
||||
typedef struct {
|
||||
CORE_message_queue_Disciplines discipline;
|
||||
} CORE_message_queue_Attributes;
|
||||
|
||||
|
||||
/*
|
||||
* The following defines the type for a Notification handler. A notification
|
||||
* handler is invoked when the message queue makes a 0->1 transition on
|
||||
@@ -120,7 +120,7 @@ typedef void (*CORE_message_queue_Notify_Handler)( void * );
|
||||
* The following defines the control block used to manage each
|
||||
* counting message_queue.
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
Thread_queue_Control Wait_queue;
|
||||
CORE_message_queue_Attributes Attributes;
|
||||
@@ -148,7 +148,7 @@ boolean _CORE_message_queue_Initialize(
|
||||
uint32_t maximum_pending_messages,
|
||||
uint32_t maximum_message_size
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _CORE_message_queue_Close
|
||||
*
|
||||
@@ -157,7 +157,7 @@ boolean _CORE_message_queue_Initialize(
|
||||
* This function closes a message by returning all allocated space and
|
||||
* flushing the message_queue's task wait queue.
|
||||
*/
|
||||
|
||||
|
||||
void _CORE_message_queue_Close(
|
||||
CORE_message_queue_Control *the_message_queue,
|
||||
Thread_queue_Flush_callout remote_extract_callout,
|
||||
@@ -186,11 +186,11 @@ uint32_t _CORE_message_queue_Flush(
|
||||
* This routine flushes all outstanding messages and returns
|
||||
* them to the inactive message chain.
|
||||
*/
|
||||
|
||||
|
||||
uint32_t _CORE_message_queue_Flush_support(
|
||||
CORE_message_queue_Control *the_message_queue
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _CORE_message_queue_Flush_waiting_threads
|
||||
*
|
||||
@@ -214,7 +214,7 @@ void _CORE_message_queue_Flush_waiting_threads(
|
||||
* returns the number of threads made ready by the message.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
CORE_message_queue_Status _CORE_message_queue_Broadcast(
|
||||
CORE_message_queue_Control *the_message_queue,
|
||||
void *buffer,
|
||||
@@ -237,7 +237,7 @@ CORE_message_queue_Status _CORE_message_queue_Broadcast(
|
||||
* at the front of the queue.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
CORE_message_queue_Status _CORE_message_queue_Submit(
|
||||
CORE_message_queue_Control *the_message_queue,
|
||||
void *buffer,
|
||||
@@ -261,7 +261,7 @@ CORE_message_queue_Status _CORE_message_queue_Submit(
|
||||
*
|
||||
* NOTE: Returns message priority via return are in TCB.
|
||||
*/
|
||||
|
||||
|
||||
void _CORE_message_queue_Seize(
|
||||
CORE_message_queue_Control *the_message_queue,
|
||||
Objects_Id id,
|
||||
@@ -294,6 +294,6 @@ void _CORE_message_queue_Insert_message(
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __RTEMS_CORE_MUTEX_h
|
||||
#define __RTEMS_CORE_MUTEX_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -28,12 +28,12 @@ extern "C" {
|
||||
#include <rtems/score/watchdog.h>
|
||||
#include <rtems/score/interr.h>
|
||||
#include <rtems/score/sysstate.h>
|
||||
|
||||
|
||||
/*
|
||||
* The following type defines the callout which the API provides
|
||||
* to support global/multiprocessor operations on mutexes.
|
||||
*/
|
||||
|
||||
|
||||
typedef void ( *CORE_mutex_API_mp_support_callout )(
|
||||
Thread_Control *,
|
||||
Objects_Id
|
||||
@@ -53,7 +53,7 @@ typedef enum {
|
||||
/*
|
||||
* Mutex handler return statuses.
|
||||
*/
|
||||
|
||||
|
||||
typedef enum {
|
||||
CORE_MUTEX_STATUS_SUCCESSFUL,
|
||||
CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT,
|
||||
@@ -92,7 +92,7 @@ typedef enum {
|
||||
CORE_MUTEX_NESTING_IS_ERROR,
|
||||
CORE_MUTEX_NESTING_BLOCKS
|
||||
} CORE_mutex_Nesting_behaviors;
|
||||
|
||||
|
||||
/*
|
||||
* Locked and unlocked values
|
||||
*/
|
||||
@@ -111,11 +111,11 @@ typedef struct {
|
||||
CORE_mutex_Disciplines discipline;
|
||||
Priority_Control priority_ceiling;
|
||||
} CORE_mutex_Attributes;
|
||||
|
||||
|
||||
/*
|
||||
* The following defines the control block used to manage each mutex.
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
Thread_queue_Control Wait_queue;
|
||||
CORE_mutex_Attributes Attributes;
|
||||
@@ -139,7 +139,7 @@ void _CORE_mutex_Initialize(
|
||||
CORE_mutex_Attributes *the_mutex_attributes,
|
||||
uint32_t initial_lock
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _CORE_mutex_Seize
|
||||
*
|
||||
@@ -209,7 +209,7 @@ CORE_mutex_Status _CORE_mutex_Surrender(
|
||||
Objects_Id id,
|
||||
CORE_mutex_API_mp_support_callout api_mutex_mp_support
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _CORE_mutex_Flush
|
||||
*
|
||||
@@ -218,19 +218,19 @@ CORE_mutex_Status _CORE_mutex_Surrender(
|
||||
* This routine assists in the deletion of a mutex by flushing the associated
|
||||
* wait queue.
|
||||
*/
|
||||
|
||||
|
||||
void _CORE_mutex_Flush(
|
||||
CORE_mutex_Control *the_mutex,
|
||||
Thread_queue_Flush_callout remote_extract_callout,
|
||||
uint32_t status
|
||||
);
|
||||
|
||||
|
||||
#include <rtems/score/coremutex.inl>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __RTEMS_CORE_COUNTING_SEMAPHORE_h
|
||||
#define __RTEMS_CORE_COUNTING_SEMAPHORE_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -26,12 +26,12 @@ extern "C" {
|
||||
#include <rtems/score/threadq.h>
|
||||
#include <rtems/score/priority.h>
|
||||
#include <rtems/score/watchdog.h>
|
||||
|
||||
|
||||
/*
|
||||
* The following type defines the callout which the API provides
|
||||
* to support global/multiprocessor operations on semaphores.
|
||||
*/
|
||||
|
||||
|
||||
typedef void ( *CORE_semaphore_API_mp_support_callout )(
|
||||
Thread_Control *,
|
||||
Objects_Id
|
||||
@@ -49,7 +49,7 @@ typedef enum {
|
||||
/*
|
||||
* Core Semaphore handler return statuses.
|
||||
*/
|
||||
|
||||
|
||||
typedef enum {
|
||||
CORE_SEMAPHORE_STATUS_SUCCESSFUL,
|
||||
CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT,
|
||||
@@ -67,12 +67,12 @@ typedef struct {
|
||||
uint32_t maximum_count;
|
||||
CORE_semaphore_Disciplines discipline;
|
||||
} CORE_semaphore_Attributes;
|
||||
|
||||
|
||||
/*
|
||||
* The following defines the control block used to manage each
|
||||
* counting semaphore.
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
Thread_queue_Control Wait_queue;
|
||||
CORE_semaphore_Attributes Attributes;
|
||||
@@ -92,7 +92,7 @@ void _CORE_semaphore_Initialize(
|
||||
CORE_semaphore_Attributes *the_semaphore_attributes,
|
||||
uint32_t initial_value
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _CORE_semaphore_Seize
|
||||
*
|
||||
@@ -110,7 +110,7 @@ void _CORE_semaphore_Seize(
|
||||
boolean wait,
|
||||
Watchdog_Interval timeout
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _CORE_semaphore_Surrender
|
||||
*
|
||||
@@ -126,7 +126,7 @@ CORE_semaphore_Status _CORE_semaphore_Surrender(
|
||||
Objects_Id id,
|
||||
CORE_semaphore_API_mp_support_callout api_semaphore_mp_support
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _CORE_semaphore_Flush
|
||||
*
|
||||
@@ -149,6 +149,6 @@ void _CORE_semaphore_Flush(
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
/* end of include file */
|
||||
|
||||
@@ -44,7 +44,7 @@ typedef enum {
|
||||
HEAP_GET_INFORMATION_SYSTEM_STATE_ERROR,
|
||||
HEAP_GET_INFORMATION_BLOCK_ERROR
|
||||
} Heap_Get_information_status;
|
||||
|
||||
|
||||
/*
|
||||
* Information block returned by _Heap_Get_information
|
||||
*/
|
||||
|
||||
@@ -60,7 +60,7 @@ typedef enum {
|
||||
/*
|
||||
* This type holds the fatal error information.
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
Internal_errors_Source the_source;
|
||||
boolean is_internal;
|
||||
|
||||
@@ -60,7 +60,7 @@ typedef ISR_Handler ( *ISR_Handler_entry )(
|
||||
* the current CPU being used. This is usually the number of distinct vectors
|
||||
* the cpu can vector.
|
||||
*/
|
||||
|
||||
|
||||
#define ISR_NUMBER_OF_VECTORS CPU_INTERRUPT_NUMBER_OF_VECTORS
|
||||
|
||||
/*
|
||||
@@ -166,10 +166,10 @@ void _ISR_Handler_initialization ( void );
|
||||
*
|
||||
* This routine returns the current interrupt level.
|
||||
*/
|
||||
|
||||
|
||||
#define _ISR_Get_level() \
|
||||
_CPU_ISR_Get_level()
|
||||
|
||||
|
||||
/*
|
||||
* _ISR_Set_level
|
||||
*
|
||||
|
||||
@@ -32,7 +32,7 @@ extern "C" {
|
||||
* The following constants define the stack size requirements for
|
||||
* the system threads.
|
||||
*/
|
||||
|
||||
|
||||
#define MPCI_RECEIVE_SERVER_STACK_SIZE \
|
||||
( STACK_MINIMUM_SIZE + \
|
||||
CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \
|
||||
@@ -100,21 +100,21 @@ typedef struct {
|
||||
*/
|
||||
|
||||
typedef void (*MPCI_Packet_processor)( MP_packet_Prefix * );
|
||||
|
||||
|
||||
/*
|
||||
* The following enumerated type defines the list of
|
||||
* internal MP operations.
|
||||
*/
|
||||
|
||||
|
||||
typedef enum {
|
||||
MPCI_PACKETS_SYSTEM_VERIFY = 0
|
||||
} MPCI_Internal_Remote_operations;
|
||||
|
||||
|
||||
/*
|
||||
* The following data structure defines the packet used to perform
|
||||
* remote event operations.
|
||||
*/
|
||||
|
||||
|
||||
typedef struct {
|
||||
MP_packet_Prefix Prefix;
|
||||
MPCI_Internal_Remote_operations operation;
|
||||
@@ -138,13 +138,13 @@ SCORE_EXTERN Thread_queue_Control _MPCI_Remote_blocked_threads;
|
||||
* The following define the internal pointers to the user's
|
||||
* configuration information.
|
||||
*/
|
||||
|
||||
|
||||
SCORE_EXTERN MPCI_Control *_MPCI_table;
|
||||
|
||||
/*
|
||||
* The following points to the MPCI Receive Server.
|
||||
*/
|
||||
|
||||
|
||||
SCORE_EXTERN Thread_Control *_MPCI_Receive_server_tcb;
|
||||
|
||||
/*
|
||||
@@ -197,13 +197,13 @@ void _MPCI_Initialization ( void );
|
||||
* This routine registers the MPCI packet processor for the
|
||||
* designated object class.
|
||||
*/
|
||||
|
||||
|
||||
void _MPCI_Register_packet_processor(
|
||||
MP_packet_Classes the_class,
|
||||
MPCI_Packet_processor the_packet_processor
|
||||
|
||||
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _MPCI_Get_packet
|
||||
*
|
||||
@@ -300,7 +300,7 @@ Thread_Control *_MPCI_Process_response (
|
||||
* _MPCI_Receive_server
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
Thread _MPCI_Receive_server(
|
||||
uint32_t ignored
|
||||
);
|
||||
@@ -313,7 +313,7 @@ Thread _MPCI_Receive_server(
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
|
||||
void _MPCI_Announce ( void );
|
||||
|
||||
/*
|
||||
@@ -324,11 +324,11 @@ void _MPCI_Announce ( void );
|
||||
* This routine performs a remote procedure call so that a
|
||||
* process operation can be performed on another node.
|
||||
*/
|
||||
|
||||
|
||||
void _MPCI_Internal_packets_Send_process_packet (
|
||||
MPCI_Internal_Remote_operations operation
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _MPCI_Internal_packets_Send_request_packet
|
||||
*
|
||||
@@ -340,7 +340,7 @@ void _MPCI_Internal_packets_Send_process_packet (
|
||||
* This routine is not needed since there are no request
|
||||
* packets to be sent by this manager.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* _MPCI_Internal_packets_Send_response_packet
|
||||
*
|
||||
@@ -352,7 +352,7 @@ void _MPCI_Internal_packets_Send_process_packet (
|
||||
* This routine is not needed since there are no response
|
||||
* packets to be sent by this manager.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* _MPCI_Internal_packets_Process_packet
|
||||
@@ -362,11 +362,11 @@ void _MPCI_Internal_packets_Send_process_packet (
|
||||
* This routine performs the actions specific to this package for
|
||||
* the request from another node.
|
||||
*/
|
||||
|
||||
|
||||
void _MPCI_Internal_packets_Process_packet (
|
||||
MP_packet_Prefix *the_packet_prefix
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* _MPCI_Internal_packets_Send_object_was_deleted
|
||||
*
|
||||
@@ -379,7 +379,7 @@ void _MPCI_Internal_packets_Process_packet (
|
||||
* This routine is not needed since there are no objects
|
||||
* deleted by this manager.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* _MPCI_Internal_packets_Send_extract_proxy
|
||||
*
|
||||
@@ -392,7 +392,7 @@ void _MPCI_Internal_packets_Process_packet (
|
||||
* This routine is not needed since there are no objects
|
||||
* deleted by this manager.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* _MPCI_Internal_packets_Get_packet
|
||||
*
|
||||
@@ -400,7 +400,7 @@ void _MPCI_Internal_packets_Process_packet (
|
||||
*
|
||||
* This routine is used to obtain a internal threads mp packet.
|
||||
*/
|
||||
|
||||
|
||||
MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -377,7 +377,7 @@ void _Objects_Free(
|
||||
*
|
||||
* This method zeroes out the name.
|
||||
*/
|
||||
|
||||
|
||||
void _Objects_Clear_name(
|
||||
void *name,
|
||||
uint32_t length
|
||||
|
||||
@@ -55,7 +55,7 @@ void _Objects_MP_Handler_initialization (
|
||||
* This routine place the specified global object in the
|
||||
* specified information table.
|
||||
*/
|
||||
|
||||
|
||||
void _Objects_MP_Open (
|
||||
Objects_Information *information,
|
||||
Objects_MP_Control *the_global_object,
|
||||
|
||||
@@ -73,17 +73,17 @@ SCORE_EXTERN Priority_Bit_map_control
|
||||
*
|
||||
* These may simply be pass throughs to CPU dependent routines.
|
||||
*/
|
||||
|
||||
|
||||
#if ( CPU_USE_GENERIC_BITFIELD_CODE == FALSE )
|
||||
|
||||
#define _Priority_Mask( _bit_number ) \
|
||||
_CPU_Priority_Mask( _bit_number )
|
||||
|
||||
|
||||
#define _Priority_Bits_index( _priority ) \
|
||||
_CPU_Priority_bits_index( _priority )
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __RTEMS_APPLICATION__
|
||||
#include <rtems/score/priority.inl>
|
||||
#endif
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef enum {
|
||||
* The following variable indicates whether or not this is
|
||||
* an multiprocessing system.
|
||||
*/
|
||||
|
||||
|
||||
SCORE_EXTERN boolean _System_state_Is_multiprocessing;
|
||||
|
||||
/*
|
||||
|
||||
@@ -231,19 +231,19 @@ struct Thread_Control_struct {
|
||||
*/
|
||||
|
||||
SCORE_EXTERN void *rtems_ada_self;
|
||||
|
||||
|
||||
/*
|
||||
* The following defines the information control block used to
|
||||
* manage this class of objects.
|
||||
*/
|
||||
|
||||
|
||||
SCORE_EXTERN Objects_Information _Thread_Internal_information;
|
||||
|
||||
|
||||
/*
|
||||
* The following define the thread control pointers used to access
|
||||
* and manipulate the idle thread.
|
||||
*/
|
||||
|
||||
|
||||
SCORE_EXTERN Thread_Control *_Thread_Idle;
|
||||
|
||||
/*
|
||||
@@ -253,9 +253,9 @@ SCORE_EXTERN Thread_Control *_Thread_Idle;
|
||||
* control of the processor can be returned to the environment
|
||||
* which initiated the system.
|
||||
*/
|
||||
|
||||
|
||||
SCORE_EXTERN Context_Control _Thread_BSP_context;
|
||||
|
||||
|
||||
/*
|
||||
* The following declares the dispatch critical section nesting
|
||||
* counter which is used to prevent context switches at inopportune
|
||||
@@ -348,7 +348,7 @@ void _Thread_Handler_initialization (
|
||||
*
|
||||
* WARNING!! No thread should be created before this one.
|
||||
*/
|
||||
|
||||
|
||||
void _Thread_Create_idle( void );
|
||||
|
||||
/*
|
||||
@@ -453,7 +453,7 @@ boolean _Thread_Initialize(
|
||||
* and makes it ready to execute. After this routine executes, the
|
||||
* thread competes with all other threads for CPU time.
|
||||
*/
|
||||
|
||||
|
||||
boolean _Thread_Start(
|
||||
Thread_Control *the_thread,
|
||||
Thread_Start_types the_prototype,
|
||||
@@ -471,9 +471,9 @@ boolean _Thread_Start(
|
||||
* next time this thread executes, it will begin execution at its
|
||||
* original starting point.
|
||||
*/
|
||||
|
||||
|
||||
/* XXX multiple task arg profiles */
|
||||
|
||||
|
||||
boolean _Thread_Restart(
|
||||
Thread_Control *the_thread,
|
||||
void *pointer_argument,
|
||||
@@ -488,7 +488,7 @@ boolean _Thread_Restart(
|
||||
* This routine resets a thread to its initial state but does
|
||||
* not restart it.
|
||||
*/
|
||||
|
||||
|
||||
void _Thread_Reset(
|
||||
Thread_Control *the_thread,
|
||||
void *pointer_argument,
|
||||
@@ -504,7 +504,7 @@ void _Thread_Reset(
|
||||
* thread and removes it from the local object table so no further
|
||||
* operations on this thread are allowed.
|
||||
*/
|
||||
|
||||
|
||||
void _Thread_Close(
|
||||
Objects_Information *information,
|
||||
Thread_Control *the_thread
|
||||
@@ -740,7 +740,7 @@ boolean _Thread_Evaluate_mode( void );
|
||||
* NOTE: If we are not using static inlines, this must be a real
|
||||
* subroutine call.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef RTEMS_INLINES
|
||||
Thread_Control *_Thread_Get (
|
||||
Objects_Id id,
|
||||
@@ -755,7 +755,7 @@ Thread_Control *_Thread_Get (
|
||||
*
|
||||
* This routine is the body of the system idle thread.
|
||||
*/
|
||||
|
||||
|
||||
#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
|
||||
Thread _Thread_Idle_body(
|
||||
uint32_t ignored
|
||||
@@ -770,7 +770,7 @@ Thread _Thread_Idle_body(
|
||||
* This routine iterates over all threads regardless of API and
|
||||
* invokes the specified routine.
|
||||
*/
|
||||
|
||||
|
||||
typedef void (*rtems_per_thread_routine)( Thread_Control * );
|
||||
|
||||
void rtems_iterate_over_all_threads(
|
||||
|
||||
@@ -29,7 +29,7 @@ extern "C" {
|
||||
/*
|
||||
* Constant for indefinite wait.
|
||||
*/
|
||||
|
||||
|
||||
#define THREAD_QUEUE_WAIT_FOREVER WATCHDOG_NO_TIMEOUT
|
||||
|
||||
/*
|
||||
@@ -46,7 +46,7 @@ typedef void ( *Thread_queue_Flush_callout )(
|
||||
* is extracted from a remote thread queue (i.e. it's proxy must
|
||||
* extracted from the remote queue).
|
||||
*/
|
||||
|
||||
|
||||
#if 0
|
||||
typedef void ( *Thread_queue_Extract_callout )(
|
||||
Thread_Control *
|
||||
@@ -108,7 +108,7 @@ void _Thread_queue_Extract(
|
||||
* and ensures that if there is a proxy for this task on
|
||||
* another node, it is also dealt with.
|
||||
*/
|
||||
|
||||
|
||||
boolean _Thread_queue_Extract_with_proxy(
|
||||
Thread_Control *the_thread
|
||||
);
|
||||
|
||||
@@ -38,7 +38,7 @@ typedef enum {
|
||||
* The following enumerated types indicate what happened while the thread
|
||||
* queue was in the synchronization window.
|
||||
*/
|
||||
|
||||
|
||||
typedef enum {
|
||||
THREAD_QUEUE_SYNCHRONIZED,
|
||||
THREAD_QUEUE_NOTHING_HAPPENED,
|
||||
|
||||
@@ -31,54 +31,54 @@ extern "C" {
|
||||
* are invoked at critical points in the life of each thread and
|
||||
* the system as a whole.
|
||||
*/
|
||||
|
||||
|
||||
typedef void User_extensions_routine;
|
||||
|
||||
|
||||
typedef boolean ( *User_extensions_thread_create_extension )(
|
||||
Thread_Control *,
|
||||
Thread_Control *
|
||||
);
|
||||
|
||||
|
||||
typedef User_extensions_routine ( *User_extensions_thread_delete_extension )(
|
||||
Thread_Control *,
|
||||
Thread_Control *
|
||||
);
|
||||
|
||||
|
||||
typedef User_extensions_routine ( *User_extensions_thread_start_extension )(
|
||||
Thread_Control *,
|
||||
Thread_Control *
|
||||
);
|
||||
|
||||
|
||||
typedef User_extensions_routine ( *User_extensions_thread_restart_extension )(
|
||||
Thread_Control *,
|
||||
Thread_Control *
|
||||
);
|
||||
|
||||
|
||||
typedef User_extensions_routine ( *User_extensions_thread_switch_extension )(
|
||||
Thread_Control *,
|
||||
Thread_Control *
|
||||
);
|
||||
|
||||
|
||||
typedef User_extensions_routine (
|
||||
*User_extensions_thread_post_switch_extension )(
|
||||
Thread_Control *
|
||||
);
|
||||
|
||||
|
||||
typedef User_extensions_routine ( *User_extensions_thread_begin_extension )(
|
||||
Thread_Control *
|
||||
);
|
||||
|
||||
|
||||
typedef User_extensions_routine ( *User_extensions_thread_exitted_extension )(
|
||||
Thread_Control *
|
||||
);
|
||||
|
||||
|
||||
typedef User_extensions_routine ( *User_extensions_fatal_extension )(
|
||||
Internal_errors_Source /* the_source */,
|
||||
boolean /* is_internal */,
|
||||
uint32_t /* the_error */
|
||||
);
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
User_extensions_thread_create_extension thread_create;
|
||||
User_extensions_thread_start_extension thread_start;
|
||||
|
||||
@@ -38,7 +38,7 @@ SCORE_EXTERN Heap_Control _Workspace_Area; /* executive heap header */
|
||||
*
|
||||
* This routine performs the initialization necessary for this handler.
|
||||
*/
|
||||
|
||||
|
||||
void _Workspace_Handler_initialization(
|
||||
void *starting_address,
|
||||
uint32_t size
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __RTEMS_SET_ERRNO_h
|
||||
#define __RTEMS_SET_ERRNO_h
|
||||
|
||||
|
||||
#define rtems_set_errno_and_return_minus_one( _error ) \
|
||||
do { errno = (_error); return -1; } while(0)
|
||||
|
||||
|
||||
@@ -20,17 +20,17 @@
|
||||
*
|
||||
* _API_extensions_Initialization
|
||||
*/
|
||||
|
||||
|
||||
void _API_extensions_Initialization( void )
|
||||
{
|
||||
_Chain_Initialize_empty( &_API_extensions_List );
|
||||
}
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _API_extensions_Add
|
||||
*/
|
||||
|
||||
|
||||
void _API_extensions_Add(
|
||||
API_extensions_Control *the_extension
|
||||
)
|
||||
@@ -47,13 +47,13 @@ void _API_extensions_Run_predriver( void )
|
||||
{
|
||||
Chain_Node *the_node;
|
||||
API_extensions_Control *the_extension;
|
||||
|
||||
|
||||
for ( the_node = _API_extensions_List.first ;
|
||||
!_Chain_Is_tail( &_API_extensions_List, the_node ) ;
|
||||
the_node = the_node->next ) {
|
||||
|
||||
|
||||
the_extension = (API_extensions_Control *) the_node;
|
||||
|
||||
|
||||
if ( the_extension->predriver_hook )
|
||||
(*the_extension->predriver_hook)();
|
||||
}
|
||||
@@ -68,13 +68,13 @@ void _API_extensions_Run_postdriver( void )
|
||||
{
|
||||
Chain_Node *the_node;
|
||||
API_extensions_Control *the_extension;
|
||||
|
||||
|
||||
for ( the_node = _API_extensions_List.first ;
|
||||
!_Chain_Is_tail( &_API_extensions_List, the_node ) ;
|
||||
the_node = the_node->next ) {
|
||||
|
||||
|
||||
the_extension = (API_extensions_Control *) the_node;
|
||||
|
||||
|
||||
if ( the_extension->postdriver_hook )
|
||||
(*the_extension->postdriver_hook)();
|
||||
}
|
||||
@@ -89,13 +89,13 @@ void _API_extensions_Run_postswitch( void )
|
||||
{
|
||||
Chain_Node *the_node;
|
||||
API_extensions_Control *the_extension;
|
||||
|
||||
|
||||
for ( the_node = _API_extensions_List.first ;
|
||||
!_Chain_Is_tail( &_API_extensions_List, the_node ) ;
|
||||
the_node = the_node->next ) {
|
||||
|
||||
|
||||
the_extension = (API_extensions_Control *) the_node;
|
||||
|
||||
|
||||
if ( the_extension->postswitch_hook )
|
||||
(*the_extension->postswitch_hook)( _Thread_Executing );
|
||||
}
|
||||
|
||||
@@ -62,35 +62,35 @@ boolean _CORE_message_queue_Initialize(
|
||||
the_message_queue->number_of_pending_messages = 0;
|
||||
the_message_queue->maximum_message_size = maximum_message_size;
|
||||
_CORE_message_queue_Set_notify( the_message_queue, NULL, NULL );
|
||||
|
||||
|
||||
/*
|
||||
* round size up to multiple of a ptr for chain init
|
||||
*/
|
||||
|
||||
|
||||
allocated_message_size = maximum_message_size;
|
||||
if (allocated_message_size & (sizeof(uint32_t ) - 1)) {
|
||||
allocated_message_size += sizeof(uint32_t );
|
||||
allocated_message_size &= ~(sizeof(uint32_t ) - 1);
|
||||
}
|
||||
|
||||
|
||||
message_buffering_required = maximum_pending_messages *
|
||||
(allocated_message_size + sizeof(CORE_message_queue_Buffer_control));
|
||||
|
||||
|
||||
the_message_queue->message_buffers = (CORE_message_queue_Buffer *)
|
||||
_Workspace_Allocate( message_buffering_required );
|
||||
|
||||
|
||||
if (the_message_queue->message_buffers == 0)
|
||||
return FALSE;
|
||||
|
||||
|
||||
_Chain_Initialize (
|
||||
&the_message_queue->Inactive_messages,
|
||||
the_message_queue->message_buffers,
|
||||
maximum_pending_messages,
|
||||
allocated_message_size + sizeof( CORE_message_queue_Buffer_control )
|
||||
);
|
||||
|
||||
|
||||
_Chain_Initialize_empty( &the_message_queue->Pending_messages );
|
||||
|
||||
|
||||
_Thread_queue_Initialize(
|
||||
&the_message_queue->Wait_queue,
|
||||
_CORE_message_queue_Is_priority( the_message_queue_attributes ) ?
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*/
|
||||
|
||||
|
||||
void _CORE_message_queue_Close(
|
||||
CORE_message_queue_Control *the_message_queue,
|
||||
Thread_queue_Flush_callout remote_extract_callout,
|
||||
@@ -67,7 +67,7 @@ void _CORE_message_queue_Close(
|
||||
* we just flushed all waiting threads, we don't have to worry about
|
||||
* the flush satisfying any blocked senders as a side-effect.
|
||||
*/
|
||||
|
||||
|
||||
if ( the_message_queue->number_of_pending_messages != 0 )
|
||||
(void) _CORE_message_queue_Flush_support( the_message_queue );
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* Output parameters:
|
||||
* returns - the number of messages flushed from the queue
|
||||
*/
|
||||
|
||||
|
||||
uint32_t _CORE_message_queue_Flush(
|
||||
CORE_message_queue_Control *the_message_queue
|
||||
)
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* Output parameters:
|
||||
* returns - the number of messages flushed from the queue
|
||||
*/
|
||||
|
||||
|
||||
void _CORE_message_queue_Flush_waiting_threads(
|
||||
CORE_message_queue_Control *the_message_queue
|
||||
)
|
||||
|
||||
@@ -75,7 +75,7 @@ CORE_message_queue_Status _CORE_message_queue_Submit(
|
||||
/*
|
||||
* Is there a thread currently waiting on this message queue?
|
||||
*/
|
||||
|
||||
|
||||
if ( the_message_queue->number_of_pending_messages == 0 ) {
|
||||
the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue );
|
||||
if ( the_thread ) {
|
||||
@@ -86,7 +86,7 @@ CORE_message_queue_Status _CORE_message_queue_Submit(
|
||||
);
|
||||
*(uint32_t *)the_thread->Wait.return_argument_1 = size;
|
||||
the_thread->Wait.count = submit_type;
|
||||
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
|
||||
(*api_message_queue_mp_support) ( the_thread, id );
|
||||
|
||||
@@ -83,9 +83,9 @@ int _CORE_mutex_Seize_interrupt_trylock(
|
||||
{
|
||||
Thread_Control *executing;
|
||||
ISR_Level level = *level_p;
|
||||
|
||||
|
||||
/* disabled when you get here */
|
||||
|
||||
|
||||
executing = _Thread_Executing;
|
||||
executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL;
|
||||
if ( !_CORE_mutex_Is_locked( the_mutex ) ) {
|
||||
|
||||
@@ -110,7 +110,7 @@ CORE_mutex_Status _CORE_mutex_Surrender(
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
if ( !_Objects_Is_local_id( the_thread->Object.id ) ) {
|
||||
|
||||
|
||||
the_mutex->holder = NULL;
|
||||
the_mutex->holder_id = the_thread->Object.id;
|
||||
the_mutex->nest_count = 1;
|
||||
|
||||
@@ -40,18 +40,18 @@
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*/
|
||||
|
||||
|
||||
void _CORE_semaphore_Flush(
|
||||
CORE_semaphore_Control *the_semaphore,
|
||||
Thread_queue_Flush_callout remote_extract_callout,
|
||||
uint32_t status
|
||||
)
|
||||
{
|
||||
|
||||
|
||||
_Thread_queue_Flush(
|
||||
&the_semaphore->Wait_queue,
|
||||
remote_extract_callout,
|
||||
status
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ void *_Heap_Allocate(
|
||||
|
||||
excess = size % the_heap->page_size;
|
||||
the_size = size + the_heap->page_size + HEAP_BLOCK_USED_OVERHEAD;
|
||||
|
||||
|
||||
if ( excess )
|
||||
the_size += the_heap->page_size - excess;
|
||||
|
||||
@@ -90,12 +90,12 @@ void *_Heap_Allocate(
|
||||
the_block->previous->next = the_block->next;
|
||||
ptr = _Heap_Start_of_user_area( the_block );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* round ptr up to a multiple of page size
|
||||
* Have to save the bump amount in the buffer so that free can figure it out
|
||||
*/
|
||||
|
||||
|
||||
offset = the_heap->page_size - (((uint32_t ) ptr) & (the_heap->page_size - 1));
|
||||
ptr = _Addresses_Add_offset( ptr, offset );
|
||||
*(((uint32_t *) ptr) - 1) = offset;
|
||||
|
||||
@@ -41,7 +41,7 @@ Heap_Extend_status _Heap_Extend(
|
||||
{
|
||||
Heap_Block *the_block;
|
||||
uint32_t *p;
|
||||
|
||||
|
||||
/*
|
||||
* The overhead was taken from the original heap memory.
|
||||
*/
|
||||
@@ -106,6 +106,6 @@ Heap_Extend_status _Heap_Extend(
|
||||
*p = sizeof(uint32_t );
|
||||
p++;
|
||||
_Heap_Free( the_heap, p );
|
||||
|
||||
|
||||
return HEAP_EXTEND_SUCCESSFUL;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ Heap_Get_information_status _Heap_Get_information(
|
||||
}
|
||||
|
||||
while (notdone) {
|
||||
|
||||
|
||||
/*
|
||||
* Accumulate size
|
||||
*/
|
||||
@@ -79,7 +79,7 @@ Heap_Get_information_status _Heap_Get_information(
|
||||
the_info->used_blocks++;
|
||||
the_info->used_size += _Heap_Block_size(the_block);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Handle the last block
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,7 @@ boolean _Heap_Size_of_user_area(
|
||||
uint32_t the_size;
|
||||
|
||||
the_block = _Heap_User_block_at( starting_address );
|
||||
|
||||
|
||||
if ( !_Heap_Is_block_in( the_heap, the_block ) ||
|
||||
_Heap_Is_block_free( the_block ) )
|
||||
return( FALSE );
|
||||
|
||||
@@ -88,7 +88,7 @@ void _Heap_Walk(
|
||||
passes++;
|
||||
if (error && (passes > 10))
|
||||
abort();
|
||||
|
||||
|
||||
if (do_dump == TRUE) {
|
||||
printf("PASS: %d Block @ 0x%p Back %d, Front %d",
|
||||
source, the_block,
|
||||
|
||||
@@ -24,7 +24,7 @@ void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
|
||||
uint32_t api_index;
|
||||
Thread_Control *the_thread;
|
||||
Objects_Information *information;
|
||||
|
||||
|
||||
for ( api_index = 1 ;
|
||||
api_index <= OBJECTS_APIS_LAST ;
|
||||
api_index++ ) {
|
||||
@@ -34,13 +34,13 @@ void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
|
||||
if ( information ) {
|
||||
for ( i=1 ; i <= information->maximum ; i++ ) {
|
||||
the_thread = (Thread_Control *)information->local_table[ i ];
|
||||
|
||||
|
||||
if ( !the_thread )
|
||||
continue;
|
||||
|
||||
|
||||
(*routine)(the_thread);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ void _MPCI_Handler_initialization(
|
||||
/*
|
||||
* Register the MP Process Packet routine.
|
||||
*/
|
||||
|
||||
|
||||
_MPCI_Register_packet_processor(
|
||||
MP_PACKET_MPCI_INTERNAL,
|
||||
_MPCI_Internal_packets_Process_packet
|
||||
@@ -103,7 +103,7 @@ void _MPCI_Create_server( void )
|
||||
*/
|
||||
|
||||
_MPCI_Receive_server_tcb = _Thread_Internal_allocate();
|
||||
|
||||
|
||||
_Thread_Initialize(
|
||||
&_Thread_Internal_information,
|
||||
_MPCI_Receive_server_tcb,
|
||||
@@ -117,7 +117,7 @@ void _MPCI_Create_server( void )
|
||||
0, /* all interrupts enabled */
|
||||
_MPCI_Internal_name
|
||||
);
|
||||
|
||||
|
||||
_Thread_Start(
|
||||
_MPCI_Receive_server_tcb,
|
||||
THREAD_START_NUMERIC,
|
||||
@@ -147,11 +147,11 @@ void _MPCI_Initialization ( void )
|
||||
* This routine registers the MPCI packet processor for the
|
||||
* designated object class.
|
||||
*/
|
||||
|
||||
|
||||
void _MPCI_Register_packet_processor(
|
||||
MP_packet_Classes the_class,
|
||||
MPCI_Packet_processor the_packet_processor
|
||||
|
||||
|
||||
)
|
||||
{
|
||||
_MPCI_Packet_processors[ the_class ] = the_packet_processor;
|
||||
@@ -347,41 +347,41 @@ Thread _MPCI_Receive_server(
|
||||
uint32_t ignored
|
||||
)
|
||||
{
|
||||
|
||||
|
||||
MP_packet_Prefix *the_packet;
|
||||
MPCI_Packet_processor the_function;
|
||||
Thread_Control *executing;
|
||||
|
||||
|
||||
executing = _Thread_Executing;
|
||||
|
||||
for ( ; ; ) {
|
||||
|
||||
|
||||
executing->receive_packet = NULL;
|
||||
|
||||
_Thread_Disable_dispatch();
|
||||
_CORE_semaphore_Seize( &_MPCI_Semaphore, 0, TRUE, WATCHDOG_NO_TIMEOUT );
|
||||
_Thread_Enable_dispatch();
|
||||
|
||||
|
||||
for ( ; ; ) {
|
||||
the_packet = _MPCI_Receive_packet();
|
||||
|
||||
|
||||
if ( !the_packet )
|
||||
break;
|
||||
|
||||
|
||||
executing->receive_packet = the_packet;
|
||||
|
||||
|
||||
if ( !_Mp_packet_Is_valid_packet_class ( the_packet->the_class ) )
|
||||
break;
|
||||
|
||||
|
||||
the_function = _MPCI_Packet_processors[ the_packet->the_class ];
|
||||
|
||||
|
||||
if ( !the_function )
|
||||
_Internal_error_Occurred(
|
||||
INTERNAL_ERROR_CORE,
|
||||
TRUE,
|
||||
INTERNAL_ERROR_BAD_PACKET
|
||||
);
|
||||
|
||||
|
||||
(*the_function)( the_packet );
|
||||
}
|
||||
}
|
||||
@@ -394,7 +394,7 @@ Thread _MPCI_Receive_server(
|
||||
* _MPCI_Announce
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
void _MPCI_Announce ( void )
|
||||
{
|
||||
_Thread_Disable_dispatch();
|
||||
@@ -407,32 +407,32 @@ void _MPCI_Announce ( void )
|
||||
* _MPCI_Internal_packets_Send_process_packet
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
void _MPCI_Internal_packets_Send_process_packet (
|
||||
MPCI_Internal_Remote_operations operation
|
||||
)
|
||||
{
|
||||
MPCI_Internal_packet *the_packet;
|
||||
|
||||
|
||||
switch ( operation ) {
|
||||
|
||||
|
||||
case MPCI_PACKETS_SYSTEM_VERIFY:
|
||||
|
||||
|
||||
the_packet = _MPCI_Internal_packets_Get_packet();
|
||||
the_packet->Prefix.the_class = MP_PACKET_MPCI_INTERNAL;
|
||||
the_packet->Prefix.length = sizeof ( MPCI_Internal_packet );
|
||||
the_packet->Prefix.to_convert = sizeof ( MPCI_Internal_packet );
|
||||
the_packet->operation = operation;
|
||||
|
||||
|
||||
the_packet->maximum_nodes = _Objects_Maximum_nodes;
|
||||
|
||||
|
||||
the_packet->maximum_global_objects = _Objects_MP_Maximum_global_objects;
|
||||
|
||||
|
||||
_MPCI_Send_process_packet( MPCI_ALL_NODES, &the_packet->Prefix );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _MPCI_Internal_packets_Send_request_packet
|
||||
@@ -441,7 +441,7 @@ void _MPCI_Internal_packets_Send_process_packet (
|
||||
* packets to be sent by this manager.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _MPCI_Internal_packets_Send_response_packet
|
||||
@@ -450,14 +450,14 @@ void _MPCI_Internal_packets_Send_process_packet (
|
||||
* packets to be sent by this manager.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
*
|
||||
* _MPCI_Internal_packets_Process_packet
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
void _MPCI_Internal_packets_Process_packet (
|
||||
MP_packet_Prefix *the_packet_prefix
|
||||
)
|
||||
@@ -465,33 +465,33 @@ void _MPCI_Internal_packets_Process_packet (
|
||||
MPCI_Internal_packet *the_packet;
|
||||
uint32_t maximum_nodes;
|
||||
uint32_t maximum_global_objects;
|
||||
|
||||
|
||||
the_packet = (MPCI_Internal_packet *) the_packet_prefix;
|
||||
|
||||
|
||||
switch ( the_packet->operation ) {
|
||||
|
||||
|
||||
case MPCI_PACKETS_SYSTEM_VERIFY:
|
||||
|
||||
|
||||
maximum_nodes = the_packet->maximum_nodes;
|
||||
maximum_global_objects = the_packet->maximum_global_objects;
|
||||
if ( maximum_nodes != _Objects_Maximum_nodes ||
|
||||
maximum_global_objects != _Objects_MP_Maximum_global_objects ) {
|
||||
|
||||
|
||||
_MPCI_Return_packet( the_packet_prefix );
|
||||
|
||||
|
||||
_Internal_error_Occurred(
|
||||
INTERNAL_ERROR_CORE,
|
||||
TRUE,
|
||||
INTERNAL_ERROR_INCONSISTENT_MP_INFORMATION
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
_MPCI_Return_packet( the_packet_prefix );
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _MPCI_Internal_packets_Send_object_was_deleted
|
||||
@@ -500,7 +500,7 @@ void _MPCI_Internal_packets_Process_packet (
|
||||
* deleted by this manager.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _MPCI_Internal_packets_Send_extract_proxy
|
||||
@@ -509,13 +509,13 @@ void _MPCI_Internal_packets_Process_packet (
|
||||
* deleted by this manager.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _MPCI_Internal_packets_Get_packet
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
MPCI_Internal_packet *_MPCI_Internal_packets_Get_packet ( void )
|
||||
{
|
||||
return ( (MPCI_Internal_packet *) _MPCI_Get_packet() );
|
||||
|
||||
@@ -46,23 +46,23 @@ Objects_Control *_Objects_Allocate(
|
||||
* If the list is empty then we are out of objects and need to
|
||||
* extend information base.
|
||||
*/
|
||||
|
||||
|
||||
if ( !the_object ) {
|
||||
_Objects_Extend_information( information );
|
||||
the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
|
||||
}
|
||||
|
||||
|
||||
if ( the_object ) {
|
||||
uint32_t block;
|
||||
|
||||
|
||||
block = _Objects_Get_index( the_object->id ) -
|
||||
_Objects_Get_index( information->minimum_id );
|
||||
block /= information->allocation_size;
|
||||
|
||||
|
||||
information->inactive_per_block[ block ]--;
|
||||
information->inactive--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return the_object;
|
||||
}
|
||||
|
||||
@@ -54,13 +54,13 @@ Objects_Control *_Objects_Allocate_by_index(
|
||||
* + The pointer arithmetic is probably too expensive.
|
||||
* + etc.
|
||||
*/
|
||||
|
||||
|
||||
the_object = (Objects_Control *) _Addresses_Add_offset(
|
||||
information->object_blocks[ 0 ],
|
||||
(sizeof_control * (index - 1))
|
||||
);
|
||||
_Chain_Extract( &the_object->Node );
|
||||
|
||||
|
||||
return the_object;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
|
||||
boolean _Objects_Compare_name_raw(
|
||||
void *name_1,
|
||||
void *name_2,
|
||||
@@ -42,7 +42,7 @@ boolean _Objects_Compare_name_raw(
|
||||
uint32_t *name_2_p = (uint32_t *) name_2;
|
||||
uint32_t tmp_length = length / OBJECTS_NAME_ALIGNMENT;
|
||||
#endif
|
||||
|
||||
|
||||
if ( name_1 == name_2 )
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
* Output parameters:
|
||||
* returns - TRUE on a match
|
||||
*/
|
||||
|
||||
|
||||
boolean _Objects_Compare_name_string(
|
||||
void *name_1,
|
||||
void *name_2,
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
|
||||
void _Objects_Copy_name_raw(
|
||||
void *source,
|
||||
void *destination,
|
||||
@@ -40,7 +40,7 @@ void _Objects_Copy_name_raw(
|
||||
uint32_t *source_p = (uint32_t *) source;
|
||||
uint32_t *destination_p = (uint32_t *) destination;
|
||||
uint32_t tmp_length = length / OBJECTS_NAME_ALIGNMENT;
|
||||
|
||||
|
||||
while ( tmp_length-- )
|
||||
*destination_p++ = *source_p++;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
|
||||
void _Objects_Copy_name_string(
|
||||
void *source,
|
||||
void *destination
|
||||
@@ -38,7 +38,7 @@ void _Objects_Copy_name_string(
|
||||
{
|
||||
uint8_t *source_p = (uint8_t *) source;
|
||||
uint8_t *destination_p = (uint8_t *) destination;
|
||||
|
||||
|
||||
*destination_p = '\0';
|
||||
if ( source_p ) {
|
||||
do {
|
||||
|
||||
@@ -59,12 +59,12 @@ void _Objects_Extend_information(
|
||||
minimum_index = _Objects_Get_index( information->minimum_id );
|
||||
index_base = minimum_index;
|
||||
block = 0;
|
||||
|
||||
|
||||
if ( information->maximum < minimum_index )
|
||||
block_count = 0;
|
||||
else {
|
||||
block_count = information->maximum / information->allocation_size;
|
||||
|
||||
|
||||
for ( ; block < block_count; block++ ) {
|
||||
if ( information->object_blocks[ block ] == NULL )
|
||||
break;
|
||||
@@ -85,7 +85,7 @@ void _Objects_Extend_information(
|
||||
Objects_Control **local_table;
|
||||
uint32_t maximum;
|
||||
void *old_tables;
|
||||
|
||||
|
||||
/*
|
||||
* Growing the tables means allocating a new area, doing a copy and
|
||||
* updating the information table.
|
||||
@@ -109,13 +109,13 @@ void _Objects_Extend_information(
|
||||
*/
|
||||
|
||||
block_count++;
|
||||
|
||||
|
||||
maximum = information->maximum + information->allocation_size;
|
||||
|
||||
/*
|
||||
* Allocate the tables and break it up.
|
||||
*/
|
||||
|
||||
|
||||
if ( information->auto_extend ) {
|
||||
object_blocks = (void**)
|
||||
_Workspace_Allocate(
|
||||
@@ -140,28 +140,28 @@ void _Objects_Extend_information(
|
||||
* Break the block into the various sections.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
inactive_per_block = (uint32_t *) _Addresses_Add_offset(
|
||||
object_blocks, block_count * sizeof(void*) );
|
||||
name_table = (Objects_Name *) _Addresses_Add_offset(
|
||||
inactive_per_block, block_count * sizeof(uint32_t ) );
|
||||
local_table = (Objects_Control **) _Addresses_Add_offset(
|
||||
name_table, block_count * sizeof(Objects_Name *) );
|
||||
|
||||
|
||||
/*
|
||||
* Take the block count down. Saves all the (block_count - 1)
|
||||
* in the copies.
|
||||
*/
|
||||
|
||||
block_count--;
|
||||
|
||||
|
||||
if ( information->maximum > minimum_index ) {
|
||||
|
||||
|
||||
/*
|
||||
* Copy each section of the table over. This has to be performed as
|
||||
* separate parts as size of each block has changed.
|
||||
*/
|
||||
|
||||
|
||||
memcpy( object_blocks,
|
||||
information->object_blocks,
|
||||
block_count * sizeof(void*) );
|
||||
@@ -184,11 +184,11 @@ void _Objects_Extend_information(
|
||||
local_table[ index ] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Initialise the new entries in the table.
|
||||
*/
|
||||
|
||||
|
||||
object_blocks[block_count] = NULL;
|
||||
inactive_per_block[block_count] = 0;
|
||||
name_table[block_count] = NULL;
|
||||
@@ -198,11 +198,11 @@ void _Objects_Extend_information(
|
||||
index++ ) {
|
||||
local_table[ index ] = NULL;
|
||||
}
|
||||
|
||||
|
||||
_ISR_Disable( level );
|
||||
|
||||
old_tables = information->object_blocks;
|
||||
|
||||
|
||||
information->object_blocks = object_blocks;
|
||||
information->inactive_per_block = inactive_per_block;
|
||||
information->name_table = name_table;
|
||||
@@ -219,10 +219,10 @@ void _Objects_Extend_information(
|
||||
|
||||
if ( old_tables )
|
||||
_Workspace_Free( old_tables );
|
||||
|
||||
|
||||
block_count++;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Allocate the name table, and the objects
|
||||
*/
|
||||
@@ -244,7 +244,7 @@ void _Objects_Extend_information(
|
||||
(information->allocation_size * information->size)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
name_area = (Objects_Name *) _Addresses_Add_offset(
|
||||
information->object_blocks[ block ],
|
||||
(information->allocation_size * information->size)
|
||||
@@ -267,16 +267,16 @@ void _Objects_Extend_information(
|
||||
*/
|
||||
|
||||
index = index_base;
|
||||
|
||||
|
||||
while ( (the_object = (Objects_Control *) _Chain_Get( &Inactive ) ) != NULL ) {
|
||||
|
||||
|
||||
the_object->id = _Objects_Build_id(
|
||||
information->the_api,
|
||||
information->the_class,
|
||||
_Objects_Local_node,
|
||||
index
|
||||
);
|
||||
|
||||
|
||||
the_object->name = (void *) name_area;
|
||||
|
||||
name_area = _Addresses_Add_offset( name_area, information->name_length );
|
||||
@@ -285,7 +285,7 @@ void _Objects_Extend_information(
|
||||
|
||||
index++;
|
||||
}
|
||||
|
||||
|
||||
information->inactive_per_block[ block ] = information->allocation_size;
|
||||
information->inactive += information->allocation_size;
|
||||
}
|
||||
|
||||
@@ -45,14 +45,14 @@ void _Objects_Free(
|
||||
|
||||
if ( information->auto_extend ) {
|
||||
uint32_t block;
|
||||
|
||||
|
||||
block =
|
||||
_Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id );
|
||||
block /= information->allocation_size;
|
||||
|
||||
|
||||
information->inactive_per_block[ block ]++;
|
||||
information->inactive++;
|
||||
|
||||
|
||||
/*
|
||||
* Check if the threshold level has been met of
|
||||
* 1.5 x allocation_size are free.
|
||||
|
||||
@@ -60,7 +60,7 @@ _Objects_Get_next(
|
||||
{
|
||||
Objects_Control *object;
|
||||
Objects_Id next_id;
|
||||
|
||||
|
||||
if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX)
|
||||
next_id = information->minimum_id;
|
||||
else
|
||||
@@ -73,7 +73,7 @@ _Objects_Get_next(
|
||||
*location_p = OBJECTS_ERROR;
|
||||
goto final;
|
||||
}
|
||||
|
||||
|
||||
/* try to grab one */
|
||||
object = _Objects_Get(information, next_id, location_p);
|
||||
|
||||
|
||||
@@ -41,20 +41,20 @@ Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
|
||||
Objects_Information *information;
|
||||
Objects_Control *the_object = (Objects_Control *) 0;
|
||||
Objects_Locations ignored_location;
|
||||
|
||||
|
||||
if ( !name )
|
||||
return OBJECTS_INVALID_NAME;
|
||||
|
||||
the_api = _Objects_Get_API( id );
|
||||
if ( the_api && the_api > OBJECTS_APIS_LAST )
|
||||
return OBJECTS_INVALID_ID;
|
||||
|
||||
|
||||
the_class = _Objects_Get_class( id );
|
||||
|
||||
information = _Objects_Information_table[ the_api ][ the_class ];
|
||||
if ( !information )
|
||||
return OBJECTS_INVALID_ID;
|
||||
|
||||
|
||||
if ( information->is_string )
|
||||
return OBJECTS_INVALID_ID;
|
||||
|
||||
|
||||
@@ -68,14 +68,14 @@ void _Objects_Initialize_information(
|
||||
information->the_api = the_api;
|
||||
information->the_class = the_class;
|
||||
information->is_string = is_string;
|
||||
|
||||
|
||||
information->local_table = 0;
|
||||
information->name_table = 0;
|
||||
information->inactive_per_block = 0;
|
||||
information->object_blocks = 0;
|
||||
|
||||
|
||||
information->inactive = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Set the entry in the object information table.
|
||||
*/
|
||||
@@ -87,14 +87,14 @@ void _Objects_Initialize_information(
|
||||
*/
|
||||
|
||||
information->size = size;
|
||||
|
||||
|
||||
/*
|
||||
* Are we operating in unlimited, or auto-extend mode
|
||||
*/
|
||||
|
||||
information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? TRUE : FALSE;
|
||||
maximum &= ~OBJECTS_UNLIMITED_OBJECTS;
|
||||
|
||||
|
||||
/*
|
||||
* The allocation unit is the maximum value
|
||||
*/
|
||||
@@ -130,7 +130,7 @@ void _Objects_Initialize_information(
|
||||
information->name_length = name_length;
|
||||
|
||||
_Chain_Initialize_empty( &information->Inactive );
|
||||
|
||||
|
||||
/*
|
||||
* Initialize objects .. if there are any
|
||||
*/
|
||||
@@ -141,17 +141,17 @@ void _Objects_Initialize_information(
|
||||
* Reset the maximum value. It will be updated when the information is
|
||||
* extended.
|
||||
*/
|
||||
|
||||
|
||||
information->maximum = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Always have the maximum size available so the current performance
|
||||
* figures are create are met. If the user moves past the maximum
|
||||
* number then a performance hit is taken.
|
||||
*/
|
||||
|
||||
|
||||
_Objects_Extend_information( information );
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -53,7 +53,7 @@ void _Objects_MP_Handler_initialization (
|
||||
* _Objects_MP_Open
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
void _Objects_MP_Open (
|
||||
Objects_Information *information,
|
||||
Objects_MP_Control *the_global_object,
|
||||
@@ -63,7 +63,7 @@ void _Objects_MP_Open (
|
||||
{
|
||||
the_global_object->Object.id = the_id;
|
||||
the_global_object->name = the_name;
|
||||
|
||||
|
||||
_Chain_Prepend(
|
||||
&information->global_table[ _Objects_Get_node( the_id ) ],
|
||||
&the_global_object->Object.Node
|
||||
|
||||
@@ -56,7 +56,7 @@ void _Objects_Shrink_information(
|
||||
|
||||
index_base = _Objects_Get_index( information->minimum_id );
|
||||
block_count = ( information->maximum - index_base ) / information->allocation_size;
|
||||
|
||||
|
||||
for ( block = 0; block < block_count; block++ ) {
|
||||
if ( information->inactive_per_block[ block ] == information->allocation_size ) {
|
||||
|
||||
@@ -64,7 +64,7 @@ void _Objects_Shrink_information(
|
||||
* XXX - Not to sure how to use a chain where you need to iterate and
|
||||
* and remove elements.
|
||||
*/
|
||||
|
||||
|
||||
the_object = (Objects_Control *) information->Inactive.first;
|
||||
|
||||
/*
|
||||
@@ -76,18 +76,18 @@ void _Objects_Shrink_information(
|
||||
|
||||
if ((index >= index_base) &&
|
||||
(index < (index_base + information->allocation_size))) {
|
||||
|
||||
|
||||
/*
|
||||
* Get the next node before the node is extracted
|
||||
*/
|
||||
|
||||
|
||||
extract_me = the_object;
|
||||
|
||||
if ( !_Chain_Is_last( &the_object->Node ) )
|
||||
the_object = (Objects_Control *) the_object->Node.next;
|
||||
else
|
||||
the_object = NULL;
|
||||
|
||||
|
||||
_Chain_Extract( &extract_me->Node );
|
||||
}
|
||||
else {
|
||||
@@ -106,10 +106,10 @@ void _Objects_Shrink_information(
|
||||
information->inactive_per_block[ block ] = 0;
|
||||
|
||||
information->inactive -= information->allocation_size;
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
index_base += information->allocation_size;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ void _Thread_Handler_initialization(
|
||||
/*
|
||||
* Initialize this class of objects.
|
||||
*/
|
||||
|
||||
|
||||
_Objects_Initialize_information(
|
||||
&_Thread_Internal_information,
|
||||
OBJECTS_INTERNAL_API,
|
||||
|
||||
@@ -62,7 +62,7 @@ void _Thread_Change_priority(
|
||||
* change calls (e.g. rtems_task_set_priority) should always do an
|
||||
* append not a prepend.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Techically, the prepend should conditional on the thread lowering
|
||||
* its priority but that does allow cxd2004 of the acvc 2.0.1 to
|
||||
@@ -75,7 +75,7 @@ void _Thread_Change_priority(
|
||||
new_priority >= the_thread->current_priority )
|
||||
prepend_it = TRUE;
|
||||
*/
|
||||
|
||||
|
||||
_Thread_Set_transient( the_thread );
|
||||
|
||||
if ( the_thread->current_priority != new_priority )
|
||||
|
||||
@@ -56,7 +56,7 @@ void _Thread_Clear_state(
|
||||
|
||||
_ISR_Disable( level );
|
||||
current_state = the_thread->current_state;
|
||||
|
||||
|
||||
if ( current_state & state ) {
|
||||
current_state =
|
||||
the_thread->current_state = _States_Clear( state, current_state );
|
||||
|
||||
@@ -35,18 +35,18 @@
|
||||
* thread and removes it from the local object table so no further
|
||||
* operations on this thread are allowed.
|
||||
*/
|
||||
|
||||
|
||||
void _Thread_Close(
|
||||
Objects_Information *information,
|
||||
Thread_Control *the_thread
|
||||
)
|
||||
{
|
||||
_User_extensions_Thread_delete( the_thread );
|
||||
|
||||
|
||||
_Objects_Close( information, &the_thread->Object );
|
||||
|
||||
|
||||
_Thread_Set_state( the_thread, STATES_TRANSIENT );
|
||||
|
||||
|
||||
if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) {
|
||||
if ( _Watchdog_Is_active( &the_thread->Timer ) )
|
||||
(void) _Watchdog_Remove( &the_thread->Timer );
|
||||
|
||||
@@ -43,26 +43,26 @@ void _Thread_Create_idle( void )
|
||||
* fields not explicitly assigned were explicitly zeroed by
|
||||
* _Workspace_Initialization.
|
||||
*/
|
||||
|
||||
|
||||
_Thread_Idle = _Thread_Internal_allocate();
|
||||
|
||||
|
||||
/*
|
||||
* Initialize the IDLE task.
|
||||
*/
|
||||
|
||||
|
||||
#if (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
|
||||
idle = (void *) _CPU_Thread_Idle_body;
|
||||
#else
|
||||
idle = (void *) _Thread_Idle_body;
|
||||
#endif
|
||||
|
||||
|
||||
if ( _CPU_Table.idle_task )
|
||||
idle = _CPU_Table.idle_task;
|
||||
|
||||
|
||||
idle_task_stack_size = _CPU_Table.idle_task_stack_size;
|
||||
if ( idle_task_stack_size < STACK_MINIMUM_SIZE )
|
||||
idle_task_stack_size = STACK_MINIMUM_SIZE;
|
||||
|
||||
|
||||
_Thread_Initialize(
|
||||
&_Thread_Internal_information,
|
||||
_Thread_Idle,
|
||||
@@ -76,15 +76,15 @@ void _Thread_Create_idle( void )
|
||||
0, /* all interrupts enabled */
|
||||
(Objects_Name) _Thread_Idle_name
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
* WARNING!!! This is necessary to "kick" start the system and
|
||||
* MUST be done before _Thread_Start is invoked.
|
||||
*/
|
||||
|
||||
|
||||
_Thread_Heir =
|
||||
_Thread_Executing = _Thread_Idle;
|
||||
|
||||
|
||||
_Thread_Start(
|
||||
_Thread_Idle,
|
||||
THREAD_START_NUMERIC,
|
||||
@@ -92,5 +92,5 @@ void _Thread_Create_idle( void )
|
||||
NULL,
|
||||
0
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -137,5 +137,5 @@ void _Thread_Dispatch( void )
|
||||
executing->do_post_task_switch_extension = FALSE;
|
||||
_API_extensions_Run_postswitch();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -47,35 +47,35 @@ Thread_Control *_Thread_Get (
|
||||
uint32_t the_class;
|
||||
Objects_Information *information;
|
||||
Thread_Control *tp = (Thread_Control *) 0;
|
||||
|
||||
|
||||
if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
|
||||
_Thread_Disable_dispatch();
|
||||
*location = OBJECTS_LOCAL;
|
||||
tp = _Thread_Executing;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
the_api = _Objects_Get_API( id );
|
||||
if ( the_api && the_api > OBJECTS_APIS_LAST ) {
|
||||
*location = OBJECTS_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
the_class = _Objects_Get_class( id );
|
||||
if ( the_class != 1 ) { /* threads are always first class :) */
|
||||
*location = OBJECTS_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
information = _Objects_Information_table[ the_api ][ the_class ];
|
||||
|
||||
|
||||
if ( !information ) {
|
||||
*location = OBJECTS_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
tp = (Thread_Control *) _Objects_Get( information, id, location );
|
||||
|
||||
|
||||
done:
|
||||
return tp;
|
||||
}
|
||||
|
||||
@@ -68,14 +68,14 @@ void _Thread_Handler( void )
|
||||
#if defined(__USE__MAIN__)
|
||||
extern void _main(void);
|
||||
#endif
|
||||
|
||||
|
||||
executing = _Thread_Executing;
|
||||
|
||||
|
||||
/*
|
||||
* have to put level into a register for those cpu's that use
|
||||
* inline asm here
|
||||
*/
|
||||
|
||||
|
||||
level = executing->Start.isr_level;
|
||||
_ISR_Set_level(level);
|
||||
|
||||
@@ -100,9 +100,9 @@ void _Thread_Handler( void )
|
||||
* 'switch' extensions can run. This means must keep dispatch
|
||||
* disabled until all 'begin' extensions complete.
|
||||
*/
|
||||
|
||||
|
||||
_User_extensions_Thread_begin( executing );
|
||||
|
||||
|
||||
/*
|
||||
* At this point, the dispatch disable level BETTER be 1.
|
||||
*/
|
||||
@@ -117,7 +117,7 @@ void _Thread_Handler( void )
|
||||
__main ();
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
switch ( executing->Start.prototype ) {
|
||||
case THREAD_START_NUMERIC:
|
||||
executing->Wait.return_argument =
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
*
|
||||
* Output parameters: NONE
|
||||
*/
|
||||
|
||||
|
||||
#if (CPU_PROVIDES_IDLE_THREAD_BODY == FALSE)
|
||||
Thread _Thread_Idle_body(
|
||||
uint32_t ignored
|
||||
|
||||
@@ -75,7 +75,7 @@ boolean _Thread_Initialize(
|
||||
actual_stack_size = stack_size;
|
||||
|
||||
actual_stack_size = _Thread_Stack_Allocate( the_thread, actual_stack_size );
|
||||
|
||||
|
||||
if ( !actual_stack_size )
|
||||
return FALSE; /* stack allocation failed */
|
||||
|
||||
@@ -96,7 +96,7 @@ boolean _Thread_Initialize(
|
||||
/*
|
||||
* Allocate the floating point area for this thread
|
||||
*/
|
||||
|
||||
|
||||
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
|
||||
if ( is_fp ) {
|
||||
|
||||
@@ -117,9 +117,9 @@ boolean _Thread_Initialize(
|
||||
/*
|
||||
* Clear the libc reent hook.
|
||||
*/
|
||||
|
||||
|
||||
the_thread->libc_reent = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* Allocate the extensions area for this thread
|
||||
*/
|
||||
@@ -141,7 +141,7 @@ boolean _Thread_Initialize(
|
||||
}
|
||||
} else
|
||||
extensions_area = NULL;
|
||||
|
||||
|
||||
the_thread->extensions = (void **) extensions_area;
|
||||
|
||||
/*
|
||||
@@ -185,7 +185,7 @@ boolean _Thread_Initialize(
|
||||
the_thread->real_priority = priority;
|
||||
the_thread->Start.initial_priority = priority;
|
||||
the_thread->ticks_executed = 0;
|
||||
|
||||
|
||||
_Thread_Set_priority( the_thread, priority );
|
||||
|
||||
/*
|
||||
@@ -214,5 +214,5 @@ boolean _Thread_Initialize(
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -183,18 +183,18 @@ synchronize:
|
||||
* enter a thread queue critical section.
|
||||
*/
|
||||
break;
|
||||
|
||||
|
||||
case THREAD_QUEUE_NOTHING_HAPPENED:
|
||||
/*
|
||||
* This should never happen. All of this was dealt with above.
|
||||
*/
|
||||
break;
|
||||
|
||||
|
||||
case THREAD_QUEUE_TIMEOUT:
|
||||
the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status;
|
||||
_ISR_Enable( level );
|
||||
break;
|
||||
|
||||
|
||||
case THREAD_QUEUE_SATISFIED:
|
||||
if ( _Watchdog_Is_active( &the_thread->Timer ) ) {
|
||||
_Watchdog_Deactivate( &the_thread->Timer );
|
||||
@@ -204,15 +204,15 @@ synchronize:
|
||||
_ISR_Enable( level );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Global objects with thread queue's should not be operated on from an
|
||||
* ISR. But the sync code still must allow short timeouts to be processed
|
||||
* correctly.
|
||||
*/
|
||||
|
||||
|
||||
_Thread_Unblock( the_thread );
|
||||
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
|
||||
_Thread_MP_Free_proxy( the_thread );
|
||||
|
||||
@@ -68,5 +68,5 @@ void _Thread_queue_Extract_fifo(
|
||||
if ( !_Objects_Is_local_id( the_thread->Object.id ) )
|
||||
_Thread_MP_Free_proxy( the_thread );
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
*
|
||||
* XXX
|
||||
*/
|
||||
|
||||
|
||||
boolean _Thread_queue_Extract_with_proxy(
|
||||
Thread_Control *the_thread
|
||||
)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* not actually restart it. Some APIs do this in separate
|
||||
* operations and this division helps support this.
|
||||
*/
|
||||
|
||||
|
||||
void _Thread_Reset(
|
||||
Thread_Control *the_thread,
|
||||
void *pointer_argument,
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* next time this thread executes, it will begin execution at its
|
||||
* original starting point.
|
||||
*/
|
||||
|
||||
|
||||
boolean _Thread_Restart(
|
||||
Thread_Control *the_thread,
|
||||
void *pointer_argument,
|
||||
@@ -43,22 +43,22 @@ boolean _Thread_Restart(
|
||||
)
|
||||
{
|
||||
if ( !_States_Is_dormant( the_thread->current_state ) ) {
|
||||
|
||||
|
||||
_Thread_Set_transient( the_thread );
|
||||
|
||||
_Thread_Reset( the_thread, pointer_argument, numeric_argument );
|
||||
|
||||
|
||||
_Thread_Load_environment( the_thread );
|
||||
|
||||
|
||||
_Thread_Ready( the_thread );
|
||||
|
||||
|
||||
_User_extensions_Thread_restart( the_thread );
|
||||
|
||||
|
||||
if ( _Thread_Is_executing ( the_thread ) )
|
||||
_Thread_Restart_self();
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ void _Thread_Resume(
|
||||
States_Control current_state;
|
||||
|
||||
_ISR_Disable( level );
|
||||
|
||||
|
||||
if ( force == TRUE )
|
||||
the_thread->suspend_count = 0;
|
||||
else
|
||||
|
||||
@@ -42,10 +42,10 @@ uint32_t _Thread_Stack_Allocate(
|
||||
)
|
||||
{
|
||||
void *stack_addr = 0;
|
||||
|
||||
|
||||
if ( !_Stack_Is_enough( stack_size ) )
|
||||
stack_size = STACK_MINIMUM_SIZE;
|
||||
|
||||
|
||||
/*
|
||||
* Call ONLY the CPU table stack allocate hook, _or_ the
|
||||
* the RTEMS workspace allocate. This is so the stack free
|
||||
@@ -71,11 +71,11 @@ uint32_t _Thread_Stack_Allocate(
|
||||
stack_size = _Stack_Adjust_size( stack_size );
|
||||
stack_addr = _Workspace_Allocate( stack_size );
|
||||
}
|
||||
|
||||
|
||||
if ( !stack_addr )
|
||||
stack_size = 0;
|
||||
|
||||
|
||||
the_thread->Start.stack = stack_addr;
|
||||
|
||||
|
||||
return stack_size;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* and makes it ready to execute. After this routine executes, the
|
||||
* thread competes with all other threads for CPU time.
|
||||
*/
|
||||
|
||||
|
||||
boolean _Thread_Start(
|
||||
Thread_Control *the_thread,
|
||||
Thread_Start_types the_prototype,
|
||||
@@ -45,22 +45,22 @@ boolean _Thread_Start(
|
||||
)
|
||||
{
|
||||
if ( _States_Is_dormant( the_thread->current_state ) ) {
|
||||
|
||||
|
||||
the_thread->Start.entry_point = (Thread_Entry) entry_point;
|
||||
|
||||
|
||||
the_thread->Start.prototype = the_prototype;
|
||||
the_thread->Start.pointer_argument = pointer_argument;
|
||||
the_thread->Start.numeric_argument = numeric_argument;
|
||||
|
||||
|
||||
_Thread_Load_environment( the_thread );
|
||||
|
||||
|
||||
_Thread_Ready( the_thread );
|
||||
|
||||
|
||||
_User_extensions_Thread_start( the_thread );
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
return FALSE;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ void _Thread_Start_multitasking( void )
|
||||
* Ignore the CPU_USE_DEFERRED_FP_SWITCH because we must always
|
||||
* switch in the first thread if it is FP.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
|
||||
/*
|
||||
|
||||
@@ -28,13 +28,13 @@ boolean _User_extensions_Thread_create (
|
||||
Chain_Node *the_node;
|
||||
User_extensions_Control *the_extension;
|
||||
boolean status;
|
||||
|
||||
|
||||
for ( the_node = _User_extensions_List.first ;
|
||||
!_Chain_Is_tail( &_User_extensions_List, the_node ) ;
|
||||
the_node = the_node->next ) {
|
||||
|
||||
|
||||
the_extension = (User_extensions_Control *) the_node;
|
||||
|
||||
|
||||
if ( the_extension->Callouts.thread_create != NULL ) {
|
||||
status = (*the_extension->Callouts.thread_create)(
|
||||
_Thread_Executing,
|
||||
@@ -44,7 +44,7 @@ boolean _User_extensions_Thread_create (
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -52,20 +52,20 @@ boolean _User_extensions_Thread_create (
|
||||
*
|
||||
* _User_extensions_Thread_delete
|
||||
*/
|
||||
|
||||
|
||||
void _User_extensions_Thread_delete (
|
||||
Thread_Control *the_thread
|
||||
)
|
||||
{
|
||||
Chain_Node *the_node;
|
||||
User_extensions_Control *the_extension;
|
||||
|
||||
|
||||
for ( the_node = _User_extensions_List.last ;
|
||||
!_Chain_Is_head( &_User_extensions_List, the_node ) ;
|
||||
the_node = the_node->previous ) {
|
||||
|
||||
|
||||
the_extension = (User_extensions_Control *) the_node;
|
||||
|
||||
|
||||
if ( the_extension->Callouts.thread_delete != NULL )
|
||||
(*the_extension->Callouts.thread_delete)(
|
||||
_Thread_Executing,
|
||||
@@ -73,26 +73,26 @@ void _User_extensions_Thread_delete (
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _User_extensions_Thread_start
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
void _User_extensions_Thread_start (
|
||||
Thread_Control *the_thread
|
||||
)
|
||||
{
|
||||
Chain_Node *the_node;
|
||||
User_extensions_Control *the_extension;
|
||||
|
||||
|
||||
for ( the_node = _User_extensions_List.first ;
|
||||
!_Chain_Is_tail( &_User_extensions_List, the_node ) ;
|
||||
the_node = the_node->next ) {
|
||||
|
||||
|
||||
the_extension = (User_extensions_Control *) the_node;
|
||||
|
||||
|
||||
if ( the_extension->Callouts.thread_start != NULL )
|
||||
(*the_extension->Callouts.thread_start)(
|
||||
_Thread_Executing,
|
||||
@@ -100,26 +100,26 @@ void _User_extensions_Thread_start (
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _User_extensions_Thread_restart
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
void _User_extensions_Thread_restart (
|
||||
Thread_Control *the_thread
|
||||
)
|
||||
{
|
||||
Chain_Node *the_node;
|
||||
User_extensions_Control *the_extension;
|
||||
|
||||
|
||||
for ( the_node = _User_extensions_List.first ;
|
||||
!_Chain_Is_tail( &_User_extensions_List, the_node ) ;
|
||||
the_node = the_node->next ) {
|
||||
|
||||
|
||||
the_extension = (User_extensions_Control *) the_node;
|
||||
|
||||
|
||||
if ( the_extension->Callouts.thread_restart != NULL )
|
||||
(*the_extension->Callouts.thread_restart)(
|
||||
_Thread_Executing,
|
||||
@@ -127,49 +127,49 @@ void _User_extensions_Thread_restart (
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _User_extensions_Thread_begin
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
void _User_extensions_Thread_begin (
|
||||
Thread_Control *executing
|
||||
)
|
||||
{
|
||||
Chain_Node *the_node;
|
||||
User_extensions_Control *the_extension;
|
||||
|
||||
|
||||
for ( the_node = _User_extensions_List.first ;
|
||||
!_Chain_Is_tail( &_User_extensions_List, the_node ) ;
|
||||
the_node = the_node->next ) {
|
||||
|
||||
|
||||
the_extension = (User_extensions_Control *) the_node;
|
||||
|
||||
|
||||
if ( the_extension->Callouts.thread_begin != NULL )
|
||||
(*the_extension->Callouts.thread_begin)( executing );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _User_extensions_Thread_exitted
|
||||
*/
|
||||
|
||||
|
||||
void _User_extensions_Thread_exitted (
|
||||
Thread_Control *executing
|
||||
)
|
||||
{
|
||||
Chain_Node *the_node;
|
||||
User_extensions_Control *the_extension;
|
||||
|
||||
|
||||
for ( the_node = _User_extensions_List.last ;
|
||||
!_Chain_Is_head( &_User_extensions_List, the_node ) ;
|
||||
the_node = the_node->previous ) {
|
||||
|
||||
|
||||
the_extension = (User_extensions_Control *) the_node;
|
||||
|
||||
|
||||
if ( the_extension->Callouts.thread_exitted != NULL )
|
||||
(*the_extension->Callouts.thread_exitted)( executing );
|
||||
}
|
||||
@@ -179,7 +179,7 @@ void _User_extensions_Thread_exitted (
|
||||
*
|
||||
* _User_extensions_Fatal
|
||||
*/
|
||||
|
||||
|
||||
void _User_extensions_Fatal (
|
||||
Internal_errors_Source the_source,
|
||||
boolean is_internal,
|
||||
@@ -188,13 +188,13 @@ void _User_extensions_Fatal (
|
||||
{
|
||||
Chain_Node *the_node;
|
||||
User_extensions_Control *the_extension;
|
||||
|
||||
|
||||
for ( the_node = _User_extensions_List.last ;
|
||||
!_Chain_Is_head( &_User_extensions_List, the_node ) ;
|
||||
the_node = the_node->previous ) {
|
||||
|
||||
|
||||
the_extension = (User_extensions_Control *) the_node;
|
||||
|
||||
|
||||
if ( the_extension->Callouts.fatal != NULL )
|
||||
(*the_extension->Callouts.fatal)( the_source, is_internal, the_error );
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ void _Watchdog_Insert(
|
||||
Watchdog_Control *after;
|
||||
uint32_t insert_isr_nest_level;
|
||||
Watchdog_Interval delta_interval;
|
||||
|
||||
|
||||
|
||||
insert_isr_nest_level = _ISR_Nest_level;
|
||||
the_watchdog->state = WATCHDOG_BEING_INSERTED;
|
||||
|
||||
@@ -39,7 +39,7 @@ Watchdog_States _Watchdog_Remove(
|
||||
break;
|
||||
|
||||
case WATCHDOG_BEING_INSERTED:
|
||||
|
||||
|
||||
/*
|
||||
* It is not actually on the chain so just change the state and
|
||||
* the Insert operation we interrupted will be aborted.
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*
|
||||
* _Workspace_Handler_initialization
|
||||
*/
|
||||
|
||||
|
||||
void _Workspace_Handler_initialization(
|
||||
void *starting_address,
|
||||
uint32_t size
|
||||
@@ -32,28 +32,28 @@ void _Workspace_Handler_initialization(
|
||||
uint32_t *zero_out_array;
|
||||
uint32_t index;
|
||||
uint32_t memory_available;
|
||||
|
||||
|
||||
if ( !starting_address || !_Addresses_Is_aligned( starting_address ) )
|
||||
_Internal_error_Occurred(
|
||||
INTERNAL_ERROR_CORE,
|
||||
TRUE,
|
||||
INTERNAL_ERROR_INVALID_WORKSPACE_ADDRESS
|
||||
);
|
||||
|
||||
|
||||
if ( _CPU_Table.do_zero_of_workspace ) {
|
||||
for( zero_out_array = (uint32_t *) starting_address, index = 0 ;
|
||||
index < size / sizeof( uint32_t ) ;
|
||||
index++ )
|
||||
zero_out_array[ index ] = 0;
|
||||
}
|
||||
|
||||
|
||||
memory_available = _Heap_Initialize(
|
||||
&_Workspace_Area,
|
||||
starting_address,
|
||||
size,
|
||||
CPU_HEAP_ALIGNMENT
|
||||
);
|
||||
|
||||
|
||||
if ( memory_available == 0 )
|
||||
_Internal_error_Occurred(
|
||||
INTERNAL_ERROR_CORE,
|
||||
|
||||
Reference in New Issue
Block a user