FreeBSD Bugzilla – Attachment 8791 Details for
Bug 18271
[patch] simplelock: klds not portable across UP and SMP
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.07 KB, created by
Jake Burkholder
on 2000-04-28 16:10:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Jake Burkholder
Created:
2000-04-28 16:10:01 UTC
Size:
3.07 KB
patch
obsolete
>Index: alpha/include/lock.h >=================================================================== >RCS file: /home/ncvs/src/sys/alpha/include/lock.h,v >retrieving revision 1.5 >diff -u -r1.5 lock.h >--- alpha/include/lock.h 1999/08/28 00:38:47 1.5 >+++ alpha/include/lock.h 2000/04/27 00:21:30 >@@ -38,6 +38,17 @@ > volatile int lock_data; > }; > >+void s_lock_init __P((struct simplelock *)); >+void s_lock __P((struct simplelock *)); >+int s_lock_try __P((struct simplelock *)); >+ >+/* inline simplelock functions */ >+static __inline void >+s_unlock(struct simplelock *lkp) >+{ >+ lkp->lock_data = 0; >+} >+ > #define COM_LOCK() > #define COM_UNLOCK() > >Index: i386/include/lock.h >=================================================================== >RCS file: /home/ncvs/src/sys/i386/include/lock.h,v >retrieving revision 1.12 >diff -u -r1.12 lock.h >--- i386/include/lock.h 2000/03/28 07:16:21 1.12 >+++ i386/include/lock.h 2000/04/27 00:21:33 >@@ -169,17 +169,6 @@ > extern struct simplelock mpintr_lock; > extern struct simplelock mcount_lock; > >-#if !defined(SIMPLELOCK_DEBUG) && NCPUS > 1 >-/* >- * This set of defines turns on the real functions in i386/isa/apic_ipl.s. >- */ >-#define simple_lock_init(alp) s_lock_init(alp) >-#define simple_lock(alp) s_lock(alp) >-#define simple_lock_try(alp) s_lock_try(alp) >-#define simple_unlock(alp) s_unlock(alp) >- >-#endif /* !SIMPLELOCK_DEBUG && NCPUS > 1 */ >- > #endif /* LOCORE */ > > #endif /* !_MACHINE_LOCK_H_ */ >Index: kern/kern_lock.c >=================================================================== >RCS file: /home/ncvs/src/sys/kern/kern_lock.c,v >retrieving revision 1.32 >diff -u -r1.32 kern_lock.c >--- kern/kern_lock.c 2000/03/16 08:51:50 1.32 >+++ kern/kern_lock.c 2000/04/27 15:18:07 >@@ -75,6 +75,27 @@ > static int apause(struct lock *lkp, int flags); > static int acquiredrain(struct lock *lkp, int extflags) ; > >+#ifndef SMP >+ >+void >+s_lock_init(struct simplelock *lkp) >+{ >+} >+ >+void >+s_lock(struct simplelock *lkp) >+{ >+} >+ >+int >+s_lock_try(struct simplelock *lkp) >+{ >+ >+ return 1; >+} >+ >+#endif >+ > static LOCK_INLINE void > sharelock(struct lock *lkp, int incr) { > lkp->lk_flags |= LK_SHARE_NONZERO; >Index: sys/lock.h >=================================================================== >RCS file: /home/ncvs/src/sys/sys/lock.h,v >retrieving revision 1.17 >diff -u -r1.17 lock.h >--- sys/lock.h 1999/12/11 16:13:01 1.17 >+++ sys/lock.h 2000/04/27 15:13:34 >@@ -202,13 +202,18 @@ > #define simple_lock(alp) _simple_lock(alp, __FILE__, __LINE__) > void simple_lock_init __P((struct simplelock *alp)); > #else /* !SIMPLELOCK_DEBUG */ >-#if NCPUS == 1 /* no multiprocessor locking is necessary */ >+#if defined(SMP) || defined(KLD_MODULE) >+#define simple_lock_init(alp) s_lock_init(alp) >+#define simple_lock(alp) s_lock(alp) >+#define simple_lock_try(alp) s_lock_try(alp) >+#define simple_unlock(alp) s_unlock(alp) >+#else /* !SMP || !KLD_MODULE */ > #define NULL_SIMPLELOCKS > #define simple_lock_init(alp) > #define simple_lock(alp) > #define simple_lock_try(alp) (1) /* always succeeds */ > #define simple_unlock(alp) >-#endif /* NCPUS == 1 */ >+#endif /* !SMP || !KLD_MODULE */ > #endif /* !SIMPLELOCK_DEBUG */ > > #endif /* !_LOCK_H_ */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 18271
: 8791