Commit 19cb8137 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Altix update: small cleanups

From: Pat Gefre <pfg@sgi.com>

arch/ia64/sn/io/io.c@1.12
    misc code cleanup
    no parens on returns
    remove __psunsigned_t

arch/ia64/sn/io/sn2/ml_iograph.c@1.18
    no parens on returns

arch/ia64/sn/io/sn2/pcibr/pcibr_dvr.c@1.25
    no parens on returns
    use -errno

arch/ia64/sn/io/sn2/pcibr/pcibr_hints.c@1.8
    no parens on returns

arch/ia64/sn/io/sn2/pcibr/pcibr_intr.c@1.15
    no parens on returns
    unsigned to unsigned int

arch/ia64/sn/io/sn2/pcibr/pcibr_rrb.c@1.13
    no parens on returns
    use -errno

arch/ia64/sn/io/sn2/pcibr/pcibr_slot.c@1.18
    no parens on returns
    use -errno

arch/ia64/sn/io/sn2/pciio.c@1.14
    oom handling
    removed ASSERT and funcs not needed

arch/ia64/sn/io/sn2/pic.c@1.13
    use -errno

arch/ia64/sn/io/sn2/shuberror.c@1.12
    add delay.h

arch/ia64/sn/io/sn2/xbow.c@1.10
    include file clean up

arch/ia64/sn/io/sn2/xtalk.c@1.9
    misc code cleanup
    no parens on returns

arch/ia64/sn/io/xswitch.c@1.11
    misc code cleanup

arch/ia64/sn/kernel/bte.c@1.5
    include file clean up

arch/ia64/sn/kernel/mca.c@1.8
    include file clean up

arch/ia64/sn/kernel/probe.c@1.5
    include file clean up

arch/ia64/sn/kernel/sn2/prominfo_proc.c@1.3
    include file clean up

arch/ia64/sn/kernel/sn2/sn2_smp.c@1.9
    include file clean up

arch/ia64/sn/kernel/sn2/sn_proc_fs.c@1.4
    include file clean up

drivers/char/sn_serial.c@1.3
    include file clean up

include/asm-ia64/sn/addrs.h@1.8
    include file clean up
    remove __psunsigned_t

include/asm-ia64/sn/alenlist.h@1.8
    unsigned to unsigned int

include/asm-ia64/sn/arch.h@1.7
    include file clean up

include/asm-ia64/sn/bte.h@1.6
    include file clean up

include/asm-ia64/sn/clksupport.h@1.8
    include file clean up

include/asm-ia64/sn/driver.h@1.5
    remove __psunsigned_t

include/asm-ia64/sn/hcl.h@1.13
    include file clean up

include/asm-ia64/sn/hcl_util.h@1.7
    include file clean up

include/asm-ia64/sn/hwgfs.h@1.5
    include file clean up

include/asm-ia64/sn/iograph.h@1.9
    include file clean up

include/asm-ia64/sn/klconfig.h@1.14
    remove __psunsigned_t

include/asm-ia64/sn/kldir.h@1.5
    remove __psunsigned_t
    include file clean up

include/asm-ia64/sn/module.h@1.12
    include file clean up

include/asm-ia64/sn/nodepda.h@1.14
    include file clean up

include/asm-ia64/sn/pci/bridge.h@1.13
    uchar_t to unsigned char

include/asm-ia64/sn/pci/pcibr_private.h@1.20
    move PVnnnnnn's

include/asm-ia64/sn/pci/pciio.h@1.14
    unsigned to unsigned int

include/asm-ia64/sn/pci/pciio_private.h@1.10
    unsigned to unsigned int

include/asm-ia64/sn/pda.h@1.9
    include file clean up

include/asm-ia64/sn/pio.h@1.7
    include file clean up
    ulong to unsigned long

include/asm-ia64/sn/sgi.h@1.11
    include file clean up
    move PVnnnnnn's to here

include/asm-ia64/sn/sn2/arch.h@1.6
    include file clean up

include/asm-ia64/sn/sn2/sn_private.h@1.12
    include file clean up
    remove __psunsigned_t

include/asm-ia64/sn/sn_cpuid.h@1.8
    include file clean up

include/asm-ia64/sn/sn_private.h@1.6
    include file clean up

include/asm-ia64/sn/types.h@1.6
    include file clean up
    remove __psunsigned_t

include/asm-ia64/sn/vector.h@1.6
    include file clean up

include/asm-ia64/sn/xtalk/xbow.h@1.9
    include file clean up
    misc code cleanup

include/asm-ia64/sn/xtalk/xtalk.h@1.12
    unsigned to unsigned int

include/asm-ia64/sn/xtalk/xwidget.h@1.8
    unsigned to unsigned int
