diff options
| author | Len Brown <len.brown@intel.com> | 2004-02-05 12:21:02 -0500 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2004-02-05 12:21:02 -0500 |
| commit | 151fa98b00778e62ebb74f8dd64a0f0cff9997ac (patch) | |
| tree | b50419187097dcb135c2c1f6bfa4e1429264fc36 /include | |
| parent | cbd884c9feafad7e29214eeaee9a36e48053d31a (diff) | |
| parent | 12a981f8fd62fb34823626844a5c76d6614055fe (diff) | |
Merge intel.com:/home/lenb/bk/linux-2.6.3
into intel.com:/home/lenb/src/linux-acpi-test-2.6.3
Diffstat (limited to 'include')
161 files changed, 1341 insertions, 1609 deletions
diff --git a/include/asm-alpha/byteorder.h b/include/asm-alpha/byteorder.h index ddf4e740e72a..e5179c55920c 100644 --- a/include/asm-alpha/byteorder.h +++ b/include/asm-alpha/byteorder.h @@ -6,7 +6,7 @@ #ifdef __GNUC__ -static __inline __u32 __attribute__((__const)) __arch__swab32(__u32 x) +static __inline __u32 __attribute_const__ __arch__swab32(__u32 x) { /* * Unfortunately, we can't use the 6 instruction sequence diff --git a/include/asm-alpha/io.h b/include/asm-alpha/io.h index e1646aff4e31..fccb0fa8c6a1 100644 --- a/include/asm-alpha/io.h +++ b/include/asm-alpha/io.h @@ -412,6 +412,11 @@ extern void ___raw_writeq(u64 b, unsigned long addr); # define readq(a) _readq((unsigned long)(a)) #endif +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) +#define readq_relaxed(addr) readq(addr) + #ifndef writeb # define writeb(v,a) _writeb((v),(unsigned long)(a)) #endif diff --git a/include/asm-alpha/mmzone.h b/include/asm-alpha/mmzone.h index 36e3130c6696..ce75633b5052 100644 --- a/include/asm-alpha/mmzone.h +++ b/include/asm-alpha/mmzone.h @@ -72,9 +72,8 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n) ((unsigned long)__va(NODE_DATA(kvaddr_to_nid(kaddr))->node_start_pfn \ << PAGE_SHIFT)) -#define kern_addr_valid(kaddr) \ - test_bit(local_mapnr(kaddr), \ - NODE_DATA(kvaddr_to_nid(kaddr))->valid_addr_bitmap) +/* XXX: FIXME -- wli */ +#define kern_addr_valid(kaddr) (0) #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h index 2289a5350d41..faeee0303518 100644 --- a/include/asm-alpha/pci.h +++ b/include/asm-alpha/pci.h @@ -51,6 +51,7 @@ struct pci_controller { bus numbers. */ #define pcibios_assign_all_busses() 1 +#define pcibios_scan_all_fns(a, b) 0 #define PCIBIOS_MIN_IO alpha_mv.min_io_address #define PCIBIOS_MIN_MEM alpha_mv.min_mem_address diff --git a/include/asm-alpha/topology.h b/include/asm-alpha/topology.h index dbdb0d4f90e1..65a6a2e8b6a1 100644 --- a/include/asm-alpha/topology.h +++ b/include/asm-alpha/topology.h @@ -39,9 +39,6 @@ static inline int node_to_cpumask(int node) return node_cpu_mask; } -# define node_to_memblk(node) (node) -# define memblk_to_node(memblk) (memblk) - /* Cross-node load balancing interval. */ # define NODE_BALANCE_RATE 10 diff --git a/include/asm-arm/arch-ebsa110/io.h b/include/asm-arm/arch-ebsa110/io.h index ff7221d68205..a7a1d4c1871b 100644 --- a/include/asm-arm/arch-ebsa110/io.h +++ b/include/asm-arm/arch-ebsa110/io.h @@ -38,6 +38,9 @@ u32 __readl(void *addr); #define readb(b) __readb(b) #define readw(b) __readw(b) #define readl(b) __readl(b) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) void __writeb(u8 val, void *addr); void __writew(u16 val, void *addr); diff --git a/include/asm-arm/current.h b/include/asm-arm/current.h index b3d68cd03f73..75d21e2a3ff7 100644 --- a/include/asm-arm/current.h +++ b/include/asm-arm/current.h @@ -3,7 +3,7 @@ #include <linux/thread_info.h> -static inline struct task_struct *get_current(void) __attribute__ (( __const__ )); +static inline struct task_struct *get_current(void) __attribute_const__; static inline struct task_struct *get_current(void) { diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index 8bb0d5e1cc9a..9d7b1be3ad0f 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h @@ -149,6 +149,9 @@ extern void _memset_io(unsigned long, int, size_t); #define readb(c) ({ unsigned int __v = __raw_readb(__mem_pci(c)); __v; }) #define readw(c) ({ unsigned int __v = le16_to_cpu(__raw_readw(__mem_pci(c))); __v; }) #define readl(c) ({ unsigned int __v = le32_to_cpu(__raw_readl(__mem_pci(c))); __v; }) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) #define readsb(p,d,l) __raw_readsb((unsigned int)__mem_pci(p),d,l) #define readsw(p,d,l) __raw_readsw((unsigned int)__mem_pci(p),d,l) diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h index 67299aff947f..ac2ed843eefe 100644 --- a/include/asm-arm/pci.h +++ b/include/asm-arm/pci.h @@ -20,6 +20,8 @@ #endif +#define pcibios_scan_all_fns(a, b) 0 + static inline void pcibios_set_master(struct pci_dev *dev) { /* No special bus mastering setup handling */ diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h index 16a541206166..95e3c9c996d3 100644 --- a/include/asm-arm/thread_info.h +++ b/include/asm-arm/thread_info.h @@ -77,7 +77,7 @@ struct thread_info { /* * how to get the thread information struct from C */ -static inline struct thread_info *current_thread_info(void) __attribute__ (( __const__ )); +static inline struct thread_info *current_thread_info(void) __attribute_const__; static inline struct thread_info *current_thread_info(void) { diff --git a/include/asm-arm26/current.h b/include/asm-arm26/current.h index b3d68cd03f73..75d21e2a3ff7 100644 --- a/include/asm-arm26/current.h +++ b/include/asm-arm26/current.h @@ -3,7 +3,7 @@ #include <linux/thread_info.h> -static inline struct task_struct *get_current(void) __attribute__ (( __const__ )); +static inline struct task_struct *get_current(void) __attribute_const__; static inline struct task_struct *get_current(void) { diff --git a/include/asm-arm26/io.h b/include/asm-arm26/io.h index 95ab4f7551dd..d9885d087b44 100644 --- a/include/asm-arm26/io.h +++ b/include/asm-arm26/io.h @@ -308,6 +308,9 @@ DECLARE_IO(int,l,"") #define readb(c) (__readwrite_bug("readb"),0) #define readw(c) (__readwrite_bug("readw"),0) #define readl(c) (__readwrite_bug("readl"),0) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) #define writeb(v,c) __readwrite_bug("writeb") #define writew(v,c) __readwrite_bug("writew") #define writel(v,c) __readwrite_bug("writel") diff --git a/include/asm-arm26/pci.h b/include/asm-arm26/pci.h index ea14145f145a..6ac67ed7718c 100644 --- a/include/asm-arm26/pci.h +++ b/include/asm-arm26/pci.h @@ -1,5 +1,6 @@ /* Should not be needed. IDE stupidity */ /* JMA 18.05.03 - is kinda needed, if only to tell it we don't have a PCI bus */ -#define PCI_DMA_BUS_IS_PHYS 0 +#define PCI_DMA_BUS_IS_PHYS 0 +#define pcibios_scan_all_fns(a, b) 0 diff --git a/include/asm-arm26/thread_info.h b/include/asm-arm26/thread_info.h index 24c5136484fb..e57f9b2b17b7 100644 --- a/include/asm-arm26/thread_info.h +++ b/include/asm-arm26/thread_info.h @@ -71,7 +71,7 @@ struct thread_info { /* * how to get the thread information struct from C */ -static inline struct thread_info *current_thread_info(void) __attribute__ (( __const__ )); +static inline struct thread_info *current_thread_info(void) __attribute_const__; static inline struct thread_info *current_thread_info(void) { diff --git a/include/asm-cris/io.h b/include/asm-cris/io.h index 8604f0e9a69d..b89c1f93b5e3 100644 --- a/include/asm-cris/io.h +++ b/include/asm-cris/io.h @@ -42,6 +42,9 @@ extern void iounmap(void *addr); #define readb(addr) (*(volatile unsigned char *) (addr)) #define readw(addr) (*(volatile unsigned short *) (addr)) #define readl(addr) (*(volatile unsigned int *) (addr)) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) #define __raw_readb readb #define __raw_readw readw #define __raw_readl readl diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h index df757d240e9a..40cca57fe01e 100644 --- a/include/asm-generic/pci.h +++ b/include/asm-generic/pci.h @@ -22,4 +22,6 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, region->end = res->end; } +#define pcibios_scan_all_fns(a, b) 0 + #endif diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h index ba29df93e8eb..8f84159f0f4b 100644 --- a/include/asm-generic/topology.h +++ b/include/asm-generic/topology.h @@ -32,9 +32,6 @@ #ifndef cpu_to_node #define cpu_to_node(cpu) (0) #endif -#ifndef memblk_to_node -#define memblk_to_node(memblk) (0) -#endif #ifndef parent_node #define parent_node(node) (0) #endif @@ -44,9 +41,6 @@ #ifndef node_to_first_cpu #define node_to_first_cpu(node) (0) #endif -#ifndef node_to_memblk -#define node_to_memblk(node) (0) -#endif #ifndef pcibus_to_cpumask #define pcibus_to_cpumask(bus) (cpu_online_map) #endif diff --git a/include/asm-h8300/bitops.h b/include/asm-h8300/bitops.h index 30288d3ffe32..1d7382f84cb4 100644 --- a/include/asm-h8300/bitops.h +++ b/include/asm-h8300/bitops.h @@ -35,172 +35,151 @@ static __inline__ unsigned long ffz(unsigned long word) return result; } -static __inline__ void set_bit(int nr, volatile unsigned long* addr) -{ - volatile unsigned char *b_addr; - b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3); - __asm__("mov.l %1,er0\n\t" - "bset r0l,%0" - :"+m"(*b_addr) - :"g"(nr & 7),"m"(*b_addr) - :"er0"); +#define H8300_GEN_BITOP_CONST(OP,BIT) \ + case BIT: \ + __asm__(OP " #" #BIT ",@%0"::"r"(b_addr):"memory"); \ + break; + +#define H8300_GEN_BITOP(FNAME,OP) \ +static __inline__ void FNAME(int nr, volatile unsigned long* addr) \ +{ \ + volatile unsigned char *b_addr; \ + b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3); \ + if (__builtin_constant_p(nr)) { \ + switch(nr & 7) { \ + H8300_GEN_BITOP_CONST(OP,0) \ + H8300_GEN_BITOP_CONST(OP,1) \ + H8300_GEN_BITOP_CONST(OP,2) \ + H8300_GEN_BITOP_CONST(OP,3) \ + H8300_GEN_BITOP_CONST(OP,4) \ + H8300_GEN_BITOP_CONST(OP,5) \ + H8300_GEN_BITOP_CONST(OP,6) \ + H8300_GEN_BITOP_CONST(OP,7) \ + } \ + } else { \ + __asm__(OP " %w0,@%1"::"r"(nr),"r"(b_addr):"memory"); \ + } \ } -/* Bigendian is complexed... */ -#define __set_bit(nr, addr) set_bit((nr), (addr)) - /* * clear_bit() doesn't provide any barrier for the compiler. */ #define smp_mb__before_clear_bit() barrier() #define smp_mb__after_clear_bit() barrier() -static __inline__ void clear_bit(int nr, volatile unsigned long* addr) -{ - volatile unsigned char *b_addr; - b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3); - __asm__("mov.l %1,er0\n\t" - "bclr r0l,%0" - :"+m"(*b_addr) - :"g"(nr & 7),"m"(*b_addr) - :"er0"); -} - -#define __clear_bit(nr, addr) clear_bit((nr), (addr)) - -static __inline__ void change_bit(int nr, volatile unsigned long* addr) -{ - volatile unsigned char *b_addr; - b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3); - __asm__("mov.l %1,er0\n\t" - "bnot r0l,%0" - :"+m"(*b_addr) - :"g"(nr & 7),"m"(*b_addr) - :"er0"); -} +H8300_GEN_BITOP(set_bit ,"bset") +H8300_GEN_BITOP(clear_bit ,"bclr") +H8300_GEN_BITOP(change_bit,"bnot") +#define __set_bit(nr,addr) set_bit((nr),(addr)) +#define __clear_bit(nr,addr) clear_bit((nr),(addr)) +#define __change_bit(nr,addr) change_bit((nr),(addr)) -#define __change_bit(nr, addr) change_bit((nr), (addr)) +#undef H8300_GEN_BITOP +#undef H8300_GEN_BITOP_CONST static __inline__ int test_bit(int nr, const unsigned long* addr) { - return (*((volatile unsigned char *)addr + ((nr >> 3) ^ 3)) & (1UL << (nr & 7))) != 0; + return (*((volatile unsigned char *)addr + + ((nr >> 3) ^ 3)) & (1UL << (nr & 7))) != 0; } #define __test_bit(nr, addr) test_bit(nr, addr) -static __inline__ int test_and_set_bit(int nr, volatile unsigned long* addr) -{ - int retval = 0; - volatile unsigned char *a; - - a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3); \ - __asm__("mov.l %4,er3\n\t" - "stc ccr,r3h\n\t" - "orc #0x80,ccr\n\t" - "btst r3l,%1\n\t" - "bset r3l,%1\n\t" - "beq 1f\n\t" - "inc.l #1,%0\n\t" - "1:" - "ldc r3h,ccr" - : "=r"(retval),"+m"(*a) - : "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory"); - return retval; +#define H8300_GEN_TEST_BITOP_CONST_INT(OP,BIT) \ + case BIT: \ + __asm__("stc ccr,%w1\n\t" \ + "orc #0x80,ccr\n\t" \ + "bld #" #BIT ",@%3\n\t" \ + OP " #" #BIT ",@%3\n\t" \ + "rotxl.l %0\n\t" \ + "ldc %w1,ccr" \ + : "=r"(retval),"=&r"(ccrsave) \ + : "0" (retval),"r" (b_addr) \ + : "memory"); \ + break; + +#define H8300_GEN_TEST_BITOP_CONST(OP,BIT) \ + case BIT: \ + __asm__("bld #" #BIT ",@%2\n\t" \ + OP " #" #BIT ",@%2\n\t" \ + "rotxl.l %0\n\t" \ + : "=r"(retval) \ + : "0" (retval),"r" (b_addr) \ + : "memory"); \ + break; + +#define H8300_GEN_TEST_BITOP(FNNAME,OP) \ +static __inline__ int FNNAME(int nr, volatile void * addr) \ +{ \ + int retval = 0; \ + char ccrsave; \ + volatile unsigned char *b_addr; \ + b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3); \ + if (__builtin_constant_p(nr)) { \ + switch(nr & 7) { \ + H8300_GEN_TEST_BITOP_CONST_INT(OP,0) \ + H8300_GEN_TEST_BITOP_CONST_INT(OP,1) \ + H8300_GEN_TEST_BITOP_CONST_INT(OP,2) \ + H8300_GEN_TEST_BITOP_CONST_INT(OP,3) \ + H8300_GEN_TEST_BITOP_CONST_INT(OP,4) \ + H8300_GEN_TEST_BITOP_CONST_INT(OP,5) \ + H8300_GEN_TEST_BITOP_CONST_INT(OP,6) \ + H8300_GEN_TEST_BITOP_CONST_INT(OP,7) \ + } \ + } else { \ + __asm__("stc ccr,%w1\n\t" \ + "orc #0x80,ccr\n\t" \ + "btst %w4,@%3\n\t" \ + OP " %w4,@%3\n\t" \ + "beq 1f\n\t" \ + "inc.l #1,%0\n" \ + "1:\n\t" \ + "ldc %w1,ccr" \ + : "=r"(retval),"=&r"(ccrsave) \ + : "0" (retval),"r" (b_addr),"r"(nr) \ + : "memory"); \ + } \ + return retval; \ +} \ + \ +static __inline__ int __ ## FNNAME(int nr, volatile void * addr) \ +{ \ + int retval = 0; \ + volatile unsigned char *b_addr; \ + b_addr = (volatile unsigned char *)addr + ((nr >> 3) ^ 3); \ + if (__builtin_constant_p(nr)) { \ + switch(nr & 7) { \ + H8300_GEN_TEST_BITOP_CONST(OP,0) \ + H8300_GEN_TEST_BITOP_CONST(OP,1) \ + H8300_GEN_TEST_BITOP_CONST(OP,2) \ + H8300_GEN_TEST_BITOP_CONST(OP,3) \ + H8300_GEN_TEST_BITOP_CONST(OP,4) \ + H8300_GEN_TEST_BITOP_CONST(OP,5) \ + H8300_GEN_TEST_BITOP_CONST(OP,6) \ + H8300_GEN_TEST_BITOP_CONST(OP,7) \ + } \ + } else { \ + __asm__("btst %w3,@%2\n\t" \ + OP " %w3,@%2\n\t" \ + "beq 1f\n\t" \ + "inc.l #1,%0\n" \ + "1:" \ + : "=r"(retval) \ + : "0" (retval),"r" (b_addr),"r"(nr) \ + : "memory"); \ + } \ + return retval; \ } -static __inline__ int __test_and_set_bit(int nr, volatile unsigned long* addr) -{ - int retval = 0; - volatile unsigned char *a; - - a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3); \ - __asm__("mov.l %4,er3\n\t" - "btst r3l,%1\n\t" - "bset r3l,%1\n\t" - "beq 1f\n\t" - "inc.l #1,%0\n\t" - "1:" - : "=r"(retval),"+m"(*a) - : "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory"); - return retval; -} - -static __inline__ int test_and_clear_bit(int nr, volatile unsigned long* addr) -{ - int retval = 0; - volatile unsigned char *a; - - a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3); \ - __asm__("mov.l %4,er3\n\t" - "stc ccr,r3h\n\t" - "orc #0x80,ccr\n\t" - "btst r3l,%1\n\t" - "bclr r3l,%1\n\t" - "beq 1f\n\t" - "inc.l #1,%0\n\t" - "1:" - "ldc r3h,ccr" - : "=r"(retval),"+m"(*a) - : "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory"); - return retval; -} - -static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long* addr) -{ - int retval = 0; - volatile unsigned char *a; - - a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3); \ - __asm__("mov.l %4,er3\n\t" - "btst r3l,%1\n\t" - "bclr r3l,%1\n\t" - "beq 1f\n\t" - "inc.l #1,%0\n\t" - "1:" - : "=r"(retval),"+m"(*a) - : "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory"); - return retval; -} - -static __inline__ int test_and_change_bit(int nr, volatile unsigned long* addr) -{ - int retval = 0; - volatile unsigned char *a; - - a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3); \ - __asm__("mov.l %4,er3\n\t" - "stc ccr,r3h\n\t" - "orc #0x80,ccr\n\t" - "btst r3l,%1\n\t" - "bnot r3l,%1\n\t" - "beq 1f\n\t" - "inc.l #1,%0\n\t" - "1:" - "ldc r3h,ccr" - : "=r"(retval),"+m"(*a) - : "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory"); - return retval; -} - -static __inline__ int __test_and_change_bit(int nr, volatile unsigned long* addr) -{ - int retval = 0; - volatile unsigned char *a; - - a = (volatile unsigned char *)addr += ((nr >> 3) ^ 3); \ - __asm__("mov.l %4,er3\n\t" - "btst r3l,%1\n\t" - "bnot r3l,%1\n\t" - "beq 1f\n\t" - "inc.l #1,%0\n\t" - "1:" - : "=r"(retval),"+m"(*a) - : "0" (retval),"m" (*a),"g"(nr & 7):"er3","memory"); - return retval; -} +H8300_GEN_TEST_BITOP(test_and_set_bit, "bset") +H8300_GEN_TEST_BITOP(test_and_clear_bit, "bclr") +H8300_GEN_TEST_BITOP(test_and_change_bit,"bnot") +#undef H8300_GEN_TEST_BITOP_CONST +#undef H8300_GEN_TEST_BITOP_CONST_INT +#undef H8300_GEN_TEST_BITOP #define find_first_zero_bit(addr, size) \ - find_next_zero_bit((addr), (size), 0) + find_next_zero_bit((addr), (size), 0) static __inline__ int find_next_zero_bit (void * addr, int size, int offset) { @@ -326,7 +305,7 @@ static __inline__ int ext2_test_bit(int nr, const volatile void * addr) } #define ext2_find_first_zero_bit(addr, size) \ - ext2_find_next_zero_bit((addr), (size), 0) + ext2_find_next_zero_bit((addr), (size), 0) static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset) { diff --git a/include/asm-h8300/io.h b/include/asm-h8300/io.h index 42f91752b920..50e4b6803609 100644 --- a/include/asm-h8300/io.h +++ b/include/asm-h8300/io.h @@ -47,6 +47,10 @@ static inline unsigned int _swapl(volatile unsigned long v) #define readl(addr) \ ({ unsigned int __v = (*(volatile unsigned int *) (addr & 0x00ffffff)); __v; }) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) + #define writeb(b,addr) (void)((*(volatile unsigned char *) (addr & 0x00ffffff)) = (b)) #define writew(b,addr) (void)((*(volatile unsigned short *) (addr & 0x00ffffff)) = (b)) #define writel(b,addr) (void)((*(volatile unsigned int *) (addr & 0x00ffffff)) = (b)) diff --git a/include/asm-h8300/pci.h b/include/asm-h8300/pci.h index 4374b6ac4765..f4813f0a9021 100644 --- a/include/asm-h8300/pci.h +++ b/include/asm-h8300/pci.h @@ -8,6 +8,7 @@ */ #define pcibios_assign_all_busses() 0 +#define pcibios_scan_all_fns(a, b) 0 extern inline void pcibios_set_master(struct pci_dev *dev) { diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h index 1d21e333b324..d7d2c9aa5907 100644 --- a/include/asm-i386/acpi.h +++ b/include/asm-i386/acpi.h @@ -116,6 +116,7 @@ extern int acpi_noirq; #ifdef CONFIG_X86_IO_APIC extern int skip_ioapic_setup; +extern int acpi_irq_to_vector(u32 irq); static inline void disable_ioapic_setup(void) { diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h index 42a1dcaf172b..d3054e6fa4bb 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-i386/apic.h @@ -85,7 +85,7 @@ extern void disable_lapic_nmi_watchdog(void); extern void enable_lapic_nmi_watchdog(void); extern void disable_timer_nmi_watchdog(void); extern void enable_timer_nmi_watchdog(void); -extern inline void nmi_watchdog_tick (struct pt_regs * regs); +extern void nmi_watchdog_tick (struct pt_regs * regs); extern int APIC_init_uniprocessor (void); extern void disable_APIC_timer(void); extern void enable_APIC_timer(void); diff --git a/include/asm-i386/edd.h b/include/asm-i386/edd.h index 3bae533f3d2f..6f7dbc6db811 100644 --- a/include/asm-i386/edd.h +++ b/include/asm-i386/edd.h @@ -1,6 +1,6 @@ /* * linux/include/asm-i386/edd.h - * Copyright (C) 2002 Dell Inc. + * Copyright (C) 2002, 2003 Dell Inc. * by Matt Domsch <Matt_Domsch@dell.com> * * structures and definitions for the int 13h, ax={41,48}h @@ -41,6 +41,9 @@ #define EDDMAGIC1 0x55AA #define EDDMAGIC2 0xAA55 +#define READ_SECTORS 0x02 +#define MBR_SIG_OFFSET 0x1B8 +#define DISK80_SIG_BUFFER 0x2cc #ifndef __ASSEMBLY__ #define EDD_EXT_FIXED_DISK_ACCESS (1 << 0) @@ -167,6 +170,7 @@ struct edd_info { extern struct edd_info edd[EDDMAXNR]; extern unsigned char eddnr; +extern unsigned int edd_disk80_sig; #endif /*!__ASSEMBLY__ */ #endif /* _ASM_I386_EDD_H */ diff --git a/include/asm-i386/hw_irq.h b/include/asm-i386/hw_irq.h index 9b3b8bf9e266..b8166a30fbe1 100644 --- a/include/asm-i386/hw_irq.h +++ b/include/asm-i386/hw_irq.h @@ -26,7 +26,7 @@ */ extern u8 irq_vector[NR_IRQ_VECTORS]; -#define IO_APIC_VECTOR(irq) ((int)irq_vector[irq]) +#define IO_APIC_VECTOR(irq) (irq_vector[irq]) extern void (*interrupt[NR_IRQS])(void); diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h index 62dc0bb8e217..7e7b595b31eb 100644 --- a/include/asm-i386/io.h +++ b/include/asm-i386/io.h @@ -153,6 +153,9 @@ extern void bt_iounmap(void *addr, unsigned long size); #define readb(addr) (*(volatile unsigned char *) __io_virt(addr)) #define readw(addr) (*(volatile unsigned short *) __io_virt(addr)) #define readl(addr) (*(volatile unsigned int *) __io_virt(addr)) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) #define __raw_readb readb #define __raw_readw readw #define __raw_readl readl diff --git a/include/asm-i386/memblk.h b/include/asm-i386/memblk.h deleted file mode 100644 index 668fc0d644ba..000000000000 --- a/include/asm-i386/memblk.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef _ASM_I386_MEMBLK_H_ -#define _ASM_I386_MEMBLK_H_ - -#include <linux/device.h> -#include <linux/mmzone.h> -#include <linux/memblk.h> -#include <linux/topology.h> - -#include <asm/node.h> - -struct i386_memblk { - struct memblk memblk; -}; -extern struct i386_memblk memblk_devices[MAX_NR_MEMBLKS]; - -static inline int arch_register_memblk(int num){ - int p_node = memblk_to_node(num); - - return register_memblk(&memblk_devices[num].memblk, num, - &node_devices[p_node].node); -} - -#endif /* _ASM_I386_MEMBLK_H_ */ diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h index 8587d7e3a2ae..1bd79dfb3c9a 100644 --- a/include/asm-i386/mmzone.h +++ b/include/asm-i386/mmzone.h @@ -62,12 +62,8 @@ extern struct pglist_data *node_data[]; (__pfn - node_start_pfn(pfn_to_nid(__pfn))); \ }) -#define kern_addr_valid(kaddr) \ -({ \ - unsigned long __kaddr = (unsigned long)(kaddr); \ - pg_data_t *__pgdat = NODE_DATA(kvaddr_to_nid(__kaddr)); \ - test_bit(local_mapnr(__kaddr), __pgdat->valid_addr_bitmap); \ -}) +/* XXX: FIXME -- wli */ +#define kern_addr_valid(kaddr) (0) #define pfn_to_page(pfn) \ ({ \ diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h index 0fc93a7d3c07..83aede6ce595 100644 --- a/include/asm-i386/pci.h +++ b/include/asm-i386/pci.h @@ -15,6 +15,7 @@ extern unsigned int pcibios_assign_all_busses(void); #else #define pcibios_assign_all_busses() 0 #endif +#define pcibios_scan_all_fns(a, b) 0 extern unsigned long pci_mem_start; #define PCIBIOS_MIN_IO 0x1000 diff --git a/include/asm-i386/setup.h b/include/asm-i386/setup.h index bead49efcf04..bac2c9f0f7d8 100644 --- a/include/asm-i386/setup.h +++ b/include/asm-i386/setup.h @@ -44,6 +44,7 @@ #define INITRD_START (*(unsigned long *) (PARAM+0x218)) #define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c)) #define EDID_INFO (*(struct edid_info *) (PARAM+0x440)) +#define DISK80_SIGNATURE (*(unsigned int*) (PARAM+DISK80_SIG_BUFFER)) #define EDD_NR (*(unsigned char *) (PARAM+EDDNR)) #define EDD_BUF ((struct edd_info *) (PARAM+EDDBUF)) #define COMMAND_LINE ((char *) (PARAM+2048)) diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h index daecfc479f35..a14f9f37d9c1 100644 --- a/include/asm-i386/string.h +++ b/include/asm-i386/string.h @@ -23,7 +23,10 @@ * consider these trivial functions to be PD. */ -#define __HAVE_ARCH_STRCPY +/* AK: in fact I bet it would be better to move this stuff all out of line. + */ +#if !defined(IN_STRING_C) + static inline char * strcpy(char * dest,const char *src) { int d0, d1, d2; @@ -37,7 +40,6 @@ __asm__ __volatile__( return dest; } -#define __HAVE_ARCH_STRNCPY static inline char * strncpy(char * dest,const char *src,size_t count) { int d0, d1, d2, d3; @@ -56,7 +58,6 @@ __asm__ __volatile__( return dest; } -#define __HAVE_ARCH_STRCAT static inline char * strcat(char * dest,const char * src) { int d0, d1, d2, d3; @@ -73,7 +74,6 @@ __asm__ __volatile__( return dest; } -#define __HAVE_ARCH_STRNCAT static inline char * strncat(char * dest,const char * src,size_t count) { int d0, d1, d2, d3; @@ -96,7 +96,6 @@ __asm__ __volatile__( return dest; } -#define __HAVE_ARCH_STRCMP static inline int strcmp(const char * cs,const char * ct) { int d0, d1; @@ -117,7 +116,6 @@ __asm__ __volatile__( return __res; } -#define __HAVE_ARCH_STRNCMP static inline int strncmp(const char * cs,const char * ct,size_t count) { register int __res; @@ -140,7 +138,6 @@ __asm__ __volatile__( return __res; } -#define __HAVE_ARCH_STRCHR static inline char * strchr(const char * s, int c) { int d0; @@ -159,7 +156,6 @@ __asm__ __volatile__( return __res; } -#define __HAVE_ARCH_STRRCHR static inline char * strrchr(const char * s, int c) { int d0, d1; @@ -176,6 +172,8 @@ __asm__ __volatile__( return __res; } +#endif + #define __HAVE_ARCH_STRLEN static inline size_t strlen(const char * s) { diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h index 9190a4f3408f..219c6efbd972 100644 --- a/include/asm-i386/topology.h +++ b/include/asm-i386/topology.h @@ -43,9 +43,6 @@ static inline int cpu_to_node(int cpu) return cpu_2_node[cpu]; } -/* Returns the number of the node containing MemBlk 'memblk' */ -#define memblk_to_node(memblk) (memblk) - /* Returns the number of the node containing Node 'node'. This architecture is flat, so it is a pretty simple function! */ #define parent_node(node) (node) @@ -63,9 +60,6 @@ static inline int node_to_first_cpu(int node) return first_cpu(mask); } -/* Returns the number of the first MemBlk on Node 'node' */ -#define node_to_memblk(node) (node) - /* Returns the number of the node containing PCI bus 'bus' */ static inline cpumask_t pcibus_to_cpumask(int bus) { diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index 3adc789060f0..89bce4f25ea9 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h @@ -385,7 +385,6 @@ __syscall_return(type,__res); \ * won't be any messing with the stack from main(), but we define * some others too. */ -#define __NR__exit __NR_exit static inline _syscall0(pid_t,setsid) static inline _syscall3(int,write,int,fd,const char *,buf,off_t,count) static inline _syscall3(int,read,int,fd,char *,buf,off_t,count) @@ -394,7 +393,6 @@ static inline _syscall1(int,dup,int,fd) static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp) static inline _syscall3(int,open,const char *,file,int,flag,int,mode) static inline _syscall1(int,close,int,fd) -static inline _syscall1(int,_exit,int,exitcode) static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) #endif diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h index a4c79e29438c..8b6d0ae22008 100644 --- a/include/asm-ia64/io.h +++ b/include/asm-ia64/io.h @@ -125,6 +125,10 @@ __ia64_mk_io_addr (unsigned long port) #define __ia64_readw ___ia64_readw #define __ia64_readl ___ia64_readl #define __ia64_readq ___ia64_readq +#define __ia64_readb_relaxed ___ia64_readb +#define __ia64_readw_relaxed ___ia64_readw +#define __ia64_readl_relaxed ___ia64_readl +#define __ia64_readq_relaxed ___ia64_readq #define __ia64_writeb ___ia64_writeb #define __ia64_writew ___ia64_writew #define __ia64_writel ___ia64_writel @@ -337,15 +341,27 @@ __writeq (unsigned long val, void *addr) #define __readw platform_readw #define __readl platform_readl #define __readq platform_readq +#define __readb_relaxed platform_readb_relaxed +#define __readw_relaxed platform_readw_relaxed +#define __readl_relaxed platform_readl_relaxed +#define __readq_relaxed platform_readq_relaxed #define readb(a) __readb((void *)(a)) #define readw(a) __readw((void *)(a)) #define readl(a) __readl((void *)(a)) #define readq(a) __readq((void *)(a)) +#define readb_relaxed(a) __readb_relaxed((void *)(a)) +#define readw_relaxed(a) __readw_relaxed((void *)(a)) +#define readl_relaxed(a) __readl_relaxed((void *)(a)) +#define readq_relaxed(a) __readq_relaxed((void *)(a)) #define __raw_readb readb #define __raw_readw readw #define __raw_readl readl #define __raw_readq readq +#define __raw_readb_relaxed readb_relaxed +#define __raw_readw_relaxed readw_relaxed +#define __raw_readl_relaxed readl_relaxed +#define __raw_readq_relaxed readq_relaxed #define writeb(v,a) __writeb((v), (void *) (a)) #define writew(v,a) __writew((v), (void *) (a)) #define writel(v,a) __writel((v), (void *) (a)) diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h index 8032a3350d3c..fb41af779d19 100644 --- a/include/asm-ia64/machvec.h +++ b/include/asm-ia64/machvec.h @@ -65,6 +65,10 @@ 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 *); extern void machvec_noop (void); extern void machvec_memory_fence (void); @@ -116,6 +120,10 @@ extern void machvec_memory_fence (void); # define platform_readw ia64_mv.readw # define platform_readl ia64_mv.readl # define platform_readq ia64_mv.readq +# define platform_readb_relaxed ia64_mv.readb_relaxed +# define platform_readw_relaxed ia64_mv.readw_relaxed +# define platform_readl_relaxed ia64_mv.readl_relaxed +# define platform_readq_relaxed ia64_mv.readq_relaxed # endif /* __attribute__((__aligned__(16))) is required to make size of the @@ -158,6 +166,10 @@ struct ia64_machine_vector { ia64_mv_readw_t *readw; ia64_mv_readl_t *readl; ia64_mv_readq_t *readq; + ia64_mv_readb_relaxed_t *readb_relaxed; + ia64_mv_readw_relaxed_t *readw_relaxed; + ia64_mv_readl_relaxed_t *readl_relaxed; + ia64_mv_readq_relaxed_t *readq_relaxed; } __attribute__((__aligned__(16))); /* align attrib? see above comment */ #define MACHVEC_INIT(name) \ @@ -196,6 +208,10 @@ struct ia64_machine_vector { platform_readw, \ platform_readl, \ platform_readq, \ + platform_readb_relaxed, \ + platform_readw_relaxed, \ + platform_readl_relaxed, \ + platform_readq_relaxed, \ } extern struct ia64_machine_vector ia64_mv; @@ -322,5 +338,17 @@ extern ia64_mv_dma_supported swiotlb_dma_supported; #ifndef platform_readq # define platform_readq __ia64_readq #endif +#ifndef platform_readb_relaxed +# define platform_readb_relaxed __ia64_readb_relaxed +#endif +#ifndef platform_readw_relaxed +# define platform_readw_relaxed __ia64_readw_relaxed +#endif +#ifndef platform_readl_relaxed +# define platform_readl_relaxed __ia64_readl_relaxed +#endif +#ifndef platform_readq_relaxed +# define platform_readq_relaxed __ia64_readq_relaxed +#endif #endif /* _ASM_IA64_MACHVEC_H */ diff --git a/include/asm-ia64/machvec_sn2.h b/include/asm-ia64/machvec_sn2.h index af1e9c255f0b..baf0bc2ea8e7 100644 --- a/include/asm-ia64/machvec_sn2.h +++ b/include/asm-ia64/machvec_sn2.h @@ -52,6 +52,10 @@ extern ia64_mv_readb_t __sn_readb; extern ia64_mv_readw_t __sn_readw; extern ia64_mv_readl_t __sn_readl; extern ia64_mv_readq_t __sn_readq; +extern ia64_mv_readb_t __sn_readb_relaxed; +extern ia64_mv_readw_t __sn_readw_relaxed; +extern ia64_mv_readl_t __sn_readl_relaxed; +extern ia64_mv_readq_t __sn_readq_relaxed; extern ia64_mv_dma_alloc_coherent sn_dma_alloc_coherent; extern ia64_mv_dma_free_coherent sn_dma_free_coherent; extern ia64_mv_dma_map_single sn_dma_map_single; @@ -87,6 +91,10 @@ extern ia64_mv_dma_supported sn_dma_supported; #define platform_readw __sn_readw #define platform_readl __sn_readl #define platform_readq __sn_readq +#define platform_readb_relaxed __sn_readb_relaxed +#define platform_readw_relaxed __sn_readw_relaxed +#define platform_readl_relaxed __sn_readl_relaxed +#define platform_readq_relaxed __sn_readq_relaxed #define platform_irq_desc sn_irq_desc #define platform_irq_to_vector sn_irq_to_vector #define platform_local_vector_to_irq sn_local_vector_to_irq diff --git a/include/asm-ia64/mmzone.h b/include/asm-ia64/mmzone.h index 9b9afd467f76..f28f0b28504f 100644 --- a/include/asm-ia64/mmzone.h +++ b/include/asm-ia64/mmzone.h @@ -20,11 +20,11 @@ #ifdef CONFIG_IA64_DIG /* DIG systems are small */ # define MAX_PHYSNODE_ID 8 # define NR_NODES 8 -# define NR_MEMBLKS (NR_NODES * 32) +# define NR_NODE_MEMBLKS (NR_NODES * 8) #else /* sn2 is the biggest case, so we use that if !DIG */ # define MAX_PHYSNODE_ID 2048 # define NR_NODES 256 -# define NR_MEMBLKS (NR_NODES) +# define NR_NODE_MEMBLKS (NR_NODES * 4) #endif extern unsigned long max_low_pfn; @@ -34,6 +34,6 @@ extern unsigned long max_low_pfn; #define pfn_to_page(pfn) (vmem_map + (pfn)) #else /* CONFIG_DISCONTIGMEM */ -# define NR_MEMBLKS 1 +# define NR_NODE_MEMBLKS 4 #endif /* CONFIG_DISCONTIGMEM */ #endif /* _ASM_IA64_MMZONE_H */ diff --git a/include/asm-ia64/numa.h b/include/asm-ia64/numa.h index de73c7000a52..6459f619a497 100644 --- a/include/asm-ia64/numa.h +++ b/include/asm-ia64/numa.h @@ -28,7 +28,7 @@ extern cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned; /* Stuff below this line could be architecture independent */ -extern int num_memblks; /* total number of memory chunks */ +extern int num_node_memblks; /* total number of memory chunks */ /* * List of node memory chunks. Filled when parsing SRAT table to @@ -47,7 +47,7 @@ struct node_cpuid_s { int nid; /* logical node containing this CPU */ }; -extern struct node_memblk_s node_memblk[NR_MEMBLKS]; +extern struct node_memblk_s node_memblk[NR_NODE_MEMBLKS]; extern struct node_cpuid_s node_cpuid[NR_CPUS]; /* diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h index 4a4e92f463a6..42f66dda432b 100644 --- a/include/asm-ia64/pci.h +++ b/include/asm-ia64/pci.h @@ -16,6 +16,7 @@ * loader. */ #define pcibios_assign_all_busses() 0 +#define pcibios_scan_all_fns(a, b) 0 #define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_MEM 0x10000000 diff --git a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h index 4790718f31df..550365c7f4ef 100644 --- a/include/asm-ia64/sn/addrs.h +++ b/include/asm-ia64/sn/addrs.h @@ -9,8 +9,6 @@ #ifndef _ASM_IA64_SN_ADDRS_H #define _ASM_IA64_SN_ADDRS_H -#include <linux/config.h> - #include <asm/sn/sn2/addrs.h> #ifndef __ASSEMBLY__ @@ -154,7 +152,7 @@ * the base of the register space. */ #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) \ HUB_L(HUB_REG_PTR((_base), (_off))) diff --git a/include/asm-ia64/sn/alenlist.h b/include/asm-ia64/sn/alenlist.h index ec01bdd359f2..4ab6c0731982 100644 --- a/include/asm-ia64/sn/alenlist.h +++ b/include/asm-ia64/sn/alenlist.h @@ -62,7 +62,7 @@ typedef struct external_alenlist *external_alenlist_t; /* 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. */ extern int alenlist_grow(alenlist_t, size_t npairs); @@ -103,7 +103,7 @@ alenlist_done(alenlist_t alenlist); extern int alenlist_append(alenlist_t alenlist, /* append to this list */ alenaddr_t address, /* address 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. @@ -114,7 +114,7 @@ alenlist_replace( alenlist_t alenlist, /* in: replace in this list */ alenlist_cursor_t cursorp, /* inout: which item to replace */ alenaddr_t *addrp, /* inout: address */ size_t *lengthp, /* inout: length */ - unsigned flags); + unsigned int flags); /* Get the next Pair from a List */ @@ -123,7 +123,7 @@ extern int alenlist_get(alenlist_t alenlist, /* in: get from this list */ size_t maxlength, /* in: at most length */ alenaddr_t *addr, /* out: address */ size_t *length, /* out: length */ - unsigned flags); + unsigned int flags); /* Return the number of Pairs stored in 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 */ extern alenlist_t alenlist_clone(alenlist_t old, /* clone this list */ - unsigned flags); + unsigned int flags); /* 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 */ 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 extern alenlist_t kvaddr_to_alenlist( alenlist_t alenlist, caddr_t kvaddr, size_t length, - unsigned flags); + unsigned int flags); /* Convert from a User Virtual Address to a Physical Address/Length List */ extern alenlist_t uvaddr_to_alenlist( alenlist_t alenlist, uvaddr_t vaddr, size_t length, - unsigned flags); + unsigned int flags); /* Convert from a buf struct to a Physical Address/Length List */ struct buf; extern alenlist_t buf_to_alenlist( alenlist_t alenlist, struct buf *buf, - unsigned flags); + unsigned int flags); /* diff --git a/include/asm-ia64/sn/arch.h b/include/asm-ia64/sn/arch.h index ac487ad83b67..53691562b9f4 100644 --- a/include/asm-ia64/sn/arch.h +++ b/include/asm-ia64/sn/arch.h @@ -11,12 +11,9 @@ #ifndef _ASM_IA64_SN_ARCH_H #define _ASM_IA64_SN_ARCH_H -#include <linux/config.h> -#include <linux/threads.h> -#include <linux/mmzone.h> +#include <asm/types.h> #include <asm/sn/types.h> - -#include <asm/sn/sn2/arch.h> +#include <asm/sn/sn_cpuid.h> typedef u64 shubreg_t; typedef u64 hubreg_t; diff --git a/include/asm-ia64/sn/bte.h b/include/asm-ia64/sn/bte.h index 2e96438b8d2b..538385a21fb7 100644 --- a/include/asm-ia64/sn/bte.h +++ b/include/asm-ia64/sn/bte.h @@ -13,8 +13,7 @@ #include <linux/timer.h> #include <linux/spinlock.h> #include <linux/cache.h> -#include <asm/sn/io.h> -#include <asm/delay.h> +#include <asm/sn/types.h> /* #define BTE_DEBUG */ diff --git a/include/asm-ia64/sn/clksupport.h b/include/asm-ia64/sn/clksupport.h index ff5c1a00c115..037112e0360a 100644 --- a/include/asm-ia64/sn/clksupport.h +++ b/include/asm-ia64/sn/clksupport.h @@ -23,9 +23,7 @@ #ifndef _ASM_IA64_SN_CLKSUPPORT_H #define _ASM_IA64_SN_CLKSUPPORT_H -#include <linux/config.h> #include <asm/sn/arch.h> -#include <asm/sn/addrs.h> typedef long clkreg_t; diff --git a/include/asm-ia64/sn/driver.h b/include/asm-ia64/sn/driver.h index c0ddca44061e..41b4ffb63c10 100644 --- a/include/asm-ia64/sn/driver.h +++ b/include/asm-ia64/sn/driver.h @@ -31,7 +31,7 @@ struct eframe_s; struct piomap; struct dmamap; -typedef __psunsigned_t iobush_t; +typedef unsigned long iobush_t; /* interrupt function */ typedef void *intr_arg_t; diff --git a/include/asm-ia64/sn/hcl.h b/include/asm-ia64/sn/hcl.h index abf3fee7cdf3..b10d9ea6760e 100644 --- a/include/asm-ia64/sn/hcl.h +++ b/include/asm-ia64/sn/hcl.h @@ -8,6 +8,7 @@ #ifndef _ASM_IA64_SN_HCL_H #define _ASM_IA64_SN_HCL_H +#include <linux/fs.h> #include <asm/sn/sgi.h> extern vertex_hdl_t hwgraph_root; @@ -58,7 +59,6 @@ typedef long arb_info_desc_t; #define hwgraph_connectpt_set labelcl_info_connectpt_set #define hwgraph_generate_path hwgfs_generate_path #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) /* diff --git a/include/asm-ia64/sn/hcl_util.h b/include/asm-ia64/sn/hcl_util.h index f32ecc728bef..faa5aaec6fe0 100644 --- a/include/asm-ia64/sn/hcl_util.h +++ b/include/asm-ia64/sn/hcl_util.h @@ -9,6 +9,8 @@ #ifndef _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 int device_master_set(vertex_hdl_t, vertex_hdl_t); extern vertex_hdl_t device_master_get(vertex_hdl_t); diff --git a/include/asm-ia64/sn/hwgfs.h b/include/asm-ia64/sn/hwgfs.h index 39191b144805..bbdd433234c5 100644 --- a/include/asm-ia64/sn/hwgfs.h +++ b/include/asm-ia64/sn/hwgfs.h @@ -8,6 +8,9 @@ * * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved. */ + +#include <asm/types.h> + typedef struct dentry *hwgfs_handle_t; extern hwgfs_handle_t hwgfs_register(hwgfs_handle_t dir, const char *name, diff --git a/include/asm-ia64/sn/iograph.h b/include/asm-ia64/sn/iograph.h index 65d191c23cf7..b6c04f7ba87a 100644 --- a/include/asm-ia64/sn/iograph.h +++ b/include/asm-ia64/sn/iograph.h @@ -144,6 +144,7 @@ void init_all_devices(void); #endif /* __KERNEL__ */ +#include <asm/sn/sgi.h> #include <asm/sn/xtalk/xbow.h> /* For get MAX_PORT_NUM */ int io_brick_map_widget(int, int); diff --git a/include/asm-ia64/sn/klconfig.h b/include/asm-ia64/sn/klconfig.h index 6f485a4da42c..781b0e00303a 100644 --- a/include/asm-ia64/sn/klconfig.h +++ b/include/asm-ia64/sn/klconfig.h @@ -92,9 +92,9 @@ typedef s32 klconf_off_t; typedef struct console_s { - __psunsigned_t uart_base; - __psunsigned_t config_base; - __psunsigned_t memory_base; + unsigned long uart_base; + unsigned long config_base; + unsigned long memory_base; short baud; short flag; int type; @@ -134,7 +134,7 @@ typedef struct kl_config_hdr { /* --- New Macros for the changed kl_config_hdr_t structure --- */ #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)) @@ -672,18 +672,19 @@ typedef union kldev_s { /* for device structure allocation */ /* external declarations of Linux kernel functions. */ extern lboard_t *root_lboard[]; -extern lboard_t *find_lboard(lboard_t *start, unsigned char type); +extern lboard_t *find_lboard_any(lboard_t *start, unsigned char type); +extern lboard_t *find_lboard_nasid(lboard_t *start, nasid_t, unsigned char type); extern klinfo_t *find_component(lboard_t *brd, klinfo_t *kli, unsigned char type); extern klinfo_t *find_first_component(lboard_t *brd, unsigned char type); extern klcpu_t *nasid_slice_to_cpuinfo(nasid_t, int); extern lboard_t *find_gfxpipe(int pipenum); -extern lboard_t *find_lboard_class(lboard_t *start, unsigned char brd_class); +extern lboard_t *find_lboard_class_any(lboard_t *start, unsigned char brd_class); +extern lboard_t *find_lboard_class_nasid(lboard_t *start, nasid_t, unsigned char brd_class); extern lboard_t *find_nic_lboard(lboard_t *, nic_t); extern lboard_t *find_nic_type_lboard(nasid_t, unsigned char, nic_t); extern lboard_t *find_lboard_modslot(lboard_t *start, geoid_t geoid); -extern lboard_t *find_lboard_module(lboard_t *start, geoid_t geoid); extern int config_find_nic_router(nasid_t, nic_t, lboard_t **, klrou_t**); extern int config_find_nic_hub(nasid_t, nic_t, lboard_t **, klhub_t**); extern int config_find_xbow(nasid_t, lboard_t **, klxbow_t**); diff --git a/include/asm-ia64/sn/kldir.h b/include/asm-ia64/sn/kldir.h index c49174494ce3..685f110b9ec7 100644 --- a/include/asm-ia64/sn/kldir.h +++ b/include/asm-ia64/sn/kldir.h @@ -11,7 +11,7 @@ #ifndef _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 @@ -136,7 +136,7 @@ typedef struct kldir_ent_s { u64 magic; /* Indicates validity of entry */ 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 */ u64 count; /* Repeat count if array, 1 if not */ size_t stride; /* Stride if array, 0 if not */ diff --git a/include/asm-ia64/sn/module.h b/include/asm-ia64/sn/module.h index c4aff28d91b3..bbc966a53daf 100644 --- a/include/asm-ia64/sn/module.h +++ b/include/asm-ia64/sn/module.h @@ -13,7 +13,7 @@ extern "C" { #endif -#include <linux/config.h> +#include <asm/semaphore.h> #include <asm/sn/klconfig.h> #include <asm/sn/ksys/elsc.h> @@ -158,12 +158,9 @@ struct module_s { spinlock_t lock; /* Lock for this structure */ /* List of nodes in this module */ - cnodeid_t nodes[MODULE_MAX_NODES]; - geoid_t geoid[MODULE_MAX_NODES]; - struct { - char moduleid[8]; - } io[MODULE_MAX_NODES]; - int nodecnt; /* Number of nodes in array */ + cnodeid_t nodes[MAX_SLABS + 1]; + geoid_t geoid[MAX_SLABS + 1]; + /* Fields for Module System Controller */ int mesgpend; /* Message pending */ int shutdown; /* Shutdown in progress */ diff --git a/include/asm-ia64/sn/nodepda.h b/include/asm-ia64/sn/nodepda.h index 4df396cd46ed..c992940c6398 100644 --- a/include/asm-ia64/sn/nodepda.h +++ b/include/asm-ia64/sn/nodepda.h @@ -9,14 +9,14 @@ #define _ASM_IA64_SN_NODEPDA_H -#include <linux/config.h> -#include <asm/sn/sgi.h> +#include <asm/semaphore.h> #include <asm/irq.h> #include <asm/sn/intr.h> #include <asm/sn/router.h> #include <asm/sn/pda.h> #include <asm/sn/module.h> #include <asm/sn/bte.h> +#include <asm/sn/sn2/arch.h> /* * NUMA Node-Specific Data structures are defined in this file. diff --git a/include/asm-ia64/sn/pci/bridge.h b/include/asm-ia64/sn/pci/bridge.h index fbb6e57b6170..6b6d346ce1c9 100644 --- a/include/asm-ia64/sn/pci/bridge.h +++ b/include/asm-ia64/sn/pci/bridge.h @@ -533,12 +533,12 @@ typedef volatile struct bridge_s { /* 0x020000-0x027FFF -- PCI Device Configuration Spaces */ 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} */ uint32_t l[0x1000 / 4]; /* 0x02{0000,,,7FFF} */ uint64_t d[0x1000 / 8]; /* 0x02{0000,,,7FFF} */ union { - uchar_t c[0x100 / 1]; + unsigned char c[0x100 / 1]; uint16_t s[0x100 / 2]; uint32_t l[0x100 / 4]; uint64_t d[0x100 / 8]; @@ -547,12 +547,12 @@ typedef volatile struct bridge_s { /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */ union { /* make all access sizes available. */ - uchar_t c[0x1000 / 1]; + unsigned char c[0x1000 / 1]; uint16_t s[0x1000 / 2]; uint32_t l[0x1000 / 4]; uint64_t d[0x1000 / 8]; union { - uchar_t c[0x100 / 1]; + unsigned char c[0x100 / 1]; uint16_t s[0x100 / 2]; uint32_t l[0x100 / 4]; uint64_t d[0x100 / 8]; @@ -563,13 +563,13 @@ typedef volatile struct bridge_s { /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */ union { - uchar_t c[8 / 1]; + unsigned char c[8 / 1]; uint16_t s[8 / 2]; uint32_t l[8 / 4]; uint64_t d[8 / 8]; } 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 */ bridge_ate_t b_ext_ate_ram[0x10000]; @@ -579,7 +579,7 @@ typedef volatile struct bridge_s { /* 0x200000-0xBFFFFF -- PCI/GIO Device Spaces */ union { /* make all access sizes available. */ - uchar_t c[0x100000 / 1]; + unsigned char c[0x100000 / 1]; uint16_t s[0x100000 / 2]; uint32_t l[0x100000 / 4]; uint64_t d[0x100000 / 8]; @@ -593,7 +593,7 @@ typedef volatile struct bridge_s { /* 0xC00000-0xFFFFFF -- External Flash Proms 1,0 */ 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 */ uint32_t l[0x400000 / 4]; /* read-only */ uint64_t d[0x400000 / 8]; /* read-only */ @@ -918,6 +918,10 @@ typedef volatile struct bridge_s { #define PCIBR_TYPE0_CFG_DEV(ps, s) PCIBRIDGE_TYPE0_CFG_DEV((ps)->bs_busnum, s+1) #define PCIBR_BUS_TYPE0_CFG_DEVF(ps,s,f) PCIBRIDGE_TYPE0_CFG_DEVF((ps)->bs_busnum,(s+1),f) +/* NOTE: 's' is the internal device number, not the external slot number */ +#define PCIBR_BUS_TYPE0_CFG_DEV(ps, s) \ + PCIBRIDGE_TYPE0_CFG_DEV((ps)->bs_busnum, s+1) + #endif /* LANGUAGE_C */ #define BRIDGE_EXTERNAL_FLASH 0x00C00000 /* External Flash PROMS */ @@ -943,10 +947,6 @@ typedef volatile struct bridge_s { #define XBRIDGE_REV_B 0x2 /* macros to determine bridge type. 'wid' == widget identification */ -#define IS_BRIDGE(wid) (XWIDGET_PART_NUM(wid) == BRIDGE_WIDGET_PART_NUM && \ - XWIDGET_MFG_NUM(wid) == BRIDGE_WIDGET_MFGR_NUM) -#define IS_XBRIDGE(wid) (XWIDGET_PART_NUM(wid) == XBRIDGE_WIDGET_PART_NUM && \ - XWIDGET_MFG_NUM(wid) == XBRIDGE_WIDGET_MFGR_NUM) #define IS_PIC_BUS0(wid) (XWIDGET_PART_NUM(wid) == PIC_WIDGET_PART_NUM_BUS0 && \ XWIDGET_MFG_NUM(wid) == PIC_WIDGET_MFGR_NUM) #define IS_PIC_BUS1(wid) (XWIDGET_PART_NUM(wid) == PIC_WIDGET_PART_NUM_BUS1 && \ diff --git a/include/asm-ia64/sn/pci/pci_bus_cvlink.h b/include/asm-ia64/sn/pci/pci_bus_cvlink.h index d1c30ab50df1..c5c04358e8d8 100644 --- a/include/asm-ia64/sn/pci/pci_bus_cvlink.h +++ b/include/asm-ia64/sn/pci/pci_bus_cvlink.h @@ -31,10 +31,6 @@ #define MAX_PCI_XWIDGET 256 #define MAX_ATE_MAPS 1024 -#define SET_PCIA64(dev) \ - (((struct sn_device_sysdata *)((dev)->sysdata))->isa64) = 1 -#define IS_PCIA64(dev) (((dev)->dma_mask == 0xffffffffffffffffUL) || \ - (((struct sn_device_sysdata *)((dev)->sysdata))->isa64)) #define IS_PCI32G(dev) ((dev)->dma_mask >= 0xffffffff) #define IS_PCI32L(dev) ((dev)->dma_mask < 0xffffffff) @@ -50,9 +46,6 @@ struct sn_widget_sysdata { struct sn_device_sysdata { vertex_hdl_t vhdl; - int isa64; - volatile unsigned int *dma_buf_sync; - volatile unsigned int *xbow_buf_sync; pciio_provider_t *pci_provider; }; diff --git a/include/asm-ia64/sn/pci/pcibr.h b/include/asm-ia64/sn/pci/pcibr.h index 5ae5814a3e2e..550bf7e39266 100644 --- a/include/asm-ia64/sn/pci/pcibr.h +++ b/include/asm-ia64/sn/pci/pcibr.h @@ -41,26 +41,6 @@ typedef struct pcibr_dmamap_s *pcibr_dmamap_t; typedef struct pcibr_intr_s *pcibr_intr_t; /* ===================================================================== - * primary entry points: Bridge (pcibr) device driver - * - * These functions are normal device driver entry points - * and are called along with the similar entry points from - * other device drivers. They are included here as documentation - * of their existence and purpose. - * - * pcibr_init() is called to inform us that there is a pcibr driver - * configured into the kernel; it is responsible for registering - * as a crosstalk widget and providing a routine to be called - * when a widget with the proper part number is observed. - * - * pcibr_attach() is called for each vertex in the hardware graph - * corresponding to a crosstalk widget with the manufacturer - * code and part number registered by pcibr_init(). - */ - -extern int pcibr_attach(vertex_hdl_t); - -/* ===================================================================== * bus provider function table * * Normally, this table is only handed off explicitly @@ -72,7 +52,6 @@ extern int pcibr_attach(vertex_hdl_t); * pcibr, we can go directly to this ops table. */ -extern pciio_provider_t pcibr_provider; extern pciio_provider_t pci_pic_provider; /* ===================================================================== @@ -107,6 +86,11 @@ extern caddr_t pcibr_piomap_addr(pcibr_piomap_t piomap, extern void pcibr_piomap_done(pcibr_piomap_t piomap); +extern int pcibr_piomap_probe(pcibr_piomap_t piomap, + off_t offset, + int len, + void *valp); + extern caddr_t pcibr_piotrans_addr(vertex_hdl_t dev, device_desc_t dev_desc, pciio_space_t space, @@ -193,15 +177,10 @@ extern void pcibr_provider_shutdown(vertex_hdl_t pcibr); extern int pcibr_reset(vertex_hdl_t dev); -extern int pcibr_write_gather_flush(vertex_hdl_t dev); - extern pciio_endian_t pcibr_endian_set(vertex_hdl_t dev, pciio_endian_t device_end, pciio_endian_t desired_end); -extern pciio_priority_t pcibr_priority_set(vertex_hdl_t dev, - pciio_priority_t device_prio); - extern uint64_t pcibr_config_get(vertex_hdl_t conn, unsigned reg, unsigned size); @@ -211,6 +190,10 @@ extern void pcibr_config_set(vertex_hdl_t conn, unsigned size, uint64_t value); +extern pciio_slot_t pcibr_error_extract(vertex_hdl_t pcibr_vhdl, + pciio_space_t *spacep, + iopaddr_t *addrp); + extern int pcibr_wrb_flush(vertex_hdl_t pconn_vhdl); extern int pcibr_rrb_check(vertex_hdl_t pconn_vhdl, int *count_vchan0, @@ -234,6 +217,12 @@ void pcibr_set_rrb_callback(vertex_hdl_t xconn_vhdl, rrb_alloc_funct_f *func); extern int pcibr_device_unregister(vertex_hdl_t); +extern void pcibr_driver_reg_callback(vertex_hdl_t, int, int, int); +extern void pcibr_driver_unreg_callback(vertex_hdl_t, + int, int, int); + + +extern void * pcibr_bridge_ptr_get(vertex_hdl_t, int); /* * Bridge-specific flags that can be set via pcibr_device_flags_set @@ -297,6 +286,12 @@ extern int pcibr_device_unregister(vertex_hdl_t); typedef int pcibr_device_flags_t; +#define MINIMAL_ATES_REQUIRED(addr, size) \ + (IOPG(IOPGOFF(addr) + (size) - 1) == IOPG((size) - 1)) + +#define MINIMAL_ATE_FLAG(addr, size) \ + (MINIMAL_ATES_REQUIRED((u_long)addr, size) ? PCIBR_NO_ATE_ROUNDUP : 0) + /* * Set bits in the Bridge Device(x) register for this device. * "flags" are defined above. NOTE: this includes turning @@ -324,9 +319,6 @@ extern int pcibr_rrb_alloc(vertex_hdl_t pconn_vhdl, * the allocation time in the current implementation of PCI bridge. */ extern iopaddr_t pcibr_dmamap_pciaddr_get(pcibr_dmamap_t); - -extern xwidget_intr_preset_f pcibr_xintr_preset; - extern void pcibr_hints_fix_rrbs(vertex_hdl_t); extern void pcibr_hints_dualslot(vertex_hdl_t, pciio_slot_t, pciio_slot_t); extern void pcibr_hints_subdevs(vertex_hdl_t, pciio_slot_t, ulong); @@ -426,7 +418,6 @@ struct pcibr_slot_info_resp_s { unsigned resp_bss_d64_flags; iopaddr_t resp_bss_d32_base; unsigned resp_bss_d32_flags; - atomic_t resp_bss_ext_ates_active; volatile unsigned *resp_bss_cmd_pointer; unsigned resp_bss_cmd_shadow; int resp_bs_rrb_valid; @@ -438,8 +429,6 @@ struct pcibr_slot_info_resp_s { uint64_t resp_b_int_device; uint64_t resp_b_int_enable; uint64_t resp_b_int_host; - picreg_t resp_p_int_enable; - picreg_t resp_p_int_host; struct pcibr_slot_func_info_resp_s { int resp_f_status; char resp_f_slot_name[MAXDEVNAME]; diff --git a/include/asm-ia64/sn/pci/pcibr_private.h b/include/asm-ia64/sn/pci/pcibr_private.h index b7b8c123d461..0bd907d74c58 100644 --- a/include/asm-ia64/sn/pci/pcibr_private.h +++ b/include/asm-ia64/sn/pci/pcibr_private.h @@ -33,24 +33,125 @@ typedef struct pcibr_intr_list_s *pcibr_intr_list_t; typedef struct pcibr_intr_wrap_s *pcibr_intr_wrap_t; typedef struct pcibr_intr_cbuf_s *pcibr_intr_cbuf_t; -typedef volatile unsigned *cfg_p; +typedef volatile unsigned int *cfg_p; typedef volatile bridgereg_t *reg_p; /* * extern functions */ -cfg_p pcibr_slot_config_addr(bridge_t *, pciio_slot_t, int); -cfg_p pcibr_func_config_addr(bridge_t *, pciio_bus_t bus, pciio_slot_t, pciio_function_t, int); -unsigned pcibr_slot_config_get(bridge_t *, pciio_slot_t, int); -unsigned pcibr_func_config_get(bridge_t *, pciio_slot_t, pciio_function_t, int); -extern void pcireg_intr_enable_bit_clr(void *, uint64_t); -extern void pcireg_intr_enable_bit_set(void *, uint64_t); -extern void pcireg_intr_addr_addr_set(void *, int, uint64_t); -extern void pcireg_force_intr_set(void *, int); +cfg_p pcibr_slot_config_addr(pcibr_soft_t, pciio_slot_t, int); +cfg_p pcibr_func_config_addr(pcibr_soft_t, pciio_bus_t bus, pciio_slot_t, pciio_function_t, int); void pcibr_debug(uint32_t, vertex_hdl_t, char *, ...); -void pcibr_slot_config_set(bridge_t *, pciio_slot_t, int, unsigned); -void pcibr_func_config_set(bridge_t *, pciio_slot_t, pciio_function_t, int, - unsigned); +void pcibr_func_config_set(pcibr_soft_t, pciio_slot_t, pciio_function_t, int, unsigned); +/* + * pcireg_ externs + */ + +extern uint64_t pcireg_id_get(pcibr_soft_t); +extern uint64_t pcireg_bridge_id_get(void *); +extern uint64_t pcireg_bus_err_get(pcibr_soft_t); +extern uint64_t pcireg_control_get(pcibr_soft_t); +extern uint64_t pcireg_bridge_control_get(void *); +extern void pcireg_control_set(pcibr_soft_t, uint64_t); +extern void pcireg_control_bit_clr(pcibr_soft_t, uint64_t); +extern void pcireg_control_bit_set(pcibr_soft_t, uint64_t); +extern void pcireg_req_timeout_set(pcibr_soft_t, uint64_t); +extern void pcireg_intr_dst_set(pcibr_soft_t, uint64_t); +extern uint64_t pcireg_intr_dst_target_id_get(pcibr_soft_t); +extern void pcireg_intr_dst_target_id_set(pcibr_soft_t, uint64_t); +extern uint64_t pcireg_intr_dst_addr_get(pcibr_soft_t); +extern void pcireg_intr_dst_addr_set(pcibr_soft_t, uint64_t); +extern uint64_t pcireg_cmdword_err_get(pcibr_soft_t); +extern uint64_t pcireg_llp_cfg_get(pcibr_soft_t); +extern void pcireg_llp_cfg_set(pcibr_soft_t, uint64_t); +extern uint64_t pcireg_tflush_get(pcibr_soft_t); +extern uint64_t pcireg_linkside_err_get(pcibr_soft_t); +extern uint64_t pcireg_resp_err_get(pcibr_soft_t); +extern uint64_t pcireg_resp_err_addr_get(pcibr_soft_t); +extern uint64_t pcireg_resp_err_buf_get(pcibr_soft_t); +extern uint64_t pcireg_resp_err_dev_get(pcibr_soft_t); +extern uint64_t pcireg_linkside_err_addr_get(pcibr_soft_t); +extern uint64_t pcireg_dirmap_get(pcibr_soft_t); +extern void pcireg_dirmap_set(pcibr_soft_t, uint64_t); +extern void pcireg_dirmap_wid_set(pcibr_soft_t, uint64_t); +extern void pcireg_dirmap_diroff_set(pcibr_soft_t, uint64_t); +extern void pcireg_dirmap_add512_set(pcibr_soft_t); +extern void pcireg_dirmap_add512_clr(pcibr_soft_t); +extern uint64_t pcireg_map_fault_get(pcibr_soft_t); +extern uint64_t pcireg_arbitration_get(pcibr_soft_t); +extern void pcireg_arbitration_set(pcibr_soft_t, uint64_t); +extern void pcireg_arbitration_bit_clr(pcibr_soft_t, uint64_t); +extern void pcireg_arbitration_bit_set(pcibr_soft_t, uint64_t); +extern uint64_t pcireg_parity_err_get(pcibr_soft_t); +extern uint64_t pcireg_type1_cntr_get(pcibr_soft_t); +extern void pcireg_type1_cntr_set(pcibr_soft_t, uint64_t); +extern uint64_t pcireg_timeout_get(pcibr_soft_t); +extern void pcireg_timeout_set(pcibr_soft_t, uint64_t); +extern void pcireg_timeout_bit_clr(pcibr_soft_t, uint64_t); +extern void pcireg_timeout_bit_set(pcibr_soft_t, uint64_t); +extern uint64_t pcireg_pci_bus_addr_get(pcibr_soft_t); +extern uint64_t pcireg_pci_bus_addr_addr_get(pcibr_soft_t); +extern uint64_t pcireg_intr_status_get(pcibr_soft_t); +extern uint64_t pcireg_intr_enable_get(pcibr_soft_t); +extern void pcireg_intr_enable_set(pcibr_soft_t, uint64_t); +extern void pcireg_intr_enable_bit_clr(pcibr_soft_t, uint64_t); +extern void pcireg_intr_enable_bit_set(pcibr_soft_t, uint64_t); +extern void pcireg_intr_reset_set(pcibr_soft_t, uint64_t); +extern void pcireg_intr_reset_bit_set(pcibr_soft_t, uint64_t); +extern uint64_t pcireg_intr_mode_get(pcibr_soft_t); +extern void pcireg_intr_mode_set(pcibr_soft_t, uint64_t); +extern void pcireg_intr_mode_bit_clr(pcibr_soft_t, uint64_t); +extern uint64_t pcireg_intr_device_get(pcibr_soft_t); +extern void pcireg_intr_device_set(pcibr_soft_t, uint64_t); +extern void pcireg_intr_device_bit_set(pcibr_soft_t, uint64_t); +extern void pcireg_bridge_intr_device_bit_set(void *, uint64_t); +extern void pcireg_intr_device_bit_clr(pcibr_soft_t, uint64_t); +extern uint64_t pcireg_intr_host_err_get(pcibr_soft_t); +extern void pcireg_intr_host_err_set(pcibr_soft_t, uint64_t); +extern uint64_t pcireg_intr_addr_get(pcibr_soft_t, int); +extern void pcireg_intr_addr_set(pcibr_soft_t, int, uint64_t); +extern void pcireg_bridge_intr_addr_set(void *, int, uint64_t); +extern void * pcireg_intr_addr_addr(pcibr_soft_t, int); +extern void pcireg_intr_addr_vect_set(pcibr_soft_t, int, uint64_t); +extern void pcireg_bridge_intr_addr_vect_set(void *, int, uint64_t); +extern uint64_t pcireg_intr_addr_addr_get(pcibr_soft_t, int); +extern void pcireg_intr_addr_addr_set(pcibr_soft_t, int, uint64_t); +extern void pcireg_bridge_intr_addr_addr_set(void *, int, uint64_t); +extern uint64_t pcireg_intr_view_get(pcibr_soft_t); +extern uint64_t pcireg_intr_multiple_get(pcibr_soft_t); +extern void pcireg_force_always_set(pcibr_soft_t, int); +extern void * pcireg_bridge_force_always_addr_get(void *, int); +extern void * pcireg_force_always_addr_get(pcibr_soft_t, int); +extern void pcireg_force_intr_set(pcibr_soft_t, int); +extern uint64_t pcireg_device_get(pcibr_soft_t, int); +extern void pcireg_device_set(pcibr_soft_t, int, uint64_t); +extern void pcireg_device_bit_set(pcibr_soft_t, int, uint64_t); +extern void pcireg_device_bit_clr(pcibr_soft_t, int, uint64_t); +extern uint64_t pcireg_rrb_get(pcibr_soft_t, int); +extern void pcireg_rrb_set(pcibr_soft_t, int, uint64_t); +extern void pcireg_rrb_bit_set(pcibr_soft_t, int, uint64_t); +extern void pcireg_rrb_bit_clr(pcibr_soft_t, int, uint64_t); +extern uint64_t pcireg_rrb_status_get(pcibr_soft_t); +extern void pcireg_rrb_clear_set(pcibr_soft_t, uint64_t); +extern uint64_t pcireg_wrb_flush_get(pcibr_soft_t, int); +extern uint64_t pcireg_pcix_bus_err_addr_get(pcibr_soft_t); +extern uint64_t pcireg_pcix_bus_err_attr_get(pcibr_soft_t); +extern uint64_t pcireg_pcix_bus_err_data_get(pcibr_soft_t); +extern uint64_t pcireg_pcix_req_err_attr_get(pcibr_soft_t); +extern uint64_t pcireg_pcix_req_err_addr_get(pcibr_soft_t); +extern uint64_t pcireg_pcix_pio_split_addr_get(pcibr_soft_t); +extern uint64_t pcireg_pcix_pio_split_attr_get(pcibr_soft_t); +extern cfg_p pcireg_type1_cfg_addr(pcibr_soft_t, pciio_function_t, + int); +extern cfg_p pcireg_type0_cfg_addr(pcibr_soft_t, pciio_slot_t, + pciio_function_t, int); +extern bridge_ate_t pcireg_int_ate_get(pcibr_soft_t, int); +extern void pcireg_int_ate_set(pcibr_soft_t, int, bridge_ate_t); +extern bridge_ate_p pcireg_int_ate_addr(pcibr_soft_t, int); + +extern uint64_t pcireg_speed_get(pcibr_soft_t); +extern uint64_t pcireg_mode_get(pcibr_soft_t); + /* * PCIBR_DEBUG() macro and debug bitmask defines */ @@ -117,7 +218,7 @@ struct pcibr_piomap_s { xtalk_piomap_t bp_xtalk_pio; /* corresponding xtalk resource */ pcibr_piomap_t bp_next; /* Next piomap on the list */ pcibr_soft_t bp_soft; /* backpointer to bridge soft data */ - atomic_t bp_toc[1]; /* PCI timeout counter */ + atomic_t bp_toc; /* PCI timeout counter */ }; @@ -143,6 +244,7 @@ struct pcibr_dmamap_s { bridge_ate_t bd_ate_proto; /* prototype ATE (for xioaddr=0) */ bridge_ate_t bd_ate_prime; /* value of 1st ATE written */ dma_addr_t bd_dma_addr; /* Linux dma handle */ + struct resource resource; }; #define IBUFSIZE 5 /* size of circular buffer (holds 4) */ @@ -171,7 +273,7 @@ struct pcibr_intr_s { #define bi_mustruncpu bi_pi.pi_mustruncpu /* Where we must run. */ #define bi_irq bi_pi.pi_irq /* IRQ assigned. */ #define bi_cpu bi_pi.pi_cpu /* cpu assigned. */ - unsigned bi_ibits; /* which Bridge interrupt bit(s) */ + unsigned int bi_ibits; /* which Bridge interrupt bit(s) */ pcibr_soft_t bi_soft; /* shortcut to soft info */ struct pcibr_intr_cbuf_s bi_ibuf; /* circular buffer of wrap ptrs */ unsigned bi_last_intr; /* For Shub lb lost intr. bug */ @@ -245,7 +347,8 @@ struct pcibr_info_s { struct pcibr_intr_list_s { pcibr_intr_list_t il_next; pcibr_intr_t il_intr; - volatile bridgereg_t *il_wrbf; /* ptr to b_wr_req_buf[] */ + pcibr_soft_t il_soft; + pciio_slot_t il_slot; }; /* ===================================================================== @@ -271,7 +374,7 @@ struct pcibr_intr_wrap_s { * To reduce the size of the internal resource mapping structures, do * not use the entire PCI bus I/O address space */ -#define PCIBR_BUS_IO_BASE 0x100000 +#define PCIBR_BUS_IO_BASE 0x200000 #define PCIBR_BUS_IO_MAX 0x0FFFFFFF #define PCIBR_BUS_IO_PAGE 0x100000 @@ -284,8 +387,6 @@ struct pcibr_intr_wrap_s { #define PCIBR_BUS_MEM_PAGE 0x100000 /* defines for pcibr_soft_s->bs_bridge_type */ -#define PCIBR_BRIDGETYPE_BRIDGE 0 -#define PCIBR_BRIDGETYPE_XBRIDGE 1 #define PCIBR_BRIDGETYPE_PIC 2 #define IS_PIC_BUSNUM_SOFT(ps, bus) ((ps)->bs_busnum == (bus)) @@ -294,25 +395,6 @@ struct pcibr_intr_wrap_s { */ #define PCIBR_WAR_ENABLED(pv, pcibr_soft) \ ((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 */ - -/* Bridgetype macros given a pcibr_soft structure */ -#define IS_PIC_SOFT(ps) (ps->bs_bridge_type == PCIBR_BRIDGETYPE_PIC) - /* defines for pcibr_soft_s->bs_bridge_mode */ #define PCIBR_BRIDGEMODE_PCI_33 0x0 @@ -349,14 +431,16 @@ struct pcibr_soft_s { vertex_hdl_t bs_conn; /* xtalk connection point */ vertex_hdl_t bs_vhdl; /* vertex owned by pcibr */ uint64_t bs_int_enable; /* Mask of enabled intrs */ - bridge_t *bs_base; /* PIO pointer to Bridge chip */ + void *bs_base; /* PIO pointer to Bridge chip */ char *bs_name; /* hw graph name */ + char bs_asic_name[16]; /* ASIC name */ xwidgetnum_t bs_xid; /* Bridge's xtalk ID number */ vertex_hdl_t bs_master; /* xtalk master vertex */ xwidgetnum_t bs_mxid; /* master's xtalk ID number */ pciio_slot_t bs_first_slot; /* first existing slot */ pciio_slot_t bs_last_slot; /* last existing slot */ pciio_slot_t bs_last_reset; /* last slot to reset */ + uint32_t bs_unused_slot; /* unavailable slots bitmask */ pciio_slot_t bs_min_slot; /* lowest possible slot */ pciio_slot_t bs_max_slot; /* highest possible slot */ pcibr_soft_t bs_peers_soft; /* PICs other bus's soft */ @@ -377,7 +461,7 @@ struct pcibr_soft_s { /* bs_dma_flags are the forced dma flags used on all DMAs. Used for * working around ASIC rev issues and protocol specific requirements */ - unsigned bs_dma_flags; /* forced DMA flags */ + unsigned int bs_dma_flags; /* forced DMA flags */ nasid_t bs_nasid; /* nasid this bus is on */ moduleid_t bs_moduleid; /* io brick moduleid */ @@ -474,14 +558,6 @@ struct pcibr_soft_s { unsigned bss_d64_flags; iopaddr_t bss_d32_base; unsigned bss_d32_flags; - - /* Shadow information used for implementing - * Bridge Hardware WAR #484930 - */ - atomic_t bss_ext_ates_active; - volatile unsigned *bss_cmd_pointer; - unsigned bss_cmd_shadow; - } bs_slot[8]; pcibr_intr_bits_f *bs_intr_bits; @@ -634,8 +710,8 @@ struct pcibr_soft_s { struct pcibr_hints_s { /* ph_host_slot is actually +1 so "0" means "no host" */ pciio_slot_t ph_host_slot[8]; /* REQ/GNT/INT in use by ... */ - unsigned ph_rrb_fixed; /* do not change RRB allocations */ - unsigned ph_hands_off; /* prevent further pcibr operations */ + unsigned int ph_rrb_fixed; /* do not change RRB allocations */ + unsigned int ph_hands_off; /* prevent further pcibr operations */ rrb_alloc_funct_t rrb_alloc_funct; /* do dynamic rrb allocation */ pcibr_intr_bits_f *ph_intr_bits; /* map PCI INT[ABCD] to Bridge Int(n) */ }; diff --git a/include/asm-ia64/sn/pci/pciio.h b/include/asm-ia64/sn/pci/pciio.h index 4519a84dda6c..f2168a8908ee 100644 --- a/include/asm-ia64/sn/pci/pciio.h +++ b/include/asm-ia64/sn/pci/pciio.h @@ -321,7 +321,7 @@ pciio_piomap_alloc_f (vertex_hdl_t dev, /* set up mapping for this device */ iopaddr_t pcipio_addr, /* starting address */ size_t byte_count, 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 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 */ pciio_space_t space, /* which address space */ iopaddr_t pciio_addr, /* starting address */ size_t byte_count, /* map this many bytes */ - unsigned flags); + unsigned int flags); typedef caddr_t 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 */ size_t byte_count, /* map this many bytes */ pciio_piomap_t *mapp, /* in case a piomap was needed */ - unsigned flags); + unsigned int flags); typedef iopaddr_t pciio_piospace_alloc_f (vertex_hdl_t dev, /* PIO space for this device */ @@ -370,7 +370,7 @@ typedef pciio_dmamap_t pciio_dmamap_alloc_f (vertex_hdl_t dev, /* set up mappings for this device */ device_desc_t dev_desc, /* device descriptor */ 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 pciio_dmamap_free_f (pciio_dmamap_t dmamap); @@ -388,7 +388,7 @@ pciio_dmatrans_addr_f (vertex_hdl_t dev, /* translate for this device */ device_desc_t dev_desc, /* device descriptor */ paddr_t paddr, /* system physical address */ size_t byte_count, /* length */ - unsigned flags); /* defined in dma.h */ + unsigned int flags); /* defined in dma.h */ typedef void pciio_dmamap_drain_f (pciio_dmamap_t map); @@ -433,27 +433,20 @@ pciio_provider_shutdown_f (vertex_hdl_t pciio_provider); typedef int pciio_reset_f (vertex_hdl_t conn); /* pci connection point */ -typedef int -pciio_write_gather_flush_f (vertex_hdl_t dev); /* Device flushing buffers */ - typedef pciio_endian_t /* actual endianness */ pciio_endian_set_f (vertex_hdl_t dev, /* specify endianness for this device */ pciio_endian_t device_end, /* endianness of device */ pciio_endian_t desired_end); /* desired endianness */ -typedef pciio_priority_t -pciio_priority_set_f (vertex_hdl_t pcicard, - pciio_priority_t device_prio); - typedef uint64_t pciio_config_get_f (vertex_hdl_t conn, /* pci connection point */ - unsigned reg, /* register byte offset */ - unsigned size); /* width in bytes (1..4) */ + unsigned int reg, /* register byte offset */ + unsigned int size); /* width in bytes (1..4) */ typedef void pciio_config_set_f (vertex_hdl_t conn, /* pci connection point */ - unsigned reg, /* register byte offset */ - unsigned size, /* width in bytes (1..4) */ + unsigned int reg, /* register byte offset */ + unsigned int size, /* width in bytes (1..4) */ uint64_t value); /* value to store */ typedef pciio_slot_t @@ -476,13 +469,14 @@ pciio_driver_unreg_callback_f (vertex_hdl_t conn, /* pci connection point */ typedef int pciio_device_unregister_f (vertex_hdl_t conn); -typedef pciio_businfo_t -pciio_businfo_get_f (vertex_hdl_t conn); /* * Adapters that provide a PCI interface adhere to this software interface. */ typedef struct pciio_provider_s { + /* ASIC PROVIDER ID */ + pciio_asic_type_t provider_asic; + /* PIO MANAGEMENT */ pciio_piomap_alloc_f *piomap_alloc; pciio_piomap_free_f *piomap_free; @@ -513,9 +507,7 @@ typedef struct pciio_provider_s { pciio_provider_startup_f *provider_startup; pciio_provider_shutdown_f *provider_shutdown; pciio_reset_f *reset; - pciio_write_gather_flush_f *write_gather_flush; pciio_endian_set_f *endian_set; - pciio_priority_set_f *priority_set; pciio_config_get_f *config_get; pciio_config_set_f *config_set; @@ -526,9 +518,6 @@ typedef struct pciio_provider_s { pciio_driver_reg_callback_f *driver_reg_callback; pciio_driver_unreg_callback_f *driver_unreg_callback; pciio_device_unregister_f *device_unregister; - - /* GENERIC BUS INFO */ - pciio_businfo_get_f *businfo_get; } pciio_provider_t; /* PCI devices use these standard PCI provider interfaces */ @@ -556,12 +545,9 @@ extern pciio_intr_cpu_get_f pciio_intr_cpu_get; extern pciio_provider_startup_f pciio_provider_startup; extern pciio_provider_shutdown_f pciio_provider_shutdown; extern pciio_reset_f pciio_reset; -extern pciio_write_gather_flush_f pciio_write_gather_flush; extern pciio_endian_set_f pciio_endian_set; -extern pciio_priority_set_f pciio_priority_set; extern pciio_config_get_f pciio_config_get; extern pciio_config_set_f pciio_config_set; -extern pciio_error_extract_f pciio_error_extract; /* Widgetdev in the IOERROR structure is encoded as follows. * +---------------------------+ @@ -592,7 +578,7 @@ extern int pciio_driver_register (pciio_vendor_id_t vendor_id, /* card's vendor number */ pciio_device_id_t device_id, /* card's device number */ char *driver_prefix, /* driver prefix */ - unsigned flags); + unsigned int flags); extern void pciio_error_register (vertex_hdl_t pconn, /* which slot */ @@ -706,10 +692,8 @@ extern pciio_provider_t *pciio_provider_fns_get(vertex_hdl_t provider); /* Generic pci slot information access interface */ extern pciio_info_t pciio_info_chk(vertex_hdl_t vhdl); extern pciio_info_t pciio_info_get(vertex_hdl_t vhdl); -extern pciio_info_t pciio_hostinfo_get(vertex_hdl_t vhdl); extern void pciio_info_set(vertex_hdl_t vhdl, pciio_info_t widget_info); extern vertex_hdl_t pciio_info_dev_get(pciio_info_t pciio_info); -extern vertex_hdl_t pciio_info_hostdev_get(pciio_info_t pciio_info); extern pciio_bus_t pciio_info_bus_get(pciio_info_t pciio_info); extern pciio_slot_t pciio_info_slot_get(pciio_info_t pciio_info); extern pciio_function_t pciio_info_function_get(pciio_info_t pciio_info); @@ -753,8 +737,7 @@ sn_pci_set_vchan(struct pci_dev *pci_dev, if (vchan == 1) { /* Set Bit 57 */ *addr |= (1UL << 57); - } - else { + } else { /* Clear Bit 57 */ *addr &= ~(1UL << 57); } diff --git a/include/asm-ia64/sn/pci/pciio_private.h b/include/asm-ia64/sn/pci/pciio_private.h index 05287f28cbe6..862015890dc6 100644 --- a/include/asm-ia64/sn/pci/pciio_private.h +++ b/include/asm-ia64/sn/pci/pciio_private.h @@ -20,7 +20,7 @@ * All PCI providers set up PIO using this information. */ 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 */ pciio_slot_t pp_slot; /* which slot the card is in */ pciio_space_t pp_space; /* which address space */ @@ -33,7 +33,7 @@ struct pciio_piomap_s { * All PCI providers set up DMA using this information. */ 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 */ pciio_slot_t pd_slot; /* which slot the card is in */ }; @@ -43,7 +43,7 @@ struct pciio_dmamap_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 */ device_desc_t pi_dev_desc; /* override device descriptor */ pciio_intr_line_t pi_lines; /* which interrupt line(s) */ diff --git a/include/asm-ia64/sn/pci/pic.h b/include/asm-ia64/sn/pci/pic.h index 32322ff4ab54..143534986ea3 100644 --- a/include/asm-ia64/sn/pci/pic.h +++ b/include/asm-ia64/sn/pci/pic.h @@ -66,7 +66,7 @@ #include <asm/sn/pci/pciio.h> -/********************************************************************* +/* * bus provider function table * * Normally, this table is only handed off explicitly @@ -81,705 +81,178 @@ extern pciio_provider_t pci_pic_provider; -/********************************************************************* +/* * misc defines * */ + #define PIC_WIDGET_PART_NUM_BUS0 0xd102 #define PIC_WIDGET_PART_NUM_BUS1 0xd112 #define PIC_WIDGET_MFGR_NUM 0x24 #define PIC_WIDGET_REV_A 0x1 +#define PIC_WIDGET_REV_B 0x2 +#define PIC_WIDGET_REV_C 0x3 + +#define PIC_XTALK_ADDR_MASK 0x0000FFFFFFFFFFFF +#define PIC_INTERNAL_ATES 1024 + #define IS_PIC_PART_REV_A(rev) \ ((rev == (PIC_WIDGET_PART_NUM_BUS0 << 4 | PIC_WIDGET_REV_A)) || \ (rev == (PIC_WIDGET_PART_NUM_BUS1 << 4 | PIC_WIDGET_REV_A))) +#define IS_PIC_PART_REV_B(rev) \ + ((rev == (PIC_WIDGET_PART_NUM_BUS0 << 4 | PIC_WIDGET_REV_B)) || \ + (rev == (PIC_WIDGET_PART_NUM_BUS1 << 4 | PIC_WIDGET_REV_B))) +#define IS_PIC_PART_REV_C(rev) \ + ((rev == (PIC_WIDGET_PART_NUM_BUS0 << 4 | PIC_WIDGET_REV_C)) || \ + (rev == (PIC_WIDGET_PART_NUM_BUS1 << 4 | PIC_WIDGET_REV_C))) + -/********************************************************************* - * register offset defines +/* + * misc typedefs * */ - /* Identification Register -- read-only */ -#define PIC_IDENTIFICATION 0x00000000 - - /* Status Register -- read-only */ -#define PIC_STATUS 0x00000008 - - /* Upper Address Holding Register Bus Side Errors -- read-only */ -#define PIC_UPPER_ADDR_REG_BUS_SIDE_ERRS 0x00000010 - - /* Lower Address Holding Register Bus Side Errors -- read-only */ -#define PIC_LOWER_ADDR_REG_BUS_SIDE_ERRS 0x00000018 - - /* Control Register -- read/write */ -#define PIC_CONTROL 0x00000020 - - /* PCI Request Time-out Value Register -- read/write */ -#define PIC_PCI_REQ_TIME_OUT_VALUE 0x00000028 - - /* Interrupt Destination Upper Address Register -- read/write */ -#define PIC_INTR_DEST_UPPER_ADDR 0x00000030 - - /* Interrupt Destination Lower Address Register -- read/write */ -#define PIC_INTR_DEST_LOWER_ADDR 0x00000038 - - /* Command Word Holding Register Bus Side -- read-only */ -#define PIC_CMD_WORD_REG_BUS_SIDE 0x00000040 - - /* LLP Configuration Register (Bus 0 Only) -- read/write */ -#define PIC_LLP_CFG_REG_(BUS_0_ONLY) 0x00000048 - - /* PCI Target Flush Register -- read-only */ -#define PIC_PCI_TARGET_FLUSH 0x00000050 - - /* Command Word Holding Register Link Side -- read-only */ -#define PIC_CMD_WORD_REG_LINK_SIDE 0x00000058 - - /* Response Buffer Error Upper Address Holding -- read-only */ -#define PIC_RESP_BUF_ERR_UPPER_ADDR_ 0x00000060 - - /* Response Buffer Error Lower Address Holding -- read-only */ -#define PIC_RESP_BUF_ERR_LOWER_ADDR_ 0x00000068 - - /* Test Pin Control Register -- read/write */ -#define PIC_TEST_PIN_CONTROL 0x00000070 - - /* Address Holding Register Link Side Errors -- read-only */ -#define PIC_ADDR_REG_LINK_SIDE_ERRS 0x00000078 - - /* Direct Map Register -- read/write */ -#define PIC_DIRECT_MAP 0x00000080 - - /* PCI Map Fault Address Register -- read-only */ -#define PIC_PCI_MAP_FAULT_ADDR 0x00000090 - - /* Arbitration Priority Register -- read/write */ -#define PIC_ARBITRATION_PRIORITY 0x000000A0 - - /* Internal Ram Parity Error Register -- read-only */ -#define PIC_INTERNAL_RAM_PARITY_ERR 0x000000B0 - - /* PCI Time-out Register -- read/write */ -#define PIC_PCI_TIME_OUT 0x000000C0 - - /* PCI Type 1 Configuration Register -- read/write */ -#define PIC_PCI_TYPE_1_CFG 0x000000C8 - - /* PCI Bus Error Upper Address Holding Register -- read-only */ -#define PIC_PCI_BUS_ERR_UPPER_ADDR_ 0x000000D0 - - /* PCI Bus Error Lower Address Holding Register -- read-only */ -#define PIC_PCI_BUS_ERR_LOWER_ADDR_ 0x000000D8 - - /* PCIX Error Address Register -- read-only */ -#define PIC_PCIX_ERR_ADDR 0x000000E0 - - /* PCIX Error Attribute Register -- read-only */ -#define PIC_PCIX_ERR_ATTRIBUTE 0x000000E8 - - /* PCIX Error Data Register -- read-only */ -#define PIC_PCIX_ERR_DATA 0x000000F0 - - /* PCIX Read Request Timeout Error Register -- read-only */ -#define PIC_PCIX_READ_REQ_TIMEOUT_ERR 0x000000F8 - - /* Interrupt Status Register -- read-only */ -#define PIC_INTR_STATUS 0x00000100 - - /* Interrupt Enable Register -- read/write */ -#define PIC_INTR_ENABLE 0x00000108 - - /* Reset Interrupt Status Register -- write-only */ -#define PIC_RESET_INTR_STATUS 0x00000110 - - /* Interrupt Mode Register -- read/write */ -#define PIC_INTR_MODE 0x00000118 - - /* Interrupt Device Register -- read/write */ -#define PIC_INTR_DEVICE 0x00000120 - - /* Host Error Field Register -- read/write */ -#define PIC_HOST_ERR_FIELD 0x00000128 - - /* Interrupt Pin 0 Host Address Register -- read/write */ -#define PIC_INTR_PIN_0_HOST_ADDR 0x00000130 - - /* Interrupt Pin 1 Host Address Register -- read/write */ -#define PIC_INTR_PIN_1_HOST_ADDR 0x00000138 - - /* Interrupt Pin 2 Host Address Register -- read/write */ -#define PIC_INTR_PIN_2_HOST_ADDR 0x00000140 - - /* Interrupt Pin 3 Host Address Register -- read/write */ -#define PIC_INTR_PIN_3_HOST_ADDR 0x00000148 - - /* Interrupt Pin 4 Host Address Register -- read/write */ -#define PIC_INTR_PIN_4_HOST_ADDR 0x00000150 - - /* Interrupt Pin 5 Host Address Register -- read/write */ -#define PIC_INTR_PIN_5_HOST_ADDR 0x00000158 - - /* Interrupt Pin 6 Host Address Register -- read/write */ -#define PIC_INTR_PIN_6_HOST_ADDR 0x00000160 - - /* Interrupt Pin 7 Host Address Register -- read/write */ -#define PIC_INTR_PIN_7_HOST_ADDR 0x00000168 - - /* Error Interrupt View Register -- read-only */ -#define PIC_ERR_INTR_VIEW 0x00000170 - - /* Multiple Interrupt Register -- read-only */ -#define PIC_MULTIPLE_INTR 0x00000178 - - /* Force Always Interrupt 0 Register -- write-only */ -#define PIC_FORCE_ALWAYS_INTR_0 0x00000180 - - /* Force Always Interrupt 1 Register -- write-only */ -#define PIC_FORCE_ALWAYS_INTR_1 0x00000188 - - /* Force Always Interrupt 2 Register -- write-only */ -#define PIC_FORCE_ALWAYS_INTR_2 0x00000190 - - /* Force Always Interrupt 3 Register -- write-only */ -#define PIC_FORCE_ALWAYS_INTR_3 0x00000198 - - /* Force Always Interrupt 4 Register -- write-only */ -#define PIC_FORCE_ALWAYS_INTR_4 0x000001A0 - - /* Force Always Interrupt 5 Register -- write-only */ -#define PIC_FORCE_ALWAYS_INTR_5 0x000001A8 - - /* Force Always Interrupt 6 Register -- write-only */ -#define PIC_FORCE_ALWAYS_INTR_6 0x000001B0 - - /* Force Always Interrupt 7 Register -- write-only */ -#define PIC_FORCE_ALWAYS_INTR_7 0x000001B8 - - /* Force w/Pin Interrupt 0 Register -- write-only */ -#define PIC_FORCE_PIN_INTR_0 0x000001C0 - - /* Force w/Pin Interrupt 1 Register -- write-only */ -#define PIC_FORCE_PIN_INTR_1 0x000001C8 - - /* Force w/Pin Interrupt 2 Register -- write-only */ -#define PIC_FORCE_PIN_INTR_2 0x000001D0 - - /* Force w/Pin Interrupt 3 Register -- write-only */ -#define PIC_FORCE_PIN_INTR_3 0x000001D8 - - /* Force w/Pin Interrupt 4 Register -- write-only */ -#define PIC_FORCE_PIN_INTR_4 0x000001E0 - - /* Force w/Pin Interrupt 5 Register -- write-only */ -#define PIC_FORCE_PIN_INTR_5 0x000001E8 - - /* Force w/Pin Interrupt 6 Register -- write-only */ -#define PIC_FORCE_PIN_INTR_6 0x000001F0 - - /* Force w/Pin Interrupt 7 Register -- write-only */ -#define PIC_FORCE_PIN_INTR_7 0x000001F8 - - /* Device 0 Register -- read/write */ -#define PIC_DEVICE_0 0x00000200 - - /* Device 1 Register -- read/write */ -#define PIC_DEVICE_1 0x00000208 - - /* Device 2 Register -- read/write */ -#define PIC_DEVICE_2 0x00000210 - - /* Device 3 Register -- read/write */ -#define PIC_DEVICE_3 0x00000218 - - /* Device 0 Write Request Buffer Register -- read-only */ -#define PIC_DEVICE_0_WRITE_REQ_BUF 0x00000240 - - /* Device 1 Write Request Buffer Register -- read-only */ -#define PIC_DEVICE_1_WRITE_REQ_BUF 0x00000248 - - /* Device 2 Write Request Buffer Register -- read-only */ -#define PIC_DEVICE_2_WRITE_REQ_BUF 0x00000250 - - /* Device 3 Write Request Buffer Register -- read-only */ -#define PIC_DEVICE_3_WRITE_REQ_BUF 0x00000258 - - /* Even Device Response Buffer Register -- read/write */ -#define PIC_EVEN_DEVICE_RESP_BUF 0x00000280 - - /* Odd Device Response Buffer Register -- read/write */ -#define PIC_ODD_DEVICE_RESP_BUF 0x00000288 - - /* Read Response Buffer Status Register -- read-only */ -#define PIC_READ_RESP_BUF_STATUS 0x00000290 - - /* Read Response Buffer Clear Register -- write-only */ -#define PIC_READ_RESP_BUF_CLEAR 0x00000298 - - /* PCI RR 0 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_0_UPPER_ADDR_MATCH 0x00000300 - - /* PCI RR 0 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_0_LOWER_ADDR_MATCH 0x00000308 - - /* PCI RR 1 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_1_UPPER_ADDR_MATCH 0x00000310 - - /* PCI RR 1 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_1_LOWER_ADDR_MATCH 0x00000318 - - /* PCI RR 2 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_2_UPPER_ADDR_MATCH 0x00000320 - - /* PCI RR 2 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_2_LOWER_ADDR_MATCH 0x00000328 - - /* PCI RR 3 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_3_UPPER_ADDR_MATCH 0x00000330 - - /* PCI RR 3 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_3_LOWER_ADDR_MATCH 0x00000338 - - /* PCI RR 4 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_4_UPPER_ADDR_MATCH 0x00000340 - - /* PCI RR 4 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_4_LOWER_ADDR_MATCH 0x00000348 - - /* PCI RR 5 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_5_UPPER_ADDR_MATCH 0x00000350 - - /* PCI RR 5 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_5_LOWER_ADDR_MATCH 0x00000358 - - /* PCI RR 6 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_6_UPPER_ADDR_MATCH 0x00000360 - - /* PCI RR 6 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_6_LOWER_ADDR_MATCH 0x00000368 - - /* PCI RR 7 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_7_UPPER_ADDR_MATCH 0x00000370 - - /* PCI RR 7 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_7_LOWER_ADDR_MATCH 0x00000378 - - /* PCI RR 8 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_8_UPPER_ADDR_MATCH 0x00000380 - - /* PCI RR 8 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_8_LOWER_ADDR_MATCH 0x00000388 - - /* PCI RR 9 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_9_UPPER_ADDR_MATCH 0x00000390 - - /* PCI RR 9 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_9_LOWER_ADDR_MATCH 0x00000398 - - /* PCI RR 10 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_10_UPPER_ADDR_MATCH 0x000003A0 - - /* PCI RR 10 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_10_LOWER_ADDR_MATCH 0x000003A8 - - /* PCI RR 11 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_11_UPPER_ADDR_MATCH 0x000003B0 - - /* PCI RR 11 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_11_LOWER_ADDR_MATCH 0x000003B8 - - /* PCI RR 12 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_12_UPPER_ADDR_MATCH 0x000003C0 - - /* PCI RR 12 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_12_LOWER_ADDR_MATCH 0x000003C8 - - /* PCI RR 13 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_13_UPPER_ADDR_MATCH 0x000003D0 - - /* PCI RR 13 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_13_LOWER_ADDR_MATCH 0x000003D8 - - /* PCI RR 14 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_14_UPPER_ADDR_MATCH 0x000003E0 - - /* PCI RR 14 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_14_LOWER_ADDR_MATCH 0x000003E8 - - /* PCI RR 15 Upper Address Match Register -- read-only */ -#define PIC_PCI_RR_15_UPPER_ADDR_MATCH 0x000003F0 - - /* PCI RR 15 Lower Address Match Register -- read-only */ -#define PIC_PCI_RR_15_LOWER_ADDR_MATCH 0x000003F8 - - /* Buffer 0 Flush Count with Data Touch Register -- read/write */ -#define PIC_BUF_0_FLUSH_CNT_WITH_DATA_TOUCH 0x00000400 - - /* Buffer 0 Flush Count w/o Data Touch Register -- read/write */ -#define PIC_BUF_0_FLUSH_CNT_W_O_DATA_TOUCH 0x00000408 - - /* Buffer 0 Request in Flight Count Register -- read/write */ -#define PIC_BUF_0_REQ_IN_FLIGHT_CNT 0x00000410 - - /* Buffer 0 Prefetch Request Count Register -- read/write */ -#define PIC_BUF_0_PREFETCH_REQ_CNT 0x00000418 - - /* Buffer 0 Total PCI Retry Count Register -- read/write */ -#define PIC_BUF_0_TOTAL_PCI_RETRY_CNT 0x00000420 - - /* Buffer 0 Max PCI Retry Count Register -- read/write */ -#define PIC_BUF_0_MAX_PCI_RETRY_CNT 0x00000428 - - /* Buffer 0 Max Latency Count Register -- read/write */ -#define PIC_BUF_0_MAX_LATENCY_CNT 0x00000430 - - /* Buffer 0 Clear All Register -- read/write */ -#define PIC_BUF_0_CLEAR_ALL 0x00000438 - - /* Buffer 2 Flush Count with Data Touch Register -- read/write */ -#define PIC_BUF_2_FLUSH_CNT_WITH_DATA_TOUCH 0x00000440 - - /* Buffer 2 Flush Count w/o Data Touch Register -- read/write */ -#define PIC_BUF_2_FLUSH_CNT_W_O_DATA_TOUCH 0x00000448 - - /* Buffer 2 Request in Flight Count Register -- read/write */ -#define PIC_BUF_2_REQ_IN_FLIGHT_CNT 0x00000450 - - /* Buffer 2 Prefetch Request Count Register -- read/write */ -#define PIC_BUF_2_PREFETCH_REQ_CNT 0x00000458 - - /* Buffer 2 Total PCI Retry Count Register -- read/write */ -#define PIC_BUF_2_TOTAL_PCI_RETRY_CNT 0x00000460 - - /* Buffer 2 Max PCI Retry Count Register -- read/write */ -#define PIC_BUF_2_MAX_PCI_RETRY_CNT 0x00000468 - - /* Buffer 2 Max Latency Count Register -- read/write */ -#define PIC_BUF_2_MAX_LATENCY_CNT 0x00000470 - - /* Buffer 2 Clear All Register -- read/write */ -#define PIC_BUF_2_CLEAR_ALL 0x00000478 - - /* Buffer 4 Flush Count with Data Touch Register -- read/write */ -#define PIC_BUF_4_FLUSH_CNT_WITH_DATA_TOUCH 0x00000480 - - /* Buffer 4 Flush Count w/o Data Touch Register -- read/write */ -#define PIC_BUF_4_FLUSH_CNT_W_O_DATA_TOUCH 0x00000488 - - /* Buffer 4 Request in Flight Count Register -- read/write */ -#define PIC_BUF_4_REQ_IN_FLIGHT_CNT 0x00000490 - - /* Buffer 4 Prefetch Request Count Register -- read/write */ -#define PIC_BUF_4_PREFETCH_REQ_CNT 0x00000498 - - /* Buffer 4 Total PCI Retry Count Register -- read/write */ -#define PIC_BUF_4_TOTAL_PCI_RETRY_CNT 0x000004A0 - - /* Buffer 4 Max PCI Retry Count Register -- read/write */ -#define PIC_BUF_4_MAX_PCI_RETRY_CNT 0x000004A8 - - /* Buffer 4 Max Latency Count Register -- read/write */ -#define PIC_BUF_4_MAX_LATENCY_CNT 0x000004B0 - - /* Buffer 4 Clear All Register -- read/write */ -#define PIC_BUF_4_CLEAR_ALL 0x000004B8 - - /* Buffer 6 Flush Count with Data Touch Register -- read/write */ -#define PIC_BUF_6_FLUSH_CNT_WITH_DATA_TOUCH 0x000004C0 - - /* Buffer 6 Flush Count w/o Data Touch Register -- read/write */ -#define PIC_BUF_6_FLUSH_CNT_W_O_DATA_TOUCH 0x000004C8 - - /* Buffer 6 Request in Flight Count Register -- read/write */ -#define PIC_BUF_6_REQ_IN_FLIGHT_CNT 0x000004D0 - - /* Buffer 6 Prefetch Request Count Register -- read/write */ -#define PIC_BUF_6_PREFETCH_REQ_CNT 0x000004D8 - - /* Buffer 6 Total PCI Retry Count Register -- read/write */ -#define PIC_BUF_6_TOTAL_PCI_RETRY_CNT 0x000004E0 - - /* Buffer 6 Max PCI Retry Count Register -- read/write */ -#define PIC_BUF_6_MAX_PCI_RETRY_CNT 0x000004E8 - - /* Buffer 6 Max Latency Count Register -- read/write */ -#define PIC_BUF_6_MAX_LATENCY_CNT 0x000004F0 - - /* Buffer 6 Clear All Register -- read/write */ -#define PIC_BUF_6_CLEAR_ALL 0x000004F8 - - /* Buffer 8 Flush Count with Data Touch Register -- read/write */ -#define PIC_BUF_8_FLUSH_CNT_WITH_DATA_TOUCH 0x00000500 - - /* Buffer 8 Flush Count w/o Data Touch Register -- read/write */ -#define PIC_BUF_8_FLUSH_CNT_W_O_DATA_TOUCH 0x00000508 - - /* Buffer 8 Request in Flight Count Register -- read/write */ -#define PIC_BUF_8_REQ_IN_FLIGHT_CNT 0x00000510 - - /* Buffer 8 Prefetch Request Count Register -- read/write */ -#define PIC_BUF_8_PREFETCH_REQ_CNT 0x00000518 - - /* Buffer 8 Total PCI Retry Count Register -- read/write */ -#define PIC_BUF_8_TOTAL_PCI_RETRY_CNT 0x00000520 - - /* Buffer 8 Max PCI Retry Count Register -- read/write */ -#define PIC_BUF_8_MAX_PCI_RETRY_CNT 0x00000528 - - /* Buffer 8 Max Latency Count Register -- read/write */ -#define PIC_BUF_8_MAX_LATENCY_CNT 0x00000530 - - /* Buffer 8 Clear All Register -- read/write */ -#define PIC_BUF_8_CLEAR_ALL 0x00000538 - - /* Buffer 10 Flush Count with Data Touch Register -- read/write */ -#define PIC_BUF_10_FLUSH_CNT_WITH_DATA_TOUCH 0x00000540 - - /* Buffer 10 Flush Count w/o Data Touch Register -- read/write */ -#define PIC_BUF_10_FLUSH_CNT_W_O_DATA_TOUCH 0x00000548 - - /* Buffer 10 Request in Flight Count Register -- read/write */ -#define PIC_BUF_10_REQ_IN_FLIGHT_CNT 0x00000550 - - /* Buffer 10 Prefetch Request Count Register -- read/write */ -#define PIC_BUF_10_PREFETCH_REQ_CNT 0x00000558 - - /* Buffer 10 Total PCI Retry Count Register -- read/write */ -#define PIC_BUF_10_TOTAL_PCI_RETRY_CNT 0x00000560 - - /* Buffer 10 Max PCI Retry Count Register -- read/write */ -#define PIC_BUF_10_MAX_PCI_RETRY_CNT 0x00000568 - - /* Buffer 10 Max Latency Count Register -- read/write */ -#define PIC_BUF_10_MAX_LATENCY_CNT 0x00000570 - - /* Buffer 10 Clear All Register -- read/write */ -#define PIC_BUF_10_CLEAR_ALL 0x00000578 - - /* Buffer 12 Flush Count with Data Touch Register -- read/write */ -#define PIC_BUF_12_FLUSH_CNT_WITH_DATA_TOUCH 0x00000580 - - /* Buffer 12 Flush Count w/o Data Touch Register -- read/write */ -#define PIC_BUF_12_FLUSH_CNT_W_O_DATA_TOUCH 0x00000588 - - /* Buffer 12 Request in Flight Count Register -- read/write */ -#define PIC_BUF_12_REQ_IN_FLIGHT_CNT 0x00000590 - - /* Buffer 12 Prefetch Request Count Register -- read/write */ -#define PIC_BUF_12_PREFETCH_REQ_CNT 0x00000598 - - /* Buffer 12 Total PCI Retry Count Register -- read/write */ -#define PIC_BUF_12_TOTAL_PCI_RETRY_CNT 0x000005A0 - - /* Buffer 12 Max PCI Retry Count Register -- read/write */ -#define PIC_BUF_12_MAX_PCI_RETRY_CNT 0x000005A8 - - /* Buffer 12 Max Latency Count Register -- read/write */ -#define PIC_BUF_12_MAX_LATENCY_CNT 0x000005B0 - - /* Buffer 12 Clear All Register -- read/write */ -#define PIC_BUF_12_CLEAR_ALL 0x000005B8 - - /* Buffer 14 Flush Count with Data Touch Register -- read/write */ -#define PIC_BUF_14_FLUSH_CNT_WITH_DATA_TOUCH 0x000005C0 - - /* Buffer 14 Flush Count w/o Data Touch Register -- read/write */ -#define PIC_BUF_14_FLUSH_CNT_W_O_DATA_TOUCH 0x000005C8 - - /* Buffer 14 Request in Flight Count Register -- read/write */ -#define PIC_BUF_14_REQ_IN_FLIGHT_CNT 0x000005D0 - - /* Buffer 14 Prefetch Request Count Register -- read/write */ -#define PIC_BUF_14_PREFETCH_REQ_CNT 0x000005D8 - - /* Buffer 14 Total PCI Retry Count Register -- read/write */ -#define PIC_BUF_14_TOTAL_PCI_RETRY_CNT 0x000005E0 - - /* Buffer 14 Max PCI Retry Count Register -- read/write */ -#define PIC_BUF_14_MAX_PCI_RETRY_CNT 0x000005E8 - - /* Buffer 14 Max Latency Count Register -- read/write */ -#define PIC_BUF_14_MAX_LATENCY_CNT 0x000005F0 - - /* Buffer 14 Clear All Register -- read/write */ -#define PIC_BUF_14_CLEAR_ALL 0x000005F8 - - /* PCIX Read Buffer 0 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_0_ADDR 0x00000A00 - - /* PCIX Read Buffer 0 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_0_ATTRIBUTE 0x00000A08 - - /* PCIX Read Buffer 1 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_1_ADDR 0x00000A10 - - /* PCIX Read Buffer 1 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_1_ATTRIBUTE 0x00000A18 - - /* PCIX Read Buffer 2 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_2_ADDR 0x00000A20 - - /* PCIX Read Buffer 2 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_2_ATTRIBUTE 0x00000A28 - - /* PCIX Read Buffer 3 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_3_ADDR 0x00000A30 - - /* PCIX Read Buffer 3 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_3_ATTRIBUTE 0x00000A38 - - /* PCIX Read Buffer 4 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_4_ADDR 0x00000A40 - - /* PCIX Read Buffer 4 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_4_ATTRIBUTE 0x00000A48 - - /* PCIX Read Buffer 5 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_5_ADDR 0x00000A50 - - /* PCIX Read Buffer 5 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_5_ATTRIBUTE 0x00000A58 - - /* PCIX Read Buffer 6 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_6_ADDR 0x00000A60 - - /* PCIX Read Buffer 6 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_6_ATTRIBUTE 0x00000A68 - - /* PCIX Read Buffer 7 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_7_ADDR 0x00000A70 - - /* PCIX Read Buffer 7 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_7_ATTRIBUTE 0x00000A78 - - /* PCIX Read Buffer 8 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_8_ADDR 0x00000A80 - - /* PCIX Read Buffer 8 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_8_ATTRIBUTE 0x00000A88 - - /* PCIX Read Buffer 9 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_9_ADDR 0x00000A90 - - /* PCIX Read Buffer 9 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_9_ATTRIBUTE 0x00000A98 - - /* PCIX Read Buffer 10 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_10_ADDR 0x00000AA0 - - /* PCIX Read Buffer 10 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_10_ATTRIBUTE 0x00000AA8 - - /* PCIX Read Buffer 11 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_11_ADDR 0x00000AB0 - - /* PCIX Read Buffer 11 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_11_ATTRIBUTE 0x00000AB8 - - /* PCIX Read Buffer 12 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_12_ADDR 0x00000AC0 - - /* PCIX Read Buffer 12 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_12_ATTRIBUTE 0x00000AC8 - - /* PCIX Read Buffer 13 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_13_ADDR 0x00000AD0 - - /* PCIX Read Buffer 13 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_13_ATTRIBUTE 0x00000AD8 - - /* PCIX Read Buffer 14 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_14_ADDR 0x00000AE0 - - /* PCIX Read Buffer 14 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_14_ATTRIBUTE 0x00000AE8 - - /* PCIX Read Buffer 15 Address Register -- read-only */ -#define PIC_PCIX_READ_BUF_15_ADDR 0x00000AF0 - - /* PCIX Read Buffer 15 Attribute Register -- read-only */ -#define PIC_PCIX_READ_BUF_15_ATTRIBUTE 0x00000AF8 - - /* PCIX Write Buffer 0 Address Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_0_ADDR 0x00000B00 - - /* PCIX Write Buffer 0 Attribute Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_0_ATTRIBUTE 0x00000B08 - - /* PCIX Write Buffer 0 Valid Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_0_VALID 0x00000B10 - - /* PCIX Write Buffer 1 Address Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_1_ADDR 0x00000B20 - - /* PCIX Write Buffer 1 Attribute Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_1_ATTRIBUTE 0x00000B28 - - /* PCIX Write Buffer 1 Valid Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_1_VALID 0x00000B30 - - /* PCIX Write Buffer 2 Address Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_2_ADDR 0x00000B40 - - /* PCIX Write Buffer 2 Attribute Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_2_ATTRIBUTE 0x00000B48 +typedef uint64_t picreg_t; +typedef uint64_t picate_t; - /* PCIX Write Buffer 2 Valid Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_2_VALID 0x00000B50 +/* + * PIC Bridge MMR defines + */ - /* PCIX Write Buffer 3 Address Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_3_ADDR 0x00000B60 +/* + * PIC STATUS register offset 0x00000008 + */ - /* PCIX Write Buffer 3 Attribute Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_3_ATTRIBUTE 0x00000B68 +#define PIC_STAT_PCIX_ACTIVE_SHFT 33 - /* PCIX Write Buffer 3 Valid Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_3_VALID 0x00000B70 +/* + * PIC CONTROL register offset 0x00000020 + */ - /* PCIX Write Buffer 4 Address Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_4_ADDR 0x00000B80 +#define PIC_CTRL_PCI_SPEED_SHFT 4 +#define PIC_CTRL_PCI_SPEED (0x3 << PIC_CTRL_PCI_SPEED_SHFT) +#define PIC_CTRL_PAGE_SIZE_SHFT 21 +#define PIC_CTRL_PAGE_SIZE (0x1 << PIC_CTRL_PAGE_SIZE_SHFT) - /* PCIX Write Buffer 4 Attribute Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_4_ATTRIBUTE 0x00000B88 - /* PCIX Write Buffer 4 Valid Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_4_VALID 0x00000B90 +/* + * PIC Intr Destination Addr offset 0x00000038 + */ - /* PCIX Write Buffer 5 Address Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_5_ADDR 0x00000BA0 +#define PIC_INTR_DEST_ADDR 0x0000FFFFFFFFFFFF +#define PIC_INTR_DEST_TID_SHFT 48 +#define PIC_INTR_DEST_TID (0xFull << PIC_INTR_DEST_TID_SHFT) - /* PCIX Write Buffer 5 Attribute Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_5_ATTRIBUTE 0x00000BA8 +/* + * PIC PCI Responce Buffer offset 0x00000068 + */ +#define PIC_RSP_BUF_ADDR 0x0000FFFFFFFFFFFF +#define PIC_RSP_BUF_NUM_SHFT 48 +#define PIC_RSP_BUF_NUM (0xFull << PIC_RSP_BUF_NUM_SHFT) +#define PIC_RSP_BUF_DEV_NUM_SHFT 52 +#define PIC_RSP_BUF_DEV_NUM (0x3ull << PIC_RSP_BUF_DEV_NUM_SHFT) - /* PCIX Write Buffer 5 Valid Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_5_VALID 0x00000BB0 +/* + * PIC PCI DIRECT MAP register offset 0x00000080 + */ +#define PIC_DIRMAP_DIROFF_SHFT 0 +#define PIC_DIRMAP_DIROFF (0x1FFFF << PIC_DIRMAP_DIROFF_SHFT) +#define PIC_DIRMAP_ADD512_SHFT 17 +#define PIC_DIRMAP_ADD512 (0x1 << PIC_DIRMAP_ADD512_SHFT) +#define PIC_DIRMAP_WID_SHFT 20 +#define PIC_DIRMAP_WID (0xF << PIC_DIRMAP_WID_SHFT) - /* PCIX Write Buffer 6 Address Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_6_ADDR 0x00000BC0 +#define PIC_DIRMAP_OFF_ADDRSHFT 31 - /* PCIX Write Buffer 6 Attribute Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_6_ATTRIBUTE 0x00000BC8 +/* + * Interrupt Status register offset 0x00000100 + */ +#define PIC_ISR_PCIX_SPLIT_MSG_PE (0x1ull << 45) +#define PIC_ISR_PCIX_SPLIT_EMSG (0x1ull << 44) +#define PIC_ISR_PCIX_SPLIT_TO (0x1ull << 43) +#define PIC_ISR_PCIX_UNEX_COMP (0x1ull << 42) +#define PIC_ISR_INT_RAM_PERR (0x1ull << 41) +#define PIC_ISR_PCIX_ARB_ERR (0x1ull << 40) +#define PIC_ISR_PCIX_REQ_TOUT (0x1ull << 39) +#define PIC_ISR_PCIX_TABORT (0x1ull << 38) +#define PIC_ISR_PCIX_PERR (0x1ull << 37) +#define PIC_ISR_PCIX_SERR (0x1ull << 36) +#define PIC_ISR_PCIX_MRETRY (0x1ull << 35) +#define PIC_ISR_PCIX_MTOUT (0x1ull << 34) +#define PIC_ISR_PCIX_DA_PARITY (0x1ull << 33) +#define PIC_ISR_PCIX_AD_PARITY (0x1ull << 32) +#define PIC_ISR_PMU_PAGE_FAULT (0x1ull << 30) +#define PIC_ISR_UNEXP_RESP (0x1ull << 29) +#define PIC_ISR_BAD_XRESP_PKT (0x1ull << 28) +#define PIC_ISR_BAD_XREQ_PKT (0x1ull << 27) +#define PIC_ISR_RESP_XTLK_ERR (0x1ull << 26) +#define PIC_ISR_REQ_XTLK_ERR (0x1ull << 25) +#define PIC_ISR_INVLD_ADDR (0x1ull << 24) +#define PIC_ISR_UNSUPPORTED_XOP (0x1ull << 23) +#define PIC_ISR_XREQ_FIFO_OFLOW (0x1ull << 22) +#define PIC_ISR_LLP_REC_SNERR (0x1ull << 21) +#define PIC_ISR_LLP_REC_CBERR (0x1ull << 20) +#define PIC_ISR_LLP_RCTY (0x1ull << 19) +#define PIC_ISR_LLP_TX_RETRY (0x1ull << 18) +#define PIC_ISR_LLP_TCTY (0x1ull << 17) +#define PIC_ISR_PCI_ABORT (0x1ull << 15) +#define PIC_ISR_PCI_PARITY (0x1ull << 14) +#define PIC_ISR_PCI_SERR (0x1ull << 13) +#define PIC_ISR_PCI_PERR (0x1ull << 12) +#define PIC_ISR_PCI_MST_TIMEOUT (0x1ull << 11) +#define PIC_ISR_PCI_RETRY_CNT (0x1ull << 10) +#define PIC_ISR_XREAD_REQ_TIMEOUT (0x1ull << 9) +#define PIC_ISR_INT_MSK (0xffull << 0) +#define PIC_ISR_INT(x) (0x1ull << (x)) + +#define PIC_ISR_LINK_ERROR \ + (PIC_ISR_LLP_REC_SNERR|PIC_ISR_LLP_REC_CBERR| \ + PIC_ISR_LLP_RCTY|PIC_ISR_LLP_TX_RETRY| \ + PIC_ISR_LLP_TCTY) + +#define PIC_ISR_PCIBUS_PIOERR \ + (PIC_ISR_PCI_MST_TIMEOUT|PIC_ISR_PCI_ABORT| \ + PIC_ISR_PCIX_MTOUT|PIC_ISR_PCIX_TABORT) + +#define PIC_ISR_PCIBUS_ERROR \ + (PIC_ISR_PCIBUS_PIOERR|PIC_ISR_PCI_PERR| \ + PIC_ISR_PCI_SERR|PIC_ISR_PCI_RETRY_CNT| \ + PIC_ISR_PCI_PARITY|PIC_ISR_PCIX_PERR| \ + PIC_ISR_PCIX_SERR|PIC_ISR_PCIX_MRETRY| \ + PIC_ISR_PCIX_AD_PARITY|PIC_ISR_PCIX_DA_PARITY| \ + PIC_ISR_PCIX_REQ_TOUT|PIC_ISR_PCIX_UNEX_COMP| \ + PIC_ISR_PCIX_SPLIT_TO|PIC_ISR_PCIX_SPLIT_EMSG| \ + PIC_ISR_PCIX_SPLIT_MSG_PE) + +#define PIC_ISR_XTALK_ERROR \ + (PIC_ISR_XREAD_REQ_TIMEOUT|PIC_ISR_XREQ_FIFO_OFLOW| \ + PIC_ISR_UNSUPPORTED_XOP|PIC_ISR_INVLD_ADDR| \ + PIC_ISR_REQ_XTLK_ERR|PIC_ISR_RESP_XTLK_ERR| \ + PIC_ISR_BAD_XREQ_PKT|PIC_ISR_BAD_XRESP_PKT| \ + PIC_ISR_UNEXP_RESP) + +#define PIC_ISR_ERRORS \ + (PIC_ISR_LINK_ERROR|PIC_ISR_PCIBUS_ERROR| \ + PIC_ISR_XTALK_ERROR| \ + PIC_ISR_PMU_PAGE_FAULT|PIC_ISR_INT_RAM_PERR) - /* PCIX Write Buffer 6 Valid Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_6_VALID 0x00000BD0 +/* + * PIC RESET INTR register offset 0x00000110 + */ - /* PCIX Write Buffer 7 Address Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_7_ADDR 0x00000BE0 +#define PIC_IRR_ALL_CLR 0xffffffffffffffff - /* PCIX Write Buffer 7 Attribute Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_7_ATTRIBUTE 0x00000BE8 +/* + * PIC PCI Host Intr Addr offset 0x00000130 - 0x00000168 + */ +#define PIC_HOST_INTR_ADDR 0x0000FFFFFFFFFFFF +#define PIC_HOST_INTR_FLD_SHFT 48 +#define PIC_HOST_INTR_FLD (0xFFull << PIC_HOST_INTR_FLD_SHFT) - /* PCIX Write Buffer 7 Valid Register -- read-only */ -#define PIC_PCIX_WRITE_BUF_7_VALID 0x00000BF0 -/********************************************************************* - * misc typedefs - * +/* + * PIC MMR structure mapping */ -typedef uint64_t picreg_t; -typedef uint64_t picate_t; - -/***************************************************************************** - *********************** PIC MMR structure mapping *************************** - *****************************************************************************/ /* NOTE: PIC WAR. PV#854697. PIC does not allow writes just to [31:0] * of a 64-bit register. When writing PIC registers, always write the diff --git a/include/asm-ia64/sn/pda.h b/include/asm-ia64/sn/pda.h index 51ce9a9f879e..20e9b5775435 100644 --- a/include/asm-ia64/sn/pda.h +++ b/include/asm-ia64/sn/pda.h @@ -8,12 +8,9 @@ #ifndef _ASM_IA64_SN_PDA_H #define _ASM_IA64_SN_PDA_H -#include <linux/config.h> #include <linux/cache.h> #include <asm/percpu.h> #include <asm/system.h> -#include <asm/processor.h> -#include <asm/page.h> #include <asm/sn/bte.h> diff --git a/include/asm-ia64/sn/pio.h b/include/asm-ia64/sn/pio.h index 4c0b9f0486a0..da74b96905f4 100644 --- a/include/asm-ia64/sn/pio.h +++ b/include/asm-ia64/sn/pio.h @@ -8,9 +8,7 @@ #ifndef _ASM_IA64_SN_PIO_H #define _ASM_IA64_SN_PIO_H -#include <linux/types.h> -#include <asm/sn/sgi.h> -#include <asm/sn/driver.h> +#include <asm/sn/types.h> /* * pioaddr_t - The kernel virtual address that a PIO can be done upon. @@ -18,7 +16,7 @@ * 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). diff --git a/include/asm-ia64/sn/sgi.h b/include/asm-ia64/sn/sgi.h index 57b3b4ecf826..4f050825eead 100644 --- a/include/asm-ia64/sn/sgi.h +++ b/include/asm-ia64/sn/sgi.h @@ -14,8 +14,6 @@ #include <asm/sn/types.h> #include <asm/uaccess.h> /* for copy_??_user */ -#include <linux/mm.h> -#include <linux/fs.h> #include <asm/sn/hwgfs.h> typedef hwgfs_handle_t vertex_hdl_t; @@ -44,6 +42,21 @@ typedef enum graph_error_e { #define CPU_NONE (-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 diff --git a/include/asm-ia64/sn/sn2/arch.h b/include/asm-ia64/sn/sn2/arch.h index db7f09301d98..f944f24cc6da 100644 --- a/include/asm-ia64/sn/sn2/arch.h +++ b/include/asm-ia64/sn/sn2/arch.h @@ -8,9 +8,6 @@ #ifndef _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_SUBNODE 4 /* CPUs on a single hub PI */ diff --git a/include/asm-ia64/sn/sn2/intr.h b/include/asm-ia64/sn/sn2/intr.h index 270b78bf99e5..2d3df0574b8c 100644 --- a/include/asm-ia64/sn/sn2/intr.h +++ b/include/asm-ia64/sn/sn2/intr.h @@ -19,8 +19,8 @@ #define SGI_ACPI_SCI_INT (0x34) #define SGI_XPC_NOTIFY (0xe7) -#define IA64_SN2_FIRST_DEVICE_VECTOR (0x34) -#define IA64_SN2_LAST_DEVICE_VECTOR (0xe7) +#define IA64_SN2_FIRST_DEVICE_VECTOR (0x37) +#define IA64_SN2_LAST_DEVICE_VECTOR (0xe6) #define SN2_IRQ_RESERVED (0x1) #define SN2_IRQ_CONNECTED (0x2) diff --git a/include/asm-ia64/sn/sn2/io.h b/include/asm-ia64/sn/sn2/io.h index 3a3b1e214164..1ed535abd010 100644 --- a/include/asm-ia64/sn/sn2/io.h +++ b/include/asm-ia64/sn/sn2/io.h @@ -27,6 +27,10 @@ extern void sn_dma_flush(unsigned long); #define __sn_readw ___sn_readw #define __sn_readl ___sn_readl #define __sn_readq ___sn_readq +#define __sn_readb_relaxed ___sn_readb_relaxed +#define __sn_readw_relaxed ___sn_readw_relaxed +#define __sn_readl_relaxed ___sn_readl_relaxed +#define __sn_readq_relaxed ___sn_readq_relaxed /* * The following routines are SN Platform specific, called when @@ -208,25 +212,25 @@ sn_inl_fast (unsigned long port) } static inline unsigned char -sn_readb_fast (void *addr) +___sn_readb_relaxed (void *addr) { return *(volatile unsigned char *)addr; } static inline unsigned short -sn_readw_fast (void *addr) +___sn_readw_relaxed (void *addr) { return *(volatile unsigned short *)addr; } static inline unsigned int -sn_readl_fast (void *addr) +___sn_readl_relaxed (void *addr) { return *(volatile unsigned int *) addr; } static inline unsigned long -sn_readq_fast (void *addr) +___sn_readq_relaxed (void *addr) { return *(volatile unsigned long *) addr; } diff --git a/include/asm-ia64/sn/sn2/sn_private.h b/include/asm-ia64/sn/sn2/sn_private.h index e9c2940d4c58..bea5eee0a116 100644 --- a/include/asm-ia64/sn/sn2/sn_private.h +++ b/include/asm-ia64/sn/sn2/sn_private.h @@ -8,6 +8,7 @@ #ifndef _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/io.h> #include <asm/sn/xtalk/xwidget.h> @@ -20,7 +21,7 @@ extern void he_arcs_set_vectors(void); extern void mem_init(void); extern void cpu_unenable(cpuid_t); 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 char get_console_pcislot(void); @@ -28,7 +29,7 @@ extern int is_master_baseio_nasid_widget(nasid_t test_nasid, xwidgetnum_t test_wid); /* 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_read_accessible(paddr_t); extern int memory_write_accessible(paddr_t); @@ -86,7 +87,7 @@ void install_klidbg_functions(void); /* klnuma.c */ 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); /* init.c */ @@ -109,7 +110,7 @@ extern int check_ni_errors(void); /* Used for debugger to signal upper software a breakpoint has taken place */ extern void *debugger_update; -extern __psunsigned_t debugger_stopped; +extern unsigned long debugger_stopped; /* * piomap, created by shub_pio_alloc. @@ -234,9 +235,6 @@ extern void sysctlr_keepalive(void); #define paddr_cnode(_pa) (NASID_TO_COMPACT_NODEID(NASID_GET(_pa))) 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 *, ...)); void bootstrap(void); diff --git a/include/asm-ia64/sn/sn_cpuid.h b/include/asm-ia64/sn/sn_cpuid.h index a2831ceb16a8..0c7cce652368 100644 --- a/include/asm-ia64/sn/sn_cpuid.h +++ b/include/asm-ia64/sn/sn_cpuid.h @@ -13,12 +13,8 @@ #include <linux/config.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/intrinsics.h> /* diff --git a/include/asm-ia64/sn/sn_private.h b/include/asm-ia64/sn/sn_private.h index ee0a7addf65b..897b8310dbf6 100644 --- a/include/asm-ia64/sn/sn_private.h +++ b/include/asm-ia64/sn/sn_private.h @@ -8,11 +8,6 @@ #ifndef _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> #endif /* _ASM_IA64_SN_SN_PRIVATE_H */ diff --git a/include/asm-ia64/sn/types.h b/include/asm-ia64/sn/types.h index 0275ce759abf..5f821c07808f 100644 --- a/include/asm-ia64/sn/types.h +++ b/include/asm-ia64/sn/types.h @@ -9,21 +9,15 @@ #ifndef _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 signed short nasid_t; /* node id in numa-as-id space */ typedef signed char partid_t; /* partition ID type */ typedef unsigned int moduleid_t; /* user-visible module number 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 uint64_t __psunsigned_t; - typedef unsigned long iopaddr_t; -typedef unsigned char uchar_t; typedef unsigned long paddr_t; typedef unsigned long pfn_t; typedef short cnodeid_t; diff --git a/include/asm-ia64/sn/vector.h b/include/asm-ia64/sn/vector.h index e87801a74e8b..6b39c7ace4b5 100644 --- a/include/asm-ia64/sn/vector.h +++ b/include/asm-ia64/sn/vector.h @@ -8,8 +8,6 @@ #ifndef _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_BAD ((net_vec_t) -1) diff --git a/include/asm-ia64/sn/xtalk/xbow.h b/include/asm-ia64/sn/xtalk/xbow.h index 596e17caaf29..b1019a81bcc9 100644 --- a/include/asm-ia64/sn/xtalk/xbow.h +++ b/include/asm-ia64/sn/xtalk/xbow.h @@ -12,7 +12,7 @@ * 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/xwidget.h> #include <asm/sn/xtalk/xswitch.h> @@ -55,12 +55,6 @@ #ifndef __ASSEMBLY__ 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 */ typedef volatile struct xb_linkregs_s { /* @@ -224,14 +218,6 @@ typedef struct xbow_cfg_s { /* of the widget0 address space (before 0xf4) */ #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 */ #define XB_LINK_BASE 0x100 #define XB_LINK_OFFSET 0x40 @@ -356,9 +342,6 @@ typedef struct xbow_cfg_s { XWIDGET_MFG_NUM(wid) == XXBOW_WIDGET_MFGR_NUM) #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__ /* diff --git a/include/asm-ia64/sn/xtalk/xtalk.h b/include/asm-ia64/sn/xtalk/xtalk.h index aaf1f7a51d7a..dc6e8b2f3728 100644 --- a/include/asm-ia64/sn/xtalk/xtalk.h +++ b/include/asm-ia64/sn/xtalk/xtalk.h @@ -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 */ size_t byte_count, 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 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 */ device_desc_t dev_desc, /* device descriptor */ iopaddr_t xtalk_addr, /* Crosstalk address */ size_t byte_count, /* map this many bytes */ - unsigned flags); /* (currently unused) */ + unsigned int flags); /* (currently unused) */ extern caddr_t 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 */ size_t byte_count, /* map this many bytes */ xtalk_piomap_t *xtalk_piomapp, /* RETURNS mapping resources */ - unsigned flags); /* (currently unused) */ + unsigned int flags); /* (currently unused) */ /* DMA MANAGEMENT */ @@ -129,7 +129,7 @@ typedef xtalk_dmamap_t xtalk_dmamap_alloc_f (vertex_hdl_t dev, /* set up mappings for this device */ device_desc_t dev_desc, /* device descriptor */ 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 xtalk_dmamap_free_f (xtalk_dmamap_t dmamap); @@ -142,7 +142,7 @@ xtalk_dmamap_addr_f (xtalk_dmamap_t dmamap, /* use these mapping resources typedef alenlist_t xtalk_dmamap_list_f (xtalk_dmamap_t dmamap, /* use these mapping resources */ alenlist_t alenlist, /* map this address/length list */ - unsigned flags); + unsigned int flags); typedef void xtalk_dmamap_done_f (xtalk_dmamap_t dmamap); @@ -152,13 +152,13 @@ xtalk_dmatrans_addr_f (vertex_hdl_t dev, /* translate for this device */ device_desc_t dev_desc, /* device descriptor */ paddr_t paddr, /* system physical address */ size_t byte_count, /* length */ - unsigned flags); + unsigned int flags); typedef alenlist_t xtalk_dmatrans_list_f (vertex_hdl_t dev, /* translate for this device */ device_desc_t dev_desc, /* device descriptor */ alenlist_t palenlist, /* system address/length list */ - unsigned flags); + unsigned int flags); typedef void 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, int which, iopaddr_t xtalk_addr, size_t byte_count, - unsigned flags); + unsigned int flags); /* * Adapters that provide a crosstalk interface adhere to this software interface. diff --git a/include/asm-ia64/sn/xtalk/xwidget.h b/include/asm-ia64/sn/xtalk/xwidget.h index 28e453fc52af..15a298a584ec 100644 --- a/include/asm-ia64/sn/xtalk/xwidget.h +++ b/include/asm-ia64/sn/xtalk/xwidget.h @@ -139,17 +139,17 @@ typedef volatile struct widget_cfg { } widget_cfg_t; typedef struct { - unsigned other:8; - unsigned bo:1; - unsigned error:1; - unsigned vbpm:1; - unsigned gbr:1; - unsigned ds:2; - unsigned ct:1; - unsigned tnum:5; - unsigned pactyp:4; - unsigned sidn:4; - unsigned didn:4; + unsigned int other:8; + unsigned int bo:1; + unsigned int error:1; + unsigned int vbpm:1; + unsigned int gbr:1; + unsigned int ds:2; + unsigned int ct:1; + unsigned int tnum:5; + unsigned int pactyp:4; + unsigned int sidn:4; + unsigned int didn:4; } w_err_cmd_word_f; typedef union { @@ -188,7 +188,7 @@ typedef struct xwidget_hwid_s { extern int xwidget_driver_register(xwidget_part_num_t part_num, xwidget_mfg_num_t mfg_num, char *driver_prefix, - unsigned flags); + unsigned int flags); extern void xwidget_driver_unregister(char *driver_prefix); @@ -230,7 +230,7 @@ extern xwidgetnum_t hub_widget_id(nasid_t); * However, since nobody looks inside ... */ 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. } v_widget_t; #endif /* _KERNEL */ diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h index f6b971b5267c..d4105bd76489 100644 --- a/include/asm-ia64/topology.h +++ b/include/asm-ia64/topology.h @@ -29,15 +29,6 @@ #define node_to_cpumask(node) (node_to_cpu_mask[node]) /* - * Returns the number of the node containing MemBlk 'memblk' - */ -#ifdef CONFIG_ACPI_NUMA -#define memblk_to_node(memblk) (node_memblk[memblk].nid) -#else -#define memblk_to_node(memblk) (memblk) -#endif - -/* * Returns the number of the node containing Node 'nid'. * Not implemented here. Multi-level hierarchies detected with * the help of node_distance(). @@ -49,12 +40,6 @@ */ #define node_to_first_cpu(node) (__ffs(node_to_cpumask(node))) -/* - * Returns the number of the first MemBlk on Node 'node' - * Should be fixed when IA64 discontigmem goes in. - */ -#define node_to_memblk(node) (node) - /* Cross-node load balancing interval. */ #define NODE_BALANCE_RATE 10 diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h index 2dfc57e2a37e..5ba49b332a19 100644 --- a/include/asm-m68k/io.h +++ b/include/asm-m68k/io.h @@ -261,6 +261,10 @@ static inline void isa_delay(void) #define writeb(val,addr) out_8((addr),(val)) #define writew(val,addr) out_le16((addr),(val)) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) + #ifndef CONFIG_ISA #define inb(port) in_8(port) #define outb(val,port) out_8((port),(val)) diff --git a/include/asm-m68k/pci.h b/include/asm-m68k/pci.h index 0a006a50e801..57e1487bac3f 100644 --- a/include/asm-m68k/pci.h +++ b/include/asm-m68k/pci.h @@ -36,6 +36,7 @@ struct pci_bus_info }; #define pcibios_assign_all_busses() 0 +#define pcibios_scan_all_fns(a, b) 0 static inline void pcibios_set_master(struct pci_dev *dev) { diff --git a/include/asm-m68k/virtconvert.h b/include/asm-m68k/virtconvert.h index 435fca52a91e..68205b61820c 100644 --- a/include/asm-m68k/virtconvert.h +++ b/include/asm-m68k/virtconvert.h @@ -19,8 +19,8 @@ * Change virtual addresses to physical addresses and vv. */ #ifndef CONFIG_SUN3 -extern unsigned long mm_vtop(unsigned long addr) __attribute__ ((const)); -extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const)); +extern unsigned long mm_vtop(unsigned long addr) __attribute_const__; +extern unsigned long mm_ptov(unsigned long addr) __attribute_const__; #else static inline unsigned long mm_vtop(unsigned long vaddr) { diff --git a/include/asm-m68knommu/io.h b/include/asm-m68knommu/io.h index f42645e4a2d2..654bf15adf1b 100644 --- a/include/asm-m68knommu/io.h +++ b/include/asm-m68knommu/io.h @@ -39,6 +39,10 @@ static inline unsigned int _swapl(volatile unsigned long v) #define readl(addr) \ ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; }) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) + #define writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b)) #define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b)) #define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b)) diff --git a/include/asm-m68knommu/pci.h b/include/asm-m68knommu/pci.h index 8720031e4412..a99ce768f4a6 100644 --- a/include/asm-m68knommu/pci.h +++ b/include/asm-m68knommu/pci.h @@ -11,6 +11,8 @@ #define PCIBIOS_MIN_IO 0x100 #define PCIBIOS_MIN_MEM 0x00010000 +#define pcibios_scan_all_fns(a, b) 0 + /* * Return whether the given PCI device DMA address mask can * be supported properly. For example, if your device can diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h index aff491b61f6f..a8962b53d96a 100644 --- a/include/asm-mips/io.h +++ b/include/asm-mips/io.h @@ -264,6 +264,10 @@ extern void iounmap(void *addr); #define readw(addr) __ioswab16(__raw_readw(addr)) #define readl(addr) __ioswab32(__raw_readl(addr)) #define readq(addr) __ioswab64(__raw_readq(addr)) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) +#define readq_relaxed(addr) readq(addr) #define __raw_writeb(b,addr) ((*(volatile unsigned char *)(addr)) = (b)) #define __raw_writew(w,addr) ((*(volatile unsigned short *)(addr)) = (w)) diff --git a/include/asm-mips/mmzone.h b/include/asm-mips/mmzone.h index cba337b07be1..69cb153bb254 100644 --- a/include/asm-mips/mmzone.h +++ b/include/asm-mips/mmzone.h @@ -75,9 +75,8 @@ extern plat_pg_data_t *plat_node_data[]; (((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \ sizeof(struct page)))) -#define kern_addr_valid(addr) ((KVADDR_TO_NID((unsigned long)addr) > \ - -1) ? 0 : (test_bit(LOCAL_MAP_NR((addr)), \ - NODE_DATA(KVADDR_TO_NID((unsigned long)addr))->valid_addr_bitmap))) +/* XXX: FIXME -- wli */ +#define kern_addr_valid(addr) (0) #define pfn_to_page(pfn) (mem_map + (pfn)) #define page_to_pfn(page) \ diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h index cd96c958408f..3943c111647e 100644 --- a/include/asm-mips/pci.h +++ b/include/asm-mips/pci.h @@ -20,6 +20,7 @@ extern unsigned int pcibios_assign_all_busses(void); #else #define pcibios_assign_all_busses() 0 #endif +#define pcibios_scan_all_fns(a, b) 0 #define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_MEM 0x10000000 diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h index 0350f0198995..cd89e57a48b4 100644 --- a/include/asm-parisc/io.h +++ b/include/asm-parisc/io.h @@ -171,6 +171,11 @@ extern __inline__ void ___raw_writeq(unsigned long long val, unsigned long addr) #define writeq(b,addr) __raw_writeq(cpu_to_le64(b),addr) #endif /* !USE_HPPA_IOREMAP */ +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) +#define readq_relaxed(addr) readq(addr) + extern void __memcpy_fromio(unsigned long dest, unsigned long src, int count); extern void __memcpy_toio(unsigned long dest, unsigned long src, int count); extern void __memset_io(unsigned long dest, char fill, int count); diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index ce754492efa2..aca998aef8f1 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h @@ -174,6 +174,7 @@ extern inline void pcibios_register_hba(struct pci_hba_data *x) ** to zero for legacy platforms and one for PAT platforms. */ #define pcibios_assign_all_busses() (pdc_type == PDC_TYPE_PAT) +#define pcibios_scan_all_fns(a, b) 0 #define PCIBIOS_MIN_IO 0x10 #define PCIBIOS_MIN_MEM 0x1000 /* NBPG - but pci/setup-res.c dies */ diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h index 55e67291c3d2..0c78d0c505c7 100644 --- a/include/asm-ppc/io.h +++ b/include/asm-ppc/io.h @@ -58,6 +58,9 @@ extern unsigned long pci_dram_offset; #define writel(b,addr) out_le32((volatile u32 *)(addr),(b)) #endif /* CONFIG_APUS */ +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) #define __raw_readb(addr) (*(volatile unsigned char *)(addr)) #define __raw_readw(addr) (*(volatile unsigned short *)(addr)) @@ -208,7 +211,7 @@ extern void *ioremap64(unsigned long long address, unsigned long size); #define ioremap_nocache(addr, size) ioremap((addr), (size)) extern void iounmap(void *addr); extern unsigned long iopa(unsigned long addr); -extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const)); +extern unsigned long mm_ptov(unsigned long addr) __attribute_const__; extern void io_block_mapping(unsigned long virt, phys_addr_t phys, unsigned int size, int flags); diff --git a/include/asm-ppc/kgdb.h b/include/asm-ppc/kgdb.h index 13e09287cae6..1d3c927ce626 100644 --- a/include/asm-ppc/kgdb.h +++ b/include/asm-ppc/kgdb.h @@ -11,8 +11,17 @@ #define _PPC_KGDB_H #ifndef __ASSEMBLY__ -/* To initialize the serial, first thing called */ + +/* Things specific to the gen550 backend. */ +struct uart_port; + +extern void gen550_progress(char *, unsigned short); +extern void gen550_kgdb_map_scc(void); +extern void gen550_init(int, struct uart_port *); + +/* Things specific to the pmac backend. */ extern void zs_kgdb_hook(int tty_num); + /* To init the kgdb engine. (called by serial hook)*/ extern void set_debug_traps(void); diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h index 01ffbcd3cdbf..54cb5a93d508 100644 --- a/include/asm-ppc/machdep.h +++ b/include/asm-ppc/machdep.h @@ -53,6 +53,7 @@ struct machdep_calls { void (*setup_io_mappings)(void); void (*progress)(char *, unsigned short); + void (*kgdb_map_scc)(void); unsigned char (*nvram_read_val)(int addr); void (*nvram_write_val)(int addr, unsigned char val); diff --git a/include/asm-ppc/param.h b/include/asm-ppc/param.h index 428a10582ac6..5b6b7dafd7b1 100644 --- a/include/asm-ppc/param.h +++ b/include/asm-ppc/param.h @@ -1,16 +1,16 @@ #ifndef _ASM_PPC_PARAM_H #define _ASM_PPC_PARAM_H -#ifndef HZ -#define HZ 100 -#endif - #ifdef __KERNEL__ -#define HZ 100 /* internal timer frequency */ +#define HZ 1000 /* internal timer frequency */ #define USER_HZ 100 /* for user interfaces in "ticks" */ #define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */ #endif /* __KERNEL__ */ +#ifndef HZ +#define HZ 100 +#endif + #define EXEC_PAGESIZE 4096 #ifndef NGROUPS diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index 5dad69a5ee61..16d617508242 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h @@ -26,6 +26,7 @@ struct pci_dev; extern int pci_assign_all_busses; #define pcibios_assign_all_busses() (pci_assign_all_busses) +#define pcibios_scan_all_fns(a, b) 0 #define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_MEM 0x10000000 diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index 53fa036d620a..0cf6aab40dfb 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h @@ -626,7 +626,7 @@ extern void cache_clear(__u32 addr, int length); extern void cache_push(__u32 addr, int length); extern int mm_end_of_chunk (unsigned long addr, int len); extern unsigned long iopa(unsigned long addr); -extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const)); +extern unsigned long mm_ptov(unsigned long addr) __attribute_const__; /* Values for nocacheflag and cmode */ /* These are not used by the APUS kernel_map, but prevents diff --git a/include/asm-ppc64/hvcall.h b/include/asm-ppc64/hvcall.h index 5ddaf5474166..482ca2220b31 100644 --- a/include/asm-ppc64/hvcall.h +++ b/include/asm-ppc64/hvcall.h @@ -102,6 +102,8 @@ long plpar_hcall(unsigned long opcode, unsigned long *out2, unsigned long *out3); +#define HVSC ".long 0x44000022\n" + /* Same as plpar_hcall but for those opcodes that return no values * other than status. Slightly more efficient. */ diff --git a/include/asm-ppc64/hvconsole.h b/include/asm-ppc64/hvconsole.h new file mode 100644 index 000000000000..17154864fcaa --- /dev/null +++ b/include/asm-ppc64/hvconsole.h @@ -0,0 +1,30 @@ +/* + * hvconsole.h + * Copyright (C) 2004 Ryan S Arnold, IBM Corporation + * + * LPAR console support. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _PPC64_HVCONSOLE_H +#define _PPC64_HVCONSOLE_H + +extern int hvc_get_chars(int index, char *buf, int count); +extern int hvc_put_chars(int index, const char *buf, int count); +extern int hvc_count(int *start_termno); + +#endif /* _PPC64_HVCONSOLE_H */ + diff --git a/include/asm-ppc64/iSeries/vio.h b/include/asm-ppc64/iSeries/vio.h index 779c56680349..0ef098c4efe2 100644 --- a/include/asm-ppc64/iSeries/vio.h +++ b/include/asm-ppc64/iSeries/vio.h @@ -49,7 +49,7 @@ * in. We use a table to route these, and this defines * the maximum number of distinct subtypes */ -#define VIO_MAX_SUBTYPES 7 +#define VIO_MAX_SUBTYPES 8 /* Each subtype can register a handler to process their events. * The handler must have this interface. @@ -103,7 +103,8 @@ enum viosubtypes { viomajorsubtype_chario = 0x0300, viomajorsubtype_config = 0x0400, viomajorsubtype_cdio = 0x0500, - viomajorsubtype_tape = 0x0600 + viomajorsubtype_tape = 0x0600, + viomajorsubtype_scsi = 0x0700 }; diff --git a/include/asm-ppc64/io.h b/include/asm-ppc64/io.h index 389d81374d6b..8d24669c13cd 100644 --- a/include/asm-ppc64/io.h +++ b/include/asm-ppc64/io.h @@ -79,6 +79,10 @@ extern unsigned long pci_io_base; #define outsl(port, buf, nl) _outsl_ns((u32 *)((port)+pci_io_base), (buf), (nl)) #endif +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) + extern void _insb(volatile u8 *port, void *buf, int ns); extern void _outsb(volatile u8 *port, const void *buf, int ns); extern void _insw(volatile u16 *port, void *buf, int ns); diff --git a/include/asm-ppc64/mmzone.h b/include/asm-ppc64/mmzone.h index 7a305c682693..7503c373f55e 100644 --- a/include/asm-ppc64/mmzone.h +++ b/include/asm-ppc64/mmzone.h @@ -72,11 +72,8 @@ static inline int pa_to_nid(unsigned long pa) #define local_mapnr(kvaddr) \ ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) -#if 0 -/* XXX fix - Anton */ -#define kern_addr_valid(kaddr) test_bit(local_mapnr(kaddr), \ - NODE_DATA(kvaddr_to_nid(kaddr))->valid_addr_bitmap) -#endif +/* XXX fix - Anton - and wli */ +#define kern_addr_valid(kaddr) (0) /* Written this way to avoid evaluating arguments twice */ #define discontigmem_pfn_to_page(pfn) \ diff --git a/include/asm-ppc64/paca.h b/include/asm-ppc64/paca.h index 1babe35028d5..24a2e99faae1 100644 --- a/include/asm-ppc64/paca.h +++ b/include/asm-ppc64/paca.h @@ -64,14 +64,13 @@ struct paca_struct { u16 xHwProcNum; /* Physical processor number 0x1A */ u32 default_decr; /* Default decrementer value 0x1c */ u64 xKsave; /* Saved Kernel stack addr or zero 0x20 */ - u64 pvr; /* Processor version register 0x28 */ struct ItLpQueue *lpQueuePtr; /* LpQueue handled by this processor 0x30 */ u64 xTOC; /* Kernel TOC address 0x38 */ STAB xStab_data; /* Segment table information 0x40,0x48,0x50 */ u8 *exception_sp; /* 0x58 */ u8 xProcEnabled; /* 0x59 */ u8 prof_enabled; /* 1=iSeries profiling enabled 0x60 */ - u8 resv1[30]; /* 0x61-0x7F */ + u8 resv1[38]; /* 0x61-0x7F */ /*===================================================================================== * CACHE_LINE_2 0x0080 - 0x00FF diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h index 305ca8cd8235..60d3832dd934 100644 --- a/include/asm-ppc64/pci.h +++ b/include/asm-ppc64/pci.h @@ -19,6 +19,14 @@ #define PCIBIOS_MIN_IO 0x1000 #define PCIBIOS_MIN_MEM 0x10000000 +extern int pcibios_scan_all_fns(struct pci_bus *bus, int devfn); + +#ifdef CONFIG_PPC_ISERIES +#define pcibios_scan_all_fns(a, b) 0 +#else +extern int pcibios_scan_all_fns(struct pci_bus *bus, int devfn); +#endif + static inline void pcibios_set_master(struct pci_dev *dev) { /* No special bus mastering setup handling */ diff --git a/include/asm-ppc64/topology.h b/include/asm-ppc64/topology.h index a41ca6cba882..c6846ecfaf8b 100644 --- a/include/asm-ppc64/topology.h +++ b/include/asm-ppc64/topology.h @@ -19,8 +19,6 @@ static inline int cpu_to_node(int cpu) return node; } -#define memblk_to_node(memblk) (memblk) - #define parent_node(node) (node) static inline cpumask_t node_to_cpumask(int node) @@ -35,8 +33,6 @@ static inline int node_to_first_cpu(int node) return first_cpu(tmp); } -#define node_to_memblk(node) (node) - #define pcibus_to_cpumask(bus) (cpu_online_map) #define nr_cpus_node(node) (nr_cpus_in_node[node]) diff --git a/include/asm-ppc64/vio.h b/include/asm-ppc64/vio.h index 7ee1250a7d41..fd68008e2c66 100644 --- a/include/asm-ppc64/vio.h +++ b/include/asm-ppc64/vio.h @@ -16,6 +16,7 @@ #include <linux/init.h> #include <linux/errno.h> +#include <linux/device.h> #include <asm/hvcall.h> #include <asm/prom.h> #include <asm/scatterlist.h> @@ -40,11 +41,11 @@ struct vio_device_id; struct TceTable; int vio_register_driver(struct vio_driver *drv); -int vio_unregister_driver(struct vio_driver *drv); +void vio_unregister_driver(struct vio_driver *drv); const struct vio_device_id * vio_match_device(const struct vio_device_id *ids, const struct vio_dev *dev); struct vio_dev * __devinit vio_register_device(struct device_node *node_vdev); -int __devinit vio_unregister_device(struct vio_dev *dev); +void __devinit vio_unregister_device(struct vio_dev *dev); const void * vio_get_attribute(struct vio_dev *vdev, void* which, int* length); int vio_get_irq(struct vio_dev *dev); struct TceTable * vio_build_tce_table(struct vio_dev *dev); @@ -64,11 +65,11 @@ void *vio_alloc_consistent(struct vio_dev *dev, size_t size, void vio_free_consistent(struct vio_dev *dev, size_t size, void *vaddr, dma_addr_t dma_handle); +extern struct bus_type vio_bus_type; + struct vio_device_id { char *type; char *compat; -/* I don't think we need this - unsigned long driver_data; */ /* Data private to the driver */ }; struct vio_driver { @@ -76,55 +77,33 @@ struct vio_driver { char *name; const struct vio_device_id *id_table; /* NULL if wants all devices */ int (*probe) (struct vio_dev *dev, const struct vio_device_id *id); /* New device inserted */ - void (*remove) (struct vio_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ + int (*remove) (struct vio_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ unsigned long driver_data; + + struct device_driver driver; }; -struct vio_bus; +static inline struct vio_driver *to_vio_driver(struct device_driver *drv) +{ + return container_of(drv, struct vio_driver, driver); +} + /* * The vio_dev structure is used to describe virtual I/O devices. */ struct vio_dev { - struct list_head devices_list; /* node in list of all vio devices */ - struct device_node *archdata; /* Open Firmware node */ - struct vio_bus *bus; /* bus this device is on */ - struct vio_driver *driver; /* owning driver */ + struct device_node *archdata; /* Open Firmware node */ void *driver_data; /* data private to the driver */ unsigned long unit_address; - - struct TceTable *tce_table; /* vio_map_* uses this */ + struct TceTable *tce_table; /* vio_map_* uses this */ unsigned int irq; - struct proc_dir_entry *procent; /* device entry in /proc/bus/vio */ -}; -struct vio_bus { - struct list_head devices; /* list of virtual devices */ + struct device dev; }; - -static inline int vio_module_init(struct vio_driver *drv) +static inline struct vio_dev *to_vio_dev(struct device *dev) { - int rc = vio_register_driver (drv); - - if (rc > 0) - return 0; - - /* iff CONFIG_HOTPLUG and built into kernel, we should - * leave the driver around for future hotplug events. - * For the module case, a hotplug daemon of some sort - * should load a module in response to an insert event. */ -#if defined(CONFIG_HOTPLUG) && !defined(MODULE) - if (rc == 0) - return 0; -#else - if (rc == 0) - rc = -ENODEV; -#endif - - /* if we get here, we need to clean up vio driver instance - * and return some sort of error */ - - return rc; + return container_of(dev, struct vio_dev, dev); } #endif /* _PHYP_H */ diff --git a/include/asm-s390/io.h b/include/asm-s390/io.h index bfd0a02b2b1b..de7312221010 100644 --- a/include/asm-s390/io.h +++ b/include/asm-s390/io.h @@ -87,6 +87,10 @@ extern void iounmap(void *addr); #define readw(addr) (*(volatile unsigned short *) __io_virt(addr)) #define readl(addr) (*(volatile unsigned int *) __io_virt(addr)) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) + #define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b)) #define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b)) #define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) diff --git a/include/asm-sh/io.h b/include/asm-sh/io.h index e4264dcc30c7..09b2a54b44cd 100644 --- a/include/asm-sh/io.h +++ b/include/asm-sh/io.h @@ -130,6 +130,10 @@ # define writel(v,a) ({ __raw_writel((v),(unsigned long)(a)); mb(); }) #endif +#define readb_relaxed(a) readb(a) +#define readw_relaxed(a) readw(a) +#define readl_relaxed(a) readl(a) + /* * If the platform has PC-like I/O, this function converts the offset into * an address. diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h index d314b8d1b340..fe2c08b2e7cd 100644 --- a/include/asm-sh/pci.h +++ b/include/asm-sh/pci.h @@ -12,6 +12,7 @@ or architectures with incomplete PCI setup by the loader */ #define pcibios_assign_all_busses() 1 +#define pcibios_scan_all_fns(a, b) 0 /* * A board can define one or more PCI channels that represent built-in (or diff --git a/include/asm-sparc/btfixup.h b/include/asm-sparc/btfixup.h index f0ea6d09d1de..b84c96c89581 100644 --- a/include/asm-sparc/btfixup.h +++ b/include/asm-sparc/btfixup.h @@ -39,7 +39,7 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void); extern __type ___f_##__name(__args); \ extern unsigned ___fs_##__name[3]; #define BTFIXUPDEF_CALL_CONST(__type, __name, __args...) \ - extern __type ___f_##__name(__args) __attribute__((const)); \ + extern __type ___f_##__name(__args) __attribute_const__; \ extern unsigned ___fs_##__name[3]; #define BTFIXUP_CALL(__name) ___f_##__name @@ -49,7 +49,7 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void); /* Put bottom 13bits into some register variable */ #define BTFIXUPDEF_SIMM13(__name) \ - extern unsigned int ___sf_##__name(void) __attribute__((const)); \ + extern unsigned int ___sf_##__name(void) __attribute_const__; \ extern unsigned ___ss_##__name[2]; \ extern __inline__ unsigned int ___sf_##__name(void) { \ unsigned int ret; \ @@ -57,7 +57,7 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void); return ret; \ } #define BTFIXUPDEF_SIMM13_INIT(__name,__val) \ - extern unsigned int ___sf_##__name(void) __attribute__((const)); \ + extern unsigned int ___sf_##__name(void) __attribute_const__; \ extern unsigned ___ss_##__name[2]; \ extern __inline__ unsigned int ___sf_##__name(void) { \ unsigned int ret; \ @@ -71,7 +71,7 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void); */ #define BTFIXUPDEF_HALF(__name) \ - extern unsigned int ___af_##__name(void) __attribute__((const)); \ + extern unsigned int ___af_##__name(void) __attribute_const__; \ extern unsigned ___as_##__name[2]; \ extern __inline__ unsigned int ___af_##__name(void) { \ unsigned int ret; \ @@ -79,7 +79,7 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void); return ret; \ } #define BTFIXUPDEF_HALF_INIT(__name,__val) \ - extern unsigned int ___af_##__name(void) __attribute__((const)); \ + extern unsigned int ___af_##__name(void) __attribute_const__; \ extern unsigned ___as_##__name[2]; \ extern __inline__ unsigned int ___af_##__name(void) { \ unsigned int ret; \ @@ -90,7 +90,7 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void); /* Put upper 22 bits into some register variable */ #define BTFIXUPDEF_SETHI(__name) \ - extern unsigned int ___hf_##__name(void) __attribute__((const)); \ + extern unsigned int ___hf_##__name(void) __attribute_const__; \ extern unsigned ___hs_##__name[2]; \ extern __inline__ unsigned int ___hf_##__name(void) { \ unsigned int ret; \ @@ -98,7 +98,7 @@ extern unsigned int ___illegal_use_of_BTFIXUP_INT_in_module(void); return ret; \ } #define BTFIXUPDEF_SETHI_INIT(__name,__val) \ - extern unsigned int ___hf_##__name(void) __attribute__((const)); \ + extern unsigned int ___hf_##__name(void) __attribute_const__; \ extern unsigned ___hs_##__name[2]; \ extern __inline__ unsigned int ___hf_##__name(void) { \ unsigned int ret; \ diff --git a/include/asm-sparc/io.h b/include/asm-sparc/io.h index 72c304cad644..a77fb0dd9c10 100644 --- a/include/asm-sparc/io.h +++ b/include/asm-sparc/io.h @@ -99,6 +99,9 @@ static inline void __writel(u32 b, unsigned long addr) #define readb(addr) __readb((unsigned long)(addr)) #define readw(addr) __readw((unsigned long)(addr)) #define readl(addr) __readl((unsigned long)(addr)) +#define readb_relaxed(addr) readb(addr) +#define readw_relaxed(addr) readw(addr) +#define readl_relaxed(addr) readl(addr) #define writeb(b, addr) __writeb((b),(unsigned long)(addr)) #define writew(b, addr) __writew((b),(unsigned long)(addr)) diff --git a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h index 2c17e7ef1e71..e97afc5a44db 100644 --- a/include/asm-sparc/pci.h +++ b/include/asm-sparc/pci.h @@ -8,6 +8,7 @@ * or architectures with incomplete PCI setup by the loader. */ #define pcibios_assign_all_busses() 0 +#define pcibios_scan_all_fns(a, b) 0 #define PCIBIOS_MIN_IO 0UL #define PCIBIOS_MIN_MEM 0UL diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index bba6e03c4cbb..b0baa22ffa48 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h @@ -80,7 +80,7 @@ BTFIXUPDEF_SIMM13(pmd_shift) BTFIXUPDEF_SETHI(pmd_size) BTFIXUPDEF_SETHI(pmd_mask) -extern unsigned int pmd_align(unsigned int addr) __attribute__((const)); +extern unsigned int pmd_align(unsigned int addr) __attribute_const__; extern __inline__ unsigned int pmd_align(unsigned int addr) { return ((addr + ~BTFIXUP_SETHI(pmd_mask)) & BTFIXUP_SETHI(pmd_mask)); @@ -90,7 +90,7 @@ BTFIXUPDEF_SIMM13(pgdir_shift) BTFIXUPDEF_SETHI(pgdir_size) BTFIXUPDEF_SETHI(pgdir_mask) -extern unsigned int pgdir_align(unsigned int addr) __attribute__((const)); +extern unsigned int pgdir_align(unsigned int addr) __attribute_const__; extern __inline__ unsigned int pgdir_align(unsigned int addr) { return ((addr + ~BTFIXUP_SETHI(pgdir_mask)) & BTFIXUP_SETHI(pgdir_mask)); @@ -248,19 +248,19 @@ BTFIXUPDEF_HALF(pte_writei) BTFIXUPDEF_HALF(pte_dirtyi) BTFIXUPDEF_HALF(pte_youngi) -extern int pte_write(pte_t pte) __attribute__((const)); +extern int pte_write(pte_t pte) __attribute_const__; extern __inline__ int pte_write(pte_t pte) { return pte_val(pte) & BTFIXUP_HALF(pte_writei); } -extern int pte_dirty(pte_t pte) __attribute__((const)); +extern int pte_dirty(pte_t pte) __attribute_const__; extern __inline__ int pte_dirty(pte_t pte) { return pte_val(pte) & BTFIXUP_HALF(pte_dirtyi); } -extern int pte_young(pte_t pte) __attribute__((const)); +extern int pte_young(pte_t pte) __attribute_const__; extern __inline__ int pte_young(pte_t pte) { return pte_val(pte) & BTFIXUP_HALF(pte_youngi); @@ -271,7 +271,7 @@ extern __inline__ int pte_young(pte_t pte) */ BTFIXUPDEF_HALF(pte_filei) -extern int pte_file(pte_t pte) __attribute__((const)); +extern int pte_file(pte_t pte) __attribute_const__; extern __inline__ int pte_file(pte_t pte) { return pte_val(pte) & BTFIXUP_HALF(pte_filei); @@ -283,19 +283,19 @@ BTFIXUPDEF_HALF(pte_wrprotecti) BTFIXUPDEF_HALF(pte_mkcleani) BTFIXUPDEF_HALF(pte_mkoldi) -extern pte_t pte_wrprotect(pte_t pte) __attribute__((const)); +extern pte_t pte_wrprotect(pte_t pte) __attribute_const__; extern __inline__ pte_t pte_wrprotect(pte_t pte) { return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_wrprotecti)); } -extern pte_t pte_mkclean(pte_t pte) __attribute__((const)); +extern pte_t pte_mkclean(pte_t pte) __attribute_const__; extern __inline__ pte_t pte_mkclean(pte_t pte) { return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_mkcleani)); } -extern pte_t pte_mkold(pte_t pte) __attribute__((const)); +extern pte_t pte_mkold(pte_t pte) __attribute_const__; extern __inline__ pte_t pte_mkold(pte_t pte) { return __pte(pte_val(pte) & ~BTFIXUP_HALF(pte_mkoldi)); @@ -332,7 +332,7 @@ BTFIXUPDEF_CALL_CONST(pte_t, mk_pte_io, unsigned long, pgprot_t, int) BTFIXUPDEF_INT(pte_modify_mask) -extern pte_t pte_modify(pte_t pte, pgprot_t newprot) __attribute__((const)); +extern pte_t pte_modify(pte_t pte, pgprot_t newprot) __attribute_const__; extern __inline__ pte_t pte_modify(pte_t pte, pgprot_t newprot) { return __pte((pte_val(pte) & BTFIXUP_INT(pte_modify_mask)) | diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h index 0745a2349ace..3d842cae6562 100644 --- a/include/asm-sparc64/io.h +++ b/include/asm-sparc64/io.h @@ -176,6 +176,10 @@ static __inline__ void _writeq(u64 q, unsigned long addr) #define readw(__addr) (_readw((unsigned long)(__addr))) #define readl(__addr) (_readl((unsigned long)(__addr))) #define readq(__addr) (_readq((unsigned long)(__addr))) +#define readb_relaxed(a) readb(a) +#define readw_relaxed(a) readw(a) +#define readl_relaxed(a) readl(a) +#define readq_relaxed(a) readq(a) #define writeb(__b, __addr) (_writeb((u8)(__b), (unsigned long)(__addr))) #define writew(__w, __addr) (_writew((u16)(__w), (unsigned long)(__addr))) #define writel(__l, __addr) (_writel((u32)(__l), (unsigned long)(__addr))) diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index 2dbd268962e6..ea722dcb49d8 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h @@ -11,6 +11,7 @@ * or architectures with incomplete PCI setup by the loader. */ #define pcibios_assign_all_busses() 0 +#define pcibios_scan_all_fns(a, b) 0 #define PCIBIOS_MIN_IO 0UL #define PCIBIOS_MIN_MEM 0UL diff --git a/include/asm-um/pci.h b/include/asm-um/pci.h index b44cf59ede1e..59923199cdc3 100644 --- a/include/asm-um/pci.h +++ b/include/asm-um/pci.h @@ -2,5 +2,6 @@ #define __UM_PCI_H #define PCI_DMA_BUS_IS_PHYS (1) +#define pcibios_scan_all_fns(a, b) 0 #endif diff --git a/include/asm-v850/io.h b/include/asm-v850/io.h index ed796a1d4e21..255f48b28c97 100644 --- a/include/asm-v850/io.h +++ b/include/asm-v850/io.h @@ -23,6 +23,10 @@ #define readl(addr) \ ({ unsigned long __v = (*(volatile unsigned long *) (addr)); __v; }) +#define readb_relaxed(a) readb(a) +#define readw_relaxed(a) readw(a) +#define readl_relaxed(a) readl(a) + #define writeb(b, addr) \ (void)((*(volatile unsigned char *) (addr)) = (b)) #define writew(b, addr) \ diff --git a/include/asm-v850/pci.h b/include/asm-v850/pci.h index b915819c609b..81addb7df017 100644 --- a/include/asm-v850/pci.h +++ b/include/asm-v850/pci.h @@ -17,6 +17,8 @@ /* Get any platform-dependent definitions. */ #include <asm/machdep.h> +#define pcibios_scan_all_fns(a, b) 0 + /* Generic declarations. */ struct scatterlist; diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h index cea3a655e42e..c7b58c99e4fe 100644 --- a/include/asm-x86_64/apic.h +++ b/include/asm-x86_64/apic.h @@ -79,7 +79,7 @@ extern void disable_lapic_nmi_watchdog(void); extern void enable_lapic_nmi_watchdog(void); extern void disable_timer_nmi_watchdog(void); extern void enable_timer_nmi_watchdog(void); -extern inline void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason); +extern void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason); extern int APIC_init_uniprocessor (void); extern void disable_APIC_timer(void); extern void enable_APIC_timer(void); diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86_64/hw_irq.h index a3cee19cff15..161edad6afdf 100644 --- a/include/asm-x86_64/hw_irq.h +++ b/include/asm-x86_64/hw_irq.h @@ -77,7 +77,7 @@ struct hw_interrupt_type; #ifndef __ASSEMBLY__ extern u8 irq_vector[NR_IRQ_VECTORS]; -#define IO_APIC_VECTOR(irq) ((int)irq_vector[irq]) +#define IO_APIC_VECTOR(irq) (irq_vector[irq]) /* * Various low-level irq details needed by irq.c, process.c, @@ -132,7 +132,7 @@ static inline void x86_do_profile (struct pt_regs *regs) { unsigned long rip; extern unsigned long prof_cpu_mask; - extern char _stext; + extern char _stext[]; profile_hook(regs); diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h index 7d37aa7f3945..5a9a0db372b2 100644 --- a/include/asm-x86_64/io.h +++ b/include/asm-x86_64/io.h @@ -188,6 +188,10 @@ extern void iounmap(void *addr); #define readw(addr) (*(volatile unsigned short *) __io_virt(addr)) #define readl(addr) (*(volatile unsigned int *) __io_virt(addr)) #define readq(addr) (*(volatile unsigned long *) __io_virt(addr)) +#define readb_relaxed(a) readb(a) +#define readw_relaxed(a) readw(a) +#define readl_relaxed(a) readl(a) +#define readq_relaxed(a) readq(a) #define __raw_readb readb #define __raw_readw readw #define __raw_readl readl diff --git a/include/asm-x86_64/memblk.h b/include/asm-x86_64/memblk.h deleted file mode 100644 index cb084c244f0d..000000000000 --- a/include/asm-x86_64/memblk.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/memblk.h> diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h index b64f5bd97a2d..6feb36107d64 100644 --- a/include/asm-x86_64/pci.h +++ b/include/asm-x86_64/pci.h @@ -17,6 +17,7 @@ extern unsigned int pcibios_assign_all_busses(void); #else #define pcibios_assign_all_busses() 0 #endif +#define pcibios_scan_all_fns(a, b) 0 extern int no_iommu, force_iommu; diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h index 1a614e8c0b18..02b24f4ef8d9 100644 --- a/include/asm-x86_64/topology.h +++ b/include/asm-x86_64/topology.h @@ -15,11 +15,9 @@ extern int fake_node; extern unsigned long cpu_online_map; #define cpu_to_node(cpu) (fake_node ? 0 : (cpu)) -#define memblk_to_node(memblk) (fake_node ? 0 : (memblk)) #define parent_node(node) (node) #define node_to_first_cpu(node) (fake_node ? 0 : (node)) #define node_to_cpumask(node) (fake_node ? cpu_online_map : (1UL << (node))) -#define node_to_memblk(node) (node) static inline unsigned long pcibus_to_cpumask(int bus) { diff --git a/include/linux/bio.h b/include/linux/bio.h index d3b4e9ed4052..c421c46bfbb2 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -231,18 +231,18 @@ extern void bio_put(struct bio *); extern void bio_endio(struct bio *, unsigned int, int); struct request_queue; -extern inline int bio_phys_segments(struct request_queue *, struct bio *); -extern inline int bio_hw_segments(struct request_queue *, struct bio *); +extern int bio_phys_segments(struct request_queue *, struct bio *); +extern int bio_hw_segments(struct request_queue *, struct bio *); -extern inline void __bio_clone(struct bio *, struct bio *); +extern void __bio_clone(struct bio *, struct bio *); extern struct bio *bio_clone(struct bio *, int); -extern inline void bio_init(struct bio *); +extern void bio_init(struct bio *); extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int); extern int bio_get_nr_vecs(struct block_device *); -extern struct bio *bio_map_user(struct block_device *, unsigned long, - unsigned int, int); +extern struct bio *bio_map_user(struct request_queue *, struct block_device *, + unsigned long, unsigned int, int); extern void bio_unmap_user(struct bio *, int); extern void bio_set_pages_dirty(struct bio *bio); extern void bio_check_pages_dirty(struct bio *bio); diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index b84caaebed87..97fec37b1029 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -41,6 +41,10 @@ void bitmap_and(unsigned long *dst, const unsigned long *bitmap1, void bitmap_or(unsigned long *dst, const unsigned long *bitmap1, const unsigned long *bitmap2, int bits); int bitmap_weight(const unsigned long *bitmap, int bits); +int bitmap_snprintf(char *buf, unsigned int buflen, + const unsigned long *maskp, int bits); +int bitmap_parse(const char __user *ubuf, unsigned int ubuflen, + unsigned long *maskp, int bits); #endif /* __ASSEMBLY__ */ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d0ba766eca75..e4aa5cfac38c 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -508,7 +508,7 @@ extern int blk_remove_plug(request_queue_t *); extern void blk_recount_segments(request_queue_t *, struct bio *); extern inline int blk_phys_contig_segment(request_queue_t *q, struct bio *, struct bio *); extern inline int blk_hw_contig_segment(request_queue_t *q, struct bio *, struct bio *); -extern int scsi_cmd_ioctl(struct block_device *, unsigned int, unsigned long); +extern int scsi_cmd_ioctl(struct gendisk *, unsigned int, unsigned long); extern void blk_start_queue(request_queue_t *q); extern void blk_stop_queue(request_queue_t *q); extern void __blk_stop_queue(request_queue_t *q); diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index 1b00b5f96c0b..513ac8f4e9a2 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h @@ -496,6 +496,7 @@ struct cdrom_generic_command #define GPCMD_GET_MEDIA_STATUS 0xda /* Mode page codes for mode sense/set */ +#define GPMODE_VENDOR_PAGE 0x00 #define GPMODE_R_W_ERROR_PAGE 0x01 #define GPMODE_WRITE_PARMS_PAGE 0x05 #define GPMODE_AUDIO_CTL_PAGE 0x0e diff --git a/include/linux/console.h b/include/linux/console.h index 6db0056fb4c9..f6ff116ccfb3 100644 --- a/include/linux/console.h +++ b/include/linux/console.h @@ -102,6 +102,14 @@ extern void acquire_console_sem(void); extern void release_console_sem(void); extern void console_conditional_schedule(void); extern void console_unblank(void); +extern int is_console_locked(void); + +/* Some debug stub to catch some of the obvious races in the VT code */ +#if 1 +#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress) +#else +#define WARN_CONSOLE_UNLOCKED() +#endif /* VESA Blanking Levels */ #define VESA_NO_BLANKING 0 diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 02579ec6b99c..5ecc291dc138 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -38,9 +38,6 @@ extern void unregister_cpu_notifier(struct notifier_block *nb); int cpu_up(unsigned int cpu); -#define lock_cpu_hotplug() down(&cpucontrol) -#define unlock_cpu_hotplug() up(&cpucontrol) - #else static inline int register_cpu_notifier(struct notifier_block *nb) @@ -51,12 +48,17 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb) { } -#define lock_cpu_hotplug() do { } while (0) -#define unlock_cpu_hotplug() do { } while (0) - #endif /* CONFIG_SMP */ extern struct sysdev_class cpu_sysdev_class; +#ifdef CONFIG_HOTPLUG_CPU /* Stop CPUs going up and down. */ extern struct semaphore cpucontrol; +#define lock_cpu_hotplug() down(&cpucontrol) +#define unlock_cpu_hotplug() up(&cpucontrol) +#else +#define lock_cpu_hotplug() do { } while (0) +#define unlock_cpu_hotplug() do { } while (0) +#endif + #endif /* _LINUX_CPU_H_ */ diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 6fa750a5b26e..f19587e5c71a 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -2,6 +2,7 @@ #define __LINUX_CPUMASK_H #include <linux/threads.h> +#include <linux/bitmap.h> #include <asm/cpumask.h> #include <asm/bug.h> @@ -31,16 +32,10 @@ extern cpumask_t cpu_possible_map; #define for_each_online_cpu(cpu) for (cpu = 0; cpu < 1; cpu++) #endif -extern int __mask_snprintf_len(char *buf, unsigned int buflen, - const unsigned long *maskp, unsigned int maskbytes); - #define cpumask_snprintf(buf, buflen, map) \ - __mask_snprintf_len(buf, buflen, cpus_addr(map), sizeof(map)) - -extern int __mask_parse_len(const char __user *ubuf, unsigned int ubuflen, - unsigned long *maskp, unsigned int maskbytes); + bitmap_snprintf(buf, buflen, cpus_addr(map), NR_CPUS) #define cpumask_parse(buf, buflen, map) \ - __mask_parse_len(buf, buflen, cpus_addr(map), sizeof(map)) + bitmap_parse(buf, buflen, cpus_addr(map), NR_CPUS) #endif /* __LINUX_CPUMASK_H */ diff --git a/include/linux/efi.h b/include/linux/efi.h index a1764b1fb106..b29c8d42178f 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -297,8 +297,8 @@ extern u64 efi_mem_attributes (unsigned long phys_addr); extern void efi_initialize_iomem_resources(struct resource *code_resource, struct resource *data_resource); extern efi_status_t phys_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc); -extern inline unsigned long __init efi_get_time(void); -extern inline int __init efi_set_rtc_mmss(unsigned long nowtime); +extern unsigned long __init efi_get_time(void); +extern int __init efi_set_rtc_mmss(unsigned long nowtime); extern struct efi_memory_map memmap; /* diff --git a/include/linux/elevator.h b/include/linux/elevator.h index cbd038b665e8..ce58f47126c1 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -96,9 +96,9 @@ extern elevator_t iosched_as; extern int elevator_init(request_queue_t *, elevator_t *); extern void elevator_exit(request_queue_t *); -extern inline int elv_rq_merge_ok(struct request *, struct bio *); -extern inline int elv_try_merge(struct request *, struct bio *); -extern inline int elv_try_last_merge(request_queue_t *, struct bio *); +extern int elv_rq_merge_ok(struct request *, struct bio *); +extern int elv_try_merge(struct request *, struct bio *); +extern int elv_try_last_merge(request_queue_t *, struct bio *); /* * Return values from elevator merger diff --git a/include/linux/fsfilter.h b/include/linux/fsfilter.h index f425566a9299..0cd46770a844 100644 --- a/include/linux/fsfilter.h +++ b/include/linux/fsfilter.h @@ -74,22 +74,22 @@ extern struct filter_fs filter_oppar[FILTER_FS_TYPES]; struct filter_fs *filter_get_filter_fs(const char *cache_type); void filter_setup_journal_ops(struct filter_fs *ops, char *cache_type); -inline struct super_operations *filter_c2usops(struct filter_fs *cache); -inline struct inode_operations *filter_c2ufiops(struct filter_fs *cache); -inline struct inode_operations *filter_c2udiops(struct filter_fs *cache); -inline struct inode_operations *filter_c2usiops(struct filter_fs *cache); -inline struct file_operations *filter_c2uffops(struct filter_fs *cache); -inline struct file_operations *filter_c2udfops(struct filter_fs *cache); -inline struct file_operations *filter_c2usfops(struct filter_fs *cache); -inline struct super_operations *filter_c2csops(struct filter_fs *cache); -inline struct inode_operations *filter_c2cfiops(struct filter_fs *cache); -inline struct inode_operations *filter_c2cdiops(struct filter_fs *cache); -inline struct inode_operations *filter_c2csiops(struct filter_fs *cache); -inline struct file_operations *filter_c2cffops(struct filter_fs *cache); -inline struct file_operations *filter_c2cdfops(struct filter_fs *cache); -inline struct file_operations *filter_c2csfops(struct filter_fs *cache); -inline struct dentry_operations *filter_c2cdops(struct filter_fs *cache); -inline struct dentry_operations *filter_c2udops(struct filter_fs *cache); +struct super_operations *filter_c2usops(struct filter_fs *cache); +struct inode_operations *filter_c2ufiops(struct filter_fs *cache); +struct inode_operations *filter_c2udiops(struct filter_fs *cache); +struct inode_operations *filter_c2usiops(struct filter_fs *cache); +struct file_operations *filter_c2uffops(struct filter_fs *cache); +struct file_operations *filter_c2udfops(struct filter_fs *cache); +struct file_operations *filter_c2usfops(struct filter_fs *cache); +struct super_operations *filter_c2csops(struct filter_fs *cache); +struct inode_operations *filter_c2cfiops(struct filter_fs *cache); +struct inode_operations *filter_c2cdiops(struct filter_fs *cache); +struct inode_operations *filter_c2csiops(struct filter_fs *cache); +struct file_operations *filter_c2cffops(struct filter_fs *cache); +struct file_operations *filter_c2cdfops(struct filter_fs *cache); +struct file_operations *filter_c2csfops(struct filter_fs *cache); +struct dentry_operations *filter_c2cdops(struct filter_fs *cache); +struct dentry_operations *filter_c2udops(struct filter_fs *cache); void filter_setup_super_ops(struct filter_fs *cache, struct super_operations *cache_ops, struct super_operations *filter_sops); void filter_setup_dir_ops(struct filter_fs *cache, struct inode *cache_inode, struct inode_operations *filter_iops, struct file_operations *ffops); diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 72bda668895b..a88f16ccdc5a 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -95,8 +95,6 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) return sb->s_fs_info; } -#define PSEUDO_DIRENT_SIZE 20 - extern struct file_operations hugetlbfs_file_operations; extern struct vm_operations_struct hugetlb_vm_ops; struct file *hugetlb_zero_setup(size_t); diff --git a/include/linux/ide.h b/include/linux/ide.h index ef73baf33fc8..f5ee5b62adee 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -799,15 +799,8 @@ typedef struct ide_dma_ops_s { int (*ide_dma_good_drive)(ide_drive_t *drive); int (*ide_dma_count)(ide_drive_t *drive); int (*ide_dma_verbose)(ide_drive_t *drive); - int (*ide_dma_retune)(ide_drive_t *drive); int (*ide_dma_lostirq)(ide_drive_t *drive); int (*ide_dma_timeout)(ide_drive_t *drive); - /* dma queued operations */ - int (*ide_dma_queued_on)(ide_drive_t *drive); - int (*ide_dma_queued_off)(ide_drive_t *drive); - ide_startstop_t (*ide_dma_queued_read)(ide_drive_t *drive); - ide_startstop_t (*ide_dma_queued_write)(ide_drive_t *drive); - ide_startstop_t (*ide_dma_queued_start)(ide_drive_t *drive); } ide_dma_ops_t; /* @@ -945,17 +938,9 @@ typedef struct hwif_s { int (*ide_dma_good_drive)(ide_drive_t *drive); int (*ide_dma_count)(ide_drive_t *drive); int (*ide_dma_verbose)(ide_drive_t *drive); - int (*ide_dma_retune)(ide_drive_t *drive); int (*ide_dma_lostirq)(ide_drive_t *drive); int (*ide_dma_timeout)(ide_drive_t *drive); - /* dma queued operations */ - int (*ide_dma_queued_on)(ide_drive_t *drive); - int (*ide_dma_queued_off)(ide_drive_t *drive); - ide_startstop_t (*ide_dma_queued_read)(ide_drive_t *drive); - ide_startstop_t (*ide_dma_queued_write)(ide_drive_t *drive); - ide_startstop_t (*ide_dma_queued_start)(ide_drive_t *drive); - void (*OUTB)(u8 addr, unsigned long port); void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); void (*OUTW)(u16 addr, unsigned long port); @@ -1214,13 +1199,6 @@ typedef struct ide_driver_s { extern int generic_ide_ioctl(struct block_device *, unsigned, unsigned long); -typedef struct ide_devices_s { - char name[4]; /* hdX */ - unsigned attached : 1; /* native */ - unsigned alttached : 1; /* alternate */ - struct ide_devices_s *next; -} ide_devices_t; - /* * ide_hwifs[] is the master data structure used to keep track * of just about everything in ide.c. Whenever possible, routines @@ -1231,13 +1209,6 @@ typedef struct ide_devices_s { */ #ifndef _IDE_C extern ide_hwif_t ide_hwifs[]; /* master data repository */ - -extern ide_devices_t *idedisk; -extern ide_devices_t *idecd; -extern ide_devices_t *idefloppy; -extern ide_devices_t *idetape; -extern ide_devices_t *idescsi; - #endif extern int noautodma; @@ -1416,12 +1387,12 @@ typedef struct pkt_task_s { void *special; } pkt_task_t; -extern inline u32 ide_read_24(ide_drive_t *); +extern u32 ide_read_24(ide_drive_t *); -extern inline void SELECT_DRIVE(ide_drive_t *); -extern inline void SELECT_INTERRUPT(ide_drive_t *); -extern inline void SELECT_MASK(ide_drive_t *, int); -extern inline void QUIRK_LIST(ide_drive_t *); +extern void SELECT_DRIVE(ide_drive_t *); +extern void SELECT_INTERRUPT(ide_drive_t *); +extern void SELECT_MASK(ide_drive_t *, int); +extern void QUIRK_LIST(ide_drive_t *); extern void ata_input_data(ide_drive_t *, void *, u32); extern void ata_output_data(ide_drive_t *, void *, u32); @@ -1651,7 +1622,6 @@ extern int __ide_dma_bad_drive(ide_drive_t *); extern int __ide_dma_good_drive(ide_drive_t *); extern int __ide_dma_count(ide_drive_t *); extern int __ide_dma_verbose(ide_drive_t *); -extern int __ide_dma_retune(ide_drive_t *); extern int __ide_dma_lostirq(ide_drive_t *); extern int __ide_dma_timeout(ide_drive_t *); @@ -1661,16 +1631,6 @@ extern int __ide_dma_queued_off(ide_drive_t *drive); extern ide_startstop_t __ide_dma_queued_read(ide_drive_t *drive); extern ide_startstop_t __ide_dma_queued_write(ide_drive_t *drive); extern ide_startstop_t __ide_dma_queued_start(ide_drive_t *drive); -#else -static inline int __ide_dma_queued_on(ide_drive_t *drive) -{ - return 1; -} - -static inline int __ide_dma_queued_off(ide_drive_t *drive) -{ - return 1; -} #endif #else diff --git a/include/linux/in6.h b/include/linux/in6.h index 8689112d08f3..5b4e89b1ac68 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h @@ -183,5 +183,17 @@ struct in6_flowlabel_req #define IPV6_IPSEC_POLICY 34 #define IPV6_XFRM_POLICY 35 +/* + * Multicast: + * Following socket options are shared between IPv4 and IPv6. + * + * MCAST_JOIN_GROUP 42 + * MCAST_BLOCK_SOURCE 43 + * MCAST_UNBLOCK_SOURCE 44 + * MCAST_LEAVE_GROUP 45 + * MCAST_JOIN_SOURCE_GROUP 46 + * MCAST_LEAVE_SOURCE_GROUP 47 + * MCAST_MSFILTER 48 + */ #endif diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 18913dfaddb1..1c5eb02667bb 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -21,6 +21,7 @@ struct ipv4_devconf int medium_id; int no_xfrm; int no_policy; + int force_igmp_version; void *sysctl; }; diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 59d4d291d455..f9708adb1d47 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -40,6 +40,7 @@ .mmap_sem = __RWSEM_INITIALIZER(name.mmap_sem), \ .page_table_lock = SPIN_LOCK_UNLOCKED, \ .mmlist = LIST_HEAD_INIT(name.mmlist), \ + .cpu_vm_mask = CPU_MASK_ALL, \ .default_kioctx = INIT_KIOCTX(name.default_kioctx, name), \ } diff --git a/include/linux/input.h b/include/linux/input.h index 3beb4078a2da..59afa63abbb3 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -751,6 +751,27 @@ struct ff_effect { #define init_input_dev(dev) do { INIT_LIST_HEAD(&((dev)->h_list)); INIT_LIST_HEAD(&((dev)->node)); } while (0) +#define SET_INPUT_KEYCODE(dev, scancode, val) \ + do { \ + switch (dev->keycodesize) { \ + case 1: { \ + u8 *k = (u8 *)dev->keycode; \ + k[scancode] = val; \ + break; \ + } \ + case 2: { \ + u16 *k = (u16 *)dev->keycode; \ + k[scancode] = val; \ + break; \ + } \ + case 4: { \ + u32 *k = (u32 *)dev->keycode; \ + k[scancode] = val; \ + break; \ + } \ + } \ + } while (0) + struct input_dev { void *private; diff --git a/include/linux/irq_cpustat.h b/include/linux/irq_cpustat.h index 03b3e17de805..95e55a9f1087 100644 --- a/include/linux/irq_cpustat.h +++ b/include/linux/irq_cpustat.h @@ -19,11 +19,7 @@ #ifndef __ARCH_IRQ_STAT extern irq_cpustat_t irq_stat[]; /* defined in asm/hardirq.h */ -#ifdef CONFIG_SMP #define __IRQ_STAT(cpu, member) (irq_stat[cpu].member) -#else -#define __IRQ_STAT(cpu, member) ((void)(cpu), irq_stat[0].member) -#endif #endif /* arch independent irq_stat fields */ diff --git a/include/linux/memblk.h b/include/linux/memblk.h deleted file mode 100644 index 5f216fb47907..000000000000 --- a/include/linux/memblk.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * include/linux/memblk.h - generic memblk definition - * - * This is mainly for topological representation. We define the - * basic 'struct memblk' here, which can be embedded in per-arch - * definitions of memory blocks. - * - * Basic handling of the devices is done in drivers/base/memblk.c - * and system devices are handled in drivers/base/sys.c. - * - * MemBlks are exported via driverfs in the class/memblk/devices/ - * directory. - * - * Per-memblk interfaces can be implemented using a struct device_interface. - * See the following for how to do this: - * - drivers/base/intf.c - * - Documentation/driver-model/interface.txt - */ -#ifndef _LINUX_MEMBLK_H_ -#define _LINUX_MEMBLK_H_ - -#include <linux/device.h> -#include <linux/node.h> - -struct memblk { - int node_id; /* The node which contains the MemBlk */ - struct sys_device sysdev; -}; - -extern int register_memblk(struct memblk *, int, struct node *); - -#endif /* _LINUX_MEMBLK_H_ */ diff --git a/include/linux/mm.h b/include/linux/mm.h index 3ecd3d633c5f..ffc1e13d0a55 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -12,6 +12,7 @@ #include <linux/mmzone.h> #include <linux/rbtree.h> #include <linux/fs.h> +#include <linux/elf.h> #ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ extern unsigned long max_mapnr; @@ -643,31 +644,24 @@ kernel_map_pages(struct page *page, int numpages, int enable) #endif #ifndef CONFIG_ARCH_GATE_AREA -#ifdef AT_SYSINFO_EHDR static inline int in_gate_area(struct task_struct *task, unsigned long addr) { +#ifdef AT_SYSINFO_EHDR if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END)) return 1; - else - return 0; +#endif + return 0; } extern struct vm_area_struct gate_vma; static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk) { +#ifdef AT_SYSINFO_EHDR return &gate_vma; -} #else -static inline int in_gate_area(struct task_struct *task, unsigned long addr) -{ return 0; -} - -static inline struct vm_area_struct *get_gate_vma(struct task_struct *tsk) -{ - return NULL; -} #endif +} #endif #endif /* __KERNEL__ */ diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 66cbaa36d878..179f51f29f78 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -205,7 +205,6 @@ typedef struct pglist_data { struct zonelist node_zonelists[MAX_NR_ZONES]; int nr_zones; struct page *node_mem_map; - unsigned long *valid_addr_bitmap; struct bootmem_data *bdata; unsigned long node_start_pfn; unsigned long node_present_pages; /* total number of physical pages */ @@ -295,12 +294,6 @@ struct file; int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *, void *, size_t *); -#ifdef CONFIG_NUMA -#define MAX_NR_MEMBLKS BITS_PER_LONG /* Max number of Memory Blocks */ -#else /* !CONFIG_NUMA */ -#define MAX_NR_MEMBLKS 1 -#endif /* CONFIG_NUMA */ - #include <linux/topology.h> /* Returns the number of the current Node. */ #define numa_node_id() (cpu_to_node(smp_processor_id())) @@ -343,7 +336,6 @@ extern struct pglist_data contig_page_data; #endif extern DECLARE_BITMAP(node_online_map, MAX_NUMNODES); -extern DECLARE_BITMAP(memblk_online_map, MAX_NR_MEMBLKS); #if defined(CONFIG_DISCONTIGMEM) || defined(CONFIG_NUMA) @@ -361,20 +353,6 @@ static inline unsigned int num_online_nodes(void) return num; } -#define memblk_online(memblk) test_bit(memblk, memblk_online_map) -#define memblk_set_online(memblk) set_bit(memblk, memblk_online_map) -#define memblk_set_offline(memblk) clear_bit(memblk, memblk_online_map) -static inline unsigned int num_online_memblks(void) -{ - int i, num = 0; - - for(i = 0; i < MAX_NR_MEMBLKS; i++){ - if (memblk_online(i)) - num++; - } - return num; -} - #else /* !CONFIG_DISCONTIGMEM && !CONFIG_NUMA */ #define node_online(node) \ @@ -385,14 +363,6 @@ static inline unsigned int num_online_memblks(void) ({ BUG_ON((node) != 0); clear_bit(node, node_online_map); }) #define num_online_nodes() 1 -#define memblk_online(memblk) \ - ({ BUG_ON((memblk) != 0); test_bit(memblk, memblk_online_map); }) -#define memblk_set_online(memblk) \ - ({ BUG_ON((memblk) != 0); set_bit(memblk, memblk_online_map); }) -#define memblk_set_offline(memblk) \ - ({ BUG_ON((memblk) != 0); clear_bit(memblk, memblk_online_map); }) -#define num_online_memblks() 1 - #endif /* CONFIG_DISCONTIGMEM || CONFIG_NUMA */ #endif /* !__ASSEMBLY__ */ #endif /* __KERNEL__ */ diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index cfdeaaad2b7e..84b6fd41e2d2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -496,6 +496,7 @@ extern rwlock_t dev_base_lock; /* Device list lock */ extern int netdev_boot_setup_add(char *name, struct ifmap *map); extern int netdev_boot_setup_check(struct net_device *dev); +extern unsigned long netdev_boot_base(const char *prefix, int unit); extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr); extern struct net_device *__dev_getfirstbyhwtype(unsigned short type); extern struct net_device *dev_getfirstbyhwtype(unsigned short type); diff --git a/include/linux/netfilter_ipv4/ip_conntrack_core.h b/include/linux/netfilter_ipv4/ip_conntrack_core.h index ea15674261a2..4c8b5d189089 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_core.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_core.h @@ -50,5 +50,6 @@ static inline int ip_conntrack_confirm(struct sk_buff *skb) extern struct list_head *ip_conntrack_hash; extern struct list_head ip_conntrack_expect_list; DECLARE_RWLOCK_EXTERN(ip_conntrack_lock); +DECLARE_RWLOCK_EXTERN(ip_conntrack_expect_tuple_lock); #endif /* _IP_CONNTRACK_CORE_H */ diff --git a/include/linux/parport.h b/include/linux/parport.h index 77e99e8eace2..eff925bb5da6 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -311,6 +311,8 @@ struct parport { int spintime; atomic_t ref_count; + + struct list_head full_list; }; #define DEFAULT_SPIN_TIME 500 /* us */ diff --git a/include/linux/parport_pc.h b/include/linux/parport_pc.h index 47f14868ca75..2334281e3af6 100644 --- a/include/linux/parport_pc.h +++ b/include/linux/parport_pc.h @@ -41,7 +41,7 @@ struct parport_pc_private { struct pci_dev *dev; }; -extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d) +static __inline__ void parport_pc_write_data(struct parport *p, unsigned char d) { #ifdef DEBUG_PARPORT printk (KERN_DEBUG "parport_pc_write_data(%p,0x%02x)\n", p, d); @@ -49,7 +49,7 @@ extern __inline__ void parport_pc_write_data(struct parport *p, unsigned char d) outb(d, DATA(p)); } -extern __inline__ unsigned char parport_pc_read_data(struct parport *p) +static __inline__ unsigned char parport_pc_read_data(struct parport *p) { unsigned char val = inb (DATA (p)); #ifdef DEBUG_PARPORT @@ -124,17 +124,17 @@ static __inline__ unsigned char __parport_pc_frob_control (struct parport *p, return ctr; } -extern __inline__ void parport_pc_data_reverse (struct parport *p) +static __inline__ void parport_pc_data_reverse (struct parport *p) { __parport_pc_frob_control (p, 0x20, 0x20); } -extern __inline__ void parport_pc_data_forward (struct parport *p) +static __inline__ void parport_pc_data_forward (struct parport *p) { __parport_pc_frob_control (p, 0x20, 0x00); } -extern __inline__ void parport_pc_write_control (struct parport *p, +static __inline__ void parport_pc_write_control (struct parport *p, unsigned char d) { const unsigned char wm = (PARPORT_CONTROL_STROBE | @@ -152,7 +152,7 @@ extern __inline__ void parport_pc_write_control (struct parport *p, __parport_pc_frob_control (p, wm, d & wm); } -extern __inline__ unsigned char parport_pc_read_control(struct parport *p) +static __inline__ unsigned char parport_pc_read_control(struct parport *p) { const unsigned char rm = (PARPORT_CONTROL_STROBE | PARPORT_CONTROL_AUTOFD | @@ -162,7 +162,7 @@ extern __inline__ unsigned char parport_pc_read_control(struct parport *p) return priv->ctr & rm; /* Use soft copy */ } -extern __inline__ unsigned char parport_pc_frob_control (struct parport *p, +static __inline__ unsigned char parport_pc_frob_control (struct parport *p, unsigned char mask, unsigned char val) { @@ -189,18 +189,18 @@ extern __inline__ unsigned char parport_pc_frob_control (struct parport *p, return __parport_pc_frob_control (p, mask, val); } -extern __inline__ unsigned char parport_pc_read_status(struct parport *p) +static __inline__ unsigned char parport_pc_read_status(struct parport *p) { return inb(STATUS(p)); } -extern __inline__ void parport_pc_disable_irq(struct parport *p) +static __inline__ void parport_pc_disable_irq(struct parport *p) { __parport_pc_frob_control (p, 0x10, 0x00); } -extern __inline__ void parport_pc_enable_irq(struct parport *p) +static __inline__ void parport_pc_enable_irq(struct parport *p) { __parport_pc_frob_control (p, 0x10, 0x10); } diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 4dba6ec06e3a..a20d64521c03 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -633,6 +633,8 @@ #define PCI_DEVICE_ID_HP_TACHLITE 0x1029 #define PCI_DEVICE_ID_HP_J2585A 0x1030 #define PCI_DEVICE_ID_HP_J2585B 0x1031 +#define PCI_DEVICE_ID_HP_J2973A 0x1040 +#define PCI_DEVICE_ID_HP_J2970A 0x1042 #define PCI_DEVICE_ID_HP_DIVA 0x1048 #define PCI_DEVICE_ID_HP_DIVA_TOSCA1 0x1049 #define PCI_DEVICE_ID_HP_DIVA_TOSCA2 0x104A @@ -807,6 +809,7 @@ #define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034 #define PCI_DEVICE_ID_APPLE_KAUAI_ATA 0x003b #define PCI_DEVICE_ID_APPLE_KEYLARGO_I 0x003e +#define PCI_DEVICE_ID_APPLE_K2_GMAC 0x004c #define PCI_DEVICE_ID_APPLE_TIGON3 0x1645 #define PCI_VENDOR_ID_YAMAHA 0x1073 diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 9e637260e58f..6aedd71cc02c 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h @@ -35,7 +35,6 @@ struct percpu_data { extern void *__alloc_percpu(size_t size, size_t align); extern void free_percpu(const void *); -extern void kmalloc_percpu_init(void); #else /* CONFIG_SMP */ @@ -52,7 +51,6 @@ static inline void free_percpu(const void *ptr) { kfree(ptr); } -static inline void kmalloc_percpu_init(void) { } #endif /* CONFIG_SMP */ diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index d97edad0effc..8ae0e141cb05 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h @@ -290,6 +290,37 @@ struct tc_htb_xstats __u32 ctokens; }; +/* HFSC section */ + +struct tc_hfsc_qopt +{ + __u16 defcls; /* default class */ +}; + +struct tc_service_curve +{ + __u32 m1; /* slope of the first segment in bps */ + __u32 d; /* x-projection of the first segment in us */ + __u32 m2; /* slope of the second segment in bps */ +}; + +struct tc_hfsc_stats +{ + __u64 work; /* total work done */ + __u64 rtwork; /* work done by real-time criteria */ + __u32 period; /* current period */ + __u32 level; /* class level in hierarchy */ +}; + +enum +{ + TCA_HFSC_UNSPEC, + TCA_HFSC_RSC, + TCA_HFSC_FSC, + TCA_HFSC_USC, + TCA_HFSC_MAX = TCA_HFSC_USC +}; + /* CBQ section */ #define TC_CBQ_MAXPRIO 8 diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 7b6e12c45dc9..a89da5378b5f 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -281,6 +281,10 @@ static inline int mdidx (mddev_t * mddev) { return mddev->__minor; } +static inline char * mdname (mddev_t * mddev) +{ + return mddev->gendisk ? mddev->gendisk->disk_name : "mdX"; +} extern mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr); diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 32fe6c84b3b6..f05d63a025c4 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h @@ -90,7 +90,7 @@ if( !( cond ) ) \ #define RFALSE( cond, format, args... ) do {;} while( 0 ) #endif -#define CONSTF __attribute__( ( const ) ) +#define CONSTF __attribute_const__ /* * Disk Data Structures */ @@ -1781,25 +1781,25 @@ int reiserfs_convert_objectid_map_v1(struct super_block *) ; /* stree.c */ int B_IS_IN_TREE(const struct buffer_head *); extern inline void copy_short_key (void * to, const void * from); -extern inline void copy_item_head(struct item_head * p_v_to, +extern void copy_item_head(struct item_head * p_v_to, const struct item_head * p_v_from); // first key is in cpu form, second - le -extern inline int comp_keys (const struct key * le_key, +extern int comp_keys (const struct key * le_key, const struct cpu_key * cpu_key); -extern inline int comp_short_keys (const struct key * le_key, +extern int comp_short_keys (const struct key * le_key, const struct cpu_key * cpu_key); -extern inline void le_key2cpu_key (struct cpu_key * to, const struct key * from); +extern void le_key2cpu_key (struct cpu_key * to, const struct key * from); // both are cpu keys -extern inline int comp_cpu_keys (const struct cpu_key *, const struct cpu_key *); -extern inline int comp_short_cpu_keys (const struct cpu_key *, +extern int comp_cpu_keys (const struct cpu_key *, const struct cpu_key *); +extern int comp_short_cpu_keys (const struct cpu_key *, const struct cpu_key *); -extern inline void cpu_key2cpu_key (struct cpu_key *, const struct cpu_key *); +extern void cpu_key2cpu_key (struct cpu_key *, const struct cpu_key *); // both are in le form -extern inline int comp_le_keys (const struct key *, const struct key *); -extern inline int comp_short_le_keys (const struct key *, const struct key *); +extern int comp_le_keys (const struct key *, const struct key *); +extern int comp_short_le_keys (const struct key *, const struct key *); // // get key version from on disk key - kludge @@ -1834,7 +1834,7 @@ int search_by_key (struct super_block *, const struct cpu_key *, int search_for_position_by_key (struct super_block * p_s_sb, const struct cpu_key * p_s_cpu_key, struct path * p_s_search_path); -extern inline void decrement_bcount (struct buffer_head * p_s_bh); +extern void decrement_bcount (struct buffer_head * p_s_bh); void decrement_counters_in_path (struct path * p_s_search_path); void pathrelse (struct path * p_s_search_path); int reiserfs_check_path(struct path *p) ; @@ -1916,7 +1916,7 @@ void sd_attrs_to_i_attrs( __u16 sd_attrs, struct inode *inode ); void i_attrs_to_sd_attrs( struct inode *inode, __u16 *sd_attrs ); /* namei.c */ -inline void set_de_name_and_namelen (struct reiserfs_dir_entry * de); +void set_de_name_and_namelen (struct reiserfs_dir_entry * de); int search_by_entry_key (struct super_block * sb, const struct cpu_key * key, struct path * path, struct reiserfs_dir_entry * de); @@ -2037,7 +2037,7 @@ int balance_internal (struct tree_balance * , int, int, struct item_head * , struct buffer_head **); /* do_balance.c */ -inline void do_balance_mark_leaf_dirty (struct tree_balance * tb, +void do_balance_mark_leaf_dirty (struct tree_balance * tb, struct buffer_head * bh, int flag); #define do_balance_mark_internal_dirty do_balance_mark_leaf_dirty #define do_balance_mark_sb_dirty do_balance_mark_leaf_dirty diff --git a/include/linux/scc.h b/include/linux/scc.h index 4965e146b737..885a4a02b23c 100644 --- a/include/linux/scc.h +++ b/include/linux/scc.h @@ -200,7 +200,7 @@ struct scc_kiss { unsigned char fulldup; /* Full Duplex mode 0=CSMA 1=DUP 2=ALWAYS KEYED */ unsigned char waittime; /* Waittime before any transmit attempt */ unsigned int maxkeyup; /* Maximum time to transmit (seconds) */ - unsigned char mintime; /* Minimal offtime after MAXKEYUP timeout (seconds) */ + unsigned int mintime; /* Minimal offtime after MAXKEYUP timeout (seconds) */ unsigned int idletime; /* Maximum idle time in ALWAYS KEYED mode (seconds) */ unsigned int maxdefer; /* Timer for CSMA channel busy limit */ unsigned char tx_inhibit; /* Transmit is not allowed when set */ diff --git a/include/linux/sched.h b/include/linux/sched.h index f5f84aedbaec..ac22951d5927 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -204,7 +204,6 @@ struct mm_struct { unsigned long arg_start, arg_end, env_start, env_end; unsigned long rss, total_vm, locked_vm; unsigned long def_flags; - cpumask_t cpu_vm_mask; unsigned long saved_auxv[40]; /* for /proc/PID/auxv */ @@ -212,6 +211,8 @@ struct mm_struct { #ifdef CONFIG_HUGETLB_PAGE int used_hugetlb; #endif + cpumask_t cpu_vm_mask; + /* Architecture-specific MM context */ mm_context_t context; @@ -670,7 +671,7 @@ static inline int capable(int cap) extern struct mm_struct * mm_alloc(void); /* mmdrop drops the mm and the page tables */ -extern inline void FASTCALL(__mmdrop(struct mm_struct *)); +extern void FASTCALL(__mmdrop(struct mm_struct *)); static inline void mmdrop(struct mm_struct * mm) { if (atomic_dec_and_test(&mm->mm_count)) diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 9ddc3bd5cd81..a851af99af70 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h @@ -61,14 +61,14 @@ typedef struct sctphdr { __u16 dest; __u32 vtag; __u32 checksum; -} sctp_sctphdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_sctphdr_t; /* Section 3.2. Chunk Field Descriptions. */ typedef struct sctp_chunkhdr { __u8 type; __u8 flags; __u16 length; -} sctp_chunkhdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_chunkhdr_t; /* Section 3.2. Chunk Type Values. @@ -152,7 +152,7 @@ enum { SCTP_CHUNK_FLAG_T = 0x01 }; typedef struct sctp_paramhdr { __u16 type; __u16 length; -} sctp_paramhdr_t __attribute((packed)); +} __attribute__((packed)) sctp_paramhdr_t; typedef enum { @@ -202,12 +202,12 @@ typedef struct sctp_datahdr { __u16 ssn; __u32 ppid; __u8 payload[0]; -} sctp_datahdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_datahdr_t; typedef struct sctp_data_chunk { sctp_chunkhdr_t chunk_hdr; sctp_datahdr_t data_hdr; -} sctp_data_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_data_chunk_t; /* DATA Chuck Specific Flags */ enum { @@ -232,48 +232,48 @@ typedef struct sctp_inithdr { __u16 num_inbound_streams; __u32 initial_tsn; __u8 params[0]; -} sctp_inithdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_inithdr_t; typedef struct sctp_init_chunk { sctp_chunkhdr_t chunk_hdr; sctp_inithdr_t init_hdr; -} sctp_init_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_init_chunk_t; /* Section 3.3.2.1. IPv4 Address Parameter (5) */ typedef struct sctp_ipv4addr_param { sctp_paramhdr_t param_hdr; struct in_addr addr; -} sctp_ipv4addr_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_ipv4addr_param_t; /* Section 3.3.2.1. IPv6 Address Parameter (6) */ typedef struct sctp_ipv6addr_param { sctp_paramhdr_t param_hdr; struct in6_addr addr; -} sctp_ipv6addr_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_ipv6addr_param_t; /* Section 3.3.2.1 Cookie Preservative (9) */ typedef struct sctp_cookie_preserve_param { sctp_paramhdr_t param_hdr; uint32_t lifespan_increment; -} sctp_cookie_preserve_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_cookie_preserve_param_t; /* Section 3.3.2.1 Host Name Address (11) */ typedef struct sctp_hostname_param { sctp_paramhdr_t param_hdr; uint8_t hostname[0]; -} sctp_hostname_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_hostname_param_t; /* Section 3.3.2.1 Supported Address Types (12) */ typedef struct sctp_supported_addrs_param { sctp_paramhdr_t param_hdr; uint16_t types[0]; -} sctp_supported_addrs_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_supported_addrs_param_t; /* Appendix A. ECN Capable (32768) */ typedef struct sctp_ecn_capable_param { sctp_paramhdr_t param_hdr; -} sctp_ecn_capable_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_ecn_capable_param_t; @@ -287,13 +287,13 @@ typedef sctp_init_chunk_t sctp_initack_chunk_t; typedef struct sctp_cookie_param { sctp_paramhdr_t p; __u8 body[0]; -} sctp_cookie_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_cookie_param_t; /* Section 3.3.3.1 Unrecognized Parameters (8) */ typedef struct sctp_unrecognized_param { sctp_paramhdr_t param_hdr; sctp_paramhdr_t unrecognized; -} sctp_unrecognized_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_unrecognized_param_t; @@ -308,7 +308,7 @@ typedef struct sctp_unrecognized_param { typedef struct sctp_gap_ack_block { __u16 start; __u16 end; -} sctp_gap_ack_block_t __attribute__((packed)); +} __attribute__((packed)) sctp_gap_ack_block_t; typedef uint32_t sctp_dup_tsn_t; @@ -323,12 +323,12 @@ typedef struct sctp_sackhdr { __u16 num_gap_ack_blocks; __u16 num_dup_tsns; sctp_sack_variable_t variable[0]; -} sctp_sackhdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_sackhdr_t; typedef struct sctp_sack_chunk { sctp_chunkhdr_t chunk_hdr; sctp_sackhdr_t sack_hdr; -} sctp_sack_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_sack_chunk_t; /* RFC 2960. Section 3.3.5 Heartbeat Request (HEARTBEAT) (4): @@ -340,12 +340,12 @@ typedef struct sctp_sack_chunk { typedef struct sctp_heartbeathdr { sctp_paramhdr_t info; -} sctp_heartbeathdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_heartbeathdr_t; typedef struct sctp_heartbeat_chunk { sctp_chunkhdr_t chunk_hdr; sctp_heartbeathdr_t hb_hdr; -} sctp_heartbeat_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_heartbeat_chunk_t; /* For the abort and shutdown ACK we must carry the init tag in the @@ -354,7 +354,7 @@ typedef struct sctp_heartbeat_chunk { */ typedef struct sctp_abort_chunk { sctp_chunkhdr_t uh; -} sctp_abort_chunkt_t __attribute__((packed)); +} __attribute__((packed)) sctp_abort_chunkt_t; /* For the graceful shutdown we must carry the tag (in common header) @@ -362,14 +362,12 @@ typedef struct sctp_abort_chunk { */ typedef struct sctp_shutdownhdr { __u32 cum_tsn_ack; -} sctp_shutdownhdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_shutdownhdr_t; struct sctp_shutdown_chunk_t { sctp_chunkhdr_t chunk_hdr; sctp_shutdownhdr_t shutdown_hdr; -} __attribute__((packed)); - - +} __attribute__ ((packed)); /* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */ @@ -377,12 +375,12 @@ typedef struct sctp_errhdr { __u16 cause; __u16 length; __u8 variable[0]; -} sctp_errhdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_errhdr_t; typedef struct sctp_operr_chunk { sctp_chunkhdr_t chunk_hdr; sctp_errhdr_t err_hdr; -} sctp_operr_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_operr_chunk_t; /* RFC 2960 3.3.10 - Operation Error * @@ -460,7 +458,7 @@ typedef struct sctp_ecnehdr { typedef struct sctp_ecne_chunk { sctp_chunkhdr_t chunk_hdr; sctp_ecnehdr_t ence_hdr; -} sctp_ecne_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_ecne_chunk_t; /* RFC 2960. Appendix A. Explicit Congestion Notification. * Congestion Window Reduced (CWR) (13) @@ -472,7 +470,7 @@ typedef struct sctp_cwrhdr { typedef struct sctp_cwr_chunk { sctp_chunkhdr_t chunk_hdr; sctp_cwrhdr_t cwr_hdr; -} sctp_cwr_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_cwr_chunk_t; /* * ADDIP Section 3.1 New Chunk Types @@ -513,16 +511,16 @@ typedef struct sctp_cwr_chunk { typedef struct sctp_addip_param { sctp_paramhdr_t param_hdr; __u32 crr_id; -}sctp_addip_param_t __attribute__((packed)); +} __attribute__((packed)) sctp_addip_param_t; typedef struct sctp_addiphdr { __u32 serial; __u8 params[0]; -} sctp_addiphdr_t __attribute__((packed)); +} __attribute__((packed)) sctp_addiphdr_t; typedef struct sctp_addip_chunk { sctp_chunkhdr_t chunk_hdr; sctp_addiphdr_t addip_hdr; -} sctp_addip_chunk_t __attribute__((packed)); +} __attribute__((packed)) sctp_addip_chunk_t; #endif /* __LINUX_SCTP_H__ */ diff --git a/include/linux/selection.h b/include/linux/selection.h index a949695af3c5..fd34cfa5f5ef 100644 --- a/include/linux/selection.h +++ b/include/linux/selection.h @@ -36,8 +36,8 @@ extern u16 screen_glyph(int currcons, int offset); extern void complement_pos(int currcons, int offset); extern void invert_screen(int currcons, int offset, int count, int shift); -extern void getconsxy(int currcons, char *p); -extern void putconsxy(int currcons, char *p); +extern void getconsxy(int currcons, unsigned char *p); +extern void putconsxy(int currcons, unsigned char *p); extern u16 vcs_scr_readw(int currcons, const u16 *org); extern void vcs_scr_writew(int currcons, u16 val, u16 *org); diff --git a/include/linux/suspend.h b/include/linux/suspend.h index db4d007f4a8b..d0cdc77fa44e 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -32,9 +32,6 @@ struct suspend_header { int page_size; suspend_pagedir_t *suspend_pagedir; unsigned int num_pbes; - struct swap_location { - char filename[SWAP_FILENAME_MAXLENGTH]; - } swap_location[MAX_SWAPFILES]; }; #define SUSPEND_PD_PAGES(x) (((x)*sizeof(struct pbe))/PAGE_SIZE+1) @@ -45,31 +42,43 @@ extern int shrink_mem(void); /* mm/page_alloc.c */ extern void drain_local_pages(void); +/* kernel/power/swsusp.c */ +extern int software_suspend(void); + extern unsigned int nr_copy_pages __nosavedata; extern suspend_pagedir_t *pagedir_nosave __nosavedata; -#endif /* CONFIG_PM */ - -#ifdef CONFIG_SOFTWARE_SUSPEND - -extern unsigned char software_suspend_enabled; -extern void software_suspend(void); #else /* CONFIG_SOFTWARE_SUSPEND */ -static inline void software_suspend(void) +static inline int software_suspend(void) { printk("Warning: fake suspend called\n"); + return -EPERM; } +#define software_resume() do { } while(0) #endif /* CONFIG_SOFTWARE_SUSPEND */ #ifdef CONFIG_PM extern void refrigerator(unsigned long); +extern int freeze_processes(void); +extern void thaw_processes(void); + +extern int pm_prepare_console(void); +extern void pm_restore_console(void); #else static inline void refrigerator(unsigned long flag) { } +static inline int freeze_processes(void) +{ + return 0; +} +static inline void thaw_processes(void) +{ + +} #endif /* CONFIG_PM */ #endif /* _LINUX_SWSUSP_H */ diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 0d5b121f54a0..935be9d21b69 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -311,6 +311,7 @@ enum NET_TCP_FRTO=92, NET_TCP_LOW_LATENCY=93, NET_IPV4_IPFRAG_SECRET_INTERVAL=94, + NET_TCP_WESTWOOD=95, }; enum { @@ -360,6 +361,7 @@ enum NET_IPV4_CONF_MEDIUM_ID=14, NET_IPV4_CONF_NOXFRM=15, NET_IPV4_CONF_NOPOLICY=16, + NET_IPV4_CONF_FORCE_IGMP_VERSION=17, }; /* /proc/sys/net/ipv4/netfilter */ diff --git a/include/linux/tcp.h b/include/linux/tcp.h index d25e5bd21c4d..1b35358879ce 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -374,6 +374,20 @@ struct tcp_opt { __u32 frto_highmark; /* snd_nxt when RTO occurred */ unsigned long last_synq_overflow; + +/* TCP Westwood structure */ + struct { + __u32 bw_sample; /* bandwidth sample */ + __u32 bw_ns_est; /* first bandwidth estimation..not too smoothed 8) */ + __u32 bw_est; /* bandwidth estimate */ + __u32 rtt_win_sx; /* here starts a new evaluation... */ + __u32 bk; + __u32 snd_una; /* used for evaluating the number of acked bytes */ + __u32 cumul_ack; + __u32 accounted; + __u32 rtt; + __u32 rtt_min; /* minimum observed RTT */ + } westwood; }; /* WARNING: don't change the layout of the members in tcp_sock! */ diff --git a/include/linux/time.h b/include/linux/time.h index 891bf4607d16..b85d596949a3 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -148,14 +148,14 @@ struct timezone { #endif #define NSEC_JIFFIE_SC (SEC_JIFFIE_SC + 29) #define USEC_JIFFIE_SC (SEC_JIFFIE_SC + 19) -#define SEC_CONVERSION ((unsigned long)((((u64)NSEC_PER_SEC << SEC_JIFFIE_SC))\ - / (u64)TICK_NSEC)) +#define SEC_CONVERSION ((unsigned long)((((u64)NSEC_PER_SEC << SEC_JIFFIE_SC) +\ + TICK_NSEC -1) / (u64)TICK_NSEC)) -#define NSEC_CONVERSION ((unsigned long)((((u64)1 << NSEC_JIFFIE_SC))\ - / (u64)TICK_NSEC)) +#define NSEC_CONVERSION ((unsigned long)((((u64)1 << NSEC_JIFFIE_SC) +\ + TICK_NSEC -1) / (u64)TICK_NSEC)) #define USEC_CONVERSION \ - ((unsigned long)((((u64)NSEC_PER_USEC << USEC_JIFFIE_SC)) \ - / (u64)TICK_NSEC)) + ((unsigned long)((((u64)NSEC_PER_USEC << USEC_JIFFIE_SC) +\ + TICK_NSEC -1) / (u64)TICK_NSEC)) /* * USEC_ROUND is used in the timeval to jiffie conversion. See there * for more details. It is the scaled resolution rounding value. Note diff --git a/include/net/irda/irlmp_frame.h b/include/net/irda/irlmp_frame.h index 779d34acc394..eb3ad158c023 100644 --- a/include/net/irda/irlmp_frame.h +++ b/include/net/irda/irlmp_frame.h @@ -40,7 +40,7 @@ #define CONTROL_BIT 0x80 -inline void irlmp_send_data_pdu(struct lap_cb *self, __u8 dlsap, __u8 slsap, +void irlmp_send_data_pdu(struct lap_cb *self, __u8 dlsap, __u8 slsap, int expedited, struct sk_buff *skb); void irlmp_send_lcf_pdu(struct lap_cb *self, __u8 dlsap, __u8 slsap, __u8 opcode, struct sk_buff *skb); diff --git a/include/net/irda/timer.h b/include/net/irda/timer.h index 739a89d3750d..61103a361d6e 100644 --- a/include/net/irda/timer.h +++ b/include/net/irda/timer.h @@ -74,19 +74,19 @@ typedef void (*TIMER_CALLBACK)(void *); void irda_start_timer(struct timer_list *ptimer, int timeout, void* data, TIMER_CALLBACK callback); -inline void irlap_start_slot_timer(struct irlap_cb *self, int timeout); -inline void irlap_start_query_timer(struct irlap_cb *self, int timeout); -inline void irlap_start_final_timer(struct irlap_cb *self, int timeout); -inline void irlap_start_wd_timer(struct irlap_cb *self, int timeout); -inline void irlap_start_backoff_timer(struct irlap_cb *self, int timeout); +void irlap_start_slot_timer(struct irlap_cb *self, int timeout); +void irlap_start_query_timer(struct irlap_cb *self, int timeout); +void irlap_start_final_timer(struct irlap_cb *self, int timeout); +void irlap_start_wd_timer(struct irlap_cb *self, int timeout); +void irlap_start_backoff_timer(struct irlap_cb *self, int timeout); void irlap_start_mbusy_timer(struct irlap_cb *self, int timeout); void irlap_stop_mbusy_timer(struct irlap_cb *); -inline void irlmp_start_watchdog_timer(struct lsap_cb *, int timeout); -inline void irlmp_start_discovery_timer(struct irlmp_cb *, int timeout); -inline void irlmp_start_idle_timer(struct lap_cb *, int timeout); -inline void irlmp_stop_idle_timer(struct lap_cb *self); +void irlmp_start_watchdog_timer(struct lsap_cb *, int timeout); +void irlmp_start_discovery_timer(struct irlmp_cb *, int timeout); +void irlmp_start_idle_timer(struct lap_cb *, int timeout); +void irlmp_stop_idle_timer(struct lap_cb *self); #endif diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 270523896c4d..35f600ba43ba 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h @@ -203,6 +203,7 @@ typedef long psched_tdiff_t; #define PSCHED_GET_TIME(stamp) do_gettimeofday(&(stamp)) #define PSCHED_US2JIFFIE(usecs) (((usecs)+(1000000/HZ-1))/(1000000/HZ)) +#define PSCHED_JIFFIE2US(delay) ((delay)*(1000000/HZ)) #define PSCHED_EXPORTLIST EXPORT_SYMBOL(psched_tod_diff); @@ -251,6 +252,7 @@ extern PSCHED_WATCHER psched_time_mark; #endif #define PSCHED_US2JIFFIE(delay) (((delay)+(1<<PSCHED_JSCALE)-1)>>PSCHED_JSCALE) +#define PSCHED_JIFFIE2US(delay) ((delay)<<PSCHED_JSCALE) #elif PSCHED_CLOCK_SOURCE == PSCHED_CPU @@ -261,6 +263,7 @@ extern int psched_clock_scale; EXPORT_SYMBOL(psched_clock_scale); #define PSCHED_US2JIFFIE(delay) (((delay)+psched_clock_per_hz-1)/psched_clock_per_hz) +#define PSCHED_JIFFIE2US(delay) ((delay)*psched_clock_per_hz) #ifdef CONFIG_X86_TSC diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 92394f3de76a..a36880e6733f 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -369,7 +369,7 @@ typedef struct sctp_sender_hb_info { struct sctp_paramhdr param_hdr; union sctp_addr daddr; unsigned long sent_at; -} sctp_sender_hb_info_t __attribute__((packed)); +} __attribute__((packed)) sctp_sender_hb_info_t; /* * RFC 2960 1.3.2 Sequenced Delivery within Streams diff --git a/include/net/tcp.h b/include/net/tcp.h index 4ef3b80fe541..55c5ea8f16ac 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -579,6 +579,7 @@ extern int sysctl_tcp_adv_win_scale; extern int sysctl_tcp_tw_reuse; extern int sysctl_tcp_frto; extern int sysctl_tcp_low_latency; +extern int sysctl_tcp_westwood; extern atomic_t tcp_memory_allocated; extern atomic_t tcp_sockets_allocated; @@ -738,7 +739,7 @@ DECLARE_SNMP_STAT(struct tcp_mib, tcp_statistics); #define TCP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(tcp_statistics, field, val) #define TCP_ADD_STATS_USER(field, val) SNMP_ADD_STATS_USER(tcp_statistics, field, val) -extern inline void tcp_put_port(struct sock *sk); +extern void tcp_put_port(struct sock *sk); extern void tcp_inherit_port(struct sock *sk, struct sock *child); extern void tcp_v4_err(struct sk_buff *skb, u32); @@ -2019,4 +2020,67 @@ struct tcp_iter_state { extern int tcp_proc_register(struct tcp_seq_afinfo *afinfo); extern void tcp_proc_unregister(struct tcp_seq_afinfo *afinfo); +/* TCP Westwood functions and constants */ + +#define TCP_WESTWOOD_INIT_RTT (20*HZ) /* maybe too conservative?! */ +#define TCP_WESTWOOD_RTT_MIN (HZ/20) /* 50ms */ + +static inline void tcp_westwood_update_rtt(struct tcp_opt *tp, __u32 rtt_seq) +{ + if (sysctl_tcp_westwood) + tp->westwood.rtt = rtt_seq; +} + +void __tcp_westwood_fast_bw(struct sock *, struct sk_buff *); +void __tcp_westwood_slow_bw(struct sock *, struct sk_buff *); + +static inline void tcp_westwood_fast_bw(struct sock *sk, struct sk_buff *skb) +{ + if (sysctl_tcp_westwood) + __tcp_westwood_fast_bw(sk, skb); +} + +static inline void tcp_westwood_slow_bw(struct sock *sk, struct sk_buff *skb) +{ + if (sysctl_tcp_westwood) + __tcp_westwood_slow_bw(sk, skb); +} + +static inline __u32 __tcp_westwood_bw_rttmin(const struct tcp_opt *tp) +{ + return max((tp->westwood.bw_est) * (tp->westwood.rtt_min) / + (__u32) (tp->mss_cache), + 2U); +} + +static inline __u32 tcp_westwood_bw_rttmin(const struct tcp_opt *tp) +{ + return sysctl_tcp_westwood ? __tcp_westwood_bw_rttmin(tp) : 0; +} + +static inline int tcp_westwood_ssthresh(struct tcp_opt *tp) +{ + __u32 ssthresh = 0; + + if (sysctl_tcp_westwood) { + ssthresh = __tcp_westwood_bw_rttmin(tp); + if (ssthresh) + tp->snd_ssthresh = ssthresh; + } + + return (ssthresh != 0); +} + +static inline int tcp_westwood_cwnd(struct tcp_opt *tp) +{ + __u32 cwnd = 0; + + if (sysctl_tcp_westwood) { + cwnd = __tcp_westwood_bw_rttmin(tp); + if (cwnd) + tp->snd_cwnd = cwnd; + } + + return (cwnd != 0); +} #endif /* _TCP_H */ diff --git a/include/pcmcia/mem_op.h b/include/pcmcia/mem_op.h index 3faeb2d23c1e..559d87352f9a 100644 --- a/include/pcmcia/mem_op.h +++ b/include/pcmcia/mem_op.h @@ -81,8 +81,12 @@ static inline void copy_from_pc(void *to, const void *from, size_t n) size_t odd = (n & 1); n -= odd; while (n) { - *(u_short *)to = __raw_readw(from); - (char *)to += 2; (char *)from += 2; n -= 2; + u_short *t = to; + + *t = __raw_readw(from); + to = (void *)((long)to + 2); + from = (const void *)((long)from + 2); + n -= 2; } if (odd) *(u_char *)to = readb(from); @@ -94,7 +98,9 @@ static inline void copy_to_pc(void *to, const void *from, size_t n) n -= odd; while (n) { __raw_writew(*(u_short *)from, to); - (char *)to += 2; (char *)from += 2; n -= 2; + to = (void *)((long)to + 2); + from = (const void *)((long)from + 2); + n -= 2; } if (odd) writeb(*(u_char *)from, to); @@ -106,7 +112,9 @@ static inline void copy_pc_to_user(void *to, const void *from, size_t n) n -= odd; while (n) { put_user(__raw_readw(from), (short *)to); - (char *)to += 2; (char *)from += 2; n -= 2; + to = (void *)((long)to + 2); + from = (const void *)((long)from + 2); + n -= 2; } if (odd) put_user(readb(from), (char *)to); @@ -121,7 +129,9 @@ static inline void copy_user_to_pc(void *to, const void *from, size_t n) while (n) { get_user(s, (short *)from); __raw_writew(s, to); - (char *)to += 2; (char *)from += 2; n -= 2; + to = (void *)((long)to + 2); + from = (const void *)((long)from + 2); + n -= 2; } if (odd) { get_user(c, (char *)from); diff --git a/include/video/sisfb.h b/include/video/sisfb.h index 11ebb1e81683..5d120172d4fe 100644 --- a/include/video/sisfb.h +++ b/include/video/sisfb.h @@ -1,37 +1,98 @@ +/* + * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the named License, + * or any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + */ + #ifndef _LINUX_SISFB #define _LINUX_SISFB -#include <linux/spinlock.h> - #include <asm/ioctl.h> #include <asm/types.h> -#define DISPTYPE_CRT1 0x00000008L -#define DISPTYPE_CRT2 0x00000004L -#define DISPTYPE_LCD 0x00000002L -#define DISPTYPE_TV 0x00000001L -#define DISPTYPE_DISP1 DISPTYPE_CRT1 -#define DISPTYPE_DISP2 (DISPTYPE_CRT2 | DISPTYPE_LCD | DISPTYPE_TV) -#define DISPMODE_SINGLE 0x00000020L -#define DISPMODE_MIRROR 0x00000010L -#define DISPMODE_DUALVIEW 0x00000040L - -#define HASVB_NONE 0x00 -#define HASVB_301 0x01 -#define HASVB_LVDS 0x02 -#define HASVB_TRUMPION 0x04 -#define HASVB_LVDS_CHRONTEL 0x10 -#define HASVB_302 0x20 -#define HASVB_303 0x40 -#define HASVB_CHRONTEL 0x80 - -/* TW: *Never* change the order of the following enum */ +/**********************************************/ +/* PUBLIC */ +/**********************************************/ + +/* vbflags */ +#define CRT2_DEFAULT 0x00000001 +#define CRT2_LCD 0x00000002 /* TW: Never change the order of the CRT2_XXX entries */ +#define CRT2_TV 0x00000004 /* (see SISCycleCRT2Type()) */ +#define CRT2_VGA 0x00000008 +#define TV_NTSC 0x00000010 +#define TV_PAL 0x00000020 +#define TV_HIVISION 0x00000040 +#define TV_YPBPR 0x00000080 +#define TV_AVIDEO 0x00000100 +#define TV_SVIDEO 0x00000200 +#define TV_SCART 0x00000400 +#define VB_CONEXANT 0x00000800 +#define TV_PALM 0x00001000 +#define TV_PALN 0x00002000 +#define TV_NTSCJ 0x00001000 +#define VB_302ELV 0x00004000 +#define TV_CHSCART 0x00008000 +#define TV_CHYPBPR525I 0x00010000 +#define CRT1_VGA 0x00000000 +#define CRT1_LCDA 0x00020000 +#define VGA2_CONNECTED 0x00040000 +#define VB_DISPTYPE_CRT1 0x00080000 /* CRT1 connected and used */ +#define VB_301 0x00100000 /* Video bridge type */ +#define VB_301B 0x00200000 +#define VB_302B 0x00400000 +#define VB_30xBDH 0x00800000 /* 30xB DH version (w/o LCD support) */ +#define VB_LVDS 0x01000000 +#define VB_CHRONTEL 0x02000000 +#define VB_301LV 0x04000000 +#define VB_302LV 0x08000000 +#define VB_301C 0x10000000 +#define VB_SINGLE_MODE 0x20000000 /* CRT1 or CRT2; determined by DISPTYPE_CRTx */ +#define VB_MIRROR_MODE 0x40000000 /* CRT1 + CRT2 identical (mirror mode) */ +#define VB_DUALVIEW_MODE 0x80000000 /* CRT1 + CRT2 independent (dual head mode) */ + +/* Aliases: */ +#define CRT2_ENABLE (CRT2_LCD | CRT2_TV | CRT2_VGA) +#define TV_STANDARD (TV_NTSC | TV_PAL | TV_PALM | TV_PALN | TV_NTSCJ) +#define TV_INTERFACE (TV_AVIDEO|TV_SVIDEO|TV_SCART|TV_HIVISION|TV_YPBPR|TV_CHSCART|TV_CHYPBPR525I) + +/* Only if TV_YPBPR is set: */ +#define TV_YPBPR525I TV_NTSC +#define TV_YPBPR525P TV_PAL +#define TV_YPBPR750P TV_PALM +#define TV_YPBPR1080I TV_PALN +#define TV_YPBPRALL (TV_YPBPR525I | TV_YPBPR525P | TV_YPBPR750P | TV_YPBPR1080I) + +#define VB_SISBRIDGE (VB_301|VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV|VB_302ELV) +#define VB_SISTVBRIDGE (VB_301|VB_301B|VB_301C|VB_302B|VB_301LV|VB_302LV) +#define VB_VIDEOBRIDGE (VB_SISBRIDGE | VB_LVDS | VB_CHRONTEL | VB_CONEXANT) + +#define VB_DISPTYPE_DISP2 CRT2_ENABLE +#define VB_DISPTYPE_CRT2 CRT2_ENABLE +#define VB_DISPTYPE_DISP1 VB_DISPTYPE_CRT1 +#define VB_DISPMODE_SINGLE VB_SINGLE_MODE +#define VB_DISPMODE_MIRROR VB_MIRROR_MODE +#define VB_DISPMODE_DUAL VB_DUALVIEW_MODE +#define VB_DISPLAY_MODE (SINGLE_MODE | MIRROR_MODE | DUALVIEW_MODE) + +/* *Never* change the order of the following enum */ typedef enum _SIS_CHIP_TYPE { - SIS_VGALegacy = 0, + SIS_VGALegacy = 0, /* chip_id in sisfb_info */ SIS_300, SIS_630, SIS_540, - SIS_730, + SIS_730, SIS_315H, SIS_315, SIS_315PRO, @@ -39,15 +100,73 @@ typedef enum _SIS_CHIP_TYPE { SIS_650, SIS_740, SIS_330, + SIS_661, + SIS_741, + SIS_660, + SIS_760, MAX_SIS_CHIP } SIS_CHIP_TYPE; -typedef enum _VGA_ENGINE { - UNKNOWN_VGA = 0, - SIS_300_VGA, - SIS_315_VGA, -} VGA_ENGINE; +/* Addtional IOCTLs for communication sisfb <> X driver */ +/* If changing this, vgatypes.h must also be changed (for X driver) */ + +/* ioctl for identifying and giving some info (esp. memory heap start) */ +#define SISFB_GET_INFO _IOR('n',0xF8,__u32) +/* ioctrl to get current vertical retrace status */ +#define SISFB_GET_VBRSTATUS _IOR('n',0xF9,__u32) +/* ioctl to enable/disable panning auto-maximize (like nomax parameter) */ +#define SISFB_GET_AUTOMAXIMIZE _IOR('n',0xFA,__u32) +#define SISFB_SET_AUTOMAXIMIZE _IOW('n',0xFA,__u32) + +/* TW: Structure argument for SISFB_GET_INFO ioctl */ +typedef struct _SISFB_INFO sisfb_info, *psisfb_info; + +struct _SISFB_INFO { + unsigned long sisfb_id; /* for identifying sisfb */ +#ifndef SISFB_ID +#define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */ +#endif + int chip_id; /* PCI ID of detected chip */ + int memory; /* video memory in KB which sisfb manages */ + int heapstart; /* heap start (= sisfb "mem" argument) in KB */ + unsigned char fbvidmode; /* current sisfb mode */ + + unsigned char sisfb_version; + unsigned char sisfb_revision; + unsigned char sisfb_patchlevel; + + unsigned char sisfb_caps; /* Sisfb capabilities */ + + int sisfb_tqlen; /* turbo queue length (in KB) */ + + unsigned int sisfb_pcibus; /* The card's PCI ID */ + unsigned int sisfb_pcislot; + unsigned int sisfb_pcifunc; + + unsigned char sisfb_lcdpdc; /* PanelDelayCompensation */ + + unsigned char sisfb_lcda; /* Detected status of LCDA for low res/text modes */ + + unsigned long sisfb_vbflags; + unsigned long sisfb_currentvbflags; + + int sisfb_scalelcd; + unsigned long sisfb_specialtiming; + + unsigned char sisfb_haveemi; + unsigned char sisfb_emi30,sisfb_emi31,sisfb_emi32,sisfb_emi33; + unsigned char sisfb_haveemilcd; + + char reserved[213]; /* for future use */ +}; + +/* For fb memory manager */ +struct sis_memreq { + unsigned long offset; + unsigned long size; +}; +/* More or less deprecated stuff follows: */ typedef enum _TVTYPE { TVMODE_NTSC = 0, TVMODE_PAL, @@ -63,19 +182,14 @@ typedef enum _TVPLUGTYPE { TVPLUG_TOTAL } SIS_TV_PLUG; -struct sis_memreq { - unsigned long offset; - unsigned long size; -}; - struct mode_info { int bpp; int xres; int yres; - int v_xres; - int v_yres; - int org_x; - int org_y; + int v_xres; /* deprecated - use var instead */ + int v_yres; /* deprecated - use var instead */ + int org_x; /* deprecated - use var instead */ + int org_y; /* deprecated - use var instead */ unsigned int vrate; }; @@ -83,15 +197,30 @@ struct ap_data { struct mode_info minfo; unsigned long iobase; unsigned int mem_size; - unsigned long disp_state; + unsigned long disp_state; /* deprecated */ SIS_CHIP_TYPE chip; unsigned char hasVB; - SIS_TV_TYPE TV_type; - SIS_TV_PLUG TV_plug; + SIS_TV_TYPE TV_type; /* deprecated */ + SIS_TV_PLUG TV_plug; /* deprecated */ unsigned long version; - char reserved[256]; + unsigned long vbflags; /* replaces deprecated entries above */ + unsigned long currentvbflags; + char reserved[248]; }; +/**********************************************/ +/* PRIVATE */ +/**********************************************/ + +#ifdef __KERNEL__ +#include <linux/spinlock.h> + +typedef enum _VGA_ENGINE { + UNKNOWN_VGA = 0, + SIS_300_VGA, + SIS_315_VGA, +} VGA_ENGINE; + struct video_info { int chip_id; unsigned int video_size; @@ -107,26 +236,26 @@ struct video_info { int video_cmap_len; int video_width; int video_height; - int video_vwidth; - int video_vheight; - int org_x; - int org_y; + int video_vwidth; /* DEPRECATED - use var instead */ + int video_vheight; /* DEPRECATED - use var instead */ + int org_x; /* DEPRECATED - use var instead */ + int org_y; /* DEPRECATED - use var instead */ int video_linelength; unsigned int refresh_rate; - unsigned long disp_state; - unsigned char hasVB; - unsigned char TV_type; - unsigned char TV_plug; + unsigned long disp_state; /* DEPRECATED */ + unsigned char hasVB; /* DEPRECATED */ + unsigned char TV_type; /* DEPRECATED */ + unsigned char TV_plug; /* DEPRECATED */ SIS_CHIP_TYPE chip; unsigned char revision_id; - unsigned short DstColor; /* TW: For 2d acceleration */ + unsigned short DstColor; /* For 2d acceleration */ unsigned long SiS310_AccelDepth; unsigned long CommandReg; - spinlock_t lockaccel; + spinlock_t lockaccel; /* Do not use outside of kernel! */ unsigned int pcibus; unsigned int pcislot; @@ -137,58 +266,20 @@ struct video_info { unsigned short subsysvendor; unsigned short subsysdevice; - char reserved[236]; -}; - - -/* TW: Addtional IOCTL for communication sisfb <> X driver */ -/* If changing this, vgatypes.h must also be changed (for X driver) */ - -/* TW: ioctl for identifying and giving some info (esp. memory heap start) */ - -/* - * NOTE! The ioctl types used to be "size_t" by mistake, but were - * really meant to be __u32. Changed to "__u32" even though that - * changes the value on 64-bit architectures, because the value - * (with a 4-byte size) is also hardwired in vgatypes.h for user - * space exports. So "__u32" is actually more compatible, duh! - */ -#define SISFB_GET_INFO _IOR('n',0xF8,__u32) -#define SISFB_GET_VBRSTATUS _IOR('n',0xF9,__u32) - -/* TW: Structure argument for SISFB_GET_INFO ioctl */ -typedef struct _SISFB_INFO sisfb_info, *psisfb_info; - -struct _SISFB_INFO { - unsigned long sisfb_id; /* for identifying sisfb */ -#ifndef SISFB_ID -#define SISFB_ID 0x53495346 /* Identify myself with 'SISF' */ -#endif - int chip_id; /* PCI ID of detected chip */ - int memory; /* video memory in KB which sisfb manages */ - int heapstart; /* heap start (= sisfb "mem" argument) in KB */ - unsigned char fbvidmode; /* current sisfb mode */ - - unsigned char sisfb_version; - unsigned char sisfb_revision; - unsigned char sisfb_patchlevel; + unsigned long vbflags; /* Replacing deprecated stuff from above */ + unsigned long currentvbflags; - unsigned char sisfb_caps; /* Sisfb capabilities */ + int current_bpp; + int current_width; + int current_height; + int current_htotal; + int current_vtotal; + __u32 current_pixclock; + int current_refresh_rate; - int sisfb_tqlen; /* turbo queue length (in KB) */ - - unsigned int sisfb_pcibus; /* The card's PCI ID */ - unsigned int sisfb_pcislot; - unsigned int sisfb_pcifunc; - - unsigned char sisfb_lcdpdc; /* PanelDelayCompensation */ - - unsigned char sisfb_lcda; /* Detected status of LCDA for low res/text modes */ - - char reserved[235]; /* for future use */ + char reserved[200]; }; -#ifdef __KERNEL__ extern struct video_info ivideo; extern void sis_malloc(struct sis_memreq *req); |
