blob: 27644af20b7c8db11cfee4252c16006c522eaeef [file] [log] [blame]
Ingo Molnarfb1c8f92005-09-10 00:25:56 -07001#ifndef __LINUX_SPINLOCK_TYPES_UP_H
2#define __LINUX_SPINLOCK_TYPES_UP_H
3
4#ifndef __LINUX_SPINLOCK_TYPES_H
5# error "please don't include this file directly"
6#endif
7
8/*
9 * include/linux/spinlock_types_up.h - spinlock type definitions for UP
10 *
11 * portions Copyright 2005, Red Hat, Inc., Ingo Molnar
12 * Released under the General Public License (GPL).
13 */
14
Ingo Molnar8a25d5d2006-07-03 00:24:54 -070015#if defined(CONFIG_DEBUG_SPINLOCK) || \
16 defined(CONFIG_DEBUG_LOCK_ALLOC)
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070017
18typedef struct {
19 volatile unsigned int slock;
Ingo Molnar8a25d5d2006-07-03 00:24:54 -070020#ifdef CONFIG_DEBUG_LOCK_ALLOC
21 struct lockdep_map dep_map;
22#endif
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070023} raw_spinlock_t;
24
25#define __RAW_SPIN_LOCK_UNLOCKED { 1 }
26
27#else
28
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070029typedef struct { } raw_spinlock_t;
30
31#define __RAW_SPIN_LOCK_UNLOCKED { }
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070032
33#endif
34
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070035typedef struct {
36 /* no debug version on UP */
Ingo Molnar8a25d5d2006-07-03 00:24:54 -070037#ifdef CONFIG_DEBUG_LOCK_ALLOC
38 struct lockdep_map dep_map;
39#endif
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070040} raw_rwlock_t;
41
42#define __RAW_RW_LOCK_UNLOCKED { }
Ingo Molnarfb1c8f92005-09-10 00:25:56 -070043
44#endif /* __LINUX_SPINLOCK_TYPES_UP_H */