parent 4e15eda4
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
* Copyright (C) 1992-1997, 2000-2003 Silicon Graphics, Inc. All Rights Reserved. * Copyright (C) 1992-1997, 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
*/ */
#include <linux/config.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/sched.h>
#include <asm/sn/types.h> #include <asm/sn/types.h>
#include <asm/sn/sgi.h> #include <asm/sn/sgi.h>
#include <asm/sn/driver.h> #include <asm/sn/driver.h>
...@@ -123,7 +123,7 @@ hub_piomap_alloc(vertex_hdl_t dev, /* set up mapping for this device */ ...@@ -123,7 +123,7 @@ hub_piomap_alloc(vertex_hdl_t dev, /* set up mapping for this device */
/* sanity check */ /* sanity check */
if (byte_count_max > byte_count) if (byte_count_max > byte_count)
return(NULL); return NULL;
hubinfo_get(hubv, &hubinfo); hubinfo_get(hubv, &hubinfo);
...@@ -152,7 +152,7 @@ hub_piomap_alloc(vertex_hdl_t dev, /* set up mapping for this device */ ...@@ -152,7 +152,7 @@ hub_piomap_alloc(vertex_hdl_t dev, /* set up mapping for this device */
* For now, reject requests that span big windows. * For now, reject requests that span big windows.
*/ */
if ((xtalk_addr % BWIN_SIZE) + byte_count > BWIN_SIZE) if ((xtalk_addr % BWIN_SIZE) + byte_count > BWIN_SIZE)
return(NULL); return NULL;
/* Round xtalk address down for big window alignement */ /* Round xtalk address down for big window alignement */
...@@ -184,7 +184,7 @@ hub_piomap_alloc(vertex_hdl_t dev, /* set up mapping for this device */ ...@@ -184,7 +184,7 @@ hub_piomap_alloc(vertex_hdl_t dev, /* set up mapping for this device */
widget == bw_piomap->hpio_xtalk_info.xp_target) { widget == bw_piomap->hpio_xtalk_info.xp_target) {
bw_piomap->hpio_holdcnt++; bw_piomap->hpio_holdcnt++;
spin_unlock(&hubinfo->h_bwlock); spin_unlock(&hubinfo->h_bwlock);
return(bw_piomap); return bw_piomap;
} }
} }
...@@ -264,7 +264,7 @@ hub_piomap_alloc(vertex_hdl_t dev, /* set up mapping for this device */ ...@@ -264,7 +264,7 @@ hub_piomap_alloc(vertex_hdl_t dev, /* set up mapping for this device */
done: done:
spin_unlock(&hubinfo->h_bwlock); spin_unlock(&hubinfo->h_bwlock);
return(bw_piomap); return bw_piomap;
} }
/* /*
...@@ -330,18 +330,18 @@ hub_piomap_addr(hub_piomap_t hub_piomap, /* mapping resources */ ...@@ -330,18 +330,18 @@ hub_piomap_addr(hub_piomap_t hub_piomap, /* mapping resources */
{ {
/* Verify that range can be mapped using the specified piomap */ /* Verify that range can be mapped using the specified piomap */
if (xtalk_addr < hub_piomap->hpio_xtalk_info.xp_xtalk_addr) if (xtalk_addr < hub_piomap->hpio_xtalk_info.xp_xtalk_addr)
return(0); return 0;
if (xtalk_addr + byte_count > if (xtalk_addr + byte_count >
( hub_piomap->hpio_xtalk_info.xp_xtalk_addr + ( hub_piomap->hpio_xtalk_info.xp_xtalk_addr +
hub_piomap->hpio_xtalk_info.xp_mapsz)) hub_piomap->hpio_xtalk_info.xp_mapsz))
return(0); return 0;
if (hub_piomap->hpio_flags & HUB_PIOMAP_IS_VALID) if (hub_piomap->hpio_flags & HUB_PIOMAP_IS_VALID)
return(hub_piomap->hpio_xtalk_info.xp_kvaddr + return hub_piomap->hpio_xtalk_info.xp_kvaddr +
(xtalk_addr % hub_piomap->hpio_xtalk_info.xp_mapsz)); (xtalk_addr % hub_piomap->hpio_xtalk_info.xp_mapsz);
else else
return(0); return 0;
} }
...@@ -388,9 +388,9 @@ hub_piotrans_addr( vertex_hdl_t dev, /* translate to this device */ ...@@ -388,9 +388,9 @@ hub_piotrans_addr( vertex_hdl_t dev, /* translate to this device */
addr = (caddr_t)iaddr; addr = (caddr_t)iaddr;
} }
#endif #endif
return(addr); return addr;
} else } else
return(0); return 0;
} }
...@@ -425,7 +425,7 @@ hub_dmamap_alloc( vertex_hdl_t dev, /* set up mappings for this device */ ...@@ -425,7 +425,7 @@ hub_dmamap_alloc( vertex_hdl_t dev, /* set up mappings for this device */
if (flags & XTALK_FIXED) if (flags & XTALK_FIXED)
dmamap->hdma_flags |= HUB_DMAMAP_IS_FIXED; dmamap->hdma_flags |= HUB_DMAMAP_IS_FIXED;
return(dmamap); return dmamap;
} }
/* /*
...@@ -467,7 +467,7 @@ hub_dmamap_addr( hub_dmamap_t dmamap, /* use these mapping resources */ ...@@ -467,7 +467,7 @@ hub_dmamap_addr( hub_dmamap_t dmamap, /* use these mapping resources */
} }
/* There isn't actually any DMA mapping hardware on the hub. */ /* There isn't actually any DMA mapping hardware on the hub. */
return( (PHYS_TO_DMA(paddr)) ); return (PHYS_TO_DMA(paddr));
} }
/* /*
...@@ -497,7 +497,7 @@ hub_dmamap_list(hub_dmamap_t hub_dmamap, /* use these mapping resources */ ...@@ -497,7 +497,7 @@ hub_dmamap_list(hub_dmamap_t hub_dmamap, /* use these mapping resources */
} }
/* There isn't actually any DMA mapping hardware on the hub. */ /* There isn't actually any DMA mapping hardware on the hub. */
return(palenlist); return palenlist;
} }
/* /*
...@@ -532,7 +532,7 @@ hub_dmatrans_addr( vertex_hdl_t dev, /* translate for this device */ ...@@ -532,7 +532,7 @@ hub_dmatrans_addr( vertex_hdl_t dev, /* translate for this device */
size_t byte_count, /* length */ size_t byte_count, /* length */
unsigned flags) /* defined in dma.h */ unsigned flags) /* defined in dma.h */
{ {
return( (PHYS_TO_DMA(paddr)) ); return (PHYS_TO_DMA(paddr));
} }
/* /*
...@@ -549,7 +549,7 @@ hub_dmatrans_list( vertex_hdl_t dev, /* translate for this device */ ...@@ -549,7 +549,7 @@ hub_dmatrans_list( vertex_hdl_t dev, /* translate for this device */
{ {
BUG(); BUG();
/* no translation needed */ /* no translation needed */
return(palenlist); return palenlist;
} }
/*ARGSUSED*/ /*ARGSUSED*/
...@@ -609,8 +609,8 @@ hub_check_is_widget0(void *addr) ...@@ -609,8 +609,8 @@ hub_check_is_widget0(void *addr)
{ {
nasid_t nasid = NASID_GET(addr); nasid_t nasid = NASID_GET(addr);
if (((__psunsigned_t)addr >= RAW_NODE_SWIN_BASE(nasid, 0)) && if (((unsigned long)addr >= RAW_NODE_SWIN_BASE(nasid, 0)) &&
((__psunsigned_t)addr < RAW_NODE_SWIN_BASE(nasid, 1))) ((unsigned long)addr < RAW_NODE_SWIN_BASE(nasid, 1)))
return 1; return 1;
return 0; return 0;
} }
...@@ -626,8 +626,8 @@ hub_check_window_equiv(void *addra, void *addrb) ...@@ -626,8 +626,8 @@ hub_check_window_equiv(void *addra, void *addrb)
return 1; return 1;
/* XXX - Assume this is really a small window address */ /* XXX - Assume this is really a small window address */
if (WIDGETID_GET((__psunsigned_t)addra) == if (WIDGETID_GET((unsigned long)addra) ==
WIDGETID_GET((__psunsigned_t)addrb)) WIDGETID_GET((unsigned long)addrb))
return 1; return 1;
return 0; return 0;
......
...@@ -46,8 +46,9 @@ xswitch_vertex_init(vertex_hdl_t xswitch) ...@@ -46,8 +46,9 @@ xswitch_vertex_init(vertex_hdl_t xswitch)
int rc; int rc;
xvolinfo = kmalloc(sizeof(struct xswitch_vol_s), GFP_KERNEL); xvolinfo = kmalloc(sizeof(struct xswitch_vol_s), GFP_KERNEL);
if (xvolinfo <= 0 ) { if (!xvolinfo) {
printk("xswitch_vertex_init: out of memory\n"); printk(KERN_WARNING "xswitch_vertex_init(): Unable to "
"allocate memory\n");
return; return;
} }
memset(xvolinfo, 0, sizeof(struct xswitch_vol_s)); memset(xvolinfo, 0, sizeof(struct xswitch_vol_s));
...@@ -763,7 +764,7 @@ io_brick_map_widget(int brick_type, int widget_num) ...@@ -763,7 +764,7 @@ io_brick_map_widget(int brick_type, int widget_num)
/* Look for brick prefix in table */ /* Look for brick prefix in table */
for (i = 0; i < num_bricks; i++) { for (i = 0; i < num_bricks; i++) {
if (brick_type == io_brick_tab[i].ibm_type) if (brick_type == io_brick_tab[i].ibm_type)
return(io_brick_tab[i].ibm_map_wid[widget_num]); return io_brick_tab[i].ibm_map_wid[widget_num];
} }
return 0; return 0;
......
...@@ -37,7 +37,7 @@ static int pcibr_debug_slot = -1; /* '-1' for all slots */ ...@@ -37,7 +37,7 @@ static int pcibr_debug_slot = -1; /* '-1' for all slots */
#if PCIBR_SOFT_LIST #if PCIBR_SOFT_LIST
pcibr_list_p pcibr_list = 0; pcibr_list_p pcibr_list;
#endif #endif
extern char *pci_space[]; extern char *pci_space[];
...@@ -402,7 +402,7 @@ pcibr_mmap(struct file * file, struct vm_area_struct * vma) ...@@ -402,7 +402,7 @@ pcibr_mmap(struct file * file, struct vm_area_struct * vma)
error = io_remap_page_range(vma, phys_addr, vma->vm_start, error = io_remap_page_range(vma, phys_addr, vma->vm_start,
vma->vm_end - vma->vm_start, vma->vm_end - vma->vm_start,
vma->vm_page_prot); vma->vm_page_prot);
return(error); return error;
} }
/* /*
...@@ -594,7 +594,7 @@ pcibr_device_unregister(vertex_hdl_t pconn_vhdl) ...@@ -594,7 +594,7 @@ pcibr_device_unregister(vertex_hdl_t pconn_vhdl)
if (error_call) if (error_call)
error = error_call; error = error_call;
return(error); return error;
} }
...@@ -694,7 +694,7 @@ pcibr_detach(vertex_hdl_t xconn) ...@@ -694,7 +694,7 @@ pcibr_detach(vertex_hdl_t xconn)
/* Get the bridge vertex from its xtalk connection point */ /* Get the bridge vertex from its xtalk connection point */
if (hwgraph_traverse(xconn, EDGE_LBL_PCI, &pcibr_vhdl) != GRAPH_SUCCESS) if (hwgraph_traverse(xconn, EDGE_LBL_PCI, &pcibr_vhdl) != GRAPH_SUCCESS)
return(1); return 1;
pcibr_soft = pcibr_soft_get(pcibr_vhdl); pcibr_soft = pcibr_soft_get(pcibr_vhdl);
...@@ -728,12 +728,8 @@ pcibr_detach(vertex_hdl_t xconn) ...@@ -728,12 +728,8 @@ pcibr_detach(vertex_hdl_t xconn)
/* Remove the Bridge revision labelled info */ /* Remove the Bridge revision labelled info */
(void)hwgraph_info_remove_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, NULL); (void)hwgraph_info_remove_LBL(pcibr_vhdl, INFO_LBL_PCIBR_ASIC_REV, NULL);
/* Remove the character device associated with this bridge */
hwgraph_edge_remove(pcibr_vhdl, EDGE_LBL_CONTROLLER, NULL);
/* Remove the PCI bridge vertex */
hwgraph_edge_remove(xconn, EDGE_LBL_PCI, NULL);
return(0); return 0;
} }
...@@ -1317,7 +1313,7 @@ pcibr_piomap_addr(pcibr_piomap_t pcibr_piomap, ...@@ -1317,7 +1313,7 @@ pcibr_piomap_addr(pcibr_piomap_t pcibr_piomap,
"pcibr_piomap_addr: map=0x%lx, addr=0x%lx\n", "pcibr_piomap_addr: map=0x%lx, addr=0x%lx\n",
pcibr_piomap, addr)); pcibr_piomap, addr));
return(addr); return addr;
} }
/*ARGSUSED */ /*ARGSUSED */
...@@ -1358,7 +1354,7 @@ pcibr_piotrans_addr(vertex_hdl_t pconn_vhdl, ...@@ -1358,7 +1354,7 @@ pcibr_piotrans_addr(vertex_hdl_t pconn_vhdl,
PCIBR_DEBUG((PCIBR_DEBUG_PIODIR, pconn_vhdl, PCIBR_DEBUG((PCIBR_DEBUG_PIODIR, pconn_vhdl,
"pcibr_piotrans_addr: xio_addr=0x%lx, addr=0x%lx\n", "pcibr_piotrans_addr: xio_addr=0x%lx, addr=0x%lx\n",
xio_addr, addr)); xio_addr, addr));
return(addr); return addr;
} }
/* /*
...@@ -1624,7 +1620,7 @@ pcibr_flags_to_d64(unsigned flags, pcibr_soft_t pcibr_soft) ...@@ -1624,7 +1620,7 @@ pcibr_flags_to_d64(unsigned flags, pcibr_soft_t pcibr_soft)
attributes &= (PCI64_ATTR_BAR | PCI64_ATTR_SWAP); attributes &= (PCI64_ATTR_BAR | PCI64_ATTR_SWAP);
} }
return (attributes); return attributes;
} }
/*ARGSUSED */ /*ARGSUSED */
...@@ -2090,7 +2086,7 @@ pcibr_get_dmatrans_node(vertex_hdl_t pconn_vhdl) ...@@ -2090,7 +2086,7 @@ pcibr_get_dmatrans_node(vertex_hdl_t pconn_vhdl)
pciio_info_t pciio_info = pciio_info_get(pconn_vhdl); pciio_info_t pciio_info = pciio_info_get(pconn_vhdl);
pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info); pcibr_soft_t pcibr_soft = (pcibr_soft_t) pciio_info_mfast_get(pciio_info);
return(NASID_TO_COMPACT_NODEID(NASID_GET(pcibr_soft->bs_dir_xbase))); return NASID_TO_COMPACT_NODEID(NASID_GET(pcibr_soft->bs_dir_xbase));
} }
/*ARGSUSED */ /*ARGSUSED */
...@@ -2179,7 +2175,7 @@ pcibr_dmatrans_addr(vertex_hdl_t pconn_vhdl, ...@@ -2179,7 +2175,7 @@ pcibr_dmatrans_addr(vertex_hdl_t pconn_vhdl,
"pcibr_dmatrans_addr: wanted paddr [0x%lx..0x%lx], " "pcibr_dmatrans_addr: wanted paddr [0x%lx..0x%lx], "
"xio_port=0x%x, direct64: pci_addr=0x%lx\n", "xio_port=0x%x, direct64: pci_addr=0x%lx\n",
paddr, paddr + req_size - 1, xio_addr, pci_addr)); paddr, paddr + req_size - 1, xio_addr, pci_addr));
return (pci_addr); return pci_addr;
} }
if (!pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D64_BITS)) { if (!pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D64_BITS)) {
pci_addr = pcibr_flags_to_d64(flags, pcibr_soft); pci_addr = pcibr_flags_to_d64(flags, pcibr_soft);
...@@ -2210,7 +2206,7 @@ pcibr_dmatrans_addr(vertex_hdl_t pconn_vhdl, ...@@ -2210,7 +2206,7 @@ pcibr_dmatrans_addr(vertex_hdl_t pconn_vhdl,
"xio_port=0x%x, direct64: pci_addr=0x%lx, " "xio_port=0x%x, direct64: pci_addr=0x%lx, "
"new flags: 0x%x\n", paddr, paddr + req_size - 1, "new flags: 0x%x\n", paddr, paddr + req_size - 1,
xio_addr, pci_addr, (uint64_t) flags)); xio_addr, pci_addr, (uint64_t) flags));
return (pci_addr); return pci_addr;
} }
PCIBR_DEBUG((PCIBR_DEBUG_DMADIR, pconn_vhdl, PCIBR_DEBUG((PCIBR_DEBUG_DMADIR, pconn_vhdl,
...@@ -2263,7 +2259,7 @@ pcibr_dmatrans_addr(vertex_hdl_t pconn_vhdl, ...@@ -2263,7 +2259,7 @@ pcibr_dmatrans_addr(vertex_hdl_t pconn_vhdl,
" xio_port=0x%x, direct32: pci_addr=0x%lx\n", " xio_port=0x%x, direct32: pci_addr=0x%lx\n",
paddr, paddr + req_size - 1, xio_addr, pci_addr)); paddr, paddr + req_size - 1, xio_addr, pci_addr));
return (pci_addr); return pci_addr;
} }
if (!pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D32_BITS)) { if (!pcibr_try_set_device(pcibr_soft, pciio_slot, flags, BRIDGE_DEV_D32_BITS)) {
...@@ -2292,7 +2288,7 @@ pcibr_dmatrans_addr(vertex_hdl_t pconn_vhdl, ...@@ -2292,7 +2288,7 @@ pcibr_dmatrans_addr(vertex_hdl_t pconn_vhdl,
"new flags: 0x%x\n", paddr, paddr + req_size - 1, "new flags: 0x%x\n", paddr, paddr + req_size - 1,
xio_addr, pci_addr, (uint64_t) flags)); xio_addr, pci_addr, (uint64_t) flags));
return (pci_addr); return pci_addr;
} }
/* our flags conflict with Device(x). /* our flags conflict with Device(x).
*/ */
...@@ -2349,7 +2345,7 @@ pcibr_dmalist_drain(vertex_hdl_t pconn_vhdl, ...@@ -2349,7 +2345,7 @@ pcibr_dmalist_drain(vertex_hdl_t pconn_vhdl,
iopaddr_t iopaddr_t
pcibr_dmamap_pciaddr_get(pcibr_dmamap_t pcibr_dmamap) pcibr_dmamap_pciaddr_get(pcibr_dmamap_t pcibr_dmamap)
{ {
return (pcibr_dmamap->bd_pci_addr); return pcibr_dmamap->bd_pci_addr;
} }
/* ===================================================================== /* =====================================================================
...@@ -2486,7 +2482,7 @@ pcibr_device_flags_set(vertex_hdl_t pconn_vhdl, ...@@ -2486,7 +2482,7 @@ pcibr_device_flags_set(vertex_hdl_t pconn_vhdl,
"pcibr_device_flags_set: Device(%d): 0x%x\n", "pcibr_device_flags_set: Device(%d): 0x%x\n",
pciio_slot, devreg)); pciio_slot, devreg));
} }
return (1); return 1;
} }
/* /*
...@@ -2529,10 +2525,10 @@ pcibr_pcix_rbars_calc(pcibr_soft_t pcibr_soft) ...@@ -2529,10 +2525,10 @@ pcibr_pcix_rbars_calc(pcibr_soft_t pcibr_soft)
percent_allowed=(percent_allowed > 100) ? 100 : percent_allowed+1; percent_allowed=(percent_allowed > 100) ? 100 : percent_allowed+1;
} }
} else { } else {
return(ENODEV); return -ENODEV;
} }
return(percent_allowed); return percent_allowed;
} }
/* /*
......
...@@ -33,8 +33,11 @@ pcibr_hints_get(vertex_hdl_t xconn_vhdl, int alloc) ...@@ -33,8 +33,11 @@ pcibr_hints_get(vertex_hdl_t xconn_vhdl, int alloc)
if (alloc && (rv != GRAPH_SUCCESS)) { if (alloc && (rv != GRAPH_SUCCESS)) {
hint = kmalloc(sizeof (*(hint)), GFP_KERNEL); hint = kmalloc(sizeof (*(hint)), GFP_KERNEL);
if ( !hint ) if ( !hint ) {
printk(KERN_WARNING "pcibr_hints_get(): unable to allocate "
"memory\n");
goto abnormal_exit; goto abnormal_exit;
}
memset(hint, 0, sizeof (*(hint))); memset(hint, 0, sizeof (*(hint)));
hint->rrb_alloc_funct = NULL; hint->rrb_alloc_funct = NULL;
...@@ -57,7 +60,7 @@ pcibr_hints_get(vertex_hdl_t xconn_vhdl, int alloc) ...@@ -57,7 +60,7 @@ pcibr_hints_get(vertex_hdl_t xconn_vhdl, int alloc)
abnormal_exit: abnormal_exit:
kfree(hint); kfree(hint);
return(NULL); return NULL;
} }
......
...@@ -25,14 +25,14 @@ compare_and_swap_ptr(void **location, void *old_ptr, void *new_ptr) ...@@ -25,14 +25,14 @@ compare_and_swap_ptr(void **location, void *old_ptr, void *new_ptr)
/* FIXME - compare_and_swap_ptr NOT ATOMIC */ /* FIXME - compare_and_swap_ptr NOT ATOMIC */
if (*location == old_ptr) { if (*location == old_ptr) {
*location = new_ptr; *location = new_ptr;
return(1); return 1;
} }
else else
return(0); return 0;
} }
#endif #endif
unsigned pcibr_intr_bits(pciio_info_t info, pciio_intr_line_t lines, int nslots); unsigned int pcibr_intr_bits(pciio_info_t info, pciio_intr_line_t lines, int nslots);
pcibr_intr_t pcibr_intr_alloc(vertex_hdl_t, device_desc_t, pciio_intr_line_t, vertex_hdl_t); pcibr_intr_t pcibr_intr_alloc(vertex_hdl_t, device_desc_t, pciio_intr_line_t, vertex_hdl_t);
void pcibr_intr_free(pcibr_intr_t); void pcibr_intr_free(pcibr_intr_t);
void pcibr_setpciint(xtalk_intr_t); void pcibr_setpciint(xtalk_intr_t);
...@@ -49,7 +49,7 @@ extern pcibr_info_t pcibr_info_get(vertex_hdl_t); ...@@ -49,7 +49,7 @@ extern pcibr_info_t pcibr_info_get(vertex_hdl_t);
* INTERRUPT MANAGEMENT * INTERRUPT MANAGEMENT
*/ */
unsigned unsigned int
pcibr_intr_bits(pciio_info_t info, pcibr_intr_bits(pciio_info_t info,
pciio_intr_line_t lines, int nslots) pciio_intr_line_t lines, int nslots)
{ {
......
...@@ -427,7 +427,7 @@ pcibr_wrb_flush(vertex_hdl_t pconn_vhdl) ...@@ -427,7 +427,7 @@ pcibr_wrb_flush(vertex_hdl_t pconn_vhdl)
pcireg_wrb_flush_get(pcibr_soft, pciio_slot); pcireg_wrb_flush_get(pcibr_soft, pciio_slot);
return(0); return 0;
} }
/* /*
...@@ -710,10 +710,10 @@ pcibr_slot_initial_rrb_alloc(vertex_hdl_t pcibr_vhdl, ...@@ -710,10 +710,10 @@ pcibr_slot_initial_rrb_alloc(vertex_hdl_t pcibr_vhdl,
pcibr_soft = pcibr_soft_get(pcibr_vhdl); pcibr_soft = pcibr_soft_get(pcibr_vhdl);
if (!pcibr_soft) if (!pcibr_soft)
return(-EINVAL); return -EINVAL;
if (!PCIBR_VALID_SLOT(pcibr_soft, slot)) if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
return(-EINVAL); return -EINVAL;
/* How many RRBs are on this slot? */ /* How many RRBs are on this slot? */
vchan_total = NUMBER_VCHANNELS; vchan_total = NUMBER_VCHANNELS;
...@@ -747,7 +747,7 @@ pcibr_slot_initial_rrb_alloc(vertex_hdl_t pcibr_vhdl, ...@@ -747,7 +747,7 @@ pcibr_slot_initial_rrb_alloc(vertex_hdl_t pcibr_vhdl,
pcibr_soft->bs_rrb_valid[slot][3] = chan[3]; pcibr_soft->bs_rrb_valid[slot][3] = chan[3];
return(-ENODEV); return -ENODEV;
} }
if ((pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) && if ((pcibr_info->f_vendor == PCIIO_VENDOR_ID_NONE) &&
...@@ -758,13 +758,13 @@ pcibr_slot_initial_rrb_alloc(vertex_hdl_t pcibr_vhdl, ...@@ -758,13 +758,13 @@ pcibr_slot_initial_rrb_alloc(vertex_hdl_t pcibr_vhdl,
for (vchan = 0; vchan < vchan_total; vchan++) for (vchan = 0; vchan < vchan_total; vchan++)
pcibr_soft->bs_rrb_valid[slot][vchan] = 0; pcibr_soft->bs_rrb_valid[slot][vchan] = 0;
return(-ENODEV); return -ENODEV;
} }
for (vchan = 0; vchan < vchan_total; vchan++) for (vchan = 0; vchan < vchan_total; vchan++)
pcibr_soft->bs_rrb_valid[slot][vchan] = chan[vchan]; pcibr_soft->bs_rrb_valid[slot][vchan] = chan[vchan];
return(0); return 0;
} }
......
...@@ -95,23 +95,23 @@ pcibr_slot_info_init(vertex_hdl_t pcibr_vhdl, ...@@ -95,23 +95,23 @@ pcibr_slot_info_init(vertex_hdl_t pcibr_vhdl,
/* Get the basic software information required to proceed */ /* Get the basic software information required to proceed */
pcibr_soft = pcibr_soft_get(pcibr_vhdl); pcibr_soft = pcibr_soft_get(pcibr_vhdl);
if (!pcibr_soft) if (!pcibr_soft)
return(EINVAL); return -EINVAL;
if (!PCIBR_VALID_SLOT(pcibr_soft, slot)) if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
return(EINVAL); return -EINVAL;
/* If we have a host slot (eg:- IOC3 has 2 PCI slots and the initialization /* If we have a host slot (eg:- IOC3 has 2 PCI slots and the initialization
* is done by the host slot then we are done. * is done by the host slot then we are done.
*/ */
if (pcibr_soft->bs_slot[slot].has_host) { if (pcibr_soft->bs_slot[slot].has_host) {
return(0); return 0;
} }
/* Try to read the device-id/vendor-id from the config space */ /* Try to read the device-id/vendor-id from the config space */
cfgw = pcibr_slot_config_addr(pcibr_soft, slot, 0); cfgw = pcibr_slot_config_addr(pcibr_soft, slot, 0);
if (pcibr_probe_slot(pcibr_soft, cfgw, &idword)) if (pcibr_probe_slot(pcibr_soft, cfgw, &idword))
return(ENODEV); return -ENODEV;
slotp = &pcibr_soft->bs_slot[slot]; slotp = &pcibr_soft->bs_slot[slot];
slotp->slot_status |= SLOT_POWER_UP; slotp->slot_status |= SLOT_POWER_UP;
...@@ -127,7 +127,7 @@ pcibr_slot_info_init(vertex_hdl_t pcibr_vhdl, ...@@ -127,7 +127,7 @@ pcibr_slot_info_init(vertex_hdl_t pcibr_vhdl,
* and we are done. * and we are done.
*/ */
if (vendor == 0xFFFF) if (vendor == 0xFFFF)
return(ENODEV); return -ENODEV;
htype = do_pcibr_config_get(cfgw, PCI_CFG_HEADER_TYPE, 1); htype = do_pcibr_config_get(cfgw, PCI_CFG_HEADER_TYPE, 1);
nfunc = 1; nfunc = 1;
...@@ -158,7 +158,7 @@ pcibr_slot_info_init(vertex_hdl_t pcibr_vhdl, ...@@ -158,7 +158,7 @@ pcibr_slot_info_init(vertex_hdl_t pcibr_vhdl,
} }
pcibr_infoh = kmalloc(nfunc*sizeof (*(pcibr_infoh)), GFP_KERNEL); pcibr_infoh = kmalloc(nfunc*sizeof (*(pcibr_infoh)), GFP_KERNEL);
if ( !pcibr_infoh ) { if ( !pcibr_infoh ) {
return ENOMEM; return -ENOMEM;
} }
memset(pcibr_infoh, 0, nfunc*sizeof (*(pcibr_infoh))); memset(pcibr_infoh, 0, nfunc*sizeof (*(pcibr_infoh)));
...@@ -428,7 +428,7 @@ pcibr_slot_info_init(vertex_hdl_t pcibr_vhdl, ...@@ -428,7 +428,7 @@ pcibr_slot_info_init(vertex_hdl_t pcibr_vhdl,
} /* next win */ } /* next win */
} /* next func */ } /* next func */
return(0); return 0;
} }
/* /*
...@@ -447,7 +447,7 @@ pcibr_find_capability(cfg_p cfgw, ...@@ -447,7 +447,7 @@ pcibr_find_capability(cfg_p cfgw,
/* Check to see if there is a capabilities pointer in the cfg header */ /* Check to see if there is a capabilities pointer in the cfg header */
if (!(do_pcibr_config_get(cfgw, PCI_CFG_STATUS, 2) & PCI_STAT_CAP_LIST)) { if (!(do_pcibr_config_get(cfgw, PCI_CFG_STATUS, 2) & PCI_STAT_CAP_LIST)) {
return (NULL); return NULL;
} }
/* /*
...@@ -462,13 +462,13 @@ pcibr_find_capability(cfg_p cfgw, ...@@ -462,13 +462,13 @@ pcibr_find_capability(cfg_p cfgw,
while (cap_nxt && (defend_against_circular_linkedlist <= 48)) { while (cap_nxt && (defend_against_circular_linkedlist <= 48)) {
cap_id = do_pcibr_config_get(cfgw, cap_nxt, 1); cap_id = do_pcibr_config_get(cfgw, cap_nxt, 1);
if (cap_id == capability) { if (cap_id == capability) {
return ((cfg_p)((char *)cfgw + cap_nxt)); return (cfg_p)((char *)cfgw + cap_nxt);
} }
cap_nxt = (do_pcibr_config_get(cfgw, cap_nxt+1, 1) & 0xfc); cap_nxt = (do_pcibr_config_get(cfgw, cap_nxt+1, 1) & 0xfc);
defend_against_circular_linkedlist++; defend_against_circular_linkedlist++;
} }
return (NULL); return NULL;
} }
/* /*
...@@ -487,10 +487,10 @@ pcibr_slot_info_free(vertex_hdl_t pcibr_vhdl, ...@@ -487,10 +487,10 @@ pcibr_slot_info_free(vertex_hdl_t pcibr_vhdl,
pcibr_soft = pcibr_soft_get(pcibr_vhdl); pcibr_soft = pcibr_soft_get(pcibr_vhdl);
if (!pcibr_soft) if (!pcibr_soft)
return(EINVAL); return -EINVAL;
if (!PCIBR_VALID_SLOT(pcibr_soft, slot)) if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
return(EINVAL); return -EINVAL;
nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; nfunc = pcibr_soft->bs_slot[slot].bss_ninfo;
...@@ -500,7 +500,7 @@ pcibr_slot_info_free(vertex_hdl_t pcibr_vhdl, ...@@ -500,7 +500,7 @@ pcibr_slot_info_free(vertex_hdl_t pcibr_vhdl,
kfree(pcibr_infoh); kfree(pcibr_infoh);
pcibr_soft->bs_slot[slot].bss_ninfo = 0; pcibr_soft->bs_slot[slot].bss_ninfo = 0;
return(0); return 0;
} }
/* /*
...@@ -517,13 +517,13 @@ pcibr_slot_pcix_rbar_init(pcibr_soft_t pcibr_soft, ...@@ -517,13 +517,13 @@ pcibr_slot_pcix_rbar_init(pcibr_soft_t pcibr_soft,
int func; int func;
if (!PCIBR_VALID_SLOT(pcibr_soft, slot)) if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
return(EINVAL); return -EINVAL;
if ((nfunc = pcibr_soft->bs_slot[slot].bss_ninfo) < 1) if ((nfunc = pcibr_soft->bs_slot[slot].bss_ninfo) < 1)
return(EINVAL); return -EINVAL;
if (!(pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos)) if (!(pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos))
return(EINVAL); return -EINVAL;
PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RBAR, pcibr_soft->bs_vhdl, PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_RBAR, pcibr_soft->bs_vhdl,
"pcibr_slot_pcix_rbar_init for slot %d\n", "pcibr_slot_pcix_rbar_init for slot %d\n",
...@@ -595,7 +595,7 @@ pcibr_slot_pcix_rbar_init(pcibr_soft_t pcibr_soft, ...@@ -595,7 +595,7 @@ pcibr_slot_pcix_rbar_init(pcibr_soft_t pcibr_soft,
pcibr_soft->bs_pcix_rbar_inuse, pcibr_soft->bs_pcix_rbar_inuse,
pcibr_soft->bs_pcix_rbar_avail)); pcibr_soft->bs_pcix_rbar_avail));
} }
return(0); return 0;
} }
int as_debug = 0; int as_debug = 0;
...@@ -623,26 +623,26 @@ pcibr_slot_addr_space_init(vertex_hdl_t pcibr_vhdl, ...@@ -623,26 +623,26 @@ pcibr_slot_addr_space_init(vertex_hdl_t pcibr_vhdl,
pcibr_soft = pcibr_soft_get(pcibr_vhdl); pcibr_soft = pcibr_soft_get(pcibr_vhdl);
if (!pcibr_soft) if (!pcibr_soft)
return(EINVAL); return -EINVAL;
if (!PCIBR_VALID_SLOT(pcibr_soft, slot)) if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
return(EINVAL); return -EINVAL;
/* allocate address space, /* allocate address space,
* for windows that have not been * for windows that have not been
* previously assigned. * previously assigned.
*/ */
if (pcibr_soft->bs_slot[slot].has_host) { if (pcibr_soft->bs_slot[slot].has_host) {
return(0); return 0;
} }
nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; nfunc = pcibr_soft->bs_slot[slot].bss_ninfo;
if (nfunc < 1) if (nfunc < 1)
return(EINVAL); return -EINVAL;
pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos;
if (!pcibr_infoh) if (!pcibr_infoh)
return(EINVAL); return -EINVAL;
/* /*
* Try to make the DevIO windows not * Try to make the DevIO windows not
...@@ -827,7 +827,7 @@ pcibr_slot_addr_space_init(vertex_hdl_t pcibr_vhdl, ...@@ -827,7 +827,7 @@ pcibr_slot_addr_space_init(vertex_hdl_t pcibr_vhdl,
do_pcibr_config_set(cfgw, PCI_CFG_COMMAND, 4, do_pcibr_config_set(cfgw, PCI_CFG_COMMAND, 4,
pci_cfg_cmd_reg | pci_cfg_cmd_reg_add); pci_cfg_cmd_reg | pci_cfg_cmd_reg_add);
} /* next func */ } /* next func */
return(rc); return rc;
} }
/* /*
...@@ -845,10 +845,10 @@ pcibr_slot_device_init(vertex_hdl_t pcibr_vhdl, ...@@ -845,10 +845,10 @@ pcibr_slot_device_init(vertex_hdl_t pcibr_vhdl,
pcibr_soft = pcibr_soft_get(pcibr_vhdl); pcibr_soft = pcibr_soft_get(pcibr_vhdl);
if (!pcibr_soft) if (!pcibr_soft)
return(EINVAL); return -EINVAL;
if (!PCIBR_VALID_SLOT(pcibr_soft, slot)) if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
return(EINVAL); return -EINVAL;
/* /*
* Adjustments to Device(x) and init of bss_device shadow * Adjustments to Device(x) and init of bss_device shadow
...@@ -878,7 +878,7 @@ pcibr_slot_device_init(vertex_hdl_t pcibr_vhdl, ...@@ -878,7 +878,7 @@ pcibr_slot_device_init(vertex_hdl_t pcibr_vhdl,
PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DEVREG, pcibr_vhdl, PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_DEVREG, pcibr_vhdl,
"pcibr_slot_device_init: Device(%d): 0x%x\n", "pcibr_slot_device_init: Device(%d): 0x%x\n",
slot, devreg)); slot, devreg));
return(0); return 0;
} }
/* /*
...@@ -897,10 +897,10 @@ pcibr_slot_guest_info_init(vertex_hdl_t pcibr_vhdl, ...@@ -897,10 +897,10 @@ pcibr_slot_guest_info_init(vertex_hdl_t pcibr_vhdl,
pcibr_soft = pcibr_soft_get(pcibr_vhdl); pcibr_soft = pcibr_soft_get(pcibr_vhdl);
if (!pcibr_soft) if (!pcibr_soft)
return(EINVAL); return -EINVAL;
if (!PCIBR_VALID_SLOT(pcibr_soft, slot)) if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
return(EINVAL); return -EINVAL;
slotp = &pcibr_soft->bs_slot[slot]; slotp = &pcibr_soft->bs_slot[slot];
...@@ -912,7 +912,7 @@ pcibr_slot_guest_info_init(vertex_hdl_t pcibr_vhdl, ...@@ -912,7 +912,7 @@ pcibr_slot_guest_info_init(vertex_hdl_t pcibr_vhdl,
if (pcibr_soft->bs_slot[slot].bss_ninfo < 1) { if (pcibr_soft->bs_slot[slot].bss_ninfo < 1) {
pcibr_infoh = kmalloc(sizeof (*(pcibr_infoh)), GFP_KERNEL); pcibr_infoh = kmalloc(sizeof (*(pcibr_infoh)), GFP_KERNEL);
if ( !pcibr_infoh ) { if ( !pcibr_infoh ) {
return ENOMEM; return -ENOMEM;
} }
memset(pcibr_infoh, 0, sizeof (*(pcibr_infoh))); memset(pcibr_infoh, 0, sizeof (*(pcibr_infoh)));
...@@ -950,7 +950,7 @@ pcibr_slot_guest_info_init(vertex_hdl_t pcibr_vhdl, ...@@ -950,7 +950,7 @@ pcibr_slot_guest_info_init(vertex_hdl_t pcibr_vhdl,
EDGE_LBL_GUEST); EDGE_LBL_GUEST);
} }
return(0); return 0;
} }
...@@ -977,13 +977,13 @@ pcibr_slot_call_device_attach(vertex_hdl_t pcibr_vhdl, ...@@ -977,13 +977,13 @@ pcibr_slot_call_device_attach(vertex_hdl_t pcibr_vhdl,
pcibr_soft = pcibr_soft_get(pcibr_vhdl); pcibr_soft = pcibr_soft_get(pcibr_vhdl);
if (!pcibr_soft) if (!pcibr_soft)
return(EINVAL); return -EINVAL;
if (!PCIBR_VALID_SLOT(pcibr_soft, slot)) if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
return(EINVAL); return -EINVAL;
if (pcibr_soft->bs_slot[slot].has_host) { if (pcibr_soft->bs_slot[slot].has_host) {
return(EPERM); return -EPERM;
} }
xconn_vhdl = pcibr_soft->bs_conn; xconn_vhdl = pcibr_soft->bs_conn;
...@@ -1029,7 +1029,7 @@ pcibr_slot_call_device_attach(vertex_hdl_t pcibr_vhdl, ...@@ -1029,7 +1029,7 @@ pcibr_slot_call_device_attach(vertex_hdl_t pcibr_vhdl,
pcibr_soft->bs_slot[slot].slot_status |= SLOT_STARTUP_CMPLT; pcibr_soft->bs_slot[slot].slot_status |= SLOT_STARTUP_CMPLT;
} }
return(error); return error;
} }
/* /*
...@@ -1055,13 +1055,13 @@ pcibr_slot_call_device_detach(vertex_hdl_t pcibr_vhdl, ...@@ -1055,13 +1055,13 @@ pcibr_slot_call_device_detach(vertex_hdl_t pcibr_vhdl,
pcibr_soft = pcibr_soft_get(pcibr_vhdl); pcibr_soft = pcibr_soft_get(pcibr_vhdl);
if (!pcibr_soft) if (!pcibr_soft)
return(EINVAL); return -EINVAL;
if (!PCIBR_VALID_SLOT(pcibr_soft, slot)) if (!PCIBR_VALID_SLOT(pcibr_soft, slot))
return(EINVAL); return -EINVAL;
if (pcibr_soft->bs_slot[slot].has_host) if (pcibr_soft->bs_slot[slot].has_host)
return(EPERM); return -EPERM;
nfunc = pcibr_soft->bs_slot[slot].bss_ninfo; nfunc = pcibr_soft->bs_slot[slot].bss_ninfo;
pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos; pcibr_infoh = pcibr_soft->bs_slot[slot].bss_infos;
...@@ -1116,7 +1116,7 @@ pcibr_slot_call_device_detach(vertex_hdl_t pcibr_vhdl, ...@@ -1116,7 +1116,7 @@ pcibr_slot_call_device_detach(vertex_hdl_t pcibr_vhdl,
pcibr_soft->bs_slot[slot].slot_status |= SLOT_SHUTDOWN_CMPLT; pcibr_soft->bs_slot[slot].slot_status |= SLOT_SHUTDOWN_CMPLT;
} }
return(error); return error;
} }
/* /*
...@@ -1141,7 +1141,7 @@ pcibr_slot_detach(vertex_hdl_t pcibr_vhdl, ...@@ -1141,7 +1141,7 @@ pcibr_slot_detach(vertex_hdl_t pcibr_vhdl,
*sub_errorp = error; *sub_errorp = error;
if (l1_msg) if (l1_msg)
; ;
return(PCI_SLOT_DRV_DETACH_ERR); return PCI_SLOT_DRV_DETACH_ERR;
} }
/* Recalculate the RBARs for all the devices on the bus since we've /* Recalculate the RBARs for all the devices on the bus since we've
...@@ -1160,7 +1160,7 @@ pcibr_slot_detach(vertex_hdl_t pcibr_vhdl, ...@@ -1160,7 +1160,7 @@ pcibr_slot_detach(vertex_hdl_t pcibr_vhdl,
(void)pcibr_slot_pcix_rbar_init(pcibr_soft, tmp_slot); (void)pcibr_slot_pcix_rbar_init(pcibr_soft, tmp_slot);
} }
return (0); return 0;
} }
...@@ -1350,7 +1350,7 @@ pcibr_bus_addr_alloc(pcibr_soft_t pcibr_soft, pciio_win_info_t win_info_p, ...@@ -1350,7 +1350,7 @@ pcibr_bus_addr_alloc(pcibr_soft_t pcibr_soft, pciio_win_info_t win_info_p,
? &win_info_p->w_win_alloc ? &win_info_p->w_win_alloc
: NULL, : NULL,
start, size, align); start, size, align);
return(iopaddr); return iopaddr;
} }
......
...@@ -768,9 +768,12 @@ pciio_device_info_new( ...@@ -768,9 +768,12 @@ pciio_device_info_new(
pciio_info = kmalloc(sizeof (*(pciio_info)), GFP_KERNEL); pciio_info = kmalloc(sizeof (*(pciio_info)), GFP_KERNEL);
if ( pciio_info ) if ( pciio_info )
memset(pciio_info, 0, sizeof (*(pciio_info))); memset(pciio_info, 0, sizeof (*(pciio_info)));
else {
printk(KERN_WARNING "pciio_device_info_new(): Unable to "
"allocate memory\n");
return NULL;
}
} }
ASSERT(pciio_info != NULL);
pciio_info->c_slot = slot; pciio_info->c_slot = slot;
pciio_info->c_func = func; pciio_info->c_func = func;
pciio_info->c_vendor = vendor_id; pciio_info->c_vendor = vendor_id;
...@@ -835,13 +838,8 @@ pciio_device_info_unregister(vertex_hdl_t connectpt, ...@@ -835,13 +838,8 @@ pciio_device_info_unregister(vertex_hdl_t connectpt,
pciio_info->c_slot, pciio_info->c_slot,
pciio_info->c_func); pciio_info->c_func);
hwgraph_edge_remove(connectpt,name,&pconn);
pciio_info_set(pconn,0); pciio_info_set(pconn,0);
/* Remove the link to our pci provider */
hwgraph_edge_remove(pconn, EDGE_LBL_MASTER, NULL);
hwgraph_vertex_unref(pconn); hwgraph_vertex_unref(pconn);
hwgraph_vertex_destroy(pconn); hwgraph_vertex_destroy(pconn);
......
...@@ -76,7 +76,7 @@ pic_bus1_widget_info_dup(vertex_hdl_t conn_v, vertex_hdl_t peer_conn_v, ...@@ -76,7 +76,7 @@ pic_bus1_widget_info_dup(vertex_hdl_t conn_v, vertex_hdl_t peer_conn_v,
(arbitrary_info_t *)&widget_info) == GRAPH_SUCCESS) { (arbitrary_info_t *)&widget_info) == GRAPH_SUCCESS) {
peer_widget_info = kmalloc(sizeof (*(peer_widget_info)), GFP_KERNEL); peer_widget_info = kmalloc(sizeof (*(peer_widget_info)), GFP_KERNEL);
if ( !peer_widget_info ) { if ( !peer_widget_info ) {
return 0; return -ENOMEM;
} }
memset(peer_widget_info, 0, sizeof (*(peer_widget_info))); memset(peer_widget_info, 0, sizeof (*(peer_widget_info)));
...@@ -336,12 +336,12 @@ pic_attach2(vertex_hdl_t xconn_vhdl, void *bridge, ...@@ -336,12 +336,12 @@ pic_attach2(vertex_hdl_t xconn_vhdl, void *bridge,
*/ */
pcibr_soft = kmalloc(sizeof (*(pcibr_soft)), GFP_KERNEL); pcibr_soft = kmalloc(sizeof (*(pcibr_soft)), GFP_KERNEL);
if ( !pcibr_soft ) if ( !pcibr_soft )
return -1; return -ENOMEM;
self = kmalloc(sizeof (*(self)), GFP_KERNEL); self = kmalloc(sizeof (*(self)), GFP_KERNEL);
if ( !self ) { if ( !self ) {
kfree(pcibr_soft); kfree(pcibr_soft);
return -1; return -ENOMEM;
} }
memset(pcibr_soft, 0, sizeof (*(pcibr_soft))); memset(pcibr_soft, 0, sizeof (*(pcibr_soft)));
memset(self, 0, sizeof (*(self))); memset(self, 0, sizeof (*(self)));
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/delay.h>
#include <asm/sn/sgi.h> #include <asm/sn/sgi.h>
#include <asm/sn/io.h> #include <asm/sn/io.h>
#include <asm/sn/iograph.h> #include <asm/sn/iograph.h>
......
...@@ -9,11 +9,15 @@ ...@@ -9,11 +9,15 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/mm.h>
#include <linux/delay.h>
#include <asm/sn/sgi.h>
#include <asm/sn/sn2/sn_private.h> #include <asm/sn/sn2/sn_private.h>
#include <asm/sn/iograph.h> #include <asm/sn/iograph.h>
#include <asm/sn/simulator.h> #include <asm/sn/simulator.h>
#include <asm/sn/hcl.h> #include <asm/sn/hcl.h>
#include <asm/sn/hcl_util.h> #include <asm/sn/hcl_util.h>
#include <asm/sn/pci/pcibr_private.h>
/* #define DEBUG 1 */ /* #define DEBUG 1 */
/* #define XBOW_DEBUG 1 */ /* #define XBOW_DEBUG 1 */
......
...@@ -30,9 +30,6 @@ ...@@ -30,9 +30,6 @@
* completely disappear. * completely disappear.
*/ */
#define NEW(ptr) (ptr = kmalloc(sizeof (*(ptr)), GFP_KERNEL))
#define DEL(ptr) (kfree(ptr))
char widget_info_fingerprint[] = "widget_info"; char widget_info_fingerprint[] = "widget_info";
/* ===================================================================== /* =====================================================================
...@@ -855,7 +852,9 @@ xwidget_register(xwidget_hwid_t hwid, /* widget's hardware ID */ ...@@ -855,7 +852,9 @@ xwidget_register(xwidget_hwid_t hwid, /* widget's hardware ID */
char *s,devnm[MAXDEVNAME]; char *s,devnm[MAXDEVNAME];
/* Allocate widget_info and associate it with widget vertex */ /* Allocate widget_info and associate it with widget vertex */
NEW(widget_info); widget_info = kmalloc(sizeof(*widget_info), GFP_KERNEL);
if (!widget_info)
return - ENOMEM;
/* Initialize widget_info */ /* Initialize widget_info */
widget_info->w_vertex = widget; widget_info->w_vertex = widget;
...@@ -898,16 +897,13 @@ xwidget_unregister(vertex_hdl_t widget) ...@@ -898,16 +897,13 @@ xwidget_unregister(vertex_hdl_t widget)
/* Make sure that we have valid widget information initialized */ /* Make sure that we have valid widget information initialized */
if (!(widget_info = xwidget_info_get(widget))) if (!(widget_info = xwidget_info_get(widget)))
return(1); return 1;
hwid = &(widget_info->w_hwid); hwid = &(widget_info->w_hwid);
/* Clean out the xwidget information */ kfree(widget_info->w_name);
(void)kfree(widget_info->w_name); kfree(widget_info);
memset((void *)widget_info, 0, sizeof(widget_info)); return 0;
DEL(widget_info);
return(0);
} }
void void
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm/errno.h>
#include <asm/sn/sgi.h> #include <asm/sn/sgi.h>
#include <asm/sn/driver.h> #include <asm/sn/driver.h>
#include <asm/sn/iograph.h> #include <asm/sn/iograph.h>
...@@ -18,8 +19,6 @@ ...@@ -18,8 +19,6 @@
#include <asm/sn/xtalk/xwidget.h> #include <asm/sn/xtalk/xwidget.h>
#include <asm/sn/xtalk/xtalk_private.h> #include <asm/sn/xtalk/xtalk_private.h>
#define NEW(ptr) (ptr = kmalloc(sizeof (*(ptr)), GFP_KERNEL))
#define DEL(ptr) (kfree(ptr))
/* /*
* This file provides generic support for Crosstalk * This file provides generic support for Crosstalk
...@@ -118,7 +117,12 @@ xswitch_info_new(vertex_hdl_t xwidget) ...@@ -118,7 +117,12 @@ xswitch_info_new(vertex_hdl_t xwidget)
if (xswitch_info == NULL) { if (xswitch_info == NULL) {
int port; int port;
NEW(xswitch_info); xswitch_info = kmalloc(sizeof(*xswitch_info), GFP_KERNEL);
if (!xswitch_info) {
printk(KERN_WARNING "xswitch_info_new(): Unable to "
"allocate memory\n");
return NULL;
}
xswitch_info->census = 0; xswitch_info->census = 0;
for (port = 0; port <= XSWITCH_CENSUS_PORT_MAX; port++) { for (port = 0; port <= XSWITCH_CENSUS_PORT_MAX; port++) {
xswitch_info_vhdl_set(xswitch_info, port, xswitch_info_vhdl_set(xswitch_info, port,
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <asm/sn/sgi.h>
#include <asm/sn/nodepda.h> #include <asm/sn/nodepda.h>
#include <asm/sn/addrs.h> #include <asm/sn/addrs.h>
#include <asm/sn/arch.h> #include <asm/sn/arch.h>
...@@ -14,6 +15,7 @@ ...@@ -14,6 +15,7 @@
#include <asm/sn/pda.h> #include <asm/sn/pda.h>
#include <asm/sn/sn2/shubio.h> #include <asm/sn/sn2/shubio.h>
#include <asm/nodedata.h> #include <asm/nodedata.h>
#include <asm/delay.h>
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/string.h> #include <linux/string.h>
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <asm/sn/sgi.h>
#include <asm/mca.h> #include <asm/mca.h>
#include <asm/sal.h> #include <asm/sal.h>
#include <asm/sn/sn_sal.h> #include <asm/sn/sn_sal.h>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All rights reserved. * Copyright (c) 2000-2003 Silicon Graphics, Inc. All rights reserved.
*/ */
#include <asm/sn/sgi.h>
#include <asm/sn/sn_sal.h> #include <asm/sn/sn_sal.h>
/** /**
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/sn/sn2/addrs.h>
#include <asm/sn/simulator.h> #include <asm/sn/simulator.h>
/* to lookup nasids */ /* to lookup nasids */
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/sn/sgi.h>
#include <asm/sal.h> #include <asm/sal.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/delay.h> #include <asm/delay.h>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <asm/sn/sgi.h>
#include <asm/sn/sn_sal.h> #include <asm/sn/sn_sal.h>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/circ_buf.h> #include <linux/circ_buf.h>
#include <linux/serial_reg.h> #include <linux/serial_reg.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/sn/sgi.h>
#include <asm/sn/sn_sal.h> #include <asm/sn/sn_sal.h>
#include <asm/sn/pci/pciio.h> #include <asm/sn/pci/pciio.h>
#include <asm/sn/simulator.h> #include <asm/sn/simulator.h>
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#ifndef _ASM_IA64_SN_ADDRS_H #ifndef _ASM_IA64_SN_ADDRS_H
#define _ASM_IA64_SN_ADDRS_H #define _ASM_IA64_SN_ADDRS_H
#include <linux/config.h>
#include <asm/sn/sn2/addrs.h> #include <asm/sn/sn2/addrs.h>
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
...@@ -154,7 +152,7 @@ ...@@ -154,7 +152,7 @@
* the base of the register space. * the base of the register space.
*/ */
#define HUB_REG_PTR(_base, _off) \ #define HUB_REG_PTR(_base, _off) \
(HUBREG_CAST ((__psunsigned_t)(_base) + (__psunsigned_t)(_off))) (HUBREG_CAST ((unsigned long)(_base) + (__psunsigned_t)(_off)))
#define HUB_REG_PTR_L(_base, _off) \ #define HUB_REG_PTR_L(_base, _off) \
HUB_L(HUB_REG_PTR((_base), (_off))) HUB_L(HUB_REG_PTR((_base), (_off)))
......
...@@ -62,7 +62,7 @@ typedef struct external_alenlist *external_alenlist_t; ...@@ -62,7 +62,7 @@ typedef struct external_alenlist *external_alenlist_t;
/* Create an Address/Length List, and clear it of all entries. */ /* Create an Address/Length List, and clear it of all entries. */
extern alenlist_t alenlist_create(unsigned flags); extern alenlist_t alenlist_create(unsigned int flags);
/* Grow/shrink an Address/Length List and FIX its size. */ /* Grow/shrink an Address/Length List and FIX its size. */
extern int alenlist_grow(alenlist_t, size_t npairs); extern int alenlist_grow(alenlist_t, size_t npairs);
...@@ -103,7 +103,7 @@ alenlist_done(alenlist_t alenlist); ...@@ -103,7 +103,7 @@ alenlist_done(alenlist_t alenlist);
extern int alenlist_append(alenlist_t alenlist, /* append to this list */ extern int alenlist_append(alenlist_t alenlist, /* append to this list */
alenaddr_t address, /* address to append */ alenaddr_t address, /* address to append */
size_t length, /* length to append */ size_t length, /* length to append */
unsigned flags); unsigned int flags);
/* /*
* Replace a Pair in the middle of a List, and return old values. * Replace a Pair in the middle of a List, and return old values.
...@@ -114,7 +114,7 @@ alenlist_replace( alenlist_t alenlist, /* in: replace in this list */ ...@@ -114,7 +114,7 @@ alenlist_replace( alenlist_t alenlist, /* in: replace in this list */
alenlist_cursor_t cursorp, /* inout: which item to replace */ alenlist_cursor_t cursorp, /* inout: which item to replace */
alenaddr_t *addrp, /* inout: address */ alenaddr_t *addrp, /* inout: address */
size_t *lengthp, /* inout: length */ size_t *lengthp, /* inout: length */
unsigned flags); unsigned int flags);
/* Get the next Pair from a List */ /* Get the next Pair from a List */
...@@ -123,7 +123,7 @@ extern int alenlist_get(alenlist_t alenlist, /* in: get from this list */ ...@@ -123,7 +123,7 @@ extern int alenlist_get(alenlist_t alenlist, /* in: get from this list */
size_t maxlength, /* in: at most length */ size_t maxlength, /* in: at most length */
alenaddr_t *addr, /* out: address */ alenaddr_t *addr, /* out: address */
size_t *length, /* out: length */ size_t *length, /* out: length */
unsigned flags); unsigned int flags);
/* Return the number of Pairs stored in this List */ /* Return the number of Pairs stored in this List */
...@@ -135,11 +135,11 @@ extern void alenlist_concat( alenlist_t from, /* copy from this list */ ...@@ -135,11 +135,11 @@ extern void alenlist_concat( alenlist_t from, /* copy from this list */
/* Create a copy of an Address/Length List */ /* Create a copy of an Address/Length List */
extern alenlist_t alenlist_clone(alenlist_t old, /* clone this list */ extern alenlist_t alenlist_clone(alenlist_t old, /* clone this list */
unsigned flags); unsigned int flags);
/* Allocate and initialize an Address/Length List Cursor */ /* Allocate and initialize an Address/Length List Cursor */
extern alenlist_cursor_t alenlist_cursor_create(alenlist_t alenlist, unsigned flags); extern alenlist_cursor_t alenlist_cursor_create(alenlist_t alenlist, unsigned int flags);
/* Free an Address/Length List Cursor */ /* Free an Address/Length List Cursor */
extern void alenlist_cursor_destroy(alenlist_cursor_t cursorp); extern void alenlist_cursor_destroy(alenlist_cursor_t cursorp);
...@@ -170,19 +170,19 @@ extern size_t alenlist_cursor_offset(alenlist_t alenlist, alenlist_cursor_t curs ...@@ -170,19 +170,19 @@ extern size_t alenlist_cursor_offset(alenlist_t alenlist, alenlist_cursor_t curs
extern alenlist_t kvaddr_to_alenlist( alenlist_t alenlist, extern alenlist_t kvaddr_to_alenlist( alenlist_t alenlist,
caddr_t kvaddr, caddr_t kvaddr,
size_t length, size_t length,
unsigned flags); unsigned int flags);
/* Convert from a User Virtual Address to a Physical Address/Length List */ /* Convert from a User Virtual Address to a Physical Address/Length List */
extern alenlist_t uvaddr_to_alenlist( alenlist_t alenlist, extern alenlist_t uvaddr_to_alenlist( alenlist_t alenlist,
uvaddr_t vaddr, uvaddr_t vaddr,
size_t length, size_t length,
unsigned flags); unsigned int flags);
/* Convert from a buf struct to a Physical Address/Length List */ /* Convert from a buf struct to a Physical Address/Length List */
struct buf; struct buf;
extern alenlist_t buf_to_alenlist( alenlist_t alenlist, extern alenlist_t buf_to_alenlist( alenlist_t alenlist,
struct buf *buf, struct buf *buf,
unsigned flags); unsigned int flags);
/* /*
......
...@@ -11,12 +11,9 @@ ...@@ -11,12 +11,9 @@
#ifndef _ASM_IA64_SN_ARCH_H #ifndef _ASM_IA64_SN_ARCH_H
#define _ASM_IA64_SN_ARCH_H #define _ASM_IA64_SN_ARCH_H
#include <linux/config.h> #include <asm/types.h>
#include <linux/threads.h>
#include <linux/mmzone.h>
#include <asm/sn/types.h> #include <asm/sn/types.h>
#include <asm/sn/sn_cpuid.h>
#include <asm/sn/sn2/arch.h>
typedef u64 shubreg_t; typedef u64 shubreg_t;
typedef u64 hubreg_t; typedef u64 hubreg_t;
......
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/cache.h> #include <linux/cache.h>
#include <asm/sn/io.h> #include <asm/sn/types.h>
#include <asm/delay.h>
/* #define BTE_DEBUG */ /* #define BTE_DEBUG */
......
...@@ -23,9 +23,7 @@ ...@@ -23,9 +23,7 @@
#ifndef _ASM_IA64_SN_CLKSUPPORT_H #ifndef _ASM_IA64_SN_CLKSUPPORT_H
#define _ASM_IA64_SN_CLKSUPPORT_H #define _ASM_IA64_SN_CLKSUPPORT_H
#include <linux/config.h>
#include <asm/sn/arch.h> #include <asm/sn/arch.h>
#include <asm/sn/addrs.h>
typedef long clkreg_t; typedef long clkreg_t;
......
...@@ -31,7 +31,7 @@ struct eframe_s; ...@@ -31,7 +31,7 @@ struct eframe_s;
struct piomap; struct piomap;
struct dmamap; struct dmamap;
typedef __psunsigned_t iobush_t; typedef unsigned long iobush_t;
/* interrupt function */ /* interrupt function */
typedef void *intr_arg_t; typedef void *intr_arg_t;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#ifndef _ASM_IA64_SN_HCL_H #ifndef _ASM_IA64_SN_HCL_H
#define _ASM_IA64_SN_HCL_H #define _ASM_IA64_SN_HCL_H
#include <linux/fs.h>
#include <asm/sn/sgi.h> #include <asm/sn/sgi.h>
extern vertex_hdl_t hwgraph_root; extern vertex_hdl_t hwgraph_root;
...@@ -58,7 +59,6 @@ typedef long arb_info_desc_t; ...@@ -58,7 +59,6 @@ typedef long arb_info_desc_t;
#define hwgraph_connectpt_set labelcl_info_connectpt_set #define hwgraph_connectpt_set labelcl_info_connectpt_set
#define hwgraph_generate_path hwgfs_generate_path #define hwgraph_generate_path hwgfs_generate_path
#define hwgraph_path_to_vertex(a) hwgfs_find_handle(NULL, a, 0, 0, 0, 1) #define hwgraph_path_to_vertex(a) hwgfs_find_handle(NULL, a, 0, 0, 0, 1)
#define hwgraph_edge_remove(a,b,c)
#define hwgraph_vertex_unref(a) #define hwgraph_vertex_unref(a)
/* /*
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#ifndef _ASM_IA64_SN_HCL_UTIL_H #ifndef _ASM_IA64_SN_HCL_UTIL_H
#define _ASM_IA64_SN_HCL_UTIL_H #define _ASM_IA64_SN_HCL_UTIL_H
#include <asm/sn/sgi.h>
extern char * dev_to_name(vertex_hdl_t, char *, unsigned int); extern char * dev_to_name(vertex_hdl_t, char *, unsigned int);
extern int device_master_set(vertex_hdl_t, vertex_hdl_t); extern int device_master_set(vertex_hdl_t, vertex_hdl_t);
extern vertex_hdl_t device_master_get(vertex_hdl_t); extern vertex_hdl_t device_master_get(vertex_hdl_t);
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
* *
* Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved. * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
*/ */
#include <asm/types.h>
typedef struct dentry *hwgfs_handle_t; typedef struct dentry *hwgfs_handle_t;
extern hwgfs_handle_t hwgfs_register(hwgfs_handle_t dir, const char *name, extern hwgfs_handle_t hwgfs_register(hwgfs_handle_t dir, const char *name,
......
...@@ -144,6 +144,7 @@ ...@@ -144,6 +144,7 @@
void init_all_devices(void); void init_all_devices(void);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#include <asm/sn/sgi.h>
#include <asm/sn/xtalk/xbow.h> /* For get MAX_PORT_NUM */ #include <asm/sn/xtalk/xbow.h> /* For get MAX_PORT_NUM */
int io_brick_map_widget(int, int); int io_brick_map_widget(int, int);
......
...@@ -92,9 +92,9 @@ typedef s32 klconf_off_t; ...@@ -92,9 +92,9 @@ typedef s32 klconf_off_t;
typedef struct console_s { typedef struct console_s {
__psunsigned_t uart_base; unsigned long uart_base;
__psunsigned_t config_base; unsigned long config_base;
__psunsigned_t memory_base; unsigned long memory_base;
short baud; short baud;
short flag; short flag;
int type; int type;
...@@ -134,7 +134,7 @@ typedef struct kl_config_hdr { ...@@ -134,7 +134,7 @@ typedef struct kl_config_hdr {
/* --- New Macros for the changed kl_config_hdr_t structure --- */ /* --- New Macros for the changed kl_config_hdr_t structure --- */
#define PTR_CH_CONS_INFO(_k) ((console_t *)\ #define PTR_CH_CONS_INFO(_k) ((console_t *)\
((__psunsigned_t)_k + (_k->ch_cons_off))) ((unsigned long)_k + (_k->ch_cons_off)))
#define KL_CONFIG_CH_CONS_INFO(_n) PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n)) #define KL_CONFIG_CH_CONS_INFO(_n) PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n))
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#ifndef _ASM_IA64_SN_KLDIR_H #ifndef _ASM_IA64_SN_KLDIR_H
#define _ASM_IA64_SN_KLDIR_H #define _ASM_IA64_SN_KLDIR_H
#include <asm/sn/sgi.h> #include <linux/types.h>
/* /*
* The kldir memory area resides at a fixed place in each node's memory and * The kldir memory area resides at a fixed place in each node's memory and
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
typedef struct kldir_ent_s { typedef struct kldir_ent_s {
u64 magic; /* Indicates validity of entry */ u64 magic; /* Indicates validity of entry */
off_t offset; /* Offset from start of node space */ off_t offset; /* Offset from start of node space */
__psunsigned_t pointer; /* Pointer to area in some cases */ unsigned long pointer; /* Pointer to area in some cases */
size_t size; /* Size in bytes */ size_t size; /* Size in bytes */
u64 count; /* Repeat count if array, 1 if not */ u64 count; /* Repeat count if array, 1 if not */
size_t stride; /* Stride if array, 0 if not */ size_t stride; /* Stride if array, 0 if not */
......
...@@ -13,7 +13,7 @@ extern "C" { ...@@ -13,7 +13,7 @@ extern "C" {
#endif #endif
#include <linux/config.h> #include <asm/semaphore.h>
#include <asm/sn/klconfig.h> #include <asm/sn/klconfig.h>
#include <asm/sn/ksys/elsc.h> #include <asm/sn/ksys/elsc.h>
......
...@@ -9,14 +9,14 @@ ...@@ -9,14 +9,14 @@
#define _ASM_IA64_SN_NODEPDA_H #define _ASM_IA64_SN_NODEPDA_H
#include <linux/config.h> #include <asm/semaphore.h>
#include <asm/sn/sgi.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/sn/intr.h> #include <asm/sn/intr.h>
#include <asm/sn/router.h> #include <asm/sn/router.h>
#include <asm/sn/pda.h> #include <asm/sn/pda.h>
#include <asm/sn/module.h> #include <asm/sn/module.h>
#include <asm/sn/bte.h> #include <asm/sn/bte.h>
#include <asm/sn/sn2/arch.h>
/* /*
* NUMA Node-Specific Data structures are defined in this file. * NUMA Node-Specific Data structures are defined in this file.
......
...@@ -533,12 +533,12 @@ typedef volatile struct bridge_s { ...@@ -533,12 +533,12 @@ typedef volatile struct bridge_s {
/* 0x020000-0x027FFF -- PCI Device Configuration Spaces */ /* 0x020000-0x027FFF -- PCI Device Configuration Spaces */
union { /* make all access sizes available. */ union { /* make all access sizes available. */
uchar_t c[0x1000 / 1]; /* 0x02{0000,,,7FFF} */ unsigned char c[0x1000 / 1]; /* 0x02{0000,,,7FFF} */
uint16_t s[0x1000 / 2]; /* 0x02{0000,,,7FFF} */ uint16_t s[0x1000 / 2]; /* 0x02{0000,,,7FFF} */
uint32_t l[0x1000 / 4]; /* 0x02{0000,,,7FFF} */ uint32_t l[0x1000 / 4]; /* 0x02{0000,,,7FFF} */
uint64_t d[0x1000 / 8]; /* 0x02{0000,,,7FFF} */ uint64_t d[0x1000 / 8]; /* 0x02{0000,,,7FFF} */
union { union {
uchar_t c[0x100 / 1]; unsigned char c[0x100 / 1];
uint16_t s[0x100 / 2]; uint16_t s[0x100 / 2];
uint32_t l[0x100 / 4]; uint32_t l[0x100 / 4];
uint64_t d[0x100 / 8]; uint64_t d[0x100 / 8];
...@@ -547,12 +547,12 @@ typedef volatile struct bridge_s { ...@@ -547,12 +547,12 @@ typedef volatile struct bridge_s {
/* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */ /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */
union { /* make all access sizes available. */ union { /* make all access sizes available. */
uchar_t c[0x1000 / 1]; unsigned char c[0x1000 / 1];
uint16_t s[0x1000 / 2]; uint16_t s[0x1000 / 2];
uint32_t l[0x1000 / 4]; uint32_t l[0x1000 / 4];
uint64_t d[0x1000 / 8]; uint64_t d[0x1000 / 8];
union { union {
uchar_t c[0x100 / 1]; unsigned char c[0x100 / 1];
uint16_t s[0x100 / 2]; uint16_t s[0x100 / 2];
uint32_t l[0x100 / 4]; uint32_t l[0x100 / 4];
uint64_t d[0x100 / 8]; uint64_t d[0x100 / 8];
...@@ -563,13 +563,13 @@ typedef volatile struct bridge_s { ...@@ -563,13 +563,13 @@ typedef volatile struct bridge_s {
/* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */ /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */
union { union {
uchar_t c[8 / 1]; unsigned char c[8 / 1];
uint16_t s[8 / 2]; uint16_t s[8 / 2];
uint32_t l[8 / 4]; uint32_t l[8 / 4];
uint64_t d[8 / 8]; uint64_t d[8 / 8];
} b_pci_iack; /* 0x030000-0x030007 */ } b_pci_iack; /* 0x030000-0x030007 */
uchar_t _pad_030007[0x04fff8]; /* 0x030008-0x07FFFF */ unsigned char _pad_030007[0x04fff8]; /* 0x030008-0x07FFFF */
/* 0x080000-0x0FFFFF -- External Address Translation Entry RAM */ /* 0x080000-0x0FFFFF -- External Address Translation Entry RAM */
bridge_ate_t b_ext_ate_ram[0x10000]; bridge_ate_t b_ext_ate_ram[0x10000];
...@@ -579,7 +579,7 @@ typedef volatile struct bridge_s { ...@@ -579,7 +579,7 @@ typedef volatile struct bridge_s {
/* 0x200000-0xBFFFFF -- PCI/GIO Device Spaces */ /* 0x200000-0xBFFFFF -- PCI/GIO Device Spaces */
union { /* make all access sizes available. */ union { /* make all access sizes available. */
uchar_t c[0x100000 / 1]; unsigned char c[0x100000 / 1];
uint16_t s[0x100000 / 2]; uint16_t s[0x100000 / 2];
uint32_t l[0x100000 / 4]; uint32_t l[0x100000 / 4];
uint64_t d[0x100000 / 8]; uint64_t d[0x100000 / 8];
...@@ -593,7 +593,7 @@ typedef volatile struct bridge_s { ...@@ -593,7 +593,7 @@ typedef volatile struct bridge_s {
/* 0xC00000-0xFFFFFF -- External Flash Proms 1,0 */ /* 0xC00000-0xFFFFFF -- External Flash Proms 1,0 */
union { /* make all access sizes available. */ union { /* make all access sizes available. */
uchar_t c[0x400000 / 1]; /* read-only */ unsigned char c[0x400000 / 1]; /* read-only */
uint16_t s[0x400000 / 2]; /* read-write */ uint16_t s[0x400000 / 2]; /* read-write */
uint32_t l[0x400000 / 4]; /* read-only */ uint32_t l[0x400000 / 4]; /* read-only */
uint64_t d[0x400000 / 8]; /* read-only */ uint64_t d[0x400000 / 8]; /* read-only */
......
...@@ -395,21 +395,6 @@ struct pcibr_intr_wrap_s { ...@@ -395,21 +395,6 @@ struct pcibr_intr_wrap_s {
*/ */
#define PCIBR_WAR_ENABLED(pv, pcibr_soft) \ #define PCIBR_WAR_ENABLED(pv, pcibr_soft) \
((1 << XWIDGET_PART_REV_NUM_REV(pcibr_soft->bs_rev_num)) & pv) ((1 << XWIDGET_PART_REV_NUM_REV(pcibr_soft->bs_rev_num)) & pv)
/*
* Defines for individual WARs. Each is a bitmask of applicable
* part revision numbers. (1 << 1) == rev A, (1 << 2) == rev B,
* (3 << 1) == (rev A or rev B), etc
*/
#define PV854697 (~0) /* PIC: write 64bit regs as 64bits. permanent */
#define PV854827 (~0) /* PIC: fake widget 0xf presence bit. permanent */
#define PV855271 (1 << 1) /* PIC: use virt chan iff 64-bit device. */
#define PV878674 (~0) /* PIC: Dont allow 64bit PIOs. permanent */
#define PV855272 (1 << 1) /* PIC: runaway interrupt WAR */
#define PV856155 (1 << 1) /* PIC: arbitration WAR */
#define PV856864 (1 << 1) /* PIC: lower timeout to free TNUMs quicker */
#define PV856866 (1 << 1) /* PIC: avoid rrb's 0/1/8/9. */
#define PV862253 (1 << 1) /* PIC: don't enable write req RAM parity checking */
#define PV867308 (3 << 1) /* PIC: make LLP error interrupts FATAL for PIC */
/* defines for pcibr_soft_s->bs_bridge_mode */ /* defines for pcibr_soft_s->bs_bridge_mode */
#define PCIBR_BRIDGEMODE_PCI_33 0x0 #define PCIBR_BRIDGEMODE_PCI_33 0x0
......
...@@ -321,7 +321,7 @@ pciio_piomap_alloc_f (vertex_hdl_t dev, /* set up mapping for this device */ ...@@ -321,7 +321,7 @@ pciio_piomap_alloc_f (vertex_hdl_t dev, /* set up mapping for this device */
iopaddr_t pcipio_addr, /* starting address */ iopaddr_t pcipio_addr, /* starting address */
size_t byte_count, size_t byte_count,
size_t byte_count_max, /* maximum size of a mapping */ size_t byte_count_max, /* maximum size of a mapping */
unsigned flags); /* defined in sys/pio.h */ unsigned int flags); /* defined in sys/pio.h */
typedef void typedef void
pciio_piomap_free_f (pciio_piomap_t pciio_piomap); pciio_piomap_free_f (pciio_piomap_t pciio_piomap);
...@@ -340,7 +340,7 @@ pciio_piotrans_addr_f (vertex_hdl_t dev, /* translate for this device */ ...@@ -340,7 +340,7 @@ pciio_piotrans_addr_f (vertex_hdl_t dev, /* translate for this device */
pciio_space_t space, /* which address space */ pciio_space_t space, /* which address space */
iopaddr_t pciio_addr, /* starting address */ iopaddr_t pciio_addr, /* starting address */
size_t byte_count, /* map this many bytes */ size_t byte_count, /* map this many bytes */
unsigned flags); unsigned int flags);
typedef caddr_t typedef caddr_t
pciio_pio_addr_f (vertex_hdl_t dev, /* translate for this device */ pciio_pio_addr_f (vertex_hdl_t dev, /* translate for this device */
...@@ -349,7 +349,7 @@ pciio_pio_addr_f (vertex_hdl_t dev, /* translate for this device */ ...@@ -349,7 +349,7 @@ pciio_pio_addr_f (vertex_hdl_t dev, /* translate for this device */
iopaddr_t pciio_addr, /* starting address */ iopaddr_t pciio_addr, /* starting address */
size_t byte_count, /* map this many bytes */ size_t byte_count, /* map this many bytes */
pciio_piomap_t *mapp, /* in case a piomap was needed */ pciio_piomap_t *mapp, /* in case a piomap was needed */
unsigned flags); unsigned int flags);
typedef iopaddr_t typedef iopaddr_t
pciio_piospace_alloc_f (vertex_hdl_t dev, /* PIO space for this device */ pciio_piospace_alloc_f (vertex_hdl_t dev, /* PIO space for this device */
...@@ -370,7 +370,7 @@ typedef pciio_dmamap_t ...@@ -370,7 +370,7 @@ typedef pciio_dmamap_t
pciio_dmamap_alloc_f (vertex_hdl_t dev, /* set up mappings for this device */ pciio_dmamap_alloc_f (vertex_hdl_t dev, /* set up mappings for this device */
device_desc_t dev_desc, /* device descriptor */ device_desc_t dev_desc, /* device descriptor */
size_t byte_count_max, /* max size of a mapping */ size_t byte_count_max, /* max size of a mapping */
unsigned flags); /* defined in dma.h */ unsigned int flags); /* defined in dma.h */
typedef void typedef void
pciio_dmamap_free_f (pciio_dmamap_t dmamap); pciio_dmamap_free_f (pciio_dmamap_t dmamap);
...@@ -388,7 +388,7 @@ pciio_dmatrans_addr_f (vertex_hdl_t dev, /* translate for this device */ ...@@ -388,7 +388,7 @@ pciio_dmatrans_addr_f (vertex_hdl_t dev, /* translate for this device */
device_desc_t dev_desc, /* device descriptor */ device_desc_t dev_desc, /* device descriptor */
paddr_t paddr, /* system physical address */ paddr_t paddr, /* system physical address */
size_t byte_count, /* length */ size_t byte_count, /* length */
unsigned flags); /* defined in dma.h */ unsigned int flags); /* defined in dma.h */
typedef void typedef void
pciio_dmamap_drain_f (pciio_dmamap_t map); pciio_dmamap_drain_f (pciio_dmamap_t map);
...@@ -440,13 +440,13 @@ pciio_endian_set_f (vertex_hdl_t dev, /* specify endianness for this device ...@@ -440,13 +440,13 @@ pciio_endian_set_f (vertex_hdl_t dev, /* specify endianness for this device
typedef uint64_t typedef uint64_t
pciio_config_get_f (vertex_hdl_t conn, /* pci connection point */ pciio_config_get_f (vertex_hdl_t conn, /* pci connection point */
unsigned reg, /* register byte offset */ unsigned int reg, /* register byte offset */
unsigned size); /* width in bytes (1..4) */ unsigned int size); /* width in bytes (1..4) */
typedef void typedef void
pciio_config_set_f (vertex_hdl_t conn, /* pci connection point */ pciio_config_set_f (vertex_hdl_t conn, /* pci connection point */
unsigned reg, /* register byte offset */ unsigned int reg, /* register byte offset */
unsigned size, /* width in bytes (1..4) */ unsigned int size, /* width in bytes (1..4) */
uint64_t value); /* value to store */ uint64_t value); /* value to store */
typedef pciio_slot_t typedef pciio_slot_t
...@@ -578,7 +578,7 @@ extern int ...@@ -578,7 +578,7 @@ extern int
pciio_driver_register (pciio_vendor_id_t vendor_id, /* card's vendor number */ pciio_driver_register (pciio_vendor_id_t vendor_id, /* card's vendor number */
pciio_device_id_t device_id, /* card's device number */ pciio_device_id_t device_id, /* card's device number */
char *driver_prefix, /* driver prefix */ char *driver_prefix, /* driver prefix */
unsigned flags); unsigned int flags);
extern void extern void
pciio_error_register (vertex_hdl_t pconn, /* which slot */ pciio_error_register (vertex_hdl_t pconn, /* which slot */
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* All PCI providers set up PIO using this information. * All PCI providers set up PIO using this information.
*/ */
struct pciio_piomap_s { struct pciio_piomap_s {
unsigned pp_flags; /* PCIIO_PIOMAP flags */ unsigned int pp_flags; /* PCIIO_PIOMAP flags */
vertex_hdl_t pp_dev; /* associated pci card */ vertex_hdl_t pp_dev; /* associated pci card */
pciio_slot_t pp_slot; /* which slot the card is in */ pciio_slot_t pp_slot; /* which slot the card is in */
pciio_space_t pp_space; /* which address space */ pciio_space_t pp_space; /* which address space */
...@@ -33,7 +33,7 @@ struct pciio_piomap_s { ...@@ -33,7 +33,7 @@ struct pciio_piomap_s {
* All PCI providers set up DMA using this information. * All PCI providers set up DMA using this information.
*/ */
struct pciio_dmamap_s { struct pciio_dmamap_s {
unsigned pd_flags; /* PCIIO_DMAMAP flags */ unsigned int pd_flags; /* PCIIO_DMAMAP flags */
vertex_hdl_t pd_dev; /* associated pci card */ vertex_hdl_t pd_dev; /* associated pci card */
pciio_slot_t pd_slot; /* which slot the card is in */ pciio_slot_t pd_slot; /* which slot the card is in */
}; };
...@@ -43,7 +43,7 @@ struct pciio_dmamap_s { ...@@ -43,7 +43,7 @@ struct pciio_dmamap_s {
*/ */
struct pciio_intr_s { struct pciio_intr_s {
unsigned pi_flags; /* PCIIO_INTR flags */ unsigned int pi_flags; /* PCIIO_INTR flags */
vertex_hdl_t pi_dev; /* associated pci card */ vertex_hdl_t pi_dev; /* associated pci card */
device_desc_t pi_dev_desc; /* override device descriptor */ device_desc_t pi_dev_desc; /* override device descriptor */
pciio_intr_line_t pi_lines; /* which interrupt line(s) */ pciio_intr_line_t pi_lines; /* which interrupt line(s) */
......
...@@ -8,12 +8,9 @@ ...@@ -8,12 +8,9 @@
#ifndef _ASM_IA64_SN_PDA_H #ifndef _ASM_IA64_SN_PDA_H
#define _ASM_IA64_SN_PDA_H #define _ASM_IA64_SN_PDA_H
#include <linux/config.h>
#include <linux/cache.h> #include <linux/cache.h>
#include <asm/percpu.h> #include <asm/percpu.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/processor.h>
#include <asm/page.h>
#include <asm/sn/bte.h> #include <asm/sn/bte.h>
......
...@@ -8,9 +8,7 @@ ...@@ -8,9 +8,7 @@
#ifndef _ASM_IA64_SN_PIO_H #ifndef _ASM_IA64_SN_PIO_H
#define _ASM_IA64_SN_PIO_H #define _ASM_IA64_SN_PIO_H
#include <linux/types.h> #include <asm/sn/types.h>
#include <asm/sn/sgi.h>
#include <asm/sn/driver.h>
/* /*
* pioaddr_t - The kernel virtual address that a PIO can be done upon. * pioaddr_t - The kernel virtual address that a PIO can be done upon.
...@@ -18,7 +16,7 @@ ...@@ -18,7 +16,7 @@
* to long mostly, just cast for other sizes. * to long mostly, just cast for other sizes.
*/ */
typedef volatile ulong* pioaddr_t; typedef volatile unsigned long* pioaddr_t;
/* /*
* iopaddr_t - the physical io space relative address (e.g. VME A16S 0x0800). * iopaddr_t - the physical io space relative address (e.g. VME A16S 0x0800).
......
...@@ -14,8 +14,6 @@ ...@@ -14,8 +14,6 @@
#include <asm/sn/types.h> #include <asm/sn/types.h>
#include <asm/uaccess.h> /* for copy_??_user */ #include <asm/uaccess.h> /* for copy_??_user */
#include <linux/mm.h>
#include <linux/fs.h>
#include <asm/sn/hwgfs.h> #include <asm/sn/hwgfs.h>
typedef hwgfs_handle_t vertex_hdl_t; typedef hwgfs_handle_t vertex_hdl_t;
...@@ -44,6 +42,21 @@ typedef enum graph_error_e { ...@@ -44,6 +42,21 @@ typedef enum graph_error_e {
#define CPU_NONE (-1) #define CPU_NONE (-1)
#define GRAPH_VERTEX_NONE ((vertex_hdl_t)-1) #define GRAPH_VERTEX_NONE ((vertex_hdl_t)-1)
/*
* Defines for individual WARs. Each is a bitmask of applicable
* part revision numbers. (1 << 1) == rev A, (1 << 2) == rev B,
* (3 << 1) == (rev A or rev B), etc
*/
#define PV854697 (~0) /* PIC: write 64bit regs as 64bits. permanent */
#define PV854827 (~0UL) /* PIC: fake widget 0xf presence bit. permanent */
#define PV855271 (1 << 1) /* PIC: use virt chan iff 64-bit device. */
#define PV878674 (~0) /* PIC: Dont allow 64bit PIOs. permanent */
#define PV855272 (1 << 1) /* PIC: runaway interrupt WAR */
#define PV856155 (1 << 1) /* PIC: arbitration WAR */
#define PV856864 (1 << 1) /* PIC: lower timeout to free TNUMs quicker */
#define PV856866 (1 << 1) /* PIC: avoid rrb's 0/1/8/9. */
#define PV862253 (1 << 1) /* PIC: don't enable write req RAM parity checking */
#define PV867308 (3 << 1) /* PIC: make LLP error interrupts FATAL for PIC */
/* /*
* No code is complete without an Assertion macro * No code is complete without an Assertion macro
......
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
#ifndef _ASM_IA64_SN_SN2_ARCH_H #ifndef _ASM_IA64_SN_SN2_ARCH_H
#define _ASM_IA64_SN_SN2_ARCH_H #define _ASM_IA64_SN_SN2_ARCH_H
#include <asm/types.h>
#define CPUS_PER_NODE 4 /* CPUs on a single hub */ #define CPUS_PER_NODE 4 /* CPUs on a single hub */
#define CPUS_PER_SUBNODE 4 /* CPUs on a single hub PI */ #define CPUS_PER_SUBNODE 4 /* CPUs on a single hub PI */
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#ifndef _ASM_IA64_SN_SN2_SN_PRIVATE_H #ifndef _ASM_IA64_SN_SN2_SN_PRIVATE_H
#define _ASM_IA64_SN_SN2_SN_PRIVATE_H #define _ASM_IA64_SN_SN2_SN_PRIVATE_H
#include <linux/wait.h>
#include <asm/sn/nodepda.h> #include <asm/sn/nodepda.h>
#include <asm/sn/io.h> #include <asm/sn/io.h>
#include <asm/sn/xtalk/xwidget.h> #include <asm/sn/xtalk/xwidget.h>
...@@ -20,7 +21,7 @@ extern void he_arcs_set_vectors(void); ...@@ -20,7 +21,7 @@ extern void he_arcs_set_vectors(void);
extern void mem_init(void); extern void mem_init(void);
extern void cpu_unenable(cpuid_t); extern void cpu_unenable(cpuid_t);
extern nasid_t get_lowest_nasid(void); extern nasid_t get_lowest_nasid(void);
extern __psunsigned_t get_master_bridge_base(void); extern unsigned long get_master_bridge_base(void);
extern int check_nasid_equiv(nasid_t, nasid_t); extern int check_nasid_equiv(nasid_t, nasid_t);
extern char get_console_pcislot(void); extern char get_console_pcislot(void);
...@@ -28,7 +29,7 @@ extern int is_master_baseio_nasid_widget(nasid_t test_nasid, ...@@ -28,7 +29,7 @@ extern int is_master_baseio_nasid_widget(nasid_t test_nasid,
xwidgetnum_t test_wid); xwidgetnum_t test_wid);
/* memsupport.c */ /* memsupport.c */
extern void poison_state_alter_range(__psunsigned_t start, int len, int poison); extern void poison_state_alter_range(unsigned long start, int len, int poison);
extern int memory_present(paddr_t); extern int memory_present(paddr_t);
extern int memory_read_accessible(paddr_t); extern int memory_read_accessible(paddr_t);
extern int memory_write_accessible(paddr_t); extern int memory_write_accessible(paddr_t);
...@@ -86,7 +87,7 @@ void install_klidbg_functions(void); ...@@ -86,7 +87,7 @@ void install_klidbg_functions(void);
/* klnuma.c */ /* klnuma.c */
extern void replicate_kernel_text(int numnodes); extern void replicate_kernel_text(int numnodes);
extern __psunsigned_t get_freemem_start(cnodeid_t cnode); extern unsigned long get_freemem_start(cnodeid_t cnode);
extern void setup_replication_mask(int maxnodes); extern void setup_replication_mask(int maxnodes);
/* init.c */ /* init.c */
...@@ -109,7 +110,7 @@ extern int check_ni_errors(void); ...@@ -109,7 +110,7 @@ extern int check_ni_errors(void);
/* Used for debugger to signal upper software a breakpoint has taken place */ /* Used for debugger to signal upper software a breakpoint has taken place */
extern void *debugger_update; extern void *debugger_update;
extern __psunsigned_t debugger_stopped; extern unsigned long debugger_stopped;
/* /*
* piomap, created by shub_pio_alloc. * piomap, created by shub_pio_alloc.
...@@ -234,9 +235,6 @@ extern void sysctlr_keepalive(void); ...@@ -234,9 +235,6 @@ extern void sysctlr_keepalive(void);
#define paddr_cnode(_pa) (NASID_TO_COMPACT_NODEID(NASID_GET(_pa))) #define paddr_cnode(_pa) (NASID_TO_COMPACT_NODEID(NASID_GET(_pa)))
extern void membank_pathname_get(paddr_t, char *); extern void membank_pathname_get(paddr_t, char *);
/* To redirect the output into the error buffer */
#define errbuf_print(_s) printf("#%s",_s)
extern void crbx(nasid_t nasid, void (*pf) (char *, ...)); extern void crbx(nasid_t nasid, void (*pf) (char *, ...));
void bootstrap(void); void bootstrap(void);
......
...@@ -13,12 +13,8 @@ ...@@ -13,12 +13,8 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/sched.h>
#include <linux/mmzone.h>
#include <asm/sn/types.h>
#include <asm/current.h>
#include <asm/nodedata.h>
#include <asm/sn/pda.h> #include <asm/sn/pda.h>
#include <asm/intrinsics.h>
/* /*
......
...@@ -8,11 +8,6 @@ ...@@ -8,11 +8,6 @@
#ifndef _ASM_IA64_SN_SN_PRIVATE_H #ifndef _ASM_IA64_SN_SN_PRIVATE_H
#define _ASM_IA64_SN_SN_PRIVATE_H #define _ASM_IA64_SN_SN_PRIVATE_H
#include <linux/config.h>
#include <asm/sn/nodepda.h>
#include <asm/sn/xtalk/xwidget.h>
#include <asm/sn/xtalk/xtalk_private.h>
#include <asm/sn/sn2/sn_private.h> #include <asm/sn/sn2/sn_private.h>
#endif /* _ASM_IA64_SN_SN_PRIVATE_H */ #endif /* _ASM_IA64_SN_SN_PRIVATE_H */
...@@ -9,21 +9,15 @@ ...@@ -9,21 +9,15 @@
#ifndef _ASM_IA64_SN_TYPES_H #ifndef _ASM_IA64_SN_TYPES_H
#define _ASM_IA64_SN_TYPES_H #define _ASM_IA64_SN_TYPES_H
#include <linux/config.h>
#include <linux/types.h>
typedef unsigned long cpuid_t; typedef unsigned long cpuid_t;
typedef signed short nasid_t; /* node id in numa-as-id space */ typedef signed short nasid_t; /* node id in numa-as-id space */
typedef signed char partid_t; /* partition ID type */ typedef signed char partid_t; /* partition ID type */
typedef unsigned int moduleid_t; /* user-visible module number type */ typedef unsigned int moduleid_t; /* user-visible module number type */
typedef unsigned int cmoduleid_t; /* kernel compact module id type */ typedef unsigned int cmoduleid_t; /* kernel compact module id type */
typedef signed char slabid_t; typedef signed char slabid_t;
typedef unsigned char clusterid_t; /* Clusterid of the cell */ typedef unsigned char clusterid_t; /* Clusterid of the cell */
typedef uint64_t __psunsigned_t;
typedef unsigned long iopaddr_t; typedef unsigned long iopaddr_t;
typedef unsigned char uchar_t;
typedef unsigned long paddr_t; typedef unsigned long paddr_t;
typedef unsigned long pfn_t; typedef unsigned long pfn_t;
typedef short cnodeid_t; typedef short cnodeid_t;
......
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
#ifndef _ASM_IA64_SN_VECTOR_H #ifndef _ASM_IA64_SN_VECTOR_H
#define _ASM_IA64_SN_VECTOR_H #define _ASM_IA64_SN_VECTOR_H
#include <linux/config.h>
#define NET_VEC_NULL ((net_vec_t) 0) #define NET_VEC_NULL ((net_vec_t) 0)
#define NET_VEC_BAD ((net_vec_t) -1) #define NET_VEC_BAD ((net_vec_t) -1)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* xbow.h - header file for crossbow chip and xbow section of xbridge * xbow.h - header file for crossbow chip and xbow section of xbridge
*/ */
#include <linux/config.h> #include <asm/types.h>
#include <asm/sn/xtalk/xtalk.h> #include <asm/sn/xtalk/xtalk.h>
#include <asm/sn/xtalk/xwidget.h> #include <asm/sn/xtalk/xwidget.h>
#include <asm/sn/xtalk/xswitch.h> #include <asm/sn/xtalk/xswitch.h>
...@@ -55,12 +55,6 @@ ...@@ -55,12 +55,6 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
typedef uint32_t xbowreg_t; typedef uint32_t xbowreg_t;
#define XBOWCONST (xbowreg_t)
/* Generic xbow register, given base and offset */
#define XBOW_REG_PTR(base, offset) ((volatile xbowreg_t*) \
((__psunsigned_t)(base) + (__psunsigned_t)(offset)))
/* Register set for each xbow link */ /* Register set for each xbow link */
typedef volatile struct xb_linkregs_s { typedef volatile struct xb_linkregs_s {
/* /*
...@@ -224,14 +218,6 @@ typedef struct xbow_cfg_s { ...@@ -224,14 +218,6 @@ typedef struct xbow_cfg_s {
/* of the widget0 address space (before 0xf4) */ /* of the widget0 address space (before 0xf4) */
#define XBOW_WID_UNDEF 0xe4 #define XBOW_WID_UNDEF 0xe4
/* pointer to link arbitration register, given xbow base, dst and src widget id */
#define XBOW_PRIO_ARBREG_PTR(base, dst_wid, src_wid) \
XBOW_REG_PTR(XBOW_PRIO_LINKREGS_PTR(base, dst_wid), XBOW_ARB_OFF(src_wid))
/* pointer to link registers base, given xbow base and destination widget id */
#define XBOW_PRIO_LINKREGS_PTR(base, dst_wid) (xb_linkregs_t*) \
XBOW_REG_PTR(base, XB_LINK_REG_BASE(dst_wid))
/* xbow link register set base, legal value for x is 0x8..0xf */ /* xbow link register set base, legal value for x is 0x8..0xf */
#define XB_LINK_BASE 0x100 #define XB_LINK_BASE 0x100
#define XB_LINK_OFFSET 0x40 #define XB_LINK_OFFSET 0x40
...@@ -356,9 +342,6 @@ typedef struct xbow_cfg_s { ...@@ -356,9 +342,6 @@ typedef struct xbow_cfg_s {
XWIDGET_MFG_NUM(wid) == XXBOW_WIDGET_MFGR_NUM) XWIDGET_MFG_NUM(wid) == XXBOW_WIDGET_MFGR_NUM)
#define XBOW_WAR_ENABLED(pv, widid) ((1 << XWIDGET_REV_NUM(widid)) & pv) #define XBOW_WAR_ENABLED(pv, widid) ((1 << XWIDGET_REV_NUM(widid)) & pv)
#define PV854827 (~0) /* PIC: fake widget 0xf presence bit. permanent */
#define PV863579 (1 << 1) /* PIC: PIO to PIC register */
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/* /*
......
...@@ -94,7 +94,7 @@ xtalk_piomap_alloc_f (vertex_hdl_t dev, /* set up mapping for this device */ ...@@ -94,7 +94,7 @@ xtalk_piomap_alloc_f (vertex_hdl_t dev, /* set up mapping for this device */
iopaddr_t xtalk_addr, /* map for this xtalk_addr range */ iopaddr_t xtalk_addr, /* map for this xtalk_addr range */
size_t byte_count, size_t byte_count,
size_t byte_count_max, /* maximum size of a mapping */ size_t byte_count_max, /* maximum size of a mapping */
unsigned flags); /* defined in sys/pio.h */ unsigned int flags); /* defined in sys/pio.h */
typedef void typedef void
xtalk_piomap_free_f (xtalk_piomap_t xtalk_piomap); xtalk_piomap_free_f (xtalk_piomap_t xtalk_piomap);
...@@ -111,7 +111,7 @@ xtalk_piotrans_addr_f (vertex_hdl_t dev, /* translate for this device */ ...@@ -111,7 +111,7 @@ xtalk_piotrans_addr_f (vertex_hdl_t dev, /* translate for this device */
device_desc_t dev_desc, /* device descriptor */ device_desc_t dev_desc, /* device descriptor */
iopaddr_t xtalk_addr, /* Crosstalk address */ iopaddr_t xtalk_addr, /* Crosstalk address */
size_t byte_count, /* map this many bytes */ size_t byte_count, /* map this many bytes */
unsigned flags); /* (currently unused) */ unsigned int flags); /* (currently unused) */
extern caddr_t extern caddr_t
xtalk_pio_addr (vertex_hdl_t dev, /* translate for this device */ xtalk_pio_addr (vertex_hdl_t dev, /* translate for this device */
...@@ -119,7 +119,7 @@ xtalk_pio_addr (vertex_hdl_t dev, /* translate for this device */ ...@@ -119,7 +119,7 @@ xtalk_pio_addr (vertex_hdl_t dev, /* translate for this device */
iopaddr_t xtalk_addr, /* Crosstalk address */ iopaddr_t xtalk_addr, /* Crosstalk address */
size_t byte_count, /* map this many bytes */ size_t byte_count, /* map this many bytes */
xtalk_piomap_t *xtalk_piomapp, /* RETURNS mapping resources */ xtalk_piomap_t *xtalk_piomapp, /* RETURNS mapping resources */
unsigned flags); /* (currently unused) */ unsigned int flags); /* (currently unused) */
/* DMA MANAGEMENT */ /* DMA MANAGEMENT */
...@@ -129,7 +129,7 @@ typedef xtalk_dmamap_t ...@@ -129,7 +129,7 @@ typedef xtalk_dmamap_t
xtalk_dmamap_alloc_f (vertex_hdl_t dev, /* set up mappings for this device */ xtalk_dmamap_alloc_f (vertex_hdl_t dev, /* set up mappings for this device */
device_desc_t dev_desc, /* device descriptor */ device_desc_t dev_desc, /* device descriptor */
size_t byte_count_max, /* max size of a mapping */ size_t byte_count_max, /* max size of a mapping */
unsigned flags); /* defined in dma.h */ unsigned int flags); /* defined in dma.h */
typedef void typedef void
xtalk_dmamap_free_f (xtalk_dmamap_t dmamap); xtalk_dmamap_free_f (xtalk_dmamap_t dmamap);
...@@ -142,7 +142,7 @@ xtalk_dmamap_addr_f (xtalk_dmamap_t dmamap, /* use these mapping resources ...@@ -142,7 +142,7 @@ xtalk_dmamap_addr_f (xtalk_dmamap_t dmamap, /* use these mapping resources
typedef alenlist_t typedef alenlist_t
xtalk_dmamap_list_f (xtalk_dmamap_t dmamap, /* use these mapping resources */ xtalk_dmamap_list_f (xtalk_dmamap_t dmamap, /* use these mapping resources */
alenlist_t alenlist, /* map this address/length list */ alenlist_t alenlist, /* map this address/length list */
unsigned flags); unsigned int flags);
typedef void typedef void
xtalk_dmamap_done_f (xtalk_dmamap_t dmamap); xtalk_dmamap_done_f (xtalk_dmamap_t dmamap);
...@@ -152,13 +152,13 @@ xtalk_dmatrans_addr_f (vertex_hdl_t dev, /* translate for this device */ ...@@ -152,13 +152,13 @@ xtalk_dmatrans_addr_f (vertex_hdl_t dev, /* translate for this device */
device_desc_t dev_desc, /* device descriptor */ device_desc_t dev_desc, /* device descriptor */
paddr_t paddr, /* system physical address */ paddr_t paddr, /* system physical address */
size_t byte_count, /* length */ size_t byte_count, /* length */
unsigned flags); unsigned int flags);
typedef alenlist_t typedef alenlist_t
xtalk_dmatrans_list_f (vertex_hdl_t dev, /* translate for this device */ xtalk_dmatrans_list_f (vertex_hdl_t dev, /* translate for this device */
device_desc_t dev_desc, /* device descriptor */ device_desc_t dev_desc, /* device descriptor */
alenlist_t palenlist, /* system address/length list */ alenlist_t palenlist, /* system address/length list */
unsigned flags); unsigned int flags);
typedef void typedef void
xtalk_dmamap_drain_f (xtalk_dmamap_t map); /* drain this map's channel */ xtalk_dmamap_drain_f (xtalk_dmamap_t map); /* drain this map's channel */
...@@ -243,7 +243,7 @@ xtalk_early_piotrans_addr_f (xwidget_part_num_t part_num, ...@@ -243,7 +243,7 @@ xtalk_early_piotrans_addr_f (xwidget_part_num_t part_num,
int which, int which,
iopaddr_t xtalk_addr, iopaddr_t xtalk_addr,
size_t byte_count, size_t byte_count,
unsigned flags); unsigned int flags);
/* /*
* Adapters that provide a crosstalk interface adhere to this software interface. * Adapters that provide a crosstalk interface adhere to this software interface.
......
...@@ -139,17 +139,17 @@ typedef volatile struct widget_cfg { ...@@ -139,17 +139,17 @@ typedef volatile struct widget_cfg {
} widget_cfg_t; } widget_cfg_t;
typedef struct { typedef struct {
unsigned other:8; unsigned int other:8;
unsigned bo:1; unsigned int bo:1;
unsigned error:1; unsigned int error:1;
unsigned vbpm:1; unsigned int vbpm:1;
unsigned gbr:1; unsigned int gbr:1;
unsigned ds:2; unsigned int ds:2;
unsigned ct:1; unsigned int ct:1;
unsigned tnum:5; unsigned int tnum:5;
unsigned pactyp:4; unsigned int pactyp:4;
unsigned sidn:4; unsigned int sidn:4;
unsigned didn:4; unsigned int didn:4;
} w_err_cmd_word_f; } w_err_cmd_word_f;
typedef union { typedef union {
...@@ -188,7 +188,7 @@ typedef struct xwidget_hwid_s { ...@@ -188,7 +188,7 @@ typedef struct xwidget_hwid_s {
extern int xwidget_driver_register(xwidget_part_num_t part_num, extern int xwidget_driver_register(xwidget_part_num_t part_num,
xwidget_mfg_num_t mfg_num, xwidget_mfg_num_t mfg_num,
char *driver_prefix, char *driver_prefix,
unsigned flags); unsigned int flags);
extern void xwidget_driver_unregister(char *driver_prefix); extern void xwidget_driver_unregister(char *driver_prefix);
...@@ -230,7 +230,7 @@ extern xwidgetnum_t hub_widget_id(nasid_t); ...@@ -230,7 +230,7 @@ extern xwidgetnum_t hub_widget_id(nasid_t);
* However, since nobody looks inside ... * However, since nobody looks inside ...
*/ */
typedef struct v_widget_s { typedef struct v_widget_s {
unsigned v_widget_s_is_really_empty; unsigned int v_widget_s_is_really_empty;
#define v_widget_s_is_really_empty and using this would be a syntax error. #define v_widget_s_is_really_empty and using this would be a syntax error.
} v_widget_t; } v_widget_t;
#endif /* _KERNEL */ #endif /* _KERNEL */
......
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