Commit e360aa91 authored by David Mosberger's avatar David Mosberger

Merge tiger.hpl.hp.com:/data1/bk/vanilla/linux-2.5

into tiger.hpl.hp.com:/data1/bk/lia64/to-linus-2.5
parents 740ba8b9 d86d6278
...@@ -297,9 +297,9 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg) ...@@ -297,9 +297,9 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
u64 start; u64 start;
u64 end; u64 end;
} prev, curr; } 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; 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_start = __va(ia64_boot_param->efi_memmap);
efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size; efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size;
...@@ -312,41 +312,34 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg) ...@@ -312,41 +312,34 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
if (!(md->attribute & EFI_MEMORY_WB)) if (!(md->attribute & EFI_MEMORY_WB))
continue; continue;
if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > first_non_wb_addr) { /*
/* * granule_addr is the base of md's first granule.
* Search for the next run of contiguous WB memory. Start search * [granule_addr - first_non_wb_addr) is guaranteed to
* at first granule boundary covered by md. * be contiguous WB memory.
*/ */
granule_addr = ((md->phys_addr + IA64_GRANULE_SIZE - 1) granule_addr = md->phys_addr & ~(IA64_GRANULE_SIZE - 1);
& -IA64_GRANULE_SIZE); first_non_wb_addr = max(first_non_wb_addr, granule_addr);
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)) if (first_non_wb_addr < md->phys_addr) {
break; /* hit a non-WB region; stop search */ 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) for (q = p; q < efi_map_end; q += efi_desc_size) {
break; /* hit a memory hole; stop search */ 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; first_non_wb_addr += check_md->num_pages << EFI_PAGE_SHIFT;
} else
/* round it down to the previous granule-boundary: */ break; /* non-WB or hole */
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);
} }
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 (is_available_memory(md)) {
if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > mem_limit) { if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > mem_limit) {
if (md->phys_addr > mem_limit) if (md->phys_addr > mem_limit)
......
...@@ -34,13 +34,8 @@ EXPORT_SYMBOL(disable_irq_nosync); ...@@ -34,13 +34,8 @@ EXPORT_SYMBOL(disable_irq_nosync);
#include <linux/interrupt.h> #include <linux/interrupt.h>
EXPORT_SYMBOL(probe_irq_mask); EXPORT_SYMBOL(probe_irq_mask);
#include <linux/in6.h>
#include <asm/checksum.h> #include <asm/checksum.h>
/* not coded yet?? EXPORT_SYMBOL(csum_ipv6_magic); */ EXPORT_SYMBOL(ip_fast_csum); /* hand-coded assembly */
EXPORT_SYMBOL(csum_partial_copy_nocheck);
EXPORT_SYMBOL(csum_tcpudp_magic);
EXPORT_SYMBOL(ip_compute_csum);
EXPORT_SYMBOL(ip_fast_csum);
#include <asm/io.h> #include <asm/io.h>
EXPORT_SYMBOL(__ia64_memcpy_fromio); EXPORT_SYMBOL(__ia64_memcpy_fromio);
...@@ -58,9 +53,11 @@ EXPORT_SYMBOL_NOVERS(__up); ...@@ -58,9 +53,11 @@ EXPORT_SYMBOL_NOVERS(__up);
EXPORT_SYMBOL(clear_page); EXPORT_SYMBOL(clear_page);
#ifdef CONFIG_VIRTUAL_MEM_MAP #ifdef CONFIG_VIRTUAL_MEM_MAP
#include <linux/bootmem.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
EXPORT_SYMBOL(vmalloc_end); EXPORT_SYMBOL(vmalloc_end);
EXPORT_SYMBOL(ia64_pfn_valid); EXPORT_SYMBOL(ia64_pfn_valid);
EXPORT_SYMBOL(max_low_pfn); /* defined by bootmem.c, but not exported by generic code */
#endif #endif
#include <asm/processor.h> #include <asm/processor.h>
......
...@@ -4225,7 +4225,7 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) ...@@ -4225,7 +4225,7 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
ret = -EBUSY; ret = -EBUSY;
} else { } else {
pfm_sessions.pfs_sys_use_dbregs++; 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; set_dbregs = 1;
} }
} }
......
...@@ -685,12 +685,16 @@ machine_restart (char *restart_cmd) ...@@ -685,12 +685,16 @@ machine_restart (char *restart_cmd)
(*efi.reset_system)(EFI_RESET_WARM, 0, 0, 0); (*efi.reset_system)(EFI_RESET_WARM, 0, 0, 0);
} }
EXPORT_SYMBOL(machine_restart);
void void
machine_halt (void) machine_halt (void)
{ {
cpu_halt(); cpu_halt();
} }
EXPORT_SYMBOL(machine_halt);
void void
machine_power_off (void) machine_power_off (void)
{ {
...@@ -698,3 +702,5 @@ machine_power_off (void) ...@@ -698,3 +702,5 @@ machine_power_off (void)
pm_power_off(); pm_power_off();
machine_halt(); machine_halt();
} }
EXPORT_SYMBOL(machine_power_off);
...@@ -327,9 +327,11 @@ setup_arch (char **cmdline_p) ...@@ -327,9 +327,11 @@ setup_arch (char **cmdline_p)
* because we don't *really* know whether there's anything there, but we hope that * because we don't *really* know whether there's anything there, but we hope that
* all new boxes will implement HCDP. * all new boxes will implement HCDP.
*/ */
extern unsigned char acpi_legacy_devices; {
if (!efi.hcdp && acpi_legacy_devices) extern unsigned char acpi_legacy_devices;
setup_serial_legacy(); if (!efi.hcdp && acpi_legacy_devices)
setup_serial_legacy();
}
#endif #endif
#ifdef CONFIG_VT #ifdef CONFIG_VT
......
/* /*
* Network checksum routines * Network checksum routines
* *
* Copyright (C) 1999 Hewlett-Packard Co * Copyright (C) 1999, 2003 Hewlett-Packard Co
* Copyright (C) 1999 Stephane Eranian <eranian@hpl.hp.com> * Stephane Eranian <eranian@hpl.hp.com>
* *
* Most of the code coming from arch/alpha/lib/checksum.c * Most of the code coming from arch/alpha/lib/checksum.c
* *
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
* in an architecture-specific manner due to speed.. * in an architecture-specific manner due to speed..
*/ */
#include <linux/module.h>
#include <linux/string.h> #include <linux/string.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
...@@ -40,6 +41,8 @@ csum_tcpudp_magic (unsigned long saddr, unsigned long daddr, unsigned short len, ...@@ -40,6 +41,8 @@ csum_tcpudp_magic (unsigned long saddr, unsigned long daddr, unsigned short len,
((unsigned long) proto << 8)); ((unsigned long) proto << 8));
} }
EXPORT_SYMBOL(csum_tcpudp_magic);
unsigned int unsigned int
csum_tcpudp_nofold (unsigned long saddr, unsigned long daddr, unsigned short len, csum_tcpudp_nofold (unsigned long saddr, unsigned long daddr, unsigned short len,
unsigned short proto, unsigned int sum) unsigned short proto, unsigned int sum)
...@@ -84,6 +87,7 @@ csum_partial (const unsigned char * buff, int len, unsigned int sum) ...@@ -84,6 +87,7 @@ csum_partial (const unsigned char * buff, int len, unsigned int sum)
return result; return result;
} }
EXPORT_SYMBOL(csum_partial);
/* /*
* this routine is used for miscellaneous IP-like checksums, mainly * this routine is used for miscellaneous IP-like checksums, mainly
...@@ -94,3 +98,5 @@ ip_compute_csum (unsigned char * buff, int len) ...@@ -94,3 +98,5 @@ ip_compute_csum (unsigned char * buff, int len)
{ {
return ~do_csum(buff,len); return ~do_csum(buff,len);
} }
EXPORT_SYMBOL(ip_compute_csum);
/* /*
* Network Checksum & Copy routine * Network Checksum & Copy routine
* *
* Copyright (C) 1999 Hewlett-Packard Co * Copyright (C) 1999, 2003 Hewlett-Packard Co
* Copyright (C) 1999 Stephane Eranian <eranian@hpl.hp.com> * Stephane Eranian <eranian@hpl.hp.com>
* *
* Most of the code has been imported from Linux/Alpha * Most of the code has been imported from Linux/Alpha
*/ */
#include <linux/module.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -146,3 +147,4 @@ csum_partial_copy_nocheck(const char *src, char *dst, int len, unsigned int sum) ...@@ -146,3 +147,4 @@ csum_partial_copy_nocheck(const char *src, char *dst, int len, unsigned int sum)
return do_csum_partial_copy_from_user(src, dst, len, sum, NULL); return do_csum_partial_copy_from_user(src, dst, len, sum, NULL);
} }
EXPORT_SYMBOL(csum_partial_copy_nocheck);
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/elf.h> #include <linux/elf.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/mmzone.h> #include <linux/mmzone.h>
#include <linux/module.h>
#include <linux/personality.h> #include <linux/personality.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -43,6 +44,8 @@ unsigned long MAX_DMA_ADDRESS = PAGE_OFFSET + 0x100000000UL; ...@@ -43,6 +44,8 @@ unsigned long MAX_DMA_ADDRESS = PAGE_OFFSET + 0x100000000UL;
#ifdef CONFIG_VIRTUAL_MEM_MAP #ifdef CONFIG_VIRTUAL_MEM_MAP
unsigned long vmalloc_end = VMALLOC_END_INIT; unsigned long vmalloc_end = VMALLOC_END_INIT;
struct page *vmem_map; struct page *vmem_map;
EXPORT_SYMBOL(vmem_map);
#endif #endif
static int pgt_cache_water[2] = { 25, 50 }; static int pgt_cache_water[2] = { 25, 50 };
......
...@@ -11,12 +11,19 @@ ...@@ -11,12 +11,19 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/cpu.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/memblk.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/node.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <asm/numa.h> #include <asm/numa.h>
static struct memblk *sysfs_memblks;
static struct node *sysfs_nodes;
static struct cpu *sysfs_cpus;
/* /*
* The following structures are usually initialized by ACPI or * The following structures are usually initialized by ACPI or
* similar mechanisms and describe the NUMA characteristics of the machine. * similar mechanisms and describe the NUMA characteristics of the machine.
...@@ -43,3 +50,49 @@ paddr_to_nid(unsigned long paddr) ...@@ -43,3 +50,49 @@ paddr_to_nid(unsigned long paddr)
return (i < num_memblks) ? node_memblk[i].nid : (num_memblks ? -1 : 0); 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;
}
sysfs_memblks = kmalloc(sizeof(struct memblk) * num_memblks,
GFP_KERNEL);
if (!sysfs_memblks) {
kfree(sysfs_nodes);
err = -ENOMEM;
goto out;
}
sysfs_cpus = kmalloc(sizeof(struct cpu) * NR_CPUS, GFP_KERNEL);
if (!sysfs_cpus) {
kfree(sysfs_memblks);
kfree(sysfs_nodes);
err = -ENOMEM;
goto out;
}
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);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment