Messages in this thread Patch in this message | | | Date | Sat, 22 May 1999 10:46:42 -0400 (EDT) | From | Jeff Garzik <> | Subject | [patch] alpha 2.3.x fixes and crashes |
| |
2.3.3 does not compile at all on Alpha because of the new wait queue and semaphore changes, the patch below fixes that.
arch/alpha/kernel/process.c - corrects for updated sched.h initializer macros
include/asm-alpha/semaphore.h - adds semaphore primitves used in kernel/fork.c and elsewhere, mainly stolen from include/asm-i386/semaphore.h.
The process.c change looks correct, but Alpha semaphores definitely need some more attention.
My kernel gets all the way through the boot process, all the way to multi-user with daemons running, before things start crashing. The kernel itself doesn't panic, but oops reports pour across the console as fast as my poor old laptop (serial port console) can record them.
I have attached ksymoops output for the first few oops reports. I haven't looked at all at up(), down() and down_failed() yet (where the oops are), to see if there might be a problem in there.
Jeff
Index: arch/alpha/kernel/process.c =================================================================== RCS file: /usr/local/cvsroot/linux_2_3/arch/alpha/kernel/process.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 process.c --- arch/alpha/kernel/process.c 1999/05/16 06:27:48 1.1.1.1 +++ arch/alpha/kernel/process.c 1999/05/22 14:28:36 @@ -58,10 +58,11 @@ static struct file * init_fd_array[NR_OPEN] = { NULL, }; static struct files_struct init_files = INIT_FILES; static struct signal_struct init_signals = INIT_SIGNALS; -struct mm_struct init_mm = INIT_MM; +struct mm_struct init_mm = INIT_MM(init_mm); -union task_union init_task_union __attribute__((section("init_task"))) - = { task: INIT_TASK }; +union task_union init_task_union + __attribute__((__section__(".data.init_task"))) = + { INIT_TASK(init_task_union.task) }; /* * No need to acquire the kernel lock, we're entirely local.. Index: include/asm-alpha/semaphore.h =================================================================== RCS file: /usr/local/cvsroot/linux_2_3/include/asm-alpha/semaphore.h,v retrieving revision 1.1.1.2 diff -u -r1.1.1.2 semaphore.h --- include/asm-alpha/semaphore.h 1999/05/21 22:43:31 1.1.1.2 +++ include/asm-alpha/semaphore.h 1999/05/22 14:29:08 @@ -8,23 +8,54 @@ * (C) Copyright 1996 Richard Henderson */ +#include <linux/wait.h> #include <asm/current.h> #include <asm/system.h> #include <asm/atomic.h> +#if WAITQUEUE_DEBUG +#error wait queue debugging is not supported +#endif + struct semaphore { /* Careful, inline assembly knows about the position of these two. */ atomic_t count; atomic_t waking; /* biased by -1 */ wait_queue_head_t wait; }; + + +#define __SEM_DEBUG_INIT(name) +#define __SEM_DEBUG_INIT_LATER(name) + +#define __SEMAPHORE_INITIALIZER(name,count) \ +{ ATOMIC_INIT(count), ATOMIC_INIT(-1), \ + __WAIT_QUEUE_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 MUTEX ((struct semaphore) \ - { ATOMIC_INIT(1), ATOMIC_INIT(-1), NULL }) -#define MUTEX_LOCKED ((struct semaphore) \ - { ATOMIC_INIT(0), ATOMIC_INIT(-1), NULL }) +#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) +#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) + #define sema_init(sem, val) atomic_set(&((sem)->count), 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); extern int __down_interruptible(struct semaphore * sem); Index: include/linux/wait.h =================================================================== RCS file: /usr/local/cvsroot/linux_2_3/include/linux/wait.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 wait.h --- include/linux/wait.h 1999/05/16 06:21:10 1.1.1.1 +++ include/linux/wait.h 1999/05/22 14:29:33 @@ -17,7 +17,7 @@ * Temporary debugging help until all code is converted to the new * waitqueue usage. */ -#define WAITQUEUE_DEBUG 1 +#define WAITQUEUE_DEBUG 0 #if WAITQUEUE_DEBUG extern int printk(const char *fmt, ...);[unhandled content-type:application/octet-stream] | |