Changeset d4d36f9 in mainline for kernel/generic/include
- Timestamp:
- 2012-07-30T05:23:06Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 452e91b
- Parents:
- f0fcb04
- Location:
- kernel/generic/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/arch.h
rf0fcb04 rd4d36f9 38 38 #include <arch/arch.h> /* arch_pre_main() */ 39 39 #include <arch/asm.h> /* get_stack_base() */ 40 #include <config.h> 40 41 41 42 … … 69 70 typedef struct { 70 71 size_t preemption; /**< Preemption disabled counter and flag. */ 72 #ifdef RCU_PREEMPT_A 73 size_t rcu_nesting; /**< RCU nesting count and flag. */ 74 #endif 71 75 struct thread *thread; /**< Current thread. */ 72 76 struct task *task; /**< Current task. */ -
kernel/generic/include/synch/rcu.h
rf0fcb04 rd4d36f9 123 123 extern void _rcu_synchronize(bool expedite); 124 124 125 126 #ifdef RCU_PREEMPT_A 127 128 #define RCU_CNT_INC (1 << 1) 129 #define RCU_WAS_PREEMPTED (1 << 0) 130 131 /* Fwd. decl. because of inlining. */ 132 void _rcu_preempted_unlock(void); 133 134 /** Delimits the start of an RCU reader critical section. 135 * 136 * Reader sections may be nested and are preemptable. You must not 137 * however block/sleep within reader sections. 138 */ 139 static inline void rcu_read_lock(void) 140 { 141 THE->rcu_nesting += RCU_CNT_INC; 142 } 143 144 /** Delimits the end of an RCU reader critical section. */ 145 static inline void rcu_read_unlock(void) 146 { 147 THE->rcu_nesting -= RCU_CNT_INC; 148 149 if (RCU_WAS_PREEMPTED == THE->rcu_nesting) { 150 _rcu_preempted_unlock(); 151 } 152 } 153 154 #elif defined(RCU_PREEMPT_PODZIMEK) 125 155 126 156 /* Fwd decl. required by the inlined implementation. Not part of public API. */ … … 210 240 preemption_enable(); 211 241 } 212 213 214 242 #endif 215 243 244 #endif 245 216 246 /** @} 217 247 */ -
kernel/generic/include/synch/rcu_types.h
rf0fcb04 rd4d36f9 39 39 #include <synch/semaphore.h> 40 40 41 #if !defined(RCU_PREEMPT_PODZIMEK) && !defined(RCU_PREEMPT_A) 42 #define RCU_PREEMPT_A 43 //#error You must select an RCU algorithm. 44 #endif 45 41 46 42 47 /* Fwd decl. */ … … 58 63 /** RCU related per-cpu data. */ 59 64 typedef struct rcu_cpu_data { 60 /** The cpu recorded a quiescent state last time during this grace period 65 /** The cpu recorded a quiescent state last time during this grace period.*/ 61 66 rcu_gp_t last_seen_gp; 67 68 #ifdef RCU_PREEMPT_PODZIMEK 69 /** This cpu has not yet passed a quiescent state and it is delaying the 70 * detector. Once it reaches a QS it must sema_up(rcu.remaining_readers). 71 */ 72 bool is_delaying_gp; 62 73 74 /** True if we should signal the detector that we exited a reader section. 75 * 76 * Equal to (THREAD->rcu.was_preempted || CPU->rcu.is_delaying_gp). 77 */ 78 bool signal_unlock; 79 63 80 /** The number of times an RCU reader section is nested on this cpu. 64 81 * … … 68 85 */ 69 86 size_t nesting_cnt; 70 87 #endif 88 71 89 /** Callbacks to invoke once the current grace period ends, ie cur_cbs_gp. 72 90 * Accessed by the local reclaimer only. … … 102 120 rcu_gp_t next_cbs_gp; 103 121 104 /** This cpu has not yet passed a quiescent state and it is delaying the105 * detector. Once it reaches a QS it must sema_up(rcu.remaining_readers).106 */107 bool is_delaying_gp;108 109 /** True if we should signal the detector that we exited a reader section.110 *111 * Equal to (THREAD->rcu.was_preempted || CPU->rcu.is_delaying_gp).112 */113 bool signal_unlock;114 115 122 /** Positive if there are callbacks pending in arriving_cbs. */ 116 123 semaphore_t arrived_flag; … … 142 149 */ 143 150 size_t nesting_cnt; 151 152 #ifdef RCU_PREEMPT_PODZIMEK 144 153 145 154 /** True if the thread was preempted in a reader section. … … 151 160 */ 152 161 bool was_preempted; 162 #endif 163 153 164 /** Preempted threads link. Access with rcu.prempt_lock.*/ 154 165 link_t preempt_link;
Note:
See TracChangeset
for help on using the changeset viewer.