[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] Use DEFINE_SPINLOCK consistently throughout Xen.
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID 8084304286224d09f9443c25a8dbeb9ed4025532 # Parent 8c6ff337d164f240513337c1f4ae8332da255176 Use DEFINE_SPINLOCK consistently throughout Xen. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> --- xen/arch/x86/cpu/mtrr/main.c | 2 +- xen/arch/x86/hvm/svm/svm.c | 20 +++++++++----------- xen/arch/x86/i8259.c | 2 +- xen/arch/x86/microcode.c | 2 +- xen/arch/x86/smp.c | 2 +- xen/arch/x86/time.c | 6 +++--- xen/arch/x86/x86_32/domain_page.c | 2 +- xen/common/dom0_ops.c | 2 +- xen/common/page_alloc.c | 4 ++-- xen/common/perfc.c | 2 +- xen/common/trace.c | 2 +- xen/common/xmalloc.c | 2 +- xen/drivers/char/console.c | 6 +++--- xen/include/xen/console.h | 2 -- 14 files changed, 26 insertions(+), 30 deletions(-) diff -r 8c6ff337d164 -r 808430428622 xen/arch/x86/cpu/mtrr/main.c --- a/xen/arch/x86/cpu/mtrr/main.c Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/arch/x86/cpu/mtrr/main.c Thu Jun 01 21:49:25 2006 +0100 @@ -43,7 +43,7 @@ #include "mtrr.h" /* No blocking mutexes in Xen. Spin instead. */ -#define DECLARE_MUTEX(_m) spinlock_t _m = SPIN_LOCK_UNLOCKED +#define DECLARE_MUTEX(_m) DEFINE_SPINLOCK(_m) #define down(_m) spin_lock(_m) #define up(_m) spin_unlock(_m) #define lock_cpu_hotplug() ((void)0) diff -r 8c6ff337d164 -r 808430428622 xen/arch/x86/hvm/svm/svm.c --- a/xen/arch/x86/hvm/svm/svm.c Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/arch/x86/hvm/svm/svm.c Thu Jun 01 21:49:25 2006 +0100 @@ -84,28 +84,26 @@ struct svm_percore_globals svm_globals[N /* * Initializes the POOL of ASID used by the guests per core. */ -void asidpool_init( int core ) +void asidpool_init(int core) { int i; - svm_globals[core].ASIDpool.asid_lock = SPIN_LOCK_UNLOCKED; - spin_lock(&svm_globals[core].ASIDpool.asid_lock); + + spin_lock_init(&svm_globals[core].ASIDpool.asid_lock); + /* Host ASID is always in use */ svm_globals[core].ASIDpool.asid[INITIAL_ASID] = ASID_INUSE; - for( i=1; i<ASID_MAX; i++ ) - { + for ( i = 1; i < ASID_MAX; i++ ) svm_globals[core].ASIDpool.asid[i] = ASID_AVAILABLE; - } - spin_unlock(&svm_globals[core].ASIDpool.asid_lock); } /* internal function to get the next available ASID */ -static int asidpool_fetch_next( struct vmcb_struct *vmcb, int core ) +static int asidpool_fetch_next(struct vmcb_struct *vmcb, int core) { int i; - for( i = 1; i < ASID_MAX; i++ ) - { - if( svm_globals[core].ASIDpool.asid[i] == ASID_AVAILABLE ) + for ( i = 1; i < ASID_MAX; i++ ) + { + if ( svm_globals[core].ASIDpool.asid[i] == ASID_AVAILABLE ) { vmcb->guest_asid = i; svm_globals[core].ASIDpool.asid[i] = ASID_INUSE; diff -r 8c6ff337d164 -r 808430428622 xen/arch/x86/i8259.c --- a/xen/arch/x86/i8259.c Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/arch/x86/i8259.c Thu Jun 01 21:49:25 2006 +0100 @@ -102,7 +102,7 @@ BUILD_SMP_INTERRUPT(thermal_interrupt,TH * moves to arch independent land */ -spinlock_t i8259A_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(i8259A_lock); static void disable_8259A_vector(unsigned int vector) { diff -r 8c6ff337d164 -r 808430428622 xen/arch/x86/microcode.c --- a/xen/arch/x86/microcode.c Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/arch/x86/microcode.c Thu Jun 01 21:49:25 2006 +0100 @@ -83,7 +83,7 @@ #include <asm/processor.h> #define pr_debug(x...) ((void)0) -#define DECLARE_MUTEX(_m) spinlock_t _m = SPIN_LOCK_UNLOCKED +#define DECLARE_MUTEX(_m) DEFINE_SPINLOCK(_m) #define down(_m) spin_lock(_m) #define up(_m) spin_unlock(_m) #define vmalloc(_s) xmalloc_bytes(_s) diff -r 8c6ff337d164 -r 808430428622 xen/arch/x86/smp.c --- a/xen/arch/x86/smp.c Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/arch/x86/smp.c Thu Jun 01 21:49:25 2006 +0100 @@ -161,7 +161,7 @@ void send_IPI_mask_phys(cpumask_t mask, local_irq_restore(flags); } -static spinlock_t flush_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(flush_lock); static cpumask_t flush_cpumask; static unsigned long flush_va; diff -r 8c6ff337d164 -r 808430428622 xen/arch/x86/time.c --- a/xen/arch/x86/time.c Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/arch/x86/time.c Thu Jun 01 21:49:25 2006 +0100 @@ -40,10 +40,10 @@ boolean_param("hpet_force", opt_hpet_for unsigned long cpu_khz; /* CPU clock frequency in kHz. */ unsigned long hpet_address; -spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; +DEFINE_SPINLOCK(rtc_lock); unsigned long volatile jiffies; static u32 wc_sec, wc_nsec; /* UTC time at last 'time update'. */ -static spinlock_t wc_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(wc_lock); struct time_scale { int shift; @@ -67,7 +67,7 @@ static s_time_t stime_platform_stamp; static s_time_t stime_platform_stamp; static u64 platform_timer_stamp; static struct time_scale platform_timer_scale; -static spinlock_t platform_timer_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(platform_timer_lock); static u64 (*read_platform_count)(void); /* diff -r 8c6ff337d164 -r 808430428622 xen/arch/x86/x86_32/domain_page.c --- a/xen/arch/x86/x86_32/domain_page.c Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/arch/x86/x86_32/domain_page.c Thu Jun 01 21:49:25 2006 +0100 @@ -183,7 +183,7 @@ static unsigned long inuse[BITS_TO_LONGS static unsigned long inuse[BITS_TO_LONGS(GLOBALMAP_BITS)]; static unsigned long garbage[BITS_TO_LONGS(GLOBALMAP_BITS)]; static unsigned int inuse_cursor; -static spinlock_t globalmap_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(globalmap_lock); void *map_domain_page_global(unsigned long pfn) { diff -r 8c6ff337d164 -r 808430428622 xen/common/dom0_ops.c --- a/xen/common/dom0_ops.c Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/common/dom0_ops.c Thu Jun 01 21:49:25 2006 +0100 @@ -95,7 +95,7 @@ long do_dom0_op(XEN_GUEST_HANDLE(dom0_op long ret = 0; struct dom0_op curop, *op = &curop; void *ssid = NULL; /* save security ptr between pre and post/fail hooks */ - static spinlock_t dom0_lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(dom0_lock); if ( !IS_PRIV(current->domain) ) return -EPERM; diff -r 8c6ff337d164 -r 808430428622 xen/common/page_alloc.c --- a/xen/common/page_alloc.c Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/common/page_alloc.c Thu Jun 01 21:49:25 2006 +0100 @@ -59,7 +59,7 @@ custom_param("lowmem_emergency_pool", pa #define round_pgdown(_p) ((_p)&PAGE_MASK) #define round_pgup(_p) (((_p)+(PAGE_SIZE-1))&PAGE_MASK) -static spinlock_t page_scrub_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(page_scrub_lock); LIST_HEAD(page_scrub_list); /********************* @@ -250,7 +250,7 @@ static struct list_head heap[NR_ZONES][M static unsigned long avail[NR_ZONES]; -static spinlock_t heap_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(heap_lock); void end_boot_allocator(void) { diff -r 8c6ff337d164 -r 808430428622 xen/common/perfc.c --- a/xen/common/perfc.c Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/common/perfc.c Thu Jun 01 21:49:25 2006 +0100 @@ -209,7 +209,7 @@ static int perfc_copy_info(XEN_GUEST_HAN /* Dom0 control of perf counters */ int perfc_control(dom0_perfccontrol_t *pc) { - static spinlock_t lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(lock); u32 op = pc->op; int rc; diff -r 8c6ff337d164 -r 808430428622 xen/common/trace.c --- a/xen/common/trace.c Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/common/trace.c Thu Jun 01 21:49:25 2006 +0100 @@ -173,7 +173,7 @@ void init_trace_bufs(void) */ int tb_control(dom0_tbufcontrol_t *tbc) { - static spinlock_t lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(lock); int rc = 0; spin_lock(&lock); diff -r 8c6ff337d164 -r 808430428622 xen/common/xmalloc.c --- a/xen/common/xmalloc.c Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/common/xmalloc.c Thu Jun 01 21:49:25 2006 +0100 @@ -35,7 +35,7 @@ #include <xen/prefetch.h> static LIST_HEAD(freelist); -static spinlock_t freelist_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(freelist_lock); struct xmalloc_hdr { diff -r 8c6ff337d164 -r 808430428622 xen/drivers/char/console.c --- a/xen/drivers/char/console.c Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/drivers/char/console.c Thu Jun 01 21:49:25 2006 +0100 @@ -53,7 +53,7 @@ static int sercon_handle = -1; static int sercon_handle = -1; static int vgacon_enabled = 0; -spinlock_t console_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(console_lock); /* * ******************************************************* @@ -563,7 +563,7 @@ static unsigned int debugtrace_prd; /* P static unsigned int debugtrace_prd; /* Producer index */ static unsigned int debugtrace_kilobytes = 128, debugtrace_bytes; static unsigned int debugtrace_used; -static spinlock_t debugtrace_lock = SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(debugtrace_lock); integer_param("debugtrace", debugtrace_kilobytes); void debugtrace_dump(void) @@ -675,7 +675,7 @@ void panic(const char *fmt, ...) va_list args; char buf[128]; unsigned long flags; - static spinlock_t lock = SPIN_LOCK_UNLOCKED; + static DEFINE_SPINLOCK(lock); extern void machine_restart(char *); debugtrace_dump(); diff -r 8c6ff337d164 -r 808430428622 xen/include/xen/console.h --- a/xen/include/xen/console.h Thu Jun 01 21:34:47 2006 +0100 +++ b/xen/include/xen/console.h Thu Jun 01 21:49:25 2006 +0100 @@ -9,8 +9,6 @@ #include <xen/spinlock.h> #include <xen/guest_access.h> - -extern spinlock_t console_lock; void set_printk_prefix(const char *prefix); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |