diff options
Diffstat (limited to 'include/asm-sparc')
-rw-r--r-- | include/asm-sparc/bpp.h | 9 | ||||
-rw-r--r-- | include/asm-sparc/ethtool.h | 79 | ||||
-rw-r--r-- | include/asm-sparc/highmem.h | 17 | ||||
-rw-r--r-- | include/asm-sparc/module.h | 11 | ||||
-rw-r--r-- | include/asm-sparc/openpromio.h | 6 | ||||
-rw-r--r-- | include/asm-sparc/pgtable.h | 4 | ||||
-rw-r--r-- | include/asm-sparc/xor.h | 273 |
7 files changed, 294 insertions, 105 deletions
diff --git a/include/asm-sparc/bpp.h b/include/asm-sparc/bpp.h index d1b967a00..ad4a84571 100644 --- a/include/asm-sparc/bpp.h +++ b/include/asm-sparc/bpp.h @@ -70,13 +70,4 @@ # define BPP_GP_Select 0x0800 # define BPP_GP_nFault 0x1000 - -/* - * Prototype for the initialization routine. - */ - -#ifdef __KERNEL__ -extern int bpp_init(void); -#endif - #endif diff --git a/include/asm-sparc/ethtool.h b/include/asm-sparc/ethtool.h deleted file mode 100644 index 572db24fb..000000000 --- a/include/asm-sparc/ethtool.h +++ /dev/null @@ -1,79 +0,0 @@ -/* $Id: ethtool.h,v 1.2 2000/01/31 04:59:17 davem Exp $ - * ethtool.h: Defines for SparcLinux ethtool. - * - * Copyright (C) 1998 David S. Miller (davem@redhat.com) - */ - -#ifndef _SPARC_ETHTOOL_H -#define _SPARC_ETHTOOL_H - -/* We do things like this so it does not matter what kernel - * headers you have on your system etc. - */ -#undef SIOCETHTOOL -#define SIOCETHTOOL (SIOCDEVPRIVATE + 0x0f) - -/* This should work for both 32 and 64 bit userland. */ -struct ethtool_cmd { - u32 cmd; - u32 supported; - u16 speed; - u8 duplex; - u8 port; - u8 phy_address; - u8 transceiver; - u8 autoneg; -}; - -/* CMDs currently supported */ -#define SPARC_ETH_GSET 0x00000001 /* Get settings, non-privileged. */ -#define SPARC_ETH_SSET 0x00000002 /* Set settings, privileged. */ - -/* Indicates what features are supported by the interface. */ -#define SUPPORTED_10baseT_Half 0x00000001 -#define SUPPORTED_10baseT_Full 0x00000002 -#define SUPPORTED_100baseT_Half 0x00000004 -#define SUPPORTED_100baseT_Full 0x00000008 -#define SUPPORTED_1000baseT_Half 0x00000010 -#define SUPPORTED_1000baseT_Full 0x00000020 -#define SUPPORTED_Autoneg 0x00000040 -#define SUPPORTED_TP 0x00000080 -#define SUPPORTED_AUI 0x00000100 -#define SUPPORTED_MII 0x00000200 -#define SUPPORTED_FIBRE 0x00000400 - -/* The following are all involved in forcing a particular link - * mode for the device for setting things. When getting the - * devices settings, these indicate the current mode and whether - * it was foced up into this mode or autonegotiated. - */ - -/* The forced speec, 10Mb, 100Mb, gigabit. */ -#define SPEED_10 10 -#define SPEED_100 100 -#define SPEED_1000 1000 - -/* Duplex, half or full. */ -#define DUPLEX_HALF 0x00 -#define DUPLEX_FULL 0x01 - -/* Which connector port. */ -#define PORT_TP 0x00 -#define PORT_AUI 0x01 -#define PORT_MII 0x02 -#define PORT_FIBRE 0x03 - -/* Which tranceiver to use. */ -#define XCVR_INTERNAL 0x00 -#define XCVR_EXTERNAL 0x01 -#define XCVR_DUMMY1 0x02 -#define XCVR_DUMMY2 0x03 -#define XCVR_DUMMY3 0x04 - -/* Enable or disable autonegotiation. If this is set to enable, - * the forced link modes above are completely ignored. - */ -#define AUTONEG_DISABLE 0x00 -#define AUTONEG_ENABLE 0x01 - -#endif /* _SPARC_ETHTOOL_H */ diff --git a/include/asm-sparc/highmem.h b/include/asm-sparc/highmem.h index 0724061e4..179f1a3cb 100644 --- a/include/asm-sparc/highmem.h +++ b/include/asm-sparc/highmem.h @@ -49,19 +49,19 @@ extern void kmap_init(void) __init; #define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT) #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) -extern unsigned long kmap_high(struct page *page); +extern void *kmap_high(struct page *page); extern void kunmap_high(struct page *page); -extern inline unsigned long kmap(struct page *page) +static inline void *kmap(struct page *page) { if (in_interrupt()) BUG(); if (page < highmem_start_page) - return (unsigned long) page_address(page); + return page_address(page); return kmap_high(page); } -extern inline void kunmap(struct page *page) +static inline void kunmap(struct page *page) { if (in_interrupt()) BUG(); @@ -76,13 +76,13 @@ extern inline void kunmap(struct page *page) * be used in IRQ contexts, so in some (very limited) cases we need * it. */ -extern inline unsigned long kmap_atomic(struct page *page, enum km_type type) +static inline void *kmap_atomic(struct page *page, enum km_type type) { unsigned long idx; unsigned long vaddr; if (page < highmem_start_page) - return (unsigned long) page_address(page); + return page_address(page); idx = type + KM_TYPE_NR*smp_processor_id(); vaddr = FIX_KMAP_BEGIN + idx * PAGE_SIZE; @@ -106,12 +106,13 @@ extern inline unsigned long kmap_atomic(struct page *page, enum km_type type) flush_tlb_all(); #endif - return vaddr; + return (void*) vaddr; } -extern inline void kunmap_atomic(unsigned long vaddr, enum km_type type) +static inline void kunmap_atomic(void *kvaddr, enum km_type type) { #if HIGHMEM_DEBUG + unsigned long vaddr = (unsigned long) kvaddr; unsigned long idx = type + KM_TYPE_NR*smp_processor_id(); #if 0 diff --git a/include/asm-sparc/module.h b/include/asm-sparc/module.h new file mode 100644 index 000000000..45c02931c --- /dev/null +++ b/include/asm-sparc/module.h @@ -0,0 +1,11 @@ +#ifndef _ASM_SPARC_MODULE_H +#define _ASM_SPARC_MODULE_H +/* + * This file contains the sparc architecture specific module code. + */ + +#define module_map(x) vmalloc(x) +#define module_unmap(x) vfree(x) +#define module_arch_init(x) (0) + +#endif /* _ASM_SPARC_MODULE_H */ diff --git a/include/asm-sparc/openpromio.h b/include/asm-sparc/openpromio.h index bebb788ac..6e32823ab 100644 --- a/include/asm-sparc/openpromio.h +++ b/include/asm-sparc/openpromio.h @@ -64,11 +64,5 @@ struct opiocdesc #define OPIOCGETNEXT _IOWR('O', 5, int) #define OPIOCGETCHILD _IOWR('O', 6, int) - -#ifdef __KERNEL__ -int openprom_init(void); -#endif - - #endif /* _SPARC_OPENPROMIO_H */ diff --git a/include/asm-sparc/pgtable.h b/include/asm-sparc/pgtable.h index 251ff01da..020b68fbb 100644 --- a/include/asm-sparc/pgtable.h +++ b/include/asm-sparc/pgtable.h @@ -1,4 +1,4 @@ -/* $Id: pgtable.h,v 1.105 2000/10/30 21:01:41 davem Exp $ */ +/* $Id: pgtable.h,v 1.106 2000/11/08 04:49:24 davem Exp $ */ #ifndef _SPARC_PGTABLE_H #define _SPARC_PGTABLE_H @@ -437,8 +437,6 @@ __get_iospace (unsigned long addr) } } -#define module_map vmalloc -#define module_unmap vfree extern unsigned long *sparc_valid_addr_bitmap; /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ diff --git a/include/asm-sparc/xor.h b/include/asm-sparc/xor.h new file mode 100644 index 000000000..f9af76af7 --- /dev/null +++ b/include/asm-sparc/xor.h @@ -0,0 +1,273 @@ +/* + * include/asm-sparc/xor.h + * + * Optimized RAID-5 checksumming functions for 32-bit Sparc. + * + * 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. + */ + +/* + * High speed xor_block operation for RAID4/5 utilizing the + * ldd/std SPARC instructions. + * + * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz) + */ + +static void +sparc_2(unsigned long bytes, unsigned long *p1, unsigned long *p2) +{ + int lines = bytes / (sizeof (long)) / 8; + + do { + __asm__ __volatile__(" + ldd [%0 + 0x00], %%g2 + ldd [%0 + 0x08], %%g4 + ldd [%0 + 0x10], %%o0 + ldd [%0 + 0x18], %%o2 + ldd [%1 + 0x00], %%o4 + ldd [%1 + 0x08], %%l0 + ldd [%1 + 0x10], %%l2 + ldd [%1 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + std %%g2, [%0 + 0x00] + std %%g4, [%0 + 0x08] + std %%o0, [%0 + 0x10] + std %%o2, [%0 + 0x18] + " + : + : "r" (p1), "r" (p2) + : "g2", "g3", "g4", "g5", + "o0", "o1", "o2", "o3", "o4", "o5", + "l0", "l1", "l2", "l3", "l4", "l5"); + p1 += 8; + p2 += 8; + } while (--lines > 0); +} + +static void +sparc_3(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3) +{ + int lines = bytes / (sizeof (long)) / 8; + + do { + __asm__ __volatile__(" + ldd [%0 + 0x00], %%g2 + ldd [%0 + 0x08], %%g4 + ldd [%0 + 0x10], %%o0 + ldd [%0 + 0x18], %%o2 + ldd [%1 + 0x00], %%o4 + ldd [%1 + 0x08], %%l0 + ldd [%1 + 0x10], %%l2 + ldd [%1 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + ldd [%2 + 0x00], %%o4 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + ldd [%2 + 0x08], %%l0 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + ldd [%2 + 0x10], %%l2 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + ldd [%2 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + std %%g2, [%0 + 0x00] + std %%g4, [%0 + 0x08] + std %%o0, [%0 + 0x10] + std %%o2, [%0 + 0x18] + " + : + : "r" (p1), "r" (p2), "r" (p3) + : "g2", "g3", "g4", "g5", + "o0", "o1", "o2", "o3", "o4", "o5", + "l0", "l1", "l2", "l3", "l4", "l5"); + p1 += 8; + p2 += 8; + p3 += 8; + } while (--lines > 0); +} + +static void +sparc_4(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4) +{ + int lines = bytes / (sizeof (long)) / 8; + + do { + __asm__ __volatile__(" + ldd [%0 + 0x00], %%g2 + ldd [%0 + 0x08], %%g4 + ldd [%0 + 0x10], %%o0 + ldd [%0 + 0x18], %%o2 + ldd [%1 + 0x00], %%o4 + ldd [%1 + 0x08], %%l0 + ldd [%1 + 0x10], %%l2 + ldd [%1 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + ldd [%2 + 0x00], %%o4 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + ldd [%2 + 0x08], %%l0 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + ldd [%2 + 0x10], %%l2 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + ldd [%2 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + ldd [%3 + 0x00], %%o4 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + ldd [%3 + 0x08], %%l0 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + ldd [%3 + 0x10], %%l2 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + ldd [%3 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + std %%g2, [%0 + 0x00] + std %%g4, [%0 + 0x08] + std %%o0, [%0 + 0x10] + std %%o2, [%0 + 0x18] + " + : + : "r" (p1), "r" (p2), "r" (p3), "r" (p4) + : "g2", "g3", "g4", "g5", + "o0", "o1", "o2", "o3", "o4", "o5", + "l0", "l1", "l2", "l3", "l4", "l5"); + p1 += 8; + p2 += 8; + p3 += 8; + p4 += 8; + } while (--lines > 0); +} + +static void +sparc_5(unsigned long bytes, unsigned long *p1, unsigned long *p2, + unsigned long *p3, unsigned long *p4, unsigned long *p5) +{ + int lines = bytes / (sizeof (long)) / 8; + + do { + __asm__ __volatile__(" + ldd [%0 + 0x00], %%g2 + ldd [%0 + 0x08], %%g4 + ldd [%0 + 0x10], %%o0 + ldd [%0 + 0x18], %%o2 + ldd [%1 + 0x00], %%o4 + ldd [%1 + 0x08], %%l0 + ldd [%1 + 0x10], %%l2 + ldd [%1 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + ldd [%2 + 0x00], %%o4 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + ldd [%2 + 0x08], %%l0 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + ldd [%2 + 0x10], %%l2 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + ldd [%2 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + ldd [%3 + 0x00], %%o4 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + ldd [%3 + 0x08], %%l0 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + ldd [%3 + 0x10], %%l2 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + ldd [%3 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + ldd [%4 + 0x00], %%o4 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + ldd [%4 + 0x08], %%l0 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + ldd [%4 + 0x10], %%l2 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + ldd [%4 + 0x18], %%l4 + xor %%g2, %%o4, %%g2 + xor %%g3, %%o5, %%g3 + xor %%g4, %%l0, %%g4 + xor %%g5, %%l1, %%g5 + xor %%o0, %%l2, %%o0 + xor %%o1, %%l3, %%o1 + xor %%o2, %%l4, %%o2 + xor %%o3, %%l5, %%o3 + std %%g2, [%0 + 0x00] + std %%g4, [%0 + 0x08] + std %%o0, [%0 + 0x10] + std %%o2, [%0 + 0x18] + " + : + : "r" (p1), "r" (p2), "r" (p3), "r" (p4), "r" (p5) + : "g2", "g3", "g4", "g5", + "o0", "o1", "o2", "o3", "o4", "o5", + "l0", "l1", "l2", "l3", "l4", "l5"); + p1 += 8; + p2 += 8; + p3 += 8; + p4 += 8; + p5 += 8; + } while (--lines > 0); +} + +static struct xor_block_template xor_block_SPARC = { + name: "SPARC", + do_2: sparc_2, + do_3: sparc_3, + do_4: sparc_4, + do_5: sparc_5, +}; + +/* For grins, also test the generic routines. */ +#include <asm-generic/xor.h> + +#undef XOR_TRY_TEMPLATES +#define XOR_TRY_TEMPLATES \ + do { \ + xor_speed(&xor_block_8regs); \ + xor_speed(&xor_block_32regs); \ + xor_speed(&xor_block_SPARC); \ + } while (0) |