Commit d2c46c6c authored by Linus Torvalds's avatar Linus Torvalds

Merge http://lia64.bkbits.net/to-linus-2.5

into home.osdl.org:/home/torvalds/v2.5/linux
parents edbb65db b8e3ead1
......@@ -142,6 +142,19 @@ GLOBAL_ENTRY(ia32_trace_syscall)
;;
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?
......
......@@ -297,9 +297,9 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
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,41 +312,34 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
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;
/*
* 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 (!(check_md->attribute & EFI_MEMORY_WB))
break; /* hit a non-WB region; stop search */
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) {
if (md->phys_addr > mem_limit)
......
......@@ -34,13 +34,8 @@ EXPORT_SYMBOL(disable_irq_nosync);
#include <linux/interrupt.h>
EXPORT_SYMBOL(probe_irq_mask);
#include <linux/in6.h>
#include <asm/checksum.h>
/* 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 <asm/io.h>
EXPORT_SYMBOL(__ia64_memcpy_fromio);
......@@ -58,9 +53,11 @@ EXPORT_SYMBOL_NOVERS(__up);
EXPORT_SYMBOL(clear_page);
#ifdef CONFIG_VIRTUAL_MEM_MAP
#include <linux/bootmem.h>
#include <asm/pgtable.h>
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 <asm/processor.h>
......
......@@ -379,8 +379,11 @@ inline void disable_irq_nosync(unsigned int irq)
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 @@ void enable_irq(unsigned int irq)
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;
......
......@@ -4225,7 +4225,7 @@ pfm_context_load(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs)
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;
}
}
......
......@@ -93,17 +93,17 @@ default_init(struct task_struct *task, void *buf, unsigned int flags, int cpu, v
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 @@ default_handler(struct task_struct *task, void *buf, pfm_ovfl_arg_t *arg, struct
}
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 @@ default_handler(struct task_struct *task, void *buf, pfm_ovfl_arg_t *arg, struct
/*
* 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 @@ default_handler(struct task_struct *task, void *buf, pfm_ovfl_arg_t *arg, struct
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 @@ default_restart(struct task_struct *task, pfm_ovfl_ctrl_t *ctrl, void *buf, stru
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 */
......
......@@ -685,12 +685,16 @@ machine_restart (char *restart_cmd)
(*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 @@ machine_power_off (void)
pm_power_off();
machine_halt();
}
EXPORT_SYMBOL(machine_power_off);
......@@ -327,9 +327,11 @@ setup_arch (char **cmdline_p)
* 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
......
/*
* Network checksum routines
*
* Copyright (C) 1999 Hewlett-Packard Co
* Copyright (C) 1999 Stephane Eranian <eranian@hpl.hp.com>
* Copyright (C) 1999, 2003 Hewlett-Packard Co
* Stephane Eranian <eranian@hpl.hp.com>
*
* Most of the code coming from arch/alpha/lib/checksum.c
*
......@@ -10,6 +10,7 @@
* in an architecture-specific manner due to speed..
*/
#include <linux/module.h>
#include <linux/string.h>
#include <asm/byteorder.h>
......@@ -40,6 +41,8 @@ csum_tcpudp_magic (unsigned long saddr, unsigned long daddr, unsigned short len,
((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 @@ csum_partial (const unsigned char * buff, int len, unsigned int sum)
return result;
}
EXPORT_SYMBOL(csum_partial);
/*
* this routine is used for miscellaneous IP-like checksums, mainly
......@@ -94,3 +98,5 @@ ip_compute_csum (unsigned char * buff, int len)
{
return ~do_csum(buff,len);
}
EXPORT_SYMBOL(ip_compute_csum);
/*
* Network Checksum & Copy routine
*
* Copyright (C) 1999 Hewlett-Packard Co
* Copyright (C) 1999 Stephane Eranian <eranian@hpl.hp.com>
* Copyright (C) 1999, 2003 Hewlett-Packard Co
* Stephane Eranian <eranian@hpl.hp.com>
*
* Most of the code has been imported from Linux/Alpha
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/string.h>
......@@ -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);
}
EXPORT_SYMBOL(csum_partial_copy_nocheck);
......@@ -13,6 +13,7 @@
#include <linux/elf.h>
#include <linux/mm.h>
#include <linux/mmzone.h>
#include <linux/module.h>
#include <linux/personality.h>
#include <linux/reboot.h>
#include <linux/slab.h>
......@@ -43,6 +44,8 @@ unsigned long MAX_DMA_ADDRESS = PAGE_OFFSET + 0x100000000UL;
#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 };
......
......@@ -11,12 +11,19 @@
*/
#include <linux/config.h>
#include <linux/cpu.h>
#include <linux/kernel.h>
#include <linux/memblk.h>
#include <linux/mm.h>
#include <linux/node.h>
#include <linux/init.h>
#include <linux/bootmem.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
* similar mechanisms and describe the NUMA characteristics of the machine.
......@@ -43,3 +50,52 @@ paddr_to_nid(unsigned long paddr)
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);
......@@ -36,11 +36,12 @@ typedef struct {
*/
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 */
......
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