View | Details | Raw Unified | Return to bug 18271
Collapse All | Expand All

(-)alpha/include/lock.h (+11 lines)
Lines 38-43 Link Here
38
	volatile int	lock_data;
38
	volatile int	lock_data;
39
};
39
};
40
40
41
void	s_lock_init		__P((struct simplelock *));
42
void	s_lock			__P((struct simplelock *));
43
int	s_lock_try		__P((struct simplelock *));
44
45
/* inline simplelock functions */
46
static __inline void
47
s_unlock(struct simplelock *lkp)
48
{
49
	lkp->lock_data = 0;
50
}
51
41
#define COM_LOCK()
52
#define COM_LOCK()
42
#define COM_UNLOCK()
53
#define COM_UNLOCK()
43
54
(-)i386/include/lock.h (-11 lines)
Lines 169-185 Link Here
169
extern struct simplelock	mpintr_lock;
169
extern struct simplelock	mpintr_lock;
170
extern struct simplelock	mcount_lock;
170
extern struct simplelock	mcount_lock;
171
171
172
#if !defined(SIMPLELOCK_DEBUG) && NCPUS > 1
173
/*
174
 * This set of defines turns on the real functions in i386/isa/apic_ipl.s.
175
 */
176
#define	simple_lock_init(alp)	s_lock_init(alp)
177
#define	simple_lock(alp)	s_lock(alp)
178
#define	simple_lock_try(alp)	s_lock_try(alp)
179
#define	simple_unlock(alp)	s_unlock(alp)
180
181
#endif /* !SIMPLELOCK_DEBUG && NCPUS > 1 */
182
183
#endif /* LOCORE */
172
#endif /* LOCORE */
184
173
185
#endif /* !_MACHINE_LOCK_H_ */
174
#endif /* !_MACHINE_LOCK_H_ */
(-)kern/kern_lock.c (+21 lines)
Lines 75-80 Link Here
75
static int apause(struct lock *lkp, int flags);
75
static int apause(struct lock *lkp, int flags);
76
static int acquiredrain(struct lock *lkp, int extflags) ;
76
static int acquiredrain(struct lock *lkp, int extflags) ;
77
77
78
#ifndef SMP
79
80
void
81
s_lock_init(struct simplelock *lkp)
82
{
83
}
84
85
void
86
s_lock(struct simplelock *lkp)
87
{
88
}
89
90
int
91
s_lock_try(struct simplelock *lkp)
92
{
93
94
	return 1;
95
}
96
97
#endif
98
78
static LOCK_INLINE void
99
static LOCK_INLINE void
79
sharelock(struct lock *lkp, int incr) {
100
sharelock(struct lock *lkp, int incr) {
80
	lkp->lk_flags |= LK_SHARE_NONZERO;
101
	lkp->lk_flags |= LK_SHARE_NONZERO;
(-)sys/lock.h (-2 / +7 lines)
Lines 202-214 Link Here
202
#define simple_lock(alp) _simple_lock(alp, __FILE__, __LINE__)
202
#define simple_lock(alp) _simple_lock(alp, __FILE__, __LINE__)
203
void simple_lock_init __P((struct simplelock *alp));
203
void simple_lock_init __P((struct simplelock *alp));
204
#else /* !SIMPLELOCK_DEBUG */
204
#else /* !SIMPLELOCK_DEBUG */
205
#if NCPUS == 1 /* no multiprocessor locking is necessary */
205
#if defined(SMP) || defined(KLD_MODULE)
206
#define	simple_lock_init(alp)	s_lock_init(alp)
207
#define	simple_lock(alp)	s_lock(alp)
208
#define	simple_lock_try(alp)	s_lock_try(alp)
209
#define	simple_unlock(alp)	s_unlock(alp)
210
#else /* !SMP || !KLD_MODULE */
206
#define	NULL_SIMPLELOCKS
211
#define	NULL_SIMPLELOCKS
207
#define	simple_lock_init(alp)
212
#define	simple_lock_init(alp)
208
#define	simple_lock(alp)
213
#define	simple_lock(alp)
209
#define	simple_lock_try(alp)	(1)	/* always succeeds */
214
#define	simple_lock_try(alp)	(1)	/* always succeeds */
210
#define	simple_unlock(alp)
215
#define	simple_unlock(alp)
211
#endif /* NCPUS == 1 */
216
#endif /* !SMP || !KLD_MODULE */
212
#endif /* !SIMPLELOCK_DEBUG */
217
#endif /* !SIMPLELOCK_DEBUG */
213
218
214
#endif /* !_LOCK_H_ */
219
#endif /* !_LOCK_H_ */

Return to bug 18271