summaryrefslogtreecommitdiffstats
path: root/include/asm-alpha
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-11-23 02:00:47 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-11-23 02:00:47 +0000
commit06615f62b17d7de6e12d2f5ec6b88cf30af08413 (patch)
tree8766f208847d4876a6db619aebbf54d53b76eb44 /include/asm-alpha
parentfa9bdb574f4febb751848a685d9a9017e04e1d53 (diff)
Merge with Linux 2.4.0-test10.
Diffstat (limited to 'include/asm-alpha')
-rw-r--r--include/asm-alpha/byteorder.h46
-rw-r--r--include/asm-alpha/compiler.h6
-rw-r--r--include/asm-alpha/fcntl.h2
-rw-r--r--include/asm-alpha/pgalloc.h62
-rw-r--r--include/asm-alpha/pgtable.h17
-rw-r--r--include/asm-alpha/string.h9
-rw-r--r--include/asm-alpha/system.h1
-rw-r--r--include/asm-alpha/unaligned.h96
8 files changed, 29 insertions, 210 deletions
diff --git a/include/asm-alpha/byteorder.h b/include/asm-alpha/byteorder.h
index e574bb6e7..edc376a04 100644
--- a/include/asm-alpha/byteorder.h
+++ b/include/asm-alpha/byteorder.h
@@ -3,52 +3,6 @@
#include <asm/types.h>
-/* EGCS 1.1 can, without scheduling, do just as good as we do here
- with the standard macros. And since it can schedule, it does even
- better in the end. */
-
-#if defined(__GNUC__) && __GNUC_MINOR__ < 91
-
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
-{
- __u64 t1, t2, t3;
-
- /* Break the final or's out of the block so that gcc can
- schedule them at will. Further, use add not or so that
- we elide the sign extend gcc will put in because the
- return type is not a long. */
-
- __asm__(
- "insbl %3,3,%1 # %1 = dd000000\n\t"
- "zapnot %3,2,%2 # %2 = 0000cc00\n\t"
- "sll %2,8,%2 # %2 = 00cc0000\n\t"
- "or %2,%1,%1 # %1 = ddcc0000\n\t"
- "zapnot %3,4,%2 # %2 = 00bb0000\n\t"
- "extbl %3,3,%0 # %0 = 000000aa\n\t"
- "srl %2,8,%2 # %2 = 0000bb00"
- : "=r"(t3), "=&r"(t1), "=&r"(t2)
- : "r"(x));
-
- return t3 + t2 + t1;
-}
-
-static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
-{
- __u64 t1, t2;
-
- __asm__(
- "insbl %2,1,%1 # %1 = bb00\n\t"
- "extbl %2,1,%0 # %0 = 00aa"
- : "=r"(t1), "=&r"(t2) : "r"(x));
-
- return t1 | t2;
-}
-
-#define __arch__swab32(x) ___arch__swab32(x)
-#define __arch__swab16(x) ___arch__swab16(x)
-
-#endif /* __GNUC__ */
-
#define __BYTEORDER_HAS_U64__
#include <linux/byteorder/little_endian.h>
diff --git a/include/asm-alpha/compiler.h b/include/asm-alpha/compiler.h
index d3b2808e8..70d6ce775 100644
--- a/include/asm-alpha/compiler.h
+++ b/include/asm-alpha/compiler.h
@@ -9,11 +9,7 @@
* these tests and macros.
*/
-/*
- * EGCS (of varying versions) does a good job of using insxl and extxl.
- */
-
-#if 0 && (__GNUC__ > 2 || __GNUC_MINOR__ >= 91)
+#if 0
#define __kernel_insbl(val, shift) \
(((unsigned long)(val) & 0xfful) << ((shift) * 8))
#define __kernel_inswl(val, shift) \
diff --git a/include/asm-alpha/fcntl.h b/include/asm-alpha/fcntl.h
index 86a73667f..292765efa 100644
--- a/include/asm-alpha/fcntl.h
+++ b/include/asm-alpha/fcntl.h
@@ -48,7 +48,7 @@
#define F_EXLCK 16 /* or 3 */
#define F_SHLCK 32 /* or 4 */
-#define F_INPROGRESS 16
+#define F_INPROGRESS 64
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h
index dc23ef74d..dd09a2eec 100644
--- a/include/asm-alpha/pgalloc.h
+++ b/include/asm-alpha/pgalloc.h
@@ -80,7 +80,7 @@ ev5_flush_tlb_current(struct mm_struct *mm)
__load_new_mm_context(mm);
}
-extern inline void
+static inline void
flush_tlb_other(struct mm_struct *mm)
{
mm->context = 0;
@@ -234,27 +234,13 @@ extern struct pgtable_cache_struct {
#define pte_quicklist (quicklists.pte_cache)
#define pgtable_cache_size (quicklists.pgtable_cache_sz)
-extern __inline__ pgd_t *get_pgd_slow(void)
-{
- pgd_t *ret = (pgd_t *)__get_free_page(GFP_KERNEL), *init;
-
- if (ret) {
- init = pgd_offset(&init_mm, 0UL);
- memset (ret, 0, USER_PTRS_PER_PGD * sizeof(pgd_t));
- memcpy (ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
- (PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
-
- pgd_val(ret[PTRS_PER_PGD])
- = pte_val(mk_pte(virt_to_page(ret), PAGE_KERNEL));
- }
- return ret;
-}
+extern pgd_t *get_pgd_slow(void);
-extern __inline__ pgd_t *get_pgd_fast(void)
+static inline pgd_t *get_pgd_fast(void)
{
unsigned long *ret;
- if((ret = pgd_quicklist) != NULL) {
+ if ((ret = pgd_quicklist) != NULL) {
pgd_quicklist = (unsigned long *)(*ret);
ret[0] = ret[1];
pgtable_cache_size--;
@@ -263,25 +249,25 @@ extern __inline__ pgd_t *get_pgd_fast(void)
return (pgd_t *)ret;
}
-extern __inline__ void free_pgd_fast(pgd_t *pgd)
+static inline void free_pgd_fast(pgd_t *pgd)
{
*(unsigned long *)pgd = (unsigned long) pgd_quicklist;
pgd_quicklist = (unsigned long *) pgd;
pgtable_cache_size++;
}
-extern __inline__ void free_pgd_slow(pgd_t *pgd)
+static inline void free_pgd_slow(pgd_t *pgd)
{
free_page((unsigned long)pgd);
}
extern pmd_t *get_pmd_slow(pgd_t *pgd, unsigned long address_premasked);
-extern __inline__ pmd_t *get_pmd_fast(void)
+static inline pmd_t *get_pmd_fast(void)
{
unsigned long *ret;
- if((ret = (unsigned long *)pte_quicklist) != NULL) {
+ if ((ret = (unsigned long *)pte_quicklist) != NULL) {
pte_quicklist = (unsigned long *)(*ret);
ret[0] = ret[1];
pgtable_cache_size--;
@@ -289,25 +275,25 @@ extern __inline__ pmd_t *get_pmd_fast(void)
return (pmd_t *)ret;
}
-extern __inline__ void free_pmd_fast(pmd_t *pmd)
+static inline void free_pmd_fast(pmd_t *pmd)
{
*(unsigned long *)pmd = (unsigned long) pte_quicklist;
pte_quicklist = (unsigned long *) pmd;
pgtable_cache_size++;
}
-extern __inline__ void free_pmd_slow(pmd_t *pmd)
+static inline void free_pmd_slow(pmd_t *pmd)
{
free_page((unsigned long)pmd);
}
extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long address_preadjusted);
-extern __inline__ pte_t *get_pte_fast(void)
+static inline pte_t *get_pte_fast(void)
{
unsigned long *ret;
- if((ret = (unsigned long *)pte_quicklist) != NULL) {
+ if ((ret = (unsigned long *)pte_quicklist) != NULL) {
pte_quicklist = (unsigned long *)(*ret);
ret[0] = ret[1];
pgtable_cache_size--;
@@ -315,14 +301,14 @@ extern __inline__ pte_t *get_pte_fast(void)
return (pte_t *)ret;
}
-extern __inline__ void free_pte_fast(pte_t *pte)
+static inline void free_pte_fast(pte_t *pte)
{
*(unsigned long *)pte = (unsigned long) pte_quicklist;
pte_quicklist = (unsigned long *) pte;
pgtable_cache_size++;
}
-extern __inline__ void free_pte_slow(pte_t *pte)
+static inline void free_pte_slow(pte_t *pte)
{
free_page((unsigned long)pte);
}
@@ -337,7 +323,7 @@ extern void __bad_pmd(pgd_t *pgd);
#define pgd_free(pgd) free_pgd_fast(pgd)
#define pgd_alloc() get_pgd_fast()
-extern inline pte_t * pte_alloc(pmd_t *pmd, unsigned long address)
+static inline pte_t * pte_alloc(pmd_t *pmd, unsigned long address)
{
address = (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
if (pmd_none(*pmd)) {
@@ -355,7 +341,7 @@ extern inline pte_t * pte_alloc(pmd_t *pmd, unsigned long address)
return (pte_t *) pmd_page(*pmd) + address;
}
-extern inline pmd_t * pmd_alloc(pgd_t *pgd, unsigned long address)
+static inline pmd_t * pmd_alloc(pgd_t *pgd, unsigned long address)
{
address = (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
if (pgd_none(*pgd)) {
@@ -378,20 +364,4 @@ extern inline pmd_t * pmd_alloc(pgd_t *pgd, unsigned long address)
extern int do_check_pgt_cache(int, int);
-extern inline void set_pgdir(unsigned long address, pgd_t entry)
-{
- struct task_struct * p;
- pgd_t *pgd;
-
- read_lock(&tasklist_lock);
- for_each_task(p) {
- if (!p->mm)
- continue;
- *pgd_offset(p->mm,address) = entry;
- }
- read_unlock(&tasklist_lock);
- for (pgd = (pgd_t *)pgd_quicklist; pgd; pgd = (pgd_t *)*(unsigned long *)pgd)
- pgd[(address >> PGDIR_SHIFT) & (PTRS_PER_PAGE - 1)] = entry;
-}
-
#endif /* _ALPHA_PGALLOC_H */
diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h
index d68e18332..5c4373d3b 100644
--- a/include/asm-alpha/pgtable.h
+++ b/include/asm-alpha/pgtable.h
@@ -33,22 +33,23 @@
/*
* Entries per page directory level: the Alpha is three-level, with
* all levels having a one-page page table.
- *
- * The PGD is special: the last entry is reserved for self-mapping.
*/
#define PTRS_PER_PTE (1UL << (PAGE_SHIFT-3))
#define PTRS_PER_PMD (1UL << (PAGE_SHIFT-3))
-#define PTRS_PER_PGD ((1UL << (PAGE_SHIFT-3))-1)
+#define PTRS_PER_PGD (1UL << (PAGE_SHIFT-3))
#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
#define FIRST_USER_PGD_NR 0
/* Number of pointers that fit on a page: this will go away. */
#define PTRS_PER_PAGE (1UL << (PAGE_SHIFT-3))
-#define CONSOLE_REMAP_START 0xFFFFFE0000000000
-#define VMALLOC_START (CONSOLE_REMAP_START + PMD_SIZE)
+#ifdef CONFIG_ALPHA_LARGE_VMALLOC
+#define VMALLOC_START 0xfffffe0000000000
+#else
+#define VMALLOC_START (-2*PGDIR_SIZE)
+#endif
#define VMALLOC_VMADDR(x) ((unsigned long)(x))
-#define VMALLOC_END (~0UL)
+#define VMALLOC_END (-PGDIR_SIZE)
/*
* OSF/1 PAL-code-imposed page table bits
@@ -260,7 +261,7 @@ extern inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= __ACCESS_BITS; retu
#define pgd_offset_k(address) pgd_offset(&init_mm, address)
/* to find an entry in a page-table-directory. */
-#define pgd_index(address) ((address >> PGDIR_SHIFT) & PTRS_PER_PGD)
+#define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1))
#define __pgd_offset(address) pgd_index(address)
#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
@@ -319,4 +320,6 @@ extern inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
extern void paging_init(void);
+#include <asm-generic/pgtable.h>
+
#endif /* _ALPHA_PGTABLE_H */
diff --git a/include/asm-alpha/string.h b/include/asm-alpha/string.h
index 2b9cf9438..9e44fea66 100644
--- a/include/asm-alpha/string.h
+++ b/include/asm-alpha/string.h
@@ -18,28 +18,19 @@ extern void * memmove(void *, const void *, size_t);
/* For backward compatibility with modules. Unused otherwise. */
extern void * __memcpy(void *, const void *, size_t);
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
#define memcpy __builtin_memcpy
-#endif
#define __HAVE_ARCH_MEMSET
extern void * __constant_c_memset(void *, unsigned long, size_t);
extern void * __memset(void *, int, size_t);
extern void * memset(void *, int, size_t);
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
#define memset(s, c, n) \
(__builtin_constant_p(c) \
? (__builtin_constant_p(n) && (c) == 0 \
? __builtin_memset((s),0,(n)) \
: __constant_c_memset((s),0x0101010101010101UL*(unsigned char)(c),(n))) \
: __memset((s),(c),(n)))
-#else
-#define memset(s, c, n) \
-(__builtin_constant_p(c) \
- ? __constant_c_memset((s),0x0101010101010101UL*(unsigned char)(c),(n)) \
- : __memset((s),(c),(n)))
-#endif
#define __HAVE_ARCH_STRCPY
extern char * strcpy(char *,const char *);
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h
index b97d0c5b6..6d34c5472 100644
--- a/include/asm-alpha/system.h
+++ b/include/asm-alpha/system.h
@@ -36,6 +36,7 @@
#define START_ADDR (PAGE_OFFSET+KERNEL_START_PHYS+0x10000)
#ifndef __ASSEMBLY__
+#include <linux/kernel.h>
/*
* This is the logout header that should be common to all platforms
diff --git a/include/asm-alpha/unaligned.h b/include/asm-alpha/unaligned.h
index 8017f6bfa..1ec3e969e 100644
--- a/include/asm-alpha/unaligned.h
+++ b/include/asm-alpha/unaligned.h
@@ -31,59 +31,20 @@ struct __una_u16 { __u16 x __attribute__((packed)); };
extern inline unsigned long __uldq(const unsigned long * r11)
{
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
return ptr->x;
-#else
- unsigned long r1,r2;
- __asm__("ldq_u %0,%3\n\t"
- "ldq_u %1,%4\n\t"
- "extql %0,%2,%0\n\t"
- "extqh %1,%2,%1"
- :"=&r" (r1), "=&r" (r2)
- :"r" (r11),
- "m" (*r11),
- "m" (*(const unsigned long *)(7+(char *) r11)));
- return r1 | r2;
-#endif
}
extern inline unsigned long __uldl(const unsigned int * r11)
{
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
return ptr->x;
-#else
- unsigned long r1,r2;
- __asm__("ldq_u %0,%3\n\t"
- "ldq_u %1,%4\n\t"
- "extll %0,%2,%0\n\t"
- "extlh %1,%2,%1"
- :"=&r" (r1), "=&r" (r2)
- :"r" (r11),
- "m" (*r11),
- "m" (*(const unsigned long *)(3+(char *) r11)));
- return r1 | r2;
-#endif
}
extern inline unsigned long __uldw(const unsigned short * r11)
{
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
return ptr->x;
-#else
- unsigned long r1,r2;
- __asm__("ldq_u %0,%3\n\t"
- "ldq_u %1,%4\n\t"
- "extwl %0,%2,%0\n\t"
- "extwh %1,%2,%1"
- :"=&r" (r1), "=&r" (r2)
- :"r" (r11),
- "m" (*r11),
- "m" (*(const unsigned long *)(1+(char *) r11)));
- return r1 | r2;
-#endif
}
/*
@@ -92,77 +53,20 @@ extern inline unsigned long __uldw(const unsigned short * r11)
extern inline void __ustq(unsigned long r5, unsigned long * r11)
{
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
struct __una_u64 *ptr = (struct __una_u64 *) r11;
ptr->x = r5;
-#else
- unsigned long r1,r2,r3,r4;
-
- __asm__("ldq_u %3,%1\n\t"
- "ldq_u %2,%0\n\t"
- "insqh %6,%7,%5\n\t"
- "insql %6,%7,%4\n\t"
- "mskqh %3,%7,%3\n\t"
- "mskql %2,%7,%2\n\t"
- "bis %3,%5,%3\n\t"
- "bis %2,%4,%2\n\t"
- "stq_u %3,%1\n\t"
- "stq_u %2,%0"
- :"=m" (*r11),
- "=m" (*(unsigned long *)(7+(char *) r11)),
- "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
- :"r" (r5), "r" (r11));
-#endif
}
extern inline void __ustl(unsigned long r5, unsigned int * r11)
{
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
struct __una_u32 *ptr = (struct __una_u32 *) r11;
ptr->x = r5;
-#else
- unsigned long r1,r2,r3,r4;
-
- __asm__("ldq_u %3,%1\n\t"
- "ldq_u %2,%0\n\t"
- "inslh %6,%7,%5\n\t"
- "insll %6,%7,%4\n\t"
- "msklh %3,%7,%3\n\t"
- "mskll %2,%7,%2\n\t"
- "bis %3,%5,%3\n\t"
- "bis %2,%4,%2\n\t"
- "stq_u %3,%1\n\t"
- "stq_u %2,%0"
- :"=m" (*r11),
- "=m" (*(unsigned long *)(3+(char *) r11)),
- "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
- :"r" (r5), "r" (r11));
-#endif
}
extern inline void __ustw(unsigned long r5, unsigned short * r11)
{
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 91
struct __una_u16 *ptr = (struct __una_u16 *) r11;
ptr->x = r5;
-#else
- unsigned long r1,r2,r3,r4;
-
- __asm__("ldq_u %3,%1\n\t"
- "ldq_u %2,%0\n\t"
- "inswh %6,%7,%5\n\t"
- "inswl %6,%7,%4\n\t"
- "mskwh %3,%7,%3\n\t"
- "mskwl %2,%7,%2\n\t"
- "bis %3,%5,%3\n\t"
- "bis %2,%4,%2\n\t"
- "stq_u %3,%1\n\t"
- "stq_u %2,%0"
- :"=m" (*r11),
- "=m" (*(unsigned long *)(1+(char *) r11)),
- "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
- :"r" (r5), "r" (r11));
-#endif
}
extern inline unsigned long __get_unaligned(const void *ptr, size_t size)