diff options
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r-- | include/asm-sparc64/a.out-core.h | 31 | ||||
-rw-r--r-- | include/asm-sparc64/a.out.h | 12 | ||||
-rw-r--r-- | include/asm-sparc64/elf.h | 91 | ||||
-rw-r--r-- | include/asm-sparc64/io.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/page.h | 5 | ||||
-rw-r--r-- | include/asm-sparc64/pgalloc.h | 25 | ||||
-rw-r--r-- | include/asm-sparc64/posix_types.h | 8 | ||||
-rw-r--r-- | include/asm-sparc64/processor.h | 13 | ||||
-rw-r--r-- | include/asm-sparc64/ptrace.h | 18 | ||||
-rw-r--r-- | include/asm-sparc64/system.h | 29 | ||||
-rw-r--r-- | include/asm-sparc64/timex.h | 6 | ||||
-rw-r--r-- | include/asm-sparc64/tlb.h | 4 | ||||
-rw-r--r-- | include/asm-sparc64/uaccess.h | 1 | ||||
-rw-r--r-- | include/asm-sparc64/unistd.h | 6 | ||||
-rw-r--r-- | include/asm-sparc64/user.h | 2 |
15 files changed, 158 insertions, 95 deletions
diff --git a/include/asm-sparc64/a.out-core.h b/include/asm-sparc64/a.out-core.h new file mode 100644 index 000000000000..3499b3c425ca --- /dev/null +++ b/include/asm-sparc64/a.out-core.h | |||
@@ -0,0 +1,31 @@ | |||
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 a.out core dump | ||
21 | */ | ||
22 | static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump) | ||
23 | { | ||
24 | /* Only should be used for SunOS and ancient a.out | ||
25 | * SparcLinux binaries... Not worth implementing. | ||
26 | */ | ||
27 | memset(dump, 0, sizeof(struct user)); | ||
28 | } | ||
29 | |||
30 | #endif /* __KERNEL__ */ | ||
31 | #endif /* _ASM_A_OUT_CORE_H */ | ||
diff --git a/include/asm-sparc64/a.out.h b/include/asm-sparc64/a.out.h index 902e07f89a42..53c95bdfc66e 100644 --- a/include/asm-sparc64/a.out.h +++ b/include/asm-sparc64/a.out.h | |||
@@ -93,18 +93,6 @@ struct relocation_info /* used when header.a_machtype == M_SPARC */ | |||
93 | 93 | ||
94 | #define N_RELOCATION_INFO_DECLARED 1 | 94 | #define N_RELOCATION_INFO_DECLARED 1 |
95 | 95 | ||
96 | #ifdef __KERNEL__ | ||
97 | |||
98 | #define STACK_TOP32 ((1UL << 32UL) - PAGE_SIZE) | ||
99 | #define STACK_TOP64 (0x0000080000000000UL - (1UL << 32UL)) | ||
100 | |||
101 | #define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ | ||
102 | STACK_TOP32 : STACK_TOP64) | ||
103 | |||
104 | #define STACK_TOP_MAX STACK_TOP64 | ||
105 | |||
106 | #endif | ||
107 | |||
108 | #endif /* !(__ASSEMBLY__) */ | 96 | #endif /* !(__ASSEMBLY__) */ |
109 | 97 | ||
110 | #endif /* !(__SPARC64_A_OUT_H__) */ | 98 | #endif /* !(__SPARC64_A_OUT_H__) */ |
diff --git a/include/asm-sparc64/elf.h b/include/asm-sparc64/elf.h index 8653e8665009..11c8e68d712a 100644 --- a/include/asm-sparc64/elf.h +++ b/include/asm-sparc64/elf.h | |||
@@ -7,11 +7,9 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <asm/ptrace.h> | 9 | #include <asm/ptrace.h> |
10 | #ifdef __KERNEL__ | ||
11 | #include <asm/processor.h> | 10 | #include <asm/processor.h> |
12 | #include <asm/uaccess.h> | 11 | #include <asm/uaccess.h> |
13 | #include <asm/spitfire.h> | 12 | #include <asm/spitfire.h> |
14 | #endif | ||
15 | 13 | ||
16 | /* | 14 | /* |
17 | * Sparc section types | 15 | * Sparc section types |
@@ -72,18 +70,15 @@ | |||
72 | #define HWCAP_SPARC_BLKINIT 64 | 70 | #define HWCAP_SPARC_BLKINIT 64 |
73 | #define HWCAP_SPARC_N2 128 | 71 | #define HWCAP_SPARC_N2 128 |
74 | 72 | ||
73 | #define CORE_DUMP_USE_REGSET | ||
74 | |||
75 | /* | 75 | /* |
76 | * These are used to set parameters in the core dumps. | 76 | * These are used to set parameters in the core dumps. |
77 | */ | 77 | */ |
78 | #ifndef ELF_ARCH | ||
79 | #define ELF_ARCH EM_SPARCV9 | 78 | #define ELF_ARCH EM_SPARCV9 |
80 | #define ELF_CLASS ELFCLASS64 | 79 | #define ELF_CLASS ELFCLASS64 |
81 | #define ELF_DATA ELFDATA2MSB | 80 | #define ELF_DATA ELFDATA2MSB |
82 | 81 | ||
83 | typedef unsigned long elf_greg_t; | ||
84 | |||
85 | #define ELF_NGREG 36 | ||
86 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | ||
87 | /* Format of 64-bit elf_gregset_t is: | 82 | /* Format of 64-bit elf_gregset_t is: |
88 | * G0 --> G7 | 83 | * G0 --> G7 |
89 | * O0 --> O7 | 84 | * O0 --> O7 |
@@ -94,24 +89,9 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | |||
94 | * TNPC | 89 | * TNPC |
95 | * Y | 90 | * Y |
96 | */ | 91 | */ |
97 | #define ELF_CORE_COPY_REGS(__elf_regs, __pt_regs) \ | 92 | typedef unsigned long elf_greg_t; |
98 | do { unsigned long *dest = &(__elf_regs[0]); \ | 93 | #define ELF_NGREG 36 |
99 | struct pt_regs *src = (__pt_regs); \ | 94 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; |
100 | unsigned long __user *sp; \ | ||
101 | int i; \ | ||
102 | for(i = 0; i < 16; i++) \ | ||
103 | dest[i] = src->u_regs[i]; \ | ||
104 | /* Don't try this at home kids... */ \ | ||
105 | sp = (unsigned long __user *) \ | ||
106 | ((src->u_regs[14] + STACK_BIAS) \ | ||
107 | & 0xfffffffffffffff8UL); \ | ||
108 | for(i = 0; i < 16; i++) \ | ||
109 | __get_user(dest[i+16], &sp[i]); \ | ||
110 | dest[32] = src->tstate; \ | ||
111 | dest[33] = src->tpc; \ | ||
112 | dest[34] = src->tnpc; \ | ||
113 | dest[35] = src->y; \ | ||
114 | } while (0); | ||
115 | 95 | ||
116 | typedef struct { | 96 | typedef struct { |
117 | unsigned long pr_regs[32]; | 97 | unsigned long pr_regs[32]; |
@@ -119,17 +99,59 @@ typedef struct { | |||
119 | unsigned long pr_gsr; | 99 | unsigned long pr_gsr; |
120 | unsigned long pr_fprs; | 100 | unsigned long pr_fprs; |
121 | } elf_fpregset_t; | 101 | } elf_fpregset_t; |
122 | #endif | ||
123 | 102 | ||
124 | #define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs) \ | 103 | /* Format of 32-bit elf_gregset_t is: |
125 | ({ ELF_CORE_COPY_REGS((*(__elf_regs)), task_pt_regs(__tsk)); 1; }) | 104 | * G0 --> G7 |
105 | * O0 --> O7 | ||
106 | * L0 --> L7 | ||
107 | * I0 --> I7 | ||
108 | * PSR, PC, nPC, Y, WIM, TBR | ||
109 | */ | ||
110 | typedef unsigned int compat_elf_greg_t; | ||
111 | #define COMPAT_ELF_NGREG 38 | ||
112 | typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG]; | ||
113 | |||
114 | typedef struct { | ||
115 | union { | ||
116 | unsigned int pr_regs[32]; | ||
117 | unsigned long pr_dregs[16]; | ||
118 | } pr_fr; | ||
119 | unsigned int __unused; | ||
120 | unsigned int pr_fsr; | ||
121 | unsigned char pr_qcnt; | ||
122 | unsigned char pr_q_entrysize; | ||
123 | unsigned char pr_en; | ||
124 | unsigned int pr_q[64]; | ||
125 | } compat_elf_fpregset_t; | ||
126 | |||
127 | /* UltraSparc extensions. Still unused, but will be eventually. */ | ||
128 | typedef struct { | ||
129 | unsigned int pr_type; | ||
130 | unsigned int pr_align; | ||
131 | union { | ||
132 | struct { | ||
133 | union { | ||
134 | unsigned int pr_regs[32]; | ||
135 | unsigned long pr_dregs[16]; | ||
136 | long double pr_qregs[8]; | ||
137 | } pr_xfr; | ||
138 | } pr_v8p; | ||
139 | unsigned int pr_xfsr; | ||
140 | unsigned int pr_fprs; | ||
141 | unsigned int pr_xg[8]; | ||
142 | unsigned int pr_xo[8]; | ||
143 | unsigned long pr_tstate; | ||
144 | unsigned int pr_filler[8]; | ||
145 | } pr_un; | ||
146 | } elf_xregset_t; | ||
126 | 147 | ||
127 | /* | 148 | /* |
128 | * This is used to ensure we don't load something for the wrong architecture. | 149 | * This is used to ensure we don't load something for the wrong architecture. |
129 | */ | 150 | */ |
130 | #ifndef elf_check_arch | 151 | #define elf_check_arch(x) ((x)->e_machine == ELF_ARCH) |
131 | #define elf_check_arch(x) ((x)->e_machine == ELF_ARCH) /* Might be EM_SPARCV9 or EM_SPARC */ | 152 | #define compat_elf_check_arch(x) ((x)->e_machine == EM_SPARC || \ |
132 | #endif | 153 | (x)->e_machine == EM_SPARC32PLUS) |
154 | #define compat_start_thread start_thread32 | ||
133 | 155 | ||
134 | #define USE_ELF_CORE_DUMP | 156 | #define USE_ELF_CORE_DUMP |
135 | #define ELF_EXEC_PAGESIZE PAGE_SIZE | 157 | #define ELF_EXEC_PAGESIZE PAGE_SIZE |
@@ -139,9 +161,8 @@ typedef struct { | |||
139 | the loader. We need to make sure that it is out of the way of the program | 161 | the loader. We need to make sure that it is out of the way of the program |
140 | that it will "exec", and that there is sufficient room for the brk. */ | 162 | that it will "exec", and that there is sufficient room for the brk. */ |
141 | 163 | ||
142 | #ifndef ELF_ET_DYN_BASE | 164 | #define ELF_ET_DYN_BASE 0x0000010000000000UL |
143 | #define ELF_ET_DYN_BASE 0x0000010000000000UL | 165 | #define COMPAT_ELF_ET_DYN_BASE 0x0000000070000000UL |
144 | #endif | ||
145 | 166 | ||
146 | 167 | ||
147 | /* This yields a mask that user programs can use to figure out what | 168 | /* This yields a mask that user programs can use to figure out what |
@@ -175,7 +196,6 @@ static inline unsigned int sparc64_elf_hwcap(void) | |||
175 | 196 | ||
176 | #define ELF_PLATFORM (NULL) | 197 | #define ELF_PLATFORM (NULL) |
177 | 198 | ||
178 | #ifdef __KERNEL__ | ||
179 | #define SET_PERSONALITY(ex, ibcs2) \ | 199 | #define SET_PERSONALITY(ex, ibcs2) \ |
180 | do { unsigned long new_flags = current_thread_info()->flags; \ | 200 | do { unsigned long new_flags = current_thread_info()->flags; \ |
181 | new_flags &= _TIF_32BIT; \ | 201 | new_flags &= _TIF_32BIT; \ |
@@ -194,6 +214,5 @@ do { unsigned long new_flags = current_thread_info()->flags; \ | |||
194 | else if (current->personality != PER_LINUX32) \ | 214 | else if (current->personality != PER_LINUX32) \ |
195 | set_personality(PER_LINUX); \ | 215 | set_personality(PER_LINUX); \ |
196 | } while (0) | 216 | } while (0) |
197 | #endif | ||
198 | 217 | ||
199 | #endif /* !(__ASM_SPARC64_ELF_H) */ | 218 | #endif /* !(__ASM_SPARC64_ELF_H) */ |
diff --git a/include/asm-sparc64/io.h b/include/asm-sparc64/io.h index c299b853b5ba..b6ece223562d 100644 --- a/include/asm-sparc64/io.h +++ b/include/asm-sparc64/io.h | |||
@@ -16,7 +16,7 @@ | |||
16 | /* BIO layer definitions. */ | 16 | /* BIO layer definitions. */ |
17 | extern unsigned long kern_base, kern_size; | 17 | extern unsigned long kern_base, kern_size; |
18 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) | 18 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) |
19 | #define BIO_VMERGE_BOUNDARY 8192 | 19 | #define BIO_VMERGE_BOUNDARY 0 |
20 | 20 | ||
21 | static inline u8 _inb(unsigned long addr) | 21 | static inline u8 _inb(unsigned long addr) |
22 | { | 22 | { |
diff --git a/include/asm-sparc64/page.h b/include/asm-sparc64/page.h index 7af1077451ff..e93a482aa24a 100644 --- a/include/asm-sparc64/page.h +++ b/include/asm-sparc64/page.h | |||
@@ -3,8 +3,6 @@ | |||
3 | #ifndef _SPARC64_PAGE_H | 3 | #ifndef _SPARC64_PAGE_H |
4 | #define _SPARC64_PAGE_H | 4 | #define _SPARC64_PAGE_H |
5 | 5 | ||
6 | #ifdef __KERNEL__ | ||
7 | |||
8 | #include <linux/const.h> | 6 | #include <linux/const.h> |
9 | 7 | ||
10 | #if defined(CONFIG_SPARC64_PAGE_SIZE_8KB) | 8 | #if defined(CONFIG_SPARC64_PAGE_SIZE_8KB) |
@@ -106,6 +104,8 @@ typedef unsigned long pgprot_t; | |||
106 | 104 | ||
107 | #endif /* (STRICT_MM_TYPECHECKS) */ | 105 | #endif /* (STRICT_MM_TYPECHECKS) */ |
108 | 106 | ||
107 | typedef struct page *pgtable_t; | ||
108 | |||
109 | #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ | 109 | #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ |
110 | (_AC(0x0000000070000000,UL)) : \ | 110 | (_AC(0x0000000070000000,UL)) : \ |
111 | (_AC(0xfffff80000000000,UL) + (1UL << 32UL))) | 111 | (_AC(0xfffff80000000000,UL) + (1UL << 32UL))) |
@@ -143,5 +143,4 @@ typedef unsigned long pgprot_t; | |||
143 | 143 | ||
144 | #include <asm-generic/page.h> | 144 | #include <asm-generic/page.h> |
145 | 145 | ||
146 | #endif /* __KERNEL__ */ | ||
147 | #endif /* _SPARC64_PAGE_H */ | 146 | #endif /* _SPARC64_PAGE_H */ |
diff --git a/include/asm-sparc64/pgalloc.h b/include/asm-sparc64/pgalloc.h index 5d66b858a965..3ee2d406373b 100644 --- a/include/asm-sparc64/pgalloc.h +++ b/include/asm-sparc64/pgalloc.h | |||
@@ -20,7 +20,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm) | |||
20 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 20 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
21 | } | 21 | } |
22 | 22 | ||
23 | static inline void pgd_free(pgd_t *pgd) | 23 | static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) |
24 | { | 24 | { |
25 | quicklist_free(0, NULL, pgd); | 25 | quicklist_free(0, NULL, pgd); |
26 | } | 26 | } |
@@ -32,7 +32,7 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr) | |||
32 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 32 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
33 | } | 33 | } |
34 | 34 | ||
35 | static inline void pmd_free(pmd_t *pmd) | 35 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
36 | { | 36 | { |
37 | quicklist_free(0, NULL, pmd); | 37 | quicklist_free(0, NULL, pmd); |
38 | } | 38 | } |
@@ -43,20 +43,28 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | |||
43 | return quicklist_alloc(0, GFP_KERNEL, NULL); | 43 | return quicklist_alloc(0, GFP_KERNEL, NULL); |
44 | } | 44 | } |
45 | 45 | ||
46 | static inline struct page *pte_alloc_one(struct mm_struct *mm, | 46 | static inline pgtable_t pte_alloc_one(struct mm_struct *mm, |
47 | unsigned long address) | 47 | unsigned long address) |
48 | { | 48 | { |
49 | void *pg = quicklist_alloc(0, GFP_KERNEL, NULL); | 49 | struct page *page; |
50 | return pg ? virt_to_page(pg) : NULL; | 50 | void *pg; |
51 | |||
52 | pg = quicklist_alloc(0, GFP_KERNEL, NULL); | ||
53 | if (!pg) | ||
54 | return NULL; | ||
55 | page = virt_to_page(pg); | ||
56 | pgtable_page_ctor(page); | ||
57 | return page; | ||
51 | } | 58 | } |
52 | 59 | ||
53 | static inline void pte_free_kernel(pte_t *pte) | 60 | static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) |
54 | { | 61 | { |
55 | quicklist_free(0, NULL, pte); | 62 | quicklist_free(0, NULL, pte); |
56 | } | 63 | } |
57 | 64 | ||
58 | static inline void pte_free(struct page *ptepage) | 65 | static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage) |
59 | { | 66 | { |
67 | pgtable_page_dtor(ptepage); | ||
60 | quicklist_free_page(0, NULL, ptepage); | 68 | quicklist_free_page(0, NULL, ptepage); |
61 | } | 69 | } |
62 | 70 | ||
@@ -64,6 +72,7 @@ static inline void pte_free(struct page *ptepage) | |||
64 | #define pmd_populate_kernel(MM, PMD, PTE) pmd_set(PMD, PTE) | 72 | #define pmd_populate_kernel(MM, PMD, PTE) pmd_set(PMD, PTE) |
65 | #define pmd_populate(MM,PMD,PTE_PAGE) \ | 73 | #define pmd_populate(MM,PMD,PTE_PAGE) \ |
66 | pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE)) | 74 | pmd_populate_kernel(MM,PMD,page_address(PTE_PAGE)) |
75 | #define pmd_pgtable(pmd) pmd_page(pmd) | ||
67 | 76 | ||
68 | static inline void check_pgt_cache(void) | 77 | static inline void check_pgt_cache(void) |
69 | { | 78 | { |
diff --git a/include/asm-sparc64/posix_types.h b/include/asm-sparc64/posix_types.h index 3426a65ecd35..4eaaa0196636 100644 --- a/include/asm-sparc64/posix_types.h +++ b/include/asm-sparc64/posix_types.h | |||
@@ -43,14 +43,10 @@ typedef long long __kernel_loff_t; | |||
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | typedef struct { | 45 | typedef struct { |
46 | #if defined(__KERNEL__) || defined(__USE_ALL) | ||
47 | int val[2]; | 46 | int val[2]; |
48 | #else /* !defined(__KERNEL__) && !defined(__USE_ALL) */ | ||
49 | int __val[2]; | ||
50 | #endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */ | ||
51 | } __kernel_fsid_t; | 47 | } __kernel_fsid_t; |
52 | 48 | ||
53 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) | 49 | #if defined(__KERNEL__) |
54 | 50 | ||
55 | #undef __FD_SET | 51 | #undef __FD_SET |
56 | static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) | 52 | static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) |
@@ -121,6 +117,6 @@ static inline void __FD_ZERO(__kernel_fd_set *p) | |||
121 | } | 117 | } |
122 | } | 118 | } |
123 | 119 | ||
124 | #endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ | 120 | #endif /* defined(__KERNEL__) */ |
125 | 121 | ||
126 | #endif /* !(__ARCH_SPARC64_POSIX_TYPES_H) */ | 122 | #endif /* !(__ARCH_SPARC64_POSIX_TYPES_H) */ |
diff --git a/include/asm-sparc64/processor.h b/include/asm-sparc64/processor.h index 66dd2fa0e319..8da484c19822 100644 --- a/include/asm-sparc64/processor.h +++ b/include/asm-sparc64/processor.h | |||
@@ -14,7 +14,6 @@ | |||
14 | #define current_text_addr() ({ void *pc; __asm__("rd %%pc, %0" : "=r" (pc)); pc; }) | 14 | #define current_text_addr() ({ void *pc; __asm__("rd %%pc, %0" : "=r" (pc)); pc; }) |
15 | 15 | ||
16 | #include <asm/asi.h> | 16 | #include <asm/asi.h> |
17 | #include <asm/a.out.h> | ||
18 | #include <asm/pstate.h> | 17 | #include <asm/pstate.h> |
19 | #include <asm/ptrace.h> | 18 | #include <asm/ptrace.h> |
20 | #include <asm/page.h> | 19 | #include <asm/page.h> |
@@ -36,7 +35,19 @@ | |||
36 | #else | 35 | #else |
37 | #define VPTE_SIZE (1 << (VA_BITS - PAGE_SHIFT + 3)) | 36 | #define VPTE_SIZE (1 << (VA_BITS - PAGE_SHIFT + 3)) |
38 | #endif | 37 | #endif |
38 | |||
39 | #define TASK_SIZE ((unsigned long)-VPTE_SIZE) | 39 | #define TASK_SIZE ((unsigned long)-VPTE_SIZE) |
40 | #ifdef __KERNEL__ | ||
41 | |||
42 | #define STACK_TOP32 ((1UL << 32UL) - PAGE_SIZE) | ||
43 | #define STACK_TOP64 (0x0000080000000000UL - (1UL << 32UL)) | ||
44 | |||
45 | #define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ | ||
46 | STACK_TOP32 : STACK_TOP64) | ||
47 | |||
48 | #define STACK_TOP_MAX STACK_TOP64 | ||
49 | |||
50 | #endif | ||
40 | 51 | ||
41 | #ifndef __ASSEMBLY__ | 52 | #ifndef __ASSEMBLY__ |
42 | 53 | ||
diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h index 7eba90c6c753..8617c3a5143b 100644 --- a/include/asm-sparc64/ptrace.h +++ b/include/asm-sparc64/ptrace.h | |||
@@ -95,7 +95,7 @@ struct sparc_trapf { | |||
95 | 95 | ||
96 | #ifdef __KERNEL__ | 96 | #ifdef __KERNEL__ |
97 | 97 | ||
98 | #define __ARCH_SYS_PTRACE 1 | 98 | #define __ARCH_WANT_COMPAT_SYS_PTRACE |
99 | 99 | ||
100 | #define force_successful_syscall_return() \ | 100 | #define force_successful_syscall_return() \ |
101 | do { current_thread_info()->syscall_noerror = 1; \ | 101 | do { current_thread_info()->syscall_noerror = 1; \ |
@@ -261,8 +261,6 @@ extern void show_regs(struct pt_regs *); | |||
261 | #define SF_XXARG 0x5c | 261 | #define SF_XXARG 0x5c |
262 | 262 | ||
263 | /* Stuff for the ptrace system call */ | 263 | /* Stuff for the ptrace system call */ |
264 | #define PTRACE_SUNATTACH 10 | ||
265 | #define PTRACE_SUNDETACH 11 | ||
266 | #define PTRACE_GETREGS 12 | 264 | #define PTRACE_GETREGS 12 |
267 | #define PTRACE_SETREGS 13 | 265 | #define PTRACE_SETREGS 13 |
268 | #define PTRACE_GETFPREGS 14 | 266 | #define PTRACE_GETFPREGS 14 |
@@ -284,18 +282,4 @@ extern void show_regs(struct pt_regs *); | |||
284 | #define PTRACE_GETFPREGS64 25 | 282 | #define PTRACE_GETFPREGS64 25 |
285 | #define PTRACE_SETFPREGS64 26 | 283 | #define PTRACE_SETFPREGS64 26 |
286 | 284 | ||
287 | #define PTRACE_GETUCODE 29 /* stupid bsd-ism */ | ||
288 | |||
289 | /* These are for 32-bit processes debugging 64-bit ones. | ||
290 | * Here addr and addr2 are passed in %g2 and %g3 respectively. | ||
291 | */ | ||
292 | #define PTRACE_PEEKTEXT64 (30 + PTRACE_PEEKTEXT) | ||
293 | #define PTRACE_POKETEXT64 (30 + PTRACE_POKETEXT) | ||
294 | #define PTRACE_PEEKDATA64 (30 + PTRACE_PEEKDATA) | ||
295 | #define PTRACE_POKEDATA64 (30 + PTRACE_POKEDATA) | ||
296 | #define PTRACE_READDATA64 (30 + PTRACE_READDATA) | ||
297 | #define PTRACE_WRITEDATA64 (30 + PTRACE_WRITEDATA) | ||
298 | #define PTRACE_READTEXT64 (30 + PTRACE_READTEXT) | ||
299 | #define PTRACE_WRITETEXT64 (30 + PTRACE_WRITETEXT) | ||
300 | |||
301 | #endif /* !(_SPARC64_PTRACE_H) */ | 285 | #endif /* !(_SPARC64_PTRACE_H) */ |
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h index 99a669c190c7..1faefa6d3708 100644 --- a/include/asm-sparc64/system.h +++ b/include/asm-sparc64/system.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #ifndef __ASSEMBLY__ | 8 | #ifndef __ASSEMBLY__ |
9 | 9 | ||
10 | #include <linux/irqflags.h> | 10 | #include <linux/irqflags.h> |
11 | #include <asm-generic/cmpxchg-local.h> | ||
11 | 12 | ||
12 | /* | 13 | /* |
13 | * Sparc (general) CPU types | 14 | * Sparc (general) CPU types |
@@ -315,6 +316,34 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
315 | (unsigned long)_n_, sizeof(*(ptr))); \ | 316 | (unsigned long)_n_, sizeof(*(ptr))); \ |
316 | }) | 317 | }) |
317 | 318 | ||
319 | /* | ||
320 | * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make | ||
321 | * them available. | ||
322 | */ | ||
323 | |||
324 | static inline unsigned long __cmpxchg_local(volatile void *ptr, | ||
325 | unsigned long old, | ||
326 | unsigned long new, int size) | ||
327 | { | ||
328 | switch (size) { | ||
329 | case 4: | ||
330 | case 8: return __cmpxchg(ptr, old, new, size); | ||
331 | default: | ||
332 | return __cmpxchg_local_generic(ptr, old, new, size); | ||
333 | } | ||
334 | |||
335 | return old; | ||
336 | } | ||
337 | |||
338 | #define cmpxchg_local(ptr, o, n) \ | ||
339 | ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \ | ||
340 | (unsigned long)(n), sizeof(*(ptr)))) | ||
341 | #define cmpxchg64_local(ptr, o, n) \ | ||
342 | ({ \ | ||
343 | BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ | ||
344 | cmpxchg_local((ptr), (o), (n)); \ | ||
345 | }) | ||
346 | |||
318 | #endif /* !(__ASSEMBLY__) */ | 347 | #endif /* !(__ASSEMBLY__) */ |
319 | 348 | ||
320 | #define arch_align_stack(x) (x) | 349 | #define arch_align_stack(x) (x) |
diff --git a/include/asm-sparc64/timex.h b/include/asm-sparc64/timex.h index 2a5e4ebaad80..c622535c4560 100644 --- a/include/asm-sparc64/timex.h +++ b/include/asm-sparc64/timex.h | |||
@@ -14,10 +14,6 @@ | |||
14 | typedef unsigned long cycles_t; | 14 | typedef unsigned long cycles_t; |
15 | #define get_cycles() tick_ops->get_tick() | 15 | #define get_cycles() tick_ops->get_tick() |
16 | 16 | ||
17 | #define ARCH_HAS_READ_CURRENT_TIMER 1 | 17 | #define ARCH_HAS_READ_CURRENT_TIMER |
18 | #define read_current_timer(timer_val_p) \ | ||
19 | ({ *timer_val_p = tick_ops->get_tick(); \ | ||
20 | 0; \ | ||
21 | }) | ||
22 | 18 | ||
23 | #endif | 19 | #endif |
diff --git a/include/asm-sparc64/tlb.h b/include/asm-sparc64/tlb.h index 349d1d3e9c27..ec81cdedef2c 100644 --- a/include/asm-sparc64/tlb.h +++ b/include/asm-sparc64/tlb.h | |||
@@ -100,8 +100,8 @@ static inline void tlb_remove_page(struct mmu_gather *mp, struct page *page) | |||
100 | } | 100 | } |
101 | 101 | ||
102 | #define tlb_remove_tlb_entry(mp,ptep,addr) do { } while (0) | 102 | #define tlb_remove_tlb_entry(mp,ptep,addr) do { } while (0) |
103 | #define pte_free_tlb(mp,ptepage) pte_free(ptepage) | 103 | #define pte_free_tlb(mp, ptepage) pte_free((mp)->mm, ptepage) |
104 | #define pmd_free_tlb(mp,pmdp) pmd_free(pmdp) | 104 | #define pmd_free_tlb(mp, pmdp) pmd_free((mp)->mm, pmdp) |
105 | #define pud_free_tlb(tlb,pudp) __pud_free_tlb(tlb,pudp) | 105 | #define pud_free_tlb(tlb,pudp) __pud_free_tlb(tlb,pudp) |
106 | 106 | ||
107 | #define tlb_migrate_finish(mm) do { } while (0) | 107 | #define tlb_migrate_finish(mm) do { } while (0) |
diff --git a/include/asm-sparc64/uaccess.h b/include/asm-sparc64/uaccess.h index 93720e7b0289..d8547b87e730 100644 --- a/include/asm-sparc64/uaccess.h +++ b/include/asm-sparc64/uaccess.h | |||
@@ -10,7 +10,6 @@ | |||
10 | #include <linux/compiler.h> | 10 | #include <linux/compiler.h> |
11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
12 | #include <linux/string.h> | 12 | #include <linux/string.h> |
13 | #include <asm/a.out.h> | ||
14 | #include <asm/asi.h> | 13 | #include <asm/asi.h> |
15 | #include <asm/system.h> | 14 | #include <asm/system.h> |
16 | #include <asm/spitfire.h> | 15 | #include <asm/spitfire.h> |
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index cb751b4d0f56..77559da0ea3f 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h | |||
@@ -329,11 +329,13 @@ | |||
329 | #define __NR_epoll_pwait 309 | 329 | #define __NR_epoll_pwait 309 |
330 | #define __NR_utimensat 310 | 330 | #define __NR_utimensat 310 |
331 | #define __NR_signalfd 311 | 331 | #define __NR_signalfd 311 |
332 | #define __NR_timerfd 312 | 332 | #define __NR_timerfd_create 312 |
333 | #define __NR_eventfd 313 | 333 | #define __NR_eventfd 313 |
334 | #define __NR_fallocate 314 | 334 | #define __NR_fallocate 314 |
335 | #define __NR_timerfd_settime 315 | ||
336 | #define __NR_timerfd_gettime 316 | ||
335 | 337 | ||
336 | #define NR_SYSCALLS 315 | 338 | #define NR_SYSCALLS 317 |
337 | 339 | ||
338 | #ifdef __KERNEL__ | 340 | #ifdef __KERNEL__ |
339 | /* sysconf options, for SunOS compatibility */ | 341 | /* sysconf options, for SunOS compatibility */ |
diff --git a/include/asm-sparc64/user.h b/include/asm-sparc64/user.h index fce4e857dfc3..02b138943837 100644 --- a/include/asm-sparc64/user.h +++ b/include/asm-sparc64/user.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #ifndef _SPARC64_USER_H | 8 | #ifndef _SPARC64_USER_H |
9 | #define _SPARC64_USER_H | 9 | #define _SPARC64_USER_H |
10 | 10 | ||
11 | #include <asm/a.out.h> | 11 | #include <linux/a.out.h> |
12 | struct sunos_regs { | 12 | struct sunos_regs { |
13 | unsigned int psr, pc, npc, y; | 13 | unsigned int psr, pc, npc, y; |
14 | unsigned int regs[15]; | 14 | unsigned int regs[15]; |