Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/systm.h
Show First 20 Lines • Show All 278 Lines • ▼ Show 20 Lines | |||||
#else | #else | ||||
static __inline void | static __inline void | ||||
critical_enter(void) | critical_enter(void) | ||||
{ | { | ||||
struct thread_lite *td; | struct thread_lite *td; | ||||
td = (struct thread_lite *)curthread; | td = (struct thread_lite *)curthread; | ||||
td->td_critnest++; | td->td_critnest++; | ||||
__compiler_membar(); | atomic_interrupt_fence(); | ||||
} | } | ||||
static __inline void | static __inline void | ||||
critical_exit(void) | critical_exit(void) | ||||
{ | { | ||||
struct thread_lite *td; | struct thread_lite *td; | ||||
td = (struct thread_lite *)curthread; | td = (struct thread_lite *)curthread; | ||||
KASSERT(td->td_critnest != 0, | KASSERT(td->td_critnest != 0, | ||||
("critical_exit: td_critnest == 0")); | ("critical_exit: td_critnest == 0")); | ||||
__compiler_membar(); | atomic_interrupt_fence(); | ||||
td->td_critnest--; | td->td_critnest--; | ||||
__compiler_membar(); | atomic_interrupt_fence(); | ||||
if (__predict_false(td->td_owepreempt)) | if (__predict_false(td->td_owepreempt)) | ||||
critical_exit_preempt(); | critical_exit_preempt(); | ||||
} | } | ||||
#endif | #endif | ||||
#ifdef EARLY_PRINTF | #ifdef EARLY_PRINTF | ||||
typedef void early_putc_t(int ch); | typedef void early_putc_t(int ch); | ||||
▲ Show 20 Lines • Show All 325 Lines • Show Last 20 Lines |