From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org, akpm@osdl.org, hch@infradead.org,
arjan@infradead.org, matthew@wil.cx
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: [PATCH 4/19] MUTEX: FRV arch mutex
Date: Mon, 12 Dec 2005 23:45:47 GMT [thread overview]
Message-ID: <200512122345.jBCNjllF009033@warthog.cambridge.redhat.com> (raw)
In-Reply-To: <dhowells1134431145@warthog.cambridge.redhat.com>
The attached patch renames the functions of the FRV traditional semaphore
implementation to include "_sem" in their names and to remove the MUTEX macros
that are now provided by the new mutex facility.
Signed-Off-By: David Howells <dhowells@redhat.com>
---
warthog>diffstat -p1 mutex-frv-2615rc5.diff
arch/frv/kernel/frv_ksyms.c | 2 +-
arch/frv/kernel/semaphore.c | 24 ++++++++++++------------
include/asm-frv/semaphore.h | 35 +++++++++++------------------------
3 files changed, 24 insertions(+), 37 deletions(-)
diff -uNrp /warthog/kernels/linux-2.6.15-rc5/include/asm-frv/semaphore.h linux-2.6.15-rc5-mutex/include/asm-frv/semaphore.h
--- /warthog/kernels/linux-2.6.15-rc5/include/asm-frv/semaphore.h 2005-12-08 16:23:52.000000000 +0000
+++ linux-2.6.15-rc5-mutex/include/asm-frv/semaphore.h 2005-12-12 19:26:43.000000000 +0000
@@ -50,29 +50,16 @@ struct semaphore {
#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
-#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
-#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
-
static inline void sema_init (struct semaphore *sem, int val)
{
*sem = (struct semaphore) __SEMAPHORE_INITIALIZER(*sem, val);
}
-static inline void init_MUTEX (struct semaphore *sem)
-{
- sema_init(sem, 1);
-}
-
-static inline void init_MUTEX_LOCKED (struct semaphore *sem)
-{
- sema_init(sem, 0);
-}
-
-extern void __down(struct semaphore *sem, unsigned long flags);
-extern int __down_interruptible(struct semaphore *sem, unsigned long flags);
-extern void __up(struct semaphore *sem);
+extern void __down_sem(struct semaphore *sem, unsigned long flags);
+extern int __down_sem_interruptible(struct semaphore *sem, unsigned long flags);
+extern void __up_sem(struct semaphore *sem);
-static inline void down(struct semaphore *sem)
+static inline void down_sem(struct semaphore *sem)
{
unsigned long flags;
@@ -86,11 +73,11 @@ static inline void down(struct semaphore
spin_unlock_irqrestore(&sem->wait_lock, flags);
}
else {
- __down(sem, flags);
+ __down_sem(sem, flags);
}
}
-static inline int down_interruptible(struct semaphore *sem)
+static inline int down_sem_interruptible(struct semaphore *sem)
{
unsigned long flags;
int ret = 0;
@@ -105,16 +92,16 @@ static inline int down_interruptible(str
spin_unlock_irqrestore(&sem->wait_lock, flags);
}
else {
- ret = __down_interruptible(sem, flags);
+ ret = __down_sem_interruptible(sem, flags);
}
return ret;
}
/*
- * non-blockingly attempt to down() a semaphore.
+ * non-blockingly attempt to down_sem() a semaphore.
* - returns zero if we acquired it
*/
-static inline int down_trylock(struct semaphore *sem)
+static inline int down_sem_trylock(struct semaphore *sem)
{
unsigned long flags;
int success = 0;
@@ -132,7 +119,7 @@ static inline int down_trylock(struct se
return !success;
}
-static inline void up(struct semaphore *sem)
+static inline void up_sem(struct semaphore *sem)
{
unsigned long flags;
@@ -142,7 +129,7 @@ static inline void up(struct semaphore *
spin_lock_irqsave(&sem->wait_lock, flags);
if (!list_empty(&sem->wait_list))
- __up(sem);
+ __up_sem(sem);
else
sem->counter++;
spin_unlock_irqrestore(&sem->wait_lock, flags);
diff -uNrp /warthog/kernels/linux-2.6.15-rc5/arch/frv/kernel/frv_ksyms.c linux-2.6.15-rc5-mutex/arch/frv/kernel/frv_ksyms.c
--- /warthog/kernels/linux-2.6.15-rc5/arch/frv/kernel/frv_ksyms.c 2005-11-01 13:18:57.000000000 +0000
+++ linux-2.6.15-rc5-mutex/arch/frv/kernel/frv_ksyms.c 2005-12-12 22:08:19.000000000 +0000
@@ -13,7 +13,7 @@
#include <asm/pgalloc.h>
#include <asm/irq.h>
#include <asm/io.h>
-#include <asm/semaphore.h>
+#include <linux/semaphore.h>
#include <asm/checksum.h>
#include <asm/hardirq.h>
#include <asm/current.h>
diff -uNrp /warthog/kernels/linux-2.6.15-rc5/arch/frv/kernel/semaphore.c linux-2.6.15-rc5-mutex/arch/frv/kernel/semaphore.c
--- /warthog/kernels/linux-2.6.15-rc5/arch/frv/kernel/semaphore.c 2005-12-08 16:23:32.000000000 +0000
+++ linux-2.6.15-rc5-mutex/arch/frv/kernel/semaphore.c 2005-12-12 19:26:25.000000000 +0000
@@ -38,12 +38,12 @@ void semtrace(struct semaphore *sem, con
* wait for a token to be granted from a semaphore
* - entered with lock held and interrupts disabled
*/
-void __down(struct semaphore *sem, unsigned long flags)
+void __down_sem(struct semaphore *sem, unsigned long flags)
{
struct task_struct *tsk = current;
struct sem_waiter waiter;
- semtrace(sem, "Entering __down");
+ semtrace(sem, "Entering __down_sem");
/* set up my own style of waitqueue */
waiter.task = tsk;
@@ -65,22 +65,22 @@ void __down(struct semaphore *sem, unsig
}
tsk->state = TASK_RUNNING;
- semtrace(sem, "Leaving __down");
+ semtrace(sem, "Leaving __down_sem");
}
-EXPORT_SYMBOL(__down);
+EXPORT_SYMBOL(__down_sem);
/*
* interruptibly wait for a token to be granted from a semaphore
* - entered with lock held and interrupts disabled
*/
-int __down_interruptible(struct semaphore *sem, unsigned long flags)
+int __down_sem_interruptible(struct semaphore *sem, unsigned long flags)
{
struct task_struct *tsk = current;
struct sem_waiter waiter;
int ret;
- semtrace(sem,"Entering __down_interruptible");
+ semtrace(sem,"Entering __down_sem_interruptible");
/* set up my own style of waitqueue */
waiter.task = tsk;
@@ -106,7 +106,7 @@ int __down_interruptible(struct semaphor
out:
tsk->state = TASK_RUNNING;
- semtrace(sem, "Leaving __down_interruptible");
+ semtrace(sem, "Leaving __down_sem_interruptible");
return ret;
interrupted:
@@ -123,18 +123,18 @@ int __down_interruptible(struct semaphor
goto out;
}
-EXPORT_SYMBOL(__down_interruptible);
+EXPORT_SYMBOL(__down_sem_interruptible);
/*
* release a single token back to a semaphore
* - entered with lock held and interrupts disabled
*/
-void __up(struct semaphore *sem)
+void __up_sem(struct semaphore *sem)
{
struct task_struct *tsk;
struct sem_waiter *waiter;
- semtrace(sem,"Entering __up");
+ semtrace(sem,"Entering __up_sem");
/* grant the token to the process at the front of the queue */
waiter = list_entry(sem->wait_list.next, struct sem_waiter, list);
@@ -150,7 +150,7 @@ void __up(struct semaphore *sem)
wake_up_process(tsk);
put_task_struct(tsk);
- semtrace(sem,"Leaving __up");
+ semtrace(sem,"Leaving __up_sem");
}
-EXPORT_SYMBOL(__up);
+EXPORT_SYMBOL(__up_sem);
next prev parent reply other threads:[~2005-12-12 23:48 UTC|newest]
Thread overview: 226+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-12 23:45 [PATCH 1/19] MUTEX: Introduce simple mutex implementation David Howells
2005-12-12 23:45 ` [PATCH 2/19] MUTEX: i386 arch mutex David Howells
2005-12-12 23:45 ` [PATCH 7/19] MUTEX: Drivers F-H changes David Howells
2005-12-12 23:45 ` David Howells [this message]
2005-12-12 23:45 ` [PATCH 5/19] MUTEX: Core kernel changes David Howells
2005-12-12 23:45 ` [PATCH 8/19] MUTEX: Drivers I-K changes David Howells
2005-12-12 23:45 ` [PATCH 6/19] MUTEX: Drivers A-E changes David Howells
2005-12-12 23:45 ` [PATCH 3/19] MUTEX: x86_64 arch mutex David Howells
2005-12-12 23:45 ` [PATCH 12/19] MUTEX: Drivers T-Z changes David Howells
2005-12-12 23:45 ` [PATCH 13/19] MUTEX: Filesystem changes David Howells
2005-12-12 23:45 ` [PATCH 11/19] MUTEX: Drivers Q-S changes David Howells
2005-12-12 23:45 ` [PATCH 15/19] MUTEX: Second set of include changes David Howells
2005-12-12 23:45 ` [PATCH 9/19] MUTEX: Drivers L-M changes David Howells
2005-12-12 23:45 ` [PATCH 10/19] MUTEX: Drivers N-P changes David Howells
2005-12-12 23:45 ` [PATCH 14/19] MUTEX: First set of include changes David Howells
2005-12-12 23:45 ` [PATCH 16/19] MUTEX: IPC changes David Howells
2005-12-12 23:45 ` [PATCH 19/19] MUTEX: Sound changes David Howells
2005-12-12 23:45 ` [PATCH 17/19] MUTEX: Networking changes David Howells
2005-12-12 23:45 ` [PATCH 18/19] MUTEX: Security changes David Howells
2005-12-13 0:13 ` [PATCH 1/19] MUTEX: Introduce simple mutex implementation Nick Piggin
2005-12-13 0:19 ` Nick Piggin
2005-12-13 0:19 ` Andrew Morton
2005-12-13 7:54 ` Ingo Molnar
2005-12-13 7:58 ` Andi Kleen
2005-12-13 8:42 ` Andrew Morton
2005-12-13 8:49 ` Andi Kleen
2005-12-13 9:01 ` Andrew Morton
2005-12-13 9:02 ` Andrew Morton
2005-12-13 10:07 ` Jakub Jelinek
2005-12-13 10:11 ` Andi Kleen
2005-12-13 10:15 ` Jakub Jelinek
2005-12-13 10:25 ` Andrew Morton
2005-12-14 10:46 ` Russell King
2005-12-13 9:05 ` Andi Kleen
2005-12-13 9:15 ` Andrew Morton
2005-12-13 9:24 ` Andi Kleen
2005-12-13 9:44 ` Andrew Morton
2005-12-13 9:49 ` Andi Kleen
2005-12-13 10:28 ` Andreas Schwab
2005-12-13 10:30 ` Andi Kleen
2005-12-13 12:33 ` Matthew Wilcox
2005-12-13 22:18 ` Adrian Bunk
2005-12-13 22:25 ` Andi Kleen
2005-12-13 22:32 ` Adrian Bunk
2005-12-13 9:11 ` Ingo Molnar
2005-12-13 9:04 ` Christoph Hellwig
2005-12-13 9:13 ` Ingo Molnar
2005-12-13 10:11 ` Jakub Jelinek
2005-12-13 10:19 ` Christoph Hellwig
2005-12-13 10:27 ` Ingo Molnar
2005-12-15 4:53 ` Miles Bader
2005-12-15 5:05 ` Nick Piggin
2005-12-13 9:09 ` Ingo Molnar
2005-12-13 9:21 ` Andi Kleen
2005-12-13 16:16 ` Linus Torvalds
2005-12-13 21:56 ` Using C99 in the kernel was " Andi Kleen
2005-12-13 23:05 ` Al Viro
2005-12-13 23:41 ` Andi Kleen
2005-12-13 9:03 ` Christoph Hellwig
2005-12-13 9:14 ` Andrew Morton
2005-12-13 9:21 ` Christoph Hellwig
2005-12-13 10:31 ` drivers/scsi/sd.c gcc-2.95.3 Alexey Dobriyan
2005-12-13 8:00 ` [PATCH 1/19] MUTEX: Introduce simple mutex implementation Arjan van de Ven
2005-12-13 9:03 ` Ingo Molnar
2005-12-13 9:09 ` Andi Kleen
2005-12-13 9:34 ` Ingo Molnar
2005-12-13 14:33 ` Mark Lord
2005-12-13 14:45 ` Arjan van de Ven
2005-12-13 9:37 ` Ingo Molnar
2005-12-13 9:19 ` Arjan van de Ven
2005-12-13 9:02 ` Christoph Hellwig
2005-12-13 9:39 ` Ingo Molnar
2005-12-13 10:00 ` Ingo Molnar
2005-12-13 17:40 ` Paul Jackson
2005-12-13 18:34 ` David Howells
2005-12-13 22:31 ` Paul Jackson
2005-12-14 11:02 ` David Howells
2005-12-14 11:12 ` David Howells
2005-12-14 11:18 ` Alan Cox
2005-12-14 12:35 ` David Howells
2005-12-14 13:58 ` Thomas Gleixner
2005-12-14 23:40 ` Mark Lord
2005-12-14 23:54 ` Andrew Morton
2005-12-15 13:41 ` Nikita Danilov
2005-12-15 14:56 ` Alan Cox
2005-12-15 15:52 ` Nikita Danilov
2005-12-15 16:50 ` Christopher Friesen
2005-12-15 20:53 ` Steven Rostedt
2005-12-15 15:55 ` David Howells
2005-12-15 16:22 ` linux-os (Dick Johnson)
2005-12-15 16:28 ` Linus Torvalds
2005-12-15 17:04 ` Thomas Gleixner
2005-12-15 17:09 ` Paul Jackson
2005-12-15 17:17 ` David Howells
2005-12-15 16:51 ` David Howells
2005-12-15 16:56 ` Paul Jackson
2005-12-15 17:28 ` David Howells
2005-12-15 17:48 ` Linus Torvalds
2005-12-15 18:20 ` Nikita Danilov
2005-12-15 20:58 ` Steven Rostedt
2005-12-15 19:21 ` Andrew Morton
2005-12-15 19:38 ` Linus Torvalds
2005-12-15 20:28 ` Steven Rostedt
2005-12-15 20:32 ` Geert Uytterhoeven
2005-12-16 21:41 ` Thomas Gleixner
2005-12-16 21:41 ` Linus Torvalds
2005-12-16 22:06 ` Thomas Gleixner
2005-12-16 22:19 ` Linus Torvalds
2005-12-16 22:32 ` Steven Rostedt
2005-12-16 22:42 ` Thomas Gleixner
2005-12-16 22:41 ` Linus Torvalds
2005-12-16 22:49 ` Steven Rostedt
2005-12-16 23:29 ` Thomas Gleixner
2005-12-17 0:29 ` Joe Korty
2005-12-17 1:00 ` Linus Torvalds
2005-12-17 3:13 ` Steven Rostedt
2005-12-17 7:34 ` Linus Torvalds
2005-12-17 23:43 ` Matthew Wilcox
2005-12-18 0:05 ` Lee Revell
2005-12-18 0:21 ` Matthew Wilcox
2005-12-18 1:25 ` Lee Revell
2005-12-22 12:27 ` Bill Huey
2005-12-19 16:08 ` Ingo Molnar
2005-12-22 12:40 ` Bill Huey
2005-12-22 12:45 ` Bill Huey
2005-12-19 23:46 ` Keith Owens
2005-12-15 14:41 ` Steven Rostedt
2005-12-14 23:57 ` Thomas Gleixner
2005-12-14 23:57 ` Mark Lord
2005-12-15 0:10 ` Thomas Gleixner
2005-12-15 2:46 ` Linus Torvalds
2005-12-15 15:53 ` David Howells
2005-12-15 15:37 ` David Howells
2005-12-15 19:28 ` Andrew Morton
2005-12-15 20:18 ` Andrew Morton
2005-12-15 21:28 ` Steven Rostedt
2005-12-16 22:02 ` Thomas Gleixner
2005-12-16 10:45 ` David Howells
2005-12-13 9:55 ` Ingo Molnar
2005-12-13 0:30 ` Arnd Bergmann
2005-12-13 0:57 ` Daniel Walker
2005-12-13 3:23 ` Steven Rostedt
2005-12-13 2:57 ` Mark Lord
2005-12-13 3:17 ` Steven Rostedt
2005-12-13 9:06 ` Christoph Hellwig
2005-12-13 9:54 ` David Howells
2005-12-13 10:13 ` Ingo Molnar
2005-12-13 10:34 ` Ingo Molnar
2005-12-13 10:37 ` Ingo Molnar
2005-12-13 12:47 ` Oliver Neukum
2005-12-13 13:09 ` Alan Cox
2005-12-13 13:13 ` Matthew Wilcox
2005-12-13 14:04 ` Alan Cox
2005-12-13 13:24 ` Oliver Neukum
2005-12-14 1:00 ` Nick Piggin
2005-12-14 10:54 ` David Howells
2005-12-14 11:17 ` Nick Piggin
2005-12-14 11:46 ` David Howells
2005-12-14 21:23 ` Nick Piggin
2005-12-16 12:00 ` David Howells
2005-12-16 13:16 ` Nick Piggin
2005-12-16 15:53 ` David Howells
2005-12-16 23:41 ` Nick Piggin
2005-12-16 16:02 ` David Howells
2005-12-13 10:48 ` David Howells
2005-12-13 12:39 ` Matthew Wilcox
2005-12-13 10:54 ` Ingo Molnar
2005-12-13 11:23 ` David Howells
2005-12-13 11:24 ` David Howells
2005-12-13 13:45 ` Ingo Molnar
2005-12-13 11:34 ` David Howells
2005-12-13 13:05 ` Alan Cox
2005-12-13 13:15 ` Alan Cox
2005-12-13 23:21 ` Nikita Danilov
2005-12-13 13:32 ` David Howells
2005-12-13 14:00 ` Alan Cox
2005-12-13 14:35 ` Christopher Friesen
2005-12-13 14:44 ` Arjan van de Ven
2005-12-13 14:59 ` Christopher Friesen
2005-12-13 15:23 ` David Howells
2005-12-15 5:24 ` Miles Bader
2005-12-13 15:39 ` David Howells
2005-12-13 16:10 ` Alan Cox
2005-12-14 10:29 ` Arjan van de Ven
2005-12-14 11:03 ` Arjan van de Ven
2005-12-14 11:03 ` Alan Cox
2005-12-14 11:08 ` Arjan van de Ven
2005-12-14 11:24 ` Alan Cox
2005-12-14 11:35 ` Andrew Morton
2005-12-14 11:44 ` Arjan van de Ven
2005-12-14 11:52 ` Andi Kleen
2005-12-14 11:55 ` Arjan van de Ven
2005-12-14 11:57 ` David Howells
2005-12-14 12:19 ` Jakub Jelinek
2005-12-16 1:54 ` Nick Piggin
2005-12-16 11:02 ` David Howells
2005-12-16 13:01 ` Nick Piggin
2005-12-16 13:21 ` Russell King
2005-12-16 13:41 ` Nick Piggin
2005-12-16 13:46 ` Linh Dang
2005-12-16 14:31 ` Russell King
2005-12-16 15:24 ` Linh Dang
2005-12-16 15:35 ` Nick Piggin
2005-12-16 15:40 ` Kyle Moffett
2005-12-16 15:49 ` Linh Dang
2005-12-16 15:46 ` David Howells
2005-12-16 15:58 ` Russell King
2005-12-17 15:57 ` Nikita Danilov
2005-12-16 16:28 ` Linus Torvalds
2005-12-16 11:30 ` David Howells
2005-12-16 16:33 ` Linus Torvalds
2005-12-16 22:23 ` David S. Miller
2005-12-16 22:38 ` Linus Torvalds
2005-12-16 22:53 ` David S. Miller
2005-12-17 0:41 ` Jesse Barnes
2005-12-17 7:10 ` David S. Miller
2005-12-17 7:40 ` Linus Torvalds
2005-12-17 17:22 ` Jesse Barnes
2005-12-17 17:19 ` Jesse Barnes
2005-12-17 22:38 ` Richard Henderson
2005-12-17 23:05 ` David S. Miller
2005-12-14 12:17 ` Christoph Hellwig
2005-12-14 11:42 ` Arjan van de Ven
2005-12-14 8:31 ` Ingo Molnar
2005-12-13 20:04 ` Steven Rostedt
2005-12-13 21:03 ` David Howells
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=200512122345.jBCNjllF009033@warthog.cambridge.redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@osdl.org \
--cc=arjan@infradead.org \
--cc=hch@infradead.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=torvalds@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®