From 83ffe4f01035b31fa0cbc8c3705dea5d20cf58f9 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Wed, 20 Oct 2004 20:40:02 +0000 Subject: [IA64-SGI] sparse cleanups & misc fixes for sn2 This is a big patch mostly because I trimmed shub_mmr.h down from 17M to 11k or so. It fixes a number of things sparse discovered and removes some dead code, fixes up some prototypes, etc. Of note: o sn_proc_fs.c was directly dereferencing user pointers, fixed o sn_hwperf.c was missing an include and was using asm-ia64 directly o the I/O routines were all missing proper sparse annotations o dead code in prominfo_proc.c has been removed o fix generic build by putting numionodes into asm/sn/io.h With this patch applied, the check build is pretty clean. The sn_console bit depends on some of the other changes, so it's included here. Signed-off-by: Jesse Barnes Signed-off-by: Tony Luck --- include/asm-ia64/machvec.h | 16 +- include/asm-ia64/sn/addrs.h | 34 +- include/asm-ia64/sn/io.h | 16 +- include/asm-ia64/sn/shub_mmr.h | 31663 +-------------------------------------- 4 files changed, 166 insertions(+), 31563 deletions(-) (limited to 'include') diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h index ff881e2bf9fe..0f197006d100 100644 --- a/include/asm-ia64/machvec.h +++ b/include/asm-ia64/machvec.h @@ -62,14 +62,14 @@ typedef unsigned int ia64_mv_inl_t (unsigned long); typedef void ia64_mv_outb_t (unsigned char, unsigned long); typedef void ia64_mv_outw_t (unsigned short, unsigned long); typedef void ia64_mv_outl_t (unsigned int, unsigned long); -typedef unsigned char ia64_mv_readb_t (void *); -typedef unsigned short ia64_mv_readw_t (void *); -typedef unsigned int ia64_mv_readl_t (void *); -typedef unsigned long ia64_mv_readq_t (void *); -typedef unsigned char ia64_mv_readb_relaxed_t (void *); -typedef unsigned short ia64_mv_readw_relaxed_t (void *); -typedef unsigned int ia64_mv_readl_relaxed_t (void *); -typedef unsigned long ia64_mv_readq_relaxed_t (void *); +typedef unsigned char ia64_mv_readb_t (void __iomem *); +typedef unsigned short ia64_mv_readw_t (void __iomem *); +typedef unsigned int ia64_mv_readl_t (void __iomem *); +typedef unsigned long ia64_mv_readq_t (void __iomem *); +typedef unsigned char ia64_mv_readb_relaxed_t (void __iomem *); +typedef unsigned short ia64_mv_readw_relaxed_t (void __iomem *); +typedef unsigned int ia64_mv_readl_relaxed_t (void __iomem *); +typedef unsigned long ia64_mv_readq_relaxed_t (void __iomem *); static inline void machvec_noop (void) diff --git a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h index 3ad100b8d873..1220d1f122d1 100644 --- a/include/asm-ia64/sn/addrs.h +++ b/include/asm-ia64/sn/addrs.h @@ -69,27 +69,27 @@ typedef union ia64_sn2_pa { } ia64_sn2_pa_t; #endif -#define TO_PHYS_MASK 0x0001ffcfffffffff /* Note - clear AS bits */ +#define TO_PHYS_MASK 0x0001ffcfffffffffUL /* Note - clear AS bits */ /* Regions determined by AS */ -#define LOCAL_MMR_SPACE 0xc000008000000000 /* Local MMR space */ -#define LOCAL_PHYS_MMR_SPACE 0x8000008000000000 /* Local PhysicalMMR space */ -#define LOCAL_MEM_SPACE 0xc000010000000000 /* Local Memory space */ +#define LOCAL_MMR_SPACE 0xc000008000000000UL /* Local MMR space */ +#define LOCAL_PHYS_MMR_SPACE 0x8000008000000000UL /* Local PhysicalMMR space */ +#define LOCAL_MEM_SPACE 0xc000010000000000UL /* Local Memory space */ /* It so happens that setting bit 35 indicates a reference to the SHUB or TIO * MMR space. */ -#define GLOBAL_MMR_SPACE 0xc000000800000000 /* Global MMR space */ -#define TIO_MMR_SPACE 0xc000000800000000 /* TIO MMR space */ -#define ICE_MMR_SPACE 0xc000000000000000 /* ICE MMR space */ -#define GLOBAL_PHYS_MMR_SPACE 0x0000000800000000 /* Global Physical MMR space */ -#define GET_SPACE 0xe000001000000000 /* GET space */ -#define AMO_SPACE 0xc000002000000000 /* AMO space */ -#define CACHEABLE_MEM_SPACE 0xe000003000000000 /* Cacheable memory space */ -#define UNCACHED 0xc000000000000000 /* UnCacheable memory space */ -#define UNCACHED_PHYS 0x8000000000000000 /* UnCacheable physical memory space */ - -#define PHYS_MEM_SPACE 0x0000003000000000 /* physical memory space */ +#define GLOBAL_MMR_SPACE 0xc000000800000000UL /* Global MMR space */ +#define TIO_MMR_SPACE 0xc000000800000000UL /* TIO MMR space */ +#define ICE_MMR_SPACE 0xc000000000000000UL /* ICE MMR space */ +#define GLOBAL_PHYS_MMR_SPACE 0x0000000800000000UL /* Global Physical MMR space */ +#define GET_SPACE 0xe000001000000000UL /* GET space */ +#define AMO_SPACE 0xc000002000000000UL /* AMO space */ +#define CACHEABLE_MEM_SPACE 0xe000003000000000UL /* Cacheable memory space */ +#define UNCACHED 0xc000000000000000UL /* UnCacheable memory space */ +#define UNCACHED_PHYS 0x8000000000000000UL /* UnCacheable physical memory space */ + +#define PHYS_MEM_SPACE 0x0000003000000000UL /* physical memory space */ /* SN2 address macros */ /* NID_SHFT has the right value for both SHUB and TIO addresses.*/ @@ -105,7 +105,7 @@ typedef union ia64_sn2_pa { #define GLOBAL_MEM_ADDR(n,a) (CACHEABLE_MEM_SPACE | REMOTE_ADDR(n,a)) /* non-II mmr's start at top of big window space (4G) */ -#define BWIN_TOP 0x0000000100000000 +#define BWIN_TOP 0x0000000100000000UL /* * general address defines - for code common to SN0/SN1/SN2 @@ -256,7 +256,7 @@ typedef union ia64_sn2_pa { (((~(_x)) & BWIN_TOP)>>9) | (_x)) #define REMOTE_HUB(_n, _x) \ - ((volatile uint64_t *)(REMOTE_HUB_BASE(_x) | ((((long)(_n))<