linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Oliver Neukum" <Oliver.Neukum@lrz.uni-muenchen.de>
To: linuxppc-dev@lists.linuxppc.org
Subject: semaphores in 2.3.3
Date: Mon, 24 May 1999 18:15:55 +0000	[thread overview]
Message-ID: <199905241630.SAA25266@dv.ba.dlr.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

Hi,

as you may have noticed linux-2.3.3  doesn't compile on powerpc due to
changes in semaphores and waitqueues. This means that ppc is again at a
disadvantage.
I hope for ppc to become one of the stable ports.
I've attached a patch that ports the basic change from i386 to ppc.
As yet, the kernel will not compile. It needs to include semaphore.h at a
few places. In addition i've found ide-pmac.c and adbmouse.c to be broken.

People, this can't be that hard.

Regards

Oliver Neukum

PS: It assumes the changes needed to compile 2.2.8 have been made.

PPS:What is the reason IrDA isn't there for ppc ?

[-- Attachment #2: ppc233patch --]
[-- Type: application/octet-stream, Size: 1900 bytes --]

--- include/asm-ppc/semaphore.h.alt	Mon May 24 15:16:03 1999
+++ include/asm-ppc/semaphore.h	Mon May 24 17:16:08 1999
@@ -9,6 +9,7 @@
  */
 
 #include <asm/atomic.h>
+#include <linux/wait.h>
 
 struct semaphore {
 	atomic_t count;
@@ -16,17 +17,42 @@
 	wait_queue_head_t wait;
 };
 
-#define sema_init(sem, val)	atomic_set(&((sem)->count), (val))
-
-#define MUTEX		((struct semaphore) \
-			 { ATOMIC_INIT(1), ATOMIC_INIT(0), NULL })
-#define MUTEX_LOCKED	((struct semaphore) \
-			 { ATOMIC_INIT(0), ATOMIC_INIT(0), NULL })
+#define __SEM_DEBUG_INIT(name)
 
 extern void __down(struct semaphore * sem);
 extern int  __down_interruptible(struct semaphore * sem);
 extern int  __down_trylock(struct semaphore * sem);
 extern void __up(struct semaphore * sem);
+
+#define __SEMAPHORE_INITIALIZER(name,count) \
+{ ATOMIC_INIT(count), 0,__WAITQUEUE_HEAD_INITIALIZER((name).wait) \
+	__SEM_DEBUG_INIT(name) }
+
+#define __MUTEX_INITIALIZER(name) \
+	__SEMAPHORE_INITIALIZER(name,1)
+
+#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)
+
+extern inline void sema_init (struct semaphore *sem, int val)
+{
+atomic_set(&sem->count, val);
+atomic_set(&sem->waking, 0);
+init_waitqueue_head(&sem->wait);
+}
+
+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 inline void down(struct semaphore * sem)
 {
--- kernel/fork.c.alt	Mon May 24 15:01:26 1999
+++ kernel/fork.c	Mon May 24 17:10:47 1999
@@ -21,6 +21,7 @@
 #include <asm/pgtable.h>
 #include <asm/mmu_context.h>
 #include <asm/uaccess.h>
+#include <asm/semaphore.h>
 
 /* The idle tasks do not count.. */
 int nr_tasks=0;

             reply	other threads:[~1999-05-24 18:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-24 18:15 Oliver Neukum [this message]
1999-05-24 17:00 ` semaphores in 2.3.3 Martin Costabel

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=199905241630.SAA25266@dv.ba.dlr.de \
    --to=oliver.neukum@lrz.uni-muenchen.de \
    --cc=linuxppc-dev@lists.linuxppc.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;
as well as URLs for NNTP newsgroup(s).