Messages in this thread | | | Subject | (patch) alpha fix | Date | Fri, 4 Sep 1998 02:32:53 -0400 (EDT) | From | Jeff Garzik <> |
| |
Linus,
Please consider the patches below for a future 2.1.x patch. They fix a few typos for Alpha under SMP=1 which break Alpha platform compilation.
This patch has been tested fairly thoroughly on a standard Avanti Alpha kernel config. I had hoped a smarter fix would be available, but this at least moves UP Alpha back into the "dependable" category.
Thanks,
Jeff
(the following is slightly updated from previous patch)
The following patch is against 2.1.120-pre3. It resolves several problems when compiling with SMP = 1 on Alpha.
Test config: AS 200, avanti kernel w/ SRM boot, RedHat 5.1
Summary of changes: Makefile use gzip compression level 9 (-9) proto.h corrects smp_info prototype smp.c * add kernel_flag spinlock var to resolve missing-symbol link errors * disable debugging printk smplock.h needs linux/sched.h for task_struct softirq.h needs linux/stddef.h for definition of NULL linux/interrupt.h needs linux/ptrace.h for struct pt_regs core_apecs.c needs linux/sched.h for smp_processor_id
-------------CUT HERE----------CUT HERE-------------------- diff -r -c -b linux-2.1.120-pre3/arch/alpha/boot/Makefile linux/arch/alpha/boot/Makefile *** linux-2.1.120-pre3/arch/alpha/boot/Makefile Mon Jan 12 17:51:14 1998 --- linux/arch/alpha/boot/Makefile Fri Sep 4 00:21:25 1998 *************** *** 56,62 **** @test "$(BOOTDEV)" != "" || (echo You must specify BOOTDEV ; exit -1) vmlinux.gz: vmlinux ! gzip -fv vmlinux # # A raw binary without header. Used by raw boot. --- 56,62 ---- @test "$(BOOTDEV)" != "" || (echo You must specify BOOTDEV ; exit -1) vmlinux.gz: vmlinux ! gzip -fv9 vmlinux # # A raw binary without header. Used by raw boot. diff -r -c -b linux-2.1.120-pre3/arch/alpha/kernel/core_apecs.c linux/arch/alpha/kernel/core_apecs.c *** linux-2.1.120-pre3/arch/alpha/kernel/core_apecs.c Sun Aug 9 15:09:05 1998 --- linux/arch/alpha/kernel/core_apecs.c Thu Sep 3 23:11:07 1998 *************** *** 14,19 **** --- 14,20 ---- #include <linux/types.h> #include <linux/pci.h> #include <linux/init.h> + #include <linux/sched.h> #include <asm/system.h> #include <asm/ptrace.h> diff -r -c -b linux-2.1.120-pre3/arch/alpha/kernel/proto.h linux/arch/alpha/kernel/proto.h *** linux-2.1.120-pre3/arch/alpha/kernel/proto.h Sun Aug 9 15:09:05 1998 --- linux/arch/alpha/kernel/proto.h Thu Sep 3 23:11:07 1998 *************** *** 92,98 **** /* smp.c */ extern void setup_smp(void); ! extern char *smp_info(void); extern void handle_ipi(struct pt_regs *); /* bios32.c */ --- 92,98 ---- /* smp.c */ extern void setup_smp(void); ! extern int smp_info(char *buffer); extern void handle_ipi(struct pt_regs *); /* bios32.c */ diff -r -c -b linux-2.1.120-pre3/arch/alpha/kernel/smp.c linux/arch/alpha/kernel/smp.c *** linux-2.1.120-pre3/arch/alpha/kernel/smp.c Sun Aug 9 15:09:05 1998 --- linux/arch/alpha/kernel/smp.c Thu Sep 3 23:13:00 1998 *************** *** 34,39 **** --- 34,40 ---- klock_info_t klock_info = { KLOCK_CLEAR, 0 }; spinlock_t ticker_lock = SPIN_LOCK_UNLOCKED; + spinlock_t kernel_flag = SPIN_LOCK_UNLOCKED; unsigned int boot_cpu_id = 0; static int smp_activated = 0; *************** *** 766,772 **** unsigned int to_whom = cpu_present_map ^ (1 << smp_processor_id()); int timeout = 10000; ! #if 1 if (!kernel_lock_held()) { printk("flush_tlb_all: kernel_flag %d (cpu %d akp %d)!\n", klock_info.kernel_flag, smp_processor_id(), klock_info.akp); --- 767,773 ---- unsigned int to_whom = cpu_present_map ^ (1 << smp_processor_id()); int timeout = 10000; ! #if ALPHA_SMP_DEBUG_TLB if (!kernel_lock_held()) { printk("flush_tlb_all: kernel_flag %d (cpu %d akp %d)!\n", klock_info.kernel_flag, smp_processor_id(), klock_info.akp); *************** *** 794,800 **** unsigned int to_whom = cpu_present_map ^ (1 << smp_processor_id()); int timeout = 10000; ! #if 1 if (!kernel_lock_held()) { printk("flush_tlb_mm: kernel_flag %d (cpu %d akp %d)!\n", klock_info.kernel_flag, smp_processor_id(), klock_info.akp); --- 795,801 ---- unsigned int to_whom = cpu_present_map ^ (1 << smp_processor_id()); int timeout = 10000; ! #if ALPHA_SMP_DEBUG_TLB if (!kernel_lock_held()) { printk("flush_tlb_mm: kernel_flag %d (cpu %d akp %d)!\n", klock_info.kernel_flag, smp_processor_id(), klock_info.akp); *************** *** 829,835 **** struct mm_struct * mm = vma->vm_mm; int timeout = 10000; ! #if 1 if (!kernel_lock_held()) { printk("flush_tlb_page: kernel_flag %d (cpu %d akp %d)!\n", klock_info.kernel_flag, cpu, klock_info.akp); --- 830,836 ---- struct mm_struct * mm = vma->vm_mm; int timeout = 10000; ! #if ALPHA_SMP_DEBUG_TLB if (!kernel_lock_held()) { printk("flush_tlb_page: kernel_flag %d (cpu %d akp %d)!\n", klock_info.kernel_flag, cpu, klock_info.akp); *************** *** 873,879 **** timeout = 10000; to_whom = cpu_present_map ^ (1 << smp_processor_id()); ! #if 1 if (!kernel_lock_held()) { printk("flush_tlb_range: kernel_flag %d (cpu %d akp %d) @ 0x%lx\n", klock_info.kernel_flag, smp_processor_id(), klock_info.akp, --- 874,880 ---- timeout = 10000; to_whom = cpu_present_map ^ (1 << smp_processor_id()); ! #if ALPHA_SMP_DEBUG_TLB if (!kernel_lock_held()) { printk("flush_tlb_range: kernel_flag %d (cpu %d akp %d) @ 0x%lx\n", klock_info.kernel_flag, smp_processor_id(), klock_info.akp, diff -r -c -b linux-2.1.120-pre3/include/asm-alpha/smplock.h linux/include/asm-alpha/smplock.h *** linux-2.1.120-pre3/include/asm-alpha/smplock.h Mon Aug 3 15:28:20 1998 --- linux/include/asm-alpha/smplock.h Thu Sep 3 23:50:58 1998 *************** *** 4,9 **** --- 4,10 ---- * Default SMP lock implementation */ #include <linux/interrupt.h> + #include <linux/sched.h> #include <asm/spinlock.h> extern spinlock_t kernel_flag; diff -r -c -b linux-2.1.120-pre3/include/asm-alpha/softirq.h linux/include/asm-alpha/softirq.h *** linux-2.1.120-pre3/include/asm-alpha/softirq.h Mon Mar 30 03:21:41 1998 --- linux/include/asm-alpha/softirq.h Thu Sep 3 23:20:09 1998 *************** *** 1,6 **** --- 1,7 ---- #ifndef _ALPHA_SOFTIRQ_H #define _ALPHA_SOFTIRQ_H + #include <linux/stddef.h> #include <asm/atomic.h> #include <asm/hardirq.h> diff -r -c -b linux-2.1.120-pre3/include/linux/interrupt.h linux/include/linux/interrupt.h *** linux-2.1.120-pre3/include/linux/interrupt.h Wed Aug 26 18:00:39 1998 --- linux/include/linux/interrupt.h Thu Sep 3 23:20:09 1998 *************** *** 3,8 **** --- 3,9 ---- #define _LINUX_INTERRUPT_H #include <linux/kernel.h> + #include <linux/ptrace.h> #include <asm/bitops.h> #include <asm/atomic.h> -------------CUT HERE----------CUT HERE--------------------
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/faq.html
| |