RTEMS CPU Kit with SuperCore
4.11.3
|
![]() |
Files | |
file | execvp.c |
execvp() - POSIX 1003.1b 3.1.2 | |
file | key.c |
POSIX Keys Manager Initialization. | |
file | keyrundestructors.c |
Thread-Specific Data Key Create. | |
Data Structures | |
struct | POSIX_Keys_Key_value_pair |
Represents POSIX key and value pair. More... | |
struct | POSIX_Keys_Control |
The data structure used to manage a POSIX key. More... | |
Macros | |
#define | POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR(node) RTEMS_CONTAINER_OF( node, POSIX_Keys_Key_value_pair, Key_value_lookup_node ) |
Functions | |
void | _POSIX_Key_Manager_initialization (void) |
POSIX key manager initialization. More... | |
RBTree_Compare_result | _POSIX_Keys_Key_value_compare (const RBTree_Node *node1, const RBTree_Node *node2) |
POSIX keys Red-Black tree node comparison. More... | |
void | _POSIX_Keys_Run_destructors (Thread_Control *thread) |
Create thread-specific data POSIX key. More... | |
void | _POSIX_Keys_Free_memory (POSIX_Keys_Control *the_key) |
Free a POSIX key table memory. More... | |
RTEMS_INLINE_ROUTINE void | _POSIX_Keys_Free (POSIX_Keys_Control *the_key) |
Free a POSIX keys control block. More... | |
RTEMS_INLINE_ROUTINE POSIX_Keys_Control * | _POSIX_Keys_Allocate (void) |
Allocate a keys control block. More... | |
RTEMS_INLINE_ROUTINE POSIX_Keys_Control * | _POSIX_Keys_Get (pthread_key_t id, Objects_Locations *location) |
Get a keys control block. More... | |
POSIX_Keys_Key_value_pair * | _POSIX_Keys_Key_value_pair_allocate (void) |
RTEMS_INLINE_ROUTINE void | _POSIX_Keys_Key_value_pair_free (POSIX_Keys_Key_value_pair *key_value_pair) |
RTEMS_INLINE_ROUTINE RBTree_Node * | _POSIX_Keys_Find (pthread_key_t key, Thread_Control *thread) |
RTEMS_INLINE_ROUTINE void | _POSIX_Keys_Free_key_value_pair (POSIX_Keys_Key_value_pair *key_value_pair) |
Variables | |
POSIX_EXTERN Objects_Information | _POSIX_Keys_Information |
The information control block used to manage this class of objects. | |
RBTree_Control | _POSIX_Keys_Key_value_lookup_tree |
The rbtree control block used to manage all key values. | |
POSIX_EXTERN Freechain_Control | _POSIX_Keys_Keypool |
This freechain is used as a memory pool for POSIX_Keys_Key_value_pair. | |
void _POSIX_Key_Manager_initialization | ( | void | ) |
POSIX key manager initialization.
This routine performs the initialization necessary for this manager.
POSIX key manager initialization.
References _Objects_Initialize_information(), and _POSIX_Keys_Information.
RTEMS_INLINE_ROUTINE POSIX_Keys_Control* _POSIX_Keys_Allocate | ( | void | ) |
Allocate a keys control block.
This function allocates a keys control block from the inactive chain of free keys control blocks.
References _Objects_Allocate().
Referenced by pthread_key_create().
RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free | ( | POSIX_Keys_Control * | the_key | ) |
Free a POSIX keys control block.
Free a keys control block.
This routine frees a keys control block to the inactive chain of free keys control blocks.
[in] | the_key | is a pointer to the POSIX key to free. |
This routine frees a keys control block to the inactive chain of free keys control blocks.
References _Objects_Free(), and POSIX_Keys_Control::Object.
void _POSIX_Keys_Free_memory | ( | POSIX_Keys_Control * | the_key | ) |
Free a POSIX key table memory.
This memory frees the key table memory associated with the_key.
[in] | the_key | is a pointer to the POSIX key to free the table memory of. |
find the smallest thread_id node in the rbtree.
delete all nodes belongs to the_key from the rbtree and chain.
RTEMS_INLINE_ROUTINE POSIX_Keys_Control* _POSIX_Keys_Get | ( | pthread_key_t | id, |
Objects_Locations * | location | ||
) |
Get a keys control block.
This function maps key IDs to key control blocks. If ID corresponds to a local keys, then it returns the_key control pointer which maps to ID and location is set to OBJECTS_LOCAL. if the keys ID is global and resides on a remote node, then location is set to OBJECTS_REMOTE, and the_key is undefined. Otherwise, location is set to OBJECTS_ERROR and the_key is undefined.
References _Objects_Get().
RBTree_Compare_result _POSIX_Keys_Key_value_compare | ( | const RBTree_Node * | node1, |
const RBTree_Node * | node2 | ||
) |
POSIX keys Red-Black tree node comparison.
This routine compares the rbtree node
POSIX keys Red-Black tree node comparison.
if either of the input nodes's thread_id member is 0, then it will only compare the pthread_key_t member. That is when we pass thread_id = 0 node as a search node, the search is done only by pthread_key_t.
[in] | node1 | The node to be compared |
[in] | node2 | The node to be compared |
positive | if first node has higher key than second |
negative | if lower |
0 | if equal,and for all the thread id is unique, then return 0 is impossible |
void _POSIX_Keys_Run_destructors | ( | Thread_Control * | thread | ) |
Create thread-specific data POSIX key.
This function executes all the destructors associated with the thread's keys. This function will execute until all values have been set to NULL.
[in] | thread | is a pointer to the thread whose keys should have all their destructors run. |
NOTE: This is the routine executed when a thread exits to run through all the keys and do the destructor action.
remove key from rbtree and chain. here Chain_Node *iter can be convert to POSIX_Keys_Key_value_pair *, because Chain_Node is the first member of POSIX_Keys_Key_value_pair structure.
run key value's destructor if destructor and value are both non-null.