From: Peter Korsgaard Date: Mon, 26 Jan 2009 21:02:25 +0000 (-0000) Subject: toolchain/kernel-headers: remove ancient (and unused) patches X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d141a6985a6bd2b6f42036ae88dafbbbd0beb470;p=buildroot.git toolchain/kernel-headers: remove ancient (and unused) patches --- diff --git a/toolchain/kernel-headers/linux-libc-headers-2.6.11-nios2nommu.patch.conditional b/toolchain/kernel-headers/linux-libc-headers-2.6.11-nios2nommu.patch.conditional deleted file mode 100644 index b8c3fff8f0..0000000000 --- a/toolchain/kernel-headers/linux-libc-headers-2.6.11-nios2nommu.patch.conditional +++ /dev/null @@ -1,13527 +0,0 @@ ---- linux/include/asm-generic/4level-fixup.h -+++ linux/include/asm-generic/4level-fixup.h -@@ -0,0 +1,34 @@ -+#ifndef _4LEVEL_FIXUP_H -+#define _4LEVEL_FIXUP_H -+ -+#define __ARCH_HAS_4LEVEL_HACK -+ -+#define PUD_SIZE PGDIR_SIZE -+#define PUD_MASK PGDIR_MASK -+#define PTRS_PER_PUD 1 -+ -+#define pud_t pgd_t -+ -+#define pmd_alloc(mm, pud, address) \ -+({ pmd_t *ret; \ -+ if (pgd_none(*pud)) \ -+ ret = __pmd_alloc(mm, pud, address); \ -+ else \ -+ ret = pmd_offset(pud, address); \ -+ ret; \ -+}) -+ -+#define pud_alloc(mm, pgd, address) (pgd) -+#define pud_offset(pgd, start) (pgd) -+#define pud_none(pud) 0 -+#define pud_bad(pud) 0 -+#define pud_present(pud) 1 -+#define pud_ERROR(pud) do { } while (0) -+#define pud_clear(pud) pgd_clear(pud) -+ -+#undef pud_free_tlb -+#define pud_free_tlb(tlb, x) do { } while (0) -+#define pud_free(x) do { } while (0) -+#define __pud_free_tlb(tlb, x) do { } while (0) -+ -+#endif ---- linux/include/asm-generic/bitops.h -+++ linux/include/asm-generic/bitops.h -@@ -0,0 +1,81 @@ -+#ifndef _ASM_GENERIC_BITOPS_H_ -+#define _ASM_GENERIC_BITOPS_H_ -+ -+/* -+ * For the benefit of those who are trying to port Linux to another -+ * architecture, here are some C-language equivalents. You should -+ * recode these in the native assembly language, if at all possible. -+ * To guarantee atomicity, these routines call cli() and sti() to -+ * disable interrupts while they operate. (You have to provide inline -+ * routines to cli() and sti().) -+ * -+ * Also note, these routines assume that you have 32 bit longs. -+ * You will have to change this if you are trying to port Linux to the -+ * Alpha architecture or to a Cray. :-) -+ * -+ * C language equivalents written by Theodore Ts'o, 9/26/92 -+ */ -+ -+extern __inline__ int set_bit(int nr,long * addr) -+{ -+ int mask, retval; -+ -+ addr += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ cli(); -+ retval = (mask & *addr) != 0; -+ *addr |= mask; -+ sti(); -+ return retval; -+} -+ -+extern __inline__ int clear_bit(int nr, long * addr) -+{ -+ int mask, retval; -+ -+ addr += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ cli(); -+ retval = (mask & *addr) != 0; -+ *addr &= ~mask; -+ sti(); -+ return retval; -+} -+ -+extern __inline__ int test_bit(int nr, const unsigned long * addr) -+{ -+ int mask; -+ -+ addr += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ return ((mask & *addr) != 0); -+} -+ -+/* -+ * fls: find last bit set. -+ */ -+ -+#define fls(x) generic_fls(x) -+ -+#ifdef __KERNEL__ -+ -+/* -+ * ffs: find first bit set. This is defined the same way as -+ * the libc and compiler builtin ffs routines, therefore -+ * differs in spirit from the above ffz (man ffs). -+ */ -+ -+#define ffs(x) generic_ffs(x) -+ -+/* -+ * hweightN: returns the hamming weight (i.e. the number -+ * of bits set) of a N-bit word -+ */ -+ -+#define hweight32(x) generic_hweight32(x) -+#define hweight16(x) generic_hweight16(x) -+#define hweight8(x) generic_hweight8(x) -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _ASM_GENERIC_BITOPS_H */ ---- linux/include/asm-generic/bug.h -+++ linux/include/asm-generic/bug.h -@@ -0,0 +1,34 @@ -+#ifndef _ASM_GENERIC_BUG_H -+#define _ASM_GENERIC_BUG_H -+ -+#include -+// #include -+ -+#ifndef HAVE_ARCH_BUG -+#define BUG() do { \ -+ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ -+ panic("BUG!"); \ -+} while (0) -+#endif -+ -+#ifndef HAVE_ARCH_PAGE_BUG -+#define PAGE_BUG(page) do { \ -+ printk("page BUG for page at %p\n", page); \ -+ BUG(); \ -+} while (0) -+#endif -+ -+#ifndef HAVE_ARCH_BUG_ON -+#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0) -+#endif -+ -+#ifndef HAVE_ARCH_WARN_ON -+#define WARN_ON(condition) do { \ -+ if (unlikely((condition)!=0)) { \ -+ printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \ -+ dump_stack(); \ -+ } \ -+} while (0) -+#endif -+ -+#endif ---- linux/include/asm-generic/cpumask_arith.h -+++ linux/include/asm-generic/cpumask_arith.h -@@ -0,0 +1,49 @@ -+#ifndef __ASM_GENERIC_CPUMASK_ARITH_H -+#define __ASM_GENERIC_CPUMASK_ARITH_H -+ -+/* -+ * Arithmetic type -based cpu bitmaps. A single unsigned long is used -+ * to contain the whole cpu bitmap. -+ */ -+ -+#define cpu_set(cpu, map) set_bit(cpu, &(map)) -+#define cpu_clear(cpu, map) clear_bit(cpu, &(map)) -+#define cpu_isset(cpu, map) test_bit(cpu, &(map)) -+#define cpu_test_and_set(cpu, map) test_and_set_bit(cpu, &(map)) -+ -+#define cpus_and(dst,src1,src2) do { dst = (src1) & (src2); } while (0) -+#define cpus_or(dst,src1,src2) do { dst = (src1) | (src2); } while (0) -+#define cpus_clear(map) do { map = 0; } while (0) -+#define cpus_complement(map) do { map = ~(map); } while (0) -+#define cpus_equal(map1, map2) ((map1) == (map2)) -+#define cpus_empty(map) ((map) == 0) -+#define cpus_addr(map) (&(map)) -+ -+#if BITS_PER_LONG == 32 -+#define cpus_weight(map) hweight32(map) -+#elif BITS_PER_LONG == 64 -+#define cpus_weight(map) hweight64(map) -+#endif -+ -+#define cpus_shift_right(dst, src, n) do { dst = (src) >> (n); } while (0) -+#define cpus_shift_left(dst, src, n) do { dst = (src) << (n); } while (0) -+ -+#define any_online_cpu(map) \ -+({ \ -+ cpumask_t __tmp__; \ -+ cpus_and(__tmp__, map, cpu_online_map); \ -+ __tmp__ ? first_cpu(__tmp__) : NR_CPUS; \ -+}) -+ -+#define CPU_MASK_ALL (~((cpumask_t)0) >> (8*sizeof(cpumask_t) - NR_CPUS)) -+#define CPU_MASK_NONE ((cpumask_t)0) -+ -+/* only ever use this for things that are _never_ used on large boxen */ -+#define cpus_coerce(map) ((unsigned long)(map)) -+#define cpus_promote(map) ({ map; }) -+#define cpumask_of_cpu(cpu) ({ ((cpumask_t)1) << (cpu); }) -+ -+#define first_cpu(map) __ffs(map) -+#define next_cpu(cpu, map) find_next_bit(&(map), NR_CPUS, cpu + 1) -+ -+#endif /* __ASM_GENERIC_CPUMASK_ARITH_H */ ---- linux/include/asm-generic/cpumask_array.h -+++ linux/include/asm-generic/cpumask_array.h -@@ -0,0 +1,54 @@ -+#ifndef __ASM_GENERIC_CPUMASK_ARRAY_H -+#define __ASM_GENERIC_CPUMASK_ARRAY_H -+ -+/* -+ * Array-based cpu bitmaps. An array of unsigned longs is used to contain -+ * the bitmap, and then contained in a structure so it may be passed by -+ * value. -+ */ -+ -+#define CPU_ARRAY_SIZE BITS_TO_LONGS(NR_CPUS) -+ -+#define cpu_set(cpu, map) set_bit(cpu, (map).mask) -+#define cpu_clear(cpu, map) clear_bit(cpu, (map).mask) -+#define cpu_isset(cpu, map) test_bit(cpu, (map).mask) -+#define cpu_test_and_set(cpu, map) test_and_set_bit(cpu, (map).mask) -+ -+#define cpus_and(dst,src1,src2) bitmap_and((dst).mask,(src1).mask, (src2).mask, NR_CPUS) -+#define cpus_or(dst,src1,src2) bitmap_or((dst).mask, (src1).mask, (src2).mask, NR_CPUS) -+#define cpus_clear(map) bitmap_clear((map).mask, NR_CPUS) -+#define cpus_complement(map) bitmap_complement((map).mask, NR_CPUS) -+#define cpus_equal(map1, map2) bitmap_equal((map1).mask, (map2).mask, NR_CPUS) -+#define cpus_empty(map) bitmap_empty(map.mask, NR_CPUS) -+#define cpus_addr(map) ((map).mask) -+#define cpus_weight(map) bitmap_weight((map).mask, NR_CPUS) -+#define cpus_shift_right(d, s, n) bitmap_shift_right((d).mask, (s).mask, n, NR_CPUS) -+#define cpus_shift_left(d, s, n) bitmap_shift_left((d).mask, (s).mask, n, NR_CPUS) -+#define first_cpu(map) find_first_bit((map).mask, NR_CPUS) -+#define next_cpu(cpu, map) find_next_bit((map).mask, NR_CPUS, cpu + 1) -+ -+/* only ever use this for things that are _never_ used on large boxen */ -+#define cpus_coerce(map) ((map).mask[0]) -+#define cpus_promote(map) ({ cpumask_t __cpu_mask = CPU_MASK_NONE;\ -+ __cpu_mask.mask[0] = map; \ -+ __cpu_mask; \ -+ }) -+#define cpumask_of_cpu(cpu) ({ cpumask_t __cpu_mask = CPU_MASK_NONE;\ -+ cpu_set(cpu, __cpu_mask); \ -+ __cpu_mask; \ -+ }) -+#define any_online_cpu(map) \ -+({ \ -+ cpumask_t __tmp__; \ -+ cpus_and(__tmp__, map, cpu_online_map); \ -+ find_first_bit(__tmp__.mask, NR_CPUS); \ -+}) -+ -+ -+/* -+ * um, these need to be usable as static initializers -+ */ -+#define CPU_MASK_ALL { {[0 ... CPU_ARRAY_SIZE-1] = ~0UL} } -+#define CPU_MASK_NONE { {[0 ... CPU_ARRAY_SIZE-1] = 0UL} } -+ -+#endif /* __ASM_GENERIC_CPUMASK_ARRAY_H */ ---- linux/include/asm-generic/cpumask_const_reference.h -+++ linux/include/asm-generic/cpumask_const_reference.h -@@ -0,0 +1,29 @@ -+#ifndef __ASM_GENERIC_CPUMASK_CONST_REFERENCE_H -+#define __ASM_GENERIC_CPUMASK_CONST_REFERENCE_H -+ -+struct cpumask_ref { -+ const cpumask_t *val; -+}; -+ -+typedef const struct cpumask_ref cpumask_const_t; -+ -+#define mk_cpumask_const(map) ((cpumask_const_t){ &(map) }) -+#define cpu_isset_const(cpu, map) cpu_isset(cpu, *(map).val) -+ -+#define cpus_and_const(dst,src1,src2) cpus_and(dst,*(src1).val,*(src2).val) -+#define cpus_or_const(dst,src1,src2) cpus_or(dst,*(src1).val,*(src2).val) -+ -+#define cpus_equal_const(map1, map2) cpus_equal(*(map1).val, *(map2).val) -+ -+#define cpus_copy_const(map1, map2) bitmap_copy((map1).mask, (map2).val->mask, NR_CPUS) -+ -+#define cpus_empty_const(map) cpus_empty(*(map).val) -+#define cpus_weight_const(map) cpus_weight(*(map).val) -+#define first_cpu_const(map) first_cpu(*(map).val) -+#define next_cpu_const(cpu, map) next_cpu(cpu, *(map).val) -+ -+/* only ever use this for things that are _never_ used on large boxen */ -+#define cpus_coerce_const(map) cpus_coerce(*(map).val) -+#define any_online_cpu_const(map) any_online_cpu(*(map).val) -+ -+#endif /* __ASM_GENERIC_CPUMASK_CONST_REFERENCE_H */ ---- linux/include/asm-generic/cpumask_const_value.h -+++ linux/include/asm-generic/cpumask_const_value.h -@@ -0,0 +1,21 @@ -+#ifndef __ASM_GENERIC_CPUMASK_CONST_VALUE_H -+#define __ASM_GENERIC_CPUMASK_CONST_VALUE_H -+ -+typedef const cpumask_t cpumask_const_t; -+ -+#define mk_cpumask_const(map) (map) -+#define cpu_isset_const(cpu, map) cpu_isset(cpu, map) -+#define cpus_and_const(dst,src1,src2) cpus_and(dst, src1, src2) -+#define cpus_or_const(dst,src1,src2) cpus_or(dst, src1, src2) -+#define cpus_equal_const(map1, map2) cpus_equal(map1, map2) -+#define cpus_empty_const(map) cpus_empty(map) -+#define cpus_copy_const(map1, map2) do { map1 = (cpumask_t)map2; } while (0) -+#define cpus_weight_const(map) cpus_weight(map) -+#define first_cpu_const(map) first_cpu(map) -+#define next_cpu_const(cpu, map) next_cpu(cpu, map) -+ -+/* only ever use this for things that are _never_ used on large boxen */ -+#define cpus_coerce_const(map) cpus_coerce(map) -+#define any_online_cpu_const(map) any_online_cpu(map) -+ -+#endif /* __ASM_GENERIC_CPUMASK_CONST_VALUE_H */ ---- linux/include/asm-generic/cpumask.h -+++ linux/include/asm-generic/cpumask.h -@@ -0,0 +1,40 @@ -+#ifndef __ASM_GENERIC_CPUMASK_H -+#define __ASM_GENERIC_CPUMASK_H -+ -+// #include -+#include -+#include -+#include -+#include -+ -+#if NR_CPUS > BITS_PER_LONG && NR_CPUS != 1 -+#define CPU_ARRAY_SIZE BITS_TO_LONGS(NR_CPUS) -+ -+struct cpumask -+{ -+ unsigned long mask[CPU_ARRAY_SIZE]; -+}; -+ -+typedef struct cpumask cpumask_t; -+ -+#else -+typedef unsigned long cpumask_t; -+#endif -+ -+#ifdef CONFIG_SMP -+#if NR_CPUS > BITS_PER_LONG -+#include -+#else -+#include -+#endif -+#else -+#include -+#endif -+ -+#if NR_CPUS <= 4*BITS_PER_LONG -+#include -+#else -+#include -+#endif -+ -+#endif /* __ASM_GENERIC_CPUMASK_H */ ---- linux/include/asm-generic/cpumask_up.h -+++ linux/include/asm-generic/cpumask_up.h -@@ -0,0 +1,59 @@ -+#ifndef __ASM_GENERIC_CPUMASK_UP_H -+#define __ASM_GENERIC_CPUMASK_UP_H -+ -+#define cpus_coerce(map) (map) -+ -+#define cpu_set(cpu, map) do { (void)(cpu); cpus_coerce(map) = 1UL; } while (0) -+#define cpu_clear(cpu, map) do { (void)(cpu); cpus_coerce(map) = 0UL; } while (0) -+#define cpu_isset(cpu, map) ((void)(cpu), cpus_coerce(map) != 0UL) -+#define cpu_test_and_set(cpu, map) ((void)(cpu), test_and_set_bit(0, &(map))) -+ -+#define cpus_and(dst, src1, src2) \ -+ do { \ -+ if (cpus_coerce(src1) && cpus_coerce(src2)) \ -+ cpus_coerce(dst) = 1UL; \ -+ else \ -+ cpus_coerce(dst) = 0UL; \ -+ } while (0) -+ -+#define cpus_or(dst, src1, src2) \ -+ do { \ -+ if (cpus_coerce(src1) || cpus_coerce(src2)) \ -+ cpus_coerce(dst) = 1UL; \ -+ else \ -+ cpus_coerce(dst) = 0UL; \ -+ } while (0) -+ -+#define cpus_clear(map) do { cpus_coerce(map) = 0UL; } while (0) -+ -+#define cpus_complement(map) \ -+ do { \ -+ cpus_coerce(map) = !cpus_coerce(map); \ -+ } while (0) -+ -+#define cpus_equal(map1, map2) (cpus_coerce(map1) == cpus_coerce(map2)) -+#define cpus_empty(map) (cpus_coerce(map) == 0UL) -+#define cpus_addr(map) (&(map)) -+#define cpus_weight(map) (cpus_coerce(map) ? 1UL : 0UL) -+#define cpus_shift_right(d, s, n) do { cpus_coerce(d) = 0UL; } while (0) -+#define cpus_shift_left(d, s, n) do { cpus_coerce(d) = 0UL; } while (0) -+#define first_cpu(map) (cpus_coerce(map) ? 0 : 1) -+#define next_cpu(cpu, map) 1 -+ -+/* only ever use this for things that are _never_ used on large boxen */ -+#define cpus_promote(map) \ -+ ({ \ -+ cpumask_t __tmp__; \ -+ cpus_coerce(__tmp__) = map; \ -+ __tmp__; \ -+ }) -+#define cpumask_of_cpu(cpu) ((void)(cpu), cpus_promote(1)) -+#define any_online_cpu(map) (cpus_coerce(map) ? 0 : 1) -+ -+/* -+ * um, these need to be usable as static initializers -+ */ -+#define CPU_MASK_ALL 1UL -+#define CPU_MASK_NONE 0UL -+ -+#endif /* __ASM_GENERIC_CPUMASK_UP_H */ ---- linux/include/asm-generic/cputime.h -+++ linux/include/asm-generic/cputime.h -@@ -0,0 +1,64 @@ -+#ifndef _ASM_GENERIC_CPUTIME_H -+#define _ASM_GENERIC_CPUTIME_H -+ -+#include -+#include -+ -+typedef unsigned long cputime_t; -+ -+#define cputime_zero (0UL) -+#define cputime_max ((~0UL >> 1) - 1) -+#define cputime_add(__a, __b) ((__a) + (__b)) -+#define cputime_sub(__a, __b) ((__a) - (__b)) -+#define cputime_eq(__a, __b) ((__a) == (__b)) -+#define cputime_gt(__a, __b) ((__a) > (__b)) -+#define cputime_ge(__a, __b) ((__a) >= (__b)) -+#define cputime_lt(__a, __b) ((__a) < (__b)) -+#define cputime_le(__a, __b) ((__a) <= (__b)) -+#define cputime_to_jiffies(__ct) (__ct) -+#define jiffies_to_cputime(__hz) (__hz) -+ -+typedef u64 cputime64_t; -+ -+#define cputime64_zero (0ULL) -+#define cputime64_add(__a, __b) ((__a) + (__b)) -+#define cputime64_to_jiffies64(__ct) (__ct) -+#define cputime_to_cputime64(__ct) ((u64) __ct) -+ -+ -+/* -+ * Convert cputime to milliseconds and back. -+ */ -+#define cputime_to_msecs(__ct) jiffies_to_msecs(__ct) -+#define msecs_to_cputime(__msecs) msecs_to_jiffies(__msecs) -+ -+/* -+ * Convert cputime to seconds and back. -+ */ -+#define cputime_to_secs(jif) ((jif) / HZ) -+#define secs_to_cputime(sec) ((sec) * HZ) -+ -+/* -+ * Convert cputime to timespec and back. -+ */ -+#define timespec_to_cputime(__val) timespec_to_jiffies(__val) -+#define cputime_to_timespec(__ct,__val) jiffies_to_timespec(__ct,__val) -+ -+/* -+ * Convert cputime to timeval and back. -+ */ -+#define timeval_to_cputime(__val) timeval_to_jiffies(__val) -+#define cputime_to_timeval(__ct,__val) jiffies_to_timeval(__ct,__val) -+ -+/* -+ * Convert cputime to clock and back. -+ */ -+#define cputime_to_clock_t(__ct) jiffies_to_clock_t(__ct) -+#define clock_t_to_cputime(__x) clock_t_to_jiffies(__x) -+ -+/* -+ * Convert cputime64 to clock. -+ */ -+#define cputime64_to_clock_t(__ct) jiffies_64_to_clock_t(__ct) -+ -+#endif ---- linux/include/asm-generic/div64.h -+++ linux/include/asm-generic/div64.h -@@ -0,0 +1,58 @@ -+#ifndef _ASM_GENERIC_DIV64_H -+#define _ASM_GENERIC_DIV64_H -+/* -+ * Copyright (C) 2003 Bernardo Innocenti -+ * Based on former asm-ppc/div64.h and asm-m68knommu/div64.h -+ * -+ * The semantics of do_div() are: -+ * -+ * uint32_t do_div(uint64_t *n, uint32_t base) -+ * { -+ * uint32_t remainder = *n % base; -+ * *n = *n / base; -+ * return remainder; -+ * } -+ * -+ * NOTE: macro parameter n is evaluated multiple times, -+ * beware of side effects! -+ */ -+ -+#include -+#include -+ -+#if BITS_PER_LONG == 64 -+ -+# define do_div(n,base) ({ \ -+ uint32_t __base = (base); \ -+ uint32_t __rem; \ -+ __rem = ((uint64_t)(n)) % __base; \ -+ (n) = ((uint64_t)(n)) / __base; \ -+ __rem; \ -+ }) -+ -+#elif BITS_PER_LONG == 32 -+ -+extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor); -+ -+/* The unnecessary pointer compare is there -+ * to check for type safety (n must be 64bit) -+ */ -+# define do_div(n,base) ({ \ -+ uint32_t __base = (base); \ -+ uint32_t __rem; \ -+ (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \ -+ if (likely(((n) >> 32) == 0)) { \ -+ __rem = (uint32_t)(n) % __base; \ -+ (n) = (uint32_t)(n) / __base; \ -+ } else \ -+ __rem = __div64_32(&(n), __base); \ -+ __rem; \ -+ }) -+ -+#else /* BITS_PER_LONG == ?? */ -+ -+# error do_div() does not yet support the C64 -+ -+#endif /* BITS_PER_LONG */ -+ -+#endif /* _ASM_GENERIC_DIV64_H */ ---- linux/include/asm-generic/dma-mapping-broken.h -+++ linux/include/asm-generic/dma-mapping-broken.h -@@ -0,0 +1,22 @@ -+#ifndef _ASM_GENERIC_DMA_MAPPING_H -+#define _ASM_GENERIC_DMA_MAPPING_H -+ -+/* This is used for archs that do not support DMA */ -+ -+ -+static inline void * -+dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, -+ int flag) -+{ -+ BUG(); -+ return NULL; -+} -+ -+static inline void -+dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, -+ dma_addr_t dma_handle) -+{ -+ BUG(); -+} -+ -+#endif /* _ASM_GENERIC_DMA_MAPPING_H */ ---- linux/include/asm-generic/dma-mapping.h -+++ linux/include/asm-generic/dma-mapping.h -@@ -0,0 +1,309 @@ -+/* Copyright (C) 2002 by James.Bottomley@HansenPartnership.com -+ * -+ * Implements the generic device dma API via the existing pci_ one -+ * for unconverted architectures -+ */ -+ -+#ifndef _ASM_GENERIC_DMA_MAPPING_H -+#define _ASM_GENERIC_DMA_MAPPING_H -+ -+// #include -+ -+#ifdef CONFIG_PCI -+ -+/* we implement the API below in terms of the existing PCI one, -+ * so include it */ -+#include -+/* need struct page definitions */ -+#include -+ -+static inline int -+dma_supported(struct device *dev, u64 mask) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ return pci_dma_supported(to_pci_dev(dev), mask); -+} -+ -+static inline int -+dma_set_mask(struct device *dev, u64 dma_mask) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ return pci_set_dma_mask(to_pci_dev(dev), dma_mask); -+} -+ -+static inline void * -+dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, -+ int flag) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ return pci_alloc_consistent(to_pci_dev(dev), size, dma_handle); -+} -+ -+static inline void -+dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, -+ dma_addr_t dma_handle) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle); -+} -+ -+static inline dma_addr_t -+dma_map_single(struct device *dev, void *cpu_addr, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction); -+} -+ -+static inline void -+dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction); -+} -+ -+static inline dma_addr_t -+dma_map_page(struct device *dev, struct page *page, -+ unsigned long offset, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction); -+} -+ -+static inline void -+dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction); -+} -+ -+static inline int -+dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction); -+} -+ -+static inline void -+dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction); -+} -+ -+static inline void -+dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_dma_sync_single_for_cpu(to_pci_dev(dev), dma_handle, -+ size, (int)direction); -+} -+ -+static inline void -+dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_dma_sync_single_for_device(to_pci_dev(dev), dma_handle, -+ size, (int)direction); -+} -+ -+static inline void -+dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_dma_sync_sg_for_cpu(to_pci_dev(dev), sg, nelems, (int)direction); -+} -+ -+static inline void -+dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_dma_sync_sg_for_device(to_pci_dev(dev), sg, nelems, (int)direction); -+} -+ -+static inline int -+dma_mapping_error(dma_addr_t dma_addr) -+{ -+ return pci_dma_mapping_error(dma_addr); -+} -+ -+ -+#else -+ -+static inline int -+dma_supported(struct device *dev, u64 mask) -+{ -+ return 0; -+} -+ -+static inline int -+dma_set_mask(struct device *dev, u64 dma_mask) -+{ -+ BUG(); -+ return 0; -+} -+ -+static inline void * -+dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, -+ int flag) -+{ -+ BUG(); -+ return NULL; -+} -+ -+static inline void -+dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, -+ dma_addr_t dma_handle) -+{ -+ BUG(); -+} -+ -+static inline dma_addr_t -+dma_map_single(struct device *dev, void *cpu_addr, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+ return 0; -+} -+ -+static inline void -+dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline dma_addr_t -+dma_map_page(struct device *dev, struct page *page, -+ unsigned long offset, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+ return 0; -+} -+ -+static inline void -+dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline int -+dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+ return 0; -+} -+ -+static inline void -+dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline void -+dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline void -+dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline void -+dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline void -+dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline int -+dma_error(dma_addr_t dma_addr) -+{ -+ return 0; -+} -+ -+#endif -+ -+/* Now for the API extensions over the pci_ one */ -+ -+#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) -+#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) -+#define dma_is_consistent(d) (1) -+ -+static inline int -+dma_get_cache_alignment(void) -+{ -+ /* no easy way to get cache size on all processors, so return -+ * the maximum possible, to be safe */ -+ return (1 << L1_CACHE_SHIFT_MAX); -+} -+ -+static inline void -+dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, -+ unsigned long offset, size_t size, -+ enum dma_data_direction direction) -+{ -+ /* just sync everything, that's all the pci API can do */ -+ dma_sync_single_for_cpu(dev, dma_handle, offset+size, direction); -+} -+ -+static inline void -+dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, -+ unsigned long offset, size_t size, -+ enum dma_data_direction direction) -+{ -+ /* just sync everything, that's all the pci API can do */ -+ dma_sync_single_for_device(dev, dma_handle, offset+size, direction); -+} -+ -+static inline void -+dma_cache_sync(void *vaddr, size_t size, -+ enum dma_data_direction direction) -+{ -+ /* could define this in terms of the dma_cache ... operations, -+ * but if you get this on a platform, you should convert the platform -+ * to using the generic device DMA API */ -+ BUG(); -+} -+ -+#endif -+ ---- linux/include/asm-generic/errno-base.h -+++ linux/include/asm-generic/errno-base.h -@@ -0,0 +1,39 @@ -+#ifndef _ASM_GENERIC_ERRNO_BASE_H -+#define _ASM_GENERIC_ERRNO_BASE_H -+ -+#define EPERM 1 /* Operation not permitted */ -+#define ENOENT 2 /* No such file or directory */ -+#define ESRCH 3 /* No such process */ -+#define EINTR 4 /* Interrupted system call */ -+#define EIO 5 /* I/O error */ -+#define ENXIO 6 /* No such device or address */ -+#define E2BIG 7 /* Argument list too long */ -+#define ENOEXEC 8 /* Exec format error */ -+#define EBADF 9 /* Bad file number */ -+#define ECHILD 10 /* No child processes */ -+#define EAGAIN 11 /* Try again */ -+#define ENOMEM 12 /* Out of memory */ -+#define EACCES 13 /* Permission denied */ -+#define EFAULT 14 /* Bad address */ -+#define ENOTBLK 15 /* Block device required */ -+#define EBUSY 16 /* Device or resource busy */ -+#define EEXIST 17 /* File exists */ -+#define EXDEV 18 /* Cross-device link */ -+#define ENODEV 19 /* No such device */ -+#define ENOTDIR 20 /* Not a directory */ -+#define EISDIR 21 /* Is a directory */ -+#define EINVAL 22 /* Invalid argument */ -+#define ENFILE 23 /* File table overflow */ -+#define EMFILE 24 /* Too many open files */ -+#define ENOTTY 25 /* Not a typewriter */ -+#define ETXTBSY 26 /* Text file busy */ -+#define EFBIG 27 /* File too large */ -+#define ENOSPC 28 /* No space left on device */ -+#define ESPIPE 29 /* Illegal seek */ -+#define EROFS 30 /* Read-only file system */ -+#define EMLINK 31 /* Too many links */ -+#define EPIPE 32 /* Broken pipe */ -+#define EDOM 33 /* Math argument out of domain of func */ -+#define ERANGE 34 /* Math result not representable */ -+ -+#endif ---- linux/include/asm-generic/errno.h -+++ linux/include/asm-generic/errno.h -@@ -0,0 +1,105 @@ -+#ifndef _ASM_GENERIC_ERRNO_H -+#define _ASM_GENERIC_ERRNO_H -+ -+#include -+ -+#define EDEADLK 35 /* Resource deadlock would occur */ -+#define ENAMETOOLONG 36 /* File name too long */ -+#define ENOLCK 37 /* No record locks available */ -+#define ENOSYS 38 /* Function not implemented */ -+#define ENOTEMPTY 39 /* Directory not empty */ -+#define ELOOP 40 /* Too many symbolic links encountered */ -+#define EWOULDBLOCK EAGAIN /* Operation would block */ -+#define ENOMSG 42 /* No message of desired type */ -+#define EIDRM 43 /* Identifier removed */ -+#define ECHRNG 44 /* Channel number out of range */ -+#define EL2NSYNC 45 /* Level 2 not synchronized */ -+#define EL3HLT 46 /* Level 3 halted */ -+#define EL3RST 47 /* Level 3 reset */ -+#define ELNRNG 48 /* Link number out of range */ -+#define EUNATCH 49 /* Protocol driver not attached */ -+#define ENOCSI 50 /* No CSI structure available */ -+#define EL2HLT 51 /* Level 2 halted */ -+#define EBADE 52 /* Invalid exchange */ -+#define EBADR 53 /* Invalid request descriptor */ -+#define EXFULL 54 /* Exchange full */ -+#define ENOANO 55 /* No anode */ -+#define EBADRQC 56 /* Invalid request code */ -+#define EBADSLT 57 /* Invalid slot */ -+ -+#define EDEADLOCK EDEADLK -+ -+#define EBFONT 59 /* Bad font file format */ -+#define ENOSTR 60 /* Device not a stream */ -+#define ENODATA 61 /* No data available */ -+#define ETIME 62 /* Timer expired */ -+#define ENOSR 63 /* Out of streams resources */ -+#define ENONET 64 /* Machine is not on the network */ -+#define ENOPKG 65 /* Package not installed */ -+#define EREMOTE 66 /* Object is remote */ -+#define ENOLINK 67 /* Link has been severed */ -+#define EADV 68 /* Advertise error */ -+#define ESRMNT 69 /* Srmount error */ -+#define ECOMM 70 /* Communication error on send */ -+#define EPROTO 71 /* Protocol error */ -+#define EMULTIHOP 72 /* Multihop attempted */ -+#define EDOTDOT 73 /* RFS specific error */ -+#define EBADMSG 74 /* Not a data message */ -+#define EOVERFLOW 75 /* Value too large for defined data type */ -+#define ENOTUNIQ 76 /* Name not unique on network */ -+#define EBADFD 77 /* File descriptor in bad state */ -+#define EREMCHG 78 /* Remote address changed */ -+#define ELIBACC 79 /* Can not access a needed shared library */ -+#define ELIBBAD 80 /* Accessing a corrupted shared library */ -+#define ELIBSCN 81 /* .lib section in a.out corrupted */ -+#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ -+#define ELIBEXEC 83 /* Cannot exec a shared library directly */ -+#define EILSEQ 84 /* Illegal byte sequence */ -+#define ERESTART 85 /* Interrupted system call should be restarted */ -+#define ESTRPIPE 86 /* Streams pipe error */ -+#define EUSERS 87 /* Too many users */ -+#define ENOTSOCK 88 /* Socket operation on non-socket */ -+#define EDESTADDRREQ 89 /* Destination address required */ -+#define EMSGSIZE 90 /* Message too long */ -+#define EPROTOTYPE 91 /* Protocol wrong type for socket */ -+#define ENOPROTOOPT 92 /* Protocol not available */ -+#define EPROTONOSUPPORT 93 /* Protocol not supported */ -+#define ESOCKTNOSUPPORT 94 /* Socket type not supported */ -+#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -+#define EPFNOSUPPORT 96 /* Protocol family not supported */ -+#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ -+#define EADDRINUSE 98 /* Address already in use */ -+#define EADDRNOTAVAIL 99 /* Cannot assign requested address */ -+#define ENETDOWN 100 /* Network is down */ -+#define ENETUNREACH 101 /* Network is unreachable */ -+#define ENETRESET 102 /* Network dropped connection because of reset */ -+#define ECONNABORTED 103 /* Software caused connection abort */ -+#define ECONNRESET 104 /* Connection reset by peer */ -+#define ENOBUFS 105 /* No buffer space available */ -+#define EISCONN 106 /* Transport endpoint is already connected */ -+#define ENOTCONN 107 /* Transport endpoint is not connected */ -+#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ -+#define ETOOMANYREFS 109 /* Too many references: cannot splice */ -+#define ETIMEDOUT 110 /* Connection timed out */ -+#define ECONNREFUSED 111 /* Connection refused */ -+#define EHOSTDOWN 112 /* Host is down */ -+#define EHOSTUNREACH 113 /* No route to host */ -+#define EALREADY 114 /* Operation already in progress */ -+#define EINPROGRESS 115 /* Operation now in progress */ -+#define ESTALE 116 /* Stale NFS file handle */ -+#define EUCLEAN 117 /* Structure needs cleaning */ -+#define ENOTNAM 118 /* Not a XENIX named type file */ -+#define ENAVAIL 119 /* No XENIX semaphores available */ -+#define EISNAM 120 /* Is a named type file */ -+#define EREMOTEIO 121 /* Remote I/O error */ -+#define EDQUOT 122 /* Quota exceeded */ -+ -+#define ENOMEDIUM 123 /* No medium found */ -+#define EMEDIUMTYPE 124 /* Wrong medium type */ -+#define ECANCELED 125 /* Operation Canceled */ -+#define ENOKEY 126 /* Required key not available */ -+#define EKEYEXPIRED 127 /* Key has expired */ -+#define EKEYREVOKED 128 /* Key has been revoked */ -+#define EKEYREJECTED 129 /* Key was rejected by service */ -+ -+#endif ---- linux/include/asm-generic/hdreg.h -+++ linux/include/asm-generic/hdreg.h -@@ -0,0 +1,8 @@ -+#warning is obsolete, please do not use it -+ -+#ifndef __ASM_GENERIC_HDREG_H -+#define __ASM_GENERIC_HDREG_H -+ -+typedef unsigned long ide_ioreg_t; -+ -+#endif /* __ASM_GENERIC_HDREG_H */ ---- linux/include/asm-generic/ide_iops.h -+++ linux/include/asm-generic/ide_iops.h -@@ -0,0 +1,38 @@ -+/* Generic I/O and MEMIO string operations. */ -+ -+#define __ide_insw insw -+#define __ide_insl insl -+#define __ide_outsw outsw -+#define __ide_outsl outsl -+ -+static __inline__ void __ide_mm_insw(void __iomem *port, void *addr, u32 count) -+{ -+ while (count--) { -+ *(u16 *)addr = readw(port); -+ addr += 2; -+ } -+} -+ -+static __inline__ void __ide_mm_insl(void __iomem *port, void *addr, u32 count) -+{ -+ while (count--) { -+ *(u32 *)addr = readl(port); -+ addr += 4; -+ } -+} -+ -+static __inline__ void __ide_mm_outsw(void __iomem *port, void *addr, u32 count) -+{ -+ while (count--) { -+ writew(*(u16 *)addr, port); -+ addr += 2; -+ } -+} -+ -+static __inline__ void __ide_mm_outsl(void __iomem * port, void *addr, u32 count) -+{ -+ while (count--) { -+ writel(*(u32 *)addr, port); -+ addr += 4; -+ } -+} ---- linux/include/asm-generic/iomap.h -+++ linux/include/asm-generic/iomap.h -@@ -0,0 +1,63 @@ -+#ifndef __GENERIC_IO_H -+#define __GENERIC_IO_H -+ -+#include -+ -+/* -+ * These are the "generic" interfaces for doing new-style -+ * memory-mapped or PIO accesses. Architectures may do -+ * their own arch-optimized versions, these just act as -+ * wrappers around the old-style IO register access functions: -+ * read[bwl]/write[bwl]/in[bwl]/out[bwl] -+ * -+ * Don't include this directly, include it from . -+ */ -+ -+/* -+ * Read/write from/to an (offsettable) iomem cookie. It might be a PIO -+ * access or a MMIO access, these functions don't care. The info is -+ * encoded in the hardware mapping set up by the mapping functions -+ * (or the cookie itself, depending on implementation and hw). -+ * -+ * The generic routines just encode the PIO/MMIO as part of the -+ * cookie, and coldly assume that the MMIO IO mappings are not -+ * in the low address range. Architectures for which this is not -+ * true can't use this generic implementation. -+ */ -+extern unsigned int fastcall ioread8(void __iomem *); -+extern unsigned int fastcall ioread16(void __iomem *); -+extern unsigned int fastcall ioread32(void __iomem *); -+ -+extern void fastcall iowrite8(u8, void __iomem *); -+extern void fastcall iowrite16(u16, void __iomem *); -+extern void fastcall iowrite32(u32, void __iomem *); -+ -+/* -+ * "string" versions of the above. Note that they -+ * use native byte ordering for the accesses (on -+ * the assumption that IO and memory agree on a -+ * byte order, and CPU byteorder is irrelevant). -+ * -+ * They do _not_ update the port address. If you -+ * want MMIO that copies stuff laid out in MMIO -+ * memory across multiple ports, use "memcpy_toio()" -+ * and friends. -+ */ -+extern void fastcall ioread8_rep(void __iomem *port, void *buf, unsigned long count); -+extern void fastcall ioread16_rep(void __iomem *port, void *buf, unsigned long count); -+extern void fastcall ioread32_rep(void __iomem *port, void *buf, unsigned long count); -+ -+extern void fastcall iowrite8_rep(void __iomem *port, const void *buf, unsigned long count); -+extern void fastcall iowrite16_rep(void __iomem *port, const void *buf, unsigned long count); -+extern void fastcall iowrite32_rep(void __iomem *port, const void *buf, unsigned long count); -+ -+/* Create a virtual mapping cookie for an IO port range */ -+extern void __iomem *ioport_map(unsigned long port, unsigned int nr); -+extern void ioport_unmap(void __iomem *); -+ -+/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -+struct pci_dev; -+extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); -+extern void pci_iounmap(struct pci_dev *dev, void __iomem *); -+ -+#endif ---- linux/include/asm-generic/local.h -+++ linux/include/asm-generic/local.h -@@ -0,0 +1,118 @@ -+#ifndef _ASM_GENERIC_LOCAL_H -+#define _ASM_GENERIC_LOCAL_H -+ -+// #include -+#include -+#include -+#include -+ -+/* An unsigned long type for operations which are atomic for a single -+ * CPU. Usually used in combination with per-cpu variables. */ -+ -+#if BITS_PER_LONG == 32 -+/* Implement in terms of atomics. */ -+ -+/* Don't use typedef: don't want them to be mixed with atomic_t's. */ -+typedef struct -+{ -+ atomic_t a; -+} local_t; -+ -+#define LOCAL_INIT(i) { ATOMIC_INIT(i) } -+ -+#define local_read(l) ((unsigned long)atomic_read(&(l)->a)) -+#define local_set(l,i) atomic_set((&(l)->a),(i)) -+#define local_inc(l) atomic_inc(&(l)->a) -+#define local_dec(l) atomic_dec(&(l)->a) -+#define local_add(i,l) atomic_add((i),(&(l)->a)) -+#define local_sub(i,l) atomic_sub((i),(&(l)->a)) -+ -+/* Non-atomic variants, ie. preemption disabled and won't be touched -+ * in interrupt, etc. Some archs can optimize this case well. */ -+#define __local_inc(l) local_set((l), local_read(l) + 1) -+#define __local_dec(l) local_set((l), local_read(l) - 1) -+#define __local_add(i,l) local_set((l), local_read(l) + (i)) -+#define __local_sub(i,l) local_set((l), local_read(l) - (i)) -+ -+#else /* ... can't use atomics. */ -+/* Implement in terms of three variables. -+ Another option would be to use local_irq_save/restore. */ -+ -+typedef struct -+{ -+ /* 0 = in hardirq, 1 = in softirq, 2 = usermode. */ -+ unsigned long v[3]; -+} local_t; -+ -+#define _LOCAL_VAR(l) ((l)->v[!in_interrupt() + !in_irq()]) -+ -+#define LOCAL_INIT(i) { { (i), 0, 0 } } -+ -+static inline unsigned long local_read(local_t *l) -+{ -+ return l->v[0] + l->v[1] + l->v[2]; -+} -+ -+static inline void local_set(local_t *l, unsigned long v) -+{ -+ l->v[0] = v; -+ l->v[1] = l->v[2] = 0; -+} -+ -+static inline void local_inc(local_t *l) -+{ -+ preempt_disable(); -+ _LOCAL_VAR(l)++; -+ preempt_enable(); -+} -+ -+static inline void local_dec(local_t *l) -+{ -+ preempt_disable(); -+ _LOCAL_VAR(l)--; -+ preempt_enable(); -+} -+ -+static inline void local_add(unsigned long v, local_t *l) -+{ -+ preempt_disable(); -+ _LOCAL_VAR(l) += v; -+ preempt_enable(); -+} -+ -+static inline void local_sub(unsigned long v, local_t *l) -+{ -+ preempt_disable(); -+ _LOCAL_VAR(l) -= v; -+ preempt_enable(); -+} -+ -+/* Non-atomic variants, ie. preemption disabled and won't be touched -+ * in interrupt, etc. Some archs can optimize this case well. */ -+#define __local_inc(l) ((l)->v[0]++) -+#define __local_dec(l) ((l)->v[0]--) -+#define __local_add(i,l) ((l)->v[0] += (i)) -+#define __local_sub(i,l) ((l)->v[0] -= (i)) -+ -+#endif /* Non-atomic implementation */ -+ -+/* Use these for per-cpu local_t variables: on some archs they are -+ * much more efficient than these naive implementations. Note they take -+ * a variable (eg. mystruct.foo), not an address. -+ */ -+#define cpu_local_read(v) local_read(&__get_cpu_var(v)) -+#define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i)) -+#define cpu_local_inc(v) local_inc(&__get_cpu_var(v)) -+#define cpu_local_dec(v) local_dec(&__get_cpu_var(v)) -+#define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v)) -+#define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v)) -+ -+/* Non-atomic increments, ie. preemption disabled and won't be touched -+ * in interrupt, etc. Some archs can optimize this case well. -+ */ -+#define __cpu_local_inc(v) __local_inc(&__get_cpu_var(v)) -+#define __cpu_local_dec(v) __local_dec(&__get_cpu_var(v)) -+#define __cpu_local_add(i, v) __local_add((i), &__get_cpu_var(v)) -+#define __cpu_local_sub(i, v) __local_sub((i), &__get_cpu_var(v)) -+ -+#endif /* _ASM_GENERIC_LOCAL_H */ ---- linux/include/asm-generic/pci-dma-compat.h -+++ linux/include/asm-generic/pci-dma-compat.h -@@ -0,0 +1,107 @@ -+/* include this file if the platform implements the dma_ DMA Mapping API -+ * and wants to provide the pci_ DMA Mapping API in terms of it */ -+ -+#ifndef _ASM_GENERIC_PCI_DMA_COMPAT_H -+#define _ASM_GENERIC_PCI_DMA_COMPAT_H -+ -+#include -+ -+/* note pci_set_dma_mask isn't here, since it's a public function -+ * exported from drivers/pci, use dma_supported instead */ -+ -+static inline int -+pci_dma_supported(struct pci_dev *hwdev, u64 mask) -+{ -+ return dma_supported(hwdev == NULL ? NULL : &hwdev->dev, mask); -+} -+ -+static inline void * -+pci_alloc_consistent(struct pci_dev *hwdev, size_t size, -+ dma_addr_t *dma_handle) -+{ -+ return dma_alloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, dma_handle, GFP_ATOMIC); -+} -+ -+static inline void -+pci_free_consistent(struct pci_dev *hwdev, size_t size, -+ void *vaddr, dma_addr_t dma_handle) -+{ -+ dma_free_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, vaddr, dma_handle); -+} -+ -+static inline dma_addr_t -+pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) -+{ -+ return dma_map_single(hwdev == NULL ? NULL : &hwdev->dev, ptr, size, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, -+ size_t size, int direction) -+{ -+ dma_unmap_single(hwdev == NULL ? NULL : &hwdev->dev, dma_addr, size, (enum dma_data_direction)direction); -+} -+ -+static inline dma_addr_t -+pci_map_page(struct pci_dev *hwdev, struct page *page, -+ unsigned long offset, size_t size, int direction) -+{ -+ return dma_map_page(hwdev == NULL ? NULL : &hwdev->dev, page, offset, size, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address, -+ size_t size, int direction) -+{ -+ dma_unmap_page(hwdev == NULL ? NULL : &hwdev->dev, dma_address, size, (enum dma_data_direction)direction); -+} -+ -+static inline int -+pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, -+ int nents, int direction) -+{ -+ return dma_map_sg(hwdev == NULL ? NULL : &hwdev->dev, sg, nents, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, -+ int nents, int direction) -+{ -+ dma_unmap_sg(hwdev == NULL ? NULL : &hwdev->dev, sg, nents, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t dma_handle, -+ size_t size, int direction) -+{ -+ dma_sync_single_for_cpu(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t dma_handle, -+ size_t size, int direction) -+{ -+ dma_sync_single_for_device(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sg, -+ int nelems, int direction) -+{ -+ dma_sync_sg_for_cpu(hwdev == NULL ? NULL : &hwdev->dev, sg, nelems, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sg, -+ int nelems, int direction) -+{ -+ dma_sync_sg_for_device(hwdev == NULL ? NULL : &hwdev->dev, sg, nelems, (enum dma_data_direction)direction); -+} -+ -+static inline int -+pci_dma_mapping_error(dma_addr_t dma_addr) -+{ -+ return dma_mapping_error(dma_addr); -+} -+ -+#endif ---- linux/include/asm-generic/pci.h -+++ linux/include/asm-generic/pci.h -@@ -0,0 +1,34 @@ -+/* -+ * linux/include/asm-generic/pci.h -+ * -+ * Copyright (C) 2003 Russell King -+ */ -+#ifndef _ASM_GENERIC_PCI_H -+#define _ASM_GENERIC_PCI_H -+ -+/** -+ * pcibios_resource_to_bus - convert resource to PCI bus address -+ * @dev: device which owns this resource -+ * @region: converted bus-centric region (start,end) -+ * @res: resource to convert -+ * -+ * Convert a resource to a PCI device bus address or bus window. -+ */ -+static inline void -+pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, -+ struct resource *res) -+{ -+ region->start = res->start; -+ region->end = res->end; -+} -+ -+#define pcibios_scan_all_fns(a, b) 0 -+ -+#ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ -+static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) -+{ -+ return channel ? 15 : 14; -+} -+#endif /* HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ */ -+ -+#endif ---- linux/include/asm-generic/percpu.h -+++ linux/include/asm-generic/percpu.h -@@ -0,0 +1,42 @@ -+#ifndef _ASM_GENERIC_PERCPU_H_ -+#define _ASM_GENERIC_PERCPU_H_ -+#include -+ -+#define __GENERIC_PER_CPU -+#ifdef CONFIG_SMP -+ -+extern unsigned long __per_cpu_offset[NR_CPUS]; -+ -+/* Separate out the type, so (int[3], foo) works. */ -+#define DEFINE_PER_CPU(type, name) \ -+ __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name -+ -+/* var is in discarded region: offset to particular copy we want */ -+#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) -+#define __get_cpu_var(var) per_cpu(var, smp_processor_id()) -+ -+/* A macro to avoid #include hell... */ -+#define percpu_modcopy(pcpudst, src, size) \ -+do { \ -+ unsigned int __i; \ -+ for (__i = 0; __i < NR_CPUS; __i++) \ -+ if (cpu_possible(__i)) \ -+ memcpy((pcpudst)+__per_cpu_offset[__i], \ -+ (src), (size)); \ -+} while (0) -+#else /* ! SMP */ -+ -+#define DEFINE_PER_CPU(type, name) \ -+ __typeof__(type) per_cpu__##name -+ -+#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) -+#define __get_cpu_var(var) per_cpu__##var -+ -+#endif /* SMP */ -+ -+#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name -+ -+#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) -+#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) -+ -+#endif /* _ASM_GENERIC_PERCPU_H_ */ ---- linux/include/asm-generic/pgtable.h -+++ linux/include/asm-generic/pgtable.h -@@ -0,0 +1,137 @@ -+#ifndef _ASM_GENERIC_PGTABLE_H -+#define _ASM_GENERIC_PGTABLE_H -+ -+#ifndef __HAVE_ARCH_PTEP_ESTABLISH -+/* -+ * Establish a new mapping: -+ * - flush the old one -+ * - update the page tables -+ * - inform the TLB about the new one -+ * -+ * We hold the mm semaphore for reading and vma->vm_mm->page_table_lock. -+ * -+ * Note: the old pte is known to not be writable, so we don't need to -+ * worry about dirty bits etc getting lost. -+ */ -+#ifndef __HAVE_ARCH_SET_PTE_ATOMIC -+#define ptep_establish(__vma, __address, __ptep, __entry) \ -+do { \ -+ set_pte(__ptep, __entry); \ -+ flush_tlb_page(__vma, __address); \ -+} while (0) -+#else /* __HAVE_ARCH_SET_PTE_ATOMIC */ -+#define ptep_establish(__vma, __address, __ptep, __entry) \ -+do { \ -+ set_pte_atomic(__ptep, __entry); \ -+ flush_tlb_page(__vma, __address); \ -+} while (0) -+#endif /* __HAVE_ARCH_SET_PTE_ATOMIC */ -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS -+/* -+ * Largely same as above, but only sets the access flags (dirty, -+ * accessed, and writable). Furthermore, we know it always gets set -+ * to a "more permissive" setting, which allows most architectures -+ * to optimize this. -+ */ -+#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ -+do { \ -+ set_pte(__ptep, __entry); \ -+ flush_tlb_page(__vma, __address); \ -+} while (0) -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG -+static inline int ptep_test_and_clear_young(pte_t *ptep) -+{ -+ pte_t pte = *ptep; -+ if (!pte_young(pte)) -+ return 0; -+ set_pte(ptep, pte_mkold(pte)); -+ return 1; -+} -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH -+#define ptep_clear_flush_young(__vma, __address, __ptep) \ -+({ \ -+ int __young = ptep_test_and_clear_young(__ptep); \ -+ if (__young) \ -+ flush_tlb_page(__vma, __address); \ -+ __young; \ -+}) -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY -+static inline int ptep_test_and_clear_dirty(pte_t *ptep) -+{ -+ pte_t pte = *ptep; -+ if (!pte_dirty(pte)) -+ return 0; -+ set_pte(ptep, pte_mkclean(pte)); -+ return 1; -+} -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH -+#define ptep_clear_flush_dirty(__vma, __address, __ptep) \ -+({ \ -+ int __dirty = ptep_test_and_clear_dirty(__ptep); \ -+ if (__dirty) \ -+ flush_tlb_page(__vma, __address); \ -+ __dirty; \ -+}) -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR -+static inline pte_t ptep_get_and_clear(pte_t *ptep) -+{ -+ pte_t pte = *ptep; -+ pte_clear(ptep); -+ return pte; -+} -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH -+#define ptep_clear_flush(__vma, __address, __ptep) \ -+({ \ -+ pte_t __pte = ptep_get_and_clear(__ptep); \ -+ flush_tlb_page(__vma, __address); \ -+ __pte; \ -+}) -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT -+static inline void ptep_set_wrprotect(pte_t *ptep) -+{ -+ pte_t old_pte = *ptep; -+ set_pte(ptep, pte_wrprotect(old_pte)); -+} -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_MKDIRTY -+static inline void ptep_mkdirty(pte_t *ptep) -+{ -+ pte_t old_pte = *ptep; -+ set_pte(ptep, pte_mkdirty(old_pte)); -+} -+#endif -+ -+#ifndef __HAVE_ARCH_PTE_SAME -+#define pte_same(A,B) (pte_val(A) == pte_val(B)) -+#endif -+ -+#ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY -+#define page_test_and_clear_dirty(page) (0) -+#endif -+ -+#ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG -+#define page_test_and_clear_young(page) (0) -+#endif -+ -+#ifndef __HAVE_ARCH_PGD_OFFSET_GATE -+#define pgd_offset_gate(mm, addr) pgd_offset(mm, addr) -+#endif -+ -+#endif /* _ASM_GENERIC_PGTABLE_H */ ---- linux/include/asm-generic/pgtable-nopmd.h -+++ linux/include/asm-generic/pgtable-nopmd.h -@@ -0,0 +1,60 @@ -+#ifndef _PGTABLE_NOPMD_H -+#define _PGTABLE_NOPMD_H -+ -+#ifndef __ASSEMBLY__ -+ -+#include -+ -+/* -+ * Having the pmd type consist of a pud gets the size right, and allows -+ * us to conceptually access the pud entry that this pmd is folded into -+ * without casting. -+ */ -+typedef struct { pud_t pud; } pmd_t; -+ -+#define PMD_SHIFT PUD_SHIFT -+#define PTRS_PER_PMD 1 -+#define PMD_SIZE (1UL << PMD_SHIFT) -+#define PMD_MASK (~(PMD_SIZE-1)) -+ -+/* -+ * The "pud_xxx()" functions here are trivial for a folded two-level -+ * setup: the pmd is never bad, and a pmd always exists (as it's folded -+ * into the pud entry) -+ */ -+static inline int pud_none(pud_t pud) { return 0; } -+static inline int pud_bad(pud_t pud) { return 0; } -+static inline int pud_present(pud_t pud) { return 1; } -+static inline void pud_clear(pud_t *pud) { } -+#define pmd_ERROR(pmd) (pud_ERROR((pmd).pud)) -+ -+#define pud_populate(mm, pmd, pte) do { } while (0) -+ -+/* -+ * (pmds are folded into puds so this doesn't get actually called, -+ * but the define is needed for a generic inline function.) -+ */ -+#define set_pud(pudptr, pudval) set_pmd((pmd_t *)(pudptr), (pmd_t) { pudval }) -+ -+static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address) -+{ -+ return (pmd_t *)pud; -+} -+ -+#define pmd_val(x) (pud_val((x).pud)) -+#define __pmd(x) ((pmd_t) { __pud(x) } ) -+ -+#define pud_page(pud) (pmd_page((pmd_t){ pud })) -+#define pud_page_kernel(pud) (pmd_page_kernel((pmd_t){ pud })) -+ -+/* -+ * allocating and freeing a pmd is trivial: the 1-entry pmd is -+ * inside the pud, so has no extra memory associated with it. -+ */ -+#define pmd_alloc_one(mm, address) NULL -+#define pmd_free(x) do { } while (0) -+#define __pmd_free_tlb(tlb, x) do { } while (0) -+ -+#endif /* __ASSEMBLY__ */ -+ -+#endif /* _PGTABLE_NOPMD_H */ ---- linux/include/asm-generic/pgtable-nopud.h -+++ linux/include/asm-generic/pgtable-nopud.h -@@ -0,0 +1,56 @@ -+#ifndef _PGTABLE_NOPUD_H -+#define _PGTABLE_NOPUD_H -+ -+#ifndef __ASSEMBLY__ -+ -+/* -+ * Having the pud type consist of a pgd gets the size right, and allows -+ * us to conceptually access the pgd entry that this pud is folded into -+ * without casting. -+ */ -+typedef struct { pgd_t pgd; } pud_t; -+ -+#define PUD_SHIFT PGDIR_SHIFT -+#define PTRS_PER_PUD 1 -+#define PUD_SIZE (1UL << PUD_SHIFT) -+#define PUD_MASK (~(PUD_SIZE-1)) -+ -+/* -+ * The "pgd_xxx()" functions here are trivial for a folded two-level -+ * setup: the pud is never bad, and a pud always exists (as it's folded -+ * into the pgd entry) -+ */ -+static inline int pgd_none(pgd_t pgd) { return 0; } -+static inline int pgd_bad(pgd_t pgd) { return 0; } -+static inline int pgd_present(pgd_t pgd) { return 1; } -+static inline void pgd_clear(pgd_t *pgd) { } -+#define pud_ERROR(pud) (pgd_ERROR((pud).pgd)) -+ -+#define pgd_populate(mm, pgd, pud) do { } while (0) -+/* -+ * (puds are folded into pgds so this doesn't get actually called, -+ * but the define is needed for a generic inline function.) -+ */ -+#define set_pgd(pgdptr, pgdval) set_pud((pud_t *)(pgdptr), (pud_t) { pgdval }) -+ -+static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address) -+{ -+ return (pud_t *)pgd; -+} -+ -+#define pud_val(x) (pgd_val((x).pgd)) -+#define __pud(x) ((pud_t) { __pgd(x) } ) -+ -+#define pgd_page(pgd) (pud_page((pud_t){ pgd })) -+#define pgd_page_kernel(pgd) (pud_page_kernel((pud_t){ pgd })) -+ -+/* -+ * allocating and freeing a pud is trivial: the 1-entry pud is -+ * inside the pgd, so has no extra memory associated with it. -+ */ -+#define pud_alloc_one(mm, address) NULL -+#define pud_free(x) do { } while (0) -+#define __pud_free_tlb(tlb, x) do { } while (0) -+ -+#endif /* __ASSEMBLY__ */ -+#endif /* _PGTABLE_NOPUD_H */ ---- linux/include/asm-generic/resource.h -+++ linux/include/asm-generic/resource.h -@@ -0,0 +1,60 @@ -+#ifndef _ASM_GENERIC_RESOURCE_H -+#define _ASM_GENERIC_RESOURCE_H -+ -+/* -+ * Resource limits -+ */ -+ -+/* Allow arch to control resource order */ -+#ifndef __ARCH_RLIMIT_ORDER -+#define RLIMIT_CPU 0 /* CPU time in ms */ -+#define RLIMIT_FSIZE 1 /* Maximum filesize */ -+#define RLIMIT_DATA 2 /* max data size */ -+#define RLIMIT_STACK 3 /* max stack size */ -+#define RLIMIT_CORE 4 /* max core file size */ -+#define RLIMIT_RSS 5 /* max resident set size */ -+#define RLIMIT_NPROC 6 /* max number of processes */ -+#define RLIMIT_NOFILE 7 /* max number of open files */ -+#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */ -+#define RLIMIT_AS 9 /* address space limit */ -+#define RLIMIT_LOCKS 10 /* maximum file locks held */ -+#define RLIMIT_SIGPENDING 11 /* max number of pending signals */ -+#define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */ -+ -+#define RLIM_NLIMITS 13 -+#endif -+ -+/* -+ * SuS says limits have to be unsigned. -+ * Which makes a ton more sense anyway. -+ */ -+#ifndef RLIM_INFINITY -+#define RLIM_INFINITY (~0UL) -+#endif -+ -+#ifndef _STK_LIM_MAX -+#define _STK_LIM_MAX RLIM_INFINITY -+#endif -+ -+#ifdef __KERNEL__ -+ -+#define INIT_RLIMITS \ -+{ \ -+ [RLIMIT_CPU] = { RLIM_INFINITY, RLIM_INFINITY }, \ -+ [RLIMIT_FSIZE] = { RLIM_INFINITY, RLIM_INFINITY }, \ -+ [RLIMIT_DATA] = { RLIM_INFINITY, RLIM_INFINITY }, \ -+ [RLIMIT_STACK] = { _STK_LIM, _STK_LIM_MAX }, \ -+ [RLIMIT_CORE] = { 0, RLIM_INFINITY }, \ -+ [RLIMIT_RSS] = { RLIM_INFINITY, RLIM_INFINITY }, \ -+ [RLIMIT_NPROC] = { 0, 0 }, \ -+ [RLIMIT_NOFILE] = { INR_OPEN, INR_OPEN }, \ -+ [RLIMIT_MEMLOCK] = { MLOCK_LIMIT, MLOCK_LIMIT }, \ -+ [RLIMIT_AS] = { RLIM_INFINITY, RLIM_INFINITY }, \ -+ [RLIMIT_LOCKS] = { RLIM_INFINITY, RLIM_INFINITY }, \ -+ [RLIMIT_SIGPENDING] = { MAX_SIGPENDING, MAX_SIGPENDING }, \ -+ [RLIMIT_MSGQUEUE] = { MQ_BYTES_MAX, MQ_BYTES_MAX }, \ -+} -+ -+#endif /* __KERNEL__ */ -+ -+#endif ---- linux/include/asm-generic/rmap.h -+++ linux/include/asm-generic/rmap.h -@@ -0,0 +1,90 @@ -+#ifndef _GENERIC_RMAP_H -+#define _GENERIC_RMAP_H -+/* -+ * linux/include/asm-generic/rmap.h -+ * -+ * Architecture dependent parts of the reverse mapping code, -+ * this version should work for most architectures with a -+ * 'normal' page table layout. -+ * -+ * We use the struct page of the page table page to find out -+ * the process and full address of a page table entry: -+ * - page->mapping points to the process' mm_struct -+ * - page->index has the high bits of the address -+ * - the lower bits of the address are calculated from the -+ * offset of the page table entry within the page table page -+ * -+ * For CONFIG_HIGHPTE, we need to represent the address of a pte in a -+ * scalar pte_addr_t. The pfn of the pte's page is shifted left by PAGE_SIZE -+ * bits and is then ORed with the byte offset of the pte within its page. -+ * -+ * For CONFIG_HIGHMEM4G, the pte_addr_t is 32 bits. 20 for the pfn, 12 for -+ * the offset. -+ * -+ * For CONFIG_HIGHMEM64G, the pte_addr_t is 64 bits. 52 for the pfn, 12 for -+ * the offset. -+ */ -+#include -+ -+static inline void pgtable_add_rmap(struct page * page, struct mm_struct * mm, unsigned long address) -+{ -+#ifdef BROKEN_PPC_PTE_ALLOC_ONE -+ /* OK, so PPC calls pte_alloc() before mem_map[] is setup ... ;( */ -+ extern int mem_init_done; -+ -+ if (!mem_init_done) -+ return; -+#endif -+ page->mapping = (void *)mm; -+ page->index = address & ~((PTRS_PER_PTE * PAGE_SIZE) - 1); -+ inc_page_state(nr_page_table_pages); -+} -+ -+static inline void pgtable_remove_rmap(struct page * page) -+{ -+ page->mapping = NULL; -+ page->index = 0; -+ dec_page_state(nr_page_table_pages); -+} -+ -+static inline struct mm_struct * ptep_to_mm(pte_t * ptep) -+{ -+ struct page * page = kmap_atomic_to_page(ptep); -+ return (struct mm_struct *) page->mapping; -+} -+ -+static inline unsigned long ptep_to_address(pte_t * ptep) -+{ -+ struct page * page = kmap_atomic_to_page(ptep); -+ unsigned long low_bits; -+ low_bits = ((unsigned long)ptep & ~PAGE_MASK) * PTRS_PER_PTE; -+ return page->index + low_bits; -+} -+ -+#ifdef CONFIG_HIGHPTE -+static inline pte_addr_t ptep_to_paddr(pte_t *ptep) -+{ -+ pte_addr_t paddr; -+ paddr = ((pte_addr_t)page_to_pfn(kmap_atomic_to_page(ptep))) << PAGE_SHIFT; -+ return paddr + (pte_addr_t)((unsigned long)ptep & ~PAGE_MASK); -+} -+#else -+static inline pte_addr_t ptep_to_paddr(pte_t *ptep) -+{ -+ return (pte_addr_t)ptep; -+} -+#endif -+ -+#ifndef CONFIG_HIGHPTE -+static inline pte_t *rmap_ptep_map(pte_addr_t pte_paddr) -+{ -+ return (pte_t *)pte_paddr; -+} -+ -+static inline void rmap_ptep_unmap(pte_t *pte) -+{ -+ return; -+} -+#endif -+ -+#endif /* _GENERIC_RMAP_H */ ---- linux/include/asm-generic/rtc.h -+++ linux/include/asm-generic/rtc.h -@@ -0,0 +1,213 @@ -+/* -+ * inclue/asm-generic/rtc.h -+ * -+ * Author: Tom Rini -+ * -+ * Based on: -+ * drivers/char/rtc.c -+ * -+ * Please read the COPYING file for all license details. -+ */ -+ -+#ifndef __ASM_RTC_H__ -+#define __ASM_RTC_H__ -+ -+#ifdef __KERNEL__ -+ -+#include -+#include -+#include -+ -+#define RTC_PIE 0x40 /* periodic interrupt enable */ -+#define RTC_AIE 0x20 /* alarm interrupt enable */ -+#define RTC_UIE 0x10 /* update-finished interrupt enable */ -+ -+/* some dummy definitions */ -+#define RTC_BATT_BAD 0x100 /* battery bad */ -+#define RTC_SQWE 0x08 /* enable square-wave output */ -+#define RTC_DM_BINARY 0x04 /* all time/date values are BCD if clear */ -+#define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ -+#define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ -+ -+/* -+ * Returns true if a clock update is in progress -+ */ -+static inline unsigned char rtc_is_updating(void) -+{ -+ unsigned char uip; -+ -+ spin_lock_irq(&rtc_lock); -+ uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP); -+ spin_unlock_irq(&rtc_lock); -+ return uip; -+} -+ -+static inline unsigned int get_rtc_time(struct rtc_time *time) -+{ -+ unsigned long uip_watchdog = jiffies; -+ unsigned char ctrl; -+#ifdef CONFIG_MACH_DECSTATION -+ unsigned int real_year; -+#endif -+ -+ /* -+ * read RTC once any update in progress is done. The update -+ * can take just over 2ms. We wait 10 to 20ms. There is no need to -+ * to poll-wait (up to 1s - eeccch) for the falling edge of RTC_UIP. -+ * If you need to know *exactly* when a second has started, enable -+ * periodic update complete interrupts, (via ioctl) and then -+ * immediately read /dev/rtc which will block until you get the IRQ. -+ * Once the read clears, read the RTC time (again via ioctl). Easy. -+ */ -+ -+ if (rtc_is_updating() != 0) -+ while (jiffies - uip_watchdog < 2*HZ/100) { -+ barrier(); -+ cpu_relax(); -+ } -+ -+ /* -+ * Only the values that we read from the RTC are set. We leave -+ * tm_wday, tm_yday and tm_isdst untouched. Even though the -+ * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated -+ * by the RTC when initially set to a non-zero value. -+ */ -+ spin_lock_irq(&rtc_lock); -+ time->tm_sec = CMOS_READ(RTC_SECONDS); -+ time->tm_min = CMOS_READ(RTC_MINUTES); -+ time->tm_hour = CMOS_READ(RTC_HOURS); -+ time->tm_mday = CMOS_READ(RTC_DAY_OF_MONTH); -+ time->tm_mon = CMOS_READ(RTC_MONTH); -+ time->tm_year = CMOS_READ(RTC_YEAR); -+#ifdef CONFIG_MACH_DECSTATION -+ real_year = CMOS_READ(RTC_DEC_YEAR); -+#endif -+ ctrl = CMOS_READ(RTC_CONTROL); -+ spin_unlock_irq(&rtc_lock); -+ -+ if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) -+ { -+ BCD_TO_BIN(time->tm_sec); -+ BCD_TO_BIN(time->tm_min); -+ BCD_TO_BIN(time->tm_hour); -+ BCD_TO_BIN(time->tm_mday); -+ BCD_TO_BIN(time->tm_mon); -+ BCD_TO_BIN(time->tm_year); -+ } -+ -+#ifdef CONFIG_MACH_DECSTATION -+ time->tm_year += real_year - 72; -+#endif -+ -+ /* -+ * Account for differences between how the RTC uses the values -+ * and how they are defined in a struct rtc_time; -+ */ -+ if (time->tm_year <= 69) -+ time->tm_year += 100; -+ -+ time->tm_mon--; -+ -+ return RTC_24H; -+} -+ -+/* Set the current date and time in the real time clock. */ -+static inline int set_rtc_time(struct rtc_time *time) -+{ -+ unsigned char mon, day, hrs, min, sec; -+ unsigned char save_control, save_freq_select; -+ unsigned int yrs; -+#ifdef CONFIG_MACH_DECSTATION -+ unsigned int real_yrs, leap_yr; -+#endif -+ -+ yrs = time->tm_year; -+ mon = time->tm_mon + 1; /* tm_mon starts at zero */ -+ day = time->tm_mday; -+ hrs = time->tm_hour; -+ min = time->tm_min; -+ sec = time->tm_sec; -+ -+ if (yrs > 255) /* They are unsigned */ -+ return -EINVAL; -+ -+ spin_lock_irq(&rtc_lock); -+#ifdef CONFIG_MACH_DECSTATION -+ real_yrs = yrs; -+ leap_yr = ((!((yrs + 1900) % 4) && ((yrs + 1900) % 100)) || -+ !((yrs + 1900) % 400)); -+ yrs = 72; -+ -+ /* -+ * We want to keep the year set to 73 until March -+ * for non-leap years, so that Feb, 29th is handled -+ * correctly. -+ */ -+ if (!leap_yr && mon < 3) { -+ real_yrs--; -+ yrs = 73; -+ } -+#endif -+ /* These limits and adjustments are independent of -+ * whether the chip is in binary mode or not. -+ */ -+ if (yrs > 169) { -+ spin_unlock_irq(&rtc_lock); -+ return -EINVAL; -+ } -+ -+ if (yrs >= 100) -+ yrs -= 100; -+ -+ if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) -+ || RTC_ALWAYS_BCD) { -+ BIN_TO_BCD(sec); -+ BIN_TO_BCD(min); -+ BIN_TO_BCD(hrs); -+ BIN_TO_BCD(day); -+ BIN_TO_BCD(mon); -+ BIN_TO_BCD(yrs); -+ } -+ -+ save_control = CMOS_READ(RTC_CONTROL); -+ CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL); -+ save_freq_select = CMOS_READ(RTC_FREQ_SELECT); -+ CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT); -+ -+#ifdef CONFIG_MACH_DECSTATION -+ CMOS_WRITE(real_yrs, RTC_DEC_YEAR); -+#endif -+ CMOS_WRITE(yrs, RTC_YEAR); -+ CMOS_WRITE(mon, RTC_MONTH); -+ CMOS_WRITE(day, RTC_DAY_OF_MONTH); -+ CMOS_WRITE(hrs, RTC_HOURS); -+ CMOS_WRITE(min, RTC_MINUTES); -+ CMOS_WRITE(sec, RTC_SECONDS); -+ -+ CMOS_WRITE(save_control, RTC_CONTROL); -+ CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); -+ -+ spin_unlock_irq(&rtc_lock); -+ -+ return 0; -+} -+ -+static inline unsigned int get_rtc_ss(void) -+{ -+ struct rtc_time h; -+ -+ get_rtc_time(&h); -+ return h.tm_sec; -+} -+ -+static inline int get_rtc_pll(struct rtc_pll_info *pll) -+{ -+ return -EINVAL; -+} -+static inline int set_rtc_pll(struct rtc_pll_info *pll) -+{ -+ return -EINVAL; -+} -+ -+#endif /* __KERNEL__ */ -+#endif /* __ASM_RTC_H__ */ ---- linux/include/asm-generic/sections.h -+++ linux/include/asm-generic/sections.h -@@ -0,0 +1,13 @@ -+#ifndef _ASM_GENERIC_SECTIONS_H_ -+#define _ASM_GENERIC_SECTIONS_H_ -+ -+/* References to section boundaries */ -+ -+extern char _text[], _stext[], _etext[]; -+extern char _data[], _sdata[], _edata[]; -+extern char __bss_start[], __bss_stop[]; -+extern char __init_begin[], __init_end[]; -+extern char _sinittext[], _einittext[]; -+extern char _end[]; -+ -+#endif /* _ASM_GENERIC_SECTIONS_H_ */ ---- linux/include/asm-generic/siginfo.h -+++ linux/include/asm-generic/siginfo.h -@@ -0,0 +1,288 @@ -+#ifndef _ASM_GENERIC_SIGINFO_H -+#define _ASM_GENERIC_SIGINFO_H -+ -+#include -+#include -+#include -+ -+typedef union sigval { -+ int sival_int; -+ void __user *sival_ptr; -+} sigval_t; -+ -+/* -+ * This is the size (including padding) of the part of the -+ * struct siginfo that is before the union. -+ */ -+#ifndef __ARCH_SI_PREAMBLE_SIZE -+#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int)) -+#endif -+ -+#define SI_MAX_SIZE 128 -+#ifndef SI_PAD_SIZE -+#define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int)) -+#endif -+ -+#ifndef __ARCH_SI_UID_T -+#define __ARCH_SI_UID_T uid_t -+#endif -+ -+/* -+ * The default "si_band" type is "long", as specified by POSIX. -+ * However, some architectures want to override this to "int" -+ * for historical compatibility reasons, so we allow that. -+ */ -+#ifndef __ARCH_SI_BAND_T -+#define __ARCH_SI_BAND_T long -+#endif -+ -+#ifndef HAVE_ARCH_SIGINFO_T -+ -+typedef struct siginfo { -+ int si_signo; -+ int si_errno; -+ int si_code; -+ -+ union { -+ int _pad[SI_PAD_SIZE]; -+ -+ /* kill() */ -+ struct { -+ pid_t _pid; /* sender's pid */ -+ __ARCH_SI_UID_T _uid; /* sender's uid */ -+ } _kill; -+ -+ /* POSIX.1b timers */ -+ struct { -+ timer_t _tid; /* timer id */ -+ int _overrun; /* overrun count */ -+ char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)]; -+ sigval_t _sigval; /* same as below */ -+ int _sys_private; /* not to be passed to user */ -+ } _timer; -+ -+ /* POSIX.1b signals */ -+ struct { -+ pid_t _pid; /* sender's pid */ -+ __ARCH_SI_UID_T _uid; /* sender's uid */ -+ sigval_t _sigval; -+ } _rt; -+ -+ /* SIGCHLD */ -+ struct { -+ pid_t _pid; /* which child */ -+ __ARCH_SI_UID_T _uid; /* sender's uid */ -+ int _status; /* exit code */ -+ clock_t _utime; -+ clock_t _stime; -+ } _sigchld; -+ -+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ -+ struct { -+ void __user *_addr; /* faulting insn/memory ref. */ -+#ifdef __ARCH_SI_TRAPNO -+ int _trapno; /* TRAP # which caused the signal */ -+#endif -+ } _sigfault; -+ -+ /* SIGPOLL */ -+ struct { -+ __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */ -+ int _fd; -+ } _sigpoll; -+ } _sifields; -+} siginfo_t; -+ -+#endif -+ -+/* -+ * How these fields are to be accessed. -+ */ -+#define si_pid _sifields._kill._pid -+#define si_uid _sifields._kill._uid -+#define si_tid _sifields._timer._tid -+#define si_overrun _sifields._timer._overrun -+#define si_sys_private _sifields._timer._sys_private -+#define si_status _sifields._sigchld._status -+#define si_utime _sifields._sigchld._utime -+#define si_stime _sifields._sigchld._stime -+#define si_value _sifields._rt._sigval -+#define si_int _sifields._rt._sigval.sival_int -+#define si_ptr _sifields._rt._sigval.sival_ptr -+#define si_addr _sifields._sigfault._addr -+#ifdef __ARCH_SI_TRAPNO -+#define si_trapno _sifields._sigfault._trapno -+#endif -+#define si_band _sifields._sigpoll._band -+#define si_fd _sifields._sigpoll._fd -+ -+#ifdef __KERNEL__ -+#define __SI_MASK 0xffff0000u -+#define __SI_KILL (0 << 16) -+#define __SI_TIMER (1 << 16) -+#define __SI_POLL (2 << 16) -+#define __SI_FAULT (3 << 16) -+#define __SI_CHLD (4 << 16) -+#define __SI_RT (5 << 16) -+#define __SI_MESGQ (6 << 16) -+#define __SI_CODE(T,N) ((T) | ((N) & 0xffff)) -+#else -+#define __SI_KILL 0 -+#define __SI_TIMER 0 -+#define __SI_POLL 0 -+#define __SI_FAULT 0 -+#define __SI_CHLD 0 -+#define __SI_RT 0 -+#define __SI_MESGQ 0 -+#define __SI_CODE(T,N) (N) -+#endif -+ -+/* -+ * si_code values -+ * Digital reserves positive values for kernel-generated signals. -+ */ -+#define SI_USER 0 /* sent by kill, sigsend, raise */ -+#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */ -+#define SI_QUEUE -1 /* sent by sigqueue */ -+#define SI_TIMER __SI_CODE(__SI_TIMER,-2) /* sent by timer expiration */ -+#define SI_MESGQ __SI_CODE(__SI_MESGQ,-3) /* sent by real time mesq state change */ -+#define SI_ASYNCIO -4 /* sent by AIO completion */ -+#define SI_SIGIO -5 /* sent by queued SIGIO */ -+#define SI_TKILL -6 /* sent by tkill system call */ -+#define SI_DETHREAD -7 /* sent by execve() killing subsidiary threads */ -+ -+#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0) -+#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0) -+ -+/* -+ * SIGILL si_codes -+ */ -+#define ILL_ILLOPC (__SI_FAULT|1) /* illegal opcode */ -+#define ILL_ILLOPN (__SI_FAULT|2) /* illegal operand */ -+#define ILL_ILLADR (__SI_FAULT|3) /* illegal addressing mode */ -+#define ILL_ILLTRP (__SI_FAULT|4) /* illegal trap */ -+#define ILL_PRVOPC (__SI_FAULT|5) /* privileged opcode */ -+#define ILL_PRVREG (__SI_FAULT|6) /* privileged register */ -+#define ILL_COPROC (__SI_FAULT|7) /* coprocessor error */ -+#define ILL_BADSTK (__SI_FAULT|8) /* internal stack error */ -+#define NSIGILL 8 -+ -+/* -+ * SIGFPE si_codes -+ */ -+#define FPE_INTDIV (__SI_FAULT|1) /* integer divide by zero */ -+#define FPE_INTOVF (__SI_FAULT|2) /* integer overflow */ -+#define FPE_FLTDIV (__SI_FAULT|3) /* floating point divide by zero */ -+#define FPE_FLTOVF (__SI_FAULT|4) /* floating point overflow */ -+#define FPE_FLTUND (__SI_FAULT|5) /* floating point underflow */ -+#define FPE_FLTRES (__SI_FAULT|6) /* floating point inexact result */ -+#define FPE_FLTINV (__SI_FAULT|7) /* floating point invalid operation */ -+#define FPE_FLTSUB (__SI_FAULT|8) /* subscript out of range */ -+#define NSIGFPE 8 -+ -+/* -+ * SIGSEGV si_codes -+ */ -+#define SEGV_MAPERR (__SI_FAULT|1) /* address not mapped to object */ -+#define SEGV_ACCERR (__SI_FAULT|2) /* invalid permissions for mapped object */ -+#define NSIGSEGV 2 -+ -+/* -+ * SIGBUS si_codes -+ */ -+#define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */ -+#define BUS_ADRERR (__SI_FAULT|2) /* non-existant physical address */ -+#define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */ -+#define NSIGBUS 3 -+ -+/* -+ * SIGTRAP si_codes -+ */ -+#define TRAP_BRKPT (__SI_FAULT|1) /* process breakpoint */ -+#define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */ -+#define NSIGTRAP 2 -+ -+/* -+ * SIGCHLD si_codes -+ */ -+#define CLD_EXITED (__SI_CHLD|1) /* child has exited */ -+#define CLD_KILLED (__SI_CHLD|2) /* child was killed */ -+#define CLD_DUMPED (__SI_CHLD|3) /* child terminated abnormally */ -+#define CLD_TRAPPED (__SI_CHLD|4) /* traced child has trapped */ -+#define CLD_STOPPED (__SI_CHLD|5) /* child has stopped */ -+#define CLD_CONTINUED (__SI_CHLD|6) /* stopped child has continued */ -+#define NSIGCHLD 6 -+ -+/* -+ * SIGPOLL si_codes -+ */ -+#define POLL_IN (__SI_POLL|1) /* data input available */ -+#define POLL_OUT (__SI_POLL|2) /* output buffers available */ -+#define POLL_MSG (__SI_POLL|3) /* input message available */ -+#define POLL_ERR (__SI_POLL|4) /* i/o error */ -+#define POLL_PRI (__SI_POLL|5) /* high priority input available */ -+#define POLL_HUP (__SI_POLL|6) /* device disconnected */ -+#define NSIGPOLL 6 -+ -+/* -+ * sigevent definitions -+ * -+ * It seems likely that SIGEV_THREAD will have to be handled from -+ * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the -+ * thread manager then catches and does the appropriate nonsense. -+ * However, everything is written out here so as to not get lost. -+ */ -+#define SIGEV_SIGNAL 0 /* notify via signal */ -+#define SIGEV_NONE 1 /* other notification: meaningless */ -+#define SIGEV_THREAD 2 /* deliver via thread creation */ -+#define SIGEV_THREAD_ID 4 /* deliver to thread */ -+ -+#define SIGEV_MAX_SIZE 64 -+#ifndef SIGEV_PAD_SIZE -+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3) -+#endif -+ -+typedef struct sigevent { -+ sigval_t sigev_value; -+ int sigev_signo; -+ int sigev_notify; -+ union { -+ int _pad[SIGEV_PAD_SIZE]; -+ int _tid; -+ -+ struct { -+ void (*_function)(sigval_t); -+ void *_attribute; /* really pthread_attr_t */ -+ } _sigev_thread; -+ } _sigev_un; -+} sigevent_t; -+ -+#define sigev_notify_function _sigev_un._sigev_thread._function -+#define sigev_notify_attributes _sigev_un._sigev_thread._attribute -+#define sigev_notify_thread_id _sigev_un._tid -+ -+#ifdef __KERNEL__ -+ -+struct siginfo; -+void do_schedule_next_timer(struct siginfo *info); -+ -+#ifndef HAVE_ARCH_COPY_SIGINFO -+ -+#include -+ -+static inline void copy_siginfo(struct siginfo *to, struct siginfo *from) -+{ -+ if (from->si_code < 0) -+ memcpy(to, from, sizeof(*to)); -+ else -+ /* _sigchld is currently the largest know union member */ -+ memcpy(to, from, __ARCH_SI_PREAMBLE_SIZE + sizeof(from->_sifields._sigchld)); -+} -+ -+#endif -+ -+extern int copy_siginfo_to_user(struct siginfo __user *to, struct siginfo *from); -+ -+#endif /* __KERNEL__ */ -+ -+#endif ---- linux/include/asm-generic/statfs.h -+++ linux/include/asm-generic/statfs.h -@@ -0,0 +1,51 @@ -+#ifndef _GENERIC_STATFS_H -+#define _GENERIC_STATFS_H -+ -+#ifndef __KERNEL_STRICT_NAMES -+# include -+typedef __kernel_fsid_t fsid_t; -+#endif -+ -+struct statfs { -+ __u32 f_type; -+ __u32 f_bsize; -+ __u32 f_blocks; -+ __u32 f_bfree; -+ __u32 f_bavail; -+ __u32 f_files; -+ __u32 f_ffree; -+ __kernel_fsid_t f_fsid; -+ __u32 f_namelen; -+ __u32 f_frsize; -+ __u32 f_spare[5]; -+}; -+ -+struct statfs64 { -+ __u32 f_type; -+ __u32 f_bsize; -+ __u64 f_blocks; -+ __u64 f_bfree; -+ __u64 f_bavail; -+ __u64 f_files; -+ __u64 f_ffree; -+ __kernel_fsid_t f_fsid; -+ __u32 f_namelen; -+ __u32 f_frsize; -+ __u32 f_spare[5]; -+}; -+ -+struct compat_statfs64 { -+ __u32 f_type; -+ __u32 f_bsize; -+ __u64 f_blocks; -+ __u64 f_bfree; -+ __u64 f_bavail; -+ __u64 f_files; -+ __u64 f_ffree; -+ __kernel_fsid_t f_fsid; -+ __u32 f_namelen; -+ __u32 f_frsize; -+ __u32 f_spare[5]; -+}; -+ -+#endif ---- linux/include/asm-generic/termios.h -+++ linux/include/asm-generic/termios.h -@@ -0,0 +1,69 @@ -+/* termios.h: generic termios/termio user copying/translation -+ */ -+ -+#ifndef _ASM_GENERIC_TERMIOS_H -+#define _ASM_GENERIC_TERMIOS_H -+ -+#include -+ -+#ifndef __ARCH_TERMIO_GETPUT -+ -+/* -+ * Translate a "termio" structure into a "termios". Ugh. -+ */ -+static inline int user_termio_to_kernel_termios(struct termios *termios, -+ struct termio __user *termio) -+{ -+ unsigned short tmp; -+ -+ if (get_user(tmp, &termio->c_iflag) < 0) -+ goto fault; -+ termios->c_iflag = (0xffff0000 & termios->c_iflag) | tmp; -+ -+ if (get_user(tmp, &termio->c_oflag) < 0) -+ goto fault; -+ termios->c_oflag = (0xffff0000 & termios->c_oflag) | tmp; -+ -+ if (get_user(tmp, &termio->c_cflag) < 0) -+ goto fault; -+ termios->c_cflag = (0xffff0000 & termios->c_cflag) | tmp; -+ -+ if (get_user(tmp, &termio->c_lflag) < 0) -+ goto fault; -+ termios->c_lflag = (0xffff0000 & termios->c_lflag) | tmp; -+ -+ if (get_user(termios->c_line, &termio->c_line) < 0) -+ goto fault; -+ -+ if (copy_from_user(termios->c_cc, termio->c_cc, NCC) != 0) -+ goto fault; -+ -+ return 0; -+ -+ fault: -+ return -EFAULT; -+} -+ -+/* -+ * Translate a "termios" structure into a "termio". Ugh. -+ */ -+static inline int kernel_termios_to_user_termio(struct termio __user *termio, -+ struct termios *termios) -+{ -+ if (put_user(termios->c_iflag, &termio->c_iflag) < 0 || -+ put_user(termios->c_oflag, &termio->c_oflag) < 0 || -+ put_user(termios->c_cflag, &termio->c_cflag) < 0 || -+ put_user(termios->c_lflag, &termio->c_lflag) < 0 || -+ put_user(termios->c_line, &termio->c_line) < 0 || -+ copy_to_user(termio->c_cc, termios->c_cc, NCC) != 0) -+ return -EFAULT; -+ -+ return 0; -+} -+ -+#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) -+#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) -+ -+#endif /* __ARCH_TERMIO_GETPUT */ -+ -+#endif /* _ASM_GENERIC_TERMIOS_H */ ---- linux/include/asm-generic/tlb.h -+++ linux/include/asm-generic/tlb.h -@@ -0,0 +1,160 @@ -+/* asm-generic/tlb.h -+ * -+ * Generic TLB shootdown code -+ * -+ * Copyright 2001 Red Hat, Inc. -+ * Based on code from mm/memory.c Copyright Linus Torvalds and others. -+ * -+ * 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. -+ */ -+#ifndef _ASM_GENERIC__TLB_H -+#define _ASM_GENERIC__TLB_H -+ -+// #include -+#include -+#include -+#include -+ -+/* -+ * For UP we don't need to worry about TLB flush -+ * and page free order so much.. -+ */ -+#ifdef CONFIG_SMP -+ #define FREE_PTE_NR 506 -+ #define tlb_fast_mode(tlb) ((tlb)->nr == ~0U) -+#else -+ #define FREE_PTE_NR 1 -+ #define tlb_fast_mode(tlb) 1 -+#endif -+ -+/* struct mmu_gather is an opaque type used by the mm code for passing around -+ * any data needed by arch specific code for tlb_remove_page. This structure -+ * can be per-CPU or per-MM as the page table lock is held for the duration of -+ * TLB shootdown. -+ */ -+struct mmu_gather { -+ struct mm_struct *mm; -+ unsigned int nr; /* set to ~0U means fast mode */ -+ unsigned int need_flush;/* Really unmapped some ptes? */ -+ unsigned int fullmm; /* non-zero means full mm flush */ -+ unsigned long freed; -+ struct page * pages[FREE_PTE_NR]; -+}; -+ -+/* Users of the generic TLB shootdown code must declare this storage space. */ -+DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); -+ -+/* tlb_gather_mmu -+ * Return a pointer to an initialized struct mmu_gather. -+ */ -+static inline struct mmu_gather * -+tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) -+{ -+ struct mmu_gather *tlb = &per_cpu(mmu_gathers, smp_processor_id()); -+ -+ tlb->mm = mm; -+ -+ /* Use fast mode if only one CPU is online */ -+ tlb->nr = num_online_cpus() > 1 ? 0U : ~0U; -+ -+ tlb->fullmm = full_mm_flush; -+ tlb->freed = 0; -+ -+ return tlb; -+} -+ -+static inline void -+tlb_flush_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) -+{ -+ if (!tlb->need_flush) -+ return; -+ tlb->need_flush = 0; -+ tlb_flush(tlb); -+ if (!tlb_fast_mode(tlb)) { -+ free_pages_and_swap_cache(tlb->pages, tlb->nr); -+ tlb->nr = 0; -+ } -+} -+ -+/* tlb_finish_mmu -+ * Called at the end of the shootdown operation to free up any resources -+ * that were required. The page table lock is still held at this point. -+ */ -+static inline void -+tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) -+{ -+ int freed = tlb->freed; -+ struct mm_struct *mm = tlb->mm; -+ int rss = mm->rss; -+ -+ if (rss < freed) -+ freed = rss; -+ mm->rss = rss - freed; -+ tlb_flush_mmu(tlb, start, end); -+ -+ /* keep the page table cache within bounds */ -+ check_pgt_cache(); -+} -+ -+static inline unsigned int -+tlb_is_full_mm(struct mmu_gather *tlb) -+{ -+ return tlb->fullmm; -+} -+ -+/* tlb_remove_page -+ * Must perform the equivalent to __free_pte(pte_get_and_clear(ptep)), while -+ * handling the additional races in SMP caused by other CPUs caching valid -+ * mappings in their TLBs. -+ */ -+static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) -+{ -+ tlb->need_flush = 1; -+ if (tlb_fast_mode(tlb)) { -+ free_page_and_swap_cache(page); -+ return; -+ } -+ tlb->pages[tlb->nr++] = page; -+ if (tlb->nr >= FREE_PTE_NR) -+ tlb_flush_mmu(tlb, 0, 0); -+} -+ -+/** -+ * tlb_remove_tlb_entry - remember a pte unmapping for later tlb invalidation. -+ * -+ * Record the fact that pte's were really umapped in ->need_flush, so we can -+ * later optimise away the tlb invalidate. This helps when userspace is -+ * unmapping already-unmapped pages, which happens quite a lot. -+ */ -+#define tlb_remove_tlb_entry(tlb, ptep, address) \ -+ do { \ -+ tlb->need_flush = 1; \ -+ __tlb_remove_tlb_entry(tlb, ptep, address); \ -+ } while (0) -+ -+#define pte_free_tlb(tlb, ptep) \ -+ do { \ -+ tlb->need_flush = 1; \ -+ __pte_free_tlb(tlb, ptep); \ -+ } while (0) -+ -+#ifndef __ARCH_HAS_4LEVEL_HACK -+#define pud_free_tlb(tlb, pudp) \ -+ do { \ -+ tlb->need_flush = 1; \ -+ __pud_free_tlb(tlb, pudp); \ -+ } while (0) -+#endif -+ -+#define pmd_free_tlb(tlb, pmdp) \ -+ do { \ -+ tlb->need_flush = 1; \ -+ __pmd_free_tlb(tlb, pmdp); \ -+ } while (0) -+ -+#define tlb_migrate_finish(mm) do {} while (0) -+ -+#endif /* _ASM_GENERIC__TLB_H */ ---- linux/include/asm-generic/topology.h -+++ linux/include/asm-generic/topology.h -@@ -0,0 +1,48 @@ -+/* -+ * linux/include/asm-generic/topology.h -+ * -+ * Written by: Matthew Dobson, IBM Corporation -+ * -+ * Copyright (C) 2002, IBM Corp. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ * Send feedback to -+ */ -+#ifndef _ASM_GENERIC_TOPOLOGY_H -+#define _ASM_GENERIC_TOPOLOGY_H -+ -+/* Other architectures wishing to use this simple topology API should fill -+ in the below functions as appropriate in their own file. */ -+#ifndef cpu_to_node -+#define cpu_to_node(cpu) (0) -+#endif -+#ifndef parent_node -+#define parent_node(node) (0) -+#endif -+#ifndef node_to_cpumask -+#define node_to_cpumask(node) (cpu_online_map) -+#endif -+#ifndef node_to_first_cpu -+#define node_to_first_cpu(node) (0) -+#endif -+#ifndef pcibus_to_cpumask -+#define pcibus_to_cpumask(bus) (cpu_online_map) -+#endif -+ -+#endif /* _ASM_GENERIC_TOPOLOGY_H */ ---- linux/include/asm-generic/uaccess.h -+++ linux/include/asm-generic/uaccess.h -@@ -0,0 +1,26 @@ -+#ifndef _ASM_GENERIC_UACCESS_H_ -+#define _ASM_GENERIC_UACCESS_H_ -+ -+/* -+ * This macro should be used instead of __get_user() when accessing -+ * values at locations that are not known to be aligned. -+ */ -+#define __get_user_unaligned(x, ptr) \ -+({ \ -+ __typeof__ (*(ptr)) __x; \ -+ __copy_from_user(&__x, (ptr), sizeof(*(ptr))) ? -EFAULT : 0; \ -+ (x) = __x; \ -+}) -+ -+ -+/* -+ * This macro should be used instead of __put_user() when accessing -+ * values at locations that are not known to be aligned. -+ */ -+#define __put_user_unaligned(x, ptr) \ -+({ \ -+ __typeof__ (*(ptr)) __x = (x); \ -+ __copy_to_user((ptr), &__x, sizeof(*(ptr))) ? -EFAULT : 0; \ -+}) -+ -+#endif /* _ASM_GENERIC_UACCESS_H */ ---- linux/include/asm-generic/unaligned.h -+++ linux/include/asm-generic/unaligned.h -@@ -0,0 +1,20 @@ -+#ifndef _ASM_GENERIC_UNALIGNED_H_ -+#define _ASM_GENERIC_UNALIGNED_H_ -+ -+/* -+ * For the benefit of those who are trying to port Linux to another -+ * architecture, here are some C-language equivalents. -+ */ -+ -+#include -+ -+ -+#define get_unaligned(ptr) \ -+ ({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) -+ -+#define put_unaligned(val, ptr) \ -+ ({ __typeof__(*(ptr)) __tmp = (val); \ -+ memcpy((ptr), &__tmp, sizeof(*(ptr))); \ -+ (void)0; }) -+ -+#endif /* _ASM_GENERIC_UNALIGNED_H */ ---- linux/include/asm-generic/vmlinux.lds.h -+++ linux/include/asm-generic/vmlinux.lds.h -@@ -0,0 +1,90 @@ -+#ifndef LOAD_OFFSET -+#define LOAD_OFFSET 0 -+#endif -+ -+#ifndef VMLINUX_SYMBOL -+#define VMLINUX_SYMBOL(_sym_) _sym_ -+#endif -+ -+#define RODATA \ -+ .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ -+ *(.rodata) *(.rodata.*) \ -+ *(__vermagic) /* Kernel version magic */ \ -+ } \ -+ \ -+ .rodata1 : AT(ADDR(.rodata1) - LOAD_OFFSET) { \ -+ *(.rodata1) \ -+ } \ -+ \ -+ /* PCI quirks */ \ -+ .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \ -+ VMLINUX_SYMBOL(__start_pci_fixups_early) = .; \ -+ *(.pci_fixup_early) \ -+ VMLINUX_SYMBOL(__end_pci_fixups_early) = .; \ -+ VMLINUX_SYMBOL(__start_pci_fixups_header) = .; \ -+ *(.pci_fixup_header) \ -+ VMLINUX_SYMBOL(__end_pci_fixups_header) = .; \ -+ VMLINUX_SYMBOL(__start_pci_fixups_final) = .; \ -+ *(.pci_fixup_final) \ -+ VMLINUX_SYMBOL(__end_pci_fixups_final) = .; \ -+ VMLINUX_SYMBOL(__start_pci_fixups_enable) = .; \ -+ *(.pci_fixup_enable) \ -+ VMLINUX_SYMBOL(__end_pci_fixups_enable) = .; \ -+ } \ -+ \ -+ /* Kernel symbol table: Normal symbols */ \ -+ __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ -+ VMLINUX_SYMBOL(__start___ksymtab) = .; \ -+ *(__ksymtab) \ -+ VMLINUX_SYMBOL(__stop___ksymtab) = .; \ -+ } \ -+ \ -+ /* Kernel symbol table: GPL-only symbols */ \ -+ __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \ -+ VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \ -+ *(__ksymtab_gpl) \ -+ VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ -+ } \ -+ \ -+ /* Kernel symbol table: Normal symbols */ \ -+ __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \ -+ VMLINUX_SYMBOL(__start___kcrctab) = .; \ -+ *(__kcrctab) \ -+ VMLINUX_SYMBOL(__stop___kcrctab) = .; \ -+ } \ -+ \ -+ /* Kernel symbol table: GPL-only symbols */ \ -+ __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \ -+ VMLINUX_SYMBOL(__start___kcrctab_gpl) = .; \ -+ *(__kcrctab_gpl) \ -+ VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \ -+ } \ -+ \ -+ /* Kernel symbol table: strings */ \ -+ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ -+ *(__ksymtab_strings) \ -+ } \ -+ \ -+ /* Built-in module parameters. */ \ -+ __param : AT(ADDR(__param) - LOAD_OFFSET) { \ -+ VMLINUX_SYMBOL(__start___param) = .; \ -+ *(__param) \ -+ VMLINUX_SYMBOL(__stop___param) = .; \ -+ } -+ -+#define SECURITY_INIT \ -+ .security_initcall.init : { \ -+ VMLINUX_SYMBOL(__security_initcall_start) = .; \ -+ *(.security_initcall.init) \ -+ VMLINUX_SYMBOL(__security_initcall_end) = .; \ -+ } -+ -+#define SCHED_TEXT \ -+ VMLINUX_SYMBOL(__sched_text_start) = .; \ -+ *(.sched.text) \ -+ VMLINUX_SYMBOL(__sched_text_end) = .; -+ -+#define LOCK_TEXT \ -+ VMLINUX_SYMBOL(__lock_text_start) = .; \ -+ *(.spinlock.text) \ -+ VMLINUX_SYMBOL(__lock_text_end) = .; ---- linux/include/asm-generic/xor.h -+++ linux/include/asm-generic/xor.h -@@ -0,0 +1,718 @@ -+/* -+ * include/asm-generic/xor.h -+ * -+ * Generic optimized RAID-5 checksumming functions. -+ * -+ * 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, or (at your option) -+ * any later version. -+ * -+ * You should have received a copy of the GNU General Public License -+ * (for example /usr/src/linux/COPYING); if not, write to the Free -+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ */ -+ -+#include -+ -+static void -+xor_8regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ p1[0] ^= p2[0]; -+ p1[1] ^= p2[1]; -+ p1[2] ^= p2[2]; -+ p1[3] ^= p2[3]; -+ p1[4] ^= p2[4]; -+ p1[5] ^= p2[5]; -+ p1[6] ^= p2[6]; -+ p1[7] ^= p2[7]; -+ p1 += 8; -+ p2 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_8regs_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ p1[0] ^= p2[0] ^ p3[0]; -+ p1[1] ^= p2[1] ^ p3[1]; -+ p1[2] ^= p2[2] ^ p3[2]; -+ p1[3] ^= p2[3] ^ p3[3]; -+ p1[4] ^= p2[4] ^ p3[4]; -+ p1[5] ^= p2[5] ^ p3[5]; -+ p1[6] ^= p2[6] ^ p3[6]; -+ p1[7] ^= p2[7] ^ p3[7]; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_8regs_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ p1[0] ^= p2[0] ^ p3[0] ^ p4[0]; -+ p1[1] ^= p2[1] ^ p3[1] ^ p4[1]; -+ p1[2] ^= p2[2] ^ p3[2] ^ p4[2]; -+ p1[3] ^= p2[3] ^ p3[3] ^ p4[3]; -+ p1[4] ^= p2[4] ^ p3[4] ^ p4[4]; -+ p1[5] ^= p2[5] ^ p3[5] ^ p4[5]; -+ p1[6] ^= p2[6] ^ p3[6] ^ p4[6]; -+ p1[7] ^= p2[7] ^ p3[7] ^ p4[7]; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_8regs_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4, unsigned long *p5) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ p1[0] ^= p2[0] ^ p3[0] ^ p4[0] ^ p5[0]; -+ p1[1] ^= p2[1] ^ p3[1] ^ p4[1] ^ p5[1]; -+ p1[2] ^= p2[2] ^ p3[2] ^ p4[2] ^ p5[2]; -+ p1[3] ^= p2[3] ^ p3[3] ^ p4[3] ^ p5[3]; -+ p1[4] ^= p2[4] ^ p3[4] ^ p4[4] ^ p5[4]; -+ p1[5] ^= p2[5] ^ p3[5] ^ p4[5] ^ p5[5]; -+ p1[6] ^= p2[6] ^ p3[6] ^ p4[6] ^ p5[6]; -+ p1[7] ^= p2[7] ^ p3[7] ^ p4[7] ^ p5[7]; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ p5 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_32regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_32regs_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ d0 ^= p3[0]; -+ d1 ^= p3[1]; -+ d2 ^= p3[2]; -+ d3 ^= p3[3]; -+ d4 ^= p3[4]; -+ d5 ^= p3[5]; -+ d6 ^= p3[6]; -+ d7 ^= p3[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_32regs_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ d0 ^= p3[0]; -+ d1 ^= p3[1]; -+ d2 ^= p3[2]; -+ d3 ^= p3[3]; -+ d4 ^= p3[4]; -+ d5 ^= p3[5]; -+ d6 ^= p3[6]; -+ d7 ^= p3[7]; -+ d0 ^= p4[0]; -+ d1 ^= p4[1]; -+ d2 ^= p4[2]; -+ d3 ^= p4[3]; -+ d4 ^= p4[4]; -+ d5 ^= p4[5]; -+ d6 ^= p4[6]; -+ d7 ^= p4[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_32regs_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4, unsigned long *p5) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ d0 ^= p3[0]; -+ d1 ^= p3[1]; -+ d2 ^= p3[2]; -+ d3 ^= p3[3]; -+ d4 ^= p3[4]; -+ d5 ^= p3[5]; -+ d6 ^= p3[6]; -+ d7 ^= p3[7]; -+ d0 ^= p4[0]; -+ d1 ^= p4[1]; -+ d2 ^= p4[2]; -+ d3 ^= p4[3]; -+ d4 ^= p4[4]; -+ d5 ^= p4[5]; -+ d6 ^= p4[6]; -+ d7 ^= p4[7]; -+ d0 ^= p5[0]; -+ d1 ^= p5[1]; -+ d2 ^= p5[2]; -+ d3 ^= p5[3]; -+ d4 ^= p5[4]; -+ d5 ^= p5[5]; -+ d6 ^= p5[6]; -+ d7 ^= p5[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ p5 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_8regs_p_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ prefetchw(p1); -+ prefetch(p2); -+ -+ do { -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ once_more: -+ p1[0] ^= p2[0]; -+ p1[1] ^= p2[1]; -+ p1[2] ^= p2[2]; -+ p1[3] ^= p2[3]; -+ p1[4] ^= p2[4]; -+ p1[5] ^= p2[5]; -+ p1[6] ^= p2[6]; -+ p1[7] ^= p2[7]; -+ p1 += 8; -+ p2 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_8regs_p_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ prefetchw(p1); -+ prefetch(p2); -+ prefetch(p3); -+ -+ do { -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ prefetch(p3+8); -+ once_more: -+ p1[0] ^= p2[0] ^ p3[0]; -+ p1[1] ^= p2[1] ^ p3[1]; -+ p1[2] ^= p2[2] ^ p3[2]; -+ p1[3] ^= p2[3] ^ p3[3]; -+ p1[4] ^= p2[4] ^ p3[4]; -+ p1[5] ^= p2[5] ^ p3[5]; -+ p1[6] ^= p2[6] ^ p3[6]; -+ p1[7] ^= p2[7] ^ p3[7]; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_8regs_p_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ -+ prefetchw(p1); -+ prefetch(p2); -+ prefetch(p3); -+ prefetch(p4); -+ -+ do { -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ prefetch(p3+8); -+ prefetch(p4+8); -+ once_more: -+ p1[0] ^= p2[0] ^ p3[0] ^ p4[0]; -+ p1[1] ^= p2[1] ^ p3[1] ^ p4[1]; -+ p1[2] ^= p2[2] ^ p3[2] ^ p4[2]; -+ p1[3] ^= p2[3] ^ p3[3] ^ p4[3]; -+ p1[4] ^= p2[4] ^ p3[4] ^ p4[4]; -+ p1[5] ^= p2[5] ^ p3[5] ^ p4[5]; -+ p1[6] ^= p2[6] ^ p3[6] ^ p4[6]; -+ p1[7] ^= p2[7] ^ p3[7] ^ p4[7]; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_8regs_p_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4, unsigned long *p5) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ -+ prefetchw(p1); -+ prefetch(p2); -+ prefetch(p3); -+ prefetch(p4); -+ prefetch(p5); -+ -+ do { -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ prefetch(p3+8); -+ prefetch(p4+8); -+ prefetch(p5+8); -+ once_more: -+ p1[0] ^= p2[0] ^ p3[0] ^ p4[0] ^ p5[0]; -+ p1[1] ^= p2[1] ^ p3[1] ^ p4[1] ^ p5[1]; -+ p1[2] ^= p2[2] ^ p3[2] ^ p4[2] ^ p5[2]; -+ p1[3] ^= p2[3] ^ p3[3] ^ p4[3] ^ p5[3]; -+ p1[4] ^= p2[4] ^ p3[4] ^ p4[4] ^ p5[4]; -+ p1[5] ^= p2[5] ^ p3[5] ^ p4[5] ^ p5[5]; -+ p1[6] ^= p2[6] ^ p3[6] ^ p4[6] ^ p5[6]; -+ p1[7] ^= p2[7] ^ p3[7] ^ p4[7] ^ p5[7]; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ p5 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_32regs_p_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ -+ prefetchw(p1); -+ prefetch(p2); -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ once_more: -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_32regs_p_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ -+ prefetchw(p1); -+ prefetch(p2); -+ prefetch(p3); -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ prefetch(p3+8); -+ once_more: -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ d0 ^= p3[0]; -+ d1 ^= p3[1]; -+ d2 ^= p3[2]; -+ d3 ^= p3[3]; -+ d4 ^= p3[4]; -+ d5 ^= p3[5]; -+ d6 ^= p3[6]; -+ d7 ^= p3[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_32regs_p_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ -+ prefetchw(p1); -+ prefetch(p2); -+ prefetch(p3); -+ prefetch(p4); -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ prefetch(p3+8); -+ prefetch(p4+8); -+ once_more: -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ d0 ^= p3[0]; -+ d1 ^= p3[1]; -+ d2 ^= p3[2]; -+ d3 ^= p3[3]; -+ d4 ^= p3[4]; -+ d5 ^= p3[5]; -+ d6 ^= p3[6]; -+ d7 ^= p3[7]; -+ d0 ^= p4[0]; -+ d1 ^= p4[1]; -+ d2 ^= p4[2]; -+ d3 ^= p4[3]; -+ d4 ^= p4[4]; -+ d5 ^= p4[5]; -+ d6 ^= p4[6]; -+ d7 ^= p4[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_32regs_p_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4, unsigned long *p5) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ -+ prefetchw(p1); -+ prefetch(p2); -+ prefetch(p3); -+ prefetch(p4); -+ prefetch(p5); -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ prefetch(p3+8); -+ prefetch(p4+8); -+ prefetch(p5+8); -+ once_more: -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ d0 ^= p3[0]; -+ d1 ^= p3[1]; -+ d2 ^= p3[2]; -+ d3 ^= p3[3]; -+ d4 ^= p3[4]; -+ d5 ^= p3[5]; -+ d6 ^= p3[6]; -+ d7 ^= p3[7]; -+ d0 ^= p4[0]; -+ d1 ^= p4[1]; -+ d2 ^= p4[2]; -+ d3 ^= p4[3]; -+ d4 ^= p4[4]; -+ d5 ^= p4[5]; -+ d6 ^= p4[6]; -+ d7 ^= p4[7]; -+ d0 ^= p5[0]; -+ d1 ^= p5[1]; -+ d2 ^= p5[2]; -+ d3 ^= p5[3]; -+ d4 ^= p5[4]; -+ d5 ^= p5[5]; -+ d6 ^= p5[6]; -+ d7 ^= p5[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ p5 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static struct xor_block_template xor_block_8regs = { -+ .name = "8regs", -+ .do_2 = xor_8regs_2, -+ .do_3 = xor_8regs_3, -+ .do_4 = xor_8regs_4, -+ .do_5 = xor_8regs_5, -+}; -+ -+static struct xor_block_template xor_block_32regs = { -+ .name = "32regs", -+ .do_2 = xor_32regs_2, -+ .do_3 = xor_32regs_3, -+ .do_4 = xor_32regs_4, -+ .do_5 = xor_32regs_5, -+}; -+ -+static struct xor_block_template xor_block_8regs_p = { -+ .name = "8regs_prefetch", -+ .do_2 = xor_8regs_p_2, -+ .do_3 = xor_8regs_p_3, -+ .do_4 = xor_8regs_p_4, -+ .do_5 = xor_8regs_p_5, -+}; -+ -+static struct xor_block_template xor_block_32regs_p = { -+ .name = "32regs_prefetch", -+ .do_2 = xor_32regs_p_2, -+ .do_3 = xor_32regs_p_3, -+ .do_4 = xor_32regs_p_4, -+ .do_5 = xor_32regs_p_5, -+}; -+ -+#define XOR_TRY_TEMPLATES \ -+ do { \ -+ xor_speed(&xor_block_8regs); \ -+ xor_speed(&xor_block_8regs_p); \ -+ xor_speed(&xor_block_32regs); \ -+ xor_speed(&xor_block_32regs_p); \ -+ } while (0) ---- linux/include/asm-nios2nommu/altera_juart.h -+++ linux/include/asm-nios2nommu/altera_juart.h -@@ -0,0 +1,36 @@ -+/*------------------------------------------------------------------------ -+ * -+ * linux/drivers/serial/altera_juart.h -+ * -+ * Driver for Altera JTAG UART core with Avalon interface -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * History: -+ * Jun/20/2005 DGT Microtronix Datacom NiosII -+ * -+ -----------------------------------------------------------------------*/ -+ -+#ifndef _ALTERA_JUART_H_ -+ #define _ALTERA_JUART_H_ -+ -+ /* jtag uart details needed outside of the driver itself: */ -+ /* by: arch/kernel/start.c - boot time error message(s) */ -+ -+ void jtaguart_console_write -+ ( struct console *co, -+ const char *s, -+ unsigned int count); -+ -+#endif /* _ALTERA_JUART_H_ */ ---- linux/include/asm-nios2nommu/a.out.h -+++ linux/include/asm-nios2nommu/a.out.h -@@ -0,0 +1,85 @@ -+/* $Id: a.out.h,v 1.4 2004/03/30 19:35:04 ken-h Exp $ */ -+/* -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef __NIOS2NOMMU_A_OUT_H__ -+#define __NIOS2NOMMU_A_OUT_H__ -+ -+#define SPARC_PGSIZE 0x1000 /* Thanks to the sun4 architecture... */ -+#define SEGMENT_SIZE SPARC_PGSIZE /* whee... */ -+ -+struct exec { -+ unsigned char a_dynamic:1; /* A __DYNAMIC is in this image */ -+ unsigned char a_toolversion:7; -+ unsigned char a_machtype; -+ unsigned short a_info; -+ unsigned long a_text; /* length of text, in bytes */ -+ unsigned long a_data; /* length of data, in bytes */ -+ unsigned long a_bss; /* length of bss, in bytes */ -+ unsigned long a_syms; /* length of symbol table, in bytes */ -+ unsigned long a_entry; /* where program begins */ -+ unsigned long a_trsize; -+ unsigned long a_drsize; -+}; -+ -+#define INIT_EXEC { \ -+ .a_dynamic = 0, \ -+ .a_toolversion = 0, \ -+ .a_machtype = 0, \ -+ .a_info = 0, \ -+ .a_text = 0, \ -+ .a_data = 0, \ -+ .a_bss = 0, \ -+ .a_syms = 0, \ -+ .a_entry = 0, \ -+ .a_trsize = 0, \ -+ .a_drsize = 0, \ -+} -+ -+/* Where in the file does the text information begin? */ -+#define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? 0 : sizeof (struct exec)) -+ -+/* Where do the Symbols start? */ -+#define N_SYMOFF(x) (N_TXTOFF(x) + (x).a_text + \ -+ (x).a_data + (x).a_trsize + \ -+ (x).a_drsize) -+ -+/* Where does text segment go in memory after being loaded? */ -+#define N_TXTADDR(x) (((N_MAGIC(x) == ZMAGIC) && \ -+ ((x).a_entry < SPARC_PGSIZE)) ? \ -+ 0 : SPARC_PGSIZE) -+ -+/* And same for the data segment.. */ -+#define N_DATADDR(x) (N_MAGIC(x)==OMAGIC ? \ -+ (N_TXTADDR(x) + (x).a_text) \ -+ : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x)))) -+ -+#define N_TRSIZE(a) ((a).a_trsize) -+#define N_DRSIZE(a) ((a).a_drsize) -+#define N_SYMSIZE(a) ((a).a_syms) -+ -+#ifdef __KERNEL__ -+ -+#define STACK_TOP TASK_SIZE -+ -+#endif -+ -+#endif /* __NIOS2NOMMU_A_OUT_H__ */ ---- linux/include/asm-nios2nommu/asm-macros.h -+++ linux/include/asm-nios2nommu/asm-macros.h -@@ -0,0 +1,331 @@ -+/* -+ * Macro used to simplify coding multi-line assembler. -+ * Some of the bit test macro can simplify down to one line -+ * depending on the mask value. -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+/* -+ * ANDs reg2 with mask and places the result in reg1. -+ * -+ * You cannnot use the same register for reg1 & reg2. -+ */ -+ -+.macro ANDI32 reg1,reg2,mask -+ .if \mask & 0xffff -+ .if \mask & 0xffff0000 -+ movhi \reg1,%hi(\mask) -+ movui \reg1,%lo(\mask) -+ and \reg1,\reg1,\reg2 -+ .else -+ andi \reg1,\reg2,%lo(\mask) -+ .endif -+ .else -+ andhi \reg1,\reg2,%hi(\mask) -+ .endif -+.endm -+ -+/* -+ * ORs reg2 with mask and places the result in reg1. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro ORI32 reg1,reg2,mask -+ .if \mask & 0xffff -+ .if \mask & 0xffff0000 -+ orhi \reg1,\reg2,%hi(\mask) -+ ori \reg1,\reg2,%lo(\mask) -+ .else -+ ori \reg1,\reg2,%lo(\mask) -+ .endif -+ .else -+ orhi \reg1,\reg2,%hi(\mask) -+ .endif -+.endm -+ -+/* -+ * XORs reg2 with mask and places the result in reg1. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro XORI32 reg1,reg2,mask -+ .if \mask & 0xffff -+ .if \mask & 0xffff0000 -+ xorhi \reg1,\reg2,%hi(\mask) -+ xori \reg1,\reg1,%lo(\mask) -+ .else -+ xori \reg1,\reg2,%lo(\mask) -+ .endif -+ .else -+ xorhi \reg1,\reg2,%hi(\mask) -+ .endif -+.endm -+ -+/* -+ * This is a support macro for BTBZ & BTBNZ. It checks -+ * the bit to make sure it is valid 32 value. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BT reg1,reg2,bit -+.if \bit > 31 -+ .err -+.else -+ .if \bit < 16 -+ andi \reg1,\reg2,(1 << \bit) -+ .else -+ andhi \reg1,\reg2,(1 << (\bit - 16)) -+ .endif -+.endif -+.endm -+ -+/* -+ * Tests the bit in reg2 and branches to label if the -+ * bit is zero. The result of the bit test is stored in reg1. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTBZ reg1,reg2,bit,label -+ BT \reg1,\reg2,\bit -+ beq \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and branches to label if the -+ * bit is non-zero. The result of the bit test is stored in reg1. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTBNZ reg1,reg2,bit,label -+ BT \reg1,\reg2,\bit -+ bne \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and then compliments the bit in reg2. -+ * The result of the bit test is stored in reg1. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTC reg1,reg2,bit -+.if \bit > 31 -+ .err -+.else -+ .if \bit < 16 -+ andi \reg1,\reg2,(1 << \bit) -+ xori \reg2,\reg2,(1 << \bit) -+ .else -+ andhi \reg1,\reg2,(1 << (\bit - 16)) -+ xorhi \reg2,\reg2,(1 << (\bit - 16)) -+ .endif -+.endif -+.endm -+ -+/* -+ * Tests the bit in reg2 and then sets the bit in reg2. -+ * The result of the bit test is stored in reg1. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTS reg1,reg2,bit -+.if \bit > 31 -+ .err -+.else -+ .if \bit < 16 -+ andi \reg1,\reg2,(1 << \bit) -+ ori \reg2,\reg2,(1 << \bit) -+ .else -+ andhi \reg1,\reg2,(1 << (\bit - 16)) -+ orhi \reg2,\reg2,(1 << (\bit - 16)) -+ .endif -+.endif -+.endm -+ -+/* -+ * Tests the bit in reg2 and then resets the bit in reg2. -+ * The result of the bit test is stored in reg1. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTR reg1,reg2,bit -+.if \bit > 31 -+ .err -+.else -+ .if \bit < 16 -+ andi \reg1,\reg2,(1 << \bit) -+ andi \reg2,\reg2,%lo(~(1 << \bit)) -+ .else -+ andhi \reg1,\reg2,(1 << (\bit - 16)) -+ andhi \reg2,\reg2,%lo(~(1 << (\bit - 16))) -+ .endif -+.endif -+.endm -+ -+/* -+ * Tests the bit in reg2 and then compliments the bit in reg2. -+ * The result of the bit test is stored in reg1. If the -+ * original bit was zero it branches to label. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTCBZ reg1,reg2,bit,label -+ BTC \reg1,\reg2,\bit -+ beq \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and then compliments the bit in reg2. -+ * The result of the bit test is stored in reg1. If the -+ * original bit was non-zero it branches to label. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTCBNZ reg1,reg2,bit,label -+ BTC \reg1,\reg2,\bit -+ bne \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and then sets the bit in reg2. -+ * The result of the bit test is stored in reg1. If the -+ * original bit was zero it branches to label. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTSBZ reg1,reg2,bit,label -+ BTS \reg1,\reg2,\bit -+ beq \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and then sets the bit in reg2. -+ * The result of the bit test is stored in reg1. If the -+ * original bit was non-zero it branches to label. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTSBNZ reg1,reg2,bit,label -+ BTS \reg1,\reg2,\bit -+ bne \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and then resets the bit in reg2. -+ * The result of the bit test is stored in reg1. If the -+ * original bit was zero it branches to label. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTRBZ reg1,reg2,bit,label -+ BTR \reg1,\reg2,\bit -+ bne \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and then resets the bit in reg2. -+ * The result of the bit test is stored in reg1. If the -+ * original bit was non-zero it branches to label. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTRBNZ reg1,reg2,bit,label -+ BTR \reg1,\reg2,\bit -+ bne \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bits in mask against reg2 stores the result in reg1. -+ * If the all the bits in the mask are zero it branches to label. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro TSTBZ reg1,reg2,mask,label -+ ANDI32 \reg1,\reg2,\mask -+ beq \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bits in mask against reg2 stores the result in reg1. -+ * If the any of the bits in the mask are 1 it branches to label. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro TSTBNZ reg1,reg2,mask,label -+ ANDI32 \reg1,\reg2,\mask -+ bne \reg1,r0,\label -+.endm -+ -+/* -+ * Pushes reg onto the stack. -+ */ -+ -+.macro PUSH reg -+ addi sp,sp,-4 -+ stw \reg,0(sp) -+.endm -+ -+/* -+ * Pops the top of the stack into reg. -+ */ -+ -+.macro POP reg -+ ldw \reg,0(sp) -+ addi sp,sp,4 -+.endm -+ -+/* -+ * Clears reg -+ */ -+ -+.macro CLR reg -+ mov \reg,r0 -+.endm -+ -+/* -+ * The preprocessor macro does not work for -+ * the nios2 compiler. Undefine ENTRY and define -+ * a real assembler macro. -+ */ -+#undef ENTRY -+#define ENTRY(name) ASM_ENTRY name -+ -+.macro ASM_ENTRY name -+.globl \name -+__ALIGN -+ \name: -+.endm ---- linux/include/asm-nios2nommu/atomic.h -+++ linux/include/asm-nios2nommu/atomic.h -@@ -0,0 +1,190 @@ -+//vic - add 'atomic_add/sub_return', 'atomic_add_negative' -+//vic from v850 architecture -+ -+/* atomic.h: -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * Copyright (C) 2001 Vic Phillips (vic@microtronix.com) -+ * -+ * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __ARCH_NIOS2NOMMU_ATOMIC__ -+#define __ARCH_NIOS2NOMMU_ATOMIC__ -+ -+#include -+ -+typedef struct { int counter; } atomic_t; -+#define ATOMIC_INIT(i) { (i) } -+ -+#define atomic_read(v) ((v)->counter) -+#define atomic_set(v, i) (((v)->counter) = i) -+ -+ -+extern __inline__ void atomic_add(int i, atomic_t *v) -+{ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter += i; -+ local_irq_restore(flags); -+} -+ -+extern __inline__ int atomic_add_negative(int i, atomic_t *v) -+{ -+ unsigned long flags; -+ int result; -+ -+ local_irq_save(flags); -+ v->counter += i; -+ result = (v->counter < 0); -+ local_irq_restore(flags); -+ return result; -+} -+ -+extern __inline__ void atomic_sub(int i, atomic_t *v) -+{ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter -= i; -+ local_irq_restore(flags); -+} -+ -+extern __inline__ int atomic_sub_and_test(int i, atomic_t *v) -+{ -+ int result; -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter -= i; -+ result = (v->counter == 0); -+ local_irq_restore(flags); -+ return result; -+} -+ -+extern __inline__ void atomic_inc(atomic_t *v) -+{ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter += 1; -+ local_irq_restore(flags); -+} -+ -+extern __inline__ int atomic_inc_and_test(atomic_t *v) -+{ -+ unsigned long flags; -+ int result; -+ -+ local_irq_save(flags); -+ v->counter += 1; -+ result = (v->counter == 0); -+ local_irq_restore(flags); -+ return result; -+} -+ -+extern __inline__ void atomic_dec(atomic_t *v) -+{ -+ int i = 1; /* the compiler optimizes better this way */ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter -= i; -+ local_irq_restore(flags); -+} -+ -+extern __inline__ int atomic_dec_and_test(atomic_t *v) -+{ -+ int result; -+ int i = 1; /* the compiler optimizes better this way */ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter -= i; -+ result = (v->counter == 0); -+ local_irq_restore(flags); -+ return result; -+} -+ -+extern __inline__ int atomic_inc_return(atomic_t *v) -+{ -+ int result; -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ result = ++v->counter; -+ local_irq_restore(flags); -+ return result; -+} -+ -+extern __inline__ int atomic_dec_return(atomic_t *v) -+{ -+ int result; -+ int i = 1; /* the compiler optimizes better this way */ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter -= i; -+ result = v->counter; -+ local_irq_restore(flags); -+ return result; -+} -+ -+extern __inline__ int atomic_add_return (int i, volatile atomic_t *v) -+{ -+ int res; -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ res = v->counter + i; -+ v->counter = res; -+ local_irq_restore(flags); -+ -+ return res; -+} -+ -+static __inline__ int atomic_sub_return (int i, volatile atomic_t *v) -+{ -+ int res; -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ res = v->counter - i; -+ v->counter = res; -+ local_irq_restore(flags); -+ -+ return res; -+} -+ -+#define atomic_dec_return(v) atomic_sub_return(1,(v)) -+#define atomic_inc_return(v) atomic_add_return(1,(v)) -+ -+/* Atomic operations are already serializing */ -+#define smp_mb__before_atomic_dec() barrier() -+#define smp_mb__after_atomic_dec() barrier() -+#define smp_mb__before_atomic_inc() barrier() -+#define smp_mb__after_atomic_inc() barrier() -+ -+ -+#endif /* !(__ARCH_NIOS2NOMMU_ATOMIC__) */ -+ -+ ---- linux/include/asm-nios2nommu/bitops.h -+++ linux/include/asm-nios2nommu/bitops.h -@@ -0,0 +1,472 @@ -+#ifndef _ASM_NIOS_BITOPS_H_ -+#define _ASM_NIOS_BITOPS_H_ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/bitops.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#ifdef __KERNEL__ -+// #include -+#include -+#include /* swab32 */ -+#include -+#endif -+ -+/* -+ * Adapted to NIOS from generic bitops.h: -+ * -+ * For the benefit of those who are trying to port Linux to another -+ * architecture, here are some C-language equivalents. You should -+ * recode these in the native assembly language, if at all possible. -+ * To guarantee atomicity, these routines call cli() and sti() to -+ * disable interrupts while they operate. (You have to provide inline -+ * routines to cli() and sti().) -+ * -+ * Also note, these routines assume that you have 32 bit integers. -+ * You will have to change this if you are trying to port Linux to the -+ * Alpha architecture or to a Cray. :-) -+ * -+ * C language equivalents written by Theodore Ts'o, 9/26/92 -+ */ -+ -+/* -+ * Generic ffs(). -+ */ -+static inline int ffs(int x) -+{ -+ int r = 1; -+ -+ if (!x) -+ return 0; -+ if (!(x & 0xffff)) { -+ x >>= 16; -+ r += 16; -+ } -+ if (!(x & 0xff)) { -+ x >>= 8; -+ r += 8; -+ } -+ if (!(x & 0xf)) { -+ x >>= 4; -+ r += 4; -+ } -+ if (!(x & 3)) { -+ x >>= 2; -+ r += 2; -+ } -+ if (!(x & 1)) { -+ x >>= 1; -+ r += 1; -+ } -+ return r; -+} -+ -+/* -+ * Generic __ffs(). -+ */ -+static inline int __ffs(int x) -+{ -+ int r = 0; -+ -+ if (!x) -+ return 0; -+ if (!(x & 0xffff)) { -+ x >>= 16; -+ r += 16; -+ } -+ if (!(x & 0xff)) { -+ x >>= 8; -+ r += 8; -+ } -+ if (!(x & 0xf)) { -+ x >>= 4; -+ r += 4; -+ } -+ if (!(x & 3)) { -+ x >>= 2; -+ r += 2; -+ } -+ if (!(x & 1)) { -+ x >>= 1; -+ r += 1; -+ } -+ return r; -+} -+ -+/* -+ * fls: find last bit set. -+ */ -+#define fls(x) generic_fls(x) -+ -+ -+/* -+ * Every architecture must define this function. It's the fastest -+ * way of searching a 140-bit bitmap where the first 100 bits are -+ * unlikely to be set. It's guaranteed that at least one of the 140 -+ * bits is cleared. -+ */ -+static inline int sched_find_first_bit(unsigned long *b) -+{ -+ if (unlikely(b[0])) -+ return __ffs(b[0]); -+ if (unlikely(b[1])) -+ return __ffs(b[1]) + 32; -+ if (unlikely(b[2])) -+ return __ffs(b[2]) + 64; -+ if (b[3]) -+ return __ffs(b[3]) + 96; -+ return __ffs(b[4]) + 128; -+} -+ -+/* -+ * ffz = Find First Zero in word. Undefined if no zero exists, -+ * so code should check against ~0UL first.. -+ */ -+static __inline__ unsigned long ffz(unsigned long word) -+{ -+ unsigned long result = 0; -+ -+ while(word & 1) { -+ result++; -+ word >>= 1; -+ } -+ return result; -+} -+ -+ -+static __inline__ void set_bit(int nr, volatile unsigned long * addr) -+{ -+ int * a = (int *) addr; -+ int mask; -+ unsigned long flags; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ local_irq_save(flags); -+ *a |= mask; -+ local_irq_restore(flags); -+} -+ -+static __inline__ void __set_bit(int nr, volatile unsigned long * addr) -+{ -+ int * a = (int *) addr; -+ int mask; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ *a |= mask; -+} -+ -+/* -+ * 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) -+{ -+ int * a = (int *) addr; -+ int mask; -+ unsigned long flags; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ local_irq_save(flags); -+ *a &= ~mask; -+ local_irq_restore(flags); -+} -+ -+static __inline__ void __clear_bit(int nr, volatile unsigned long * addr) -+{ -+ int * a = (int *) addr; -+ int mask; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ *a &= ~mask; -+} -+ -+static __inline__ void change_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, flags; -+ unsigned long *ADDR = (unsigned long *) addr; -+ -+ ADDR += nr >> 5; -+ mask = 1 << (nr & 31); -+ local_irq_save(flags); -+ *ADDR ^= mask; -+ local_irq_restore(flags); -+} -+ -+static __inline__ void __change_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask; -+ unsigned long *ADDR = (unsigned long *) addr; -+ -+ ADDR += nr >> 5; -+ mask = 1 << (nr & 31); -+ *ADDR ^= mask; -+} -+ -+static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, retval; -+ volatile unsigned int *a = (volatile unsigned int *) addr; -+ unsigned long flags; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ local_irq_save(flags); -+ retval = (mask & *a) != 0; -+ *a |= mask; -+ local_irq_restore(flags); -+ -+ return retval; -+} -+ -+static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, retval; -+ volatile unsigned int *a = (volatile unsigned int *) addr; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ retval = (mask & *a) != 0; -+ *a |= mask; -+ return retval; -+} -+ -+static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, retval; -+ volatile unsigned int *a = (volatile unsigned int *) addr; -+ unsigned long flags; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ local_irq_save(flags); -+ retval = (mask & *a) != 0; -+ *a &= ~mask; -+ local_irq_restore(flags); -+ -+ return retval; -+} -+ -+static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, retval; -+ volatile unsigned int *a = (volatile unsigned int *) addr; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ retval = (mask & *a) != 0; -+ *a &= ~mask; -+ return retval; -+} -+ -+static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, retval; -+ volatile unsigned int *a = (volatile unsigned int *) addr; -+ unsigned long flags; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ local_irq_save(flags); -+ retval = (mask & *a) != 0; -+ *a ^= mask; -+ local_irq_restore(flags); -+ -+ return retval; -+} -+ -+static __inline__ int __test_and_change_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, retval; -+ volatile unsigned int *a = (volatile unsigned int *) addr; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ retval = (mask & *a) != 0; -+ *a ^= mask; -+ return retval; -+} -+ -+/* -+ * This routine doesn't need to be atomic. -+ */ -+static __inline__ int __constant_test_bit(int nr, const volatile unsigned long * addr) -+{ -+ return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0; -+} -+ -+static __inline__ int __test_bit(int nr, const volatile unsigned long * addr) -+{ -+ int * a = (int *) addr; -+ int mask; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ return ((mask & *a) != 0); -+} -+ -+#define test_bit(nr,addr) \ -+(__builtin_constant_p(nr) ? \ -+ __constant_test_bit((nr),(unsigned long *)(addr)) : \ -+ __test_bit((nr),(unsigned long *)(addr))) -+ -+ -+/* find_next_zero_bit() finds the first zero bit in a bit string of length -+ * 'size' bits, starting the search at bit 'offset'. This is largely based -+ * on Linus's ALPHA routines, which are pretty portable BTW. -+ */ -+ -+extern __inline__ unsigned long find_next_zero_bit(void *addr, unsigned long size, unsigned long offset) -+{ -+ unsigned long *p = ((unsigned long *) addr) + (offset >> 5); -+ unsigned long result = offset & ~31UL; -+ unsigned long tmp; -+ -+ if (offset >= size) -+ return size; -+ size -= result; -+ offset &= 31UL; -+ if (offset) { -+ tmp = *(p++); -+ tmp |= ~0UL >> (32-offset); -+ if (size < 32) -+ goto found_first; -+ if (~tmp) -+ goto found_middle; -+ size -= 32; -+ result += 32; -+ } -+ while (size & ~31UL) { -+ if (~(tmp = *(p++))) -+ goto found_middle; -+ result += 32; -+ size -= 32; -+ } -+ if (!size) -+ return result; -+ tmp = *p; -+ -+found_first: -+ tmp |= ~0UL << size; -+ if (tmp == ~0UL) -+ return result + size; -+found_middle: -+ return result + ffz(tmp); -+} -+ -+/* -+ * Find next one bit in a bitmap reasonably efficiently. -+ */ -+extern __inline__ unsigned long find_next_bit(const unsigned long *addr, -+ unsigned long size, unsigned long offset) -+{ -+ unsigned int *p = ((unsigned int *) addr) + (offset >> 5); -+ unsigned int result = offset & ~31UL; -+ unsigned int tmp; -+ -+ if (offset >= size) -+ return size; -+ size -= result; -+ offset &= 31UL; -+ if (offset) { -+ tmp = *p++; -+ tmp &= ~0UL << offset; -+ if (size < 32) -+ goto found_first; -+ if (tmp) -+ goto found_middle; -+ size -= 32; -+ result += 32; -+ } -+ while (size >= 32) { -+ if ((tmp = *p++) != 0) -+ goto found_middle; -+ result += 32; -+ size -= 32; -+ } -+ if (!size) -+ return result; -+ tmp = *p; -+ -+found_first: -+ tmp &= ~0UL >> (32 - size); -+ if (tmp == 0UL) /* Are any bits set? */ -+ return result + size; /* Nope. */ -+found_middle: -+ return result + __ffs(tmp); -+} -+ -+/* -+ * hweightN: returns the hamming weight (i.e. the number -+ * of bits set) of a N-bit word -+ */ -+ -+#define hweight32(x) generic_hweight32(x) -+#define hweight16(x) generic_hweight16(x) -+#define hweight8(x) generic_hweight8(x) -+ -+/* Linus sez that gcc can optimize the following correctly, we'll see if this -+ * holds on the Sparc as it does for the ALPHA. -+ */ -+ -+#define find_first_zero_bit(addr, size) \ -+ find_next_zero_bit((addr), (size), 0) -+#define find_first_bit(addr, size) \ -+ find_next_bit((addr), (size), 0) -+ -+/* Now for the ext2 filesystem bit operations and helper routines. -+ * -+ * Both NIOS and ext2 are little endian, so these are the same as above. -+ */ -+ -+#define ext2_set_bit test_and_set_bit -+#define ext2_clear_bit test_and_clear_bit -+#define ext2_test_bit test_bit -+ -+#define ext2_set_bit_atomic(lock, nr, addr) \ -+ ({ \ -+ int ret; \ -+ spin_lock(lock); \ -+ ret = ext2_set_bit((nr),(unsigned long *) (addr)); \ -+ spin_unlock(lock); \ -+ ret; \ -+ }) -+ -+#define ext2_clear_bit_atomic(lock, nr, addr) \ -+ ({ \ -+ int ret; \ -+ spin_lock(lock); \ -+ ret = ext2_clear_bit((nr),(unsigned long *) (addr)); \ -+ spin_unlock(lock); \ -+ ret; \ -+ }) -+ -+#define ext2_find_first_zero_bit find_first_zero_bit -+#define ext2_find_next_zero_bit find_next_zero_bit -+ -+#endif /* _ASM_NIOS_BITOPS_H */ ---- linux/include/asm-nios2nommu/bootinfo.h -+++ linux/include/asm-nios2nommu/bootinfo.h -@@ -0,0 +1,2 @@ -+ -+/* Nothing for nios2nommu */ ---- linux/include/asm-nios2nommu/bug.h -+++ linux/include/asm-nios2nommu/bug.h -@@ -0,0 +1,48 @@ -+#ifndef _NIOS2NOMMU_BUG_H -+#define _NIOS2NOMMU_BUG_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/bug.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#define BUG() do { \ -+ printk("%s(%d): kernel BUG!\n", __FILE__, __LINE__); \ -+} while (0) -+ -+#define BUG_ON(condition) do { \ -+ if (unlikely((condition)!=0)) \ -+ BUG(); \ -+} while(0) -+ -+#define PAGE_BUG(page) do { \ -+ BUG(); \ -+} while (0) -+ -+#define WARN_ON(condition) do { \ -+ if (unlikely((condition)!=0)) { \ -+ printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \ -+ dump_stack(); \ -+ } \ -+} while (0) -+ -+#endif ---- linux/include/asm-nios2nommu/bugs.h -+++ linux/include/asm-nios2nommu/bugs.h -@@ -0,0 +1,40 @@ -+#ifndef __ASM_NIOS_BUGS_H -+#define __ASM_NIOS_BUGS_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/bugs.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 1994 Linus Torvalds -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* -+ * This is included by init/main.c to check for architecture-dependent bugs. -+ * -+ * Needs: -+ * void check_bugs(void); -+ */ -+ -+static void check_bugs(void) -+{ -+} -+ -+#endif ---- linux/include/asm-nios2nommu/byteorder.h -+++ linux/include/asm-nios2nommu/byteorder.h -@@ -0,0 +1,38 @@ -+#ifndef __ASM_NIOS_BYTEORDER_H -+#define __ASM_NIOS_BYTEORDER_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/byteorder.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) -+# define __BYTEORDER_HAS_U64__ -+# define __SWAB_64_THRU_32__ -+#endif -+ -+#include -+ -+#endif -+ ---- linux/include/asm-nios2nommu/cachectl.h -+++ linux/include/asm-nios2nommu/cachectl.h -@@ -0,0 +1,36 @@ -+/* -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2NOMMU_CACHECTL_H -+#define _NIOS2NOMMU_CACHECTL_H -+ -+/* Definitions for the cacheflush system call. */ -+ -+#define FLUSH_SCOPE_LINE 1 /* Flush a cache line */ -+#define FLUSH_SCOPE_PAGE 2 /* Flush a page */ -+#define FLUSH_SCOPE_ALL 3 /* Flush the whole cache -- superuser only */ -+ -+#define FLUSH_CACHE_DATA 1 /* Writeback and flush data cache */ -+#define FLUSH_CACHE_INSN 2 /* Flush instruction cache */ -+#define FLUSH_CACHE_BOTH 3 /* Flush both caches */ -+ -+#endif /* _NIOS2NOMMU_CACHECTL_H */ ---- linux/include/asm-nios2nommu/cacheflush.h -+++ linux/include/asm-nios2nommu/cacheflush.h -@@ -0,0 +1,59 @@ -+#ifndef _NIOS2NOMMU_CACHEFLUSH_H -+#define _NIOS2NOMMU_CACHEFLUSH_H -+ -+/* -+ * Ported from m68knommu. -+ * -+ * (C) Copyright 2003, Microtronix Datacom Ltd. -+ * (C) Copyright 2000-2002, Greg Ungerer -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#include -+ -+extern void cache_push (unsigned long vaddr, int len); -+extern void dcache_push (unsigned long vaddr, int len); -+extern void icache_push (unsigned long vaddr, int len); -+extern void cache_push_all (void); -+extern void cache_clear (unsigned long paddr, int len); -+ -+#define flush_cache_all() __flush_cache_all() -+#define flush_cache_mm(mm) do { } while (0) -+#define flush_cache_range(vma, start, end) cache_push(start, end - start) -+#define flush_cache_page(vma, vmaddr) do { } while (0) -+#define flush_dcache_range(start,end) dcache_push(start, end - start) -+#define flush_dcache_page(page) do { } while (0) -+#define flush_dcache_mmap_lock(mapping) do { } while (0) -+#define flush_dcache_mmap_unlock(mapping) do { } while (0) -+#define flush_icache_range(start,end) cache_push(start, end - start) -+#define flush_icache_page(vma,pg) do { } while (0) -+#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) -+ -+#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ -+ memcpy(dst, src, len) -+#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ -+ memcpy(dst, src, len) -+ -+ -+extern inline void __flush_cache_all(void) -+{ -+ cache_push_all(); -+} -+ -+#endif /* _NIOS2NOMMU_CACHEFLUSH_H */ ---- linux/include/asm-nios2nommu/cache.h -+++ linux/include/asm-nios2nommu/cache.h -@@ -0,0 +1,34 @@ -+/* -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef __ARCH_NIOS2NOMMU_CACHE_H -+#define __ARCH_NIOS2NOMMU_CACHE_H -+ -+#include -+ -+/* bytes per L1 cache line */ -+#define L1_CACHE_BYTES nasys_icache_line_size /* this need to be at least 1 */ -+ -+ -+#define __cacheline_aligned -+#define ____cacheline_aligned -+ -+#endif ---- linux/include/asm-nios2nommu/ChangeLog -+++ linux/include/asm-nios2nommu/ChangeLog -@@ -0,0 +1,14 @@ -+2004-06-29 Ken Hill -+ -+ * bitops.h (find_next_zero_bit): Fix problem with with masking for found_first -+ handling. The masking of the upper bits for size < 32 bits would set all -+ the bits to 1. Removing any zero's there may have been. -+ -+2004-06-02 Ken Hill -+ -+ * processor.h (TASK_SIZE): Change na_sdram_end to nasys_program_mem_end to remove -+ dependancy on quartus memory component name. -+ -+ * page.h (PAGE_OFFSET): Change na_sdram to nasys_program_mem to remove -+ dependancy on quartus memory component name. -+ ---- linux/include/asm-nios2nommu/checksum.h -+++ linux/include/asm-nios2nommu/checksum.h -@@ -0,0 +1,320 @@ -+#ifndef __NIOS2_CHECKSUM_H -+#define __NIOS2_CHECKSUM_H -+ -+/* checksum.h: IP/UDP/TCP checksum routines on the NIOS. -+ * -+ * Copyright(C) 1995 Linus Torvalds -+ * Copyright(C) 1995 Miguel de Icaza -+ * Copyright(C) 1996 David S. Miller -+ * Copyright(C) 2001 Ken Hill -+ * Copyright(C) 2004 Microtronix Datacom Ltd. -+ * -+ * derived from: -+ * Alpha checksum c-code -+ * ix86 inline assembly -+ * Spar nommu -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+/* -+ * computes the checksum of the TCP/UDP pseudo-header -+ * returns a 16-bit checksum, already complemented -+ */ -+ -+extern inline unsigned short csum_tcpudp_magic(unsigned long saddr, -+ unsigned long daddr, -+ unsigned short len, -+ unsigned short proto, -+ unsigned int sum) -+{ -+ barrier(); -+ __asm__ __volatile__( -+" add %0, %3, %0\n" -+" bgeu %0, %3, 1f\n" -+" addi %0, %0, 1\n" -+"1: add %0, %4, %0\n" -+" bgeu %0, %4, 1f\n" -+" addi %0, %0, 1\n" -+"1: add %0, %5, %0\n" -+" bgeu %0, %5, 1f\n" -+" addi %0, %0, 1\n" -+"1:\n" -+/* -+ We need the carry from the addition of 16-bit -+ significant addition, so we zap out the low bits -+ in one half, zap out the high bits in another, -+ shift them both up to the top 16-bits of a word -+ and do the carry producing addition, finally -+ shift the result back down to the low 16-bits. -+ -+ Actually, we can further optimize away two shifts -+ because we know the low bits of the original -+ value will be added to zero-only bits so cannot -+ affect the addition result nor the final carry -+ bit. -+*/ -+" slli %1,%0, 16\n" /* Need a copy to fold with */ -+ /* Bring the LOW 16 bits up */ -+" add %0, %1, %0\n" /* add and set carry, neat eh? */ -+" cmpltu r15, %0, %1\n" /* get remaining carry bit */ -+" srli %0, %0, 16\n" /* shift back down the result */ -+" add %0, %0, r15\n" -+" nor %0, %0, %0\n" /* negate */ -+ : "=&r" (sum), "=&r" (saddr) -+ : "0" (sum), "1" (saddr), "r" (ntohl(len+proto)), "r" (daddr) -+ : "r15"); -+ return ((unsigned short) sum); -+ barrier(); -+} -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+ -+ extern inline unsigned short from32to16(unsigned long x) -+ { -+ barrier(); -+ __asm__ __volatile__( -+ "add %0, %1, %0\n" -+ "cmpltu r15, %0, %1\n" -+ "srli %0, %0, 16\n" -+ "add %0, %0, r15\n" -+ : "=r" (x) -+ : "r" (x << 16), "0" (x) -+ : "r15"); -+ return x; -+ barrier(); -+ } -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+ -+extern inline unsigned long do_csum(const unsigned char * buff, int len) -+{ -+ int odd, count; -+ unsigned long result = 0; -+ -+ barrier(); -+ if (len <= 0) -+ goto out; -+ odd = 1 & (unsigned long) buff; -+ if (odd) { -+////result = *buff; // dgt: Big endian -+ result = *buff << 8; // dgt: Little endian -+ -+ len--; -+ buff++; -+ } -+ count = len >> 1; /* nr of 16-bit words.. */ -+ if (count) { -+ if (2 & (unsigned long) buff) { -+ result += *(unsigned short *) buff; -+ count--; -+ len -= 2; -+ buff += 2; -+ } -+ count >>= 1; /* nr of 32-bit words.. */ -+ if (count) { -+ unsigned long carry = 0; -+ do { -+ unsigned long w = *(unsigned long *) buff; -+ count--; -+ buff += 4; -+ result += carry; -+ result += w; -+ carry = (w > result); -+ } while (count); -+ result += carry; -+ result = (result & 0xffff) + (result >> 16); -+ } -+ if (len & 2) { -+ result += *(unsigned short *) buff; -+ buff += 2; -+ } -+ } -+ if (len & 1) -+ result += *buff; /* This is little machine, byte is right */ -+ result = from32to16(result); -+ if (odd) -+ result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); -+out: -+ return result; -+ barrier(); -+ } -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+ -+/* ihl is always 5 or greater, almost always is 5, iph is always word -+ * aligned but can fail to be dword aligned very often. -+ */ -+ -+ extern inline unsigned short ip_fast_csum(const unsigned char *iph, unsigned int ihl) -+ { -+ unsigned int sum; -+ -+ barrier(); -+ __asm__ __volatile__( -+" andi r8, %1, 2\n" /* Remember original alignment */ -+" ldw %0, (%1)\n" /* 16 or 32 bit boundary */ -+" beq r8, r0, 1f\n" /* Aligned on 32 bit boundary, go */ -+" srli %0, %0, 16\n" /* Get correct 16 bits */ -+" addi %2, %2, -1\n" /* Take off for 4 bytes, pickup last 2 at end */ -+" addi %1, %1, 2\n" /* Adjust pointer to 32 bit boundary */ -+" br 2f\n" -+"1:\n" -+" addi %2, %2, -1\n" -+" addi %1, %1, 4\n" /* Bump ptr a long word */ -+"2:\n" -+" ldw r9, (%1)\n" -+"1:\n" -+" add %0, r9, %0\n" -+" bgeu %0, r9, 2f\n" -+" addi %0, %0, 1\n" -+"2:\n" -+" addi %1, %1, 4\n" -+" addi %2, %2, -1\n" -+" ldw r9, (%1)\n" -+" bne %2, r0, 1b\n" -+" beq r8, r0, 1f\n" /* 32 bit boundary time to leave */ -+" srli r9, r9, 16\n" /* 16 bit boundary, get correct 16 bits */ -+" add %0, r9, %0\n" -+" bgeu %0, r9, 1f\n" -+" addi %0, %0, 1\n" -+"1:\n" -+" slli %2, %0, 16\n" -+" add %0, %2, %0\n" -+" cmpltu r8, %0, %2\n" -+" srli %0, %0, 16\n" -+" add %0, %0, r8\n" -+" nor %0, %0, %0\n" -+ : "=&r" (sum), "=&r" (iph), "=&r" (ihl) -+ : "1" (iph), "2" (ihl) -+ : "r8", "r9"); -+ return sum; -+ barrier(); -+ } -+ -+/*these 2 functions are now in checksum.c */ -+unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); -+unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum); -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+/* -+ * the same as csum_partial_copy, but copies from user space. -+ * -+ * here even more important to align src and dst on a 32-bit (or even -+ * better 64-bit) boundary -+ */ -+extern inline unsigned int -+csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *csum_err) -+{ -+ barrier(); -+ if (csum_err) *csum_err = 0; -+ memcpy(dst, src, len); -+ return csum_partial(dst, len, sum); -+ barrier(); -+} -+ -+#define csum_partial_copy_nocheck(src, dst, len, sum) \ -+ csum_partial_copy ((src), (dst), (len), (sum)) -+ -+ -+/* -+ * this routine is used for miscellaneous IP-like checksums, mainly -+ * in icmp.c -+ */ -+ -+extern inline unsigned short ip_compute_csum(unsigned char * buff, int len) -+{ -+ barrier(); -+ return ~from32to16(do_csum(buff,len)); -+ barrier(); -+} -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+ -+#define csum_partial_copy_fromuser(s, d, l, w) \ -+ csum_partial_copy((char *) (s), (d), (l), (w)) -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+ -+/* -+ * Fold a partial checksum without adding pseudo headers -+ */ -+extern __inline__ unsigned int csum_fold(unsigned int sum) -+{ -+ barrier(); -+ __asm__ __volatile__( -+ "add %0, %1, %0\n" -+ "cmpltu r8, %0, %1\n" -+ "srli %0, %0, 16\n" -+ "add %0, %0, r8\n" -+ "nor %0, %0, %0\n" -+ : "=r" (sum) -+ : "r" (sum << 16), "0" (sum) -+ : "r8"); -+ return sum; -+ barrier(); -+} -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+ -+extern __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr, -+ unsigned long daddr, -+ unsigned short len, -+ unsigned short proto, -+ unsigned int sum) -+{ -+ barrier(); -+ __asm__ __volatile__( -+ "add %0, %1, %0\n" -+ "cmpltu r8, %0, %1\n" -+ "add %0, %0, r8\n" /* add carry */ -+ "add %0, %2, %0\n" -+ "cmpltu r8, %0, %2\n" -+ "add %0, %0, r8\n" /* add carry */ -+ "add %0, %3, %0\n" -+ "cmpltu r8, %0, %3\n" -+ "add %0, %0, r8\n" /* add carry */ -+ : "=r" (sum), "=r" (saddr) -+ : "r" (daddr), "r" ( (ntohs(len)<<16) + (proto*256) ), -+ "0" (sum), -+ "1" (saddr) -+ : "r8"); -+ -+ return sum; -+ barrier(); -+} -+ -+ -+#endif /* (__NIOS2_CHECKSUM_H) */ ---- linux/include/asm-nios2nommu/cprefix.h -+++ linux/include/asm-nios2nommu/cprefix.h -@@ -0,0 +1,38 @@ -+/* cprefix.h: This file is included by assembly source which needs -+ * to know what the c-label prefixes are. The newer versions -+ * of cpp that come with gcc predefine such things to help -+ * us out. The reason this stuff is needed is to make -+ * solaris compiles of the kernel work. -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef __NIOS2_CPREFIX_H -+#define __NIOS2_CPREFIX_H -+ -+#define C_LABEL_PREFIX -+ -+#define CONCAT(a, b) CONCAT2(a, b) -+#define CONCAT2(a, b) a##b -+ -+#define C_LABEL(name) CONCAT(C_LABEL_PREFIX, name) -+ -+#endif /* !(__NIOS2_CPREFIX_H) */ ---- linux/include/asm-nios2nommu/cpumask.h -+++ linux/include/asm-nios2nommu/cpumask.h -@@ -0,0 +1,28 @@ -+/* -+ * All rights reserved. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _ASM_NIOS2NOMMU_CPUMASK_H -+#define _ASM_NIOS2NOMMU_CPUMASK_H -+ -+#include -+ -+#endif /* _ASM_NIOS2NOMMU_CPUMASK_H */ ---- linux/include/asm-nios2nommu/cputime.h -+++ linux/include/asm-nios2nommu/cputime.h -@@ -0,0 +1,31 @@ -+/* -+ * cputime.h -+ * (C) Copyright 2004, Microtronix Datacom Ltd. -+ * -+ * Taken from m68knommu -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2NOMMU_CPUTIME_H -+#define __NIOS2NOMMU_CPUTIME_H -+ -+#include -+ -+#endif /* __NIOS@NOMMU_CPUTIME_H */ ---- linux/include/asm-nios2nommu/current.h -+++ linux/include/asm-nios2nommu/current.h -@@ -0,0 +1,39 @@ -+#ifndef _NIOS2NOMMU_CURRENT_H -+#define _NIOS2NOMMU_CURRENT_H -+/* -+ * current.h -+ * (C) Copyright 2000, Lineo, David McCullough -+ * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com) -+ * (C) Copyright 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#include -+ -+struct task_struct; -+ -+static inline struct task_struct *get_current(void) -+{ -+ return(current_thread_info()->task); -+} -+ -+#define current get_current() -+ -+#endif /* _NIOS2NOMMU_CURRENT_H */ ---- linux/include/asm-nios2nommu/delay.h -+++ linux/include/asm-nios2nommu/delay.h -@@ -0,0 +1,96 @@ -+#ifndef _NIOS_DELAY_H -+#define _NIOS_DELAY_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/delay.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+extern __inline__ void __delay(unsigned long loops) -+{ -+ int dummy; -+ -+ __asm__ __volatile__( -+ "1: \n\t" -+ " beq %0,zero,2f\n\t" -+ " addi %0, %0, -1\n\t" -+ " br 1b\n\t" -+ "2: \n\t" -+ -+ : "=r" (dummy) /* Need output for optimizer */ -+ -+ : "0" (loops) /* %0 Input */ -+ ); -+} -+ -+/* -+ * Note that 19 * 226 == 4294 ==~ 2^32 / 10^6, so -+ * loops = (4294 * usecs * loops_per_jiffy * HZ) / 2^32. -+ * -+ * The mul instruction gives us loops = (a * b) / 2^32. -+ * We choose a = usecs * 19 * HZ and b = loops_per_jiffy * 226 -+ * because this lets us support a wide range of HZ and -+ * loops_per_jiffy values without either a or b overflowing 2^32. -+ * Thus we need usecs * HZ <= (2^32 - 1) / 19 = 226050910 and -+ * loops_per_jiffy <= (2^32 - 1) / 226 = 19004280 -+ * (which corresponds to ~3800 bogomips at HZ = 100). -+ * -- paulus -+ */ -+#define __MAX_UDELAY (226050910UL/HZ) /* maximum udelay argument */ -+#define __MAX_NDELAY (4294967295UL/HZ) /* maximum ndelay argument */ -+ -+extern unsigned long loops_per_jiffy; -+ -+extern __inline__ void __udelay(unsigned int x) -+{ -+ unsigned int loops; -+ -+ __asm__("mulxuu %0,%1,%2" : "=r" (loops) : -+ "r" (x), "r" (loops_per_jiffy * 226)); -+ __delay(loops); -+} -+ -+extern __inline__ void __ndelay(unsigned int x) -+{ -+ unsigned int loops; -+ -+ __asm__("mulxuu %0,%1,%2" : "=r" (loops) : -+ "r" (x), "r" (loops_per_jiffy * 5)); -+ __delay(loops); -+} -+ -+extern void __bad_udelay(void); /* deliberately undefined */ -+extern void __bad_ndelay(void); /* deliberately undefined */ -+ -+#define udelay(n) (__builtin_constant_p(n)? \ -+ ((n) > __MAX_UDELAY? __bad_udelay(): __udelay((n) * (19 * HZ))) : \ -+ __udelay((n) * (19 * HZ))) -+ -+#define ndelay(n) (__builtin_constant_p(n)? \ -+ ((n) > __MAX_NDELAY? __bad_ndelay(): __ndelay((n) * HZ)) : \ -+ __ndelay((n) * HZ)) -+ -+#define muldiv(a, b, c) (((a)*(b))/(c)) -+ -+#endif /* defined(_NIOS_DELAY_H) */ ---- linux/include/asm-nios2nommu/div64.h -+++ linux/include/asm-nios2nommu/div64.h -@@ -0,0 +1,31 @@ -+#ifndef __ASMNIOS_DIV64_H -+#define __ASMNIOS_DIV64_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/div64.h -+ * -+ * Derived from m68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#endif -+ ---- linux/include/asm-nios2nommu/dma.h -+++ linux/include/asm-nios2nommu/dma.h -@@ -0,0 +1,57 @@ -+/* $Id: dma.h,v 1.6 2005/04/07 21:00:26 wentao Exp $ -+ * -+ * Copyright 2004 (C) Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _ASM_NIOS2_DMA_H -+#define _ASM_NIOS2_DMA_H -+ -+#include -+#include -+ -+#define MAX_DMA_ADDRESS (LINUX_SDRAM_END) -+ -+int request_dma(unsigned int, const char *); -+void free_dma(unsigned int); -+void enable_dma(unsigned int dmanr); -+void disable_dma(unsigned int dmanr); -+void set_dma_count(unsigned int dmanr, unsigned int count); -+int get_dma_residue(unsigned int dmanr); -+void nios2_set_dma_data_width(unsigned int dmanr, unsigned int width); -+ -+void nios2_set_dma_handler(unsigned int dmanr, int (*handler)(void*, int), void* user); -+int nios2_request_dma(const char *); -+ -+void nios2_set_dma_mode(unsigned int dmanr, unsigned int mode); -+void nios2_set_dma_rcon(unsigned int dmanr, unsigned int set); -+void nios2_set_dma_wcon(unsigned int dmanr, unsigned int set); -+void nios2_set_dma_raddr(unsigned int dmanr, unsigned int a); -+void nios2_set_dma_waddr(unsigned int dmanr, unsigned int a); -+ -+static inline unsigned long claim_dma_lock(void) -+{ -+} -+ -+static inline void release_dma_lock(unsigned long flags) -+{ -+} -+ -+#endif /* !(_ASM_NIOS2_DMA_H) */ ---- linux/include/asm-nios2nommu/dma-mapping.h -+++ linux/include/asm-nios2nommu/dma-mapping.h -@@ -0,0 +1,133 @@ -+/* -+ * include/asm-nios2nommu/dma-mapping.h -+ * -+ * This file exists so that #include doesn't break anything. -+ */ -+ -+#ifndef _ASM_DMA_MAPPING_H -+#define _ASM_DMA_MAPPING_H -+ -+#include -+#include -+#include -+#include -+ -+static inline void *dma_alloc_coherent(struct device *dev, size_t size, -+ dma_addr_t *dma_handle, int flag) -+{ -+ BUG(); -+ return 0; -+} -+ -+static inline void dma_free_coherent(struct device *dev, size_t size, -+ void *vaddr, dma_addr_t dma_handle) -+{ -+ BUG(); -+} -+ -+/** -+ * dma_map_single - map a single buffer for streaming DMA -+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices -+ * @cpu_addr: CPU direct mapped address of buffer -+ * @size: size of buffer to map -+ * @dir: DMA transfer direction -+ * -+ * Ensure that any data held in the cache is appropriately discarded -+ * or written back. -+ * -+ * The device owns this memory once this call has completed. The CPU -+ * can regain ownership by calling dma_unmap_single() or -+ * dma_sync_single_for_cpu(). -+ */ -+static inline dma_addr_t -+dma_map_single(struct device *dev, void *cpu_addr, size_t size, -+ enum dma_data_direction dir) -+{ -+ cache_push ((unsigned long)cpu_addr, size); -+ return virt_to_bus((unsigned long)cpu_addr); -+} -+ -+/** -+ * dma_unmap_single - unmap a single buffer previously mapped -+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices -+ * @handle: DMA address of buffer -+ * @size: size of buffer to map -+ * @dir: DMA transfer direction -+ * -+ * Unmap a single streaming mode DMA translation. The handle and size -+ * must match what was provided in the previous dma_map_single() call. -+ * All other usages are undefined. -+ * -+ * After this call, reads by the CPU to the buffer are guaranteed to see -+ * whatever the device wrote there. -+ */ -+static inline void -+dma_unmap_single(struct device *dev, dma_addr_t handle, size_t size, -+ enum dma_data_direction dir) -+{ -+ cache_clear((unsigned long)bus_to_virt(handle), size); -+} -+ -+/** -+ * dma_map_sg - map a set of SG buffers for streaming mode DMA -+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices -+ * @sg: list of buffers -+ * @nents: number of buffers to map -+ * @dir: DMA transfer direction -+ * -+ * Map a set of buffers described by scatterlist in streaming -+ * mode for DMA. This is the scatter-gather version of the -+ * above dma_map_single interface. Here the scatter gather list -+ * elements are each tagged with the appropriate dma address -+ * and length. They are obtained via sg_dma_{address,length}(SG). -+ * -+ * NOTE: An implementation may be able to use a smaller number of -+ * DMA address/length pairs than there are SG table elements. -+ * (for example via virtual mapping capabilities) -+ * The routine returns the number of addr/length pairs actually -+ * used, at most nents. -+ * -+ * Device ownership issues as mentioned above for dma_map_single are -+ * the same here. -+ */ -+static inline int -+dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, -+ enum dma_data_direction dir) -+{ -+ int i; -+ -+ for (i = 0; i < nents; i++, sg++) { -+ char *virt; -+ -+ sg->dma_address = page_to_bus(sg->page) + sg->offset; -+ virt = page_address(sg->page) + sg->offset; -+ cache_push ((unsigned long)virt, sg->length); -+ } -+ -+ return nents; -+} -+ -+/** -+ * dma_unmap_sg - unmap a set of SG buffers mapped by dma_map_sg -+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices -+ * @sg: list of buffers -+ * @nents: number of buffers to map -+ * @dir: DMA transfer direction -+ * -+ * Unmap a set of streaming mode DMA translations. -+ * Again, CPU read rules concerning calls here are the same as for -+ * dma_unmap_single() above. -+ */ -+static inline void -+dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, -+ enum dma_data_direction dir) -+{ -+ int i; -+ -+ for (i = 0; i < nents; i++, sg++) { -+ char *virt; -+ virt = page_address(sg->page) + sg->offset; -+ cache_clear ((unsigned long)virt, sg->length); -+ } -+} -+#endif /* _ASM_DMA_MAPPING_H */ ---- linux/include/asm-nios2nommu/elf.h -+++ linux/include/asm-nios2nommu/elf.h -@@ -0,0 +1,141 @@ -+#ifndef __NIOS2_ELF_H -+#define __NIOS2_ELF_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/elf.h -+ * -+ * Nio2 ELF relocation types -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * Jan/20/2004 dgt NiosII -+ * Mar/18/2004 xwt NiosII relocation types added -+ * -+ ---------------------------------------------------------------------*/ -+ -+// #include -+#include -+#include -+ -+#define R_NIOS2_NONE 0 -+#define R_NIOS2_S16 1 -+#define R_NIOS2_U16 2 -+#define R_NIOS2_PCREL16 3 -+#define R_NIOS2_CALL26 4 -+#define R_NIOS2_IMM5 5 -+#define R_NIOS2_CACHE_OPX 6 -+#define R_NIOS2_IMM6 7 -+#define R_NIOS2_IMM8 8 -+#define R_NIOS2_HI16 9 -+#define R_NIOS2_LO16 10 -+#define R_NIOS2_HIADJ16 11 -+#define R_NIOS2_BFD_RELOC_32 12 -+#define R_NIOS2_BFD_RELOC_16 13 -+#define R_NIOS2_BFD_RELOC_8 14 -+#define R_NIOS2_GPREL 15 -+#define R_NIOS2_GNU_VTINHERIT 16 -+#define R_NIOS2_GNU_VTENTRY 17 -+#define R_NIOS2_UJMP 18 -+#define R_NIOS2_CJMP 19 -+#define R_NIOS2_CALLR 20 -+#define R_NIOS2_ALIGN 21 -+/* Keep this the last entry. */ -+#define R_NIOS2_NUM 22 -+ -+typedef unsigned long elf_greg_t; -+ -+#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) -+typedef elf_greg_t elf_gregset_t[ELF_NGREG]; -+ -+typedef unsigned long elf_fpregset_t; -+ -+/* -+ * This is used to ensure we don't load something for the wrong architecture. -+ */ -+#define elf_check_arch(x) \ -+ ((x)->e_machine == EM_ALTERA_NIOS2) -+ -+/* -+ * These are used to set parameters in the core dumps. -+ */ -+#define ELF_CLASS ELFCLASS32 -+#define ELF_DATA ELFDATA2LSB -+#define ELF_ARCH EM_ALTERA_NIOS2 -+ -+#define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0 -+ -+#define USE_ELF_CORE_DUMP -+#define ELF_EXEC_PAGESIZE 4096 -+ -+/* This is the location that an ET_DYN program is loaded if exec'ed. Typical -+ use of this is to invoke "./ld.so someprog" to test out a new version of -+ the loader. We need to make sure that it is out of the way of the program -+ that it will "exec", and that there is sufficient room for the brk. */ -+ -+#define ELF_ET_DYN_BASE 0xD0000000UL -+ -+/* regs is struct pt_regs, pr_reg is elf_gregset_t (which is -+ now struct_user_regs, they are different) */ -+ -+#define ELF_CORE_COPY_REGS(pr_reg, regs) \ -+ /* Bleech. */ \ -+ pr_reg[0] = regs->r1; \ -+ pr_reg[1] = regs->r2; \ -+ pr_reg[2] = regs->r3; \ -+ pr_reg[3] = regs->r4; \ -+ pr_reg[4] = regs->r5; \ -+ pr_reg[5] = regs->r6; \ -+ pr_reg[6] = regs->r7; \ -+ pr_reg[7] = regs->r8; \ -+ pr_reg[8] = regs->r9; \ -+ pr_reg[9] = regs->r10; \ -+ pr_reg[10] = regs->r11; \ -+ pr_reg[11] = regs->r12; \ -+ pr_reg[12] = regs->r13; \ -+ pr_reg[13] = regs->r14; \ -+ pr_reg[14] = regs->r15; \ -+ pr_reg[23] = regs->sp; \ -+ pr_reg[26] = regs->estatus; \ -+ { \ -+ struct switch_stack *sw = ((struct switch_stack *)regs) - 1; \ -+ pr_reg[15] = sw->r16; \ -+ pr_reg[16] = sw->r17; \ -+ pr_reg[17] = sw->r18; \ -+ pr_reg[18] = sw->r19; \ -+ pr_reg[19] = sw->r20; \ -+ pr_reg[20] = sw->r21; \ -+ pr_reg[21] = sw->r22; \ -+ pr_reg[22] = sw->r23; \ -+ pr_reg[24] = sw->fp; \ -+ pr_reg[25] = sw->gp; \ -+ } -+ -+/* This yields a mask that user programs can use to figure out what -+ instruction set this cpu supports. */ -+ -+#define ELF_HWCAP (0) -+ -+/* This yields a string that ld.so will use to load implementation -+ specific libraries for optimization. This is more specific in -+ intent than poking at uname or /proc/cpuinfo. */ -+ -+#define ELF_PLATFORM (NULL) -+ -+#ifdef __KERNEL__ -+#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) -+#endif -+ -+#endif ---- linux/include/asm-nios2nommu/entry.h -+++ linux/include/asm-nios2nommu/entry.h -@@ -0,0 +1,188 @@ -+/* -+ * Hacked from m68knommu port. -+ * -+ * Copyright(C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2NOMMU_ENTRY_H -+#define __NIOS2NOMMU_ENTRY_H -+ -+#ifdef __ASSEMBLY__ -+ -+// #include -+#include -+#include -+#include -+ -+/* -+ * Stack layout in 'ret_from_exception': -+ * -+ * This allows access to the syscall arguments in registers r4-r8 -+ * -+ * 0(sp) - r8 -+ * 4(sp) - r9 -+ * 8(sp) - r10 -+ * C(sp) - r11 -+ * 10(sp) - r12 -+ * 14(sp) - r13 -+ * 18(sp) - r14 -+ * 1C(sp) - r15 -+ * 20(sp) - r1 -+ * 24(sp) - r2 -+ * 28(sp) - r3 -+ * 2C(sp) - r4 -+ * 30(sp) - r5 -+ * 34(sp) - r6 -+ * 38(sp) - r7 -+ * 3C(sp) - orig_r2 -+ * 40(sp) - ra -+ * 44(sp) - fp -+ * 48(sp) - sp -+ * 4C(sp) - gp -+ * 50(sp) - estatus -+ * 54(sp) - status_extension -+ * 58(sp) - ea -+ * -+ */ -+ -+/* process bits for task_struct.flags */ -+PF_TRACESYS_OFF = 3 -+PF_TRACESYS_BIT = 5 -+PF_PTRACED_OFF = 3 -+PF_PTRACED_BIT = 4 -+PF_DTRACE_OFF = 1 -+PF_DTRACE_BIT = 5 -+ -+LENOSYS = 38 -+ -+/* -+ * This defines the normal kernel pt-regs layout. -+ * -+ */ -+ -+/* -+ * Standard Nios2 interrupt entry and exit macros. -+ * Must be called with interrupts disabled. -+ */ -+.macro SAVE_ALL -+ movia r24,status_extension // Read status extension -+ ldw r24,0(r24) -+ andi r24,r24,PS_S_ASM -+ bne r24,r0,1f // In supervisor mode, already on kernel stack -+ movia r24,_current_thread // Switch to current kernel stack -+ ldw r24,0(r24) // using the thread_info -+ addi r24,r24,THREAD_SIZE_ASM-PT_REGS_SIZE -+ stw sp,PT_SP(r24) // Save user stack before changing -+ mov sp,r24 -+ br 2f -+ -+1: mov r24,sp -+ addi sp,sp,-PT_REGS_SIZE // Backup the kernel stack pointer -+ stw r24,PT_SP(sp) -+2: stw r1,PT_R1(sp) -+ stw r2,PT_R2(sp) -+ stw r3,PT_R3(sp) -+ stw r4,PT_R4(sp) -+ stw r5,PT_R5(sp) -+ stw r6,PT_R6(sp) -+ stw r7,PT_R7(sp) -+ stw r8,PT_R8(sp) -+ stw r9,PT_R9(sp) -+ stw r10,PT_R10(sp) -+ stw r11,PT_R11(sp) -+ stw r12,PT_R12(sp) -+ stw r13,PT_R13(sp) -+ stw r14,PT_R14(sp) -+ stw r15,PT_R15(sp) -+ stw r2,PT_ORIG_R2(sp) -+ stw ra,PT_RA(sp) -+ stw fp,PT_FP(sp) -+ stw gp,PT_GP(sp) -+ rdctl r24,estatus -+ stw r24,PT_ESTATUS(sp) -+ movia r24,status_extension // Read status extension -+ ldw r1,0(r24) -+ stw r1,PT_STATUS_EXTENSION(sp) // Store user/supervisor status -+ ORI32 r1,r1,PS_S_ASM // Set supervisor mode -+ stw r1,0(r24) -+ stw ea,PT_EA(sp) -+.endm -+ -+.macro RESTORE_ALL -+ ldw r1,PT_STATUS_EXTENSION(sp) // Restore user/supervisor status -+ movia r24,status_extension -+ stw r1,0(r24) -+ ldw r1,PT_R1(sp) // Restore registers -+ ldw r2,PT_R2(sp) -+ ldw r3,PT_R3(sp) -+ ldw r4,PT_R4(sp) -+ ldw r5,PT_R5(sp) -+ ldw r6,PT_R6(sp) -+ ldw r7,PT_R7(sp) -+ ldw r8,PT_R8(sp) -+ ldw r9,PT_R9(sp) -+ ldw r10,PT_R10(sp) -+ ldw r11,PT_R11(sp) -+ ldw r12,PT_R12(sp) -+ ldw r13,PT_R13(sp) -+ ldw r14,PT_R14(sp) -+ ldw r15,PT_R15(sp) -+ ldw ra,PT_RA(sp) -+ ldw fp,PT_FP(sp) -+ ldw gp,PT_GP(sp) -+ ldw r24,PT_ESTATUS(sp) -+ wrctl estatus,r24 -+ ldw ea,PT_EA(sp) -+ ldw sp,PT_SP(sp) // Restore sp last -+.endm -+ -+.macro SAVE_SWITCH_STACK -+ addi sp,sp,-SWITCH_STACK_SIZE -+ stw r16,SW_R16(sp) -+ stw r17,SW_R17(sp) -+ stw r18,SW_R18(sp) -+ stw r19,SW_R19(sp) -+ stw r20,SW_R20(sp) -+ stw r21,SW_R21(sp) -+ stw r22,SW_R22(sp) -+ stw r23,SW_R23(sp) -+ stw fp,SW_FP(sp) -+ stw gp,SW_GP(sp) -+ stw ra,SW_RA(sp) -+.endm -+ -+.macro RESTORE_SWITCH_STACK -+ ldw r16,SW_R16(sp) -+ ldw r17,SW_R17(sp) -+ ldw r18,SW_R18(sp) -+ ldw r19,SW_R19(sp) -+ ldw r20,SW_R20(sp) -+ ldw r21,SW_R21(sp) -+ ldw r22,SW_R22(sp) -+ ldw r23,SW_R23(sp) -+ ldw fp,SW_FP(sp) -+ ldw gp,SW_GP(sp) -+ ldw ra,SW_RA(sp) -+ addi sp,sp,SWITCH_STACK_SIZE -+.endm -+ -+#endif /* __ASSEMBLY__ */ -+#endif /* __NIOS2NOMMU_ENTRY_H */ ---- linux/include/asm-nios2nommu/errno.h -+++ linux/include/asm-nios2nommu/errno.h -@@ -0,0 +1,6 @@ -+#ifndef _NIOS2NOMMU_ERRNO_H -+#define _NIOS2NOMMU_ERRNO_H -+ -+#include -+ -+#endif /* _NIOS2NOMMU_ERRNO_H */ ---- linux/include/asm-nios2nommu/fcntl.h -+++ linux/include/asm-nios2nommu/fcntl.h -@@ -0,0 +1,110 @@ -+/* -+ * This file came from the m68k port. -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef _NIOS2_FCNTL_H -+#define _NIOS2_FCNTL_H -+ -+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files -+ located on an ext2 file system */ -+#define O_ACCMODE 0003 -+#define O_RDONLY 00 -+#define O_WRONLY 01 -+#define O_RDWR 02 -+#define O_CREAT 0100 /* not fcntl */ -+#define O_EXCL 0200 /* not fcntl */ -+#define O_NOCTTY 0400 /* not fcntl */ -+#define O_TRUNC 01000 /* not fcntl */ -+#define O_APPEND 02000 -+#define O_NONBLOCK 04000 -+#define O_NDELAY O_NONBLOCK -+#define O_SYNC 010000 -+#define FASYNC 020000 /* fcntl, for BSD compatibility */ -+#define O_DIRECTORY 040000 /* must be a directory */ -+#define O_NOFOLLOW 0100000 /* don't follow links */ -+#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ -+#define O_LARGEFILE 0400000 -+#define O_NOATIME 01000000 -+ -+#define F_DUPFD 0 /* dup */ -+#define F_GETFD 1 /* get close_on_exec */ -+#define F_SETFD 2 /* set/clear close_on_exec */ -+#define F_GETFL 3 /* get file->f_flags */ -+#define F_SETFL 4 /* set file->f_flags */ -+#define F_GETLK 5 -+#define F_SETLK 6 -+#define F_SETLKW 7 -+ -+#define F_SETOWN 8 /* for sockets. */ -+#define F_GETOWN 9 /* for sockets. */ -+#define F_SETSIG 10 /* for sockets. */ -+#define F_GETSIG 11 /* for sockets. */ -+ -+#define F_GETLK64 12 /* using 'struct flock64' */ -+#define F_SETLK64 13 -+#define F_SETLKW64 14 -+ -+/* for F_[GET|SET]FL */ -+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ -+ -+/* for posix fcntl() and lockf() */ -+#define F_RDLCK 0 -+#define F_WRLCK 1 -+#define F_UNLCK 2 -+ -+/* for old implementation of bsd flock () */ -+#define F_EXLCK 4 /* or 3 */ -+#define F_SHLCK 8 /* or 4 */ -+ -+/* for leases */ -+#define F_INPROGRESS 16 -+ -+/* operations for bsd flock(), also used by the kernel implementation */ -+#define LOCK_SH 1 /* shared lock */ -+#define LOCK_EX 2 /* exclusive lock */ -+#define LOCK_NB 4 /* or'd with one of the above to prevent -+ blocking */ -+#define LOCK_UN 8 /* remove lock */ -+ -+#define LOCK_MAND 32 /* This is a mandatory flock */ -+#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ -+ -+struct flock { -+ short l_type; -+ short l_whence; -+ off_t l_start; -+ off_t l_len; -+ pid_t l_pid; -+}; -+ -+struct flock64 { -+ short l_type; -+ short l_whence; -+ loff_t l_start; -+ loff_t l_len; -+ pid_t l_pid; -+}; -+ -+#define F_LINUX_SPECIFIC_BASE 1024 -+#endif /* _NIOS2_FCNTL_H */ ---- linux/include/asm-nios2nommu/flat.h -+++ linux/include/asm-nios2nommu/flat.h -@@ -0,0 +1,126 @@ -+/* -+ * include/asm-nios2nommu/flat.h -- uClinux bFLT relocations -+ * -+ * Copyright (C) 2004,05 Microtronix Datacom Ltd -+ * -+ * This file is subject to the terms and conditions of the GNU General -+ * Public License. See the file COPYING in the main directory of this -+ * archive for more details. -+ * -+ * Written by Wentao Xu -+ */ -+ -+#ifndef __NIOS2_FLAT_H__ -+#define __NIOS2_FLAT_H__ -+ -+#define flat_reloc_valid(reloc, size) ((reloc) <= (size + 0x8000)) -+ -+/* The stack is 64-bit aligned for Nios II, so (sp - 1) shall -+ * be 64-bit aligned, where -1 is for argc -+ */ -+#define flat_stack_align(sp) (sp = (unsigned long *)(((unsigned long)sp - 1) & (-8))) -+ -+/* The uClibc port for Nios II expects the argc is followed by argv and envp */ -+#define flat_argvp_envp_on_stack() 1 -+ -+#define flat_old_ram_flag(flags) (flags) -+ -+/* We store the type of relocation in the top 4 bits of the `relval.' */ -+ -+/* Convert a relocation entry into an address. */ -+static inline unsigned long -+flat_get_relocate_addr (unsigned long relval) -+{ -+ return relval & 0x0fffffff; /* Mask out top 4-bits */ -+} -+ -+#define FLAT_NIOS2_RELOC_TYPE(relval) ((relval) >> 28) -+ -+#define FLAT_NIOS2_R_32 0 /* Normal 32-bit reloc */ -+#define FLAT_NIOS2_R_HI_LO 1 /* High 16-bits + low 16-bits field */ -+#define FLAT_NIOS2_R_HIADJ_LO 2 /* High 16-bits adjust + low 16-bits field */ -+#define FLAT_NIOS2_R_CALL26 4 /* Call imm26 */ -+ -+/* Extract the address to be relocated from the symbol reference at rp; -+ * relval is the raw relocation-table entry from which RP is derived. -+ * rp shall always be 32-bit aligned -+ */ -+static inline unsigned long flat_get_addr_from_rp (unsigned long *rp, -+ unsigned long relval, -+ unsigned long flags) -+{ -+ switch (FLAT_NIOS2_RELOC_TYPE(relval)) -+ { -+ case FLAT_NIOS2_R_32: -+ /* Simple 32-bit address. The loader expect it in bigger endian */ -+ return htonl(*rp); -+ -+ case FLAT_NIOS2_R_HI_LO: -+ /* get the two 16-bit immediate value from instructions, then -+ * construct a 32-bit value. Again the loader expect bigger endian -+ */ -+ return htonl ((((rp[0] >> 6) & 0xFFFF) << 16 ) | -+ ((rp[1] >> 6) & 0xFFFF)); -+ -+ case FLAT_NIOS2_R_HIADJ_LO: -+ { -+ /* get the two 16-bit immediate value from instructions, then -+ * construct a 32-bit value. Again the loader expect bigger endian -+ */ -+ unsigned int low, high; -+ high = (rp[0] >> 6) & 0xFFFF; -+ low = (rp[1] >> 6) & 0xFFFF; -+ -+ if ((low >> 15) & 1) high--; -+ -+ return htonl ((high << 16 ) | low ); -+ } -+ case FLAT_NIOS2_R_CALL26: -+ /* the 26-bit immediate value is actually 28-bit */ -+ return htonl(((*rp) >> 6) << 2); -+ -+ default: -+ return ~0; /* bogus value */ -+ } -+} -+ -+/* Insert the address addr into the symbol reference at rp; -+ * relval is the raw relocation-table entry from which rp is derived. -+ * rp shall always be 32-bit aligned -+ */ -+static inline void flat_put_addr_at_rp (unsigned long *rp, unsigned long addr, -+ unsigned long relval) -+{ -+ unsigned long exist_val; -+ switch (FLAT_NIOS2_RELOC_TYPE (relval)) { -+ case FLAT_NIOS2_R_32: -+ /* Simple 32-bit address. */ -+ *rp = addr; -+ break; -+ -+ case FLAT_NIOS2_R_HI_LO: -+ exist_val = rp[0]; -+ rp[0] = ((((exist_val >> 22) << 16) | (addr >> 16)) << 6) | (exist_val & 0x3F); -+ exist_val = rp[1]; -+ rp[1] = ((((exist_val >> 22) << 16) | (addr & 0xFFFF)) << 6) | (exist_val & 0x3F); -+ break; -+ -+ case FLAT_NIOS2_R_HIADJ_LO: -+ { -+ unsigned int high = (addr >> 16); -+ if ((addr >> 15) & 1) -+ high = (high + 1) & 0xFFFF; -+ exist_val = rp[0]; -+ rp[0] = ((((exist_val >> 22) << 16) | high) << 6) | (exist_val & 0x3F); -+ exist_val = rp[1]; -+ rp[1] = ((((exist_val >> 22) << 16) | (addr & 0xFFFF)) << 6) | (exist_val & 0x3F); -+ break; -+ } -+ case FLAT_NIOS2_R_CALL26: -+ /* the opcode of CALL is 0, so just store the value */ -+ *rp = ((addr >> 2) << 6); -+ break; -+ } -+} -+ -+#endif /* __NIOS2_FLAT_H__ */ ---- linux/include/asm-nios2nommu/hardirq.h -+++ linux/include/asm-nios2nommu/hardirq.h -@@ -0,0 +1,53 @@ -+/* -+ * Ported from m68knommu -+ * -+ * Copyright (C) 2003, Microtronix Datacom Ltd. -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef __NIOS2_HARDIRQ_H -+#define __NIOS2_HARDIRQ_H -+ -+// #include -+#include -+#include -+ -+typedef struct { -+ unsigned int __softirq_pending; -+} ____cacheline_aligned irq_cpustat_t; -+ -+#include /* Standard mappings for irq_cpustat_t above */ -+ -+#define HARDIRQ_BITS 8 -+ -+/* -+ * The hardirq mask has to be large enough to have -+ * space for potentially all IRQ sources in the system -+ * nesting on a single CPU: -+ */ -+#if (1 << HARDIRQ_BITS) < NR_IRQS -+# error HARDIRQ_BITS is too low! -+#endif -+ -+#ifdef CONFIG_SMP -+# error nios2nommu SMP is not available -+#endif /* CONFIG_SMP */ -+ -+#endif /* __NIOS2_HARDIRQ_H */ ---- linux/include/asm-nios2nommu/hdreg.h -+++ linux/include/asm-nios2nommu/hdreg.h -@@ -0,0 +1,30 @@ -+/* -+ * Copyright (C) 1994-1996 Linus Torvalds & authors -+ * Copyright (C) 2002 Wentau Xu (www.microtronix.com) -+ * copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2_HDREG_H -+#define __NIOS2_HDREG_H -+ -+typedef unsigned long ide_ioreg_t; -+ -+#endif /* __NIOS2_HDREG_H */ ---- linux/include/asm-nios2nommu/hw_irq.h -+++ linux/include/asm-nios2nommu/hw_irq.h -@@ -0,0 +1,16 @@ -+#ifndef _ASM_HW_IRQ_H -+#define _ASM_HW_IRQ_H -+ -+/* -+ * linux/include/asm/hw_irq.h -+ * -+ * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar -+ * -+ * moved some of the old arch/i386/kernel/irq.h to here. VY -+ * -+ * IRQ/IPI changes taken from work by Thomas Radke -+ * -+ */ -+ -+ -+#endif /* _ASM_HW_IRQ_H */ ---- linux/include/asm-nios2nommu/ide.h -+++ linux/include/asm-nios2nommu/ide.h -@@ -0,0 +1,47 @@ -+/* -+ * linux/include/asm-niosnommu2/ide.h -+ * -+ * Copyright (C) 1994-1996 Linus Torvalds & authors -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __ASMNIOS2_IDE_H -+#define __ASMNIOS2_IDE_H -+ -+#ifdef __KERNEL__ -+#undef MAX_HWIFS /* we're going to force it */ -+ -+#ifndef MAX_HWIFS -+#define MAX_HWIFS 1 -+#endif -+ -+#define IDE_ARCH_OBSOLETE_INIT -+#define IDE_ARCH_OBSOLETE_DEFAULTS -+#define ide_default_io_base(i) ((unsigned long)na_ide_ide) -+#define ide_default_irq(b) (na_ide_ide_irq) -+#define ide_init_default_irq(base) ide_default_irq(base) -+#define ide_default_io_ctl(base) ((base) + (0xE*4)) -+ -+#include -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* __ASMNIOS2_IDE_H */ ---- linux/include/asm-nios2nommu/init.h -+++ linux/include/asm-nios2nommu/init.h -@@ -0,0 +1,22 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#error " should never be used - use instead" ---- linux/include/asm-nios2nommu/ioctl.h -+++ linux/include/asm-nios2nommu/ioctl.h -@@ -0,0 +1,100 @@ -+/* $Id: ioctl.h,v 1.3 2004/02/12 23:06:40 ken-h Exp $ -+ * -+ * linux/ioctl.h for Linux by H.H. Bergman. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2_IOCTL_H -+#define _NIOS2_IOCTL_H -+ -+/* ioctl command encoding: 32 bits total, command in lower 16 bits, -+ * size of the parameter structure in the lower 14 bits of the -+ * upper 16 bits. -+ * Encoding the size of the parameter structure in the ioctl request -+ * is useful for catching programs compiled with old versions -+ * and to avoid overwriting user space outside the user buffer area. -+ * The highest 2 bits are reserved for indicating the ``access mode''. -+ * NOTE: This limits the max parameter size to 16kB -1 ! -+ */ -+ -+/* -+ * I don't really have any idea about what this should look like, so -+ * for the time being, this is heavily based on the PC definitions. -+ */ -+ -+/* -+ * The following is for compatibility across the various Linux -+ * platforms. The i386 ioctl numbering scheme doesn't really enforce -+ * a type field. De facto, however, the top 8 bits of the lower 16 -+ * bits are indeed used as a type field, so we might just as well make -+ * this explicit here. Please be sure to use the decoding macros -+ * below from now on. -+ */ -+#define _IOC_NRBITS 8 -+#define _IOC_TYPEBITS 8 -+#define _IOC_SIZEBITS 14 -+#define _IOC_DIRBITS 2 -+ -+#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) -+#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) -+#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) -+#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) -+ -+#define _IOC_NRSHIFT 0 -+#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) -+#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) -+#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) -+ -+/* -+ * Direction bits. -+ */ -+#define _IOC_NONE 0U -+#define _IOC_WRITE 1U -+#define _IOC_READ 2U -+ -+#define _IOC(dir,type,nr,size) \ -+ (((dir) << _IOC_DIRSHIFT) | \ -+ ((type) << _IOC_TYPESHIFT) | \ -+ ((nr) << _IOC_NRSHIFT) | \ -+ ((size) << _IOC_SIZESHIFT)) -+ -+/* used to create numbers */ -+#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) -+#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) -+#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) -+#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) -+ -+/* used to decode ioctl numbers.. */ -+#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) -+#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) -+#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) -+#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) -+ -+/* ...and for the drivers/sound files... */ -+ -+#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) -+#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) -+#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) -+#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) -+#define IOCSIZE_SHIFT (_IOC_SIZESHIFT) -+ -+#endif /* _NIOS2_IOCTL_H */ ---- linux/include/asm-nios2nommu/ioctls.h -+++ linux/include/asm-nios2nommu/ioctls.h -@@ -0,0 +1,103 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __ARCH_NIOS2_IOCTLS_H__ -+#define __ARCH_NIOS2_IOCTLS_H__ -+ -+#include -+ -+/* 0x54 is just a magic number to make these relatively unique ('T') */ -+ -+#define TCGETS 0x5401 -+#define TCSETS 0x5402 -+#define TCSETSW 0x5403 -+#define TCSETSF 0x5404 -+#define TCGETA 0x5405 -+#define TCSETA 0x5406 -+#define TCSETAW 0x5407 -+#define TCSETAF 0x5408 -+#define TCSBRK 0x5409 -+#define TCXONC 0x540A -+#define TCFLSH 0x540B -+#define TIOCEXCL 0x540C -+#define TIOCNXCL 0x540D -+#define TIOCSCTTY 0x540E -+#define TIOCGPGRP 0x540F -+#define TIOCSPGRP 0x5410 -+#define TIOCOUTQ 0x5411 -+#define TIOCSTI 0x5412 -+#define TIOCGWINSZ 0x5413 -+#define TIOCSWINSZ 0x5414 -+#define TIOCMGET 0x5415 -+#define TIOCMBIS 0x5416 -+#define TIOCMBIC 0x5417 -+#define TIOCMSET 0x5418 -+#define TIOCGSOFTCAR 0x5419 -+#define TIOCSSOFTCAR 0x541A -+#define FIONREAD 0x541B -+#define TIOCINQ FIONREAD -+#define TIOCLINUX 0x541C -+#define TIOCCONS 0x541D -+#define TIOCGSERIAL 0x541E -+#define TIOCSSERIAL 0x541F -+#define TIOCPKT 0x5420 -+#define FIONBIO 0x5421 -+#define TIOCNOTTY 0x5422 -+#define TIOCSETD 0x5423 -+#define TIOCGETD 0x5424 -+#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ -+#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */ -+#define TIOCSBRK 0x5427 /* BSD compatibility */ -+#define TIOCCBRK 0x5428 /* BSD compatibility */ -+#define TIOCGSID 0x5429 /* Return the session ID of FD */ -+#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ -+#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ -+ -+#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ -+#define FIOCLEX 0x5451 -+#define FIOASYNC 0x5452 -+#define TIOCSERCONFIG 0x5453 -+#define TIOCSERGWILD 0x5454 -+#define TIOCSERSWILD 0x5455 -+#define TIOCGLCKTRMIOS 0x5456 -+#define TIOCSLCKTRMIOS 0x5457 -+#define TIOCSERGSTRUCT 0x5458 /* For debugging only */ -+#define TIOCSERGETLSR 0x5459 /* Get line status register */ -+#define TIOCSERGETMULTI 0x545A /* Get multiport config */ -+#define TIOCSERSETMULTI 0x545B /* Set multiport config */ -+ -+#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ -+#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ -+#define FIOQSIZE 0x545E -+ -+/* Used for packet mode */ -+#define TIOCPKT_DATA 0 -+#define TIOCPKT_FLUSHREAD 1 -+#define TIOCPKT_FLUSHWRITE 2 -+#define TIOCPKT_STOP 4 -+#define TIOCPKT_START 8 -+#define TIOCPKT_NOSTOP 16 -+#define TIOCPKT_DOSTOP 32 -+ -+#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ -+ -+#endif /* __ARCH_NIOS2_IOCTLS_H__ */ ---- linux/include/asm-nios2nommu/io.h -+++ linux/include/asm-nios2nommu/io.h -@@ -0,0 +1,240 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2_IO_H -+#define __NIOS2_IO_H -+ -+#ifdef __KERNEL__ -+ -+#include -+ -+#include /* IO address mapping routines need this */ -+#include -+#include -+ -+extern void insw(unsigned long port, void *dst, unsigned long count); -+extern void outsw(unsigned long port, void *src, unsigned long count); -+extern void insl(unsigned long port, void *dst, unsigned long count); -+extern void outsl(unsigned long port, void *src, unsigned long count); -+ -+ -+/* -+ * readX/writeX() are used to access memory mapped devices. On some -+ * architectures the memory mapped IO stuff needs to be accessed -+ * differently. On the Nios architecture, we just read/write the -+ * memory location directly. -+ */ -+ -+#define readb(addr) \ -+({ \ -+ unsigned char __res;\ -+ __asm__ __volatile__( \ -+ "ldbuio %0, 0(%1)" \ -+ : "=r"(__res) \ -+ : "r" (addr)); \ -+ __res; \ -+}) -+ -+#define readw(addr) \ -+({ \ -+ unsigned short __res;\ -+ __asm__ __volatile__( \ -+ "ldhuio %0, 0(%1)" \ -+ : "=r"(__res) \ -+ : "r" (addr)); \ -+ __res; \ -+}) -+ -+#define readl(addr) \ -+({ \ -+ unsigned int __res;\ -+ __asm__ __volatile__( \ -+ "ldwio %0, 0(%1)" \ -+ : "=r"(__res) \ -+ : "r" (addr)); \ -+ __res; \ -+}) -+ -+#define writeb(b,addr) \ -+({ \ -+ __asm__ __volatile__( \ -+ "stbio %0, 0(%1)" \ -+ : : "r"(b), "r" (addr)); \ -+}) -+ -+#define writew(b,addr) \ -+({ \ -+ __asm__ __volatile__( \ -+ "sthio %0, 0(%1)" \ -+ : : "r"(b), "r" (addr)); \ -+}) -+ -+#define writel(b,addr) \ -+({ \ -+ __asm__ __volatile__( \ -+ "stwio %0, 0(%1)" \ -+ : : "r"(b), "r" (addr)); \ -+}) -+ -+#define __raw_readb readb -+#define __raw_readw readw -+#define __raw_readl readl -+#define __raw_writeb writeb -+#define __raw_writew writew -+#define __raw_writel writel -+ -+#define mmiowb() -+ -+/* -+ * make the short names macros so specific devices -+ * can override them as required -+ */ -+ -+#define memset_io(addr,c,len) memset((void *)(((unsigned int)(addr)) | 0x80000000),(c),(len)) -+#define memcpy_fromio(to,from,len) memcpy((to),(void *)(((unsigned int)(from)) | 0x80000000),(len)) -+#define memcpy_toio(to,from,len) memcpy((void *)(((unsigned int)(to)) | 0x80000000),(from),(len)) -+ -+#define inb(addr) readb(addr) -+#define inw(addr) readw(addr) -+#define inl(addr) readl(addr) -+ -+#define outb(x,addr) ((void) writeb(x,addr)) -+#define outw(x,addr) ((void) writew(x,addr)) -+#define outl(x,addr) ((void) writel(x,addr)) -+ -+#define inb_p(addr) inb(addr) -+#define inw_p(addr) inw(addr) -+#define inl_p(addr) inl(addr) -+ -+#define outb_p(x,addr) outb(x,addr) -+#define outw_p(x,addr) outw(x,addr) -+#define outl_p(x,addr) outl(x,addr) -+ -+ -+ -+extern inline void insb(unsigned long port, void *dst, unsigned long count) -+{ -+ unsigned char *p=(unsigned char*)dst; -+ while (count--) -+ *p++ = inb(port); -+} -+ -+/* See arch/niosnommu/io.c for optimized version */ -+extern inline void _insw(unsigned long port, void *dst, unsigned long count) -+{ -+ unsigned short *p=(unsigned short*)dst; -+ while (count--) -+ *p++ = inw(port); -+} -+ -+/* See arch/niosnommu/kernel/io.c for unaligned destination pointer */ -+extern inline void _insl(unsigned long port, void *dst, unsigned long count) -+{ -+ unsigned long *p=(unsigned long*)dst; -+ while (count--) -+ *p++ = inl(port); -+} -+ -+extern inline void outsb(unsigned long port, void *src, unsigned long count) -+{ -+ unsigned char *p=(unsigned char*)src; -+ while (count--) -+ outb( *p++, port ); -+} -+ -+/* See arch/niosnommu/io.c for optimized version */ -+extern inline void _outsw(unsigned long port, void *src, unsigned long count) -+{ -+ unsigned short *p=(unsigned short*)src; -+ while (count--) -+ outw( *p++, port ); -+} -+ -+/* See arch/niosnommu/kernel/io.c for unaligned source pointer */ -+extern inline void _outsl(unsigned long port, void *src, unsigned long count) -+{ -+ unsigned long *p=(unsigned long*)src; -+ while (count--) -+ outl( *p++, port ); -+} -+ -+ -+ -+extern inline void mapioaddr(unsigned long physaddr, unsigned long virt_addr, -+ int bus, int rdonly) -+{ -+ return; -+} -+ -+//vic - copied from m68knommu -+ -+/* Values for nocacheflag and cmode */ -+#define IOMAP_FULL_CACHING 0 -+#define IOMAP_NOCACHE_SER 1 -+#define IOMAP_NOCACHE_NONSER 2 -+#define IOMAP_WRITETHROUGH 3 -+ -+extern void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag); -+extern void __iounmap(void *addr, unsigned long size); -+ -+extern inline void *ioremap(unsigned long physaddr, unsigned long size) -+{ -+ return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); -+} -+extern inline void *ioremap_nocache(unsigned long physaddr, unsigned long size) -+{ -+ return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); -+} -+extern inline void *ioremap_writethrough(unsigned long physaddr, unsigned long size) -+{ -+ return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); -+} -+extern inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size) -+{ -+ return __ioremap(physaddr, size, IOMAP_FULL_CACHING); -+} -+ -+extern void iounmap(void *addr); -+ -+ -+#define IO_SPACE_LIMIT 0xffffffff -+ -+#define dma_cache_inv(_start,_size) do { } while (0) -+#define dma_cache_wback(_start,_size) do { } while (0) -+#define dma_cache_wback_inv(_start,_size) do { } while (0) -+ -+/* Pages to physical address... */ -+#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) -+#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT) -+ -+#define mm_ptov(vaddr) ((void *) (vaddr)) -+#define mm_vtop(vaddr) ((unsigned long) (vaddr)) -+#define phys_to_virt(vaddr) ((void *) (vaddr)) -+#define virt_to_phys(vaddr) ((unsigned long) (vaddr)) -+ -+#define virt_to_bus virt_to_phys -+#define bus_to_virt phys_to_virt -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* !(__NIOS2_IO_H) */ -+ ---- linux/include/asm-nios2nommu/ipcbuf.h -+++ linux/include/asm-nios2nommu/ipcbuf.h -@@ -0,0 +1,49 @@ -+#ifndef __NIOS2_IPCBUF_H__ -+#define __NIOS2_IPCBUF_H__ -+ -+/* Copied from asm-m68k/ipcbuf.h -+ * The user_ipc_perm structure for Nios architecture. -+ * Note extra padding because this structure is passed back and forth -+ * between kernel and user space. -+ * -+ * Pad space is left for: -+ * - 32-bit mode_t and seq -+ * - 2 miscellaneous 32-bit values -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+struct ipc64_perm -+{ -+ __kernel_key_t key; -+ __kernel_uid32_t uid; -+ __kernel_gid32_t gid; -+ __kernel_uid32_t cuid; -+ __kernel_gid32_t cgid; -+ __kernel_mode_t mode; -+ unsigned short __pad1; -+ unsigned short seq; -+ unsigned short __pad2; -+ unsigned long __unused1; -+ unsigned long __unused2; -+}; -+ -+#endif /* __NIOS2_IPCBUF_H__ */ ---- linux/include/asm-nios2nommu/ipc.h -+++ linux/include/asm-nios2nommu/ipc.h -@@ -0,0 +1,51 @@ -+#ifndef __NIOS2_IPC_H__ -+#define __NIOS2_IPC_H__ -+ -+/* Copied from sparc version -+ * These are used to wrap system calls on the Nios. -+ * -+ * See arch/niosnommu/kernel/sys_nios.c for ugly details.. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+struct ipc_kludge { -+ struct msgbuf *msgp; -+ long msgtyp; -+}; -+ -+#define SEMOP 1 -+#define SEMGET 2 -+#define SEMCTL 3 -+#define MSGSND 11 -+#define MSGRCV 12 -+#define MSGGET 13 -+#define MSGCTL 14 -+#define SHMAT 21 -+#define SHMDT 22 -+#define SHMGET 23 -+#define SHMCTL 24 -+ -+/* Used by the DIPC package, try and avoid reusing it */ -+#define DIPC 25 -+ -+#define IPCCALL(version,op) ((version)<<16 | (op)) -+ -+#endif ---- linux/include/asm-nios2nommu/irq.h -+++ linux/include/asm-nios2nommu/irq.h -@@ -0,0 +1,182 @@ -+/* -+ * 21Mar2001 1.1 dgt/microtronix -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+ -+#ifndef _NIOS2NOMMU_IRQ_H_ -+#define _NIOS2NOMMU_IRQ_H_ -+ -+extern void disable_irq(unsigned int); -+extern void enable_irq(unsigned int); -+ -+// #include -+#include -+ -+#define SYS_IRQS 32 -+#define NR_IRQS SYS_IRQS -+ -+/* -+ * Interrupt source definitions -+ * General interrupt sources are the level 1-7. -+ * Adding an interrupt service routine for one of these sources -+ * results in the addition of that routine to a chain of routines. -+ * Each one is called in succession. Each individual interrupt -+ * service routine should determine if the device associated with -+ * that routine requires service. -+ */ -+ -+#define IRQ01 (1) /* level 1 interrupt */ -+#define IRQ02 (2) /* level 2 interrupt */ -+#define IRQ03 (3) /* level 3 interrupt */ -+#define IRQ04 (4) /* level 4 interrupt */ -+#define IRQ05 (5) /* level 5 interrupt */ -+#define IRQ06 (6) /* level 6 interrupt */ -+#define IRQ07 (7) /* level 7 interrupt */ -+#define IRQ08 (8) /* level 8 interrupt */ -+#define IRQ09 (9) /* level 9 interrupt */ -+#define IRQ0A (10) /* level 10 interrupt */ -+#define IRQ0B (11) /* level 11 interrupt */ -+#define IRQ0C (12) /* level 12 interrupt */ -+#define IRQ0D (13) /* level 13 interrupt */ -+#define IRQ0E (14) /* level 14 interrupt */ -+#define IRQ0F (15) /* level 15 interrupt */ -+#define IRQ10 (16) /* level 16 interrupt */ -+#define IRQ12 (17) /* level 17 interrupt */ -+#define IRQ13 (18) /* level 18 interrupt */ -+#define IRQ14 (19) /* level 19 interrupt */ -+#define IRQ15 (20) /* level 20 interrupt */ -+#define IRQ16 (21) /* level 21 interrupt */ -+#define IRQ17 (22) /* level 22 interrupt */ -+#define IRQ18 (23) /* level 23 interrupt */ -+#define IRQ19 (24) /* level 24 interrupt */ -+#define IRQ1A (25) /* level 25 interrupt */ -+#define IRQ1B (26) /* level 26 interrupt */ -+#define IRQ1C (27) /* level 27 interrupt */ -+#define IRQ1D (28) /* level 28 interrupt */ -+#define IRQ1E (29) /* level 29 interrupt */ -+#define IRQ1F (30) /* level 30 interrupt */ -+#define IRQ20 (31) /* level 31 interrupt */ -+#define IRQ21 (32) /* level 32 interrupt */ -+ -+#define IRQMAX IRQ21 -+ -+/* -+ * "Generic" interrupt sources -+ */ -+ -+/* -+ * Machine specific interrupt sources. -+ * -+ * Adding an interrupt service routine for a source with this bit -+ * set indicates a special machine specific interrupt source. -+ * The machine specific files define these sources. -+ * -+ * Removed, they are not used by any one. -+ */ -+ -+/* -+ * various flags for request_irq() -+ */ -+#define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */ -+#define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */ -+#define IRQ_FLG_FAST (0x0004) -+#define IRQ_FLG_SLOW (0x0008) -+#define IRQ_FLG_STD (0x8000) /* internally used */ -+ -+/* -+ * Functions to set and clear the interrupt mask. -+ */ -+ -+/* -+ * Use a zero to clean the bit. -+ */ -+static inline void clrimr(int mask) -+{ -+ int flags; -+ -+ local_irq_save(flags); -+ __asm__ __volatile__( -+ "rdctl r8, ienable\n" -+ "and r8,r8,%0\n" -+ "wrctl ienable, r8\n" -+ : /* No output */ -+ : "r" (mask) -+ : "r8"); -+ local_irq_restore(flags); -+} -+ -+/* -+ * Use a one to set the bit. -+ */ -+static inline void setimr(int mask) -+{ -+ int flags; -+ -+ local_irq_save(flags); -+ __asm__ __volatile__( -+ "rdctl r8, ienable\n" -+ "or r8,r8,%0\n" -+ "wrctl ienable, r8\n" -+ : /* No output */ -+ : "r" (mask) -+ : "r8"); -+ local_irq_restore(flags); -+} -+ -+/* -+ * This structure is used to chain together the ISRs for a particular -+ * interrupt source (if it supports chaining). -+ */ -+typedef struct irq_node { -+ irqreturn_t (*handler)(int, void *, struct pt_regs *); -+ unsigned long flags; -+ void *dev_id; -+ const char *devname; -+ struct irq_node *next; -+} irq_node_t; -+ -+/* -+ * This function returns a new irq_node_t -+ */ -+extern irq_node_t *new_irq_node(void); -+ -+/* -+ * This structure has only 4 elements for speed reasons -+ */ -+typedef struct irq_handler { -+ irqreturn_t (*handler)(int, void *, struct pt_regs *); -+ unsigned long flags; -+ void *dev_id; -+ const char *devname; -+} irq_handler_t; -+ -+/* count of spurious interrupts */ -+extern volatile unsigned int num_spurious; -+ -+#define disable_irq_nosync(i) disable_irq(i) -+ -+#ifndef irq_canonicalize -+#define irq_canonicalize(i) (i) -+#endif -+ -+#endif /* _NIOS2NOMMU_IRQ_H_ */ ---- linux/include/asm-nios2nommu/kmap_types.h -+++ linux/include/asm-nios2nommu/kmap_types.h -@@ -0,0 +1,43 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _ASM_KMAP_TYPES_H -+#define _ASM_KMAP_TYPES_H -+ -+enum km_type { -+ KM_BOUNCE_READ, -+ KM_SKB_SUNRPC_DATA, -+ KM_SKB_DATA_SOFTIRQ, -+ KM_USER0, -+ KM_USER1, -+ KM_BIO_SRC_IRQ, -+ KM_BIO_DST_IRQ, -+ KM_PTE0, -+ KM_PTE1, -+ KM_IRQ0, -+ KM_IRQ1, -+ KM_SOFTIRQ0, -+ KM_SOFTIRQ1, -+ KM_TYPE_NR -+}; -+ -+#endif ---- linux/include/asm-nios2nommu/linkage.h -+++ linux/include/asm-nios2nommu/linkage.h -@@ -0,0 +1,29 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __ASM_LINKAGE_H -+#define __ASM_LINKAGE_H -+ -+#define __ALIGN .align 3 -+#define __ALIGN_STR ".align 3" -+ -+#endif ---- linux/include/asm-nios2nommu/linux_logo.h -+++ linux/include/asm-nios2nommu/linux_logo.h -@@ -0,0 +1,953 @@ -+/* $Id: linux_logo.h,v 1.3 2004/02/12 23:06:40 ken-h Exp $ -+ * include/asm-nios/linux_logo.h: This is a linux logo -+ * to be displayed on boot. -+ * -+ * Copyright (C) 1996 Larry Ewing (lewing@isc.tamu.edu) -+ * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) -+ * Copyright (C) 2004 Micrtronix Datacom Ltd. -+ * -+ * You can put anything here, but: -+ * LINUX_LOGO_COLORS has to be less than 224 -+ * image size has to be 80x80 -+ * values have to start from 0x20 -+ * (i.e. RGB(linux_logo_red[0], -+ * linux_logo_green[0], -+ * linux_logo_blue[0]) is color 0x20) -+ * BW image has to be 80x80 as well, with MS bit -+ * on the left -+ * Serial_console ascii image can be any size, -+ * but should contain %s to display the version -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#include -+#include -+ -+#define linux_logo_banner "Linux/NIOS2 version " UTS_RELEASE -+ -+#define __HAVE_ARCH_LINUX_LOGO -+#define __HAVE_ARCH_LINUX_LOGO16 -+ -+#define LINUX_LOGO_COLORS 221 -+ -+#ifdef INCLUDE_LINUX_LOGO_DATA -+ -+unsigned char linux_logo_red[] __initdata = { -+ 0x00, 0x06, 0x0a, 0x0e, 0x16, 0x1a, 0x1e, 0x22, -+ 0x12, 0x00, 0x2a, 0x36, 0x42, 0x4e, 0x4a, 0x56, -+ 0x26, 0x46, 0x2e, 0x32, 0x52, 0x3a, 0x02, 0x65, -+ 0x5e, 0x3e, 0x74, 0x8a, 0xa2, 0x9a, 0x86, 0xc6, -+ 0xc3, 0x65, 0xbb, 0xd2, 0xda, 0xd6, 0xe2, 0xf6, -+ 0xfd, 0xae, 0x7b, 0xdd, 0xea, 0x6a, 0xaa, 0xe7, -+ 0xbe, 0x5a, 0xee, 0x9e, 0x95, 0x80, 0x76, 0x79, -+ 0x62, 0x36, 0x9a, 0xe2, 0xec, 0xe1, 0xb8, 0xd7, -+ 0xaf, 0x25, 0xbc, 0xc0, 0xef, 0xea, 0xe8, 0xe8, -+ 0xf5, 0xf1, 0xda, 0xd3, 0x79, 0xdb, 0xf4, 0xf6, -+ 0xf6, 0xf6, 0xe2, 0x3d, 0xb4, 0xce, 0xe6, 0xee, -+ 0xf6, 0x68, 0xd8, 0xec, 0xf5, 0xc6, 0xc8, 0x9c, -+ 0x89, 0xd2, 0xee, 0xcb, 0xb9, 0xd2, 0x66, 0x5e, -+ 0x8b, 0xbe, 0xa8, 0xd5, 0xca, 0xb6, 0xae, 0x9c, -+ 0xc5, 0xbe, 0xbe, 0xca, 0x90, 0xb2, 0x9a, 0xa8, -+ 0xb6, 0xf2, 0xce, 0xfa, 0xb2, 0x6e, 0xa6, 0xfe, -+ 0xf6, 0xec, 0xfe, 0xd2, 0xea, 0xf5, 0xf2, 0xf2, -+ 0xe9, 0xee, 0xf6, 0xf2, 0xee, 0xf6, 0xda, 0xd4, -+ 0xfa, 0xca, 0xf2, 0xf6, 0xfe, 0xf2, 0xda, 0xe4, -+ 0xf6, 0xdd, 0xf2, 0xee, 0xfa, 0xf0, 0x12, 0x4a, -+ 0xd6, 0xf2, 0x8e, 0xf2, 0xf6, 0xf6, 0xb5, 0xf1, -+ 0x26, 0x9a, 0xea, 0xf6, 0xe0, 0xd2, 0x16, 0x9a, -+ 0x2e, 0xd2, 0x70, 0xd6, 0x46, 0x7c, 0xb4, 0x62, -+ 0xda, 0xee, 0xd6, 0xa3, 0x74, 0xa7, 0xa2, 0xe0, -+ 0xae, 0xbe, 0xce, 0xe2, 0xa3, 0x8e, 0x6d, 0x8e, -+ 0x32, 0xaf, 0x50, 0x9e, 0x5b, 0x8a, 0x98, 0x82, -+ 0x7a, 0x82, 0x56, 0x7c, 0x8a, 0x56, 0x5e, 0x86, -+ 0x6a, 0x52, 0x59, 0x64, 0x5e, -+}; -+ -+unsigned char linux_logo_green[] __initdata = { -+ 0x00, 0x06, 0x0a, 0x0e, 0x16, 0x1a, 0x1e, 0x22, -+ 0x12, 0x00, 0x2a, 0x36, 0x42, 0x4e, 0x4a, 0x56, -+ 0x26, 0x46, 0x2e, 0x32, 0x52, 0x3a, 0x02, 0x65, -+ 0x5e, 0x3e, 0x74, 0x8a, 0xa2, 0x9a, 0x86, 0xc6, -+ 0xc3, 0x62, 0xbb, 0xd2, 0xda, 0xd6, 0xe2, 0xf6, -+ 0xfd, 0xae, 0x7b, 0xdd, 0xea, 0x6a, 0xaa, 0xe7, -+ 0xbe, 0x5a, 0xee, 0x9e, 0x95, 0x80, 0x62, 0x5c, -+ 0x4e, 0x26, 0x72, 0xaa, 0xba, 0xaf, 0x90, 0xae, -+ 0x92, 0x1a, 0xa4, 0x85, 0xb6, 0xbe, 0xc3, 0xc8, -+ 0xcf, 0xd0, 0xc2, 0xce, 0x57, 0xa2, 0xd6, 0xda, -+ 0xda, 0xd7, 0xb8, 0x2a, 0x7b, 0x91, 0xae, 0xca, -+ 0xda, 0x45, 0x9e, 0xb2, 0xd7, 0x9b, 0x90, 0x76, -+ 0x5c, 0xa2, 0xbe, 0xa6, 0x85, 0x96, 0x4e, 0x46, -+ 0x66, 0x92, 0x7a, 0x9a, 0x96, 0x9d, 0x9a, 0x6b, -+ 0x8a, 0x8e, 0xb2, 0xca, 0x90, 0xa6, 0x79, 0x7c, -+ 0xb6, 0xf2, 0xce, 0xfa, 0xb2, 0x6e, 0xa6, 0xfa, -+ 0xea, 0xd7, 0xf6, 0xbc, 0xda, 0xde, 0xda, 0xe6, -+ 0xca, 0xd8, 0xea, 0xe0, 0xcc, 0xf2, 0xce, 0xb2, -+ 0xee, 0xa2, 0xd6, 0xe6, 0xf6, 0xd7, 0xc5, 0xb8, -+ 0xc6, 0xb9, 0xce, 0xde, 0xce, 0xc6, 0x0e, 0x36, -+ 0xae, 0xbe, 0x86, 0xba, 0xbe, 0xe6, 0x8e, 0xc4, -+ 0x1e, 0x8e, 0xae, 0xba, 0xb2, 0xa6, 0x12, 0x7a, -+ 0x20, 0xc6, 0x64, 0xaa, 0x2f, 0x70, 0x85, 0x46, -+ 0xce, 0xd6, 0xa6, 0x6e, 0x51, 0x72, 0x92, 0xa6, -+ 0x87, 0x96, 0xa2, 0xd6, 0x85, 0x7a, 0x6a, 0x6e, -+ 0x22, 0x76, 0x36, 0x76, 0x3c, 0x6e, 0x63, 0x53, -+ 0x66, 0x62, 0x42, 0x50, 0x56, 0x42, 0x56, 0x56, -+ 0x56, 0x3e, 0x51, 0x52, 0x56, -+}; -+ -+unsigned char linux_logo_blue[] __initdata = { -+ 0x00, 0x06, 0x0a, 0x0e, 0x16, 0x1a, 0x1e, 0x22, -+ 0x12, 0x01, 0x2a, 0x36, 0x42, 0x4e, 0x4a, 0x56, -+ 0x26, 0x46, 0x2e, 0x32, 0x52, 0x3a, 0x06, 0x65, -+ 0x5e, 0x3e, 0x74, 0x8a, 0xa2, 0x9a, 0x86, 0xc6, -+ 0xc3, 0x59, 0xbb, 0xd2, 0xda, 0xd6, 0xe2, 0xf6, -+ 0xfd, 0xae, 0x7b, 0xdd, 0xea, 0x6a, 0xaa, 0xe7, -+ 0xbe, 0x5a, 0xee, 0x9e, 0x95, 0x80, 0x2e, 0x08, -+ 0x0a, 0x06, 0x0a, 0x0b, 0x0b, 0x0f, 0x0c, 0x0f, -+ 0x3d, 0x09, 0x73, 0x09, 0x0d, 0x0a, 0x10, 0x1e, -+ 0x2d, 0x13, 0x86, 0xba, 0x19, 0x0a, 0x36, 0x3c, -+ 0x26, 0x14, 0x0d, 0x06, 0x07, 0x0a, 0x0b, 0x0f, -+ 0x4a, 0x06, 0x0a, 0x0c, 0x2b, 0x0a, 0x0b, 0x0a, -+ 0x06, 0x0a, 0x0a, 0x11, 0x0b, 0x0a, 0x0a, 0x1e, -+ 0x0f, 0x0d, 0x0a, 0x0b, 0x22, 0x6a, 0x72, 0x0b, -+ 0x0b, 0x22, 0x90, 0xca, 0x90, 0x92, 0x3c, 0x2c, -+ 0xb6, 0xf2, 0xce, 0xfa, 0xb2, 0x6e, 0xa6, 0xea, -+ 0xb6, 0x7c, 0xda, 0x8e, 0xa6, 0x87, 0x66, 0xb6, -+ 0x81, 0x6a, 0xc6, 0x9a, 0x5b, 0xd2, 0xb6, 0x6a, -+ 0xca, 0x45, 0x92, 0xb2, 0xca, 0x52, 0x8a, 0x3e, -+ 0x2e, 0x66, 0x66, 0xae, 0x3e, 0x47, 0x06, 0x0e, -+ 0x52, 0x36, 0x6a, 0x0e, 0x0e, 0xbe, 0x2c, 0x0e, -+ 0x0a, 0x5a, 0x0d, 0x0e, 0x3e, 0x0a, 0x06, 0x2e, -+ 0x06, 0x9e, 0x4e, 0x36, 0x06, 0x58, 0x24, 0x06, -+ 0x9e, 0xae, 0x3a, 0x08, 0x08, 0x07, 0x5e, 0x0a, -+ 0x32, 0x2e, 0x2a, 0xb2, 0x43, 0x48, 0x5f, 0x2e, -+ 0x06, 0x06, 0x07, 0x24, 0x06, 0x32, 0x06, 0x06, -+ 0x46, 0x2e, 0x22, 0x06, 0x06, 0x1e, 0x4c, 0x06, -+ 0x3a, 0x22, 0x42, 0x34, 0x42, -+}; -+ -+unsigned char linux_logo[] __initdata = { -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x21, 0x21, 0x22, 0x22, -+ 0x22, 0x21, 0x21, 0x21, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, -+ 0x26, 0x26, 0x25, 0x28, 0x23, 0x22, 0x21, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x21, 0x23, 0x25, 0x2a, 0x2b, 0x2c, 0x2d, 0x2d, -+ 0x2d, 0x2e, 0x2c, 0x2b, 0x2a, 0x25, 0x28, 0x22, -+ 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x24, 0x2a, 0x2c, 0x2f, 0x2c, 0x30, 0x30, 0x24, -+ 0x25, 0x27, 0x2b, 0x2c, 0x2f, 0x31, 0x32, 0x25, -+ 0x23, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x25, -+ 0x33, 0x34, 0x35, 0x21, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x21, 0x2b, 0x2f, 0x2c, -+ 0x30, 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x24, 0x33, -+ 0x2d, 0x27, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x21, 0x31, -+ 0x2d, 0x32, 0x24, 0x21, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x21, 0x28, 0x2a, 0x34, -+ 0x25, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x23, 0x32, 0x27, 0x21, 0x36, -+ 0x2a, 0x2d, 0x2a, 0x28, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x20, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x22, 0x26, 0x2c, 0x35, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x25, 0x2f, 0x37, 0x32, 0x22, -+ 0x36, 0x35, 0x31, 0x27, 0x22, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x23, 0x2a, 0x2f, 0x22, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x26, 0x38, 0x38, 0x35, 0x25, -+ 0x36, 0x21, 0x2d, 0x2b, 0x24, 0x21, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x21, 0x24, 0x39, 0x39, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x25, 0x2b, 0x30, 0x28, 0x22, -+ 0x36, 0x36, 0x27, 0x34, 0x30, 0x23, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x21, 0x26, 0x2d, 0x26, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x22, 0x22, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x2d, 0x33, 0x28, 0x21, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x30, 0x2f, 0x23, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x2b, 0x2c, 0x25, 0x21, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x2a, 0x34, 0x36, 0x36, -+ 0x36, 0x21, 0x22, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x21, 0x23, 0x22, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x28, 0x34, 0x27, 0x22, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x32, 0x2f, 0x36, 0x36, -+ 0x21, 0x21, 0x24, 0x27, 0x21, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x28, 0x27, 0x22, 0x33, 0x24, 0x36, -+ 0x36, 0x36, 0x36, 0x22, 0x2f, 0x2a, 0x23, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x32, 0x2f, 0x36, 0x36, -+ 0x30, 0x3a, 0x38, 0x24, 0x24, 0x36, 0x36, 0x36, -+ 0x23, 0x2f, 0x3b, 0x3c, 0x3d, 0x30, 0x25, 0x21, -+ 0x36, 0x36, 0x36, 0x36, 0x2f, 0x32, 0x23, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x32, 0x2f, 0x36, 0x23, -+ 0x3e, 0x3f, 0x40, 0x3a, 0x22, 0x36, 0x36, 0x21, -+ 0x41, 0x42, 0x43, 0x44, 0x45, 0x3e, 0x23, 0x21, -+ 0x36, 0x36, 0x36, 0x36, 0x2f, 0x33, 0x28, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x29, 0x20, 0x29, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x32, 0x2f, 0x36, 0x2b, -+ 0x44, 0x40, 0x46, 0x47, 0x35, 0x36, 0x36, 0x26, -+ 0x43, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x2e, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x31, 0x35, 0x24, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x32, 0x34, 0x36, 0x4d, -+ 0x4e, 0x25, 0x2f, 0x46, 0x4a, 0x22, 0x23, 0x32, -+ 0x4f, 0x50, 0x21, 0x31, 0x51, 0x52, 0x53, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x31, 0x35, 0x24, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x29, 0x20, 0x29, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x2a, 0x2f, 0x21, 0x3a, -+ 0x4d, 0x21, 0x31, 0x54, 0x55, 0x28, 0x30, 0x2b, -+ 0x4b, 0x4d, 0x36, 0x23, 0x32, 0x50, 0x3f, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x2e, 0x39, 0x24, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x29, 0x20, 0x29, 0x20, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x2a, 0x38, 0x23, 0x37, -+ 0x55, 0x36, 0x28, 0x3a, 0x56, 0x57, 0x57, 0x58, -+ 0x3c, 0x4d, 0x36, 0x36, 0x36, 0x40, 0x40, 0x21, -+ 0x36, 0x36, 0x36, 0x36, 0x2e, 0x39, 0x24, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x29, 0x29, 0x29, 0x20, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x30, 0x51, 0x23, 0x35, -+ 0x43, 0x25, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, -+ 0x5f, 0x60, 0x61, 0x36, 0x31, 0x47, 0x3b, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x31, 0x2c, 0x25, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x30, 0x2f, 0x23, 0x22, -+ 0x40, 0x62, 0x63, 0x5d, 0x64, 0x65, 0x66, 0x67, -+ 0x68, 0x69, 0x66, 0x5e, 0x6a, 0x6b, 0x2a, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x33, 0x2e, 0x26, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x27, 0x2f, 0x23, 0x36, -+ 0x6c, 0x63, 0x6d, 0x64, 0x5c, 0x66, 0x69, 0x6e, -+ 0x6f, 0x70, 0x71, 0x69, 0x69, 0x72, 0x6c, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x33, 0x34, 0x27, 0x22, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x27, 0x34, 0x26, 0x73, -+ 0x74, 0x75, 0x76, 0x64, 0x65, 0x77, 0x69, 0x78, -+ 0x70, 0x71, 0x71, 0x71, 0x72, 0x5f, 0x5e, 0x21, -+ 0x36, 0x36, 0x36, 0x36, 0x25, 0x38, 0x2a, 0x23, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x26, 0x2d, 0x33, 0x79, -+ 0x63, 0x7a, 0x7b, 0x5c, 0x66, 0x69, 0x6e, 0x7c, -+ 0x71, 0x71, 0x69, 0x7d, 0x7e, 0x7a, 0x7f, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x21, 0x51, 0x2b, 0x28, -+ 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x26, 0x2d, 0x32, 0x24, -+ 0x80, 0x81, 0x64, 0x82, 0x77, 0x69, 0x71, 0x71, -+ 0x69, 0x83, 0x84, 0x85, 0x7a, 0x85, 0x86, 0x36, -+ 0x21, 0x2b, 0x23, 0x36, 0x36, 0x39, 0x2e, 0x26, -+ 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x27, 0x2d, 0x33, 0x21, -+ 0x87, 0x88, 0x89, 0x72, 0x67, 0x66, 0x5f, 0x89, -+ 0x8a, 0x63, 0x85, 0x8b, 0x8c, 0x8d, 0x41, 0x36, -+ 0x36, 0x2d, 0x3a, 0x35, 0x36, 0x24, 0x51, 0x32, -+ 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x30, 0x2f, 0x33, 0x21, -+ 0x55, 0x8e, 0x8f, 0x8a, 0x7d, 0x5e, 0x90, 0x7e, -+ 0x75, 0x75, 0x90, 0x62, 0x40, 0x3f, 0x49, 0x23, -+ 0x36, 0x24, 0x3a, 0x3a, 0x24, 0x36, 0x2e, 0x31, -+ 0x26, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x21, 0x28, 0x33, 0x37, 0x25, 0x22, -+ 0x3b, 0x50, 0x8e, 0x8f, 0x90, 0x7e, 0x90, 0x63, -+ 0x74, 0x91, 0x92, 0x42, 0x93, 0x4b, 0x45, 0x2c, -+ 0x36, 0x36, 0x33, 0x39, 0x21, 0x36, 0x22, 0x51, -+ 0x33, 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x22, 0x27, 0x2e, 0x2e, 0x36, 0x21, -+ 0x94, 0x3f, 0x50, 0x95, 0x96, 0x8f, 0x8f, 0x97, -+ 0x8e, 0x42, 0x50, 0x43, 0x47, 0x48, 0x48, 0x98, -+ 0x21, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x39, -+ 0x2e, 0x27, 0x23, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x22, 0x24, 0x2b, 0x38, 0x28, 0x36, 0x32, -+ 0x4c, 0x4b, 0x50, 0x50, 0x50, 0x42, 0x42, 0x50, -+ 0x50, 0x40, 0x45, 0x99, 0x48, 0x48, 0x48, 0x48, -+ 0x34, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x23, -+ 0x2f, 0x2b, 0x24, 0x21, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x21, 0x28, 0x32, 0x51, 0x32, 0x28, 0x21, 0x98, -+ 0x48, 0x47, 0x9a, 0x50, 0x50, 0x50, 0x50, 0x50, -+ 0x9a, 0x4f, 0x9b, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x93, 0x23, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x2a, 0x2f, 0x2a, 0x28, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x23, 0x30, 0x2e, 0x2c, 0x36, 0x21, 0x51, 0x9b, -+ 0x48, 0x48, 0x52, 0x3f, 0x50, 0x50, 0x40, 0x4b, -+ 0x47, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x34, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x2d, 0x31, 0x27, 0x23, 0x21, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x23, -+ 0x27, 0x2c, 0x2d, 0x21, 0x36, 0x28, 0x44, 0x48, -+ 0x48, 0x48, 0x48, 0x47, 0x46, 0x4f, 0x47, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x9c, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x28, 0x51, 0x39, 0x26, 0x22, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x25, -+ 0x35, 0x51, 0x28, 0x36, 0x36, 0x9d, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x9b, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x4f, 0x28, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x28, 0x38, 0x2b, 0x25, 0x22, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x24, 0x33, -+ 0x51, 0x25, 0x36, 0x36, 0x23, 0x40, 0x9b, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x9b, 0x99, 0x2b, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x30, 0x2f, 0x33, 0x24, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x21, 0x23, 0x30, 0x34, -+ 0x27, 0x36, 0x36, 0x36, 0x2a, 0x40, 0x47, 0x48, -+ 0x48, 0x48, 0x48, 0x9b, 0x99, 0x99, 0x9b, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x9b, 0x47, 0x52, -+ 0x46, 0x4f, 0x37, 0x21, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x30, 0x34, 0x2a, 0x23, -+ 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x22, 0x25, 0x39, 0x2c, -+ 0x36, 0x36, 0x36, 0x21, 0x31, 0x4e, 0x9a, 0x4c, -+ 0x47, 0x9b, 0x9b, 0x52, 0x46, 0x4f, 0x52, 0x9b, -+ 0x9b, 0x9b, 0x47, 0x4f, 0x45, 0x9a, 0x93, 0x93, -+ 0x3f, 0x93, 0x98, 0x28, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x39, 0x2c, 0x26, -+ 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x23, 0x2a, 0x34, 0x28, -+ 0x36, 0x36, 0x36, 0x22, 0x38, 0x98, 0x44, 0x99, -+ 0x9b, 0x48, 0x48, 0x9b, 0x4c, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x47, 0x52, 0x46, 0x43, 0x93, -+ 0x40, 0x40, 0x43, 0x53, 0x21, 0x23, 0x33, 0x23, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x21, 0x2f, 0x32, -+ 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x21, 0x24, 0x2b, 0x31, 0x36, -+ 0x36, 0x22, 0x36, 0x24, 0x9e, 0x4f, 0x9b, 0x48, -+ 0x48, 0x48, 0x48, 0x9b, 0x99, 0x9f, 0x52, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x47, -+ 0x4f, 0x9a, 0x3f, 0x46, 0x38, 0x36, 0x21, 0x30, -+ 0x26, 0x36, 0x36, 0x36, 0x36, 0x36, 0x39, 0x2c, -+ 0x25, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x26, 0x2e, 0x33, 0x36, -+ 0x25, 0x25, 0x36, 0x4d, 0x52, 0x48, 0x48, 0x48, -+ 0x47, 0x9f, 0x48, 0x48, 0x48, 0xa0, 0xa1, 0xa2, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x47, 0x44, 0x93, 0x43, 0x23, 0x36, 0x36, -+ 0x26, 0x24, 0x36, 0x36, 0x36, 0x36, 0x28, 0x2f, -+ 0x2a, 0x23, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x2a, 0x51, 0x24, 0x36, -+ 0x2a, 0x36, 0x28, 0x44, 0x48, 0x48, 0x48, 0x48, -+ 0xa3, 0xa4, 0x48, 0x48, 0x9f, 0xa5, 0xa6, 0x9f, -+ 0x48, 0x48, 0x48, 0xa2, 0xa7, 0x47, 0x48, 0x48, -+ 0x48, 0x48, 0x9b, 0x4b, 0x44, 0x37, 0x36, 0x23, -+ 0x28, 0x30, 0x22, 0x36, 0x36, 0x36, 0x36, 0x2d, -+ 0x35, 0x24, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x21, 0x28, 0x2b, 0x34, 0x36, 0x25, -+ 0x24, 0x36, 0x4a, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0xa8, 0xa1, 0x48, 0x48, 0x9f, 0xa9, 0xa6, 0x9f, -+ 0x48, 0x48, 0xaa, 0xa1, 0xa5, 0x9f, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x9b, 0x52, 0x3f, 0x21, 0x30, -+ 0x35, 0x25, 0x30, 0x36, 0x36, 0x36, 0x36, 0x32, -+ 0x2d, 0x26, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x22, 0x26, 0x2e, 0x35, 0x36, 0x2a, -+ 0x36, 0x24, 0x4f, 0x48, 0x52, 0x52, 0x48, 0x48, -+ 0xab, 0xac, 0xa0, 0x48, 0xad, 0xa6, 0xa6, 0x9f, -+ 0x48, 0xa2, 0xa9, 0xa6, 0xa2, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x47, 0x32, 0x30, -+ 0x2a, 0x23, 0x30, 0x23, 0x36, 0x36, 0x36, 0x21, -+ 0x2f, 0x32, 0x23, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x21, 0x23, 0x2a, 0x51, 0x28, 0x28, 0x25, -+ 0x36, 0x3a, 0x48, 0x48, 0xae, 0xaf, 0x48, 0x48, -+ 0xad, 0xac, 0xa1, 0x9f, 0xa2, 0xa9, 0xa9, 0xa2, -+ 0x48, 0xab, 0x78, 0xa7, 0x48, 0x48, 0x48, 0x48, -+ 0x9f, 0x48, 0x48, 0x48, 0x48, 0x48, 0x38, 0x21, -+ 0x36, 0x36, 0x22, 0x27, 0x36, 0x36, 0x36, 0x36, -+ 0x2e, 0x35, 0x24, 0x21, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x22, 0x25, 0x2c, 0x34, 0x36, 0x30, 0x21, -+ 0x23, 0x43, 0x48, 0x48, 0xb0, 0xb1, 0xb2, 0x9f, -+ 0x48, 0xb3, 0xa5, 0xb3, 0xab, 0xa9, 0xa9, 0xb3, -+ 0xb4, 0xa9, 0xb5, 0xb0, 0x48, 0x48, 0xa0, 0xa5, -+ 0xa1, 0xad, 0x48, 0x48, 0x48, 0x48, 0x94, 0x36, -+ 0x36, 0x36, 0x36, 0x32, 0x36, 0x36, 0x36, 0x36, -+ 0x2a, 0x2e, 0x26, 0x22, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x21, 0x23, 0x2a, 0x51, 0x25, 0x21, 0x2a, 0x36, -+ 0x2e, 0x9b, 0x48, 0x48, 0x48, 0xb6, 0xb7, 0xa4, -+ 0xa2, 0xa7, 0xb5, 0x78, 0x6f, 0x6f, 0x6e, 0x6f, -+ 0xa9, 0xb5, 0xab, 0x48, 0x9f, 0xab, 0xa9, 0xa1, -+ 0xaa, 0x48, 0x48, 0x48, 0x48, 0x48, 0x98, 0x36, -+ 0x36, 0x36, 0x36, 0x32, 0x36, 0x36, 0x36, 0x36, -+ 0x22, 0x2f, 0x30, 0x22, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x22, 0x25, 0x2c, 0x34, 0x36, 0x24, 0x28, 0x36, -+ 0x54, 0x48, 0x48, 0x48, 0x48, 0xa2, 0xa8, 0xa1, -+ 0xa5, 0xa6, 0x6e, 0x6e, 0x6f, 0x6f, 0x6f, 0x6f, -+ 0x6f, 0x78, 0xa5, 0xa0, 0xa0, 0x78, 0xa6, 0xa2, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x9a, 0x36, -+ 0x36, 0x36, 0x36, 0x30, 0x36, 0x36, 0x36, 0x36, -+ 0x21, 0x2f, 0x32, 0x23, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x28, 0x32, 0x2f, 0x28, 0x36, 0x27, 0x22, 0x21, -+ 0x43, 0x48, 0x4b, 0xa2, 0x9f, 0x48, 0xa2, 0xa1, -+ 0xb8, 0x6e, 0x6e, 0xb5, 0x78, 0x6f, 0x78, 0x78, -+ 0x6e, 0x6f, 0x78, 0xb5, 0xa6, 0xa1, 0xa0, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x4b, 0x21, -+ 0x36, 0x36, 0x21, 0x26, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x34, 0x2b, 0x28, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x25, 0x2c, 0x39, 0x36, 0x36, 0x30, 0x22, 0x25, -+ 0x52, 0x48, 0xa3, 0xb1, 0xb6, 0xb3, 0xaa, 0xac, -+ 0x68, 0x68, 0x6e, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, -+ 0x78, 0x6f, 0x6f, 0xb5, 0xa6, 0xb4, 0x48, 0x9f, -+ 0xb4, 0xb4, 0xa2, 0x9f, 0x48, 0x48, 0x4f, 0x21, -+ 0x36, 0x36, 0x22, 0x26, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x2c, 0x35, 0x24, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x30, 0x2d, 0x21, 0x36, 0x36, 0x32, 0x23, 0x2a, -+ 0x47, 0x48, 0xa2, 0xb6, 0xaf, 0xb9, 0xba, 0x68, -+ 0x6e, 0x6e, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, 0x78, -+ 0x6f, 0x6f, 0xa6, 0x6f, 0xb5, 0xa0, 0xaa, 0xa6, -+ 0xa6, 0xa9, 0xb2, 0xb3, 0x48, 0x48, 0x4c, 0x22, -+ 0x36, 0x36, 0x24, 0x23, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x2c, 0x39, 0x24, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x28, -+ 0x33, 0x2e, 0x36, 0x36, 0x23, 0x31, 0x27, 0x39, -+ 0x9b, 0x48, 0x48, 0x48, 0xb0, 0xb0, 0xba, 0xb8, -+ 0x68, 0x68, 0x69, 0x78, 0x6f, 0xb5, 0x6f, 0xb5, -+ 0x78, 0x78, 0x78, 0x78, 0x78, 0xa5, 0xbb, 0xa9, -+ 0xa5, 0x48, 0x48, 0x48, 0x48, 0x48, 0x4c, 0x23, -+ 0x36, 0x36, 0x26, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x2c, 0x39, 0x24, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x28, -+ 0x2b, 0x39, 0x36, 0x36, 0x36, 0x26, 0x32, 0x31, -+ 0x9b, 0x48, 0x48, 0x48, 0x48, 0x9f, 0xac, 0x68, -+ 0xbc, 0x6e, 0x6e, 0x6e, 0xb5, 0x6f, 0x6e, 0x6f, -+ 0x6f, 0x78, 0x78, 0xb5, 0xb5, 0xa5, 0x9f, 0x9f, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x46, 0x22, -+ 0x36, 0x21, 0x26, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x2c, 0x35, 0x24, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x24, -+ 0x35, 0x39, 0x36, 0x36, 0x36, 0x36, 0x26, 0x2d, -+ 0x9b, 0x48, 0x48, 0xb0, 0xaa, 0xb3, 0xbd, 0xb8, -+ 0xb8, 0x68, 0x6e, 0x6e, 0xb5, 0x6f, 0x78, 0x6e, -+ 0x78, 0x6f, 0x78, 0x78, 0xb5, 0xa9, 0xa2, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x9a, 0x36, -+ 0x24, 0x27, 0xbe, 0x24, 0x25, 0x28, 0x21, 0x36, -+ 0x36, 0x34, 0x2b, 0x28, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x25, -+ 0x39, 0x4d, 0xbf, 0x84, 0x81, 0x57, 0x21, 0x39, -+ 0x52, 0x48, 0x48, 0x62, 0xb1, 0xc0, 0xc1, 0xc1, -+ 0xb8, 0xb8, 0x68, 0xbc, 0x6e, 0x6e, 0x6e, 0x78, -+ 0x78, 0x78, 0x78, 0x6e, 0x78, 0xa9, 0xa0, 0xab, -+ 0xb3, 0xa2, 0x48, 0x48, 0x48, 0x48, 0x53, 0x28, -+ 0x23, 0x36, 0x36, 0x36, 0x21, 0x28, 0x2c, 0x30, -+ 0x21, 0x38, 0x33, 0x28, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x21, 0x22, 0x22, 0x28, 0x30, -+ 0x2d, 0xc2, 0x7a, 0xc3, 0xc4, 0xc4, 0x7f, 0x22, -+ 0x51, 0x52, 0x48, 0x48, 0xb0, 0xaa, 0xa8, 0xbd, -+ 0x68, 0xb8, 0xb8, 0x68, 0x68, 0x6e, 0x6e, 0x6f, -+ 0x6e, 0x6e, 0xb5, 0x6e, 0x78, 0xab, 0xab, 0xb5, -+ 0x78, 0xa6, 0xb3, 0xc5, 0xac, 0xac, 0xc6, 0x61, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x30, 0x32, -+ 0x25, 0x4d, 0x2b, 0x28, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x21, 0x23, 0x24, 0x26, 0x30, 0x33, 0x31, -+ 0x4d, 0x91, 0x5b, 0xc3, 0xc4, 0xc4, 0xc4, 0x5a, -+ 0x21, 0x2e, 0x46, 0x48, 0x48, 0x48, 0xb0, 0x64, -+ 0xc1, 0xb8, 0xb8, 0xb8, 0x68, 0x71, 0x6e, 0x6e, -+ 0x6f, 0x71, 0x6f, 0x6f, 0xa6, 0xa0, 0x9f, 0xb4, -+ 0xb4, 0xa0, 0xa1, 0xb7, 0xc7, 0x69, 0x66, 0xc8, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x21, 0x26, 0x25, -+ 0x83, 0xc9, 0x2c, 0x25, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x21, 0x28, 0x30, 0x35, 0x2d, 0x2f, 0x37, 0x4a, -+ 0x60, 0x85, 0xca, 0xcb, 0xc4, 0xc4, 0xc4, 0x82, -+ 0x86, 0x36, 0x32, 0x3f, 0xa2, 0xa4, 0xa8, 0xa9, -+ 0xb8, 0xb8, 0xb8, 0xb8, 0x68, 0x6e, 0x6e, 0x6e, -+ 0x6e, 0x71, 0x6f, 0x71, 0xa6, 0xb4, 0x9f, 0x9f, -+ 0x48, 0x48, 0x48, 0xcc, 0xc3, 0xc7, 0xcd, 0xce, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x21, 0x57, -+ 0x77, 0x66, 0x34, 0x27, 0x22, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x23, 0x30, 0x31, 0xcf, 0x91, 0x7e, 0x90, 0x90, -+ 0x8b, 0x5b, 0xc3, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0x5d, 0xd0, 0x36, 0x24, 0xd1, 0xb1, 0xaf, 0xaa, -+ 0xba, 0xb8, 0x68, 0x68, 0x68, 0x71, 0x6e, 0x6e, -+ 0x6e, 0x6f, 0x6e, 0x78, 0xa1, 0xa9, 0xa1, 0xb0, -+ 0x9f, 0x9b, 0x99, 0xcc, 0x64, 0x5c, 0x8b, 0xd0, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x73, 0x5d, -+ 0x82, 0x5c, 0xd2, 0x2a, 0x23, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x24, 0x2b, 0xcf, 0x8b, 0x5b, 0x76, 0x5b, 0x5b, -+ 0x7b, 0xc3, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc7, 0x5e, 0x22, 0x36, 0x21, 0x3a, 0x99, 0x48, -+ 0xa2, 0xa8, 0xb7, 0xc1, 0xb8, 0x68, 0x68, 0xbc, -+ 0x68, 0x6e, 0xb5, 0xb4, 0xb4, 0xab, 0xb5, 0xa1, -+ 0xb0, 0x4f, 0x3f, 0xd3, 0x7b, 0x7b, 0x85, 0x80, -+ 0xbe, 0x36, 0x36, 0x36, 0x21, 0xd4, 0x7e, 0x7b, -+ 0x64, 0x64, 0xd5, 0x35, 0x24, 0x21, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x26, 0x31, 0xd6, 0x5b, 0x64, 0xc3, 0xc3, 0xcb, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0x66, 0xd7, 0x36, 0x36, 0x36, 0x2c, 0x4b, -+ 0xd8, 0xd9, 0xb3, 0xa8, 0xbd, 0xbd, 0xbd, 0xbd, -+ 0xa9, 0xab, 0xb3, 0xa5, 0xa2, 0x9f, 0xa2, 0xa1, -+ 0x6a, 0x9a, 0x3f, 0xda, 0x76, 0x76, 0x7a, 0x63, -+ 0xdb, 0xdc, 0x86, 0xdc, 0xdd, 0x90, 0x5b, 0x64, -+ 0xc3, 0xc3, 0xde, 0x2d, 0x27, 0x23, 0x21, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x26, 0x2d, 0x91, 0x5b, 0x64, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc7, 0x83, 0xce, 0x36, 0x36, 0x36, 0x30, -+ 0xb1, 0xd9, 0x48, 0xa1, 0xb2, 0xb0, 0xb0, 0xb3, -+ 0xa2, 0x48, 0xa7, 0xbd, 0xa9, 0xa2, 0x48, 0x9f, -+ 0xaa, 0x9a, 0x3f, 0xb1, 0x5b, 0x7b, 0xdf, 0x85, -+ 0x7e, 0x90, 0x63, 0x90, 0x85, 0x5b, 0xc3, 0xc4, -+ 0xc4, 0xcb, 0x5d, 0xd5, 0x39, 0x26, 0x23, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x26, 0x2d, 0xe0, 0xdf, 0x64, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc7, 0x88, 0x36, 0x36, 0x36, 0x36, -+ 0x2d, 0x9b, 0x48, 0xb9, 0xaf, 0xa2, 0xa2, 0xb9, -+ 0xa8, 0x9f, 0x48, 0xa7, 0xb7, 0xd9, 0x48, 0x48, -+ 0x9b, 0x45, 0x3f, 0xe1, 0x6d, 0x7b, 0xca, 0xdf, -+ 0x7a, 0x8b, 0x8b, 0x7a, 0x5b, 0x64, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc3, 0xe2, 0x37, 0x35, 0x26, 0x23, -+ 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x26, 0x2e, 0xe0, 0x7a, 0x7b, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc7, 0x72, 0x73, 0x36, 0x36, 0x36, -+ 0x24, 0x52, 0x48, 0xa3, 0xaf, 0x9f, 0x48, 0xb6, -+ 0xaf, 0xa2, 0x48, 0x9f, 0xe3, 0xd8, 0x48, 0x48, -+ 0x48, 0x46, 0x42, 0xd6, 0x7a, 0x7b, 0x64, 0x7b, -+ 0x76, 0x5b, 0x5b, 0x76, 0x7b, 0xc3, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xcb, 0x64, 0xe2, 0x4d, 0x2c, 0x27, -+ 0x23, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x25, 0x31, 0xe4, 0x8b, 0x7b, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc7, 0x89, 0xbe, 0x36, 0x36, -+ 0x32, 0x47, 0x48, 0x4f, 0xa0, 0x48, 0x48, 0xe3, -+ 0x92, 0x9f, 0x48, 0x9f, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x4b, 0x2f, 0x8f, 0x7a, 0x7b, 0xc3, 0xcb, -+ 0xc3, 0x64, 0x64, 0xc3, 0xc3, 0xcb, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc3, 0x5d, 0xe5, 0x2c, -+ 0x26, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x25, 0x31, 0xe4, 0x85, 0x7b, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0x66, 0x57, 0x27, 0x4d, -+ 0x4b, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x99, 0x34, 0xbe, 0xdb, 0x7a, 0x7b, 0xc3, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc3, 0xe4, -+ 0x32, 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x26, 0x2d, 0xe4, 0x85, 0x7b, 0xcb, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc7, 0x5f, 0x92, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x44, -+ 0x35, 0x36, 0xce, 0xdd, 0x7a, 0x7b, 0xcb, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xcb, 0xc3, 0xe1, -+ 0x2b, 0x24, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x23, -+ 0x30, 0x2f, 0xd6, 0x8b, 0x7b, 0xcb, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0x66, 0x89, 0x45, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x9b, 0x4e, 0x25, -+ 0x36, 0x36, 0x61, 0xdb, 0x6d, 0x64, 0xcb, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xcb, 0x7b, 0xdf, 0xe5, -+ 0x32, 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x28, -+ 0x33, 0xe6, 0x63, 0xdf, 0xc3, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc3, 0x72, 0x81, 0xe7, -+ 0x46, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x3f, 0x2c, 0x36, 0x36, -+ 0x36, 0x36, 0xe8, 0x8f, 0x6d, 0x64, 0xcb, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc3, 0xca, 0x8b, 0xcf, 0x2c, -+ 0x26, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x24, -+ 0x35, 0x96, 0x75, 0xca, 0xc3, 0xcb, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xcb, 0x7b, 0x81, 0xdb, -+ 0x73, 0x3b, 0x44, 0x9b, 0x48, 0x48, 0x48, 0x9b, -+ 0x99, 0x43, 0x94, 0x2c, 0x21, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x73, 0xdb, 0x7a, 0x7b, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0x64, 0x76, 0x7a, 0x91, 0xd5, 0x31, 0x30, -+ 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x24, -+ 0x39, 0x97, 0x75, 0xdf, 0x7b, 0x64, 0xc3, 0xc3, -+ 0xcb, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0x7b, 0x7a, 0xe9, -+ 0xea, 0x36, 0x21, 0x26, 0x2b, 0x39, 0x33, 0x30, -+ 0x23, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x21, 0xea, 0xdd, 0x8b, 0x7b, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc3, 0x64, 0x64, -+ 0x76, 0x85, 0xe0, 0xd5, 0x34, 0x2b, 0x27, 0x28, -+ 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x28, -+ 0x33, 0xeb, 0x63, 0x7e, 0x7a, 0x6d, 0xdf, 0x5b, -+ 0x76, 0x7b, 0x64, 0x64, 0xc3, 0xcb, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xcb, 0x76, 0x85, 0xdb, -+ 0x79, 0x22, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x21, 0xec, 0xdd, 0x75, 0x76, 0xc3, 0xc4, -+ 0xc4, 0xc4, 0xcb, 0xc3, 0x64, 0x76, 0xdf, 0x8b, -+ 0xd6, 0xd5, 0x2f, 0x35, 0x30, 0x24, 0x22, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x23, -+ 0x27, 0x31, 0xed, 0xeb, 0xdd, 0x74, 0x63, 0x90, -+ 0x7e, 0x75, 0x8b, 0x6d, 0xdf, 0x76, 0x64, 0xc3, -+ 0xcb, 0xcb, 0xcb, 0xcb, 0x64, 0x7a, 0x84, 0xee, -+ 0x79, 0xbe, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x21, 0xea, 0xee, 0x63, 0x6d, 0x7b, 0x64, -+ 0xcb, 0xc3, 0x64, 0x7b, 0xdf, 0x75, 0x63, 0x96, -+ 0x38, 0x39, 0x2a, 0x24, 0x23, 0x21, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x28, 0x27, 0x35, 0x2d, 0x41, 0xd5, 0xe7, 0x8f, -+ 0xdb, 0xdd, 0xe9, 0x74, 0x84, 0x90, 0x85, 0x6d, -+ 0x5b, 0x7b, 0x7b, 0xca, 0x6d, 0x90, 0xdb, 0xef, -+ 0xec, 0x22, 0x36, 0x36, 0x28, 0x30, 0x30, 0x30, -+ 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x25, 0x36, -+ 0x36, 0x21, 0xd4, 0x80, 0xe9, 0x7e, 0x6d, 0x76, -+ 0xca, 0x76, 0x6d, 0x85, 0x63, 0xdb, 0xd5, 0x34, -+ 0x33, 0x26, 0x23, 0x21, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x21, 0x23, 0x24, 0x27, 0x2a, 0x35, 0x2e, 0x2f, -+ 0x41, 0xf0, 0xf1, 0x6c, 0x80, 0xee, 0xdb, 0x74, -+ 0x84, 0x90, 0x75, 0x7e, 0x74, 0x8f, 0xef, 0x79, -+ 0xe8, 0x2b, 0x9d, 0x41, 0x2f, 0x34, 0x2d, 0x2d, -+ 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x2f, 0x38, -+ 0x4d, 0x37, 0xf2, 0xf3, 0x8f, 0x74, 0x63, 0x7e, -+ 0x75, 0x7e, 0x63, 0xe9, 0x88, 0xe6, 0x31, 0x2a, -+ 0x24, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x21, 0x22, 0x23, 0x24, 0x26, 0x30, -+ 0x33, 0x39, 0x2e, 0x51, 0x41, 0xd2, 0x6c, 0xf3, -+ 0x80, 0xee, 0xee, 0xee, 0xf4, 0xf3, 0xd7, 0xf5, -+ 0x41, 0x34, 0x35, 0x32, 0x30, 0x27, 0x27, 0x27, -+ 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x30, 0x2a, -+ 0x2b, 0x34, 0xf6, 0xec, 0xf7, 0x8f, 0xdd, 0xe9, -+ 0xe9, 0xdd, 0xee, 0x6c, 0x41, 0x39, 0x27, 0x28, -+ 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x21, 0x22, -+ 0x28, 0x24, 0x26, 0x2a, 0x33, 0x2c, 0x2f, 0x41, -+ 0xf8, 0xd7, 0x79, 0x79, 0x79, 0xec, 0xf9, 0x51, -+ 0x39, 0x30, 0x24, 0x23, 0x22, 0x22, 0x22, 0x22, -+ 0x22, 0x22, 0x21, 0x22, 0x22, 0x22, 0x22, 0x23, -+ 0x24, 0x2a, 0x31, 0xfa, 0xea, 0x79, 0xf3, 0x80, -+ 0xf7, 0xdc, 0xfb, 0x2f, 0x35, 0x26, 0x23, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x21, 0x22, 0x23, 0x28, 0x25, 0x30, 0x2b, -+ 0x31, 0x2f, 0xf6, 0xfa, 0xfa, 0x2f, 0x2e, 0x33, -+ 0x26, 0x23, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x21, 0x28, 0x27, 0x35, 0x34, 0xfa, 0xfa, 0xfa, -+ 0xfc, 0xf6, 0x2e, 0x33, 0x25, 0x23, 0x21, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x21, 0x21, 0x23, 0x28, -+ 0x26, 0x30, 0x32, 0x2b, 0x33, 0x2a, 0x26, 0x28, -+ 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x21, 0x23, 0x25, 0x30, 0x33, 0x35, 0x35, -+ 0x2b, 0x2a, 0x26, 0x28, 0x22, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x21, 0x22, 0x23, 0x28, 0x28, 0x23, 0x22, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x21, 0x23, 0x28, 0x24, 0x24, -+ 0x28, 0x23, 0x22, 0x21, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+}; -+ -+unsigned char linux_logo16[1]; -+ -+#endif /* INCLUDE_LINUX_LOGO_DATA */ -+ -+#include -+ ---- linux/include/asm-nios2nommu/local.h -+++ linux/include/asm-nios2nommu/local.h -@@ -0,0 +1,28 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2NOMMU_LOCAL_H -+#define __NIOS2NOMMU_LOCAL_H -+ -+#include -+ -+#endif /* __NIOS2NOMMU_LOCAL_H */ ---- linux/include/asm-nios2nommu/mc146818rtc.h -+++ linux/include/asm-nios2nommu/mc146818rtc.h -@@ -0,0 +1,29 @@ -+/* -+ * Machine dependent access functions for RTC registers. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef _NIOS2_MC146818RTC_H -+#define _NIOS2_MC146818RTC_H -+ -+/* empty include file to satisfy the include in genrtc.c/ide-geometry.c */ -+ -+#endif /* _NIOS2_MC146818RTC_H */ ---- linux/include/asm-nios2nommu/mman.h -+++ linux/include/asm-nios2nommu/mman.h -@@ -0,0 +1,68 @@ -+/* -+ * Copied from the m68k port. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2_MMAN_H__ -+#define __NIOS2_MMAN_H__ -+ -+#define PROT_READ 0x1 /* page can be read */ -+#define PROT_WRITE 0x2 /* page can be written */ -+#define PROT_EXEC 0x4 /* page can be executed */ -+#define PROT_SEM 0x8 /* page may be used for atomic ops */ -+#define PROT_NONE 0x0 /* page can not be accessed */ -+#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ -+#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ -+ -+#define MAP_SHARED 0x01 /* Share changes */ -+#define MAP_PRIVATE 0x02 /* Changes are private */ -+#define MAP_TYPE 0x0f /* Mask for type of mapping */ -+#define MAP_FIXED 0x10 /* Interpret addr exactly */ -+#define MAP_ANONYMOUS 0x20 /* don't use a file */ -+ -+#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ -+#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ -+#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ -+#define MAP_LOCKED 0x2000 /* pages are locked */ -+#define MAP_NORESERVE 0x4000 /* don't check for reservations */ -+#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ -+#define MAP_NONBLOCK 0x10000 /* do not block on IO */ -+ -+#define MS_ASYNC 1 /* sync memory asynchronously */ -+#define MS_INVALIDATE 2 /* invalidate the caches */ -+#define MS_SYNC 4 /* synchronous memory sync */ -+ -+#define MCL_CURRENT 1 /* lock all current mappings */ -+#define MCL_FUTURE 2 /* lock all future mappings */ -+ -+#define MADV_NORMAL 0x0 /* default page-in behavior */ -+#define MADV_RANDOM 0x1 /* page-in minimum required */ -+#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */ -+#define MADV_WILLNEED 0x3 /* pre-fault pages */ -+#define MADV_DONTNEED 0x4 /* discard these pages */ -+ -+/* compatibility flags */ -+#define MAP_ANON MAP_ANONYMOUS -+#define MAP_FILE 0 -+ -+#endif /* __NIOS2_MMAN_H__ */ -+ ---- linux/include/asm-nios2nommu/mmu_context.h -+++ linux/include/asm-nios2nommu/mmu_context.h -@@ -0,0 +1,58 @@ -+/* -+ * -+ * Taken from the m68knommu. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2NOMMU_MMU_CONTEXT_H -+#define __NIOS2NOMMU_MMU_CONTEXT_H -+ -+#include -+#include -+#include -+#include -+ -+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) -+{ -+} -+ -+extern inline int -+init_new_context(struct task_struct *tsk, struct mm_struct *mm) -+{ -+ // mm->context = virt_to_phys(mm->pgd); -+ return(0); -+} -+ -+#define destroy_context(mm) do { } while(0) -+ -+static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) -+{ -+} -+ -+#define deactivate_mm(tsk,mm) do { } while (0) -+ -+extern inline void activate_mm(struct mm_struct *prev_mm, -+ struct mm_struct *next_mm) -+{ -+} -+ -+#endif ---- linux/include/asm-nios2nommu/mmu.h -+++ linux/include/asm-nios2nommu/mmu.h -@@ -0,0 +1,36 @@ -+/* -+ * -+ * Taken from the m68knommu. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2NOMMU_MMU_H -+#define __NIOS2NOMMU_MMU_H -+ -+/* Copyright (C) 2002, David McCullough */ -+ -+typedef struct { -+ struct vm_list_struct *vmlist; -+ unsigned long end_brk; -+} mm_context_t; -+ -+#endif /* __NIOS2NOMMU_MMU_H */ ---- linux/include/asm-nios2nommu/module.h -+++ linux/include/asm-nios2nommu/module.h -@@ -0,0 +1,36 @@ -+#ifndef _NIOS2_MODULE_H -+#define _NIOS2_MODULE_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/module.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+struct mod_arch_specific -+{ -+}; -+ -+#define Elf_Shdr Elf32_Shdr -+#define Elf_Sym Elf32_Sym -+#define Elf_Ehdr Elf32_Ehdr -+ -+#endif /* _NIOS_MODULE_H */ ---- linux/include/asm-nios2nommu/msgbuf.h -+++ linux/include/asm-nios2nommu/msgbuf.h -@@ -0,0 +1,56 @@ -+/* -+ * Taken from the m68k. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2_MSGBUF_H -+#define _NIOS2_MSGBUF_H -+ -+/* -+ * The msqid64_ds structure for nios2 architecture. -+ * Note extra padding because this structure is passed back and forth -+ * between kernel and user space. -+ * -+ * Pad space is left for: -+ * - 64-bit time_t to solve y2038 problem -+ * - 2 miscellaneous 32-bit values -+ */ -+ -+struct msqid64_ds { -+ struct ipc64_perm msg_perm; -+ __kernel_time_t msg_stime; /* last msgsnd time */ -+ unsigned long __unused1; -+ __kernel_time_t msg_rtime; /* last msgrcv time */ -+ unsigned long __unused2; -+ __kernel_time_t msg_ctime; /* last change time */ -+ unsigned long __unused3; -+ unsigned long msg_cbytes; /* current number of bytes on queue */ -+ unsigned long msg_qnum; /* number of messages in queue */ -+ unsigned long msg_qbytes; /* max number of bytes on queue */ -+ __kernel_pid_t msg_lspid; /* pid of last msgsnd */ -+ __kernel_pid_t msg_lrpid; /* last receive pid */ -+ unsigned long __unused4; -+ unsigned long __unused5; -+}; -+ -+#endif /* _NIOS2_MSGBUF_H */ -+ ---- linux/include/asm-nios2nommu/namei.h -+++ linux/include/asm-nios2nommu/namei.h -@@ -0,0 +1,36 @@ -+/* -+ * linux/include/asm-nios/namei.h -+ * Moved from m68k version -+ * Included from linux/fs/namei.c -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2_NAMEI_H -+#define __NIOS2_NAMEI_H -+ -+/* This dummy routine maybe changed to something useful -+ * for /usr/gnemul/ emulation stuff. -+ * Look at asm-sparc/namei.h for details. -+ */ -+ -+#define __emul_prefix() NULL -+ -+#endif ---- linux/include/asm-nios2nommu/ndma.h -+++ linux/include/asm-nios2nommu/ndma.h -@@ -0,0 +1,64 @@ -+#ifndef __NDMA_H__ -+ #define __NDMA_H__ -+ -+ #ifndef __ASSEMBLY__ -+ -+// DMA Registers -+typedef volatile struct -+{ -+ int np_dmastatus; // status register -+ int np_dmareadaddress; // read address -+ int np_dmawriteaddress; // write address -+ int np_dmalength; // length in bytes -+ int np_dmareserved1; // reserved -+ int np_dmareserved2; // reserved -+ int np_dmacontrol; // control register -+ int np_dmareserved3; // control register alternate -+} np_dma; -+ -+// DMA Register Bits -+enum -+{ -+ np_dmacontrol_byte_bit = 0, // Byte transaction -+ np_dmacontrol_hw_bit = 1, // Half-word transaction -+ np_dmacontrol_word_bit = 2, // Word transaction -+ np_dmacontrol_go_bit = 3, // enable execution -+ np_dmacontrol_i_en_bit = 4, // enable interrupt -+ np_dmacontrol_reen_bit = 5, // Enable read end-of-packet -+ np_dmacontrol_ween_bit = 6, // Enable write end-of-packet -+ np_dmacontrol_leen_bit = 7, // Enable length=0 transaction end -+ np_dmacontrol_rcon_bit = 8, // Read from a fixed address -+ np_dmacontrol_wcon_bit = 9, // Write to a fixed address -+ np_dmacontrol_doubleword_bit = 10, // Double-word transaction -+ np_dmacontrol_quadword_bit = 11, // Quad-word transaction -+ -+ np_dmastatus_done_bit = 0, // 1 when done. Status write clears. -+ np_dmastatus_busy_bit = 1, // 1 when busy. -+ np_dmastatus_reop_bit = 2, // read-eop received -+ np_dmastatus_weop_bit = 3, // write-eop received -+ np_dmastatus_len_bit = 4, // requested length transacted -+ -+ np_dmacontrol_byte_mask = (1 << 0), // Byte transaction -+ np_dmacontrol_hw_mask = (1 << 1), // Half-word transaction -+ np_dmacontrol_word_mask = (1 << 2), // Word transaction -+ np_dmacontrol_go_mask = (1 << 3), // enable execution -+ np_dmacontrol_i_en_mask = (1 << 4), // enable interrupt -+ np_dmacontrol_reen_mask = (1 << 5), // Enable read end-of-packet -+ np_dmacontrol_ween_mask = (1 << 6), // Enable write end-of-packet -+ np_dmacontrol_leen_mask = (1 << 7), // Enable length=0 transaction end -+ np_dmacontrol_rcon_mask = (1 << 8), // Read from a fixed address -+ np_dmacontrol_wcon_mask = (1 << 9), // Write to a fixed address -+ np_dmacontrol_doubleword_mask = (1 << 10), // Double-word transaction -+ np_dmacontrol_quadword_mask = (1 << 11), // Quad-word transaction -+ -+ np_dmastatus_done_mask = (1 << 0), // 1 when done. Status write clears. -+ np_dmastatus_busy_mask = (1 << 1), // 1 when busy. -+ np_dmastatus_reop_mask = (1 << 2), // read-eop received -+ np_dmastatus_weop_mask = (1 << 3), // write-eop received -+ np_dmastatus_len_mask = (1 << 4), // requested length transacted -+}; -+ -+ #endif /* __ASSEMBLY__ */ -+ -+#endif -+/* End of File */ ---- linux/include/asm-nios2nommu/nios.h -+++ linux/include/asm-nios2nommu/nios.h -@@ -0,0 +1,7 @@ -+#ifndef __NIOS_H__ -+#define __NIOS_H__ -+ -+#include "nios2_system.h" -+ -+#endif -+ ---- linux/include/asm-nios2nommu/page.h -+++ linux/include/asm-nios2nommu/page.h -@@ -0,0 +1,135 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2_PAGE_H -+#define _NIOS2_PAGE_H -+ -+/* copied from m68knommu arch */ -+// #include -+ -+/* PAGE_SHIFT determines the page size */ -+ -+#define PAGE_SHIFT (12) -+#define PAGE_SIZE (1UL << PAGE_SHIFT) -+#define PAGE_MASK (~(PAGE_SIZE-1)) -+ -+#ifdef __KERNEL__ -+ -+#include -+ -+#if PAGE_SHIFT < 13 -+#define THREAD_SIZE (8192) -+#else -+#define THREAD_SIZE PAGE_SIZE -+#endif -+ -+#ifndef __ASSEMBLY__ -+ -+#define get_user_page(vaddr) __get_free_page(GFP_KERNEL) -+#define free_user_page(page, addr) free_page(addr) -+ -+#define clear_page(page) memset((page), 0, PAGE_SIZE) -+#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE) -+ -+#define clear_user_page(page, vaddr, pg) clear_page(page) -+#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) -+ -+/* -+ * These are used to make use of C type-checking.. -+ */ -+typedef struct { unsigned long pte; } pte_t; -+typedef struct { unsigned long pmd[16]; } pmd_t; -+typedef struct { unsigned long pgd; } pgd_t; -+typedef struct { unsigned long pgprot; } pgprot_t; -+ -+#define pte_val(x) ((x).pte) -+#define pmd_val(x) ((&x)->pmd[0]) -+#define pgd_val(x) ((x).pgd) -+#define pgprot_val(x) ((x).pgprot) -+ -+#define __pte(x) ((pte_t) { (x) } ) -+#define __pmd(x) ((pmd_t) { (x) } ) -+#define __pgd(x) ((pgd_t) { (x) } ) -+#define __pgprot(x) ((pgprot_t) { (x) } ) -+ -+/* to align the pointer to the (next) page boundary */ -+#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) -+ -+/* Pure 2^n version of get_order */ -+extern __inline__ int get_order(unsigned long size) -+{ -+ int order; -+ -+ size = (size-1) >> (PAGE_SHIFT-1); -+ order = -1; -+ do { -+ size >>= 1; -+ order++; -+ } while (size); -+ return order; -+} -+ -+extern unsigned long memory_start; -+extern unsigned long memory_end; -+ -+#endif /* !__ASSEMBLY__ */ -+#include -+#define PAGE_OFFSET ((int)(nasys_program_mem)) -+ -+#ifndef __ASSEMBLY__ -+ -+#define __pa(vaddr) virt_to_phys((void *)vaddr) -+#define __va(paddr) phys_to_virt((unsigned long)paddr) -+ -+#define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT) -+ -+#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) -+#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) -+ -+#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) -+#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) -+#define VALID_PAGE(page) ((page - mem_map) < max_mapnr) -+ -+#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn)) -+#define page_to_pfn(page) virt_to_pfn(page_to_virt(page)) -+ -+#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ -+ ((void *)(kaddr) < (void *)memory_end)) -+ -+#ifdef CONFIG_NO_KERNEL_MSG -+#define BUG_PRINT() -+#else -+#define BUG_PRINT() printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__) -+#endif -+ -+#ifdef na_cpu_oci_core -+#define BUG_PANIC() asm volatile ("break") /* drop to debugger */ -+#else -+// #define BUG_PANIC() while(1) -+#define BUG_PANIC() panic("BUG!") -+#endif -+ -+#endif /* __ASSEMBLY__ */ -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _NIOS2_PAGE_H */ ---- linux/include/asm-nios2nommu/param.h -+++ linux/include/asm-nios2nommu/param.h -@@ -0,0 +1,49 @@ -+#ifndef _NIOS_PARAM_H -+#define _NIOS_PARAM_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/param.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#ifndef HZ -+#define HZ 100 -+#endif -+ -+#ifdef __KERNEL__ -+#define USER_HZ HZ -+#define CLOCKS_PER_SEC (USER_HZ) -+#endif -+ -+#define EXEC_PAGESIZE 4096 -+ -+#ifndef NGROUPS -+#define NGROUPS 32 -+#endif -+ -+#ifndef NOGROUP -+#define NOGROUP (-1) -+#endif -+ -+#define MAXHOSTNAMELEN 64 /* max length of hostname */ -+ -+#endif ---- linux/include/asm-nios2nommu/pci.h -+++ linux/include/asm-nios2nommu/pci.h -@@ -0,0 +1,75 @@ -+#ifndef _ASM_NIOS2NOMMU_PCI_H -+#define _ASM_NIOS2NOMMU_PCI_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/pci.h -+ * -+ * Derived from asm-m68k/pci_m68k.h -+ * - m68k specific PCI declarations, by Wout Klaren. -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+struct pci_ops; -+ -+/* -+ * Structure with hardware dependent information and functions of the -+ * PCI bus. -+ */ -+ -+struct pci_bus_info -+{ -+ /* -+ * Resources of the PCI bus. -+ */ -+ -+ struct resource mem_space; -+ struct resource io_space; -+ -+ /* -+ * System dependent functions. -+ */ -+ -+ struct pci_ops *m68k_pci_ops; -+ -+ void (*fixup)(int pci_modify); -+ void (*conf_device)(struct pci_dev *dev); -+}; -+ -+#define pcibios_assign_all_busses() 0 -+ -+extern inline void pcibios_set_master(struct pci_dev *dev) -+{ -+ /* No special bus mastering setup handling */ -+} -+ -+extern inline void pcibios_penalize_isa_irq(int irq) -+{ -+ /* We don't do dynamic PCI IRQ allocation */ -+} -+ -+/* The PCI address space does equal the physical memory -+ * address space. The networking and block device layers use -+ * this boolean for bounce buffer decisions. -+ */ -+#define PCI_DMA_BUS_IS_PHYS (1) -+ -+#endif /* _ASM_NIOS2NOMMU_PCI_H */ ---- linux/include/asm-nios2nommu/percpu.h -+++ linux/include/asm-nios2nommu/percpu.h -@@ -0,0 +1,30 @@ -+#ifndef __ARCH_NIOS2NOMMU_PERCPU__ -+#define __ARCH_NIOS2NOMMU_PERCPU__ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/percpu.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#endif /* __ARCH_NIOS2NOMMU_PERCPU__ */ ---- linux/include/asm-nios2nommu/pgalloc.h -+++ linux/include/asm-nios2nommu/pgalloc.h -@@ -0,0 +1,32 @@ -+#ifndef _NIOS2NOMMU_PGALLOC_H -+#define _NIOS2NOMMU_PGALLOC_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/pgalloc.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#define check_pgt_cache() do { } while (0) -+ -+#endif /* _NIOS2NOMMU_PGALLOC_H */ ---- linux/include/asm-nios2nommu/pgtable.h -+++ linux/include/asm-nios2nommu/pgtable.h -@@ -0,0 +1,104 @@ -+#ifndef _NIOS_PGTABLE_H -+#define _NIOS_PGTABLE_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/pgtable.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+#include -+ -+//vic - this bit copied from m68knommu version -+// #include -+#include -+#include -+ -+typedef pte_t *pte_addr_t; -+ -+#define pgd_present(pgd) (1) /* pages are always present on NO_MM */ -+#define pgd_none(pgd) (0) -+#define pgd_bad(pgd) (0) -+#define pgd_clear(pgdp) -+#define kern_addr_valid(addr) (1) -+#define pmd_offset(a, b) ((void *)0) -+ -+#define PAGE_NONE __pgprot(0) /* these mean nothing to NO_MM */ -+#define PAGE_SHARED __pgprot(0) /* these mean nothing to NO_MM */ -+#define PAGE_COPY __pgprot(0) /* these mean nothing to NO_MM */ -+#define PAGE_READONLY __pgprot(0) /* these mean nothing to NO_MM */ -+#define PAGE_KERNEL __pgprot(0) /* these mean nothing to NO_MM */ -+//vic - this bit copied from m68knommu version -+ -+extern void paging_init(void); -+#define swapper_pg_dir ((pgd_t *) 0) -+ -+#define __swp_type(x) (0) -+#define __swp_offset(x) (0) -+#define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) }) -+#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) -+#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) -+ -+static inline int pte_file(pte_t pte) { return 0; } -+ -+/* -+ * ZERO_PAGE is a global shared page that is always zero: used -+ * for zero-mapped memory areas etc.. -+ */ -+#define ZERO_PAGE(vaddr) (virt_to_page(0)) -+ -+extern unsigned int kobjsize(const void *objp); -+extern int is_in_rom(unsigned long); -+ -+/* -+ * No page table caches to initialise -+ */ -+#define pgtable_cache_init() do { } while (0) -+#define io_remap_page_range(vma, vaddr, paddr, size, prot) \ -+ remap_pfn_range(vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot) -+ -+extern inline void flush_cache_mm(struct mm_struct *mm) -+{ -+} -+ -+extern inline void flush_cache_range(struct mm_struct *mm, -+ unsigned long start, -+ unsigned long end) -+{ -+} -+ -+/* Push the page at kernel virtual address and clear the icache */ -+extern inline void flush_page_to_ram (unsigned long address) -+{ -+} -+ -+/* Push n pages at kernel virtual address and clear the icache */ -+extern inline void flush_pages_to_ram (unsigned long address, int n) -+{ -+} -+ -+/* -+ * All 32bit addresses are effectively valid for vmalloc... -+ * Sort of meaningless for non-VM targets. -+ */ -+#define VMALLOC_START 0 -+#define VMALLOC_END 0xffffffff -+ -+#endif /* _NIOS_PGTABLE_H */ ---- linux/include/asm-nios2nommu/pio_struct.h -+++ linux/include/asm-nios2nommu/pio_struct.h -@@ -0,0 +1,14 @@ -+// PIO Peripheral -+ -+// PIO Registers -+typedef volatile struct -+ { -+ int np_piodata; // read/write, up to 32 bits -+ int np_piodirection; // write/readable, up to 32 bits, 1->output bit -+ int np_piointerruptmask; // write/readable, up to 32 bits, 1->enable interrupt -+ int np_pioedgecapture; // read, up to 32 bits, cleared by any write -+ } np_pio; -+ -+// PIO Routines -+void nr_pio_showhex(int value); // shows low byte on pio named na_seven_seg_pio -+ ---- linux/include/asm-nios2nommu/poll.h -+++ linux/include/asm-nios2nommu/poll.h -@@ -0,0 +1,46 @@ -+#ifndef __NIOS2_POLL_H -+#define __NIOS2_POLL_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/poll.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#define POLLIN 1 -+#define POLLPRI 2 -+#define POLLOUT 4 -+#define POLLERR 8 -+#define POLLHUP 16 -+#define POLLNVAL 32 -+#define POLLRDNORM 64 -+#define POLLWRNORM POLLOUT -+#define POLLRDBAND 128 -+#define POLLWRBAND 256 -+#define POLLMSG 0x0400 -+ -+struct pollfd { -+ int fd; -+ short events; -+ short revents; -+}; -+ -+#endif ---- linux/include/asm-nios2nommu/posix_types.h -+++ linux/include/asm-nios2nommu/posix_types.h -@@ -0,0 +1,89 @@ -+#ifndef __ARCH_NIOS2_POSIX_TYPES_H -+#define __ARCH_NIOS2_POSIX_TYPES_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/posix_types.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* -+ * This file is generally used by user-level software, so you need to -+ * be a little careful about namespace pollution etc. Also, we cannot -+ * assume GCC is being used. -+ */ -+ -+typedef unsigned long __kernel_ino_t; -+typedef unsigned short __kernel_mode_t; -+typedef unsigned short __kernel_nlink_t; -+typedef long __kernel_off_t; -+typedef int __kernel_pid_t; -+typedef unsigned short __kernel_ipc_pid_t; -+typedef unsigned short __kernel_uid_t; -+typedef unsigned short __kernel_gid_t; -+typedef unsigned int __kernel_size_t; -+typedef int __kernel_ssize_t; -+typedef int __kernel_ptrdiff_t; -+typedef long __kernel_time_t; -+typedef long __kernel_suseconds_t; -+typedef long __kernel_clock_t; -+typedef int __kernel_timer_t; -+typedef int __kernel_clockid_t; -+typedef int __kernel_daddr_t; -+typedef char * __kernel_caddr_t; -+typedef unsigned short __kernel_uid16_t; -+typedef unsigned short __kernel_gid16_t; -+typedef unsigned int __kernel_uid32_t; -+typedef unsigned int __kernel_gid32_t; -+ -+typedef unsigned short __kernel_old_uid_t; -+typedef unsigned short __kernel_old_gid_t; -+typedef unsigned short __kernel_old_dev_t; -+ -+#ifdef __GNUC__ -+typedef long long __kernel_loff_t; -+#endif -+ -+typedef struct { -+#if defined(__KERNEL__) || defined(__USE_ALL) -+ int val[2]; -+#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */ -+ int __val[2]; -+#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */ -+} __kernel_fsid_t; -+ -+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) -+ -+#undef __FD_SET -+#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) -+ -+#undef __FD_CLR -+#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) -+ -+#undef __FD_ISSET -+#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) -+ -+#undef __FD_ZERO -+#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp))) -+ -+#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ -+ -+#endif ---- linux/include/asm-nios2nommu/preem_latency.h -+++ linux/include/asm-nios2nommu/preem_latency.h -@@ -0,0 +1,39 @@ -+#ifndef _ASM_PREEM_LATENCY_H -+#define _ASM_PREEM_LATENCY_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/preem_latency.h -+ * -+ * timing support for preempt-stats patch -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#define readclock(low) \ -+do {\ -+ *(volatile unsigned long *)na_Counter_64_bit=1; \ -+ low=*(volatile unsigned long *)na_Counter_64_bit; \ -+} while (0) -+#define readclock_init() -+ -+#endif /* _ASM_PREEM_LATENCY_H */ ---- linux/include/asm-nios2nommu/processor.h -+++ linux/include/asm-nios2nommu/processor.h -@@ -0,0 +1,148 @@ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/processor.h -+ * -+ * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) -+ * Copyright (C) 2001 Ken Hill (khill@microtronix.com) -+ * Vic Phillips (vic@microtronix.com) -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * hacked from: -+ * include/asm-sparc/processor.h -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * Nov/02/2003 dgt Fix task_size -+ * -+ ---------------------------------------------------------------------*/ -+ -+#ifndef __ASM_NIOS_PROCESSOR_H -+#define __ASM_NIOS_PROCESSOR_H -+ -+#define NIOS2_FLAG_KTHREAD 0x00000001 /* task is a kernel thread */ -+#define NIOS2_FLAG_COPROC 0x00000002 /* Thread used coprocess */ -+#define NIOS2_FLAG_DEBUG 0x00000004 /* task is being debugged */ -+ -+#define NIOS2_OP_NOP 0x1883a -+#define NIOS2_OP_BREAK 0x3da03a -+ -+#ifndef __ASSEMBLY__ -+ -+/* -+ * Default implementation of macro that returns current -+ * instruction pointer ("program counter"). -+ */ -+#define current_text_addr() ({ __label__ _l; _l: &&_l;}) -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include /* for get_hi_limit */ -+ -+/* -+ * Bus types -+ */ -+#define EISA_bus 0 -+#define EISA_bus__is_a_macro /* for versions in ksyms.c */ -+#define MCA_bus 0 -+#define MCA_bus__is_a_macro /* for versions in ksyms.c */ -+ -+/* -+ * The nios has no problems with write protection -+ */ -+#define wp_works_ok 1 -+#define wp_works_ok__is_a_macro /* for versions in ksyms.c */ -+ -+/* Whee, this is STACK_TOP and the lowest kernel address too... */ -+#if 0 -+#define KERNBASE 0x00000000 /* First address the kernel will eventually be */ -+#define TASK_SIZE (KERNBASE) -+#define MAX_USER_ADDR TASK_SIZE -+#define MMAP_SEARCH_START (TASK_SIZE/3) -+#endif -+ -+#define TASK_SIZE ((unsigned int) nasys_program_mem_end) //...this is better... -+ -+/* -+ * This decides where the kernel will search for a free chunk of vm -+ * space during mmap's. We won't be using it -+ */ -+#define TASK_UNMAPPED_BASE 0 -+ -+/* The Nios processor specific thread struct. */ -+struct thread_struct { -+ struct pt_regs *kregs; -+ -+ /* For signal handling */ -+ unsigned long sig_address; -+ unsigned long sig_desc; -+ -+ /* Context switch saved kernel state. */ -+ unsigned long ksp; -+ unsigned long kpsr; -+ unsigned long kesr; -+ -+ /* Flags are defined below */ -+ -+ unsigned long flags; -+ int current_ds; -+ struct exec core_exec; /* just what it says. */ -+}; -+ -+#define INIT_MMAP { &init_mm, (0), (0), \ -+ __pgprot(0x0) , VM_READ | VM_WRITE | VM_EXEC } -+ -+#define INIT_THREAD { \ -+ .kregs = 0, \ -+ .sig_address = 0, \ -+ .sig_desc = 0, \ -+ .ksp = 0, \ -+ .kpsr = 0, \ -+ .kesr = PS_S, \ -+ .flags = NIOS2_FLAG_KTHREAD, \ -+ .current_ds = __KERNEL_DS, \ -+ .core_exec = INIT_EXEC \ -+} -+ -+/* Free all resources held by a thread. */ -+extern void release_thread(struct task_struct *); -+ -+extern unsigned long thread_saved_pc(struct task_struct *t); -+ -+extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp); -+ -+/* Prepare to copy thread state - unlazy all lazy status */ -+#define prepare_to_copy(tsk) do { } while (0) -+ -+extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); -+ -+unsigned long get_wchan(struct task_struct *p); -+ -+#define KSTK_EIP(tsk) ((tsk)->thread.kregs->ea) -+#define KSTK_ESP(tsk) ((tsk)->thread.kregs->sp) -+ -+#ifdef __KERNEL__ -+/* Allocation and freeing of basic task resources. */ -+ -+//;dgt2;#define alloc_task_struct() ((struct task_struct *) xx..see..linux..fork..xx __get_free_pages(GFP_KERNEL,1)) -+//;dgt2;#define get_task_struct(tsk) xx..see..linux..sched.h...atomic_inc(&mem_map[MAP_NR(tsk)].count) -+ -+#endif -+ -+#define cpu_relax() do { } while (0) -+#endif /* __ASSEMBLY__ */ -+#endif /* __ASM_NIOS_PROCESSOR_H */ ---- linux/include/asm-nios2nommu/ptrace.h -+++ linux/include/asm-nios2nommu/ptrace.h -@@ -0,0 +1,141 @@ -+/* -+ * Taken from the m68k port. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef _NIOS2NOMMU_PTRACE_H -+#define _NIOS2NOMMU_PTRACE_H -+ -+#ifndef __ASSEMBLY__ -+ -+#define PTR_R0 0 -+#define PTR_R1 1 -+#define PTR_R2 2 -+#define PTR_R3 3 -+#define PTR_R4 4 -+#define PTR_R5 5 -+#define PTR_R6 6 -+#define PTR_R7 7 -+#define PTR_R8 8 -+#define PTR_R9 9 -+#define PTR_R10 10 -+#define PTR_R11 11 -+#define PTR_R12 12 -+#define PTR_R13 13 -+#define PTR_R14 14 -+#define PTR_R15 15 -+#define PTR_R16 16 -+#define PTR_R17 17 -+#define PTR_R18 18 -+#define PTR_R19 19 -+#define PTR_R20 20 -+#define PTR_R21 21 -+#define PTR_R22 22 -+#define PTR_R23 23 -+#define PTR_R24 24 -+#define PTR_R25 25 -+#define PTR_GP 26 -+#define PTR_SP 27 -+#define PTR_FP 28 -+#define PTR_EA 29 -+#define PTR_BA 30 -+#define PTR_RA 31 -+#define PTR_STATUS 32 -+#define PTR_ESTATUS 33 -+#define PTR_BSTATUS 34 -+#define PTR_IENABLE 35 -+#define PTR_IPENDING 36 -+ -+/* this struct defines the way the registers are stored on the -+ stack during a system call. -+ -+ There is a fake_regs in setup.c that has to match pt_regs.*/ -+ -+struct pt_regs { -+ unsigned long r8; -+ unsigned long r9; -+ unsigned long r10; -+ unsigned long r11; -+ unsigned long r12; -+ unsigned long r13; -+ unsigned long r14; -+ unsigned long r15; -+ unsigned long r1; -+ unsigned long r2; -+ unsigned long r3; -+ unsigned long r4; -+ unsigned long r5; -+ unsigned long r6; -+ unsigned long r7; -+ unsigned long orig_r2; -+ unsigned long ra; -+ unsigned long fp; -+ unsigned long sp; -+ unsigned long gp; -+ unsigned long estatus; -+ unsigned long status_extension; -+ unsigned long ea; -+}; -+ -+ -+/* -+ * This is the extended stack used by signal handlers and the context -+ * switcher: it's pushed after the normal "struct pt_regs". -+ */ -+struct switch_stack { -+ unsigned long r16; -+ unsigned long r17; -+ unsigned long r18; -+ unsigned long r19; -+ unsigned long r20; -+ unsigned long r21; -+ unsigned long r22; -+ unsigned long r23; -+ unsigned long fp; -+ unsigned long gp; -+ unsigned long ra; -+}; -+ -+/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ -+#define PTRACE_GETREGS 12 -+#define PTRACE_SETREGS 13 -+#ifdef CONFIG_FPU -+#define PTRACE_GETFPREGS 14 -+#define PTRACE_SETFPREGS 15 -+#endif -+ -+#ifdef __KERNEL__ -+ -+#ifndef PS_S -+#define PS_S (0x00000001) -+#endif -+#ifndef PS_T -+#define PS_T (0x00000002) -+#endif -+ -+#define user_mode(regs) (!((regs)->status_extension & PS_S)) -+#define instruction_pointer(regs) ((regs)->ra) -+#define profile_pc(regs) instruction_pointer(regs) -+extern void show_regs(struct pt_regs *); -+ -+#endif /* __KERNEL__ */ -+#endif /* __ASSEMBLY__ */ -+#endif /* _NIOS2NOMMU_PTRACE_H */ ---- linux/include/asm-nios2nommu/resource.h -+++ linux/include/asm-nios2nommu/resource.h -@@ -0,0 +1,73 @@ -+#ifndef _NIOS2NOMMU_RESOURCE_H -+#define _NIOS2NOMMU_RESOURCE_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * Resource limits -+ * -+ * include/asm-nios2nommu/resource.h -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#define RLIMIT_CPU 0 /* CPU time in ms */ -+#define RLIMIT_FSIZE 1 /* Maximum filesize */ -+#define RLIMIT_DATA 2 /* max data size */ -+#define RLIMIT_STACK 3 /* max stack size */ -+#define RLIMIT_CORE 4 /* max core file size */ -+#define RLIMIT_RSS 5 /* max resident set size */ -+#define RLIMIT_NPROC 6 /* max number of processes */ -+#define RLIMIT_NOFILE 7 /* max number of open files */ -+#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */ -+#define RLIMIT_AS 9 /* address space limit */ -+#define RLIMIT_LOCKS 10 /* maximum file locks held */ -+#define RLIMIT_SIGPENDING 11 /* max number of pending signals */ -+#define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */ -+ -+#define RLIM_NLIMITS 13 -+ -+/* -+ * SuS says limits have to be unsigned. -+ * Which makes a ton more sense anyway. -+ */ -+#define RLIM_INFINITY (~0UL) -+ -+#ifdef __KERNEL__ -+ -+#define INIT_RLIMITS \ -+{ \ -+ { RLIM_INFINITY, RLIM_INFINITY }, \ -+ { RLIM_INFINITY, RLIM_INFINITY }, \ -+ { RLIM_INFINITY, RLIM_INFINITY }, \ -+ { _STK_LIM, RLIM_INFINITY }, \ -+ { 0, RLIM_INFINITY }, \ -+ { RLIM_INFINITY, RLIM_INFINITY }, \ -+ { 0, 0 }, \ -+ { INR_OPEN, INR_OPEN }, \ -+ { MLOCK_LIMIT, MLOCK_LIMIT }, \ -+ { RLIM_INFINITY, RLIM_INFINITY }, \ -+ { RLIM_INFINITY, RLIM_INFINITY }, \ -+ { MAX_SIGPENDING, MAX_SIGPENDING }, \ -+ { MQ_BYTES_MAX, MQ_BYTES_MAX }, \ -+} -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _NIOS2NOMMU_RESOURCE_H */ ---- linux/include/asm-nios2nommu/rmap.h -+++ linux/include/asm-nios2nommu/rmap.h -@@ -0,0 +1,2 @@ -+/* Do not need anything here */ -+ ---- linux/include/asm-nios2nommu/scatterlist.h -+++ linux/include/asm-nios2nommu/scatterlist.h -@@ -0,0 +1,42 @@ -+#ifndef _NIOS2NOMMU_SCATTERLIST_H -+#define _NIOS2NOMMU_SCATTERLIST_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/scatterlist.h -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+#include -+ -+struct scatterlist { -+ struct page *page; -+ unsigned int offset; -+ dma_addr_t dma_address; -+ unsigned int length; -+}; -+ -+#define sg_address(sg) (page_address((sg)->page) + (sg)->offset -+#define sg_dma_address(sg) ((sg)->dma_address) -+#define sg_dma_len(sg) ((sg)->length) -+ -+#define ISA_DMA_THRESHOLD (0xffffffff) -+ -+#endif /* !(_NIOS2NOMMU_SCATTERLIST_H) */ ---- linux/include/asm-nios2nommu/sections.h -+++ linux/include/asm-nios2nommu/sections.h -@@ -0,0 +1,30 @@ -+#ifndef _NIOS2NOMMU_SECTIONS_H -+#define _NIOS2NOMMU_SECTIONS_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/sections.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#endif /* _NIOS2NOMMU_SECTIONS_H */ ---- linux/include/asm-nios2nommu/segment.h -+++ linux/include/asm-nios2nommu/segment.h -@@ -0,0 +1,75 @@ -+#ifndef _NIOS2NOMMU_SEGMENT_H -+#define _NIOS2NOMMU_SEGMENT_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/segment.h -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* define constants */ -+/* Address spaces (FC0-FC2) */ -+#define USER_DATA (1) -+#ifndef __USER_DS -+#define __USER_DS (USER_DATA) -+#endif -+#define USER_PROGRAM (2) -+#define SUPER_DATA (5) -+#ifndef __KERNEL_DS -+#define __KERNEL_DS (SUPER_DATA) -+#endif -+#define SUPER_PROGRAM (6) -+#define CPU_SPACE (7) -+ -+#ifndef __ASSEMBLY__ -+ -+typedef struct { -+ unsigned long seg; -+} mm_segment_t; -+ -+#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) -+#define USER_DS MAKE_MM_SEG(__USER_DS) -+#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS) -+ -+/* -+ * Get/set the SFC/DFC registers for MOVES instructions -+ */ -+ -+static inline mm_segment_t get_fs(void) -+{ -+ return USER_DS; -+} -+ -+static inline mm_segment_t get_ds(void) -+{ -+ /* return the supervisor data space code */ -+ return KERNEL_DS; -+} -+ -+static inline void set_fs(mm_segment_t val) -+{ -+} -+ -+#define segment_eq(a,b) ((a).seg == (b).seg) -+ -+#endif /* __ASSEMBLY__ */ -+ -+#endif /* _NIOS2NOMMU_SEGMENT_H */ ---- linux/include/asm-nios2nommu/semaphore.h -+++ linux/include/asm-nios2nommu/semaphore.h -@@ -0,0 +1,155 @@ -+#ifndef _NIOS2NOMMU_SEMAPHORE_H -+#define _NIOS2NOMMU_SEMAPHORE_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/semaphore.h -+ * -+ * Interrupt-safe semaphores.. -+ * -+ * Derived from M68knommu -+ * -+ * (C) Copyright 1996 Linus Torvalds -+ * m68k version by Andreas Schwab -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+#define RW_LOCK_BIAS 0x01000000 -+ -+#ifndef __ASSEMBLY__ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+struct semaphore { -+ atomic_t count; -+ atomic_t waking; -+ wait_queue_head_t wait; -+}; -+ -+#define __SEMAPHORE_INITIALIZER(name, n) \ -+{ \ -+ .count = ATOMIC_INIT(n), \ -+ .waking = ATOMIC_INIT(0), \ -+ .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ -+} -+ -+#define __MUTEX_INITIALIZER(name) \ -+ __SEMAPHORE_INITIALIZER(name,1) -+ -+#define __DECLARE_SEMAPHORE_GENERIC(name,count) \ -+ struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) -+ -+#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -+#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) -+ -+extern inline void sema_init (struct semaphore *sem, int val) -+{ -+ *sem = (struct semaphore)__SEMAPHORE_INITIALIZER(*sem, val); -+} -+ -+static inline void init_MUTEX (struct semaphore *sem) -+{ -+ sema_init(sem, 1); -+} -+ -+static inline void init_MUTEX_LOCKED (struct semaphore *sem) -+{ -+ sema_init(sem, 0); -+} -+ -+asmlinkage void __down(struct semaphore * sem); -+asmlinkage int __down_interruptible(struct semaphore * sem); -+asmlinkage int __down_trylock(struct semaphore * sem); -+asmlinkage void __up(struct semaphore * sem); -+ -+asmlinkage void __down_failed(void /* special register calling convention */); -+asmlinkage int __down_failed_interruptible(void /* params in registers */); -+asmlinkage int __down_failed_trylock(void /* params in registers */); -+asmlinkage void __up_wakeup(void /* special register calling convention */); -+ -+extern spinlock_t semaphore_wake_lock; -+ -+/* -+ * This is ugly, but we want the default case to fall through. -+ * "down_failed" is a special asm handler that calls the C -+ * routine that actually waits. -+ */ -+extern inline void down(struct semaphore * sem) -+{ -+ might_sleep(); -+ -+ #if 0 -+ ...Nios2 has no atomic "decrement memory".... -+ #else -+ if (atomic_dec_return(&sem->count) < 0) -+ __down(sem); -+ #endif -+} -+ -+extern inline int down_interruptible(struct semaphore * sem) -+{ -+ int ret = 0; -+ -+ -+ might_sleep(); -+ -+ #if 0 -+ ...Nios2 has no atomic "decrement memory".... -+ #else -+ if(atomic_dec_return(&sem->count) < 0) -+ ret = __down_interruptible(sem); -+ return ret; -+ #endif -+} -+ -+extern inline int down_trylock(struct semaphore * sem) -+{ -+ #if 0 -+ ...Nios2 has no atomic "decrement memory".... -+ #else -+ int ret = 0; -+ -+ if (atomic_dec_return (&sem->count) < 0) -+ ret = __down_trylock(sem); -+ return ret; -+ #endif -+} -+ -+/* -+ * Note! This is subtle. We jump to wake people up only if -+ * the semaphore was negative (== somebody was waiting on it). -+ * The default case (no contention) will result in NO -+ * jumps for both down() and up(). -+ */ -+extern inline void up(struct semaphore * sem) -+{ -+ #if 0 -+ ...Nios2 has no atomic "increment memory".... -+ #else -+ if (atomic_inc_return(&sem->count) <= 0) -+ __up(sem); -+ #endif -+} -+ -+#endif /* __ASSEMBLY__ */ -+ -+#endif ---- linux/include/asm-nios2nommu/semaphore-helper.h -+++ linux/include/asm-nios2nommu/semaphore-helper.h -@@ -0,0 +1,101 @@ -+#ifndef _NIOS2NOMMU_SEMAPHORE_HELPER_H -+#define _NIOS2NOMMU_SEMAPHORE_HELPER_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/semaphore.h -+ * -+ * SMP- and interrupt-safe semaphores helper functions. -+ * -+ * Derived from M68knommu -+ * -+ * (C) Copyright 1996 Linus Torvalds -+ * m68k version by Andreas Schwab -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+// #include -+ -+/* -+ * These two _must_ execute atomically wrt each other. -+ */ -+static inline void wake_one_more(struct semaphore * sem) -+{ -+ atomic_inc(&sem->waking); -+} -+ -+static inline int waking_non_zero(struct semaphore *sem) -+{ -+ int ret; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&semaphore_wake_lock, flags); -+ ret = 0; -+ if (atomic_read(&sem->waking) > 0) { -+ atomic_dec(&sem->waking); -+ ret = 1; -+ } -+ spin_unlock_irqrestore(&semaphore_wake_lock, flags); -+ return ret; -+} -+ -+/* -+ * waking_non_zero_interruptible: -+ * 1 got the lock -+ * 0 go to sleep -+ * -EINTR interrupted -+ */ -+static inline int waking_non_zero_interruptible(struct semaphore *sem, -+ struct task_struct *tsk) -+{ -+ int ret; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&semaphore_wake_lock, flags); -+ ret = 0; -+ if (atomic_read(&sem->waking) > 0) { -+ atomic_dec(&sem->waking); -+ ret = 1; -+ } else if (signal_pending(tsk)) { -+ atomic_inc(&sem->count); -+ ret = -EINTR; -+ } -+ spin_unlock_irqrestore(&semaphore_wake_lock, flags); -+ return ret; -+} -+ -+/* -+ * waking_non_zero_trylock: -+ * 1 failed to lock -+ * 0 got the lock -+ */ -+static inline int waking_non_zero_trylock(struct semaphore *sem) -+{ -+ int ret; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&semaphore_wake_lock, flags); -+ ret = 1; -+ if (atomic_read(&sem->waking) > 0) { -+ atomic_dec(&sem->waking); -+ ret = 0; -+ } else -+ atomic_inc(&sem->count); -+ spin_unlock_irqrestore(&semaphore_wake_lock, flags); -+ return ret; -+} -+ -+#endif ---- linux/include/asm-nios2nommu/sembuf.h -+++ linux/include/asm-nios2nommu/sembuf.h -@@ -0,0 +1,48 @@ -+#ifndef _NIOS_SEMBUF_H -+#define _NIOS_SEMBUF_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/sembuf.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* -+ * Note extra padding because this structure is passed back and forth -+ * between kernel and user space. -+ * -+ * Pad space is left for: -+ * - 64-bit time_t to solve y2038 problem -+ * - 2 miscellaneous 32-bit values -+ */ -+ -+struct semid64_ds { -+ struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ -+ __kernel_time_t sem_otime; /* last semop time */ -+ unsigned long __unused1; -+ __kernel_time_t sem_ctime; /* last change time */ -+ unsigned long __unused2; -+ unsigned long sem_nsems; /* no. of semaphores in array */ -+ unsigned long __unused3; -+ unsigned long __unused4; -+}; -+ -+#endif /* _NIOS_SEMBUF_H */ ---- linux/include/asm-nios2nommu/setup.h -+++ linux/include/asm-nios2nommu/setup.h -@@ -0,0 +1,31 @@ -+/* Copied from i386 port. -+ * Just a place holder. We don't want to have to test x86 before -+ * we include stuff -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2_SETUP_H -+#define _NIOS2_SETUP_H -+ -+#define COMMAND_LINE_SIZE 512 -+ -+#endif /* _NIOS2_SETUP_H */ ---- linux/include/asm-nios2nommu/shmbuf.h -+++ linux/include/asm-nios2nommu/shmbuf.h -@@ -0,0 +1,64 @@ -+#ifndef _NIOS_SHMBUF_H -+#define _NIOS_SHMBUF_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/shmbuf.h -+ * -+ * Derived from m68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* Note extra padding because this structure is passed back and forth -+ * between kernel and user space. -+ * -+ * Pad space is left for: -+ * - 64-bit time_t to solve y2038 problem -+ * - 2 miscellaneous 32-bit values -+ */ -+ -+struct shmid64_ds { -+ struct ipc64_perm shm_perm; /* operation perms */ -+ size_t shm_segsz; /* size of segment (bytes) */ -+ __kernel_time_t shm_atime; /* last attach time */ -+ unsigned long __unused1; -+ __kernel_time_t shm_dtime; /* last detach time */ -+ unsigned long __unused2; -+ __kernel_time_t shm_ctime; /* last change time */ -+ unsigned long __unused3; -+ __kernel_pid_t shm_cpid; /* pid of creator */ -+ __kernel_pid_t shm_lpid; /* pid of last operator */ -+ unsigned long shm_nattch; /* no. of current attaches */ -+ unsigned long __unused4; -+ unsigned long __unused5; -+}; -+ -+struct shminfo64 { -+ unsigned long shmmax; -+ unsigned long shmmin; -+ unsigned long shmmni; -+ unsigned long shmseg; -+ unsigned long shmall; -+ unsigned long __unused1; -+ unsigned long __unused2; -+ unsigned long __unused3; -+ unsigned long __unused4; -+}; -+ -+#endif /* _NIOS_SHMBUF_H */ ---- linux/include/asm-nios2nommu/shmparam.h -+++ linux/include/asm-nios2nommu/shmparam.h -@@ -0,0 +1,30 @@ -+#ifndef __NIOS2NOMMU_SHMPARAM_H__ -+#define __NIOS2NOMMU_SHMPARAM_H__ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/shmparam.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ -+ -+#endif /* __NIOS2NOMMU_SHMPARAM_H__ */ ---- linux/include/asm-nios2nommu/sigcontext.h -+++ linux/include/asm-nios2nommu/sigcontext.h -@@ -0,0 +1,35 @@ -+/* -+ * Taken from the m68knommu. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _ASM_NIOS2NOMMU_SIGCONTEXT_H -+#define _ASM_NIOS2NOMMU_SIGCONTEXT_H -+ -+#include -+ -+struct sigcontext { -+ struct pt_regs regs; -+ unsigned long sc_mask; /* old sigmask */ -+}; -+ -+#endif ---- linux/include/asm-nios2nommu/siginfo.h -+++ linux/include/asm-nios2nommu/siginfo.h -@@ -0,0 +1,28 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2NOMMU_SIGINFO_H -+#define _NIOS2NOMMU_SIGINFO_H -+ -+#include -+ -+#endif ---- linux/include/asm-nios2nommu/signal.h -+++ linux/include/asm-nios2nommu/signal.h -@@ -0,0 +1,207 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2_SIGNAL_H -+#define _NIOS2_SIGNAL_H -+ -+#include -+ -+/* Avoid too many header ordering problems. */ -+struct siginfo; -+ -+#ifdef __KERNEL__ -+/* Most things should be clean enough to redefine this at will, if care -+ is taken to make libc match. */ -+ -+#define _NSIG 64 -+#define _NSIG_BPW 32 -+#define _NSIG_WORDS (_NSIG / _NSIG_BPW) -+ -+typedef unsigned long old_sigset_t; /* at least 32 bits */ -+ -+typedef struct { -+ unsigned long sig[_NSIG_WORDS]; -+} sigset_t; -+ -+#else -+/* Here we must cater to libcs that poke about in kernel headers. */ -+ -+#define NSIG 32 -+typedef unsigned long sigset_t; -+ -+#endif /* __KERNEL__ */ -+ -+#define SIGHUP 1 -+#define SIGINT 2 -+#define SIGQUIT 3 -+#define SIGILL 4 -+#define SIGTRAP 5 -+#define SIGABRT 6 -+#define SIGIOT 6 -+#define SIGBUS 7 -+#define SIGFPE 8 -+#define SIGKILL 9 -+#define SIGUSR1 10 -+#define SIGSEGV 11 -+#define SIGUSR2 12 -+#define SIGPIPE 13 -+#define SIGALRM 14 -+#define SIGTERM 15 -+#define SIGSTKFLT 16 -+#define SIGCHLD 17 -+#define SIGCONT 18 -+#define SIGSTOP 19 -+#define SIGTSTP 20 -+#define SIGTTIN 21 -+#define SIGTTOU 22 -+#define SIGURG 23 -+#define SIGXCPU 24 -+#define SIGXFSZ 25 -+#define SIGVTALRM 26 -+#define SIGPROF 27 -+#define SIGWINCH 28 -+#define SIGIO 29 -+#define SIGPOLL SIGIO -+/* -+#define SIGLOST 29 -+*/ -+#define SIGPWR 30 -+#define SIGSYS 31 -+#define SIGUNUSED 31 -+ -+/* These should not be considered constants from userland. */ -+#define SIGRTMIN 32 -+#define SIGRTMAX _NSIG-1 -+ -+/* -+ * SA_FLAGS values: -+ * -+ * SA_ONSTACK indicates that a registered stack_t will be used. -+ * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the -+ * SA_RESTART flag to get restarting signals (which were the default long ago) -+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. -+ * SA_RESETHAND clears the handler when the signal is delivered. -+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. -+ * SA_NODEFER prevents the current signal from being masked in the handler. -+ * -+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single -+ * Unix names RESETHAND and NODEFER respectively. -+ */ -+#define SA_NOCLDSTOP 0x00000001 -+#define SA_NOCLDWAIT 0x00000002 /* not supported yet */ -+#define SA_SIGINFO 0x00000004 -+#define SA_ONSTACK 0x08000000 -+#define SA_RESTART 0x10000000 -+#define SA_NODEFER 0x40000000 -+#define SA_RESETHAND 0x80000000 -+ -+#define SA_NOMASK SA_NODEFER -+#define SA_ONESHOT SA_RESETHAND -+#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ -+ -+#define SA_RESTORER 0x04000000 -+ -+/* -+ * sigaltstack controls -+ */ -+#define SS_ONSTACK 1 -+#define SS_DISABLE 2 -+ -+#define MINSIGSTKSZ 2048 -+#define SIGSTKSZ 8192 -+ -+#ifdef __KERNEL__ -+/* -+ * These values of sa_flags are used only by the kernel as part of the -+ * irq handling routines. -+ * -+ * SA_INTERRUPT is also used by the irq handling routines. -+ * SA_SHIRQ is for shared interrupt support on PCI and EISA. -+ */ -+#define SA_PROBE SA_ONESHOT -+#define SA_SAMPLE_RANDOM SA_RESTART -+#define SA_SHIRQ 0x04000000 -+#endif -+ -+#define SIG_BLOCK 0 /* for blocking signals */ -+#define SIG_UNBLOCK 1 /* for unblocking signals */ -+#define SIG_SETMASK 2 /* for setting the signal mask */ -+ -+/* Type of a signal handler. */ -+typedef void (*__sighandler_t)(int); -+ -+#define SIG_DFL ((__sighandler_t)0) /* default signal handling */ -+#define SIG_IGN ((__sighandler_t)1) /* ignore signal */ -+#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */ -+ -+#ifdef __KERNEL__ -+struct old_sigaction { -+ __sighandler_t sa_handler; -+ old_sigset_t sa_mask; -+ unsigned long sa_flags; -+ void (*sa_restorer)(void); -+}; -+ -+struct sigaction { -+ __sighandler_t sa_handler; -+ unsigned long sa_flags; -+ void (*sa_restorer)(void); -+ sigset_t sa_mask; /* mask last for extensibility */ -+}; -+ -+struct k_sigaction { -+ struct sigaction sa; -+}; -+#else -+/* Here we must cater to libcs that poke about in kernel headers. */ -+ -+struct sigaction { -+ union { -+ __sighandler_t _sa_handler; -+ void (*_sa_sigaction)(int, struct siginfo *, void *); -+ } _u; -+ sigset_t sa_mask; -+ unsigned long sa_flags; -+ void (*sa_restorer)(void); -+}; -+ -+#define sa_handler _u._sa_handler -+#define sa_sigaction _u._sa_sigaction -+ -+#endif /* __KERNEL__ */ -+ -+typedef struct sigaltstack { -+ void *ss_sp; -+ int ss_flags; -+ size_t ss_size; -+} stack_t; -+ -+#ifdef __KERNEL__ -+ -+#include -+#undef __HAVE_ARCH_SIG_BITOPS -+ -+#define ptrace_signal_deliver(regs, cookie) do { } while (0) -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _NIOS2_SIGNAL_H */ ---- linux/include/asm-nios2nommu/smp.h -+++ linux/include/asm-nios2nommu/smp.h -@@ -0,0 +1,34 @@ -+#ifndef __ASM_SMP_H -+#define __ASM_SMP_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/smp.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+// #include -+ -+#ifdef CONFIG_SMP -+#error SMP not supported -+#endif -+ -+#endif ---- linux/include/asm-nios2nommu/socket.h -+++ linux/include/asm-nios2nommu/socket.h -@@ -0,0 +1,74 @@ -+#ifndef _ASM_SOCKET_H -+#define _ASM_SOCKET_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/socket.h -+ * -+ * Derived from m68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+/* For setsockopt(2) */ -+#define SOL_SOCKET 1 -+ -+#define SO_DEBUG 1 -+#define SO_REUSEADDR 2 -+#define SO_TYPE 3 -+#define SO_ERROR 4 -+#define SO_DONTROUTE 5 -+#define SO_BROADCAST 6 -+#define SO_SNDBUF 7 -+#define SO_RCVBUF 8 -+#define SO_KEEPALIVE 9 -+#define SO_OOBINLINE 10 -+#define SO_NO_CHECK 11 -+#define SO_PRIORITY 12 -+#define SO_LINGER 13 -+#define SO_BSDCOMPAT 14 -+/* To add :#define SO_REUSEPORT 15 */ -+#define SO_PASSCRED 16 -+#define SO_PEERCRED 17 -+#define SO_RCVLOWAT 18 -+#define SO_SNDLOWAT 19 -+#define SO_RCVTIMEO 20 -+#define SO_SNDTIMEO 21 -+ -+/* Security levels - as per NRL IPv6 - don't actually do anything */ -+#define SO_SECURITY_AUTHENTICATION 22 -+#define SO_SECURITY_ENCRYPTION_TRANSPORT 23 -+#define SO_SECURITY_ENCRYPTION_NETWORK 24 -+ -+#define SO_BINDTODEVICE 25 -+ -+/* Socket filtering */ -+#define SO_ATTACH_FILTER 26 -+#define SO_DETACH_FILTER 27 -+ -+#define SO_PEERNAME 28 -+#define SO_TIMESTAMP 29 -+#define SCM_TIMESTAMP SO_TIMESTAMP -+ -+#define SO_ACCEPTCONN 30 -+ -+#define SO_PEERSEC 31 /* ;dgt2;tmp; */ -+ -+#endif /* _ASM_SOCKET_H */ ---- linux/include/asm-nios2nommu/sockios.h -+++ linux/include/asm-nios2nommu/sockios.h -@@ -0,0 +1,38 @@ -+#ifndef _ASM_NIOS_SOCKIOS_H -+#define _ASM_NIOS_SOCKIOS_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/sockios.h -+ * -+ * Socket-level I/O control calls. -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#define FIOSETOWN 0x8901 -+#define SIOCSPGRP 0x8902 -+#define FIOGETOWN 0x8903 -+#define SIOCGPGRP 0x8904 -+#define SIOCATMARK 0x8905 -+#define SIOCGSTAMP 0x8906 /* Get stamp */ -+ -+#endif /* !(_ASM_NIOS_SOCKIOS_H) */ -+ ---- linux/include/asm-nios2nommu/spi.h -+++ linux/include/asm-nios2nommu/spi.h -@@ -0,0 +1,92 @@ -+#ifndef _ASM_SPI_H_ -+#define _ASM_SPI_H_ 1 -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/spi.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+int register_NIOS_SPI( void ); -+void unregister_NIOS_SPI( void ); -+ -+#if defined(MODULE) -+void cleanup_module( void ); -+int init_module( void ); -+#endif -+ -+#if defined(__KERNEL__) -+int spi_reset ( void ); -+#endif -+ -+ -+#define clockCS 0x01 -+#define temperatureCS 0x02 -+ -+#define clock_read_base 0x00 -+#define clock_write_base 0x80 -+#define clock_read_control 0x0F -+#define clock_read_trickle 0x11 -+ -+#define clock_read_sec 0x00 -+#define clock_read_min 0x01 -+#define clock_read_hour 0x02 -+#define clock_read_day 0x03 -+#define clock_read_date 0x04 -+#define clock_read_month 0x05 -+#define clock_read_year 0x06 -+ -+#define clock_write_control 0x8F -+#define clock_write_trickle 0x91 -+#define clock_write_sec 0x80 -+#define clock_write_min 0x81 -+#define clock_write_hour 0x82 -+#define clock_write_day 0x83 -+#define clock_write_date 0x84 -+#define clock_write_month 0x85 -+#define clock_write_year 0x86 -+ -+#define clock_write_ram_start 0xA0 -+#define clock_write_ram_end 0x100 -+#define clock_read_ram_start 0x20 -+#define clock_read_ram_end 0x80 -+ -+ -+#define clock_sec_def 0x11 -+#define clock_min_def 0x59 -+#define clock_hour_def 0x71 -+#define clock_day_def 0x00 -+#define clock_date_def 0x20 -+#define clock_month_def 0x12 -+#define clock_year_def 0x34 -+ -+#define temp_read_base 0x00 -+#define temp_write_base 0x80 -+#define temp_read_control 0x00 -+#define temp_write_control 0x80 -+#define temp_read_msb 0x02 -+#define temp_read_lsb 0x01 -+ -+#define MAX_TEMP_VAR 10 -+ -+#endif /*_ASM_SPI_H_*/ ---- linux/include/asm-nios2nommu/spinlock.h -+++ linux/include/asm-nios2nommu/spinlock.h -@@ -0,0 +1,30 @@ -+#ifndef __NIOS_SPINLOCK_H -+#define __NIOS_SPINLOCK_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/spinlock.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#error "Nios doesn't do SMP yet" -+ -+#endif ---- linux/include/asm-nios2nommu/spi_struct.h -+++ linux/include/asm-nios2nommu/spi_struct.h -@@ -0,0 +1,57 @@ -+// SPI Registers -+typedef volatile struct -+ { -+ int np_spirxdata; // Read-only, 1-16 bit -+ int np_spitxdata; // Write-only, same width as rxdata -+ int np_spistatus; // Read-only, 9-bit -+ int np_spicontrol; // Read/Write, 9-bit -+ int np_spireserved; // reserved -+ int np_spislaveselect; // Read/Write, 1-16 bit, master only -+ int np_spiendofpacket; // Read/write, same width as txdata, rxdata. -+ } np_spi; -+ -+// SPI Status Register Bits -+enum -+ { -+ np_spistatus_eop_bit = 9, -+ np_spistatus_e_bit = 8, -+ np_spistatus_rrdy_bit = 7, -+ np_spistatus_trdy_bit = 6, -+ np_spistatus_tmt_bit = 5, -+ np_spistatus_toe_bit = 4, -+ np_spistatus_roe_bit = 3, -+ -+ np_spistatus_eop_mask = (1 << 9), -+ np_spistatus_e_mask = (1 << 8), -+ np_spistatus_rrdy_mask = (1 << 7), -+ np_spistatus_trdy_mask = (1 << 6), -+ np_spistatus_tmt_mask = (1 << 5), -+ np_spistatus_toe_mask = (1 << 4), -+ np_spistatus_roe_mask = (1 << 3), -+ }; -+ -+// SPI Control Register Bits -+enum -+ { -+ np_spicontrol_sso_bit = 10, -+ np_spicontrol_ieop_bit = 9, -+ np_spicontrol_ie_bit = 8, -+ np_spicontrol_irrdy_bit = 7, -+ np_spicontrol_itrdy_bit = 6, -+ np_spicontrol_itoe_bit = 4, -+ np_spicontrol_iroe_bit = 3, -+ -+ np_spicontrol_sso_mask = (1 << 10), -+ np_spicontrol_ieop_mask = (1 << 9), -+ np_spicontrol_ie_mask = (1 << 8), -+ np_spicontrol_irrdy_mask = (1 << 7), -+ np_spicontrol_itrdy_mask = (1 << 6), -+ np_spicontrol_itoe_mask = (1 << 4), -+ np_spicontrol_iroe_mask = (1 << 3), -+ }; -+ -+// SPI Routines. -+int nr_spi_rxchar(np_spi *spiBase); -+int nr_spi_txchar(int i, np_spi *spiBase); -+ -+ ---- linux/include/asm-nios2nommu/statfs.h -+++ linux/include/asm-nios2nommu/statfs.h -@@ -0,0 +1,30 @@ -+#ifndef _NIOS2NOMMU_STATFS_H -+#define _NIOS2NOMMU_STATFS_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/statfs.h -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#endif /* _NIOS2NOMMU_STATFS_H */ ---- linux/include/asm-nios2nommu/stat.h -+++ linux/include/asm-nios2nommu/stat.h -@@ -0,0 +1,102 @@ -+#ifndef _ASMNIOS2NOMMU_STAT_H -+#define _ASMNIOS2NOMMU_STAT_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/stat.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+struct __old_kernel_stat { -+ unsigned short st_dev; -+ unsigned short st_ino; -+ unsigned short st_mode; -+ unsigned short st_nlink; -+ unsigned short st_uid; -+ unsigned short st_gid; -+ unsigned short st_rdev; -+ unsigned long st_size; -+ unsigned long st_atime; -+ unsigned long st_mtime; -+ unsigned long st_ctime; -+}; -+ -+struct stat { -+ unsigned short st_dev; -+ unsigned short __pad1; -+ unsigned long st_ino; -+ unsigned short st_mode; -+ unsigned short st_nlink; -+ unsigned short st_uid; -+ unsigned short st_gid; -+ unsigned short st_rdev; -+ unsigned short __pad2; -+ unsigned long st_size; -+ unsigned long st_blksize; -+ unsigned long st_blocks; -+ unsigned long st_atime; -+ unsigned long __unused1; -+ unsigned long st_mtime; -+ unsigned long __unused2; -+ unsigned long st_ctime; -+ unsigned long __unused3; -+ unsigned long __unused4; -+ unsigned long __unused5; -+}; -+ -+/* This matches struct stat64 in glibc2.1, hence the absolutely -+ * insane amounts of padding around dev_t's. -+ */ -+struct stat64 { -+ unsigned long long st_dev; -+ unsigned char __pad1[4]; -+ -+#define STAT64_HAS_BROKEN_ST_INO 1 -+ unsigned long __st_ino; -+ -+ unsigned int st_mode; -+ unsigned int st_nlink; -+ -+ unsigned long st_uid; -+ unsigned long st_gid; -+ -+ unsigned long long st_rdev; -+ unsigned char __pad3[4]; -+ -+ long long st_size; -+ unsigned long st_blksize; -+ -+ unsigned long __pad4; /* future possible st_blocks high bits */ -+ unsigned long st_blocks; /* Number 512-byte blocks allocated. */ -+ -+ unsigned long st_atime; -+ unsigned long st_atime_nsec; -+ -+ unsigned long st_mtime; -+ unsigned long st_mtime_nsec; -+ -+ unsigned long st_ctime; -+ unsigned long st_ctime_nsec; -+ -+ unsigned long long st_ino; -+}; -+ -+#endif ---- linux/include/asm-nios2nommu/string.h -+++ linux/include/asm-nios2nommu/string.h -@@ -0,0 +1,45 @@ -+#ifndef __NIOS_STRING_H__ -+#define __NIOS_STRING_H__ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/string.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#ifdef __KERNEL__ /* only set these up for kernel code */ -+ -+#define __HAVE_ARCH_MEMMOVE -+void * memmove(void * d, const void * s, size_t count); -+#define __HAVE_ARCH_MEMCPY -+extern void * memcpy(void *d, const void *s, size_t count); -+#define __HAVE_ARCH_MEMSET -+extern void * memset(void * s,int c,size_t count); -+ -+#if 0 -+#define __HAVE_ARCH_BCOPY -+#define __HAVE_ARCH_STRLEN -+#endif -+ -+#endif /* KERNEL */ -+ -+#endif /* !(__NIOS_STRING_H__) */ ---- linux/include/asm-nios2nommu/system.h -+++ linux/include/asm-nios2nommu/system.h -@@ -0,0 +1,172 @@ -+/* -+ * Taken from the m68k. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2NOMMU_SYSTEM_H -+#define _NIOS2NOMMU_SYSTEM_H -+ -+// #include /* get configuration macros */ -+#include -+#include -+#include -+#include -+ -+/* -+ * switch_to(n) should switch tasks to task ptr, first checking that -+ * ptr isn't the current task, in which case it does nothing. This -+ * also clears the TS-flag if the task we switched to has used the -+ * math co-processor latest. -+ */ -+ -+/* -+ */ -+asmlinkage void resume(void); -+#define switch_to(prev,next,last) \ -+{ \ -+ void *_last; \ -+ __asm__ __volatile__( \ -+ "mov r4, %1\n" \ -+ "mov r5, %2\n" \ -+ "call resume\n" \ -+ "mov %0,r4\n" \ -+ : "=r" (_last) \ -+ : "r" (prev), "r" (next) \ -+ : "r4","r5","r7","r8","ra"); \ -+ (last) = _last; \ -+} -+ -+#define local_irq_enable() __asm__ __volatile__ ( \ -+ "rdctl r8, status\n" \ -+ "ori r8, r8, 1\n" \ -+ "wrctl status, r8\n" \ -+ : : : "r8") -+ -+#define local_irq_disable() __asm__ __volatile__ ( \ -+ "rdctl r8, status\n" \ -+ "andi r8, r8, 0xfffe\n" \ -+ "wrctl status, r8\n" \ -+ : : : "r8") -+ -+#define local_save_flags(x) __asm__ __volatile__ ( \ -+ "rdctl r8, status\n" \ -+ "mov %0, r8\n" \ -+ :"=r" (x) : : "r8", "memory") -+ -+#define local_irq_restore(x) __asm__ __volatile__ ( \ -+ "mov r8, %0\n" \ -+ "wrctl status, r8\n" \ -+ : :"r" (x) : "memory") -+ -+/* For spinlocks etc */ -+#define local_irq_save(x) do { local_save_flags(x); local_irq_disable(); } while (0) -+ -+#define irqs_disabled() \ -+({ \ -+ unsigned long flags; \ -+ local_save_flags(flags); \ -+ ((flags & NIOS2_STATUS_PIE_MSK) == 0x0); \ -+}) -+ -+#define iret() __asm__ __volatile__ ("eret": : :"memory", "ea") -+ -+/* -+ * Force strict CPU ordering. -+ * Not really required on m68k... -+ */ -+#define nop() asm volatile ("nop"::) -+#define mb() asm volatile ("" : : :"memory") -+#define rmb() asm volatile ("" : : :"memory") -+#define wmb() asm volatile ("" : : :"memory") -+#define set_rmb(var, value) do { xchg(&var, value); } while (0) -+#define set_mb(var, value) set_rmb(var, value) -+#define set_wmb(var, value) do { var = value; wmb(); } while (0) -+ -+#ifdef CONFIG_SMP -+#define smp_mb() mb() -+#define smp_rmb() rmb() -+#define smp_wmb() wmb() -+#define smp_read_barrier_depends() read_barrier_depends() -+#else -+#define smp_mb() barrier() -+#define smp_rmb() barrier() -+#define smp_wmb() barrier() -+#define smp_read_barrier_depends() do { } while(0) -+#endif -+ -+#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -+#define tas(ptr) (xchg((ptr),1)) -+ -+struct __xchg_dummy { unsigned long a[100]; }; -+#define __xg(x) ((volatile struct __xchg_dummy *)(x)) -+ -+static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) -+{ -+ unsigned long tmp, flags; -+ -+ local_irq_save(flags); -+ -+ switch (size) { -+ case 1: -+ __asm__ __volatile__( \ -+ "ldb %0, %2\n" \ -+ "stb %1, %2\n" \ -+ : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory"); -+ break; -+ case 2: -+ __asm__ __volatile__( \ -+ "ldh %0, %2\n" \ -+ "sth %1, %2\n" \ -+ : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory"); -+ break; -+ case 4: -+ __asm__ __volatile__( \ -+ "ldw %0, %2\n" \ -+ "stw %1, %2\n" \ -+ : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory"); -+ break; -+ } -+ local_irq_restore(flags); -+ return tmp; -+} -+ -+/* -+ * Atomic compare and exchange. Compare OLD with MEM, if identical, -+ * store NEW in MEM. Return the initial value in MEM. Success is -+ * indicated by comparing RETURN with OLD. -+ */ -+#define __HAVE_ARCH_CMPXCHG 1 -+ -+static __inline__ unsigned long -+cmpxchg(volatile int *p, int old, int new) -+{ -+ unsigned long flags; -+ int prev; -+ -+ local_irq_save(flags); -+ if ((prev = *p) == old) -+ *p = new; -+ local_irq_restore(flags); -+ return(prev); -+} -+ -+#endif /* _NIOS2NOMMU_SYSTEM_H */ ---- linux/include/asm-nios2nommu/termbits.h -+++ linux/include/asm-nios2nommu/termbits.h -@@ -0,0 +1,199 @@ -+#ifndef __ARCH_NIOS_TERMBITS_H__ -+#define __ARCH_NIOS_TERMBITS_H__ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/termbits.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+typedef unsigned char cc_t; -+typedef unsigned int speed_t; -+typedef unsigned int tcflag_t; -+ -+#define NCCS 19 -+struct termios { -+ tcflag_t c_iflag; /* input mode flags */ -+ tcflag_t c_oflag; /* output mode flags */ -+ tcflag_t c_cflag; /* control mode flags */ -+ tcflag_t c_lflag; /* local mode flags */ -+ cc_t c_line; /* line discipline */ -+ cc_t c_cc[NCCS]; /* control characters */ -+}; -+ -+/* c_cc characters */ -+#define VINTR 0 -+#define VQUIT 1 -+#define VERASE 2 -+#define VKILL 3 -+#define VEOF 4 -+#define VTIME 5 -+#define VMIN 6 -+#define VSWTC 7 -+#define VSTART 8 -+#define VSTOP 9 -+#define VSUSP 10 -+#define VEOL 11 -+#define VREPRINT 12 -+#define VDISCARD 13 -+#define VWERASE 14 -+#define VLNEXT 15 -+#define VEOL2 16 -+ -+ -+/* c_iflag bits */ -+#define IGNBRK 0000001 -+#define BRKINT 0000002 -+#define IGNPAR 0000004 -+#define PARMRK 0000010 -+#define INPCK 0000020 -+#define ISTRIP 0000040 -+#define INLCR 0000100 -+#define IGNCR 0000200 -+#define ICRNL 0000400 -+#define IUCLC 0001000 -+#define IXON 0002000 -+#define IXANY 0004000 -+#define IXOFF 0010000 -+#define IMAXBEL 0020000 -+#define IUTF8 0040000 -+ -+/* c_oflag bits */ -+#define OPOST 0000001 -+#define OLCUC 0000002 -+#define ONLCR 0000004 -+#define OCRNL 0000010 -+#define ONOCR 0000020 -+#define ONLRET 0000040 -+#define OFILL 0000100 -+#define OFDEL 0000200 -+#define NLDLY 0000400 -+#define NL0 0000000 -+#define NL1 0000400 -+#define CRDLY 0003000 -+#define CR0 0000000 -+#define CR1 0001000 -+#define CR2 0002000 -+#define CR3 0003000 -+#define TABDLY 0014000 -+#define TAB0 0000000 -+#define TAB1 0004000 -+#define TAB2 0010000 -+#define TAB3 0014000 -+#define XTABS 0014000 -+#define BSDLY 0020000 -+#define BS0 0000000 -+#define BS1 0020000 -+#define VTDLY 0040000 -+#define VT0 0000000 -+#define VT1 0040000 -+#define FFDLY 0100000 -+#define FF0 0000000 -+#define FF1 0100000 -+ -+/* c_cflag bit meaning */ -+#define CBAUD 0010017 -+#define B0 0000000 /* hang up */ -+#define B50 0000001 -+#define B75 0000002 -+#define B110 0000003 -+#define B134 0000004 -+#define B150 0000005 -+#define B200 0000006 -+#define B300 0000007 -+#define B600 0000010 -+#define B1200 0000011 -+#define B1800 0000012 -+#define B2400 0000013 -+#define B4800 0000014 -+#define B9600 0000015 -+#define B19200 0000016 -+#define B38400 0000017 -+#define EXTA B19200 -+#define EXTB B38400 -+#define CSIZE 0000060 -+#define CS5 0000000 -+#define CS6 0000020 -+#define CS7 0000040 -+#define CS8 0000060 -+#define CSTOPB 0000100 -+#define CREAD 0000200 -+#define PARENB 0000400 -+#define PARODD 0001000 -+#define HUPCL 0002000 -+#define CLOCAL 0004000 -+#define CBAUDEX 0010000 -+#define B57600 0010001 -+#define B115200 0010002 -+#define B230400 0010003 -+#define B460800 0010004 -+#define B500000 0010005 -+#define B576000 0010006 -+#define B921600 0010007 -+#define B1000000 0010010 -+#define B1152000 0010011 -+#define B1500000 0010012 -+#define B2000000 0010013 -+#define B2500000 0010014 -+#define B3000000 0010015 -+#define B3500000 0010016 -+#define B4000000 0010017 -+#define CIBAUD 002003600000 /* input baud rate (not used) */ -+#define CMSPAR 010000000000 /* mark or space (stick) parity */ -+#define CRTSCTS 020000000000 /* flow control */ -+ -+/* c_lflag bits */ -+#define ISIG 0000001 -+#define ICANON 0000002 -+#define XCASE 0000004 -+#define ECHO 0000010 -+#define ECHOE 0000020 -+#define ECHOK 0000040 -+#define ECHONL 0000100 -+#define NOFLSH 0000200 -+#define TOSTOP 0000400 -+#define ECHOCTL 0001000 -+#define ECHOPRT 0002000 -+#define ECHOKE 0004000 -+#define FLUSHO 0010000 -+#define PENDIN 0040000 -+#define IEXTEN 0100000 -+ -+ -+/* tcflow() and TCXONC use these */ -+#define TCOOFF 0 -+#define TCOON 1 -+#define TCIOFF 2 -+#define TCION 3 -+ -+/* tcflush() and TCFLSH use these */ -+#define TCIFLUSH 0 -+#define TCOFLUSH 1 -+#define TCIOFLUSH 2 -+ -+/* tcsetattr uses these */ -+#define TCSANOW 0 -+#define TCSADRAIN 1 -+#define TCSAFLUSH 2 -+ -+#endif /* __ARCH_NIOS_TERMBITS_H__ */ ---- linux/include/asm-nios2nommu/termios.h -+++ linux/include/asm-nios2nommu/termios.h -@@ -0,0 +1,132 @@ -+#ifndef _NIOS_TERMIOS_H -+#define _NIOS_TERMIOS_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/termios.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+#include -+ -+struct winsize { -+ unsigned short ws_row; -+ unsigned short ws_col; -+ unsigned short ws_xpixel; -+ unsigned short ws_ypixel; -+}; -+ -+#define NCC 8 -+struct termio { -+ unsigned short c_iflag; /* input mode flags */ -+ unsigned short c_oflag; /* output mode flags */ -+ unsigned short c_cflag; /* control mode flags */ -+ unsigned short c_lflag; /* local mode flags */ -+ unsigned char c_line; /* line discipline */ -+ unsigned char c_cc[NCC]; /* control characters */ -+}; -+ -+#ifdef __KERNEL__ -+/* intr=^C quit=^| erase=del kill=^U -+ eof=^D vtime=\0 vmin=\1 sxtc=\0 -+ start=^Q stop=^S susp=^Z eol=\0 -+ reprint=^R discard=^U werase=^W lnext=^V -+ eol2=\0 -+*/ -+#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" -+#endif -+ -+/* modem lines */ -+#define TIOCM_LE 0x001 -+#define TIOCM_DTR 0x002 -+#define TIOCM_RTS 0x004 -+#define TIOCM_ST 0x008 -+#define TIOCM_SR 0x010 -+#define TIOCM_CTS 0x020 -+#define TIOCM_CAR 0x040 -+#define TIOCM_RNG 0x080 -+#define TIOCM_DSR 0x100 -+#define TIOCM_CD TIOCM_CAR -+#define TIOCM_RI TIOCM_RNG -+#define TIOCM_OUT1 0x2000 -+#define TIOCM_OUT2 0x4000 -+#define TIOCM_LOOP 0x8000 -+ -+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -+ -+/* line disciplines */ -+#define N_TTY 0 -+#define N_SLIP 1 -+#define N_MOUSE 2 -+#define N_PPP 3 -+#define N_STRIP 4 -+#define N_AX25 5 -+#define N_X25 6 /* X.25 async */ -+#define N_6PACK 7 -+#define N_MASC 8 /* Reserved for Mobitex module */ -+#define N_R3964 9 /* Reserved for Simatic R3964 module */ -+#define N_PROFIBUS_FDL 10 /* Reserved for Profibus */ -+#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */ -+#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */ -+#define N_HDLC 13 /* synchronous HDLC */ -+#define N_SYNC_PPP 14 -+#define N_HCI 15 /* Bluetooth HCI UART */ -+ -+#ifdef __KERNEL__ -+ -+/* -+ * Translate a "termio" structure into a "termios". Ugh. -+ */ -+#define user_termio_to_kernel_termios(termios, termio) \ -+({ \ -+ unsigned short tmp; \ -+ get_user(tmp, &(termio)->c_iflag); \ -+ (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ -+ get_user(tmp, &(termio)->c_oflag); \ -+ (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ -+ get_user(tmp, &(termio)->c_cflag); \ -+ (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ -+ get_user(tmp, &(termio)->c_lflag); \ -+ (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ -+ get_user((termios)->c_line, &(termio)->c_line); \ -+ copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ -+}) -+ -+/* -+ * Translate a "termios" structure into a "termio". Ugh. -+ */ -+#define kernel_termios_to_user_termio(termio, termios) \ -+({ \ -+ put_user((termios)->c_iflag, &(termio)->c_iflag); \ -+ put_user((termios)->c_oflag, &(termio)->c_oflag); \ -+ put_user((termios)->c_cflag, &(termio)->c_cflag); \ -+ put_user((termios)->c_lflag, &(termio)->c_lflag); \ -+ put_user((termios)->c_line, &(termio)->c_line); \ -+ copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ -+}) -+ -+#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) -+#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _NIOS_TERMIOS_H */ ---- linux/include/asm-nios2nommu/thread_info.h -+++ linux/include/asm-nios2nommu/thread_info.h -@@ -0,0 +1,127 @@ -+/* thread_info.h: niosnommu low-level thread information -+ * adapted from the m68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * Copyright (C) 2002 Microtronix Datacom -+ * -+ * - Incorporating suggestions made by Linus Torvalds and Dave Miller -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _ASM_THREAD_INFO_H -+#define _ASM_THREAD_INFO_H -+ -+#include -+ -+#ifdef __KERNEL__ -+ -+#ifndef __ASSEMBLY__ -+ -+/* -+ * low level task data. -+ */ -+struct thread_info { -+ struct task_struct *task; /* main task structure */ -+ struct exec_domain *exec_domain; /* execution domain */ -+ unsigned long flags; /* low level flags */ -+ int cpu; /* cpu we're on */ -+ int preempt_count; /* 0 => preemptable, <0 => BUG*/ -+ struct restart_block restart_block; -+}; -+ -+/* -+ * macros/functions for gaining access to the thread information structure -+ */ -+#define INIT_THREAD_INFO(tsk) \ -+{ \ -+ .task = &tsk, \ -+ .exec_domain = &default_exec_domain, \ -+ .flags = 0, \ -+ .cpu = 0, \ -+ .preempt_count = 1, \ -+ .restart_block = { \ -+ .fn = do_no_restart_syscall, \ -+ }, \ -+} -+ -+#define init_thread_info (init_thread_union.thread_info) -+#define init_stack (init_thread_union.stack) -+ -+ -+/* how to get the thread information struct from C -+ usable only in supervisor mode */ -+static inline struct thread_info *current_thread_info(void) -+{ -+ struct thread_info *ti; -+ __asm__ __volatile__( -+ "mov %0, sp\n" -+ "and %0, %0, %1\n" -+ : "=&r"(ti) -+ : "r" (~(THREAD_SIZE-1)) -+ ); -+ return ti; -+} -+ -+/* thread information allocation */ -+#define alloc_thread_info(tsk) ((struct thread_info *) \ -+ __get_free_pages(GFP_KERNEL, 1)) -+#define free_thread_info(ti) free_pages((unsigned long) (ti), 1) -+#define put_thread_info(ti) put_task_struct((ti)->task) -+ -+#define PREEMPT_ACTIVE 0x4000000 -+ -+/* -+ * thread information flag bit numbers -+ */ -+#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ -+#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ -+#define TIF_SIGPENDING 2 /* signal pending */ -+#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ -+#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling -+ TIF_NEED_RESCHED */ -+#define TIF_MEMDIE 5 -+ -+/* as above, but as bit values */ -+#define _TIF_SYSCALL_TRACE (1< -+ -+ -+#define CLOCK_TICK_RATE nasys_clock_freq /* Underlying HZ */ -+ -+#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ -+ -+#define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \ -+ (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \ -+ << (SHIFT_SCALE-SHIFT_HZ)) / HZ) -+ -+typedef unsigned long cycles_t; -+ -+static inline cycles_t get_cycles(void) -+{ -+ return 0; -+} -+ -+#endif ---- linux/include/asm-nios2nommu/tlbflush.h -+++ linux/include/asm-nios2nommu/tlbflush.h -@@ -0,0 +1,86 @@ -+#ifndef _NIOS2NOMMU_TLBFLUSH_H -+#define _NIOS2NOMMU_TLBFLUSH_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/tlbflush.h -+ * -+ * Ported from m68knommu. -+ * -+ * Copyright (C) 2003 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+#include -+ -+/* -+ * flush all user-space atc entries. -+ */ -+static inline void __flush_tlb(void) -+{ -+ BUG(); -+} -+ -+static inline void __flush_tlb_one(unsigned long addr) -+{ -+ BUG(); -+} -+ -+#define flush_tlb() __flush_tlb() -+ -+/* -+ * flush all atc entries (both kernel and user-space entries). -+ */ -+static inline void flush_tlb_all(void) -+{ -+ BUG(); -+} -+ -+static inline void flush_tlb_mm(struct mm_struct *mm) -+{ -+ BUG(); -+} -+ -+static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) -+{ -+ BUG(); -+} -+ -+static inline void flush_tlb_range(struct mm_struct *mm, -+ unsigned long start, unsigned long end) -+{ -+ BUG(); -+} -+ -+extern inline void flush_tlb_kernel_page(unsigned long addr) -+{ -+ BUG(); -+} -+ -+extern inline void flush_tlb_pgtables(struct mm_struct *mm, -+ unsigned long start, unsigned long end) -+{ -+ BUG(); -+} -+ -+#endif /* _NIOS2NOMMU_TLBFLUSH_H */ ---- linux/include/asm-nios2nommu/tlb.h -+++ linux/include/asm-nios2nommu/tlb.h -@@ -0,0 +1,35 @@ -+#ifndef __NIOS_TLB_H__ -+#define __NIOS_TLB_H__ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/tlb.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2003 Microtronix Datacom Ltd -+ * Copyright (C) 2002 NEC Corporation -+ * Copyright (C) 2002 Miles Bader -+ * -+ * 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. -+ * -+ * -+ * Written by Miles Bader -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+#define tlb_flush(tlb) ((void)0) -+ -+#include -+ -+#endif /* __NIOS_TLB_H__ */ -+ ---- linux/include/asm-nios2nommu/topology.h -+++ linux/include/asm-nios2nommu/topology.h -@@ -0,0 +1,30 @@ -+#ifndef _ASM_NIOS2NOMMU_TOPOLOGY_H -+#define _ASM_NIOS2NOMMU_TOPOLOGY_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/topology.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#endif /* _ASM_NIOS2NOMMU_TOPOLOGY_H */ ---- linux/include/asm-nios2nommu/traps.h -+++ linux/include/asm-nios2nommu/traps.h -@@ -0,0 +1,27 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef _NIOS2_TRAPS_H -+#define _NIOS2_TRAPS_H -+ -+#define TRAP_ID_SYSCALL 0 -+#define TRAP_ID_APPDEBUG 1 -+#endif /* !(_NIOS2_TRAPS_H) */ ---- linux/include/asm-nios2nommu/types.h -+++ linux/include/asm-nios2nommu/types.h -@@ -0,0 +1,93 @@ -+#ifndef _NIOS_TYPES_H -+#define _NIOS_TYPES_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/types.h -+ * -+ * Derived from m68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* -+ * This file is never included by application software unless -+ * explicitly requested (e.g., via linux/types.h) in which case the -+ * application is Linux specific so (user-) name space pollution is -+ * not a major issue. However, for interoperability, libraries still -+ * need to be careful to avoid a name clashes. -+ */ -+ -+#ifndef __ASSEMBLY__ -+ -+typedef unsigned short umode_t; -+ -+/* -+ * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the -+ * header files exported to user space -+ */ -+ -+typedef __signed__ char __s8; -+typedef unsigned char __u8; -+ -+typedef __signed__ short __s16; -+typedef unsigned short __u16; -+ -+typedef __signed__ int __s32; -+typedef unsigned int __u32; -+ -+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -+typedef __signed__ long long __s64; -+typedef unsigned long long __u64; -+#endif -+ -+#endif /* __ASSEMBLY__ */ -+ -+/* -+ * These aren't exported outside the kernel to avoid name space clashes -+ */ -+#ifdef __KERNEL__ -+ -+#define BITS_PER_LONG 32 -+ -+#ifndef __ASSEMBLY__ -+ -+typedef signed char s8; -+typedef unsigned char u8; -+ -+typedef signed short s16; -+typedef unsigned short u16; -+ -+typedef signed int s32; -+typedef unsigned int u32; -+ -+typedef signed long long s64; -+typedef unsigned long long u64; -+ -+/* DMA addresses are always 32-bits wide */ -+ -+typedef u32 dma_addr_t; -+typedef u32 dma64_addr_t; -+ -+typedef unsigned short kmem_bufctl_t; -+ -+#endif /* __ASSEMBLY__ */ -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _NIOS_TYPES_H */ ---- linux/include/asm-nios2nommu/uaccess.h -+++ linux/include/asm-nios2nommu/uaccess.h -@@ -0,0 +1,183 @@ -+#ifndef __NIOS2NOMMU_UACCESS_H -+#define __NIOS2NOMMU_UACCESS_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * asm-nios2nommu/uaccess.h -+ * -+ * User space memory access functions -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Ported from asm-m68knommu/uaccess.h --wentao -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+#include -+#include -+#include -+ -+#define VERIFY_READ 0 -+#define VERIFY_WRITE 1 -+ -+#define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size)) -+ -+static inline int _access_ok(unsigned long addr, unsigned long size) -+{ -+ return (((unsigned long)addr < (unsigned long)nasys_program_mem_end) && -+ (((unsigned long)addr >= (unsigned long)nasys_program_mem))); -+} -+ -+extern inline int verify_area(int type, const void * addr, unsigned long size) -+{ -+ return access_ok(type,addr,size)?0:-EFAULT; -+} -+ -+/* -+ * The exception table consists of pairs of addresses: the first is the -+ * address of an instruction that is allowed to fault, and the second is -+ * the address at which the program should continue. No registers are -+ * modified, so it is entirely up to the continuation code to figure out -+ * what to do. -+ * -+ * All the routines below use bits of fixup code that are out of line -+ * with the main instruction path. This means when everything is well, -+ * we don't even have to jump over them. Further, they do not intrude -+ * on our cache or tlb entries. -+ */ -+ -+#define ARCH_HAS_SEARCH_EXTABLE -+//;dgt2;tmp; -+ -+struct exception_table_entry -+{ -+ unsigned long insn, fixup; -+}; -+ -+/* Returns 0 if exception not found and fixup otherwise. */ -+extern unsigned long search_exception_table(unsigned long); -+ -+ -+/* -+ * These are the main single-value transfer routines. They automatically -+ * use the right size if we just have the right pointer type. -+ */ -+ -+#define put_user(x, ptr) \ -+({ \ -+ int __pu_err = 0; \ -+ typeof(*(ptr)) __pu_val = (x); \ -+ switch (sizeof (*(ptr))) { \ -+ case 1: \ -+ case 2: \ -+ case 4: \ -+ case 8: \ -+ memcpy(ptr, &__pu_val, sizeof (*(ptr))); \ -+ break; \ -+ default: \ -+ __pu_err = __put_user_bad(); \ -+ break; \ -+ } \ -+ __pu_err; \ -+}) -+#define __put_user(x, ptr) put_user(x, ptr) -+ -+extern int __put_user_bad(void); -+ -+/* -+ * Tell gcc we read from memory instead of writing: this is because -+ * we do not write to any memory gcc knows about, so there are no -+ * aliasing issues. -+ */ -+ -+#define __ptr(x) ((unsigned long *)(x)) -+ -+#define get_user(x, ptr) \ -+({ \ -+ int __gu_err = 0; \ -+ typeof(*(ptr)) __gu_val = 0; \ -+ switch (sizeof(*(ptr))) { \ -+ case 1: \ -+ case 2: \ -+ case 4: \ -+ case 8: \ -+ memcpy(&__gu_val, ptr, sizeof (*(ptr))); \ -+ break; \ -+ default: \ -+ __gu_val = 0; \ -+ __gu_err = __get_user_bad(); \ -+ break; \ -+ } \ -+ (x) = __gu_val; \ -+ __gu_err; \ -+}) -+#define __get_user(x, ptr) get_user(x, ptr) -+ -+extern int __get_user_bad(void); -+ -+#define copy_from_user(to, from, n) (memcpy(to, from, n), 0) -+#define copy_to_user(to, from, n) (memcpy(to, from, n), 0) -+ -+#define __copy_from_user(to, from, n) copy_from_user(to, from, n) -+#define __copy_to_user(to, from, n) copy_to_user(to, from, n) -+#define __copy_to_user_inatomic __copy_to_user -+#define __copy_from_user_inatomic __copy_from_user -+ -+#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; }) -+ -+#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; }) -+ -+/* -+ * Copy a null terminated string from userspace. -+ */ -+ -+static inline long -+strncpy_from_user(char *dst, const char *src, long count) -+{ -+ char *tmp; -+ strncpy(dst, src, count); -+ for (tmp = dst; *tmp && count > 0; tmp++, count--) -+ ; -+ return(tmp - dst); /* DAVIDM should we count a NUL ? check getname */ -+} -+ -+/* -+ * Return the size of a string (including the ending 0) -+ * -+ * Return 0 on exception, a value greater than N if too long -+ */ -+static inline long strnlen_user(const char *src, long n) -+{ -+ return(strlen(src) + 1); /* DAVIDM make safer */ -+} -+ -+#define strlen_user(str) strnlen_user(str, 32767) -+ -+/* -+ * Zero Userspace -+ */ -+ -+static inline unsigned long -+clear_user(void *to, unsigned long n) -+{ -+ memset(to, 0, n); -+ return(0); -+} -+ -+#endif /* _NIOS2NOMMU_UACCESS_H */ ---- linux/include/asm-nios2nommu/uart_struct.h -+++ linux/include/asm-nios2nommu/uart_struct.h -@@ -0,0 +1,83 @@ -+ -+// UART Registers -+typedef volatile struct -+ { -+ int np_uartrxdata; // Read-only, 8-bit -+ int np_uarttxdata; // Write-only, 8-bit -+ int np_uartstatus; // Read-only, 8-bit -+ int np_uartcontrol; // Read/Write, 9-bit -+ int np_uartdivisor; // Read/Write, 16-bit, optional -+ int np_uartendofpacket; // Read/Write, end-of-packet character -+ } np_uart; -+ -+// UART Status Register Bits -+enum -+ { -+ np_uartstatus_eop_bit = 12, -+ np_uartstatus_cts_bit = 11, -+ np_uartstatus_dcts_bit = 10, -+ np_uartstatus_e_bit = 8, -+ np_uartstatus_rrdy_bit = 7, -+ np_uartstatus_trdy_bit = 6, -+ np_uartstatus_tmt_bit = 5, -+ np_uartstatus_toe_bit = 4, -+ np_uartstatus_roe_bit = 3, -+ np_uartstatus_brk_bit = 2, -+ np_uartstatus_fe_bit = 1, -+ np_uartstatus_pe_bit = 0, -+ -+ np_uartstatus_eop_mask = (1<<12), -+ np_uartstatus_cts_mask = (1<<11), -+ np_uartstatus_dcts_mask = (1<<10), -+ np_uartstatus_e_mask = (1<<8), -+ np_uartstatus_rrdy_mask = (1<<7), -+ np_uartstatus_trdy_mask = (1<<6), -+ np_uartstatus_tmt_mask = (1<<5), -+ np_uartstatus_toe_mask = (1<<4), -+ np_uartstatus_roe_mask = (1<<3), -+ np_uartstatus_brk_mask = (1<<2), -+ np_uartstatus_fe_mask = (1<<1), -+ np_uartstatus_pe_mask = (1<<0) -+ }; -+ -+// UART Control Register Bits -+enum -+ { -+ np_uartcontrol_ieop_bit = 12, -+ np_uartcontrol_rts_bit = 11, -+ np_uartcontrol_idcts_bit = 10, -+ np_uartcontrol_tbrk_bit = 9, -+ np_uartcontrol_ie_bit = 8, -+ np_uartcontrol_irrdy_bit = 7, -+ np_uartcontrol_itrdy_bit = 6, -+ np_uartcontrol_itmt_bit = 5, -+ np_uartcontrol_itoe_bit = 4, -+ np_uartcontrol_iroe_bit = 3, -+ np_uartcontrol_ibrk_bit = 2, -+ np_uartcontrol_ife_bit = 1, -+ np_uartcontrol_ipe_bit = 0, -+ -+ np_uartcontrol_ieop_mask = (1<<12), -+ np_uartcontrol_rts_mask = (1<<11), -+ np_uartcontrol_idcts_mask = (1<<10), -+ np_uartcontrol_tbrk_mask = (1<<9), -+ np_uartcontrol_ie_mask = (1<<8), -+ np_uartcontrol_irrdy_mask = (1<<7), -+ np_uartcontrol_itrdy_mask = (1<<6), -+ np_uartcontrol_itmt_mask = (1<<5), -+ np_uartcontrol_itoe_mask = (1<<4), -+ np_uartcontrol_iroe_mask = (1<<3), -+ np_uartcontrol_ibrk_mask = (1<<2), -+ np_uartcontrol_ife_mask = (1<<1), -+ np_uartcontrol_ipe_mask = (1<<0) -+ }; -+ -+// UART Routines -+int nr_uart_rxchar(np_uart *uartBase); // 0 for default UART -+void nr_uart_txcr(void); -+void nr_uart_txchar(int c,np_uart *uartBase); // 0 for default UART -+void nr_uart_txhex(int x); // 16 or 32 bits -+void nr_uart_txhex16(short x); -+void nr_uart_txhex32(long x); -+void nr_uart_txstring(char *s); -+ ---- linux/include/asm-nios2nommu/ucontext.h -+++ linux/include/asm-nios2nommu/ucontext.h -@@ -0,0 +1,63 @@ -+#ifndef _NIOSKNOMMU_UCONTEXT_H -+#define _NIOSKNOMMU_UCONTEXT_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/ucontext.h -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+typedef int greg_t; -+#define NGREG 32 -+typedef greg_t gregset_t[NGREG]; -+ -+#ifdef CONFIG_FPU -+typedef struct fpregset { -+ int f_pcr; -+ int f_psr; -+ int f_fpiaddr; -+ int f_fpregs[8][3]; -+} fpregset_t; -+#endif -+ -+struct mcontext { -+ int version; -+ int status_extension; -+ gregset_t gregs; -+#ifdef CONFIG_FPU -+ fpregset_t fpregs; -+#endif -+}; -+ -+#define MCONTEXT_VERSION 2 -+ -+struct ucontext { -+ unsigned long uc_flags; -+ struct ucontext *uc_link; -+ stack_t uc_stack; -+ struct mcontext uc_mcontext; -+#ifdef CONFIG_FPU -+ unsigned long uc_filler[80]; -+#endif -+ sigset_t uc_sigmask; /* mask last for extensibility */ -+}; -+ -+#endif ---- linux/include/asm-nios2nommu/unaligned.h -+++ linux/include/asm-nios2nommu/unaligned.h -@@ -0,0 +1,43 @@ -+#ifndef __NIOS_UNALIGNED_H -+#define __NIOS_UNALIGNED_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/unaligned.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* -+ * The nios cannot do unaligned accesses itself. -+ */ -+ -+#define get_unaligned(ptr) ({ \ -+ typeof((*(ptr))) x; \ -+ memcpy(&x, (void*)ptr, sizeof(*(ptr))); \ -+ x; \ -+}) -+ -+#define put_unaligned(val, ptr) ({ \ -+ typeof((*(ptr))) x = val; \ -+ memcpy((void*)ptr, &x, sizeof(*(ptr))); \ -+}) -+ -+#endif /* __NIOS_UNALIGNED_H */ ---- linux/include/asm-nios2nommu/unistd.h -+++ linux/include/asm-nios2nommu/unistd.h -@@ -0,0 +1,686 @@ -+#ifndef _ASM_NIOS_UNISTD_H_ -+#define _ASM_NIOS_UNISTD_H_ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/unistd.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * //vic - kernel_thread moved to process.c -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+/* TRAP isr expects the trap# (syscall=#TRAP_ID_SYSCALL) in r2, -+ * the syscall # in r3, and arguments in r4, r5, ... -+ * Return argument expected in r2. -+ */ -+ -+#define __NR_restart_syscall 0 -+#define __NR_exit 1 -+#define __NR_fork 2 -+#define __NR_read 3 -+#define __NR_write 4 -+#define __NR_open 5 -+#define __NR_close 6 -+#define __NR_waitpid 7 -+#define __NR_creat 8 -+#define __NR_link 9 -+#define __NR_unlink 10 -+#define __NR_execve 11 -+#define __NR_chdir 12 -+#define __NR_time 13 -+#define __NR_mknod 14 -+#define __NR_chmod 15 -+#define __NR_chown 16 -+#define __NR_break 17 -+#define __NR_oldstat 18 -+#define __NR_lseek 19 -+#define __NR_getpid 20 -+#define __NR_mount 21 -+#define __NR_umount 22 -+#define __NR_setuid 23 -+#define __NR_getuid 24 -+#define __NR_stime 25 -+#define __NR_ptrace 26 -+#define __NR_alarm 27 -+#define __NR_oldfstat 28 -+#define __NR_pause 29 -+#define __NR_utime 30 -+#define __NR_stty 31 -+#define __NR_gtty 32 -+#define __NR_access 33 -+#define __NR_nice 34 -+#define __NR_ftime 35 -+#define __NR_sync 36 -+#define __NR_kill 37 -+#define __NR_rename 38 -+#define __NR_mkdir 39 -+#define __NR_rmdir 40 -+#define __NR_dup 41 -+#define __NR_pipe 42 -+#define __NR_times 43 -+#define __NR_prof 44 -+#define __NR_brk 45 -+#define __NR_setgid 46 -+#define __NR_getgid 47 -+#define __NR_signal 48 -+#define __NR_geteuid 49 -+#define __NR_getegid 50 -+#define __NR_acct 51 -+#define __NR_umount2 52 //vic #define __NR_phys 52 -+#define __NR_lock 53 -+#define __NR_ioctl 54 -+#define __NR_fcntl 55 -+#define __NR_mpx 56 -+#define __NR_setpgid 57 -+#define __NR_ulimit 58 -+#define __NR_oldolduname 59 -+#define __NR_umask 60 -+#define __NR_chroot 61 -+#define __NR_ustat 62 -+#define __NR_dup2 63 -+#define __NR_getppid 64 -+#define __NR_getpgrp 65 -+#define __NR_setsid 66 -+#define __NR_sigaction 67 -+#define __NR_sgetmask 68 -+#define __NR_ssetmask 69 -+#define __NR_setreuid 70 -+#define __NR_setregid 71 -+#define __NR_sigsuspend 72 -+#define __NR_sigpending 73 -+#define __NR_sethostname 74 -+#define __NR_setrlimit 75 -+#define __NR_getrlimit 76 -+#define __NR_getrusage 77 -+#define __NR_gettimeofday 78 -+#define __NR_settimeofday 79 -+#define __NR_getgroups 80 -+#define __NR_setgroups 81 -+#define __NR_select 82 -+#define __NR_symlink 83 -+#define __NR_oldlstat 84 -+#define __NR_readlink 85 -+#define __NR_uselib 86 -+#define __NR_swapon 87 -+#define __NR_reboot 88 -+#define __NR_readdir 89 -+#define __NR_mmap 90 -+#define __NR_munmap 91 -+#define __NR_truncate 92 -+#define __NR_ftruncate 93 -+#define __NR_fchmod 94 -+#define __NR_fchown 95 -+#define __NR_getpriority 96 -+#define __NR_setpriority 97 -+#define __NR_profil 98 -+#define __NR_statfs 99 -+#define __NR_fstatfs 100 -+#define __NR_ioperm 101 -+#define __NR_socketcall 102 -+#define __NR_syslog 103 -+#define __NR_setitimer 104 -+#define __NR_getitimer 105 -+#define __NR_stat 106 -+#define __NR_lstat 107 -+#define __NR_fstat 108 -+#define __NR_olduname 109 -+#define __NR_iopl /* 110 */ not supported -+#define __NR_vhangup 111 -+#define __NR_idle /* 112 */ Obsolete -+#define __NR_vm86 /* 113 */ not supported -+#define __NR_wait4 114 -+#define __NR_swapoff 115 -+#define __NR_sysinfo 116 -+#define __NR_ipc 117 -+#define __NR_fsync 118 -+#define __NR_sigreturn 119 -+#define __NR_clone 120 -+#define __NR_setdomainname 121 -+#define __NR_uname 122 -+#define __NR_cacheflush 123 -+#define __NR_adjtimex 124 -+#define __NR_mprotect 125 -+#define __NR_sigprocmask 126 -+#define __NR_create_module 127 -+#define __NR_init_module 128 -+#define __NR_delete_module 129 -+#define __NR_get_kernel_syms 130 -+#define __NR_quotactl 131 -+#define __NR_getpgid 132 -+#define __NR_fchdir 133 -+#define __NR_bdflush 134 -+#define __NR_sysfs 135 -+#define __NR_personality 136 -+#define __NR_afs_syscall 137 /* Syscall for Andrew File System */ -+#define __NR_setfsuid 138 -+#define __NR_setfsgid 139 -+#define __NR__llseek 140 -+#define __NR_getdents 141 -+#define __NR__newselect 142 -+#define __NR_flock 143 -+#define __NR_msync 144 -+#define __NR_readv 145 -+#define __NR_writev 146 -+#define __NR_getsid 147 -+#define __NR_fdatasync 148 -+#define __NR__sysctl 149 -+#define __NR_mlock 150 -+#define __NR_munlock 151 -+#define __NR_mlockall 152 -+#define __NR_munlockall 153 -+#define __NR_sched_setparam 154 -+#define __NR_sched_getparam 155 -+#define __NR_sched_setscheduler 156 -+#define __NR_sched_getscheduler 157 -+#define __NR_sched_yield 158 -+#define __NR_sched_get_priority_max 159 -+#define __NR_sched_get_priority_min 160 -+#define __NR_sched_rr_get_interval 161 -+#define __NR_nanosleep 162 -+#define __NR_mremap 163 -+#define __NR_setresuid 164 -+#define __NR_getresuid 165 -+#define __NR_getpagesize 166 -+#define __NR_query_module 167 -+#define __NR_poll 168 -+#define __NR_nfsservctl 169 -+#define __NR_setresgid 170 -+#define __NR_getresgid 171 -+#define __NR_prctl 172 -+#define __NR_rt_sigreturn 173 -+#define __NR_rt_sigaction 174 -+#define __NR_rt_sigprocmask 175 -+#define __NR_rt_sigpending 176 -+#define __NR_rt_sigtimedwait 177 -+#define __NR_rt_sigqueueinfo 178 -+#define __NR_rt_sigsuspend 179 -+#define __NR_pread 180 -+#define __NR_pwrite 181 -+#define __NR_lchown 182 -+#define __NR_getcwd 183 -+#define __NR_capget 184 -+#define __NR_capset 185 -+#define __NR_sigaltstack 186 -+#define __NR_sendfile 187 -+#define __NR_getpmsg 188 /* some people actually want streams */ -+#define __NR_putpmsg 189 /* some people actually want streams */ -+#define __NR_vfork 190 -+#define __NR_ugetrlimit 191 -+#define __NR_mmap2 192 -+#define __NR_truncate64 193 -+#define __NR_ftruncate64 194 -+#define __NR_stat64 195 -+#define __NR_lstat64 196 -+#define __NR_fstat64 197 -+#define __NR_chown32 198 -+#define __NR_getuid32 199 -+#define __NR_getgid32 200 -+#define __NR_geteuid32 201 -+#define __NR_getegid32 202 -+#define __NR_setreuid32 203 -+#define __NR_setregid32 204 -+#define __NR_getgroups32 205 -+#define __NR_setgroups32 206 -+#define __NR_fchown32 207 -+#define __NR_setresuid32 208 -+#define __NR_getresuid32 209 -+#define __NR_setresgid32 210 -+#define __NR_getresgid32 211 -+#define __NR_lchown32 212 -+#define __NR_setuid32 213 -+#define __NR_setgid32 214 -+#define __NR_setfsuid32 215 -+#define __NR_setfsgid32 216 -+#define __NR_pivot_root 217 -+/* 218 unused */ -+/* 219 unused */ -+#define __NR_getdents64 220 -+#define __NR_gettid 221 -+#define __NR_tkill 222 -+#define __NR_setxattr 223 -+#define __NR_lsetxattr 224 -+#define __NR_fsetxattr 225 -+#define __NR_getxattr 226 -+#define __NR_lgetxattr 227 -+#define __NR_fgetxattr 228 -+#define __NR_listxattr 229 -+#define __NR_llistxattr 230 -+#define __NR_flistxattr 231 -+#define __NR_removexattr 232 -+#define __NR_lremovexattr 233 -+#define __NR_fremovexattr 234 -+#define __NR_futex 235 -+#define __NR_sendfile64 236 -+#define __NR_mincore 237 -+#define __NR_madvise 238 -+#define __NR_fcntl64 239 -+#define __NR_readahead 240 -+#define __NR_io_setup 241 -+#define __NR_io_destroy 242 -+#define __NR_io_getevents 243 -+#define __NR_io_submit 244 -+#define __NR_io_cancel 245 -+#define __NR_fadvise64 246 -+#define __NR_exit_group 247 -+#define __NR_lookup_dcookie 248 -+#define __NR_epoll_create 249 -+#define __NR_epoll_ctl 250 -+#define __NR_epoll_wait 251 -+#define __NR_remap_file_pages 252 -+#define __NR_set_tid_address 253 -+#define __NR_timer_create 254 -+#define __NR_timer_settime 255 -+#define __NR_timer_gettime 256 -+#define __NR_timer_getoverrun 257 -+#define __NR_timer_delete 258 -+#define __NR_clock_settime 259 -+#define __NR_clock_gettime 260 -+#define __NR_clock_getres 261 -+#define __NR_clock_nanosleep 262 -+#define __NR_statfs64 263 -+#define __NR_fstatfs64 264 -+#define __NR_tgkill 265 -+#define __NR_utimes 266 -+#define __NR_fadvise64_64 267 -+#define __NR_mbind 268 -+#define __NR_get_mempolicy 269 -+#define __NR_set_mempolicy 270 -+#define __NR_mq_open 271 -+#define __NR_mq_unlink 272 -+#define __NR_mq_timedsend 273 -+#define __NR_mq_timedreceive 274 -+#define __NR_mq_notify 275 -+#define __NR_mq_getsetattr 276 -+#define __NR_waitid 277 -+#define __NR_sys_setaltroot 278 -+#define __NR_add_key 279 -+#define __NR_request_key 280 -+#define __NR_keyctl 281 -+ -+#define NR_syscalls 282 -+ -+/* user-visible error numbers are in the range -1 - -122: see -+ */ -+ -+#define __syscall_return(type, res) \ -+do { \ -+ if ((unsigned long)(res) >= (unsigned long)(-125)) { \ -+ \ -+ /* avoid using res which is declared to be in \ -+ register r2; errno might expand to a function \ -+ call and clobber it. */ \ -+ \ -+ int __err = -(res); \ -+ errno = __err; \ -+ res = -1; \ -+ } \ -+ return (type) (res); \ -+} while (0) -+ -+#define _syscall0(type,name) \ -+type name(void) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+//;dgt2;tmp;can we RELY on syscall1 arg a -+//;dgt2;tmp; already being in r4 ? -+#define _syscall1(type,name,atype,a) \ -+type name(atype a) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ " mov r4, %3\n\t" /* (long) a */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ , "r" ((long) a) /* %3 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ , "r4" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+//;dgt2;tmp;can we RELY on syscall2 args a,b -+//;dgt2;tmp; already being in r4,r5 ? -+#define _syscall2(type,name,atype,a,btype,b) \ -+type name(atype a,btype b) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ " mov r4, %3\n\t" /* (long) a */ \ -+ " mov r5, %4\n\t" /* (long) b */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ , "r" ((long) a) /* %3 */ \ -+ , "r" ((long) b) /* %4 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ , "r4" /* Clobbered */ \ -+ , "r5" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+//;dgt2;tmp;can we RELY on syscall3 args a,b,c -+//;dgt2;tmp; already being in r4,r5,r6 ? -+#define _syscall3(type,name,atype,a,btype,b,ctype,c) \ -+type name(atype a,btype b,ctype c) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ " mov r4, %3\n\t" /* (long) a */ \ -+ " mov r5, %4\n\t" /* (long) b */ \ -+ " mov r6, %5\n\t" /* (long) c */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ , "r" ((long) a) /* %3 */ \ -+ , "r" ((long) b) /* %4 */ \ -+ , "r" ((long) c) /* %5 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ , "r4" /* Clobbered */ \ -+ , "r5" /* Clobbered */ \ -+ , "r6" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+//;dgt2;tmp;can we RELY on syscall4 args a,b,c,d -+//;dgt2;tmp; already being in r4,r5,r6,r7 ? -+#define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \ -+type name (atype a, btype b, ctype c, dtype d) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ " mov r4, %3\n\t" /* (long) a */ \ -+ " mov r5, %4\n\t" /* (long) b */ \ -+ " mov r6, %5\n\t" /* (long) c */ \ -+ " mov r7, %6\n\t" /* (long) d */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ , "r" ((long) a) /* %3 */ \ -+ , "r" ((long) b) /* %4 */ \ -+ , "r" ((long) c) /* %5 */ \ -+ , "r" ((long) d) /* %6 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ , "r4" /* Clobbered */ \ -+ , "r5" /* Clobbered */ \ -+ , "r6" /* Clobbered */ \ -+ , "r7" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+//;dgt2;tmp;can we RELY on syscall5 args a,b,c,d -+//;dgt2;tmp; already being in r4,r5,r6,r7 ? -+#define _syscall5(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e) \ -+type name (atype a,btype b,ctype c,dtype d,etype e) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ " mov r4, %3\n\t" /* (long) a */ \ -+ " mov r5, %4\n\t" /* (long) b */ \ -+ " mov r6, %5\n\t" /* (long) c */ \ -+ " mov r7, %6\n\t" /* (long) c */ \ -+ " mov r8, %7\n\t" /* (long) e */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ , "r" ((long) a) /* %3 */ \ -+ , "r" ((long) b) /* %4 */ \ -+ , "r" ((long) c) /* %5 */ \ -+ , "r" ((long) d) /* %6 */ \ -+ , "r" ((long) e) /* %7 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ , "r4" /* Clobbered */ \ -+ , "r5" /* Clobbered */ \ -+ , "r6" /* Clobbered */ \ -+ , "r7" /* Clobbered */ \ -+ , "r8" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+//;dgt2;tmp;can we RELY on syscall6 args a,b,c,d -+//;dgt2;tmp; already being in r4,r5,r6,r7 ? -+#define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \ -+type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ " mov r4, %3\n\t" /* (long) a */ \ -+ " mov r5, %4\n\t" /* (long) b */ \ -+ " mov r6, %5\n\t" /* (long) c */ \ -+ " mov r7, %6\n\t" /* (long) c */ \ -+ " mov r8, %7\n\t" /* (long) e */ \ -+ " mov r9, %8\n\t" /* (long) f */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ , "r" ((long) a) /* %3 */ \ -+ , "r" ((long) b) /* %4 */ \ -+ , "r" ((long) c) /* %5 */ \ -+ , "r" ((long) d) /* %6 */ \ -+ , "r" ((long) e) /* %7 */ \ -+ , "r" ((long) f) /* %8 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ , "r4" /* Clobbered */ \ -+ , "r5" /* Clobbered */ \ -+ , "r6" /* Clobbered */ \ -+ , "r7" /* Clobbered */ \ -+ , "r8" /* Clobbered */ \ -+ , "r9" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+#ifdef __KERNEL__ -+#define __ARCH_WANT_IPC_PARSE_VERSION -+#define __ARCH_WANT_OLD_READDIR -+#define __ARCH_WANT_OLD_STAT -+#define __ARCH_WANT_STAT64 -+#define __ARCH_WANT_SYS_ALARM -+#define __ARCH_WANT_SYS_GETHOSTNAME -+#define __ARCH_WANT_SYS_PAUSE -+#define __ARCH_WANT_SYS_SGETMASK -+#define __ARCH_WANT_SYS_SIGNAL -+#define __ARCH_WANT_SYS_TIME -+#define __ARCH_WANT_SYS_UTIME -+#define __ARCH_WANT_SYS_WAITPID -+#define __ARCH_WANT_SYS_SOCKETCALL -+#define __ARCH_WANT_SYS_FADVISE64 -+#define __ARCH_WANT_SYS_GETPGRP -+#define __ARCH_WANT_SYS_LLSEEK -+#define __ARCH_WANT_SYS_NICE -+#define __ARCH_WANT_SYS_OLD_GETRLIMIT -+#define __ARCH_WANT_SYS_OLDUMOUNT -+#define __ARCH_WANT_SYS_SIGPENDING -+#define __ARCH_WANT_SYS_SIGPROCMASK -+#define __ARCH_WANT_SYS_RT_SIGACTION -+#endif -+ -+#ifdef __KERNEL_SYSCALLS__ -+ -+/* -+ * we need this inline - forking from kernel space will result -+ * in NO COPY ON WRITE (!!!), until an execve is executed. This -+ * is no problem, but for the stack. This is handled by not letting -+ * main() use the stack at all after fork(). Thus, no function -+ * calls - which means inline code for fork too, as otherwise we -+ * would use the stack upon exit from 'fork()'. -+ * -+ * Actually only pause and fork are needed inline, so that there -+ * won't be any messing with the stack from main(), but we define -+ * some others too. -+ */ -+#define __NR__exit __NR_exit -+static inline _syscall0(int,pause) -+static inline _syscall0(int,sync) -+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) -+static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) -+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) -+static inline _syscall1(int,delete_module,const char *,name) -+ -+static inline pid_t wait(int * wait_stat) -+{ -+ return waitpid(-1,wait_stat,0); -+} -+ -+#endif -+ -+/* -+ * "Conditional" syscalls -+ * -+ * What we want is __attribute__((weak,alias("sys_ni_syscall"))), -+ * but it doesn't work on all toolchains, so we just do it by hand -+ */ -+#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); -+ -+#endif /* _ASM_NIOS_UNISTD_H_ */ ---- linux/include/asm-nios2nommu/user.h -+++ linux/include/asm-nios2nommu/user.h -@@ -0,0 +1,112 @@ -+#ifndef _NIOS2NOMMU_USER_H -+#define _NIOS2NOMMU_USER_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/user.h -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+/* Core file format: The core file is written in such a way that gdb -+ can understand it and provide useful information to the user (under -+ linux we use the 'trad-core' bfd). There are quite a number of -+ obstacles to being able to view the contents of the floating point -+ registers, and until these are solved you will not be able to view the -+ contents of them. Actually, you can read in the core file and look at -+ the contents of the user struct to find out what the floating point -+ registers contain. -+ The actual file contents are as follows: -+ UPAGE: 1 page consisting of a user struct that tells gdb what is present -+ in the file. Directly after this is a copy of the task_struct, which -+ is currently not used by gdb, but it may come in useful at some point. -+ All of the registers are stored as part of the upage. The upage should -+ always be only one page. -+ DATA: The data area is stored. We use current->end_text to -+ current->brk to pick up all of the user variables, plus any memory -+ that may have been malloced. No attempt is made to determine if a page -+ is demand-zero or if a page is totally unused, we just cover the entire -+ range. All of the addresses are rounded in such a way that an integral -+ number of pages is written. -+ STACK: We need the stack information in order to get a meaningful -+ backtrace. We need to write the data from (esp) to -+ current->start_stack, so we round each of these off in order to be able -+ to write an integer number of pages. -+ The minimum core file size is 3 pages, or 12288 bytes. -+*/ -+ -+struct user_m68kfp_struct { -+ unsigned long fpregs[8*3]; /* fp0-fp7 registers */ -+ unsigned long fpcntl[3]; /* fp control regs */ -+}; -+ -+/* This is needs more work, probably should look like gdb useage */ -+struct user_regs_struct { -+ long r1,r2,r3,r4,r5,r6,r7,r8; -+ long r9,r10,r11,r12,r13,r14,r15; -+ long r16,r17,r18,r19,r20,r21,r22,r23; -+ long gp; -+ long sp; -+ long ra; -+ long fp; -+ long orig_r2; -+ long estatus; -+ long status_extension; -+ long ea; -+}; -+ -+ -+/* When the kernel dumps core, it starts by dumping the user struct - -+ this will be used by gdb to figure out where the data and stack segments -+ are within the file, and what virtual addresses to use. */ -+struct user{ -+/* We start with the registers, to mimic the way that "memory" is returned -+ from the ptrace(3,...) function. */ -+ struct user_regs_struct regs; /* Where the registers are actually stored */ -+/* ptrace does not yet supply these. Someday.... */ -+ int u_fpvalid; /* True if math co-processor being used. */ -+ /* for this mess. Not yet used. */ -+ struct user_m68kfp_struct m68kfp; /* Math Co-processor registers. */ -+/* The rest of this junk is to help gdb figure out what goes where */ -+ unsigned long int u_tsize; /* Text segment size (pages). */ -+ unsigned long int u_dsize; /* Data segment size (pages). */ -+ unsigned long int u_ssize; /* Stack segment size (pages). */ -+ unsigned long start_code; /* Starting virtual address of text. */ -+ unsigned long start_stack; /* Starting virtual address of stack area. -+ This is actually the bottom of the stack, -+ the top of the stack is always found in the -+ esp register. */ -+ long int signal; /* Signal that caused the core dump. */ -+ int reserved; /* No longer used */ -+ struct user_regs_struct *u_ar0; -+ /* Used by gdb to help find the values for */ -+ /* the registers. */ -+ struct user_m68kfp_struct* u_fpstate; /* Math Co-processor pointer. */ -+ unsigned long magic; /* To uniquely identify a core file */ -+ char u_comm[32]; /* User command that was responsible */ -+}; -+#define NBPG PAGE_SIZE -+#define UPAGES 1 -+#define HOST_TEXT_START_ADDR (u.start_code) -+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) -+ -+#endif ---- linux/include/asm-nios2nommu/virtconvert.h -+++ linux/include/asm-nios2nommu/virtconvert.h -@@ -0,0 +1,47 @@ -+#ifndef __NIOS_VIRT_CONVERT__ -+#define __NIOS_VIRT_CONVERT__ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/virtconvert.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* -+ * Macros used for converting between virtual and physical mappings. -+ */ -+ -+#ifdef __KERNEL__ -+ -+// #include -+#include -+#include -+ -+#define mm_ptov(vaddr) ((void *) (vaddr)) -+#define mm_vtop(vaddr) ((unsigned long) (vaddr)) -+#define phys_to_virt(vaddr) ((void *) (vaddr)) -+#define virt_to_phys(vaddr) ((unsigned long) (vaddr)) -+ -+#define virt_to_bus virt_to_phys -+#define bus_to_virt phys_to_virt -+ -+#endif /*__KERNEL__ */ -+#endif /*__NIOS_VIRT_CONVERT__*/ diff --git a/toolchain/kernel-headers/linux-libc-headers-2.6.11.0-mips-nptl.patch b/toolchain/kernel-headers/linux-libc-headers-2.6.11.0-mips-nptl.patch deleted file mode 100644 index 72571b05e9..0000000000 --- a/toolchain/kernel-headers/linux-libc-headers-2.6.11.0-mips-nptl.patch +++ /dev/null @@ -1,75 +0,0 @@ -diff -urN linux-libc-headers-2.6.11.0/include/asm-mips/inst.h linux-libc-headers-2.6.11.0-nptl/include/asm-mips/inst.h ---- linux-libc-headers-2.6.11.0/include/asm-mips/inst.h 2004-10-31 13:54:20.000000000 -0600 -+++ linux-libc-headers-2.6.11.0-nptl/include/asm-mips/inst.h 2005-05-04 23:15:45.890613280 -0500 -@@ -28,7 +28,7 @@ - sdl_op, sdr_op, swr_op, cache_op, - ll_op, lwc1_op, lwc2_op, pref_op, - lld_op, ldc1_op, ldc2_op, ld_op, -- sc_op, swc1_op, swc2_op, major_3b_op, /* Opcode 0x3b is unused */ -+ sc_op, swc1_op, swc2_op, rdhwr_op, - scd_op, sdc1_op, sdc2_op, sd_op - }; - -diff -urN linux-libc-headers-2.6.11.0/include/asm-mips/unistd.h linux-libc-headers-2.6.11.0-nptl/include/asm-mips/unistd.h ---- linux-libc-headers-2.6.11.0/include/asm-mips/unistd.h 2005-01-08 08:02:51.000000000 -0600 -+++ linux-libc-headers-2.6.11.0-nptl/include/asm-mips/unistd.h 2005-05-04 23:16:48.240229738 -0500 -@@ -303,16 +303,17 @@ - #define __NR_add_key (__NR_Linux + 280) - #define __NR_request_key (__NR_Linux + 281) - #define __NR_keyctl (__NR_Linux + 282) -+#define __NR_set_thread_area (__NR_Linux + 283) - - /* - * Offset of the last Linux o32 flavoured syscall - */ --#define __NR_Linux_syscalls 282 -+#define __NR_Linux_syscalls 283 - - #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ - - #define __NR_O32_Linux 4000 --#define __NR_O32_Linux_syscalls 282 -+#define __NR_O32_Linux_syscalls 283 - - #if _MIPS_SIM == _MIPS_SIM_ABI64 - -@@ -562,16 +563,17 @@ - #define __NR_add_key (__NR_Linux + 239) - #define __NR_request_key (__NR_Linux + 240) - #define __NR_keyctl (__NR_Linux + 241) -+#define __NR_set_thread_area (__NR_Linux + 242) - - /* - * Offset of the last Linux 64-bit flavoured syscall - */ --#define __NR_Linux_syscalls 241 -+#define __NR_Linux_syscalls 242 - - #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ - - #define __NR_64_Linux 5000 --#define __NR_64_Linux_syscalls 241 -+#define __NR_64_Linux_syscalls 242 - - #if _MIPS_SIM == _MIPS_SIM_NABI32 - -@@ -825,16 +827,17 @@ - #define __NR_add_key (__NR_Linux + 243) - #define __NR_request_key (__NR_Linux + 244) - #define __NR_keyctl (__NR_Linux + 245) -+#define __NR_set_thread_area (__NR_Linux + 246) - - /* - * Offset of the last N32 flavoured syscall - */ --#define __NR_Linux_syscalls 245 -+#define __NR_Linux_syscalls 246 - - #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ - - #define __NR_N32_Linux 6000 --#define __NR_N32_Linux_syscalls 245 -+#define __NR_N32_Linux_syscalls 246 - - #ifndef __ASSEMBLY__ - diff --git a/toolchain/kernel-headers/linux-libc-headers-2.6.11.0.patch b/toolchain/kernel-headers/linux-libc-headers-2.6.11.0.patch deleted file mode 100644 index f528b8b4c3..0000000000 --- a/toolchain/kernel-headers/linux-libc-headers-2.6.11.0.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- linux/include/linux/netfilter_ipv4/ip_nat.h.orig 2005-03-21 16:18:40.000000000 -0700 -+++ linux/include/linux/netfilter_ipv4/ip_nat.h 2005-03-21 16:23:54.000000000 -0700 -@@ -66,6 +66,15 @@ - struct ip_conntrack_manip manip; - }; - -+/* For backwards compat: don't use in modern code. */ -+struct ip_nat_multi_range_compat -+{ -+ unsigned int rangesize; /* Must be 1. */ -+ -+ /* hangs off end. */ -+ struct ip_nat_range range[1]; -+}; -+ - #define ip_nat_multi_range ip_nat_multi_range_compat - - #endif diff --git a/toolchain/kernel-headers/linux-libc-headers-2.6.12.0-arm-eabi.patch b/toolchain/kernel-headers/linux-libc-headers-2.6.12.0-arm-eabi.patch deleted file mode 100644 index dcbd21b0a1..0000000000 --- a/toolchain/kernel-headers/linux-libc-headers-2.6.12.0-arm-eabi.patch +++ /dev/null @@ -1,166 +0,0 @@ ---- linux-libc-headers-2.6.12.0/include/asm-arm/unistd.h 2005-07-06 03:17:41.000000000 +0300 -+++ linux-libc-headers-2.6.12.0-arm-eabi/include/asm-arm/unistd.h 2006-06-05 17:14:09.000000000 +0300 -@@ -15,10 +15,12 @@ - - #include - --#if defined(__thumb__) -+#define __NR_OABI_SYSCALL_BASE 0x900000 -+ -+#if defined(__thumb__) || defined(__ARM_EABI__) - #define __NR_SYSCALL_BASE 0 - #else --#define __NR_SYSCALL_BASE 0x900000 -+#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE - #endif - - /* -@@ -365,13 +375,13 @@ - #define __sys1(x) __sys2(x) - - #ifndef __syscall --#if defined(__thumb__) --#define __syscall(name) \ -- "push {r7}\n\t" \ -- "mov r7, #" __sys1(__NR_##name) "\n\t" \ -- "swi 0\n\t" \ -- "pop {r7}" -+#if defined(__thumb__) || defined(__ARM_EABI__) -+#define __SYS_REG(name) register long __sysreg __asm__("r7") = __NR_##name; -+#define __SYS_REG_LIST(regs...) "r" (__sysreg) , ##regs -+#define __syscall(name) "swi\t0" - #else -+#define __SYS_REG(name) -+#define __SYS_REG_LIST(regs...) regs - #define __syscall(name) "swi\t" __sys1(__NR_##name) "" - #endif - #endif -@@ -387,33 +397,34 @@ - - #define _syscall0(type,name) \ - type name(void) { \ -+ __SYS_REG(name) \ - register long __res_r0 __asm__("r0"); \ - long __res; \ - __asm__ __volatile__ ( \ - __syscall(name) \ - : "=r" (__res_r0) \ -- : \ -- : "lr"); \ -+ : __SYS_REG_LIST() ); \ - __res = __res_r0; \ - __syscall_return(type,__res); \ - } - - #define _syscall1(type,name,type1,arg1) \ - type name(type1 arg1) { \ -+ __SYS_REG(name) \ - register long __r0 __asm__("r0") = (long)arg1; \ - register long __res_r0 __asm__("r0"); \ - long __res; \ - __asm__ __volatile__ ( \ - __syscall(name) \ - : "=r" (__res_r0) \ -- : "r" (__r0) \ -- : "lr"); \ -+ : __SYS_REG_LIST( "0" (__r0) ) ); \ - __res = __res_r0; \ - __syscall_return(type,__res); \ - } - - #define _syscall2(type,name,type1,arg1,type2,arg2) \ - type name(type1 arg1,type2 arg2) { \ -+ __SYS_REG(name) \ - register long __r0 __asm__("r0") = (long)arg1; \ - register long __r1 __asm__("r1") = (long)arg2; \ - register long __res_r0 __asm__("r0"); \ -@@ -421,8 +432,7 @@ - __asm__ __volatile__ ( \ - __syscall(name) \ - : "=r" (__res_r0) \ -- : "r" (__r0),"r" (__r1) \ -- : "lr"); \ -+ : __SYS_REG_LIST( "0" (__r0), "r" (__r1) ) ); \ - __res = __res_r0; \ - __syscall_return(type,__res); \ - } -@@ -430,6 +440,7 @@ - - #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ - type name(type1 arg1,type2 arg2,type3 arg3) { \ -+ __SYS_REG(name) \ - register long __r0 __asm__("r0") = (long)arg1; \ - register long __r1 __asm__("r1") = (long)arg2; \ - register long __r2 __asm__("r2") = (long)arg3; \ -@@ -438,8 +449,7 @@ - __asm__ __volatile__ ( \ - __syscall(name) \ - : "=r" (__res_r0) \ -- : "r" (__r0),"r" (__r1),"r" (__r2) \ -- : "lr"); \ -+ : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) ); \ - __res = __res_r0; \ - __syscall_return(type,__res); \ - } -@@ -447,6 +457,7 @@ - - #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\ - type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \ -+ __SYS_REG(name) \ - register long __r0 __asm__("r0") = (long)arg1; \ - register long __r1 __asm__("r1") = (long)arg2; \ - register long __r2 __asm__("r2") = (long)arg3; \ -@@ -456,8 +467,7 @@ - __asm__ __volatile__ ( \ - __syscall(name) \ - : "=r" (__res_r0) \ -- : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3) \ -- : "lr"); \ -+ : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) ); \ - __res = __res_r0; \ - __syscall_return(type,__res); \ - } -@@ -465,6 +475,7 @@ - - #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ - type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \ -+ __SYS_REG(name) \ - register long __r0 __asm__("r0") = (long)arg1; \ - register long __r1 __asm__("r1") = (long)arg2; \ - register long __r2 __asm__("r2") = (long)arg3; \ -@@ -475,14 +486,15 @@ - __asm__ __volatile__ ( \ - __syscall(name) \ - : "=r" (__res_r0) \ -- : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3),"r" (__r4) \ -- : "lr"); \ -+ : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ -+ "r" (__r3), "r" (__r4) ) ); \ - __res = __res_r0; \ - __syscall_return(type,__res); \ - } - - #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \ - type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) { \ -+ __SYS_REG(name) \ - register long __r0 __asm__("r0") = (long)arg1; \ - register long __r1 __asm__("r1") = (long)arg2; \ - register long __r2 __asm__("r2") = (long)arg3; \ -@@ -494,14 +506,15 @@ - __asm__ __volatile__ ( \ - __syscall(name) \ - : "=r" (__res_r0) \ -- : "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3), "r" (__r4),"r" (__r5) \ -- : "lr"); \ -+ : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \ -+ "r" (__r3), "r" (__r4), "r" (__r5) ) ); \ - __res = __res_r0; \ - __syscall_return(type,__res); \ - } - - #ifdef __KERNEL_SYSCALLS__ - -+#include - #include - #include - diff --git a/toolchain/kernel-headers/linux-libc-headers-2.6.12.0-config-base-small.patch b/toolchain/kernel-headers/linux-libc-headers-2.6.12.0-config-base-small.patch deleted file mode 100644 index b6bbfd64ab..0000000000 --- a/toolchain/kernel-headers/linux-libc-headers-2.6.12.0-config-base-small.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -urN linux-libc-headers-2.6.12.0/include/linux/threads.h linux-libc-headers-2.6.12.0-patched/include/linux/threads.h ---- linux-libc-headers-2.6.12.0/include/linux/threads.h 2005-07-05 19:17:23.000000000 -0500 -+++ linux-libc-headers-2.6.12.0-patched/include/linux/threads.h 2005-08-18 11:39:15.000000000 -0500 -@@ -24,12 +24,11 @@ - /* - * This controls the default maximum pid allocated to a process - */ --#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000) -+#define PID_MAX_DEFAULT 0x8000 - - /* - * A maximum of 4 million PIDs should be enough for a while: - */ --#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \ -- (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)) -+#define PID_MAX_LIMIT (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT) - - #endif -diff -urN linux-libc-headers-2.6.12.0/include/linux/vt_kern.h linux-libc-headers-2.6.12.0-patched/include/linux/vt_kern.h ---- linux-libc-headers-2.6.12.0/include/linux/vt_kern.h 2005-07-05 19:17:23.000000000 -0500 -+++ linux-libc-headers-2.6.12.0-patched/include/linux/vt_kern.h 2005-08-18 11:39:30.000000000 -0500 -@@ -77,7 +77,7 @@ - * we can easily avoid touching user space while holding the console spinlock. - */ - --#define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE) -+#define CON_BUF_SIZE PAGE_SIZE - extern char con_buf[CON_BUF_SIZE]; - extern struct semaphore con_buf_sem; - diff --git a/toolchain/kernel-headers/linux-libc-headers-2.6.12.0-i2c_msg.patch b/toolchain/kernel-headers/linux-libc-headers-2.6.12.0-i2c_msg.patch deleted file mode 100644 index 2c1eac3f8b..0000000000 --- a/toolchain/kernel-headers/linux-libc-headers-2.6.12.0-i2c_msg.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -urpN linux-libc-headers-2.6.12.0/include/linux/i2c-dev.h linux-libc-headers-2.6.12.0-patched/include/linux/i2c-dev.h ---- linux-libc-headers-2.6.12.0/include/linux/i2c-dev.h 2005-07-06 02:17:21.000000000 +0200 -+++ linux-libc-headers-2.6.12.0-patched/include/linux/i2c-dev.h 2006-04-26 13:10:56.000000000 +0200 -@@ -44,8 +44,6 @@ struct i2c_msg { - #define I2C_M_NO_RD_ACK 0x0800 - short len; /* msg length */ - char *buf; /* pointer to msg data */ -- int err; -- short done; - }; - - /* To determine what functionality is present */ diff --git a/toolchain/kernel-headers/linux-libc-headers-2.6.12.0-mips-nptl.patch b/toolchain/kernel-headers/linux-libc-headers-2.6.12.0-mips-nptl.patch deleted file mode 100644 index 5f7167b62b..0000000000 --- a/toolchain/kernel-headers/linux-libc-headers-2.6.12.0-mips-nptl.patch +++ /dev/null @@ -1,90 +0,0 @@ -diff -urN linux-libc-headers-2.6.12.0/include/asm-mips/inst.h linux-libc-headers-2.6.12.0-mips-nptl/include/asm-mips/inst.h ---- linux-libc-headers-2.6.12.0/include/asm-mips/inst.h 2004-10-31 13:54:20.000000000 -0600 -+++ linux-libc-headers-2.6.12.0-mips-nptl/include/asm-mips/inst.h 2005-08-10 21:20:57.000000000 -0500 -@@ -28,7 +28,7 @@ - sdl_op, sdr_op, swr_op, cache_op, - ll_op, lwc1_op, lwc2_op, pref_op, - lld_op, ldc1_op, ldc2_op, ld_op, -- sc_op, swc1_op, swc2_op, major_3b_op, /* Opcode 0x3b is unused */ -+ sc_op, swc1_op, swc2_op, rdhwr_op, - scd_op, sdc1_op, sdc2_op, sd_op - }; - -@@ -62,10 +62,10 @@ - spimi_op, unused_rt_op_0x05, unused_rt_op_0x06, unused_rt_op_0x07, - tgei_op, tgeiu_op, tlti_op, tltiu_op, - teqi_op, unused_0x0d_rt_op, tnei_op, unused_0x0f_rt_op, -- bltzal_op, bgezal_op, bltzall_op, bgezall_op -- /* -- * The others (0x14 - 0x1f) are unused. -- */ -+ bltzal_op, bgezal_op, bltzall_op, bgezall_op, -+ rt_op_0x14, rt_op_0x15, rt_op_0x16, rt_op_0x17, -+ rt_op_0x18, rt_op_0x19, rt_op_0x1a, rt_op_0x1b, -+ bposge32_op, rt_op_0x1d, rt_op_0x1e, rt_op_0x1f - }; - - /* -diff -urN linux-libc-headers-2.6.12.0/include/asm-mips/unistd.h linux-libc-headers-2.6.12.0-mips-nptl/include/asm-mips/unistd.h ---- linux-libc-headers-2.6.12.0/include/asm-mips/unistd.h 2005-07-05 19:17:29.000000000 -0500 -+++ linux-libc-headers-2.6.12.0-mips-nptl/include/asm-mips/unistd.h 2005-08-10 21:22:27.000000000 -0500 -@@ -303,16 +303,17 @@ - #define __NR_add_key (__NR_Linux + 280) - #define __NR_request_key (__NR_Linux + 281) - #define __NR_keyctl (__NR_Linux + 282) -+#define __NR_set_thread_area (__NR_Linux + 283) - - /* - * Offset of the last Linux o32 flavoured syscall - */ --#define __NR_Linux_syscalls 282 -+#define __NR_Linux_syscalls 283 - - #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ - - #define __NR_O32_Linux 4000 --#define __NR_O32_Linux_syscalls 282 -+#define __NR_O32_Linux_syscalls 283 - - #if _MIPS_SIM == _MIPS_SIM_ABI64 - -@@ -562,16 +563,17 @@ - #define __NR_add_key (__NR_Linux + 239) - #define __NR_request_key (__NR_Linux + 240) - #define __NR_keyctl (__NR_Linux + 241) -+#define __NR_set_thread_area (__NR_Linux + 242) - - /* - * Offset of the last Linux 64-bit flavoured syscall - */ --#define __NR_Linux_syscalls 241 -+#define __NR_Linux_syscalls 242 - - #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ - - #define __NR_64_Linux 5000 --#define __NR_64_Linux_syscalls 241 -+#define __NR_64_Linux_syscalls 242 - - #if _MIPS_SIM == _MIPS_SIM_NABI32 - -@@ -825,16 +827,17 @@ - #define __NR_add_key (__NR_Linux + 243) - #define __NR_request_key (__NR_Linux + 244) - #define __NR_keyctl (__NR_Linux + 245) -+#define __NR_set_thread_area (__NR_Linux + 246) - - /* - * Offset of the last N32 flavoured syscall - */ --#define __NR_Linux_syscalls 245 -+#define __NR_Linux_syscalls 246 - - #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ - - #define __NR_N32_Linux 6000 --#define __NR_N32_Linux_syscalls 245 -+#define __NR_N32_Linux_syscalls 246 - - #ifndef __ASSEMBLY__ - diff --git a/toolchain/kernel-headers/linux-libc-headers-2.6.8-cleanup.patch b/toolchain/kernel-headers/linux-libc-headers-2.6.8-cleanup.patch deleted file mode 100644 index 44461d1abf..0000000000 --- a/toolchain/kernel-headers/linux-libc-headers-2.6.8-cleanup.patch +++ /dev/null @@ -1,8153 +0,0 @@ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/addrspace.h linux-libc-headers-2.6.8.0/include/asm-mips/addrspace.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/addrspace.h 2004-03-28 07:51:50.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/addrspace.h 2004-08-26 05:53:12.000000000 -0500 -@@ -10,7 +10,23 @@ - #ifndef _ASM_ADDRSPACE_H - #define _ASM_ADDRSPACE_H - --#include -+/**********************************************************************/ -+/* Include the common bits for #include */ -+#ifndef __mips64 -+ -+#define CAC_BASE 0x80000000 -+#define IO_BASE 0xa0000000 -+#define UNCAC_BASE 0xa0000000 -+#define MAP_BASE 0xc0000000 -+ -+/* -+ * This handles the memory map. -+ * We handle pages at KSEG0 for kernels with 32 bit address space. -+ */ -+#define PAGE_OFFSET 0x80000000UL -+ -+#endif /* ndef __mips64 */ -+/**********************************************************************/ - - /* - * Configure language -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/asmmacro.h linux-libc-headers-2.6.8.0/include/asm-mips/asmmacro.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/asmmacro.h 2004-08-18 13:15:41.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/asmmacro.h 2004-08-26 05:14:41.000000000 -0500 -@@ -9,10 +9,10 @@ - #define _ASM_ASMMACRO_H - - --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - #include - #endif --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - #include - #endif - -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/checksum.h linux-libc-headers-2.6.8.0/include/asm-mips/checksum.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/checksum.h 2004-06-23 16:52:45.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/checksum.h 2004-08-26 05:14:41.000000000 -0500 -@@ -125,7 +125,7 @@ - { - __asm__( - ".set\tnoat\t\t\t# csum_tcpudp_nofold\n\t" --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - "addu\t%0, %2\n\t" - "sltu\t$1, %0, %2\n\t" - "addu\t%0, $1\n\t" -@@ -138,7 +138,7 @@ - "sltu\t$1, %0, %4\n\t" - "addu\t%0, $1\n\t" - #endif --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - "daddu\t%0, %2\n\t" - "daddu\t%0, %3\n\t" - "daddu\t%0, %4\n\t" -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/compat.h linux-libc-headers-2.6.8.0/include/asm-mips/compat.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/compat.h 2003-12-15 12:47:02.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/compat.h 2004-08-26 05:23:05.000000000 -0500 -@@ -8,64 +8,64 @@ - - #define COMPAT_USER_HZ 100 - --typedef u32 compat_size_t; --typedef s32 compat_ssize_t; --typedef s32 compat_time_t; --typedef s32 compat_clock_t; --typedef s32 compat_suseconds_t; -- --typedef s32 compat_pid_t; --typedef s32 compat_uid_t; --typedef s32 compat_gid_t; --typedef u32 compat_mode_t; --typedef u32 compat_ino_t; --typedef u32 compat_dev_t; --typedef s32 compat_off_t; --typedef s64 compat_loff_t; --typedef u32 compat_nlink_t; --typedef s32 compat_ipc_pid_t; --typedef s32 compat_daddr_t; --typedef s32 compat_caddr_t; -+typedef __u32 compat_size_t; -+typedef __s32 compat_ssize_t; -+typedef __s32 compat_time_t; -+typedef __s32 compat_clock_t; -+typedef __s32 compat_suseconds_t; -+ -+typedef __s32 compat_pid_t; -+typedef __s32 compat_uid_t; -+typedef __s32 compat_gid_t; -+typedef __u32 compat_mode_t; -+typedef __u32 compat_ino_t; -+typedef __u32 compat_dev_t; -+typedef __s32 compat_off_t; -+typedef __s64 compat_loff_t; -+typedef __u32 compat_nlink_t; -+typedef __s32 compat_ipc_pid_t; -+typedef __s32 compat_daddr_t; -+typedef __s32 compat_caddr_t; - typedef struct { -- s32 val[2]; -+ __s32 val[2]; - } compat_fsid_t; - --typedef s32 compat_int_t; --typedef s32 compat_long_t; --typedef u32 compat_uint_t; --typedef u32 compat_ulong_t; -+typedef __s32 compat_int_t; -+typedef __s32 compat_long_t; -+typedef __u32 compat_uint_t; -+typedef __u32 compat_ulong_t; - - struct compat_timespec { - compat_time_t tv_sec; -- s32 tv_nsec; -+ __s32 tv_nsec; - }; - - struct compat_timeval { - compat_time_t tv_sec; -- s32 tv_usec; -+ __s32 tv_usec; - }; - - struct compat_stat { - compat_dev_t st_dev; -- s32 st_pad1[3]; -+ __s32 st_pad1[3]; - compat_ino_t st_ino; - compat_mode_t st_mode; - compat_nlink_t st_nlink; - compat_uid_t st_uid; - compat_gid_t st_gid; - compat_dev_t st_rdev; -- s32 st_pad2[2]; -+ __s32 st_pad2[2]; - compat_off_t st_size; -- s32 st_pad3; -+ __s32 st_pad3; - compat_time_t st_atime; -- s32 st_atime_nsec; -+ __s32 st_atime_nsec; - compat_time_t st_mtime; -- s32 st_mtime_nsec; -+ __s32 st_mtime_nsec; - compat_time_t st_ctime; -- s32 st_ctime_nsec; -- s32 st_blksize; -- s32 st_blocks; -- s32 st_pad4[14]; -+ __s32 st_ctime_nsec; -+ __s32 st_blksize; -+ __s32 st_blocks; -+ __s32 st_pad4[14]; - }; - - struct compat_flock { -@@ -73,10 +73,10 @@ - short l_whence; - compat_off_t l_start; - compat_off_t l_len; -- s32 l_sysid; -+ __s32 l_sysid; - compat_pid_t l_pid; - short __unused; -- s32 pad[4]; -+ __s32 pad[4]; - }; - - #define F_GETLK64 33 -@@ -107,12 +107,12 @@ - - #define COMPAT_RLIM_INFINITY 0x7fffffffUL - --typedef u32 compat_old_sigset_t; /* at least 32 bits */ -+typedef __u32 compat_old_sigset_t; /* at least 32 bits */ - - #define _COMPAT_NSIG 128 /* Don't ask !$@#% ... */ - #define _COMPAT_NSIG_BPW 32 - --typedef u32 compat_sigset_word; -+typedef __u32 compat_sigset_word; - - #define COMPAT_OFF_T_MAX 0x7fffffff - #define COMPAT_LOFF_T_MAX 0x7fffffffffffffffL -@@ -123,7 +123,7 @@ - * as pointers because the syscall entry code will have - * appropriately comverted them already. - */ --typedef u32 compat_uptr_t; -+typedef __u32 compat_uptr_t; - - static inline void *compat_ptr(compat_uptr_t uptr) - { -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/ddb5xxx/ddb5074.h linux-libc-headers-2.6.8.0/include/asm-mips/ddb5xxx/ddb5074.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/ddb5xxx/ddb5074.h 2003-12-15 12:47:03.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/ddb5xxx/ddb5074.h 2004-08-26 13:21:48.000000000 -0500 -@@ -34,5 +34,5 @@ - extern void ddb5074_led_d2(int on); - extern void ddb5074_led_d3(int on); - --extern void nile4_irq_setup(u32 base); -+extern void nile4_irq_setup(__u32 base); - #endif -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/ddb5xxx/ddb5476.h linux-libc-headers-2.6.8.0/include/asm-mips/ddb5xxx/ddb5476.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/ddb5xxx/ddb5476.h 2003-12-15 12:47:03.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/ddb5xxx/ddb5476.h 2004-08-26 05:24:06.000000000 -0500 -@@ -145,13 +145,13 @@ - extern void nile4_enable_irq(int nile4_irq); - extern void nile4_disable_irq(int nile4_irq); - extern void nile4_disable_irq_all(void); --extern u16 nile4_get_irq_stat(int cpu_irq); -+extern __u16 nile4_get_irq_stat(int cpu_irq); - extern void nile4_enable_irq_output(int cpu_irq); - extern void nile4_disable_irq_output(int cpu_irq); - extern void nile4_set_pci_irq_polarity(int pci_irq, int high); - extern void nile4_set_pci_irq_level_or_edge(int pci_irq, int level); - extern void nile4_clear_irq(int nile4_irq); --extern void nile4_clear_irq_mask(u32 mask); --extern u8 nile4_i8259_iack(void); -+extern void nile4_clear_irq_mask(__u32 mask); -+extern __u8 nile4_i8259_iack(void); - extern void nile4_dump_irq_status(void); /* Debug */ - #endif /* !__ASSEMBLY__ */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/ddb5xxx/ddb5xxx.h linux-libc-headers-2.6.8.0/include/asm-mips/ddb5xxx/ddb5xxx.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/ddb5xxx/ddb5xxx.h 2004-01-17 17:03:47.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/ddb5xxx/ddb5xxx.h 2004-08-26 05:24:01.000000000 -0500 -@@ -177,46 +177,46 @@ - * interrupt load - */ - #ifndef CONFIG_DDB5074 -- volatile u32 *p = (volatile u32 *)0xbfc00000; -+ volatile __u32 *p = (volatile __u32 *)0xbfc00000; - (void)(*p); - #endif - } - --static inline void ddb_out32(u32 offset, u32 val) -+static inline void ddb_out32(__u32 offset, __u32 val) - { -- *(volatile u32 *)(DDB_BASE+offset) = val; -+ *(volatile __u32 *)(DDB_BASE+offset) = val; - ddb_sync(); - } - --static inline u32 ddb_in32(u32 offset) -+static inline __u32 ddb_in32(__u32 offset) - { -- u32 val = *(volatile u32 *)(DDB_BASE+offset); -+ __u32 val = *(volatile __u32 *)(DDB_BASE+offset); - ddb_sync(); - return val; - } - --static inline void ddb_out16(u32 offset, u16 val) -+static inline void ddb_out16(__u32 offset, __u16 val) - { -- *(volatile u16 *)(DDB_BASE+offset) = val; -+ *(volatile __u16 *)(DDB_BASE+offset) = val; - ddb_sync(); - } - --static inline u16 ddb_in16(u32 offset) -+static inline __u16 ddb_in16(__u32 offset) - { -- u16 val = *(volatile u16 *)(DDB_BASE+offset); -+ __u16 val = *(volatile __u16 *)(DDB_BASE+offset); - ddb_sync(); - return val; - } - --static inline void ddb_out8(u32 offset, u8 val) -+static inline void ddb_out8(__u32 offset, __u8 val) - { -- *(volatile u8 *)(DDB_BASE+offset) = val; -+ *(volatile __u8 *)(DDB_BASE+offset) = val; - ddb_sync(); - } - --static inline u8 ddb_in8(u32 offset) -+static inline __u8 ddb_in8(__u32 offset) - { -- u8 val = *(volatile u8 *)(DDB_BASE+offset); -+ __u8 val = *(volatile __u8 *)(DDB_BASE+offset); - ddb_sync(); - return val; - } -@@ -226,10 +226,10 @@ - * Physical Device Address Registers - */ - --extern u32 --ddb_calc_pdar(u32 phys, u32 size, int width, int on_memory_bus, int pci_visible); -+extern __u32 -+ddb_calc_pdar(__u32 phys, __u32 size, int width, int on_memory_bus, int pci_visible); - extern void --ddb_set_pdar(u32 pdar, u32 phys, u32 size, int width, -+ddb_set_pdar(__u32 pdar, __u32 phys, __u32 size, int width, - int on_memory_bus, int pci_visible); - - /* -@@ -248,7 +248,7 @@ - #define DDB_PCI_ACCESS_32 0x10 /* for pci init0/1 regs */ - - --extern void ddb_set_pmr(u32 pmr, u32 type, u32 addr, u32 options); -+extern void ddb_set_pmr(__u32 pmr, __u32 type, __u32 addr, __u32 options); - - /* - * we need to reset pci bus when we start up and shutdown -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/dec/ioasic.h linux-libc-headers-2.6.8.0/include/asm-mips/dec/ioasic.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/dec/ioasic.h 2004-01-17 17:03:47.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/dec/ioasic.h 2004-08-26 05:25:44.000000000 -0500 -@@ -18,14 +18,14 @@ - - extern spinlock_t ioasic_ssr_lock; - --extern volatile u32 *ioasic_base; -+extern volatile __u32 *ioasic_base; - --static inline void ioasic_write(unsigned int reg, u32 v) -+static inline void ioasic_write(unsigned int reg, __u32 v) - { - ioasic_base[reg / 4] = v; - } - --static inline u32 ioasic_read(unsigned int reg) -+static inline __u32 ioasic_read(unsigned int reg) - { - return ioasic_base[reg / 4]; - } -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/dec/kn02.h linux-libc-headers-2.6.8.0/include/asm-mips/dec/kn02.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/dec/kn02.h 2004-01-17 17:03:47.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/dec/kn02.h 2004-08-26 05:25:47.000000000 -0500 -@@ -97,7 +97,7 @@ - - - #ifndef __ASSEMBLY__ --extern u32 cached_kn02_csr; -+extern __u32 cached_kn02_csr; - extern spinlock_t kn02_lock; - extern void init_kn02_irqs(int base); - #endif -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/elf.h linux-libc-headers-2.6.8.0/include/asm-mips/elf.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/elf.h 2004-03-28 07:51:51.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/elf.h 2004-08-26 05:17:25.000000000 -0500 -@@ -122,7 +122,7 @@ - typedef double elf_fpreg_t; - typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; - --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - - /* - * This is used to ensure we don't load something for the wrong architecture. -@@ -150,9 +150,9 @@ - */ - #define ELF_CLASS ELFCLASS32 - --#endif /* CONFIG_MIPS32 */ -+#endif /* ndef __mips64 */ - --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - /* - * This is used to ensure we don't load something for the wrong architecture. - */ -@@ -174,7 +174,7 @@ - */ - #define ELF_CLASS ELFCLASS64 - --#endif /* CONFIG_MIPS64 */ -+#endif /* __mips64 */ - - /* - * These are used to set parameters in the core dumps. -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/galileo-boards/ev96100.h linux-libc-headers-2.6.8.0/include/asm-mips/galileo-boards/ev96100.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/galileo-boards/ev96100.h 2004-03-28 07:51:53.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/galileo-boards/ev96100.h 2004-08-26 05:23:12.000000000 -0500 -@@ -46,9 +46,9 @@ - * bytes when running bigendian. - */ - #define __GT_READ(ofs) \ -- (*(volatile u32 *)(GT64120_BASE+(ofs))) -+ (*(volatile __u32 *)(GT64120_BASE+(ofs))) - #define __GT_WRITE(ofs, data) \ -- do { *(volatile u32 *)(GT64120_BASE+(ofs)) = (data); } while (0) -+ do { *(volatile __u32 *)(GT64120_BASE+(ofs)) = (data); } while (0) - #define GT_READ(ofs) le32_to_cpu(__GT_READ(ofs)) - #define GT_WRITE(ofs, data) __GT_WRITE(ofs, cpu_to_le32(data)) - -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/galileo-boards/gt96100.h linux-libc-headers-2.6.8.0/include/asm-mips/galileo-boards/gt96100.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/galileo-boards/gt96100.h 2004-03-28 07:51:53.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/galileo-boards/gt96100.h 2004-08-26 05:23:17.000000000 -0500 -@@ -27,9 +27,9 @@ - #define MIPS_GT96100_BASE (KSEG1ADDR(0x14000000)) - - #define GT96100_WRITE(ofs, data) \ -- *(volatile u32 *)(MIPS_GT96100_BASE+ofs) = cpu_to_le32(data) -+ *(volatile __u32 *)(MIPS_GT96100_BASE+ofs) = cpu_to_le32(data) - #define GT96100_READ(ofs) \ -- le32_to_cpu(*(volatile u32 *)(MIPS_GT96100_BASE+ofs)) -+ le32_to_cpu(*(volatile __u32 *)(MIPS_GT96100_BASE+ofs)) - - #define GT96100_ETH_IO_SIZE 0x4000 - -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/gt64120.h linux-libc-headers-2.6.8.0/include/asm-mips/gt64120.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/gt64120.h 2004-03-28 07:51:51.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/gt64120.h 2004-08-26 05:22:36.000000000 -0500 -@@ -420,9 +420,9 @@ - * bytes when running bigendian. We also provide non-swapping versions. - */ - #define __GT_READ(ofs) \ -- (*(volatile u32 *)(GT64120_BASE+(ofs))) -+ (*(volatile __u32 *)(GT64120_BASE+(ofs))) - #define __GT_WRITE(ofs, data) \ -- do { *(volatile u32 *)(GT64120_BASE+(ofs)) = (data); } while (0) -+ do { *(volatile __u32 *)(GT64120_BASE+(ofs)) = (data); } while (0) - #define GT_READ(ofs) le32_to_cpu(__GT_READ(ofs)) - #define GT_WRITE(ofs, data) __GT_WRITE(ofs, cpu_to_le32(data)) - -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/io.h linux-libc-headers-2.6.8.0/include/asm-mips/io.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/io.h 2004-03-28 07:51:51.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/io.h 2004-08-26 05:24:16.000000000 -0500 -@@ -173,14 +173,14 @@ - unsigned long flags) - { - if (cpu_has_64bit_addresses) { -- u64 base = UNCAC_BASE; -+ __u64 base = UNCAC_BASE; - - /* - * R10000 supports a 2 bit uncached attribute therefore - * UNCAC_BASE may not equal IO_BASE. - */ - if (flags == _CACHE_UNCACHED) -- base = (u64) IO_BASE; -+ base = (__u64) IO_BASE; - return (void *) (unsigned long) (base + offset); - } - -@@ -245,10 +245,10 @@ - #define __raw_readb(addr) (*(volatile unsigned char *)(addr)) - #define __raw_readw(addr) (*(volatile unsigned short *)(addr)) - #define __raw_readl(addr) (*(volatile unsigned int *)(addr)) --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - #define ____raw_readq(addr) \ - ({ \ -- u64 __res; \ -+ __u64 __res; \ - \ - __asm__ __volatile__ ( \ - " .set mips3 # ____raw_readq \n" \ -@@ -263,7 +263,7 @@ - #define __raw_readq(addr) \ - ({ \ - unsigned long __flags; \ -- u64 __res; \ -+ __u64 __res; \ - \ - local_irq_save(__flags); \ - __res = ____raw_readq(addr); \ -@@ -271,7 +271,7 @@ - __res; \ - }) - #endif --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - #define ____raw_readq(addr) (*(volatile unsigned long *)(addr)) - #define __raw_readq(addr) ____raw_readq(addr) - #endif -@@ -288,10 +288,10 @@ - #define __raw_writeb(b,addr) ((*(volatile unsigned char *)(addr)) = (b)) - #define __raw_writew(w,addr) ((*(volatile unsigned short *)(addr)) = (w)) - #define __raw_writel(l,addr) ((*(volatile unsigned int *)(addr)) = (l)) --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - #define ____raw_writeq(val,addr) \ - ({ \ -- u64 __tmp; \ -+ __u64 __tmp; \ - \ - __asm__ __volatile__ ( \ - " .set mips3 \n" \ -@@ -313,7 +313,7 @@ - local_irq_restore(__flags); \ - }) - #endif --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - #define ____raw_writeq(q,addr) ((*(volatile unsigned long *)(addr)) = (q)) - #define __raw_writeq(q,addr) ____raw_writeq(q, addr) - #endif -@@ -400,28 +400,28 @@ - { - port = __swizzle_addr_b(port); - -- *(volatile u8 *)(mips_io_port_base + port) = __ioswab8(val); -+ *(volatile __u8 *)(mips_io_port_base + port) = __ioswab8(val); - } - - static inline void __outw(unsigned short val, unsigned long port) - { - port = __swizzle_addr_w(port); - -- *(volatile u16 *)(mips_io_port_base + port) = __ioswab16(val); -+ *(volatile __u16 *)(mips_io_port_base + port) = __ioswab16(val); - } - - static inline void __outl(unsigned int val, unsigned long port) - { - port = __swizzle_addr_l(port); - -- *(volatile u32 *)(mips_io_port_base + port) = __ioswab32(val); -+ *(volatile __u32 *)(mips_io_port_base + port) = __ioswab32(val); - } - - static inline void __outb_p(unsigned char val, unsigned long port) - { - port = __swizzle_addr_b(port); - -- *(volatile u8 *)(mips_io_port_base + port) = __ioswab8(val); -+ *(volatile __u8 *)(mips_io_port_base + port) = __ioswab8(val); - SLOW_DOWN_IO; - } - -@@ -429,7 +429,7 @@ - { - port = __swizzle_addr_w(port); - -- *(volatile u16 *)(mips_io_port_base + port) = __ioswab16(val); -+ *(volatile __u16 *)(mips_io_port_base + port) = __ioswab16(val); - SLOW_DOWN_IO; - } - -@@ -437,7 +437,7 @@ - { - port = __swizzle_addr_l(port); - -- *(volatile u32 *)(mips_io_port_base + port) = __ioswab32(val); -+ *(volatile __u32 *)(mips_io_port_base + port) = __ioswab32(val); - SLOW_DOWN_IO; - } - -@@ -452,30 +452,30 @@ - { - port = __swizzle_addr_b(port); - -- return __ioswab8(*(volatile u8 *)(mips_io_port_base + port)); -+ return __ioswab8(*(volatile __u8 *)(mips_io_port_base + port)); - } - - static inline unsigned short __inw(unsigned long port) - { - port = __swizzle_addr_w(port); - -- return __ioswab16(*(volatile u16 *)(mips_io_port_base + port)); -+ return __ioswab16(*(volatile __u16 *)(mips_io_port_base + port)); - } - - static inline unsigned int __inl(unsigned long port) - { - port = __swizzle_addr_l(port); - -- return __ioswab32(*(volatile u32 *)(mips_io_port_base + port)); -+ return __ioswab32(*(volatile __u32 *)(mips_io_port_base + port)); - } - - static inline unsigned char __inb_p(unsigned long port) - { -- u8 __val; -+ __u8 __val; - - port = __swizzle_addr_b(port); - -- __val = *(volatile u8 *)(mips_io_port_base + port); -+ __val = *(volatile __u8 *)(mips_io_port_base + port); - SLOW_DOWN_IO; - - return __ioswab8(__val); -@@ -483,11 +483,11 @@ - - static inline unsigned short __inw_p(unsigned long port) - { -- u16 __val; -+ __u16 __val; - - port = __swizzle_addr_w(port); - -- __val = *(volatile u16 *)(mips_io_port_base + port); -+ __val = *(volatile __u16 *)(mips_io_port_base + port); - SLOW_DOWN_IO; - - return __ioswab16(__val); -@@ -495,11 +495,11 @@ - - static inline unsigned int __inl_p(unsigned long port) - { -- u32 __val; -+ __u32 __val; - - port = __swizzle_addr_l(port); - -- __val = *(volatile u32 *)(mips_io_port_base + port); -+ __val = *(volatile __u32 *)(mips_io_port_base + port); - SLOW_DOWN_IO; - - return __ioswab32(__val); -@@ -515,7 +515,7 @@ - static inline void __outsb(unsigned long port, void *addr, unsigned int count) - { - while (count--) { -- outb(*(u8 *)addr, port); -+ outb(*(__u8 *)addr, port); - addr++; - } - } -@@ -523,7 +523,7 @@ - static inline void __insb(unsigned long port, void *addr, unsigned int count) - { - while (count--) { -- *(u8 *)addr = inb(port); -+ *(__u8 *)addr = inb(port); - addr++; - } - } -@@ -531,7 +531,7 @@ - static inline void __outsw(unsigned long port, void *addr, unsigned int count) - { - while (count--) { -- outw(*(u16 *)addr, port); -+ outw(*(__u16 *)addr, port); - addr += 2; - } - } -@@ -539,7 +539,7 @@ - static inline void __insw(unsigned long port, void *addr, unsigned int count) - { - while (count--) { -- *(u16 *)addr = inw(port); -+ *(__u16 *)addr = inw(port); - addr += 2; - } - } -@@ -547,7 +547,7 @@ - static inline void __outsl(unsigned long port, void *addr, unsigned int count) - { - while (count--) { -- outl(*(u32 *)addr, port); -+ outl(*(__u32 *)addr, port); - addr += 4; - } - } -@@ -555,7 +555,7 @@ - static inline void __insl(unsigned long port, void *addr, unsigned int count) - { - while (count--) { -- *(u32 *)addr = inl(port); -+ *(__u32 *)addr = inl(port); - addr += 4; - } - } -@@ -617,7 +617,7 @@ - #define __CSR_32_ADJUST 0 - #endif - --#define csr_out32(v,a) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST) = (v)) --#define csr_in32(a) (*(volatile u32 *)((unsigned long)(a) + __CSR_32_ADJUST)) -+#define csr_out32(v,a) (*(volatile __u32 *)((unsigned long)(a) + __CSR_32_ADJUST) = (v)) -+#define csr_in32(a) (*(volatile __u32 *)((unsigned long)(a) + __CSR_32_ADJUST)) - - #endif /* _ASM_IO_H */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/ip32/mace.h linux-libc-headers-2.6.8.0/include/asm-mips/ip32/mace.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/ip32/mace.h 2004-06-09 07:00:41.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/ip32/mace.h 2004-08-26 05:14:41.000000000 -0500 -@@ -22,7 +22,7 @@ - #undef BIT - #define BIT(x) (1ULL << (x)) - --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - typedef struct { - volatile unsigned long long reg; - } mace64_t; -@@ -32,7 +32,7 @@ - volatile unsigned long reg; - } mace32_t; - #endif --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - typedef struct { - volatile unsigned long reg; - } mace64_t; -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/it8172/it8172.h linux-libc-headers-2.6.8.0/include/asm-mips/it8172/it8172.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/it8172/it8172.h 2003-12-15 12:47:03.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/it8172/it8172.h 2004-08-26 05:22:54.000000000 -0500 -@@ -336,13 +336,13 @@ - #define TIMER_TIDR 0x0E - - --#define IT_WRITE(ofs, data) *(volatile u32 *)KSEG1ADDR((IT8172_BASE+ofs)) = data --#define IT_READ(ofs, data) data = *(volatile u32 *)KSEG1ADDR((IT8172_BASE+ofs)) -+#define IT_WRITE(ofs, data) *(volatile __u32 *)KSEG1ADDR((IT8172_BASE+ofs)) = data -+#define IT_READ(ofs, data) data = *(volatile __u32 *)KSEG1ADDR((IT8172_BASE+ofs)) - --#define IT_IO_WRITE(ofs, data) *(volatile u32 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) = data --#define IT_IO_READ(ofs, data) data = *(volatile u32 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) -+#define IT_IO_WRITE(ofs, data) *(volatile __u32 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) = data -+#define IT_IO_READ(ofs, data) data = *(volatile __u32 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) - --#define IT_IO_WRITE16(ofs, data) *(volatile u16 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) = data --#define IT_IO_READ16(ofs, data) data = *(volatile u16 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) -+#define IT_IO_WRITE16(ofs, data) *(volatile __u16 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) = data -+#define IT_IO_READ16(ofs, data) data = *(volatile __u16 *)KSEG1ADDR((IT8172_PCI_IO_BASE+ofs)) - - #endif -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/lasat/head.h linux-libc-headers-2.6.8.0/include/asm-mips/lasat/head.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/lasat/head.h 2003-12-15 12:47:03.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/lasat/head.h 2004-08-26 05:23:42.000000000 -0500 -@@ -10,12 +10,12 @@ - #ifndef _LANGUAGE_ASSEMBLY - #include - struct bootloader_header { -- u32 magic[2]; -- u32 version; -- u32 image_start; -- u32 image_size; -- u32 kernel_start; -- u32 kernel_entry; -+ __u32 magic[2]; -+ __u32 version; -+ __u32 image_start; -+ __u32 image_size; -+ __u32 kernel_start; -+ __u32 kernel_entry; - }; - #endif - -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/lasat/lasat.h linux-libc-headers-2.6.8.0/include/asm-mips/lasat/lasat.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/lasat/lasat.h 2004-06-09 07:00:42.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/lasat/lasat.h 2004-08-26 05:23:50.000000000 -0500 -@@ -25,9 +25,9 @@ - #ifndef _LANGUAGE_ASSEMBLY - - extern struct lasat_misc { -- volatile u32 *reset_reg; -- volatile u32 *flash_wp_reg; -- u32 flash_wp_bit; -+ volatile __u32 *reset_reg; -+ volatile __u32 *flash_wp_reg; -+ __u32 flash_wp_bit; - } *lasat_misc; - - enum lasat_mtdparts { -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/m48t35.h linux-libc-headers-2.6.8.0/include/asm-mips/m48t35.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/m48t35.h 2004-01-17 17:03:44.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/m48t35.h 2004-08-26 05:23:39.000000000 -0500 -@@ -8,15 +8,15 @@ - extern spinlock_t rtc_lock; - - struct m48t35_rtc { -- volatile u8 pad[0x7ff8]; /* starts at 0x7ff8 */ -- volatile u8 control; -- volatile u8 sec; -- volatile u8 min; -- volatile u8 hour; -- volatile u8 day; -- volatile u8 date; -- volatile u8 month; -- volatile u8 year; -+ volatile __u8 pad[0x7ff8]; /* starts at 0x7ff8 */ -+ volatile __u8 control; -+ volatile __u8 sec; -+ volatile __u8 min; -+ volatile __u8 hour; -+ volatile __u8 day; -+ volatile __u8 date; -+ volatile __u8 month; -+ volatile __u8 year; - }; - - #define M48T35_RTC_SET 0x80 -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/mips-boards/bonito64.h linux-libc-headers-2.6.8.0/include/asm-mips/mips-boards/bonito64.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/mips-boards/bonito64.h 2004-03-28 07:51:54.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/mips-boards/bonito64.h 2004-08-26 05:21:59.000000000 -0500 -@@ -34,7 +34,7 @@ - extern unsigned long _pcictrl_bonito; - extern unsigned long _pcictrl_bonito_pcicfg; - --#define BONITO(x) *(volatile u32 *)(_pcictrl_bonito + (x)) -+#define BONITO(x) *(volatile __u32 *)(_pcictrl_bonito + (x)) - - #endif /* __ASSEMBLY__ */ - -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/mips-boards/generic.h linux-libc-headers-2.6.8.0/include/asm-mips/mips-boards/generic.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/mips-boards/generic.h 2004-03-28 07:51:54.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/mips-boards/generic.h 2004-08-26 05:22:06.000000000 -0500 -@@ -74,7 +74,7 @@ - #define MIPS_REVISION_CORID_CORE_EMUL_BON 0x63 - #define MIPS_REVISION_CORID_CORE_EMUL_MSC 0x65 - --#define MIPS_REVISION_CORID (((*(volatile u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 10) & 0x3f) -+#define MIPS_REVISION_CORID (((*(volatile __u32 *)ioremap(MIPS_REVISION_REG, 4)) >> 10) & 0x3f) - - extern unsigned int mips_revision_corid; - -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/mips-boards/msc01_pci.h linux-libc-headers-2.6.8.0/include/asm-mips/mips-boards/msc01_pci.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/mips-boards/msc01_pci.h 2004-03-28 07:51:54.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/mips-boards/msc01_pci.h 2004-08-26 05:22:10.000000000 -0500 -@@ -212,8 +212,8 @@ - - #define MSC01_PCI_REG_BASE _pcictrl_msc - --#define MSC_WRITE(reg, data) do { *(volatile u32 *)(reg) = data; } while (0) --#define MSC_READ(reg, data) do { data = *(volatile u32 *)(reg); } while (0) -+#define MSC_WRITE(reg, data) do { *(volatile __u32 *)(reg) = data; } while (0) -+#define MSC_READ(reg, data) do { data = *(volatile __u32 *)(reg); } while (0) - - /* - * Registers absolute addresses -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/mipsregs.h linux-libc-headers-2.6.8.0/include/asm-mips/mipsregs.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/mipsregs.h 2004-08-18 13:15:41.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/mipsregs.h 2004-08-26 13:00:51.000000000 -0500 -@@ -14,7 +14,6 @@ - #define _ASM_MIPSREGS_H - - #include --#include - - /* - * The following macros are especially useful for __asm__ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/mmu_context.h linux-libc-headers-2.6.8.0/include/asm-mips/mmu_context.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/mmu_context.h 2004-08-18 13:15:41.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/mmu_context.h 2004-08-26 05:14:41.000000000 -0500 -@@ -27,12 +27,12 @@ - */ - #define TLBMISS_HANDLER_SETUP_PGD(pgd) \ - pgd_current[smp_processor_id()] = (unsigned long)(pgd) --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - #define TLBMISS_HANDLER_SETUP() \ - write_c0_context((unsigned long) smp_processor_id() << 23); \ - TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) - #endif --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - #define TLBMISS_HANDLER_SETUP() \ - write_c0_context((unsigned long) &pgd_current[smp_processor_id()] << 23); \ - TLBMISS_HANDLER_SETUP_PGD(swapper_pg_dir) -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/module.h linux-libc-headers-2.6.8.0/include/asm-mips/module.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/module.h 2004-08-18 13:15:41.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/module.h 2004-08-26 05:14:41.000000000 -0500 -@@ -21,7 +21,7 @@ - Elf64_Sxword r_addend; /* Addend. */ - } Elf64_Mips_Rela; - --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - - #define Elf_Shdr Elf32_Shdr - #define Elf_Sym Elf32_Sym -@@ -29,7 +29,7 @@ - - #endif - --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - - #define Elf_Shdr Elf64_Shdr - #define Elf_Sym Elf64_Sym -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/msgbuf.h linux-libc-headers-2.6.8.0/include/asm-mips/msgbuf.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/msgbuf.h 2004-01-17 17:03:44.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/msgbuf.h 2004-08-26 05:15:04.000000000 -0500 -@@ -14,25 +14,25 @@ - - struct msqid64_ds { - struct ipc64_perm msg_perm; --#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN) -+#if !defined(__mips64) && !defined(CONFIG_CPU_LITTLE_ENDIAN) - unsigned long __unused1; - #endif - __kernel_time_t msg_stime; /* last msgsnd time */ --#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN) -+#if !defined(__mips64) && defined(CONFIG_CPU_LITTLE_ENDIAN) - unsigned long __unused1; - #endif --#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN) -+#if !defined(__mips64) && !defined(CONFIG_CPU_LITTLE_ENDIAN) - unsigned long __unused2; - #endif - __kernel_time_t msg_rtime; /* last msgrcv time */ --#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN) -+#if !defined(__mips64) && defined(CONFIG_CPU_LITTLE_ENDIAN) - unsigned long __unused2; - #endif --#if defined(CONFIG_MIPS32) && !defined(CONFIG_CPU_LITTLE_ENDIAN) -+#if !defined(__mips64) && !defined(CONFIG_CPU_LITTLE_ENDIAN) - unsigned long __unused3; - #endif - __kernel_time_t msg_ctime; /* last change time */ --#if defined(CONFIG_MIPS32) && defined(CONFIG_CPU_LITTLE_ENDIAN) -+#if !defined(__mips64) && defined(CONFIG_CPU_LITTLE_ENDIAN) - unsigned long __unused3; - #endif - unsigned long msg_cbytes; /* current number of bytes on queue */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/nile4.h linux-libc-headers-2.6.8.0/include/asm-mips/nile4.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/nile4.h 2003-12-15 12:47:02.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/nile4.h 2004-08-26 05:22:46.000000000 -0500 -@@ -202,45 +202,45 @@ - - static inline void nile4_sync(void) - { -- volatile u32 *p = (volatile u32 *)0xbfc00000; -+ volatile __u32 *p = (volatile __u32 *)0xbfc00000; - (void)(*p); - } - --static inline void nile4_out32(u32 offset, u32 val) -+static inline void nile4_out32(__u32 offset, __u32 val) - { -- *(volatile u32 *)(NILE4_BASE+offset) = val; -+ *(volatile __u32 *)(NILE4_BASE+offset) = val; - nile4_sync(); - } - --static inline u32 nile4_in32(u32 offset) -+static inline __u32 nile4_in32(__u32 offset) - { -- u32 val = *(volatile u32 *)(NILE4_BASE+offset); -+ __u32 val = *(volatile __u32 *)(NILE4_BASE+offset); - nile4_sync(); - return val; - } - --static inline void nile4_out16(u32 offset, u16 val) -+static inline void nile4_out16(__u32 offset, __u16 val) - { -- *(volatile u16 *)(NILE4_BASE+offset) = val; -+ *(volatile __u16 *)(NILE4_BASE+offset) = val; - nile4_sync(); - } - --static inline u16 nile4_in16(u32 offset) -+static inline __u16 nile4_in16(__u32 offset) - { -- u16 val = *(volatile u16 *)(NILE4_BASE+offset); -+ __u16 val = *(volatile __u16 *)(NILE4_BASE+offset); - nile4_sync(); - return val; - } - --static inline void nile4_out8(u32 offset, u8 val) -+static inline void nile4_out8(__u32 offset, __u8 val) - { -- *(volatile u8 *)(NILE4_BASE+offset) = val; -+ *(volatile __u8 *)(NILE4_BASE+offset) = val; - nile4_sync(); - } - --static inline u8 nile4_in8(u32 offset) -+static inline __u8 nile4_in8(__u32 offset) - { -- u8 val = *(volatile u8 *)(NILE4_BASE+offset); -+ __u8 val = *(volatile __u8 *)(NILE4_BASE+offset); - nile4_sync(); - return val; - } -@@ -250,7 +250,7 @@ - * Physical Device Address Registers - */ - --extern void nile4_set_pdar(u32 pdar, u32 phys, u32 size, int width, -+extern void nile4_set_pdar(__u32 pdar, __u32 phys, __u32 size, int width, - int on_memory_bus, int visible); - - -@@ -276,7 +276,7 @@ - #define NILE4_PCI_IACK_BASE NILE4_PCI_IO_BASE - - --extern void nile4_set_pmr(u32 pmr, u32 type, u32 addr); -+extern void nile4_set_pmr(__u32 pmr, __u32 type, __u32 addr); - - - /* -@@ -296,14 +296,14 @@ - extern void nile4_enable_irq(unsigned int nile4_irq); - extern void nile4_disable_irq(unsigned int nile4_irq); - extern void nile4_disable_irq_all(void); --extern u16 nile4_get_irq_stat(int cpu_irq); -+extern __u16 nile4_get_irq_stat(int cpu_irq); - extern void nile4_enable_irq_output(int cpu_irq); - extern void nile4_disable_irq_output(int cpu_irq); - extern void nile4_set_pci_irq_polarity(int pci_irq, int high); - extern void nile4_set_pci_irq_level_or_edge(int pci_irq, int level); - extern void nile4_clear_irq(int nile4_irq); --extern void nile4_clear_irq_mask(u32 mask); --extern u8 nile4_i8259_iack(void); -+extern void nile4_clear_irq_mask(__u32 mask); -+extern __u8 nile4_i8259_iack(void); - extern void nile4_dump_irq_status(void); /* Debug */ - - #endif -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/paccess.h linux-libc-headers-2.6.8.0/include/asm-mips/paccess.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/paccess.h 2004-01-17 17:03:44.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/paccess.h 2004-08-26 05:17:48.000000000 -0500 -@@ -14,11 +14,12 @@ - #define _ASM_PACCESS_H - - #include -+#include - --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - #define __PA_ADDR ".word" - #endif --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - #define __PA_ADDR ".dword" - #endif - -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/pci/bridge.h linux-libc-headers-2.6.8.0/include/asm-mips/pci/bridge.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/pci/bridge.h 2004-03-28 07:51:54.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/pci/bridge.h 2004-08-26 05:25:40.000000000 -0500 -@@ -48,9 +48,9 @@ - * All accesses to bridge hardware registers must be done - * using 32-bit loads and stores. - */ --typedef u32 bridgereg_t; -+typedef __u32 bridgereg_t; - --typedef u64 bridge_ate_t; -+typedef __u64 bridge_ate_t; - - /* pointers to bridge ATEs - * are always "pointer to volatile" -@@ -199,37 +199,37 @@ - - /* PCI Device Configuration Spaces 0x020000-0x027FFF */ - union { /* make all access sizes available. */ -- u8 c[0x1000 / 1]; -- u16 s[0x1000 / 2]; -- u32 l[0x1000 / 4]; -- u64 d[0x1000 / 8]; -+ __u8 c[0x1000 / 1]; -+ __u16 s[0x1000 / 2]; -+ __u32 l[0x1000 / 4]; -+ __u64 d[0x1000 / 8]; - union { -- u8 c[0x100 / 1]; -- u16 s[0x100 / 2]; -- u32 l[0x100 / 4]; -- u64 d[0x100 / 8]; -+ __u8 c[0x100 / 1]; -+ __u16 s[0x100 / 2]; -+ __u32 l[0x100 / 4]; -+ __u64 d[0x100 / 8]; - } f[8]; - } b_type0_cfg_dev[8]; /* 0x020000 */ - - /* PCI Type 1 Configuration Space 0x028000-0x028FFF */ - union { /* make all access sizes available. */ -- u8 c[0x1000 / 1]; -- u16 s[0x1000 / 2]; -- u32 l[0x1000 / 4]; -- u64 d[0x1000 / 8]; -+ __u8 c[0x1000 / 1]; -+ __u16 s[0x1000 / 2]; -+ __u32 l[0x1000 / 4]; -+ __u64 d[0x1000 / 8]; - } b_type1_cfg; /* 0x028000-0x029000 */ - - char _pad_029000[0x007000]; /* 0x029000-0x030000 */ - - /* PCI Interrupt Acknowledge Cycle 0x030000 */ - union { -- u8 c[8 / 1]; -- u16 s[8 / 2]; -- u32 l[8 / 4]; -- u64 d[8 / 8]; -+ __u8 c[8 / 1]; -+ __u16 s[8 / 2]; -+ __u32 l[8 / 4]; -+ __u64 d[8 / 8]; - } b_pci_iack; /* 0x030000 */ - -- u8 _pad_030007[0x04fff8]; /* 0x030008-0x07FFFF */ -+ __u8 _pad_030007[0x04fff8]; /* 0x030008-0x07FFFF */ - - /* External Address Translation Entry RAM 0x080000-0x0FFFFF */ - bridge_ate_t b_ext_ate_ram[0x10000]; -@@ -239,10 +239,10 @@ - - /* PCI/GIO Device Spaces 0x200000-0xBFFFFF */ - union { /* make all access sizes available. */ -- u8 c[0x100000 / 1]; -- u16 s[0x100000 / 2]; -- u32 l[0x100000 / 4]; -- u64 d[0x100000 / 8]; -+ __u8 c[0x100000 / 1]; -+ __u16 s[0x100000 / 2]; -+ __u32 l[0x100000 / 4]; -+ __u64 d[0x100000 / 8]; - } b_devio_raw[10]; /* 0x200000 */ - - /* b_devio macro is a bit strange; it reflects the -@@ -253,10 +253,10 @@ - - /* External Flash Proms 1,0 0xC00000-0xFFFFFF */ - union { /* make all access sizes available. */ -- u8 c[0x400000 / 1]; /* read-only */ -- u16 s[0x400000 / 2]; /* read-write */ -- u32 l[0x400000 / 4]; /* read-only */ -- u64 d[0x400000 / 8]; /* read-only */ -+ __u8 c[0x400000 / 1]; /* read-only */ -+ __u16 s[0x400000 / 2]; /* read-write */ -+ __u32 l[0x400000 / 4]; /* read-only */ -+ __u64 d[0x400000 / 8]; /* read-only */ - } b_external_flash; /* 0xC00000 */ - } bridge_t; - -@@ -266,9 +266,9 @@ - */ - typedef struct bridge_err_cmdword_s { - union { -- u32 cmd_word; -+ __u32 cmd_word; - struct { -- u32 didn:4, /* Destination ID */ -+ __u32 didn:4, /* Destination ID */ - sidn:4, /* Source ID */ - pactyp:4, /* Packet type */ - tnum:5, /* Trans Number */ -@@ -799,17 +799,17 @@ - #ifndef __ASSEMBLY__ - /* Address translation entry for mapped pci32 accesses */ - typedef union ate_u { -- u64 ent; -+ __u64 ent; - struct ate_s { -- u64 rmf:16; -- u64 addr:36; -- u64 targ:4; -- u64 reserved:3; -- u64 barrier:1; -- u64 prefetch:1; -- u64 precise:1; -- u64 coherent:1; -- u64 valid:1; -+ __u64 rmf:16; -+ __u64 addr:36; -+ __u64 targ:4; -+ __u64 reserved:3; -+ __u64 barrier:1; -+ __u64 prefetch:1; -+ __u64 precise:1; -+ __u64 coherent:1; -+ __u64 valid:1; - } field; - } ate_t; - #endif /* !__ASSEMBLY__ */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/pci_channel.h linux-libc-headers-2.6.8.0/include/asm-mips/pci_channel.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/pci_channel.h 2004-03-28 07:51:52.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/pci_channel.h 2004-08-26 05:21:47.000000000 -0500 -@@ -41,6 +41,6 @@ - /* - * board supplied pci irq fixup routine - */ --extern int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin); -+extern int pcibios_map_irq(struct pci_dev *dev, __u8 slot, __u8 pin); - - #endif /* __ASM_PCI_CHANNEL_H */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/pgalloc.h linux-libc-headers-2.6.8.0/include/asm-mips/pgalloc.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/pgalloc.h 2004-06-09 07:00:41.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/pgalloc.h 2004-08-26 05:14:41.000000000 -0500 -@@ -85,7 +85,7 @@ - - #define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) - --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - #define pgd_populate(mm, pmd, pte) BUG() - - /* -@@ -97,7 +97,7 @@ - #define __pmd_free_tlb(tlb,x) do { } while (0) - #endif - --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - - #define pgd_populate(mm, pgd, pmd) set_pgd(pgd, __pgd(pmd)) - -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/prctl.h linux-libc-headers-2.6.8.0/include/asm-mips/prctl.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/prctl.h 2003-12-15 12:47:02.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/prctl.h 2004-08-26 05:21:43.000000000 -0500 -@@ -12,21 +12,21 @@ - #define PRDA ((struct prda *) PRDA_ADDRESS) - - struct prda_sys { -- pid_t t_pid; -- u32 t_hint; -- u32 t_dlactseq; -- u32 t_fpflags; -- u32 t_prid; /* processor type, $prid CP0 register */ -- u32 t_dlendseq; -- u64 t_unused1[5]; -- pid_t t_rpid; -- s32 t_resched; -- u32 t_unused[8]; -- u32 t_cpu; /* current/last cpu */ -+ pid_t t_pid; -+ __u32 t_hint; -+ __u32 t_dlactseq; -+ __u32 t_fpflags; -+ __u32 t_prid; /* processor type, $prid CP0 register */ -+ __u32 t_dlendseq; -+ __u64 t_unused1[5]; -+ pid_t t_rpid; -+ __s32 t_resched; -+ __u32 t_unused[8]; -+ __u32 t_cpu; /* current/last cpu */ - - /* FIXME: The signal information, not supported by Linux now */ -- u32 t_flags; /* if true, then the sigprocmask is in userspace */ -- u32 t_sigprocmask [1]; /* the sigprocmask */ -+ __u32 t_flags; /* if true, then the sigprocmask is in userspace */ -+ __u32 t_sigprocmask [1]; /* the sigprocmask */ - }; - - struct prda { -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/processor.h linux-libc-headers-2.6.8.0/include/asm-mips/processor.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/processor.h 2004-08-18 13:15:41.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/processor.h 2004-08-26 05:23:24.000000000 -0500 -@@ -102,7 +102,7 @@ - #define MCA_bus 0 - #define MCA_bus__is_a_macro /* for versions in ksyms.c */ - --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - /* - * User space process size: 2GB. This is hardcoded into a few places, - * so don't change it unless you know what you are doing. -@@ -116,7 +116,7 @@ - #define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3)) - #endif - --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - /* - * User space process size: 1TB. This is hardcoded into a few places, - * so don't change it unless you know what you are doing. TASK_SIZE -@@ -142,7 +142,7 @@ - - #define NUM_FPU_REGS 32 - --typedef u64 fpureg_t; -+typedef __u64 fpureg_t; - - struct mips_fpu_hard_struct { - fpureg_t fpr[NUM_FPU_REGS]; -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/ptrace.h linux-libc-headers-2.6.8.0/include/asm-mips/ptrace.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/ptrace.h 2004-03-28 07:51:52.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/ptrace.h 2004-08-26 05:14:41.000000000 -0500 -@@ -27,7 +27,7 @@ - * system call/exception. As usual the registers k0/k1 aren't being saved. - */ - struct pt_regs { --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - /* Pad bytes for argument save space on the stack. */ - unsigned long pad0[6]; - #endif -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/serial.h linux-libc-headers-2.6.8.0/include/asm-mips/serial.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/serial.h 2004-08-18 13:15:41.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/serial.h 2004-08-26 13:21:37.000000000 -0500 -@@ -68,7 +68,7 @@ - - #define _JAZZ_SERIAL_INIT(int, base) \ - { .baud_base = JAZZ_BASE_BAUD, .irq = int, .flags = STD_COM_FLAGS, \ -- .iomem_base = (u8 *) base, .iomem_reg_shift = 0, \ -+ .iomem_base = (__u8 *) base, .iomem_reg_shift = 0, \ - .io_type = SERIAL_IO_MEM } - #define JAZZ_SERIAL_PORT_DEFNS \ - _JAZZ_SERIAL_INIT(JAZZ_SERIAL1_IRQ, JAZZ_SERIAL1_BASE), \ -@@ -243,7 +243,7 @@ - #define _JAGUAR_ATX_SERIAL_INIT(int, base) \ - { baud_base: JAGUAR_ATX_BASE_BAUD, irq: int, \ - flags: (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST), \ -- iomem_base: (u8 *) base, iomem_reg_shift: 2, \ -+ iomem_base: (__u8 *) base, iomem_reg_shift: 2, \ - io_type: SERIAL_IO_MEM } - #define MOMENCO_JAGUAR_ATX_SERIAL_PORT_DEFNS \ - _JAGUAR_ATX_SERIAL_INIT(JAGUAR_ATX_SERIAL1_IRQ, JAGUAR_ATX_SERIAL1_BASE) -@@ -260,7 +260,7 @@ - - #define _OCELOT_SERIAL_INIT(int, base) \ - { .baud_base = OCELOT_BASE_BAUD, .irq = int, .flags = STD_COM_FLAGS, \ -- .iomem_base = (u8 *) base, .iomem_reg_shift = 2, \ -+ .iomem_base = (__u8 *) base, .iomem_reg_shift = 2, \ - .io_type = SERIAL_IO_MEM } - #define MOMENCO_OCELOT_SERIAL_PORT_DEFNS \ - _OCELOT_SERIAL_INIT(OCELOT_SERIAL1_IRQ, OCELOT_SERIAL1_BASE) -@@ -281,7 +281,7 @@ - - #define _OCELOT_G_SERIAL_INIT(int, base) \ - { .baud_base = OCELOT_G_BASE_BAUD, .irq = int, .flags = STD_COM_FLAGS,\ -- .iomem_base = (u8 *) base, .iomem_reg_shift = 2, \ -+ .iomem_base = (__u8 *) base, .iomem_reg_shift = 2, \ - .io_type = SERIAL_IO_MEM } - #define MOMENCO_OCELOT_G_SERIAL_PORT_DEFNS \ - _OCELOT_G_SERIAL_INIT(OCELOT_G_SERIAL1_IRQ, OCELOT_G_SERIAL1_BASE) -@@ -303,7 +303,7 @@ - { .baud_base = OCELOT_C_BASE_BAUD, \ - .irq = (int), \ - .flags = STD_COM_FLAGS, \ -- .iomem_base = (u8 *) base, \ -+ .iomem_base = (__u8 *) base, \ - .iomem_reg_shift = 2, \ - .io_type = SERIAL_IO_MEM \ - } -@@ -318,10 +318,10 @@ - #include - #define DDB5477_SERIAL_PORT_DEFNS \ - { .baud_base = BASE_BAUD, .irq = VRC5477_IRQ_UART0, \ -- .flags = STD_COM_FLAGS, .iomem_base = (u8*)0xbfa04200, \ -+ .flags = STD_COM_FLAGS, .iomem_base = (__u8*)0xbfa04200, \ - .iomem_reg_shift = 3, .io_type = SERIAL_IO_MEM}, \ - { .baud_base = BASE_BAUD, .irq = VRC5477_IRQ_UART1, \ -- .flags = STD_COM_FLAGS, .iomem_base = (u8*)0xbfa04240, \ -+ .flags = STD_COM_FLAGS, .iomem_base = (__u8*)0xbfa04240, \ - .iomem_reg_shift = 3, .io_type = SERIAL_IO_MEM}, - #else - #define DDB5477_SERIAL_PORT_DEFNS -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgi/hpc3.h linux-libc-headers-2.6.8.0/include/asm-mips/sgi/hpc3.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgi/hpc3.h 2003-12-15 12:47:03.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sgi/hpc3.h 2004-08-26 05:24:34.000000000 -0500 -@@ -17,8 +17,8 @@ - - /* An HPC DMA descriptor. */ - struct hpc_dma_desc { -- u32 pbuf; /* physical address of data buffer */ -- u32 cntinfo; /* counter and info bits */ -+ __u32 pbuf; /* physical address of data buffer */ -+ __u32 cntinfo; /* counter and info bits */ - #define HPCDMA_EOX 0x80000000 /* last desc in chain for tx */ - #define HPCDMA_EOR 0x80000000 /* last desc in chain for rx */ - #define HPCDMA_EOXP 0x40000000 /* end of packet for tx */ -@@ -30,15 +30,15 @@ - #define HPCDMA_OWN 0x00004000 /* Denotes ring buffer ownership on rx */ - #define HPCDMA_BCNT 0x00003fff /* size in bytes of this dma buffer */ - -- u32 pnext; /* paddr of next hpc_dma_desc if any */ -+ __u32 pnext; /* paddr of next hpc_dma_desc if any */ - }; - - /* The set of regs for each HPC3 PBUS DMA channel. */ - struct hpc3_pbus_dmacregs { -- volatile u32 pbdma_bptr; /* pbus dma channel buffer ptr */ -- volatile u32 pbdma_dptr; /* pbus dma channel desc ptr */ -- u32 _unused0[0x1000/4 - 2]; /* padding */ -- volatile u32 pbdma_ctrl; /* pbus dma channel control register has -+ volatile __u32 pbdma_bptr; /* pbus dma channel buffer ptr */ -+ volatile __u32 pbdma_dptr; /* pbus dma channel desc ptr */ -+ __u32 _unused0[0x1000/4 - 2]; /* padding */ -+ volatile __u32 pbdma_ctrl; /* pbus dma channel control register has - * copletely different meaning for read - * compared with write */ - /* read */ -@@ -55,20 +55,20 @@ - #define HPC3_PDMACTRL_FB 0x003f0000 /* Ptr to beginning of fifo */ - #define HPC3_PDMACTRL_FE 0x3f000000 /* Ptr to end of fifo */ - -- u32 _unused1[0x1000/4 - 1]; /* padding */ -+ __u32 _unused1[0x1000/4 - 1]; /* padding */ - }; - - /* The HPC3 SCSI registers, this does not include external ones. */ - struct hpc3_scsiregs { -- volatile u32 cbptr; /* current dma buffer ptr, diagnostic use only */ -- volatile u32 ndptr; /* next dma descriptor ptr */ -- u32 _unused0[0x1000/4 - 2]; /* padding */ -- volatile u32 bcd; /* byte count info */ -+ volatile __u32 cbptr; /* current dma buffer ptr, diagnostic use only */ -+ volatile __u32 ndptr; /* next dma descriptor ptr */ -+ __u32 _unused0[0x1000/4 - 2]; /* padding */ -+ volatile __u32 bcd; /* byte count info */ - #define HPC3_SBCD_BCNTMSK 0x00003fff /* bytes to transfer from/to memory */ - #define HPC3_SBCD_XIE 0x00004000 /* Send IRQ when done with cur buf */ - #define HPC3_SBCD_EOX 0x00008000 /* Indicates this is last buf in chain */ - -- volatile u32 ctrl; /* control register */ -+ volatile __u32 ctrl; /* control register */ - #define HPC3_SCTRL_IRQ 0x01 /* IRQ asserted, either dma done or parity */ - #define HPC3_SCTRL_ENDIAN 0x02 /* DMA endian mode, 0=big 1=little */ - #define HPC3_SCTRL_DIR 0x04 /* DMA direction, 1=dev2mem 0=mem2dev */ -@@ -78,9 +78,9 @@ - #define HPC3_SCTRL_CRESET 0x40 /* Resets dma channel and external controller */ - #define HPC3_SCTRL_PERR 0x80 /* Bad parity on HPC3 iface to scsi controller */ - -- volatile u32 gfptr; /* current GIO fifo ptr */ -- volatile u32 dfptr; /* current device fifo ptr */ -- volatile u32 dconfig; /* DMA configuration register */ -+ volatile __u32 gfptr; /* current GIO fifo ptr */ -+ volatile __u32 dfptr; /* current device fifo ptr */ -+ volatile __u32 dconfig; /* DMA configuration register */ - #define HPC3_SDCFG_HCLK 0x00001 /* Enable DMA half clock mode */ - #define HPC3_SDCFG_D1 0x00006 /* Cycles to spend in D1 state */ - #define HPC3_SDCFG_D2 0x00038 /* Cycles to spend in D2 state */ -@@ -92,7 +92,7 @@ - #define HPC3_SDCFG_POLL 0x08000 /* hd_dreq polarity control */ - #define HPC3_SDCFG_ERLY 0x30000 /* hd_dreq behavior control bits */ - -- volatile u32 pconfig; /* PIO configuration register */ -+ volatile __u32 pconfig; /* PIO configuration register */ - #define HPC3_SPCFG_P3 0x0003 /* Cycles to spend in P3 state */ - #define HPC3_SPCFG_P2W 0x001c /* Cycles to spend in P2 state for writes */ - #define HPC3_SPCFG_P2R 0x01e0 /* Cycles to spend in P2 state for reads */ -@@ -102,21 +102,21 @@ - #define HPC3_SPCFG_EPAR 0x4000 /* Enable parity checking for PIO */ - #define HPC3_SPCFG_FUJI 0x8000 /* Fujitsu scsi controller mode for faster dma/pio */ - -- u32 _unused1[0x1000/4 - 6]; /* padding */ -+ __u32 _unused1[0x1000/4 - 6]; /* padding */ - }; - - /* SEEQ ethernet HPC3 registers, only one seeq per HPC3. */ - struct hpc3_ethregs { - /* Receiver registers. */ -- volatile u32 rx_cbptr; /* current dma buffer ptr, diagnostic use only */ -- volatile u32 rx_ndptr; /* next dma descriptor ptr */ -- u32 _unused0[0x1000/4 - 2]; /* padding */ -- volatile u32 rx_bcd; /* byte count info */ -+ volatile __u32 rx_cbptr; /* current dma buffer ptr, diagnostic use only */ -+ volatile __u32 rx_ndptr; /* next dma descriptor ptr */ -+ __u32 _unused0[0x1000/4 - 2]; /* padding */ -+ volatile __u32 rx_bcd; /* byte count info */ - #define HPC3_ERXBCD_BCNTMSK 0x00003fff /* bytes to be sent to memory */ - #define HPC3_ERXBCD_XIE 0x20000000 /* HPC3 interrupts cpu at end of this buf */ - #define HPC3_ERXBCD_EOX 0x80000000 /* flags this as end of descriptor chain */ - -- volatile u32 rx_ctrl; /* control register */ -+ volatile __u32 rx_ctrl; /* control register */ - #define HPC3_ERXCTRL_STAT50 0x0000003f /* Receive status reg bits of Seeq8003 */ - #define HPC3_ERXCTRL_STAT6 0x00000040 /* Rdonly irq status */ - #define HPC3_ERXCTRL_STAT7 0x00000080 /* Rdonlt old/new status bit from Seeq */ -@@ -125,15 +125,15 @@ - #define HPC3_ERXCTRL_AMASK 0x00000400 /* Tells if ACTIVE inhibits PIO's to hpc3 */ - #define HPC3_ERXCTRL_RBO 0x00000800 /* Receive buffer overflow if set to 1 */ - -- volatile u32 rx_gfptr; /* current GIO fifo ptr */ -- volatile u32 rx_dfptr; /* current device fifo ptr */ -- u32 _unused1; /* padding */ -- volatile u32 rx_reset; /* reset register */ -+ volatile __u32 rx_gfptr; /* current GIO fifo ptr */ -+ volatile __u32 rx_dfptr; /* current device fifo ptr */ -+ __u32 _unused1; /* padding */ -+ volatile __u32 rx_reset; /* reset register */ - #define HPC3_ERXRST_CRESET 0x1 /* Reset dma channel and external controller */ - #define HPC3_ERXRST_CLRIRQ 0x2 /* Clear channel interrupt */ - #define HPC3_ERXRST_LBACK 0x4 /* Enable diagnostic loopback mode of Seeq8003 */ - -- volatile u32 rx_dconfig; /* DMA configuration register */ -+ volatile __u32 rx_dconfig; /* DMA configuration register */ - #define HPC3_ERXDCFG_D1 0x0000f /* Cycles to spend in D1 state for PIO */ - #define HPC3_ERXDCFG_D2 0x000f0 /* Cycles to spend in D2 state for PIO */ - #define HPC3_ERXDCFG_D3 0x00f00 /* Cycles to spend in D3 state for PIO */ -@@ -143,26 +143,26 @@ - #define HPC3_ERXDCFG_FIRQ 0x08000 /* Another bad packet timeout enable */ - #define HPC3_ERXDCFG_PTO 0x30000 /* Programmed timeout value for above two */ - -- volatile u32 rx_pconfig; /* PIO configuration register */ -+ volatile __u32 rx_pconfig; /* PIO configuration register */ - #define HPC3_ERXPCFG_P1 0x000f /* Cycles to spend in P1 state for PIO */ - #define HPC3_ERXPCFG_P2 0x00f0 /* Cycles to spend in P2 state for PIO */ - #define HPC3_ERXPCFG_P3 0x0f00 /* Cycles to spend in P3 state for PIO */ - #define HPC3_ERXPCFG_TST 0x1000 /* Diagnistic ram test feature bit */ - -- u32 _unused2[0x1000/4 - 8]; /* padding */ -+ __u32 _unused2[0x1000/4 - 8]; /* padding */ - - /* Transmitter registers. */ -- volatile u32 tx_cbptr; /* current dma buffer ptr, diagnostic use only */ -- volatile u32 tx_ndptr; /* next dma descriptor ptr */ -- u32 _unused3[0x1000/4 - 2]; /* padding */ -- volatile u32 tx_bcd; /* byte count info */ -+ volatile __u32 tx_cbptr; /* current dma buffer ptr, diagnostic use only */ -+ volatile __u32 tx_ndptr; /* next dma descriptor ptr */ -+ __u32 _unused3[0x1000/4 - 2]; /* padding */ -+ volatile __u32 tx_bcd; /* byte count info */ - #define HPC3_ETXBCD_BCNTMSK 0x00003fff /* bytes to be read from memory */ - #define HPC3_ETXBCD_ESAMP 0x10000000 /* if set, too late to add descriptor */ - #define HPC3_ETXBCD_XIE 0x20000000 /* Interrupt cpu at end of cur desc */ - #define HPC3_ETXBCD_EOP 0x40000000 /* Last byte of cur buf is end of packet */ - #define HPC3_ETXBCD_EOX 0x80000000 /* This buf is the end of desc chain */ - -- volatile u32 tx_ctrl; /* control register */ -+ volatile __u32 tx_ctrl; /* control register */ - #define HPC3_ETXCTRL_STAT30 0x0000000f /* Rdonly copy of seeq tx stat reg */ - #define HPC3_ETXCTRL_STAT4 0x00000010 /* Indicate late collision occurred */ - #define HPC3_ETXCTRL_STAT75 0x000000e0 /* Rdonly irq status from seeq */ -@@ -170,9 +170,9 @@ - #define HPC3_ETXCTRL_ACTIVE 0x00000200 /* DMA tx channel is active */ - #define HPC3_ETXCTRL_AMASK 0x00000400 /* Indicates ACTIVE inhibits PIO's */ - -- volatile u32 tx_gfptr; /* current GIO fifo ptr */ -- volatile u32 tx_dfptr; /* current device fifo ptr */ -- u32 _unused4[0x1000/4 - 4]; /* padding */ -+ volatile __u32 tx_gfptr; /* current GIO fifo ptr */ -+ volatile __u32 tx_dfptr; /* current device fifo ptr */ -+ __u32 _unused4[0x1000/4 - 4]; /* padding */ - }; - - struct hpc3_regs { -@@ -188,7 +188,7 @@ - /* Here are where the hpc3 fifo's can be directly accessed - * via PIO accesses. Under normal operation we never stick - * our grubby paws in here so it's just padding. */ -- u32 _unused0[0x18000/4]; -+ __u32 _unused0[0x18000/4]; - - /* HPC3 irq status regs. Due to a peculiar bug you need to - * look at two different register addresses to get at all of -@@ -197,42 +197,42 @@ - * reliably report bits 9:5 of the hpc3 irq status. I told - * you it was a peculiar bug. ;-) - */ -- volatile u32 istat0; /* Irq status, only bits <4:0> reliable. */ -+ volatile __u32 istat0; /* Irq status, only bits <4:0> reliable. */ - #define HPC3_ISTAT_PBIMASK 0x0ff /* irq bits for pbus devs 0 --> 7 */ - #define HPC3_ISTAT_SC0MASK 0x100 /* irq bit for scsi channel 0 */ - #define HPC3_ISTAT_SC1MASK 0x200 /* irq bit for scsi channel 1 */ - -- volatile u32 gio_misc; /* GIO misc control bits. */ -+ volatile __u32 gio_misc; /* GIO misc control bits. */ - #define HPC3_GIOMISC_ERTIME 0x1 /* Enable external timer real time. */ - #define HPC3_GIOMISC_DENDIAN 0x2 /* dma descriptor endian, 1=lit 0=big */ - -- volatile u32 eeprom; /* EEPROM data reg. */ -+ volatile __u32 eeprom; /* EEPROM data reg. */ - #define HPC3_EEPROM_EPROT 0x01 /* Protect register enable */ - #define HPC3_EEPROM_CSEL 0x02 /* Chip select */ - #define HPC3_EEPROM_ECLK 0x04 /* EEPROM clock */ - #define HPC3_EEPROM_DATO 0x08 /* Data out */ - #define HPC3_EEPROM_DATI 0x10 /* Data in */ - -- volatile u32 istat1; /* Irq status, only bits <9:5> reliable. */ -- volatile u32 bestat; /* Bus error interrupt status reg. */ -+ volatile __u32 istat1; /* Irq status, only bits <9:5> reliable. */ -+ volatile __u32 bestat; /* Bus error interrupt status reg. */ - #define HPC3_BESTAT_BLMASK 0x000ff /* Bus lane where bad parity occurred */ - #define HPC3_BESTAT_CTYPE 0x00100 /* Bus cycle type, 0=PIO 1=DMA */ - #define HPC3_BESTAT_PIDSHIFT 9 - #define HPC3_BESTAT_PIDMASK 0x3f700 /* DMA channel parity identifier */ - -- u32 _unused1[0x14000/4 - 5]; /* padding */ -+ __u32 _unused1[0x14000/4 - 5]; /* padding */ - - /* Now direct PIO per-HPC3 peripheral access to external regs. */ -- volatile u32 scsi0_ext[256]; /* SCSI channel 0 external regs */ -- u32 _unused2[0x7c00/4]; -- volatile u32 scsi1_ext[256]; /* SCSI channel 1 external regs */ -- u32 _unused3[0x7c00/4]; -- volatile u32 eth_ext[320]; /* Ethernet external registers */ -- u32 _unused4[0x3b00/4]; -+ volatile __u32 scsi0_ext[256]; /* SCSI channel 0 external regs */ -+ __u32 _unused2[0x7c00/4]; -+ volatile __u32 scsi1_ext[256]; /* SCSI channel 1 external regs */ -+ __u32 _unused3[0x7c00/4]; -+ volatile __u32 eth_ext[320]; /* Ethernet external registers */ -+ __u32 _unused4[0x3b00/4]; - - /* Per-peripheral device external registers and DMA/PIO control. */ -- volatile u32 pbus_extregs[16][256]; -- volatile u32 pbus_dmacfg[8][128]; -+ volatile __u32 pbus_extregs[16][256]; -+ volatile __u32 pbus_dmacfg[8][128]; - /* Cycles to spend in D3 for reads */ - #define HPC3_DMACFG_D3R_MASK 0x00000001 - #define HPC3_DMACFG_D3R_SHIFT 0 -@@ -262,7 +262,7 @@ - #define HPC3_DMACFG_BURST_SHIFT 22 - /* Use live pbus_dreq unsynchronized signal */ - #define HPC3_DMACFG_DRQLIVE 0x08000000 -- volatile u32 pbus_piocfg[16][64]; -+ volatile __u32 pbus_piocfg[16][64]; - /* Cycles to spend in P2 state for reads */ - #define HPC3_PIOCFG_P2R_MASK 0x00001 - #define HPC3_PIOCFG_P2R_SHIFT 0 -@@ -287,21 +287,21 @@ - #define HPC3_PIOCFG_EVENHI 0x80000 - - /* PBUS PROM control regs. */ -- volatile u32 pbus_promwe; /* PROM write enable register */ -+ volatile __u32 pbus_promwe; /* PROM write enable register */ - #define HPC3_PROM_WENAB 0x1 /* Enable writes to the PROM */ - -- u32 _unused5[0x0800/4 - 1]; -- volatile u32 pbus_promswap; /* Chip select swap reg */ -+ __u32 _unused5[0x0800/4 - 1]; -+ volatile __u32 pbus_promswap; /* Chip select swap reg */ - #define HPC3_PROM_SWAP 0x1 /* invert GIO addr bit to select prom0 or prom1 */ - -- u32 _unused6[0x0800/4 - 1]; -- volatile u32 pbus_gout; /* PROM general purpose output reg */ -+ __u32 _unused6[0x0800/4 - 1]; -+ volatile __u32 pbus_gout; /* PROM general purpose output reg */ - #define HPC3_PROM_STAT 0x1 /* General purpose status bit in gout */ - -- u32 _unused7[0x1000/4 - 1]; -- volatile u32 rtcregs[14]; /* Dallas clock registers */ -- u32 _unused8[50]; -- volatile u32 bbram[8192-50-14]; /* Battery backed ram */ -+ __u32 _unused7[0x1000/4 - 1]; -+ volatile __u32 rtcregs[14]; /* Dallas clock registers */ -+ __u32 _unused8[50]; -+ volatile __u32 bbram[8192-50-14]; /* Battery backed ram */ - }; - - /* -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgi/ioc.h linux-libc-headers-2.6.8.0/include/asm-mips/sgi/ioc.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgi/ioc.h 2004-03-28 07:51:54.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sgi/ioc.h 2004-08-26 05:24:48.000000000 -0500 -@@ -22,26 +22,26 @@ - */ - - struct sgioc_uart_regs { -- u8 _ctrl1[3]; -- volatile u8 ctrl1; -- u8 _data1[3]; -- volatile u8 data1; -- u8 _ctrl2[3]; -- volatile u8 ctrl2; -- u8 _data2[3]; -- volatile u8 data2; -+ __u8 _ctrl1[3]; -+ volatile __u8 ctrl1; -+ __u8 _data1[3]; -+ volatile __u8 data1; -+ __u8 _ctrl2[3]; -+ volatile __u8 ctrl2; -+ __u8 _data2[3]; -+ volatile __u8 data2; - }; - - struct sgioc_keyb_regs { -- u8 _data[3]; -- volatile u8 data; -- u8 _command[3]; -- volatile u8 command; -+ __u8 _data[3]; -+ volatile __u8 data; -+ __u8 _command[3]; -+ volatile __u8 command; - }; - - struct sgint_regs { -- u8 _istat0[3]; -- volatile u8 istat0; /* Interrupt status zero */ -+ __u8 _istat0[3]; -+ volatile __u8 istat0; /* Interrupt status zero */ - #define SGINT_ISTAT0_FFULL 0x01 - #define SGINT_ISTAT0_SCSI0 0x02 - #define SGINT_ISTAT0_SCSI1 0x04 -@@ -50,10 +50,10 @@ - #define SGINT_ISTAT0_PPORT 0x20 - #define SGINT_ISTAT0_HPC2 0x40 - #define SGINT_ISTAT0_LIO2 0x80 -- u8 _imask0[3]; -- volatile u8 imask0; /* Interrupt mask zero */ -- u8 _istat1[3]; -- volatile u8 istat1; /* Interrupt status one */ -+ __u8 _imask0[3]; -+ volatile __u8 imask0; /* Interrupt mask zero */ -+ __u8 _istat1[3]; -+ volatile __u8 istat1; /* Interrupt status one */ - #define SGINT_ISTAT1_ISDNI 0x01 - #define SGINT_ISTAT1_PWR 0x02 - #define SGINT_ISTAT1_ISDNH 0x04 -@@ -62,29 +62,29 @@ - #define SGINT_ISTAT1_AFAIL 0x20 - #define SGINT_ISTAT1_VIDEO 0x40 - #define SGINT_ISTAT1_GIO2 0x80 -- u8 _imask1[3]; -- volatile u8 imask1; /* Interrupt mask one */ -- u8 _vmeistat[3]; -- volatile u8 vmeistat; /* VME interrupt status */ -- u8 _cmeimask0[3]; -- volatile u8 cmeimask0; /* VME interrupt mask zero */ -- u8 _cmeimask1[3]; -- volatile u8 cmeimask1; /* VME interrupt mask one */ -- u8 _cmepol[3]; -- volatile u8 cmepol; /* VME polarity */ -- u8 _tclear[3]; -- volatile u8 tclear; -- u8 _errstat[3]; -- volatile u8 errstat; /* Error status reg, reserved on INT2 */ -- u32 _unused0[2]; -- u8 _tcnt0[3]; -- volatile u8 tcnt0; /* counter 0 */ -- u8 _tcnt1[3]; -- volatile u8 tcnt1; /* counter 1 */ -- u8 _tcnt2[3]; -- volatile u8 tcnt2; /* counter 2 */ -- u8 _tcword[3]; -- volatile u8 tcword; /* control word */ -+ __u8 _imask1[3]; -+ volatile __u8 imask1; /* Interrupt mask one */ -+ __u8 _vmeistat[3]; -+ volatile __u8 vmeistat; /* VME interrupt status */ -+ __u8 _cmeimask0[3]; -+ volatile __u8 cmeimask0; /* VME interrupt mask zero */ -+ __u8 _cmeimask1[3]; -+ volatile __u8 cmeimask1; /* VME interrupt mask one */ -+ __u8 _cmepol[3]; -+ volatile __u8 cmepol; /* VME polarity */ -+ __u8 _tclear[3]; -+ volatile __u8 tclear; -+ __u8 _errstat[3]; -+ volatile __u8 errstat; /* Error status reg, reserved on INT2 */ -+ __u32 _unused0[2]; -+ __u8 _tcnt0[3]; -+ volatile __u8 tcnt0; /* counter 0 */ -+ __u8 _tcnt1[3]; -+ volatile __u8 tcnt1; /* counter 1 */ -+ __u8 _tcnt2[3]; -+ volatile __u8 tcnt2; /* counter 2 */ -+ __u8 _tcword[3]; -+ volatile __u8 tcword; /* control word */ - #define SGINT_TCWORD_BCD 0x01 /* Use BCD mode for counters */ - #define SGINT_TCWORD_MMASK 0x0e /* Mode bitmask. */ - #define SGINT_TCWORD_MITC 0x00 /* IRQ on terminal count (doesn't work) */ -@@ -115,55 +115,55 @@ - #define SGINT_TCSAMP_COUNTER ((SGINT_TIMER_CLOCK / HZ) + 255) - - /* We need software copies of these because they are write only. */ --extern u8 sgi_ioc_reset, sgi_ioc_write; -+extern __u8 sgi_ioc_reset, sgi_ioc_write; - - struct sgioc_regs { - struct pi1_regs pport; -- u32 _unused0[2]; -+ __u32 _unused0[2]; - struct sgioc_uart_regs serport; - struct sgioc_keyb_regs kbdmouse; -- u8 _gcsel[3]; -- volatile u8 gcsel; -- u8 _genctrl[3]; -- volatile u8 genctrl; -- u8 _panel[3]; -- volatile u8 panel; -+ __u8 _gcsel[3]; -+ volatile __u8 gcsel; -+ __u8 _genctrl[3]; -+ volatile __u8 genctrl; -+ __u8 _panel[3]; -+ volatile __u8 panel; - #define SGIOC_PANEL_POWERON 0x01 - #define SGIOC_PANEL_POWERINTR 0x02 - #define SGIOC_PANEL_VOLDNINTR 0x10 - #define SGIOC_PANEL_VOLDNHOLD 0x20 - #define SGIOC_PANEL_VOLUPINTR 0x40 - #define SGIOC_PANEL_VOLUPHOLD 0x80 -- u32 _unused1; -- u8 _sysid[3]; -- volatile u8 sysid; -+ __u32 _unused1; -+ __u8 _sysid[3]; -+ volatile __u8 sysid; - #define SGIOC_SYSID_FULLHOUSE 0x01 - #define SGIOC_SYSID_BOARDREV(x) ((x & 0xe0) > 5) - #define SGIOC_SYSID_CHIPREV(x) ((x & 0x1e) > 1) -- u32 _unused2; -- u8 _read[3]; -- volatile u8 read; -- u32 _unused3; -- u8 _dmasel[3]; -- volatile u8 dmasel; -+ __u32 _unused2; -+ __u8 _read[3]; -+ volatile __u8 read; -+ __u32 _unused3; -+ __u8 _dmasel[3]; -+ volatile __u8 dmasel; - #define SGIOC_DMASEL_SCLK10MHZ 0x00 /* use 10MHZ serial clock */ - #define SGIOC_DMASEL_ISDNB 0x01 /* enable isdn B */ - #define SGIOC_DMASEL_ISDNA 0x02 /* enable isdn A */ - #define SGIOC_DMASEL_PPORT 0x04 /* use parallel DMA */ - #define SGIOC_DMASEL_SCLK667MHZ 0x10 /* use 6.67MHZ serial clock */ - #define SGIOC_DMASEL_SCLKEXT 0x20 /* use external serial clock */ -- u32 _unused4; -- u8 _reset[3]; -- volatile u8 reset; -+ __u32 _unused4; -+ __u8 _reset[3]; -+ volatile __u8 reset; - #define SGIOC_RESET_PPORT 0x01 /* 0=parport reset, 1=nornal */ - #define SGIOC_RESET_KBDMOUSE 0x02 /* 0=kbdmouse reset, 1=normal */ - #define SGIOC_RESET_EISA 0x04 /* 0=eisa reset, 1=normal */ - #define SGIOC_RESET_ISDN 0x08 /* 0=isdn reset, 1=normal */ - #define SGIOC_RESET_LC0OFF 0x10 /* guiness: turn led off (red, else green) */ - #define SGIOC_RESET_LC1OFF 0x20 /* guiness: turn led off (green, else amber) */ -- u32 _unused5; -- u8 _write[3]; -- volatile u8 write; -+ __u32 _unused5; -+ __u8 _write[3]; -+ volatile __u8 write; - #define SGIOC_WRITE_NTHRESH 0x01 /* use 4.5db threshhold */ - #define SGIOC_WRITE_TPSPEED 0x02 /* use 100ohm TP speed */ - #define SGIOC_WRITE_EPSEL 0x04 /* force cable mode: 1=AUI 0=TP */ -@@ -172,10 +172,10 @@ - #define SGIOC_WRITE_U0AMODE 0x20 /* 1=PC 0=MAC UART mode */ - #define SGIOC_WRITE_MLO 0x40 /* 1=4.75V 0=+5V */ - #define SGIOC_WRITE_MHI 0x80 /* 1=5.25V 0=+5V */ -- u32 _unused6; -+ __u32 _unused6; - struct sgint_regs int3; -- u32 _unused7[16]; -- volatile u32 extio; /* FullHouse only */ -+ __u32 _unused7[16]; -+ volatile __u32 extio; /* FullHouse only */ - #define EXTIO_S0_IRQ_3 0x8000 /* S0: vid.vsync */ - #define EXTIO_S0_IRQ_2 0x4000 /* S0: gfx.fifofull */ - #define EXTIO_S0_IRQ_1 0x2000 /* S0: gfx.int */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgi/mc.h linux-libc-headers-2.6.8.0/include/asm-mips/sgi/mc.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgi/mc.h 2003-12-15 12:47:03.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sgi/mc.h 2004-08-26 05:25:28.000000000 -0500 -@@ -14,8 +14,8 @@ - #define _SGI_MC_H - - struct sgimc_regs { -- u32 _unused0; -- volatile u32 cpuctrl0; /* CPU control register 0, readwrite */ -+ __u32 _unused0; -+ volatile __u32 cpuctrl0; /* CPU control register 0, readwrite */ - #define SGIMC_CCTRL0_REFS 0x0000000f /* REFS mask */ - #define SGIMC_CCTRL0_EREFRESH 0x00000010 /* Memory refresh enable */ - #define SGIMC_CCTRL0_EPERRGIO 0x00000020 /* GIO parity error enable */ -@@ -35,8 +35,8 @@ - #define SGIMC_CCTRL0_CMEMBADPAR 0x02000000 /* Generate bad perr from cpu to mem */ - #define SGIMC_CCTRL0_R4KNOCHKPARR 0x04000000 /* Don't chk parity on mem data reads */ - #define SGIMC_CCTRL0_GIOBTOB 0x08000000 /* Allow GIO back to back writes */ -- u32 _unused1; -- volatile u32 cpuctrl1; /* CPU control register 1, readwrite */ -+ __u32 _unused1; -+ volatile __u32 cpuctrl1; /* CPU control register 1, readwrite */ - #define SGIMC_CCTRL1_EGIOTIMEO 0x00000010 /* GIO bus timeout enable */ - #define SGIMC_CCTRL1_FIXEDEHPC 0x00001000 /* Fixed HPC endianness */ - #define SGIMC_CCTRL1_LITTLEHPC 0x00002000 /* Little endian HPC */ -@@ -45,33 +45,33 @@ - #define SGIMC_CCTRL1_FIXEDEEXP1 0x00010000 /* Fixed EXP1 endianness */ - #define SGIMC_CCTRL1_LITTLEEXP1 0x00020000 /* Little endian EXP1 */ - -- u32 _unused2; -- volatile u32 watchdogt; /* Watchdog reg rdonly, write clears */ -+ __u32 _unused2; -+ volatile __u32 watchdogt; /* Watchdog reg rdonly, write clears */ - -- u32 _unused3; -- volatile u32 systemid; /* MC system ID register, readonly */ -+ __u32 _unused3; -+ volatile __u32 systemid; /* MC system ID register, readonly */ - #define SGIMC_SYSID_MASKREV 0x0000000f /* Revision of MC controller */ - #define SGIMC_SYSID_EPRESENT 0x00000010 /* Indicates presence of EISA bus */ - -- u32 _unused4[3]; -- volatile u32 divider; /* Divider reg for RPSS */ -+ __u32 _unused4[3]; -+ volatile __u32 divider; /* Divider reg for RPSS */ - -- u32 _unused5; -- volatile u32 eeprom; /* EEPROM byte reg for r4k */ -+ __u32 _unused5; -+ volatile __u32 eeprom; /* EEPROM byte reg for r4k */ - #define SGIMC_EEPROM_PRE 0x00000001 /* eeprom chip PRE pin assertion */ - #define SGIMC_EEPROM_CSEL 0x00000002 /* Active high, eeprom chip select */ - #define SGIMC_EEPROM_SECLOCK 0x00000004 /* EEPROM serial clock */ - #define SGIMC_EEPROM_SDATAO 0x00000008 /* Serial EEPROM data-out */ - #define SGIMC_EEPROM_SDATAI 0x00000010 /* Serial EEPROM data-in */ - -- u32 _unused6[3]; -- volatile u32 rcntpre; /* Preload refresh counter */ -+ __u32 _unused6[3]; -+ volatile __u32 rcntpre; /* Preload refresh counter */ - -- u32 _unused7; -- volatile u32 rcounter; /* Readonly refresh counter */ -+ __u32 _unused7; -+ volatile __u32 rcounter; /* Readonly refresh counter */ - -- u32 _unused8[13]; -- volatile u32 giopar; /* Parameter word for GIO64 */ -+ __u32 _unused8[13]; -+ volatile __u32 giopar; /* Parameter word for GIO64 */ - #define SGIMC_GIOPAR_HPC64 0x00000001 /* HPC talks to GIO using 64-bits */ - #define SGIMC_GIOPAR_GFX64 0x00000002 /* GFX talks to GIO using 64-bits */ - #define SGIMC_GIOPAR_EXP064 0x00000004 /* EXP(slot0) talks using 64-bits */ -@@ -89,36 +89,36 @@ - #define SGIMC_GIOPAR_PLINEEXP0 0x00004000 /* EXP(slot0) has pipeline attr */ - #define SGIMC_GIOPAR_PLINEEXP1 0x00008000 /* EXP(slot1) has pipeline attr */ - -- u32 _unused9; -- volatile u32 cputp; /* CPU bus arb time period */ -+ __u32 _unused9; -+ volatile __u32 cputp; /* CPU bus arb time period */ - -- u32 _unused10[3]; -- volatile u32 lbursttp; /* Time period for long bursts */ -+ __u32 _unused10[3]; -+ volatile __u32 lbursttp; /* Time period for long bursts */ - - /* MC chip can drive up to 4 bank 4 SIMMs each. All SIMMs in bank must - * be the same size. The size encoding for supported SIMMs is bellow */ -- u32 _unused11[9]; -- volatile u32 mconfig0; /* Memory config register zero */ -- u32 _unused12; -- volatile u32 mconfig1; /* Memory config register one */ -+ __u32 _unused11[9]; -+ volatile __u32 mconfig0; /* Memory config register zero */ -+ __u32 _unused12; -+ volatile __u32 mconfig1; /* Memory config register one */ - #define SGIMC_MCONFIG_BASEADDR 0x000000ff /* Base address of bank*/ - #define SGIMC_MCONFIG_RMASK 0x00001f00 /* Ram config bitmask */ - #define SGIMC_MCONFIG_BVALID 0x00002000 /* Bank is valid */ - #define SGIMC_MCONFIG_SBANKS 0x00004000 /* Number of subbanks */ - -- u32 _unused13; -- volatile u32 cmacc; /* Mem access config for CPU */ -- u32 _unused14; -- volatile u32 gmacc; /* Mem access config for GIO */ -+ __u32 _unused13; -+ volatile __u32 cmacc; /* Mem access config for CPU */ -+ __u32 _unused14; -+ volatile __u32 gmacc; /* Mem access config for GIO */ - - /* This define applies to both cmacc and gmacc registers above. */ - #define SGIMC_MACC_ALIASBIG 0x20000000 /* 512MB home for alias */ - - /* Error address/status regs from GIO and CPU perspectives. */ -- u32 _unused15; -- volatile u32 cerr; /* Error address reg for CPU */ -- u32 _unused16; -- volatile u32 cstat; /* Status reg for CPU */ -+ __u32 _unused15; -+ volatile __u32 cerr; /* Error address reg for CPU */ -+ __u32 _unused16; -+ volatile __u32 cstat; /* Status reg for CPU */ - #define SGIMC_CSTAT_RD 0x00000100 /* read parity error */ - #define SGIMC_CSTAT_PAR 0x00000200 /* CPU parity error */ - #define SGIMC_CSTAT_ADDR 0x00000400 /* memory bus error bad addr */ -@@ -128,10 +128,10 @@ - #define SGIMC_CSTAT_PAR_MASK 0x00001f00 /* parity error mask */ - #define SGIMC_CSTAT_RD_PAR (SGIMC_CSTAT_RD | SGIMC_CSTAT_PAR) - -- u32 _unused17; -- volatile u32 gerr; /* Error address reg for GIO */ -- u32 _unused18; -- volatile u32 gstat; /* Status reg for GIO */ -+ __u32 _unused17; -+ volatile __u32 gerr; /* Error address reg for GIO */ -+ __u32 _unused18; -+ volatile __u32 gstat; /* Status reg for GIO */ - #define SGIMC_GSTAT_RD 0x00000100 /* read parity error */ - #define SGIMC_GSTAT_WR 0x00000200 /* write parity error */ - #define SGIMC_GSTAT_TIME 0x00000400 /* GIO bus timed out */ -@@ -142,76 +142,76 @@ - #define SGIMC_GSTAT_PIO_WR 0x00008000 /* write data parity on pio */ - - /* Special hard bus locking registers. */ -- u32 _unused19; -- volatile u32 syssembit; /* Uni-bit system semaphore */ -- u32 _unused20; -- volatile u32 mlock; /* Global GIO memory access lock */ -- u32 _unused21; -- volatile u32 elock; /* Locks EISA from GIO accesses */ -+ __u32 _unused19; -+ volatile __u32 syssembit; /* Uni-bit system semaphore */ -+ __u32 _unused20; -+ volatile __u32 mlock; /* Global GIO memory access lock */ -+ __u32 _unused21; -+ volatile __u32 elock; /* Locks EISA from GIO accesses */ - - /* GIO dma control registers. */ -- u32 _unused22[15]; -- volatile u32 gio_dma_trans; /* DMA mask to translation GIO addrs */ -- u32 _unused23; -- volatile u32 gio_dma_sbits; /* DMA GIO addr substitution bits */ -- u32 _unused24; -- volatile u32 dma_intr_cause; /* DMA IRQ cause indicator bits */ -- u32 _unused25; -- volatile u32 dma_ctrl; /* Main DMA control reg */ -+ __u32 _unused22[15]; -+ volatile __u32 gio_dma_trans; /* DMA mask to translation GIO addrs */ -+ __u32 _unused23; -+ volatile __u32 gio_dma_sbits; /* DMA GIO addr substitution bits */ -+ __u32 _unused24; -+ volatile __u32 dma_intr_cause; /* DMA IRQ cause indicator bits */ -+ __u32 _unused25; -+ volatile __u32 dma_ctrl; /* Main DMA control reg */ - - /* DMA TLB entry 0 */ -- u32 _unused26[5]; -- volatile u32 dtlb_hi0; -- u32 _unused27; -- volatile u32 dtlb_lo0; -+ __u32 _unused26[5]; -+ volatile __u32 dtlb_hi0; -+ __u32 _unused27; -+ volatile __u32 dtlb_lo0; - - /* DMA TLB entry 1 */ -- u32 _unused28; -- volatile u32 dtlb_hi1; -- u32 _unused29; -- volatile u32 dtlb_lo1; -+ __u32 _unused28; -+ volatile __u32 dtlb_hi1; -+ __u32 _unused29; -+ volatile __u32 dtlb_lo1; - - /* DMA TLB entry 2 */ -- u32 _unused30; -- volatile u32 dtlb_hi2; -- u32 _unused31; -- volatile u32 dtlb_lo2; -+ __u32 _unused30; -+ volatile __u32 dtlb_hi2; -+ __u32 _unused31; -+ volatile __u32 dtlb_lo2; - - /* DMA TLB entry 3 */ -- u32 _unused32; -- volatile u32 dtlb_hi3; -- u32 _unused33; -- volatile u32 dtlb_lo3; -+ __u32 _unused32; -+ volatile __u32 dtlb_hi3; -+ __u32 _unused33; -+ volatile __u32 dtlb_lo3; - -- u32 _unused34[0x0392]; -+ __u32 _unused34[0x0392]; - -- u32 _unused35; -- volatile u32 rpsscounter; /* Chirps at 100ns */ -+ __u32 _unused35; -+ volatile __u32 rpsscounter; /* Chirps at 100ns */ - -- u32 _unused36[0x1000/4-2*4]; -+ __u32 _unused36[0x1000/4-2*4]; - -- u32 _unused37; -- volatile u32 maddronly; /* Address DMA goes at */ -- u32 _unused38; -- volatile u32 maddrpdeflts; /* Same as above, plus set defaults */ -- u32 _unused39; -- volatile u32 dmasz; /* DMA count */ -- u32 _unused40; -- volatile u32 ssize; /* DMA stride size */ -- u32 _unused41; -- volatile u32 gmaddronly; /* Set GIO DMA but don't start trans */ -- u32 _unused42; -- volatile u32 dmaddnpgo; /* Set GIO DMA addr + start transfer */ -- u32 _unused43; -- volatile u32 dmamode; /* DMA mode config bit settings */ -- u32 _unused44; -- volatile u32 dmaccount; /* Zoom and byte count for DMA */ -- u32 _unused45; -- volatile u32 dmastart; /* Pedal to the metal. */ -- u32 _unused46; -- volatile u32 dmarunning; /* DMA op is in progress */ -- u32 _unused47; -- volatile u32 maddrdefstart; /* Set dma addr, defaults, and kick it */ -+ __u32 _unused37; -+ volatile __u32 maddronly; /* Address DMA goes at */ -+ __u32 _unused38; -+ volatile __u32 maddrpdeflts; /* Same as above, plus set defaults */ -+ __u32 _unused39; -+ volatile __u32 dmasz; /* DMA count */ -+ __u32 _unused40; -+ volatile __u32 ssize; /* DMA stride size */ -+ __u32 _unused41; -+ volatile __u32 gmaddronly; /* Set GIO DMA but don't start trans */ -+ __u32 _unused42; -+ volatile __u32 dmaddnpgo; /* Set GIO DMA addr + start transfer */ -+ __u32 _unused43; -+ volatile __u32 dmamode; /* DMA mode config bit settings */ -+ __u32 _unused44; -+ volatile __u32 dmaccount; /* Zoom and byte count for DMA */ -+ __u32 _unused45; -+ volatile __u32 dmastart; /* Pedal to the metal. */ -+ __u32 _unused46; -+ volatile __u32 dmarunning; /* DMA op is in progress */ -+ __u32 _unused47; -+ volatile __u32 maddrdefstart; /* Set dma addr, defaults, and kick it */ - }; - - extern struct sgimc_regs *sgimc; -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgiarcs.h linux-libc-headers-2.6.8.0/include/asm-mips/sgiarcs.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sgiarcs.h 2004-03-28 07:51:52.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sgiarcs.h 2004-08-26 05:21:53.000000000 -0500 -@@ -164,11 +164,11 @@ - /* This prom has a bolixed design. */ - struct linux_bigint { - #ifdef __MIPSEL__ -- u32 lo; -- s32 hi; -+ __u32 lo; -+ __s32 hi; - #else /* !(__MIPSEL__) */ -- s32 hi; -- u32 lo; -+ __s32 hi; -+ __u32 lo; - #endif - }; - -@@ -366,7 +366,7 @@ - * Macros for calling a 32-bit ARC implementation from 64-bit code - */ - --#if defined(CONFIG_MIPS64) && defined(CONFIG_ARC32) -+#if defined(__mips64) && defined(CONFIG_ARC32) - - #define __arc_clobbers \ - "$2","$3" /* ... */, "$8","$9","$10","$11", \ -@@ -475,10 +475,10 @@ - __res; \ - }) - --#endif /* defined(CONFIG_MIPS64) && defined(CONFIG_ARC32) */ -+#endif /* defined(__mips64) && defined(CONFIG_ARC32) */ - --#if (defined(CONFIG_MIPS32) && defined(CONFIG_ARC32)) || \ -- (defined(CONFIG_MIPS64) && defined(CONFIG_ARC64)) -+#if (!defined(__mips64) && defined(CONFIG_ARC32)) || \ -+ (defined(__mips64) && defined(CONFIG_ARC64)) - - #define ARC_CALL0(dest) \ - ({ long __res; \ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/siginfo.h linux-libc-headers-2.6.8.0/include/asm-mips/siginfo.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/siginfo.h 2004-06-09 07:00:41.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/siginfo.h 2004-08-26 05:14:41.000000000 -0500 -@@ -66,10 +66,10 @@ - - /* SIGPOLL, SIGXFSZ (To do ...) */ - struct { --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ - #endif --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - long _band; /* POLL_IN, POLL_OUT, POLL_MSG */ - #endif - int _fd; -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sim.h linux-libc-headers-2.6.8.0/include/asm-mips/sim.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sim.h 2004-03-28 07:51:52.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sim.h 2004-08-26 05:17:16.000000000 -0500 -@@ -18,7 +18,7 @@ - #define __str2(x) #x - #define __str(x) __str2(x) - --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - - #define save_static_function(symbol) \ - __asm__ ( \ -@@ -43,9 +43,9 @@ - - #define nabi_no_regargs - --#endif /* CONFIG_MIPS32 */ -+#endif /* ndef __mips64 */ - --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - - #define save_static_function(symbol) \ - __asm__ ( \ -@@ -78,6 +78,6 @@ - unsigned long __dummy6, \ - unsigned long __dummy7, - --#endif /* CONFIG_MIPS64 */ -+#endif /* __mips64 */ - - #endif /* _ASM_SIM_H */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/arch.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/arch.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/arch.h 2004-06-09 07:00:42.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/arch.h 2004-08-26 05:26:16.000000000 -0500 -@@ -17,8 +17,8 @@ - #include - #endif - --typedef u64 hubreg_t; --typedef u64 nic_t; -+typedef __u64 hubreg_t; -+typedef __u64 nic_t; - - #define cputonasid(cpu) (cpu_data[(cpu)].p_nasid) - #define cputoslice(cpu) (cpu_data[(cpu)].p_slice) -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/gda.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/gda.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/gda.h 2003-12-15 12:47:02.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/gda.h 2004-08-26 05:26:30.000000000 -0500 -@@ -44,11 +44,11 @@ - #ifndef __ASSEMBLY__ - - typedef struct gda { -- u32 g_magic; /* GDA magic number */ -- u16 g_version; /* Version of this structure */ -- u16 g_masterid; /* The NASID:CPUNUM of the master cpu */ -- u32 g_promop; /* Passes requests from the kernel to prom */ -- u32 g_vds; /* Store the virtual dipswitches here */ -+ __u32 g_magic; /* GDA magic number */ -+ __u16 g_version; /* Version of this structure */ -+ __u16 g_masterid; /* The NASID:CPUNUM of the master cpu */ -+ __u32 g_promop; /* Passes requests from the kernel to prom */ -+ __u32 g_vds; /* Store the virtual dipswitches here */ - void **g_hooked_norm;/* ptr to pda loc for norm hndlr */ - void **g_hooked_utlb;/* ptr to pda loc for utlb hndlr */ - void **g_hooked_xtlb;/* ptr to pda loc for xtlb hndlr */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/ioc3.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/ioc3.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/ioc3.h 2003-12-15 12:47:02.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/ioc3.h 2004-08-26 05:26:06.000000000 -0500 -@@ -8,23 +8,23 @@ - /* SUPERIO uart register map */ - typedef volatile struct ioc3_uartregs { - union { -- volatile u8 rbr; /* read only, DLAB == 0 */ -- volatile u8 thr; /* write only, DLAB == 0 */ -- volatile u8 dll; /* DLAB == 1 */ -+ volatile __u8 rbr; /* read only, DLAB == 0 */ -+ volatile __u8 thr; /* write only, DLAB == 0 */ -+ volatile __u8 dll; /* DLAB == 1 */ - } u1; - union { -- volatile u8 ier; /* DLAB == 0 */ -- volatile u8 dlm; /* DLAB == 1 */ -+ volatile __u8 ier; /* DLAB == 0 */ -+ volatile __u8 dlm; /* DLAB == 1 */ - } u2; - union { -- volatile u8 iir; /* read only */ -- volatile u8 fcr; /* write only */ -+ volatile __u8 iir; /* read only */ -+ volatile __u8 fcr; /* write only */ - } u3; -- volatile u8 iu_lcr; -- volatile u8 iu_mcr; -- volatile u8 iu_lsr; -- volatile u8 iu_msr; -- volatile u8 iu_scr; -+ volatile __u8 iu_lcr; -+ volatile __u8 iu_mcr; -+ volatile __u8 iu_lsr; -+ volatile __u8 iu_msr; -+ volatile __u8 iu_scr; - } ioc3_uregs_t; - - #define iu_rbr u1.rbr -@@ -36,29 +36,29 @@ - #define iu_fcr u3.fcr - - struct ioc3_sioregs { -- volatile u8 fill[0x141]; /* starts at 0x141 */ -+ volatile __u8 fill[0x141]; /* starts at 0x141 */ - -- volatile u8 uartc; -- volatile u8 kbdcg; -+ volatile __u8 uartc; -+ volatile __u8 kbdcg; - -- volatile u8 fill0[0x150 - 0x142 - 1]; -+ volatile __u8 fill0[0x150 - 0x142 - 1]; - -- volatile u8 pp_data; -- volatile u8 pp_dsr; -- volatile u8 pp_dcr; -+ volatile __u8 pp_data; -+ volatile __u8 pp_dsr; -+ volatile __u8 pp_dcr; - -- volatile u8 fill1[0x158 - 0x152 - 1]; -+ volatile __u8 fill1[0x158 - 0x152 - 1]; - -- volatile u8 pp_fifa; -- volatile u8 pp_cfgb; -- volatile u8 pp_ecr; -+ volatile __u8 pp_fifa; -+ volatile __u8 pp_cfgb; -+ volatile __u8 pp_ecr; - -- volatile u8 fill2[0x168 - 0x15a - 1]; -+ volatile __u8 fill2[0x168 - 0x15a - 1]; - -- volatile u8 rtcad; -- volatile u8 rtcdat; -+ volatile __u8 rtcad; -+ volatile __u8 rtcdat; - -- volatile u8 fill3[0x170 - 0x169 - 1]; -+ volatile __u8 fill3[0x170 - 0x169 - 1]; - - struct ioc3_uartregs uartb; /* 0x20170 */ - struct ioc3_uartregs uarta; /* 0x20178 */ -@@ -66,103 +66,103 @@ - - /* Register layout of IOC3 in configuration space. */ - struct ioc3 { -- volatile u32 pad0[7]; /* 0x00000 */ -- volatile u32 sio_ir; /* 0x0001c */ -- volatile u32 sio_ies; /* 0x00020 */ -- volatile u32 sio_iec; /* 0x00024 */ -- volatile u32 sio_cr; /* 0x00028 */ -- volatile u32 int_out; /* 0x0002c */ -- volatile u32 mcr; /* 0x00030 */ -+ volatile __u32 pad0[7]; /* 0x00000 */ -+ volatile __u32 sio_ir; /* 0x0001c */ -+ volatile __u32 sio_ies; /* 0x00020 */ -+ volatile __u32 sio_iec; /* 0x00024 */ -+ volatile __u32 sio_cr; /* 0x00028 */ -+ volatile __u32 int_out; /* 0x0002c */ -+ volatile __u32 mcr; /* 0x00030 */ - - /* General Purpose I/O registers */ -- volatile u32 gpcr_s; /* 0x00034 */ -- volatile u32 gpcr_c; /* 0x00038 */ -- volatile u32 gpdr; /* 0x0003c */ -- volatile u32 gppr_0; /* 0x00040 */ -- volatile u32 gppr_1; /* 0x00044 */ -- volatile u32 gppr_2; /* 0x00048 */ -- volatile u32 gppr_3; /* 0x0004c */ -- volatile u32 gppr_4; /* 0x00050 */ -- volatile u32 gppr_5; /* 0x00054 */ -- volatile u32 gppr_6; /* 0x00058 */ -- volatile u32 gppr_7; /* 0x0005c */ -- volatile u32 gppr_8; /* 0x00060 */ -- volatile u32 gppr_9; /* 0x00064 */ -- volatile u32 gppr_10; /* 0x00068 */ -- volatile u32 gppr_11; /* 0x0006c */ -- volatile u32 gppr_12; /* 0x00070 */ -- volatile u32 gppr_13; /* 0x00074 */ -- volatile u32 gppr_14; /* 0x00078 */ -- volatile u32 gppr_15; /* 0x0007c */ -+ volatile __u32 gpcr_s; /* 0x00034 */ -+ volatile __u32 gpcr_c; /* 0x00038 */ -+ volatile __u32 gpdr; /* 0x0003c */ -+ volatile __u32 gppr_0; /* 0x00040 */ -+ volatile __u32 gppr_1; /* 0x00044 */ -+ volatile __u32 gppr_2; /* 0x00048 */ -+ volatile __u32 gppr_3; /* 0x0004c */ -+ volatile __u32 gppr_4; /* 0x00050 */ -+ volatile __u32 gppr_5; /* 0x00054 */ -+ volatile __u32 gppr_6; /* 0x00058 */ -+ volatile __u32 gppr_7; /* 0x0005c */ -+ volatile __u32 gppr_8; /* 0x00060 */ -+ volatile __u32 gppr_9; /* 0x00064 */ -+ volatile __u32 gppr_10; /* 0x00068 */ -+ volatile __u32 gppr_11; /* 0x0006c */ -+ volatile __u32 gppr_12; /* 0x00070 */ -+ volatile __u32 gppr_13; /* 0x00074 */ -+ volatile __u32 gppr_14; /* 0x00078 */ -+ volatile __u32 gppr_15; /* 0x0007c */ - - /* Parallel Port Registers */ -- volatile u32 ppbr_h_a; /* 0x00080 */ -- volatile u32 ppbr_l_a; /* 0x00084 */ -- volatile u32 ppcr_a; /* 0x00088 */ -- volatile u32 ppcr; /* 0x0008c */ -- volatile u32 ppbr_h_b; /* 0x00090 */ -- volatile u32 ppbr_l_b; /* 0x00094 */ -- volatile u32 ppcr_b; /* 0x00098 */ -+ volatile __u32 ppbr_h_a; /* 0x00080 */ -+ volatile __u32 ppbr_l_a; /* 0x00084 */ -+ volatile __u32 ppcr_a; /* 0x00088 */ -+ volatile __u32 ppcr; /* 0x0008c */ -+ volatile __u32 ppbr_h_b; /* 0x00090 */ -+ volatile __u32 ppbr_l_b; /* 0x00094 */ -+ volatile __u32 ppcr_b; /* 0x00098 */ - - /* Keyboard and Mouse Registers */ -- volatile u32 km_csr; /* 0x0009c */ -- volatile u32 k_rd; /* 0x000a0 */ -- volatile u32 m_rd; /* 0x000a4 */ -- volatile u32 k_wd; /* 0x000a8 */ -- volatile u32 m_wd; /* 0x000ac */ -+ volatile __u32 km_csr; /* 0x0009c */ -+ volatile __u32 k_rd; /* 0x000a0 */ -+ volatile __u32 m_rd; /* 0x000a4 */ -+ volatile __u32 k_wd; /* 0x000a8 */ -+ volatile __u32 m_wd; /* 0x000ac */ - - /* Serial Port Registers */ -- volatile u32 sbbr_h; /* 0x000b0 */ -- volatile u32 sbbr_l; /* 0x000b4 */ -- volatile u32 sscr_a; /* 0x000b8 */ -- volatile u32 stpir_a; /* 0x000bc */ -- volatile u32 stcir_a; /* 0x000c0 */ -- volatile u32 srpir_a; /* 0x000c4 */ -- volatile u32 srcir_a; /* 0x000c8 */ -- volatile u32 srtr_a; /* 0x000cc */ -- volatile u32 shadow_a; /* 0x000d0 */ -- volatile u32 sscr_b; /* 0x000d4 */ -- volatile u32 stpir_b; /* 0x000d8 */ -- volatile u32 stcir_b; /* 0x000dc */ -- volatile u32 srpir_b; /* 0x000e0 */ -- volatile u32 srcir_b; /* 0x000e4 */ -- volatile u32 srtr_b; /* 0x000e8 */ -- volatile u32 shadow_b; /* 0x000ec */ -+ volatile __u32 sbbr_h; /* 0x000b0 */ -+ volatile __u32 sbbr_l; /* 0x000b4 */ -+ volatile __u32 sscr_a; /* 0x000b8 */ -+ volatile __u32 stpir_a; /* 0x000bc */ -+ volatile __u32 stcir_a; /* 0x000c0 */ -+ volatile __u32 srpir_a; /* 0x000c4 */ -+ volatile __u32 srcir_a; /* 0x000c8 */ -+ volatile __u32 srtr_a; /* 0x000cc */ -+ volatile __u32 shadow_a; /* 0x000d0 */ -+ volatile __u32 sscr_b; /* 0x000d4 */ -+ volatile __u32 stpir_b; /* 0x000d8 */ -+ volatile __u32 stcir_b; /* 0x000dc */ -+ volatile __u32 srpir_b; /* 0x000e0 */ -+ volatile __u32 srcir_b; /* 0x000e4 */ -+ volatile __u32 srtr_b; /* 0x000e8 */ -+ volatile __u32 shadow_b; /* 0x000ec */ - - /* Ethernet Registers */ -- volatile u32 emcr; /* 0x000f0 */ -- volatile u32 eisr; /* 0x000f4 */ -- volatile u32 eier; /* 0x000f8 */ -- volatile u32 ercsr; /* 0x000fc */ -- volatile u32 erbr_h; /* 0x00100 */ -- volatile u32 erbr_l; /* 0x00104 */ -- volatile u32 erbar; /* 0x00108 */ -- volatile u32 ercir; /* 0x0010c */ -- volatile u32 erpir; /* 0x00110 */ -- volatile u32 ertr; /* 0x00114 */ -- volatile u32 etcsr; /* 0x00118 */ -- volatile u32 ersr; /* 0x0011c */ -- volatile u32 etcdc; /* 0x00120 */ -- volatile u32 ebir; /* 0x00124 */ -- volatile u32 etbr_h; /* 0x00128 */ -- volatile u32 etbr_l; /* 0x0012c */ -- volatile u32 etcir; /* 0x00130 */ -- volatile u32 etpir; /* 0x00134 */ -- volatile u32 emar_h; /* 0x00138 */ -- volatile u32 emar_l; /* 0x0013c */ -- volatile u32 ehar_h; /* 0x00140 */ -- volatile u32 ehar_l; /* 0x00144 */ -- volatile u32 micr; /* 0x00148 */ -- volatile u32 midr_r; /* 0x0014c */ -- volatile u32 midr_w; /* 0x00150 */ -- volatile u32 pad1[(0x20000 - 0x00154) / 4]; -+ volatile __u32 emcr; /* 0x000f0 */ -+ volatile __u32 eisr; /* 0x000f4 */ -+ volatile __u32 eier; /* 0x000f8 */ -+ volatile __u32 ercsr; /* 0x000fc */ -+ volatile __u32 erbr_h; /* 0x00100 */ -+ volatile __u32 erbr_l; /* 0x00104 */ -+ volatile __u32 erbar; /* 0x00108 */ -+ volatile __u32 ercir; /* 0x0010c */ -+ volatile __u32 erpir; /* 0x00110 */ -+ volatile __u32 ertr; /* 0x00114 */ -+ volatile __u32 etcsr; /* 0x00118 */ -+ volatile __u32 ersr; /* 0x0011c */ -+ volatile __u32 etcdc; /* 0x00120 */ -+ volatile __u32 ebir; /* 0x00124 */ -+ volatile __u32 etbr_h; /* 0x00128 */ -+ volatile __u32 etbr_l; /* 0x0012c */ -+ volatile __u32 etcir; /* 0x00130 */ -+ volatile __u32 etpir; /* 0x00134 */ -+ volatile __u32 emar_h; /* 0x00138 */ -+ volatile __u32 emar_l; /* 0x0013c */ -+ volatile __u32 ehar_h; /* 0x00140 */ -+ volatile __u32 ehar_l; /* 0x00144 */ -+ volatile __u32 micr; /* 0x00148 */ -+ volatile __u32 midr_r; /* 0x0014c */ -+ volatile __u32 midr_w; /* 0x00150 */ -+ volatile __u32 pad1[(0x20000 - 0x00154) / 4]; - - /* SuperIO Registers XXX */ - struct ioc3_sioregs sregs; /* 0x20000 */ -- volatile u32 pad2[(0x40000 - 0x20180) / 4]; -+ volatile __u32 pad2[(0x40000 - 0x20180) / 4]; - - /* SSRAM Diagnostic Access */ -- volatile u32 ssram[(0x80000 - 0x40000) / 4]; -+ volatile __u32 ssram[(0x80000 - 0x40000) / 4]; - - /* Bytebus device offsets - 0x80000 - Access to the generic devices selected with DEV0 -@@ -179,8 +179,8 @@ - * Ethernet RX Buffer - */ - struct ioc3_erxbuf { -- u32 w0; /* first word (valid,bcnt,cksum) */ -- u32 err; /* second word various errors */ -+ __u32 w0; /* first word (valid,bcnt,cksum) */ -+ __u32 err; /* second word various errors */ - /* next comes n bytes of padding */ - /* then the received ethernet frame itself */ - }; -@@ -208,11 +208,11 @@ - */ - #define ETXD_DATALEN 104 - struct ioc3_etxd { -- u32 cmd; /* command field */ -- u32 bufcnt; /* buffer counts field */ -- u64 p1; /* buffer pointer 1 */ -- u64 p2; /* buffer pointer 2 */ -- u8 data[ETXD_DATALEN]; /* opt. tx data */ -+ __u32 cmd; /* command field */ -+ __u32 bufcnt; /* buffer counts field */ -+ __u64 p1; /* buffer pointer 1 */ -+ __u64 p2; /* buffer pointer 2 */ -+ __u8 data[ETXD_DATALEN]; /* opt. tx data */ - }; - - #define ETXD_BYTECNT_MASK 0x000007ff /* total byte count */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/klconfig.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/klconfig.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/klconfig.h 2004-03-28 07:51:55.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/klconfig.h 2004-08-26 05:26:13.000000000 -0500 -@@ -64,9 +64,9 @@ - #define KLCFGINFO_MAGIC 0xbeedbabe - - #ifdef FRUTEST --typedef u64 klconf_off_t; -+typedef __u64 klconf_off_t; - #else --typedef s32 klconf_off_t; -+typedef __s32 klconf_off_t; - #endif - - /* -@@ -160,8 +160,8 @@ - /* Functions/macros needed to use this structure */ - - typedef struct kl_config_hdr { -- u64 ch_magic; /* set this to KLCFGINFO_MAGIC */ -- u32 ch_version; /* structure version number */ -+ __u64 ch_magic; /* set this to KLCFGINFO_MAGIC */ -+ __u32 ch_version; /* structure version number */ - klconf_off_t ch_malloc_hdr_off; /* offset of ch_malloc_hdr */ - klconf_off_t ch_cons_off; /* offset of ch_cons */ - klconf_off_t ch_board_info; /* the link list of boards */ -@@ -609,14 +609,14 @@ - - /* Info holders for various hardware components */ - --typedef u64 *pci_t; --typedef u64 *vmeb_t; --typedef u64 *vmed_t; --typedef u64 *fddi_t; --typedef u64 *scsi_t; --typedef u64 *mio_t; --typedef u64 *graphics_t; --typedef u64 *router_t; -+typedef __u64 *pci_t; -+typedef __u64 *vmeb_t; -+typedef __u64 *vmed_t; -+typedef __u64 *fddi_t; -+typedef __u64 *scsi_t; -+typedef __u64 *mio_t; -+typedef __u64 *graphics_t; -+typedef __u64 *router_t; - - /* - * The port info in ip27_cfg area translates to a lboart_t in the -@@ -659,7 +659,7 @@ - klport_t hub_port; /* hub is connected to this */ - nic_t hub_box_nic; /* nic of containing box */ - klconf_off_t hub_mfg_nic; /* MFG NIC string */ -- u64 hub_speed; /* Speed of hub in HZ */ -+ __u64 hub_speed; /* Speed of hub in HZ */ - } klhub_t ; - - typedef struct klhub_uart_s { /* HUB */ -@@ -716,8 +716,8 @@ - #define MAX_PCI_SLOTS 8 - - typedef struct klpci_device_s { -- s32 pci_device_id; /* 32 bits of vendor/device ID. */ -- s32 pci_device_pad; /* 32 bits of padding. */ -+ __s32 pci_device_id; /* 32 bits of vendor/device ID. */ -+ __s32 pci_device_pad; /* 32 bits of padding. */ - } klpci_device_t; - - #define BRIDGE_STRUCT_VERSION 2 -@@ -767,7 +767,7 @@ - nic_t rou_box_nic ; /* nic of the containing module */ - klport_t rou_port[MAX_ROUTER_PORTS + 1] ; /* array index 1 to 6 */ - klconf_off_t rou_mfg_nic ; /* MFG NIC string */ -- u64 rou_vector; /* vector from master node */ -+ __u64 rou_vector; /* vector from master node */ - } klrou_t ; - - /* -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/kldir.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/kldir.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/kldir.h 2004-01-17 17:03:49.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/kldir.h 2004-08-26 05:26:25.000000000 -0500 -@@ -210,7 +210,7 @@ - - #ifndef __ASSEMBLY__ - typedef struct kldir_ent_s { -- u64 magic; /* Indicates validity of entry */ -+ __u64 magic; /* Indicates validity of entry */ - off_t offset; /* Offset from start of node space */ - #if defined(CONFIG_SGI_IO) /* FIXME */ - __psunsigned_t pointer; /* Pointer to area in some cases */ -@@ -218,7 +218,7 @@ - unsigned long pointer; /* Pointer to area in some cases */ - #endif - size_t size; /* Size in bytes */ -- u64 count; /* Repeat count if array, 1 if not */ -+ __u64 count; /* Repeat count if array, 1 if not */ - size_t stride; /* Stride if array, 0 if not */ - char rsvd[16]; /* Pad entry to 0x40 bytes */ - /* NOTE: These 16 bytes are used in the Partition KLDIR -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/launch.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/launch.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/launch.h 2004-01-17 17:03:49.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/launch.h 2004-08-26 05:25:52.000000000 -0500 -@@ -62,14 +62,14 @@ - #ifndef __ASSEMBLY__ - - typedef int launch_state_t; --typedef void (*launch_proc_t)(u64 call_parm); -+typedef void (*launch_proc_t)(__u64 call_parm); - - typedef struct launch_s { -- volatile u64 magic; /* Magic number */ -- volatile u64 busy; /* Slave currently active */ -+ volatile __u64 magic; /* Magic number */ -+ volatile __u64 busy; /* Slave currently active */ - volatile launch_proc_t call_addr; /* Func. for slave to call */ -- volatile u64 call_addr_c; /* 1's complement of call_addr*/ -- volatile u64 call_parm; /* Single parm passed to call*/ -+ volatile __u64 call_addr_c; /* 1's complement of call_addr*/ -+ volatile __u64 call_parm; /* Single parm passed to call*/ - volatile void *stack_addr; /* Stack pointer for slave function */ - volatile void *gp_addr; /* Global pointer for slave func. */ - volatile char *bevutlb;/* Address of bev utlb ex handler */ -@@ -84,7 +84,7 @@ - - #define LAUNCH_SLAVE (*(void (*)(int nasid, int cpu, \ - launch_proc_t call_addr, \ -- u64 call_parm, \ -+ __u64 call_parm, \ - void *stack_addr, \ - void *gp_addr)) \ - IP27PROM_LAUNCHSLAVE) -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubio.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubio.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubio.h 2003-12-15 12:47:02.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubio.h 2004-08-26 05:27:21.000000000 -0500 -@@ -172,9 +172,9 @@ - #ifndef __ASSEMBLY__ - - typedef union hubii_wid_u { -- u64 wid_reg_value; -+ __u64 wid_reg_value; - struct { -- u64 wid_rsvd: 32, /* unused */ -+ __u64 wid_rsvd: 32, /* unused */ - wid_rev_num: 4, /* revision number */ - wid_part_num: 16, /* the widget type: hub=c101 */ - wid_mfg_num: 11, /* Manufacturer id (IBM) */ -@@ -184,9 +184,9 @@ - - - typedef union hubii_wcr_u { -- u64 wcr_reg_value; -+ __u64 wcr_reg_value; - struct { -- u64 wcr_rsvd: 41, /* unused */ -+ __u64 wcr_rsvd: 41, /* unused */ - wcr_e_thresh: 5, /* elasticity threshold */ - wcr_dir_con: 1, /* widget direct connect */ - wcr_f_bad_pkt: 1, /* Force bad llp pkt enable */ -@@ -200,9 +200,9 @@ - #define iwcr_dir_con wcr_fields_s.wcr_dir_con - - typedef union hubii_wstat_u { -- u64 reg_value; -+ __u64 reg_value; - struct { -- u64 rsvd1: 31, -+ __u64 rsvd1: 31, - crazy: 1, /* Crazy bit */ - rsvd2: 8, - llp_tx_cnt: 8, /* LLP Xmit retry counter */ -@@ -217,9 +217,9 @@ - - - typedef union hubii_ilcsr_u { -- u64 icsr_reg_value; -+ __u64 icsr_reg_value; - struct { -- u64 icsr_rsvd: 22, /* unused */ -+ __u64 icsr_rsvd: 22, /* unused */ - icsr_max_burst: 10, /* max burst */ - icsr_rsvd4: 6, /* reserved */ - icsr_max_retry: 10, /* max retry */ -@@ -237,9 +237,9 @@ - - - typedef union hubii_iowa_u { -- u64 iowa_reg_value; -+ __u64 iowa_reg_value; - struct { -- u64 iowa_rsvd: 48, /* unused */ -+ __u64 iowa_rsvd: 48, /* unused */ - iowa_wxoac: 8, /* xtalk widget access bits */ - iowa_rsvd1: 7, /* xtalk widget access bits */ - iowa_w0oac: 1; /* xtalk widget access bits */ -@@ -247,9 +247,9 @@ - } hubii_iowa_t; - - typedef union hubii_iiwa_u { -- u64 iiwa_reg_value; -+ __u64 iiwa_reg_value; - struct { -- u64 iiwa_rsvd: 48, /* unused */ -+ __u64 iiwa_rsvd: 48, /* unused */ - iiwa_wxiac: 8, /* hub wid access bits */ - iiwa_rsvd1: 7, /* reserved */ - iiwa_w0iac: 1; /* hub wid0 access */ -@@ -257,9 +257,9 @@ - } hubii_iiwa_t; - - typedef union hubii_illr_u { -- u64 illr_reg_value; -+ __u64 illr_reg_value; - struct { -- u64 illr_rsvd: 32, /* unused */ -+ __u64 illr_rsvd: 32, /* unused */ - illr_cb_cnt: 16, /* checkbit error count */ - illr_sn_cnt: 16; /* sequence number count */ - } illr_fields_s; -@@ -271,9 +271,9 @@ - /* io_perf_sel allows the caller to specify what tests will be - performed */ - typedef union io_perf_sel { -- u64 perf_sel_reg; -+ __u64 perf_sel_reg; - struct { -- u64 perf_rsvd : 48, -+ __u64 perf_rsvd : 48, - perf_icct : 8, - perf_ippr1 : 4, - perf_ippr0 : 4; -@@ -284,9 +284,9 @@ - hardware problems there is only one counter, not two. */ - - typedef union io_perf_cnt { -- u64 perf_cnt; -+ __u64 perf_cnt; - struct { -- u64 perf_rsvd1 : 32, -+ __u64 perf_rsvd1 : 32, - perf_rsvd2 : 12, - perf_cnt : 20; - } perf_cnt_bits; -@@ -442,9 +442,9 @@ - */ - #ifndef __ASSEMBLY__ - typedef union icrba_u { -- u64 reg_value; -+ __u64 reg_value; - struct { -- u64 resvd: 6, -+ __u64 resvd: 6, - stall_bte0: 1, /* Stall BTE 0 */ - stall_bte1: 1, /* Stall BTE 1 */ - error: 1, /* CRB has an error */ -@@ -464,10 +464,10 @@ - runtime selection of the format based on the REV_ID field of the - NI_STATUS_REV_ID register. */ - typedef union h1_icrba_u { -- u64 reg_value; -+ __u64 reg_value; - - struct { -- u64 resvd: 6, -+ __u64 resvd: 6, - unused: 1, /* Unused but RW!! */ - error: 1, /* CRB has an error */ - ecode: 4, /* Error Code */ -@@ -525,9 +525,9 @@ - */ - #ifndef __ASSEMBLY__ - typedef union icrbb_u { -- u64 reg_value; -+ __u64 reg_value; - struct { -- u64 rsvd1: 5, -+ __u64 rsvd1: 5, - btenum: 1, /* BTE to which entry belongs to */ - cohtrans: 1, /* Coherent transaction */ - xtsize: 2, /* Xtalk operation size -@@ -567,9 +567,9 @@ - runtime selection of the format based on the REV_ID field of the - NI_STATUS_REV_ID register. */ - typedef union h1_icrbb_u { -- u64 reg_value; -+ __u64 reg_value; - struct { -- u64 rsvd1: 5, -+ __u64 rsvd1: 5, - btenum: 1, /* BTE to which entry belongs to */ - cohtrans: 1, /* Coherent transaction */ - xtsize: 2, /* Xtalk operation size -@@ -683,9 +683,9 @@ - #ifndef __ASSEMBLY__ - - typedef union icrbc_s { -- u64 reg_value; -+ __u64 reg_value; - struct { -- u64 rsvd: 6, -+ __u64 rsvd: 6, - sleep: 1, - pricnt: 4, /* Priority count sent with Read req */ - pripsc: 4, /* Priority Pre scalar */ -@@ -720,9 +720,9 @@ - - #ifndef __ASSEMBLY__ - typedef union icrbd_s { -- u64 reg_value; -+ __u64 reg_value; - struct { -- u64 rsvd: 38, -+ __u64 rsvd: 38, - toutvld: 1, /* Timeout in progress for this CRB */ - ctxtvld: 1, /* Context field below is valid */ - rsvd2: 1, -@@ -742,9 +742,9 @@ - - - typedef union hubii_ifdr_u { -- u64 hi_ifdr_value; -+ __u64 hi_ifdr_value; - struct { -- u64 ifdr_rsvd: 49, -+ __u64 ifdr_rsvd: 49, - ifdr_maxrp: 7, - ifdr_rsvd1: 1, - ifdr_maxrq: 7; -@@ -801,9 +801,9 @@ - #ifndef __ASSEMBLY__ - - typedef union iprte_a { -- u64 entry; -+ __u64 entry; - struct { -- u64 rsvd1 : 7, /* Reserved field */ -+ __u64 rsvd1 : 7, /* Reserved field */ - valid : 1, /* Maps to a timeout entry */ - rsvd2 : 1, - srcnode : 9, /* Node which did this PIO */ -@@ -835,9 +835,9 @@ - */ - - typedef union iprb_u { -- u64 reg_value; -+ __u64 reg_value; - struct { -- u64 rsvd1: 15, -+ __u64 rsvd1: 15, - error: 1, /* Widget rcvd wr resp pkt w/ error */ - ovflow: 5, /* Over flow count. perf measurement */ - fire_and_forget: 1, /* Launch Write without response */ -@@ -877,9 +877,9 @@ - */ - #ifndef __ASSEMBLY__ - typedef union icrbp_a { -- u64 ip_reg; /* the entire register value */ -+ __u64 ip_reg; /* the entire register value */ - struct { -- u64 error: 1, /* 63, error occurred */ -+ __u64 error: 1, /* 63, error occurred */ - ln_uce: 1, /* 62: uncorrectable memory */ - ln_ae: 1, /* 61: protection violation */ - ln_werr:1, /* 60: write access error */ -@@ -919,9 +919,9 @@ - - #ifndef __ASSEMBLY__ - typedef union hubii_idsr { -- u64 iin_reg; -+ __u64 iin_reg; - struct { -- u64 rsvd1 : 35, -+ __u64 rsvd1 : 35, - isent : 1, - rsvd2 : 3, - ienable: 1, -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubmd.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubmd.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubmd.h 2004-01-17 17:03:49.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubmd.h 2004-08-26 05:27:00.000000000 -0500 -@@ -541,7 +541,7 @@ - */ - - struct dir_error_reg { -- u64 uce_vld: 1, /* 63: valid directory uce */ -+ __u64 uce_vld: 1, /* 63: valid directory uce */ - ae_vld: 1, /* 62: valid dir prot ecc error */ - ce_vld: 1, /* 61: valid correctable ECC err*/ - rsvd1: 19, /* 60-42: reserved */ -@@ -555,13 +555,13 @@ - }; - - typedef union md_dir_error { -- u64 derr_reg; /* the entire register */ -+ __u64 derr_reg; /* the entire register */ - struct dir_error_reg derr_fmt; /* the register format */ - } md_dir_error_t; - - - struct mem_error_reg { -- u64 uce_vld: 1, /* 63: valid memory uce */ -+ __u64 uce_vld: 1, /* 63: valid memory uce */ - ce_vld: 1, /* 62: valid correctable ECC err*/ - rsvd1: 22, /* 61-40: reserved */ - bad_syn: 8, /* 39-32: bad mem ecc syndrome */ -@@ -573,13 +573,13 @@ - - - typedef union md_mem_error { -- u64 merr_reg; /* the entire register */ -+ __u64 merr_reg; /* the entire register */ - struct mem_error_reg merr_fmt; /* format of the mem_error reg */ - } md_mem_error_t; - - - struct proto_error_reg { -- u64 valid: 1, /* 63: valid protocol error */ -+ __u64 valid: 1, /* 63: valid protocol error */ - rsvd1: 2, /* 62-61: reserved */ - initiator:11, /* 60-50: id of request initiator*/ - backoff: 2, /* 49-48: backoff control */ -@@ -594,7 +594,7 @@ - }; - - typedef union md_proto_error { -- u64 perr_reg; /* the entire register */ -+ __u64 perr_reg; /* the entire register */ - struct proto_error_reg perr_fmt; /* format of the register */ - } md_proto_error_t; - -@@ -642,7 +642,7 @@ - - - struct md_pdir_high_fmt { -- u64 pd_hi_unused : 16, -+ __u64 pd_hi_unused : 16, - pd_hi_bvec : 38, - pd_hi_unused1 : 3, - pd_hi_ecc : 7; -@@ -651,14 +651,14 @@ - - typedef union md_pdir_high { - /* The 48 bits of standard directory, upper word */ -- u64 pd_hi_val; -+ __u64 pd_hi_val; - struct md_pdir_high_fmt pd_hi_fmt; - }md_pdir_high_t; - - - struct md_pdir_low_shared_fmt { - /* The meaning of lower directory, shared */ -- u64 pds_lo_unused : 16, -+ __u64 pds_lo_unused : 16, - pds_lo_bvec : 26, - pds_lo_cnt : 6, - pds_lo_state : 3, -@@ -670,7 +670,7 @@ - - struct md_pdir_low_exclusive_fmt { - /* The meaning of lower directory, exclusive */ -- u64 pde_lo_unused : 31, -+ __u64 pde_lo_unused : 31, - pde_lo_ptr : 11, - pde_lo_unused1 : 6, - pde_lo_state : 3, -@@ -683,7 +683,7 @@ - - typedef union md_pdir_loent { - /* The 48 bits of premium directory, lower word */ -- u64 pd_lo_val; -+ __u64 pd_lo_val; - struct md_pdir_low_exclusive_fmt pde_lo_fmt; - struct md_pdir_low_shared_fmt pds_lo_fmt; - }md_pdir_low_t; -@@ -711,25 +711,25 @@ - } bddir_entry_t; - - typedef struct dir_mem_entry { -- u64 prcpf[MAX_REGIONS]; -+ __u64 prcpf[MAX_REGIONS]; - bddir_entry_t directory_words[MD_PAGE_SIZE/CACHE_SLINE_SIZE]; - } dir_mem_entry_t; - - - - typedef union md_perf_sel { -- u64 perf_sel_reg; -+ __u64 perf_sel_reg; - struct { -- u64 perf_rsvd : 60, -+ __u64 perf_rsvd : 60, - perf_en : 1, - perf_sel : 3; - } perf_sel_bits; - } md_perf_sel_t; - - typedef union md_perf_cnt { -- u64 perf_cnt; -+ __u64 perf_cnt; - struct { -- u64 perf_rsvd : 44, -+ __u64 perf_rsvd : 44, - perf_cnt : 20; - } perf_cnt_bits; - } md_perf_cnt_t; -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubni.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubni.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubni.h 2003-12-15 12:47:02.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubni.h 2004-08-26 05:26:48.000000000 -0500 -@@ -229,9 +229,9 @@ - #ifndef __ASSEMBLY__ - - typedef union hubni_port_error_u { -- u64 nipe_reg_value; -+ __u64 nipe_reg_value; - struct { -- u64 nipe_rsvd: 26, /* unused */ -+ __u64 nipe_rsvd: 26, /* unused */ - nipe_lnk_reset: 1, /* link reset */ - nipe_intl_err: 1, /* internal error */ - nipe_bad_msg: 1, /* bad message */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubpi.h linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubpi.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/sn/sn0/hubpi.h 2003-12-15 12:47:02.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/sn/sn0/hubpi.h 2004-08-26 05:26:36.000000000 -0500 -@@ -312,7 +312,7 @@ - */ - - struct err_stack_format { -- u64 sk_addr : 33, /* address */ -+ __u64 sk_addr : 33, /* address */ - sk_cmd : 8, /* message command */ - sk_crb_sts : 10, /* status from RRB or WRB */ - sk_rw_rb : 1, /* RRB == 0, WRB == 1 */ -@@ -323,12 +323,12 @@ - }; - - typedef union pi_err_stack { -- u64 pi_stk_word; -+ __u64 pi_stk_word; - struct err_stack_format pi_stk_fmt; - } pi_err_stack_t; - - struct err_status0_format { -- u64 s0_valid : 1, /* Valid */ -+ __u64 s0_valid : 1, /* Valid */ - s0_ovr_run : 1, /* Overrun, spooled to memory */ - s0_addr : 37, /* address */ - s0_cmd : 8, /* message command */ -@@ -338,12 +338,12 @@ - }; - - typedef union pi_err_stat0 { -- u64 pi_stat0_word; -+ __u64 pi_stat0_word; - struct err_status0_format pi_stat0_fmt; - } pi_err_stat0_t; - - struct err_status1_format { -- u64 s1_src : 11, /* message source */ -+ __u64 s1_src : 11, /* message source */ - s1_crb_sts : 10, /* status from RRB or WRB */ - s1_rw_rb : 1, /* RRB == 0, WRB == 1 */ - s1_crb_num : 3, /* WRB (0 to 7) or RRB (0 to 4) */ -@@ -353,11 +353,11 @@ - }; - - typedef union pi_err_stat1 { -- u64 pi_stat1_word; -+ __u64 pi_stat1_word; - struct err_status1_format pi_stat1_fmt; - } pi_err_stat1_t; - --typedef u64 rtc_time_t; -+typedef __u64 rtc_time_t; - - #endif /* !__ASSEMBLY__ */ - -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/stackframe.h linux-libc-headers-2.6.8.0/include/asm-mips/stackframe.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/stackframe.h 2004-08-18 13:15:41.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/stackframe.h 2004-08-26 05:14:41.000000000 -0500 -@@ -25,7 +25,7 @@ - - .macro SAVE_TEMP - mfhi v1 --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - LONG_S $8, PT_R8(sp) - LONG_S $9, PT_R9(sp) - #endif -@@ -55,7 +55,7 @@ - - #ifdef CONFIG_SMP - .macro get_saved_sp /* SMP variation */ --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - mfc0 k0, CP0_CONTEXT - lui k1, %hi(kernelsp) - srl k0, k0, 23 -@@ -63,7 +63,7 @@ - addu k1, k0 - LONG_L k1, %lo(kernelsp)(k1) - #endif --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - MFC0 k1, CP0_CONTEXT - dsra k1, 23 - lui k0, %hi(pgd_current) -@@ -76,13 +76,13 @@ - .endm - - .macro set_saved_sp stackp temp temp2 --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - mfc0 \temp, CP0_CONTEXT - srl \temp, 23 - sll \temp, 2 - LONG_S \stackp, kernelsp(\temp) - #endif --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - lw \temp, TI_CPU(gp) - dsll \temp, 3 - lui \temp2, %hi(kernelsp) -@@ -127,7 +127,7 @@ - LONG_S $6, PT_R6(sp) - MFC0 v1, CP0_EPC - LONG_S $7, PT_R7(sp) --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - LONG_S $8, PT_R8(sp) - LONG_S $9, PT_R9(sp) - #endif -@@ -156,7 +156,7 @@ - - .macro RESTORE_TEMP - LONG_L $24, PT_LO(sp) --#ifdef CONFIG_MIPS32 -+#ifndef __mips64 - LONG_L $8, PT_R8(sp) - LONG_L $9, PT_R9(sp) - #endif -@@ -204,7 +204,7 @@ - LONG_L $31, PT_R31(sp) - LONG_L $28, PT_R28(sp) - LONG_L $25, PT_R25(sp) --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - LONG_L $8, PT_R8(sp) - LONG_L $9, PT_R9(sp) - #endif -@@ -249,7 +249,7 @@ - LONG_L $31, PT_R31(sp) - LONG_L $28, PT_R28(sp) - LONG_L $25, PT_R25(sp) --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - LONG_L $8, PT_R8(sp) - LONG_L $9, PT_R9(sp) - #endif -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/system.h linux-libc-headers-2.6.8.0/include/asm-mips/system.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/system.h 2004-08-18 13:15:42.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/system.h 2004-08-28 18:13:39.000000000 -0500 -@@ -15,10 +15,11 @@ - #include - - #include -+#include - - #include - #include --#include -+#include - - __asm__ ( - ".macro\tlocal_irq_enable\n\t" -@@ -311,7 +312,7 @@ - return retval; - } - --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val) - { - __u64 retval; -@@ -406,7 +407,7 @@ - return retval; - } - --#ifdef CONFIG_MIPS64 -+#ifdef __mips64 - static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old, - unsigned long new) - { -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/tx4927/tx4927_mips.h linux-libc-headers-2.6.8.0/include/asm-mips/tx4927/tx4927_mips.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/tx4927/tx4927_mips.h 2003-12-15 12:47:03.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/tx4927/tx4927_mips.h 2004-08-26 05:22:30.000000000 -0500 -@@ -36,15 +36,15 @@ - ".set\tmips0"); - } - --#define reg_rd08(r) ((u8 )(*((vu8 *)(r)))) --#define reg_rd16(r) ((u16)(*((vu16*)(r)))) --#define reg_rd32(r) ((u32)(*((vu32*)(r)))) --#define reg_rd64(r) ((u64)(*((vu64*)(r)))) -+#define reg_rd08(r) ((__u8 )(*((vu8 *)(r)))) -+#define reg_rd16(r) ((__u16)(*((vu16*)(r)))) -+#define reg_rd32(r) ((__u32)(*((vu32*)(r)))) -+#define reg_rd64(r) ((__u64)(*((vu64*)(r)))) - --#define reg_wr08(r,v) ((*((vu8 *)(r)))=((u8 )(v))) --#define reg_wr16(r,v) ((*((vu16*)(r)))=((u16)(v))) --#define reg_wr32(r,v) ((*((vu32*)(r)))=((u32)(v))) --#define reg_wr64(r,v) ((*((vu64*)(r)))=((u64)(v))) -+#define reg_wr08(r,v) ((*((vu8 *)(r)))=((__u8 )(v))) -+#define reg_wr16(r,v) ((*((vu16*)(r)))=((__u16)(v))) -+#define reg_wr32(r,v) ((*((vu32*)(r)))=((__u32)(v))) -+#define reg_wr64(r,v) ((*((vu64*)(r)))=((__u64)(v))) - - typedef volatile __signed char vs8; - typedef volatile unsigned char vu8; -@@ -55,10 +55,10 @@ - typedef volatile __signed int vs32; - typedef volatile unsigned int vu32; - --typedef s8 s08; -+typedef __s8 s08; - typedef vs8 vs08; - --typedef u8 u08; -+typedef __u8 u08; - typedef vu8 vu08; - - -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/unaligned.h linux-libc-headers-2.6.8.0/include/asm-mips/unaligned.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/unaligned.h 2004-08-15 15:38:27.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/unaligned.h 2004-08-26 05:22:21.000000000 -0500 -@@ -17,7 +17,7 @@ - * - * This macro should be used for accessing values larger in size than - * single bytes at locations that are expected to be improperly aligned, -- * e.g. retrieving a u16 value from a location not u16-aligned. -+ * e.g. retrieving a __u16 value from a location not __u16-aligned. - * - * Note that unaligned accesses can be very expensive on some architectures. - */ -@@ -31,7 +31,7 @@ - * - * This macro should be used for placing values larger in size than - * single bytes at locations that are expected to be improperly aligned, -- * e.g. writing a u16 value to a location not u16-aligned. -+ * e.g. writing a __u16 value to a location not __u16-aligned. - * - * Note that unaligned accesses can be very expensive on some architectures. - */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/asm-mips/xtalk/xwidget.h linux-libc-headers-2.6.8.0/include/asm-mips/xtalk/xwidget.h ---- linux-libc-headers-2.6.8.0-dist/include/asm-mips/xtalk/xwidget.h 2003-12-15 12:47:03.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/asm-mips/xtalk/xwidget.h 2004-08-26 05:23:33.000000000 -0500 -@@ -92,7 +92,7 @@ - * defined here - */ - #ifndef __ASSEMBLY__ --typedef u32 widgetreg_t; -+typedef __u32 widgetreg_t; - - /* widget configuration registers */ - typedef volatile struct widget_cfg { -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/acpi.h linux-libc-headers-2.6.8.0/include/linux/acpi.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/acpi.h 2004-08-18 13:16:01.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/acpi.h 2004-08-26 05:41:49.000000000 -0500 -@@ -51,49 +51,49 @@ - - struct acpi_table_rsdp { - char signature[8]; -- u8 checksum; -+ __u8 checksum; - char oem_id[6]; -- u8 revision; -- u32 rsdt_address; -+ __u8 revision; -+ __u32 rsdt_address; - } __attribute__ ((packed)); - - struct acpi20_table_rsdp { - char signature[8]; -- u8 checksum; -+ __u8 checksum; - char oem_id[6]; -- u8 revision; -- u32 rsdt_address; -- u32 length; -- u64 xsdt_address; -- u8 ext_checksum; -- u8 reserved[3]; -+ __u8 revision; -+ __u32 rsdt_address; -+ __u32 length; -+ __u64 xsdt_address; -+ __u8 ext_checksum; -+ __u8 reserved[3]; - } __attribute__ ((packed)); - - typedef struct { -- u8 type; -- u8 length; -+ __u8 type; -+ __u8 length; - } __attribute__ ((packed)) acpi_table_entry_header; - - /* Root System Description Table (RSDT) */ - - struct acpi_table_rsdt { - struct acpi_table_header header; -- u32 entry[8]; -+ __u32 entry[8]; - } __attribute__ ((packed)); - - /* Extended System Description Table (XSDT) */ - - struct acpi_table_xsdt { - struct acpi_table_header header; -- u64 entry[1]; -+ __u64 entry[1]; - } __attribute__ ((packed)); - - /* Fixed ACPI Description Table (FADT) */ - - struct acpi_table_fadt { - struct acpi_table_header header; -- u32 facs_addr; -- u32 dsdt_addr; -+ __u32 facs_addr; -+ __u32 dsdt_addr; - /* ... */ - } __attribute__ ((packed)); - -@@ -101,10 +101,10 @@ - - struct acpi_table_madt { - struct acpi_table_header header; -- u32 lapic_address; -+ __u32 lapic_address; - struct { -- u32 pcat_compat:1; -- u32 reserved:31; -+ __u32 pcat_compat:1; -+ __u32 reserved:31; - } flags; - } __attribute__ ((packed)); - -@@ -122,85 +122,85 @@ - }; - - typedef struct { -- u16 polarity:2; -- u16 trigger:2; -- u16 reserved:12; -+ __u16 polarity:2; -+ __u16 trigger:2; -+ __u16 reserved:12; - } __attribute__ ((packed)) acpi_interrupt_flags; - - struct acpi_table_lapic { - acpi_table_entry_header header; -- u8 acpi_id; -- u8 id; -+ __u8 acpi_id; -+ __u8 id; - struct { -- u32 enabled:1; -- u32 reserved:31; -+ __u32 enabled:1; -+ __u32 reserved:31; - } flags; - } __attribute__ ((packed)); - - struct acpi_table_ioapic { - acpi_table_entry_header header; -- u8 id; -- u8 reserved; -- u32 address; -- u32 global_irq_base; -+ __u8 id; -+ __u8 reserved; -+ __u32 address; -+ __u32 global_irq_base; - } __attribute__ ((packed)); - - struct acpi_table_int_src_ovr { - acpi_table_entry_header header; -- u8 bus; -- u8 bus_irq; -- u32 global_irq; -+ __u8 bus; -+ __u8 bus_irq; -+ __u32 global_irq; - acpi_interrupt_flags flags; - } __attribute__ ((packed)); - - struct acpi_table_nmi_src { - acpi_table_entry_header header; - acpi_interrupt_flags flags; -- u32 global_irq; -+ __u32 global_irq; - } __attribute__ ((packed)); - - struct acpi_table_lapic_nmi { - acpi_table_entry_header header; -- u8 acpi_id; -+ __u8 acpi_id; - acpi_interrupt_flags flags; -- u8 lint; -+ __u8 lint; - } __attribute__ ((packed)); - - struct acpi_table_lapic_addr_ovr { - acpi_table_entry_header header; -- u8 reserved[2]; -- u64 address; -+ __u8 reserved[2]; -+ __u64 address; - } __attribute__ ((packed)); - - struct acpi_table_iosapic { - acpi_table_entry_header header; -- u8 id; -- u8 reserved; -- u32 global_irq_base; -- u64 address; -+ __u8 id; -+ __u8 reserved; -+ __u32 global_irq_base; -+ __u64 address; - } __attribute__ ((packed)); - - struct acpi_table_lsapic { - acpi_table_entry_header header; -- u8 acpi_id; -- u8 id; -- u8 eid; -- u8 reserved[3]; -+ __u8 acpi_id; -+ __u8 id; -+ __u8 eid; -+ __u8 reserved[3]; - struct { -- u32 enabled:1; -- u32 reserved:31; -+ __u32 enabled:1; -+ __u32 reserved:31; - } flags; - } __attribute__ ((packed)); - - struct acpi_table_plat_int_src { - acpi_table_entry_header header; - acpi_interrupt_flags flags; -- u8 type; /* See acpi_interrupt_type */ -- u8 id; -- u8 eid; -- u8 iosapic_vector; -- u32 global_irq; -- u32 reserved; -+ __u8 type; /* See acpi_interrupt_type */ -+ __u8 id; -+ __u8 eid; -+ __u8 iosapic_vector; -+ __u32 global_irq; -+ __u32 reserved; - } __attribute__ ((packed)); - - enum acpi_interrupt_id { -@@ -213,21 +213,21 @@ - #define ACPI_SPACE_MEM 0 - - struct acpi_gen_regaddr { -- u8 space_id; -- u8 bit_width; -- u8 bit_offset; -- u8 resv; -- u32 addrl; -- u32 addrh; -+ __u8 space_id; -+ __u8 bit_width; -+ __u8 bit_offset; -+ __u8 resv; -+ __u32 addrl; -+ __u32 addrh; - } __attribute__ ((packed)); - - struct acpi_table_hpet { - struct acpi_table_header header; -- u32 id; -+ __u32 id; - struct acpi_gen_regaddr addr; -- u8 number; -- u16 min_tick; -- u8 page_protect; -+ __u8 number; -+ __u16 min_tick; -+ __u8 page_protect; - } __attribute__ ((packed)); - - /* -@@ -236,17 +236,17 @@ - */ - struct acpi_table_sbf - { -- u8 sbf_signature[4]; -- u32 sbf_len; -- u8 sbf_revision; -- u8 sbf_csum; -- u8 sbf_oemid[6]; -- u8 sbf_oemtable[8]; -- u8 sbf_revdata[4]; -- u8 sbf_creator[4]; -- u8 sbf_crearev[4]; -- u8 sbf_cmos; -- u8 sbf_spare[3]; -+ __u8 sbf_signature[4]; -+ __u32 sbf_len; -+ __u8 sbf_revision; -+ __u8 sbf_csum; -+ __u8 sbf_oemid[6]; -+ __u8 sbf_oemtable[8]; -+ __u8 sbf_revdata[4]; -+ __u8 sbf_creator[4]; -+ __u8 sbf_crearev[4]; -+ __u8 sbf_cmos; -+ __u8 sbf_spare[3]; - } __attribute__ ((packed)); - - /* -@@ -256,8 +256,8 @@ - - struct acpi_table_srat { - struct acpi_table_header header; -- u32 table_revision; -- u64 reserved; -+ __u32 table_revision; -+ __u64 reserved; - } __attribute__ ((packed)); - - enum acpi_srat_entry_id { -@@ -268,31 +268,31 @@ - - struct acpi_table_processor_affinity { - acpi_table_entry_header header; -- u8 proximity_domain; -- u8 apic_id; -+ __u8 proximity_domain; -+ __u8 apic_id; - struct { -- u32 enabled:1; -- u32 reserved:31; -+ __u32 enabled:1; -+ __u32 reserved:31; - } flags; -- u8 lsapic_eid; -- u8 reserved[7]; -+ __u8 lsapic_eid; -+ __u8 reserved[7]; - } __attribute__ ((packed)); - - struct acpi_table_memory_affinity { - acpi_table_entry_header header; -- u8 proximity_domain; -- u8 reserved1[5]; -- u32 base_addr_lo; -- u32 base_addr_hi; -- u32 length_lo; -- u32 length_hi; -- u32 memory_type; /* See acpi_address_range_id */ -+ __u8 proximity_domain; -+ __u8 reserved1[5]; -+ __u32 base_addr_lo; -+ __u32 base_addr_hi; -+ __u32 length_lo; -+ __u32 length_hi; -+ __u32 memory_type; /* See acpi_address_range_id */ - struct { -- u32 enabled:1; -- u32 hot_pluggable:1; -- u32 reserved:30; -+ __u32 enabled:1; -+ __u32 hot_pluggable:1; -+ __u32 reserved:30; - } flags; -- u64 reserved2; -+ __u64 reserved2; - } __attribute__ ((packed)); - - enum acpi_address_range_id { -@@ -310,17 +310,17 @@ - - struct acpi_table_slit { - struct acpi_table_header header; -- u64 localities; -- u8 entry[1]; /* real size = localities^2 */ -+ __u64 localities; -+ __u8 entry[1]; /* real size = localities^2 */ - } __attribute__ ((packed)); - - /* Smart Battery Description Table (SBST) */ - - struct acpi_table_sbst { - struct acpi_table_header header; -- u32 warning; /* Warn user */ -- u32 low; /* Critical sleep */ -- u32 critical; /* Critical shutdown */ -+ __u32 warning; /* Warn user */ -+ __u32 low; /* Critical sleep */ -+ __u32 critical; /* Critical shutdown */ - } __attribute__ ((packed)); - - /* Embedded Controller Boot Resources Table (ECDT) */ -@@ -329,8 +329,8 @@ - struct acpi_table_header header; - struct acpi_generic_address ec_control; - struct acpi_generic_address ec_data; -- u32 uid; -- u8 gpe_bit; -+ __u32 uid; -+ __u8 gpe_bit; - char ec_id[0]; - } __attribute__ ((packed)); - -@@ -338,9 +338,9 @@ - - struct acpi_table_mcfg { - struct acpi_table_header header; -- u8 reserved[8]; -- u32 base_address; -- u32 base_reserved; -+ __u8 reserved[8]; -+ __u32 base_address; -+ __u32 base_reserved; - } __attribute__ ((packed)); - - /* Table Handlers */ -@@ -396,7 +396,7 @@ - - extern int acpi_mp_config; - --extern u32 pci_mmcfg_base_addr; -+extern __u32 pci_mmcfg_base_addr; - - extern int sbf_port ; - -@@ -411,20 +411,20 @@ - - #endif /*!CONFIG_ACPI_BOOT*/ - --unsigned int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low); --int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); -+unsigned int acpi_register_gsi (__u32 gsi, int edge_level, int active_high_low); -+int acpi_gsi_to_irq (__u32 gsi, unsigned int *irq); - - #ifdef CONFIG_ACPI_PCI - - struct acpi_prt_entry { - struct list_head node; - struct acpi_pci_id id; -- u8 pin; -+ __u8 pin; - struct { - acpi_handle handle; -- u32 index; -+ __u32 index; - } link; -- u32 irq; -+ __u32 irq; - }; - - struct acpi_prt_list { -@@ -451,8 +451,8 @@ - - #ifdef CONFIG_ACPI_EC - --int ec_read(u8 addr, u8 *val); --int ec_write(u8 addr, u8 val); -+int ec_read(__u8 addr, __u8 *val); -+int ec_write(__u8 addr, __u8 val); - - #endif /*CONFIG_ACPI_EC*/ - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/affs_fs_i.h linux-libc-headers-2.6.8.0/include/linux/affs_fs_i.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/affs_fs_i.h 2003-12-31 17:46:48.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/affs_fs_i.h 2004-08-26 05:41:49.000000000 -0500 -@@ -9,13 +9,13 @@ - //#define AFFS_CACHE_SIZE (4*4) - - #define AFFS_MAX_PREALLOC 32 --#define AFFS_LC_SIZE (AFFS_CACHE_SIZE/sizeof(u32)/2) -+#define AFFS_LC_SIZE (AFFS_CACHE_SIZE/sizeof(__u32)/2) - #define AFFS_AC_SIZE (AFFS_CACHE_SIZE/sizeof(struct affs_ext_key)/2) - #define AFFS_AC_MASK (AFFS_AC_SIZE-1) - - struct affs_ext_key { -- u32 ext; /* idx of the extended block */ -- u32 key; /* block number */ -+ __u32 ext; /* idx of the extended block */ -+ __u32 key; /* block number */ - }; - - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/affs_fs_sb.h linux-libc-headers-2.6.8.0/include/linux/affs_fs_sb.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/affs_fs_sb.h 2004-08-18 13:16:01.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/affs_fs_sb.h 2004-08-26 05:41:49.000000000 -0500 -@@ -9,8 +9,8 @@ - */ - - struct affs_bm_info { -- u32 bm_key; /* Disk block number */ -- u32 bm_free; /* Free blocks in here */ -+ __u32 bm_key; /* Disk block number */ -+ __u32 bm_free; /* Free blocks in here */ - }; - - #define SF_INTL 0x0001 /* International filesystem. */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/affs_hardblocks.h linux-libc-headers-2.6.8.0/include/linux/affs_hardblocks.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/affs_hardblocks.h 2003-12-15 12:46:58.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/affs_hardblocks.h 2004-08-26 05:41:49.000000000 -0500 -@@ -4,59 +4,59 @@ - /* Just the needed definitions for the RDB of an Amiga HD. */ - - struct RigidDiskBlock { -- u32 rdb_ID; -- u32 rdb_SummedLongs; -- s32 rdb_ChkSum; -- u32 rdb_HostID; -- u32 rdb_BlockBytes; -- u32 rdb_Flags; -- u32 rdb_BadBlockList; -- u32 rdb_PartitionList; -- u32 rdb_FileSysHeaderList; -- u32 rdb_DriveInit; -- u32 rdb_Reserved1[6]; -- u32 rdb_Cylinders; -- u32 rdb_Sectors; -- u32 rdb_Heads; -- u32 rdb_Interleave; -- u32 rdb_Park; -- u32 rdb_Reserved2[3]; -- u32 rdb_WritePreComp; -- u32 rdb_ReducedWrite; -- u32 rdb_StepRate; -- u32 rdb_Reserved3[5]; -- u32 rdb_RDBBlocksLo; -- u32 rdb_RDBBlocksHi; -- u32 rdb_LoCylinder; -- u32 rdb_HiCylinder; -- u32 rdb_CylBlocks; -- u32 rdb_AutoParkSeconds; -- u32 rdb_HighRDSKBlock; -- u32 rdb_Reserved4; -+ __u32 rdb_ID; -+ __u32 rdb_SummedLongs; -+ __s32 rdb_ChkSum; -+ __u32 rdb_HostID; -+ __u32 rdb_BlockBytes; -+ __u32 rdb_Flags; -+ __u32 rdb_BadBlockList; -+ __u32 rdb_PartitionList; -+ __u32 rdb_FileSysHeaderList; -+ __u32 rdb_DriveInit; -+ __u32 rdb_Reserved1[6]; -+ __u32 rdb_Cylinders; -+ __u32 rdb_Sectors; -+ __u32 rdb_Heads; -+ __u32 rdb_Interleave; -+ __u32 rdb_Park; -+ __u32 rdb_Reserved2[3]; -+ __u32 rdb_WritePreComp; -+ __u32 rdb_ReducedWrite; -+ __u32 rdb_StepRate; -+ __u32 rdb_Reserved3[5]; -+ __u32 rdb_RDBBlocksLo; -+ __u32 rdb_RDBBlocksHi; -+ __u32 rdb_LoCylinder; -+ __u32 rdb_HiCylinder; -+ __u32 rdb_CylBlocks; -+ __u32 rdb_AutoParkSeconds; -+ __u32 rdb_HighRDSKBlock; -+ __u32 rdb_Reserved4; - char rdb_DiskVendor[8]; - char rdb_DiskProduct[16]; - char rdb_DiskRevision[4]; - char rdb_ControllerVendor[8]; - char rdb_ControllerProduct[16]; - char rdb_ControllerRevision[4]; -- u32 rdb_Reserved5[10]; -+ __u32 rdb_Reserved5[10]; - }; - - #define IDNAME_RIGIDDISK 0x5244534B /* "RDSK" */ - - struct PartitionBlock { -- u32 pb_ID; -- u32 pb_SummedLongs; -- s32 pb_ChkSum; -- u32 pb_HostID; -- u32 pb_Next; -- u32 pb_Flags; -- u32 pb_Reserved1[2]; -- u32 pb_DevFlags; -- u8 pb_DriveName[32]; -- u32 pb_Reserved2[15]; -- u32 pb_Environment[17]; -- u32 pb_EReserved[15]; -+ __u32 pb_ID; -+ __u32 pb_SummedLongs; -+ __s32 pb_ChkSum; -+ __u32 pb_HostID; -+ __u32 pb_Next; -+ __u32 pb_Flags; -+ __u32 pb_Reserved1[2]; -+ __u32 pb_DevFlags; -+ __u8 pb_DriveName[32]; -+ __u32 pb_Reserved2[15]; -+ __u32 pb_Environment[17]; -+ __u32 pb_EReserved[15]; - }; - - #define IDNAME_PARTITION 0x50415254 /* "PART" */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/amigaffs.h linux-libc-headers-2.6.8.0/include/linux/amigaffs.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/amigaffs.h 2003-12-31 17:46:48.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/amigaffs.h 2004-08-26 05:41:49.000000000 -0500 -@@ -64,90 +64,90 @@ - #define AFFS_DATA(bh) (((struct affs_data_head *)(bh)->b_data)->data) - - struct affs_date { -- u32 days; -- u32 mins; -- u32 ticks; -+ __u32 days; -+ __u32 mins; -+ __u32 ticks; - }; - - struct affs_short_date { -- u16 days; -- u16 mins; -- u16 ticks; -+ __u16 days; -+ __u16 mins; -+ __u16 ticks; - }; - - struct affs_root_head { -- u32 ptype; -- u32 spare1; -- u32 spare2; -- u32 hash_size; -- u32 spare3; -- u32 checksum; -- u32 hashtable[1]; -+ __u32 ptype; -+ __u32 spare1; -+ __u32 spare2; -+ __u32 hash_size; -+ __u32 spare3; -+ __u32 checksum; -+ __u32 hashtable[1]; - }; - - struct affs_root_tail { -- u32 bm_flag; -- u32 bm_blk[AFFS_ROOT_BMAPS]; -- u32 bm_ext; -+ __u32 bm_flag; -+ __u32 bm_blk[AFFS_ROOT_BMAPS]; -+ __u32 bm_ext; - struct affs_date root_change; -- u8 disk_name[32]; -- u32 spare1; -- u32 spare2; -+ __u8 disk_name[32]; -+ __u32 spare1; -+ __u32 spare2; - struct affs_date disk_change; - struct affs_date disk_create; -- u32 spare3; -- u32 spare4; -- u32 dcache; -- u32 stype; -+ __u32 spare3; -+ __u32 spare4; -+ __u32 dcache; -+ __u32 stype; - }; - - struct affs_head { -- u32 ptype; -- u32 key; -- u32 block_count; -- u32 spare1; -- u32 first_data; -- u32 checksum; -- u32 table[1]; -+ __u32 ptype; -+ __u32 key; -+ __u32 block_count; -+ __u32 spare1; -+ __u32 first_data; -+ __u32 checksum; -+ __u32 table[1]; - }; - - struct affs_tail { -- u32 spare1; -- u16 uid; -- u16 gid; -- u32 protect; -- u32 size; -- u8 comment[92]; -+ __u32 spare1; -+ __u16 uid; -+ __u16 gid; -+ __u32 protect; -+ __u32 size; -+ __u8 comment[92]; - struct affs_date change; -- u8 name[32]; -- u32 spare2; -- u32 original; -- u32 link_chain; -- u32 spare[5]; -- u32 hash_chain; -- u32 parent; -- u32 extension; -- u32 stype; -+ __u8 name[32]; -+ __u32 spare2; -+ __u32 original; -+ __u32 link_chain; -+ __u32 spare[5]; -+ __u32 hash_chain; -+ __u32 parent; -+ __u32 extension; -+ __u32 stype; - }; - - struct slink_front - { -- u32 ptype; -- u32 key; -- u32 spare1[3]; -- u32 checksum; -- u8 symname[1]; /* depends on block size */ -+ __u32 ptype; -+ __u32 key; -+ __u32 spare1[3]; -+ __u32 checksum; -+ __u8 symname[1]; /* depends on block size */ - }; - - struct affs_data_head - { -- u32 ptype; -- u32 key; -- u32 sequence; -- u32 size; -- u32 next; -- u32 checksum; -- u8 data[1]; /* depends on block size */ -+ __u32 ptype; -+ __u32 key; -+ __u32 sequence; -+ __u32 size; -+ __u32 next; -+ __u32 checksum; -+ __u8 data[1]; /* depends on block size */ - }; - - /* Permission bits */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/ata.h linux-libc-headers-2.6.8.0/include/linux/ata.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/ata.h 2004-08-18 13:16:01.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/ata.h 2004-08-26 05:41:49.000000000 -0500 -@@ -34,7 +34,7 @@ - ATA_MAX_PRD = 256, /* we could make these 256/256 */ - ATA_SECT_SIZE = 512, - ATA_SECT_SIZE_MASK = (ATA_SECT_SIZE - 1), -- ATA_SECT_DWORDS = ATA_SECT_SIZE / sizeof(u32), -+ ATA_SECT_DWORDS = ATA_SECT_SIZE / sizeof(__u32), - - ATA_ID_WORDS = 256, - ATA_ID_PROD_OFS = 27, -@@ -176,31 +176,31 @@ - /* core structures */ - - struct ata_prd { -- u32 addr; -- u32 flags_len; -+ __u32 addr; -+ __u32 flags_len; - } __attribute__((packed)); - - struct ata_taskfile { - unsigned long flags; /* ATA_TFLAG_xxx */ -- u8 protocol; /* ATA_PROT_xxx */ -+ __u8 protocol; /* ATA_PROT_xxx */ - -- u8 ctl; /* control reg */ -+ __u8 ctl; /* control reg */ - -- u8 hob_feature; /* additional data */ -- u8 hob_nsect; /* to support LBA48 */ -- u8 hob_lbal; -- u8 hob_lbam; -- u8 hob_lbah; -+ __u8 hob_feature; /* additional data */ -+ __u8 hob_nsect; /* to support LBA48 */ -+ __u8 hob_lbal; -+ __u8 hob_lbam; -+ __u8 hob_lbah; - -- u8 feature; -- u8 nsect; -- u8 lbal; -- u8 lbam; -- u8 lbah; -+ __u8 feature; -+ __u8 nsect; -+ __u8 lbal; -+ __u8 lbam; -+ __u8 lbah; - -- u8 device; -+ __u8 device; - -- u8 command; /* IO operation */ -+ __u8 command; /* IO operation */ - }; - - #define ata_id_is_ata(dev) (((dev)->id[0] & (1 << 15)) == 0) -@@ -213,12 +213,12 @@ - #define ata_id_has_dma(dev) ((dev)->id[49] & (1 << 8)) - #define ata_id_removeable(dev) ((dev)->id[0] & (1 << 7)) - #define ata_id_u32(dev,n) \ -- (((u32) (dev)->id[(n) + 1] << 16) | ((u32) (dev)->id[(n)])) -+ (((__u32) (dev)->id[(n) + 1] << 16) | ((__u32) (dev)->id[(n)])) - #define ata_id_u64(dev,n) \ -- ( ((u64) dev->id[(n) + 3] << 48) | \ -- ((u64) dev->id[(n) + 2] << 32) | \ -- ((u64) dev->id[(n) + 1] << 16) | \ -- ((u64) dev->id[(n) + 0]) ) -+ ( ((__u64) dev->id[(n) + 3] << 48) | \ -+ ((__u64) dev->id[(n) + 2] << 32) | \ -+ ((__u64) dev->id[(n) + 1] << 16) | \ -+ ((__u64) dev->id[(n) + 0]) ) - - static inline int is_atapi_taskfile(struct ata_taskfile *tf) - { -@@ -226,7 +226,7 @@ - (tf->protocol == ATA_PROT_ATAPI_DMA); - } - --static inline int ata_ok(u8 status) -+static inline int ata_ok(__u8 status) - { - return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) - == ATA_DRDY); -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/bitops.h linux-libc-headers-2.6.8.0/include/linux/bitops.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/bitops.h 2004-06-09 07:00:49.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/bitops.h 2004-08-26 05:41:49.000000000 -0500 -@@ -114,7 +114,7 @@ - return generic_hweight32((unsigned int)(w >> 32)) + - generic_hweight32((unsigned int)w); - #else -- u64 res; -+ __u64 res; - res = (w & 0x5555555555555555ul) + ((w >> 1) & 0x5555555555555555ul); - res = (res & 0x3333333333333333ul) + ((res >> 2) & 0x3333333333333333ul); - res = (res & 0x0F0F0F0F0F0F0F0Ful) + ((res >> 4) & 0x0F0F0F0F0F0F0F0Ful); -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/compat.h linux-libc-headers-2.6.8.0/include/linux/compat.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/compat.h 2004-06-09 07:00:49.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/compat.h 2004-08-26 05:41:49.000000000 -0500 -@@ -78,9 +78,9 @@ - }; - - struct compat_dirent { -- u32 d_ino; -+ __u32 d_ino; - compat_off_t d_off; -- u16 d_reclen; -+ __u16 d_reclen; - char d_name[256]; - }; - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/console.h linux-libc-headers-2.6.8.0/include/linux/console.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/console.h 2004-08-18 13:16:02.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/console.h 2004-08-26 05:41:49.000000000 -0500 -@@ -49,9 +49,9 @@ - int (*con_scrolldelta)(struct vc_data *, int); - int (*con_set_origin)(struct vc_data *); - void (*con_save_screen)(struct vc_data *); -- u8 (*con_build_attr)(struct vc_data *, u8, u8, u8, u8, u8); -- void (*con_invert_region)(struct vc_data *, u16 *, int); -- u16 *(*con_screen_pos)(struct vc_data *, int); -+ __u8 (*con_build_attr)(struct vc_data *, __u8, __u8, __u8, __u8, __u8); -+ void (*con_invert_region)(struct vc_data *, __u16 *, int); -+ __u16 *(*con_screen_pos)(struct vc_data *, int); - unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *); - }; - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/cpufreq.h linux-libc-headers-2.6.8.0/include/linux/cpufreq.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/cpufreq.h 2004-06-23 16:52:53.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/cpufreq.h 2004-08-26 05:41:49.000000000 -0500 -@@ -103,7 +103,7 @@ - unsigned int cpu; /* cpu nr */ - unsigned int old; - unsigned int new; -- u8 flags; /* flags of cpufreq_driver, see below. */ -+ __u8 flags; /* flags of cpufreq_driver, see below. */ - }; - - -@@ -120,13 +120,13 @@ - { - #if BITS_PER_LONG == 32 - -- u64 result = ((u64) old) * ((u64) mult); -+ __u64 result = ((__u64) old) * ((__u64) mult); - do_div(result, div); - return (unsigned long) result; - - #elif BITS_PER_LONG == 64 - -- unsigned long result = old * ((u64) mult); -+ unsigned long result = old * ((__u64) mult); - result /= div; - return result; - -@@ -178,7 +178,7 @@ - struct cpufreq_driver { - struct module *owner; - char name[CPUFREQ_NAME_LEN]; -- u8 flags; -+ __u8 flags; - - /* needed by all drivers */ - int (*init) (struct cpufreq_policy *policy); -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/cramfs_fs.h linux-libc-headers-2.6.8.0/include/linux/cramfs_fs.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/cramfs_fs.h 2004-01-05 12:42:27.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/cramfs_fs.h 2004-08-26 05:41:49.000000000 -0500 -@@ -2,9 +2,9 @@ - #define __CRAMFS_H - - --typedef unsigned char u8; --typedef unsigned short u16; --typedef unsigned int u32; -+typedef unsigned char __u8; -+typedef unsigned short __u16; -+typedef unsigned int __u32; - - - #define CRAMFS_MAGIC 0x28cd3d45 /* some random number */ -@@ -31,9 +31,9 @@ - * Reasonably terse representation of the inode data. - */ - struct cramfs_inode { -- u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH; -+ __u32 mode:CRAMFS_MODE_WIDTH, uid:CRAMFS_UID_WIDTH; - /* SIZE for device files is i_rdev */ -- u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH; -+ __u32 size:CRAMFS_SIZE_WIDTH, gid:CRAMFS_GID_WIDTH; - /* NAMELEN is the length of the file name, divided by 4 and - rounded up. (cramfs doesn't support hard links.) */ - /* OFFSET: For symlinks and non-empty regular files, this -@@ -42,27 +42,27 @@ - see README). For non-empty directories it is the offset - (divided by 4) of the inode of the first file in that - directory. For anything else, offset is zero. */ -- u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH; -+ __u32 namelen:CRAMFS_NAMELEN_WIDTH, offset:CRAMFS_OFFSET_WIDTH; - }; - - struct cramfs_info { -- u32 crc; -- u32 edition; -- u32 blocks; -- u32 files; -+ __u32 crc; -+ __u32 edition; -+ __u32 blocks; -+ __u32 files; - }; - - /* - * Superblock information at the beginning of the FS. - */ - struct cramfs_super { -- u32 magic; /* 0x28cd3d45 - random number */ -- u32 size; /* length in bytes */ -- u32 flags; /* feature flags */ -- u32 future; /* reserved for future use */ -- u8 signature[16]; /* "Compressed ROMFS" */ -+ __u32 magic; /* 0x28cd3d45 - random number */ -+ __u32 size; /* length in bytes */ -+ __u32 flags; /* feature flags */ -+ __u32 future; /* reserved for future use */ -+ __u8 signature[16]; /* "Compressed ROMFS" */ - struct cramfs_info fsid; /* unique filesystem info */ -- u8 name[16]; /* user-defined name */ -+ __u8 name[16]; /* user-defined name */ - struct cramfs_inode root; /* root inode data */ - }; - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/crc32.h linux-libc-headers-2.6.8.0/include/linux/crc32.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/crc32.h 2003-12-15 12:46:57.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/crc32.h 2004-08-26 05:41:49.000000000 -0500 -@@ -7,9 +7,9 @@ - - #include - --extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len); --extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len); --extern u32 bitreverse(u32 in); -+extern __u32 crc32_le(__u32 crc, unsigned char const *p, size_t len); -+extern __u32 crc32_be(__u32 crc, unsigned char const *p, size_t len); -+extern __u32 bitreverse(__u32 in); - - #define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length) - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/crypto.h linux-libc-headers-2.6.8.0/include/linux/crypto.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/crypto.h 2004-04-19 16:13:51.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/crypto.h 2004-08-26 05:41:49.000000000 -0500 -@@ -63,28 +63,28 @@ - struct cipher_alg { - unsigned int cia_min_keysize; - unsigned int cia_max_keysize; -- int (*cia_setkey)(void *ctx, const u8 *key, -- unsigned int keylen, u32 *flags); -- void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src); -- void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src); -+ int (*cia_setkey)(void *ctx, const __u8 *key, -+ unsigned int keylen, __u32 *flags); -+ void (*cia_encrypt)(void *ctx, __u8 *dst, const __u8 *src); -+ void (*cia_decrypt)(void *ctx, __u8 *dst, const __u8 *src); - }; - - struct digest_alg { - unsigned int dia_digestsize; - void (*dia_init)(void *ctx); -- void (*dia_update)(void *ctx, const u8 *data, unsigned int len); -- void (*dia_final)(void *ctx, u8 *out); -- int (*dia_setkey)(void *ctx, const u8 *key, -- unsigned int keylen, u32 *flags); -+ void (*dia_update)(void *ctx, const __u8 *data, unsigned int len); -+ void (*dia_final)(void *ctx, __u8 *out); -+ int (*dia_setkey)(void *ctx, const __u8 *key, -+ unsigned int keylen, __u32 *flags); - }; - - struct compress_alg { - int (*coa_init)(void *ctx); - void (*coa_exit)(void *ctx); -- int (*coa_compress)(void *ctx, const u8 *src, unsigned int slen, -- u8 *dst, unsigned int *dlen); -- int (*coa_decompress)(void *ctx, const u8 *src, unsigned int slen, -- u8 *dst, unsigned int *dlen); -+ int (*coa_compress)(void *ctx, const __u8 *src, unsigned int slen, -+ __u8 *dst, unsigned int *dlen); -+ int (*coa_decompress)(void *ctx, const __u8 *src, unsigned int slen, -+ __u8 *dst, unsigned int *dlen); - }; - - #define cra_cipher cra_u.cipher -@@ -93,7 +93,7 @@ - - struct crypto_alg { - struct list_head cra_list; -- u32 cra_flags; -+ __u32 cra_flags; - unsigned int cra_blocksize; - unsigned int cra_ctxsize; - const char cra_name[CRYPTO_MAX_ALG_NAME]; -@@ -116,7 +116,7 @@ - /* - * Algorithm query interface. - */ --int crypto_alg_available(const char *name, u32 flags); -+int crypto_alg_available(const char *name, __u32 flags); - - /* - * Transforms: user-instantiated objects which encapsulate algorithms -@@ -128,9 +128,9 @@ - struct cipher_tfm { - void *cit_iv; - unsigned int cit_ivsize; -- u32 cit_mode; -+ __u32 cit_mode; - int (*cit_setkey)(struct crypto_tfm *tfm, -- const u8 *key, unsigned int keylen); -+ const __u8 *key, unsigned int keylen); - int (*cit_encrypt)(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, -@@ -138,7 +138,7 @@ - int (*cit_encrypt_iv)(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, -- unsigned int nbytes, u8 *iv); -+ unsigned int nbytes, __u8 *iv); - int (*cit_decrypt)(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, -@@ -146,19 +146,19 @@ - int (*cit_decrypt_iv)(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, -- unsigned int nbytes, u8 *iv); -- void (*cit_xor_block)(u8 *dst, const u8 *src); -+ unsigned int nbytes, __u8 *iv); -+ void (*cit_xor_block)(__u8 *dst, const __u8 *src); - }; - - struct digest_tfm { - void (*dit_init)(struct crypto_tfm *tfm); - void (*dit_update)(struct crypto_tfm *tfm, - struct scatterlist *sg, unsigned int nsg); -- void (*dit_final)(struct crypto_tfm *tfm, u8 *out); -+ void (*dit_final)(struct crypto_tfm *tfm, __u8 *out); - void (*dit_digest)(struct crypto_tfm *tfm, struct scatterlist *sg, -- unsigned int nsg, u8 *out); -+ unsigned int nsg, __u8 *out); - int (*dit_setkey)(struct crypto_tfm *tfm, -- const u8 *key, unsigned int keylen); -+ const __u8 *key, unsigned int keylen); - #ifdef CONFIG_CRYPTO_HMAC - void *dit_hmac_block; - #endif -@@ -166,11 +166,11 @@ - - struct compress_tfm { - int (*cot_compress)(struct crypto_tfm *tfm, -- const u8 *src, unsigned int slen, -- u8 *dst, unsigned int *dlen); -+ const __u8 *src, unsigned int slen, -+ __u8 *dst, unsigned int *dlen); - int (*cot_decompress)(struct crypto_tfm *tfm, -- const u8 *src, unsigned int slen, -- u8 *dst, unsigned int *dlen); -+ const __u8 *src, unsigned int slen, -+ __u8 *dst, unsigned int *dlen); - }; - - #define crt_cipher crt_u.cipher -@@ -179,7 +179,7 @@ - - struct crypto_tfm { - -- u32 crt_flags; -+ __u32 crt_flags; - - union { - struct cipher_tfm cipher; -@@ -203,7 +203,7 @@ - * crypto_free_tfm() frees up the transform and any associated resources, - * then drops the refcount on the associated algorithm. - */ --struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags); -+struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, __u32 tfm_flags); - void crypto_free_tfm(struct crypto_tfm *tfm); - - /* -@@ -219,7 +219,7 @@ - return module_name(tfm->__crt_alg->cra_module); - } - --static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm) -+static inline __u32 crypto_tfm_alg_type(struct crypto_tfm *tfm) - { - return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; - } -@@ -270,7 +270,7 @@ - tfm->crt_digest.dit_update(tfm, sg, nsg); - } - --static inline void crypto_digest_final(struct crypto_tfm *tfm, u8 *out) -+static inline void crypto_digest_final(struct crypto_tfm *tfm, __u8 *out) - { - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); - tfm->crt_digest.dit_final(tfm, out); -@@ -278,14 +278,14 @@ - - static inline void crypto_digest_digest(struct crypto_tfm *tfm, - struct scatterlist *sg, -- unsigned int nsg, u8 *out) -+ unsigned int nsg, __u8 *out) - { - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); - tfm->crt_digest.dit_digest(tfm, sg, nsg, out); - } - - static inline int crypto_digest_setkey(struct crypto_tfm *tfm, -- const u8 *key, unsigned int keylen) -+ const __u8 *key, unsigned int keylen) - { - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); - if (tfm->crt_digest.dit_setkey == NULL) -@@ -294,7 +294,7 @@ - } - - static inline int crypto_cipher_setkey(struct crypto_tfm *tfm, -- const u8 *key, unsigned int keylen) -+ const __u8 *key, unsigned int keylen) - { - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - return tfm->crt_cipher.cit_setkey(tfm, key, keylen); -@@ -312,7 +312,7 @@ - static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, -- unsigned int nbytes, u8 *iv) -+ unsigned int nbytes, __u8 *iv) - { - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB); -@@ -331,7 +331,7 @@ - static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, -- unsigned int nbytes, u8 *iv) -+ unsigned int nbytes, __u8 *iv) - { - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB); -@@ -339,30 +339,30 @@ - } - - static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm, -- const u8 *src, unsigned int len) -+ const __u8 *src, unsigned int len) - { - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - memcpy(tfm->crt_cipher.cit_iv, src, len); - } - - static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm, -- u8 *dst, unsigned int len) -+ __u8 *dst, unsigned int len) - { - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); - memcpy(dst, tfm->crt_cipher.cit_iv, len); - } - - static inline int crypto_comp_compress(struct crypto_tfm *tfm, -- const u8 *src, unsigned int slen, -- u8 *dst, unsigned int *dlen) -+ const __u8 *src, unsigned int slen, -+ __u8 *dst, unsigned int *dlen) - { - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); - return tfm->crt_compress.cot_compress(tfm, src, slen, dst, dlen); - } - - static inline int crypto_comp_decompress(struct crypto_tfm *tfm, -- const u8 *src, unsigned int slen, -- u8 *dst, unsigned int *dlen) -+ const __u8 *src, unsigned int slen, -+ __u8 *dst, unsigned int *dlen) - { - BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); - return tfm->crt_compress.cot_decompress(tfm, src, slen, dst, dlen); -@@ -372,13 +372,13 @@ - * HMAC support. - */ - #ifdef CONFIG_CRYPTO_HMAC --void crypto_hmac_init(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen); -+void crypto_hmac_init(struct crypto_tfm *tfm, __u8 *key, unsigned int *keylen); - void crypto_hmac_update(struct crypto_tfm *tfm, - struct scatterlist *sg, unsigned int nsg); --void crypto_hmac_final(struct crypto_tfm *tfm, u8 *key, -- unsigned int *keylen, u8 *out); --void crypto_hmac(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen, -- struct scatterlist *sg, unsigned int nsg, u8 *out); -+void crypto_hmac_final(struct crypto_tfm *tfm, __u8 *key, -+ unsigned int *keylen, __u8 *out); -+void crypto_hmac(struct crypto_tfm *tfm, __u8 *key, unsigned int *keylen, -+ struct scatterlist *sg, unsigned int nsg, __u8 *out); - #endif /* CONFIG_CRYPTO_HMAC */ - - #endif /* _LINUX_CRYPTO_H */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/cycx_drv.h linux-libc-headers-2.6.8.0/include/linux/cycx_drv.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/cycx_drv.h 2003-12-15 12:46:57.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/cycx_drv.h 2004-08-26 05:41:49.000000000 -0500 -@@ -14,9 +14,9 @@ - * ============================================================================ - * 1999/10/23 acme cycxhw_t cleanup - * 1999/01/03 acme more judicious use of data types... --* uclong, ucchar, etc deleted, the u8, u16, u32 -+* uclong, ucchar, etc deleted, the __u8, __u16, __u32 - * types are the portable way to go. --* 1999/01/03 acme judicious use of data types... u16, u32, etc -+* 1999/01/03 acme judicious use of data types... __u16, __u32, etc - * 1998/12/26 acme FIXED_BUFFERS, CONF_OFFSET, - * removal of cy_read{bwl} - * 1998/08/08 acme Initial version. -@@ -46,18 +46,18 @@ - * @reserved - reserved for future use - */ - struct cycx_hw { -- u32 fwid; -+ __u32 fwid; - int irq; - void *dpmbase; -- u32 dpmsize; -- u32 reserved[5]; -+ __u32 dpmsize; -+ __u32 reserved[5]; - }; - - /* Function Prototypes */ --extern int cycx_setup(struct cycx_hw *hw, void *sfm, u32 len); -+extern int cycx_setup(struct cycx_hw *hw, void *sfm, __u32 len); - extern int cycx_down(struct cycx_hw *hw); --extern int cycx_peek(struct cycx_hw *hw, u32 addr, void *buf, u32 len); --extern int cycx_poke(struct cycx_hw *hw, u32 addr, void *buf, u32 len); -+extern int cycx_peek(struct cycx_hw *hw, __u32 addr, void *buf, __u32 len); -+extern int cycx_poke(struct cycx_hw *hw, __u32 addr, void *buf, __u32 len); - extern int cycx_exec(void *addr); - - extern void cycx_inten(struct cycx_hw *hw); -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/cycx_x25.h linux-libc-headers-2.6.8.0/include/linux/cycx_x25.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/cycx_x25.h 2003-12-15 12:46:58.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/cycx_x25.h 2004-08-26 05:41:49.000000000 -0500 -@@ -38,10 +38,10 @@ - /* Data Structures */ - /* X.25 Command Block. */ - struct cycx_x25_cmd { -- u16 command PACKED; -- u16 link PACKED; /* values: 0 or 1 */ -- u16 len PACKED; /* values: 0 thru 0x205 (517) */ -- u32 buf PACKED; -+ __u16 command PACKED; -+ __u16 link PACKED; /* values: 0 or 1 */ -+ __u16 len PACKED; /* values: 0 thru 0x205 (517) */ -+ __u32 buf PACKED; - }; - - /* Defines for the 'command' field. */ -@@ -92,34 +92,34 @@ - * @flags - see dosx25.doc, in portuguese, for details - */ - struct cycx_x25_config { -- u8 link PACKED; -- u8 speed PACKED; -- u8 clock PACKED; -- u8 n2 PACKED; -- u8 n2win PACKED; -- u8 n3win PACKED; -- u8 nvc PACKED; -- u8 pktlen PACKED; -- u8 locaddr PACKED; -- u8 remaddr PACKED; -- u16 t1 PACKED; -- u16 t2 PACKED; -- u8 t21 PACKED; -- u8 npvc PACKED; -- u8 t23 PACKED; -- u8 flags PACKED; -+ __u8 link PACKED; -+ __u8 speed PACKED; -+ __u8 clock PACKED; -+ __u8 n2 PACKED; -+ __u8 n2win PACKED; -+ __u8 n3win PACKED; -+ __u8 nvc PACKED; -+ __u8 pktlen PACKED; -+ __u8 locaddr PACKED; -+ __u8 remaddr PACKED; -+ __u16 t1 PACKED; -+ __u16 t2 PACKED; -+ __u8 t21 PACKED; -+ __u8 npvc PACKED; -+ __u8 t23 PACKED; -+ __u8 flags PACKED; - }; - - struct cycx_x25_stats { -- u16 rx_crc_errors PACKED; -- u16 rx_over_errors PACKED; -- u16 n2_tx_frames PACKED; -- u16 n2_rx_frames PACKED; -- u16 tx_timeouts PACKED; -- u16 rx_timeouts PACKED; -- u16 n3_tx_packets PACKED; -- u16 n3_rx_packets PACKED; -- u16 tx_aborts PACKED; -- u16 rx_aborts PACKED; -+ __u16 rx_crc_errors PACKED; -+ __u16 rx_over_errors PACKED; -+ __u16 n2_tx_frames PACKED; -+ __u16 n2_rx_frames PACKED; -+ __u16 tx_timeouts PACKED; -+ __u16 rx_timeouts PACKED; -+ __u16 n3_tx_packets PACKED; -+ __u16 n3_rx_packets PACKED; -+ __u16 tx_aborts PACKED; -+ __u16 rx_aborts PACKED; - }; - #endif /* _CYCX_X25_H */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/device.h linux-libc-headers-2.6.8.0/include/linux/device.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/device.h 2004-08-18 13:16:02.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/device.h 2004-08-26 05:41:49.000000000 -0500 -@@ -57,7 +57,7 @@ - struct device * (*add) (struct device * parent, char * bus_id); - int (*hotplug) (struct device *dev, char **envp, - int num_envp, char *buffer, int buffer_size); -- int (*suspend)(struct device * dev, u32 state); -+ int (*suspend)(struct device * dev, __u32 state); - int (*resume)(struct device * dev); - }; - -@@ -105,8 +105,8 @@ - int (*probe) (struct device * dev); - int (*remove) (struct device * dev); - void (*shutdown) (struct device * dev); -- int (*suspend) (struct device * dev, u32 state, u32 level); -- int (*resume) (struct device * dev, u32 level); -+ int (*suspend) (struct device * dev, __u32 state, __u32 level); -+ int (*resume) (struct device * dev, __u32 level); - }; - - -@@ -262,17 +262,17 @@ - void *platform_data; /* Platform specific data (e.g. ACPI, - BIOS data relevant to device) */ - struct dev_pm_info power; -- u32 power_state; /* Current operating state. In -+ __u32 power_state; /* Current operating state. In - ACPI-speak, this is D0-D3, D0 - being fully functional, and D3 - being off. */ - - unsigned char *saved_state; /* saved device state */ -- u32 detach_state; /* State to enter when device is -+ __u32 detach_state; /* State to enter when device is - detached from its driver. */ - -- u64 *dma_mask; /* dma mask (if dma'able device) */ -- u64 coherent_dma_mask;/* Like dma_mask, but for -+ __u64 *dma_mask; /* dma mask (if dma'able device) */ -+ __u64 coherent_dma_mask;/* Like dma_mask, but for - alloc_coherent mappings as - not all hardware supports - 64 bit addresses for consistent -@@ -360,9 +360,9 @@ - - struct platform_device { - char * name; -- u32 id; -+ __u32 id; - struct device dev; -- u32 num_resources; -+ __u32 num_resources; - struct resource * resource; - }; - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/divert.h linux-libc-headers-2.6.8.0/include/linux/divert.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/divert.h 2004-06-09 07:00:49.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/divert.h 2004-08-26 05:41:49.000000000 -0500 -@@ -27,10 +27,10 @@ - { - int divert; /* are we active */ - unsigned int protos; /* protocols */ -- u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */ -- u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */ -- u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */ -- u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */ -+ __u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */ -+ __u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */ -+ __u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */ -+ __u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */ - }; - - /* -@@ -40,12 +40,12 @@ - - typedef union _divert_cf_arg - { -- s16 int16; -- u16 uint16; -- s32 int32; -- u32 uint32; -- s64 int64; -- u64 uint64; -+ __s16 int16; -+ __u16 uint16; -+ __s32 int32; -+ __u32 uint32; -+ __s64 int64; -+ __u64 uint64; - void *ptr; - } divert_cf_arg; - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/eeprom.h linux-libc-headers-2.6.8.0/include/linux/eeprom.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/eeprom.h 2003-12-19 07:05:15.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/eeprom.h 2004-08-26 13:26:38.000000000 -0500 -@@ -26,15 +26,15 @@ - unsigned ee_state; - - spinlock_t *lock; -- u32 *cache; -+ __u32 *cache; - }; - - --u8 eeprom_readb(struct eeprom *ee, unsigned address); --void eeprom_read(struct eeprom *ee, unsigned address, u8 *bytes, -+__u8 eeprom_readb(struct eeprom *ee, unsigned address); -+void eeprom_read(struct eeprom *ee, unsigned address, __u8 *bytes, - unsigned count); --void eeprom_writeb(struct eeprom *ee, unsigned address, u8 data); --void eeprom_write(struct eeprom *ee, unsigned address, u8 *bytes, -+void eeprom_writeb(struct eeprom *ee, unsigned address, __u8 data); -+void eeprom_write(struct eeprom *ee, unsigned address, __u8 *bytes, - unsigned count); - - /* The EEPROM commands include the alway-set leading bit. */ -@@ -56,10 +56,10 @@ - } - - /* foo. put this in a .c file */ --static inline void eeprom_update(struct eeprom *ee, u32 mask, int pol) -+static inline void eeprom_update(struct eeprom *ee, __u32 mask, int pol) - { - unsigned long flags; -- u32 data; -+ __u32 data; - - spin_lock_irqsave(ee->lock, flags); - data = *ee->cache; -@@ -106,17 +106,17 @@ - eeprom_update(ee, ee->eedi, pol); - } - --u16 eeprom_readw(struct eeprom *ee, unsigned address) -+__u16 eeprom_readw(struct eeprom *ee, unsigned address) - { - unsigned i; -- u16 res = 0; -+ __u16 res = 0; - - eeprom_clk_lo(ee); - eeprom_update(ee, ee->eesel, 1 ^ !!(ee->polarity & EEPOL_EESEL)); - eeprom_send_addr(ee, address); - - for (i=0; i<16; i++) { -- u32 data; -+ __u32 data; - eeprom_clk_hi(ee); - res <<= 1; - data = readl(ee->addr); -@@ -130,6 +130,6 @@ - } - - --void eeprom_writeb(struct eeprom *ee, unsigned address, u8 data) -+void eeprom_writeb(struct eeprom *ee, unsigned address, __u8 data) - { - } -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/efi.h linux-libc-headers-2.6.8.0/include/linux/efi.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/efi.h 2004-08-18 13:16:02.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/efi.h 2004-08-26 05:42:08.000000000 -0500 -@@ -30,12 +30,12 @@ - #define EFI_NOT_FOUND (14 | (1UL << (BITS_PER_LONG-1))) - - typedef unsigned long efi_status_t; --typedef u8 efi_bool_t; --typedef u16 efi_char16_t; /* UNICODE character */ -+typedef __u8 efi_bool_t; -+typedef __u16 efi_char16_t; /* UNICODE character */ - - - typedef struct { -- u8 b[16]; -+ __u8 b[16]; - } efi_guid_t; - - #define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ -@@ -49,11 +49,11 @@ - * Generic EFI table header - */ - typedef struct { -- u64 signature; -- u32 revision; -- u32 headersize; -- u32 crc32; -- u32 reserved; -+ __u64 signature; -+ __u32 revision; -+ __u32 headersize; -+ __u32 crc32; -+ __u32 reserved; - } efi_table_hdr_t; - - /* -@@ -78,14 +78,14 @@ - #define EFI_MAX_MEMORY_TYPE 14 - - /* Attribute values: */ --#define EFI_MEMORY_UC ((u64)0x0000000000000001ULL) /* uncached */ --#define EFI_MEMORY_WC ((u64)0x0000000000000002ULL) /* write-coalescing */ --#define EFI_MEMORY_WT ((u64)0x0000000000000004ULL) /* write-through */ --#define EFI_MEMORY_WB ((u64)0x0000000000000008ULL) /* write-back */ --#define EFI_MEMORY_WP ((u64)0x0000000000001000ULL) /* write-protect */ --#define EFI_MEMORY_RP ((u64)0x0000000000002000ULL) /* read-protect */ --#define EFI_MEMORY_XP ((u64)0x0000000000004000ULL) /* execute-protect */ --#define EFI_MEMORY_RUNTIME ((u64)0x8000000000000000ULL) /* range requires runtime mapping */ -+#define EFI_MEMORY_UC ((__u64)0x0000000000000001ULL) /* uncached */ -+#define EFI_MEMORY_WC ((__u64)0x0000000000000002ULL) /* write-coalescing */ -+#define EFI_MEMORY_WT ((__u64)0x0000000000000004ULL) /* write-through */ -+#define EFI_MEMORY_WB ((__u64)0x0000000000000008ULL) /* write-back */ -+#define EFI_MEMORY_WP ((__u64)0x0000000000001000ULL) /* write-protect */ -+#define EFI_MEMORY_RP ((__u64)0x0000000000002000ULL) /* read-protect */ -+#define EFI_MEMORY_XP ((__u64)0x0000000000004000ULL) /* execute-protect */ -+#define EFI_MEMORY_RUNTIME ((__u64)0x8000000000000000ULL) /* range requires runtime mapping */ - #define EFI_MEMORY_DESCRIPTOR_VERSION 1 - - #define EFI_PAGE_SHIFT 12 -@@ -96,14 +96,14 @@ - * the case in ia64. Need to have this fixed in the f/w. - */ - typedef struct { -- u32 type; -- u32 pad; -- u64 phys_addr; -- u64 virt_addr; -- u64 num_pages; -- u64 attribute; -+ __u32 type; -+ __u32 pad; -+ __u64 phys_addr; -+ __u64 virt_addr; -+ __u64 num_pages; -+ __u64 attribute; - #if defined (__i386__) -- u64 pad1; -+ __u64 pad1; - #endif - } efi_memory_desc_t; - -@@ -117,23 +117,23 @@ - #define EFI_UNSPECIFIED_TIMEZONE 0x07ff - - typedef struct { -- u16 year; -- u8 month; -- u8 day; -- u8 hour; -- u8 minute; -- u8 second; -- u8 pad1; -- u32 nanosecond; -- s16 timezone; -- u8 daylight; -- u8 pad2; -+ __u16 year; -+ __u8 month; -+ __u8 day; -+ __u8 hour; -+ __u8 minute; -+ __u8 second; -+ __u8 pad1; -+ __u32 nanosecond; -+ __s16 timezone; -+ __u8 daylight; -+ __u8 pad2; - } efi_time_t; - - typedef struct { -- u32 resolution; -- u32 accuracy; -- u8 sets_to_zero; -+ __u32 resolution; -+ __u32 accuracy; -+ __u8 sets_to_zero; - } efi_time_cap_t; - - /* -@@ -146,7 +146,7 @@ - /* - * EFI Runtime Services table - */ --#define EFI_RUNTIME_SERVICES_SIGNATURE ((u64)0x5652453544e5552ULL) -+#define EFI_RUNTIME_SERVICES_SIGNATURE ((__u64)0x5652453544e5552ULL) - #define EFI_RUNTIME_SERVICES_REVISION 0x00010000 - - typedef struct { -@@ -169,19 +169,19 @@ - typedef efi_status_t efi_get_wakeup_time_t (efi_bool_t *enabled, efi_bool_t *pending, - efi_time_t *tm); - typedef efi_status_t efi_set_wakeup_time_t (efi_bool_t enabled, efi_time_t *tm); --typedef efi_status_t efi_get_variable_t (efi_char16_t *name, efi_guid_t *vendor, u32 *attr, -+typedef efi_status_t efi_get_variable_t (efi_char16_t *name, efi_guid_t *vendor, __u32 *attr, - unsigned long *data_size, void *data); - typedef efi_status_t efi_get_next_variable_t (unsigned long *name_size, efi_char16_t *name, - efi_guid_t *vendor); - typedef efi_status_t efi_set_variable_t (efi_char16_t *name, efi_guid_t *vendor, - unsigned long attr, unsigned long data_size, - void *data); --typedef efi_status_t efi_get_next_high_mono_count_t (u32 *count); -+typedef efi_status_t efi_get_next_high_mono_count_t (__u32 *count); - typedef void efi_reset_system_t (int reset_type, efi_status_t status, - unsigned long data_size, efi_char16_t *data); - typedef efi_status_t efi_set_virtual_address_map_t (unsigned long memory_map_size, - unsigned long descriptor_size, -- u32 descriptor_version, -+ __u32 descriptor_version, - efi_memory_desc_t *virtual_map); - - /* -@@ -219,13 +219,13 @@ - unsigned long table; - } efi_config_table_t; - --#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) -+#define EFI_SYSTEM_TABLE_SIGNATURE ((__u64)0x5453595320494249ULL) - #define EFI_SYSTEM_TABLE_REVISION ((1 << 16) | 00) - - typedef struct { - efi_table_hdr_t hdr; - unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */ -- u32 fw_revision; -+ __u32 fw_revision; - unsigned long con_in_handle; - unsigned long con_in; - unsigned long con_out_handle; -@@ -293,9 +293,9 @@ - extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg); - extern void efi_gettimeofday (struct timespec *ts); - extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if possible */ --extern u64 efi_get_iobase (void); --extern u32 efi_mem_type (unsigned long phys_addr); --extern u64 efi_mem_attributes (unsigned long phys_addr); -+extern __u64 efi_get_iobase (void); -+extern __u32 efi_mem_type (unsigned long phys_addr); -+extern __u64 efi_mem_attributes (unsigned long phys_addr); - extern int __init efi_uart_console_only (void); - extern void efi_initialize_iomem_resources(struct resource *code_resource, - struct resource *data_resource); -@@ -368,9 +368,9 @@ - #define EFI_DEV_END_ENTIRE 0xFF - - struct efi_generic_dev_path { -- u8 type; -- u8 sub_type; -- u16 length; -+ __u8 type; -+ __u8 sub_type; -+ __u16 length; - } __attribute ((packed)); - - #endif /* _LINUX_EFI_H */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/eisa.h linux-libc-headers-2.6.8.0/include/linux/eisa.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/eisa.h 2003-12-15 12:46:58.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/eisa.h 2004-08-26 05:42:08.000000000 -0500 -@@ -43,7 +43,7 @@ - int state; - unsigned long base_addr; - struct resource res[EISA_MAX_RESOURCES]; -- u64 dma_mask; -+ __u64 dma_mask; - struct device dev; /* generic device */ - #ifdef CONFIG_EISA_NAMES - char pretty_name[DEVICE_NAME_SIZE]; -@@ -91,7 +91,7 @@ - unsigned long bus_base_addr; - int slots; /* Max slot number */ - int force_probe; /* Probe even when no slot 0 */ -- u64 dma_mask; /* from bridge device */ -+ __u64 dma_mask; /* from bridge device */ - int bus_nr; /* Set by eisa_root_register */ - struct resource eisa_root_res; /* ditto */ - }; -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/ethtool.h linux-libc-headers-2.6.8.0/include/linux/ethtool.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/ethtool.h 2004-06-23 16:52:54.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/ethtool.h 2004-08-26 13:29:11.000000000 -0500 -@@ -15,24 +15,24 @@ - - /* This should work for both 32 and 64 bit userland. */ - struct ethtool_cmd { -- u32 cmd; -- u32 supported; /* Features this interface supports */ -- u32 advertising; /* Features this interface advertises */ -- u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */ -- u8 duplex; /* Duplex, half or full */ -- u8 port; /* Which connector port */ -- u8 phy_address; -- u8 transceiver; /* Which transceiver to use */ -- u8 autoneg; /* Enable or disable autonegotiation */ -- u32 maxtxpkt; /* Tx pkts before generating tx int */ -- u32 maxrxpkt; /* Rx pkts before generating rx int */ -- u32 reserved[4]; -+ __u32 cmd; -+ __u32 supported; /* Features this interface supports */ -+ __u32 advertising; /* Features this interface advertises */ -+ __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */ -+ __u8 duplex; /* Duplex, half or full */ -+ __u8 port; /* Which connector port */ -+ __u8 phy_address; -+ __u8 transceiver; /* Which transceiver to use */ -+ __u8 autoneg; /* Enable or disable autonegotiation */ -+ __u32 maxtxpkt; /* Tx pkts before generating tx int */ -+ __u32 maxrxpkt; /* Rx pkts before generating rx int */ -+ __u32 reserved[4]; - }; - - #define ETHTOOL_BUSINFO_LEN 32 - /* these strings are set to whatever the driver author decides... */ - struct ethtool_drvinfo { -- u32 cmd; -+ __u32 cmd; - char driver[32]; /* driver short name, "tulip", "eepro100" */ - char version[32]; /* driver version string */ - char fw_version[32]; /* firmware version string, if applicable */ -@@ -40,53 +40,53 @@ - /* For PCI devices, use pci_name(pci_dev). */ - char reserved1[32]; - char reserved2[16]; -- u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ -- u32 testinfo_len; -- u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ -- u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ -+ __u32 n_stats; /* number of __u64's from ETHTOOL_GSTATS */ -+ __u32 testinfo_len; -+ __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ -+ __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ - }; - - #define SOPASS_MAX 6 - /* wake-on-lan settings */ - struct ethtool_wolinfo { -- u32 cmd; -- u32 supported; -- u32 wolopts; -- u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */ -+ __u32 cmd; -+ __u32 supported; -+ __u32 wolopts; -+ __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */ - }; - - /* for passing single values */ - struct ethtool_value { -- u32 cmd; -- u32 data; -+ __u32 cmd; -+ __u32 data; - }; - - /* for passing big chunks of data */ - struct ethtool_regs { -- u32 cmd; -- u32 version; /* driver-specific, indicates different chips/revs */ -- u32 len; /* bytes */ -- u8 data[0]; -+ __u32 cmd; -+ __u32 version; /* driver-specific, indicates different chips/revs */ -+ __u32 len; /* bytes */ -+ __u8 data[0]; - }; - - /* for passing EEPROM chunks */ - struct ethtool_eeprom { -- u32 cmd; -- u32 magic; -- u32 offset; /* in bytes */ -- u32 len; /* in bytes */ -- u8 data[0]; -+ __u32 cmd; -+ __u32 magic; -+ __u32 offset; /* in bytes */ -+ __u32 len; /* in bytes */ -+ __u8 data[0]; - }; - - /* for configuring coalescing parameters of chip */ - struct ethtool_coalesce { -- u32 cmd; /* ETHTOOL_{G,S}COALESCE */ -+ __u32 cmd; /* ETHTOOL_{G,S}COALESCE */ - - /* How many usecs to delay an RX interrupt after - * a packet arrives. If 0, only rx_max_coalesced_frames - * is used. - */ -- u32 rx_coalesce_usecs; -+ __u32 rx_coalesce_usecs; - - /* How many packets to delay an RX interrupt after - * a packet arrives. If 0, only rx_coalesce_usecs is -@@ -94,21 +94,21 @@ - * to zero as this would cause RX interrupts to never be - * generated. - */ -- u32 rx_max_coalesced_frames; -+ __u32 rx_max_coalesced_frames; - - /* Same as above two parameters, except that these values - * apply while an IRQ is being serviced by the host. Not - * all cards support this feature and the values are ignored - * in that case. - */ -- u32 rx_coalesce_usecs_irq; -- u32 rx_max_coalesced_frames_irq; -+ __u32 rx_coalesce_usecs_irq; -+ __u32 rx_max_coalesced_frames_irq; - - /* How many usecs to delay a TX interrupt after - * a packet is sent. If 0, only tx_max_coalesced_frames - * is used. - */ -- u32 tx_coalesce_usecs; -+ __u32 tx_coalesce_usecs; - - /* How many packets to delay a TX interrupt after - * a packet is sent. If 0, only tx_coalesce_usecs is -@@ -116,22 +116,22 @@ - * to zero as this would cause TX interrupts to never be - * generated. - */ -- u32 tx_max_coalesced_frames; -+ __u32 tx_max_coalesced_frames; - - /* Same as above two parameters, except that these values - * apply while an IRQ is being serviced by the host. Not - * all cards support this feature and the values are ignored - * in that case. - */ -- u32 tx_coalesce_usecs_irq; -- u32 tx_max_coalesced_frames_irq; -+ __u32 tx_coalesce_usecs_irq; -+ __u32 tx_max_coalesced_frames_irq; - - /* How many usecs to delay in-memory statistics - * block updates. Some drivers do not have an in-memory - * statistic block, and in such cases this value is ignored. - * This value must not be zero. - */ -- u32 stats_block_coalesce_usecs; -+ __u32 stats_block_coalesce_usecs; - - /* Adaptive RX/TX coalescing is an algorithm implemented by - * some drivers to improve latency under low packet rates and -@@ -140,18 +140,18 @@ - * not implemented by the driver causes these values to be - * silently ignored. - */ -- u32 use_adaptive_rx_coalesce; -- u32 use_adaptive_tx_coalesce; -+ __u32 use_adaptive_rx_coalesce; -+ __u32 use_adaptive_tx_coalesce; - - /* When the packet rate (measured in packets per second) - * is below pkt_rate_low, the {rx,tx}_*_low parameters are - * used. - */ -- u32 pkt_rate_low; -- u32 rx_coalesce_usecs_low; -- u32 rx_max_coalesced_frames_low; -- u32 tx_coalesce_usecs_low; -- u32 tx_max_coalesced_frames_low; -+ __u32 pkt_rate_low; -+ __u32 rx_coalesce_usecs_low; -+ __u32 rx_max_coalesced_frames_low; -+ __u32 tx_coalesce_usecs_low; -+ __u32 tx_max_coalesced_frames_low; - - /* When the packet rate is below pkt_rate_high but above - * pkt_rate_low (both measured in packets per second) the -@@ -162,43 +162,43 @@ - * is above pkt_rate_high, the {rx,tx}_*_high parameters are - * used. - */ -- u32 pkt_rate_high; -- u32 rx_coalesce_usecs_high; -- u32 rx_max_coalesced_frames_high; -- u32 tx_coalesce_usecs_high; -- u32 tx_max_coalesced_frames_high; -+ __u32 pkt_rate_high; -+ __u32 rx_coalesce_usecs_high; -+ __u32 rx_max_coalesced_frames_high; -+ __u32 tx_coalesce_usecs_high; -+ __u32 tx_max_coalesced_frames_high; - - /* How often to do adaptive coalescing packet rate sampling, - * measured in seconds. Must not be zero. - */ -- u32 rate_sample_interval; -+ __u32 rate_sample_interval; - }; - - /* for configuring RX/TX ring parameters */ - struct ethtool_ringparam { -- u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */ -+ __u32 cmd; /* ETHTOOL_{G,S}RINGPARAM */ - - /* Read only attributes. These indicate the maximum number - * of pending RX/TX ring entries the driver will allow the - * user to set. - */ -- u32 rx_max_pending; -- u32 rx_mini_max_pending; -- u32 rx_jumbo_max_pending; -- u32 tx_max_pending; -+ __u32 rx_max_pending; -+ __u32 rx_mini_max_pending; -+ __u32 rx_jumbo_max_pending; -+ __u32 tx_max_pending; - - /* Values changeable by the user. The valid values are - * in the range 1 to the "*_max_pending" counterpart above. - */ -- u32 rx_pending; -- u32 rx_mini_pending; -- u32 rx_jumbo_pending; -- u32 tx_pending; -+ __u32 rx_pending; -+ __u32 rx_mini_pending; -+ __u32 rx_jumbo_pending; -+ __u32 tx_pending; - }; - - /* for configuring link flow control parameters */ - struct ethtool_pauseparam { -- u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */ -+ __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */ - - /* If the link is being auto-negotiated (via ethtool_cmd.autoneg - * being true) the user may set 'autonet' here non-zero to have the -@@ -210,9 +210,9 @@ - * then {rx,tx}_pause force the driver to use/not-use pause - * flow control. - */ -- u32 autoneg; -- u32 rx_pause; -- u32 tx_pause; -+ __u32 autoneg; -+ __u32 rx_pause; -+ __u32 tx_pause; - }; - - #define ETH_GSTRING_LEN 32 -@@ -223,10 +223,10 @@ - - /* for passing string sets for data tagging */ - struct ethtool_gstrings { -- u32 cmd; /* ETHTOOL_GSTRINGS */ -- u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/ -- u32 len; /* number of strings in the string set */ -- u8 data[0]; -+ __u32 cmd; /* ETHTOOL_GSTRINGS */ -+ __u32 string_set; /* string set id e.c. ETH_SS_TEST, etc*/ -+ __u32 len; /* number of strings in the string set */ -+ __u8 data[0]; - }; - - enum ethtool_test_flags { -@@ -236,30 +236,30 @@ - - /* for requesting NIC test and getting results*/ - struct ethtool_test { -- u32 cmd; /* ETHTOOL_TEST */ -- u32 flags; /* ETH_TEST_FL_xxx */ -- u32 reserved; -- u32 len; /* result length, in number of u64 elements */ -- u64 data[0]; -+ __u32 cmd; /* ETHTOOL_TEST */ -+ __u32 flags; /* ETH_TEST_FL_xxx */ -+ __u32 reserved; -+ __u32 len; /* result length, in number of __u64 elements */ -+ __u64 data[0]; - }; - - /* for dumping NIC-specific statistics */ - struct ethtool_stats { -- u32 cmd; /* ETHTOOL_GSTATS */ -- u32 n_stats; /* number of u64's being returned */ -- u64 data[0]; -+ __u32 cmd; /* ETHTOOL_GSTATS */ -+ __u32 n_stats; /* number of __u64's being returned */ -+ __u64 data[0]; - }; - - struct net_device; - - /* Some generic methods drivers may use in their ethtool_ops */ --u32 ethtool_op_get_link(struct net_device *dev); --u32 ethtool_op_get_tx_csum(struct net_device *dev); --int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); --u32 ethtool_op_get_sg(struct net_device *dev); --int ethtool_op_set_sg(struct net_device *dev, u32 data); --u32 ethtool_op_get_tso(struct net_device *dev); --int ethtool_op_set_tso(struct net_device *dev, u32 data); -+__u32 ethtool_op_get_link(struct net_device *dev); -+__u32 ethtool_op_get_tx_csum(struct net_device *dev); -+int ethtool_op_set_tx_csum(struct net_device *dev, __u32 data); -+__u32 ethtool_op_get_sg(struct net_device *dev); -+int ethtool_op_set_sg(struct net_device *dev, __u32 data); -+__u32 ethtool_op_get_tso(struct net_device *dev); -+int ethtool_op_set_tso(struct net_device *dev, __u32 data); - - /** - * ðtool_ops - Alter and report network device settings -@@ -324,33 +324,33 @@ - void (*get_regs)(struct net_device *, struct ethtool_regs *, void *); - void (*get_wol)(struct net_device *, struct ethtool_wolinfo *); - int (*set_wol)(struct net_device *, struct ethtool_wolinfo *); -- u32 (*get_msglevel)(struct net_device *); -- void (*set_msglevel)(struct net_device *, u32); -+ __u32 (*get_msglevel)(struct net_device *); -+ void (*set_msglevel)(struct net_device *, __u32); - int (*nway_reset)(struct net_device *); -- u32 (*get_link)(struct net_device *); -+ __u32 (*get_link)(struct net_device *); - int (*get_eeprom_len)(struct net_device *); -- int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); -- int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, u8 *); -+ int (*get_eeprom)(struct net_device *, struct ethtool_eeprom *, __u8 *); -+ int (*set_eeprom)(struct net_device *, struct ethtool_eeprom *, __u8 *); - int (*get_coalesce)(struct net_device *, struct ethtool_coalesce *); - int (*set_coalesce)(struct net_device *, struct ethtool_coalesce *); - void (*get_ringparam)(struct net_device *, struct ethtool_ringparam *); - int (*set_ringparam)(struct net_device *, struct ethtool_ringparam *); - void (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*); - int (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*); -- u32 (*get_rx_csum)(struct net_device *); -- int (*set_rx_csum)(struct net_device *, u32); -- u32 (*get_tx_csum)(struct net_device *); -- int (*set_tx_csum)(struct net_device *, u32); -- u32 (*get_sg)(struct net_device *); -- int (*set_sg)(struct net_device *, u32); -- u32 (*get_tso)(struct net_device *); -- int (*set_tso)(struct net_device *, u32); -+ __u32 (*get_rx_csum)(struct net_device *); -+ int (*set_rx_csum)(struct net_device *, __u32); -+ __u32 (*get_tx_csum)(struct net_device *); -+ int (*set_tx_csum)(struct net_device *, __u32); -+ __u32 (*get_sg)(struct net_device *); -+ int (*set_sg)(struct net_device *, __u32); -+ __u32 (*get_tso)(struct net_device *); -+ int (*set_tso)(struct net_device *, __u32); - int (*self_test_count)(struct net_device *); -- void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); -- void (*get_strings)(struct net_device *, u32 stringset, u8 *); -- int (*phys_id)(struct net_device *, u32); -+ void (*self_test)(struct net_device *, struct ethtool_test *, __u64 *); -+ void (*get_strings)(struct net_device *, __u32 stringset, __u8 *); -+ int (*phys_id)(struct net_device *, __u32); - int (*get_stats_count)(struct net_device *); -- void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *); -+ void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, __u64 *); - int (*begin)(struct net_device *); - void (*complete)(struct net_device *); - }; -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/firmware.h linux-libc-headers-2.6.8.0/include/linux/firmware.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/firmware.h 2003-12-15 12:46:58.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/firmware.h 2004-08-26 05:42:08.000000000 -0500 -@@ -5,7 +5,7 @@ - #define FIRMWARE_NAME_MAX 30 - struct firmware { - size_t size; -- u8 *data; -+ __u8 *data; - }; - int request_firmware(const struct firmware **fw, const char *name, - struct device *device); -@@ -15,5 +15,5 @@ - void (*cont)(const struct firmware *fw, void *context)); - - void release_firmware(const struct firmware *fw); --void register_firmware(const char *name, const u8 *data, size_t size); -+void register_firmware(const char *name, const __u8 *data, size_t size); - #endif -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/fs.h linux-libc-headers-2.6.8.0/include/linux/fs.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/fs.h 2004-08-18 13:16:02.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/fs.h 2004-08-26 05:42:08.000000000 -0500 -@@ -198,7 +198,7 @@ - /* A jump here: 108-111 have been used for various private purposes. */ - #define BLKBSZGET _IOR(0x12,112,size_t) - #define BLKBSZSET _IOW(0x12,113,size_t) --#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */ -+#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (__u64 *arg) */ - - #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ - #define FIBMAP _IO(0x00,1) /* bmap access */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/i2c.h linux-libc-headers-2.6.8.0/include/linux/i2c.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/i2c.h 2004-06-23 16:52:54.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/i2c.h 2004-08-26 05:42:08.000000000 -0500 -@@ -70,36 +70,36 @@ - and probably just as fast. - Note that we use i2c_adapter here, because you do not need a specific - smbus adapter to call this function. */ --extern s32 i2c_smbus_xfer (struct i2c_adapter * adapter, u16 addr, -+extern __s32 i2c_smbus_xfer (struct i2c_adapter * adapter, __u16 addr, - unsigned short flags, -- char read_write, u8 command, int size, -+ char read_write, __u8 command, int size, - union i2c_smbus_data * data); - - /* Now follow the 'nice' access routines. These also document the calling - conventions of smbus_access. */ - --extern s32 i2c_smbus_write_quick(struct i2c_client * client, u8 value); --extern s32 i2c_smbus_read_byte(struct i2c_client * client); --extern s32 i2c_smbus_write_byte(struct i2c_client * client, u8 value); --extern s32 i2c_smbus_read_byte_data(struct i2c_client * client, u8 command); --extern s32 i2c_smbus_write_byte_data(struct i2c_client * client, -- u8 command, u8 value); --extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command); --extern s32 i2c_smbus_write_word_data(struct i2c_client * client, -- u8 command, u16 value); --extern s32 i2c_smbus_process_call(struct i2c_client * client, -- u8 command, u16 value); -+extern __s32 i2c_smbus_write_quick(struct i2c_client * client, __u8 value); -+extern __s32 i2c_smbus_read_byte(struct i2c_client * client); -+extern __s32 i2c_smbus_write_byte(struct i2c_client * client, __u8 value); -+extern __s32 i2c_smbus_read_byte_data(struct i2c_client * client, __u8 command); -+extern __s32 i2c_smbus_write_byte_data(struct i2c_client * client, -+ __u8 command, __u8 value); -+extern __s32 i2c_smbus_read_word_data(struct i2c_client * client, __u8 command); -+extern __s32 i2c_smbus_write_word_data(struct i2c_client * client, -+ __u8 command, __u16 value); -+extern __s32 i2c_smbus_process_call(struct i2c_client * client, -+ __u8 command, __u16 value); - /* Returns the number of read bytes */ --extern s32 i2c_smbus_read_block_data(struct i2c_client * client, -- u8 command, u8 *values); --extern s32 i2c_smbus_write_block_data(struct i2c_client * client, -- u8 command, u8 length, -- u8 *values); --extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, -- u8 command, u8 *values); --extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, -- u8 command, u8 length, -- u8 *values); -+extern __s32 i2c_smbus_read_block_data(struct i2c_client * client, -+ __u8 command, __u8 *values); -+extern __s32 i2c_smbus_write_block_data(struct i2c_client * client, -+ __u8 command, __u8 length, -+ __u8 *values); -+extern __s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, -+ __u8 command, __u8 *values); -+extern __s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, -+ __u8 command, __u8 length, -+ __u8 *values); - - - /* -@@ -203,9 +203,9 @@ - using common I2C messages */ - int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg msgs[], - int num); -- int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, -+ int (*smbus_xfer) (struct i2c_adapter *adap, __u16 addr, - unsigned short flags, char read_write, -- u8 command, int size, union i2c_smbus_data * data); -+ __u8 command, int size, union i2c_smbus_data * data); - - /* --- these optional/future use for some adapter types.*/ - int (*slave_send)(struct i2c_adapter *,char*,int); -@@ -215,7 +215,7 @@ - int (*algo_control)(struct i2c_adapter *, unsigned int, unsigned long); - - /* To determine what the adapter supports */ -- u32 (*functionality) (struct i2c_adapter *); -+ __u32 (*functionality) (struct i2c_adapter *); - }; - - /* -@@ -381,10 +381,10 @@ - - - /* Return the functionality mask */ --extern u32 i2c_get_functionality (struct i2c_adapter *adap); -+extern __u32 i2c_get_functionality (struct i2c_adapter *adap); - - /* Return 1 if adapter supports everything we need, 0 if not. */ --extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func); -+extern int i2c_check_functionality (struct i2c_adapter *adap, __u32 func); - - /* - * I2C Message - used for pure i2c transaction, also from /dev interface -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/i2o-dev.h linux-libc-headers-2.6.8.0/include/linux/i2o-dev.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/i2o-dev.h 2004-06-23 16:52:54.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/i2o-dev.h 2004-08-26 05:42:08.000000000 -0500 -@@ -29,7 +29,7 @@ - * I2O Control IOCTLs and structures - */ - #define I2O_MAGIC_NUMBER 'i' --#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,u8[MAX_I2O_CONTROLLERS]) -+#define I2OGETIOPS _IOR(I2O_MAGIC_NUMBER,0,__u8[MAX_I2O_CONTROLLERS]) - #define I2OHRTGET _IOWR(I2O_MAGIC_NUMBER,1,struct i2o_cmd_hrtlct) - #define I2OLCTGET _IOWR(I2O_MAGIC_NUMBER,2,struct i2o_cmd_hrtlct) - #define I2OPARMSET _IOWR(I2O_MAGIC_NUMBER,3,struct i2o_cmd_psetget) -@@ -37,7 +37,7 @@ - #define I2OSWDL _IOWR(I2O_MAGIC_NUMBER,5,struct i2o_sw_xfer) - #define I2OSWUL _IOWR(I2O_MAGIC_NUMBER,6,struct i2o_sw_xfer) - #define I2OSWDEL _IOWR(I2O_MAGIC_NUMBER,7,struct i2o_sw_xfer) --#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,u32) -+#define I2OVALIDATE _IOR(I2O_MAGIC_NUMBER,8,__u32) - #define I2OHTML _IOWR(I2O_MAGIC_NUMBER,9,struct i2o_html) - #define I2OEVTREG _IOW(I2O_MAGIC_NUMBER,10,struct i2o_evt_id) - #define I2OEVTGET _IOR(I2O_MAGIC_NUMBER,11,struct i2o_evt_info) -@@ -129,65 +129,65 @@ - #define I2O_BUS_CARDBUS 7 - #define I2O_BUS_UNKNOWN 0x80 - --typedef unsigned char u8; --typedef unsigned short u16; --typedef unsigned int u32; -+typedef unsigned char __u8; -+typedef unsigned short __u16; -+typedef unsigned int __u32; - - typedef struct _i2o_pci_bus - { -- u8 PciFunctionNumber; -- u8 PciDeviceNumber; -- u8 PciBusNumber; -- u8 reserved; -- u16 PciVendorID; -- u16 PciDeviceID; -+ __u8 PciFunctionNumber; -+ __u8 PciDeviceNumber; -+ __u8 PciBusNumber; -+ __u8 reserved; -+ __u16 PciVendorID; -+ __u16 PciDeviceID; - } i2o_pci_bus; - - typedef struct _i2o_local_bus - { -- u16 LbBaseIOPort; -- u16 reserved; -- u32 LbBaseMemoryAddress; -+ __u16 LbBaseIOPort; -+ __u16 reserved; -+ __u32 LbBaseMemoryAddress; - } i2o_local_bus; - - typedef struct _i2o_isa_bus - { -- u16 IsaBaseIOPort; -- u8 CSN; -- u8 reserved; -- u32 IsaBaseMemoryAddress; -+ __u16 IsaBaseIOPort; -+ __u8 CSN; -+ __u8 reserved; -+ __u32 IsaBaseMemoryAddress; - } i2o_isa_bus; - - typedef struct _i2o_eisa_bus_info - { -- u16 EisaBaseIOPort; -- u8 reserved; -- u8 EisaSlotNumber; -- u32 EisaBaseMemoryAddress; -+ __u16 EisaBaseIOPort; -+ __u8 reserved; -+ __u8 EisaSlotNumber; -+ __u32 EisaBaseMemoryAddress; - } i2o_eisa_bus; - - typedef struct _i2o_mca_bus - { -- u16 McaBaseIOPort; -- u8 reserved; -- u8 McaSlotNumber; -- u32 McaBaseMemoryAddress; -+ __u16 McaBaseIOPort; -+ __u8 reserved; -+ __u8 McaSlotNumber; -+ __u32 McaBaseMemoryAddress; - } i2o_mca_bus; - - typedef struct _i2o_other_bus - { -- u16 BaseIOPort; -- u16 reserved; -- u32 BaseMemoryAddress; -+ __u16 BaseIOPort; -+ __u16 reserved; -+ __u32 BaseMemoryAddress; - } i2o_other_bus; - - typedef struct _i2o_hrt_entry - { -- u32 adapter_id; -- u32 parent_tid:12; -- u32 state:4; -- u32 bus_num:8; -- u32 bus_type:8; -+ __u32 adapter_id; -+ __u32 parent_tid:12; -+ __u32 state:4; -+ __u32 bus_num:8; -+ __u32 bus_type:8; - union - { - i2o_pci_bus pci_bus; -@@ -201,69 +201,69 @@ - - typedef struct _i2o_hrt - { -- u16 num_entries; -- u8 entry_len; -- u8 hrt_version; -- u32 change_ind; -+ __u16 num_entries; -+ __u8 entry_len; -+ __u8 hrt_version; -+ __u32 change_ind; - i2o_hrt_entry hrt_entry[1]; - } i2o_hrt; - - typedef struct _i2o_lct_entry - { -- u32 entry_size:16; -- u32 tid:12; -- u32 reserved:4; -- u32 change_ind; -- u32 device_flags; -- u32 class_id:12; -- u32 version:4; -- u32 vendor_id:16; -- u32 sub_class; -- u32 user_tid:12; -- u32 parent_tid:12; -- u32 bios_info:8; -- u8 identity_tag[8]; -- u32 event_capabilities; -+ __u32 entry_size:16; -+ __u32 tid:12; -+ __u32 reserved:4; -+ __u32 change_ind; -+ __u32 device_flags; -+ __u32 class_id:12; -+ __u32 version:4; -+ __u32 vendor_id:16; -+ __u32 sub_class; -+ __u32 user_tid:12; -+ __u32 parent_tid:12; -+ __u32 bios_info:8; -+ __u8 identity_tag[8]; -+ __u32 event_capabilities; - } i2o_lct_entry; - - typedef struct _i2o_lct - { -- u32 table_size:16; -- u32 boot_tid:12; -- u32 lct_ver:4; -- u32 iop_flags; -- u32 change_ind; -+ __u32 table_size:16; -+ __u32 boot_tid:12; -+ __u32 lct_ver:4; -+ __u32 iop_flags; -+ __u32 change_ind; - i2o_lct_entry lct_entry[1]; - } i2o_lct; - - typedef struct _i2o_status_block - { -- u16 org_id; -- u16 reserved; -- u16 iop_id:12; -- u16 reserved1:4; -- u16 host_unit_id; -- u16 segment_number:12; -- u16 i2o_version:4; -- u8 iop_state; -- u8 msg_type; -- u16 inbound_frame_size; -- u8 init_code; -- u8 reserved2; -- u32 max_inbound_frames; -- u32 cur_inbound_frames; -- u32 max_outbound_frames; -+ __u16 org_id; -+ __u16 reserved; -+ __u16 iop_id:12; -+ __u16 reserved1:4; -+ __u16 host_unit_id; -+ __u16 segment_number:12; -+ __u16 i2o_version:4; -+ __u8 iop_state; -+ __u8 msg_type; -+ __u16 inbound_frame_size; -+ __u8 init_code; -+ __u8 reserved2; -+ __u32 max_inbound_frames; -+ __u32 cur_inbound_frames; -+ __u32 max_outbound_frames; - char product_id[24]; -- u32 expected_lct_size; -- u32 iop_capabilities; -- u32 desired_mem_size; -- u32 current_mem_size; -- u32 current_mem_base; -- u32 desired_io_size; -- u32 current_io_size; -- u32 current_io_base; -- u32 reserved3:24; -- u32 cmd_status:8; -+ __u32 expected_lct_size; -+ __u32 iop_capabilities; -+ __u32 desired_mem_size; -+ __u32 current_mem_size; -+ __u32 current_mem_base; -+ __u32 desired_io_size; -+ __u32 current_io_size; -+ __u32 current_io_base; -+ __u32 reserved3:24; -+ __u32 cmd_status:8; - } i2o_status_block; - - /* Event indicator mask flags */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/isdn/capilli.h linux-libc-headers-2.6.8.0/include/linux/isdn/capilli.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/isdn/capilli.h 2004-03-28 07:52:12.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/isdn/capilli.h 2004-08-26 13:26:47.000000000 -0500 -@@ -43,20 +43,20 @@ - char *driver_name; /* name of driver */ - int (*load_firmware)(struct capi_ctr *, capiloaddata *); - void (*reset_ctr)(struct capi_ctr *); -- void (*register_appl)(struct capi_ctr *, u16 appl, -+ void (*register_appl)(struct capi_ctr *, __u16 appl, - capi_register_params *); -- void (*release_appl)(struct capi_ctr *, u16 appl); -- u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb); -+ void (*release_appl)(struct capi_ctr *, __u16 appl); -+ __u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb); - - char *(*procinfo)(struct capi_ctr *); - int (*ctr_read_proc)(char *page, char **start, off_t off, - int count, int *eof, struct capi_ctr *card); - - /* filled in before calling ready callback */ -- u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */ -+ __u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */ - capi_version version; /* CAPI_GET_VERSION */ - capi_profile profile; /* CAPI_GET_PROFILE */ -- u8 serial[CAPI_SERIAL_LEN]; /* CAPI_GET_SERIAL */ -+ __u8 serial[CAPI_SERIAL_LEN]; /* CAPI_GET_SERIAL */ - - /* management information for kcapi */ - -@@ -81,7 +81,7 @@ - void capi_ctr_reseted(struct capi_ctr * card); - void capi_ctr_suspend_output(struct capi_ctr * card); - void capi_ctr_resume_output(struct capi_ctr * card); --void capi_ctr_handle_message(struct capi_ctr * card, u16 appl, struct sk_buff *skb); -+void capi_ctr_handle_message(struct capi_ctr * card, __u16 appl, struct sk_buff *skb); - - // --------------------------------------------------------------------------- - // needed for AVM capi drivers -@@ -102,11 +102,11 @@ - // --------------------------------------------------------------------------- - // library functions for use by hardware controller drivers - --void capilib_new_ncci(struct list_head *head, u16 applid, u32 ncci, u32 winsize); --void capilib_free_ncci(struct list_head *head, u16 applid, u32 ncci); --void capilib_release_appl(struct list_head *head, u16 applid); -+void capilib_new_ncci(struct list_head *head, __u16 applid, __u32 ncci, __u32 winsize); -+void capilib_free_ncci(struct list_head *head, __u16 applid, __u32 ncci); -+void capilib_release_appl(struct list_head *head, __u16 applid); - void capilib_release(struct list_head *head); --void capilib_data_b3_conf(struct list_head *head, u16 applid, u32 ncci, u16 msgid); --u16 capilib_data_b3_req(struct list_head *head, u16 applid, u32 ncci, u16 msgid); -+void capilib_data_b3_conf(struct list_head *head, __u16 applid, __u32 ncci, __u16 msgid); -+__u16 capilib_data_b3_req(struct list_head *head, __u16 applid, __u32 ncci, __u16 msgid); - - #endif /* __CAPILLI_H__ */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/jhash.h linux-libc-headers-2.6.8.0/include/linux/jhash.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/jhash.h 2004-03-28 07:52:09.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/jhash.h 2004-08-26 05:42:08.000000000 -0500 -@@ -41,19 +41,19 @@ - * of bytes. No alignment or length assumptions are made about - * the input key. - */ --static inline u32 jhash(const void *key, u32 length, u32 initval) -+static inline __u32 jhash(const void *key, __u32 length, __u32 initval) - { -- u32 a, b, c, len; -- const u8 *k = key; -+ __u32 a, b, c, len; -+ const __u8 *k = key; - - len = length; - a = b = JHASH_GOLDEN_RATIO; - c = initval; - - while (len >= 12) { -- a += (k[0] +((u32)k[1]<<8) +((u32)k[2]<<16) +((u32)k[3]<<24)); -- b += (k[4] +((u32)k[5]<<8) +((u32)k[6]<<16) +((u32)k[7]<<24)); -- c += (k[8] +((u32)k[9]<<8) +((u32)k[10]<<16)+((u32)k[11]<<24)); -+ a += (k[0] +((__u32)k[1]<<8) +((__u32)k[2]<<16) +((__u32)k[3]<<24)); -+ b += (k[4] +((__u32)k[5]<<8) +((__u32)k[6]<<16) +((__u32)k[7]<<24)); -+ c += (k[8] +((__u32)k[9]<<8) +((__u32)k[10]<<16)+((__u32)k[11]<<24)); - - __jhash_mix(a,b,c); - -@@ -63,16 +63,16 @@ - - c += length; - switch (len) { -- case 11: c += ((u32)k[10]<<24); -- case 10: c += ((u32)k[9]<<16); -- case 9 : c += ((u32)k[8]<<8); -- case 8 : b += ((u32)k[7]<<24); -- case 7 : b += ((u32)k[6]<<16); -- case 6 : b += ((u32)k[5]<<8); -+ case 11: c += ((__u32)k[10]<<24); -+ case 10: c += ((__u32)k[9]<<16); -+ case 9 : c += ((__u32)k[8]<<8); -+ case 8 : b += ((__u32)k[7]<<24); -+ case 7 : b += ((__u32)k[6]<<16); -+ case 6 : b += ((__u32)k[5]<<8); - case 5 : b += k[4]; -- case 4 : a += ((u32)k[3]<<24); -- case 3 : a += ((u32)k[2]<<16); -- case 2 : a += ((u32)k[1]<<8); -+ case 4 : a += ((__u32)k[3]<<24); -+ case 3 : a += ((__u32)k[2]<<16); -+ case 2 : a += ((__u32)k[1]<<8); - case 1 : a += k[0]; - }; - -@@ -81,12 +81,12 @@ - return c; - } - --/* A special optimized version that handles 1 or more of u32s. -- * The length parameter here is the number of u32s in the key. -+/* A special optimized version that handles 1 or more of __u32s. -+ * The length parameter here is the number of __u32s in the key. - */ --static inline u32 jhash2(u32 *k, u32 length, u32 initval) -+static inline __u32 jhash2(__u32 *k, __u32 length, __u32 initval) - { -- u32 a, b, c, len; -+ __u32 a, b, c, len; - - a = b = JHASH_GOLDEN_RATIO; - c = initval; -@@ -119,7 +119,7 @@ - * NOTE: In partilar the "c += length; __jhash_mix(a,b,c);" normally - * done at the end is not done here. - */ --static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval) -+static inline __u32 jhash_3words(__u32 a, __u32 b, __u32 c, __u32 initval) - { - a += JHASH_GOLDEN_RATIO; - b += JHASH_GOLDEN_RATIO; -@@ -130,12 +130,12 @@ - return c; - } - --static inline u32 jhash_2words(u32 a, u32 b, u32 initval) -+static inline __u32 jhash_2words(__u32 a, __u32 b, __u32 initval) - { - return jhash_3words(a, b, 0, initval); - } - --static inline u32 jhash_1word(u32 a, u32 initval) -+static inline __u32 jhash_1word(__u32 a, __u32 initval) - { - return jhash_3words(a, 0, 0, initval); - } -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/jiffies.h linux-libc-headers-2.6.8.0/include/linux/jiffies.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/jiffies.h 2004-01-17 17:04:30.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/jiffies.h 2004-08-26 13:26:33.000000000 -0500 -@@ -12,15 +12,15 @@ - * without sampling the sequence number in xtime_lock. - * get_jiffies_64() will do this for you as appropriate. - */ --extern u64 jiffies_64; -+extern __u64 jiffies_64; - extern unsigned long volatile jiffies; - - #if (BITS_PER_LONG < 64) --u64 get_jiffies_64(void); -+__u64 get_jiffies_64(void); - #else --static inline u64 get_jiffies_64(void) -+static inline __u64 get_jiffies_64(void) - { -- return (u64)jiffies; -+ return (__u64)jiffies; - } - #endif - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/kernel_stat.h linux-libc-headers-2.6.8.0/include/linux/kernel_stat.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/kernel_stat.h 2004-04-19 16:13:51.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/kernel_stat.h 2004-08-26 05:42:08.000000000 -0500 -@@ -12,13 +12,13 @@ - */ - - struct cpu_usage_stat { -- u64 user; -- u64 nice; -- u64 system; -- u64 softirq; -- u64 irq; -- u64 idle; -- u64 iowait; -+ __u64 user; -+ __u64 nice; -+ __u64 system; -+ __u64 softirq; -+ __u64 irq; -+ __u64 idle; -+ __u64 iowait; - }; - - struct kernel_stat { -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/libata.h linux-libc-headers-2.6.8.0/include/linux/libata.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/libata.h 2004-08-18 13:16:03.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/libata.h 2004-08-26 05:42:08.000000000 -0500 -@@ -160,7 +160,7 @@ - struct ata_queued_cmd; - - /* typedefs */ --typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, u8 drv_stat); -+typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, __u8 drv_stat); - - struct ata_ioports { - unsigned long cmd_addr; -@@ -246,18 +246,18 @@ - }; - - struct ata_device { -- u64 n_sectors; /* size of device, if ATA */ -+ __u64 n_sectors; /* size of device, if ATA */ - unsigned long flags; /* ATA_DFLAG_xxx */ - unsigned int class; /* ATA_DEV_xxx */ - unsigned int devno; /* 0 or 1 */ -- u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ -+ __u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ - unsigned int pio_mode; - unsigned int udma_mode; - - /* cache info about current transfer mode */ -- u8 xfer_protocol; /* taskfile xfer protocol */ -- u8 read_cmd; /* opcode to use on read */ -- u8 write_cmd; /* opcode to use on write */ -+ __u8 xfer_protocol; /* taskfile xfer protocol */ -+ __u8 read_cmd; /* opcode to use on read */ -+ __u8 write_cmd; /* opcode to use on write */ - }; - - struct ata_port { -@@ -272,8 +272,8 @@ - - struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */ - -- u8 ctl; /* cache of ATA control register */ -- u8 last_ctl; /* Cache last written value */ -+ __u8 ctl; /* cache of ATA control register */ -+ __u8 last_ctl; /* Cache last written value */ - unsigned int bus_state; - unsigned int port_state; - unsigned int pio_mask; -@@ -312,7 +312,7 @@ - void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); - - void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); -- u8 (*check_status)(struct ata_port *ap); -+ __u8 (*check_status)(struct ata_port *ap); - - void (*phy_reset) (struct ata_port *ap); - void (*post_set_mode) (struct ata_port *ap); -@@ -328,9 +328,9 @@ - irqreturn_t (*irq_handler)(int, void *, struct pt_regs *); - void (*irq_clear) (struct ata_port *); - -- u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); -+ __u32 (*scr_read) (struct ata_port *ap, unsigned int sc_reg); - void (*scr_write) (struct ata_port *ap, unsigned int sc_reg, -- u32 val); -+ __u32 val); - - int (*port_start) (struct ata_port *ap); - void (*port_stop) (struct ata_port *ap); -@@ -374,10 +374,10 @@ - extern void ata_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf); - extern void ata_tf_read_pio(struct ata_port *ap, struct ata_taskfile *tf); - extern void ata_tf_read_mmio(struct ata_port *ap, struct ata_taskfile *tf); --extern void ata_tf_to_fis(struct ata_taskfile *tf, u8 *fis, u8 pmp); --extern void ata_tf_from_fis(u8 *fis, struct ata_taskfile *tf); --extern u8 ata_check_status_pio(struct ata_port *ap); --extern u8 ata_check_status_mmio(struct ata_port *ap); -+extern void ata_tf_to_fis(struct ata_taskfile *tf, __u8 *fis, __u8 pmp); -+extern void ata_tf_from_fis(__u8 *fis, struct ata_taskfile *tf); -+extern __u8 ata_check_status_pio(struct ata_port *ap); -+extern __u8 ata_check_status_mmio(struct ata_port *ap); - extern void ata_exec_command_pio(struct ata_port *ap, struct ata_taskfile *tf); - extern void ata_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf); - extern int ata_port_start (struct ata_port *ap); -@@ -397,7 +397,7 @@ - extern void ata_bmdma_start_pio (struct ata_queued_cmd *qc); - extern void ata_bmdma_irq_clear(struct ata_port *ap); - extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); --extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat); -+extern void ata_qc_complete(struct ata_queued_cmd *qc, __u8 drv_stat); - extern void ata_eng_timeout(struct ata_port *ap); - extern int ata_std_bios_param(struct scsi_device *sdev, - struct block_device *bdev, -@@ -416,7 +416,7 @@ - (dev->class == ATA_DEV_ATAPI)); - } - --static inline u8 ata_chk_err(struct ata_port *ap) -+static inline __u8 ata_chk_err(struct ata_port *ap) - { - if (ap->flags & ATA_FLAG_MMIO) { - return readb((void *) ap->ioaddr.error_addr); -@@ -424,12 +424,12 @@ - return inb(ap->ioaddr.error_addr); - } - --static inline u8 ata_chk_status(struct ata_port *ap) -+static inline __u8 ata_chk_status(struct ata_port *ap) - { - return ap->ops->check_status(ap); - } - --static inline u8 ata_altstatus(struct ata_port *ap) -+static inline __u8 ata_altstatus(struct ata_port *ap) - { - if (ap->flags & ATA_FLAG_MMIO) - return readb(ap->ioaddr.altstatus_addr); -@@ -442,10 +442,10 @@ - ndelay(400); - } - --static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, -+static inline __u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, - unsigned int max) - { -- u8 status; -+ __u8 status; - - do { - udelay(10); -@@ -456,9 +456,9 @@ - return status; - } - --static inline u8 ata_wait_idle(struct ata_port *ap) -+static inline __u8 ata_wait_idle(struct ata_port *ap) - { -- u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); -+ __u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); - - if (status & (ATA_BUSY | ATA_DRQ)) { - unsigned long l = ap->ioaddr.status_addr; -@@ -495,10 +495,10 @@ - tf->device = ATA_DEVICE_OBS | ATA_DEV1; - } - --static inline u8 ata_irq_on(struct ata_port *ap) -+static inline __u8 ata_irq_on(struct ata_port *ap) - { - struct ata_ioports *ioaddr = &ap->ioaddr; -- u8 tmp; -+ __u8 tmp; - - ap->ctl &= ~ATA_NIEN; - ap->last_ctl = ap->ctl; -@@ -514,10 +514,10 @@ - return tmp; - } - --static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) -+static inline __u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) - { - unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY; -- u8 host_stat, post_stat, status; -+ __u8 host_stat, post_stat, status; - - status = ata_busy_wait(ap, bits, 1000); - if (status & bits) -@@ -545,12 +545,12 @@ - return status; - } - --static inline u32 scr_read(struct ata_port *ap, unsigned int reg) -+static inline __u32 scr_read(struct ata_port *ap, unsigned int reg) - { - return ap->ops->scr_read(ap, reg); - } - --static inline void scr_write(struct ata_port *ap, unsigned int reg, u32 val) -+static inline void scr_write(struct ata_port *ap, unsigned int reg, __u32 val) - { - ap->ops->scr_write(ap, reg, val); - } -@@ -589,9 +589,9 @@ - } - } - --static inline u8 ata_bmdma_status(struct ata_port *ap) -+static inline __u8 ata_bmdma_status(struct ata_port *ap) - { -- u8 host_stat; -+ __u8 host_stat; - if (ap->flags & ATA_FLAG_MMIO) { - void *mmio = (void *) ap->ioaddr.bmdma_addr; - host_stat = readb(mmio + ATA_DMA_STATUS); -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/lockd/bind.h linux-libc-headers-2.6.8.0/include/linux/lockd/bind.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/lockd/bind.h 2003-12-15 12:46:58.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/lockd/bind.h 2004-08-26 05:42:08.000000000 -0500 -@@ -18,7 +18,7 @@ - * This is the set of functions for lockd->nfsd communication - */ - struct nlmsvc_binding { -- u32 (*fopen)(struct svc_rqst *, -+ __u32 (*fopen)(struct svc_rqst *, - struct nfs_fh *, - struct file *); - void (*fclose)(struct file *); -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/lockd/nlm.h linux-libc-headers-2.6.8.0/include/linux/lockd/nlm.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/lockd/nlm.h 2004-01-17 17:04:34.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/lockd/nlm.h 2004-08-26 05:42:08.000000000 -0500 -@@ -11,8 +11,8 @@ - - - /* Maximum file offset in file_lock.fl_end */ --# define NLM_OFFSET_MAX ((s32) 0x7fffffff) --# define NLM4_OFFSET_MAX ((s64) ((~(u64)0) >> 1)) -+# define NLM_OFFSET_MAX ((__s32) 0x7fffffff) -+# define NLM4_OFFSET_MAX ((__s64) ((~(__u64)0) >> 1)) - - /* Return states for NLM */ - enum { -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/lockd/share.h linux-libc-headers-2.6.8.0/include/linux/lockd/share.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/lockd/share.h 2003-12-15 12:46:58.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/lockd/share.h 2004-08-26 13:26:43.000000000 -0500 -@@ -17,13 +17,13 @@ - struct nlm_host * s_host; /* client host */ - struct nlm_file * s_file; /* shared file */ - struct xdr_netobj s_owner; /* owner handle */ -- u32 s_access; /* access mode */ -- u32 s_mode; /* deny mode */ -+ __u32 s_access; /* access mode */ -+ __u32 s_mode; /* deny mode */ - }; - --u32 nlmsvc_share_file(struct nlm_host *, struct nlm_file *, -+__u32 nlmsvc_share_file(struct nlm_host *, struct nlm_file *, - struct nlm_args *); --u32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *, -+__u32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *, - struct nlm_args *); - int nlmsvc_traverse_shares(struct nlm_host *, struct nlm_file *, int); - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/lockd/sm_inter.h linux-libc-headers-2.6.8.0/include/linux/lockd/sm_inter.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/lockd/sm_inter.h 2003-12-15 12:46:58.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/lockd/sm_inter.h 2004-08-26 05:42:08.000000000 -0500 -@@ -24,23 +24,23 @@ - * Arguments for all calls to statd - */ - struct nsm_args { -- u32 addr; /* remote address */ -- u32 prog; /* RPC callback info */ -- u32 vers; -- u32 proc; -- u32 proto; /* protocol (udp/tcp) plus server/client flag */ -+ __u32 addr; /* remote address */ -+ __u32 prog; /* RPC callback info */ -+ __u32 vers; -+ __u32 proc; -+ __u32 proto; /* protocol (udp/tcp) plus server/client flag */ - }; - - /* - * Result returned by statd - */ - struct nsm_res { -- u32 status; -- u32 state; -+ __u32 status; -+ __u32 state; - }; - - int nsm_monitor(struct nlm_host *); - int nsm_unmonitor(struct nlm_host *); --extern u32 nsm_local_state; -+extern __u32 nsm_local_state; - - #endif /* LINUX_LOCKD_SM_INTER_H */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/lockd/xdr.h linux-libc-headers-2.6.8.0/include/linux/lockd/xdr.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/lockd/xdr.h 2004-01-05 12:42:33.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/lockd/xdr.h 2004-08-26 05:42:08.000000000 -0500 -@@ -48,12 +48,12 @@ - struct nlm_args { - struct nlm_cookie cookie; - struct nlm_lock lock; -- u32 block; -- u32 reclaim; -- u32 state; -- u32 monitor; -- u32 fsm_access; -- u32 fsm_mode; -+ __u32 block; -+ __u32 reclaim; -+ __u32 state; -+ __u32 monitor; -+ __u32 fsm_access; -+ __u32 fsm_mode; - }; - - typedef struct nlm_args nlm_args; -@@ -63,7 +63,7 @@ - */ - struct nlm_res { - struct nlm_cookie cookie; -- u32 status; -+ __u32 status; - struct nlm_lock lock; - }; - -@@ -73,10 +73,10 @@ - struct nlm_reboot { - char * mon; - int len; -- u32 state; -- u32 addr; -- u32 vers; -- u32 proto; -+ __u32 state; -+ __u32 addr; -+ __u32 vers; -+ __u32 proto; - }; - - /* -@@ -84,24 +84,24 @@ - */ - #define NLMSVC_XDRSIZE sizeof(struct nlm_args) - --int nlmsvc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *); --int nlmsvc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *); --int nlmsvc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *); --int nlmsvc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *); --int nlmsvc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *); --int nlmsvc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *); --int nlmsvc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *); --int nlmsvc_encode_void(struct svc_rqst *, u32 *, void *); --int nlmsvc_decode_void(struct svc_rqst *, u32 *, void *); --int nlmsvc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *); --int nlmsvc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *); --int nlmsvc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *); --int nlmsvc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *); -+int nlmsvc_decode_testargs(struct svc_rqst *, __u32 *, struct nlm_args *); -+int nlmsvc_encode_testres(struct svc_rqst *, __u32 *, struct nlm_res *); -+int nlmsvc_decode_lockargs(struct svc_rqst *, __u32 *, struct nlm_args *); -+int nlmsvc_decode_cancargs(struct svc_rqst *, __u32 *, struct nlm_args *); -+int nlmsvc_decode_unlockargs(struct svc_rqst *, __u32 *, struct nlm_args *); -+int nlmsvc_encode_res(struct svc_rqst *, __u32 *, struct nlm_res *); -+int nlmsvc_decode_res(struct svc_rqst *, __u32 *, struct nlm_res *); -+int nlmsvc_encode_void(struct svc_rqst *, __u32 *, void *); -+int nlmsvc_decode_void(struct svc_rqst *, __u32 *, void *); -+int nlmsvc_decode_shareargs(struct svc_rqst *, __u32 *, struct nlm_args *); -+int nlmsvc_encode_shareres(struct svc_rqst *, __u32 *, struct nlm_res *); -+int nlmsvc_decode_notify(struct svc_rqst *, __u32 *, struct nlm_args *); -+int nlmsvc_decode_reboot(struct svc_rqst *, __u32 *, struct nlm_reboot *); - /* --int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *); --int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *); --int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *); --int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *); -+int nlmclt_encode_testargs(struct rpc_rqst *, __u32 *, struct nlm_args *); -+int nlmclt_encode_lockargs(struct rpc_rqst *, __u32 *, struct nlm_args *); -+int nlmclt_encode_cancargs(struct rpc_rqst *, __u32 *, struct nlm_args *); -+int nlmclt_encode_unlockargs(struct rpc_rqst *, __u32 *, struct nlm_args *); - */ - - #endif /* LOCKD_XDR_H */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/lockd/xdr4.h linux-libc-headers-2.6.8.0/include/linux/lockd/xdr4.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/lockd/xdr4.h 2004-01-05 12:42:33.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/lockd/xdr4.h 2004-08-26 05:42:08.000000000 -0500 -@@ -22,24 +22,24 @@ - - - --int nlm4svc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *); --int nlm4svc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *); --int nlm4svc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *); --int nlm4svc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *); --int nlm4svc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *); --int nlm4svc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *); --int nlm4svc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *); --int nlm4svc_encode_void(struct svc_rqst *, u32 *, void *); --int nlm4svc_decode_void(struct svc_rqst *, u32 *, void *); --int nlm4svc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *); --int nlm4svc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *); --int nlm4svc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *); --int nlm4svc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *); -+int nlm4svc_decode_testargs(struct svc_rqst *, __u32 *, struct nlm_args *); -+int nlm4svc_encode_testres(struct svc_rqst *, __u32 *, struct nlm_res *); -+int nlm4svc_decode_lockargs(struct svc_rqst *, __u32 *, struct nlm_args *); -+int nlm4svc_decode_cancargs(struct svc_rqst *, __u32 *, struct nlm_args *); -+int nlm4svc_decode_unlockargs(struct svc_rqst *, __u32 *, struct nlm_args *); -+int nlm4svc_encode_res(struct svc_rqst *, __u32 *, struct nlm_res *); -+int nlm4svc_decode_res(struct svc_rqst *, __u32 *, struct nlm_res *); -+int nlm4svc_encode_void(struct svc_rqst *, __u32 *, void *); -+int nlm4svc_decode_void(struct svc_rqst *, __u32 *, void *); -+int nlm4svc_decode_shareargs(struct svc_rqst *, __u32 *, struct nlm_args *); -+int nlm4svc_encode_shareres(struct svc_rqst *, __u32 *, struct nlm_res *); -+int nlm4svc_decode_notify(struct svc_rqst *, __u32 *, struct nlm_args *); -+int nlm4svc_decode_reboot(struct svc_rqst *, __u32 *, struct nlm_reboot *); - /* --int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *); --int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *); --int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *); --int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *); -+int nlmclt_encode_testargs(struct rpc_rqst *, __u32 *, struct nlm_args *); -+int nlmclt_encode_lockargs(struct rpc_rqst *, __u32 *, struct nlm_args *); -+int nlmclt_encode_cancargs(struct rpc_rqst *, __u32 *, struct nlm_args *); -+int nlmclt_encode_unlockargs(struct rpc_rqst *, __u32 *, struct nlm_args *); - */ - - #endif /* LOCKD_XDR4_H */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/mca.h linux-libc-headers-2.6.8.0/include/linux/mca.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/mca.h 2004-08-18 13:16:03.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/mca.h 2004-08-26 05:42:08.000000000 -0500 -@@ -50,7 +50,7 @@ - }; - - struct mca_device { -- u64 dma_mask; -+ __u64 dma_mask; - int pos_id; - int slot; - -@@ -91,7 +91,7 @@ - }; - - struct mca_bus { -- u64 default_dma_mask; -+ __u64 default_dma_mask; - int number; - struct mca_bus_accessor_functions f; - struct device dev; -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/mii.h linux-libc-headers-2.6.8.0/include/linux/mii.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/mii.h 2004-06-23 16:52:55.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/mii.h 2004-08-26 05:42:08.000000000 -0500 -@@ -138,10 +138,10 @@ - - /* This structure is used in all SIOCxMIIxxx ioctl calls */ - struct mii_ioctl_data { -- u16 phy_id; -- u16 reg_num; -- u16 val_in; -- u16 val_out; -+ __u16 phy_id; -+ __u16 reg_num; -+ __u16 val_in; -+ __u16 val_out; - }; - - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/mtd/map.h linux-libc-headers-2.6.8.0/include/linux/mtd/map.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/mtd/map.h 2004-08-18 13:16:06.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/mtd/map.h 2004-08-26 05:42:08.000000000 -0500 -@@ -36,20 +36,20 @@ - int buswidth; /* in octets */ - - #ifdef CONFIG_MTD_COMPLEX_MAPPINGS -- u8 (*read8)(struct map_info *, unsigned long); -- u16 (*read16)(struct map_info *, unsigned long); -- u32 (*read32)(struct map_info *, unsigned long); -- u64 (*read64)(struct map_info *, unsigned long); -+ __u8 (*read8)(struct map_info *, unsigned long); -+ __u16 (*read16)(struct map_info *, unsigned long); -+ __u32 (*read32)(struct map_info *, unsigned long); -+ __u64 (*read64)(struct map_info *, unsigned long); - /* If it returned a 'long' I'd call it readl. - * It doesn't. - * I won't. - * dwmw2 */ - - void (*copy_from)(struct map_info *, void *, unsigned long, ssize_t); -- void (*write8)(struct map_info *, u8, unsigned long); -- void (*write16)(struct map_info *, u16, unsigned long); -- void (*write32)(struct map_info *, u32, unsigned long); -- void (*write64)(struct map_info *, u64, unsigned long); -+ void (*write8)(struct map_info *, __u8, unsigned long); -+ void (*write16)(struct map_info *, __u16, unsigned long); -+ void (*write32)(struct map_info *, __u32, unsigned long); -+ void (*write64)(struct map_info *, __u64, unsigned long); - void (*copy_to)(struct map_info *, unsigned long, const void *, ssize_t); - - /* We can perhaps put in 'point' and 'unpoint' methods, if we really -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/mtd/nand.h linux-libc-headers-2.6.8.0/include/linux/mtd/nand.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/mtd/nand.h 2004-08-18 13:16:06.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/mtd/nand.h 2004-08-26 05:42:08.000000000 -0500 -@@ -271,8 +271,8 @@ - - u_char (*read_byte)(struct mtd_info *mtd); - void (*write_byte)(struct mtd_info *mtd, u_char byte); -- u16 (*read_word)(struct mtd_info *mtd); -- void (*write_word)(struct mtd_info *mtd, u16 word); -+ __u16 (*read_word)(struct mtd_info *mtd); -+ void (*write_word)(struct mtd_info *mtd, __u16 word); - - void (*write_buf)(struct mtd_info *mtd, const u_char *buf, int len); - void (*read_buf)(struct mtd_info *mtd, u_char *buf, int len); -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/mtd/pmc551.h linux-libc-headers-2.6.8.0/include/linux/mtd/pmc551.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/mtd/pmc551.h 2004-03-28 07:52:13.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/mtd/pmc551.h 2004-08-26 05:42:08.000000000 -0500 -@@ -25,9 +25,9 @@ - struct mypriv { - struct pci_dev *dev; - u_char *start; -- u32 base_map0; -- u32 curr_map0; -- u32 asize; -+ __u32 base_map0; -+ __u32 curr_map0; -+ __u32 asize; - struct mtd_info *nextpmc551; - }; - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nbd.h linux-libc-headers-2.6.8.0/include/linux/nbd.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/nbd.h 2004-03-28 07:52:09.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/nbd.h 2004-08-26 05:42:08.000000000 -0500 -@@ -45,11 +45,11 @@ - * server. All data are in network byte order. - */ - struct nbd_request { -- u32 magic; -- u32 type; /* == READ || == WRITE */ -+ __u32 magic; -+ __u32 type; /* == READ || == WRITE */ - char handle[8]; -- u64 from; -- u32 len; -+ __u64 from; -+ __u32 len; - } - #ifdef __GNUC__ - __attribute__ ((packed)) -@@ -61,8 +61,8 @@ - * it has completed an I/O request (or an error occurs). - */ - struct nbd_reply { -- u32 magic; -- u32 error; /* 0 = ok, else error */ -+ __u32 magic; -+ __u32 error; /* 0 = ok, else error */ - char handle[8]; /* handle you got from request */ - }; - #endif -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfs_fs_i.h linux-libc-headers-2.6.8.0/include/linux/nfs_fs_i.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/nfs_fs_i.h 2004-01-17 17:04:31.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/nfs_fs_i.h 2004-08-26 05:42:08.000000000 -0500 -@@ -8,8 +8,8 @@ - * NFS lock info - */ - struct nfs_lock_info { -- u32 state; -- u32 flags; -+ __u32 state; -+ __u32 flags; - struct nlm_host *host; - }; - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfs_fs_sb.h linux-libc-headers-2.6.8.0/include/linux/nfs_fs_sb.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/nfs_fs_sb.h 2004-06-09 07:00:50.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/nfs_fs_sb.h 2004-08-26 05:42:08.000000000 -0500 -@@ -37,10 +37,10 @@ - struct list_head nfs4_siblings; /* List of other nfs_server structs - * that share the same clientid - */ -- u32 attr_bitmask[2];/* V4 bitmask representing the set -+ __u32 attr_bitmask[2];/* V4 bitmask representing the set - of attributes supported on this - filesystem */ -- u32 acl_bitmask; /* V4 bitmask representing the ACEs -+ __u32 acl_bitmask; /* V4 bitmask representing the ACEs - that are supported on this - filesystem */ - #endif -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfs_xdr.h linux-libc-headers-2.6.8.0/include/linux/nfs_xdr.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/nfs_xdr.h 2004-06-09 07:00:50.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/nfs_xdr.h 2004-08-26 05:42:08.000000000 -0500 -@@ -90,9 +90,9 @@ - }; - - struct nfs4_change_info { -- u32 atomic; -- u64 before; -- u64 after; -+ __u32 atomic; -+ __u64 before; -+ __u64 after; - }; - - /* -@@ -112,7 +112,7 @@ - } u; - const struct qstr * name; - const struct nfs_server *server; /* Needed for ID mapping */ -- const u32 * bitmask; -+ const __u32 * bitmask; - }; - - struct nfs_openres { -@@ -168,7 +168,7 @@ - * */ - struct nfs_lowner { - __u64 clientid; -- u32 id; -+ __u32 id; - }; - - struct nfs_open_to_lock { -@@ -328,7 +328,7 @@ - nfs4_stateid stateid; - struct iattr * iap; - const struct nfs_server * server; /* Needed for name mapping */ -- const u32 * bitmask; -+ const __u32 * bitmask; - }; - - struct nfs_setattrres { -@@ -482,32 +482,32 @@ - - #ifdef CONFIG_NFS_V4 - --typedef u64 clientid4; -+typedef __u64 clientid4; - - struct nfs4_accessargs { - const struct nfs_fh * fh; -- u32 access; -+ __u32 access; - }; - - struct nfs4_accessres { -- u32 supported; -- u32 access; -+ __u32 supported; -+ __u32 access; - }; - - struct nfs4_create_arg { -- u32 ftype; -+ __u32 ftype; - union { - struct qstr * symlink; /* NF4LNK */ - struct { -- u32 specdata1; -- u32 specdata2; -+ __u32 specdata1; -+ __u32 specdata2; - } device; /* NF4BLK, NF4CHR */ - } u; - const struct qstr * name; - const struct nfs_server * server; - const struct iattr * attrs; - const struct nfs_fh * dir_fh; -- const u32 * bitmask; -+ const __u32 * bitmask; - }; - - struct nfs4_create_res { -@@ -519,12 +519,12 @@ - - struct nfs4_fsinfo_arg { - const struct nfs_fh * fh; -- const u32 * bitmask; -+ const __u32 * bitmask; - }; - - struct nfs4_getattr_arg { - const struct nfs_fh * fh; -- const u32 * bitmask; -+ const __u32 * bitmask; - }; - - struct nfs4_getattr_res { -@@ -541,7 +541,7 @@ - struct nfs4_lookup_arg { - const struct nfs_fh * dir_fh; - const struct qstr * name; -- const u32 * bitmask; -+ const __u32 * bitmask; - }; - - struct nfs4_lookup_res { -@@ -551,19 +551,19 @@ - }; - - struct nfs4_lookup_root_arg { -- const u32 * bitmask; -+ const __u32 * bitmask; - }; - - struct nfs4_pathconf_arg { - const struct nfs_fh * fh; -- const u32 * bitmask; -+ const __u32 * bitmask; - }; - - struct nfs4_readdir_arg { - const struct nfs_fh * fh; -- u64 cookie; -+ __u64 cookie; - nfs4_verifier verifier; -- u32 count; -+ __u32 count; - struct page ** pages; /* zero-copy data */ - unsigned int pgbase; /* zero-copy data */ - }; -@@ -575,7 +575,7 @@ - - struct nfs4_readlink { - const struct nfs_fh * fh; -- u32 count; /* zero-copy data */ -+ __u32 count; /* zero-copy data */ - struct page ** pages; /* zero-copy data */ - }; - -@@ -599,23 +599,23 @@ - struct nfs4_setclientid { - nfs4_verifier sc_verifier; /* request */ - char * sc_name; /* request */ -- u32 sc_prog; /* request */ -+ __u32 sc_prog; /* request */ - char sc_netid[4]; /* request */ - char sc_uaddr[24]; /* request */ -- u32 sc_cb_ident; /* request */ -+ __u32 sc_cb_ident; /* request */ - struct nfs4_client * sc_state; /* response */ - }; - - struct nfs4_statfs_arg { - const struct nfs_fh * fh; -- const u32 * bitmask; -+ const __u32 * bitmask; - }; - - struct nfs4_server_caps_res { -- u32 attr_bitmask[2]; -- u32 acl_bitmask; -- u32 has_links; -- u32 has_symlinks; -+ __u32 attr_bitmask[2]; -+ __u32 acl_bitmask; -+ __u32 has_links; -+ __u32 has_symlinks; - }; - - #endif /* CONFIG_NFS_V4 */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/state.h linux-libc-headers-2.6.8.0/include/linux/nfsd/state.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/state.h 2004-08-18 13:16:07.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/nfsd/state.h 2004-08-26 05:42:08.000000000 -0500 -@@ -41,18 +41,18 @@ - - #define NFS4_OPAQUE_LIMIT 1024 - typedef struct { -- u32 cl_boot; -- u32 cl_id; -+ __u32 cl_boot; -+ __u32 cl_id; - } clientid_t; - - typedef struct { -- u32 so_boot; -- u32 so_stateownerid; -- u32 so_fileid; -+ __u32 so_boot; -+ __u32 so_stateownerid; -+ __u32 so_fileid; - } stateid_opaque_t; - - typedef struct { -- u32 si_generation; -+ __u32 si_generation; - stateid_opaque_t si_opaque; - } stateid_t; - #define si_boot si_opaque.so_boot -@@ -68,14 +68,14 @@ - /* client delegation callback info */ - struct nfs4_callback { - /* SETCLIENTID info */ -- u32 cb_parsed; /* addr parsed */ -- u32 cb_addr; -+ __u32 cb_parsed; /* addr parsed */ -+ __u32 cb_addr; - unsigned short cb_port; -- u32 cb_prog; -- u32 cb_ident; -+ __u32 cb_prog; -+ __u32 cb_ident; - struct xdr_netobj cb_netid; - /* RPC client info */ -- u32 cb_set; /* successful CB_NULL call */ -+ __u32 cb_set; /* successful CB_NULL call */ - struct rpc_program cb_program; - struct rpc_stat cb_stat; - struct rpc_clnt * cb_client; -@@ -99,7 +99,7 @@ - struct xdr_netobj cl_name; /* id generated by client */ - nfs4_verifier cl_verifier; /* generated by client */ - time_t cl_time; /* time of last lease renewal */ -- u32 cl_addr; /* client ipaddress */ -+ __u32 cl_addr; /* client ipaddress */ - struct svc_cred cl_cred; /* setclientid principal */ - clientid_t cl_clientid; /* generated by server */ - nfs4_verifier cl_confirm; /* generated by server */ -@@ -116,7 +116,7 @@ - struct list_head cr_strhash; /* hash by cr_name */ - struct xdr_netobj cr_name; /* id generated by client */ - time_t cr_first_state; /* first state aquisition */ -- u32 cr_expired; /* boolean: lease expired? */ -+ __u32 cr_expired; /* boolean: lease expired? */ - }; - - static inline void -@@ -139,7 +139,7 @@ - * is cached. - */ - struct nfs4_replay { -- u32 rp_status; -+ __u32 rp_status; - unsigned int rp_buflen; - char *rp_buf; - unsigned intrp_allocated; -@@ -175,9 +175,9 @@ - struct list_head so_close_lru; /* tail queue */ - time_t so_time; /* time of placement on so_close_lru */ - int so_is_open_owner; /* 1=openowner,0=lockowner */ -- u32 so_id; -+ __u32 so_id; - struct nfs4_client * so_client; -- u32 so_seqid; -+ __u32 so_seqid; - struct xdr_netobj so_owner; /* open owner name */ - int so_confirmed; /* successful OPEN_CONFIRM? */ - struct nfs4_replay so_replay; -@@ -192,7 +192,7 @@ - struct list_head fi_hash; /* hash by "struct inode *" */ - struct list_head fi_perfile; /* list: nfs4_stateid */ - struct inode *fi_inode; -- u32 fi_id; /* used with stateowner->so_id -+ __u32 fi_id; /* used with stateowner->so_id - * for stateid_hashtbl hash */ - }; - -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/xdr.h linux-libc-headers-2.6.8.0/include/linux/nfsd/xdr.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/xdr.h 2004-08-18 13:16:07.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/nfsd/xdr.h 2004-08-26 05:42:08.000000000 -0500 -@@ -83,7 +83,7 @@ - struct svc_fh fh; - __u32 cookie; - __u32 count; -- u32 * buffer; -+ __u32 * buffer; - }; - - struct nfsd_attrstat { -@@ -107,9 +107,9 @@ - int count; - - struct readdir_cd common; -- u32 * buffer; -+ __u32 * buffer; - int buflen; -- u32 * offset; -+ __u32 * offset; - }; - - struct nfsd_statfsres { -@@ -134,39 +134,39 @@ - #define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore) - - --int nfssvc_decode_void(struct svc_rqst *, u32 *, void *); --int nfssvc_decode_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *); --int nfssvc_decode_sattrargs(struct svc_rqst *, u32 *, -+int nfssvc_decode_void(struct svc_rqst *, __u32 *, void *); -+int nfssvc_decode_fhandle(struct svc_rqst *, __u32 *, struct nfsd_fhandle *); -+int nfssvc_decode_sattrargs(struct svc_rqst *, __u32 *, - struct nfsd_sattrargs *); --int nfssvc_decode_diropargs(struct svc_rqst *, u32 *, -+int nfssvc_decode_diropargs(struct svc_rqst *, __u32 *, - struct nfsd_diropargs *); --int nfssvc_decode_readargs(struct svc_rqst *, u32 *, -+int nfssvc_decode_readargs(struct svc_rqst *, __u32 *, - struct nfsd_readargs *); --int nfssvc_decode_writeargs(struct svc_rqst *, u32 *, -+int nfssvc_decode_writeargs(struct svc_rqst *, __u32 *, - struct nfsd_writeargs *); --int nfssvc_decode_createargs(struct svc_rqst *, u32 *, -+int nfssvc_decode_createargs(struct svc_rqst *, __u32 *, - struct nfsd_createargs *); --int nfssvc_decode_renameargs(struct svc_rqst *, u32 *, -+int nfssvc_decode_renameargs(struct svc_rqst *, __u32 *, - struct nfsd_renameargs *); --int nfssvc_decode_readlinkargs(struct svc_rqst *, u32 *, -+int nfssvc_decode_readlinkargs(struct svc_rqst *, __u32 *, - struct nfsd_readlinkargs *); --int nfssvc_decode_linkargs(struct svc_rqst *, u32 *, -+int nfssvc_decode_linkargs(struct svc_rqst *, __u32 *, - struct nfsd_linkargs *); --int nfssvc_decode_symlinkargs(struct svc_rqst *, u32 *, -+int nfssvc_decode_symlinkargs(struct svc_rqst *, __u32 *, - struct nfsd_symlinkargs *); --int nfssvc_decode_readdirargs(struct svc_rqst *, u32 *, -+int nfssvc_decode_readdirargs(struct svc_rqst *, __u32 *, - struct nfsd_readdirargs *); --int nfssvc_encode_void(struct svc_rqst *, u32 *, void *); --int nfssvc_encode_attrstat(struct svc_rqst *, u32 *, struct nfsd_attrstat *); --int nfssvc_encode_diropres(struct svc_rqst *, u32 *, struct nfsd_diropres *); --int nfssvc_encode_readlinkres(struct svc_rqst *, u32 *, struct nfsd_readlinkres *); --int nfssvc_encode_readres(struct svc_rqst *, u32 *, struct nfsd_readres *); --int nfssvc_encode_statfsres(struct svc_rqst *, u32 *, struct nfsd_statfsres *); --int nfssvc_encode_readdirres(struct svc_rqst *, u32 *, struct nfsd_readdirres *); -+int nfssvc_encode_void(struct svc_rqst *, __u32 *, void *); -+int nfssvc_encode_attrstat(struct svc_rqst *, __u32 *, struct nfsd_attrstat *); -+int nfssvc_encode_diropres(struct svc_rqst *, __u32 *, struct nfsd_diropres *); -+int nfssvc_encode_readlinkres(struct svc_rqst *, __u32 *, struct nfsd_readlinkres *); -+int nfssvc_encode_readres(struct svc_rqst *, __u32 *, struct nfsd_readres *); -+int nfssvc_encode_statfsres(struct svc_rqst *, __u32 *, struct nfsd_statfsres *); -+int nfssvc_encode_readdirres(struct svc_rqst *, __u32 *, struct nfsd_readdirres *); - - int nfssvc_encode_entry(struct readdir_cd *, const char *name, - int namlen, loff_t offset, ino_t ino, unsigned int); - --int nfssvc_release_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *); -+int nfssvc_release_fhandle(struct svc_rqst *, __u32 *, struct nfsd_fhandle *); - - #endif /* LINUX_NFSD_H */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/xdr3.h linux-libc-headers-2.6.8.0/include/linux/nfsd/xdr3.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/xdr3.h 2004-08-18 13:16:07.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/nfsd/xdr3.h 2004-08-26 05:42:08.000000000 -0500 -@@ -101,7 +101,7 @@ - __u32 dircount; - __u32 count; - __u32 * verf; -- u32 * buffer; -+ __u32 * buffer; - }; - - struct nfsd3_commitargs { -@@ -167,10 +167,10 @@ - __u32 verf[2]; - - struct readdir_cd common; -- u32 * buffer; -+ __u32 * buffer; - int buflen; -- u32 * offset; -- u32 * offset1; -+ __u32 * offset; -+ __u32 * offset1; - struct svc_rqst * rqstp; - - }; -@@ -245,70 +245,70 @@ - - #define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore) - --int nfs3svc_decode_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *); --int nfs3svc_decode_sattrargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_fhandle(struct svc_rqst *, __u32 *, struct nfsd_fhandle *); -+int nfs3svc_decode_sattrargs(struct svc_rqst *, __u32 *, - struct nfsd3_sattrargs *); --int nfs3svc_decode_diropargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_diropargs(struct svc_rqst *, __u32 *, - struct nfsd3_diropargs *); --int nfs3svc_decode_accessargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_accessargs(struct svc_rqst *, __u32 *, - struct nfsd3_accessargs *); --int nfs3svc_decode_readargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_readargs(struct svc_rqst *, __u32 *, - struct nfsd3_readargs *); --int nfs3svc_decode_writeargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_writeargs(struct svc_rqst *, __u32 *, - struct nfsd3_writeargs *); --int nfs3svc_decode_createargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_createargs(struct svc_rqst *, __u32 *, - struct nfsd3_createargs *); --int nfs3svc_decode_mkdirargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_mkdirargs(struct svc_rqst *, __u32 *, - struct nfsd3_createargs *); --int nfs3svc_decode_mknodargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_mknodargs(struct svc_rqst *, __u32 *, - struct nfsd3_mknodargs *); --int nfs3svc_decode_renameargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_renameargs(struct svc_rqst *, __u32 *, - struct nfsd3_renameargs *); --int nfs3svc_decode_readlinkargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_readlinkargs(struct svc_rqst *, __u32 *, - struct nfsd3_readlinkargs *); --int nfs3svc_decode_linkargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_linkargs(struct svc_rqst *, __u32 *, - struct nfsd3_linkargs *); --int nfs3svc_decode_symlinkargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_symlinkargs(struct svc_rqst *, __u32 *, - struct nfsd3_symlinkargs *); --int nfs3svc_decode_readdirargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_readdirargs(struct svc_rqst *, __u32 *, - struct nfsd3_readdirargs *); --int nfs3svc_decode_readdirplusargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __u32 *, - struct nfsd3_readdirargs *); --int nfs3svc_decode_commitargs(struct svc_rqst *, u32 *, -+int nfs3svc_decode_commitargs(struct svc_rqst *, __u32 *, - struct nfsd3_commitargs *); --int nfs3svc_encode_voidres(struct svc_rqst *, u32 *, void *); --int nfs3svc_encode_attrstat(struct svc_rqst *, u32 *, -+int nfs3svc_encode_voidres(struct svc_rqst *, __u32 *, void *); -+int nfs3svc_encode_attrstat(struct svc_rqst *, __u32 *, - struct nfsd3_attrstat *); --int nfs3svc_encode_wccstat(struct svc_rqst *, u32 *, -+int nfs3svc_encode_wccstat(struct svc_rqst *, __u32 *, - struct nfsd3_attrstat *); --int nfs3svc_encode_diropres(struct svc_rqst *, u32 *, -+int nfs3svc_encode_diropres(struct svc_rqst *, __u32 *, - struct nfsd3_diropres *); --int nfs3svc_encode_accessres(struct svc_rqst *, u32 *, -+int nfs3svc_encode_accessres(struct svc_rqst *, __u32 *, - struct nfsd3_accessres *); --int nfs3svc_encode_readlinkres(struct svc_rqst *, u32 *, -+int nfs3svc_encode_readlinkres(struct svc_rqst *, __u32 *, - struct nfsd3_readlinkres *); --int nfs3svc_encode_readres(struct svc_rqst *, u32 *, struct nfsd3_readres *); --int nfs3svc_encode_writeres(struct svc_rqst *, u32 *, struct nfsd3_writeres *); --int nfs3svc_encode_createres(struct svc_rqst *, u32 *, -+int nfs3svc_encode_readres(struct svc_rqst *, __u32 *, struct nfsd3_readres *); -+int nfs3svc_encode_writeres(struct svc_rqst *, __u32 *, struct nfsd3_writeres *); -+int nfs3svc_encode_createres(struct svc_rqst *, __u32 *, - struct nfsd3_diropres *); --int nfs3svc_encode_renameres(struct svc_rqst *, u32 *, -+int nfs3svc_encode_renameres(struct svc_rqst *, __u32 *, - struct nfsd3_renameres *); --int nfs3svc_encode_linkres(struct svc_rqst *, u32 *, -+int nfs3svc_encode_linkres(struct svc_rqst *, __u32 *, - struct nfsd3_linkres *); --int nfs3svc_encode_readdirres(struct svc_rqst *, u32 *, -+int nfs3svc_encode_readdirres(struct svc_rqst *, __u32 *, - struct nfsd3_readdirres *); --int nfs3svc_encode_fsstatres(struct svc_rqst *, u32 *, -+int nfs3svc_encode_fsstatres(struct svc_rqst *, __u32 *, - struct nfsd3_fsstatres *); --int nfs3svc_encode_fsinfores(struct svc_rqst *, u32 *, -+int nfs3svc_encode_fsinfores(struct svc_rqst *, __u32 *, - struct nfsd3_fsinfores *); --int nfs3svc_encode_pathconfres(struct svc_rqst *, u32 *, -+int nfs3svc_encode_pathconfres(struct svc_rqst *, __u32 *, - struct nfsd3_pathconfres *); --int nfs3svc_encode_commitres(struct svc_rqst *, u32 *, -+int nfs3svc_encode_commitres(struct svc_rqst *, __u32 *, - struct nfsd3_commitres *); - --int nfs3svc_release_fhandle(struct svc_rqst *, u32 *, -+int nfs3svc_release_fhandle(struct svc_rqst *, __u32 *, - struct nfsd3_attrstat *); --int nfs3svc_release_fhandle2(struct svc_rqst *, u32 *, -+int nfs3svc_release_fhandle2(struct svc_rqst *, __u32 *, - struct nfsd3_fhandle_pair *); - int nfs3svc_encode_entry(struct readdir_cd *, const char *name, - int namlen, loff_t offset, ino_t ino, -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/xdr4.h linux-libc-headers-2.6.8.0/include/linux/nfsd/xdr4.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/nfsd/xdr4.h 2004-08-18 13:16:07.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/nfsd/xdr4.h 2004-08-26 05:42:08.000000000 -0500 -@@ -42,9 +42,9 @@ - #define NFSD4_MAX_TAGLEN 128 - #define XDR_LEN(n) (((n) + 3) & ~3) - --typedef u32 delegation_zero_t; --typedef u32 delegation_boot_t; --typedef u64 delegation_id_t; -+typedef __u32 delegation_zero_t; -+typedef __u32 delegation_boot_t; -+typedef __u64 delegation_id_t; - - typedef struct { - delegation_zero_t ds_zero; -@@ -53,46 +53,46 @@ - } delegation_stateid_t; - - struct nfsd4_change_info { -- u32 atomic; -- u32 before_ctime_sec; -- u32 before_ctime_nsec; -- u32 after_ctime_sec; -- u32 after_ctime_nsec; -+ __u32 atomic; -+ __u32 before_ctime_sec; -+ __u32 before_ctime_nsec; -+ __u32 after_ctime_sec; -+ __u32 after_ctime_nsec; - }; - - struct nfsd4_access { -- u32 ac_req_access; /* request */ -- u32 ac_supported; /* response */ -- u32 ac_resp_access; /* response */ -+ __u32 ac_req_access; /* request */ -+ __u32 ac_supported; /* response */ -+ __u32 ac_resp_access; /* response */ - }; - - struct nfsd4_close { -- u32 cl_seqid; /* request */ -+ __u32 cl_seqid; /* request */ - stateid_t cl_stateid; /* request+response */ - struct nfs4_stateowner * cl_stateowner; /* response */ - }; - - struct nfsd4_commit { -- u64 co_offset; /* request */ -- u32 co_count; /* request */ -+ __u64 co_offset; /* request */ -+ __u32 co_count; /* request */ - nfs4_verifier co_verf; /* response */ - }; - - struct nfsd4_create { -- u32 cr_namelen; /* request */ -+ __u32 cr_namelen; /* request */ - char * cr_name; /* request */ -- u32 cr_type; /* request */ -+ __u32 cr_type; /* request */ - union { /* request */ - struct { -- u32 namelen; -+ __u32 namelen; - char *name; - } link; /* NF4LNK */ - struct { -- u32 specdata1; -- u32 specdata2; -+ __u32 specdata1; -+ __u32 specdata2; - } dev; /* NF4BLK, NF4CHR */ - } u; -- u32 cr_bmval[2]; /* request */ -+ __u32 cr_bmval[2]; /* request */ - struct iattr cr_iattr; /* request */ - struct nfsd4_change_info cr_cinfo; /* response */ - }; -@@ -102,41 +102,41 @@ - #define cr_specdata2 u.dev.specdata2 - - struct nfsd4_getattr { -- u32 ga_bmval[2]; /* request */ -+ __u32 ga_bmval[2]; /* request */ - struct svc_fh *ga_fhp; /* response */ - }; - - struct nfsd4_link { -- u32 li_namelen; /* request */ -+ __u32 li_namelen; /* request */ - char * li_name; /* request */ - struct nfsd4_change_info li_cinfo; /* response */ - }; - - struct nfsd4_lock_denied { - struct nfs4_stateowner *ld_sop; -- u64 ld_start; -- u64 ld_length; -- u32 ld_type; -+ __u64 ld_start; -+ __u64 ld_length; -+ __u32 ld_type; - }; - - struct nfsd4_lock { - /* request */ -- u32 lk_type; -- u32 lk_reclaim; /* boolean */ -- u64 lk_offset; -- u64 lk_length; -- u32 lk_is_new; -+ __u32 lk_type; -+ __u32 lk_reclaim; /* boolean */ -+ __u64 lk_offset; -+ __u64 lk_length; -+ __u32 lk_is_new; - union { - struct { -- u32 open_seqid; -+ __u32 open_seqid; - stateid_t open_stateid; -- u32 lock_seqid; -+ __u32 lock_seqid; - clientid_t clientid; - struct xdr_netobj owner; - } new; - struct { - stateid_t lock_stateid; -- u32 lock_seqid; -+ __u32 lock_seqid; - } old; - } v; - -@@ -164,56 +164,56 @@ - - - struct nfsd4_lockt { -- u32 lt_type; -+ __u32 lt_type; - clientid_t lt_clientid; - struct xdr_netobj lt_owner; -- u64 lt_offset; -- u64 lt_length; -+ __u64 lt_offset; -+ __u64 lt_length; - struct nfs4_stateowner * lt_stateowner; - struct nfsd4_lock_denied lt_denied; - }; - - - struct nfsd4_locku { -- u32 lu_type; -- u32 lu_seqid; -+ __u32 lu_type; -+ __u32 lu_seqid; - stateid_t lu_stateid; -- u64 lu_offset; -- u64 lu_length; -+ __u64 lu_offset; -+ __u64 lu_length; - struct nfs4_stateowner *lu_stateowner; - }; - - - struct nfsd4_lookup { -- u32 lo_len; /* request */ -+ __u32 lo_len; /* request */ - char * lo_name; /* request */ - }; - - struct nfsd4_putfh { -- u32 pf_fhlen; /* request */ -+ __u32 pf_fhlen; /* request */ - char *pf_fhval; /* request */ - }; - - struct nfsd4_open { -- u32 op_claim_type; /* request */ -+ __u32 op_claim_type; /* request */ - struct xdr_netobj op_fname; /* request - everything but CLAIM_PREV */ -- u32 op_delegate_type; /* request - CLAIM_PREV only */ -+ __u32 op_delegate_type; /* request - CLAIM_PREV only */ - delegation_stateid_t op_delegate_stateid; /* request - CLAIM_DELEGATE_CUR only */ -- u32 op_create; /* request */ -- u32 op_createmode; /* request */ -- u32 op_bmval[2]; /* request */ -+ __u32 op_create; /* request */ -+ __u32 op_createmode; /* request */ -+ __u32 op_bmval[2]; /* request */ - union { /* request */ - struct iattr iattr; /* UNCHECKED4,GUARDED4 */ - nfs4_verifier verf; /* EXCLUSIVE4 */ - } u; - clientid_t op_clientid; /* request */ - struct xdr_netobj op_owner; /* request */ -- u32 op_seqid; /* request */ -- u32 op_share_access; /* request */ -- u32 op_share_deny; /* request */ -+ __u32 op_seqid; /* request */ -+ __u32 op_share_access; /* request */ -+ __u32 op_share_deny; /* request */ - stateid_t op_stateid; /* response */ - struct nfsd4_change_info op_cinfo; /* response */ -- u32 op_rflags; /* response */ -+ __u32 op_rflags; /* response */ - int op_truncate; /* used during processing */ - struct nfs4_stateowner *op_stateowner; /* used during processing */ - -@@ -223,24 +223,24 @@ - - struct nfsd4_open_confirm { - stateid_t oc_req_stateid /* request */; -- u32 oc_seqid /* request */; -+ __u32 oc_seqid /* request */; - stateid_t oc_resp_stateid /* response */; - struct nfs4_stateowner * oc_stateowner; /* response */ - }; - - struct nfsd4_open_downgrade { - stateid_t od_stateid; -- u32 od_seqid; -- u32 od_share_access; -- u32 od_share_deny; -+ __u32 od_seqid; -+ __u32 od_share_access; -+ __u32 od_share_deny; - struct nfs4_stateowner *od_stateowner; - }; - - - struct nfsd4_read { - stateid_t rd_stateid; /* request */ -- u64 rd_offset; /* request */ -- u32 rd_length; /* request */ -+ __u64 rd_offset; /* request */ -+ __u32 rd_length; /* request */ - struct kvec rd_iov[RPCSVC_MAXPAGES]; - int rd_vlen; - -@@ -249,18 +249,18 @@ - }; - - struct nfsd4_readdir { -- u64 rd_cookie; /* request */ -+ __u64 rd_cookie; /* request */ - nfs4_verifier rd_verf; /* request */ -- u32 rd_dircount; /* request */ -- u32 rd_maxcount; /* request */ -- u32 rd_bmval[2]; /* request */ -+ __u32 rd_dircount; /* request */ -+ __u32 rd_maxcount; /* request */ -+ __u32 rd_bmval[2]; /* request */ - struct svc_rqst *rd_rqstp; /* response */ - struct svc_fh * rd_fhp; /* response */ - - struct readdir_cd common; -- u32 * buffer; -+ __u32 * buffer; - int buflen; -- u32 * offset; -+ __u32 * offset; - }; - - struct nfsd4_release_lockowner { -@@ -273,15 +273,15 @@ - }; - - struct nfsd4_remove { -- u32 rm_namelen; /* request */ -+ __u32 rm_namelen; /* request */ - char * rm_name; /* request */ - struct nfsd4_change_info rm_cinfo; /* response */ - }; - - struct nfsd4_rename { -- u32 rn_snamelen; /* request */ -+ __u32 rn_snamelen; /* request */ - char * rn_sname; /* request */ -- u32 rn_tnamelen; /* request */ -+ __u32 rn_tnamelen; /* request */ - char * rn_tname; /* request */ - struct nfsd4_change_info rn_sinfo; /* response */ - struct nfsd4_change_info rn_tinfo; /* response */ -@@ -289,20 +289,20 @@ - - struct nfsd4_setattr { - stateid_t sa_stateid; /* request */ -- u32 sa_bmval[2]; /* request */ -+ __u32 sa_bmval[2]; /* request */ - struct iattr sa_iattr; /* request */ - }; - - struct nfsd4_setclientid { - nfs4_verifier se_verf; /* request */ -- u32 se_namelen; /* request */ -+ __u32 se_namelen; /* request */ - char * se_name; /* request */ -- u32 se_callback_prog; /* request */ -- u32 se_callback_netid_len; /* request */ -+ __u32 se_callback_prog; /* request */ -+ __u32 se_callback_netid_len; /* request */ - char * se_callback_netid_val; /* request */ -- u32 se_callback_addr_len; /* request */ -+ __u32 se_callback_addr_len; /* request */ - char * se_callback_addr_val; /* request */ -- u32 se_callback_ident; /* request */ -+ __u32 se_callback_ident; /* request */ - clientid_t se_clientid; /* response */ - nfs4_verifier se_confirm; /* response */ - }; -@@ -314,21 +314,21 @@ - - /* also used for NVERIFY */ - struct nfsd4_verify { -- u32 ve_bmval[2]; /* request */ -- u32 ve_attrlen; /* request */ -+ __u32 ve_bmval[2]; /* request */ -+ __u32 ve_attrlen; /* request */ - char * ve_attrval; /* request */ - }; - - struct nfsd4_write { - stateid_t wr_stateid; /* request */ -- u64 wr_offset; /* request */ -- u32 wr_stable_how; /* request */ -- u32 wr_buflen; /* request */ -+ __u64 wr_offset; /* request */ -+ __u32 wr_stable_how; /* request */ -+ __u32 wr_buflen; /* request */ - struct kvec wr_vec[RPCSVC_MAXPAGES]; /* request */ - int wr_vlen; - -- u32 wr_bytes_written; /* response */ -- u32 wr_how_written; /* response */ -+ __u32 wr_bytes_written; /* response */ -+ __u32 wr_how_written; /* response */ - nfs4_verifier wr_verifier; /* response */ - }; - -@@ -370,12 +370,12 @@ - - struct nfsd4_compoundargs { - /* scratch variables for XDR decode */ -- u32 * p; -- u32 * end; -+ __u32 * p; -+ __u32 * end; - struct page ** pagelist; - int pagelen; -- u32 tmp[8]; -- u32 * tmpp; -+ __u32 tmp[8]; -+ __u32 * tmpp; - struct tmpbuf { - struct tmpbuf *next; - void (*release)(const void *); -@@ -384,25 +384,25 @@ - - struct svc_rqst *rqstp; - -- u32 taglen; -+ __u32 taglen; - char * tag; -- u32 minorversion; -- u32 opcnt; -+ __u32 minorversion; -+ __u32 opcnt; - struct nfsd4_op *ops; - struct nfsd4_op iops[8]; - }; - - struct nfsd4_compoundres { - /* scratch variables for XDR encode */ -- u32 * p; -- u32 * end; -+ __u32 * p; -+ __u32 * end; - struct xdr_buf * xbuf; - struct svc_rqst * rqstp; - -- u32 taglen; -+ __u32 taglen; - char * tag; -- u32 opcnt; -- u32 * tagp; /* where to encode tag and opcount */ -+ __u32 opcnt; -+ __u32 * tagp; /* where to encode tag and opcount */ - }; - - #define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs) -@@ -418,16 +418,16 @@ - cinfo->after_ctime_nsec = fhp->fh_post_ctime.tv_nsec; - } - --int nfs4svc_encode_voidres(struct svc_rqst *, u32 *, void *); --int nfs4svc_decode_compoundargs(struct svc_rqst *, u32 *, -+int nfs4svc_encode_voidres(struct svc_rqst *, __u32 *, void *); -+int nfs4svc_decode_compoundargs(struct svc_rqst *, __u32 *, - struct nfsd4_compoundargs *); --int nfs4svc_encode_compoundres(struct svc_rqst *, u32 *, -+int nfs4svc_encode_compoundres(struct svc_rqst *, __u32 *, - struct nfsd4_compoundres *); - void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *); - void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op); - int nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, -- struct dentry *dentry, u32 *buffer, int *countp, -- u32 *bmval, struct svc_rqst *); -+ struct dentry *dentry, __u32 *buffer, int *countp, -+ __u32 *bmval, struct svc_rqst *); - extern int nfsd4_setclientid(struct svc_rqst *rqstp, - struct nfsd4_setclientid *setclid); - extern int nfsd4_setclientid_confirm(struct svc_rqst *rqstp, -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/pmu.h linux-libc-headers-2.6.8.0/include/linux/pmu.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/pmu.h 2004-01-17 17:04:31.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/pmu.h 2004-08-26 05:42:08.000000000 -0500 -@@ -120,15 +120,15 @@ - - /* no param */ - #define PMU_IOC_SLEEP _IO('B', 0) --/* out param: u32* backlight value: 0 to 15 */ -+/* out param: __u32* backlight value: 0 to 15 */ - #define PMU_IOC_GET_BACKLIGHT _IOR('B', 1, size_t) --/* in param: u32 backlight value: 0 to 15 */ -+/* in param: __u32 backlight value: 0 to 15 */ - #define PMU_IOC_SET_BACKLIGHT _IOW('B', 2, size_t) --/* out param: u32* PMU model */ -+/* out param: __u32* PMU model */ - #define PMU_IOC_GET_MODEL _IOR('B', 3, size_t) --/* out param: u32* has_adb: 0 or 1 */ -+/* out param: __u32* has_adb: 0 or 1 */ - #define PMU_IOC_HAS_ADB _IOR('B', 4, size_t) --/* out param: u32* can_sleep: 0 or 1 */ -+/* out param: __u32* can_sleep: 0 or 1 */ - #define PMU_IOC_CAN_SLEEP _IOR('B', 5, size_t) - /* no param, but historically was _IOR('B', 6, 0), meaning 4 bytes */ - #define PMU_IOC_GRAB_BACKLIGHT _IOR('B', 6, size_t) -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/reiserfs_fs.h linux-libc-headers-2.6.8.0/include/linux/reiserfs_fs.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/reiserfs_fs.h 2004-08-18 13:16:04.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/reiserfs_fs.h 2004-08-26 13:26:06.000000000 -0500 -@@ -1821,7 +1821,7 @@ - * to use for a new object underneat it. The locality is returned - * in disk byte order (le). - */ --u32 reiserfs_choose_packing(struct inode *dir); -+__u32 reiserfs_choose_packing(struct inode *dir); - - int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value); - void reiserfs_free_block (struct reiserfs_transaction_handle *th, struct inode *, b_blocknr_t, int for_unformatted); -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/scx200_gpio.h linux-libc-headers-2.6.8.0/include/linux/scx200_gpio.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/scx200_gpio.h 2004-01-17 17:04:32.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/scx200_gpio.h 2004-08-26 13:26:01.000000000 -0500 -@@ -1,5 +1,5 @@ - --u32 scx200_gpio_configure(int index, u32 set, u32 clear); -+__u32 scx200_gpio_configure(int index, __u32 set, __u32 clear); - void scx200_gpio_dump(unsigned index); - - extern unsigned scx200_gpio_base; -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sdladrv.h linux-libc-headers-2.6.8.0/include/linux/sdladrv.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/sdladrv.h 2003-12-15 12:46:58.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/sdladrv.h 2004-08-26 05:42:08.000000000 -0500 -@@ -55,8 +55,8 @@ - extern int sdla_inten (sdlahw_t* hw); - extern int sdla_intde (sdlahw_t* hw); - extern int sdla_intack (sdlahw_t* hw); --extern void S514_intack (sdlahw_t* hw, u32 int_status); --extern void read_S514_int_stat (sdlahw_t* hw, u32* int_status); -+extern void S514_intack (sdlahw_t* hw, __u32 int_status); -+extern void read_S514_int_stat (sdlahw_t* hw, __u32* int_status); - extern int sdla_intr (sdlahw_t* hw); - extern int sdla_mapmem (sdlahw_t* hw, unsigned long addr); - extern int sdla_peek (sdlahw_t* hw, unsigned long addr, void* buf, -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/selection.h linux-libc-headers-2.6.8.0/include/linux/selection.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/selection.h 2004-06-23 16:52:56.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/selection.h 2004-08-26 05:42:08.000000000 -0500 -@@ -32,14 +32,14 @@ - extern int default_blu[]; - - extern unsigned short *screen_pos(int currcons, int w_offset, int viewed); --extern u16 screen_glyph(int currcons, int offset); -+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, 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); -+extern __u16 vcs_scr_readw(int currcons, const __u16 *org); -+extern void vcs_scr_writew(int currcons, __u16 val, __u16 *org); - - #endif -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/serialP.h linux-libc-headers-2.6.8.0/include/linux/serialP.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/serialP.h 2004-08-18 13:16:04.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/serialP.h 2004-08-26 05:42:08.000000000 -0500 -@@ -39,8 +39,8 @@ - int xmit_fifo_size; - int custom_divisor; - int count; -- u8 *iomem_base; -- u16 iomem_reg_shift; -+ __u8 *iomem_base; -+ __u16 iomem_reg_shift; - unsigned short close_delay; - unsigned short closing_wait; /* time to wait before closing */ - struct async_icount icount; -@@ -75,8 +75,8 @@ - int blocked_open; /* # of blocked opens */ - struct circ_buf xmit; - spinlock_t xmit_lock; -- u8 *iomem_base; -- u16 iomem_reg_shift; -+ __u8 *iomem_base; -+ __u16 iomem_reg_shift; - int io_type; - struct work_struct work; - struct tasklet_struct tlet; -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/clnt.h linux-libc-headers-2.6.8.0/include/linux/sunrpc/clnt.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/clnt.h 2004-02-29 10:36:05.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/sunrpc/clnt.h 2004-08-26 05:42:08.000000000 -0500 -@@ -36,7 +36,7 @@ - atomic_t cl_users; /* number of references */ - struct rpc_xprt * cl_xprt; /* transport */ - struct rpc_procinfo * cl_procinfo; /* procedure info */ -- u32 cl_maxproc; /* max procedure number */ -+ __u32 cl_maxproc; /* max procedure number */ - - char * cl_server; /* server machine name */ - char * cl_protname; /* protocol name */ -@@ -75,7 +75,7 @@ - #define RPC_MAXVERSION 4 - struct rpc_program { - char * name; /* protocol name */ -- u32 number; /* program number */ -+ __u32 number; /* program number */ - unsigned int nrvers; /* number of versions */ - struct rpc_version ** version; /* version array */ - struct rpc_stat * stats; /* statistics */ -@@ -83,7 +83,7 @@ - }; - - struct rpc_version { -- u32 number; /* version number */ -+ __u32 number; /* version number */ - unsigned int nrprocs; /* number of procs */ - struct rpc_procinfo * procs; /* procedure array */ - }; -@@ -92,7 +92,7 @@ - * Procedure information - */ - struct rpc_procinfo { -- u32 p_proc; /* RPC procedure number */ -+ __u32 p_proc; /* RPC procedure number */ - kxdrproc_t p_encode; /* XDR encode function */ - kxdrproc_t p_decode; /* XDR decode function */ - unsigned int p_bufsiz; /* req. buffer size */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/gss_asn1.h linux-libc-headers-2.6.8.0/include/linux/sunrpc/gss_asn1.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/gss_asn1.h 2004-06-23 16:52:58.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/sunrpc/gss_asn1.h 2004-08-26 13:26:25.000000000 -0500 -@@ -64,14 +64,14 @@ - (((o1)->len == (o2)->len) && \ - (memcmp((o1)->data,(o2)->data,(int) (o1)->len) == 0)) - --u32 g_verify_token_header( -+__u32 g_verify_token_header( - struct xdr_netobj *mech, - int *body_size, - unsigned char **buf_in, - int tok_type, - int toksize); - --u32 g_get_mech_oid(struct xdr_netobj *mech, struct xdr_netobj * in_buf); -+__u32 g_get_mech_oid(struct xdr_netobj *mech, struct xdr_netobj * in_buf); - - int g_token_size( - struct xdr_netobj *mech, -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/gss_krb5.h linux-libc-headers-2.6.8.0/include/linux/sunrpc/gss_krb5.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/gss_krb5.h 2004-06-23 16:52:58.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/sunrpc/gss_krb5.h 2004-08-26 13:26:21.000000000 -0500 -@@ -46,8 +46,8 @@ - int sealalg; - struct crypto_tfm *enc; - struct crypto_tfm *seq; -- s32 endtime; -- u32 seq_send; -+ __s32 endtime; -+ __u32 seq_send; - struct xdr_netobj mech_used; - }; - -@@ -112,35 +112,35 @@ - #define ENCTYPE_DES3_CBC_SHA1 0x0010 - #define ENCTYPE_UNKNOWN 0x01ff - --s32 --make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, -+__s32 -+make_checksum(__s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, - struct xdr_netobj *cksum); - --u32 -+__u32 - krb5_make_token(struct krb5_ctx *context_handle, int qop_req, - struct xdr_buf *input_message_buffer, - struct xdr_netobj *output_message_buffer, int toktype); - --u32 -+__u32 - krb5_read_token(struct krb5_ctx *context_handle, - struct xdr_netobj *input_token_buffer, - struct xdr_buf *message_buffer, - int *qop_state, int toktype); - --u32 -+__u32 - krb5_encrypt(struct crypto_tfm * key, - void *iv, void *in, void *out, int length); - --u32 -+__u32 - krb5_decrypt(struct crypto_tfm * key, - void *iv, void *in, void *out, int length); - --s32 -+__s32 - krb5_make_seq_num(struct crypto_tfm * key, - int direction, -- s32 seqnum, unsigned char *cksum, unsigned char *buf); -+ __s32 seqnum, unsigned char *cksum, unsigned char *buf); - --s32 -+__s32 - krb5_get_seq_num(struct crypto_tfm * key, - unsigned char *cksum, -- unsigned char *buf, int *direction, s32 * seqnum); -+ unsigned char *buf, int *direction, __s32 * seqnum); -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/svc.h linux-libc-headers-2.6.8.0/include/linux/sunrpc/svc.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/svc.h 2004-08-18 13:16:07.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/sunrpc/svc.h 2004-08-26 05:42:08.000000000 -0500 -@@ -75,20 +75,20 @@ - */ - #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2) - --static inline u32 svc_getu32(struct kvec *iov) -+static inline __u32 svc_getu32(struct kvec *iov) - { -- u32 val, *vp; -+ __u32 val, *vp; - vp = iov->iov_base; - val = *vp++; - iov->iov_base = (void*)vp; -- iov->iov_len -= sizeof(u32); -+ iov->iov_len -= sizeof(__u32); - return val; - } --static inline void svc_putu32(struct kvec *iov, u32 val) -+static inline void svc_putu32(struct kvec *iov, __u32 val) - { -- u32 *vp = iov->iov_base + iov->iov_len; -+ __u32 *vp = iov->iov_base + iov->iov_len; - *vp = val; -- iov->iov_len += sizeof(u32); -+ iov->iov_len += sizeof(__u32); - } - - -@@ -119,11 +119,11 @@ - short rq_arghi; /* pages available in argument page list */ - short rq_resused; /* pages used for result */ - -- u32 rq_xid; /* transmission id */ -- u32 rq_prog; /* program number */ -- u32 rq_vers; /* program version */ -- u32 rq_proc; /* procedure number */ -- u32 rq_prot; /* IP protocol */ -+ __u32 rq_xid; /* transmission id */ -+ __u32 rq_prog; /* program number */ -+ __u32 rq_vers; /* program version */ -+ __u32 rq_proc; /* procedure number */ -+ __u32 rq_prot; /* IP protocol */ - unsigned short - rq_secure : 1; /* secure port */ - -@@ -156,7 +156,7 @@ - * Check buffer bounds after decoding arguments - */ - static inline int --xdr_argsize_check(struct svc_rqst *rqstp, u32 *p) -+xdr_argsize_check(struct svc_rqst *rqstp, __u32 *p) - { - char *cp = (char *)p; - struct kvec *vec = &rqstp->rq_arg.head[0]; -@@ -164,7 +164,7 @@ - } - - static inline int --xdr_ressize_check(struct svc_rqst *rqstp, u32 *p) -+xdr_ressize_check(struct svc_rqst *rqstp, __u32 *p) - { - struct kvec *vec = &rqstp->rq_res.head[0]; - char *cp = (char*)p; -@@ -220,19 +220,19 @@ - } - - struct svc_deferred_req { -- u32 prot; /* protocol (UDP or TCP) */ -+ __u32 prot; /* protocol (UDP or TCP) */ - struct sockaddr_in addr; - struct svc_sock *svsk; /* where reply must go */ - struct cache_deferred_req handle; - int argslen; -- u32 args[0]; -+ __u32 args[0]; - }; - - /* - * RPC program - */ - struct svc_program { -- u32 pg_prog; /* program number */ -+ __u32 pg_prog; /* program number */ - unsigned int pg_lovers; /* lowest version */ - unsigned int pg_hivers; /* lowest version */ - unsigned int pg_nvers; /* number of versions */ -@@ -246,16 +246,16 @@ - * RPC program version - */ - struct svc_version { -- u32 vs_vers; /* version number */ -- u32 vs_nproc; /* number of procedures */ -+ __u32 vs_vers; /* version number */ -+ __u32 vs_nproc; /* number of procedures */ - struct svc_procedure * vs_proc; /* per-procedure info */ -- u32 vs_xdrsize; /* xdrsize needed for this version */ -+ __u32 vs_xdrsize; /* xdrsize needed for this version */ - - /* Override dispatch function (e.g. when caching replies). - * A return value of 0 means drop the request. - * vs_dispatch == NULL means use default dispatcher. - */ -- int (*vs_dispatch)(struct svc_rqst *, u32 *); -+ int (*vs_dispatch)(struct svc_rqst *, __u32 *); - }; - - /* -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/xprt.h linux-libc-headers-2.6.8.0/include/linux/sunrpc/xprt.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/sunrpc/xprt.h 2004-06-23 16:52:58.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/sunrpc/xprt.h 2004-08-26 05:42:08.000000000 -0500 -@@ -93,7 +93,7 @@ - __u32 rq_xid; /* request XID */ - int rq_cong; /* has incremented xprt->cong */ - int rq_received; /* receive completed */ -- u32 rq_seqno; /* gss seq no. used on req. */ -+ __u32 rq_seqno; /* gss seq no. used on req. */ - - struct list_head rq_list; - -@@ -106,13 +106,13 @@ - /* - * For authentication (e.g. auth_des) - */ -- u32 rq_creddata[2]; -+ __u32 rq_creddata[2]; - - /* - * Partial send handling - */ - -- u32 rq_bytes_sent; /* Bytes we have sent */ -+ __u32 rq_bytes_sent; /* Bytes we have sent */ - - unsigned long rq_xtime; /* when transmitted */ - int rq_ntrans; -@@ -160,7 +160,7 @@ - /* - * State of TCP reply receive stuff - */ -- u32 tcp_recm, /* Fragment header */ -+ __u32 tcp_recm, /* Fragment header */ - tcp_xid, /* Current XID */ - tcp_reclen, /* fragment length */ - tcp_offset; /* fragment offset */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/suspend.h linux-libc-headers-2.6.8.0/include/linux/suspend.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/suspend.h 2004-08-18 13:16:05.000000000 -0500 -+++ linux-libc-headers-2.6.8.0/include/linux/suspend.h 2004-08-26 05:42:08.000000000 -0500 -@@ -23,7 +23,7 @@ - #define SWAP_FILENAME_MAXLENGTH 32 - - struct suspend_header { -- u32 version_code; -+ __u32 version_code; - unsigned long num_physpages; - char machine[8]; - char version[20]; -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sysdev.h linux-libc-headers-2.6.8.0/include/linux/sysdev.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/sysdev.h 2004-03-28 07:52:11.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/sysdev.h 2004-08-26 05:42:08.000000000 -0500 -@@ -31,7 +31,7 @@ - - /* Default operations for these types of devices */ - int (*shutdown)(struct sys_device *); -- int (*suspend)(struct sys_device *, u32 state); -+ int (*suspend)(struct sys_device *, __u32 state); - int (*resume)(struct sys_device *); - struct kset kset; - }; -@@ -50,7 +50,7 @@ - int (*add)(struct sys_device *); - int (*remove)(struct sys_device *); - int (*shutdown)(struct sys_device *); -- int (*suspend)(struct sys_device *, u32 state); -+ int (*suspend)(struct sys_device *, __u32 state); - int (*resume)(struct sys_device *); - }; - -@@ -65,7 +65,7 @@ - */ - - struct sys_device { -- u32 id; -+ __u32 id; - struct sysdev_class * cls; - struct kobject kobj; - }; -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/sysv_fs.h linux-libc-headers-2.6.8.0/include/linux/sysv_fs.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/sysv_fs.h 2003-12-15 12:46:58.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/sysv_fs.h 2004-08-26 05:42:08.000000000 -0500 -@@ -9,12 +9,12 @@ - - - /* inode numbers are 16 bit */ --typedef u16 sysv_ino_t; -+typedef __u16 sysv_ino_t; - - /* Block numbers are 24 bit, sometimes stored in 32 bit. - On Coherent FS, they are always stored in PDP-11 manner: the least - significant 16 bits come last. */ --typedef u32 sysv_zone_t; -+typedef __u32 sysv_zone_t; - - /* 0 is non-existent */ - #define SYSV_BADBL_INO 1 /* inode of bad blocks file */ -@@ -25,29 +25,29 @@ - #define XENIX_NICINOD 100 /* number of inode cache entries */ - #define XENIX_NICFREE 100 /* number of free block list chunk entries */ - struct xenix_super_block { -- u16 s_isize; /* index of first data zone */ -- u32 s_fsize __packed2__; /* total number of zones of this fs */ -+ __u16 s_isize; /* index of first data zone */ -+ __u32 s_fsize __packed2__; /* total number of zones of this fs */ - /* the start of the free block list: */ -- u16 s_nfree; /* number of free blocks in s_free, <= XENIX_NICFREE */ -- u32 s_free[XENIX_NICFREE]; /* first free block list chunk */ -+ __u16 s_nfree; /* number of free blocks in s_free, <= XENIX_NICFREE */ -+ __u32 s_free[XENIX_NICFREE]; /* first free block list chunk */ - /* the cache of free inodes: */ -- u16 s_ninode; /* number of free inodes in s_inode, <= XENIX_NICINOD */ -+ __u16 s_ninode; /* number of free inodes in s_inode, <= XENIX_NICINOD */ - sysv_ino_t s_inode[XENIX_NICINOD]; /* some free inodes */ - /* locks, not used by Linux: */ - char s_flock; /* lock during free block list manipulation */ - char s_ilock; /* lock during inode cache manipulation */ - char s_fmod; /* super-block modified flag */ - char s_ronly; /* flag whether fs is mounted read-only */ -- u32 s_time __packed2__; /* time of last super block update */ -- u32 s_tfree __packed2__; /* total number of free zones */ -- u16 s_tinode; /* total number of free inodes */ -- s16 s_dinfo[4]; /* device information ?? */ -+ __u32 s_time __packed2__; /* time of last super block update */ -+ __u32 s_tfree __packed2__; /* total number of free zones */ -+ __u16 s_tinode; /* total number of free inodes */ -+ __s16 s_dinfo[4]; /* device information ?? */ - char s_fname[6]; /* file system volume name */ - char s_fpack[6]; /* file system pack name */ - char s_clean; /* set to 0x46 when filesystem is properly unmounted */ - char s_fill[371]; -- s32 s_magic; /* version of file system */ -- s32 s_type; /* type of file system: 1 for 512 byte blocks -+ __s32 s_magic; /* version of file system */ -+ __s32 s_type; /* type of file system: 1 for 512 byte blocks - 2 for 1024 byte blocks - 3 for 2048 byte blocks */ - -@@ -63,61 +63,61 @@ - - /* SystemV4 super-block data on disk */ - struct sysv4_super_block { -- u16 s_isize; /* index of first data zone */ -- u16 s_pad0; -- u32 s_fsize; /* total number of zones of this fs */ -+ __u16 s_isize; /* index of first data zone */ -+ __u16 s_pad0; -+ __u32 s_fsize; /* total number of zones of this fs */ - /* the start of the free block list: */ -- u16 s_nfree; /* number of free blocks in s_free, <= SYSV_NICFREE */ -- u16 s_pad1; -- u32 s_free[SYSV_NICFREE]; /* first free block list chunk */ -+ __u16 s_nfree; /* number of free blocks in s_free, <= SYSV_NICFREE */ -+ __u16 s_pad1; -+ __u32 s_free[SYSV_NICFREE]; /* first free block list chunk */ - /* the cache of free inodes: */ -- u16 s_ninode; /* number of free inodes in s_inode, <= SYSV_NICINOD */ -- u16 s_pad2; -+ __u16 s_ninode; /* number of free inodes in s_inode, <= SYSV_NICINOD */ -+ __u16 s_pad2; - sysv_ino_t s_inode[SYSV_NICINOD]; /* some free inodes */ - /* locks, not used by Linux: */ - char s_flock; /* lock during free block list manipulation */ - char s_ilock; /* lock during inode cache manipulation */ - char s_fmod; /* super-block modified flag */ - char s_ronly; /* flag whether fs is mounted read-only */ -- u32 s_time; /* time of last super block update */ -- s16 s_dinfo[4]; /* device information ?? */ -- u32 s_tfree; /* total number of free zones */ -- u16 s_tinode; /* total number of free inodes */ -- u16 s_pad3; -+ __u32 s_time; /* time of last super block update */ -+ __s16 s_dinfo[4]; /* device information ?? */ -+ __u32 s_tfree; /* total number of free zones */ -+ __u16 s_tinode; /* total number of free inodes */ -+ __u16 s_pad3; - char s_fname[6]; /* file system volume name */ - char s_fpack[6]; /* file system pack name */ -- s32 s_fill[12]; -- s32 s_state; /* file system state: 0x7c269d38-s_time means clean */ -- s32 s_magic; /* version of file system */ -- s32 s_type; /* type of file system: 1 for 512 byte blocks -+ __s32 s_fill[12]; -+ __s32 s_state; /* file system state: 0x7c269d38-s_time means clean */ -+ __s32 s_magic; /* version of file system */ -+ __s32 s_type; /* type of file system: 1 for 512 byte blocks - 2 for 1024 byte blocks */ - }; - - /* SystemV2 super-block data on disk */ - struct sysv2_super_block { -- u16 s_isize; /* index of first data zone */ -- u32 s_fsize __packed2__; /* total number of zones of this fs */ -+ __u16 s_isize; /* index of first data zone */ -+ __u32 s_fsize __packed2__; /* total number of zones of this fs */ - /* the start of the free block list: */ -- u16 s_nfree; /* number of free blocks in s_free, <= SYSV_NICFREE */ -- u32 s_free[SYSV_NICFREE]; /* first free block list chunk */ -+ __u16 s_nfree; /* number of free blocks in s_free, <= SYSV_NICFREE */ -+ __u32 s_free[SYSV_NICFREE]; /* first free block list chunk */ - /* the cache of free inodes: */ -- u16 s_ninode; /* number of free inodes in s_inode, <= SYSV_NICINOD */ -+ __u16 s_ninode; /* number of free inodes in s_inode, <= SYSV_NICINOD */ - sysv_ino_t s_inode[SYSV_NICINOD]; /* some free inodes */ - /* locks, not used by Linux: */ - char s_flock; /* lock during free block list manipulation */ - char s_ilock; /* lock during inode cache manipulation */ - char s_fmod; /* super-block modified flag */ - char s_ronly; /* flag whether fs is mounted read-only */ -- u32 s_time __packed2__; /* time of last super block update */ -- s16 s_dinfo[4]; /* device information ?? */ -- u32 s_tfree __packed2__; /* total number of free zones */ -- u16 s_tinode; /* total number of free inodes */ -+ __u32 s_time __packed2__; /* time of last super block update */ -+ __s16 s_dinfo[4]; /* device information ?? */ -+ __u32 s_tfree __packed2__; /* total number of free zones */ -+ __u16 s_tinode; /* total number of free inodes */ - char s_fname[6]; /* file system volume name */ - char s_fpack[6]; /* file system pack name */ -- s32 s_fill[14]; -- s32 s_state; /* file system state: 0xcb096f43 means clean */ -- s32 s_magic; /* version of file system */ -- s32 s_type; /* type of file system: 1 for 512 byte blocks -+ __s32 s_fill[14]; -+ __s32 s_state; /* file system state: 0xcb096f43 means clean */ -+ __s32 s_magic; /* version of file system */ -+ __s32 s_type; /* type of file system: 1 for 512 byte blocks - 2 for 1024 byte blocks */ - }; - -@@ -125,25 +125,25 @@ - #define V7_NICINOD 100 /* number of inode cache entries */ - #define V7_NICFREE 50 /* number of free block list chunk entries */ - struct v7_super_block { -- u16 s_isize; /* index of first data zone */ -- u32 s_fsize __packed2__; /* total number of zones of this fs */ -+ __u16 s_isize; /* index of first data zone */ -+ __u32 s_fsize __packed2__; /* total number of zones of this fs */ - /* the start of the free block list: */ -- u16 s_nfree; /* number of free blocks in s_free, <= V7_NICFREE */ -- u32 s_free[V7_NICFREE]; /* first free block list chunk */ -+ __u16 s_nfree; /* number of free blocks in s_free, <= V7_NICFREE */ -+ __u32 s_free[V7_NICFREE]; /* first free block list chunk */ - /* the cache of free inodes: */ -- u16 s_ninode; /* number of free inodes in s_inode, <= V7_NICINOD */ -+ __u16 s_ninode; /* number of free inodes in s_inode, <= V7_NICINOD */ - sysv_ino_t s_inode[V7_NICINOD]; /* some free inodes */ - /* locks, not used by Linux or V7: */ - char s_flock; /* lock during free block list manipulation */ - char s_ilock; /* lock during inode cache manipulation */ - char s_fmod; /* super-block modified flag */ - char s_ronly; /* flag whether fs is mounted read-only */ -- u32 s_time __packed2__; /* time of last super block update */ -+ __u32 s_time __packed2__; /* time of last super block update */ - /* the following fields are not maintained by V7: */ -- u32 s_tfree __packed2__; /* total number of free zones */ -- u16 s_tinode; /* total number of free inodes */ -- u16 s_m; /* interleave factor */ -- u16 s_n; /* interleave factor */ -+ __u32 s_tfree __packed2__; /* total number of free zones */ -+ __u16 s_tinode; /* total number of free inodes */ -+ __u16 s_m; /* interleave factor */ -+ __u16 s_n; /* interleave factor */ - char s_fname[6]; /* file system name */ - char s_fpack[6]; /* file system pack name */ - }; -@@ -152,41 +152,41 @@ - #define COH_NICINOD 100 /* number of inode cache entries */ - #define COH_NICFREE 64 /* number of free block list chunk entries */ - struct coh_super_block { -- u16 s_isize; /* index of first data zone */ -- u32 s_fsize __packed2__; /* total number of zones of this fs */ -+ __u16 s_isize; /* index of first data zone */ -+ __u32 s_fsize __packed2__; /* total number of zones of this fs */ - /* the start of the free block list: */ -- u16 s_nfree; /* number of free blocks in s_free, <= COH_NICFREE */ -- u32 s_free[COH_NICFREE] __packed2__; /* first free block list chunk */ -+ __u16 s_nfree; /* number of free blocks in s_free, <= COH_NICFREE */ -+ __u32 s_free[COH_NICFREE] __packed2__; /* first free block list chunk */ - /* the cache of free inodes: */ -- u16 s_ninode; /* number of free inodes in s_inode, <= COH_NICINOD */ -+ __u16 s_ninode; /* number of free inodes in s_inode, <= COH_NICINOD */ - sysv_ino_t s_inode[COH_NICINOD]; /* some free inodes */ - /* locks, not used by Linux: */ - char s_flock; /* lock during free block list manipulation */ - char s_ilock; /* lock during inode cache manipulation */ - char s_fmod; /* super-block modified flag */ - char s_ronly; /* flag whether fs is mounted read-only */ -- u32 s_time __packed2__; /* time of last super block update */ -- u32 s_tfree __packed2__; /* total number of free zones */ -- u16 s_tinode; /* total number of free inodes */ -- u16 s_interleave_m; /* interleave factor */ -- u16 s_interleave_n; -+ __u32 s_time __packed2__; /* time of last super block update */ -+ __u32 s_tfree __packed2__; /* total number of free zones */ -+ __u16 s_tinode; /* total number of free inodes */ -+ __u16 s_interleave_m; /* interleave factor */ -+ __u16 s_interleave_n; - char s_fname[6]; /* file system volume name */ - char s_fpack[6]; /* file system pack name */ -- u32 s_unique; /* zero, not used */ -+ __u32 s_unique; /* zero, not used */ - }; - - /* SystemV/Coherent inode data on disk */ - struct sysv_inode { -- u16 i_mode; -- u16 i_nlink; -- u16 i_uid; -- u16 i_gid; -- u32 i_size; -- u8 i_data[3*(10+1+1+1)]; -- u8 i_gen; -- u32 i_atime; /* time of last access */ -- u32 i_mtime; /* time of last modification */ -- u32 i_ctime; /* time of creation */ -+ __u16 i_mode; -+ __u16 i_nlink; -+ __u16 i_uid; -+ __u16 i_gid; -+ __u32 i_size; -+ __u8 i_data[3*(10+1+1+1)]; -+ __u8 i_gen; -+ __u32 i_atime; /* time of last access */ -+ __u32 i_mtime; /* time of last modification */ -+ __u32 i_ctime; /* time of creation */ - }; - - /* SystemV/Coherent directory entry on disk */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/tiocl.h linux-libc-headers-2.6.8.0/include/linux/tiocl.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/tiocl.h 2003-12-15 12:46:58.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/tiocl.h 2004-08-26 05:42:08.000000000 -0500 -@@ -23,7 +23,7 @@ - - #define TIOCL_SELLOADLUT 5 - /* set characters to be considered alphabetic when selecting */ -- /* u32[8] bit array, 4 bytes-aligned with type */ -+ /* __u32[8] bit array, 4 bytes-aligned with type */ - - /* these two don't return a value: they write it back in the type */ - #define TIOCL_GETSHIFTSTATE 6 /* write shift state */ -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/umem.h linux-libc-headers-2.6.8.0/include/linux/umem.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/umem.h 2003-12-15 12:46:58.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/umem.h 2004-08-26 05:42:08.000000000 -0500 -@@ -110,19 +110,19 @@ - #define DMA_WRITE_TO_HOST 1 - - struct mm_dma_desc { -- u64 pci_addr; -- u64 local_addr; -- u32 transfer_size; -- u32 zero1; -- u64 next_desc_addr; -- u64 sem_addr; -- u32 control_bits; -- u32 zero2; -+ __u64 pci_addr; -+ __u64 local_addr; -+ __u32 transfer_size; -+ __u32 zero1; -+ __u64 next_desc_addr; -+ __u64 sem_addr; -+ __u32 control_bits; -+ __u32 zero2; - - dma_addr_t data_dma_handle; - - /* Copy of the bits */ -- u64 sem_control_bits; -+ __u64 sem_control_bits; - } __attribute__((aligned(8))); - - #define PCI_VENDOR_ID_MICRO_MEMORY 0x1332 -diff -urN linux-libc-headers-2.6.8.0-dist/include/linux/vt_buffer.h linux-libc-headers-2.6.8.0/include/linux/vt_buffer.h ---- linux-libc-headers-2.6.8.0-dist/include/linux/vt_buffer.h 2004-01-17 17:04:33.000000000 -0600 -+++ linux-libc-headers-2.6.8.0/include/linux/vt_buffer.h 2004-08-26 05:42:08.000000000 -0500 -@@ -28,7 +28,7 @@ - #endif - - #ifndef VT_BUF_HAVE_MEMSETW --static inline void scr_memsetw(u16 *s, u16 c, unsigned int count) -+static inline void scr_memsetw(__u16 *s, __u16 c, unsigned int count) - { - count /= 2; - while (count--) -@@ -37,7 +37,7 @@ - #endif - - #ifndef VT_BUF_HAVE_MEMCPYW --static inline void scr_memcpyw(u16 *d, const u16 *s, unsigned int count) -+static inline void scr_memcpyw(__u16 *d, const __u16 *s, unsigned int count) - { - count /= 2; - while (count--) -@@ -46,7 +46,7 @@ - #endif - - #ifndef VT_BUF_HAVE_MEMMOVEW --static inline void scr_memmovew(u16 *d, const u16 *s, unsigned int count) -+static inline void scr_memmovew(__u16 *d, const __u16 *s, unsigned int count) - { - if (d < s) - scr_memcpyw(d, s, count); diff --git a/toolchain/kernel-headers/linux-libc-headers-2.6.9-nios2nommu.patch.conditional b/toolchain/kernel-headers/linux-libc-headers-2.6.9-nios2nommu.patch.conditional deleted file mode 100644 index b828b3bb3f..0000000000 --- a/toolchain/kernel-headers/linux-libc-headers-2.6.9-nios2nommu.patch.conditional +++ /dev/null @@ -1,12925 +0,0 @@ ---- linux/include/asm-generic/bitops.h -+++ linux/include/asm-generic/bitops.h -@@ -0,0 +1,81 @@ -+#ifndef _ASM_GENERIC_BITOPS_H_ -+#define _ASM_GENERIC_BITOPS_H_ -+ -+/* -+ * For the benefit of those who are trying to port Linux to another -+ * architecture, here are some C-language equivalents. You should -+ * recode these in the native assembly language, if at all possible. -+ * To guarantee atomicity, these routines call cli() and sti() to -+ * disable interrupts while they operate. (You have to provide inline -+ * routines to cli() and sti().) -+ * -+ * Also note, these routines assume that you have 32 bit longs. -+ * You will have to change this if you are trying to port Linux to the -+ * Alpha architecture or to a Cray. :-) -+ * -+ * C language equivalents written by Theodore Ts'o, 9/26/92 -+ */ -+ -+extern __inline__ int set_bit(int nr,long * addr) -+{ -+ int mask, retval; -+ -+ addr += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ cli(); -+ retval = (mask & *addr) != 0; -+ *addr |= mask; -+ sti(); -+ return retval; -+} -+ -+extern __inline__ int clear_bit(int nr, long * addr) -+{ -+ int mask, retval; -+ -+ addr += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ cli(); -+ retval = (mask & *addr) != 0; -+ *addr &= ~mask; -+ sti(); -+ return retval; -+} -+ -+extern __inline__ int test_bit(int nr, const unsigned long * addr) -+{ -+ int mask; -+ -+ addr += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ return ((mask & *addr) != 0); -+} -+ -+/* -+ * fls: find last bit set. -+ */ -+ -+#define fls(x) generic_fls(x) -+ -+#ifdef __KERNEL__ -+ -+/* -+ * ffs: find first bit set. This is defined the same way as -+ * the libc and compiler builtin ffs routines, therefore -+ * differs in spirit from the above ffz (man ffs). -+ */ -+ -+#define ffs(x) generic_ffs(x) -+ -+/* -+ * hweightN: returns the hamming weight (i.e. the number -+ * of bits set) of a N-bit word -+ */ -+ -+#define hweight32(x) generic_hweight32(x) -+#define hweight16(x) generic_hweight16(x) -+#define hweight8(x) generic_hweight8(x) -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _ASM_GENERIC_BITOPS_H */ ---- linux/include/asm-generic/bug.h -+++ linux/include/asm-generic/bug.h -@@ -0,0 +1,34 @@ -+#ifndef _ASM_GENERIC_BUG_H -+#define _ASM_GENERIC_BUG_H -+ -+#include -+// #include -+ -+#ifndef HAVE_ARCH_BUG -+#define BUG() do { \ -+ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ -+ panic("BUG!"); \ -+} while (0) -+#endif -+ -+#ifndef HAVE_ARCH_PAGE_BUG -+#define PAGE_BUG(page) do { \ -+ printk("page BUG for page at %p\n", page); \ -+ BUG(); \ -+} while (0) -+#endif -+ -+#ifndef HAVE_ARCH_BUG_ON -+#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0) -+#endif -+ -+#ifndef HAVE_ARCH_WARN_ON -+#define WARN_ON(condition) do { \ -+ if (unlikely((condition)!=0)) { \ -+ printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \ -+ dump_stack(); \ -+ } \ -+} while (0) -+#endif -+ -+#endif ---- linux/include/asm-generic/cpumask.h -+++ linux/include/asm-generic/cpumask.h -@@ -0,0 +1,40 @@ -+#ifndef __ASM_GENERIC_CPUMASK_H -+#define __ASM_GENERIC_CPUMASK_H -+ -+// #include -+#include -+#include -+#include -+#include -+ -+#if NR_CPUS > BITS_PER_LONG && NR_CPUS != 1 -+#define CPU_ARRAY_SIZE BITS_TO_LONGS(NR_CPUS) -+ -+struct cpumask -+{ -+ unsigned long mask[CPU_ARRAY_SIZE]; -+}; -+ -+typedef struct cpumask cpumask_t; -+ -+#else -+typedef unsigned long cpumask_t; -+#endif -+ -+#ifdef CONFIG_SMP -+#if NR_CPUS > BITS_PER_LONG -+#include -+#else -+#include -+#endif -+#else -+#include -+#endif -+ -+#if NR_CPUS <= 4*BITS_PER_LONG -+#include -+#else -+#include -+#endif -+ -+#endif /* __ASM_GENERIC_CPUMASK_H */ ---- linux/include/asm-generic/cpumask_arith.h -+++ linux/include/asm-generic/cpumask_arith.h -@@ -0,0 +1,49 @@ -+#ifndef __ASM_GENERIC_CPUMASK_ARITH_H -+#define __ASM_GENERIC_CPUMASK_ARITH_H -+ -+/* -+ * Arithmetic type -based cpu bitmaps. A single unsigned long is used -+ * to contain the whole cpu bitmap. -+ */ -+ -+#define cpu_set(cpu, map) set_bit(cpu, &(map)) -+#define cpu_clear(cpu, map) clear_bit(cpu, &(map)) -+#define cpu_isset(cpu, map) test_bit(cpu, &(map)) -+#define cpu_test_and_set(cpu, map) test_and_set_bit(cpu, &(map)) -+ -+#define cpus_and(dst,src1,src2) do { dst = (src1) & (src2); } while (0) -+#define cpus_or(dst,src1,src2) do { dst = (src1) | (src2); } while (0) -+#define cpus_clear(map) do { map = 0; } while (0) -+#define cpus_complement(map) do { map = ~(map); } while (0) -+#define cpus_equal(map1, map2) ((map1) == (map2)) -+#define cpus_empty(map) ((map) == 0) -+#define cpus_addr(map) (&(map)) -+ -+#if BITS_PER_LONG == 32 -+#define cpus_weight(map) hweight32(map) -+#elif BITS_PER_LONG == 64 -+#define cpus_weight(map) hweight64(map) -+#endif -+ -+#define cpus_shift_right(dst, src, n) do { dst = (src) >> (n); } while (0) -+#define cpus_shift_left(dst, src, n) do { dst = (src) << (n); } while (0) -+ -+#define any_online_cpu(map) \ -+({ \ -+ cpumask_t __tmp__; \ -+ cpus_and(__tmp__, map, cpu_online_map); \ -+ __tmp__ ? first_cpu(__tmp__) : NR_CPUS; \ -+}) -+ -+#define CPU_MASK_ALL (~((cpumask_t)0) >> (8*sizeof(cpumask_t) - NR_CPUS)) -+#define CPU_MASK_NONE ((cpumask_t)0) -+ -+/* only ever use this for things that are _never_ used on large boxen */ -+#define cpus_coerce(map) ((unsigned long)(map)) -+#define cpus_promote(map) ({ map; }) -+#define cpumask_of_cpu(cpu) ({ ((cpumask_t)1) << (cpu); }) -+ -+#define first_cpu(map) __ffs(map) -+#define next_cpu(cpu, map) find_next_bit(&(map), NR_CPUS, cpu + 1) -+ -+#endif /* __ASM_GENERIC_CPUMASK_ARITH_H */ ---- linux/include/asm-generic/cpumask_array.h -+++ linux/include/asm-generic/cpumask_array.h -@@ -0,0 +1,54 @@ -+#ifndef __ASM_GENERIC_CPUMASK_ARRAY_H -+#define __ASM_GENERIC_CPUMASK_ARRAY_H -+ -+/* -+ * Array-based cpu bitmaps. An array of unsigned longs is used to contain -+ * the bitmap, and then contained in a structure so it may be passed by -+ * value. -+ */ -+ -+#define CPU_ARRAY_SIZE BITS_TO_LONGS(NR_CPUS) -+ -+#define cpu_set(cpu, map) set_bit(cpu, (map).mask) -+#define cpu_clear(cpu, map) clear_bit(cpu, (map).mask) -+#define cpu_isset(cpu, map) test_bit(cpu, (map).mask) -+#define cpu_test_and_set(cpu, map) test_and_set_bit(cpu, (map).mask) -+ -+#define cpus_and(dst,src1,src2) bitmap_and((dst).mask,(src1).mask, (src2).mask, NR_CPUS) -+#define cpus_or(dst,src1,src2) bitmap_or((dst).mask, (src1).mask, (src2).mask, NR_CPUS) -+#define cpus_clear(map) bitmap_clear((map).mask, NR_CPUS) -+#define cpus_complement(map) bitmap_complement((map).mask, NR_CPUS) -+#define cpus_equal(map1, map2) bitmap_equal((map1).mask, (map2).mask, NR_CPUS) -+#define cpus_empty(map) bitmap_empty(map.mask, NR_CPUS) -+#define cpus_addr(map) ((map).mask) -+#define cpus_weight(map) bitmap_weight((map).mask, NR_CPUS) -+#define cpus_shift_right(d, s, n) bitmap_shift_right((d).mask, (s).mask, n, NR_CPUS) -+#define cpus_shift_left(d, s, n) bitmap_shift_left((d).mask, (s).mask, n, NR_CPUS) -+#define first_cpu(map) find_first_bit((map).mask, NR_CPUS) -+#define next_cpu(cpu, map) find_next_bit((map).mask, NR_CPUS, cpu + 1) -+ -+/* only ever use this for things that are _never_ used on large boxen */ -+#define cpus_coerce(map) ((map).mask[0]) -+#define cpus_promote(map) ({ cpumask_t __cpu_mask = CPU_MASK_NONE;\ -+ __cpu_mask.mask[0] = map; \ -+ __cpu_mask; \ -+ }) -+#define cpumask_of_cpu(cpu) ({ cpumask_t __cpu_mask = CPU_MASK_NONE;\ -+ cpu_set(cpu, __cpu_mask); \ -+ __cpu_mask; \ -+ }) -+#define any_online_cpu(map) \ -+({ \ -+ cpumask_t __tmp__; \ -+ cpus_and(__tmp__, map, cpu_online_map); \ -+ find_first_bit(__tmp__.mask, NR_CPUS); \ -+}) -+ -+ -+/* -+ * um, these need to be usable as static initializers -+ */ -+#define CPU_MASK_ALL { {[0 ... CPU_ARRAY_SIZE-1] = ~0UL} } -+#define CPU_MASK_NONE { {[0 ... CPU_ARRAY_SIZE-1] = 0UL} } -+ -+#endif /* __ASM_GENERIC_CPUMASK_ARRAY_H */ ---- linux/include/asm-generic/cpumask_const_reference.h -+++ linux/include/asm-generic/cpumask_const_reference.h -@@ -0,0 +1,29 @@ -+#ifndef __ASM_GENERIC_CPUMASK_CONST_REFERENCE_H -+#define __ASM_GENERIC_CPUMASK_CONST_REFERENCE_H -+ -+struct cpumask_ref { -+ const cpumask_t *val; -+}; -+ -+typedef const struct cpumask_ref cpumask_const_t; -+ -+#define mk_cpumask_const(map) ((cpumask_const_t){ &(map) }) -+#define cpu_isset_const(cpu, map) cpu_isset(cpu, *(map).val) -+ -+#define cpus_and_const(dst,src1,src2) cpus_and(dst,*(src1).val,*(src2).val) -+#define cpus_or_const(dst,src1,src2) cpus_or(dst,*(src1).val,*(src2).val) -+ -+#define cpus_equal_const(map1, map2) cpus_equal(*(map1).val, *(map2).val) -+ -+#define cpus_copy_const(map1, map2) bitmap_copy((map1).mask, (map2).val->mask, NR_CPUS) -+ -+#define cpus_empty_const(map) cpus_empty(*(map).val) -+#define cpus_weight_const(map) cpus_weight(*(map).val) -+#define first_cpu_const(map) first_cpu(*(map).val) -+#define next_cpu_const(cpu, map) next_cpu(cpu, *(map).val) -+ -+/* only ever use this for things that are _never_ used on large boxen */ -+#define cpus_coerce_const(map) cpus_coerce(*(map).val) -+#define any_online_cpu_const(map) any_online_cpu(*(map).val) -+ -+#endif /* __ASM_GENERIC_CPUMASK_CONST_REFERENCE_H */ ---- linux/include/asm-generic/cpumask_const_value.h -+++ linux/include/asm-generic/cpumask_const_value.h -@@ -0,0 +1,21 @@ -+#ifndef __ASM_GENERIC_CPUMASK_CONST_VALUE_H -+#define __ASM_GENERIC_CPUMASK_CONST_VALUE_H -+ -+typedef const cpumask_t cpumask_const_t; -+ -+#define mk_cpumask_const(map) (map) -+#define cpu_isset_const(cpu, map) cpu_isset(cpu, map) -+#define cpus_and_const(dst,src1,src2) cpus_and(dst, src1, src2) -+#define cpus_or_const(dst,src1,src2) cpus_or(dst, src1, src2) -+#define cpus_equal_const(map1, map2) cpus_equal(map1, map2) -+#define cpus_empty_const(map) cpus_empty(map) -+#define cpus_copy_const(map1, map2) do { map1 = (cpumask_t)map2; } while (0) -+#define cpus_weight_const(map) cpus_weight(map) -+#define first_cpu_const(map) first_cpu(map) -+#define next_cpu_const(cpu, map) next_cpu(cpu, map) -+ -+/* only ever use this for things that are _never_ used on large boxen */ -+#define cpus_coerce_const(map) cpus_coerce(map) -+#define any_online_cpu_const(map) any_online_cpu(map) -+ -+#endif /* __ASM_GENERIC_CPUMASK_CONST_VALUE_H */ ---- linux/include/asm-generic/cpumask_up.h -+++ linux/include/asm-generic/cpumask_up.h -@@ -0,0 +1,59 @@ -+#ifndef __ASM_GENERIC_CPUMASK_UP_H -+#define __ASM_GENERIC_CPUMASK_UP_H -+ -+#define cpus_coerce(map) (map) -+ -+#define cpu_set(cpu, map) do { (void)(cpu); cpus_coerce(map) = 1UL; } while (0) -+#define cpu_clear(cpu, map) do { (void)(cpu); cpus_coerce(map) = 0UL; } while (0) -+#define cpu_isset(cpu, map) ((void)(cpu), cpus_coerce(map) != 0UL) -+#define cpu_test_and_set(cpu, map) ((void)(cpu), test_and_set_bit(0, &(map))) -+ -+#define cpus_and(dst, src1, src2) \ -+ do { \ -+ if (cpus_coerce(src1) && cpus_coerce(src2)) \ -+ cpus_coerce(dst) = 1UL; \ -+ else \ -+ cpus_coerce(dst) = 0UL; \ -+ } while (0) -+ -+#define cpus_or(dst, src1, src2) \ -+ do { \ -+ if (cpus_coerce(src1) || cpus_coerce(src2)) \ -+ cpus_coerce(dst) = 1UL; \ -+ else \ -+ cpus_coerce(dst) = 0UL; \ -+ } while (0) -+ -+#define cpus_clear(map) do { cpus_coerce(map) = 0UL; } while (0) -+ -+#define cpus_complement(map) \ -+ do { \ -+ cpus_coerce(map) = !cpus_coerce(map); \ -+ } while (0) -+ -+#define cpus_equal(map1, map2) (cpus_coerce(map1) == cpus_coerce(map2)) -+#define cpus_empty(map) (cpus_coerce(map) == 0UL) -+#define cpus_addr(map) (&(map)) -+#define cpus_weight(map) (cpus_coerce(map) ? 1UL : 0UL) -+#define cpus_shift_right(d, s, n) do { cpus_coerce(d) = 0UL; } while (0) -+#define cpus_shift_left(d, s, n) do { cpus_coerce(d) = 0UL; } while (0) -+#define first_cpu(map) (cpus_coerce(map) ? 0 : 1) -+#define next_cpu(cpu, map) 1 -+ -+/* only ever use this for things that are _never_ used on large boxen */ -+#define cpus_promote(map) \ -+ ({ \ -+ cpumask_t __tmp__; \ -+ cpus_coerce(__tmp__) = map; \ -+ __tmp__; \ -+ }) -+#define cpumask_of_cpu(cpu) ((void)(cpu), cpus_promote(1)) -+#define any_online_cpu(map) (cpus_coerce(map) ? 0 : 1) -+ -+/* -+ * um, these need to be usable as static initializers -+ */ -+#define CPU_MASK_ALL 1UL -+#define CPU_MASK_NONE 0UL -+ -+#endif /* __ASM_GENERIC_CPUMASK_UP_H */ ---- linux/include/asm-generic/div64.h -+++ linux/include/asm-generic/div64.h -@@ -0,0 +1,58 @@ -+#ifndef _ASM_GENERIC_DIV64_H -+#define _ASM_GENERIC_DIV64_H -+/* -+ * Copyright (C) 2003 Bernardo Innocenti -+ * Based on former asm-ppc/div64.h and asm-m68knommu/div64.h -+ * -+ * The semantics of do_div() are: -+ * -+ * uint32_t do_div(uint64_t *n, uint32_t base) -+ * { -+ * uint32_t remainder = *n % base; -+ * *n = *n / base; -+ * return remainder; -+ * } -+ * -+ * NOTE: macro parameter n is evaluated multiple times, -+ * beware of side effects! -+ */ -+ -+#include -+#include -+ -+#if BITS_PER_LONG == 64 -+ -+# define do_div(n,base) ({ \ -+ uint32_t __base = (base); \ -+ uint32_t __rem; \ -+ __rem = ((uint64_t)(n)) % __base; \ -+ (n) = ((uint64_t)(n)) / __base; \ -+ __rem; \ -+ }) -+ -+#elif BITS_PER_LONG == 32 -+ -+extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor); -+ -+/* The unnecessary pointer compare is there -+ * to check for type safety (n must be 64bit) -+ */ -+# define do_div(n,base) ({ \ -+ uint32_t __base = (base); \ -+ uint32_t __rem; \ -+ (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \ -+ if (likely(((n) >> 32) == 0)) { \ -+ __rem = (uint32_t)(n) % __base; \ -+ (n) = (uint32_t)(n) / __base; \ -+ } else \ -+ __rem = __div64_32(&(n), __base); \ -+ __rem; \ -+ }) -+ -+#else /* BITS_PER_LONG == ?? */ -+ -+# error do_div() does not yet support the C64 -+ -+#endif /* BITS_PER_LONG */ -+ -+#endif /* _ASM_GENERIC_DIV64_H */ ---- linux/include/asm-generic/dma-mapping-broken.h -+++ linux/include/asm-generic/dma-mapping-broken.h -@@ -0,0 +1,22 @@ -+#ifndef _ASM_GENERIC_DMA_MAPPING_H -+#define _ASM_GENERIC_DMA_MAPPING_H -+ -+/* This is used for archs that do not support DMA */ -+ -+ -+static inline void * -+dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, -+ int flag) -+{ -+ BUG(); -+ return 0; -+} -+ -+static inline void -+dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, -+ dma_addr_t dma_handle) -+{ -+ BUG(); -+} -+ -+#endif /* _ASM_GENERIC_DMA_MAPPING_H */ ---- linux/include/asm-generic/dma-mapping.h -+++ linux/include/asm-generic/dma-mapping.h -@@ -0,0 +1,309 @@ -+/* Copyright (C) 2002 by James.Bottomley@HansenPartnership.com -+ * -+ * Implements the generic device dma API via the existing pci_ one -+ * for unconverted architectures -+ */ -+ -+#ifndef _ASM_GENERIC_DMA_MAPPING_H -+#define _ASM_GENERIC_DMA_MAPPING_H -+ -+// #include -+ -+#ifdef CONFIG_PCI -+ -+/* we implement the API below in terms of the existing PCI one, -+ * so include it */ -+#include -+/* need struct page definitions */ -+#include -+ -+static inline int -+dma_supported(struct device *dev, u64 mask) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ return pci_dma_supported(to_pci_dev(dev), mask); -+} -+ -+static inline int -+dma_set_mask(struct device *dev, u64 dma_mask) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ return pci_set_dma_mask(to_pci_dev(dev), dma_mask); -+} -+ -+static inline void * -+dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, -+ int flag) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ return pci_alloc_consistent(to_pci_dev(dev), size, dma_handle); -+} -+ -+static inline void -+dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, -+ dma_addr_t dma_handle) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle); -+} -+ -+static inline dma_addr_t -+dma_map_single(struct device *dev, void *cpu_addr, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction); -+} -+ -+static inline void -+dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction); -+} -+ -+static inline dma_addr_t -+dma_map_page(struct device *dev, struct page *page, -+ unsigned long offset, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction); -+} -+ -+static inline void -+dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction); -+} -+ -+static inline int -+dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction); -+} -+ -+static inline void -+dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction); -+} -+ -+static inline void -+dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_dma_sync_single_for_cpu(to_pci_dev(dev), dma_handle, -+ size, (int)direction); -+} -+ -+static inline void -+dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_dma_sync_single_for_device(to_pci_dev(dev), dma_handle, -+ size, (int)direction); -+} -+ -+static inline void -+dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_dma_sync_sg_for_cpu(to_pci_dev(dev), sg, nelems, (int)direction); -+} -+ -+static inline void -+dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, -+ enum dma_data_direction direction) -+{ -+ BUG_ON(dev->bus != &pci_bus_type); -+ -+ pci_dma_sync_sg_for_device(to_pci_dev(dev), sg, nelems, (int)direction); -+} -+ -+static inline int -+dma_mapping_error(dma_addr_t dma_addr) -+{ -+ return pci_dma_mapping_error(dma_addr); -+} -+ -+ -+#else -+ -+static inline int -+dma_supported(struct device *dev, u64 mask) -+{ -+ return 0; -+} -+ -+static inline int -+dma_set_mask(struct device *dev, u64 dma_mask) -+{ -+ BUG(); -+ return 0; -+} -+ -+static inline void * -+dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, -+ int flag) -+{ -+ BUG(); -+ return NULL; -+} -+ -+static inline void -+dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, -+ dma_addr_t dma_handle) -+{ -+ BUG(); -+} -+ -+static inline dma_addr_t -+dma_map_single(struct device *dev, void *cpu_addr, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+ return 0; -+} -+ -+static inline void -+dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline dma_addr_t -+dma_map_page(struct device *dev, struct page *page, -+ unsigned long offset, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+ return 0; -+} -+ -+static inline void -+dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline int -+dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+ return 0; -+} -+ -+static inline void -+dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline void -+dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline void -+dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline void -+dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline void -+dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, -+ enum dma_data_direction direction) -+{ -+ BUG(); -+} -+ -+static inline int -+dma_error(dma_addr_t dma_addr) -+{ -+ return 0; -+} -+ -+#endif -+ -+/* Now for the API extensions over the pci_ one */ -+ -+#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) -+#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) -+#define dma_is_consistent(d) (1) -+ -+static inline int -+dma_get_cache_alignment(void) -+{ -+ /* no easy way to get cache size on all processors, so return -+ * the maximum possible, to be safe */ -+ return (1 << L1_CACHE_SHIFT_MAX); -+} -+ -+static inline void -+dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, -+ unsigned long offset, size_t size, -+ enum dma_data_direction direction) -+{ -+ /* just sync everything, that's all the pci API can do */ -+ dma_sync_single_for_cpu(dev, dma_handle, offset+size, direction); -+} -+ -+static inline void -+dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, -+ unsigned long offset, size_t size, -+ enum dma_data_direction direction) -+{ -+ /* just sync everything, that's all the pci API can do */ -+ dma_sync_single_for_device(dev, dma_handle, offset+size, direction); -+} -+ -+static inline void -+dma_cache_sync(void *vaddr, size_t size, -+ enum dma_data_direction direction) -+{ -+ /* could define this in terms of the dma_cache ... operations, -+ * but if you get this on a platform, you should convert the platform -+ * to using the generic device DMA API */ -+ BUG(); -+} -+ -+#endif -+ ---- linux/include/asm-generic/errno-base.h -+++ linux/include/asm-generic/errno-base.h -@@ -0,0 +1,39 @@ -+#ifndef _ASM_GENERIC_ERRNO_BASE_H -+#define _ASM_GENERIC_ERRNO_BASE_H -+ -+#define EPERM 1 /* Operation not permitted */ -+#define ENOENT 2 /* No such file or directory */ -+#define ESRCH 3 /* No such process */ -+#define EINTR 4 /* Interrupted system call */ -+#define EIO 5 /* I/O error */ -+#define ENXIO 6 /* No such device or address */ -+#define E2BIG 7 /* Argument list too long */ -+#define ENOEXEC 8 /* Exec format error */ -+#define EBADF 9 /* Bad file number */ -+#define ECHILD 10 /* No child processes */ -+#define EAGAIN 11 /* Try again */ -+#define ENOMEM 12 /* Out of memory */ -+#define EACCES 13 /* Permission denied */ -+#define EFAULT 14 /* Bad address */ -+#define ENOTBLK 15 /* Block device required */ -+#define EBUSY 16 /* Device or resource busy */ -+#define EEXIST 17 /* File exists */ -+#define EXDEV 18 /* Cross-device link */ -+#define ENODEV 19 /* No such device */ -+#define ENOTDIR 20 /* Not a directory */ -+#define EISDIR 21 /* Is a directory */ -+#define EINVAL 22 /* Invalid argument */ -+#define ENFILE 23 /* File table overflow */ -+#define EMFILE 24 /* Too many open files */ -+#define ENOTTY 25 /* Not a typewriter */ -+#define ETXTBSY 26 /* Text file busy */ -+#define EFBIG 27 /* File too large */ -+#define ENOSPC 28 /* No space left on device */ -+#define ESPIPE 29 /* Illegal seek */ -+#define EROFS 30 /* Read-only file system */ -+#define EMLINK 31 /* Too many links */ -+#define EPIPE 32 /* Broken pipe */ -+#define EDOM 33 /* Math argument out of domain of func */ -+#define ERANGE 34 /* Math result not representable */ -+ -+#endif ---- linux/include/asm-generic/errno.h -+++ linux/include/asm-generic/errno.h -@@ -0,0 +1,100 @@ -+#ifndef _ASM_GENERIC_ERRNO_H -+#define _ASM_GENERIC_ERRNO_H -+ -+#include -+ -+#define EDEADLK 35 /* Resource deadlock would occur */ -+#define ENAMETOOLONG 36 /* File name too long */ -+#define ENOLCK 37 /* No record locks available */ -+#define ENOSYS 38 /* Function not implemented */ -+#define ENOTEMPTY 39 /* Directory not empty */ -+#define ELOOP 40 /* Too many symbolic links encountered */ -+#define EWOULDBLOCK EAGAIN /* Operation would block */ -+#define ENOMSG 42 /* No message of desired type */ -+#define EIDRM 43 /* Identifier removed */ -+#define ECHRNG 44 /* Channel number out of range */ -+#define EL2NSYNC 45 /* Level 2 not synchronized */ -+#define EL3HLT 46 /* Level 3 halted */ -+#define EL3RST 47 /* Level 3 reset */ -+#define ELNRNG 48 /* Link number out of range */ -+#define EUNATCH 49 /* Protocol driver not attached */ -+#define ENOCSI 50 /* No CSI structure available */ -+#define EL2HLT 51 /* Level 2 halted */ -+#define EBADE 52 /* Invalid exchange */ -+#define EBADR 53 /* Invalid request descriptor */ -+#define EXFULL 54 /* Exchange full */ -+#define ENOANO 55 /* No anode */ -+#define EBADRQC 56 /* Invalid request code */ -+#define EBADSLT 57 /* Invalid slot */ -+ -+#define EDEADLOCK EDEADLK -+ -+#define EBFONT 59 /* Bad font file format */ -+#define ENOSTR 60 /* Device not a stream */ -+#define ENODATA 61 /* No data available */ -+#define ETIME 62 /* Timer expired */ -+#define ENOSR 63 /* Out of streams resources */ -+#define ENONET 64 /* Machine is not on the network */ -+#define ENOPKG 65 /* Package not installed */ -+#define EREMOTE 66 /* Object is remote */ -+#define ENOLINK 67 /* Link has been severed */ -+#define EADV 68 /* Advertise error */ -+#define ESRMNT 69 /* Srmount error */ -+#define ECOMM 70 /* Communication error on send */ -+#define EPROTO 71 /* Protocol error */ -+#define EMULTIHOP 72 /* Multihop attempted */ -+#define EDOTDOT 73 /* RFS specific error */ -+#define EBADMSG 74 /* Not a data message */ -+#define EOVERFLOW 75 /* Value too large for defined data type */ -+#define ENOTUNIQ 76 /* Name not unique on network */ -+#define EBADFD 77 /* File descriptor in bad state */ -+#define EREMCHG 78 /* Remote address changed */ -+#define ELIBACC 79 /* Can not access a needed shared library */ -+#define ELIBBAD 80 /* Accessing a corrupted shared library */ -+#define ELIBSCN 81 /* .lib section in a.out corrupted */ -+#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ -+#define ELIBEXEC 83 /* Cannot exec a shared library directly */ -+#define EILSEQ 84 /* Illegal byte sequence */ -+#define ERESTART 85 /* Interrupted system call should be restarted */ -+#define ESTRPIPE 86 /* Streams pipe error */ -+#define EUSERS 87 /* Too many users */ -+#define ENOTSOCK 88 /* Socket operation on non-socket */ -+#define EDESTADDRREQ 89 /* Destination address required */ -+#define EMSGSIZE 90 /* Message too long */ -+#define EPROTOTYPE 91 /* Protocol wrong type for socket */ -+#define ENOPROTOOPT 92 /* Protocol not available */ -+#define EPROTONOSUPPORT 93 /* Protocol not supported */ -+#define ESOCKTNOSUPPORT 94 /* Socket type not supported */ -+#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -+#define EPFNOSUPPORT 96 /* Protocol family not supported */ -+#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ -+#define EADDRINUSE 98 /* Address already in use */ -+#define EADDRNOTAVAIL 99 /* Cannot assign requested address */ -+#define ENETDOWN 100 /* Network is down */ -+#define ENETUNREACH 101 /* Network is unreachable */ -+#define ENETRESET 102 /* Network dropped connection because of reset */ -+#define ECONNABORTED 103 /* Software caused connection abort */ -+#define ECONNRESET 104 /* Connection reset by peer */ -+#define ENOBUFS 105 /* No buffer space available */ -+#define EISCONN 106 /* Transport endpoint is already connected */ -+#define ENOTCONN 107 /* Transport endpoint is not connected */ -+#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ -+#define ETOOMANYREFS 109 /* Too many references: cannot splice */ -+#define ETIMEDOUT 110 /* Connection timed out */ -+#define ECONNREFUSED 111 /* Connection refused */ -+#define EHOSTDOWN 112 /* Host is down */ -+#define EHOSTUNREACH 113 /* No route to host */ -+#define EALREADY 114 /* Operation already in progress */ -+#define EINPROGRESS 115 /* Operation now in progress */ -+#define ESTALE 116 /* Stale NFS file handle */ -+#define EUCLEAN 117 /* Structure needs cleaning */ -+#define ENOTNAM 118 /* Not a XENIX named type file */ -+#define ENAVAIL 119 /* No XENIX semaphores available */ -+#define EISNAM 120 /* Is a named type file */ -+#define EREMOTEIO 121 /* Remote I/O error */ -+#define EDQUOT 122 /* Quota exceeded */ -+ -+#define ENOMEDIUM 123 /* No medium found */ -+#define EMEDIUMTYPE 124 /* Wrong medium type */ -+ -+#endif ---- linux/include/asm-generic/hdreg.h -+++ linux/include/asm-generic/hdreg.h -@@ -0,0 +1,8 @@ -+#warning is obsolete, please do not use it -+ -+#ifndef __ASM_GENERIC_HDREG_H -+#define __ASM_GENERIC_HDREG_H -+ -+typedef unsigned long ide_ioreg_t; -+ -+#endif /* __ASM_GENERIC_HDREG_H */ ---- linux/include/asm-generic/ide_iops.h -+++ linux/include/asm-generic/ide_iops.h -@@ -0,0 +1,38 @@ -+/* Generic I/O and MEMIO string operations. */ -+ -+#define __ide_insw insw -+#define __ide_insl insl -+#define __ide_outsw outsw -+#define __ide_outsl outsl -+ -+static __inline__ void __ide_mm_insw(void __iomem *port, void *addr, u32 count) -+{ -+ while (count--) { -+ *(u16 *)addr = readw(port); -+ addr += 2; -+ } -+} -+ -+static __inline__ void __ide_mm_insl(void __iomem *port, void *addr, u32 count) -+{ -+ while (count--) { -+ *(u32 *)addr = readl(port); -+ addr += 4; -+ } -+} -+ -+static __inline__ void __ide_mm_outsw(void __iomem *port, void *addr, u32 count) -+{ -+ while (count--) { -+ writew(*(u16 *)addr, port); -+ addr += 2; -+ } -+} -+ -+static __inline__ void __ide_mm_outsl(void __iomem * port, void *addr, u32 count) -+{ -+ while (count--) { -+ writel(*(u32 *)addr, port); -+ addr += 4; -+ } -+} ---- linux/include/asm-generic/iomap.h -+++ linux/include/asm-generic/iomap.h -@@ -0,0 +1,63 @@ -+#ifndef __GENERIC_IO_H -+#define __GENERIC_IO_H -+ -+#include -+ -+/* -+ * These are the "generic" interfaces for doing new-style -+ * memory-mapped or PIO accesses. Architectures may do -+ * their own arch-optimized versions, these just act as -+ * wrappers around the old-style IO register access functions: -+ * read[bwl]/write[bwl]/in[bwl]/out[bwl] -+ * -+ * Don't include this directly, include it from . -+ */ -+ -+/* -+ * Read/write from/to an (offsettable) iomem cookie. It might be a PIO -+ * access or a MMIO access, these functions don't care. The info is -+ * encoded in the hardware mapping set up by the mapping functions -+ * (or the cookie itself, depending on implementation and hw). -+ * -+ * The generic routines just encode the PIO/MMIO as part of the -+ * cookie, and coldly assume that the MMIO IO mappings are not -+ * in the low address range. Architectures for which this is not -+ * true can't use this generic implementation. -+ */ -+extern unsigned int fastcall ioread8(void __iomem *); -+extern unsigned int fastcall ioread16(void __iomem *); -+extern unsigned int fastcall ioread32(void __iomem *); -+ -+extern void fastcall iowrite8(u8, void __iomem *); -+extern void fastcall iowrite16(u16, void __iomem *); -+extern void fastcall iowrite32(u32, void __iomem *); -+ -+/* -+ * "string" versions of the above. Note that they -+ * use native byte ordering for the accesses (on -+ * the assumption that IO and memory agree on a -+ * byte order, and CPU byteorder is irrelevant). -+ * -+ * They do _not_ update the port address. If you -+ * want MMIO that copies stuff laid out in MMIO -+ * memory across multiple ports, use "memcpy_toio()" -+ * and friends. -+ */ -+extern void fastcall ioread8_rep(void __iomem *port, void *buf, unsigned long count); -+extern void fastcall ioread16_rep(void __iomem *port, void *buf, unsigned long count); -+extern void fastcall ioread32_rep(void __iomem *port, void *buf, unsigned long count); -+ -+extern void fastcall iowrite8_rep(void __iomem *port, const void *buf, unsigned long count); -+extern void fastcall iowrite16_rep(void __iomem *port, const void *buf, unsigned long count); -+extern void fastcall iowrite32_rep(void __iomem *port, const void *buf, unsigned long count); -+ -+/* Create a virtual mapping cookie for an IO port range */ -+extern void __iomem *ioport_map(unsigned long port, unsigned int nr); -+extern void ioport_unmap(void __iomem *); -+ -+/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ -+struct pci_dev; -+extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); -+extern void pci_iounmap(struct pci_dev *dev, void __iomem *); -+ -+#endif ---- linux/include/asm-generic/local.h -+++ linux/include/asm-generic/local.h -@@ -0,0 +1,118 @@ -+#ifndef _ASM_GENERIC_LOCAL_H -+#define _ASM_GENERIC_LOCAL_H -+ -+// #include -+#include -+#include -+#include -+ -+/* An unsigned long type for operations which are atomic for a single -+ * CPU. Usually used in combination with per-cpu variables. */ -+ -+#if BITS_PER_LONG == 32 -+/* Implement in terms of atomics. */ -+ -+/* Don't use typedef: don't want them to be mixed with atomic_t's. */ -+typedef struct -+{ -+ atomic_t a; -+} local_t; -+ -+#define LOCAL_INIT(i) { ATOMIC_INIT(i) } -+ -+#define local_read(l) ((unsigned long)atomic_read(&(l)->a)) -+#define local_set(l,i) atomic_set((&(l)->a),(i)) -+#define local_inc(l) atomic_inc(&(l)->a) -+#define local_dec(l) atomic_dec(&(l)->a) -+#define local_add(i,l) atomic_add((i),(&(l)->a)) -+#define local_sub(i,l) atomic_sub((i),(&(l)->a)) -+ -+/* Non-atomic variants, ie. preemption disabled and won't be touched -+ * in interrupt, etc. Some archs can optimize this case well. */ -+#define __local_inc(l) local_set((l), local_read(l) + 1) -+#define __local_dec(l) local_set((l), local_read(l) - 1) -+#define __local_add(i,l) local_set((l), local_read(l) + (i)) -+#define __local_sub(i,l) local_set((l), local_read(l) - (i)) -+ -+#else /* ... can't use atomics. */ -+/* Implement in terms of three variables. -+ Another option would be to use local_irq_save/restore. */ -+ -+typedef struct -+{ -+ /* 0 = in hardirq, 1 = in softirq, 2 = usermode. */ -+ unsigned long v[3]; -+} local_t; -+ -+#define _LOCAL_VAR(l) ((l)->v[!in_interrupt() + !in_irq()]) -+ -+#define LOCAL_INIT(i) { { (i), 0, 0 } } -+ -+static inline unsigned long local_read(local_t *l) -+{ -+ return l->v[0] + l->v[1] + l->v[2]; -+} -+ -+static inline void local_set(local_t *l, unsigned long v) -+{ -+ l->v[0] = v; -+ l->v[1] = l->v[2] = 0; -+} -+ -+static inline void local_inc(local_t *l) -+{ -+ preempt_disable(); -+ _LOCAL_VAR(l)++; -+ preempt_enable(); -+} -+ -+static inline void local_dec(local_t *l) -+{ -+ preempt_disable(); -+ _LOCAL_VAR(l)--; -+ preempt_enable(); -+} -+ -+static inline void local_add(unsigned long v, local_t *l) -+{ -+ preempt_disable(); -+ _LOCAL_VAR(l) += v; -+ preempt_enable(); -+} -+ -+static inline void local_sub(unsigned long v, local_t *l) -+{ -+ preempt_disable(); -+ _LOCAL_VAR(l) -= v; -+ preempt_enable(); -+} -+ -+/* Non-atomic variants, ie. preemption disabled and won't be touched -+ * in interrupt, etc. Some archs can optimize this case well. */ -+#define __local_inc(l) ((l)->v[0]++) -+#define __local_dec(l) ((l)->v[0]--) -+#define __local_add(i,l) ((l)->v[0] += (i)) -+#define __local_sub(i,l) ((l)->v[0] -= (i)) -+ -+#endif /* Non-atomic implementation */ -+ -+/* Use these for per-cpu local_t variables: on some archs they are -+ * much more efficient than these naive implementations. Note they take -+ * a variable (eg. mystruct.foo), not an address. -+ */ -+#define cpu_local_read(v) local_read(&__get_cpu_var(v)) -+#define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i)) -+#define cpu_local_inc(v) local_inc(&__get_cpu_var(v)) -+#define cpu_local_dec(v) local_dec(&__get_cpu_var(v)) -+#define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v)) -+#define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v)) -+ -+/* Non-atomic increments, ie. preemption disabled and won't be touched -+ * in interrupt, etc. Some archs can optimize this case well. -+ */ -+#define __cpu_local_inc(v) __local_inc(&__get_cpu_var(v)) -+#define __cpu_local_dec(v) __local_dec(&__get_cpu_var(v)) -+#define __cpu_local_add(i, v) __local_add((i), &__get_cpu_var(v)) -+#define __cpu_local_sub(i, v) __local_sub((i), &__get_cpu_var(v)) -+ -+#endif /* _ASM_GENERIC_LOCAL_H */ ---- linux/include/asm-generic/pci-dma-compat.h -+++ linux/include/asm-generic/pci-dma-compat.h -@@ -0,0 +1,107 @@ -+/* include this file if the platform implements the dma_ DMA Mapping API -+ * and wants to provide the pci_ DMA Mapping API in terms of it */ -+ -+#ifndef _ASM_GENERIC_PCI_DMA_COMPAT_H -+#define _ASM_GENERIC_PCI_DMA_COMPAT_H -+ -+#include -+ -+/* note pci_set_dma_mask isn't here, since it's a public function -+ * exported from drivers/pci, use dma_supported instead */ -+ -+static inline int -+pci_dma_supported(struct pci_dev *hwdev, u64 mask) -+{ -+ return dma_supported(hwdev == NULL ? NULL : &hwdev->dev, mask); -+} -+ -+static inline void * -+pci_alloc_consistent(struct pci_dev *hwdev, size_t size, -+ dma_addr_t *dma_handle) -+{ -+ return dma_alloc_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, dma_handle, GFP_ATOMIC); -+} -+ -+static inline void -+pci_free_consistent(struct pci_dev *hwdev, size_t size, -+ void *vaddr, dma_addr_t dma_handle) -+{ -+ dma_free_coherent(hwdev == NULL ? NULL : &hwdev->dev, size, vaddr, dma_handle); -+} -+ -+static inline dma_addr_t -+pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction) -+{ -+ return dma_map_single(hwdev == NULL ? NULL : &hwdev->dev, ptr, size, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, -+ size_t size, int direction) -+{ -+ dma_unmap_single(hwdev == NULL ? NULL : &hwdev->dev, dma_addr, size, (enum dma_data_direction)direction); -+} -+ -+static inline dma_addr_t -+pci_map_page(struct pci_dev *hwdev, struct page *page, -+ unsigned long offset, size_t size, int direction) -+{ -+ return dma_map_page(hwdev == NULL ? NULL : &hwdev->dev, page, offset, size, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_unmap_page(struct pci_dev *hwdev, dma_addr_t dma_address, -+ size_t size, int direction) -+{ -+ dma_unmap_page(hwdev == NULL ? NULL : &hwdev->dev, dma_address, size, (enum dma_data_direction)direction); -+} -+ -+static inline int -+pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, -+ int nents, int direction) -+{ -+ return dma_map_sg(hwdev == NULL ? NULL : &hwdev->dev, sg, nents, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, -+ int nents, int direction) -+{ -+ dma_unmap_sg(hwdev == NULL ? NULL : &hwdev->dev, sg, nents, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t dma_handle, -+ size_t size, int direction) -+{ -+ dma_sync_single_for_cpu(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t dma_handle, -+ size_t size, int direction) -+{ -+ dma_sync_single_for_device(hwdev == NULL ? NULL : &hwdev->dev, dma_handle, size, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sg, -+ int nelems, int direction) -+{ -+ dma_sync_sg_for_cpu(hwdev == NULL ? NULL : &hwdev->dev, sg, nelems, (enum dma_data_direction)direction); -+} -+ -+static inline void -+pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sg, -+ int nelems, int direction) -+{ -+ dma_sync_sg_for_device(hwdev == NULL ? NULL : &hwdev->dev, sg, nelems, (enum dma_data_direction)direction); -+} -+ -+static inline int -+pci_dma_mapping_error(dma_addr_t dma_addr) -+{ -+ return dma_mapping_error(dma_addr); -+} -+ -+#endif ---- linux/include/asm-generic/pci.h -+++ linux/include/asm-generic/pci.h -@@ -0,0 +1,27 @@ -+/* -+ * linux/include/asm-generic/pci.h -+ * -+ * Copyright (C) 2003 Russell King -+ */ -+#ifndef _ASM_GENERIC_PCI_H -+#define _ASM_GENERIC_PCI_H -+ -+/** -+ * pcibios_resource_to_bus - convert resource to PCI bus address -+ * @dev: device which owns this resource -+ * @region: converted bus-centric region (start,end) -+ * @res: resource to convert -+ * -+ * Convert a resource to a PCI device bus address or bus window. -+ */ -+static inline void -+pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, -+ struct resource *res) -+{ -+ region->start = res->start; -+ region->end = res->end; -+} -+ -+#define pcibios_scan_all_fns(a, b) 0 -+ -+#endif ---- linux/include/asm-generic/percpu.h -+++ linux/include/asm-generic/percpu.h -@@ -0,0 +1,42 @@ -+#ifndef _ASM_GENERIC_PERCPU_H_ -+#define _ASM_GENERIC_PERCPU_H_ -+#include -+ -+#define __GENERIC_PER_CPU -+#ifdef CONFIG_SMP -+ -+extern unsigned long __per_cpu_offset[NR_CPUS]; -+ -+/* Separate out the type, so (int[3], foo) works. */ -+#define DEFINE_PER_CPU(type, name) \ -+ __attribute__((__section__(".data.percpu"))) __typeof__(type) per_cpu__##name -+ -+/* var is in discarded region: offset to particular copy we want */ -+#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) -+#define __get_cpu_var(var) per_cpu(var, smp_processor_id()) -+ -+/* A macro to avoid #include hell... */ -+#define percpu_modcopy(pcpudst, src, size) \ -+do { \ -+ unsigned int __i; \ -+ for (__i = 0; __i < NR_CPUS; __i++) \ -+ if (cpu_possible(__i)) \ -+ memcpy((pcpudst)+__per_cpu_offset[__i], \ -+ (src), (size)); \ -+} while (0) -+#else /* ! SMP */ -+ -+#define DEFINE_PER_CPU(type, name) \ -+ __typeof__(type) per_cpu__##name -+ -+#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) -+#define __get_cpu_var(var) per_cpu__##var -+ -+#endif /* SMP */ -+ -+#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name -+ -+#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) -+#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var) -+ -+#endif /* _ASM_GENERIC_PERCPU_H_ */ ---- linux/include/asm-generic/pgtable.h -+++ linux/include/asm-generic/pgtable.h -@@ -0,0 +1,137 @@ -+#ifndef _ASM_GENERIC_PGTABLE_H -+#define _ASM_GENERIC_PGTABLE_H -+ -+#ifndef __HAVE_ARCH_PTEP_ESTABLISH -+/* -+ * Establish a new mapping: -+ * - flush the old one -+ * - update the page tables -+ * - inform the TLB about the new one -+ * -+ * We hold the mm semaphore for reading and vma->vm_mm->page_table_lock. -+ * -+ * Note: the old pte is known to not be writable, so we don't need to -+ * worry about dirty bits etc getting lost. -+ */ -+#ifndef __HAVE_ARCH_SET_PTE_ATOMIC -+#define ptep_establish(__vma, __address, __ptep, __entry) \ -+do { \ -+ set_pte(__ptep, __entry); \ -+ flush_tlb_page(__vma, __address); \ -+} while (0) -+#else /* __HAVE_ARCH_SET_PTE_ATOMIC */ -+#define ptep_establish(__vma, __address, __ptep, __entry) \ -+do { \ -+ set_pte_atomic(__ptep, __entry); \ -+ flush_tlb_page(__vma, __address); \ -+} while (0) -+#endif /* __HAVE_ARCH_SET_PTE_ATOMIC */ -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS -+/* -+ * Largely same as above, but only sets the access flags (dirty, -+ * accessed, and writable). Furthermore, we know it always gets set -+ * to a "more permissive" setting, which allows most architectures -+ * to optimize this. -+ */ -+#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ -+do { \ -+ set_pte(__ptep, __entry); \ -+ flush_tlb_page(__vma, __address); \ -+} while (0) -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG -+static inline int ptep_test_and_clear_young(pte_t *ptep) -+{ -+ pte_t pte = *ptep; -+ if (!pte_young(pte)) -+ return 0; -+ set_pte(ptep, pte_mkold(pte)); -+ return 1; -+} -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH -+#define ptep_clear_flush_young(__vma, __address, __ptep) \ -+({ \ -+ int __young = ptep_test_and_clear_young(__ptep); \ -+ if (__young) \ -+ flush_tlb_page(__vma, __address); \ -+ __young; \ -+}) -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY -+static inline int ptep_test_and_clear_dirty(pte_t *ptep) -+{ -+ pte_t pte = *ptep; -+ if (!pte_dirty(pte)) -+ return 0; -+ set_pte(ptep, pte_mkclean(pte)); -+ return 1; -+} -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH -+#define ptep_clear_flush_dirty(__vma, __address, __ptep) \ -+({ \ -+ int __dirty = ptep_test_and_clear_dirty(__ptep); \ -+ if (__dirty) \ -+ flush_tlb_page(__vma, __address); \ -+ __dirty; \ -+}) -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR -+static inline pte_t ptep_get_and_clear(pte_t *ptep) -+{ -+ pte_t pte = *ptep; -+ pte_clear(ptep); -+ return pte; -+} -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH -+#define ptep_clear_flush(__vma, __address, __ptep) \ -+({ \ -+ pte_t __pte = ptep_get_and_clear(__ptep); \ -+ flush_tlb_page(__vma, __address); \ -+ __pte; \ -+}) -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT -+static inline void ptep_set_wrprotect(pte_t *ptep) -+{ -+ pte_t old_pte = *ptep; -+ set_pte(ptep, pte_wrprotect(old_pte)); -+} -+#endif -+ -+#ifndef __HAVE_ARCH_PTEP_MKDIRTY -+static inline void ptep_mkdirty(pte_t *ptep) -+{ -+ pte_t old_pte = *ptep; -+ set_pte(ptep, pte_mkdirty(old_pte)); -+} -+#endif -+ -+#ifndef __HAVE_ARCH_PTE_SAME -+#define pte_same(A,B) (pte_val(A) == pte_val(B)) -+#endif -+ -+#ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY -+#define page_test_and_clear_dirty(page) (0) -+#endif -+ -+#ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG -+#define page_test_and_clear_young(page) (0) -+#endif -+ -+#ifndef __HAVE_ARCH_PGD_OFFSET_GATE -+#define pgd_offset_gate(mm, addr) pgd_offset(mm, addr) -+#endif -+ -+#endif /* _ASM_GENERIC_PGTABLE_H */ ---- linux/include/asm-generic/rmap.h -+++ linux/include/asm-generic/rmap.h -@@ -0,0 +1,90 @@ -+#ifndef _GENERIC_RMAP_H -+#define _GENERIC_RMAP_H -+/* -+ * linux/include/asm-generic/rmap.h -+ * -+ * Architecture dependent parts of the reverse mapping code, -+ * this version should work for most architectures with a -+ * 'normal' page table layout. -+ * -+ * We use the struct page of the page table page to find out -+ * the process and full address of a page table entry: -+ * - page->mapping points to the process' mm_struct -+ * - page->index has the high bits of the address -+ * - the lower bits of the address are calculated from the -+ * offset of the page table entry within the page table page -+ * -+ * For CONFIG_HIGHPTE, we need to represent the address of a pte in a -+ * scalar pte_addr_t. The pfn of the pte's page is shifted left by PAGE_SIZE -+ * bits and is then ORed with the byte offset of the pte within its page. -+ * -+ * For CONFIG_HIGHMEM4G, the pte_addr_t is 32 bits. 20 for the pfn, 12 for -+ * the offset. -+ * -+ * For CONFIG_HIGHMEM64G, the pte_addr_t is 64 bits. 52 for the pfn, 12 for -+ * the offset. -+ */ -+#include -+ -+static inline void pgtable_add_rmap(struct page * page, struct mm_struct * mm, unsigned long address) -+{ -+#ifdef BROKEN_PPC_PTE_ALLOC_ONE -+ /* OK, so PPC calls pte_alloc() before mem_map[] is setup ... ;( */ -+ extern int mem_init_done; -+ -+ if (!mem_init_done) -+ return; -+#endif -+ page->mapping = (void *)mm; -+ page->index = address & ~((PTRS_PER_PTE * PAGE_SIZE) - 1); -+ inc_page_state(nr_page_table_pages); -+} -+ -+static inline void pgtable_remove_rmap(struct page * page) -+{ -+ page->mapping = NULL; -+ page->index = 0; -+ dec_page_state(nr_page_table_pages); -+} -+ -+static inline struct mm_struct * ptep_to_mm(pte_t * ptep) -+{ -+ struct page * page = kmap_atomic_to_page(ptep); -+ return (struct mm_struct *) page->mapping; -+} -+ -+static inline unsigned long ptep_to_address(pte_t * ptep) -+{ -+ struct page * page = kmap_atomic_to_page(ptep); -+ unsigned long low_bits; -+ low_bits = ((unsigned long)ptep & ~PAGE_MASK) * PTRS_PER_PTE; -+ return page->index + low_bits; -+} -+ -+#ifdef CONFIG_HIGHPTE -+static inline pte_addr_t ptep_to_paddr(pte_t *ptep) -+{ -+ pte_addr_t paddr; -+ paddr = ((pte_addr_t)page_to_pfn(kmap_atomic_to_page(ptep))) << PAGE_SHIFT; -+ return paddr + (pte_addr_t)((unsigned long)ptep & ~PAGE_MASK); -+} -+#else -+static inline pte_addr_t ptep_to_paddr(pte_t *ptep) -+{ -+ return (pte_addr_t)ptep; -+} -+#endif -+ -+#ifndef CONFIG_HIGHPTE -+static inline pte_t *rmap_ptep_map(pte_addr_t pte_paddr) -+{ -+ return (pte_t *)pte_paddr; -+} -+ -+static inline void rmap_ptep_unmap(pte_t *pte) -+{ -+ return; -+} -+#endif -+ -+#endif /* _GENERIC_RMAP_H */ ---- linux/include/asm-generic/rtc.h -+++ linux/include/asm-generic/rtc.h -@@ -0,0 +1,213 @@ -+/* -+ * inclue/asm-generic/rtc.h -+ * -+ * Author: Tom Rini -+ * -+ * Based on: -+ * drivers/char/rtc.c -+ * -+ * Please read the COPYING file for all license details. -+ */ -+ -+#ifndef __ASM_RTC_H__ -+#define __ASM_RTC_H__ -+ -+#ifdef __KERNEL__ -+ -+#include -+#include -+#include -+ -+#define RTC_PIE 0x40 /* periodic interrupt enable */ -+#define RTC_AIE 0x20 /* alarm interrupt enable */ -+#define RTC_UIE 0x10 /* update-finished interrupt enable */ -+ -+/* some dummy definitions */ -+#define RTC_BATT_BAD 0x100 /* battery bad */ -+#define RTC_SQWE 0x08 /* enable square-wave output */ -+#define RTC_DM_BINARY 0x04 /* all time/date values are BCD if clear */ -+#define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ -+#define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ -+ -+/* -+ * Returns true if a clock update is in progress -+ */ -+static inline unsigned char rtc_is_updating(void) -+{ -+ unsigned char uip; -+ -+ spin_lock_irq(&rtc_lock); -+ uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP); -+ spin_unlock_irq(&rtc_lock); -+ return uip; -+} -+ -+static inline unsigned int get_rtc_time(struct rtc_time *time) -+{ -+ unsigned long uip_watchdog = jiffies; -+ unsigned char ctrl; -+#ifdef CONFIG_MACH_DECSTATION -+ unsigned int real_year; -+#endif -+ -+ /* -+ * read RTC once any update in progress is done. The update -+ * can take just over 2ms. We wait 10 to 20ms. There is no need to -+ * to poll-wait (up to 1s - eeccch) for the falling edge of RTC_UIP. -+ * If you need to know *exactly* when a second has started, enable -+ * periodic update complete interrupts, (via ioctl) and then -+ * immediately read /dev/rtc which will block until you get the IRQ. -+ * Once the read clears, read the RTC time (again via ioctl). Easy. -+ */ -+ -+ if (rtc_is_updating() != 0) -+ while (jiffies - uip_watchdog < 2*HZ/100) { -+ barrier(); -+ cpu_relax(); -+ } -+ -+ /* -+ * Only the values that we read from the RTC are set. We leave -+ * tm_wday, tm_yday and tm_isdst untouched. Even though the -+ * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated -+ * by the RTC when initially set to a non-zero value. -+ */ -+ spin_lock_irq(&rtc_lock); -+ time->tm_sec = CMOS_READ(RTC_SECONDS); -+ time->tm_min = CMOS_READ(RTC_MINUTES); -+ time->tm_hour = CMOS_READ(RTC_HOURS); -+ time->tm_mday = CMOS_READ(RTC_DAY_OF_MONTH); -+ time->tm_mon = CMOS_READ(RTC_MONTH); -+ time->tm_year = CMOS_READ(RTC_YEAR); -+#ifdef CONFIG_MACH_DECSTATION -+ real_year = CMOS_READ(RTC_DEC_YEAR); -+#endif -+ ctrl = CMOS_READ(RTC_CONTROL); -+ spin_unlock_irq(&rtc_lock); -+ -+ if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) -+ { -+ BCD_TO_BIN(time->tm_sec); -+ BCD_TO_BIN(time->tm_min); -+ BCD_TO_BIN(time->tm_hour); -+ BCD_TO_BIN(time->tm_mday); -+ BCD_TO_BIN(time->tm_mon); -+ BCD_TO_BIN(time->tm_year); -+ } -+ -+#ifdef CONFIG_MACH_DECSTATION -+ time->tm_year += real_year - 72; -+#endif -+ -+ /* -+ * Account for differences between how the RTC uses the values -+ * and how they are defined in a struct rtc_time; -+ */ -+ if (time->tm_year <= 69) -+ time->tm_year += 100; -+ -+ time->tm_mon--; -+ -+ return RTC_24H; -+} -+ -+/* Set the current date and time in the real time clock. */ -+static inline int set_rtc_time(struct rtc_time *time) -+{ -+ unsigned char mon, day, hrs, min, sec; -+ unsigned char save_control, save_freq_select; -+ unsigned int yrs; -+#ifdef CONFIG_MACH_DECSTATION -+ unsigned int real_yrs, leap_yr; -+#endif -+ -+ yrs = time->tm_year; -+ mon = time->tm_mon + 1; /* tm_mon starts at zero */ -+ day = time->tm_mday; -+ hrs = time->tm_hour; -+ min = time->tm_min; -+ sec = time->tm_sec; -+ -+ if (yrs > 255) /* They are unsigned */ -+ return -EINVAL; -+ -+ spin_lock_irq(&rtc_lock); -+#ifdef CONFIG_MACH_DECSTATION -+ real_yrs = yrs; -+ leap_yr = ((!((yrs + 1900) % 4) && ((yrs + 1900) % 100)) || -+ !((yrs + 1900) % 400)); -+ yrs = 72; -+ -+ /* -+ * We want to keep the year set to 73 until March -+ * for non-leap years, so that Feb, 29th is handled -+ * correctly. -+ */ -+ if (!leap_yr && mon < 3) { -+ real_yrs--; -+ yrs = 73; -+ } -+#endif -+ /* These limits and adjustments are independent of -+ * whether the chip is in binary mode or not. -+ */ -+ if (yrs > 169) { -+ spin_unlock_irq(&rtc_lock); -+ return -EINVAL; -+ } -+ -+ if (yrs >= 100) -+ yrs -= 100; -+ -+ if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) -+ || RTC_ALWAYS_BCD) { -+ BIN_TO_BCD(sec); -+ BIN_TO_BCD(min); -+ BIN_TO_BCD(hrs); -+ BIN_TO_BCD(day); -+ BIN_TO_BCD(mon); -+ BIN_TO_BCD(yrs); -+ } -+ -+ save_control = CMOS_READ(RTC_CONTROL); -+ CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL); -+ save_freq_select = CMOS_READ(RTC_FREQ_SELECT); -+ CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT); -+ -+#ifdef CONFIG_MACH_DECSTATION -+ CMOS_WRITE(real_yrs, RTC_DEC_YEAR); -+#endif -+ CMOS_WRITE(yrs, RTC_YEAR); -+ CMOS_WRITE(mon, RTC_MONTH); -+ CMOS_WRITE(day, RTC_DAY_OF_MONTH); -+ CMOS_WRITE(hrs, RTC_HOURS); -+ CMOS_WRITE(min, RTC_MINUTES); -+ CMOS_WRITE(sec, RTC_SECONDS); -+ -+ CMOS_WRITE(save_control, RTC_CONTROL); -+ CMOS_WRITE(save_freq_select, RTC_FREQ_SELECT); -+ -+ spin_unlock_irq(&rtc_lock); -+ -+ return 0; -+} -+ -+static inline unsigned int get_rtc_ss(void) -+{ -+ struct rtc_time h; -+ -+ get_rtc_time(&h); -+ return h.tm_sec; -+} -+ -+static inline int get_rtc_pll(struct rtc_pll_info *pll) -+{ -+ return -EINVAL; -+} -+static inline int set_rtc_pll(struct rtc_pll_info *pll) -+{ -+ return -EINVAL; -+} -+ -+#endif /* __KERNEL__ */ -+#endif /* __ASM_RTC_H__ */ ---- linux/include/asm-generic/sections.h -+++ linux/include/asm-generic/sections.h -@@ -0,0 +1,12 @@ -+#ifndef _ASM_GENERIC_SECTIONS_H_ -+#define _ASM_GENERIC_SECTIONS_H_ -+ -+/* References to section boundaries */ -+ -+extern char _text[], _stext[], _etext[]; -+extern char _data[], _sdata[], _edata[]; -+extern char __bss_start[], __bss_stop[]; -+extern char __init_begin[], __init_end[]; -+extern char _sinittext[], _einittext[]; -+ -+#endif /* _ASM_GENERIC_SECTIONS_H_ */ ---- linux/include/asm-generic/siginfo.h -+++ linux/include/asm-generic/siginfo.h -@@ -0,0 +1,295 @@ -+#ifndef _ASM_GENERIC_SIGINFO_H -+#define _ASM_GENERIC_SIGINFO_H -+ -+#include -+#include -+#include -+ -+typedef union sigval { -+ int sival_int; -+ void __user *sival_ptr; -+} sigval_t; -+ -+/* -+ * This is the size (including padding) of the part of the -+ * struct siginfo that is before the union. -+ */ -+#ifndef __ARCH_SI_PREAMBLE_SIZE -+#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int)) -+#endif -+ -+#define SI_MAX_SIZE 128 -+#ifndef SI_PAD_SIZE -+#define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int)) -+#endif -+ -+#ifndef __ARCH_SI_UID_T -+#define __ARCH_SI_UID_T uid_t -+#endif -+ -+/* -+ * The default "si_band" type is "long", as specified by POSIX. -+ * However, some architectures want to override this to "int" -+ * for historical compatibility reasons, so we allow that. -+ */ -+#ifndef __ARCH_SI_BAND_T -+#define __ARCH_SI_BAND_T long -+#endif -+ -+#ifndef HAVE_ARCH_SIGINFO_T -+ -+typedef struct siginfo { -+ int si_signo; -+ int si_errno; -+ int si_code; -+ -+ union { -+ int _pad[SI_PAD_SIZE]; -+ -+ /* kill() */ -+ struct { -+ pid_t _pid; /* sender's pid */ -+ __ARCH_SI_UID_T _uid; /* sender's uid */ -+ } _kill; -+ -+ /* POSIX.1b timers */ -+ struct { -+ timer_t _tid; /* timer id */ -+ int _overrun; /* overrun count */ -+ char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)]; -+ sigval_t _sigval; /* same as below */ -+ int _sys_private; /* not to be passed to user */ -+ } _timer; -+ -+ /* POSIX.1b signals */ -+ struct { -+ pid_t _pid; /* sender's pid */ -+ __ARCH_SI_UID_T _uid; /* sender's uid */ -+ sigval_t _sigval; -+ } _rt; -+ -+ /* SIGCHLD */ -+ struct { -+ pid_t _pid; /* which child */ -+ __ARCH_SI_UID_T _uid; /* sender's uid */ -+ int _status; /* exit code */ -+ clock_t _utime; -+ clock_t _stime; -+ } _sigchld; -+ -+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ -+ struct { -+ void __user *_addr; /* faulting insn/memory ref. */ -+#ifdef __ARCH_SI_TRAPNO -+ int _trapno; /* TRAP # which caused the signal */ -+#endif -+ } _sigfault; -+ -+ /* SIGPOLL */ -+ struct { -+ __ARCH_SI_BAND_T _band; /* POLL_IN, POLL_OUT, POLL_MSG */ -+ int _fd; -+ } _sigpoll; -+ } _sifields; -+} siginfo_t; -+ -+#endif -+ -+/* -+ * How these fields are to be accessed. -+ */ -+#define si_pid _sifields._kill._pid -+#define si_uid _sifields._kill._uid -+#define si_tid _sifields._timer._tid -+#define si_overrun _sifields._timer._overrun -+#define si_sys_private _sifields._timer._sys_private -+#define si_status _sifields._sigchld._status -+#define si_utime _sifields._sigchld._utime -+#define si_stime _sifields._sigchld._stime -+#define si_value _sifields._rt._sigval -+#define si_int _sifields._rt._sigval.sival_int -+#define si_ptr _sifields._rt._sigval.sival_ptr -+#define si_addr _sifields._sigfault._addr -+#ifdef __ARCH_SI_TRAPNO -+#define si_trapno _sifields._sigfault._trapno -+#endif -+#define si_band _sifields._sigpoll._band -+#define si_fd _sifields._sigpoll._fd -+ -+#ifdef __KERNEL__ -+#define __SI_MASK 0xffff0000u -+#define __SI_KILL (0 << 16) -+#define __SI_TIMER (1 << 16) -+#define __SI_POLL (2 << 16) -+#define __SI_FAULT (3 << 16) -+#define __SI_CHLD (4 << 16) -+#define __SI_RT (5 << 16) -+#define __SI_MESGQ (6 << 16) -+#define __SI_CODE(T,N) ((T) | ((N) & 0xffff)) -+#else -+#define __SI_KILL 0 -+#define __SI_TIMER 0 -+#define __SI_POLL 0 -+#define __SI_FAULT 0 -+#define __SI_CHLD 0 -+#define __SI_RT 0 -+#define __SI_MESGQ 0 -+#define __SI_CODE(T,N) (N) -+#endif -+ -+/* -+ * si_code values -+ * Digital reserves positive values for kernel-generated signals. -+ */ -+#define SI_USER 0 /* sent by kill, sigsend, raise */ -+#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */ -+#define SI_QUEUE -1 /* sent by sigqueue */ -+#define SI_TIMER __SI_CODE(__SI_TIMER,-2) /* sent by timer expiration */ -+#define SI_MESGQ __SI_CODE(__SI_MESGQ,-3) /* sent by real time mesq state change */ -+#define SI_ASYNCIO -4 /* sent by AIO completion */ -+#define SI_SIGIO -5 /* sent by queued SIGIO */ -+#define SI_TKILL -6 /* sent by tkill system call */ -+#define SI_DETHREAD -7 /* sent by execve() killing subsidiary threads */ -+ -+#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0) -+#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0) -+ -+#ifndef HAVE_ARCH_SI_CODES -+/* -+ * SIGILL si_codes -+ */ -+#define ILL_ILLOPC (__SI_FAULT|1) /* illegal opcode */ -+#define ILL_ILLOPN (__SI_FAULT|2) /* illegal operand */ -+#define ILL_ILLADR (__SI_FAULT|3) /* illegal addressing mode */ -+#define ILL_ILLTRP (__SI_FAULT|4) /* illegal trap */ -+#define ILL_PRVOPC (__SI_FAULT|5) /* privileged opcode */ -+#define ILL_PRVREG (__SI_FAULT|6) /* privileged register */ -+#define ILL_COPROC (__SI_FAULT|7) /* coprocessor error */ -+#define ILL_BADSTK (__SI_FAULT|8) /* internal stack error */ -+#define NSIGILL 8 -+ -+/* -+ * SIGFPE si_codes -+ */ -+#define FPE_INTDIV (__SI_FAULT|1) /* integer divide by zero */ -+#define FPE_INTOVF (__SI_FAULT|2) /* integer overflow */ -+#define FPE_FLTDIV (__SI_FAULT|3) /* floating point divide by zero */ -+#define FPE_FLTOVF (__SI_FAULT|4) /* floating point overflow */ -+#define FPE_FLTUND (__SI_FAULT|5) /* floating point underflow */ -+#define FPE_FLTRES (__SI_FAULT|6) /* floating point inexact result */ -+#define FPE_FLTINV (__SI_FAULT|7) /* floating point invalid operation */ -+#define FPE_FLTSUB (__SI_FAULT|8) /* subscript out of range */ -+#define NSIGFPE 8 -+ -+/* -+ * SIGSEGV si_codes -+ */ -+#define SEGV_MAPERR (__SI_FAULT|1) /* address not mapped to object */ -+#define SEGV_ACCERR (__SI_FAULT|2) /* invalid permissions for mapped object */ -+#define NSIGSEGV 2 -+ -+/* -+ * SIGBUS si_codes -+ */ -+#define BUS_ADRALN (__SI_FAULT|1) /* invalid address alignment */ -+#define BUS_ADRERR (__SI_FAULT|2) /* non-existant physical address */ -+#define BUS_OBJERR (__SI_FAULT|3) /* object specific hardware error */ -+#define NSIGBUS 3 -+ -+/* -+ * SIGTRAP si_codes -+ */ -+#define TRAP_BRKPT (__SI_FAULT|1) /* process breakpoint */ -+#define TRAP_TRACE (__SI_FAULT|2) /* process trace trap */ -+#define NSIGTRAP 2 -+ -+/* -+ * SIGCHLD si_codes -+ */ -+#define CLD_EXITED (__SI_CHLD|1) /* child has exited */ -+#define CLD_KILLED (__SI_CHLD|2) /* child was killed */ -+#define CLD_DUMPED (__SI_CHLD|3) /* child terminated abnormally */ -+#define CLD_TRAPPED (__SI_CHLD|4) /* traced child has trapped */ -+#define CLD_STOPPED (__SI_CHLD|5) /* child has stopped */ -+#define CLD_CONTINUED (__SI_CHLD|6) /* stopped child has continued */ -+#define NSIGCHLD 6 -+ -+/* -+ * SIGPOLL si_codes -+ */ -+#define POLL_IN (__SI_POLL|1) /* data input available */ -+#define POLL_OUT (__SI_POLL|2) /* output buffers available */ -+#define POLL_MSG (__SI_POLL|3) /* input message available */ -+#define POLL_ERR (__SI_POLL|4) /* i/o error */ -+#define POLL_PRI (__SI_POLL|5) /* high priority input available */ -+#define POLL_HUP (__SI_POLL|6) /* device disconnected */ -+#define NSIGPOLL 6 -+ -+#endif -+ -+/* -+ * sigevent definitions -+ * -+ * It seems likely that SIGEV_THREAD will have to be handled from -+ * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the -+ * thread manager then catches and does the appropriate nonsense. -+ * However, everything is written out here so as to not get lost. -+ */ -+#define SIGEV_SIGNAL 0 /* notify via signal */ -+#define SIGEV_NONE 1 /* other notification: meaningless */ -+#define SIGEV_THREAD 2 /* deliver via thread creation */ -+#define SIGEV_THREAD_ID 4 /* deliver to thread */ -+ -+#define SIGEV_MAX_SIZE 64 -+#ifndef SIGEV_PAD_SIZE -+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3) -+#endif -+ -+#ifndef HAVE_ARCH_SIGEVENT_T -+ -+typedef struct sigevent { -+ sigval_t sigev_value; -+ int sigev_signo; -+ int sigev_notify; -+ union { -+ int _pad[SIGEV_PAD_SIZE]; -+ int _tid; -+ -+ struct { -+ void (*_function)(sigval_t); -+ void *_attribute; /* really pthread_attr_t */ -+ } _sigev_thread; -+ } _sigev_un; -+} sigevent_t; -+ -+#endif -+ -+#define sigev_notify_function _sigev_un._sigev_thread._function -+#define sigev_notify_attributes _sigev_un._sigev_thread._attribute -+#define sigev_notify_thread_id _sigev_un._tid -+ -+#ifdef __KERNEL__ -+ -+struct siginfo; -+void do_schedule_next_timer(struct siginfo *info); -+ -+#ifndef HAVE_ARCH_COPY_SIGINFO -+ -+#include -+ -+static inline void copy_siginfo(struct siginfo *to, struct siginfo *from) -+{ -+ if (from->si_code < 0) -+ memcpy(to, from, sizeof(*to)); -+ else -+ /* _sigchld is currently the largest know union member */ -+ memcpy(to, from, __ARCH_SI_PREAMBLE_SIZE + sizeof(from->_sifields._sigchld)); -+} -+ -+#endif -+ -+extern int copy_siginfo_to_user(struct siginfo __user *to, struct siginfo *from); -+ -+#endif /* __KERNEL__ */ -+ -+#endif ---- linux/include/asm-generic/statfs.h -+++ linux/include/asm-generic/statfs.h -@@ -0,0 +1,51 @@ -+#ifndef _GENERIC_STATFS_H -+#define _GENERIC_STATFS_H -+ -+#ifndef __KERNEL_STRICT_NAMES -+# include -+typedef __kernel_fsid_t fsid_t; -+#endif -+ -+struct statfs { -+ __u32 f_type; -+ __u32 f_bsize; -+ __u32 f_blocks; -+ __u32 f_bfree; -+ __u32 f_bavail; -+ __u32 f_files; -+ __u32 f_ffree; -+ __kernel_fsid_t f_fsid; -+ __u32 f_namelen; -+ __u32 f_frsize; -+ __u32 f_spare[5]; -+}; -+ -+struct statfs64 { -+ __u32 f_type; -+ __u32 f_bsize; -+ __u64 f_blocks; -+ __u64 f_bfree; -+ __u64 f_bavail; -+ __u64 f_files; -+ __u64 f_ffree; -+ __kernel_fsid_t f_fsid; -+ __u32 f_namelen; -+ __u32 f_frsize; -+ __u32 f_spare[5]; -+}; -+ -+struct compat_statfs64 { -+ __u32 f_type; -+ __u32 f_bsize; -+ __u64 f_blocks; -+ __u64 f_bfree; -+ __u64 f_bavail; -+ __u64 f_files; -+ __u64 f_ffree; -+ __kernel_fsid_t f_fsid; -+ __u32 f_namelen; -+ __u32 f_frsize; -+ __u32 f_spare[5]; -+}; -+ -+#endif ---- linux/include/asm-generic/tlb.h -+++ linux/include/asm-generic/tlb.h -@@ -0,0 +1,152 @@ -+/* asm-generic/tlb.h -+ * -+ * Generic TLB shootdown code -+ * -+ * Copyright 2001 Red Hat, Inc. -+ * Based on code from mm/memory.c Copyright Linus Torvalds and others. -+ * -+ * 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. -+ */ -+#ifndef _ASM_GENERIC__TLB_H -+#define _ASM_GENERIC__TLB_H -+ -+// #include -+#include -+#include -+#include -+ -+/* -+ * For UP we don't need to worry about TLB flush -+ * and page free order so much.. -+ */ -+#ifdef CONFIG_SMP -+ #define FREE_PTE_NR 506 -+ #define tlb_fast_mode(tlb) ((tlb)->nr == ~0U) -+#else -+ #define FREE_PTE_NR 1 -+ #define tlb_fast_mode(tlb) 1 -+#endif -+ -+/* struct mmu_gather is an opaque type used by the mm code for passing around -+ * any data needed by arch specific code for tlb_remove_page. This structure -+ * can be per-CPU or per-MM as the page table lock is held for the duration of -+ * TLB shootdown. -+ */ -+struct mmu_gather { -+ struct mm_struct *mm; -+ unsigned int nr; /* set to ~0U means fast mode */ -+ unsigned int need_flush;/* Really unmapped some ptes? */ -+ unsigned int fullmm; /* non-zero means full mm flush */ -+ unsigned long freed; -+ struct page * pages[FREE_PTE_NR]; -+}; -+ -+/* Users of the generic TLB shootdown code must declare this storage space. */ -+DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); -+ -+/* tlb_gather_mmu -+ * Return a pointer to an initialized struct mmu_gather. -+ */ -+static inline struct mmu_gather * -+tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) -+{ -+ struct mmu_gather *tlb = &per_cpu(mmu_gathers, smp_processor_id()); -+ -+ tlb->mm = mm; -+ -+ /* Use fast mode if only one CPU is online */ -+ tlb->nr = num_online_cpus() > 1 ? 0U : ~0U; -+ -+ tlb->fullmm = full_mm_flush; -+ tlb->freed = 0; -+ -+ return tlb; -+} -+ -+static inline void -+tlb_flush_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) -+{ -+ if (!tlb->need_flush) -+ return; -+ tlb->need_flush = 0; -+ tlb_flush(tlb); -+ if (!tlb_fast_mode(tlb)) { -+ free_pages_and_swap_cache(tlb->pages, tlb->nr); -+ tlb->nr = 0; -+ } -+} -+ -+/* tlb_finish_mmu -+ * Called at the end of the shootdown operation to free up any resources -+ * that were required. The page table lock is still held at this point. -+ */ -+static inline void -+tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) -+{ -+ int freed = tlb->freed; -+ struct mm_struct *mm = tlb->mm; -+ int rss = mm->rss; -+ -+ if (rss < freed) -+ freed = rss; -+ mm->rss = rss - freed; -+ tlb_flush_mmu(tlb, start, end); -+ -+ /* keep the page table cache within bounds */ -+ check_pgt_cache(); -+} -+ -+static inline unsigned int -+tlb_is_full_mm(struct mmu_gather *tlb) -+{ -+ return tlb->fullmm; -+} -+ -+/* tlb_remove_page -+ * Must perform the equivalent to __free_pte(pte_get_and_clear(ptep)), while -+ * handling the additional races in SMP caused by other CPUs caching valid -+ * mappings in their TLBs. -+ */ -+static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) -+{ -+ tlb->need_flush = 1; -+ if (tlb_fast_mode(tlb)) { -+ free_page_and_swap_cache(page); -+ return; -+ } -+ tlb->pages[tlb->nr++] = page; -+ if (tlb->nr >= FREE_PTE_NR) -+ tlb_flush_mmu(tlb, 0, 0); -+} -+ -+/** -+ * tlb_remove_tlb_entry - remember a pte unmapping for later tlb invalidation. -+ * -+ * Record the fact that pte's were really umapped in ->need_flush, so we can -+ * later optimise away the tlb invalidate. This helps when userspace is -+ * unmapping already-unmapped pages, which happens quite a lot. -+ */ -+#define tlb_remove_tlb_entry(tlb, ptep, address) \ -+ do { \ -+ tlb->need_flush = 1; \ -+ __tlb_remove_tlb_entry(tlb, ptep, address); \ -+ } while (0) -+ -+#define pte_free_tlb(tlb, ptep) \ -+ do { \ -+ tlb->need_flush = 1; \ -+ __pte_free_tlb(tlb, ptep); \ -+ } while (0) -+ -+#define pmd_free_tlb(tlb, pmdp) \ -+ do { \ -+ tlb->need_flush = 1; \ -+ __pmd_free_tlb(tlb, pmdp); \ -+ } while (0) -+ -+#define tlb_migrate_finish(mm) do {} while (0) -+ -+#endif /* _ASM_GENERIC__TLB_H */ ---- linux/include/asm-generic/topology.h -+++ linux/include/asm-generic/topology.h -@@ -0,0 +1,53 @@ -+/* -+ * linux/include/asm-generic/topology.h -+ * -+ * Written by: Matthew Dobson, IBM Corporation -+ * -+ * Copyright (C) 2002, IBM Corp. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ * Send feedback to -+ */ -+#ifndef _ASM_GENERIC_TOPOLOGY_H -+#define _ASM_GENERIC_TOPOLOGY_H -+ -+/* Other architectures wishing to use this simple topology API should fill -+ in the below functions as appropriate in their own file. */ -+#ifndef cpu_to_node -+#define cpu_to_node(cpu) (0) -+#endif -+#ifndef parent_node -+#define parent_node(node) (0) -+#endif -+#ifndef node_to_cpumask -+#define node_to_cpumask(node) (cpu_online_map) -+#endif -+#ifndef node_to_first_cpu -+#define node_to_first_cpu(node) (0) -+#endif -+#ifndef pcibus_to_cpumask -+#define pcibus_to_cpumask(bus) (cpu_online_map) -+#endif -+ -+/* Cross-node load balancing interval. */ -+#ifndef NODE_BALANCE_RATE -+#define NODE_BALANCE_RATE 10 -+#endif -+ -+#endif /* _ASM_GENERIC_TOPOLOGY_H */ ---- linux/include/asm-generic/uaccess.h -+++ linux/include/asm-generic/uaccess.h -@@ -0,0 +1,26 @@ -+#ifndef _ASM_GENERIC_UACCESS_H_ -+#define _ASM_GENERIC_UACCESS_H_ -+ -+/* -+ * This macro should be used instead of __get_user() when accessing -+ * values at locations that are not known to be aligned. -+ */ -+#define __get_user_unaligned(x, ptr) \ -+({ \ -+ __typeof__ (*(ptr)) __x; \ -+ __copy_from_user(&__x, (ptr), sizeof(*(ptr))) ? -EFAULT : 0; \ -+ (x) = __x; \ -+}) -+ -+ -+/* -+ * This macro should be used instead of __put_user() when accessing -+ * values at locations that are not known to be aligned. -+ */ -+#define __put_user_unaligned(x, ptr) \ -+({ \ -+ __typeof__ (*(ptr)) __x = (x); \ -+ __copy_to_user((ptr), &__x, sizeof(*(ptr))) ? -EFAULT : 0; \ -+}) -+ -+#endif /* _ASM_GENERIC_UACCESS_H */ ---- linux/include/asm-generic/unaligned.h -+++ linux/include/asm-generic/unaligned.h -@@ -0,0 +1,20 @@ -+#ifndef _ASM_GENERIC_UNALIGNED_H_ -+#define _ASM_GENERIC_UNALIGNED_H_ -+ -+/* -+ * For the benefit of those who are trying to port Linux to another -+ * architecture, here are some C-language equivalents. -+ */ -+ -+#include -+ -+ -+#define get_unaligned(ptr) \ -+ ({ __typeof__(*(ptr)) __tmp; memcpy(&__tmp, (ptr), sizeof(*(ptr))); __tmp; }) -+ -+#define put_unaligned(val, ptr) \ -+ ({ __typeof__(*(ptr)) __tmp = (val); \ -+ memcpy((ptr), &__tmp, sizeof(*(ptr))); \ -+ (void)0; }) -+ -+#endif /* _ASM_GENERIC_UNALIGNED_H */ ---- linux/include/asm-generic/vmlinux.lds.h -+++ linux/include/asm-generic/vmlinux.lds.h -@@ -0,0 +1,84 @@ -+#ifndef LOAD_OFFSET -+#define LOAD_OFFSET 0 -+#endif -+ -+#ifndef VMLINUX_SYMBOL -+#define VMLINUX_SYMBOL(_sym_) _sym_ -+#endif -+ -+#define RODATA \ -+ .rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \ -+ *(.rodata) *(.rodata.*) \ -+ *(__vermagic) /* Kernel version magic */ \ -+ } \ -+ \ -+ .rodata1 : AT(ADDR(.rodata1) - LOAD_OFFSET) { \ -+ *(.rodata1) \ -+ } \ -+ \ -+ /* PCI quirks */ \ -+ .pci_fixup : AT(ADDR(.pci_fixup) - LOAD_OFFSET) { \ -+ VMLINUX_SYMBOL(__start_pci_fixups_header) = .; \ -+ *(.pci_fixup_header) \ -+ VMLINUX_SYMBOL(__end_pci_fixups_header) = .; \ -+ VMLINUX_SYMBOL(__start_pci_fixups_final) = .; \ -+ *(.pci_fixup_final) \ -+ VMLINUX_SYMBOL(__end_pci_fixups_final) = .; \ -+ } \ -+ \ -+ /* Kernel symbol table: Normal symbols */ \ -+ __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ -+ VMLINUX_SYMBOL(__start___ksymtab) = .; \ -+ *(__ksymtab) \ -+ VMLINUX_SYMBOL(__stop___ksymtab) = .; \ -+ } \ -+ \ -+ /* Kernel symbol table: GPL-only symbols */ \ -+ __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \ -+ VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \ -+ *(__ksymtab_gpl) \ -+ VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ -+ } \ -+ \ -+ /* Kernel symbol table: Normal symbols */ \ -+ __kcrctab : AT(ADDR(__kcrctab) - LOAD_OFFSET) { \ -+ VMLINUX_SYMBOL(__start___kcrctab) = .; \ -+ *(__kcrctab) \ -+ VMLINUX_SYMBOL(__stop___kcrctab) = .; \ -+ } \ -+ \ -+ /* Kernel symbol table: GPL-only symbols */ \ -+ __kcrctab_gpl : AT(ADDR(__kcrctab_gpl) - LOAD_OFFSET) { \ -+ VMLINUX_SYMBOL(__start___kcrctab_gpl) = .; \ -+ *(__kcrctab_gpl) \ -+ VMLINUX_SYMBOL(__stop___kcrctab_gpl) = .; \ -+ } \ -+ \ -+ /* Kernel symbol table: strings */ \ -+ __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ -+ *(__ksymtab_strings) \ -+ } \ -+ \ -+ /* Built-in module parameters. */ \ -+ __param : AT(ADDR(__param) - LOAD_OFFSET) { \ -+ VMLINUX_SYMBOL(__start___param) = .; \ -+ *(__param) \ -+ VMLINUX_SYMBOL(__stop___param) = .; \ -+ } -+ -+#define SECURITY_INIT \ -+ .security_initcall.init : { \ -+ VMLINUX_SYMBOL(__security_initcall_start) = .; \ -+ *(.security_initcall.init) \ -+ VMLINUX_SYMBOL(__security_initcall_end) = .; \ -+ } -+ -+#define SCHED_TEXT \ -+ VMLINUX_SYMBOL(__sched_text_start) = .; \ -+ *(.sched.text) \ -+ VMLINUX_SYMBOL(__sched_text_end) = .; -+ -+#define LOCK_TEXT \ -+ VMLINUX_SYMBOL(__lock_text_start) = .; \ -+ *(.spinlock.text) \ -+ VMLINUX_SYMBOL(__lock_text_end) = .; ---- linux/include/asm-generic/xor.h -+++ linux/include/asm-generic/xor.h -@@ -0,0 +1,718 @@ -+/* -+ * include/asm-generic/xor.h -+ * -+ * Generic optimized RAID-5 checksumming functions. -+ * -+ * 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, or (at your option) -+ * any later version. -+ * -+ * You should have received a copy of the GNU General Public License -+ * (for example /usr/src/linux/COPYING); if not, write to the Free -+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ */ -+ -+#include -+ -+static void -+xor_8regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ p1[0] ^= p2[0]; -+ p1[1] ^= p2[1]; -+ p1[2] ^= p2[2]; -+ p1[3] ^= p2[3]; -+ p1[4] ^= p2[4]; -+ p1[5] ^= p2[5]; -+ p1[6] ^= p2[6]; -+ p1[7] ^= p2[7]; -+ p1 += 8; -+ p2 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_8regs_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ p1[0] ^= p2[0] ^ p3[0]; -+ p1[1] ^= p2[1] ^ p3[1]; -+ p1[2] ^= p2[2] ^ p3[2]; -+ p1[3] ^= p2[3] ^ p3[3]; -+ p1[4] ^= p2[4] ^ p3[4]; -+ p1[5] ^= p2[5] ^ p3[5]; -+ p1[6] ^= p2[6] ^ p3[6]; -+ p1[7] ^= p2[7] ^ p3[7]; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_8regs_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ p1[0] ^= p2[0] ^ p3[0] ^ p4[0]; -+ p1[1] ^= p2[1] ^ p3[1] ^ p4[1]; -+ p1[2] ^= p2[2] ^ p3[2] ^ p4[2]; -+ p1[3] ^= p2[3] ^ p3[3] ^ p4[3]; -+ p1[4] ^= p2[4] ^ p3[4] ^ p4[4]; -+ p1[5] ^= p2[5] ^ p3[5] ^ p4[5]; -+ p1[6] ^= p2[6] ^ p3[6] ^ p4[6]; -+ p1[7] ^= p2[7] ^ p3[7] ^ p4[7]; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_8regs_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4, unsigned long *p5) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ p1[0] ^= p2[0] ^ p3[0] ^ p4[0] ^ p5[0]; -+ p1[1] ^= p2[1] ^ p3[1] ^ p4[1] ^ p5[1]; -+ p1[2] ^= p2[2] ^ p3[2] ^ p4[2] ^ p5[2]; -+ p1[3] ^= p2[3] ^ p3[3] ^ p4[3] ^ p5[3]; -+ p1[4] ^= p2[4] ^ p3[4] ^ p4[4] ^ p5[4]; -+ p1[5] ^= p2[5] ^ p3[5] ^ p4[5] ^ p5[5]; -+ p1[6] ^= p2[6] ^ p3[6] ^ p4[6] ^ p5[6]; -+ p1[7] ^= p2[7] ^ p3[7] ^ p4[7] ^ p5[7]; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ p5 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_32regs_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_32regs_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ d0 ^= p3[0]; -+ d1 ^= p3[1]; -+ d2 ^= p3[2]; -+ d3 ^= p3[3]; -+ d4 ^= p3[4]; -+ d5 ^= p3[5]; -+ d6 ^= p3[6]; -+ d7 ^= p3[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_32regs_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ d0 ^= p3[0]; -+ d1 ^= p3[1]; -+ d2 ^= p3[2]; -+ d3 ^= p3[3]; -+ d4 ^= p3[4]; -+ d5 ^= p3[5]; -+ d6 ^= p3[6]; -+ d7 ^= p3[7]; -+ d0 ^= p4[0]; -+ d1 ^= p4[1]; -+ d2 ^= p4[2]; -+ d3 ^= p4[3]; -+ d4 ^= p4[4]; -+ d5 ^= p4[5]; -+ d6 ^= p4[6]; -+ d7 ^= p4[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_32regs_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4, unsigned long *p5) -+{ -+ long lines = bytes / (sizeof (long)) / 8; -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ d0 ^= p3[0]; -+ d1 ^= p3[1]; -+ d2 ^= p3[2]; -+ d3 ^= p3[3]; -+ d4 ^= p3[4]; -+ d5 ^= p3[5]; -+ d6 ^= p3[6]; -+ d7 ^= p3[7]; -+ d0 ^= p4[0]; -+ d1 ^= p4[1]; -+ d2 ^= p4[2]; -+ d3 ^= p4[3]; -+ d4 ^= p4[4]; -+ d5 ^= p4[5]; -+ d6 ^= p4[6]; -+ d7 ^= p4[7]; -+ d0 ^= p5[0]; -+ d1 ^= p5[1]; -+ d2 ^= p5[2]; -+ d3 ^= p5[3]; -+ d4 ^= p5[4]; -+ d5 ^= p5[5]; -+ d6 ^= p5[6]; -+ d7 ^= p5[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ p5 += 8; -+ } while (--lines > 0); -+} -+ -+static void -+xor_8regs_p_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ prefetchw(p1); -+ prefetch(p2); -+ -+ do { -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ once_more: -+ p1[0] ^= p2[0]; -+ p1[1] ^= p2[1]; -+ p1[2] ^= p2[2]; -+ p1[3] ^= p2[3]; -+ p1[4] ^= p2[4]; -+ p1[5] ^= p2[5]; -+ p1[6] ^= p2[6]; -+ p1[7] ^= p2[7]; -+ p1 += 8; -+ p2 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_8regs_p_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ prefetchw(p1); -+ prefetch(p2); -+ prefetch(p3); -+ -+ do { -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ prefetch(p3+8); -+ once_more: -+ p1[0] ^= p2[0] ^ p3[0]; -+ p1[1] ^= p2[1] ^ p3[1]; -+ p1[2] ^= p2[2] ^ p3[2]; -+ p1[3] ^= p2[3] ^ p3[3]; -+ p1[4] ^= p2[4] ^ p3[4]; -+ p1[5] ^= p2[5] ^ p3[5]; -+ p1[6] ^= p2[6] ^ p3[6]; -+ p1[7] ^= p2[7] ^ p3[7]; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_8regs_p_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ -+ prefetchw(p1); -+ prefetch(p2); -+ prefetch(p3); -+ prefetch(p4); -+ -+ do { -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ prefetch(p3+8); -+ prefetch(p4+8); -+ once_more: -+ p1[0] ^= p2[0] ^ p3[0] ^ p4[0]; -+ p1[1] ^= p2[1] ^ p3[1] ^ p4[1]; -+ p1[2] ^= p2[2] ^ p3[2] ^ p4[2]; -+ p1[3] ^= p2[3] ^ p3[3] ^ p4[3]; -+ p1[4] ^= p2[4] ^ p3[4] ^ p4[4]; -+ p1[5] ^= p2[5] ^ p3[5] ^ p4[5]; -+ p1[6] ^= p2[6] ^ p3[6] ^ p4[6]; -+ p1[7] ^= p2[7] ^ p3[7] ^ p4[7]; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_8regs_p_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4, unsigned long *p5) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ -+ prefetchw(p1); -+ prefetch(p2); -+ prefetch(p3); -+ prefetch(p4); -+ prefetch(p5); -+ -+ do { -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ prefetch(p3+8); -+ prefetch(p4+8); -+ prefetch(p5+8); -+ once_more: -+ p1[0] ^= p2[0] ^ p3[0] ^ p4[0] ^ p5[0]; -+ p1[1] ^= p2[1] ^ p3[1] ^ p4[1] ^ p5[1]; -+ p1[2] ^= p2[2] ^ p3[2] ^ p4[2] ^ p5[2]; -+ p1[3] ^= p2[3] ^ p3[3] ^ p4[3] ^ p5[3]; -+ p1[4] ^= p2[4] ^ p3[4] ^ p4[4] ^ p5[4]; -+ p1[5] ^= p2[5] ^ p3[5] ^ p4[5] ^ p5[5]; -+ p1[6] ^= p2[6] ^ p3[6] ^ p4[6] ^ p5[6]; -+ p1[7] ^= p2[7] ^ p3[7] ^ p4[7] ^ p5[7]; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ p5 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_32regs_p_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ -+ prefetchw(p1); -+ prefetch(p2); -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ once_more: -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_32regs_p_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ -+ prefetchw(p1); -+ prefetch(p2); -+ prefetch(p3); -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ prefetch(p3+8); -+ once_more: -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ d0 ^= p3[0]; -+ d1 ^= p3[1]; -+ d2 ^= p3[2]; -+ d3 ^= p3[3]; -+ d4 ^= p3[4]; -+ d5 ^= p3[5]; -+ d6 ^= p3[6]; -+ d7 ^= p3[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_32regs_p_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ -+ prefetchw(p1); -+ prefetch(p2); -+ prefetch(p3); -+ prefetch(p4); -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ prefetch(p3+8); -+ prefetch(p4+8); -+ once_more: -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ d0 ^= p3[0]; -+ d1 ^= p3[1]; -+ d2 ^= p3[2]; -+ d3 ^= p3[3]; -+ d4 ^= p3[4]; -+ d5 ^= p3[5]; -+ d6 ^= p3[6]; -+ d7 ^= p3[7]; -+ d0 ^= p4[0]; -+ d1 ^= p4[1]; -+ d2 ^= p4[2]; -+ d3 ^= p4[3]; -+ d4 ^= p4[4]; -+ d5 ^= p4[5]; -+ d6 ^= p4[6]; -+ d7 ^= p4[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static void -+xor_32regs_p_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, -+ unsigned long *p3, unsigned long *p4, unsigned long *p5) -+{ -+ long lines = bytes / (sizeof (long)) / 8 - 1; -+ -+ prefetchw(p1); -+ prefetch(p2); -+ prefetch(p3); -+ prefetch(p4); -+ prefetch(p5); -+ -+ do { -+ register long d0, d1, d2, d3, d4, d5, d6, d7; -+ -+ prefetchw(p1+8); -+ prefetch(p2+8); -+ prefetch(p3+8); -+ prefetch(p4+8); -+ prefetch(p5+8); -+ once_more: -+ d0 = p1[0]; /* Pull the stuff into registers */ -+ d1 = p1[1]; /* ... in bursts, if possible. */ -+ d2 = p1[2]; -+ d3 = p1[3]; -+ d4 = p1[4]; -+ d5 = p1[5]; -+ d6 = p1[6]; -+ d7 = p1[7]; -+ d0 ^= p2[0]; -+ d1 ^= p2[1]; -+ d2 ^= p2[2]; -+ d3 ^= p2[3]; -+ d4 ^= p2[4]; -+ d5 ^= p2[5]; -+ d6 ^= p2[6]; -+ d7 ^= p2[7]; -+ d0 ^= p3[0]; -+ d1 ^= p3[1]; -+ d2 ^= p3[2]; -+ d3 ^= p3[3]; -+ d4 ^= p3[4]; -+ d5 ^= p3[5]; -+ d6 ^= p3[6]; -+ d7 ^= p3[7]; -+ d0 ^= p4[0]; -+ d1 ^= p4[1]; -+ d2 ^= p4[2]; -+ d3 ^= p4[3]; -+ d4 ^= p4[4]; -+ d5 ^= p4[5]; -+ d6 ^= p4[6]; -+ d7 ^= p4[7]; -+ d0 ^= p5[0]; -+ d1 ^= p5[1]; -+ d2 ^= p5[2]; -+ d3 ^= p5[3]; -+ d4 ^= p5[4]; -+ d5 ^= p5[5]; -+ d6 ^= p5[6]; -+ d7 ^= p5[7]; -+ p1[0] = d0; /* Store the result (in bursts) */ -+ p1[1] = d1; -+ p1[2] = d2; -+ p1[3] = d3; -+ p1[4] = d4; -+ p1[5] = d5; -+ p1[6] = d6; -+ p1[7] = d7; -+ p1 += 8; -+ p2 += 8; -+ p3 += 8; -+ p4 += 8; -+ p5 += 8; -+ } while (--lines > 0); -+ if (lines == 0) -+ goto once_more; -+} -+ -+static struct xor_block_template xor_block_8regs = { -+ .name = "8regs", -+ .do_2 = xor_8regs_2, -+ .do_3 = xor_8regs_3, -+ .do_4 = xor_8regs_4, -+ .do_5 = xor_8regs_5, -+}; -+ -+static struct xor_block_template xor_block_32regs = { -+ .name = "32regs", -+ .do_2 = xor_32regs_2, -+ .do_3 = xor_32regs_3, -+ .do_4 = xor_32regs_4, -+ .do_5 = xor_32regs_5, -+}; -+ -+static struct xor_block_template xor_block_8regs_p = { -+ .name = "8regs_prefetch", -+ .do_2 = xor_8regs_p_2, -+ .do_3 = xor_8regs_p_3, -+ .do_4 = xor_8regs_p_4, -+ .do_5 = xor_8regs_p_5, -+}; -+ -+static struct xor_block_template xor_block_32regs_p = { -+ .name = "32regs_prefetch", -+ .do_2 = xor_32regs_p_2, -+ .do_3 = xor_32regs_p_3, -+ .do_4 = xor_32regs_p_4, -+ .do_5 = xor_32regs_p_5, -+}; -+ -+#define XOR_TRY_TEMPLATES \ -+ do { \ -+ xor_speed(&xor_block_8regs); \ -+ xor_speed(&xor_block_8regs_p); \ -+ xor_speed(&xor_block_32regs); \ -+ xor_speed(&xor_block_32regs_p); \ -+ } while (0) ---- linux/include/asm-nios2nommu/ChangeLog -+++ linux/include/asm-nios2nommu/ChangeLog -@@ -0,0 +1,14 @@ -+2004-06-29 Ken Hill -+ -+ * bitops.h (find_next_zero_bit): Fix problem with with masking for found_first -+ handling. The masking of the upper bits for size < 32 bits would set all -+ the bits to 1. Removing any zero's there may have been. -+ -+2004-06-02 Ken Hill -+ -+ * processor.h (TASK_SIZE): Change na_sdram_end to nasys_program_mem_end to remove -+ dependancy on quartus memory component name. -+ -+ * page.h (PAGE_OFFSET): Change na_sdram to nasys_program_mem to remove -+ dependancy on quartus memory component name. -+ ---- linux/include/asm-nios2nommu/a.out.h -+++ linux/include/asm-nios2nommu/a.out.h -@@ -0,0 +1,85 @@ -+/* $Id: a.out.h,v 1.4 2004/03/30 19:35:04 ken-h Exp $ */ -+/* -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef __NIOS2NOMMU_A_OUT_H__ -+#define __NIOS2NOMMU_A_OUT_H__ -+ -+#define SPARC_PGSIZE 0x1000 /* Thanks to the sun4 architecture... */ -+#define SEGMENT_SIZE SPARC_PGSIZE /* whee... */ -+ -+struct exec { -+ unsigned char a_dynamic:1; /* A __DYNAMIC is in this image */ -+ unsigned char a_toolversion:7; -+ unsigned char a_machtype; -+ unsigned short a_info; -+ unsigned long a_text; /* length of text, in bytes */ -+ unsigned long a_data; /* length of data, in bytes */ -+ unsigned long a_bss; /* length of bss, in bytes */ -+ unsigned long a_syms; /* length of symbol table, in bytes */ -+ unsigned long a_entry; /* where program begins */ -+ unsigned long a_trsize; -+ unsigned long a_drsize; -+}; -+ -+#define INIT_EXEC { \ -+ .a_dynamic = 0, \ -+ .a_toolversion = 0, \ -+ .a_machtype = 0, \ -+ .a_info = 0, \ -+ .a_text = 0, \ -+ .a_data = 0, \ -+ .a_bss = 0, \ -+ .a_syms = 0, \ -+ .a_entry = 0, \ -+ .a_trsize = 0, \ -+ .a_drsize = 0, \ -+} -+ -+/* Where in the file does the text information begin? */ -+#define N_TXTOFF(x) (N_MAGIC(x) == ZMAGIC ? 0 : sizeof (struct exec)) -+ -+/* Where do the Symbols start? */ -+#define N_SYMOFF(x) (N_TXTOFF(x) + (x).a_text + \ -+ (x).a_data + (x).a_trsize + \ -+ (x).a_drsize) -+ -+/* Where does text segment go in memory after being loaded? */ -+#define N_TXTADDR(x) (((N_MAGIC(x) == ZMAGIC) && \ -+ ((x).a_entry < SPARC_PGSIZE)) ? \ -+ 0 : SPARC_PGSIZE) -+ -+/* And same for the data segment.. */ -+#define N_DATADDR(x) (N_MAGIC(x)==OMAGIC ? \ -+ (N_TXTADDR(x) + (x).a_text) \ -+ : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x)))) -+ -+#define N_TRSIZE(a) ((a).a_trsize) -+#define N_DRSIZE(a) ((a).a_drsize) -+#define N_SYMSIZE(a) ((a).a_syms) -+ -+#ifdef __KERNEL__ -+ -+#define STACK_TOP TASK_SIZE -+ -+#endif -+ -+#endif /* __NIOS2NOMMU_A_OUT_H__ */ ---- linux/include/asm-nios2nommu/asm-macros.h -+++ linux/include/asm-nios2nommu/asm-macros.h -@@ -0,0 +1,331 @@ -+/* -+ * Macro used to simplify coding multi-line assembler. -+ * Some of the bit test macro can simplify down to one line -+ * depending on the mask value. -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+/* -+ * ANDs reg2 with mask and places the result in reg1. -+ * -+ * You cannnot use the same register for reg1 & reg2. -+ */ -+ -+.macro ANDI32 reg1,reg2,mask -+ .if \mask & 0xffff -+ .if \mask & 0xffff0000 -+ movhi \reg1,%hi(\mask) -+ movui \reg1,%lo(\mask) -+ and \reg1,\reg1,\reg2 -+ .else -+ andi \reg1,\reg2,%lo(\mask) -+ .endif -+ .else -+ andhi \reg1,\reg2,%hi(\mask) -+ .endif -+.endm -+ -+/* -+ * ORs reg2 with mask and places the result in reg1. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro ORI32 reg1,reg2,mask -+ .if \mask & 0xffff -+ .if \mask & 0xffff0000 -+ orhi \reg1,\reg2,%hi(\mask) -+ ori \reg1,\reg2,%lo(\mask) -+ .else -+ ori \reg1,\reg2,%lo(\mask) -+ .endif -+ .else -+ orhi \reg1,\reg2,%hi(\mask) -+ .endif -+.endm -+ -+/* -+ * XORs reg2 with mask and places the result in reg1. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro XORI32 reg1,reg2,mask -+ .if \mask & 0xffff -+ .if \mask & 0xffff0000 -+ xorhi \reg1,\reg2,%hi(\mask) -+ xori \reg1,\reg1,%lo(\mask) -+ .else -+ xori \reg1,\reg2,%lo(\mask) -+ .endif -+ .else -+ xorhi \reg1,\reg2,%hi(\mask) -+ .endif -+.endm -+ -+/* -+ * This is a support macro for BTBZ & BTBNZ. It checks -+ * the bit to make sure it is valid 32 value. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BT reg1,reg2,bit -+.if \bit > 31 -+ .err -+.else -+ .if \bit < 16 -+ andi \reg1,\reg2,(1 << \bit) -+ .else -+ andhi \reg1,\reg2,(1 << (\bit - 16)) -+ .endif -+.endif -+.endm -+ -+/* -+ * Tests the bit in reg2 and branches to label if the -+ * bit is zero. The result of the bit test is stored in reg1. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTBZ reg1,reg2,bit,label -+ BT \reg1,\reg2,\bit -+ beq \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and branches to label if the -+ * bit is non-zero. The result of the bit test is stored in reg1. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTBNZ reg1,reg2,bit,label -+ BT \reg1,\reg2,\bit -+ bne \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and then compliments the bit in reg2. -+ * The result of the bit test is stored in reg1. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTC reg1,reg2,bit -+.if \bit > 31 -+ .err -+.else -+ .if \bit < 16 -+ andi \reg1,\reg2,(1 << \bit) -+ xori \reg2,\reg2,(1 << \bit) -+ .else -+ andhi \reg1,\reg2,(1 << (\bit - 16)) -+ xorhi \reg2,\reg2,(1 << (\bit - 16)) -+ .endif -+.endif -+.endm -+ -+/* -+ * Tests the bit in reg2 and then sets the bit in reg2. -+ * The result of the bit test is stored in reg1. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTS reg1,reg2,bit -+.if \bit > 31 -+ .err -+.else -+ .if \bit < 16 -+ andi \reg1,\reg2,(1 << \bit) -+ ori \reg2,\reg2,(1 << \bit) -+ .else -+ andhi \reg1,\reg2,(1 << (\bit - 16)) -+ orhi \reg2,\reg2,(1 << (\bit - 16)) -+ .endif -+.endif -+.endm -+ -+/* -+ * Tests the bit in reg2 and then resets the bit in reg2. -+ * The result of the bit test is stored in reg1. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTR reg1,reg2,bit -+.if \bit > 31 -+ .err -+.else -+ .if \bit < 16 -+ andi \reg1,\reg2,(1 << \bit) -+ andi \reg2,\reg2,%lo(~(1 << \bit)) -+ .else -+ andhi \reg1,\reg2,(1 << (\bit - 16)) -+ andhi \reg2,\reg2,%lo(~(1 << (\bit - 16))) -+ .endif -+.endif -+.endm -+ -+/* -+ * Tests the bit in reg2 and then compliments the bit in reg2. -+ * The result of the bit test is stored in reg1. If the -+ * original bit was zero it branches to label. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTCBZ reg1,reg2,bit,label -+ BTC \reg1,\reg2,\bit -+ beq \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and then compliments the bit in reg2. -+ * The result of the bit test is stored in reg1. If the -+ * original bit was non-zero it branches to label. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTCBNZ reg1,reg2,bit,label -+ BTC \reg1,\reg2,\bit -+ bne \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and then sets the bit in reg2. -+ * The result of the bit test is stored in reg1. If the -+ * original bit was zero it branches to label. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTSBZ reg1,reg2,bit,label -+ BTS \reg1,\reg2,\bit -+ beq \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and then sets the bit in reg2. -+ * The result of the bit test is stored in reg1. If the -+ * original bit was non-zero it branches to label. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTSBNZ reg1,reg2,bit,label -+ BTS \reg1,\reg2,\bit -+ bne \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and then resets the bit in reg2. -+ * The result of the bit test is stored in reg1. If the -+ * original bit was zero it branches to label. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTRBZ reg1,reg2,bit,label -+ BTR \reg1,\reg2,\bit -+ bne \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bit in reg2 and then resets the bit in reg2. -+ * The result of the bit test is stored in reg1. If the -+ * original bit was non-zero it branches to label. -+ * -+ * It is NOT safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro BTRBNZ reg1,reg2,bit,label -+ BTR \reg1,\reg2,\bit -+ bne \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bits in mask against reg2 stores the result in reg1. -+ * If the all the bits in the mask are zero it branches to label. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro TSTBZ reg1,reg2,mask,label -+ ANDI32 \reg1,\reg2,\mask -+ beq \reg1,r0,\label -+.endm -+ -+/* -+ * Tests the bits in mask against reg2 stores the result in reg1. -+ * If the any of the bits in the mask are 1 it branches to label. -+ * -+ * It is safe to use the same register for reg1 & reg2. -+ */ -+ -+.macro TSTBNZ reg1,reg2,mask,label -+ ANDI32 \reg1,\reg2,\mask -+ bne \reg1,r0,\label -+.endm -+ -+/* -+ * Pushes reg onto the stack. -+ */ -+ -+.macro PUSH reg -+ addi sp,sp,-4 -+ stw \reg,0(sp) -+.endm -+ -+/* -+ * Pops the top of the stack into reg. -+ */ -+ -+.macro POP reg -+ ldw \reg,0(sp) -+ addi sp,sp,4 -+.endm -+ -+/* -+ * Clears reg -+ */ -+ -+.macro CLR reg -+ mov \reg,r0 -+.endm -+ -+/* -+ * The preprocessor macro does not work for -+ * the nios2 compiler. Undefine ENTRY and define -+ * a real assembler macro. -+ */ -+#undef ENTRY -+#define ENTRY(name) ASM_ENTRY name -+ -+.macro ASM_ENTRY name -+.globl \name -+__ALIGN -+ \name: -+.endm ---- linux/include/asm-nios2nommu/atomic.h -+++ linux/include/asm-nios2nommu/atomic.h -@@ -0,0 +1,190 @@ -+//vic - add 'atomic_add/sub_return', 'atomic_add_negative' -+//vic from v850 architecture -+ -+/* atomic.h: -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * Copyright (C) 2001 Vic Phillips (vic@microtronix.com) -+ * -+ * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __ARCH_NIOS2NOMMU_ATOMIC__ -+#define __ARCH_NIOS2NOMMU_ATOMIC__ -+ -+#include -+ -+typedef struct { int counter; } atomic_t; -+#define ATOMIC_INIT(i) { (i) } -+ -+#define atomic_read(v) ((v)->counter) -+#define atomic_set(v, i) (((v)->counter) = i) -+ -+ -+extern __inline__ void atomic_add(int i, atomic_t *v) -+{ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter += i; -+ local_irq_restore(flags); -+} -+ -+extern __inline__ int atomic_add_negative(int i, atomic_t *v) -+{ -+ unsigned long flags; -+ int result; -+ -+ local_irq_save(flags); -+ v->counter += i; -+ result = (v->counter < 0); -+ local_irq_restore(flags); -+ return result; -+} -+ -+extern __inline__ void atomic_sub(int i, atomic_t *v) -+{ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter -= i; -+ local_irq_restore(flags); -+} -+ -+extern __inline__ int atomic_sub_and_test(int i, atomic_t *v) -+{ -+ int result; -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter -= i; -+ result = (v->counter == 0); -+ local_irq_restore(flags); -+ return result; -+} -+ -+extern __inline__ void atomic_inc(atomic_t *v) -+{ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter += 1; -+ local_irq_restore(flags); -+} -+ -+extern __inline__ int atomic_inc_and_test(atomic_t *v) -+{ -+ unsigned long flags; -+ int result; -+ -+ local_irq_save(flags); -+ v->counter += 1; -+ result = (v->counter == 0); -+ local_irq_restore(flags); -+ return result; -+} -+ -+extern __inline__ void atomic_dec(atomic_t *v) -+{ -+ int i = 1; /* the compiler optimizes better this way */ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter -= i; -+ local_irq_restore(flags); -+} -+ -+extern __inline__ int atomic_dec_and_test(atomic_t *v) -+{ -+ int result; -+ int i = 1; /* the compiler optimizes better this way */ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter -= i; -+ result = (v->counter == 0); -+ local_irq_restore(flags); -+ return result; -+} -+ -+extern __inline__ int atomic_inc_return(atomic_t *v) -+{ -+ int result; -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ result = ++v->counter; -+ local_irq_restore(flags); -+ return result; -+} -+ -+extern __inline__ int atomic_dec_return(atomic_t *v) -+{ -+ int result; -+ int i = 1; /* the compiler optimizes better this way */ -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ v->counter -= i; -+ result = v->counter; -+ local_irq_restore(flags); -+ return result; -+} -+ -+extern __inline__ int atomic_add_return (int i, volatile atomic_t *v) -+{ -+ int res; -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ res = v->counter + i; -+ v->counter = res; -+ local_irq_restore(flags); -+ -+ return res; -+} -+ -+static __inline__ int atomic_sub_return (int i, volatile atomic_t *v) -+{ -+ int res; -+ unsigned long flags; -+ -+ local_irq_save(flags); -+ res = v->counter - i; -+ v->counter = res; -+ local_irq_restore(flags); -+ -+ return res; -+} -+ -+#define atomic_dec_return(v) atomic_sub_return(1,(v)) -+#define atomic_inc_return(v) atomic_add_return(1,(v)) -+ -+/* Atomic operations are already serializing */ -+#define smp_mb__before_atomic_dec() barrier() -+#define smp_mb__after_atomic_dec() barrier() -+#define smp_mb__before_atomic_inc() barrier() -+#define smp_mb__after_atomic_inc() barrier() -+ -+ -+#endif /* !(__ARCH_NIOS2NOMMU_ATOMIC__) */ -+ -+ ---- linux/include/asm-nios2nommu/bitops.h -+++ linux/include/asm-nios2nommu/bitops.h -@@ -0,0 +1,472 @@ -+#ifndef _ASM_NIOS_BITOPS_H_ -+#define _ASM_NIOS_BITOPS_H_ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/bitops.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#ifdef __KERNEL__ -+#include -+#include -+#include /* swab32 */ -+#include -+#endif -+ -+/* -+ * Adapted to NIOS from generic bitops.h: -+ * -+ * For the benefit of those who are trying to port Linux to another -+ * architecture, here are some C-language equivalents. You should -+ * recode these in the native assembly language, if at all possible. -+ * To guarantee atomicity, these routines call cli() and sti() to -+ * disable interrupts while they operate. (You have to provide inline -+ * routines to cli() and sti().) -+ * -+ * Also note, these routines assume that you have 32 bit integers. -+ * You will have to change this if you are trying to port Linux to the -+ * Alpha architecture or to a Cray. :-) -+ * -+ * C language equivalents written by Theodore Ts'o, 9/26/92 -+ */ -+ -+/* -+ * Generic ffs(). -+ */ -+static inline int ffs(int x) -+{ -+ int r = 1; -+ -+ if (!x) -+ return 0; -+ if (!(x & 0xffff)) { -+ x >>= 16; -+ r += 16; -+ } -+ if (!(x & 0xff)) { -+ x >>= 8; -+ r += 8; -+ } -+ if (!(x & 0xf)) { -+ x >>= 4; -+ r += 4; -+ } -+ if (!(x & 3)) { -+ x >>= 2; -+ r += 2; -+ } -+ if (!(x & 1)) { -+ x >>= 1; -+ r += 1; -+ } -+ return r; -+} -+ -+/* -+ * Generic __ffs(). -+ */ -+static inline int __ffs(int x) -+{ -+ int r = 0; -+ -+ if (!x) -+ return 0; -+ if (!(x & 0xffff)) { -+ x >>= 16; -+ r += 16; -+ } -+ if (!(x & 0xff)) { -+ x >>= 8; -+ r += 8; -+ } -+ if (!(x & 0xf)) { -+ x >>= 4; -+ r += 4; -+ } -+ if (!(x & 3)) { -+ x >>= 2; -+ r += 2; -+ } -+ if (!(x & 1)) { -+ x >>= 1; -+ r += 1; -+ } -+ return r; -+} -+ -+/* -+ * fls: find last bit set. -+ */ -+#define fls(x) generic_fls(x) -+ -+ -+/* -+ * Every architecture must define this function. It's the fastest -+ * way of searching a 140-bit bitmap where the first 100 bits are -+ * unlikely to be set. It's guaranteed that at least one of the 140 -+ * bits is cleared. -+ */ -+static inline int sched_find_first_bit(unsigned long *b) -+{ -+ if (unlikely(b[0])) -+ return __ffs(b[0]); -+ if (unlikely(b[1])) -+ return __ffs(b[1]) + 32; -+ if (unlikely(b[2])) -+ return __ffs(b[2]) + 64; -+ if (b[3]) -+ return __ffs(b[3]) + 96; -+ return __ffs(b[4]) + 128; -+} -+ -+/* -+ * ffz = Find First Zero in word. Undefined if no zero exists, -+ * so code should check against ~0UL first.. -+ */ -+static __inline__ unsigned long ffz(unsigned long word) -+{ -+ unsigned long result = 0; -+ -+ while(word & 1) { -+ result++; -+ word >>= 1; -+ } -+ return result; -+} -+ -+ -+static __inline__ void set_bit(int nr, volatile unsigned long * addr) -+{ -+ int * a = (int *) addr; -+ int mask; -+ unsigned long flags; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ local_irq_save(flags); -+ *a |= mask; -+ local_irq_restore(flags); -+} -+ -+static __inline__ void __set_bit(int nr, volatile unsigned long * addr) -+{ -+ int * a = (int *) addr; -+ int mask; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ *a |= mask; -+} -+ -+/* -+ * 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) -+{ -+ int * a = (int *) addr; -+ int mask; -+ unsigned long flags; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ local_irq_save(flags); -+ *a &= ~mask; -+ local_irq_restore(flags); -+} -+ -+static __inline__ void __clear_bit(int nr, volatile unsigned long * addr) -+{ -+ int * a = (int *) addr; -+ int mask; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ *a &= ~mask; -+} -+ -+static __inline__ void change_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, flags; -+ unsigned long *ADDR = (unsigned long *) addr; -+ -+ ADDR += nr >> 5; -+ mask = 1 << (nr & 31); -+ local_irq_save(flags); -+ *ADDR ^= mask; -+ local_irq_restore(flags); -+} -+ -+static __inline__ void __change_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask; -+ unsigned long *ADDR = (unsigned long *) addr; -+ -+ ADDR += nr >> 5; -+ mask = 1 << (nr & 31); -+ *ADDR ^= mask; -+} -+ -+static __inline__ int test_and_set_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, retval; -+ volatile unsigned int *a = (volatile unsigned int *) addr; -+ unsigned long flags; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ local_irq_save(flags); -+ retval = (mask & *a) != 0; -+ *a |= mask; -+ local_irq_restore(flags); -+ -+ return retval; -+} -+ -+static __inline__ int __test_and_set_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, retval; -+ volatile unsigned int *a = (volatile unsigned int *) addr; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ retval = (mask & *a) != 0; -+ *a |= mask; -+ return retval; -+} -+ -+static __inline__ int test_and_clear_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, retval; -+ volatile unsigned int *a = (volatile unsigned int *) addr; -+ unsigned long flags; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ local_irq_save(flags); -+ retval = (mask & *a) != 0; -+ *a &= ~mask; -+ local_irq_restore(flags); -+ -+ return retval; -+} -+ -+static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, retval; -+ volatile unsigned int *a = (volatile unsigned int *) addr; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ retval = (mask & *a) != 0; -+ *a &= ~mask; -+ return retval; -+} -+ -+static __inline__ int test_and_change_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, retval; -+ volatile unsigned int *a = (volatile unsigned int *) addr; -+ unsigned long flags; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ local_irq_save(flags); -+ retval = (mask & *a) != 0; -+ *a ^= mask; -+ local_irq_restore(flags); -+ -+ return retval; -+} -+ -+static __inline__ int __test_and_change_bit(int nr, volatile unsigned long * addr) -+{ -+ int mask, retval; -+ volatile unsigned int *a = (volatile unsigned int *) addr; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ retval = (mask & *a) != 0; -+ *a ^= mask; -+ return retval; -+} -+ -+/* -+ * This routine doesn't need to be atomic. -+ */ -+static __inline__ int __constant_test_bit(int nr, const volatile unsigned long * addr) -+{ -+ return ((1UL << (nr & 31)) & (((const volatile unsigned int *) addr)[nr >> 5])) != 0; -+} -+ -+static __inline__ int __test_bit(int nr, const volatile unsigned long * addr) -+{ -+ int * a = (int *) addr; -+ int mask; -+ -+ a += nr >> 5; -+ mask = 1 << (nr & 0x1f); -+ return ((mask & *a) != 0); -+} -+ -+#define test_bit(nr,addr) \ -+(__builtin_constant_p(nr) ? \ -+ __constant_test_bit((nr),(unsigned long *)(addr)) : \ -+ __test_bit((nr),(unsigned long *)(addr))) -+ -+ -+/* find_next_zero_bit() finds the first zero bit in a bit string of length -+ * 'size' bits, starting the search at bit 'offset'. This is largely based -+ * on Linus's ALPHA routines, which are pretty portable BTW. -+ */ -+ -+extern __inline__ unsigned long find_next_zero_bit(void *addr, unsigned long size, unsigned long offset) -+{ -+ unsigned long *p = ((unsigned long *) addr) + (offset >> 5); -+ unsigned long result = offset & ~31UL; -+ unsigned long tmp; -+ -+ if (offset >= size) -+ return size; -+ size -= result; -+ offset &= 31UL; -+ if (offset) { -+ tmp = *(p++); -+ tmp |= ~0UL >> (32-offset); -+ if (size < 32) -+ goto found_first; -+ if (~tmp) -+ goto found_middle; -+ size -= 32; -+ result += 32; -+ } -+ while (size & ~31UL) { -+ if (~(tmp = *(p++))) -+ goto found_middle; -+ result += 32; -+ size -= 32; -+ } -+ if (!size) -+ return result; -+ tmp = *p; -+ -+found_first: -+ tmp |= ~0UL << size; -+ if (tmp == ~0UL) -+ return result + size; -+found_middle: -+ return result + ffz(tmp); -+} -+ -+/* -+ * Find next one bit in a bitmap reasonably efficiently. -+ */ -+extern __inline__ unsigned long find_next_bit(const unsigned long *addr, -+ unsigned long size, unsigned long offset) -+{ -+ unsigned int *p = ((unsigned int *) addr) + (offset >> 5); -+ unsigned int result = offset & ~31UL; -+ unsigned int tmp; -+ -+ if (offset >= size) -+ return size; -+ size -= result; -+ offset &= 31UL; -+ if (offset) { -+ tmp = *p++; -+ tmp &= ~0UL << offset; -+ if (size < 32) -+ goto found_first; -+ if (tmp) -+ goto found_middle; -+ size -= 32; -+ result += 32; -+ } -+ while (size >= 32) { -+ if ((tmp = *p++) != 0) -+ goto found_middle; -+ result += 32; -+ size -= 32; -+ } -+ if (!size) -+ return result; -+ tmp = *p; -+ -+found_first: -+ tmp &= ~0UL >> (32 - size); -+ if (tmp == 0UL) /* Are any bits set? */ -+ return result + size; /* Nope. */ -+found_middle: -+ return result + __ffs(tmp); -+} -+ -+/* -+ * hweightN: returns the hamming weight (i.e. the number -+ * of bits set) of a N-bit word -+ */ -+ -+#define hweight32(x) generic_hweight32(x) -+#define hweight16(x) generic_hweight16(x) -+#define hweight8(x) generic_hweight8(x) -+ -+/* Linus sez that gcc can optimize the following correctly, we'll see if this -+ * holds on the Sparc as it does for the ALPHA. -+ */ -+ -+#define find_first_zero_bit(addr, size) \ -+ find_next_zero_bit((addr), (size), 0) -+#define find_first_bit(addr, size) \ -+ find_next_bit((addr), (size), 0) -+ -+/* Now for the ext2 filesystem bit operations and helper routines. -+ * -+ * Both NIOS and ext2 are little endian, so these are the same as above. -+ */ -+ -+#define ext2_set_bit test_and_set_bit -+#define ext2_clear_bit test_and_clear_bit -+#define ext2_test_bit test_bit -+ -+#define ext2_set_bit_atomic(lock, nr, addr) \ -+ ({ \ -+ int ret; \ -+ spin_lock(lock); \ -+ ret = ext2_set_bit((nr),(unsigned long *) (addr)); \ -+ spin_unlock(lock); \ -+ ret; \ -+ }) -+ -+#define ext2_clear_bit_atomic(lock, nr, addr) \ -+ ({ \ -+ int ret; \ -+ spin_lock(lock); \ -+ ret = ext2_clear_bit((nr),(unsigned long *) (addr)); \ -+ spin_unlock(lock); \ -+ ret; \ -+ }) -+ -+#define ext2_find_first_zero_bit find_first_zero_bit -+#define ext2_find_next_zero_bit find_next_zero_bit -+ -+#endif /* _ASM_NIOS_BITOPS_H */ ---- linux/include/asm-nios2nommu/bootinfo.h -+++ linux/include/asm-nios2nommu/bootinfo.h -@@ -0,0 +1,2 @@ -+ -+/* Nothing for nios2nommu */ ---- linux/include/asm-nios2nommu/bug.h -+++ linux/include/asm-nios2nommu/bug.h -@@ -0,0 +1,48 @@ -+#ifndef _NIOS2NOMMU_BUG_H -+#define _NIOS2NOMMU_BUG_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/bug.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#define BUG() do { \ -+ printk("%s(%d): kernel BUG!\n", __FILE__, __LINE__); \ -+} while (0) -+ -+#define BUG_ON(condition) do { \ -+ if (unlikely((condition)!=0)) \ -+ BUG(); \ -+} while(0) -+ -+#define PAGE_BUG(page) do { \ -+ BUG(); \ -+} while (0) -+ -+#define WARN_ON(condition) do { \ -+ if (unlikely((condition)!=0)) { \ -+ printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \ -+ dump_stack(); \ -+ } \ -+} while (0) -+ -+#endif ---- linux/include/asm-nios2nommu/bugs.h -+++ linux/include/asm-nios2nommu/bugs.h -@@ -0,0 +1,40 @@ -+#ifndef __ASM_NIOS_BUGS_H -+#define __ASM_NIOS_BUGS_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/bugs.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 1994 Linus Torvalds -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* -+ * This is included by init/main.c to check for architecture-dependent bugs. -+ * -+ * Needs: -+ * void check_bugs(void); -+ */ -+ -+static void check_bugs(void) -+{ -+} -+ -+#endif ---- linux/include/asm-nios2nommu/byteorder.h -+++ linux/include/asm-nios2nommu/byteorder.h -@@ -0,0 +1,38 @@ -+#ifndef __ASM_NIOS_BYTEORDER_H -+#define __ASM_NIOS_BYTEORDER_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/byteorder.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__) -+# define __BYTEORDER_HAS_U64__ -+# define __SWAB_64_THRU_32__ -+#endif -+ -+#include -+ -+#endif -+ ---- linux/include/asm-nios2nommu/cache.h -+++ linux/include/asm-nios2nommu/cache.h -@@ -0,0 +1,34 @@ -+/* -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef __ARCH_NIOS2NOMMU_CACHE_H -+#define __ARCH_NIOS2NOMMU_CACHE_H -+ -+#include -+ -+/* bytes per L1 cache line */ -+#define L1_CACHE_BYTES nasys_icache_line_size /* this need to be at least 1 */ -+ -+ -+#define __cacheline_aligned -+#define ____cacheline_aligned -+ -+#endif ---- linux/include/asm-nios2nommu/cachectl.h -+++ linux/include/asm-nios2nommu/cachectl.h -@@ -0,0 +1,36 @@ -+/* -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2NOMMU_CACHECTL_H -+#define _NIOS2NOMMU_CACHECTL_H -+ -+/* Definitions for the cacheflush system call. */ -+ -+#define FLUSH_SCOPE_LINE 1 /* Flush a cache line */ -+#define FLUSH_SCOPE_PAGE 2 /* Flush a page */ -+#define FLUSH_SCOPE_ALL 3 /* Flush the whole cache -- superuser only */ -+ -+#define FLUSH_CACHE_DATA 1 /* Writeback and flush data cache */ -+#define FLUSH_CACHE_INSN 2 /* Flush instruction cache */ -+#define FLUSH_CACHE_BOTH 3 /* Flush both caches */ -+ -+#endif /* _NIOS2NOMMU_CACHECTL_H */ ---- linux/include/asm-nios2nommu/cacheflush.h -+++ linux/include/asm-nios2nommu/cacheflush.h -@@ -0,0 +1,56 @@ -+#ifndef _NIOS2NOMMU_CACHEFLUSH_H -+#define _NIOS2NOMMU_CACHEFLUSH_H -+ -+/* -+ * Ported from m68knommu. -+ * -+ * (C) Copyright 2003, Microtronix Datacom Ltd. -+ * (C) Copyright 2000-2002, Greg Ungerer -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#include -+ -+extern void cache_push (unsigned long vaddr, int len); -+extern void dcache_push (unsigned long vaddr, int len); -+extern void icache_push (unsigned long vaddr, int len); -+extern void cache_push_all (void); -+ -+#define flush_cache_all() __flush_cache_all() -+#define flush_cache_mm(mm) do { } while (0) -+#define flush_cache_range(vma, start, end) do { } while (0) -+#define flush_cache_page(vma, vmaddr) do { } while (0) -+#define flush_dcache_range(start,end) dcache_push(start, end - start) -+#define flush_dcache_page(page) do { } while (0) -+#define flush_icache_range(start,end) cache_push(start, end - start) -+#define flush_icache_page(vma,pg) do { } while (0) -+#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) -+ -+#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ -+ memcpy(dst, src, len) -+#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ -+ memcpy(dst, src, len) -+ -+ -+extern inline void __flush_cache_all(void) -+{ -+ cache_push_all(); -+} -+ -+#endif /* _NIOS2NOMMU_CACHEFLUSH_H */ ---- linux/include/asm-nios2nommu/checksum.h -+++ linux/include/asm-nios2nommu/checksum.h -@@ -0,0 +1,320 @@ -+#ifndef __NIOS2_CHECKSUM_H -+#define __NIOS2_CHECKSUM_H -+ -+/* checksum.h: IP/UDP/TCP checksum routines on the NIOS. -+ * -+ * Copyright(C) 1995 Linus Torvalds -+ * Copyright(C) 1995 Miguel de Icaza -+ * Copyright(C) 1996 David S. Miller -+ * Copyright(C) 2001 Ken Hill -+ * Copyright(C) 2004 Microtronix Datacom Ltd. -+ * -+ * derived from: -+ * Alpha checksum c-code -+ * ix86 inline assembly -+ * Spar nommu -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+/* -+ * computes the checksum of the TCP/UDP pseudo-header -+ * returns a 16-bit checksum, already complemented -+ */ -+ -+extern inline unsigned short csum_tcpudp_magic(unsigned long saddr, -+ unsigned long daddr, -+ unsigned short len, -+ unsigned short proto, -+ unsigned int sum) -+{ -+ barrier(); -+ __asm__ __volatile__( -+" add %0, %3, %0\n" -+" bgeu %0, %3, 1f\n" -+" addi %0, %0, 1\n" -+"1: add %0, %4, %0\n" -+" bgeu %0, %4, 1f\n" -+" addi %0, %0, 1\n" -+"1: add %0, %5, %0\n" -+" bgeu %0, %5, 1f\n" -+" addi %0, %0, 1\n" -+"1:\n" -+/* -+ We need the carry from the addition of 16-bit -+ significant addition, so we zap out the low bits -+ in one half, zap out the high bits in another, -+ shift them both up to the top 16-bits of a word -+ and do the carry producing addition, finally -+ shift the result back down to the low 16-bits. -+ -+ Actually, we can further optimize away two shifts -+ because we know the low bits of the original -+ value will be added to zero-only bits so cannot -+ affect the addition result nor the final carry -+ bit. -+*/ -+" slli %1,%0, 16\n" /* Need a copy to fold with */ -+ /* Bring the LOW 16 bits up */ -+" add %0, %1, %0\n" /* add and set carry, neat eh? */ -+" cmpltu r15, %0, %1\n" /* get remaining carry bit */ -+" srli %0, %0, 16\n" /* shift back down the result */ -+" add %0, %0, r15\n" -+" nor %0, %0, %0\n" /* negate */ -+ : "=&r" (sum), "=&r" (saddr) -+ : "0" (sum), "1" (saddr), "r" (ntohl(len+proto)), "r" (daddr) -+ : "r15"); -+ return ((unsigned short) sum); -+ barrier(); -+} -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+ -+ extern inline unsigned short from32to16(unsigned long x) -+ { -+ barrier(); -+ __asm__ __volatile__( -+ "add %0, %1, %0\n" -+ "cmpltu r15, %0, %1\n" -+ "srli %0, %0, 16\n" -+ "add %0, %0, r15\n" -+ : "=r" (x) -+ : "r" (x << 16), "0" (x) -+ : "r15"); -+ return x; -+ barrier(); -+ } -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+ -+extern inline unsigned long do_csum(const unsigned char * buff, int len) -+{ -+ int odd, count; -+ unsigned long result = 0; -+ -+ barrier(); -+ if (len <= 0) -+ goto out; -+ odd = 1 & (unsigned long) buff; -+ if (odd) { -+////result = *buff; // dgt: Big endian -+ result = *buff << 8; // dgt: Little endian -+ -+ len--; -+ buff++; -+ } -+ count = len >> 1; /* nr of 16-bit words.. */ -+ if (count) { -+ if (2 & (unsigned long) buff) { -+ result += *(unsigned short *) buff; -+ count--; -+ len -= 2; -+ buff += 2; -+ } -+ count >>= 1; /* nr of 32-bit words.. */ -+ if (count) { -+ unsigned long carry = 0; -+ do { -+ unsigned long w = *(unsigned long *) buff; -+ count--; -+ buff += 4; -+ result += carry; -+ result += w; -+ carry = (w > result); -+ } while (count); -+ result += carry; -+ result = (result & 0xffff) + (result >> 16); -+ } -+ if (len & 2) { -+ result += *(unsigned short *) buff; -+ buff += 2; -+ } -+ } -+ if (len & 1) -+ result += *buff; /* This is little machine, byte is right */ -+ result = from32to16(result); -+ if (odd) -+ result = ((result >> 8) & 0xff) | ((result & 0xff) << 8); -+out: -+ return result; -+ barrier(); -+ } -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+ -+/* ihl is always 5 or greater, almost always is 5, iph is always word -+ * aligned but can fail to be dword aligned very often. -+ */ -+ -+ extern inline unsigned short ip_fast_csum(const unsigned char *iph, unsigned int ihl) -+ { -+ unsigned int sum; -+ -+ barrier(); -+ __asm__ __volatile__( -+" andi r8, %1, 2\n" /* Remember original alignment */ -+" ldw %0, (%1)\n" /* 16 or 32 bit boundary */ -+" beq r8, r0, 1f\n" /* Aligned on 32 bit boundary, go */ -+" srli %0, %0, 16\n" /* Get correct 16 bits */ -+" addi %2, %2, -1\n" /* Take off for 4 bytes, pickup last 2 at end */ -+" addi %1, %1, 2\n" /* Adjust pointer to 32 bit boundary */ -+" br 2f\n" -+"1:\n" -+" addi %2, %2, -1\n" -+" addi %1, %1, 4\n" /* Bump ptr a long word */ -+"2:\n" -+" ldw r9, (%1)\n" -+"1:\n" -+" add %0, r9, %0\n" -+" bgeu %0, r9, 2f\n" -+" addi %0, %0, 1\n" -+"2:\n" -+" addi %1, %1, 4\n" -+" addi %2, %2, -1\n" -+" ldw r9, (%1)\n" -+" bne %2, r0, 1b\n" -+" beq r8, r0, 1f\n" /* 32 bit boundary time to leave */ -+" srli r9, r9, 16\n" /* 16 bit boundary, get correct 16 bits */ -+" add %0, r9, %0\n" -+" bgeu %0, r9, 1f\n" -+" addi %0, %0, 1\n" -+"1:\n" -+" slli %2, %0, 16\n" -+" add %0, %2, %0\n" -+" cmpltu r8, %0, %2\n" -+" srli %0, %0, 16\n" -+" add %0, %0, r8\n" -+" nor %0, %0, %0\n" -+ : "=&r" (sum), "=&r" (iph), "=&r" (ihl) -+ : "1" (iph), "2" (ihl) -+ : "r8", "r9"); -+ return sum; -+ barrier(); -+ } -+ -+/*these 2 functions are now in checksum.c */ -+unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum); -+unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum); -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+/* -+ * the same as csum_partial_copy, but copies from user space. -+ * -+ * here even more important to align src and dst on a 32-bit (or even -+ * better 64-bit) boundary -+ */ -+extern inline unsigned int -+csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *csum_err) -+{ -+ barrier(); -+ if (csum_err) *csum_err = 0; -+ memcpy(dst, src, len); -+ return csum_partial(dst, len, sum); -+ barrier(); -+} -+ -+#define csum_partial_copy_nocheck(src, dst, len, sum) \ -+ csum_partial_copy ((src), (dst), (len), (sum)) -+ -+ -+/* -+ * this routine is used for miscellaneous IP-like checksums, mainly -+ * in icmp.c -+ */ -+ -+extern inline unsigned short ip_compute_csum(unsigned char * buff, int len) -+{ -+ barrier(); -+ return ~from32to16(do_csum(buff,len)); -+ barrier(); -+} -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+ -+#define csum_partial_copy_fromuser(s, d, l, w) \ -+ csum_partial_copy((char *) (s), (d), (l), (w)) -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+ -+/* -+ * Fold a partial checksum without adding pseudo headers -+ */ -+extern __inline__ unsigned int csum_fold(unsigned int sum) -+{ -+ barrier(); -+ __asm__ __volatile__( -+ "add %0, %1, %0\n" -+ "cmpltu r8, %0, %1\n" -+ "srli %0, %0, 16\n" -+ "add %0, %0, r8\n" -+ "nor %0, %0, %0\n" -+ : "=r" (sum) -+ : "r" (sum << 16), "0" (sum) -+ : "r8"); -+ return sum; -+ barrier(); -+} -+ -+ -+/*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ -+ -+ -+extern __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr, -+ unsigned long daddr, -+ unsigned short len, -+ unsigned short proto, -+ unsigned int sum) -+{ -+ barrier(); -+ __asm__ __volatile__( -+ "add %0, %1, %0\n" -+ "cmpltu r8, %0, %1\n" -+ "add %0, %0, r8\n" /* add carry */ -+ "add %0, %2, %0\n" -+ "cmpltu r8, %0, %2\n" -+ "add %0, %0, r8\n" /* add carry */ -+ "add %0, %3, %0\n" -+ "cmpltu r8, %0, %3\n" -+ "add %0, %0, r8\n" /* add carry */ -+ : "=r" (sum), "=r" (saddr) -+ : "r" (daddr), "r" ( (ntohs(len)<<16) + (proto*256) ), -+ "0" (sum), -+ "1" (saddr) -+ : "r8"); -+ -+ return sum; -+ barrier(); -+} -+ -+ -+#endif /* (__NIOS2_CHECKSUM_H) */ ---- linux/include/asm-nios2nommu/cprefix.h -+++ linux/include/asm-nios2nommu/cprefix.h -@@ -0,0 +1,38 @@ -+/* cprefix.h: This file is included by assembly source which needs -+ * to know what the c-label prefixes are. The newer versions -+ * of cpp that come with gcc predefine such things to help -+ * us out. The reason this stuff is needed is to make -+ * solaris compiles of the kernel work. -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef __NIOS2_CPREFIX_H -+#define __NIOS2_CPREFIX_H -+ -+#define C_LABEL_PREFIX -+ -+#define CONCAT(a, b) CONCAT2(a, b) -+#define CONCAT2(a, b) a##b -+ -+#define C_LABEL(name) CONCAT(C_LABEL_PREFIX, name) -+ -+#endif /* !(__NIOS2_CPREFIX_H) */ ---- linux/include/asm-nios2nommu/cpumask.h -+++ linux/include/asm-nios2nommu/cpumask.h -@@ -0,0 +1,28 @@ -+/* -+ * All rights reserved. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _ASM_NIOS2NOMMU_CPUMASK_H -+#define _ASM_NIOS2NOMMU_CPUMASK_H -+ -+#include -+ -+#endif /* _ASM_NIOS2NOMMU_CPUMASK_H */ ---- linux/include/asm-nios2nommu/current.h -+++ linux/include/asm-nios2nommu/current.h -@@ -0,0 +1,39 @@ -+#ifndef _NIOS2NOMMU_CURRENT_H -+#define _NIOS2NOMMU_CURRENT_H -+/* -+ * current.h -+ * (C) Copyright 2000, Lineo, David McCullough -+ * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com) -+ * (C) Copyright 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#include -+ -+struct task_struct; -+ -+static inline struct task_struct *get_current(void) -+{ -+ return(current_thread_info()->task); -+} -+ -+#define current get_current() -+ -+#endif /* _NIOS2NOMMU_CURRENT_H */ ---- linux/include/asm-nios2nommu/delay.h -+++ linux/include/asm-nios2nommu/delay.h -@@ -0,0 +1,96 @@ -+#ifndef _NIOS_DELAY_H -+#define _NIOS_DELAY_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/delay.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+extern __inline__ void __delay(unsigned long loops) -+{ -+ int dummy; -+ -+ __asm__ __volatile__( -+ "1: \n\t" -+ " beq %0,zero,2f\n\t" -+ " addi %0, %0, -1\n\t" -+ " br 1b\n\t" -+ "2: \n\t" -+ -+ : "=r" (dummy) /* Need output for optimizer */ -+ -+ : "0" (loops) /* %0 Input */ -+ ); -+} -+ -+/* -+ * Note that 19 * 226 == 4294 ==~ 2^32 / 10^6, so -+ * loops = (4294 * usecs * loops_per_jiffy * HZ) / 2^32. -+ * -+ * The mul instruction gives us loops = (a * b) / 2^32. -+ * We choose a = usecs * 19 * HZ and b = loops_per_jiffy * 226 -+ * because this lets us support a wide range of HZ and -+ * loops_per_jiffy values without either a or b overflowing 2^32. -+ * Thus we need usecs * HZ <= (2^32 - 1) / 19 = 226050910 and -+ * loops_per_jiffy <= (2^32 - 1) / 226 = 19004280 -+ * (which corresponds to ~3800 bogomips at HZ = 100). -+ * -- paulus -+ */ -+#define __MAX_UDELAY (226050910UL/HZ) /* maximum udelay argument */ -+#define __MAX_NDELAY (4294967295UL/HZ) /* maximum ndelay argument */ -+ -+extern unsigned long loops_per_jiffy; -+ -+extern __inline__ void __udelay(unsigned int x) -+{ -+ unsigned int loops; -+ -+ __asm__("mulxuu %0,%1,%2" : "=r" (loops) : -+ "r" (x), "r" (loops_per_jiffy * 226)); -+ __delay(loops); -+} -+ -+extern __inline__ void __ndelay(unsigned int x) -+{ -+ unsigned int loops; -+ -+ __asm__("mulxuu %0,%1,%2" : "=r" (loops) : -+ "r" (x), "r" (loops_per_jiffy * 5)); -+ __delay(loops); -+} -+ -+extern void __bad_udelay(void); /* deliberately undefined */ -+extern void __bad_ndelay(void); /* deliberately undefined */ -+ -+#define udelay(n) (__builtin_constant_p(n)? \ -+ ((n) > __MAX_UDELAY? __bad_udelay(): __udelay((n) * (19 * HZ))) : \ -+ __udelay((n) * (19 * HZ))) -+ -+#define ndelay(n) (__builtin_constant_p(n)? \ -+ ((n) > __MAX_NDELAY? __bad_ndelay(): __ndelay((n) * HZ)) : \ -+ __ndelay((n) * HZ)) -+ -+#define muldiv(a, b, c) (((a)*(b))/(c)) -+ -+#endif /* defined(_NIOS_DELAY_H) */ ---- linux/include/asm-nios2nommu/div64.h -+++ linux/include/asm-nios2nommu/div64.h -@@ -0,0 +1,31 @@ -+#ifndef __ASMNIOS_DIV64_H -+#define __ASMNIOS_DIV64_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/div64.h -+ * -+ * Derived from m68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#endif -+ ---- linux/include/asm-nios2nommu/dma-mapping.h -+++ linux/include/asm-nios2nommu/dma-mapping.h -@@ -0,0 +1,25 @@ -+/* -+ * include/asm-s390/dma-mapping.h -+ * -+ * S390 version -+ * -+ * This file exists so that #include doesn't break anything. -+ */ -+ -+#ifndef _ASM_DMA_MAPPING_H -+#define _ASM_DMA_MAPPING_H -+ -+static inline void *dma_alloc_coherent(struct device *dev, size_t size, -+ dma_addr_t *dma_handle, int flag) -+{ -+ BUG(); -+ return 0; -+} -+ -+static inline void dma_free_coherent(struct device *dev, size_t size, -+ void *vaddr, dma_addr_t dma_handle) -+{ -+ BUG(); -+} -+ -+#endif /* _ASM_DMA_MAPPING_H */ ---- linux/include/asm-nios2nommu/dma.h -+++ linux/include/asm-nios2nommu/dma.h -@@ -0,0 +1,40 @@ -+/* $Id: dma.h,v 1.5 2004/03/02 16:05:52 ken-h Exp $ -+ * -+ * Copyright 1995 (C) David S. Miller (davem@caip.rutgers.edu) -+ * Copyright 2004 (C) Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _ASM_NIOS2_DMA_H -+#define _ASM_NIOS2_DMA_H -+ -+#include -+#include -+ -+#define MAX_DMA_CHANNELS 2 -+#define MAX_DMA_ADDRESS (LINUX_SDRAM_START) -+#define DMA_MODE_READ 1 -+#define DMA_MODE_WRITE 2 -+ -+extern int get_dma_list(char *); -+extern int request_dma(unsigned int, const char *); -+extern void free_dma(unsigned int); -+ -+#endif /* !(_ASM_NIOS2_DMA_H) */ ---- linux/include/asm-nios2nommu/elf.h -+++ linux/include/asm-nios2nommu/elf.h -@@ -0,0 +1,141 @@ -+#ifndef __NIOS2_ELF_H -+#define __NIOS2_ELF_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/elf.h -+ * -+ * Nio2 ELF relocation types -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * Jan/20/2004 dgt NiosII -+ * Mar/18/2004 xwt NiosII relocation types added -+ * -+ ---------------------------------------------------------------------*/ -+ -+// #include -+#include -+#include -+ -+#define R_NIOS2_NONE 0 -+#define R_NIOS2_S16 1 -+#define R_NIOS2_U16 2 -+#define R_NIOS2_PCREL16 3 -+#define R_NIOS2_CALL26 4 -+#define R_NIOS2_IMM5 5 -+#define R_NIOS2_CACHE_OPX 6 -+#define R_NIOS2_IMM6 7 -+#define R_NIOS2_IMM8 8 -+#define R_NIOS2_HI16 9 -+#define R_NIOS2_LO16 10 -+#define R_NIOS2_HIADJ16 11 -+#define R_NIOS2_BFD_RELOC_32 12 -+#define R_NIOS2_BFD_RELOC_16 13 -+#define R_NIOS2_BFD_RELOC_8 14 -+#define R_NIOS2_GPREL 15 -+#define R_NIOS2_GNU_VTINHERIT 16 -+#define R_NIOS2_GNU_VTENTRY 17 -+#define R_NIOS2_UJMP 18 -+#define R_NIOS2_CJMP 19 -+#define R_NIOS2_CALLR 20 -+#define R_NIOS2_ALIGN 21 -+/* Keep this the last entry. */ -+#define R_NIOS2_NUM 22 -+ -+typedef unsigned long elf_greg_t; -+ -+#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) -+typedef elf_greg_t elf_gregset_t[ELF_NGREG]; -+ -+typedef unsigned long elf_fpregset_t; -+ -+/* -+ * This is used to ensure we don't load something for the wrong architecture. -+ */ -+#define elf_check_arch(x) \ -+ ((x)->e_machine == EM_ALTERA_NIOS2) -+ -+/* -+ * These are used to set parameters in the core dumps. -+ */ -+#define ELF_CLASS ELFCLASS32 -+#define ELF_DATA ELFDATA2LSB -+#define ELF_ARCH EM_ALTERA_NIOS2 -+ -+#define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0 -+ -+#define USE_ELF_CORE_DUMP -+#define ELF_EXEC_PAGESIZE 4096 -+ -+/* This is the location that an ET_DYN program is loaded if exec'ed. Typical -+ use of this is to invoke "./ld.so someprog" to test out a new version of -+ the loader. We need to make sure that it is out of the way of the program -+ that it will "exec", and that there is sufficient room for the brk. */ -+ -+#define ELF_ET_DYN_BASE 0xD0000000UL -+ -+/* regs is struct pt_regs, pr_reg is elf_gregset_t (which is -+ now struct_user_regs, they are different) */ -+ -+#define ELF_CORE_COPY_REGS(pr_reg, regs) \ -+ /* Bleech. */ \ -+ pr_reg[0] = regs->r1; \ -+ pr_reg[1] = regs->r2; \ -+ pr_reg[2] = regs->r3; \ -+ pr_reg[3] = regs->r4; \ -+ pr_reg[4] = regs->r5; \ -+ pr_reg[5] = regs->r6; \ -+ pr_reg[6] = regs->r7; \ -+ pr_reg[7] = regs->r8; \ -+ pr_reg[8] = regs->r9; \ -+ pr_reg[9] = regs->r10; \ -+ pr_reg[10] = regs->r11; \ -+ pr_reg[11] = regs->r12; \ -+ pr_reg[12] = regs->r13; \ -+ pr_reg[13] = regs->r14; \ -+ pr_reg[14] = regs->r15; \ -+ pr_reg[23] = regs->sp; \ -+ pr_reg[26] = regs->estatus; \ -+ { \ -+ struct switch_stack *sw = ((struct switch_stack *)regs) - 1; \ -+ pr_reg[15] = sw->r16; \ -+ pr_reg[16] = sw->r17; \ -+ pr_reg[17] = sw->r18; \ -+ pr_reg[18] = sw->r19; \ -+ pr_reg[19] = sw->r20; \ -+ pr_reg[20] = sw->r21; \ -+ pr_reg[21] = sw->r22; \ -+ pr_reg[22] = sw->r23; \ -+ pr_reg[24] = sw->fp; \ -+ pr_reg[25] = sw->gp; \ -+ } -+ -+/* This yields a mask that user programs can use to figure out what -+ instruction set this cpu supports. */ -+ -+#define ELF_HWCAP (0) -+ -+/* This yields a string that ld.so will use to load implementation -+ specific libraries for optimization. This is more specific in -+ intent than poking at uname or /proc/cpuinfo. */ -+ -+#define ELF_PLATFORM (NULL) -+ -+#ifdef __KERNEL__ -+#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX) -+#endif -+ -+#endif ---- linux/include/asm-nios2nommu/entry.h -+++ linux/include/asm-nios2nommu/entry.h -@@ -0,0 +1,188 @@ -+/* -+ * Hacked from m68knommu port. -+ * -+ * Copyright(C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2NOMMU_ENTRY_H -+#define __NIOS2NOMMU_ENTRY_H -+ -+#ifdef __ASSEMBLY__ -+ -+// #include -+#include -+#include -+#include -+ -+/* -+ * Stack layout in 'ret_from_exception': -+ * -+ * This allows access to the syscall arguments in registers r4-r8 -+ * -+ * 0(sp) - r8 -+ * 4(sp) - r9 -+ * 8(sp) - r10 -+ * C(sp) - r11 -+ * 10(sp) - r12 -+ * 14(sp) - r13 -+ * 18(sp) - r14 -+ * 1C(sp) - r15 -+ * 20(sp) - r1 -+ * 24(sp) - r2 -+ * 28(sp) - r3 -+ * 2C(sp) - r4 -+ * 30(sp) - r5 -+ * 34(sp) - r6 -+ * 38(sp) - r7 -+ * 3C(sp) - orig_r2 -+ * 40(sp) - ra -+ * 44(sp) - fp -+ * 48(sp) - sp -+ * 4C(sp) - gp -+ * 50(sp) - estatus -+ * 54(sp) - status_extension -+ * 58(sp) - ea -+ * -+ */ -+ -+/* process bits for task_struct.flags */ -+PF_TRACESYS_OFF = 3 -+PF_TRACESYS_BIT = 5 -+PF_PTRACED_OFF = 3 -+PF_PTRACED_BIT = 4 -+PF_DTRACE_OFF = 1 -+PF_DTRACE_BIT = 5 -+ -+LENOSYS = 38 -+ -+/* -+ * This defines the normal kernel pt-regs layout. -+ * -+ */ -+ -+/* -+ * Standard Nios2 interrupt entry and exit macros. -+ * Must be called with interrupts disabled. -+ */ -+.macro SAVE_ALL -+ movia r24,status_extension // Read status extension -+ ldw r24,0(r24) -+ andi r24,r24,PS_S_ASM -+ bne r24,r0,1f // In supervisor mode, already on kernel stack -+ movia r24,_current_thread // Switch to current kernel stack -+ ldw r24,0(r24) // using the thread_info -+ addi r24,r24,THREAD_SIZE_ASM-PT_REGS_SIZE -+ stw sp,PT_SP(r24) // Save user stack before changing -+ mov sp,r24 -+ br 2f -+ -+1: mov r24,sp -+ addi sp,sp,-PT_REGS_SIZE // Backup the kernel stack pointer -+ stw r24,PT_SP(sp) -+2: stw r1,PT_R1(sp) -+ stw r2,PT_R2(sp) -+ stw r3,PT_R3(sp) -+ stw r4,PT_R4(sp) -+ stw r5,PT_R5(sp) -+ stw r6,PT_R6(sp) -+ stw r7,PT_R7(sp) -+ stw r8,PT_R8(sp) -+ stw r9,PT_R9(sp) -+ stw r10,PT_R10(sp) -+ stw r11,PT_R11(sp) -+ stw r12,PT_R12(sp) -+ stw r13,PT_R13(sp) -+ stw r14,PT_R14(sp) -+ stw r15,PT_R15(sp) -+ stw r2,PT_ORIG_R2(sp) -+ stw ra,PT_RA(sp) -+ stw fp,PT_FP(sp) -+ stw gp,PT_GP(sp) -+ rdctl r24,estatus -+ stw r24,PT_ESTATUS(sp) -+ movia r24,status_extension // Read status extension -+ ldw r1,0(r24) -+ stw r1,PT_STATUS_EXTENSION(sp) // Store user/supervisor status -+ ORI32 r1,r1,PS_S_ASM // Set supervisor mode -+ stw r1,0(r24) -+ stw ea,PT_EA(sp) -+.endm -+ -+.macro RESTORE_ALL -+ ldw r1,PT_STATUS_EXTENSION(sp) // Restore user/supervisor status -+ movia r24,status_extension -+ stw r1,0(r24) -+ ldw r1,PT_R1(sp) // Restore registers -+ ldw r2,PT_R2(sp) -+ ldw r3,PT_R3(sp) -+ ldw r4,PT_R4(sp) -+ ldw r5,PT_R5(sp) -+ ldw r6,PT_R6(sp) -+ ldw r7,PT_R7(sp) -+ ldw r8,PT_R8(sp) -+ ldw r9,PT_R9(sp) -+ ldw r10,PT_R10(sp) -+ ldw r11,PT_R11(sp) -+ ldw r12,PT_R12(sp) -+ ldw r13,PT_R13(sp) -+ ldw r14,PT_R14(sp) -+ ldw r15,PT_R15(sp) -+ ldw ra,PT_RA(sp) -+ ldw fp,PT_FP(sp) -+ ldw gp,PT_GP(sp) -+ ldw r24,PT_ESTATUS(sp) -+ wrctl estatus,r24 -+ ldw ea,PT_EA(sp) -+ ldw sp,PT_SP(sp) // Restore sp last -+.endm -+ -+.macro SAVE_SWITCH_STACK -+ addi sp,sp,-SWITCH_STACK_SIZE -+ stw r16,SW_R16(sp) -+ stw r17,SW_R17(sp) -+ stw r18,SW_R18(sp) -+ stw r19,SW_R19(sp) -+ stw r20,SW_R20(sp) -+ stw r21,SW_R21(sp) -+ stw r22,SW_R22(sp) -+ stw r23,SW_R23(sp) -+ stw fp,SW_FP(sp) -+ stw gp,SW_GP(sp) -+ stw ra,SW_RA(sp) -+.endm -+ -+.macro RESTORE_SWITCH_STACK -+ ldw r16,SW_R16(sp) -+ ldw r17,SW_R17(sp) -+ ldw r18,SW_R18(sp) -+ ldw r19,SW_R19(sp) -+ ldw r20,SW_R20(sp) -+ ldw r21,SW_R21(sp) -+ ldw r22,SW_R22(sp) -+ ldw r23,SW_R23(sp) -+ ldw fp,SW_FP(sp) -+ ldw gp,SW_GP(sp) -+ ldw ra,SW_RA(sp) -+ addi sp,sp,SWITCH_STACK_SIZE -+.endm -+ -+#endif /* __ASSEMBLY__ */ -+#endif /* __NIOS2NOMMU_ENTRY_H */ ---- linux/include/asm-nios2nommu/errno.h -+++ linux/include/asm-nios2nommu/errno.h -@@ -0,0 +1,6 @@ -+#ifndef _NIOS2NOMMU_ERRNO_H -+#define _NIOS2NOMMU_ERRNO_H -+ -+#include -+ -+#endif /* _NIOS2NOMMU_ERRNO_H */ ---- linux/include/asm-nios2nommu/fcntl.h -+++ linux/include/asm-nios2nommu/fcntl.h -@@ -0,0 +1,110 @@ -+/* -+ * This file came from the m68k port. -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef _NIOS2_FCNTL_H -+#define _NIOS2_FCNTL_H -+ -+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files -+ located on an ext2 file system */ -+#define O_ACCMODE 0003 -+#define O_RDONLY 00 -+#define O_WRONLY 01 -+#define O_RDWR 02 -+#define O_CREAT 0100 /* not fcntl */ -+#define O_EXCL 0200 /* not fcntl */ -+#define O_NOCTTY 0400 /* not fcntl */ -+#define O_TRUNC 01000 /* not fcntl */ -+#define O_APPEND 02000 -+#define O_NONBLOCK 04000 -+#define O_NDELAY O_NONBLOCK -+#define O_SYNC 010000 -+#define FASYNC 020000 /* fcntl, for BSD compatibility */ -+#define O_DIRECTORY 040000 /* must be a directory */ -+#define O_NOFOLLOW 0100000 /* don't follow links */ -+#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */ -+#define O_LARGEFILE 0400000 -+#define O_NOATIME 01000000 -+ -+#define F_DUPFD 0 /* dup */ -+#define F_GETFD 1 /* get close_on_exec */ -+#define F_SETFD 2 /* set/clear close_on_exec */ -+#define F_GETFL 3 /* get file->f_flags */ -+#define F_SETFL 4 /* set file->f_flags */ -+#define F_GETLK 5 -+#define F_SETLK 6 -+#define F_SETLKW 7 -+ -+#define F_SETOWN 8 /* for sockets. */ -+#define F_GETOWN 9 /* for sockets. */ -+#define F_SETSIG 10 /* for sockets. */ -+#define F_GETSIG 11 /* for sockets. */ -+ -+#define F_GETLK64 12 /* using 'struct flock64' */ -+#define F_SETLK64 13 -+#define F_SETLKW64 14 -+ -+/* for F_[GET|SET]FL */ -+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */ -+ -+/* for posix fcntl() and lockf() */ -+#define F_RDLCK 0 -+#define F_WRLCK 1 -+#define F_UNLCK 2 -+ -+/* for old implementation of bsd flock () */ -+#define F_EXLCK 4 /* or 3 */ -+#define F_SHLCK 8 /* or 4 */ -+ -+/* for leases */ -+#define F_INPROGRESS 16 -+ -+/* operations for bsd flock(), also used by the kernel implementation */ -+#define LOCK_SH 1 /* shared lock */ -+#define LOCK_EX 2 /* exclusive lock */ -+#define LOCK_NB 4 /* or'd with one of the above to prevent -+ blocking */ -+#define LOCK_UN 8 /* remove lock */ -+ -+#define LOCK_MAND 32 /* This is a mandatory flock */ -+#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -+#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -+#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ -+ -+struct flock { -+ short l_type; -+ short l_whence; -+ off_t l_start; -+ off_t l_len; -+ pid_t l_pid; -+}; -+ -+struct flock64 { -+ short l_type; -+ short l_whence; -+ loff_t l_start; -+ loff_t l_len; -+ pid_t l_pid; -+}; -+ -+#define F_LINUX_SPECIFIC_BASE 1024 -+#endif /* _NIOS2_FCNTL_H */ ---- linux/include/asm-nios2nommu/flat.h -+++ linux/include/asm-nios2nommu/flat.h -@@ -0,0 +1,126 @@ -+/* -+ * include/asm-nios2nommu/flat.h -- uClinux bFLT relocations -+ * -+ * Copyright (C) 2004,05 Microtronix Datacom Ltd -+ * -+ * This file is subject to the terms and conditions of the GNU General -+ * Public License. See the file COPYING in the main directory of this -+ * archive for more details. -+ * -+ * Written by Wentao Xu -+ */ -+ -+#ifndef __NIOS2_FLAT_H__ -+#define __NIOS2_FLAT_H__ -+ -+#define flat_reloc_valid(reloc, size) ((reloc) <= (size + 0x8000)) -+ -+/* The stack is 64-bit aligned for Nios II, so (sp - 1) shall -+ * be 64-bit aligned, where -1 is for argc -+ */ -+#define flat_stack_align(sp) (sp = (unsigned long *)(((unsigned long)sp - 1) & (-8))) -+ -+/* The uClibc port for Nios II expects the argc is followed by argv and envp */ -+#define flat_argvp_envp_on_stack() 1 -+ -+#define flat_old_ram_flag(flags) (flags) -+ -+/* We store the type of relocation in the top 4 bits of the `relval.' */ -+ -+/* Convert a relocation entry into an address. */ -+static inline unsigned long -+flat_get_relocate_addr (unsigned long relval) -+{ -+ return relval & 0x0fffffff; /* Mask out top 4-bits */ -+} -+ -+#define FLAT_NIOS2_RELOC_TYPE(relval) ((relval) >> 28) -+ -+#define FLAT_NIOS2_R_32 0 /* Normal 32-bit reloc */ -+#define FLAT_NIOS2_R_HI_LO 1 /* High 16-bits + low 16-bits field */ -+#define FLAT_NIOS2_R_HIADJ_LO 2 /* High 16-bits adjust + low 16-bits field */ -+#define FLAT_NIOS2_R_CALL26 4 /* Call imm26 */ -+ -+/* Extract the address to be relocated from the symbol reference at rp; -+ * relval is the raw relocation-table entry from which RP is derived. -+ * rp shall always be 32-bit aligned -+ */ -+static inline unsigned long flat_get_addr_from_rp (unsigned long *rp, -+ unsigned long relval, -+ unsigned long flags) -+{ -+ switch (FLAT_NIOS2_RELOC_TYPE(relval)) -+ { -+ case FLAT_NIOS2_R_32: -+ /* Simple 32-bit address. The loader expect it in bigger endian */ -+ return htonl(*rp); -+ -+ case FLAT_NIOS2_R_HI_LO: -+ /* get the two 16-bit immediate value from instructions, then -+ * construct a 32-bit value. Again the loader expect bigger endian -+ */ -+ return htonl ((((rp[0] >> 6) & 0xFFFF) << 16 ) | -+ ((rp[1] >> 6) & 0xFFFF)); -+ -+ case FLAT_NIOS2_R_HIADJ_LO: -+ { -+ /* get the two 16-bit immediate value from instructions, then -+ * construct a 32-bit value. Again the loader expect bigger endian -+ */ -+ unsigned int low, high; -+ high = (rp[0] >> 6) & 0xFFFF; -+ low = (rp[1] >> 6) & 0xFFFF; -+ -+ if ((low >> 15) & 1) high--; -+ -+ return htonl ((high << 16 ) | low ); -+ } -+ case FLAT_NIOS2_R_CALL26: -+ /* the 26-bit immediate value is actually 28-bit */ -+ return htonl(((*rp) >> 6) << 2); -+ -+ default: -+ return ~0; /* bogus value */ -+ } -+} -+ -+/* Insert the address addr into the symbol reference at rp; -+ * relval is the raw relocation-table entry from which rp is derived. -+ * rp shall always be 32-bit aligned -+ */ -+static inline void flat_put_addr_at_rp (unsigned long *rp, unsigned long addr, -+ unsigned long relval) -+{ -+ unsigned long exist_val; -+ switch (FLAT_NIOS2_RELOC_TYPE (relval)) { -+ case FLAT_NIOS2_R_32: -+ /* Simple 32-bit address. */ -+ *rp = addr; -+ break; -+ -+ case FLAT_NIOS2_R_HI_LO: -+ exist_val = rp[0]; -+ rp[0] = ((((exist_val >> 22) << 16) | (addr >> 16)) << 6) | (exist_val & 0x3F); -+ exist_val = rp[1]; -+ rp[1] = ((((exist_val >> 22) << 16) | (addr & 0xFFFF)) << 6) | (exist_val & 0x3F); -+ break; -+ -+ case FLAT_NIOS2_R_HIADJ_LO: -+ { -+ unsigned int high = (addr >> 16); -+ if ((addr >> 15) & 1) -+ high = (high + 1) & 0xFFFF; -+ exist_val = rp[0]; -+ rp[0] = ((((exist_val >> 22) << 16) | high) << 6) | (exist_val & 0x3F); -+ exist_val = rp[1]; -+ rp[1] = ((((exist_val >> 22) << 16) | (addr & 0xFFFF)) << 6) | (exist_val & 0x3F); -+ break; -+ } -+ case FLAT_NIOS2_R_CALL26: -+ /* the opcode of CALL is 0, so just store the value */ -+ *rp = ((addr >> 2) << 6); -+ break; -+ } -+} -+ -+#endif /* __NIOS2_FLAT_H__ */ ---- linux/include/asm-nios2nommu/hardirq.h -+++ linux/include/asm-nios2nommu/hardirq.h -@@ -0,0 +1,85 @@ -+/* -+ * Ported from m68knommu -+ * -+ * Copyright (C) 2003, Microtronix Datacom Ltd. -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef __NIOS2_HARDIRQ_H -+#define __NIOS2_HARDIRQ_H -+ -+// #include -+#include -+#include -+ -+typedef struct { -+ unsigned int __softirq_pending; -+ unsigned int __syscall_count; -+ struct task_struct * __ksoftirqd_task; -+} ____cacheline_aligned irq_cpustat_t; -+ -+#include /* Standard mappings for irq_cpustat_t above */ -+ -+/* -+ * We put the hardirq and softirq counter into the preemption -+ * counter. The bitmask has the following meaning: -+ * -+ * - bits 0-7 are the preemption count (max preemption depth: 256) -+ * - bits 8-15 are the softirq count (max # of softirqs: 256) -+ * - bits 16-23 are the hardirq count (max # of hardirqs: 256) -+ * -+ * - ( bit 26 is the PREEMPT_ACTIVE flag. ) -+ * -+ * PREEMPT_MASK: 0x000000ff -+ * HARDIRQ_MASK: 0x0000ff00 -+ * SOFTIRQ_MASK: 0x00ff0000 -+ */ -+ -+#define PREEMPT_BITS 8 -+#define SOFTIRQ_BITS 8 -+#define HARDIRQ_BITS 8 -+ -+#define PREEMPT_SHIFT 0 -+#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) -+#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) -+ -+/* -+ * The hardirq mask has to be large enough to have -+ * space for potentially all IRQ sources in the system -+ * nesting on a single CPU: -+ */ -+#if (1 << HARDIRQ_BITS) < NR_IRQS -+# error HARDIRQ_BITS is too low! -+#endif -+ -+#define irq_enter() (preempt_count() += HARDIRQ_OFFSET) -+#define irq_exit() \ -+do { \ -+ preempt_count() -= IRQ_EXIT_OFFSET; \ -+ if (!in_interrupt() && softirq_pending(smp_processor_id())) \ -+ do_softirq(); \ -+ preempt_enable_no_resched(); \ -+} while (0) -+ -+#ifdef CONFIG_SMP -+# error nios2nommu SMP is not available -+#endif /* CONFIG_SMP */ -+ -+#endif /* __NIOS2_HARDIRQ_H */ ---- linux/include/asm-nios2nommu/hdreg.h -+++ linux/include/asm-nios2nommu/hdreg.h -@@ -0,0 +1,30 @@ -+/* -+ * Copyright (C) 1994-1996 Linus Torvalds & authors -+ * Copyright (C) 2002 Wentau Xu (www.microtronix.com) -+ * copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2_HDREG_H -+#define __NIOS2_HDREG_H -+ -+typedef unsigned long ide_ioreg_t; -+ -+#endif /* __NIOS2_HDREG_H */ ---- linux/include/asm-nios2nommu/hw_irq.h -+++ linux/include/asm-nios2nommu/hw_irq.h -@@ -0,0 +1,16 @@ -+#ifndef _ASM_HW_IRQ_H -+#define _ASM_HW_IRQ_H -+ -+/* -+ * linux/include/asm/hw_irq.h -+ * -+ * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar -+ * -+ * moved some of the old arch/i386/kernel/irq.h to here. VY -+ * -+ * IRQ/IPI changes taken from work by Thomas Radke -+ * -+ */ -+ -+ -+#endif /* _ASM_HW_IRQ_H */ ---- linux/include/asm-nios2nommu/ide.h -+++ linux/include/asm-nios2nommu/ide.h -@@ -0,0 +1,47 @@ -+/* -+ * linux/include/asm-niosnommu2/ide.h -+ * -+ * Copyright (C) 1994-1996 Linus Torvalds & authors -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __ASMNIOS2_IDE_H -+#define __ASMNIOS2_IDE_H -+ -+#ifdef __KERNEL__ -+#undef MAX_HWIFS /* we're going to force it */ -+ -+#ifndef MAX_HWIFS -+#define MAX_HWIFS 1 -+#endif -+ -+#define IDE_ARCH_OBSOLETE_INIT -+#define IDE_ARCH_OBSOLETE_DEFAULTS -+#define ide_default_io_base(i) ((unsigned long)na_ide_ide) -+#define ide_default_irq(b) (na_ide_ide_irq) -+#define ide_init_default_irq(base) ide_default_irq(base) -+#define ide_default_io_ctl(base) ((base) + (0xE*4)) -+ -+#include -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* __ASMNIOS2_IDE_H */ ---- linux/include/asm-nios2nommu/init.h -+++ linux/include/asm-nios2nommu/init.h -@@ -0,0 +1,22 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#error " should never be used - use instead" ---- linux/include/asm-nios2nommu/io.h -+++ linux/include/asm-nios2nommu/io.h -@@ -0,0 +1,239 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2_IO_H -+#define __NIOS2_IO_H -+ -+#ifdef __KERNEL__ -+ -+#include -+ -+#include /* IO address mapping routines need this */ -+#include -+#include -+ -+extern void insw(unsigned long port, void *dst, unsigned long count); -+extern void outsw(unsigned long port, void *src, unsigned long count); -+extern void insl(unsigned long port, void *dst, unsigned long count); -+extern void outsl(unsigned long port, void *src, unsigned long count); -+ -+ -+/* -+ * readX/writeX() are used to access memory mapped devices. On some -+ * architectures the memory mapped IO stuff needs to be accessed -+ * differently. On the Nios architecture, we just read/write the -+ * memory location directly. -+ */ -+ -+#define readb(addr) \ -+({ \ -+ unsigned char __res;\ -+ __asm__ __volatile__( \ -+ "ldbuio %0, 0(%1)" \ -+ : "=r"(__res) \ -+ : "r" (addr)); \ -+ __res; \ -+}) -+ -+#define readw(addr) \ -+({ \ -+ unsigned short __res;\ -+ __asm__ __volatile__( \ -+ "ldhuio %0, 0(%1)" \ -+ : "=r"(__res) \ -+ : "r" (addr)); \ -+ __res; \ -+}) -+ -+#define readl(addr) \ -+({ \ -+ unsigned int __res;\ -+ __asm__ __volatile__( \ -+ "ldwio %0, 0(%1)" \ -+ : "=r"(__res) \ -+ : "r" (addr)); \ -+ __res; \ -+}) -+ -+#define writeb(b,addr) \ -+({ \ -+ __asm__ __volatile__( \ -+ "stbio %0, 0(%1)" \ -+ : : "r"(b), "r" (addr)); \ -+}) -+ -+#define writew(b,addr) \ -+({ \ -+ __asm__ __volatile__( \ -+ "sthio %0, 0(%1)" \ -+ : : "r"(b), "r" (addr)); \ -+}) -+ -+#define writel(b,addr) \ -+({ \ -+ __asm__ __volatile__( \ -+ "stwio %0, 0(%1)" \ -+ : : "r"(b), "r" (addr)); \ -+}) -+ -+#define __raw_readb readb -+#define __raw_readw readw -+#define __raw_readl readl -+#define __raw_writeb writeb -+#define __raw_writew writew -+#define __raw_writel writel -+ -+ -+/* -+ * make the short names macros so specific devices -+ * can override them as required -+ */ -+ -+#define memset_io(addr,c,len) memset((void *)(((unsigned int)(addr)) | 0x80000000),(c),(len)) -+#define memcpy_fromio(to,from,len) memcpy((to),(void *)(((unsigned int)(from)) | 0x80000000),(len)) -+#define memcpy_toio(to,from,len) memcpy((void *)(((unsigned int)(to)) | 0x80000000),(from),(len)) -+ -+#define inb(addr) readb(addr) -+#define inw(addr) readw(addr) -+#define inl(addr) readl(addr) -+ -+#define outb(x,addr) ((void) writeb(x,addr)) -+#define outw(x,addr) ((void) writew(x,addr)) -+#define outl(x,addr) ((void) writel(x,addr)) -+ -+#define inb_p(addr) inb(addr) -+#define inw_p(addr) inw(addr) -+#define inl_p(addr) inl(addr) -+ -+#define outb_p(x,addr) outb(x,addr) -+#define outw_p(x,addr) outw(x,addr) -+#define outl_p(x,addr) outl(x,addr) -+ -+ -+ -+extern inline void insb(unsigned long port, void *dst, unsigned long count) -+{ -+ unsigned char *p=(unsigned char*)dst; -+ while (count--) -+ *p++ = inb(port); -+} -+ -+/* See arch/niosnommu/io.c for optimized version */ -+extern inline void _insw(unsigned long port, void *dst, unsigned long count) -+{ -+ unsigned short *p=(unsigned short*)dst; -+ while (count--) -+ *p++ = inw(port); -+} -+ -+/* See arch/niosnommu/kernel/io.c for unaligned destination pointer */ -+extern inline void _insl(unsigned long port, void *dst, unsigned long count) -+{ -+ unsigned long *p=(unsigned long*)dst; -+ while (count--) -+ *p++ = inl(port); -+} -+ -+extern inline void outsb(unsigned long port, void *src, unsigned long count) -+{ -+ unsigned char *p=(unsigned char*)src; -+ while (count--) -+ outb( *p++, port ); -+} -+ -+/* See arch/niosnommu/io.c for optimized version */ -+extern inline void _outsw(unsigned long port, void *src, unsigned long count) -+{ -+ unsigned short *p=(unsigned short*)src; -+ while (count--) -+ outw( *p++, port ); -+} -+ -+/* See arch/niosnommu/kernel/io.c for unaligned source pointer */ -+extern inline void _outsl(unsigned long port, void *src, unsigned long count) -+{ -+ unsigned long *p=(unsigned long*)src; -+ while (count--) -+ outl( *p++, port ); -+} -+ -+ -+ -+extern inline void mapioaddr(unsigned long physaddr, unsigned long virt_addr, -+ int bus, int rdonly) -+{ -+ return; -+} -+ -+//vic - copied from m68knommu -+ -+/* Values for nocacheflag and cmode */ -+#define IOMAP_FULL_CACHING 0 -+#define IOMAP_NOCACHE_SER 1 -+#define IOMAP_NOCACHE_NONSER 2 -+#define IOMAP_WRITETHROUGH 3 -+ -+extern void *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag); -+extern void __iounmap(void *addr, unsigned long size); -+ -+extern inline void *ioremap(unsigned long physaddr, unsigned long size) -+{ -+ return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); -+} -+extern inline void *ioremap_nocache(unsigned long physaddr, unsigned long size) -+{ -+ return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); -+} -+extern inline void *ioremap_writethrough(unsigned long physaddr, unsigned long size) -+{ -+ return __ioremap(physaddr, size, IOMAP_WRITETHROUGH); -+} -+extern inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size) -+{ -+ return __ioremap(physaddr, size, IOMAP_FULL_CACHING); -+} -+ -+extern void iounmap(void *addr); -+ -+ -+#define IO_SPACE_LIMIT 0xffffffff -+ -+#define dma_cache_inv(_start,_size) do { } while (0) -+#define dma_cache_wback(_start,_size) do { } while (0) -+#define dma_cache_wback_inv(_start,_size) do { } while (0) -+ -+/* Pages to physical address... */ -+#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) -+#define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT) -+ -+#define mm_ptov(vaddr) ((void *) (vaddr)) -+#define mm_vtop(vaddr) ((unsigned long) (vaddr)) -+#define phys_to_virt(vaddr) ((void *) (vaddr)) -+#define virt_to_phys(vaddr) ((unsigned long) (vaddr)) -+ -+#define virt_to_bus virt_to_phys -+#define bus_to_virt phys_to_virt -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* !(__NIOS2_IO_H) */ -+ ---- linux/include/asm-nios2nommu/ioctl.h -+++ linux/include/asm-nios2nommu/ioctl.h -@@ -0,0 +1,100 @@ -+/* $Id: ioctl.h,v 1.3 2004/02/12 23:06:40 ken-h Exp $ -+ * -+ * linux/ioctl.h for Linux by H.H. Bergman. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2_IOCTL_H -+#define _NIOS2_IOCTL_H -+ -+/* ioctl command encoding: 32 bits total, command in lower 16 bits, -+ * size of the parameter structure in the lower 14 bits of the -+ * upper 16 bits. -+ * Encoding the size of the parameter structure in the ioctl request -+ * is useful for catching programs compiled with old versions -+ * and to avoid overwriting user space outside the user buffer area. -+ * The highest 2 bits are reserved for indicating the ``access mode''. -+ * NOTE: This limits the max parameter size to 16kB -1 ! -+ */ -+ -+/* -+ * I don't really have any idea about what this should look like, so -+ * for the time being, this is heavily based on the PC definitions. -+ */ -+ -+/* -+ * The following is for compatibility across the various Linux -+ * platforms. The i386 ioctl numbering scheme doesn't really enforce -+ * a type field. De facto, however, the top 8 bits of the lower 16 -+ * bits are indeed used as a type field, so we might just as well make -+ * this explicit here. Please be sure to use the decoding macros -+ * below from now on. -+ */ -+#define _IOC_NRBITS 8 -+#define _IOC_TYPEBITS 8 -+#define _IOC_SIZEBITS 14 -+#define _IOC_DIRBITS 2 -+ -+#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) -+#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) -+#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) -+#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) -+ -+#define _IOC_NRSHIFT 0 -+#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) -+#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) -+#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) -+ -+/* -+ * Direction bits. -+ */ -+#define _IOC_NONE 0U -+#define _IOC_WRITE 1U -+#define _IOC_READ 2U -+ -+#define _IOC(dir,type,nr,size) \ -+ (((dir) << _IOC_DIRSHIFT) | \ -+ ((type) << _IOC_TYPESHIFT) | \ -+ ((nr) << _IOC_NRSHIFT) | \ -+ ((size) << _IOC_SIZESHIFT)) -+ -+/* used to create numbers */ -+#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) -+#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) -+#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) -+#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) -+ -+/* used to decode ioctl numbers.. */ -+#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) -+#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) -+#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) -+#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) -+ -+/* ...and for the drivers/sound files... */ -+ -+#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) -+#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) -+#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) -+#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) -+#define IOCSIZE_SHIFT (_IOC_SIZESHIFT) -+ -+#endif /* _NIOS2_IOCTL_H */ ---- linux/include/asm-nios2nommu/ioctls.h -+++ linux/include/asm-nios2nommu/ioctls.h -@@ -0,0 +1,103 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __ARCH_NIOS2_IOCTLS_H__ -+#define __ARCH_NIOS2_IOCTLS_H__ -+ -+#include -+ -+/* 0x54 is just a magic number to make these relatively unique ('T') */ -+ -+#define TCGETS 0x5401 -+#define TCSETS 0x5402 -+#define TCSETSW 0x5403 -+#define TCSETSF 0x5404 -+#define TCGETA 0x5405 -+#define TCSETA 0x5406 -+#define TCSETAW 0x5407 -+#define TCSETAF 0x5408 -+#define TCSBRK 0x5409 -+#define TCXONC 0x540A -+#define TCFLSH 0x540B -+#define TIOCEXCL 0x540C -+#define TIOCNXCL 0x540D -+#define TIOCSCTTY 0x540E -+#define TIOCGPGRP 0x540F -+#define TIOCSPGRP 0x5410 -+#define TIOCOUTQ 0x5411 -+#define TIOCSTI 0x5412 -+#define TIOCGWINSZ 0x5413 -+#define TIOCSWINSZ 0x5414 -+#define TIOCMGET 0x5415 -+#define TIOCMBIS 0x5416 -+#define TIOCMBIC 0x5417 -+#define TIOCMSET 0x5418 -+#define TIOCGSOFTCAR 0x5419 -+#define TIOCSSOFTCAR 0x541A -+#define FIONREAD 0x541B -+#define TIOCINQ FIONREAD -+#define TIOCLINUX 0x541C -+#define TIOCCONS 0x541D -+#define TIOCGSERIAL 0x541E -+#define TIOCSSERIAL 0x541F -+#define TIOCPKT 0x5420 -+#define FIONBIO 0x5421 -+#define TIOCNOTTY 0x5422 -+#define TIOCSETD 0x5423 -+#define TIOCGETD 0x5424 -+#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ -+#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */ -+#define TIOCSBRK 0x5427 /* BSD compatibility */ -+#define TIOCCBRK 0x5428 /* BSD compatibility */ -+#define TIOCGSID 0x5429 /* Return the session ID of FD */ -+#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ -+#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ -+ -+#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ -+#define FIOCLEX 0x5451 -+#define FIOASYNC 0x5452 -+#define TIOCSERCONFIG 0x5453 -+#define TIOCSERGWILD 0x5454 -+#define TIOCSERSWILD 0x5455 -+#define TIOCGLCKTRMIOS 0x5456 -+#define TIOCSLCKTRMIOS 0x5457 -+#define TIOCSERGSTRUCT 0x5458 /* For debugging only */ -+#define TIOCSERGETLSR 0x5459 /* Get line status register */ -+#define TIOCSERGETMULTI 0x545A /* Get multiport config */ -+#define TIOCSERSETMULTI 0x545B /* Set multiport config */ -+ -+#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ -+#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ -+#define FIOQSIZE 0x545E -+ -+/* Used for packet mode */ -+#define TIOCPKT_DATA 0 -+#define TIOCPKT_FLUSHREAD 1 -+#define TIOCPKT_FLUSHWRITE 2 -+#define TIOCPKT_STOP 4 -+#define TIOCPKT_START 8 -+#define TIOCPKT_NOSTOP 16 -+#define TIOCPKT_DOSTOP 32 -+ -+#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ -+ -+#endif /* __ARCH_NIOS2_IOCTLS_H__ */ ---- linux/include/asm-nios2nommu/ipc.h -+++ linux/include/asm-nios2nommu/ipc.h -@@ -0,0 +1,51 @@ -+#ifndef __NIOS2_IPC_H__ -+#define __NIOS2_IPC_H__ -+ -+/* Copied from sparc version -+ * These are used to wrap system calls on the Nios. -+ * -+ * See arch/niosnommu/kernel/sys_nios.c for ugly details.. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+struct ipc_kludge { -+ struct msgbuf *msgp; -+ long msgtyp; -+}; -+ -+#define SEMOP 1 -+#define SEMGET 2 -+#define SEMCTL 3 -+#define MSGSND 11 -+#define MSGRCV 12 -+#define MSGGET 13 -+#define MSGCTL 14 -+#define SHMAT 21 -+#define SHMDT 22 -+#define SHMGET 23 -+#define SHMCTL 24 -+ -+/* Used by the DIPC package, try and avoid reusing it */ -+#define DIPC 25 -+ -+#define IPCCALL(version,op) ((version)<<16 | (op)) -+ -+#endif ---- linux/include/asm-nios2nommu/ipcbuf.h -+++ linux/include/asm-nios2nommu/ipcbuf.h -@@ -0,0 +1,49 @@ -+#ifndef __NIOS2_IPCBUF_H__ -+#define __NIOS2_IPCBUF_H__ -+ -+/* Copied from asm-m68k/ipcbuf.h -+ * The user_ipc_perm structure for Nios architecture. -+ * Note extra padding because this structure is passed back and forth -+ * between kernel and user space. -+ * -+ * Pad space is left for: -+ * - 32-bit mode_t and seq -+ * - 2 miscellaneous 32-bit values -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+struct ipc64_perm -+{ -+ __kernel_key_t key; -+ __kernel_uid32_t uid; -+ __kernel_gid32_t gid; -+ __kernel_uid32_t cuid; -+ __kernel_gid32_t cgid; -+ __kernel_mode_t mode; -+ unsigned short __pad1; -+ unsigned short seq; -+ unsigned short __pad2; -+ unsigned long __unused1; -+ unsigned long __unused2; -+}; -+ -+#endif /* __NIOS2_IPCBUF_H__ */ ---- linux/include/asm-nios2nommu/irq.h -+++ linux/include/asm-nios2nommu/irq.h -@@ -0,0 +1,182 @@ -+/* -+ * 21Mar2001 1.1 dgt/microtronix -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+ -+#ifndef _NIOS2NOMMU_IRQ_H_ -+#define _NIOS2NOMMU_IRQ_H_ -+ -+extern void disable_irq(unsigned int); -+extern void enable_irq(unsigned int); -+ -+// #include -+#include -+ -+#define SYS_IRQS 32 -+#define NR_IRQS SYS_IRQS -+ -+/* -+ * Interrupt source definitions -+ * General interrupt sources are the level 1-7. -+ * Adding an interrupt service routine for one of these sources -+ * results in the addition of that routine to a chain of routines. -+ * Each one is called in succession. Each individual interrupt -+ * service routine should determine if the device associated with -+ * that routine requires service. -+ */ -+ -+#define IRQ01 (1) /* level 1 interrupt */ -+#define IRQ02 (2) /* level 2 interrupt */ -+#define IRQ03 (3) /* level 3 interrupt */ -+#define IRQ04 (4) /* level 4 interrupt */ -+#define IRQ05 (5) /* level 5 interrupt */ -+#define IRQ06 (6) /* level 6 interrupt */ -+#define IRQ07 (7) /* level 7 interrupt */ -+#define IRQ08 (8) /* level 8 interrupt */ -+#define IRQ09 (9) /* level 9 interrupt */ -+#define IRQ0A (10) /* level 10 interrupt */ -+#define IRQ0B (11) /* level 11 interrupt */ -+#define IRQ0C (12) /* level 12 interrupt */ -+#define IRQ0D (13) /* level 13 interrupt */ -+#define IRQ0E (14) /* level 14 interrupt */ -+#define IRQ0F (15) /* level 15 interrupt */ -+#define IRQ10 (16) /* level 16 interrupt */ -+#define IRQ12 (17) /* level 17 interrupt */ -+#define IRQ13 (18) /* level 18 interrupt */ -+#define IRQ14 (19) /* level 19 interrupt */ -+#define IRQ15 (20) /* level 20 interrupt */ -+#define IRQ16 (21) /* level 21 interrupt */ -+#define IRQ17 (22) /* level 22 interrupt */ -+#define IRQ18 (23) /* level 23 interrupt */ -+#define IRQ19 (24) /* level 24 interrupt */ -+#define IRQ1A (25) /* level 25 interrupt */ -+#define IRQ1B (26) /* level 26 interrupt */ -+#define IRQ1C (27) /* level 27 interrupt */ -+#define IRQ1D (28) /* level 28 interrupt */ -+#define IRQ1E (29) /* level 29 interrupt */ -+#define IRQ1F (30) /* level 30 interrupt */ -+#define IRQ20 (31) /* level 31 interrupt */ -+#define IRQ21 (32) /* level 32 interrupt */ -+ -+#define IRQMAX IRQ21 -+ -+/* -+ * "Generic" interrupt sources -+ */ -+ -+/* -+ * Machine specific interrupt sources. -+ * -+ * Adding an interrupt service routine for a source with this bit -+ * set indicates a special machine specific interrupt source. -+ * The machine specific files define these sources. -+ * -+ * Removed, they are not used by any one. -+ */ -+ -+/* -+ * various flags for request_irq() -+ */ -+#define IRQ_FLG_LOCK (0x0001) /* handler is not replaceable */ -+#define IRQ_FLG_REPLACE (0x0002) /* replace existing handler */ -+#define IRQ_FLG_FAST (0x0004) -+#define IRQ_FLG_SLOW (0x0008) -+#define IRQ_FLG_STD (0x8000) /* internally used */ -+ -+/* -+ * Functions to set and clear the interrupt mask. -+ */ -+ -+/* -+ * Use a zero to clean the bit. -+ */ -+static inline void clrimr(int mask) -+{ -+ int flags; -+ -+ local_irq_save(flags); -+ __asm__ __volatile__( -+ "rdctl r8, ienable\n" -+ "and r8,r8,%0\n" -+ "wrctl ienable, r8\n" -+ : /* No output */ -+ : "r" (mask) -+ : "r8"); -+ local_irq_restore(flags); -+} -+ -+/* -+ * Use a one to set the bit. -+ */ -+static inline void setimr(int mask) -+{ -+ int flags; -+ -+ local_irq_save(flags); -+ __asm__ __volatile__( -+ "rdctl r8, ienable\n" -+ "or r8,r8,%0\n" -+ "wrctl ienable, r8\n" -+ : /* No output */ -+ : "r" (mask) -+ : "r8"); -+ local_irq_restore(flags); -+} -+ -+/* -+ * This structure is used to chain together the ISRs for a particular -+ * interrupt source (if it supports chaining). -+ */ -+typedef struct irq_node { -+ irqreturn_t (*handler)(int, void *, struct pt_regs *); -+ unsigned long flags; -+ void *dev_id; -+ const char *devname; -+ struct irq_node *next; -+} irq_node_t; -+ -+/* -+ * This function returns a new irq_node_t -+ */ -+extern irq_node_t *new_irq_node(void); -+ -+/* -+ * This structure has only 4 elements for speed reasons -+ */ -+typedef struct irq_handler { -+ irqreturn_t (*handler)(int, void *, struct pt_regs *); -+ unsigned long flags; -+ void *dev_id; -+ const char *devname; -+} irq_handler_t; -+ -+/* count of spurious interrupts */ -+extern volatile unsigned int num_spurious; -+ -+#define disable_irq_nosync(i) disable_irq(i) -+ -+#ifndef irq_canonicalize -+#define irq_canonicalize(i) (i) -+#endif -+ -+#endif /* _NIOS2NOMMU_IRQ_H_ */ ---- linux/include/asm-nios2nommu/kmap_types.h -+++ linux/include/asm-nios2nommu/kmap_types.h -@@ -0,0 +1,43 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _ASM_KMAP_TYPES_H -+#define _ASM_KMAP_TYPES_H -+ -+enum km_type { -+ KM_BOUNCE_READ, -+ KM_SKB_SUNRPC_DATA, -+ KM_SKB_DATA_SOFTIRQ, -+ KM_USER0, -+ KM_USER1, -+ KM_BIO_SRC_IRQ, -+ KM_BIO_DST_IRQ, -+ KM_PTE0, -+ KM_PTE1, -+ KM_IRQ0, -+ KM_IRQ1, -+ KM_SOFTIRQ0, -+ KM_SOFTIRQ1, -+ KM_TYPE_NR -+}; -+ -+#endif ---- linux/include/asm-nios2nommu/linkage.h -+++ linux/include/asm-nios2nommu/linkage.h -@@ -0,0 +1,29 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __ASM_LINKAGE_H -+#define __ASM_LINKAGE_H -+ -+#define __ALIGN .align 3 -+#define __ALIGN_STR ".align 3" -+ -+#endif ---- linux/include/asm-nios2nommu/linux_logo.h -+++ linux/include/asm-nios2nommu/linux_logo.h -@@ -0,0 +1,953 @@ -+/* $Id: linux_logo.h,v 1.3 2004/02/12 23:06:40 ken-h Exp $ -+ * include/asm-nios/linux_logo.h: This is a linux logo -+ * to be displayed on boot. -+ * -+ * Copyright (C) 1996 Larry Ewing (lewing@isc.tamu.edu) -+ * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) -+ * Copyright (C) 2004 Micrtronix Datacom Ltd. -+ * -+ * You can put anything here, but: -+ * LINUX_LOGO_COLORS has to be less than 224 -+ * image size has to be 80x80 -+ * values have to start from 0x20 -+ * (i.e. RGB(linux_logo_red[0], -+ * linux_logo_green[0], -+ * linux_logo_blue[0]) is color 0x20) -+ * BW image has to be 80x80 as well, with MS bit -+ * on the left -+ * Serial_console ascii image can be any size, -+ * but should contain %s to display the version -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#include -+#include -+ -+#define linux_logo_banner "Linux/NIOS2 version " UTS_RELEASE -+ -+#define __HAVE_ARCH_LINUX_LOGO -+#define __HAVE_ARCH_LINUX_LOGO16 -+ -+#define LINUX_LOGO_COLORS 221 -+ -+#ifdef INCLUDE_LINUX_LOGO_DATA -+ -+unsigned char linux_logo_red[] __initdata = { -+ 0x00, 0x06, 0x0a, 0x0e, 0x16, 0x1a, 0x1e, 0x22, -+ 0x12, 0x00, 0x2a, 0x36, 0x42, 0x4e, 0x4a, 0x56, -+ 0x26, 0x46, 0x2e, 0x32, 0x52, 0x3a, 0x02, 0x65, -+ 0x5e, 0x3e, 0x74, 0x8a, 0xa2, 0x9a, 0x86, 0xc6, -+ 0xc3, 0x65, 0xbb, 0xd2, 0xda, 0xd6, 0xe2, 0xf6, -+ 0xfd, 0xae, 0x7b, 0xdd, 0xea, 0x6a, 0xaa, 0xe7, -+ 0xbe, 0x5a, 0xee, 0x9e, 0x95, 0x80, 0x76, 0x79, -+ 0x62, 0x36, 0x9a, 0xe2, 0xec, 0xe1, 0xb8, 0xd7, -+ 0xaf, 0x25, 0xbc, 0xc0, 0xef, 0xea, 0xe8, 0xe8, -+ 0xf5, 0xf1, 0xda, 0xd3, 0x79, 0xdb, 0xf4, 0xf6, -+ 0xf6, 0xf6, 0xe2, 0x3d, 0xb4, 0xce, 0xe6, 0xee, -+ 0xf6, 0x68, 0xd8, 0xec, 0xf5, 0xc6, 0xc8, 0x9c, -+ 0x89, 0xd2, 0xee, 0xcb, 0xb9, 0xd2, 0x66, 0x5e, -+ 0x8b, 0xbe, 0xa8, 0xd5, 0xca, 0xb6, 0xae, 0x9c, -+ 0xc5, 0xbe, 0xbe, 0xca, 0x90, 0xb2, 0x9a, 0xa8, -+ 0xb6, 0xf2, 0xce, 0xfa, 0xb2, 0x6e, 0xa6, 0xfe, -+ 0xf6, 0xec, 0xfe, 0xd2, 0xea, 0xf5, 0xf2, 0xf2, -+ 0xe9, 0xee, 0xf6, 0xf2, 0xee, 0xf6, 0xda, 0xd4, -+ 0xfa, 0xca, 0xf2, 0xf6, 0xfe, 0xf2, 0xda, 0xe4, -+ 0xf6, 0xdd, 0xf2, 0xee, 0xfa, 0xf0, 0x12, 0x4a, -+ 0xd6, 0xf2, 0x8e, 0xf2, 0xf6, 0xf6, 0xb5, 0xf1, -+ 0x26, 0x9a, 0xea, 0xf6, 0xe0, 0xd2, 0x16, 0x9a, -+ 0x2e, 0xd2, 0x70, 0xd6, 0x46, 0x7c, 0xb4, 0x62, -+ 0xda, 0xee, 0xd6, 0xa3, 0x74, 0xa7, 0xa2, 0xe0, -+ 0xae, 0xbe, 0xce, 0xe2, 0xa3, 0x8e, 0x6d, 0x8e, -+ 0x32, 0xaf, 0x50, 0x9e, 0x5b, 0x8a, 0x98, 0x82, -+ 0x7a, 0x82, 0x56, 0x7c, 0x8a, 0x56, 0x5e, 0x86, -+ 0x6a, 0x52, 0x59, 0x64, 0x5e, -+}; -+ -+unsigned char linux_logo_green[] __initdata = { -+ 0x00, 0x06, 0x0a, 0x0e, 0x16, 0x1a, 0x1e, 0x22, -+ 0x12, 0x00, 0x2a, 0x36, 0x42, 0x4e, 0x4a, 0x56, -+ 0x26, 0x46, 0x2e, 0x32, 0x52, 0x3a, 0x02, 0x65, -+ 0x5e, 0x3e, 0x74, 0x8a, 0xa2, 0x9a, 0x86, 0xc6, -+ 0xc3, 0x62, 0xbb, 0xd2, 0xda, 0xd6, 0xe2, 0xf6, -+ 0xfd, 0xae, 0x7b, 0xdd, 0xea, 0x6a, 0xaa, 0xe7, -+ 0xbe, 0x5a, 0xee, 0x9e, 0x95, 0x80, 0x62, 0x5c, -+ 0x4e, 0x26, 0x72, 0xaa, 0xba, 0xaf, 0x90, 0xae, -+ 0x92, 0x1a, 0xa4, 0x85, 0xb6, 0xbe, 0xc3, 0xc8, -+ 0xcf, 0xd0, 0xc2, 0xce, 0x57, 0xa2, 0xd6, 0xda, -+ 0xda, 0xd7, 0xb8, 0x2a, 0x7b, 0x91, 0xae, 0xca, -+ 0xda, 0x45, 0x9e, 0xb2, 0xd7, 0x9b, 0x90, 0x76, -+ 0x5c, 0xa2, 0xbe, 0xa6, 0x85, 0x96, 0x4e, 0x46, -+ 0x66, 0x92, 0x7a, 0x9a, 0x96, 0x9d, 0x9a, 0x6b, -+ 0x8a, 0x8e, 0xb2, 0xca, 0x90, 0xa6, 0x79, 0x7c, -+ 0xb6, 0xf2, 0xce, 0xfa, 0xb2, 0x6e, 0xa6, 0xfa, -+ 0xea, 0xd7, 0xf6, 0xbc, 0xda, 0xde, 0xda, 0xe6, -+ 0xca, 0xd8, 0xea, 0xe0, 0xcc, 0xf2, 0xce, 0xb2, -+ 0xee, 0xa2, 0xd6, 0xe6, 0xf6, 0xd7, 0xc5, 0xb8, -+ 0xc6, 0xb9, 0xce, 0xde, 0xce, 0xc6, 0x0e, 0x36, -+ 0xae, 0xbe, 0x86, 0xba, 0xbe, 0xe6, 0x8e, 0xc4, -+ 0x1e, 0x8e, 0xae, 0xba, 0xb2, 0xa6, 0x12, 0x7a, -+ 0x20, 0xc6, 0x64, 0xaa, 0x2f, 0x70, 0x85, 0x46, -+ 0xce, 0xd6, 0xa6, 0x6e, 0x51, 0x72, 0x92, 0xa6, -+ 0x87, 0x96, 0xa2, 0xd6, 0x85, 0x7a, 0x6a, 0x6e, -+ 0x22, 0x76, 0x36, 0x76, 0x3c, 0x6e, 0x63, 0x53, -+ 0x66, 0x62, 0x42, 0x50, 0x56, 0x42, 0x56, 0x56, -+ 0x56, 0x3e, 0x51, 0x52, 0x56, -+}; -+ -+unsigned char linux_logo_blue[] __initdata = { -+ 0x00, 0x06, 0x0a, 0x0e, 0x16, 0x1a, 0x1e, 0x22, -+ 0x12, 0x01, 0x2a, 0x36, 0x42, 0x4e, 0x4a, 0x56, -+ 0x26, 0x46, 0x2e, 0x32, 0x52, 0x3a, 0x06, 0x65, -+ 0x5e, 0x3e, 0x74, 0x8a, 0xa2, 0x9a, 0x86, 0xc6, -+ 0xc3, 0x59, 0xbb, 0xd2, 0xda, 0xd6, 0xe2, 0xf6, -+ 0xfd, 0xae, 0x7b, 0xdd, 0xea, 0x6a, 0xaa, 0xe7, -+ 0xbe, 0x5a, 0xee, 0x9e, 0x95, 0x80, 0x2e, 0x08, -+ 0x0a, 0x06, 0x0a, 0x0b, 0x0b, 0x0f, 0x0c, 0x0f, -+ 0x3d, 0x09, 0x73, 0x09, 0x0d, 0x0a, 0x10, 0x1e, -+ 0x2d, 0x13, 0x86, 0xba, 0x19, 0x0a, 0x36, 0x3c, -+ 0x26, 0x14, 0x0d, 0x06, 0x07, 0x0a, 0x0b, 0x0f, -+ 0x4a, 0x06, 0x0a, 0x0c, 0x2b, 0x0a, 0x0b, 0x0a, -+ 0x06, 0x0a, 0x0a, 0x11, 0x0b, 0x0a, 0x0a, 0x1e, -+ 0x0f, 0x0d, 0x0a, 0x0b, 0x22, 0x6a, 0x72, 0x0b, -+ 0x0b, 0x22, 0x90, 0xca, 0x90, 0x92, 0x3c, 0x2c, -+ 0xb6, 0xf2, 0xce, 0xfa, 0xb2, 0x6e, 0xa6, 0xea, -+ 0xb6, 0x7c, 0xda, 0x8e, 0xa6, 0x87, 0x66, 0xb6, -+ 0x81, 0x6a, 0xc6, 0x9a, 0x5b, 0xd2, 0xb6, 0x6a, -+ 0xca, 0x45, 0x92, 0xb2, 0xca, 0x52, 0x8a, 0x3e, -+ 0x2e, 0x66, 0x66, 0xae, 0x3e, 0x47, 0x06, 0x0e, -+ 0x52, 0x36, 0x6a, 0x0e, 0x0e, 0xbe, 0x2c, 0x0e, -+ 0x0a, 0x5a, 0x0d, 0x0e, 0x3e, 0x0a, 0x06, 0x2e, -+ 0x06, 0x9e, 0x4e, 0x36, 0x06, 0x58, 0x24, 0x06, -+ 0x9e, 0xae, 0x3a, 0x08, 0x08, 0x07, 0x5e, 0x0a, -+ 0x32, 0x2e, 0x2a, 0xb2, 0x43, 0x48, 0x5f, 0x2e, -+ 0x06, 0x06, 0x07, 0x24, 0x06, 0x32, 0x06, 0x06, -+ 0x46, 0x2e, 0x22, 0x06, 0x06, 0x1e, 0x4c, 0x06, -+ 0x3a, 0x22, 0x42, 0x34, 0x42, -+}; -+ -+unsigned char linux_logo[] __initdata = { -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x21, 0x21, 0x22, 0x22, -+ 0x22, 0x21, 0x21, 0x21, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, -+ 0x26, 0x26, 0x25, 0x28, 0x23, 0x22, 0x21, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x21, 0x23, 0x25, 0x2a, 0x2b, 0x2c, 0x2d, 0x2d, -+ 0x2d, 0x2e, 0x2c, 0x2b, 0x2a, 0x25, 0x28, 0x22, -+ 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x24, 0x2a, 0x2c, 0x2f, 0x2c, 0x30, 0x30, 0x24, -+ 0x25, 0x27, 0x2b, 0x2c, 0x2f, 0x31, 0x32, 0x25, -+ 0x23, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x25, -+ 0x33, 0x34, 0x35, 0x21, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x21, 0x2b, 0x2f, 0x2c, -+ 0x30, 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x24, 0x33, -+ 0x2d, 0x27, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x21, 0x31, -+ 0x2d, 0x32, 0x24, 0x21, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x21, 0x28, 0x2a, 0x34, -+ 0x25, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x23, 0x32, 0x27, 0x21, 0x36, -+ 0x2a, 0x2d, 0x2a, 0x28, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x20, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x22, 0x26, 0x2c, 0x35, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x25, 0x2f, 0x37, 0x32, 0x22, -+ 0x36, 0x35, 0x31, 0x27, 0x22, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x23, 0x2a, 0x2f, 0x22, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x26, 0x38, 0x38, 0x35, 0x25, -+ 0x36, 0x21, 0x2d, 0x2b, 0x24, 0x21, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x21, 0x24, 0x39, 0x39, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x25, 0x2b, 0x30, 0x28, 0x22, -+ 0x36, 0x36, 0x27, 0x34, 0x30, 0x23, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x21, 0x26, 0x2d, 0x26, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x22, 0x22, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x2d, 0x33, 0x28, 0x21, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x30, 0x2f, 0x23, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x2b, 0x2c, 0x25, 0x21, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x2a, 0x34, 0x36, 0x36, -+ 0x36, 0x21, 0x22, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x21, 0x23, 0x22, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x28, 0x34, 0x27, 0x22, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x32, 0x2f, 0x36, 0x36, -+ 0x21, 0x21, 0x24, 0x27, 0x21, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x28, 0x27, 0x22, 0x33, 0x24, 0x36, -+ 0x36, 0x36, 0x36, 0x22, 0x2f, 0x2a, 0x23, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x29, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x32, 0x2f, 0x36, 0x36, -+ 0x30, 0x3a, 0x38, 0x24, 0x24, 0x36, 0x36, 0x36, -+ 0x23, 0x2f, 0x3b, 0x3c, 0x3d, 0x30, 0x25, 0x21, -+ 0x36, 0x36, 0x36, 0x36, 0x2f, 0x32, 0x23, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x32, 0x2f, 0x36, 0x23, -+ 0x3e, 0x3f, 0x40, 0x3a, 0x22, 0x36, 0x36, 0x21, -+ 0x41, 0x42, 0x43, 0x44, 0x45, 0x3e, 0x23, 0x21, -+ 0x36, 0x36, 0x36, 0x36, 0x2f, 0x33, 0x28, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x29, 0x20, 0x29, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x32, 0x2f, 0x36, 0x2b, -+ 0x44, 0x40, 0x46, 0x47, 0x35, 0x36, 0x36, 0x26, -+ 0x43, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x2e, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x31, 0x35, 0x24, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x32, 0x34, 0x36, 0x4d, -+ 0x4e, 0x25, 0x2f, 0x46, 0x4a, 0x22, 0x23, 0x32, -+ 0x4f, 0x50, 0x21, 0x31, 0x51, 0x52, 0x53, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x31, 0x35, 0x24, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x29, 0x20, 0x29, 0x29, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x2a, 0x2f, 0x21, 0x3a, -+ 0x4d, 0x21, 0x31, 0x54, 0x55, 0x28, 0x30, 0x2b, -+ 0x4b, 0x4d, 0x36, 0x23, 0x32, 0x50, 0x3f, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x2e, 0x39, 0x24, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x29, 0x20, 0x29, 0x20, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x2a, 0x38, 0x23, 0x37, -+ 0x55, 0x36, 0x28, 0x3a, 0x56, 0x57, 0x57, 0x58, -+ 0x3c, 0x4d, 0x36, 0x36, 0x36, 0x40, 0x40, 0x21, -+ 0x36, 0x36, 0x36, 0x36, 0x2e, 0x39, 0x24, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x29, 0x29, 0x29, 0x20, 0x29, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x30, 0x51, 0x23, 0x35, -+ 0x43, 0x25, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, -+ 0x5f, 0x60, 0x61, 0x36, 0x31, 0x47, 0x3b, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x31, 0x2c, 0x25, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x30, 0x2f, 0x23, 0x22, -+ 0x40, 0x62, 0x63, 0x5d, 0x64, 0x65, 0x66, 0x67, -+ 0x68, 0x69, 0x66, 0x5e, 0x6a, 0x6b, 0x2a, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x33, 0x2e, 0x26, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x27, 0x2f, 0x23, 0x36, -+ 0x6c, 0x63, 0x6d, 0x64, 0x5c, 0x66, 0x69, 0x6e, -+ 0x6f, 0x70, 0x71, 0x69, 0x69, 0x72, 0x6c, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x33, 0x34, 0x27, 0x22, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x27, 0x34, 0x26, 0x73, -+ 0x74, 0x75, 0x76, 0x64, 0x65, 0x77, 0x69, 0x78, -+ 0x70, 0x71, 0x71, 0x71, 0x72, 0x5f, 0x5e, 0x21, -+ 0x36, 0x36, 0x36, 0x36, 0x25, 0x38, 0x2a, 0x23, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x26, 0x2d, 0x33, 0x79, -+ 0x63, 0x7a, 0x7b, 0x5c, 0x66, 0x69, 0x6e, 0x7c, -+ 0x71, 0x71, 0x69, 0x7d, 0x7e, 0x7a, 0x7f, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x21, 0x51, 0x2b, 0x28, -+ 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x26, 0x2d, 0x32, 0x24, -+ 0x80, 0x81, 0x64, 0x82, 0x77, 0x69, 0x71, 0x71, -+ 0x69, 0x83, 0x84, 0x85, 0x7a, 0x85, 0x86, 0x36, -+ 0x21, 0x2b, 0x23, 0x36, 0x36, 0x39, 0x2e, 0x26, -+ 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x27, 0x2d, 0x33, 0x21, -+ 0x87, 0x88, 0x89, 0x72, 0x67, 0x66, 0x5f, 0x89, -+ 0x8a, 0x63, 0x85, 0x8b, 0x8c, 0x8d, 0x41, 0x36, -+ 0x36, 0x2d, 0x3a, 0x35, 0x36, 0x24, 0x51, 0x32, -+ 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x30, 0x2f, 0x33, 0x21, -+ 0x55, 0x8e, 0x8f, 0x8a, 0x7d, 0x5e, 0x90, 0x7e, -+ 0x75, 0x75, 0x90, 0x62, 0x40, 0x3f, 0x49, 0x23, -+ 0x36, 0x24, 0x3a, 0x3a, 0x24, 0x36, 0x2e, 0x31, -+ 0x26, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x21, 0x28, 0x33, 0x37, 0x25, 0x22, -+ 0x3b, 0x50, 0x8e, 0x8f, 0x90, 0x7e, 0x90, 0x63, -+ 0x74, 0x91, 0x92, 0x42, 0x93, 0x4b, 0x45, 0x2c, -+ 0x36, 0x36, 0x33, 0x39, 0x21, 0x36, 0x22, 0x51, -+ 0x33, 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x22, 0x27, 0x2e, 0x2e, 0x36, 0x21, -+ 0x94, 0x3f, 0x50, 0x95, 0x96, 0x8f, 0x8f, 0x97, -+ 0x8e, 0x42, 0x50, 0x43, 0x47, 0x48, 0x48, 0x98, -+ 0x21, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x39, -+ 0x2e, 0x27, 0x23, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x22, 0x24, 0x2b, 0x38, 0x28, 0x36, 0x32, -+ 0x4c, 0x4b, 0x50, 0x50, 0x50, 0x42, 0x42, 0x50, -+ 0x50, 0x40, 0x45, 0x99, 0x48, 0x48, 0x48, 0x48, -+ 0x34, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x23, -+ 0x2f, 0x2b, 0x24, 0x21, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x21, 0x28, 0x32, 0x51, 0x32, 0x28, 0x21, 0x98, -+ 0x48, 0x47, 0x9a, 0x50, 0x50, 0x50, 0x50, 0x50, -+ 0x9a, 0x4f, 0x9b, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x93, 0x23, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x2a, 0x2f, 0x2a, 0x28, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x23, 0x30, 0x2e, 0x2c, 0x36, 0x21, 0x51, 0x9b, -+ 0x48, 0x48, 0x52, 0x3f, 0x50, 0x50, 0x40, 0x4b, -+ 0x47, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x34, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x2d, 0x31, 0x27, 0x23, 0x21, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x23, -+ 0x27, 0x2c, 0x2d, 0x21, 0x36, 0x28, 0x44, 0x48, -+ 0x48, 0x48, 0x48, 0x47, 0x46, 0x4f, 0x47, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x9c, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x28, 0x51, 0x39, 0x26, 0x22, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x25, -+ 0x35, 0x51, 0x28, 0x36, 0x36, 0x9d, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x9b, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x4f, 0x28, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x28, 0x38, 0x2b, 0x25, 0x22, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x24, 0x33, -+ 0x51, 0x25, 0x36, 0x36, 0x23, 0x40, 0x9b, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x9b, 0x99, 0x2b, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x30, 0x2f, 0x33, 0x24, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x21, 0x23, 0x30, 0x34, -+ 0x27, 0x36, 0x36, 0x36, 0x2a, 0x40, 0x47, 0x48, -+ 0x48, 0x48, 0x48, 0x9b, 0x99, 0x99, 0x9b, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x9b, 0x47, 0x52, -+ 0x46, 0x4f, 0x37, 0x21, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x30, 0x34, 0x2a, 0x23, -+ 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x22, 0x25, 0x39, 0x2c, -+ 0x36, 0x36, 0x36, 0x21, 0x31, 0x4e, 0x9a, 0x4c, -+ 0x47, 0x9b, 0x9b, 0x52, 0x46, 0x4f, 0x52, 0x9b, -+ 0x9b, 0x9b, 0x47, 0x4f, 0x45, 0x9a, 0x93, 0x93, -+ 0x3f, 0x93, 0x98, 0x28, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x39, 0x2c, 0x26, -+ 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x23, 0x2a, 0x34, 0x28, -+ 0x36, 0x36, 0x36, 0x22, 0x38, 0x98, 0x44, 0x99, -+ 0x9b, 0x48, 0x48, 0x9b, 0x4c, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x47, 0x52, 0x46, 0x43, 0x93, -+ 0x40, 0x40, 0x43, 0x53, 0x21, 0x23, 0x33, 0x23, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x21, 0x2f, 0x32, -+ 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x21, 0x24, 0x2b, 0x31, 0x36, -+ 0x36, 0x22, 0x36, 0x24, 0x9e, 0x4f, 0x9b, 0x48, -+ 0x48, 0x48, 0x48, 0x9b, 0x99, 0x9f, 0x52, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x47, -+ 0x4f, 0x9a, 0x3f, 0x46, 0x38, 0x36, 0x21, 0x30, -+ 0x26, 0x36, 0x36, 0x36, 0x36, 0x36, 0x39, 0x2c, -+ 0x25, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x22, 0x26, 0x2e, 0x33, 0x36, -+ 0x25, 0x25, 0x36, 0x4d, 0x52, 0x48, 0x48, 0x48, -+ 0x47, 0x9f, 0x48, 0x48, 0x48, 0xa0, 0xa1, 0xa2, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x47, 0x44, 0x93, 0x43, 0x23, 0x36, 0x36, -+ 0x26, 0x24, 0x36, 0x36, 0x36, 0x36, 0x28, 0x2f, -+ 0x2a, 0x23, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x23, 0x2a, 0x51, 0x24, 0x36, -+ 0x2a, 0x36, 0x28, 0x44, 0x48, 0x48, 0x48, 0x48, -+ 0xa3, 0xa4, 0x48, 0x48, 0x9f, 0xa5, 0xa6, 0x9f, -+ 0x48, 0x48, 0x48, 0xa2, 0xa7, 0x47, 0x48, 0x48, -+ 0x48, 0x48, 0x9b, 0x4b, 0x44, 0x37, 0x36, 0x23, -+ 0x28, 0x30, 0x22, 0x36, 0x36, 0x36, 0x36, 0x2d, -+ 0x35, 0x24, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x21, 0x28, 0x2b, 0x34, 0x36, 0x25, -+ 0x24, 0x36, 0x4a, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0xa8, 0xa1, 0x48, 0x48, 0x9f, 0xa9, 0xa6, 0x9f, -+ 0x48, 0x48, 0xaa, 0xa1, 0xa5, 0x9f, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x9b, 0x52, 0x3f, 0x21, 0x30, -+ 0x35, 0x25, 0x30, 0x36, 0x36, 0x36, 0x36, 0x32, -+ 0x2d, 0x26, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x22, 0x26, 0x2e, 0x35, 0x36, 0x2a, -+ 0x36, 0x24, 0x4f, 0x48, 0x52, 0x52, 0x48, 0x48, -+ 0xab, 0xac, 0xa0, 0x48, 0xad, 0xa6, 0xa6, 0x9f, -+ 0x48, 0xa2, 0xa9, 0xa6, 0xa2, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x47, 0x32, 0x30, -+ 0x2a, 0x23, 0x30, 0x23, 0x36, 0x36, 0x36, 0x21, -+ 0x2f, 0x32, 0x23, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x21, 0x23, 0x2a, 0x51, 0x28, 0x28, 0x25, -+ 0x36, 0x3a, 0x48, 0x48, 0xae, 0xaf, 0x48, 0x48, -+ 0xad, 0xac, 0xa1, 0x9f, 0xa2, 0xa9, 0xa9, 0xa2, -+ 0x48, 0xab, 0x78, 0xa7, 0x48, 0x48, 0x48, 0x48, -+ 0x9f, 0x48, 0x48, 0x48, 0x48, 0x48, 0x38, 0x21, -+ 0x36, 0x36, 0x22, 0x27, 0x36, 0x36, 0x36, 0x36, -+ 0x2e, 0x35, 0x24, 0x21, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x22, 0x25, 0x2c, 0x34, 0x36, 0x30, 0x21, -+ 0x23, 0x43, 0x48, 0x48, 0xb0, 0xb1, 0xb2, 0x9f, -+ 0x48, 0xb3, 0xa5, 0xb3, 0xab, 0xa9, 0xa9, 0xb3, -+ 0xb4, 0xa9, 0xb5, 0xb0, 0x48, 0x48, 0xa0, 0xa5, -+ 0xa1, 0xad, 0x48, 0x48, 0x48, 0x48, 0x94, 0x36, -+ 0x36, 0x36, 0x36, 0x32, 0x36, 0x36, 0x36, 0x36, -+ 0x2a, 0x2e, 0x26, 0x22, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x21, 0x23, 0x2a, 0x51, 0x25, 0x21, 0x2a, 0x36, -+ 0x2e, 0x9b, 0x48, 0x48, 0x48, 0xb6, 0xb7, 0xa4, -+ 0xa2, 0xa7, 0xb5, 0x78, 0x6f, 0x6f, 0x6e, 0x6f, -+ 0xa9, 0xb5, 0xab, 0x48, 0x9f, 0xab, 0xa9, 0xa1, -+ 0xaa, 0x48, 0x48, 0x48, 0x48, 0x48, 0x98, 0x36, -+ 0x36, 0x36, 0x36, 0x32, 0x36, 0x36, 0x36, 0x36, -+ 0x22, 0x2f, 0x30, 0x22, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x22, 0x25, 0x2c, 0x34, 0x36, 0x24, 0x28, 0x36, -+ 0x54, 0x48, 0x48, 0x48, 0x48, 0xa2, 0xa8, 0xa1, -+ 0xa5, 0xa6, 0x6e, 0x6e, 0x6f, 0x6f, 0x6f, 0x6f, -+ 0x6f, 0x78, 0xa5, 0xa0, 0xa0, 0x78, 0xa6, 0xa2, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x9a, 0x36, -+ 0x36, 0x36, 0x36, 0x30, 0x36, 0x36, 0x36, 0x36, -+ 0x21, 0x2f, 0x32, 0x23, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x28, 0x32, 0x2f, 0x28, 0x36, 0x27, 0x22, 0x21, -+ 0x43, 0x48, 0x4b, 0xa2, 0x9f, 0x48, 0xa2, 0xa1, -+ 0xb8, 0x6e, 0x6e, 0xb5, 0x78, 0x6f, 0x78, 0x78, -+ 0x6e, 0x6f, 0x78, 0xb5, 0xa6, 0xa1, 0xa0, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x4b, 0x21, -+ 0x36, 0x36, 0x21, 0x26, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x34, 0x2b, 0x28, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x25, 0x2c, 0x39, 0x36, 0x36, 0x30, 0x22, 0x25, -+ 0x52, 0x48, 0xa3, 0xb1, 0xb6, 0xb3, 0xaa, 0xac, -+ 0x68, 0x68, 0x6e, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, -+ 0x78, 0x6f, 0x6f, 0xb5, 0xa6, 0xb4, 0x48, 0x9f, -+ 0xb4, 0xb4, 0xa2, 0x9f, 0x48, 0x48, 0x4f, 0x21, -+ 0x36, 0x36, 0x22, 0x26, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x2c, 0x35, 0x24, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x30, 0x2d, 0x21, 0x36, 0x36, 0x32, 0x23, 0x2a, -+ 0x47, 0x48, 0xa2, 0xb6, 0xaf, 0xb9, 0xba, 0x68, -+ 0x6e, 0x6e, 0x6f, 0x6f, 0x6f, 0x6f, 0x6f, 0x78, -+ 0x6f, 0x6f, 0xa6, 0x6f, 0xb5, 0xa0, 0xaa, 0xa6, -+ 0xa6, 0xa9, 0xb2, 0xb3, 0x48, 0x48, 0x4c, 0x22, -+ 0x36, 0x36, 0x24, 0x23, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x2c, 0x39, 0x24, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x28, -+ 0x33, 0x2e, 0x36, 0x36, 0x23, 0x31, 0x27, 0x39, -+ 0x9b, 0x48, 0x48, 0x48, 0xb0, 0xb0, 0xba, 0xb8, -+ 0x68, 0x68, 0x69, 0x78, 0x6f, 0xb5, 0x6f, 0xb5, -+ 0x78, 0x78, 0x78, 0x78, 0x78, 0xa5, 0xbb, 0xa9, -+ 0xa5, 0x48, 0x48, 0x48, 0x48, 0x48, 0x4c, 0x23, -+ 0x36, 0x36, 0x26, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x2c, 0x39, 0x24, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x28, -+ 0x2b, 0x39, 0x36, 0x36, 0x36, 0x26, 0x32, 0x31, -+ 0x9b, 0x48, 0x48, 0x48, 0x48, 0x9f, 0xac, 0x68, -+ 0xbc, 0x6e, 0x6e, 0x6e, 0xb5, 0x6f, 0x6e, 0x6f, -+ 0x6f, 0x78, 0x78, 0xb5, 0xb5, 0xa5, 0x9f, 0x9f, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x46, 0x22, -+ 0x36, 0x21, 0x26, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x2c, 0x35, 0x24, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x24, -+ 0x35, 0x39, 0x36, 0x36, 0x36, 0x36, 0x26, 0x2d, -+ 0x9b, 0x48, 0x48, 0xb0, 0xaa, 0xb3, 0xbd, 0xb8, -+ 0xb8, 0x68, 0x6e, 0x6e, 0xb5, 0x6f, 0x78, 0x6e, -+ 0x78, 0x6f, 0x78, 0x78, 0xb5, 0xa9, 0xa2, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x9a, 0x36, -+ 0x24, 0x27, 0xbe, 0x24, 0x25, 0x28, 0x21, 0x36, -+ 0x36, 0x34, 0x2b, 0x28, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x25, -+ 0x39, 0x4d, 0xbf, 0x84, 0x81, 0x57, 0x21, 0x39, -+ 0x52, 0x48, 0x48, 0x62, 0xb1, 0xc0, 0xc1, 0xc1, -+ 0xb8, 0xb8, 0x68, 0xbc, 0x6e, 0x6e, 0x6e, 0x78, -+ 0x78, 0x78, 0x78, 0x6e, 0x78, 0xa9, 0xa0, 0xab, -+ 0xb3, 0xa2, 0x48, 0x48, 0x48, 0x48, 0x53, 0x28, -+ 0x23, 0x36, 0x36, 0x36, 0x21, 0x28, 0x2c, 0x30, -+ 0x21, 0x38, 0x33, 0x28, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x21, 0x22, 0x22, 0x28, 0x30, -+ 0x2d, 0xc2, 0x7a, 0xc3, 0xc4, 0xc4, 0x7f, 0x22, -+ 0x51, 0x52, 0x48, 0x48, 0xb0, 0xaa, 0xa8, 0xbd, -+ 0x68, 0xb8, 0xb8, 0x68, 0x68, 0x6e, 0x6e, 0x6f, -+ 0x6e, 0x6e, 0xb5, 0x6e, 0x78, 0xab, 0xab, 0xb5, -+ 0x78, 0xa6, 0xb3, 0xc5, 0xac, 0xac, 0xc6, 0x61, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x30, 0x32, -+ 0x25, 0x4d, 0x2b, 0x28, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x21, 0x23, 0x24, 0x26, 0x30, 0x33, 0x31, -+ 0x4d, 0x91, 0x5b, 0xc3, 0xc4, 0xc4, 0xc4, 0x5a, -+ 0x21, 0x2e, 0x46, 0x48, 0x48, 0x48, 0xb0, 0x64, -+ 0xc1, 0xb8, 0xb8, 0xb8, 0x68, 0x71, 0x6e, 0x6e, -+ 0x6f, 0x71, 0x6f, 0x6f, 0xa6, 0xa0, 0x9f, 0xb4, -+ 0xb4, 0xa0, 0xa1, 0xb7, 0xc7, 0x69, 0x66, 0xc8, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x21, 0x26, 0x25, -+ 0x83, 0xc9, 0x2c, 0x25, 0x21, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x21, 0x28, 0x30, 0x35, 0x2d, 0x2f, 0x37, 0x4a, -+ 0x60, 0x85, 0xca, 0xcb, 0xc4, 0xc4, 0xc4, 0x82, -+ 0x86, 0x36, 0x32, 0x3f, 0xa2, 0xa4, 0xa8, 0xa9, -+ 0xb8, 0xb8, 0xb8, 0xb8, 0x68, 0x6e, 0x6e, 0x6e, -+ 0x6e, 0x71, 0x6f, 0x71, 0xa6, 0xb4, 0x9f, 0x9f, -+ 0x48, 0x48, 0x48, 0xcc, 0xc3, 0xc7, 0xcd, 0xce, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x21, 0x57, -+ 0x77, 0x66, 0x34, 0x27, 0x22, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x23, 0x30, 0x31, 0xcf, 0x91, 0x7e, 0x90, 0x90, -+ 0x8b, 0x5b, 0xc3, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0x5d, 0xd0, 0x36, 0x24, 0xd1, 0xb1, 0xaf, 0xaa, -+ 0xba, 0xb8, 0x68, 0x68, 0x68, 0x71, 0x6e, 0x6e, -+ 0x6e, 0x6f, 0x6e, 0x78, 0xa1, 0xa9, 0xa1, 0xb0, -+ 0x9f, 0x9b, 0x99, 0xcc, 0x64, 0x5c, 0x8b, 0xd0, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x73, 0x5d, -+ 0x82, 0x5c, 0xd2, 0x2a, 0x23, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x24, 0x2b, 0xcf, 0x8b, 0x5b, 0x76, 0x5b, 0x5b, -+ 0x7b, 0xc3, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc7, 0x5e, 0x22, 0x36, 0x21, 0x3a, 0x99, 0x48, -+ 0xa2, 0xa8, 0xb7, 0xc1, 0xb8, 0x68, 0x68, 0xbc, -+ 0x68, 0x6e, 0xb5, 0xb4, 0xb4, 0xab, 0xb5, 0xa1, -+ 0xb0, 0x4f, 0x3f, 0xd3, 0x7b, 0x7b, 0x85, 0x80, -+ 0xbe, 0x36, 0x36, 0x36, 0x21, 0xd4, 0x7e, 0x7b, -+ 0x64, 0x64, 0xd5, 0x35, 0x24, 0x21, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x26, 0x31, 0xd6, 0x5b, 0x64, 0xc3, 0xc3, 0xcb, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0x66, 0xd7, 0x36, 0x36, 0x36, 0x2c, 0x4b, -+ 0xd8, 0xd9, 0xb3, 0xa8, 0xbd, 0xbd, 0xbd, 0xbd, -+ 0xa9, 0xab, 0xb3, 0xa5, 0xa2, 0x9f, 0xa2, 0xa1, -+ 0x6a, 0x9a, 0x3f, 0xda, 0x76, 0x76, 0x7a, 0x63, -+ 0xdb, 0xdc, 0x86, 0xdc, 0xdd, 0x90, 0x5b, 0x64, -+ 0xc3, 0xc3, 0xde, 0x2d, 0x27, 0x23, 0x21, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x26, 0x2d, 0x91, 0x5b, 0x64, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc7, 0x83, 0xce, 0x36, 0x36, 0x36, 0x30, -+ 0xb1, 0xd9, 0x48, 0xa1, 0xb2, 0xb0, 0xb0, 0xb3, -+ 0xa2, 0x48, 0xa7, 0xbd, 0xa9, 0xa2, 0x48, 0x9f, -+ 0xaa, 0x9a, 0x3f, 0xb1, 0x5b, 0x7b, 0xdf, 0x85, -+ 0x7e, 0x90, 0x63, 0x90, 0x85, 0x5b, 0xc3, 0xc4, -+ 0xc4, 0xcb, 0x5d, 0xd5, 0x39, 0x26, 0x23, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x26, 0x2d, 0xe0, 0xdf, 0x64, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc7, 0x88, 0x36, 0x36, 0x36, 0x36, -+ 0x2d, 0x9b, 0x48, 0xb9, 0xaf, 0xa2, 0xa2, 0xb9, -+ 0xa8, 0x9f, 0x48, 0xa7, 0xb7, 0xd9, 0x48, 0x48, -+ 0x9b, 0x45, 0x3f, 0xe1, 0x6d, 0x7b, 0xca, 0xdf, -+ 0x7a, 0x8b, 0x8b, 0x7a, 0x5b, 0x64, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc3, 0xe2, 0x37, 0x35, 0x26, 0x23, -+ 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x26, 0x2e, 0xe0, 0x7a, 0x7b, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc7, 0x72, 0x73, 0x36, 0x36, 0x36, -+ 0x24, 0x52, 0x48, 0xa3, 0xaf, 0x9f, 0x48, 0xb6, -+ 0xaf, 0xa2, 0x48, 0x9f, 0xe3, 0xd8, 0x48, 0x48, -+ 0x48, 0x46, 0x42, 0xd6, 0x7a, 0x7b, 0x64, 0x7b, -+ 0x76, 0x5b, 0x5b, 0x76, 0x7b, 0xc3, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xcb, 0x64, 0xe2, 0x4d, 0x2c, 0x27, -+ 0x23, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x25, 0x31, 0xe4, 0x8b, 0x7b, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc7, 0x89, 0xbe, 0x36, 0x36, -+ 0x32, 0x47, 0x48, 0x4f, 0xa0, 0x48, 0x48, 0xe3, -+ 0x92, 0x9f, 0x48, 0x9f, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x4b, 0x2f, 0x8f, 0x7a, 0x7b, 0xc3, 0xcb, -+ 0xc3, 0x64, 0x64, 0xc3, 0xc3, 0xcb, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc3, 0x5d, 0xe5, 0x2c, -+ 0x26, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x25, 0x31, 0xe4, 0x85, 0x7b, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0x66, 0x57, 0x27, 0x4d, -+ 0x4b, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x99, 0x34, 0xbe, 0xdb, 0x7a, 0x7b, 0xc3, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc3, 0xe4, -+ 0x32, 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, -+ 0x26, 0x2d, 0xe4, 0x85, 0x7b, 0xcb, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc7, 0x5f, 0x92, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x44, -+ 0x35, 0x36, 0xce, 0xdd, 0x7a, 0x7b, 0xcb, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xcb, 0xc3, 0xe1, -+ 0x2b, 0x24, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x23, -+ 0x30, 0x2f, 0xd6, 0x8b, 0x7b, 0xcb, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0x66, 0x89, 0x45, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x48, 0x9b, 0x4e, 0x25, -+ 0x36, 0x36, 0x61, 0xdb, 0x6d, 0x64, 0xcb, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xcb, 0x7b, 0xdf, 0xe5, -+ 0x32, 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x28, -+ 0x33, 0xe6, 0x63, 0xdf, 0xc3, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc3, 0x72, 0x81, 0xe7, -+ 0x46, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, -+ 0x48, 0x48, 0x48, 0x48, 0x3f, 0x2c, 0x36, 0x36, -+ 0x36, 0x36, 0xe8, 0x8f, 0x6d, 0x64, 0xcb, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc3, 0xca, 0x8b, 0xcf, 0x2c, -+ 0x26, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x24, -+ 0x35, 0x96, 0x75, 0xca, 0xc3, 0xcb, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xcb, 0x7b, 0x81, 0xdb, -+ 0x73, 0x3b, 0x44, 0x9b, 0x48, 0x48, 0x48, 0x9b, -+ 0x99, 0x43, 0x94, 0x2c, 0x21, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x73, 0xdb, 0x7a, 0x7b, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0x64, 0x76, 0x7a, 0x91, 0xd5, 0x31, 0x30, -+ 0x28, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x24, -+ 0x39, 0x97, 0x75, 0xdf, 0x7b, 0x64, 0xc3, 0xc3, -+ 0xcb, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0x7b, 0x7a, 0xe9, -+ 0xea, 0x36, 0x21, 0x26, 0x2b, 0x39, 0x33, 0x30, -+ 0x23, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x21, 0xea, 0xdd, 0x8b, 0x7b, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xc4, 0xc3, 0x64, 0x64, -+ 0x76, 0x85, 0xe0, 0xd5, 0x34, 0x2b, 0x27, 0x28, -+ 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x28, -+ 0x33, 0xeb, 0x63, 0x7e, 0x7a, 0x6d, 0xdf, 0x5b, -+ 0x76, 0x7b, 0x64, 0x64, 0xc3, 0xcb, 0xc4, 0xc4, -+ 0xc4, 0xc4, 0xc4, 0xc4, 0xcb, 0x76, 0x85, 0xdb, -+ 0x79, 0x22, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x21, 0xec, 0xdd, 0x75, 0x76, 0xc3, 0xc4, -+ 0xc4, 0xc4, 0xcb, 0xc3, 0x64, 0x76, 0xdf, 0x8b, -+ 0xd6, 0xd5, 0x2f, 0x35, 0x30, 0x24, 0x22, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x23, -+ 0x27, 0x31, 0xed, 0xeb, 0xdd, 0x74, 0x63, 0x90, -+ 0x7e, 0x75, 0x8b, 0x6d, 0xdf, 0x76, 0x64, 0xc3, -+ 0xcb, 0xcb, 0xcb, 0xcb, 0x64, 0x7a, 0x84, 0xee, -+ 0x79, 0xbe, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, -+ 0x36, 0x21, 0xea, 0xee, 0x63, 0x6d, 0x7b, 0x64, -+ 0xcb, 0xc3, 0x64, 0x7b, 0xdf, 0x75, 0x63, 0x96, -+ 0x38, 0x39, 0x2a, 0x24, 0x23, 0x21, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x28, 0x27, 0x35, 0x2d, 0x41, 0xd5, 0xe7, 0x8f, -+ 0xdb, 0xdd, 0xe9, 0x74, 0x84, 0x90, 0x85, 0x6d, -+ 0x5b, 0x7b, 0x7b, 0xca, 0x6d, 0x90, 0xdb, 0xef, -+ 0xec, 0x22, 0x36, 0x36, 0x28, 0x30, 0x30, 0x30, -+ 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x25, 0x36, -+ 0x36, 0x21, 0xd4, 0x80, 0xe9, 0x7e, 0x6d, 0x76, -+ 0xca, 0x76, 0x6d, 0x85, 0x63, 0xdb, 0xd5, 0x34, -+ 0x33, 0x26, 0x23, 0x21, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x21, 0x23, 0x24, 0x27, 0x2a, 0x35, 0x2e, 0x2f, -+ 0x41, 0xf0, 0xf1, 0x6c, 0x80, 0xee, 0xdb, 0x74, -+ 0x84, 0x90, 0x75, 0x7e, 0x74, 0x8f, 0xef, 0x79, -+ 0xe8, 0x2b, 0x9d, 0x41, 0x2f, 0x34, 0x2d, 0x2d, -+ 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x34, 0x2f, 0x38, -+ 0x4d, 0x37, 0xf2, 0xf3, 0x8f, 0x74, 0x63, 0x7e, -+ 0x75, 0x7e, 0x63, 0xe9, 0x88, 0xe6, 0x31, 0x2a, -+ 0x24, 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x21, 0x22, 0x23, 0x24, 0x26, 0x30, -+ 0x33, 0x39, 0x2e, 0x51, 0x41, 0xd2, 0x6c, 0xf3, -+ 0x80, 0xee, 0xee, 0xee, 0xf4, 0xf3, 0xd7, 0xf5, -+ 0x41, 0x34, 0x35, 0x32, 0x30, 0x27, 0x27, 0x27, -+ 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x30, 0x2a, -+ 0x2b, 0x34, 0xf6, 0xec, 0xf7, 0x8f, 0xdd, 0xe9, -+ 0xe9, 0xdd, 0xee, 0x6c, 0x41, 0x39, 0x27, 0x28, -+ 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x21, 0x22, -+ 0x28, 0x24, 0x26, 0x2a, 0x33, 0x2c, 0x2f, 0x41, -+ 0xf8, 0xd7, 0x79, 0x79, 0x79, 0xec, 0xf9, 0x51, -+ 0x39, 0x30, 0x24, 0x23, 0x22, 0x22, 0x22, 0x22, -+ 0x22, 0x22, 0x21, 0x22, 0x22, 0x22, 0x22, 0x23, -+ 0x24, 0x2a, 0x31, 0xfa, 0xea, 0x79, 0xf3, 0x80, -+ 0xf7, 0xdc, 0xfb, 0x2f, 0x35, 0x26, 0x23, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x21, 0x22, 0x23, 0x28, 0x25, 0x30, 0x2b, -+ 0x31, 0x2f, 0xf6, 0xfa, 0xfa, 0x2f, 0x2e, 0x33, -+ 0x26, 0x23, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x21, 0x28, 0x27, 0x35, 0x34, 0xfa, 0xfa, 0xfa, -+ 0xfc, 0xf6, 0x2e, 0x33, 0x25, 0x23, 0x21, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x21, 0x21, 0x23, 0x28, -+ 0x26, 0x30, 0x32, 0x2b, 0x33, 0x2a, 0x26, 0x28, -+ 0x22, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x21, 0x23, 0x25, 0x30, 0x33, 0x35, 0x35, -+ 0x2b, 0x2a, 0x26, 0x28, 0x22, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, -+ 0x21, 0x22, 0x23, 0x28, 0x28, 0x23, 0x22, 0x21, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x21, 0x23, 0x28, 0x24, 0x24, -+ 0x28, 0x23, 0x22, 0x21, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, -+}; -+ -+unsigned char linux_logo16[1]; -+ -+#endif /* INCLUDE_LINUX_LOGO_DATA */ -+ -+#include -+ ---- linux/include/asm-nios2nommu/local.h -+++ linux/include/asm-nios2nommu/local.h -@@ -0,0 +1,28 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2NOMMU_LOCAL_H -+#define __NIOS2NOMMU_LOCAL_H -+ -+#include -+ -+#endif /* __NIOS2NOMMU_LOCAL_H */ ---- linux/include/asm-nios2nommu/mc146818rtc.h -+++ linux/include/asm-nios2nommu/mc146818rtc.h -@@ -0,0 +1,29 @@ -+/* -+ * Machine dependent access functions for RTC registers. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef _NIOS2_MC146818RTC_H -+#define _NIOS2_MC146818RTC_H -+ -+/* empty include file to satisfy the include in genrtc.c/ide-geometry.c */ -+ -+#endif /* _NIOS2_MC146818RTC_H */ ---- linux/include/asm-nios2nommu/mman.h -+++ linux/include/asm-nios2nommu/mman.h -@@ -0,0 +1,68 @@ -+/* -+ * Copied from the m68k port. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2_MMAN_H__ -+#define __NIOS2_MMAN_H__ -+ -+#define PROT_READ 0x1 /* page can be read */ -+#define PROT_WRITE 0x2 /* page can be written */ -+#define PROT_EXEC 0x4 /* page can be executed */ -+#define PROT_SEM 0x8 /* page may be used for atomic ops */ -+#define PROT_NONE 0x0 /* page can not be accessed */ -+#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ -+#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ -+ -+#define MAP_SHARED 0x01 /* Share changes */ -+#define MAP_PRIVATE 0x02 /* Changes are private */ -+#define MAP_TYPE 0x0f /* Mask for type of mapping */ -+#define MAP_FIXED 0x10 /* Interpret addr exactly */ -+#define MAP_ANONYMOUS 0x20 /* don't use a file */ -+ -+#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ -+#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ -+#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ -+#define MAP_LOCKED 0x2000 /* pages are locked */ -+#define MAP_NORESERVE 0x4000 /* don't check for reservations */ -+#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ -+#define MAP_NONBLOCK 0x10000 /* do not block on IO */ -+ -+#define MS_ASYNC 1 /* sync memory asynchronously */ -+#define MS_INVALIDATE 2 /* invalidate the caches */ -+#define MS_SYNC 4 /* synchronous memory sync */ -+ -+#define MCL_CURRENT 1 /* lock all current mappings */ -+#define MCL_FUTURE 2 /* lock all future mappings */ -+ -+#define MADV_NORMAL 0x0 /* default page-in behavior */ -+#define MADV_RANDOM 0x1 /* page-in minimum required */ -+#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */ -+#define MADV_WILLNEED 0x3 /* pre-fault pages */ -+#define MADV_DONTNEED 0x4 /* discard these pages */ -+ -+/* compatibility flags */ -+#define MAP_ANON MAP_ANONYMOUS -+#define MAP_FILE 0 -+ -+#endif /* __NIOS2_MMAN_H__ */ -+ ---- linux/include/asm-nios2nommu/mmu.h -+++ linux/include/asm-nios2nommu/mmu.h -@@ -0,0 +1,47 @@ -+/* -+ * -+ * Taken from the m68knommu. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2NOMMU_MMU_H -+#define __NIOS2NOMMU_MMU_H -+ -+/* Copyright (C) 2002, David McCullough */ -+ -+struct mm_rblock_struct { -+ int size; -+ int refcount; -+ void *kblock; -+}; -+ -+struct mm_tblock_struct { -+ struct mm_rblock_struct *rblock; -+ struct mm_tblock_struct *next; -+}; -+ -+typedef struct { -+ struct mm_tblock_struct tblock; -+ unsigned long end_brk; -+} mm_context_t; -+ -+#endif /* __NIOS2NOMMU_MMU_H */ ---- linux/include/asm-nios2nommu/mmu_context.h -+++ linux/include/asm-nios2nommu/mmu_context.h -@@ -0,0 +1,58 @@ -+/* -+ * -+ * Taken from the m68knommu. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2NOMMU_MMU_CONTEXT_H -+#define __NIOS2NOMMU_MMU_CONTEXT_H -+ -+// #include -+#include -+#include -+#include -+ -+static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) -+{ -+} -+ -+extern inline int -+init_new_context(struct task_struct *tsk, struct mm_struct *mm) -+{ -+ // mm->context = virt_to_phys(mm->pgd); -+ return(0); -+} -+ -+#define destroy_context(mm) do { } while(0) -+ -+static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) -+{ -+} -+ -+#define deactivate_mm(tsk,mm) do { } while (0) -+ -+extern inline void activate_mm(struct mm_struct *prev_mm, -+ struct mm_struct *next_mm) -+{ -+} -+ -+#endif ---- linux/include/asm-nios2nommu/module.h -+++ linux/include/asm-nios2nommu/module.h -@@ -0,0 +1,36 @@ -+#ifndef _NIOS2_MODULE_H -+#define _NIOS2_MODULE_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/module.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+struct mod_arch_specific -+{ -+}; -+ -+#define Elf_Shdr Elf32_Shdr -+#define Elf_Sym Elf32_Sym -+#define Elf_Ehdr Elf32_Ehdr -+ -+#endif /* _NIOS_MODULE_H */ ---- linux/include/asm-nios2nommu/msgbuf.h -+++ linux/include/asm-nios2nommu/msgbuf.h -@@ -0,0 +1,56 @@ -+/* -+ * Taken from the m68k. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2_MSGBUF_H -+#define _NIOS2_MSGBUF_H -+ -+/* -+ * The msqid64_ds structure for nios2 architecture. -+ * Note extra padding because this structure is passed back and forth -+ * between kernel and user space. -+ * -+ * Pad space is left for: -+ * - 64-bit time_t to solve y2038 problem -+ * - 2 miscellaneous 32-bit values -+ */ -+ -+struct msqid64_ds { -+ struct ipc64_perm msg_perm; -+ __kernel_time_t msg_stime; /* last msgsnd time */ -+ unsigned long __unused1; -+ __kernel_time_t msg_rtime; /* last msgrcv time */ -+ unsigned long __unused2; -+ __kernel_time_t msg_ctime; /* last change time */ -+ unsigned long __unused3; -+ unsigned long msg_cbytes; /* current number of bytes on queue */ -+ unsigned long msg_qnum; /* number of messages in queue */ -+ unsigned long msg_qbytes; /* max number of bytes on queue */ -+ __kernel_pid_t msg_lspid; /* pid of last msgsnd */ -+ __kernel_pid_t msg_lrpid; /* last receive pid */ -+ unsigned long __unused4; -+ unsigned long __unused5; -+}; -+ -+#endif /* _NIOS2_MSGBUF_H */ -+ ---- linux/include/asm-nios2nommu/namei.h -+++ linux/include/asm-nios2nommu/namei.h -@@ -0,0 +1,36 @@ -+/* -+ * linux/include/asm-nios/namei.h -+ * Moved from m68k version -+ * Included from linux/fs/namei.c -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef __NIOS2_NAMEI_H -+#define __NIOS2_NAMEI_H -+ -+/* This dummy routine maybe changed to something useful -+ * for /usr/gnemul/ emulation stuff. -+ * Look at asm-sparc/namei.h for details. -+ */ -+ -+#define __emul_prefix() NULL -+ -+#endif ---- linux/include/asm-nios2nommu/ndma.h -+++ linux/include/asm-nios2nommu/ndma.h -@@ -0,0 +1,64 @@ -+#ifndef __NDMA_H__ -+ #define __NDMA_H__ -+ -+ #ifndef __ASSEMBLY__ -+ -+// DMA Registers -+typedef volatile struct -+{ -+ int np_dmastatus; // status register -+ int np_dmareadaddress; // read address -+ int np_dmawriteaddress; // write address -+ int np_dmalength; // length in bytes -+ int np_dmareserved1; // reserved -+ int np_dmareserved2; // reserved -+ int np_dmacontrol; // control register -+ int np_dmareserved3; // control register alternate -+} np_dma; -+ -+// DMA Register Bits -+enum -+{ -+ np_dmacontrol_byte_bit = 0, // Byte transaction -+ np_dmacontrol_hw_bit = 1, // Half-word transaction -+ np_dmacontrol_word_bit = 2, // Word transaction -+ np_dmacontrol_go_bit = 3, // enable execution -+ np_dmacontrol_i_en_bit = 4, // enable interrupt -+ np_dmacontrol_reen_bit = 5, // Enable read end-of-packet -+ np_dmacontrol_ween_bit = 6, // Enable write end-of-packet -+ np_dmacontrol_leen_bit = 7, // Enable length=0 transaction end -+ np_dmacontrol_rcon_bit = 8, // Read from a fixed address -+ np_dmacontrol_wcon_bit = 9, // Write to a fixed address -+ np_dmacontrol_doubleword_bit = 10, // Double-word transaction -+ np_dmacontrol_quadword_bit = 11, // Quad-word transaction -+ -+ np_dmastatus_done_bit = 0, // 1 when done. Status write clears. -+ np_dmastatus_busy_bit = 1, // 1 when busy. -+ np_dmastatus_reop_bit = 2, // read-eop received -+ np_dmastatus_weop_bit = 3, // write-eop received -+ np_dmastatus_len_bit = 4, // requested length transacted -+ -+ np_dmacontrol_byte_mask = (1 << 0), // Byte transaction -+ np_dmacontrol_hw_mask = (1 << 1), // Half-word transaction -+ np_dmacontrol_word_mask = (1 << 2), // Word transaction -+ np_dmacontrol_go_mask = (1 << 3), // enable execution -+ np_dmacontrol_i_en_mask = (1 << 4), // enable interrupt -+ np_dmacontrol_reen_mask = (1 << 5), // Enable read end-of-packet -+ np_dmacontrol_ween_mask = (1 << 6), // Enable write end-of-packet -+ np_dmacontrol_leen_mask = (1 << 7), // Enable length=0 transaction end -+ np_dmacontrol_rcon_mask = (1 << 8), // Read from a fixed address -+ np_dmacontrol_wcon_mask = (1 << 9), // Write to a fixed address -+ np_dmacontrol_doubleword_mask = (1 << 10), // Double-word transaction -+ np_dmacontrol_quadword_mask = (1 << 11), // Quad-word transaction -+ -+ np_dmastatus_done_mask = (1 << 0), // 1 when done. Status write clears. -+ np_dmastatus_busy_mask = (1 << 1), // 1 when busy. -+ np_dmastatus_reop_mask = (1 << 2), // read-eop received -+ np_dmastatus_weop_mask = (1 << 3), // write-eop received -+ np_dmastatus_len_mask = (1 << 4), // requested length transacted -+}; -+ -+ #endif /* __ASSEMBLY__ */ -+ -+#endif -+/* End of File */ ---- linux/include/asm-nios2nommu/nios.h -+++ linux/include/asm-nios2nommu/nios.h -@@ -0,0 +1,7 @@ -+#ifndef __NIOS_H__ -+#define __NIOS_H__ -+ -+#include "nios2_system.h" -+ -+#endif -+ ---- linux/include/asm-nios2nommu/page.h -+++ linux/include/asm-nios2nommu/page.h -@@ -0,0 +1,135 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2_PAGE_H -+#define _NIOS2_PAGE_H -+ -+/* copied from m68knommu arch */ -+// #include -+ -+/* PAGE_SHIFT determines the page size */ -+ -+#define PAGE_SHIFT (12) -+#define PAGE_SIZE (1UL << PAGE_SHIFT) -+#define PAGE_MASK (~(PAGE_SIZE-1)) -+ -+#ifdef __KERNEL__ -+ -+#include -+ -+#if PAGE_SHIFT < 13 -+#define THREAD_SIZE (8192) -+#else -+#define THREAD_SIZE PAGE_SIZE -+#endif -+ -+#ifndef __ASSEMBLY__ -+ -+#define get_user_page(vaddr) __get_free_page(GFP_KERNEL) -+#define free_user_page(page, addr) free_page(addr) -+ -+#define clear_page(page) memset((page), 0, PAGE_SIZE) -+#define copy_page(to,from) memcpy((to), (from), PAGE_SIZE) -+ -+#define clear_user_page(page, vaddr, pg) clear_page(page) -+#define copy_user_page(to, from, vaddr, pg) copy_page(to, from) -+ -+/* -+ * These are used to make use of C type-checking.. -+ */ -+typedef struct { unsigned long pte; } pte_t; -+typedef struct { unsigned long pmd[16]; } pmd_t; -+typedef struct { unsigned long pgd; } pgd_t; -+typedef struct { unsigned long pgprot; } pgprot_t; -+ -+#define pte_val(x) ((x).pte) -+#define pmd_val(x) ((&x)->pmd[0]) -+#define pgd_val(x) ((x).pgd) -+#define pgprot_val(x) ((x).pgprot) -+ -+#define __pte(x) ((pte_t) { (x) } ) -+#define __pmd(x) ((pmd_t) { (x) } ) -+#define __pgd(x) ((pgd_t) { (x) } ) -+#define __pgprot(x) ((pgprot_t) { (x) } ) -+ -+/* to align the pointer to the (next) page boundary */ -+#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) -+ -+/* Pure 2^n version of get_order */ -+extern __inline__ int get_order(unsigned long size) -+{ -+ int order; -+ -+ size = (size-1) >> (PAGE_SHIFT-1); -+ order = -1; -+ do { -+ size >>= 1; -+ order++; -+ } while (size); -+ return order; -+} -+ -+extern unsigned long memory_start; -+extern unsigned long memory_end; -+ -+#endif /* !__ASSEMBLY__ */ -+#include -+#define PAGE_OFFSET ((int)(nasys_program_mem)) -+ -+#ifndef __ASSEMBLY__ -+ -+#define __pa(vaddr) virt_to_phys((void *)vaddr) -+#define __va(paddr) phys_to_virt((unsigned long)paddr) -+ -+#define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT) -+ -+#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) -+#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) -+ -+#define virt_to_page(addr) (mem_map + (((unsigned long)(addr)-PAGE_OFFSET) >> PAGE_SHIFT)) -+#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) -+#define VALID_PAGE(page) ((page - mem_map) < max_mapnr) -+ -+#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn)) -+#define page_to_pfn(page) virt_to_pfn(page_to_virt(page)) -+ -+#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ -+ ((void *)(kaddr) < (void *)memory_end)) -+ -+#ifdef CONFIG_NO_KERNEL_MSG -+#define BUG_PRINT() -+#else -+#define BUG_PRINT() printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__) -+#endif -+ -+#ifdef na_cpu_oci_core -+#define BUG_PANIC() asm volatile ("break") /* drop to debugger */ -+#else -+// #define BUG_PANIC() while(1) -+#define BUG_PANIC() panic("BUG!") -+#endif -+ -+#endif /* __ASSEMBLY__ */ -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _NIOS2_PAGE_H */ ---- linux/include/asm-nios2nommu/param.h -+++ linux/include/asm-nios2nommu/param.h -@@ -0,0 +1,49 @@ -+#ifndef _NIOS_PARAM_H -+#define _NIOS_PARAM_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/param.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#ifndef HZ -+#define HZ 100 -+#endif -+ -+#ifdef __KERNEL__ -+#define USER_HZ HZ -+#define CLOCKS_PER_SEC (USER_HZ) -+#endif -+ -+#define EXEC_PAGESIZE 4096 -+ -+#ifndef NGROUPS -+#define NGROUPS 32 -+#endif -+ -+#ifndef NOGROUP -+#define NOGROUP (-1) -+#endif -+ -+#define MAXHOSTNAMELEN 64 /* max length of hostname */ -+ -+#endif ---- linux/include/asm-nios2nommu/pci.h -+++ linux/include/asm-nios2nommu/pci.h -@@ -0,0 +1,75 @@ -+#ifndef _ASM_NIOS2NOMMU_PCI_H -+#define _ASM_NIOS2NOMMU_PCI_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/pci.h -+ * -+ * Derived from asm-m68k/pci_m68k.h -+ * - m68k specific PCI declarations, by Wout Klaren. -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+struct pci_ops; -+ -+/* -+ * Structure with hardware dependent information and functions of the -+ * PCI bus. -+ */ -+ -+struct pci_bus_info -+{ -+ /* -+ * Resources of the PCI bus. -+ */ -+ -+ struct resource mem_space; -+ struct resource io_space; -+ -+ /* -+ * System dependent functions. -+ */ -+ -+ struct pci_ops *m68k_pci_ops; -+ -+ void (*fixup)(int pci_modify); -+ void (*conf_device)(struct pci_dev *dev); -+}; -+ -+#define pcibios_assign_all_busses() 0 -+ -+extern inline void pcibios_set_master(struct pci_dev *dev) -+{ -+ /* No special bus mastering setup handling */ -+} -+ -+extern inline void pcibios_penalize_isa_irq(int irq) -+{ -+ /* We don't do dynamic PCI IRQ allocation */ -+} -+ -+/* The PCI address space does equal the physical memory -+ * address space. The networking and block device layers use -+ * this boolean for bounce buffer decisions. -+ */ -+#define PCI_DMA_BUS_IS_PHYS (1) -+ -+#endif /* _ASM_NIOS2NOMMU_PCI_H */ ---- linux/include/asm-nios2nommu/percpu.h -+++ linux/include/asm-nios2nommu/percpu.h -@@ -0,0 +1,30 @@ -+#ifndef __ARCH_NIOS2NOMMU_PERCPU__ -+#define __ARCH_NIOS2NOMMU_PERCPU__ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/percpu.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#endif /* __ARCH_NIOS2NOMMU_PERCPU__ */ ---- linux/include/asm-nios2nommu/pgalloc.h -+++ linux/include/asm-nios2nommu/pgalloc.h -@@ -0,0 +1,32 @@ -+#ifndef _NIOS2NOMMU_PGALLOC_H -+#define _NIOS2NOMMU_PGALLOC_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/pgalloc.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#define check_pgt_cache() do { } while (0) -+ -+#endif /* _NIOS2NOMMU_PGALLOC_H */ ---- linux/include/asm-nios2nommu/pgtable.h -+++ linux/include/asm-nios2nommu/pgtable.h -@@ -0,0 +1,100 @@ -+#ifndef _NIOS_PGTABLE_H -+#define _NIOS_PGTABLE_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/pgtable.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+//vic - this bit copied from m68knommu version -+// #include -+#include -+#include -+ -+typedef pte_t *pte_addr_t; -+ -+#define pgd_present(pgd) (1) /* pages are always present on NO_MM */ -+#define pgd_none(pgd) (0) -+#define pgd_bad(pgd) (0) -+#define pgd_clear(pgdp) -+#define kern_addr_valid(addr) (1) -+#define pmd_offset(a, b) ((void *)0) -+ -+#define PAGE_NONE __pgprot(0) /* these mean nothing to NO_MM */ -+#define PAGE_SHARED __pgprot(0) /* these mean nothing to NO_MM */ -+#define PAGE_COPY __pgprot(0) /* these mean nothing to NO_MM */ -+#define PAGE_READONLY __pgprot(0) /* these mean nothing to NO_MM */ -+#define PAGE_KERNEL __pgprot(0) /* these mean nothing to NO_MM */ -+//vic - this bit copied from m68knommu version -+ -+extern void paging_init(void); -+#define swapper_pg_dir ((pgd_t *) 0) -+ -+#define __swp_type(x) (0) -+#define __swp_offset(x) (0) -+#define __swp_entry(typ,off) ((swp_entry_t) { ((typ) | ((off) << 7)) }) -+#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) -+#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) -+ -+static inline int pte_file(pte_t pte) { return 0; } -+ -+/* -+ * ZERO_PAGE is a global shared page that is always zero: used -+ * for zero-mapped memory areas etc.. -+ */ -+#define ZERO_PAGE(vaddr) (virt_to_page(0)) -+ -+extern unsigned int kobjsize(const void *objp); -+ -+/* -+ * No page table caches to initialise -+ */ -+#define pgtable_cache_init() do { } while (0) -+ -+extern inline void flush_cache_mm(struct mm_struct *mm) -+{ -+} -+ -+extern inline void flush_cache_range(struct mm_struct *mm, -+ unsigned long start, -+ unsigned long end) -+{ -+} -+ -+/* Push the page at kernel virtual address and clear the icache */ -+extern inline void flush_page_to_ram (unsigned long address) -+{ -+} -+ -+/* Push n pages at kernel virtual address and clear the icache */ -+extern inline void flush_pages_to_ram (unsigned long address, int n) -+{ -+} -+ -+/* -+ * All 32bit addresses are effectively valid for vmalloc... -+ * Sort of meaningless for non-VM targets. -+ */ -+#define VMALLOC_START 0 -+#define VMALLOC_END 0xffffffff -+ -+#endif /* _NIOS_PGTABLE_H */ ---- linux/include/asm-nios2nommu/pio_struct.h -+++ linux/include/asm-nios2nommu/pio_struct.h -@@ -0,0 +1,14 @@ -+// PIO Peripheral -+ -+// PIO Registers -+typedef volatile struct -+ { -+ int np_piodata; // read/write, up to 32 bits -+ int np_piodirection; // write/readable, up to 32 bits, 1->output bit -+ int np_piointerruptmask; // write/readable, up to 32 bits, 1->enable interrupt -+ int np_pioedgecapture; // read, up to 32 bits, cleared by any write -+ } np_pio; -+ -+// PIO Routines -+void nr_pio_showhex(int value); // shows low byte on pio named na_seven_seg_pio -+ ---- linux/include/asm-nios2nommu/poll.h -+++ linux/include/asm-nios2nommu/poll.h -@@ -0,0 +1,46 @@ -+#ifndef __NIOS2_POLL_H -+#define __NIOS2_POLL_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/poll.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#define POLLIN 1 -+#define POLLPRI 2 -+#define POLLOUT 4 -+#define POLLERR 8 -+#define POLLHUP 16 -+#define POLLNVAL 32 -+#define POLLRDNORM 64 -+#define POLLWRNORM POLLOUT -+#define POLLRDBAND 128 -+#define POLLWRBAND 256 -+#define POLLMSG 0x0400 -+ -+struct pollfd { -+ int fd; -+ short events; -+ short revents; -+}; -+ -+#endif ---- linux/include/asm-nios2nommu/posix_types.h -+++ linux/include/asm-nios2nommu/posix_types.h -@@ -0,0 +1,89 @@ -+#ifndef __ARCH_NIOS2_POSIX_TYPES_H -+#define __ARCH_NIOS2_POSIX_TYPES_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/posix_types.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* -+ * This file is generally used by user-level software, so you need to -+ * be a little careful about namespace pollution etc. Also, we cannot -+ * assume GCC is being used. -+ */ -+ -+typedef unsigned long __kernel_ino_t; -+typedef unsigned short __kernel_mode_t; -+typedef unsigned short __kernel_nlink_t; -+typedef long __kernel_off_t; -+typedef int __kernel_pid_t; -+typedef unsigned short __kernel_ipc_pid_t; -+typedef unsigned short __kernel_uid_t; -+typedef unsigned short __kernel_gid_t; -+typedef unsigned int __kernel_size_t; -+typedef int __kernel_ssize_t; -+typedef int __kernel_ptrdiff_t; -+typedef long __kernel_time_t; -+typedef long __kernel_suseconds_t; -+typedef long __kernel_clock_t; -+typedef int __kernel_timer_t; -+typedef int __kernel_clockid_t; -+typedef int __kernel_daddr_t; -+typedef char * __kernel_caddr_t; -+typedef unsigned short __kernel_uid16_t; -+typedef unsigned short __kernel_gid16_t; -+typedef unsigned int __kernel_uid32_t; -+typedef unsigned int __kernel_gid32_t; -+ -+typedef unsigned short __kernel_old_uid_t; -+typedef unsigned short __kernel_old_gid_t; -+typedef unsigned short __kernel_old_dev_t; -+ -+#ifdef __GNUC__ -+typedef long long __kernel_loff_t; -+#endif -+ -+typedef struct { -+#if defined(__KERNEL__) || defined(__USE_ALL) -+ int val[2]; -+#else /* !defined(__KERNEL__) && !defined(__USE_ALL) */ -+ int __val[2]; -+#endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */ -+} __kernel_fsid_t; -+ -+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) -+ -+#undef __FD_SET -+#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) -+ -+#undef __FD_CLR -+#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) -+ -+#undef __FD_ISSET -+#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) -+ -+#undef __FD_ZERO -+#define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp))) -+ -+#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ -+ -+#endif ---- linux/include/asm-nios2nommu/preem_latency.h -+++ linux/include/asm-nios2nommu/preem_latency.h -@@ -0,0 +1,39 @@ -+#ifndef _ASM_PREEM_LATENCY_H -+#define _ASM_PREEM_LATENCY_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/preem_latency.h -+ * -+ * timing support for preempt-stats patch -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#define readclock(low) \ -+do {\ -+ *(volatile unsigned long *)na_Counter_64_bit=1; \ -+ low=*(volatile unsigned long *)na_Counter_64_bit; \ -+} while (0) -+#define readclock_init() -+ -+#endif /* _ASM_PREEM_LATENCY_H */ ---- linux/include/asm-nios2nommu/processor.h -+++ linux/include/asm-nios2nommu/processor.h -@@ -0,0 +1,148 @@ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/processor.h -+ * -+ * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu) -+ * Copyright (C) 2001 Ken Hill (khill@microtronix.com) -+ * Vic Phillips (vic@microtronix.com) -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * hacked from: -+ * include/asm-sparc/processor.h -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * Nov/02/2003 dgt Fix task_size -+ * -+ ---------------------------------------------------------------------*/ -+ -+#ifndef __ASM_NIOS_PROCESSOR_H -+#define __ASM_NIOS_PROCESSOR_H -+ -+#define NIOS2_FLAG_KTHREAD 0x00000001 /* task is a kernel thread */ -+#define NIOS2_FLAG_COPROC 0x00000002 /* Thread used coprocess */ -+#define NIOS2_FLAG_DEBUG 0x00000004 /* task is being debugged */ -+ -+#define NIOS2_OP_NOP 0x1883a -+#define NIOS2_OP_BREAK 0x3da03a -+ -+#ifndef __ASSEMBLY__ -+ -+/* -+ * Default implementation of macro that returns current -+ * instruction pointer ("program counter"). -+ */ -+#define current_text_addr() ({ __label__ _l; _l: &&_l;}) -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include /* for get_hi_limit */ -+ -+/* -+ * Bus types -+ */ -+#define EISA_bus 0 -+#define EISA_bus__is_a_macro /* for versions in ksyms.c */ -+#define MCA_bus 0 -+#define MCA_bus__is_a_macro /* for versions in ksyms.c */ -+ -+/* -+ * The nios has no problems with write protection -+ */ -+#define wp_works_ok 1 -+#define wp_works_ok__is_a_macro /* for versions in ksyms.c */ -+ -+/* Whee, this is STACK_TOP and the lowest kernel address too... */ -+#if 0 -+#define KERNBASE 0x00000000 /* First address the kernel will eventually be */ -+#define TASK_SIZE (KERNBASE) -+#define MAX_USER_ADDR TASK_SIZE -+#define MMAP_SEARCH_START (TASK_SIZE/3) -+#endif -+ -+#define TASK_SIZE ((unsigned int) nasys_program_mem_end) //...this is better... -+ -+/* -+ * This decides where the kernel will search for a free chunk of vm -+ * space during mmap's. We won't be using it -+ */ -+#define TASK_UNMAPPED_BASE 0 -+ -+/* The Nios processor specific thread struct. */ -+struct thread_struct { -+ struct pt_regs *kregs; -+ -+ /* For signal handling */ -+ unsigned long sig_address; -+ unsigned long sig_desc; -+ -+ /* Context switch saved kernel state. */ -+ unsigned long ksp; -+ unsigned long kpsr; -+ unsigned long kesr; -+ -+ /* Flags are defined below */ -+ -+ unsigned long flags; -+ int current_ds; -+ struct exec core_exec; /* just what it says. */ -+}; -+ -+#define INIT_MMAP { &init_mm, (0), (0), \ -+ __pgprot(0x0) , VM_READ | VM_WRITE | VM_EXEC } -+ -+#define INIT_THREAD { \ -+ .kregs = 0, \ -+ .sig_address = 0, \ -+ .sig_desc = 0, \ -+ .ksp = 0, \ -+ .kpsr = 0, \ -+ .kesr = PS_S, \ -+ .flags = NIOS2_FLAG_KTHREAD, \ -+ .current_ds = __KERNEL_DS, \ -+ .core_exec = INIT_EXEC \ -+} -+ -+/* Free all resources held by a thread. */ -+extern void release_thread(struct task_struct *); -+ -+extern unsigned long thread_saved_pc(struct task_struct *t); -+ -+extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long sp); -+ -+/* Prepare to copy thread state - unlazy all lazy status */ -+#define prepare_to_copy(tsk) do { } while (0) -+ -+extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); -+ -+unsigned long get_wchan(struct task_struct *p); -+ -+#define KSTK_EIP(tsk) ((tsk)->thread.kregs->ea) -+#define KSTK_ESP(tsk) ((tsk)->thread.kregs->sp) -+ -+#ifdef __KERNEL__ -+/* Allocation and freeing of basic task resources. */ -+ -+//;dgt2;#define alloc_task_struct() ((struct task_struct *) xx..see..linux..fork..xx __get_free_pages(GFP_KERNEL,1)) -+//;dgt2;#define get_task_struct(tsk) xx..see..linux..sched.h...atomic_inc(&mem_map[MAP_NR(tsk)].count) -+ -+#endif -+ -+#define cpu_relax() do { } while (0) -+#endif /* __ASSEMBLY__ */ -+#endif /* __ASM_NIOS_PROCESSOR_H */ ---- linux/include/asm-nios2nommu/ptrace.h -+++ linux/include/asm-nios2nommu/ptrace.h -@@ -0,0 +1,141 @@ -+/* -+ * Taken from the m68k port. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef _NIOS2NOMMU_PTRACE_H -+#define _NIOS2NOMMU_PTRACE_H -+ -+#ifndef __ASSEMBLY__ -+ -+#define PTR_R0 0 -+#define PTR_R1 1 -+#define PTR_R2 2 -+#define PTR_R3 3 -+#define PTR_R4 4 -+#define PTR_R5 5 -+#define PTR_R6 6 -+#define PTR_R7 7 -+#define PTR_R8 8 -+#define PTR_R9 9 -+#define PTR_R10 10 -+#define PTR_R11 11 -+#define PTR_R12 12 -+#define PTR_R13 13 -+#define PTR_R14 14 -+#define PTR_R15 15 -+#define PTR_R16 16 -+#define PTR_R17 17 -+#define PTR_R18 18 -+#define PTR_R19 19 -+#define PTR_R20 20 -+#define PTR_R21 21 -+#define PTR_R22 22 -+#define PTR_R23 23 -+#define PTR_R24 24 -+#define PTR_R25 25 -+#define PTR_GP 26 -+#define PTR_SP 27 -+#define PTR_FP 28 -+#define PTR_EA 29 -+#define PTR_BA 30 -+#define PTR_RA 31 -+#define PTR_STATUS 32 -+#define PTR_ESTATUS 33 -+#define PTR_BSTATUS 34 -+#define PTR_IENABLE 35 -+#define PTR_IPENDING 36 -+ -+/* this struct defines the way the registers are stored on the -+ stack during a system call. -+ -+ There is a fake_regs in setup.c that has to match pt_regs.*/ -+ -+struct pt_regs { -+ unsigned long r8; -+ unsigned long r9; -+ unsigned long r10; -+ unsigned long r11; -+ unsigned long r12; -+ unsigned long r13; -+ unsigned long r14; -+ unsigned long r15; -+ unsigned long r1; -+ unsigned long r2; -+ unsigned long r3; -+ unsigned long r4; -+ unsigned long r5; -+ unsigned long r6; -+ unsigned long r7; -+ unsigned long orig_r2; -+ unsigned long ra; -+ unsigned long fp; -+ unsigned long sp; -+ unsigned long gp; -+ unsigned long estatus; -+ unsigned long status_extension; -+ unsigned long ea; -+}; -+ -+ -+/* -+ * This is the extended stack used by signal handlers and the context -+ * switcher: it's pushed after the normal "struct pt_regs". -+ */ -+struct switch_stack { -+ unsigned long r16; -+ unsigned long r17; -+ unsigned long r18; -+ unsigned long r19; -+ unsigned long r20; -+ unsigned long r21; -+ unsigned long r22; -+ unsigned long r23; -+ unsigned long fp; -+ unsigned long gp; -+ unsigned long ra; -+}; -+ -+/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ -+#define PTRACE_GETREGS 12 -+#define PTRACE_SETREGS 13 -+#ifdef CONFIG_FPU -+#define PTRACE_GETFPREGS 14 -+#define PTRACE_SETFPREGS 15 -+#endif -+ -+#ifdef __KERNEL__ -+ -+#ifndef PS_S -+#define PS_S (0x00000001) -+#endif -+#ifndef PS_T -+#define PS_T (0x00000002) -+#endif -+ -+#define user_mode(regs) (!((regs)->status_extension & PS_S)) -+#define instruction_pointer(regs) ((regs)->ra) -+#define profile_pc(regs) instruction_pointer(regs) -+extern void show_regs(struct pt_regs *); -+ -+#endif /* __KERNEL__ */ -+#endif /* __ASSEMBLY__ */ -+#endif /* _NIOS2NOMMU_PTRACE_H */ ---- linux/include/asm-nios2nommu/resource.h -+++ linux/include/asm-nios2nommu/resource.h -@@ -0,0 +1,73 @@ -+#ifndef _NIOS2NOMMU_RESOURCE_H -+#define _NIOS2NOMMU_RESOURCE_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * Resource limits -+ * -+ * include/asm-nios2nommu/resource.h -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#define RLIMIT_CPU 0 /* CPU time in ms */ -+#define RLIMIT_FSIZE 1 /* Maximum filesize */ -+#define RLIMIT_DATA 2 /* max data size */ -+#define RLIMIT_STACK 3 /* max stack size */ -+#define RLIMIT_CORE 4 /* max core file size */ -+#define RLIMIT_RSS 5 /* max resident set size */ -+#define RLIMIT_NPROC 6 /* max number of processes */ -+#define RLIMIT_NOFILE 7 /* max number of open files */ -+#define RLIMIT_MEMLOCK 8 /* max locked-in-memory address space */ -+#define RLIMIT_AS 9 /* address space limit */ -+#define RLIMIT_LOCKS 10 /* maximum file locks held */ -+#define RLIMIT_SIGPENDING 11 /* max number of pending signals */ -+#define RLIMIT_MSGQUEUE 12 /* maximum bytes in POSIX mqueues */ -+ -+#define RLIM_NLIMITS 13 -+ -+/* -+ * SuS says limits have to be unsigned. -+ * Which makes a ton more sense anyway. -+ */ -+#define RLIM_INFINITY (~0UL) -+ -+#ifdef __KERNEL__ -+ -+#define INIT_RLIMITS \ -+{ \ -+ { RLIM_INFINITY, RLIM_INFINITY }, \ -+ { RLIM_INFINITY, RLIM_INFINITY }, \ -+ { RLIM_INFINITY, RLIM_INFINITY }, \ -+ { _STK_LIM, RLIM_INFINITY }, \ -+ { 0, RLIM_INFINITY }, \ -+ { RLIM_INFINITY, RLIM_INFINITY }, \ -+ { 0, 0 }, \ -+ { INR_OPEN, INR_OPEN }, \ -+ { MLOCK_LIMIT, MLOCK_LIMIT }, \ -+ { RLIM_INFINITY, RLIM_INFINITY }, \ -+ { RLIM_INFINITY, RLIM_INFINITY }, \ -+ { MAX_SIGPENDING, MAX_SIGPENDING }, \ -+ { MQ_BYTES_MAX, MQ_BYTES_MAX }, \ -+} -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _NIOS2NOMMU_RESOURCE_H */ ---- linux/include/asm-nios2nommu/rmap.h -+++ linux/include/asm-nios2nommu/rmap.h -@@ -0,0 +1,2 @@ -+/* Do not need anything here */ -+ ---- linux/include/asm-nios2nommu/scatterlist.h -+++ linux/include/asm-nios2nommu/scatterlist.h -@@ -0,0 +1,40 @@ -+#ifndef _NIOS2NOMMU_SCATTERLIST_H -+#define _NIOS2NOMMU_SCATTERLIST_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/scatterlist.h -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+struct scatterlist { -+ struct page *page; -+ unsigned int offset; -+ dma_addr_t dma_address; -+ unsigned int length; -+}; -+ -+#define sg_dma_address(sg) ((sg)->dma_address) -+#define sg_dma_len(sg) ((sg)->length) -+ -+#define ISA_DMA_THRESHOLD (0xffffffff) -+ -+#endif /* !(_NIOS2NOMMU_SCATTERLIST_H) */ ---- linux/include/asm-nios2nommu/sections.h -+++ linux/include/asm-nios2nommu/sections.h -@@ -0,0 +1,30 @@ -+#ifndef _NIOS2NOMMU_SECTIONS_H -+#define _NIOS2NOMMU_SECTIONS_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/sections.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#endif /* _NIOS2NOMMU_SECTIONS_H */ ---- linux/include/asm-nios2nommu/segment.h -+++ linux/include/asm-nios2nommu/segment.h -@@ -0,0 +1,75 @@ -+#ifndef _NIOS2NOMMU_SEGMENT_H -+#define _NIOS2NOMMU_SEGMENT_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/segment.h -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* define constants */ -+/* Address spaces (FC0-FC2) */ -+#define USER_DATA (1) -+#ifndef __USER_DS -+#define __USER_DS (USER_DATA) -+#endif -+#define USER_PROGRAM (2) -+#define SUPER_DATA (5) -+#ifndef __KERNEL_DS -+#define __KERNEL_DS (SUPER_DATA) -+#endif -+#define SUPER_PROGRAM (6) -+#define CPU_SPACE (7) -+ -+#ifndef __ASSEMBLY__ -+ -+typedef struct { -+ unsigned long seg; -+} mm_segment_t; -+ -+#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) }) -+#define USER_DS MAKE_MM_SEG(__USER_DS) -+#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS) -+ -+/* -+ * Get/set the SFC/DFC registers for MOVES instructions -+ */ -+ -+static inline mm_segment_t get_fs(void) -+{ -+ return USER_DS; -+} -+ -+static inline mm_segment_t get_ds(void) -+{ -+ /* return the supervisor data space code */ -+ return KERNEL_DS; -+} -+ -+static inline void set_fs(mm_segment_t val) -+{ -+} -+ -+#define segment_eq(a,b) ((a).seg == (b).seg) -+ -+#endif /* __ASSEMBLY__ */ -+ -+#endif /* _NIOS2NOMMU_SEGMENT_H */ ---- linux/include/asm-nios2nommu/semaphore-helper.h -+++ linux/include/asm-nios2nommu/semaphore-helper.h -@@ -0,0 +1,101 @@ -+#ifndef _NIOS2NOMMU_SEMAPHORE_HELPER_H -+#define _NIOS2NOMMU_SEMAPHORE_HELPER_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/semaphore.h -+ * -+ * SMP- and interrupt-safe semaphores helper functions. -+ * -+ * Derived from M68knommu -+ * -+ * (C) Copyright 1996 Linus Torvalds -+ * m68k version by Andreas Schwab -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+// #include -+ -+/* -+ * These two _must_ execute atomically wrt each other. -+ */ -+static inline void wake_one_more(struct semaphore * sem) -+{ -+ atomic_inc(&sem->waking); -+} -+ -+static inline int waking_non_zero(struct semaphore *sem) -+{ -+ int ret; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&semaphore_wake_lock, flags); -+ ret = 0; -+ if (atomic_read(&sem->waking) > 0) { -+ atomic_dec(&sem->waking); -+ ret = 1; -+ } -+ spin_unlock_irqrestore(&semaphore_wake_lock, flags); -+ return ret; -+} -+ -+/* -+ * waking_non_zero_interruptible: -+ * 1 got the lock -+ * 0 go to sleep -+ * -EINTR interrupted -+ */ -+static inline int waking_non_zero_interruptible(struct semaphore *sem, -+ struct task_struct *tsk) -+{ -+ int ret; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&semaphore_wake_lock, flags); -+ ret = 0; -+ if (atomic_read(&sem->waking) > 0) { -+ atomic_dec(&sem->waking); -+ ret = 1; -+ } else if (signal_pending(tsk)) { -+ atomic_inc(&sem->count); -+ ret = -EINTR; -+ } -+ spin_unlock_irqrestore(&semaphore_wake_lock, flags); -+ return ret; -+} -+ -+/* -+ * waking_non_zero_trylock: -+ * 1 failed to lock -+ * 0 got the lock -+ */ -+static inline int waking_non_zero_trylock(struct semaphore *sem) -+{ -+ int ret; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&semaphore_wake_lock, flags); -+ ret = 1; -+ if (atomic_read(&sem->waking) > 0) { -+ atomic_dec(&sem->waking); -+ ret = 0; -+ } else -+ atomic_inc(&sem->count); -+ spin_unlock_irqrestore(&semaphore_wake_lock, flags); -+ return ret; -+} -+ -+#endif ---- linux/include/asm-nios2nommu/semaphore.h -+++ linux/include/asm-nios2nommu/semaphore.h -@@ -0,0 +1,155 @@ -+#ifndef _NIOS2NOMMU_SEMAPHORE_H -+#define _NIOS2NOMMU_SEMAPHORE_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/semaphore.h -+ * -+ * Interrupt-safe semaphores.. -+ * -+ * Derived from M68knommu -+ * -+ * (C) Copyright 1996 Linus Torvalds -+ * m68k version by Andreas Schwab -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+#define RW_LOCK_BIAS 0x01000000 -+ -+#ifndef __ASSEMBLY__ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+struct semaphore { -+ atomic_t count; -+ atomic_t waking; -+ wait_queue_head_t wait; -+}; -+ -+#define __SEMAPHORE_INITIALIZER(name, n) \ -+{ \ -+ .count = ATOMIC_INIT(n), \ -+ .waking = ATOMIC_INIT(0), \ -+ .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ -+} -+ -+#define __MUTEX_INITIALIZER(name) \ -+ __SEMAPHORE_INITIALIZER(name,1) -+ -+#define __DECLARE_SEMAPHORE_GENERIC(name,count) \ -+ struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) -+ -+#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) -+#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) -+ -+extern inline void sema_init (struct semaphore *sem, int val) -+{ -+ *sem = (struct semaphore)__SEMAPHORE_INITIALIZER(*sem, val); -+} -+ -+static inline void init_MUTEX (struct semaphore *sem) -+{ -+ sema_init(sem, 1); -+} -+ -+static inline void init_MUTEX_LOCKED (struct semaphore *sem) -+{ -+ sema_init(sem, 0); -+} -+ -+asmlinkage void __down(struct semaphore * sem); -+asmlinkage int __down_interruptible(struct semaphore * sem); -+asmlinkage int __down_trylock(struct semaphore * sem); -+asmlinkage void __up(struct semaphore * sem); -+ -+asmlinkage void __down_failed(void /* special register calling convention */); -+asmlinkage int __down_failed_interruptible(void /* params in registers */); -+asmlinkage int __down_failed_trylock(void /* params in registers */); -+asmlinkage void __up_wakeup(void /* special register calling convention */); -+ -+extern spinlock_t semaphore_wake_lock; -+ -+/* -+ * This is ugly, but we want the default case to fall through. -+ * "down_failed" is a special asm handler that calls the C -+ * routine that actually waits. -+ */ -+extern inline void down(struct semaphore * sem) -+{ -+ might_sleep(); -+ -+ #if 0 -+ ...Nios2 has no atomic "decrement memory".... -+ #else -+ if (atomic_dec_return(&sem->count) < 0) -+ __down(sem); -+ #endif -+} -+ -+extern inline int down_interruptible(struct semaphore * sem) -+{ -+ int ret = 0; -+ -+ -+ might_sleep(); -+ -+ #if 0 -+ ...Nios2 has no atomic "decrement memory".... -+ #else -+ if(atomic_dec_return(&sem->count) < 0) -+ ret = __down_interruptible(sem); -+ return ret; -+ #endif -+} -+ -+extern inline int down_trylock(struct semaphore * sem) -+{ -+ #if 0 -+ ...Nios2 has no atomic "decrement memory".... -+ #else -+ int ret = 0; -+ -+ if (atomic_dec_return (&sem->count) < 0) -+ ret = __down_trylock(sem); -+ return ret; -+ #endif -+} -+ -+/* -+ * Note! This is subtle. We jump to wake people up only if -+ * the semaphore was negative (== somebody was waiting on it). -+ * The default case (no contention) will result in NO -+ * jumps for both down() and up(). -+ */ -+extern inline void up(struct semaphore * sem) -+{ -+ #if 0 -+ ...Nios2 has no atomic "increment memory".... -+ #else -+ if (atomic_inc_return(&sem->count) <= 0) -+ __up(sem); -+ #endif -+} -+ -+#endif /* __ASSEMBLY__ */ -+ -+#endif ---- linux/include/asm-nios2nommu/sembuf.h -+++ linux/include/asm-nios2nommu/sembuf.h -@@ -0,0 +1,48 @@ -+#ifndef _NIOS_SEMBUF_H -+#define _NIOS_SEMBUF_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/sembuf.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* -+ * Note extra padding because this structure is passed back and forth -+ * between kernel and user space. -+ * -+ * Pad space is left for: -+ * - 64-bit time_t to solve y2038 problem -+ * - 2 miscellaneous 32-bit values -+ */ -+ -+struct semid64_ds { -+ struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ -+ __kernel_time_t sem_otime; /* last semop time */ -+ unsigned long __unused1; -+ __kernel_time_t sem_ctime; /* last change time */ -+ unsigned long __unused2; -+ unsigned long sem_nsems; /* no. of semaphores in array */ -+ unsigned long __unused3; -+ unsigned long __unused4; -+}; -+ -+#endif /* _NIOS_SEMBUF_H */ ---- linux/include/asm-nios2nommu/setup.h -+++ linux/include/asm-nios2nommu/setup.h -@@ -0,0 +1,31 @@ -+/* Copied from i386 port. -+ * Just a place holder. We don't want to have to test x86 before -+ * we include stuff -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2_SETUP_H -+#define _NIOS2_SETUP_H -+ -+#define COMMAND_LINE_SIZE 512 -+ -+#endif /* _NIOS2_SETUP_H */ ---- linux/include/asm-nios2nommu/shmbuf.h -+++ linux/include/asm-nios2nommu/shmbuf.h -@@ -0,0 +1,64 @@ -+#ifndef _NIOS_SHMBUF_H -+#define _NIOS_SHMBUF_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/shmbuf.h -+ * -+ * Derived from m68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* Note extra padding because this structure is passed back and forth -+ * between kernel and user space. -+ * -+ * Pad space is left for: -+ * - 64-bit time_t to solve y2038 problem -+ * - 2 miscellaneous 32-bit values -+ */ -+ -+struct shmid64_ds { -+ struct ipc64_perm shm_perm; /* operation perms */ -+ size_t shm_segsz; /* size of segment (bytes) */ -+ __kernel_time_t shm_atime; /* last attach time */ -+ unsigned long __unused1; -+ __kernel_time_t shm_dtime; /* last detach time */ -+ unsigned long __unused2; -+ __kernel_time_t shm_ctime; /* last change time */ -+ unsigned long __unused3; -+ __kernel_pid_t shm_cpid; /* pid of creator */ -+ __kernel_pid_t shm_lpid; /* pid of last operator */ -+ unsigned long shm_nattch; /* no. of current attaches */ -+ unsigned long __unused4; -+ unsigned long __unused5; -+}; -+ -+struct shminfo64 { -+ unsigned long shmmax; -+ unsigned long shmmin; -+ unsigned long shmmni; -+ unsigned long shmseg; -+ unsigned long shmall; -+ unsigned long __unused1; -+ unsigned long __unused2; -+ unsigned long __unused3; -+ unsigned long __unused4; -+}; -+ -+#endif /* _NIOS_SHMBUF_H */ ---- linux/include/asm-nios2nommu/shmparam.h -+++ linux/include/asm-nios2nommu/shmparam.h -@@ -0,0 +1,30 @@ -+#ifndef __NIOS2NOMMU_SHMPARAM_H__ -+#define __NIOS2NOMMU_SHMPARAM_H__ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/shmparam.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ -+ -+#endif /* __NIOS2NOMMU_SHMPARAM_H__ */ ---- linux/include/asm-nios2nommu/sigcontext.h -+++ linux/include/asm-nios2nommu/sigcontext.h -@@ -0,0 +1,35 @@ -+/* -+ * Taken from the m68knommu. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _ASM_NIOS2NOMMU_SIGCONTEXT_H -+#define _ASM_NIOS2NOMMU_SIGCONTEXT_H -+ -+#include -+ -+struct sigcontext { -+ struct pt_regs regs; -+ unsigned long sc_mask; /* old sigmask */ -+}; -+ -+#endif ---- linux/include/asm-nios2nommu/siginfo.h -+++ linux/include/asm-nios2nommu/siginfo.h -@@ -0,0 +1,28 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2NOMMU_SIGINFO_H -+#define _NIOS2NOMMU_SIGINFO_H -+ -+#include -+ -+#endif ---- linux/include/asm-nios2nommu/signal.h -+++ linux/include/asm-nios2nommu/signal.h -@@ -0,0 +1,207 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2_SIGNAL_H -+#define _NIOS2_SIGNAL_H -+ -+#include -+ -+/* Avoid too many header ordering problems. */ -+struct siginfo; -+ -+#ifdef __KERNEL__ -+/* Most things should be clean enough to redefine this at will, if care -+ is taken to make libc match. */ -+ -+#define _NSIG 64 -+#define _NSIG_BPW 32 -+#define _NSIG_WORDS (_NSIG / _NSIG_BPW) -+ -+typedef unsigned long old_sigset_t; /* at least 32 bits */ -+ -+typedef struct { -+ unsigned long sig[_NSIG_WORDS]; -+} sigset_t; -+ -+#else -+/* Here we must cater to libcs that poke about in kernel headers. */ -+ -+#define NSIG 32 -+typedef unsigned long sigset_t; -+ -+#endif /* __KERNEL__ */ -+ -+#define SIGHUP 1 -+#define SIGINT 2 -+#define SIGQUIT 3 -+#define SIGILL 4 -+#define SIGTRAP 5 -+#define SIGABRT 6 -+#define SIGIOT 6 -+#define SIGBUS 7 -+#define SIGFPE 8 -+#define SIGKILL 9 -+#define SIGUSR1 10 -+#define SIGSEGV 11 -+#define SIGUSR2 12 -+#define SIGPIPE 13 -+#define SIGALRM 14 -+#define SIGTERM 15 -+#define SIGSTKFLT 16 -+#define SIGCHLD 17 -+#define SIGCONT 18 -+#define SIGSTOP 19 -+#define SIGTSTP 20 -+#define SIGTTIN 21 -+#define SIGTTOU 22 -+#define SIGURG 23 -+#define SIGXCPU 24 -+#define SIGXFSZ 25 -+#define SIGVTALRM 26 -+#define SIGPROF 27 -+#define SIGWINCH 28 -+#define SIGIO 29 -+#define SIGPOLL SIGIO -+/* -+#define SIGLOST 29 -+*/ -+#define SIGPWR 30 -+#define SIGSYS 31 -+#define SIGUNUSED 31 -+ -+/* These should not be considered constants from userland. */ -+#define SIGRTMIN 32 -+#define SIGRTMAX _NSIG-1 -+ -+/* -+ * SA_FLAGS values: -+ * -+ * SA_ONSTACK indicates that a registered stack_t will be used. -+ * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the -+ * SA_RESTART flag to get restarting signals (which were the default long ago) -+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. -+ * SA_RESETHAND clears the handler when the signal is delivered. -+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. -+ * SA_NODEFER prevents the current signal from being masked in the handler. -+ * -+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single -+ * Unix names RESETHAND and NODEFER respectively. -+ */ -+#define SA_NOCLDSTOP 0x00000001 -+#define SA_NOCLDWAIT 0x00000002 /* not supported yet */ -+#define SA_SIGINFO 0x00000004 -+#define SA_ONSTACK 0x08000000 -+#define SA_RESTART 0x10000000 -+#define SA_NODEFER 0x40000000 -+#define SA_RESETHAND 0x80000000 -+ -+#define SA_NOMASK SA_NODEFER -+#define SA_ONESHOT SA_RESETHAND -+#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ -+ -+#define SA_RESTORER 0x04000000 -+ -+/* -+ * sigaltstack controls -+ */ -+#define SS_ONSTACK 1 -+#define SS_DISABLE 2 -+ -+#define MINSIGSTKSZ 2048 -+#define SIGSTKSZ 8192 -+ -+#ifdef __KERNEL__ -+/* -+ * These values of sa_flags are used only by the kernel as part of the -+ * irq handling routines. -+ * -+ * SA_INTERRUPT is also used by the irq handling routines. -+ * SA_SHIRQ is for shared interrupt support on PCI and EISA. -+ */ -+#define SA_PROBE SA_ONESHOT -+#define SA_SAMPLE_RANDOM SA_RESTART -+#define SA_SHIRQ 0x04000000 -+#endif -+ -+#define SIG_BLOCK 0 /* for blocking signals */ -+#define SIG_UNBLOCK 1 /* for unblocking signals */ -+#define SIG_SETMASK 2 /* for setting the signal mask */ -+ -+/* Type of a signal handler. */ -+typedef void (*__sighandler_t)(int); -+ -+#define SIG_DFL ((__sighandler_t)0) /* default signal handling */ -+#define SIG_IGN ((__sighandler_t)1) /* ignore signal */ -+#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */ -+ -+#ifdef __KERNEL__ -+struct old_sigaction { -+ __sighandler_t sa_handler; -+ old_sigset_t sa_mask; -+ unsigned long sa_flags; -+ void (*sa_restorer)(void); -+}; -+ -+struct sigaction { -+ __sighandler_t sa_handler; -+ unsigned long sa_flags; -+ void (*sa_restorer)(void); -+ sigset_t sa_mask; /* mask last for extensibility */ -+}; -+ -+struct k_sigaction { -+ struct sigaction sa; -+}; -+#else -+/* Here we must cater to libcs that poke about in kernel headers. */ -+ -+struct sigaction { -+ union { -+ __sighandler_t _sa_handler; -+ void (*_sa_sigaction)(int, struct siginfo *, void *); -+ } _u; -+ sigset_t sa_mask; -+ unsigned long sa_flags; -+ void (*sa_restorer)(void); -+}; -+ -+#define sa_handler _u._sa_handler -+#define sa_sigaction _u._sa_sigaction -+ -+#endif /* __KERNEL__ */ -+ -+typedef struct sigaltstack { -+ void *ss_sp; -+ int ss_flags; -+ size_t ss_size; -+} stack_t; -+ -+#ifdef __KERNEL__ -+ -+#include -+#undef __HAVE_ARCH_SIG_BITOPS -+ -+#define ptrace_signal_deliver(regs, cookie) do { } while (0) -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _NIOS2_SIGNAL_H */ ---- linux/include/asm-nios2nommu/smp.h -+++ linux/include/asm-nios2nommu/smp.h -@@ -0,0 +1,34 @@ -+#ifndef __ASM_SMP_H -+#define __ASM_SMP_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/smp.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+// #include -+ -+#ifdef CONFIG_SMP -+#error SMP not supported -+#endif -+ -+#endif ---- linux/include/asm-nios2nommu/socket.h -+++ linux/include/asm-nios2nommu/socket.h -@@ -0,0 +1,74 @@ -+#ifndef _ASM_SOCKET_H -+#define _ASM_SOCKET_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/socket.h -+ * -+ * Derived from m68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+/* For setsockopt(2) */ -+#define SOL_SOCKET 1 -+ -+#define SO_DEBUG 1 -+#define SO_REUSEADDR 2 -+#define SO_TYPE 3 -+#define SO_ERROR 4 -+#define SO_DONTROUTE 5 -+#define SO_BROADCAST 6 -+#define SO_SNDBUF 7 -+#define SO_RCVBUF 8 -+#define SO_KEEPALIVE 9 -+#define SO_OOBINLINE 10 -+#define SO_NO_CHECK 11 -+#define SO_PRIORITY 12 -+#define SO_LINGER 13 -+#define SO_BSDCOMPAT 14 -+/* To add :#define SO_REUSEPORT 15 */ -+#define SO_PASSCRED 16 -+#define SO_PEERCRED 17 -+#define SO_RCVLOWAT 18 -+#define SO_SNDLOWAT 19 -+#define SO_RCVTIMEO 20 -+#define SO_SNDTIMEO 21 -+ -+/* Security levels - as per NRL IPv6 - don't actually do anything */ -+#define SO_SECURITY_AUTHENTICATION 22 -+#define SO_SECURITY_ENCRYPTION_TRANSPORT 23 -+#define SO_SECURITY_ENCRYPTION_NETWORK 24 -+ -+#define SO_BINDTODEVICE 25 -+ -+/* Socket filtering */ -+#define SO_ATTACH_FILTER 26 -+#define SO_DETACH_FILTER 27 -+ -+#define SO_PEERNAME 28 -+#define SO_TIMESTAMP 29 -+#define SCM_TIMESTAMP SO_TIMESTAMP -+ -+#define SO_ACCEPTCONN 30 -+ -+#define SO_PEERSEC 31 /* ;dgt2;tmp; */ -+ -+#endif /* _ASM_SOCKET_H */ ---- linux/include/asm-nios2nommu/sockios.h -+++ linux/include/asm-nios2nommu/sockios.h -@@ -0,0 +1,38 @@ -+#ifndef _ASM_NIOS_SOCKIOS_H -+#define _ASM_NIOS_SOCKIOS_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/sockios.h -+ * -+ * Socket-level I/O control calls. -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#define FIOSETOWN 0x8901 -+#define SIOCSPGRP 0x8902 -+#define FIOGETOWN 0x8903 -+#define SIOCGPGRP 0x8904 -+#define SIOCATMARK 0x8905 -+#define SIOCGSTAMP 0x8906 /* Get stamp */ -+ -+#endif /* !(_ASM_NIOS_SOCKIOS_H) */ -+ ---- linux/include/asm-nios2nommu/spi.h -+++ linux/include/asm-nios2nommu/spi.h -@@ -0,0 +1,92 @@ -+#ifndef _ASM_SPI_H_ -+#define _ASM_SPI_H_ 1 -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/spi.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+int register_NIOS_SPI( void ); -+void unregister_NIOS_SPI( void ); -+ -+#if defined(MODULE) -+void cleanup_module( void ); -+int init_module( void ); -+#endif -+ -+#if defined(__KERNEL__) -+int spi_reset ( void ); -+#endif -+ -+ -+#define clockCS 0x01 -+#define temperatureCS 0x02 -+ -+#define clock_read_base 0x00 -+#define clock_write_base 0x80 -+#define clock_read_control 0x0F -+#define clock_read_trickle 0x11 -+ -+#define clock_read_sec 0x00 -+#define clock_read_min 0x01 -+#define clock_read_hour 0x02 -+#define clock_read_day 0x03 -+#define clock_read_date 0x04 -+#define clock_read_month 0x05 -+#define clock_read_year 0x06 -+ -+#define clock_write_control 0x8F -+#define clock_write_trickle 0x91 -+#define clock_write_sec 0x80 -+#define clock_write_min 0x81 -+#define clock_write_hour 0x82 -+#define clock_write_day 0x83 -+#define clock_write_date 0x84 -+#define clock_write_month 0x85 -+#define clock_write_year 0x86 -+ -+#define clock_write_ram_start 0xA0 -+#define clock_write_ram_end 0x100 -+#define clock_read_ram_start 0x20 -+#define clock_read_ram_end 0x80 -+ -+ -+#define clock_sec_def 0x11 -+#define clock_min_def 0x59 -+#define clock_hour_def 0x71 -+#define clock_day_def 0x00 -+#define clock_date_def 0x20 -+#define clock_month_def 0x12 -+#define clock_year_def 0x34 -+ -+#define temp_read_base 0x00 -+#define temp_write_base 0x80 -+#define temp_read_control 0x00 -+#define temp_write_control 0x80 -+#define temp_read_msb 0x02 -+#define temp_read_lsb 0x01 -+ -+#define MAX_TEMP_VAR 10 -+ -+#endif /*_ASM_SPI_H_*/ ---- linux/include/asm-nios2nommu/spinlock.h -+++ linux/include/asm-nios2nommu/spinlock.h -@@ -0,0 +1,30 @@ -+#ifndef __NIOS_SPINLOCK_H -+#define __NIOS_SPINLOCK_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/spinlock.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#error "Nios doesn't do SMP yet" -+ -+#endif ---- linux/include/asm-nios2nommu/stat.h -+++ linux/include/asm-nios2nommu/stat.h -@@ -0,0 +1,102 @@ -+#ifndef _ASMNIOS2NOMMU_STAT_H -+#define _ASMNIOS2NOMMU_STAT_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/stat.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+struct __old_kernel_stat { -+ unsigned short st_dev; -+ unsigned short st_ino; -+ unsigned short st_mode; -+ unsigned short st_nlink; -+ unsigned short st_uid; -+ unsigned short st_gid; -+ unsigned short st_rdev; -+ unsigned long st_size; -+ unsigned long st_atime; -+ unsigned long st_mtime; -+ unsigned long st_ctime; -+}; -+ -+struct stat { -+ unsigned short st_dev; -+ unsigned short __pad1; -+ unsigned long st_ino; -+ unsigned short st_mode; -+ unsigned short st_nlink; -+ unsigned short st_uid; -+ unsigned short st_gid; -+ unsigned short st_rdev; -+ unsigned short __pad2; -+ unsigned long st_size; -+ unsigned long st_blksize; -+ unsigned long st_blocks; -+ unsigned long st_atime; -+ unsigned long __unused1; -+ unsigned long st_mtime; -+ unsigned long __unused2; -+ unsigned long st_ctime; -+ unsigned long __unused3; -+ unsigned long __unused4; -+ unsigned long __unused5; -+}; -+ -+/* This matches struct stat64 in glibc2.1, hence the absolutely -+ * insane amounts of padding around dev_t's. -+ */ -+struct stat64 { -+ unsigned long long st_dev; -+ unsigned char __pad1[4]; -+ -+#define STAT64_HAS_BROKEN_ST_INO 1 -+ unsigned long __st_ino; -+ -+ unsigned int st_mode; -+ unsigned int st_nlink; -+ -+ unsigned long st_uid; -+ unsigned long st_gid; -+ -+ unsigned long long st_rdev; -+ unsigned char __pad3[4]; -+ -+ long long st_size; -+ unsigned long st_blksize; -+ -+ unsigned long __pad4; /* future possible st_blocks high bits */ -+ unsigned long st_blocks; /* Number 512-byte blocks allocated. */ -+ -+ unsigned long st_atime; -+ unsigned long st_atime_nsec; -+ -+ unsigned long st_mtime; -+ unsigned long st_mtime_nsec; -+ -+ unsigned long st_ctime; -+ unsigned long st_ctime_nsec; -+ -+ unsigned long long st_ino; -+}; -+ -+#endif ---- linux/include/asm-nios2nommu/statfs.h -+++ linux/include/asm-nios2nommu/statfs.h -@@ -0,0 +1,30 @@ -+#ifndef _NIOS2NOMMU_STATFS_H -+#define _NIOS2NOMMU_STATFS_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/statfs.h -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#endif /* _NIOS2NOMMU_STATFS_H */ ---- linux/include/asm-nios2nommu/string.h -+++ linux/include/asm-nios2nommu/string.h -@@ -0,0 +1,45 @@ -+#ifndef __NIOS_STRING_H__ -+#define __NIOS_STRING_H__ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/string.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#ifdef __KERNEL__ /* only set these up for kernel code */ -+ -+#define __HAVE_ARCH_MEMMOVE -+void * memmove(void * d, const void * s, size_t count); -+#define __HAVE_ARCH_MEMCPY -+extern void * memcpy(void *d, const void *s, size_t count); -+#define __HAVE_ARCH_MEMSET -+extern void * memset(void * s,int c,size_t count); -+ -+#if 0 -+#define __HAVE_ARCH_BCOPY -+#define __HAVE_ARCH_STRLEN -+#endif -+ -+#endif /* KERNEL */ -+ -+#endif /* !(__NIOS_STRING_H__) */ ---- linux/include/asm-nios2nommu/system.h -+++ linux/include/asm-nios2nommu/system.h -@@ -0,0 +1,172 @@ -+/* -+ * Taken from the m68k. -+ * -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _NIOS2NOMMU_SYSTEM_H -+#define _NIOS2NOMMU_SYSTEM_H -+ -+// #include /* get configuration macros */ -+#include -+#include -+#include -+#include -+ -+/* -+ * switch_to(n) should switch tasks to task ptr, first checking that -+ * ptr isn't the current task, in which case it does nothing. This -+ * also clears the TS-flag if the task we switched to has used the -+ * math co-processor latest. -+ */ -+ -+/* -+ */ -+asmlinkage void resume(void); -+#define switch_to(prev,next,last) \ -+{ \ -+ void *_last; \ -+ __asm__ __volatile__( \ -+ "mov r4, %1\n" \ -+ "mov r5, %2\n" \ -+ "call resume\n" \ -+ "mov %0,r4\n" \ -+ : "=r" (_last) \ -+ : "r" (prev), "r" (next) \ -+ : "r4","r5","r7","r8","ra"); \ -+ (last) = _last; \ -+} -+ -+#define local_irq_enable() __asm__ __volatile__ ( \ -+ "rdctl r8, status\n" \ -+ "ori r8, r8, 1\n" \ -+ "wrctl status, r8\n" \ -+ : : : "r8") -+ -+#define local_irq_disable() __asm__ __volatile__ ( \ -+ "rdctl r8, status\n" \ -+ "andi r8, r8, 0xfffe\n" \ -+ "wrctl status, r8\n" \ -+ : : : "r8") -+ -+#define local_save_flags(x) __asm__ __volatile__ ( \ -+ "rdctl r8, status\n" \ -+ "mov %0, r8\n" \ -+ :"=r" (x) : : "r8", "memory") -+ -+#define local_irq_restore(x) __asm__ __volatile__ ( \ -+ "mov r8, %0\n" \ -+ "wrctl status, r8\n" \ -+ : :"r" (x) : "memory") -+ -+/* For spinlocks etc */ -+#define local_irq_save(x) do { local_save_flags(x); local_irq_disable(); } while (0) -+ -+#define irqs_disabled() \ -+({ \ -+ unsigned long flags; \ -+ local_save_flags(flags); \ -+ ((flags & NIOS2_STATUS_PIE_MSK) == 0x0); \ -+}) -+ -+#define iret() __asm__ __volatile__ ("eret": : :"memory", "ea") -+ -+/* -+ * Force strict CPU ordering. -+ * Not really required on m68k... -+ */ -+#define nop() asm volatile ("nop"::) -+#define mb() asm volatile ("" : : :"memory") -+#define rmb() asm volatile ("" : : :"memory") -+#define wmb() asm volatile ("" : : :"memory") -+#define set_rmb(var, value) do { xchg(&var, value); } while (0) -+#define set_mb(var, value) set_rmb(var, value) -+#define set_wmb(var, value) do { var = value; wmb(); } while (0) -+ -+#ifdef CONFIG_SMP -+#define smp_mb() mb() -+#define smp_rmb() rmb() -+#define smp_wmb() wmb() -+#define smp_read_barrier_depends() read_barrier_depends() -+#else -+#define smp_mb() barrier() -+#define smp_rmb() barrier() -+#define smp_wmb() barrier() -+#define smp_read_barrier_depends() do { } while(0) -+#endif -+ -+#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -+#define tas(ptr) (xchg((ptr),1)) -+ -+struct __xchg_dummy { unsigned long a[100]; }; -+#define __xg(x) ((volatile struct __xchg_dummy *)(x)) -+ -+static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) -+{ -+ unsigned long tmp, flags; -+ -+ local_irq_save(flags); -+ -+ switch (size) { -+ case 1: -+ __asm__ __volatile__( \ -+ "ldb %0, %2\n" \ -+ "stb %1, %2\n" \ -+ : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory"); -+ break; -+ case 2: -+ __asm__ __volatile__( \ -+ "ldh %0, %2\n" \ -+ "sth %1, %2\n" \ -+ : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory"); -+ break; -+ case 4: -+ __asm__ __volatile__( \ -+ "ldw %0, %2\n" \ -+ "stw %1, %2\n" \ -+ : "=&r" (tmp) : "r" (x), "m" (*__xg(ptr)) : "memory"); -+ break; -+ } -+ local_irq_restore(flags); -+ return tmp; -+} -+ -+/* -+ * Atomic compare and exchange. Compare OLD with MEM, if identical, -+ * store NEW in MEM. Return the initial value in MEM. Success is -+ * indicated by comparing RETURN with OLD. -+ */ -+#define __HAVE_ARCH_CMPXCHG 1 -+ -+static __inline__ unsigned long -+cmpxchg(volatile int *p, int old, int new) -+{ -+ unsigned long flags; -+ int prev; -+ -+ local_irq_save(flags); -+ if ((prev = *p) == old) -+ *p = new; -+ local_irq_restore(flags); -+ return(prev); -+} -+ -+#endif /* _NIOS2NOMMU_SYSTEM_H */ ---- linux/include/asm-nios2nommu/termbits.h -+++ linux/include/asm-nios2nommu/termbits.h -@@ -0,0 +1,199 @@ -+#ifndef __ARCH_NIOS_TERMBITS_H__ -+#define __ARCH_NIOS_TERMBITS_H__ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/termbits.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+typedef unsigned char cc_t; -+typedef unsigned int speed_t; -+typedef unsigned int tcflag_t; -+ -+#define NCCS 19 -+struct termios { -+ tcflag_t c_iflag; /* input mode flags */ -+ tcflag_t c_oflag; /* output mode flags */ -+ tcflag_t c_cflag; /* control mode flags */ -+ tcflag_t c_lflag; /* local mode flags */ -+ cc_t c_line; /* line discipline */ -+ cc_t c_cc[NCCS]; /* control characters */ -+}; -+ -+/* c_cc characters */ -+#define VINTR 0 -+#define VQUIT 1 -+#define VERASE 2 -+#define VKILL 3 -+#define VEOF 4 -+#define VTIME 5 -+#define VMIN 6 -+#define VSWTC 7 -+#define VSTART 8 -+#define VSTOP 9 -+#define VSUSP 10 -+#define VEOL 11 -+#define VREPRINT 12 -+#define VDISCARD 13 -+#define VWERASE 14 -+#define VLNEXT 15 -+#define VEOL2 16 -+ -+ -+/* c_iflag bits */ -+#define IGNBRK 0000001 -+#define BRKINT 0000002 -+#define IGNPAR 0000004 -+#define PARMRK 0000010 -+#define INPCK 0000020 -+#define ISTRIP 0000040 -+#define INLCR 0000100 -+#define IGNCR 0000200 -+#define ICRNL 0000400 -+#define IUCLC 0001000 -+#define IXON 0002000 -+#define IXANY 0004000 -+#define IXOFF 0010000 -+#define IMAXBEL 0020000 -+#define IUTF8 0040000 -+ -+/* c_oflag bits */ -+#define OPOST 0000001 -+#define OLCUC 0000002 -+#define ONLCR 0000004 -+#define OCRNL 0000010 -+#define ONOCR 0000020 -+#define ONLRET 0000040 -+#define OFILL 0000100 -+#define OFDEL 0000200 -+#define NLDLY 0000400 -+#define NL0 0000000 -+#define NL1 0000400 -+#define CRDLY 0003000 -+#define CR0 0000000 -+#define CR1 0001000 -+#define CR2 0002000 -+#define CR3 0003000 -+#define TABDLY 0014000 -+#define TAB0 0000000 -+#define TAB1 0004000 -+#define TAB2 0010000 -+#define TAB3 0014000 -+#define XTABS 0014000 -+#define BSDLY 0020000 -+#define BS0 0000000 -+#define BS1 0020000 -+#define VTDLY 0040000 -+#define VT0 0000000 -+#define VT1 0040000 -+#define FFDLY 0100000 -+#define FF0 0000000 -+#define FF1 0100000 -+ -+/* c_cflag bit meaning */ -+#define CBAUD 0010017 -+#define B0 0000000 /* hang up */ -+#define B50 0000001 -+#define B75 0000002 -+#define B110 0000003 -+#define B134 0000004 -+#define B150 0000005 -+#define B200 0000006 -+#define B300 0000007 -+#define B600 0000010 -+#define B1200 0000011 -+#define B1800 0000012 -+#define B2400 0000013 -+#define B4800 0000014 -+#define B9600 0000015 -+#define B19200 0000016 -+#define B38400 0000017 -+#define EXTA B19200 -+#define EXTB B38400 -+#define CSIZE 0000060 -+#define CS5 0000000 -+#define CS6 0000020 -+#define CS7 0000040 -+#define CS8 0000060 -+#define CSTOPB 0000100 -+#define CREAD 0000200 -+#define PARENB 0000400 -+#define PARODD 0001000 -+#define HUPCL 0002000 -+#define CLOCAL 0004000 -+#define CBAUDEX 0010000 -+#define B57600 0010001 -+#define B115200 0010002 -+#define B230400 0010003 -+#define B460800 0010004 -+#define B500000 0010005 -+#define B576000 0010006 -+#define B921600 0010007 -+#define B1000000 0010010 -+#define B1152000 0010011 -+#define B1500000 0010012 -+#define B2000000 0010013 -+#define B2500000 0010014 -+#define B3000000 0010015 -+#define B3500000 0010016 -+#define B4000000 0010017 -+#define CIBAUD 002003600000 /* input baud rate (not used) */ -+#define CMSPAR 010000000000 /* mark or space (stick) parity */ -+#define CRTSCTS 020000000000 /* flow control */ -+ -+/* c_lflag bits */ -+#define ISIG 0000001 -+#define ICANON 0000002 -+#define XCASE 0000004 -+#define ECHO 0000010 -+#define ECHOE 0000020 -+#define ECHOK 0000040 -+#define ECHONL 0000100 -+#define NOFLSH 0000200 -+#define TOSTOP 0000400 -+#define ECHOCTL 0001000 -+#define ECHOPRT 0002000 -+#define ECHOKE 0004000 -+#define FLUSHO 0010000 -+#define PENDIN 0040000 -+#define IEXTEN 0100000 -+ -+ -+/* tcflow() and TCXONC use these */ -+#define TCOOFF 0 -+#define TCOON 1 -+#define TCIOFF 2 -+#define TCION 3 -+ -+/* tcflush() and TCFLSH use these */ -+#define TCIFLUSH 0 -+#define TCOFLUSH 1 -+#define TCIOFLUSH 2 -+ -+/* tcsetattr uses these */ -+#define TCSANOW 0 -+#define TCSADRAIN 1 -+#define TCSAFLUSH 2 -+ -+#endif /* __ARCH_NIOS_TERMBITS_H__ */ ---- linux/include/asm-nios2nommu/termios.h -+++ linux/include/asm-nios2nommu/termios.h -@@ -0,0 +1,132 @@ -+#ifndef _NIOS_TERMIOS_H -+#define _NIOS_TERMIOS_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/termios.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+#include -+ -+struct winsize { -+ unsigned short ws_row; -+ unsigned short ws_col; -+ unsigned short ws_xpixel; -+ unsigned short ws_ypixel; -+}; -+ -+#define NCC 8 -+struct termio { -+ unsigned short c_iflag; /* input mode flags */ -+ unsigned short c_oflag; /* output mode flags */ -+ unsigned short c_cflag; /* control mode flags */ -+ unsigned short c_lflag; /* local mode flags */ -+ unsigned char c_line; /* line discipline */ -+ unsigned char c_cc[NCC]; /* control characters */ -+}; -+ -+#ifdef __KERNEL__ -+/* intr=^C quit=^| erase=del kill=^U -+ eof=^D vtime=\0 vmin=\1 sxtc=\0 -+ start=^Q stop=^S susp=^Z eol=\0 -+ reprint=^R discard=^U werase=^W lnext=^V -+ eol2=\0 -+*/ -+#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" -+#endif -+ -+/* modem lines */ -+#define TIOCM_LE 0x001 -+#define TIOCM_DTR 0x002 -+#define TIOCM_RTS 0x004 -+#define TIOCM_ST 0x008 -+#define TIOCM_SR 0x010 -+#define TIOCM_CTS 0x020 -+#define TIOCM_CAR 0x040 -+#define TIOCM_RNG 0x080 -+#define TIOCM_DSR 0x100 -+#define TIOCM_CD TIOCM_CAR -+#define TIOCM_RI TIOCM_RNG -+#define TIOCM_OUT1 0x2000 -+#define TIOCM_OUT2 0x4000 -+#define TIOCM_LOOP 0x8000 -+ -+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ -+ -+/* line disciplines */ -+#define N_TTY 0 -+#define N_SLIP 1 -+#define N_MOUSE 2 -+#define N_PPP 3 -+#define N_STRIP 4 -+#define N_AX25 5 -+#define N_X25 6 /* X.25 async */ -+#define N_6PACK 7 -+#define N_MASC 8 /* Reserved for Mobitex module */ -+#define N_R3964 9 /* Reserved for Simatic R3964 module */ -+#define N_PROFIBUS_FDL 10 /* Reserved for Profibus */ -+#define N_IRDA 11 /* Linux IrDa - http://irda.sourceforge.net/ */ -+#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */ -+#define N_HDLC 13 /* synchronous HDLC */ -+#define N_SYNC_PPP 14 -+#define N_HCI 15 /* Bluetooth HCI UART */ -+ -+#ifdef __KERNEL__ -+ -+/* -+ * Translate a "termio" structure into a "termios". Ugh. -+ */ -+#define user_termio_to_kernel_termios(termios, termio) \ -+({ \ -+ unsigned short tmp; \ -+ get_user(tmp, &(termio)->c_iflag); \ -+ (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ -+ get_user(tmp, &(termio)->c_oflag); \ -+ (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ -+ get_user(tmp, &(termio)->c_cflag); \ -+ (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ -+ get_user(tmp, &(termio)->c_lflag); \ -+ (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ -+ get_user((termios)->c_line, &(termio)->c_line); \ -+ copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ -+}) -+ -+/* -+ * Translate a "termios" structure into a "termio". Ugh. -+ */ -+#define kernel_termios_to_user_termio(termio, termios) \ -+({ \ -+ put_user((termios)->c_iflag, &(termio)->c_iflag); \ -+ put_user((termios)->c_oflag, &(termio)->c_oflag); \ -+ put_user((termios)->c_cflag, &(termio)->c_cflag); \ -+ put_user((termios)->c_lflag, &(termio)->c_lflag); \ -+ put_user((termios)->c_line, &(termio)->c_line); \ -+ copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ -+}) -+ -+#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) -+#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _NIOS_TERMIOS_H */ ---- linux/include/asm-nios2nommu/thread_info.h -+++ linux/include/asm-nios2nommu/thread_info.h -@@ -0,0 +1,126 @@ -+/* thread_info.h: niosnommu low-level thread information -+ * adapted from the m68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd. -+ * Copyright (C) 2002 Microtronix Datacom -+ * -+ * - Incorporating suggestions made by Linus Torvalds and Dave Miller -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+ -+#ifndef _ASM_THREAD_INFO_H -+#define _ASM_THREAD_INFO_H -+ -+#include -+ -+#ifdef __KERNEL__ -+ -+#ifndef __ASSEMBLY__ -+ -+/* -+ * low level task data. -+ */ -+struct thread_info { -+ struct task_struct *task; /* main task structure */ -+ struct exec_domain *exec_domain; /* execution domain */ -+ unsigned long flags; /* low level flags */ -+ int cpu; /* cpu we're on */ -+ int preempt_count; /* 0 => preemptable, <0 => BUG*/ -+ struct restart_block restart_block; -+}; -+ -+/* -+ * macros/functions for gaining access to the thread information structure -+ */ -+#define INIT_THREAD_INFO(tsk) \ -+{ \ -+ .task = &tsk, \ -+ .exec_domain = &default_exec_domain, \ -+ .flags = 0, \ -+ .cpu = 0, \ -+ .preempt_count = 1, \ -+ .restart_block = { \ -+ .fn = do_no_restart_syscall, \ -+ }, \ -+} -+ -+#define init_thread_info (init_thread_union.thread_info) -+#define init_stack (init_thread_union.stack) -+ -+ -+/* how to get the thread information struct from C -+ usable only in supervisor mode */ -+static inline struct thread_info *current_thread_info(void) -+{ -+ struct thread_info *ti; -+ __asm__ __volatile__( -+ "mov %0, sp\n" -+ "and %0, %0, %1\n" -+ : "=&r"(ti) -+ : "r" (~(THREAD_SIZE-1)) -+ ); -+ return ti; -+} -+ -+/* thread information allocation */ -+#define alloc_thread_info(tsk) ((struct thread_info *) \ -+ __get_free_pages(GFP_KERNEL, 1)) -+#define free_thread_info(ti) free_pages((unsigned long) (ti), 1) -+#define put_thread_info(ti) put_task_struct((ti)->task) -+ -+#define PREEMPT_ACTIVE 0x4000000 -+ -+/* -+ * thread information flag bit numbers -+ */ -+#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ -+#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ -+#define TIF_SIGPENDING 2 /* signal pending */ -+#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ -+#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling -+ TIF_NEED_RESCHED */ -+ -+/* as above, but as bit values */ -+#define _TIF_SYSCALL_TRACE (1< -+ -+ -+#define CLOCK_TICK_RATE nasys_clock_freq /* Underlying HZ */ -+ -+#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ -+ -+#define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \ -+ (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \ -+ << (SHIFT_SCALE-SHIFT_HZ)) / HZ) -+ -+typedef unsigned long cycles_t; -+ -+static inline cycles_t get_cycles(void) -+{ -+ return 0; -+} -+ -+#endif ---- linux/include/asm-nios2nommu/tlb.h -+++ linux/include/asm-nios2nommu/tlb.h -@@ -0,0 +1,35 @@ -+#ifndef __NIOS_TLB_H__ -+#define __NIOS_TLB_H__ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/tlb.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2003 Microtronix Datacom Ltd -+ * Copyright (C) 2002 NEC Corporation -+ * Copyright (C) 2002 Miles Bader -+ * -+ * 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. -+ * -+ * -+ * Written by Miles Bader -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+#define tlb_flush(tlb) ((void)0) -+ -+#include -+ -+#endif /* __NIOS_TLB_H__ */ -+ ---- linux/include/asm-nios2nommu/tlbflush.h -+++ linux/include/asm-nios2nommu/tlbflush.h -@@ -0,0 +1,86 @@ -+#ifndef _NIOS2NOMMU_TLBFLUSH_H -+#define _NIOS2NOMMU_TLBFLUSH_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/tlbflush.h -+ * -+ * Ported from m68knommu. -+ * -+ * Copyright (C) 2003 Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+#include -+ -+/* -+ * flush all user-space atc entries. -+ */ -+static inline void __flush_tlb(void) -+{ -+ BUG(); -+} -+ -+static inline void __flush_tlb_one(unsigned long addr) -+{ -+ BUG(); -+} -+ -+#define flush_tlb() __flush_tlb() -+ -+/* -+ * flush all atc entries (both kernel and user-space entries). -+ */ -+static inline void flush_tlb_all(void) -+{ -+ BUG(); -+} -+ -+static inline void flush_tlb_mm(struct mm_struct *mm) -+{ -+ BUG(); -+} -+ -+static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr) -+{ -+ BUG(); -+} -+ -+static inline void flush_tlb_range(struct mm_struct *mm, -+ unsigned long start, unsigned long end) -+{ -+ BUG(); -+} -+ -+extern inline void flush_tlb_kernel_page(unsigned long addr) -+{ -+ BUG(); -+} -+ -+extern inline void flush_tlb_pgtables(struct mm_struct *mm, -+ unsigned long start, unsigned long end) -+{ -+ BUG(); -+} -+ -+#endif /* _NIOS2NOMMU_TLBFLUSH_H */ ---- linux/include/asm-nios2nommu/topology.h -+++ linux/include/asm-nios2nommu/topology.h -@@ -0,0 +1,30 @@ -+#ifndef _ASM_NIOS2NOMMU_TOPOLOGY_H -+#define _ASM_NIOS2NOMMU_TOPOLOGY_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/topology.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+#endif /* _ASM_NIOS2NOMMU_TOPOLOGY_H */ ---- linux/include/asm-nios2nommu/traps.h -+++ linux/include/asm-nios2nommu/traps.h -@@ -0,0 +1,27 @@ -+/* -+ * Copyright (C) 2004, Microtronix Datacom Ltd. -+ * -+ * All rights reserved. -+ * -+ * 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, GOOD TITLE or -+ * NON INFRINGEMENT. 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., 675 Mass Ave, Cambridge, MA 02139, USA. -+ * -+ */ -+#ifndef _NIOS2_TRAPS_H -+#define _NIOS2_TRAPS_H -+ -+#define TRAP_ID_SYSCALL 0 -+#define TRAP_ID_APPDEBUG 1 -+#endif /* !(_NIOS2_TRAPS_H) */ ---- linux/include/asm-nios2nommu/types.h -+++ linux/include/asm-nios2nommu/types.h -@@ -0,0 +1,93 @@ -+#ifndef _NIOS_TYPES_H -+#define _NIOS_TYPES_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/types.h -+ * -+ * Derived from m68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* -+ * This file is never included by application software unless -+ * explicitly requested (e.g., via linux/types.h) in which case the -+ * application is Linux specific so (user-) name space pollution is -+ * not a major issue. However, for interoperability, libraries still -+ * need to be careful to avoid a name clashes. -+ */ -+ -+#ifndef __ASSEMBLY__ -+ -+typedef unsigned short umode_t; -+ -+/* -+ * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the -+ * header files exported to user space -+ */ -+ -+typedef __signed__ char __s8; -+typedef unsigned char __u8; -+ -+typedef __signed__ short __s16; -+typedef unsigned short __u16; -+ -+typedef __signed__ int __s32; -+typedef unsigned int __u32; -+ -+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) -+typedef __signed__ long long __s64; -+typedef unsigned long long __u64; -+#endif -+ -+#endif /* __ASSEMBLY__ */ -+ -+/* -+ * These aren't exported outside the kernel to avoid name space clashes -+ */ -+#ifdef __KERNEL__ -+ -+#define BITS_PER_LONG 32 -+ -+#ifndef __ASSEMBLY__ -+ -+typedef signed char s8; -+typedef unsigned char u8; -+ -+typedef signed short s16; -+typedef unsigned short u16; -+ -+typedef signed int s32; -+typedef unsigned int u32; -+ -+typedef signed long long s64; -+typedef unsigned long long u64; -+ -+/* DMA addresses are always 32-bits wide */ -+ -+typedef u32 dma_addr_t; -+typedef u32 dma64_addr_t; -+ -+typedef unsigned short kmem_bufctl_t; -+ -+#endif /* __ASSEMBLY__ */ -+ -+#endif /* __KERNEL__ */ -+ -+#endif /* _NIOS_TYPES_H */ ---- linux/include/asm-nios2nommu/uaccess.h -+++ linux/include/asm-nios2nommu/uaccess.h -@@ -0,0 +1,183 @@ -+#ifndef __NIOS2NOMMU_UACCESS_H -+#define __NIOS2NOMMU_UACCESS_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * asm-nios2nommu/uaccess.h -+ * -+ * User space memory access functions -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Ported from asm-m68knommu/uaccess.h --wentao -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+#include -+#include -+#include -+ -+#define VERIFY_READ 0 -+#define VERIFY_WRITE 1 -+ -+#define access_ok(type,addr,size) _access_ok((unsigned long)(addr),(size)) -+ -+static inline int _access_ok(unsigned long addr, unsigned long size) -+{ -+ return (((unsigned long)addr < (unsigned long)nasys_program_mem_end) && -+ (((unsigned long)addr >= (unsigned long)nasys_program_mem))); -+} -+ -+extern inline int verify_area(int type, const void * addr, unsigned long size) -+{ -+ return access_ok(type,addr,size)?0:-EFAULT; -+} -+ -+/* -+ * The exception table consists of pairs of addresses: the first is the -+ * address of an instruction that is allowed to fault, and the second is -+ * the address at which the program should continue. No registers are -+ * modified, so it is entirely up to the continuation code to figure out -+ * what to do. -+ * -+ * All the routines below use bits of fixup code that are out of line -+ * with the main instruction path. This means when everything is well, -+ * we don't even have to jump over them. Further, they do not intrude -+ * on our cache or tlb entries. -+ */ -+ -+#define ARCH_HAS_SEARCH_EXTABLE -+//;dgt2;tmp; -+ -+struct exception_table_entry -+{ -+ unsigned long insn, fixup; -+}; -+ -+/* Returns 0 if exception not found and fixup otherwise. */ -+extern unsigned long search_exception_table(unsigned long); -+ -+ -+/* -+ * These are the main single-value transfer routines. They automatically -+ * use the right size if we just have the right pointer type. -+ */ -+ -+#define put_user(x, ptr) \ -+({ \ -+ int __pu_err = 0; \ -+ typeof(*(ptr)) __pu_val = (x); \ -+ switch (sizeof (*(ptr))) { \ -+ case 1: \ -+ case 2: \ -+ case 4: \ -+ case 8: \ -+ memcpy(ptr, &__pu_val, sizeof (*(ptr))); \ -+ break; \ -+ default: \ -+ __pu_err = __put_user_bad(); \ -+ break; \ -+ } \ -+ __pu_err; \ -+}) -+#define __put_user(x, ptr) put_user(x, ptr) -+ -+extern int __put_user_bad(void); -+ -+/* -+ * Tell gcc we read from memory instead of writing: this is because -+ * we do not write to any memory gcc knows about, so there are no -+ * aliasing issues. -+ */ -+ -+#define __ptr(x) ((unsigned long *)(x)) -+ -+#define get_user(x, ptr) \ -+({ \ -+ int __gu_err = 0; \ -+ typeof(*(ptr)) __gu_val = 0; \ -+ switch (sizeof(*(ptr))) { \ -+ case 1: \ -+ case 2: \ -+ case 4: \ -+ case 8: \ -+ memcpy(&__gu_val, ptr, sizeof (*(ptr))); \ -+ break; \ -+ default: \ -+ __gu_val = 0; \ -+ __gu_err = __get_user_bad(); \ -+ break; \ -+ } \ -+ (x) = __gu_val; \ -+ __gu_err; \ -+}) -+#define __get_user(x, ptr) get_user(x, ptr) -+ -+extern int __get_user_bad(void); -+ -+#define copy_from_user(to, from, n) (memcpy(to, from, n), 0) -+#define copy_to_user(to, from, n) (memcpy(to, from, n), 0) -+ -+#define __copy_from_user(to, from, n) copy_from_user(to, from, n) -+#define __copy_to_user(to, from, n) copy_to_user(to, from, n) -+#define __copy_to_user_inatomic __copy_to_user -+#define __copy_from_user_inatomic __copy_from_user -+ -+#define copy_to_user_ret(to,from,n,retval) ({ if (copy_to_user(to,from,n)) return retval; }) -+ -+#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n)) return retval; }) -+ -+/* -+ * Copy a null terminated string from userspace. -+ */ -+ -+static inline long -+strncpy_from_user(char *dst, const char *src, long count) -+{ -+ char *tmp; -+ strncpy(dst, src, count); -+ for (tmp = dst; *tmp && count > 0; tmp++, count--) -+ ; -+ return(tmp - dst); /* DAVIDM should we count a NUL ? check getname */ -+} -+ -+/* -+ * Return the size of a string (including the ending 0) -+ * -+ * Return 0 on exception, a value greater than N if too long -+ */ -+static inline long strnlen_user(const char *src, long n) -+{ -+ return(strlen(src) + 1); /* DAVIDM make safer */ -+} -+ -+#define strlen_user(str) strnlen_user(str, 32767) -+ -+/* -+ * Zero Userspace -+ */ -+ -+static inline unsigned long -+clear_user(void *to, unsigned long n) -+{ -+ memset(to, 0, n); -+ return(0); -+} -+ -+#endif /* _NIOS2NOMMU_UACCESS_H */ ---- linux/include/asm-nios2nommu/uart_struct.h -+++ linux/include/asm-nios2nommu/uart_struct.h -@@ -0,0 +1,83 @@ -+ -+// UART Registers -+typedef volatile struct -+ { -+ int np_uartrxdata; // Read-only, 8-bit -+ int np_uarttxdata; // Write-only, 8-bit -+ int np_uartstatus; // Read-only, 8-bit -+ int np_uartcontrol; // Read/Write, 9-bit -+ int np_uartdivisor; // Read/Write, 16-bit, optional -+ int np_uartendofpacket; // Read/Write, end-of-packet character -+ } np_uart; -+ -+// UART Status Register Bits -+enum -+ { -+ np_uartstatus_eop_bit = 12, -+ np_uartstatus_cts_bit = 11, -+ np_uartstatus_dcts_bit = 10, -+ np_uartstatus_e_bit = 8, -+ np_uartstatus_rrdy_bit = 7, -+ np_uartstatus_trdy_bit = 6, -+ np_uartstatus_tmt_bit = 5, -+ np_uartstatus_toe_bit = 4, -+ np_uartstatus_roe_bit = 3, -+ np_uartstatus_brk_bit = 2, -+ np_uartstatus_fe_bit = 1, -+ np_uartstatus_pe_bit = 0, -+ -+ np_uartstatus_eop_mask = (1<<12), -+ np_uartstatus_cts_mask = (1<<11), -+ np_uartstatus_dcts_mask = (1<<10), -+ np_uartstatus_e_mask = (1<<8), -+ np_uartstatus_rrdy_mask = (1<<7), -+ np_uartstatus_trdy_mask = (1<<6), -+ np_uartstatus_tmt_mask = (1<<5), -+ np_uartstatus_toe_mask = (1<<4), -+ np_uartstatus_roe_mask = (1<<3), -+ np_uartstatus_brk_mask = (1<<2), -+ np_uartstatus_fe_mask = (1<<1), -+ np_uartstatus_pe_mask = (1<<0) -+ }; -+ -+// UART Control Register Bits -+enum -+ { -+ np_uartcontrol_ieop_bit = 12, -+ np_uartcontrol_rts_bit = 11, -+ np_uartcontrol_idcts_bit = 10, -+ np_uartcontrol_tbrk_bit = 9, -+ np_uartcontrol_ie_bit = 8, -+ np_uartcontrol_irrdy_bit = 7, -+ np_uartcontrol_itrdy_bit = 6, -+ np_uartcontrol_itmt_bit = 5, -+ np_uartcontrol_itoe_bit = 4, -+ np_uartcontrol_iroe_bit = 3, -+ np_uartcontrol_ibrk_bit = 2, -+ np_uartcontrol_ife_bit = 1, -+ np_uartcontrol_ipe_bit = 0, -+ -+ np_uartcontrol_ieop_mask = (1<<12), -+ np_uartcontrol_rts_mask = (1<<11), -+ np_uartcontrol_idcts_mask = (1<<10), -+ np_uartcontrol_tbrk_mask = (1<<9), -+ np_uartcontrol_ie_mask = (1<<8), -+ np_uartcontrol_irrdy_mask = (1<<7), -+ np_uartcontrol_itrdy_mask = (1<<6), -+ np_uartcontrol_itmt_mask = (1<<5), -+ np_uartcontrol_itoe_mask = (1<<4), -+ np_uartcontrol_iroe_mask = (1<<3), -+ np_uartcontrol_ibrk_mask = (1<<2), -+ np_uartcontrol_ife_mask = (1<<1), -+ np_uartcontrol_ipe_mask = (1<<0) -+ }; -+ -+// UART Routines -+int nr_uart_rxchar(np_uart *uartBase); // 0 for default UART -+void nr_uart_txcr(void); -+void nr_uart_txchar(int c,np_uart *uartBase); // 0 for default UART -+void nr_uart_txhex(int x); // 16 or 32 bits -+void nr_uart_txhex16(short x); -+void nr_uart_txhex32(long x); -+void nr_uart_txstring(char *s); -+ ---- linux/include/asm-nios2nommu/ucontext.h -+++ linux/include/asm-nios2nommu/ucontext.h -@@ -0,0 +1,63 @@ -+#ifndef _NIOSKNOMMU_UCONTEXT_H -+#define _NIOSKNOMMU_UCONTEXT_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/ucontext.h -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+typedef int greg_t; -+#define NGREG 32 -+typedef greg_t gregset_t[NGREG]; -+ -+#ifdef CONFIG_FPU -+typedef struct fpregset { -+ int f_pcr; -+ int f_psr; -+ int f_fpiaddr; -+ int f_fpregs[8][3]; -+} fpregset_t; -+#endif -+ -+struct mcontext { -+ int version; -+ int status_extension; -+ gregset_t gregs; -+#ifdef CONFIG_FPU -+ fpregset_t fpregs; -+#endif -+}; -+ -+#define MCONTEXT_VERSION 2 -+ -+struct ucontext { -+ unsigned long uc_flags; -+ struct ucontext *uc_link; -+ stack_t uc_stack; -+ struct mcontext uc_mcontext; -+#ifdef CONFIG_FPU -+ unsigned long uc_filler[80]; -+#endif -+ sigset_t uc_sigmask; /* mask last for extensibility */ -+}; -+ -+#endif ---- linux/include/asm-nios2nommu/unaligned.h -+++ linux/include/asm-nios2nommu/unaligned.h -@@ -0,0 +1,43 @@ -+#ifndef __NIOS_UNALIGNED_H -+#define __NIOS_UNALIGNED_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/unaligned.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* -+ * The nios cannot do unaligned accesses itself. -+ */ -+ -+#define get_unaligned(ptr) ({ \ -+ typeof((*(ptr))) x; \ -+ memcpy(&x, (void*)ptr, sizeof(*(ptr))); \ -+ x; \ -+}) -+ -+#define put_unaligned(val, ptr) ({ \ -+ typeof((*(ptr))) x = val; \ -+ memcpy((void*)ptr, &x, sizeof(*(ptr))); \ -+}) -+ -+#endif /* __NIOS_UNALIGNED_H */ ---- linux/include/asm-nios2nommu/unistd.h -+++ linux/include/asm-nios2nommu/unistd.h -@@ -0,0 +1,686 @@ -+#ifndef _ASM_NIOS_UNISTD_H_ -+#define _ASM_NIOS_UNISTD_H_ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/unistd.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * //vic - kernel_thread moved to process.c -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+/* TRAP isr expects the trap# (syscall=#TRAP_ID_SYSCALL) in r2, -+ * the syscall # in r3, and arguments in r4, r5, ... -+ * Return argument expected in r2. -+ */ -+ -+#define __NR_restart_syscall 0 -+#define __NR_exit 1 -+#define __NR_fork 2 -+#define __NR_read 3 -+#define __NR_write 4 -+#define __NR_open 5 -+#define __NR_close 6 -+#define __NR_waitpid 7 -+#define __NR_creat 8 -+#define __NR_link 9 -+#define __NR_unlink 10 -+#define __NR_execve 11 -+#define __NR_chdir 12 -+#define __NR_time 13 -+#define __NR_mknod 14 -+#define __NR_chmod 15 -+#define __NR_chown 16 -+#define __NR_break 17 -+#define __NR_oldstat 18 -+#define __NR_lseek 19 -+#define __NR_getpid 20 -+#define __NR_mount 21 -+#define __NR_umount 22 -+#define __NR_setuid 23 -+#define __NR_getuid 24 -+#define __NR_stime 25 -+#define __NR_ptrace 26 -+#define __NR_alarm 27 -+#define __NR_oldfstat 28 -+#define __NR_pause 29 -+#define __NR_utime 30 -+#define __NR_stty 31 -+#define __NR_gtty 32 -+#define __NR_access 33 -+#define __NR_nice 34 -+#define __NR_ftime 35 -+#define __NR_sync 36 -+#define __NR_kill 37 -+#define __NR_rename 38 -+#define __NR_mkdir 39 -+#define __NR_rmdir 40 -+#define __NR_dup 41 -+#define __NR_pipe 42 -+#define __NR_times 43 -+#define __NR_prof 44 -+#define __NR_brk 45 -+#define __NR_setgid 46 -+#define __NR_getgid 47 -+#define __NR_signal 48 -+#define __NR_geteuid 49 -+#define __NR_getegid 50 -+#define __NR_acct 51 -+#define __NR_umount2 52 //vic #define __NR_phys 52 -+#define __NR_lock 53 -+#define __NR_ioctl 54 -+#define __NR_fcntl 55 -+#define __NR_mpx 56 -+#define __NR_setpgid 57 -+#define __NR_ulimit 58 -+#define __NR_oldolduname 59 -+#define __NR_umask 60 -+#define __NR_chroot 61 -+#define __NR_ustat 62 -+#define __NR_dup2 63 -+#define __NR_getppid 64 -+#define __NR_getpgrp 65 -+#define __NR_setsid 66 -+#define __NR_sigaction 67 -+#define __NR_sgetmask 68 -+#define __NR_ssetmask 69 -+#define __NR_setreuid 70 -+#define __NR_setregid 71 -+#define __NR_sigsuspend 72 -+#define __NR_sigpending 73 -+#define __NR_sethostname 74 -+#define __NR_setrlimit 75 -+#define __NR_getrlimit 76 -+#define __NR_getrusage 77 -+#define __NR_gettimeofday 78 -+#define __NR_settimeofday 79 -+#define __NR_getgroups 80 -+#define __NR_setgroups 81 -+#define __NR_select 82 -+#define __NR_symlink 83 -+#define __NR_oldlstat 84 -+#define __NR_readlink 85 -+#define __NR_uselib 86 -+#define __NR_swapon 87 -+#define __NR_reboot 88 -+#define __NR_readdir 89 -+#define __NR_mmap 90 -+#define __NR_munmap 91 -+#define __NR_truncate 92 -+#define __NR_ftruncate 93 -+#define __NR_fchmod 94 -+#define __NR_fchown 95 -+#define __NR_getpriority 96 -+#define __NR_setpriority 97 -+#define __NR_profil 98 -+#define __NR_statfs 99 -+#define __NR_fstatfs 100 -+#define __NR_ioperm 101 -+#define __NR_socketcall 102 -+#define __NR_syslog 103 -+#define __NR_setitimer 104 -+#define __NR_getitimer 105 -+#define __NR_stat 106 -+#define __NR_lstat 107 -+#define __NR_fstat 108 -+#define __NR_olduname 109 -+#define __NR_iopl /* 110 */ not supported -+#define __NR_vhangup 111 -+#define __NR_idle /* 112 */ Obsolete -+#define __NR_vm86 /* 113 */ not supported -+#define __NR_wait4 114 -+#define __NR_swapoff 115 -+#define __NR_sysinfo 116 -+#define __NR_ipc 117 -+#define __NR_fsync 118 -+#define __NR_sigreturn 119 -+#define __NR_clone 120 -+#define __NR_setdomainname 121 -+#define __NR_uname 122 -+#define __NR_cacheflush 123 -+#define __NR_adjtimex 124 -+#define __NR_mprotect 125 -+#define __NR_sigprocmask 126 -+#define __NR_create_module 127 -+#define __NR_init_module 128 -+#define __NR_delete_module 129 -+#define __NR_get_kernel_syms 130 -+#define __NR_quotactl 131 -+#define __NR_getpgid 132 -+#define __NR_fchdir 133 -+#define __NR_bdflush 134 -+#define __NR_sysfs 135 -+#define __NR_personality 136 -+#define __NR_afs_syscall 137 /* Syscall for Andrew File System */ -+#define __NR_setfsuid 138 -+#define __NR_setfsgid 139 -+#define __NR__llseek 140 -+#define __NR_getdents 141 -+#define __NR__newselect 142 -+#define __NR_flock 143 -+#define __NR_msync 144 -+#define __NR_readv 145 -+#define __NR_writev 146 -+#define __NR_getsid 147 -+#define __NR_fdatasync 148 -+#define __NR__sysctl 149 -+#define __NR_mlock 150 -+#define __NR_munlock 151 -+#define __NR_mlockall 152 -+#define __NR_munlockall 153 -+#define __NR_sched_setparam 154 -+#define __NR_sched_getparam 155 -+#define __NR_sched_setscheduler 156 -+#define __NR_sched_getscheduler 157 -+#define __NR_sched_yield 158 -+#define __NR_sched_get_priority_max 159 -+#define __NR_sched_get_priority_min 160 -+#define __NR_sched_rr_get_interval 161 -+#define __NR_nanosleep 162 -+#define __NR_mremap 163 -+#define __NR_setresuid 164 -+#define __NR_getresuid 165 -+#define __NR_getpagesize 166 -+#define __NR_query_module 167 -+#define __NR_poll 168 -+#define __NR_nfsservctl 169 -+#define __NR_setresgid 170 -+#define __NR_getresgid 171 -+#define __NR_prctl 172 -+#define __NR_rt_sigreturn 173 -+#define __NR_rt_sigaction 174 -+#define __NR_rt_sigprocmask 175 -+#define __NR_rt_sigpending 176 -+#define __NR_rt_sigtimedwait 177 -+#define __NR_rt_sigqueueinfo 178 -+#define __NR_rt_sigsuspend 179 -+#define __NR_pread 180 -+#define __NR_pwrite 181 -+#define __NR_lchown 182 -+#define __NR_getcwd 183 -+#define __NR_capget 184 -+#define __NR_capset 185 -+#define __NR_sigaltstack 186 -+#define __NR_sendfile 187 -+#define __NR_getpmsg 188 /* some people actually want streams */ -+#define __NR_putpmsg 189 /* some people actually want streams */ -+#define __NR_vfork 190 -+#define __NR_ugetrlimit 191 -+#define __NR_mmap2 192 -+#define __NR_truncate64 193 -+#define __NR_ftruncate64 194 -+#define __NR_stat64 195 -+#define __NR_lstat64 196 -+#define __NR_fstat64 197 -+#define __NR_chown32 198 -+#define __NR_getuid32 199 -+#define __NR_getgid32 200 -+#define __NR_geteuid32 201 -+#define __NR_getegid32 202 -+#define __NR_setreuid32 203 -+#define __NR_setregid32 204 -+#define __NR_getgroups32 205 -+#define __NR_setgroups32 206 -+#define __NR_fchown32 207 -+#define __NR_setresuid32 208 -+#define __NR_getresuid32 209 -+#define __NR_setresgid32 210 -+#define __NR_getresgid32 211 -+#define __NR_lchown32 212 -+#define __NR_setuid32 213 -+#define __NR_setgid32 214 -+#define __NR_setfsuid32 215 -+#define __NR_setfsgid32 216 -+#define __NR_pivot_root 217 -+/* 218 unused */ -+/* 219 unused */ -+#define __NR_getdents64 220 -+#define __NR_gettid 221 -+#define __NR_tkill 222 -+#define __NR_setxattr 223 -+#define __NR_lsetxattr 224 -+#define __NR_fsetxattr 225 -+#define __NR_getxattr 226 -+#define __NR_lgetxattr 227 -+#define __NR_fgetxattr 228 -+#define __NR_listxattr 229 -+#define __NR_llistxattr 230 -+#define __NR_flistxattr 231 -+#define __NR_removexattr 232 -+#define __NR_lremovexattr 233 -+#define __NR_fremovexattr 234 -+#define __NR_futex 235 -+#define __NR_sendfile64 236 -+#define __NR_mincore 237 -+#define __NR_madvise 238 -+#define __NR_fcntl64 239 -+#define __NR_readahead 240 -+#define __NR_io_setup 241 -+#define __NR_io_destroy 242 -+#define __NR_io_getevents 243 -+#define __NR_io_submit 244 -+#define __NR_io_cancel 245 -+#define __NR_fadvise64 246 -+#define __NR_exit_group 247 -+#define __NR_lookup_dcookie 248 -+#define __NR_epoll_create 249 -+#define __NR_epoll_ctl 250 -+#define __NR_epoll_wait 251 -+#define __NR_remap_file_pages 252 -+#define __NR_set_tid_address 253 -+#define __NR_timer_create 254 -+#define __NR_timer_settime 255 -+#define __NR_timer_gettime 256 -+#define __NR_timer_getoverrun 257 -+#define __NR_timer_delete 258 -+#define __NR_clock_settime 259 -+#define __NR_clock_gettime 260 -+#define __NR_clock_getres 261 -+#define __NR_clock_nanosleep 262 -+#define __NR_statfs64 263 -+#define __NR_fstatfs64 264 -+#define __NR_tgkill 265 -+#define __NR_utimes 266 -+#define __NR_fadvise64_64 267 -+#define __NR_mbind 268 -+#define __NR_get_mempolicy 269 -+#define __NR_set_mempolicy 270 -+#define __NR_mq_open 271 -+#define __NR_mq_unlink 272 -+#define __NR_mq_timedsend 273 -+#define __NR_mq_timedreceive 274 -+#define __NR_mq_notify 275 -+#define __NR_mq_getsetattr 276 -+#define __NR_waitid 277 -+#define __NR_sys_setaltroot 278 -+#define __NR_add_key 279 -+#define __NR_request_key 280 -+#define __NR_keyctl 281 -+ -+#define NR_syscalls 282 -+ -+/* user-visible error numbers are in the range -1 - -122: see -+ */ -+ -+#define __syscall_return(type, res) \ -+do { \ -+ if ((unsigned long)(res) >= (unsigned long)(-125)) { \ -+ \ -+ /* avoid using res which is declared to be in \ -+ register r2; errno might expand to a function \ -+ call and clobber it. */ \ -+ \ -+ int __err = -(res); \ -+ errno = __err; \ -+ res = -1; \ -+ } \ -+ return (type) (res); \ -+} while (0) -+ -+#define _syscall0(type,name) \ -+type name(void) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+//;dgt2;tmp;can we RELY on syscall1 arg a -+//;dgt2;tmp; already being in r4 ? -+#define _syscall1(type,name,atype,a) \ -+type name(atype a) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ " mov r4, %3\n\t" /* (long) a */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ , "r" ((long) a) /* %3 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ , "r4" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+//;dgt2;tmp;can we RELY on syscall2 args a,b -+//;dgt2;tmp; already being in r4,r5 ? -+#define _syscall2(type,name,atype,a,btype,b) \ -+type name(atype a,btype b) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ " mov r4, %3\n\t" /* (long) a */ \ -+ " mov r5, %4\n\t" /* (long) b */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ , "r" ((long) a) /* %3 */ \ -+ , "r" ((long) b) /* %4 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ , "r4" /* Clobbered */ \ -+ , "r5" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+//;dgt2;tmp;can we RELY on syscall3 args a,b,c -+//;dgt2;tmp; already being in r4,r5,r6 ? -+#define _syscall3(type,name,atype,a,btype,b,ctype,c) \ -+type name(atype a,btype b,ctype c) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ " mov r4, %3\n\t" /* (long) a */ \ -+ " mov r5, %4\n\t" /* (long) b */ \ -+ " mov r6, %5\n\t" /* (long) c */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ , "r" ((long) a) /* %3 */ \ -+ , "r" ((long) b) /* %4 */ \ -+ , "r" ((long) c) /* %5 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ , "r4" /* Clobbered */ \ -+ , "r5" /* Clobbered */ \ -+ , "r6" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+//;dgt2;tmp;can we RELY on syscall4 args a,b,c,d -+//;dgt2;tmp; already being in r4,r5,r6,r7 ? -+#define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \ -+type name (atype a, btype b, ctype c, dtype d) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ " mov r4, %3\n\t" /* (long) a */ \ -+ " mov r5, %4\n\t" /* (long) b */ \ -+ " mov r6, %5\n\t" /* (long) c */ \ -+ " mov r7, %6\n\t" /* (long) d */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ , "r" ((long) a) /* %3 */ \ -+ , "r" ((long) b) /* %4 */ \ -+ , "r" ((long) c) /* %5 */ \ -+ , "r" ((long) d) /* %6 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ , "r4" /* Clobbered */ \ -+ , "r5" /* Clobbered */ \ -+ , "r6" /* Clobbered */ \ -+ , "r7" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+//;dgt2;tmp;can we RELY on syscall5 args a,b,c,d -+//;dgt2;tmp; already being in r4,r5,r6,r7 ? -+#define _syscall5(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e) \ -+type name (atype a,btype b,ctype c,dtype d,etype e) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ " mov r4, %3\n\t" /* (long) a */ \ -+ " mov r5, %4\n\t" /* (long) b */ \ -+ " mov r6, %5\n\t" /* (long) c */ \ -+ " mov r7, %6\n\t" /* (long) c */ \ -+ " mov r8, %7\n\t" /* (long) e */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ , "r" ((long) a) /* %3 */ \ -+ , "r" ((long) b) /* %4 */ \ -+ , "r" ((long) c) /* %5 */ \ -+ , "r" ((long) d) /* %6 */ \ -+ , "r" ((long) e) /* %7 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ , "r4" /* Clobbered */ \ -+ , "r5" /* Clobbered */ \ -+ , "r6" /* Clobbered */ \ -+ , "r7" /* Clobbered */ \ -+ , "r8" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+//;dgt2;tmp;can we RELY on syscall6 args a,b,c,d -+//;dgt2;tmp; already being in r4,r5,r6,r7 ? -+#define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \ -+type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \ -+{ \ -+ long __res; \ -+ \ -+ __asm__ __volatile__ ( \ -+ \ -+ " \n\t" \ -+ \ -+ " movi r2, %2\n\t" /* TRAP_ID_SYSCALL */ \ -+ " movi r3, %1\n\t" /* __NR_##name */ \ -+ " mov r4, %3\n\t" /* (long) a */ \ -+ " mov r5, %4\n\t" /* (long) b */ \ -+ " mov r6, %5\n\t" /* (long) c */ \ -+ " mov r7, %6\n\t" /* (long) c */ \ -+ " mov r8, %7\n\t" /* (long) e */ \ -+ " mov r9, %8\n\t" /* (long) f */ \ -+ \ -+ " trap\n\t" \ -+ " mov %0, r2\n\t" /* syscall rtn */ \ -+ \ -+ " \n\t" \ -+ \ -+ : "=r" (__res) /* %0 */ \ -+ \ -+ : "i" (__NR_##name) /* %1 */ \ -+ , "i" (TRAP_ID_SYSCALL) /* %2 */ \ -+ , "r" ((long) a) /* %3 */ \ -+ , "r" ((long) b) /* %4 */ \ -+ , "r" ((long) c) /* %5 */ \ -+ , "r" ((long) d) /* %6 */ \ -+ , "r" ((long) e) /* %7 */ \ -+ , "r" ((long) f) /* %8 */ \ -+ \ -+ : "r2" /* Clobbered */ \ -+ , "r3" /* Clobbered */ \ -+ , "r4" /* Clobbered */ \ -+ , "r5" /* Clobbered */ \ -+ , "r6" /* Clobbered */ \ -+ , "r7" /* Clobbered */ \ -+ , "r8" /* Clobbered */ \ -+ , "r9" /* Clobbered */ \ -+ ); \ -+ \ -+__syscall_return(type,__res); \ -+} -+ -+#ifdef __KERNEL__ -+#define __ARCH_WANT_IPC_PARSE_VERSION -+#define __ARCH_WANT_OLD_READDIR -+#define __ARCH_WANT_OLD_STAT -+#define __ARCH_WANT_STAT64 -+#define __ARCH_WANT_SYS_ALARM -+#define __ARCH_WANT_SYS_GETHOSTNAME -+#define __ARCH_WANT_SYS_PAUSE -+#define __ARCH_WANT_SYS_SGETMASK -+#define __ARCH_WANT_SYS_SIGNAL -+#define __ARCH_WANT_SYS_TIME -+#define __ARCH_WANT_SYS_UTIME -+#define __ARCH_WANT_SYS_WAITPID -+#define __ARCH_WANT_SYS_SOCKETCALL -+#define __ARCH_WANT_SYS_FADVISE64 -+#define __ARCH_WANT_SYS_GETPGRP -+#define __ARCH_WANT_SYS_LLSEEK -+#define __ARCH_WANT_SYS_NICE -+#define __ARCH_WANT_SYS_OLD_GETRLIMIT -+#define __ARCH_WANT_SYS_OLDUMOUNT -+#define __ARCH_WANT_SYS_SIGPENDING -+#define __ARCH_WANT_SYS_SIGPROCMASK -+#define __ARCH_WANT_SYS_RT_SIGACTION -+#endif -+ -+#ifdef __KERNEL_SYSCALLS__ -+ -+/* -+ * we need this inline - forking from kernel space will result -+ * in NO COPY ON WRITE (!!!), until an execve is executed. This -+ * is no problem, but for the stack. This is handled by not letting -+ * main() use the stack at all after fork(). Thus, no function -+ * calls - which means inline code for fork too, as otherwise we -+ * would use the stack upon exit from 'fork()'. -+ * -+ * Actually only pause and fork are needed inline, so that there -+ * won't be any messing with the stack from main(), but we define -+ * some others too. -+ */ -+#define __NR__exit __NR_exit -+static inline _syscall0(int,pause) -+static inline _syscall0(int,sync) -+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) -+static inline _syscall3(off_t,lseek,int,fd,off_t,offset,int,count) -+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) -+static inline _syscall1(int,delete_module,const char *,name) -+ -+static inline pid_t wait(int * wait_stat) -+{ -+ return waitpid(-1,wait_stat,0); -+} -+ -+#endif -+ -+/* -+ * "Conditional" syscalls -+ * -+ * What we want is __attribute__((weak,alias("sys_ni_syscall"))), -+ * but it doesn't work on all toolchains, so we just do it by hand -+ */ -+#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); -+ -+#endif /* _ASM_NIOS_UNISTD_H_ */ ---- linux/include/asm-nios2nommu/user.h -+++ linux/include/asm-nios2nommu/user.h -@@ -0,0 +1,112 @@ -+#ifndef _NIOS2NOMMU_USER_H -+#define _NIOS2NOMMU_USER_H -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/user.h -+ * -+ * Derived from M68knommu -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+#include -+ -+/* Core file format: The core file is written in such a way that gdb -+ can understand it and provide useful information to the user (under -+ linux we use the 'trad-core' bfd). There are quite a number of -+ obstacles to being able to view the contents of the floating point -+ registers, and until these are solved you will not be able to view the -+ contents of them. Actually, you can read in the core file and look at -+ the contents of the user struct to find out what the floating point -+ registers contain. -+ The actual file contents are as follows: -+ UPAGE: 1 page consisting of a user struct that tells gdb what is present -+ in the file. Directly after this is a copy of the task_struct, which -+ is currently not used by gdb, but it may come in useful at some point. -+ All of the registers are stored as part of the upage. The upage should -+ always be only one page. -+ DATA: The data area is stored. We use current->end_text to -+ current->brk to pick up all of the user variables, plus any memory -+ that may have been malloced. No attempt is made to determine if a page -+ is demand-zero or if a page is totally unused, we just cover the entire -+ range. All of the addresses are rounded in such a way that an integral -+ number of pages is written. -+ STACK: We need the stack information in order to get a meaningful -+ backtrace. We need to write the data from (esp) to -+ current->start_stack, so we round each of these off in order to be able -+ to write an integer number of pages. -+ The minimum core file size is 3 pages, or 12288 bytes. -+*/ -+ -+struct user_m68kfp_struct { -+ unsigned long fpregs[8*3]; /* fp0-fp7 registers */ -+ unsigned long fpcntl[3]; /* fp control regs */ -+}; -+ -+/* This is needs more work, probably should look like gdb useage */ -+struct user_regs_struct { -+ long r1,r2,r3,r4,r5,r6,r7,r8; -+ long r9,r10,r11,r12,r13,r14,r15; -+ long r16,r17,r18,r19,r20,r21,r22,r23; -+ long gp; -+ long sp; -+ long ra; -+ long fp; -+ long orig_r2; -+ long estatus; -+ long status_extension; -+ long ea; -+}; -+ -+ -+/* When the kernel dumps core, it starts by dumping the user struct - -+ this will be used by gdb to figure out where the data and stack segments -+ are within the file, and what virtual addresses to use. */ -+struct user{ -+/* We start with the registers, to mimic the way that "memory" is returned -+ from the ptrace(3,...) function. */ -+ struct user_regs_struct regs; /* Where the registers are actually stored */ -+/* ptrace does not yet supply these. Someday.... */ -+ int u_fpvalid; /* True if math co-processor being used. */ -+ /* for this mess. Not yet used. */ -+ struct user_m68kfp_struct m68kfp; /* Math Co-processor registers. */ -+/* The rest of this junk is to help gdb figure out what goes where */ -+ unsigned long int u_tsize; /* Text segment size (pages). */ -+ unsigned long int u_dsize; /* Data segment size (pages). */ -+ unsigned long int u_ssize; /* Stack segment size (pages). */ -+ unsigned long start_code; /* Starting virtual address of text. */ -+ unsigned long start_stack; /* Starting virtual address of stack area. -+ This is actually the bottom of the stack, -+ the top of the stack is always found in the -+ esp register. */ -+ long int signal; /* Signal that caused the core dump. */ -+ int reserved; /* No longer used */ -+ struct user_regs_struct *u_ar0; -+ /* Used by gdb to help find the values for */ -+ /* the registers. */ -+ struct user_m68kfp_struct* u_fpstate; /* Math Co-processor pointer. */ -+ unsigned long magic; /* To uniquely identify a core file */ -+ char u_comm[32]; /* User command that was responsible */ -+}; -+#define NBPG PAGE_SIZE -+#define UPAGES 1 -+#define HOST_TEXT_START_ADDR (u.start_code) -+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) -+ -+#endif ---- linux/include/asm-nios2nommu/virtconvert.h -+++ linux/include/asm-nios2nommu/virtconvert.h -@@ -0,0 +1,47 @@ -+#ifndef __NIOS_VIRT_CONVERT__ -+#define __NIOS_VIRT_CONVERT__ -+ -+/*-------------------------------------------------------------------- -+ * -+ * include/asm-nios2nommu/virtconvert.h -+ * -+ * Derived from various works, Alpha, ix86, M68K, Sparc, ...et al -+ * -+ * Copyright (C) 2004 Microtronix Datacom Ltd -+ * -+ * 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. -+ * -+ * -+ * Jan/20/2004 dgt NiosII -+ * -+ ---------------------------------------------------------------------*/ -+ -+ -+/* -+ * Macros used for converting between virtual and physical mappings. -+ */ -+ -+#ifdef __KERNEL__ -+ -+// #include -+#include -+#include -+ -+#define mm_ptov(vaddr) ((void *) (vaddr)) -+#define mm_vtop(vaddr) ((unsigned long) (vaddr)) -+#define phys_to_virt(vaddr) ((void *) (vaddr)) -+#define virt_to_phys(vaddr) ((unsigned long) (vaddr)) -+ -+#define virt_to_bus virt_to_phys -+#define bus_to_virt phys_to_virt -+ -+#endif /*__KERNEL__ */ -+#endif /*__NIOS_VIRT_CONVERT__*/