diff -Nru a/arch/ia64/Kconfig b/arch/ia64/Kconfig --- a/arch/ia64/Kconfig Mon Oct 20 23:07:25 2003 +++ b/arch/ia64/Kconfig Mon Oct 20 23:07:25 2003 @@ -621,6 +621,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/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S --- a/arch/ia64/ia32/ia32_entry.S Mon Oct 20 23:07:24 2003 +++ b/arch/ia64/ia32/ia32_entry.S Mon Oct 20 23:07:24 2003 @@ -142,6 +142,19 @@ ;; st8 [r2]=r3 // initialize return code to -ENOSYS br.call.sptk.few rp=invoke_syscall_trace // give parent a chance to catch syscall args + // Need to reload arguments (they may be changed by the tracing process) + adds r2=IA64_PT_REGS_R9_OFFSET+16,sp // r2 = &pt_regs.r9 + adds r3=IA64_PT_REGS_R13_OFFSET+16,sp // r3 = &pt_regs.r13 + ;; + ld4 r33=[r2],8 // r9 == ecx + ld4 r37=[r3],16 // r13 == ebp + ;; + ld4 r34=[r2],8 // r10 == edx + ld4 r36=[r3],8 // r15 == edi + ;; + ld4 r32=[r2],8 // r11 == ebx + ld4 r35=[r3],8 // r14 == esi + ;; .ret2: br.call.sptk.few rp=b6 // do the syscall .ia32_strace_check_retval: cmp.lt p6,p0=r8,r0 // syscall failed? diff -Nru a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c --- a/arch/ia64/kernel/efi.c Mon Oct 20 23:07:24 2003 +++ b/arch/ia64/kernel/efi.c Mon Oct 20 23:07:24 2003 @@ -297,9 +297,9 @@ u64 start; u64 end; } prev, curr; - void *efi_map_start, *efi_map_end, *p, *q, *r; + void *efi_map_start, *efi_map_end, *p, *q; efi_memory_desc_t *md, *check_md; - u64 efi_desc_size, start, end, granule_addr, first_non_wb_addr = 0; + u64 efi_desc_size, start, end, granule_addr, last_granule_addr, first_non_wb_addr = 0; efi_map_start = __va(ia64_boot_param->efi_memmap); efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size; @@ -312,40 +312,33 @@ if (!(md->attribute & EFI_MEMORY_WB)) continue; - if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > first_non_wb_addr) { - /* - * Search for the next run of contiguous WB memory. Start search - * at first granule boundary covered by md. - */ - granule_addr = ((md->phys_addr + IA64_GRANULE_SIZE - 1) - & -IA64_GRANULE_SIZE); - first_non_wb_addr = granule_addr; - for (q = p; q < efi_map_end; q += efi_desc_size) { - check_md = q; - - if (check_md->attribute & EFI_MEMORY_WB) - trim_bottom(check_md, granule_addr); - - if (check_md->phys_addr < granule_addr) - continue; - - if (!(check_md->attribute & EFI_MEMORY_WB)) - break; /* hit a non-WB region; stop search */ + /* + * granule_addr is the base of md's first granule. + * [granule_addr - first_non_wb_addr) is guaranteed to + * be contiguous WB memory. + */ + granule_addr = md->phys_addr & ~(IA64_GRANULE_SIZE - 1); + first_non_wb_addr = max(first_non_wb_addr, granule_addr); + + if (first_non_wb_addr < md->phys_addr) { + trim_bottom(md, granule_addr + IA64_GRANULE_SIZE); + granule_addr = md->phys_addr & ~(IA64_GRANULE_SIZE - 1); + first_non_wb_addr = max(first_non_wb_addr, granule_addr); + } - if (check_md->phys_addr != first_non_wb_addr) - break; /* hit a memory hole; stop search */ + for (q = p; q < efi_map_end; q += efi_desc_size) { + check_md = q; + if ((check_md->attribute & EFI_MEMORY_WB) && + (check_md->phys_addr == first_non_wb_addr)) first_non_wb_addr += check_md->num_pages << EFI_PAGE_SHIFT; - } - /* round it down to the previous granule-boundary: */ - first_non_wb_addr &= -IA64_GRANULE_SIZE; - - if (!(first_non_wb_addr > granule_addr)) - continue; /* couldn't find enough contiguous memory */ - - for (r = p; r < q; r += efi_desc_size) - trim_top(r, first_non_wb_addr); + else + break; /* non-WB or hole */ } + + last_granule_addr = first_non_wb_addr & ~(IA64_GRANULE_SIZE - 1); + if (last_granule_addr < md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT)) + trim_top(md, last_granule_addr); if (is_available_memory(md)) { if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > mem_limit) { diff -Nru a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c --- a/arch/ia64/kernel/ia64_ksyms.c Mon Oct 20 23:07:24 2003 +++ b/arch/ia64/kernel/ia64_ksyms.c Mon Oct 20 23:07:24 2003 @@ -34,13 +34,8 @@ #include EXPORT_SYMBOL(probe_irq_mask); -#include #include -/* not coded yet?? EXPORT_SYMBOL(csum_ipv6_magic); */ -EXPORT_SYMBOL(csum_partial_copy_nocheck); -EXPORT_SYMBOL(csum_tcpudp_magic); -EXPORT_SYMBOL(ip_compute_csum); -EXPORT_SYMBOL(ip_fast_csum); +EXPORT_SYMBOL(ip_fast_csum); /* hand-coded assembly */ #include EXPORT_SYMBOL(__ia64_memcpy_fromio); @@ -58,9 +53,11 @@ EXPORT_SYMBOL(clear_page); #ifdef CONFIG_VIRTUAL_MEM_MAP +#include #include EXPORT_SYMBOL(vmalloc_end); EXPORT_SYMBOL(ia64_pfn_valid); +EXPORT_SYMBOL(max_low_pfn); /* defined by bootmem.c, but not exported by generic code */ #endif #include diff -Nru a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c --- a/arch/ia64/kernel/irq.c Mon Oct 20 23:07:25 2003 +++ b/arch/ia64/kernel/irq.c Mon Oct 20 23:07:25 2003 @@ -379,8 +379,11 @@ void disable_irq(unsigned int irq) { + irq_desc_t *desc = irq_descp(irq); + disable_irq_nosync(irq); - synchronize_irq(irq); + if (desc->action) + synchronize_irq(irq); } /** @@ -402,7 +405,7 @@ spin_lock_irqsave(&desc->lock, flags); switch (desc->depth) { case 1: { - unsigned int status = desc->status & ~IRQ_DISABLED; + unsigned int status = desc->status & ~(IRQ_DISABLED | IRQ_INPROGRESS); desc->status = status; if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { desc->status = status | IRQ_REPLAY; diff -Nru a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c --- a/arch/ia64/kernel/perfmon.c Mon Oct 20 23:07:25 2003 +++ b/arch/ia64/kernel/perfmon.c Mon Oct 20 23:07:25 2003 @@ -4225,7 +4225,7 @@ ret = -EBUSY; } else { pfm_sessions.pfs_sys_use_dbregs++; - DPRINT(("load [%d] increased sys_use_dbreg=%lu\n", task->pid, pfm_sessions.pfs_sys_use_dbregs)); + DPRINT(("load [%d] increased sys_use_dbreg=%u\n", task->pid, pfm_sessions.pfs_sys_use_dbregs)); set_dbregs = 1; } } diff -Nru a/arch/ia64/kernel/perfmon_default_smpl.c b/arch/ia64/kernel/perfmon_default_smpl.c --- a/arch/ia64/kernel/perfmon_default_smpl.c Mon Oct 20 23:07:25 2003 +++ b/arch/ia64/kernel/perfmon_default_smpl.c Mon Oct 20 23:07:25 2003 @@ -93,17 +93,17 @@ hdr->hdr_version = PFM_DEFAULT_SMPL_VERSION; hdr->hdr_buf_size = arg->buf_size; - hdr->hdr_cur_pos = (void *)((unsigned long)buf)+sizeof(*hdr); - hdr->hdr_last_pos = (void *)((unsigned long)buf)+arg->buf_size; + hdr->hdr_cur_offs = sizeof(*hdr); hdr->hdr_overflows = 0UL; hdr->hdr_count = 0UL; - DPRINT(("[%d] buffer=%p buf_size=%lu hdr_size=%lu hdr_version=%u\n", + DPRINT(("[%d] buffer=%p buf_size=%lu hdr_size=%lu hdr_version=%u cur_offs=%lu\n", task->pid, buf, hdr->hdr_buf_size, sizeof(*hdr), - hdr->hdr_version)); + hdr->hdr_version, + hdr->hdr_cur_offs)); return 0; } @@ -125,8 +125,8 @@ } hdr = (pfm_default_smpl_hdr_t *)buf; - cur = hdr->hdr_cur_pos; - last = hdr->hdr_last_pos; + cur = buf+hdr->hdr_cur_offs; + last = buf+hdr->hdr_buf_size; ovfl_pmd = arg->ovfl_pmd; ovfl_notify = arg->ovfl_notify; @@ -191,7 +191,7 @@ /* * update position for next entry */ - hdr->hdr_cur_pos = cur + sizeof(*ent) + (npmds << 3); + hdr->hdr_cur_offs += sizeof(*ent) + (npmds << 3); /* * keep same ovfl_pmds, ovfl_notify @@ -212,10 +212,9 @@ hdr->hdr_overflows++; /* - * if no notification is needed, then we saturate the buffer + * if no notification requested, then we saturate the buffer */ if (ovfl_notify == 0) { - hdr->hdr_count = 0UL; arg->ovfl_ctrl.bits.notify_user = 0; arg->ovfl_ctrl.bits.block_task = 0; arg->ovfl_ctrl.bits.mask_monitoring = 1; @@ -236,8 +235,8 @@ hdr = (pfm_default_smpl_hdr_t *)buf; - hdr->hdr_count = 0UL; - hdr->hdr_cur_pos = (void *)((unsigned long)buf)+sizeof(*hdr); + hdr->hdr_count = 0UL; + hdr->hdr_cur_offs = sizeof(*hdr); ctrl->bits.mask_monitoring = 0; ctrl->bits.reset_ovfl_pmds = 1; /* uses long-reset values */ diff -Nru a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c --- a/arch/ia64/kernel/process.c Mon Oct 20 23:07:24 2003 +++ b/arch/ia64/kernel/process.c Mon Oct 20 23:07:24 2003 @@ -685,12 +685,16 @@ (*efi.reset_system)(EFI_RESET_WARM, 0, 0, 0); } +EXPORT_SYMBOL(machine_restart); + void machine_halt (void) { cpu_halt(); } +EXPORT_SYMBOL(machine_halt); + void machine_power_off (void) { @@ -698,3 +702,5 @@ pm_power_off(); machine_halt(); } + +EXPORT_SYMBOL(machine_power_off); diff -Nru a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c --- a/arch/ia64/kernel/setup.c Mon Oct 20 23:07:24 2003 +++ b/arch/ia64/kernel/setup.c Mon Oct 20 23:07:24 2003 @@ -327,9 +327,11 @@ * because we don't *really* know whether there's anything there, but we hope that * all new boxes will implement HCDP. */ - extern unsigned char acpi_legacy_devices; - if (!efi.hcdp && acpi_legacy_devices) - setup_serial_legacy(); + { + extern unsigned char acpi_legacy_devices; + if (!efi.hcdp && acpi_legacy_devices) + setup_serial_legacy(); + } #endif #ifdef CONFIG_VT diff -Nru a/arch/ia64/lib/checksum.c b/arch/ia64/lib/checksum.c --- a/arch/ia64/lib/checksum.c Mon Oct 20 23:07:25 2003 +++ b/arch/ia64/lib/checksum.c Mon Oct 20 23:07:25 2003 @@ -1,8 +1,8 @@ /* * Network checksum routines * - * Copyright (C) 1999 Hewlett-Packard Co - * Copyright (C) 1999 Stephane Eranian + * Copyright (C) 1999, 2003 Hewlett-Packard Co + * Stephane Eranian * * Most of the code coming from arch/alpha/lib/checksum.c * @@ -10,6 +10,7 @@ * in an architecture-specific manner due to speed.. */ +#include #include #include @@ -40,6 +41,8 @@ ((unsigned long) proto << 8)); } +EXPORT_SYMBOL(csum_tcpudp_magic); + unsigned int csum_tcpudp_nofold (unsigned long saddr, unsigned long daddr, unsigned short len, unsigned short proto, unsigned int sum) @@ -84,6 +87,7 @@ return result; } +EXPORT_SYMBOL(csum_partial); /* * this routine is used for miscellaneous IP-like checksums, mainly @@ -94,3 +98,5 @@ { return ~do_csum(buff,len); } + +EXPORT_SYMBOL(ip_compute_csum); diff -Nru a/arch/ia64/lib/csum_partial_copy.c b/arch/ia64/lib/csum_partial_copy.c --- a/arch/ia64/lib/csum_partial_copy.c Mon Oct 20 23:07:24 2003 +++ b/arch/ia64/lib/csum_partial_copy.c Mon Oct 20 23:07:24 2003 @@ -1,12 +1,13 @@ /* * Network Checksum & Copy routine * - * Copyright (C) 1999 Hewlett-Packard Co - * Copyright (C) 1999 Stephane Eranian + * Copyright (C) 1999, 2003 Hewlett-Packard Co + * Stephane Eranian * * Most of the code has been imported from Linux/Alpha */ +#include #include #include @@ -146,3 +147,4 @@ return do_csum_partial_copy_from_user(src, dst, len, sum, NULL); } +EXPORT_SYMBOL(csum_partial_copy_nocheck); diff -Nru a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c --- a/arch/ia64/mm/init.c Mon Oct 20 23:07:24 2003 +++ b/arch/ia64/mm/init.c Mon Oct 20 23:07:24 2003 @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -43,6 +44,8 @@ #ifdef CONFIG_VIRTUAL_MEM_MAP unsigned long vmalloc_end = VMALLOC_END_INIT; struct page *vmem_map; + + EXPORT_SYMBOL(vmem_map); #endif static int pgt_cache_water[2] = { 25, 50 }; diff -Nru a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c --- a/arch/ia64/mm/numa.c Mon Oct 20 23:07:24 2003 +++ b/arch/ia64/mm/numa.c Mon Oct 20 23:07:24 2003 @@ -11,12 +11,19 @@ */ #include +#include #include +#include #include +#include #include #include #include +static struct memblk *sysfs_memblks; +static struct node *sysfs_nodes; +static struct cpu *sysfs_cpus; + /* * The following structures are usually initialized by ACPI or * similar mechanisms and describe the NUMA characteristics of the machine. @@ -43,3 +50,52 @@ return (i < num_memblks) ? node_memblk[i].nid : (num_memblks ? -1 : 0); } + +static int __init topology_init(void) +{ + int i, err = 0; + + sysfs_nodes = kmalloc(sizeof(struct node) * numnodes, GFP_KERNEL); + if (!sysfs_nodes) { + err = -ENOMEM; + goto out; + } + memset(sysfs_nodes, 0, sizeof(struct node) * numnodes); + + sysfs_memblks = kmalloc(sizeof(struct memblk) * num_memblks, + GFP_KERNEL); + if (!sysfs_memblks) { + kfree(sysfs_nodes); + err = -ENOMEM; + goto out; + } + memset(sysfs_memblks, 0, sizeof(struct memblk) * num_memblks); + + sysfs_cpus = kmalloc(sizeof(struct cpu) * NR_CPUS, GFP_KERNEL); + if (!sysfs_cpus) { + kfree(sysfs_memblks); + kfree(sysfs_nodes); + err = -ENOMEM; + goto out; + } + memset(sysfs_cpus, 0, sizeof(struct cpu) * NR_CPUS); + + for (i = 0; i < numnodes; i++) + if ((err = register_node(&sysfs_nodes[i], i, 0))) + goto out; + + for (i = 0; i < num_memblks; i++) + if ((err = register_memblk(&sysfs_memblks[i], i, + &sysfs_nodes[memblk_to_node(i)]))) + goto out; + + for (i = 0; i < NR_CPUS; i++) + if (cpu_online(i)) + if((err = register_cpu(&sysfs_cpus[i], i, + &sysfs_nodes[cpu_to_node(i)]))) + goto out; + out: + return err; +} + +__initcall(topology_init); diff -Nru a/drivers/acpi/tables.c b/drivers/acpi/tables.c --- a/drivers/acpi/tables.c Mon Oct 20 23:07:24 2003 +++ b/drivers/acpi/tables.c Mon Oct 20 23:07:24 2003 @@ -262,10 +262,17 @@ /* Map the DSDT header via the pointer in the FADT */ if (id == ACPI_DSDT) { - struct acpi_table_fadt *fadt = (struct acpi_table_fadt *) *header; + struct fadt_descriptor_rev2 *fadt = (struct fadt_descriptor_rev2 *) *header; + + if (fadt->revision == 3 && fadt->Xdsdt) { + *header = (void *) __acpi_map_table(fadt->Xdsdt, + sizeof(struct acpi_table_header)); + } else if (fadt->V1_dsdt) { + *header = (void *) __acpi_map_table(fadt->V1_dsdt, + sizeof(struct acpi_table_header)); + } else + *header = 0; - *header = (void *) __acpi_map_table(fadt->dsdt_addr, - sizeof(struct acpi_table_header)); if (!*header) { printk(KERN_WARNING PREFIX "Unable to map DSDT\n"); return -ENODEV; diff -Nru a/drivers/media/radio/Makefile b/drivers/media/radio/Makefile --- a/drivers/media/radio/Makefile Mon Oct 20 23:07:24 2003 +++ b/drivers/media/radio/Makefile Mon Oct 20 23:07:24 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 Mon Oct 20 23:07:25 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 Mon Oct 20 23:07:24 2003 +++ b/drivers/media/video/Makefile Mon Oct 20 23:07:24 2003 @@ -7,6 +7,7 @@ zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o zr36067-objs := zoran_procfs.o zoran_device.o \ zoran_driver.o zoran_card.o +obj-y := dummy.o obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o v4l1-compat.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 Mon Oct 20 23:07:25 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 Mon Oct 20 23:07:24 2003 +++ b/drivers/net/tulip/media.c Mon Oct 20 23:07:24 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/serial/8250.c b/drivers/serial/8250.c --- a/drivers/serial/8250.c Mon Oct 20 23:07:24 2003 +++ b/drivers/serial/8250.c Mon Oct 20 23:07:24 2003 @@ -2086,6 +2086,9 @@ int __init early_serial_setup(struct uart_port *port) { + if (port->line >= ARRAY_SIZE(serial8250_ports)) + return -ENODEV; + serial8250_isa_init_ports(); serial8250_ports[port->line].port = *port; serial8250_ports[port->line].port.ops = &serial8250_pops; diff -Nru a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c --- a/drivers/serial/serial_core.c Mon Oct 20 23:07:24 2003 +++ b/drivers/serial/serial_core.c Mon Oct 20 23:07:24 2003 @@ -1859,6 +1859,9 @@ if (flow == 'r') termios.c_cflag |= CRTSCTS; + if (!port->ops) + return 0; + port->ops->set_termios(port, &termios, NULL); co->cflag = termios.c_cflag; diff -Nru a/include/asm-ia64/perfmon_default_smpl.h b/include/asm-ia64/perfmon_default_smpl.h --- a/include/asm-ia64/perfmon_default_smpl.h Mon Oct 20 23:07:24 2003 +++ b/include/asm-ia64/perfmon_default_smpl.h Mon Oct 20 23:07:24 2003 @@ -36,11 +36,12 @@ */ typedef struct { unsigned long hdr_count; /* how many valid entries */ - void *hdr_cur_pos; /* current position in the buffer */ - void *hdr_last_pos; /* first byte beyond buffer */ + unsigned long hdr_cur_offs; /* current offset from top of buffer */ + unsigned long hdr_reserved2; /* reserved for future use */ unsigned long hdr_overflows; /* how many times the buffer overflowed */ unsigned long hdr_buf_size; /* how many bytes in the buffer */ + unsigned int hdr_version; /* contains perfmon version (smpl format diffs) */ unsigned int hdr_reserved1; /* for future use */ unsigned long hdr_reserved[10]; /* for future use */ diff -Nru a/include/linux/module.h b/include/linux/module.h --- a/include/linux/module.h Mon Oct 20 23:07:25 2003 +++ b/include/linux/module.h Mon Oct 20 23:07:25 2003 @@ -60,10 +60,11 @@ #define __module_cat(a,b) ___module_cat(a,b) #define __MODULE_INFO(tag, name, info) \ static const char __module_cat(name,__LINE__)[] \ + __attribute_used__ \ __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info -#define MODULE_GENERIC_TABLE(gtype,name) \ -extern const struct gtype##_id __mod_##gtype##_table \ +#define MODULE_GENERIC_TABLE(gtype,name) \ +extern const struct gtype##_id __mod_##gtype##_table \ __attribute__ ((unused, alias(__stringify(name)))) #define THIS_MODULE (&__this_module) @@ -142,6 +143,7 @@ #define __CRC_SYMBOL(sym, sec) \ extern void *__crc_##sym __attribute__((weak)); \ static const unsigned long __kcrctab_##sym \ + __attribute_used__ \ __attribute__((section("__kcrctab" sec), unused)) \ = (unsigned long) &__crc_##sym; #else @@ -155,6 +157,7 @@ __attribute__((section("__ksymtab_strings"))) \ = MODULE_SYMBOL_PREFIX #sym; \ static const struct kernel_symbol __ksymtab_##sym \ + __attribute_used__ \ __attribute__((section("__ksymtab" sec), unused)) \ = { (unsigned long)&sym, __kstrtab_##sym } diff -Nru a/include/linux/moduleparam.h b/include/linux/moduleparam.h --- a/include/linux/moduleparam.h Mon Oct 20 23:07:24 2003 +++ b/include/linux/moduleparam.h Mon Oct 20 23:07:24 2003 @@ -52,6 +52,7 @@ #define __module_param_call(prefix, name, set, get, arg, perm) \ static char __param_str_##name[] __initdata = prefix #name; \ static struct kernel_param const __param_##name \ + __attribute_used__ \ __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ = { __param_str_##name, perm, set, get, arg } diff -Nru a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h --- a/include/linux/nfs_fs.h Mon Oct 20 23:07:24 2003 +++ b/include/linux/nfs_fs.h Mon Oct 20 23:07:24 2003 @@ -403,7 +403,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 Mon Oct 20 23:07:24 2003 +++ b/include/linux/sysctl.h Mon Oct 20 23:07:24 2003 @@ -127,6 +127,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 Mon Oct 20 23:07:25 2003 +++ b/kernel/printk.c Mon Oct 20 23:07:25 2003 @@ -361,6 +361,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 } /* @@ -678,7 +684,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(); @@ -731,3 +741,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 early_printk_sn_sal(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 + early_printk_sn_sal(str, len); +#endif +} + +#endif /* CONFIG_IA64_EARLY_PRINTK */ diff -Nru a/kernel/sysctl.c b/kernel/sysctl.c --- a/kernel/sysctl.c Mon Oct 20 23:07:24 2003 +++ b/kernel/sysctl.c Mon Oct 20 23:07:24 2003 @@ -579,6 +579,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 Mon Oct 20 23:07:24 2003 +++ b/mm/memory.c Mon Oct 20 23:07:24 2003 @@ -121,8 +121,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); }