Changeset 641 for trunk/kernel/kern/thread.h
- Timestamp:
- Oct 10, 2019, 1:42:04 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/thread.h
r635 r641 28 28 #include <hal_kernel_types.h> 29 29 #include <shared_syscalls.h> 30 #include <shared_almos.h> 30 31 #include <hal_special.h> 31 32 #include <hal_kentry.h> … … 95 96 96 97 /*************************************************************************************** 97 * This structure defines thread instrumentation informations.98 **************************************************************************************/99 100 typedef struct thread_info_s101 {102 uint32_t false_pgfault_nr; /*! number of local page fault */103 uint32_t local_pgfault_nr; /*! number of local page fault */104 uint32_t global_pgfault_nr; /*! number of global page fault */105 uint32_t false_pgfault_cost; /*! cumulated cost */106 uint32_t local_pgfault_cost; /*! cumulated cost */107 uint32_t global_pgfault_cost; /*! cumulated cost */108 109 cycle_t last_cycle; /*! last cycle counter value (date) */110 cycle_t usr_cycles; /*! user execution duration (cycles) */111 cycle_t sys_cycles; /*! system execution duration (cycles) */112 }113 thread_info_t;114 115 /***************************************************************************************116 98 * This structure defines a thread descriptor. 117 99 * It is used for both the user threads and the kernel threads. … … 119 101 * - The TRDID 16 LSB bits contain the LTID (Local Thread Index). 120 102 * - The TRDID 16 MSB bits contain the CXY of cluster containing the thread. 121 * The main thread LTID value is always 0.103 * For the main thread the LTID value is always 0, in the owner cluster. 122 104 * The LTID is used to index the th_tbl[] array in the local process descriptor. 123 105 * This TRDID is computed by the process_register_thread() function, when the user 124 106 * thread is registered in the local copy of the process descriptor. 125 107 * 126 * WARNING (1) Don't modify the first 4 fields order, as this order is used by the 127 * hal_kentry assembly code for the TSAR architectures. 128 * 129 * WARNING (2) Most of the thread state is private and accessed only by this thread, 130 * but some fields are shared, and can be modified by other threads. 131 * - the "blocked" bit_vector can be modified by another thread 132 * running in another cluster (using atomic instructions), 133 * to change this thread scheduling status. 134 * - the "flags" bit_vector can be modified by another thread 135 * running in another cluster (using atomic instructions), 136 * to register requests such as ACK or DELETE. 137 * - the "join_xp" field can be modified by the joining thread, 138 * and this rendez-vous is protected by the dedicated "join_lock". 139 * 140 * WARNING (3) When this thread is blocked on a shared resource (queuelock, condvar, 141 * or chdev), it registers in the associated waiting queue, using the 142 * "wait_list" (local list) or "wait_xlist" (trans-cluster list) fields. 108 * Implementation notes: 109 * 110 * (1) Don't modify the first 4 fields order, as this order is used by the 111 * hal_kentry assembly code for the TSAR architectures. 112 * 113 * (2) Most of the thread state is private and accessed only by this thread, 114 * but some fields are shared, and can be modified by other threads. 115 * - the "blocked" bit_vector can be modified by another thread 116 * running in another cluster (using atomic instructions), 117 * to change this thread scheduling status. 118 * - the "flags" bit_vector can be modified by another thread 119 * running in another cluster (using atomic instructions), 120 * to register requests such as ACK or DELETE. 121 * - the "join_xp" field can be modified by the joining thread, 122 * and this rendez-vous is protected by the dedicated "join_lock". 123 * 124 * (3) When this thread is blocked on a shared resource (queuelock, condvar, 125 * or chdev), it registers in the associated waiting queue, using the 126 * "wait_list" (local list) or "wait_xlist" (trans-cluster list) fields. 127 * 128 * (4) The thread_info_t structure is defined in the shared_almos.h file in the 129 * /kernel/syscall/shared_include directory. 143 130 **************************************************************************************/ 144 131
Note: See TracChangeset
for help on using the changeset viewer.