aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-alpha
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-alpha')
-rw-r--r--include/asm-alpha/a.out-core.h80
-rw-r--r--include/asm-alpha/a.out.h8
-rw-r--r--include/asm-alpha/atomic.h2
-rw-r--r--include/asm-alpha/elf.h3
-rw-r--r--include/asm-alpha/page.h5
-rw-r--r--include/asm-alpha/param.h10
-rw-r--r--include/asm-alpha/pci.h1
-rw-r--r--include/asm-alpha/pgalloc.h28
-rw-r--r--include/asm-alpha/processor.h5
-rw-r--r--include/asm-alpha/system.h15
-rw-r--r--include/asm-alpha/tlb.h4
-rw-r--r--include/asm-alpha/tlbflush.h6
-rw-r--r--include/asm-alpha/unistd.h1
-rw-r--r--include/asm-alpha/user.h2
14 files changed, 129 insertions, 41 deletions
diff --git a/include/asm-alpha/a.out-core.h b/include/asm-alpha/a.out-core.h
new file mode 100644
index 000000000000..9e33e92e524c
--- /dev/null
+++ b/include/asm-alpha/a.out-core.h
@@ -0,0 +1,80 @@
1/* a.out coredump register dumper
2 *
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12#ifndef _ASM_A_OUT_CORE_H
13#define _ASM_A_OUT_CORE_H
14
15#ifdef __KERNEL__
16
17#include <linux/user.h>
18
19/*
20 * Fill in the user structure for an ECOFF core dump.
21 */
22static inline void aout_dump_thread(struct pt_regs *pt, struct user *dump)
23{
24 /* switch stack follows right below pt_regs: */
25 struct switch_stack * sw = ((struct switch_stack *) pt) - 1;
26
27 dump->magic = CMAGIC;
28 dump->start_code = current->mm->start_code;
29 dump->start_data = current->mm->start_data;
30 dump->start_stack = rdusp() & ~(PAGE_SIZE - 1);
31 dump->u_tsize = ((current->mm->end_code - dump->start_code)
32 >> PAGE_SHIFT);
33 dump->u_dsize = ((current->mm->brk + PAGE_SIZE-1 - dump->start_data)
34 >> PAGE_SHIFT);
35 dump->u_ssize = (current->mm->start_stack - dump->start_stack
36 + PAGE_SIZE-1) >> PAGE_SHIFT;
37
38 /*
39 * We store the registers in an order/format that is
40 * compatible with DEC Unix/OSF/1 as this makes life easier
41 * for gdb.
42 */
43 dump->regs[EF_V0] = pt->r0;
44 dump->regs[EF_T0] = pt->r1;
45 dump->regs[EF_T1] = pt->r2;
46 dump->regs[EF_T2] = pt->r3;
47 dump->regs[EF_T3] = pt->r4;
48 dump->regs[EF_T4] = pt->r5;
49 dump->regs[EF_T5] = pt->r6;
50 dump->regs[EF_T6] = pt->r7;
51 dump->regs[EF_T7] = pt->r8;
52 dump->regs[EF_S0] = sw->r9;
53 dump->regs[EF_S1] = sw->r10;
54 dump->regs[EF_S2] = sw->r11;
55 dump->regs[EF_S3] = sw->r12;
56 dump->regs[EF_S4] = sw->r13;
57 dump->regs[EF_S5] = sw->r14;
58 dump->regs[EF_S6] = sw->r15;
59 dump->regs[EF_A3] = pt->r19;
60 dump->regs[EF_A4] = pt->r20;
61 dump->regs[EF_A5] = pt->r21;
62 dump->regs[EF_T8] = pt->r22;
63 dump->regs[EF_T9] = pt->r23;
64 dump->regs[EF_T10] = pt->r24;
65 dump->regs[EF_T11] = pt->r25;
66 dump->regs[EF_RA] = pt->r26;
67 dump->regs[EF_T12] = pt->r27;
68 dump->regs[EF_AT] = pt->r28;
69 dump->regs[EF_SP] = rdusp();
70 dump->regs[EF_PS] = pt->ps;
71 dump->regs[EF_PC] = pt->pc;
72 dump->regs[EF_GP] = pt->gp;
73 dump->regs[EF_A0] = pt->r16;
74 dump->regs[EF_A1] = pt->r17;
75 dump->regs[EF_A2] = pt->r18;
76 memcpy((char *)dump->regs + EF_SIZE, sw->fp, 32 * 8);
77}
78
79#endif /* __KERNEL__ */
80#endif /* _ASM_A_OUT_CORE_H */
diff --git a/include/asm-alpha/a.out.h b/include/asm-alpha/a.out.h
index e43cf61649a9..02ce8473870a 100644
--- a/include/asm-alpha/a.out.h
+++ b/include/asm-alpha/a.out.h
@@ -98,11 +98,5 @@ struct exec
98 set_personality (((BFPM->sh_bang || EX.ah.entry < 0x100000000L \ 98 set_personality (((BFPM->sh_bang || EX.ah.entry < 0x100000000L \
99 ? ADDR_LIMIT_32BIT : 0) | PER_OSF4)) 99 ? ADDR_LIMIT_32BIT : 0) | PER_OSF4))
100 100
101#define STACK_TOP \ 101#endif /* __KERNEL__ */
102 (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
103
104#define STACK_TOP_MAX 0x00120000000UL
105
106#endif
107
108#endif /* __A_OUT_GNU_H__ */ 102#endif /* __A_OUT_GNU_H__ */
diff --git a/include/asm-alpha/atomic.h b/include/asm-alpha/atomic.h
index f5cb7b878af2..ca88e54dec93 100644
--- a/include/asm-alpha/atomic.h
+++ b/include/asm-alpha/atomic.h
@@ -100,7 +100,7 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v)
100/* 100/*
101 * Same as above, but return the result value 101 * Same as above, but return the result value
102 */ 102 */
103static __inline__ long atomic_add_return(int i, atomic_t * v) 103static inline int atomic_add_return(int i, atomic_t *v)
104{ 104{
105 long temp, result; 105 long temp, result;
106 smp_mb(); 106 smp_mb();
diff --git a/include/asm-alpha/elf.h b/include/asm-alpha/elf.h
index 4b518e3b952c..fc1002ea1e0c 100644
--- a/include/asm-alpha/elf.h
+++ b/include/asm-alpha/elf.h
@@ -144,8 +144,6 @@ extern int dump_elf_task_fp(elf_fpreg_t *dest, struct task_struct *task);
144 : amask (AMASK_CIX) ? "ev6" : "ev67"); \ 144 : amask (AMASK_CIX) ? "ev6" : "ev67"); \
145}) 145})
146 146
147#ifdef __KERNEL__
148
149#define SET_PERSONALITY(EX, IBCS2) \ 147#define SET_PERSONALITY(EX, IBCS2) \
150 set_personality(((EX).e_flags & EF_ALPHA_32BIT) \ 148 set_personality(((EX).e_flags & EF_ALPHA_32BIT) \
151 ? PER_LINUX_32BIT : (IBCS2) ? PER_SVR4 : PER_LINUX) 149 ? PER_LINUX_32BIT : (IBCS2) ? PER_SVR4 : PER_LINUX)
@@ -164,5 +162,4 @@ extern int alpha_l3_cacheshape;
164 NEW_AUX_ENT(AT_L3_CACHESHAPE, alpha_l3_cacheshape); \ 162 NEW_AUX_ENT(AT_L3_CACHESHAPE, alpha_l3_cacheshape); \
165 } while (0) 163 } while (0)
166 164
167#endif /* __KERNEL__ */
168#endif /* __ASM_ALPHA_ELF_H */ 165#endif /* __ASM_ALPHA_ELF_H */
diff --git a/include/asm-alpha/page.h b/include/asm-alpha/page.h
index 8cc97bfd3789..22ff9762d17b 100644
--- a/include/asm-alpha/page.h
+++ b/include/asm-alpha/page.h
@@ -1,8 +1,6 @@
1#ifndef _ALPHA_PAGE_H 1#ifndef _ALPHA_PAGE_H
2#define _ALPHA_PAGE_H 2#define _ALPHA_PAGE_H
3 3
4#ifdef __KERNEL__
5
6#include <linux/const.h> 4#include <linux/const.h>
7#include <asm/pal.h> 5#include <asm/pal.h>
8 6
@@ -64,6 +62,8 @@ typedef unsigned long pgprot_t;
64 62
65#endif /* STRICT_MM_TYPECHECKS */ 63#endif /* STRICT_MM_TYPECHECKS */
66 64
65typedef struct page *pgtable_t;
66
67#ifdef USE_48_BIT_KSEG 67#ifdef USE_48_BIT_KSEG
68#define PAGE_OFFSET 0xffff800000000000UL 68#define PAGE_OFFSET 0xffff800000000000UL
69#else 69#else
@@ -98,5 +98,4 @@ typedef unsigned long pgprot_t;
98#include <asm-generic/memory_model.h> 98#include <asm-generic/memory_model.h>
99#include <asm-generic/page.h> 99#include <asm-generic/page.h>
100 100
101#endif /* __KERNEL__ */
102#endif /* _ALPHA_PAGE_H */ 101#endif /* _ALPHA_PAGE_H */
diff --git a/include/asm-alpha/param.h b/include/asm-alpha/param.h
index 214e7996346f..0982f1d39499 100644
--- a/include/asm-alpha/param.h
+++ b/include/asm-alpha/param.h
@@ -5,15 +5,7 @@
5 hardware ignores reprogramming. We also need userland buy-in to the 5 hardware ignores reprogramming. We also need userland buy-in to the
6 change in HZ, since this is visible in the wait4 resources etc. */ 6 change in HZ, since this is visible in the wait4 resources etc. */
7 7
8 8#define HZ CONFIG_HZ
9#ifndef HZ
10# ifndef CONFIG_ALPHA_RAWHIDE
11# define HZ 1024
12# else
13# define HZ 1200
14# endif
15#endif
16
17#define USER_HZ HZ 9#define USER_HZ HZ
18 10
19#define EXEC_PAGESIZE 8192 11#define EXEC_PAGESIZE 8192
diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h
index 30ee7669b19f..d5b10ef64364 100644
--- a/include/asm-alpha/pci.h
+++ b/include/asm-alpha/pci.h
@@ -4,6 +4,7 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/spinlock.h> 6#include <linux/spinlock.h>
7#include <linux/dma-mapping.h>
7#include <asm/scatterlist.h> 8#include <asm/scatterlist.h>
8#include <asm/machvec.h> 9#include <asm/machvec.h>
9 10
diff --git a/include/asm-alpha/pgalloc.h b/include/asm-alpha/pgalloc.h
index 471864e8d4c3..fd090155dccd 100644
--- a/include/asm-alpha/pgalloc.h
+++ b/include/asm-alpha/pgalloc.h
@@ -11,10 +11,11 @@
11 */ 11 */
12 12
13static inline void 13static inline void
14pmd_populate(struct mm_struct *mm, pmd_t *pmd, struct page *pte) 14pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t pte)
15{ 15{
16 pmd_set(pmd, (pte_t *)(page_to_pa(pte) + PAGE_OFFSET)); 16 pmd_set(pmd, (pte_t *)(page_to_pa(pte) + PAGE_OFFSET));
17} 17}
18#define pmd_pgtable(pmd) pmd_page(pmd)
18 19
19static inline void 20static inline void
20pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte) 21pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
@@ -31,7 +32,7 @@ pgd_populate(struct mm_struct *mm, pgd_t *pgd, pmd_t *pmd)
31extern pgd_t *pgd_alloc(struct mm_struct *mm); 32extern pgd_t *pgd_alloc(struct mm_struct *mm);
32 33
33static inline void 34static inline void
34pgd_free(pgd_t *pgd) 35pgd_free(struct mm_struct *mm, pgd_t *pgd)
35{ 36{
36 free_page((unsigned long)pgd); 37 free_page((unsigned long)pgd);
37} 38}
@@ -44,7 +45,7 @@ pmd_alloc_one(struct mm_struct *mm, unsigned long address)
44} 45}
45 46
46static inline void 47static inline void
47pmd_free(pmd_t *pmd) 48pmd_free(struct mm_struct *mm, pmd_t *pmd)
48{ 49{
49 free_page((unsigned long)pmd); 50 free_page((unsigned long)pmd);
50} 51}
@@ -52,23 +53,28 @@ pmd_free(pmd_t *pmd)
52extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr); 53extern pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long addr);
53 54
54static inline void 55static inline void
55pte_free_kernel(pte_t *pte) 56pte_free_kernel(struct mm_struct *mm, pte_t *pte)
56{ 57{
57 free_page((unsigned long)pte); 58 free_page((unsigned long)pte);
58} 59}
59 60
60static inline struct page * 61static inline pgtable_t
61pte_alloc_one(struct mm_struct *mm, unsigned long addr) 62pte_alloc_one(struct mm_struct *mm, unsigned long address)
62{ 63{
63 pte_t *pte = pte_alloc_one_kernel(mm, addr); 64 pte_t *pte = pte_alloc_one_kernel(mm, address);
64 if (pte) 65 struct page *page;
65 return virt_to_page(pte); 66
66 return NULL; 67 if (!pte)
68 return NULL;
69 page = virt_to_page(pte);
70 pgtable_page_ctor(page);
71 return page;
67} 72}
68 73
69static inline void 74static inline void
70pte_free(struct page *page) 75pte_free(struct mm_struct *mm, pgtable_t page)
71{ 76{
77 pgtable_page_dtor(page);
72 __free_page(page); 78 __free_page(page);
73} 79}
74 80
diff --git a/include/asm-alpha/processor.h b/include/asm-alpha/processor.h
index 425b7b6d28cb..94afe5859301 100644
--- a/include/asm-alpha/processor.h
+++ b/include/asm-alpha/processor.h
@@ -20,6 +20,11 @@
20 */ 20 */
21#define TASK_SIZE (0x40000000000UL) 21#define TASK_SIZE (0x40000000000UL)
22 22
23#define STACK_TOP \
24 (current->personality & ADDR_LIMIT_32BIT ? 0x80000000 : 0x00120000000UL)
25
26#define STACK_TOP_MAX 0x00120000000UL
27
23/* This decides where the kernel will search for a free chunk of vm 28/* This decides where the kernel will search for a free chunk of vm
24 * space during mmap's. 29 * space during mmap's.
25 */ 30 */
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h
index fd9dc889f36c..ed221d6408fc 100644
--- a/include/asm-alpha/system.h
+++ b/include/asm-alpha/system.h
@@ -681,13 +681,18 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
681 return old; 681 return old;
682} 682}
683 683
684#define cmpxchg(ptr,o,n) \ 684#define cmpxchg(ptr, o, n) \
685 ({ \ 685 ({ \
686 __typeof__(*(ptr)) _o_ = (o); \ 686 __typeof__(*(ptr)) _o_ = (o); \
687 __typeof__(*(ptr)) _n_ = (n); \ 687 __typeof__(*(ptr)) _n_ = (n); \
688 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ 688 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
689 (unsigned long)_n_, sizeof(*(ptr))); \ 689 (unsigned long)_n_, sizeof(*(ptr))); \
690 }) 690 })
691#define cmpxchg64(ptr, o, n) \
692 ({ \
693 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
694 cmpxchg((ptr), (o), (n)); \
695 })
691 696
692static inline unsigned long 697static inline unsigned long
693__cmpxchg_u8_local(volatile char *m, long old, long new) 698__cmpxchg_u8_local(volatile char *m, long old, long new)
@@ -803,13 +808,19 @@ __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
803 return old; 808 return old;
804} 809}
805 810
806#define cmpxchg_local(ptr,o,n) \ 811#define cmpxchg_local(ptr, o, n) \
807 ({ \ 812 ({ \
808 __typeof__(*(ptr)) _o_ = (o); \ 813 __typeof__(*(ptr)) _o_ = (o); \
809 __typeof__(*(ptr)) _n_ = (n); \ 814 __typeof__(*(ptr)) _n_ = (n); \
810 (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \ 815 (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \
811 (unsigned long)_n_, sizeof(*(ptr))); \ 816 (unsigned long)_n_, sizeof(*(ptr))); \
812 }) 817 })
818#define cmpxchg64_local(ptr, o, n) \
819 ({ \
820 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
821 cmpxchg_local((ptr), (o), (n)); \
822 })
823
813 824
814#endif /* __ASSEMBLY__ */ 825#endif /* __ASSEMBLY__ */
815 826
diff --git a/include/asm-alpha/tlb.h b/include/asm-alpha/tlb.h
index aa91335533e0..c13636575fba 100644
--- a/include/asm-alpha/tlb.h
+++ b/include/asm-alpha/tlb.h
@@ -9,7 +9,7 @@
9 9
10#include <asm-generic/tlb.h> 10#include <asm-generic/tlb.h>
11 11
12#define __pte_free_tlb(tlb,pte) pte_free(pte) 12#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte)
13#define __pmd_free_tlb(tlb,pmd) pmd_free(pmd) 13#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd)
14 14
15#endif 15#endif
diff --git a/include/asm-alpha/tlbflush.h b/include/asm-alpha/tlbflush.h
index b9e9147226f7..9d87aaa08c0d 100644
--- a/include/asm-alpha/tlbflush.h
+++ b/include/asm-alpha/tlbflush.h
@@ -142,6 +142,10 @@ extern void flush_tlb_range(struct vm_area_struct *, unsigned long,
142 142
143#endif /* CONFIG_SMP */ 143#endif /* CONFIG_SMP */
144 144
145#define flush_tlb_kernel_range(start, end) flush_tlb_all() 145static inline void flush_tlb_kernel_range(unsigned long start,
146 unsigned long end)
147{
148 flush_tlb_all();
149}
146 150
147#endif /* _ALPHA_TLBFLUSH_H */ 151#endif /* _ALPHA_TLBFLUSH_H */
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
index 29bf2fdc91c0..5b5c17485942 100644
--- a/include/asm-alpha/unistd.h
+++ b/include/asm-alpha/unistd.h
@@ -442,7 +442,6 @@
442#define __ARCH_WANT_OLD_READDIR 442#define __ARCH_WANT_OLD_READDIR
443#define __ARCH_WANT_STAT64 443#define __ARCH_WANT_STAT64
444#define __ARCH_WANT_SYS_GETHOSTNAME 444#define __ARCH_WANT_SYS_GETHOSTNAME
445#define __ARCH_WANT_SYS_SOCKETCALL
446#define __ARCH_WANT_SYS_FADVISE64 445#define __ARCH_WANT_SYS_FADVISE64
447#define __ARCH_WANT_SYS_GETPGRP 446#define __ARCH_WANT_SYS_GETPGRP
448#define __ARCH_WANT_SYS_OLD_GETRLIMIT 447#define __ARCH_WANT_SYS_OLD_GETRLIMIT
diff --git a/include/asm-alpha/user.h b/include/asm-alpha/user.h
index 7e417fc9d491..a4eb6a4ca8d1 100644
--- a/include/asm-alpha/user.h
+++ b/include/asm-alpha/user.h
@@ -39,7 +39,7 @@ struct user {
39 unsigned long start_data; /* data starting address */ 39 unsigned long start_data; /* data starting address */
40 unsigned long start_stack; /* stack starting address */ 40 unsigned long start_stack; /* stack starting address */
41 long int signal; /* signal causing core dump */ 41 long int signal; /* signal causing core dump */
42 struct regs * u_ar0; /* help gdb find registers */ 42 unsigned long u_ar0; /* help gdb find registers */
43 unsigned long magic; /* identifies a core file */ 43 unsigned long magic; /* identifies a core file */
44 char u_comm[32]; /* user command name */ 44 char u_comm[32]; /* user command name */
45}; 45};