aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris')
-rw-r--r--arch/cris/arch-v10/README.mm6
-rw-r--r--arch/cris/arch-v10/kernel/ptrace.c51
-rw-r--r--arch/cris/arch-v10/kernel/signal.c2
-rw-r--r--arch/cris/arch-v32/drivers/cryptocop.c14
-rw-r--r--arch/cris/arch-v32/kernel/ptrace.c51
-rw-r--r--arch/cris/arch-v32/kernel/signal.c2
-rw-r--r--arch/cris/mm/ioremap.c2
7 files changed, 17 insertions, 111 deletions
diff --git a/arch/cris/arch-v10/README.mm b/arch/cris/arch-v10/README.mm
index 6f08903f3139..517d1f027fe8 100644
--- a/arch/cris/arch-v10/README.mm
+++ b/arch/cris/arch-v10/README.mm
@@ -177,7 +177,7 @@ The example address is 0xd004000c; in binary this is:
177Given the top-level Page Directory, the offset in that directory is calculated 177Given the top-level Page Directory, the offset in that directory is calculated
178using the upper 8 bits: 178using the upper 8 bits:
179 179
180extern inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address) 180static inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address)
181{ 181{
182 return mm->pgd + (address >> PGDIR_SHIFT); 182 return mm->pgd + (address >> PGDIR_SHIFT);
183} 183}
@@ -190,14 +190,14 @@ The pgd_t from our example will therefore be the 208'th (0xd0) entry in mm->pgd.
190 190
191Since the Middle Directory does not exist, it is a unity mapping: 191Since the Middle Directory does not exist, it is a unity mapping:
192 192
193extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address) 193static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
194{ 194{
195 return (pmd_t *) dir; 195 return (pmd_t *) dir;
196} 196}
197 197
198The Page Table provides the final lookup by using bits 13 to 23 as index: 198The Page Table provides the final lookup by using bits 13 to 23 as index:
199 199
200extern inline pte_t * pte_offset(pmd_t * dir, unsigned long address) 200static inline pte_t * pte_offset(pmd_t * dir, unsigned long address)
201{ 201{
202 return (pte_t *) pmd_page(*dir) + ((address >> PAGE_SHIFT) & 202 return (pte_t *) pmd_page(*dir) + ((address >> PAGE_SHIFT) &
203 (PTRS_PER_PTE - 1)); 203 (PTRS_PER_PTE - 1));
diff --git a/arch/cris/arch-v10/kernel/ptrace.c b/arch/cris/arch-v10/kernel/ptrace.c
index 130dd214e41d..6cbd34a27b90 100644
--- a/arch/cris/arch-v10/kernel/ptrace.c
+++ b/arch/cris/arch-v10/kernel/ptrace.c
@@ -76,55 +76,11 @@ ptrace_disable(struct task_struct *child)
76 * (in user space) where the result of the ptrace call is written (instead of 76 * (in user space) where the result of the ptrace call is written (instead of
77 * being returned). 77 * being returned).
78 */ 78 */
79asmlinkage int 79long arch_ptrace(struct task_struct *child, long request, long addr, long data)
80sys_ptrace(long request, long pid, long addr, long data)
81{ 80{
82 struct task_struct *child;
83 int ret; 81 int ret;
84 unsigned long __user *datap = (unsigned long __user *)data; 82 unsigned long __user *datap = (unsigned long __user *)data;
85 83
86 lock_kernel();
87 ret = -EPERM;
88
89 if (request == PTRACE_TRACEME) {
90 /* are we already being traced? */
91 if (current->ptrace & PT_PTRACED)
92 goto out;
93 ret = security_ptrace(current->parent, current);
94 if (ret)
95 goto out;
96 /* set the ptrace bit in the process flags. */
97 current->ptrace |= PT_PTRACED;
98 ret = 0;
99 goto out;
100 }
101
102 ret = -ESRCH;
103 read_lock(&tasklist_lock);
104 child = find_task_by_pid(pid);
105
106 if (child)
107 get_task_struct(child);
108
109 read_unlock(&tasklist_lock);
110
111 if (!child)
112 goto out;
113
114 ret = -EPERM;
115
116 if (pid == 1) /* Leave the init process alone! */
117 goto out_tsk;
118
119 if (request == PTRACE_ATTACH) {
120 ret = ptrace_attach(child);
121 goto out_tsk;
122 }
123
124 ret = ptrace_check_attach(child, request == PTRACE_KILL);
125 if (ret < 0)
126 goto out_tsk;
127
128 switch (request) { 84 switch (request) {
129 /* Read word at location address. */ 85 /* Read word at location address. */
130 case PTRACE_PEEKTEXT: 86 case PTRACE_PEEKTEXT:
@@ -289,10 +245,7 @@ sys_ptrace(long request, long pid, long addr, long data)
289 ret = ptrace_request(child, request, addr, data); 245 ret = ptrace_request(child, request, addr, data);
290 break; 246 break;
291 } 247 }
292out_tsk: 248
293 put_task_struct(child);
294out:
295 unlock_kernel();
296 return ret; 249 return ret;
297} 250}
298 251
diff --git a/arch/cris/arch-v10/kernel/signal.c b/arch/cris/arch-v10/kernel/signal.c
index 693771961f85..19bcad05716f 100644
--- a/arch/cris/arch-v10/kernel/signal.c
+++ b/arch/cris/arch-v10/kernel/signal.c
@@ -476,7 +476,7 @@ give_sigsegv:
476 * OK, we're invoking a handler 476 * OK, we're invoking a handler
477 */ 477 */
478 478
479extern inline void 479static inline void
480handle_signal(int canrestart, unsigned long sig, 480handle_signal(int canrestart, unsigned long sig,
481 siginfo_t *info, struct k_sigaction *ka, 481 siginfo_t *info, struct k_sigaction *ka,
482 sigset_t *oldset, struct pt_regs * regs) 482 sigset_t *oldset, struct pt_regs * regs)
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index ca72076c630a..501fa52d8d3a 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -277,7 +277,7 @@ struct file_operations cryptocop_fops = {
277static void free_cdesc(struct cryptocop_dma_desc *cdesc) 277static void free_cdesc(struct cryptocop_dma_desc *cdesc)
278{ 278{
279 DEBUG(printk("free_cdesc: cdesc 0x%p, from_pool=%d\n", cdesc, cdesc->from_pool)); 279 DEBUG(printk("free_cdesc: cdesc 0x%p, from_pool=%d\n", cdesc, cdesc->from_pool));
280 if (cdesc->free_buf) kfree(cdesc->free_buf); 280 kfree(cdesc->free_buf);
281 281
282 if (cdesc->from_pool) { 282 if (cdesc->from_pool) {
283 unsigned long int flags; 283 unsigned long int flags;
@@ -2950,15 +2950,15 @@ static int cryptocop_ioctl_process(struct inode *inode, struct file *filp, unsig
2950 put_page(outpages[i]); 2950 put_page(outpages[i]);
2951 } 2951 }
2952 2952
2953 if (digest_result) kfree(digest_result); 2953 kfree(digest_result);
2954 if (inpages) kfree(inpages); 2954 kfree(inpages);
2955 if (outpages) kfree(outpages); 2955 kfree(outpages);
2956 if (cop){ 2956 if (cop){
2957 if (cop->tfrm_op.indata) kfree(cop->tfrm_op.indata); 2957 kfree(cop->tfrm_op.indata);
2958 if (cop->tfrm_op.outdata) kfree(cop->tfrm_op.outdata); 2958 kfree(cop->tfrm_op.outdata);
2959 kfree(cop); 2959 kfree(cop);
2960 } 2960 }
2961 if (jc) kfree(jc); 2961 kfree(jc);
2962 2962
2963 DEBUG(print_lock_status()); 2963 DEBUG(print_lock_status());
2964 2964
diff --git a/arch/cris/arch-v32/kernel/ptrace.c b/arch/cris/arch-v32/kernel/ptrace.c
index 208489da2a87..5528b83a622b 100644
--- a/arch/cris/arch-v32/kernel/ptrace.c
+++ b/arch/cris/arch-v32/kernel/ptrace.c
@@ -99,55 +99,11 @@ ptrace_disable(struct task_struct *child)
99} 99}
100 100
101 101
102asmlinkage int 102long arch_ptrace(struct task_struct *child, long request, long addr, long data)
103sys_ptrace(long request, long pid, long addr, long data)
104{ 103{
105 struct task_struct *child;
106 int ret; 104 int ret;
107 unsigned long __user *datap = (unsigned long __user *)data; 105 unsigned long __user *datap = (unsigned long __user *)data;
108 106
109 lock_kernel();
110 ret = -EPERM;
111
112 if (request == PTRACE_TRACEME) {
113 /* are we already being traced? */
114 if (current->ptrace & PT_PTRACED)
115 goto out;
116 ret = security_ptrace(current->parent, current);
117 if (ret)
118 goto out;
119 /* set the ptrace bit in the process flags. */
120 current->ptrace |= PT_PTRACED;
121 ret = 0;
122 goto out;
123 }
124
125 ret = -ESRCH;
126 read_lock(&tasklist_lock);
127 child = find_task_by_pid(pid);
128
129 if (child)
130 get_task_struct(child);
131
132 read_unlock(&tasklist_lock);
133
134 if (!child)
135 goto out;
136
137 ret = -EPERM;
138
139 if (pid == 1) /* Leave the init process alone! */
140 goto out_tsk;
141
142 if (request == PTRACE_ATTACH) {
143 ret = ptrace_attach(child);
144 goto out_tsk;
145 }
146
147 ret = ptrace_check_attach(child, request == PTRACE_KILL);
148 if (ret < 0)
149 goto out_tsk;
150
151 switch (request) { 107 switch (request) {
152 /* Read word at location address. */ 108 /* Read word at location address. */
153 case PTRACE_PEEKTEXT: 109 case PTRACE_PEEKTEXT:
@@ -347,10 +303,7 @@ sys_ptrace(long request, long pid, long addr, long data)
347 ret = ptrace_request(child, request, addr, data); 303 ret = ptrace_request(child, request, addr, data);
348 break; 304 break;
349 } 305 }
350out_tsk: 306
351 put_task_struct(child);
352out:
353 unlock_kernel();
354 return ret; 307 return ret;
355} 308}
356 309
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c
index 0a3614dab887..99e59b3eacf8 100644
--- a/arch/cris/arch-v32/kernel/signal.c
+++ b/arch/cris/arch-v32/kernel/signal.c
@@ -513,7 +513,7 @@ give_sigsegv:
513} 513}
514 514
515/* Invoke a singal handler to, well, handle the signal. */ 515/* Invoke a singal handler to, well, handle the signal. */
516extern inline void 516static inline void
517handle_signal(int canrestart, unsigned long sig, 517handle_signal(int canrestart, unsigned long sig,
518 siginfo_t *info, struct k_sigaction *ka, 518 siginfo_t *info, struct k_sigaction *ka,
519 sigset_t *oldset, struct pt_regs * regs) 519 sigset_t *oldset, struct pt_regs * regs)
diff --git a/arch/cris/mm/ioremap.c b/arch/cris/mm/ioremap.c
index a92ac9877582..1780df3ed9e5 100644
--- a/arch/cris/mm/ioremap.c
+++ b/arch/cris/mm/ioremap.c
@@ -16,7 +16,7 @@
16#include <asm/tlbflush.h> 16#include <asm/tlbflush.h>
17#include <asm/arch/memmap.h> 17#include <asm/arch/memmap.h>
18 18
19extern inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size, 19static inline void remap_area_pte(pte_t * pte, unsigned long address, unsigned long size,
20 unsigned long phys_addr, pgprot_t prot) 20 unsigned long phys_addr, pgprot_t prot)
21{ 21{
22 unsigned long end; 22 unsigned long end;