diff -Nru a/Makefile b/Makefile --- a/Makefile Tue Jul 29 00:57:42 2003 +++ b/Makefile Tue Jul 29 00:57:42 2003 @@ -213,7 +213,7 @@ NOSTDINC_FLAGS = -nostdinc -iwithprefix include CPPFLAGS := -D__KERNEL__ -Iinclude -CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \ +CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs -g -O2 \ -fno-strict-aliasing -fno-common AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS) diff -Nru a/arch/ia64/Kconfig b/arch/ia64/Kconfig --- a/arch/ia64/Kconfig Tue Jul 29 00:57:42 2003 +++ b/arch/ia64/Kconfig Tue Jul 29 00:57:42 2003 @@ -700,6 +700,33 @@ keys are documented in . Don't say Y unless you really know what this hack does. +config IA64_EARLY_PRINTK + bool "Early printk support" + depends on DEBUG_KERNEL && !IA64_GENERIC + help + Selecting this option uses the VGA screen or serial console for + printk() output before the consoles are initialised. It is useful + for debugging problems early in the boot process, but only if you + have a suitable VGA/serial console attached. If you're unsure, + select N. + +config IA64_EARLY_PRINTK_UART + bool "Early printk on MMIO serial port" + depends on IA64_EARLY_PRINTK + +config IA64_EARLY_PRINTK_UART_BASE + hex "UART MMIO base address" + depends on IA64_EARLY_PRINTK_UART + default "ff5e0000" + +config IA64_EARLY_PRINTK_VGA + bool "Early printk on VGA" + depends on IA64_EARLY_PRINTK + +config IA64_EARLY_PRINTK_SGI_SN + bool "Early printk on SGI SN serial console" + depends on IA64_EARLY_PRINTK && (IA64_GENERIC || IA64_SGI_SN2) + config DEBUG_SLAB bool "Debug memory allocations" depends on DEBUG_KERNEL diff -Nru a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c --- a/arch/ia64/kernel/process.c Tue Jul 29 00:57:42 2003 +++ b/arch/ia64/kernel/process.c Tue Jul 29 00:57:42 2003 @@ -45,7 +45,7 @@ ia64_do_show_stack (struct unw_frame_info *info, void *arg) { unsigned long ip, sp, bsp; - char buf[80]; /* don't make it so big that it overflows the stack! */ + char buf[128]; /* don't make it so big that it overflows the stack! */ printk("\nCall Trace:\n"); do { @@ -55,7 +55,9 @@ unw_get_sp(info, &sp); unw_get_bsp(info, &bsp); - snprintf(buf, sizeof(buf), " [<%016lx>] %%s\n\t\t\t\tsp=%016lx bsp=%016lx\n", + snprintf(buf, sizeof(buf), + " [<%016lx>] %%s\n" + " sp=%016lx bsp=%016lx\n", ip, sp, bsp); print_symbol(buf, ip); } while (unw_unwind(info) >= 0); diff -Nru a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c --- a/arch/ia64/kernel/setup.c Tue Jul 29 00:57:41 2003 +++ b/arch/ia64/kernel/setup.c Tue Jul 29 00:57:41 2003 @@ -372,6 +372,7 @@ strlcpy(saved_command_line, *cmdline_p, sizeof(saved_command_line)); efi_init(); + find_memory(); #ifdef CONFIG_ACPI_BOOT /* Initialize the ACPI boot-time table parser */ @@ -384,8 +385,6 @@ smp_build_cpu_map(); /* happens, e.g., with the Ski simulator */ # endif #endif /* CONFIG_APCI_BOOT */ - - find_memory(); /* process SAL system table: */ ia64_sal_init(efi.sal_systab); diff -Nru a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c --- a/drivers/acpi/pci_irq.c Tue Jul 29 00:57:42 2003 +++ b/drivers/acpi/pci_irq.c Tue Jul 29 00:57:42 2003 @@ -24,6 +24,8 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#include + #include #include #include @@ -36,6 +38,9 @@ #ifdef CONFIG_X86_IO_APIC #include #endif +#ifdef CONFIG_IOSAPIC +# include +#endif #include #include @@ -369,6 +374,10 @@ irq_mask |= (1 << dev->irq); eisa_set_level_irq(dev->irq); } +#endif +#ifdef CONFIG_IOSAPIC + if (acpi_irq_model == ACPI_IRQ_MODEL_IOSAPIC) + iosapic_enable_intr(dev->irq); #endif return_VALUE(dev->irq); diff -Nru a/drivers/media/radio/Makefile b/drivers/media/radio/Makefile --- a/drivers/media/radio/Makefile Tue Jul 29 00:57:42 2003 +++ b/drivers/media/radio/Makefile Tue Jul 29 00:57:42 2003 @@ -2,6 +2,8 @@ # Makefile for the kernel character device drivers. # +obj-y := dummy.o + miropcm20-objs := miropcm20-rds-core.o miropcm20-radio.o obj-$(CONFIG_RADIO_AZTECH) += radio-aztech.o diff -Nru a/drivers/media/radio/dummy.c b/drivers/media/radio/dummy.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/drivers/media/radio/dummy.c Tue Jul 29 00:57:42 2003 @@ -0,0 +1 @@ +/* just so the linker knows what kind of object files it's deadling with... */ diff -Nru a/drivers/media/video/Makefile b/drivers/media/video/Makefile --- a/drivers/media/video/Makefile Tue Jul 29 00:57:42 2003 +++ b/drivers/media/video/Makefile Tue Jul 29 00:57:42 2003 @@ -6,6 +6,8 @@ bttv-risc.o bttv-vbi.o zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o +obj-y := dummy.o + obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o v4l1-compat.o obj-$(CONFIG_VIDEO_BT848) += bttv.o msp3400.o tvaudio.o \ diff -Nru a/drivers/media/video/dummy.c b/drivers/media/video/dummy.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/drivers/media/video/dummy.c Tue Jul 29 00:57:42 2003 @@ -0,0 +1 @@ +/* just so the linker knows what kind of object files it's deadling with... */ diff -Nru a/drivers/net/tulip/media.c b/drivers/net/tulip/media.c --- a/drivers/net/tulip/media.c Tue Jul 29 00:57:41 2003 +++ b/drivers/net/tulip/media.c Tue Jul 29 00:57:41 2003 @@ -278,6 +278,10 @@ for (i = 0; i < init_length; i++) outl(init_sequence[i], ioaddr + CSR12); } + + (void) inl(ioaddr + CSR6); /* flush CSR12 writes */ + udelay(500); /* Give MII time to recover */ + tmp_info = get_u16(&misc_info[1]); if (tmp_info) tp->advertising[phy_num] = tmp_info | 1; diff -Nru a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c --- a/drivers/scsi/qla1280.c Tue Jul 29 00:57:42 2003 +++ b/drivers/scsi/qla1280.c Tue Jul 29 00:57:42 2003 @@ -284,7 +284,7 @@ #define QL1280_TARGET_MODE_SUPPORT 0 /* Target mode support */ #define QL1280_LUN_SUPPORT 0 #define WATCHDOGTIMER 0 -#define MEMORY_MAPPED_IO 0 +#define MEMORY_MAPPED_IO 1 #define DEBUG_QLA1280_INTR 0 #define USE_NVRAM_DEFAULTS 0 #define DEBUG_PRINT_NVRAM 0 @@ -2491,7 +2491,7 @@ /* * Get memory mapped I/O address. */ - pci_read_config_word (ha->pdev, PCI_BASE_ADDRESS_1, &mmapbase); + pci_read_config_dword (ha->pdev, PCI_BASE_ADDRESS_1, &mmapbase); mmapbase &= PCI_BASE_ADDRESS_MEM_MASK; /* diff -Nru a/include/asm-ia64/io.h b/include/asm-ia64/io.h --- a/include/asm-ia64/io.h Tue Jul 29 00:57:41 2003 +++ b/include/asm-ia64/io.h Tue Jul 29 00:57:41 2003 @@ -420,6 +420,7 @@ * SPECweb-like workloads on zx1-based machines. Thus, for now we favor I/O MMU bypassing * over BIO-level virtual merging. */ +extern unsigned long ia64_max_iommu_merge_mask; #if 1 #define BIO_VMERGE_BOUNDARY 0 #else @@ -433,7 +434,6 @@ * * which is precisely what we want. */ -extern unsigned long ia64_max_iommu_merge_mask; #define BIO_VMERGE_BOUNDARY (ia64_max_iommu_merge_mask + 1) #endif diff -Nru a/include/asm-ia64/sections.h b/include/asm-ia64/sections.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/include/asm-ia64/sections.h Tue Jul 29 00:57:42 2003 @@ -0,0 +1,23 @@ +#ifndef _ASM_IA64_SECTIONS_H +#define _ASM_IA64_SECTIONS_H + +/* + * Copyright (C) 1998-2003 Hewlett-Packard Co + * David Mosberger-Tang + */ + +#include + +extern char __per_cpu_start[], __per_cpu_end[], __phys_per_cpu_start[]; +extern char __start___vtop_patchlist[], __end___vtop_patchlist[]; +extern char __start___mckinley_e9_bundles[], __end___mckinley_e9_bundles[]; +extern char __start_gate_section[]; +extern char __start_gate_mckinley_e9_patchlist[], __end_gate_mckinley_e9_patchlist[]; +extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[]; +extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[]; +extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[]; +extern char __start_unwind[], __end_unwind[]; +extern char _end[]; /* end of kernel image */ + +#endif /* _ASM_IA64_SECTIONS_H */ + diff -Nru a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h --- a/include/linux/nfs_fs.h Tue Jul 29 00:57:42 2003 +++ b/include/linux/nfs_fs.h Tue Jul 29 00:57:42 2003 @@ -410,7 +410,7 @@ nfs_size_to_loff_t(__u64 size) { loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1; - if (size > maxsz) + if (size > (__u64) maxsz) return maxsz; return (loff_t) size; } diff -Nru a/include/linux/sysctl.h b/include/linux/sysctl.h --- a/include/linux/sysctl.h Tue Jul 29 00:57:42 2003 +++ b/include/linux/sysctl.h Tue Jul 29 00:57:42 2003 @@ -126,6 +126,7 @@ KERN_PANIC_ON_OOPS=57, /* int: whether we will panic on an oops */ KERN_HPPA_PWRSW=58, /* int: hppa soft-power enable */ KERN_HPPA_UNALIGNED=59, /* int: hppa unaligned-trap enable */ + KERN_CACHEDECAYTICKS=60,/* ulong: value for cache_decay_ticks (EXPERIMENTAL!) */ }; diff -Nru a/kernel/printk.c b/kernel/printk.c --- a/kernel/printk.c Tue Jul 29 00:57:42 2003 +++ b/kernel/printk.c Tue Jul 29 00:57:42 2003 @@ -313,6 +313,12 @@ __call_console_drivers(start, end); } } +#ifdef CONFIG_IA64_EARLY_PRINTK + if (!console_drivers) { + void early_printk (const char *str, size_t len); + early_printk(&LOG_BUF(start), end - start); + } +#endif } /* @@ -630,7 +636,11 @@ * for us. */ spin_lock_irqsave(&logbuf_lock, flags); +#ifdef CONFIG_IA64_EARLY_PRINTK + con_start = log_end; +#else con_start = log_start; +#endif spin_unlock_irqrestore(&logbuf_lock, flags); } release_console_sem(); @@ -683,3 +693,117 @@ tty->driver->write(tty, 0, msg, strlen(msg)); return; } + +#ifdef CONFIG_IA64_EARLY_PRINTK + +#include + +# ifdef CONFIG_IA64_EARLY_PRINTK_VGA + + +#define VGABASE ((char *)0xc0000000000b8000) +#define VGALINES 24 +#define VGACOLS 80 + +static int current_ypos = VGALINES, current_xpos = 0; + +static void +early_printk_vga (const char *str, size_t len) +{ + char c; + int i, k, j; + + while (len-- > 0) { + c = *str++; + if (current_ypos >= VGALINES) { + /* scroll 1 line up */ + for (k = 1, j = 0; k < VGALINES; k++, j++) { + for (i = 0; i < VGACOLS; i++) { + writew(readw(VGABASE + 2*(VGACOLS*k + i)), + VGABASE + 2*(VGACOLS*j + i)); + } + } + for (i = 0; i < VGACOLS; i++) { + writew(0x720, VGABASE + 2*(VGACOLS*j + i)); + } + current_ypos = VGALINES-1; + } + if (c == '\n') { + current_xpos = 0; + current_ypos++; + } else if (c != '\r') { + writew(((0x7 << 8) | (unsigned short) c), + VGABASE + 2*(VGACOLS*current_ypos + current_xpos++)); + if (current_xpos >= VGACOLS) { + current_xpos = 0; + current_ypos++; + } + } + } +} + +# endif /* CONFIG_IA64_EARLY_PRINTK_VGA */ + +# ifdef CONFIG_IA64_EARLY_PRINTK_UART + +#include +#include + +static void early_printk_uart(const char *str, size_t len) +{ + static char *uart = NULL; + unsigned long uart_base; + char c; + + if (!uart) { + uart_base = 0; +# ifdef CONFIG_SERIAL_8250_HCDP + { + extern unsigned long hcdp_early_uart(void); + uart_base = hcdp_early_uart(); + } +# endif +# if CONFIG_IA64_EARLY_PRINTK_UART_BASE + if (!uart_base) + uart_base = CONFIG_IA64_EARLY_PRINTK_UART_BASE; +# endif + if (!uart_base) + return; + + uart = ioremap(uart_base, 64); + if (!uart) + return; + } + + while (len-- > 0) { + c = *str++; + while ((readb(uart + UART_LSR) & UART_LSR_TEMT) == 0) + cpu_relax(); /* spin */ + + writeb(c, uart + UART_TX); + + if (c == '\n') + writeb('\r', uart + UART_TX); + } +} + +# endif /* CONFIG_IA64_EARLY_PRINTK_UART */ + +#ifdef CONFIG_IA64_EARLY_PRINTK_SGI_SN +extern int sn_sal_console_out(const char *str, int len); +#endif + +void early_printk(const char *str, size_t len) +{ +#ifdef CONFIG_IA64_EARLY_PRINTK_UART + early_printk_uart(str, len); +#endif +#ifdef CONFIG_IA64_EARLY_PRINTK_VGA + early_printk_vga(str, len); +#endif +#ifdef CONFIG_IA64_EARLY_PRINTK_SGI_SN + sn_sal_console_out(str, len); +#endif +} + +#endif /* CONFIG_IA64_EARLY_PRINTK */ diff -Nru a/kernel/sysctl.c b/kernel/sysctl.c --- a/kernel/sysctl.c Tue Jul 29 00:57:41 2003 +++ b/kernel/sysctl.c Tue Jul 29 00:57:41 2003 @@ -580,6 +580,16 @@ .mode = 0644, .proc_handler = &proc_dointvec, }, +#ifdef CONFIG_SMP + { + .ctl_name = KERN_CACHEDECAYTICKS, + .procname = "cache_decay_ticks", + .data = &cache_decay_ticks, + .maxlen = sizeof(cache_decay_ticks), + .mode = 0644, + .proc_handler = &proc_doulongvec_minmax, + }, +#endif { .ctl_name = 0 } }; diff -Nru a/mm/memory.c b/mm/memory.c --- a/mm/memory.c Tue Jul 29 00:57:42 2003 +++ b/mm/memory.c Tue Jul 29 00:57:42 2003 @@ -114,8 +114,10 @@ } pmd = pmd_offset(dir, 0); pgd_clear(dir); - for (j = 0; j < PTRS_PER_PMD ; j++) + for (j = 0; j < PTRS_PER_PMD ; j++) { + prefetchw(pmd + j + PREFETCH_STRIDE/sizeof(*pmd)); free_one_pmd(tlb, pmd+j); + } pmd_free_tlb(tlb, pmd); }