linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: semaphores in 2.3.3
  1999-05-24 18:15 semaphores in 2.3.3 Oliver Neukum
@ 1999-05-24 17:00 ` Martin Costabel
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Costabel @ 1999-05-24 17:00 UTC (permalink / raw)
  To: Oliver Neukum; +Cc: linuxppc-dev


Oliver Neukum wrote:
> 
> 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.

AFAICT, this is not a problem of finding the right patches, but to get
them accepted by Linus.

The vger cvs tree has had a compiling 2.3.3 kernel for some time (I am
running it right now). The one I am running is from last Friday, the one
checked out today compiles, but doesn't boot.

I think if you want to use 2.3.x kernels, you have to accept that these
are development kernels, and that there are periods when they don't
work.

After all, there is the stable just one week old version 2.2.9 (although
the official 2.2.9 kernel includes this broken patch of
arch/ppc/kernel/syscalls.c that didn't come from vger).

--
Martin

[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* semaphores in 2.3.3
@ 1999-05-24 18:15 Oliver Neukum
  1999-05-24 17:00 ` Martin Costabel
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Neukum @ 1999-05-24 18:15 UTC (permalink / raw)
  To: linuxppc-dev

[-- 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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-05-24 18:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-05-24 18:15 semaphores in 2.3.3 Oliver Neukum
1999-05-24 17:00 ` Martin Costabel

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).