All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>, adeos-main <adeos-main@gna.org>
Subject: [Adeos-main] [PATCH] fix !CONFIG_IPIPE build
Date: Thu, 21 Dec 2006 12:49:25 +0100	[thread overview]
Message-ID: <458A74C5.80005@domain.hid> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 177 bytes --]

Hi Philippe,

I never tested my type-based spinlocks in !CONFIG_IPIPE scenarios. Now I
did, and here comes the patch for 2.6.19-1.6-02 that is required - of
course.

Jan

[-- Attachment #1.2: fix-ipipe-off.patch --]
[-- Type: text/plain, Size: 5970 bytes --]

---
 include/linux/spinlock.h       |   36 ++++++++++++++++++------------------
 include/linux/spinlock_types.h |   10 ++++++----
 2 files changed, 24 insertions(+), 22 deletions(-)

Index: linux-2.6.19/include/linux/spinlock_types.h
===================================================================
--- linux-2.6.19.orig/include/linux/spinlock_types.h
+++ linux-2.6.19/include/linux/spinlock_types.h
@@ -33,7 +33,7 @@ typedef struct {
 
 typedef struct {
 	raw_spinlock_t __raw_lock;
-} ipipe_spinlock_t;
+} __ipipe_spinlock_t;
 
 #define SPINLOCK_MAGIC		0xdead4ead
 
@@ -91,16 +91,18 @@ typedef struct {
 
 #define SPIN_LOCK_UNLOCKED	__SPIN_LOCK_UNLOCKED(old_style_spin_init)
 #define IPIPE_SPIN_LOCK_UNLOCKED					\
-	(ipipe_spinlock_t) {	.__raw_lock = __RAW_SPIN_LOCK_UNLOCKED }
+	(__ipipe_spinlock_t) {	.__raw_lock = __RAW_SPIN_LOCK_UNLOCKED }
 #define RW_LOCK_UNLOCKED	__RW_LOCK_UNLOCKED(old_style_rw_init)
 
 #define DEFINE_SPINLOCK(x)	spinlock_t x = __SPIN_LOCK_UNLOCKED(x)
 #define DEFINE_RWLOCK(x)	rwlock_t x = __RW_LOCK_UNLOCKED(x)
 
 #ifdef CONFIG_IPIPE
-#define IPIPE_DEFINE_SPINLOCK(x) ipipe_spinlock_t x = IPIPE_SPIN_LOCK_UNLOCKED
+# define ipipe_spinlock_t	__ipipe_spinlock_t
+# define IPIPE_DEFINE_SPINLOCK(x) ipipe_spinlock_t x = IPIPE_SPIN_LOCK_UNLOCKED
 #else
-#define IPIPE_DEFINE_SPINLOCK(x) DEFINE_SPINLOCK(x)
+# define ipipe_spinlock_t	spinlock_t
+# define IPIPE_DEFINE_SPINLOCK(x) DEFINE_SPINLOCK(x)
 #endif
 
 #endif /* __LINUX_SPINLOCK_TYPES_H */
Index: linux-2.6.19/include/linux/spinlock.h
===================================================================
--- linux-2.6.19.orig/include/linux/spinlock.h
+++ linux-2.6.19/include/linux/spinlock.h
@@ -177,33 +177,33 @@ do {								\
 
 #define PICK_SPINOP(op, lock)						\
 do {									\
-	if (TYPE_EQUAL((lock), ipipe_spinlock_t))			\
-		__raw_spin##op(&((ipipe_spinlock_t *)(lock))->__raw_lock); \
+	if (TYPE_EQUAL((lock), __ipipe_spinlock_t))			\
+		__raw_spin##op(&((__ipipe_spinlock_t *)(lock))->__raw_lock); \
 	else if (TYPE_EQUAL(lock, spinlock_t))				\
 		_spin##op((spinlock_t *)(lock));			\
 } while (0)
 
 #define PICK_SPINOP_RAW(op, lock)					\
 do {									\
-	if (TYPE_EQUAL((lock), ipipe_spinlock_t))			\
-		__raw_spin##op(&((ipipe_spinlock_t *)(lock))->__raw_lock); \
+	if (TYPE_EQUAL((lock), __ipipe_spinlock_t))			\
+		__raw_spin##op(&((__ipipe_spinlock_t *)(lock))->__raw_lock); \
 	else if (TYPE_EQUAL(lock, spinlock_t))				\
 		__raw_spin##op(&((spinlock_t *)(lock))->raw_lock);	\
 } while (0)
 
 #define PICK_SPINLOCK_IRQ(lock)					\
 do {									\
-	if (TYPE_EQUAL((lock), ipipe_spinlock_t)) {			\
+	if (TYPE_EQUAL((lock), __ipipe_spinlock_t)) {			\
 		local_irq_disable_hw();					\
-		__raw_spin_lock(&((ipipe_spinlock_t *)(lock))->__raw_lock); \
+		__raw_spin_lock(&((__ipipe_spinlock_t *)(lock))->__raw_lock); \
 	} else if (TYPE_EQUAL(lock, spinlock_t))			\
 		_spin_lock_irq((spinlock_t *)(lock));			\
 } while (0)
 
 #define PICK_SPINUNLOCK_IRQ(lock)					\
 do {									\
-	if (TYPE_EQUAL((lock), ipipe_spinlock_t)) {			\
-		__raw_spin_unlock(&((ipipe_spinlock_t *)(lock))->__raw_lock); \
+	if (TYPE_EQUAL((lock), __ipipe_spinlock_t)) {			\
+		__raw_spin_unlock(&((__ipipe_spinlock_t *)(lock))->__raw_lock); \
 		local_irq_enable_hw();					\
 	} else if (TYPE_EQUAL(lock, spinlock_t))			\
 		_spin_unlock_irq((spinlock_t *)(lock));			\
@@ -211,9 +211,9 @@ do {									\
 
 #define PICK_SPINLOCK_IRQ_RAW(lock)					\
 do {									\
-	if (TYPE_EQUAL((lock), ipipe_spinlock_t)) {			\
+	if (TYPE_EQUAL((lock), __ipipe_spinlock_t)) {			\
 		local_irq_disable_hw();					\
-		__raw_spin_lock(&((ipipe_spinlock_t *)(lock))->__raw_lock); \
+		__raw_spin_lock(&((__ipipe_spinlock_t *)(lock))->__raw_lock); \
 	} else if (TYPE_EQUAL(lock, spinlock_t))			\
 		local_irq_disable();					\
 		__raw_spin_lock(&((spinlock_t *)(lock))->raw_lock);	\
@@ -221,8 +221,8 @@ do {									\
 
 #define PICK_SPINUNLOCK_IRQ_RAW(lock)				\
 do {									\
-	if (TYPE_EQUAL((lock), ipipe_spinlock_t)) {			\
-		__raw_spin_unlock(&((ipipe_spinlock_t *)(lock))->__raw_lock); \
+	if (TYPE_EQUAL((lock), __ipipe_spinlock_t)) {			\
+		__raw_spin_unlock(&((__ipipe_spinlock_t *)(lock))->__raw_lock); \
 		local_irq_enable_hw();				\
 	} else if (TYPE_EQUAL(lock, spinlock_t))			\
 		__raw_spin_unlock(&((spinlock_t *)(lock))->raw_lock);	\
@@ -234,9 +234,9 @@ extern int __bad_spinlock_type(void);
 
 #define PICK_SPINLOCK_IRQSAVE(lock, flags)				\
 do {									\
-	if (TYPE_EQUAL((lock), ipipe_spinlock_t)) {			\
+	if (TYPE_EQUAL((lock), __ipipe_spinlock_t)) {			\
 		local_irq_save_hw(flags);				\
-		__raw_spin_lock(&((ipipe_spinlock_t *)(lock))->__raw_lock); \
+		__raw_spin_lock(&((__ipipe_spinlock_t *)(lock))->__raw_lock); \
 	} else if (TYPE_EQUAL(lock, spinlock_t))			\
 		flags = _spin_lock_irqsave((spinlock_t *)(lock));	\
 	else __bad_spinlock_type();					\
@@ -244,9 +244,9 @@ do {									\
 #else
 #define PICK_SPINLOCK_IRQSAVE(lock, flags)				\
 do {									\
-	if (TYPE_EQUAL((lock), ipipe_spinlock_t)) {			\
+	if (TYPE_EQUAL((lock), __ipipe_spinlock_t)) {			\
 		local_irq_save_hw(flags);				\
-		__raw_spin_lock(&((ipipe_spinlock_t *)(lock))->__raw_lock); \
+		__raw_spin_lock(&((__ipipe_spinlock_t *)(lock))->__raw_lock); \
 	} else if (TYPE_EQUAL(lock, spinlock_t))			\
 		_spin_lock_irqsave((spinlock_t *)(lock), flags);	\
 } while (0)
@@ -254,8 +254,8 @@ do {									\
 
 #define PICK_SPINUNLOCK_IRQRESTORE(lock, flags)			\
 	do {								\
-	if (TYPE_EQUAL((lock), ipipe_spinlock_t)) {			\
-		__raw_spin_unlock(&((ipipe_spinlock_t *)(lock))->__raw_lock); \
+	if (TYPE_EQUAL((lock), __ipipe_spinlock_t)) {			\
+		__raw_spin_unlock(&((__ipipe_spinlock_t *)(lock))->__raw_lock); \
 		local_irq_restore_hw(flags);				\
 	} else if (TYPE_EQUAL(lock, spinlock_t))			\
 		_spin_unlock_irqrestore((spinlock_t *)(lock), flags);	\

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

             reply	other threads:[~2006-12-21 11:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-21 11:49 Jan Kiszka [this message]
2006-12-21 17:03 ` [Adeos-main] Re: [PATCH] fix !CONFIG_IPIPE build Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=458A74C5.80005@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=adeos-main@gna.org \
    --cc=rpm@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.