patch-2.4.19 linux-2.4.19/include/linux/spinlock.h
Next file: linux-2.4.19/include/linux/sunrpc/xprt.h
Previous file: linux-2.4.19/include/linux/slab.h
Back to the patch index
Back to the overall index
- Lines: 45
- Date:
Fri Aug 2 17:39:46 2002
- Orig file:
linux-2.4.18/include/linux/spinlock.h
- Orig date:
Thu Nov 22 11:46:19 2001
diff -urN linux-2.4.18/include/linux/spinlock.h linux-2.4.19/include/linux/spinlock.h
@@ -35,6 +35,23 @@
if (!__r) local_bh_enable(); \
__r; })
+/* Must define these before including other files, inline functions need them */
+
+#include <linux/stringify.h>
+
+#define LOCK_SECTION_NAME \
+ ".text.lock." __stringify(KBUILD_BASENAME)
+
+#define LOCK_SECTION_START(extra) \
+ ".subsection 1\n\t" \
+ extra \
+ ".ifndef " LOCK_SECTION_NAME "\n\t" \
+ LOCK_SECTION_NAME ":\n\t" \
+ ".endif\n\t"
+
+#define LOCK_SECTION_END \
+ ".previous\n\t"
+
#ifdef CONFIG_SMP
#include <asm/spinlock.h>
@@ -138,4 +155,20 @@
extern int atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock);
#endif
+#ifdef CONFIG_SMP
+#include <linux/cache.h>
+
+typedef union {
+ spinlock_t lock;
+ char fill_up[(SMP_CACHE_BYTES)];
+} spinlock_cacheline_t __attribute__ ((aligned(SMP_CACHE_BYTES)));
+
+#else /* SMP */
+
+typedef struct {
+ spinlock_t lock;
+} spinlock_cacheline_t;
+
+
+#endif
#endif /* __LINUX_SPINLOCK_H */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)