diff options
author | Chen Liqin <liqin.chen@sunplusct.com> | 2009-06-19 01:53:49 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2009-06-19 05:40:13 -0400 |
commit | 0402c91af944c61bf788370f03326959a35cb8be (patch) | |
tree | 1f522cec2d62050e7fcaed676005b7d43922276e /arch/score/include/asm | |
parent | 6bcf67374137f433e85aa42a18fde9f0e8562901 (diff) |
score: update files according to review comments
modified: arch/score/include/asm/cacheflush.h
modified: arch/score/include/asm/delay.h
modified: arch/score/include/asm/errno.h
modified: arch/score/include/asm/pgtable-bits.h
modified: arch/score/include/asm/pgtable.h
modified: arch/score/include/asm/ptrace.h
modified: arch/score/include/asm/unistd.h
modified: arch/score/kernel/entry.S
modified: arch/score/kernel/process.c
modified: arch/score/kernel/ptrace.c
modified: arch/score/kernel/signal.c
modified: arch/score/kernel/sys_score.c
modified: arch/score/kernel/traps.c
modified: arch/score/mm/cache.c
Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/score/include/asm')
-rw-r--r-- | arch/score/include/asm/cacheflush.h | 18 | ||||
-rw-r--r-- | arch/score/include/asm/delay.h | 11 | ||||
-rw-r--r-- | arch/score/include/asm/errno.h | 1 | ||||
-rw-r--r-- | arch/score/include/asm/pgtable-bits.h | 2 | ||||
-rw-r--r-- | arch/score/include/asm/pgtable.h | 59 | ||||
-rw-r--r-- | arch/score/include/asm/ptrace.h | 18 | ||||
-rw-r--r-- | arch/score/include/asm/unistd.h | 3 |
7 files changed, 67 insertions, 45 deletions
diff --git a/arch/score/include/asm/cacheflush.h b/arch/score/include/asm/cacheflush.h index 1c74628caf71..07cc8fc457cd 100644 --- a/arch/score/include/asm/cacheflush.h +++ b/arch/score/include/asm/cacheflush.h | |||
@@ -4,18 +4,16 @@ | |||
4 | /* Keep includes the same across arches. */ | 4 | /* Keep includes the same across arches. */ |
5 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
6 | 6 | ||
7 | extern void (*flush_cache_all)(void); | 7 | extern void flush_cache_all(void); |
8 | extern void (*flush_cache_mm)(struct mm_struct *mm); | 8 | extern void flush_cache_mm(struct mm_struct *mm); |
9 | extern void (*flush_cache_range)(struct vm_area_struct *vma, | 9 | extern void flush_cache_range(struct vm_area_struct *vma, |
10 | unsigned long start, unsigned long end); | 10 | unsigned long start, unsigned long end); |
11 | extern void (*flush_cache_page)(struct vm_area_struct *vma, | 11 | extern void flush_cache_page(struct vm_area_struct *vma, |
12 | unsigned long page, unsigned long pfn); | 12 | unsigned long page, unsigned long pfn); |
13 | extern void (*flush_cache_sigtramp)(unsigned long addr); | 13 | extern void flush_cache_sigtramp(unsigned long addr); |
14 | extern void (*flush_icache_all)(void); | 14 | extern void flush_icache_all(void); |
15 | extern void (*flush_icache_range)(unsigned long start, unsigned long end); | 15 | extern void flush_icache_range(unsigned long start, unsigned long end); |
16 | extern void (*flush_data_cache_page)(unsigned long addr); | 16 | extern void flush_dcache_range(unsigned long start, unsigned long end); |
17 | |||
18 | extern void s7_flush_cache_all(void); | ||
19 | 17 | ||
20 | #define flush_cache_dup_mm(mm) do {} while (0) | 18 | #define flush_cache_dup_mm(mm) do {} while (0) |
21 | #define flush_dcache_page(page) do {} while (0) | 19 | #define flush_dcache_page(page) do {} while (0) |
diff --git a/arch/score/include/asm/delay.h b/arch/score/include/asm/delay.h index ad716f6d922d..6726ec199dc0 100644 --- a/arch/score/include/asm/delay.h +++ b/arch/score/include/asm/delay.h | |||
@@ -3,17 +3,22 @@ | |||
3 | 3 | ||
4 | static inline void __delay(unsigned long loops) | 4 | static inline void __delay(unsigned long loops) |
5 | { | 5 | { |
6 | /* 3 cycles per loop. */ | ||
6 | __asm__ __volatile__ ( | 7 | __asm__ __volatile__ ( |
7 | "1:\tsubi\t%0,1\n\t" | 8 | "1:\tsubi\t%0, 3\n\t" |
8 | "cmpz.c\t%0\n\t" | 9 | "cmpz.c\t%0\n\t" |
9 | "bne\t1b\n\t" | 10 | "ble\t1b\n\t" |
10 | : "=r" (loops) | 11 | : "=r" (loops) |
11 | : "0" (loops)); | 12 | : "0" (loops)); |
12 | } | 13 | } |
13 | 14 | ||
14 | static inline void __udelay(unsigned long usecs) | 15 | static inline void __udelay(unsigned long usecs) |
15 | { | 16 | { |
16 | __delay(usecs); | 17 | unsigned long loops_per_usec; |
18 | |||
19 | loops_per_usec = (loops_per_jiffy * HZ) / 1000000; | ||
20 | |||
21 | __delay(usecs * loops_per_usec); | ||
17 | } | 22 | } |
18 | 23 | ||
19 | #define udelay(usecs) __udelay(usecs) | 24 | #define udelay(usecs) __udelay(usecs) |
diff --git a/arch/score/include/asm/errno.h b/arch/score/include/asm/errno.h index 7cd3e1f07c0b..29ff39d5ab47 100644 --- a/arch/score/include/asm/errno.h +++ b/arch/score/include/asm/errno.h | |||
@@ -2,6 +2,5 @@ | |||
2 | #define _ASM_SCORE_ERRNO_H | 2 | #define _ASM_SCORE_ERRNO_H |
3 | 3 | ||
4 | #include <asm-generic/errno.h> | 4 | #include <asm-generic/errno.h> |
5 | #define EMAXERRNO 1024 | ||
6 | 5 | ||
7 | #endif /* _ASM_SCORE_ERRNO_H */ | 6 | #endif /* _ASM_SCORE_ERRNO_H */ |
diff --git a/arch/score/include/asm/pgtable-bits.h b/arch/score/include/asm/pgtable-bits.h index ca16d357a644..7d65a96a82e5 100644 --- a/arch/score/include/asm/pgtable-bits.h +++ b/arch/score/include/asm/pgtable-bits.h | |||
@@ -17,6 +17,8 @@ | |||
17 | #define _CACHE_MASK (1<<3) | 17 | #define _CACHE_MASK (1<<3) |
18 | #define _PAGE_BUFFERABLE (1<<4) /*Fallow Spec. */ | 18 | #define _PAGE_BUFFERABLE (1<<4) /*Fallow Spec. */ |
19 | 19 | ||
20 | #define __READABLE (_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED) | ||
21 | #define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED) | ||
20 | #define _PAGE_CHG_MASK \ | 22 | #define _PAGE_CHG_MASK \ |
21 | (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_CACHE) | 23 | (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _PAGE_CACHE) |
22 | 24 | ||
diff --git a/arch/score/include/asm/pgtable.h b/arch/score/include/asm/pgtable.h index 0f7177a42205..5e913e57c671 100644 --- a/arch/score/include/asm/pgtable.h +++ b/arch/score/include/asm/pgtable.h | |||
@@ -106,24 +106,6 @@ static inline void pmd_clear(pmd_t *pmdp) | |||
106 | ((swp_entry_t) { pte_val(pte)}) | 106 | ((swp_entry_t) { pte_val(pte)}) |
107 | #define __swp_entry_to_pte(x) ((pte_t) {(x).val}) | 107 | #define __swp_entry_to_pte(x) ((pte_t) {(x).val}) |
108 | 108 | ||
109 | #define __P000 __pgprot(0) | ||
110 | #define __P001 __pgprot(0) | ||
111 | #define __P010 __pgprot(0) | ||
112 | #define __P011 __pgprot(0) | ||
113 | #define __P100 __pgprot(0) | ||
114 | #define __P101 __pgprot(0) | ||
115 | #define __P110 __pgprot(0) | ||
116 | #define __P111 __pgprot(0) | ||
117 | |||
118 | #define __S000 __pgprot(0) | ||
119 | #define __S001 __pgprot(0) | ||
120 | #define __S010 __pgprot(0) | ||
121 | #define __S011 __pgprot(0) | ||
122 | #define __S100 __pgprot(0) | ||
123 | #define __S101 __pgprot(0) | ||
124 | #define __S110 __pgprot(0) | ||
125 | #define __S111 __pgprot(0) | ||
126 | |||
127 | #define pmd_page(pmd) virt_to_page(__va(pmd_val(pmd))) | 109 | #define pmd_page(pmd) virt_to_page(__va(pmd_val(pmd))) |
128 | #define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot) | 110 | #define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot) |
129 | static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | 111 | static inline pte_t pte_mkspecial(pte_t pte) { return pte; } |
@@ -136,10 +118,15 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | |||
136 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ | 118 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ |
137 | remap_pfn_range(vma, vaddr, pfn, size, prot) | 119 | remap_pfn_range(vma, vaddr, pfn, size, prot) |
138 | 120 | ||
139 | #define pgd_present(pgd) (1) /* pages are always present on non MMU */ | 121 | /* |
122 | * The "pgd_xxx()" functions here are trivial for a folded two-level | ||
123 | * setup: the pgd is never bad, and a pmd always exists (as it's folded | ||
124 | * into the pgd entry) | ||
125 | */ | ||
126 | #define pgd_present(pgd) (1) | ||
140 | #define pgd_none(pgd) (0) | 127 | #define pgd_none(pgd) (0) |
141 | #define pgd_bad(pgd) (0) | 128 | #define pgd_bad(pgd) (0) |
142 | #define pgd_clear(pgdp) | 129 | #define pgd_clear(pgdp) do { } while (0) |
143 | 130 | ||
144 | #define kern_addr_valid(addr) (1) | 131 | #define kern_addr_valid(addr) (1) |
145 | #define pmd_offset(a, b) ((void *) 0) | 132 | #define pmd_offset(a, b) ((void *) 0) |
@@ -150,11 +137,33 @@ static inline pte_t pte_mkspecial(pte_t pte) { return pte; } | |||
150 | 137 | ||
151 | #define pud_offset(pgd, address) ((pud_t *) pgd) | 138 | #define pud_offset(pgd, address) ((pud_t *) pgd) |
152 | 139 | ||
153 | #define PAGE_NONE __pgprot(0) /* these mean nothing to non MMU */ | 140 | #define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_CACHE) |
154 | #define PAGE_SHARED __pgprot(0) /* these mean nothing to non MMU */ | 141 | #define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ |
155 | #define PAGE_COPY __pgprot(0) /* these mean nothing to non MMU */ | 142 | _PAGE_CACHE) |
156 | #define PAGE_READONLY __pgprot(0) /* these mean nothing to non MMU */ | 143 | #define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_CACHE) |
157 | #define PAGE_KERNEL __pgprot(0) /* these mean nothing to non MMU */ | 144 | #define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_READ | _PAGE_CACHE) |
145 | #define PAGE_KERNEL __pgprot(_PAGE_PRESENT | __READABLE | __WRITEABLE | \ | ||
146 | _PAGE_GLOBAL | _PAGE_CACHE) | ||
147 | #define PAGE_KERNEL_UNCACHED __pgprot(_PAGE_PRESENT | __READABLE | \ | ||
148 | __WRITEABLE | _PAGE_GLOBAL & ~_PAGE_CACHE) | ||
149 | |||
150 | #define __P000 PAGE_NONE | ||
151 | #define __P001 PAGE_READONLY | ||
152 | #define __P010 PAGE_COPY | ||
153 | #define __P011 PAGE_COPY | ||
154 | #define __P100 PAGE_READONLY | ||
155 | #define __P101 PAGE_READONLY | ||
156 | #define __P110 PAGE_COPY | ||
157 | #define __P111 PAGE_COPY | ||
158 | |||
159 | #define __S000 PAGE_NONE | ||
160 | #define __S001 PAGE_READONLY | ||
161 | #define __S010 PAGE_SHARED | ||
162 | #define __S011 PAGE_SHARED | ||
163 | #define __S100 PAGE_READONLY | ||
164 | #define __S101 PAGE_READONLY | ||
165 | #define __S110 PAGE_SHARED | ||
166 | #define __S111 PAGE_SHARED | ||
158 | 167 | ||
159 | #define pgprot_noncached(x) (x) | 168 | #define pgprot_noncached(x) (x) |
160 | 169 | ||
diff --git a/arch/score/include/asm/ptrace.h b/arch/score/include/asm/ptrace.h index 1a4900ac49f3..66b14c8891cf 100644 --- a/arch/score/include/asm/ptrace.h +++ b/arch/score/include/asm/ptrace.h | |||
@@ -1,6 +1,9 @@ | |||
1 | #ifndef _ASM_SCORE_PTRACE_H | 1 | #ifndef _ASM_SCORE_PTRACE_H |
2 | #define _ASM_SCORE_PTRACE_H | 2 | #define _ASM_SCORE_PTRACE_H |
3 | 3 | ||
4 | #define PTRACE_GETREGS 12 | ||
5 | #define PTRACE_SETREGS 13 | ||
6 | |||
4 | #define PC 32 | 7 | #define PC 32 |
5 | #define CONDITION 33 | 8 | #define CONDITION 33 |
6 | #define ECR 34 | 9 | #define ECR 34 |
@@ -76,12 +79,17 @@ struct pt_regs { | |||
76 | */ | 79 | */ |
77 | #define user_mode(regs) ((regs->cp0_psr & 8) == 8) | 80 | #define user_mode(regs) ((regs->cp0_psr & 8) == 8) |
78 | 81 | ||
79 | #define instruction_pointer(regs) (0) | 82 | #define instruction_pointer(regs) ((unsigned long)(regs)->cp0_epc) |
80 | #define profile_pc(regs) instruction_pointer(regs) | 83 | #define profile_pc(regs) instruction_pointer(regs) |
81 | 84 | ||
82 | extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); | 85 | extern void do_syscall_trace(struct pt_regs *regs, int entryexit); |
83 | extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *); | 86 | extern int read_tsk_long(struct task_struct *, unsigned long, unsigned long *); |
84 | extern void clear_single_step(struct task_struct *); | 87 | extern int read_tsk_short(struct task_struct *, unsigned long, |
85 | #endif | 88 | unsigned short *); |
89 | |||
90 | #define arch_has_single_step() (1) | ||
91 | extern void user_enable_single_step(struct task_struct *); | ||
92 | extern void user_disable_single_step(struct task_struct *); | ||
93 | #endif /* __KERNEL__ */ | ||
86 | 94 | ||
87 | #endif /* _ASM_SCORE_PTRACE_H */ | 95 | #endif /* _ASM_SCORE_PTRACE_H */ |
diff --git a/arch/score/include/asm/unistd.h b/arch/score/include/asm/unistd.h index 9aa3a159bbf6..f0f84deeb564 100644 --- a/arch/score/include/asm/unistd.h +++ b/arch/score/include/asm/unistd.h | |||
@@ -1,7 +1,8 @@ | |||
1 | #ifndef _ASM_SCORE_UNISTD_H | 1 | #if !defined(_ASM_SCORE_UNISTD_H) || defined(__SYSCALL) |
2 | #define _ASM_SCORE_UNISTD_H | 2 | #define _ASM_SCORE_UNISTD_H |
3 | 3 | ||
4 | #define __ARCH_HAVE_MMU | 4 | #define __ARCH_HAVE_MMU |
5 | #define __ARCH_WANT_IPC_PARSE_VERSION | ||
5 | 6 | ||
6 | #include <asm-generic/unistd.h> | 7 | #include <asm-generic/unistd.h> |
7 | 8 | ||