version 1.14.22.1, 2007/10/02 18:27:49 |
version 1.14.22.2, 2007/11/11 16:47:01 |
|
|
#ifndef _X86_LOCK_H_ |
#ifndef _X86_LOCK_H_ |
#define _X86_LOCK_H_ |
#define _X86_LOCK_H_ |
|
|
#if defined(_KERNEL_OPT) |
|
#include "opt_lockdebug.h" |
|
#endif |
|
|
|
#ifdef _KERNEL |
#ifdef _KERNEL |
#include <machine/cpufunc.h> |
#include <machine/cpufunc.h> |
#endif |
#endif |
|
#include <machine/atomic.h> |
|
|
|
|
static __inline int |
static __inline int |
__SIMPLELOCK_LOCKED_P(__cpu_simple_lock_t *__ptr) |
__SIMPLELOCK_LOCKED_P(__cpu_simple_lock_t *__ptr) |
Line 77 __cpu_simple_lock_clear(__cpu_simple_loc |
|
Line 75 __cpu_simple_lock_clear(__cpu_simple_loc |
|
*__ptr = __SIMPLELOCK_UNLOCKED; |
*__ptr = __SIMPLELOCK_UNLOCKED; |
} |
} |
|
|
#ifdef LOCKDEBUG |
|
|
|
extern void __cpu_simple_lock_init(__cpu_simple_lock_t *); |
|
extern void __cpu_simple_lock(__cpu_simple_lock_t *); |
|
extern int __cpu_simple_lock_try(__cpu_simple_lock_t *); |
|
extern void __cpu_simple_unlock(__cpu_simple_lock_t *); |
|
|
|
#else |
|
|
|
#include <machine/atomic.h> |
|
|
|
static __inline void __cpu_simple_lock_init(__cpu_simple_lock_t *) |
static __inline void __cpu_simple_lock_init(__cpu_simple_lock_t *) |
__attribute__((__unused__)); |
__attribute__((__unused__)); |
static __inline void __cpu_simple_lock(__cpu_simple_lock_t *) |
static __inline void __cpu_simple_lock(__cpu_simple_lock_t *) |
Line 191 __cpu_simple_unlock(__cpu_simple_lock_t |
|
Line 178 __cpu_simple_unlock(__cpu_simple_lock_t |
|
*lockp = __SIMPLELOCK_UNLOCKED; |
*lockp = __SIMPLELOCK_UNLOCKED; |
} |
} |
|
|
#endif /* !LOCKDEBUG */ |
|
|
|
#define SPINLOCK_SPIN_HOOK /* nothing */ |
#define SPINLOCK_SPIN_HOOK /* nothing */ |
#define SPINLOCK_BACKOFF_HOOK x86_pause() |
#define SPINLOCK_BACKOFF_HOOK x86_pause() |
|
|