aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris')
-rw-r--r--arch/cris/Kconfig6
-rw-r--r--arch/cris/arch-v10/kernel/entry.S4
-rw-r--r--arch/cris/arch-v10/kernel/irq.c2
-rw-r--r--arch/cris/arch-v10/kernel/ptrace.c51
-rw-r--r--arch/cris/arch-v10/lib/old_checksum.c2
-rw-r--r--arch/cris/arch-v32/drivers/cryptocop.c2
-rw-r--r--arch/cris/arch-v32/drivers/pci/bios.c16
-rw-r--r--arch/cris/arch-v32/kernel/entry.S2
-rw-r--r--arch/cris/arch-v32/kernel/irq.c2
-rw-r--r--arch/cris/arch-v32/kernel/pinmux.c4
-rw-r--r--arch/cris/arch-v32/kernel/ptrace.c109
-rw-r--r--arch/cris/arch-v32/mach-a3/pinmux.c2
-rw-r--r--arch/cris/arch-v32/mach-fs/arbiter.c2
-rw-r--r--arch/cris/arch-v32/mach-fs/pinmux.c4
-rw-r--r--arch/cris/arch-v32/mm/mmu.S2
-rw-r--r--arch/cris/arch-v32/mm/tlb.c2
-rw-r--r--arch/cris/include/arch-v32/arch/ptrace.h1
-rw-r--r--arch/cris/include/asm/pci.h8
-rw-r--r--arch/cris/include/asm/pgtable.h2
-rw-r--r--arch/cris/include/asm/unistd.h2
-rw-r--r--arch/cris/kernel/irq.c2
-rw-r--r--arch/cris/kernel/sys_cris.c96
-rw-r--r--arch/cris/kernel/time.c68
23 files changed, 65 insertions, 326 deletions
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index 7adac388a771..059eac6abda1 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -20,6 +20,12 @@ config RWSEM_GENERIC_SPINLOCK
20config RWSEM_XCHGADD_ALGORITHM 20config RWSEM_XCHGADD_ALGORITHM
21 bool 21 bool
22 22
23config GENERIC_TIME
24 def_bool y
25
26config ARCH_USES_GETTIMEOFFSET
27 def_bool y
28
23config GENERIC_IOMAP 29config GENERIC_IOMAP
24 bool 30 bool
25 default y 31 default y
diff --git a/arch/cris/arch-v10/kernel/entry.S b/arch/cris/arch-v10/kernel/entry.S
index 2c18d08cd913..0d6420d087fd 100644
--- a/arch/cris/arch-v10/kernel/entry.S
+++ b/arch/cris/arch-v10/kernel/entry.S
@@ -358,7 +358,7 @@ mmu_bus_fault:
3581: btstq 12, $r1 ; Refill? 3581: btstq 12, $r1 ; Refill?
359 bpl 2f 359 bpl 2f
360 lsrq 24, $r1 ; Get PGD index (bit 24-31) 360 lsrq 24, $r1 ; Get PGD index (bit 24-31)
361 move.d [per_cpu__current_pgd], $r0 ; PGD for the current process 361 move.d [current_pgd], $r0 ; PGD for the current process
362 move.d [$r0+$r1.d], $r0 ; Get PMD 362 move.d [$r0+$r1.d], $r0 ; Get PMD
363 beq 2f 363 beq 2f
364 nop 364 nop
@@ -692,7 +692,7 @@ sys_call_table:
692 .long sys_swapon 692 .long sys_swapon
693 .long sys_reboot 693 .long sys_reboot
694 .long sys_old_readdir 694 .long sys_old_readdir
695 .long old_mmap /* 90 */ 695 .long sys_old_mmap /* 90 */
696 .long sys_munmap 696 .long sys_munmap
697 .long sys_truncate 697 .long sys_truncate
698 .long sys_ftruncate 698 .long sys_ftruncate
diff --git a/arch/cris/arch-v10/kernel/irq.c b/arch/cris/arch-v10/kernel/irq.c
index 5d75f77f9c73..1a61efc13982 100644
--- a/arch/cris/arch-v10/kernel/irq.c
+++ b/arch/cris/arch-v10/kernel/irq.c
@@ -133,7 +133,7 @@ static void end_crisv10_irq(unsigned int irq)
133} 133}
134 134
135static struct irq_chip crisv10_irq_type = { 135static struct irq_chip crisv10_irq_type = {
136 .typename = "CRISv10", 136 .name = "CRISv10",
137 .startup = startup_crisv10_irq, 137 .startup = startup_crisv10_irq,
138 .shutdown = shutdown_crisv10_irq, 138 .shutdown = shutdown_crisv10_irq,
139 .enable = enable_crisv10_irq, 139 .enable = enable_crisv10_irq,
diff --git a/arch/cris/arch-v10/kernel/ptrace.c b/arch/cris/arch-v10/kernel/ptrace.c
index ee505b2eb4db..e70c804e9377 100644
--- a/arch/cris/arch-v10/kernel/ptrace.c
+++ b/arch/cris/arch-v10/kernel/ptrace.c
@@ -127,57 +127,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
127 ret = 0; 127 ret = 0;
128 break; 128 break;
129 129
130 case PTRACE_SYSCALL:
131 case PTRACE_CONT:
132 ret = -EIO;
133
134 if (!valid_signal(data))
135 break;
136
137 if (request == PTRACE_SYSCALL) {
138 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
139 }
140 else {
141 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
142 }
143
144 child->exit_code = data;
145
146 /* TODO: make sure any pending breakpoint is killed */
147 wake_up_process(child);
148 ret = 0;
149
150 break;
151
152 /* Make the child exit by sending it a sigkill. */
153 case PTRACE_KILL:
154 ret = 0;
155
156 if (child->exit_state == EXIT_ZOMBIE)
157 break;
158
159 child->exit_code = SIGKILL;
160
161 /* TODO: make sure any pending breakpoint is killed */
162 wake_up_process(child);
163 break;
164
165 /* Set the trap flag. */
166 case PTRACE_SINGLESTEP:
167 ret = -EIO;
168
169 if (!valid_signal(data))
170 break;
171
172 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
173
174 /* TODO: set some clever breakpoint mechanism... */
175
176 child->exit_code = data;
177 wake_up_process(child);
178 ret = 0;
179 break;
180
181 /* Get all GP registers from the child. */ 130 /* Get all GP registers from the child. */
182 case PTRACE_GETREGS: { 131 case PTRACE_GETREGS: {
183 int i; 132 int i;
diff --git a/arch/cris/arch-v10/lib/old_checksum.c b/arch/cris/arch-v10/lib/old_checksum.c
index 1734b467efa6..8f79163f1394 100644
--- a/arch/cris/arch-v10/lib/old_checksum.c
+++ b/arch/cris/arch-v10/lib/old_checksum.c
@@ -77,7 +77,7 @@ __wsum csum_partial(const void *p, int len, __wsum __sum)
77 sum += *buff++; 77 sum += *buff++;
78 78
79 if (endMarker > buff) 79 if (endMarker > buff)
80 sum += *(const u8 *)buff; /* add extra byte seperately */ 80 sum += *(const u8 *)buff; /* add extra byte separately */
81 81
82 BITOFF; 82 BITOFF;
83 return (__force __wsum)sum; 83 return (__force __wsum)sum;
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c
index fd529a0ec758..b70fb34939d9 100644
--- a/arch/cris/arch-v32/drivers/cryptocop.c
+++ b/arch/cris/arch-v32/drivers/cryptocop.c
@@ -628,9 +628,9 @@ static int create_output_descriptors(struct cryptocop_operation *operation, int
628 cdesc->dma_descr->buf = (char*)virt_to_phys(operation->tfrm_op.indata[*iniov_ix].iov_base + *iniov_offset); 628 cdesc->dma_descr->buf = (char*)virt_to_phys(operation->tfrm_op.indata[*iniov_ix].iov_base + *iniov_offset);
629 cdesc->dma_descr->after = cdesc->dma_descr->buf + dlength; 629 cdesc->dma_descr->after = cdesc->dma_descr->buf + dlength;
630 630
631 assert(desc_len >= dlength);
631 desc_len -= dlength; 632 desc_len -= dlength;
632 *iniov_offset += dlength; 633 *iniov_offset += dlength;
633 assert(desc_len >= 0);
634 if (*iniov_offset >= operation->tfrm_op.indata[*iniov_ix].iov_len) { 634 if (*iniov_offset >= operation->tfrm_op.indata[*iniov_ix].iov_len) {
635 *iniov_offset = 0; 635 *iniov_offset = 0;
636 ++(*iniov_ix); 636 ++(*iniov_ix);
diff --git a/arch/cris/arch-v32/drivers/pci/bios.c b/arch/cris/arch-v32/drivers/pci/bios.c
index 77ee319193c3..d4b9c36ddc0f 100644
--- a/arch/cris/arch-v32/drivers/pci/bios.c
+++ b/arch/cris/arch-v32/drivers/pci/bios.c
@@ -41,18 +41,16 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
41 return 0; 41 return 0;
42} 42}
43 43
44void 44resource_size_t
45pcibios_align_resource(void *data, struct resource *res, 45pcibios_align_resource(void *data, const struct resource *res,
46 resource_size_t size, resource_size_t align) 46 resource_size_t size, resource_size_t align)
47{ 47{
48 if (res->flags & IORESOURCE_IO) { 48 resource_size_t start = res->start;
49 resource_size_t start = res->start;
50 49
51 if (start & 0x300) { 50 if ((res->flags & IORESOURCE_IO) && (start & 0x300))
52 start = (start + 0x3ff) & ~0x3ff; 51 start = (start + 0x3ff) & ~0x3ff;
53 res->start = start; 52
54 } 53 return start
55 }
56} 54}
57 55
58int pcibios_enable_resources(struct pci_dev *dev, int mask) 56int pcibios_enable_resources(struct pci_dev *dev, int mask)
diff --git a/arch/cris/arch-v32/kernel/entry.S b/arch/cris/arch-v32/kernel/entry.S
index 435b9671bd4b..1f39861eac8c 100644
--- a/arch/cris/arch-v32/kernel/entry.S
+++ b/arch/cris/arch-v32/kernel/entry.S
@@ -615,7 +615,7 @@ sys_call_table:
615 .long sys_swapon 615 .long sys_swapon
616 .long sys_reboot 616 .long sys_reboot
617 .long sys_old_readdir 617 .long sys_old_readdir
618 .long old_mmap /* 90 */ 618 .long sys_old_mmap /* 90 */
619 .long sys_munmap 619 .long sys_munmap
620 .long sys_truncate 620 .long sys_truncate
621 .long sys_ftruncate 621 .long sys_ftruncate
diff --git a/arch/cris/arch-v32/kernel/irq.c b/arch/cris/arch-v32/kernel/irq.c
index 57668db25031..b6241198fb98 100644
--- a/arch/cris/arch-v32/kernel/irq.c
+++ b/arch/cris/arch-v32/kernel/irq.c
@@ -336,7 +336,7 @@ int set_affinity_crisv32_irq(unsigned int irq, const struct cpumask *dest)
336} 336}
337 337
338static struct irq_chip crisv32_irq_type = { 338static struct irq_chip crisv32_irq_type = {
339 .typename = "CRISv32", 339 .name = "CRISv32",
340 .startup = startup_crisv32_irq, 340 .startup = startup_crisv32_irq,
341 .shutdown = shutdown_crisv32_irq, 341 .shutdown = shutdown_crisv32_irq,
342 .enable = enable_crisv32_irq, 342 .enable = enable_crisv32_irq,
diff --git a/arch/cris/arch-v32/kernel/pinmux.c b/arch/cris/arch-v32/kernel/pinmux.c
index 6eb54ea1c976..f6f3637a4194 100644
--- a/arch/cris/arch-v32/kernel/pinmux.c
+++ b/arch/cris/arch-v32/kernel/pinmux.c
@@ -54,7 +54,7 @@ crisv32_pinmux_alloc(int port, int first_pin, int last_pin, enum pin_mode mode)
54 54
55 crisv32_pinmux_init(); 55 crisv32_pinmux_init();
56 56
57 if (port > PORTS) 57 if (port > PORTS || port < 0)
58 return -EINVAL; 58 return -EINVAL;
59 59
60 spin_lock_irqsave(&pinmux_lock, flags); 60 spin_lock_irqsave(&pinmux_lock, flags);
@@ -197,7 +197,7 @@ crisv32_pinmux_dealloc(int port, int first_pin, int last_pin)
197 197
198 crisv32_pinmux_init(); 198 crisv32_pinmux_init();
199 199
200 if (port > PORTS) 200 if (port > PORTS || port < 0)
201 return -EINVAL; 201 return -EINVAL;
202 202
203 spin_lock_irqsave(&pinmux_lock, flags); 203 spin_lock_irqsave(&pinmux_lock, flags);
diff --git a/arch/cris/arch-v32/kernel/ptrace.c b/arch/cris/arch-v32/kernel/ptrace.c
index dd401473f5b5..f4ebd1e7d0f5 100644
--- a/arch/cris/arch-v32/kernel/ptrace.c
+++ b/arch/cris/arch-v32/kernel/ptrace.c
@@ -78,6 +78,35 @@ int put_reg(struct task_struct *task, unsigned int regno, unsigned long data)
78 return 0; 78 return 0;
79} 79}
80 80
81void user_enable_single_step(struct task_struct *child)
82{
83 unsigned long tmp;
84
85 /*
86 * Set up SPC if not set already (in which case we have no other
87 * choice but to trust it).
88 */
89 if (!get_reg(child, PT_SPC)) {
90 /* In case we're stopped in a delay slot. */
91 tmp = get_reg(child, PT_ERP) & ~1;
92 put_reg(child, PT_SPC, tmp);
93 }
94 tmp = get_reg(child, PT_CCS) | SBIT_USER;
95 put_reg(child, PT_CCS, tmp);
96}
97
98void user_disable_single_step(struct task_struct *child)
99{
100 put_reg(child, PT_SPC, 0);
101
102 if (!get_debugreg(child->pid, PT_BP_CTRL)) {
103 unsigned long tmp;
104 /* If no h/w bp configured, disable S bit. */
105 tmp = get_reg(child, PT_CCS) & ~SBIT_USER;
106 put_reg(child, PT_CCS, tmp);
107 }
108}
109
81/* 110/*
82 * Called by kernel/ptrace.c when detaching. 111 * Called by kernel/ptrace.c when detaching.
83 * 112 *
@@ -89,8 +118,7 @@ ptrace_disable(struct task_struct *child)
89 unsigned long tmp; 118 unsigned long tmp;
90 119
91 /* Deconfigure SPC and S-bit. */ 120 /* Deconfigure SPC and S-bit. */
92 tmp = get_reg(child, PT_CCS) & ~SBIT_USER; 121 user_disable_single_step(child);
93 put_reg(child, PT_CCS, tmp);
94 put_reg(child, PT_SPC, 0); 122 put_reg(child, PT_SPC, 0);
95 123
96 /* Deconfigure any watchpoints associated with the child. */ 124 /* Deconfigure any watchpoints associated with the child. */
@@ -169,83 +197,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
169 ret = 0; 197 ret = 0;
170 break; 198 break;
171 199
172 case PTRACE_SYSCALL:
173 case PTRACE_CONT:
174 ret = -EIO;
175
176 if (!valid_signal(data))
177 break;
178
179 /* Continue means no single-step. */
180 put_reg(child, PT_SPC, 0);
181
182 if (!get_debugreg(child->pid, PT_BP_CTRL)) {
183 unsigned long tmp;
184 /* If no h/w bp configured, disable S bit. */
185 tmp = get_reg(child, PT_CCS) & ~SBIT_USER;
186 put_reg(child, PT_CCS, tmp);
187 }
188
189 if (request == PTRACE_SYSCALL) {
190 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
191 }
192 else {
193 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
194 }
195
196 child->exit_code = data;
197
198 /* TODO: make sure any pending breakpoint is killed */
199 wake_up_process(child);
200 ret = 0;
201
202 break;
203
204 /* Make the child exit by sending it a sigkill. */
205 case PTRACE_KILL:
206 ret = 0;
207
208 if (child->exit_state == EXIT_ZOMBIE)
209 break;
210
211 child->exit_code = SIGKILL;
212
213 /* Deconfigure single-step and h/w bp. */
214 ptrace_disable(child);
215
216 /* TODO: make sure any pending breakpoint is killed */
217 wake_up_process(child);
218 break;
219
220 /* Set the trap flag. */
221 case PTRACE_SINGLESTEP: {
222 unsigned long tmp;
223 ret = -EIO;
224
225 /* Set up SPC if not set already (in which case we have
226 no other choice but to trust it). */
227 if (!get_reg(child, PT_SPC)) {
228 /* In case we're stopped in a delay slot. */
229 tmp = get_reg(child, PT_ERP) & ~1;
230 put_reg(child, PT_SPC, tmp);
231 }
232 tmp = get_reg(child, PT_CCS) | SBIT_USER;
233 put_reg(child, PT_CCS, tmp);
234
235 if (!valid_signal(data))
236 break;
237
238 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
239
240 /* TODO: set some clever breakpoint mechanism... */
241
242 child->exit_code = data;
243 wake_up_process(child);
244 ret = 0;
245 break;
246
247 }
248
249 /* Get all GP registers from the child. */ 200 /* Get all GP registers from the child. */
250 case PTRACE_GETREGS: { 201 case PTRACE_GETREGS: {
251 int i; 202 int i;
diff --git a/arch/cris/arch-v32/mach-a3/pinmux.c b/arch/cris/arch-v32/mach-a3/pinmux.c
index 0a28c9bedfb7..18648ef2d874 100644
--- a/arch/cris/arch-v32/mach-a3/pinmux.c
+++ b/arch/cris/arch-v32/mach-a3/pinmux.c
@@ -242,7 +242,7 @@ crisv32_pinmux_dealloc(int port, int first_pin, int last_pin)
242 242
243 crisv32_pinmux_init(); 243 crisv32_pinmux_init();
244 244
245 if (port > PORTS) 245 if (port > PORTS || port < 0)
246 return -EINVAL; 246 return -EINVAL;
247 247
248 spin_lock_irqsave(&pinmux_lock, flags); 248 spin_lock_irqsave(&pinmux_lock, flags);
diff --git a/arch/cris/arch-v32/mach-fs/arbiter.c b/arch/cris/arch-v32/mach-fs/arbiter.c
index 84d31bd7b692..82ef293c4c81 100644
--- a/arch/cris/arch-v32/mach-fs/arbiter.c
+++ b/arch/cris/arch-v32/mach-fs/arbiter.c
@@ -332,7 +332,7 @@ int crisv32_arbiter_unwatch(int id)
332 if (id == 0) 332 if (id == 0)
333 intr_mask.bp0 = regk_marb_no; 333 intr_mask.bp0 = regk_marb_no;
334 else if (id == 1) 334 else if (id == 1)
335 intr_mask.bp2 = regk_marb_no; 335 intr_mask.bp1 = regk_marb_no;
336 else if (id == 2) 336 else if (id == 2)
337 intr_mask.bp2 = regk_marb_no; 337 intr_mask.bp2 = regk_marb_no;
338 else if (id == 3) 338 else if (id == 3)
diff --git a/arch/cris/arch-v32/mach-fs/pinmux.c b/arch/cris/arch-v32/mach-fs/pinmux.c
index d722ad9ae626..38f29eec14a6 100644
--- a/arch/cris/arch-v32/mach-fs/pinmux.c
+++ b/arch/cris/arch-v32/mach-fs/pinmux.c
@@ -54,7 +54,7 @@ crisv32_pinmux_alloc(int port, int first_pin, int last_pin, enum pin_mode mode)
54 54
55 crisv32_pinmux_init(); 55 crisv32_pinmux_init();
56 56
57 if (port > PORTS) 57 if (port > PORTS || port < 0)
58 return -EINVAL; 58 return -EINVAL;
59 59
60 spin_lock_irqsave(&pinmux_lock, flags); 60 spin_lock_irqsave(&pinmux_lock, flags);
@@ -195,7 +195,7 @@ int crisv32_pinmux_dealloc(int port, int first_pin, int last_pin)
195 195
196 crisv32_pinmux_init(); 196 crisv32_pinmux_init();
197 197
198 if (port > PORTS) 198 if (port > PORTS || port < 0)
199 return -EINVAL; 199 return -EINVAL;
200 200
201 spin_lock_irqsave(&pinmux_lock, flags); 201 spin_lock_irqsave(&pinmux_lock, flags);
diff --git a/arch/cris/arch-v32/mm/mmu.S b/arch/cris/arch-v32/mm/mmu.S
index 2238d154bde3..f125d912e140 100644
--- a/arch/cris/arch-v32/mm/mmu.S
+++ b/arch/cris/arch-v32/mm/mmu.S
@@ -115,7 +115,7 @@
115#ifdef CONFIG_SMP 115#ifdef CONFIG_SMP
116 move $s7, $acr ; PGD 116 move $s7, $acr ; PGD
117#else 117#else
118 move.d per_cpu__current_pgd, $acr ; PGD 118 move.d current_pgd, $acr ; PGD
119#endif 119#endif
120 ; Look up PMD in PGD 120 ; Look up PMD in PGD
121 lsrq 24, $r0 ; Get PMD index into PGD (bit 24-31) 121 lsrq 24, $r0 ; Get PMD index into PGD (bit 24-31)
diff --git a/arch/cris/arch-v32/mm/tlb.c b/arch/cris/arch-v32/mm/tlb.c
index 6779bcb28ab0..c030d020660a 100644
--- a/arch/cris/arch-v32/mm/tlb.c
+++ b/arch/cris/arch-v32/mm/tlb.c
@@ -189,7 +189,7 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
189 spin_unlock(&mmu_context_lock); 189 spin_unlock(&mmu_context_lock);
190 190
191 /* 191 /*
192 * Remember the pgd for the fault handlers. Keep a seperate 192 * Remember the pgd for the fault handlers. Keep a separate
193 * copy of it because current and active_mm might be invalid 193 * copy of it because current and active_mm might be invalid
194 * at points where * there's still a need to derefer the pgd. 194 * at points where * there's still a need to derefer the pgd.
195 */ 195 */
diff --git a/arch/cris/include/arch-v32/arch/ptrace.h b/arch/cris/include/arch-v32/arch/ptrace.h
index 41f4e8662bc2..ffca8d0f2e17 100644
--- a/arch/cris/include/arch-v32/arch/ptrace.h
+++ b/arch/cris/include/arch-v32/arch/ptrace.h
@@ -108,6 +108,7 @@ struct switch_stack {
108 108
109#ifdef __KERNEL__ 109#ifdef __KERNEL__
110 110
111#define arch_has_single_step() (1)
111#define user_mode(regs) (((regs)->ccs & (1 << (U_CCS_BITNR + CCS_SHIFT))) != 0) 112#define user_mode(regs) (((regs)->ccs & (1 << (U_CCS_BITNR + CCS_SHIFT))) != 0)
112#define instruction_pointer(regs) ((regs)->erp) 113#define instruction_pointer(regs) ((regs)->erp)
113extern void show_regs(struct pt_regs *); 114extern void show_regs(struct pt_regs *);
diff --git a/arch/cris/include/asm/pci.h b/arch/cris/include/asm/pci.h
index 730ce40fdd0f..9f1cd56da28c 100644
--- a/arch/cris/include/asm/pci.h
+++ b/arch/cris/include/asm/pci.h
@@ -44,14 +44,6 @@ struct pci_dev;
44 */ 44 */
45#define PCI_DMA_BUS_IS_PHYS (1) 45#define PCI_DMA_BUS_IS_PHYS (1)
46 46
47/* pci_unmap_{page,single} is a nop so... */
48#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
49#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
50#define pci_unmap_addr(PTR, ADDR_NAME) (0)
51#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
52#define pci_unmap_len(PTR, LEN_NAME) (0)
53#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
54
55#define HAVE_PCI_MMAP 47#define HAVE_PCI_MMAP
56extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 48extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
57 enum pci_mmap_state mmap_state, int write_combine); 49 enum pci_mmap_state mmap_state, int write_combine);
diff --git a/arch/cris/include/asm/pgtable.h b/arch/cris/include/asm/pgtable.h
index 1fcce00f01f4..99ea6cd1b143 100644
--- a/arch/cris/include/asm/pgtable.h
+++ b/arch/cris/include/asm/pgtable.h
@@ -270,7 +270,7 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; /* defined in head.S */
270 * Actually I am not sure on what this could be used for. 270 * Actually I am not sure on what this could be used for.
271 */ 271 */
272static inline void update_mmu_cache(struct vm_area_struct * vma, 272static inline void update_mmu_cache(struct vm_area_struct * vma,
273 unsigned long address, pte_t pte) 273 unsigned long address, pte_t *ptep)
274{ 274{
275} 275}
276 276
diff --git a/arch/cris/include/asm/unistd.h b/arch/cris/include/asm/unistd.h
index c17079388bb9..f6fad83b3a8c 100644
--- a/arch/cris/include/asm/unistd.h
+++ b/arch/cris/include/asm/unistd.h
@@ -352,6 +352,7 @@
352#define __ARCH_WANT_STAT64 352#define __ARCH_WANT_STAT64
353#define __ARCH_WANT_SYS_ALARM 353#define __ARCH_WANT_SYS_ALARM
354#define __ARCH_WANT_SYS_GETHOSTNAME 354#define __ARCH_WANT_SYS_GETHOSTNAME
355#define __ARCH_WANT_SYS_IPC
355#define __ARCH_WANT_SYS_PAUSE 356#define __ARCH_WANT_SYS_PAUSE
356#define __ARCH_WANT_SYS_SGETMASK 357#define __ARCH_WANT_SYS_SGETMASK
357#define __ARCH_WANT_SYS_SIGNAL 358#define __ARCH_WANT_SYS_SIGNAL
@@ -364,6 +365,7 @@
364#define __ARCH_WANT_SYS_LLSEEK 365#define __ARCH_WANT_SYS_LLSEEK
365#define __ARCH_WANT_SYS_NICE 366#define __ARCH_WANT_SYS_NICE
366#define __ARCH_WANT_SYS_OLD_GETRLIMIT 367#define __ARCH_WANT_SYS_OLD_GETRLIMIT
368#define __ARCH_WANT_SYS_OLD_MMAP
367#define __ARCH_WANT_SYS_OLDUMOUNT 369#define __ARCH_WANT_SYS_OLDUMOUNT
368#define __ARCH_WANT_SYS_SIGPENDING 370#define __ARCH_WANT_SYS_SIGPENDING
369#define __ARCH_WANT_SYS_SIGPROCMASK 371#define __ARCH_WANT_SYS_SIGPROCMASK
diff --git a/arch/cris/kernel/irq.c b/arch/cris/kernel/irq.c
index b5ce0724a88f..6d7b9eda4036 100644
--- a/arch/cris/kernel/irq.c
+++ b/arch/cris/kernel/irq.c
@@ -63,7 +63,7 @@ int show_interrupts(struct seq_file *p, void *v)
63 for_each_online_cpu(j) 63 for_each_online_cpu(j)
64 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); 64 seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
65#endif 65#endif
66 seq_printf(p, " %14s", irq_desc[i].chip->typename); 66 seq_printf(p, " %14s", irq_desc[i].chip->name);
67 seq_printf(p, " %s", action->name); 67 seq_printf(p, " %s", action->name);
68 68
69 for (action=action->next; action; action = action->next) 69 for (action=action->next; action; action = action->next)
diff --git a/arch/cris/kernel/sys_cris.c b/arch/cris/kernel/sys_cris.c
index c2bbb1ac98a9..7aa036ec78ff 100644
--- a/arch/cris/kernel/sys_cris.c
+++ b/arch/cris/kernel/sys_cris.c
@@ -26,24 +26,6 @@
26#include <asm/uaccess.h> 26#include <asm/uaccess.h>
27#include <asm/segment.h> 27#include <asm/segment.h>
28 28
29asmlinkage unsigned long old_mmap(unsigned long __user *args)
30{
31 unsigned long buffer[6];
32 int err = -EFAULT;
33
34 if (copy_from_user(&buffer, args, sizeof(buffer)))
35 goto out;
36
37 err = -EINVAL;
38 if (buffer[5] & ~PAGE_MASK) /* verify that offset is on page boundary */
39 goto out;
40
41 err = sys_mmap_pgoff(buffer[0], buffer[1], buffer[2], buffer[3],
42 buffer[4], buffer[5] >> PAGE_SHIFT);
43out:
44 return err;
45}
46
47asmlinkage long 29asmlinkage long
48sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, 30sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
49 unsigned long flags, unsigned long fd, unsigned long pgoff) 31 unsigned long flags, unsigned long fd, unsigned long pgoff)
@@ -51,81 +33,3 @@ sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot,
51 /* bug(?): 8Kb pages here */ 33 /* bug(?): 8Kb pages here */
52 return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); 34 return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff);
53} 35}
54
55/*
56 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
57 *
58 * This is really horribly ugly. (same as arch/i386)
59 */
60
61asmlinkage int sys_ipc (uint call, int first, int second,
62 int third, void __user *ptr, long fifth)
63{
64 int version, ret;
65
66 version = call >> 16; /* hack for backward compatibility */
67 call &= 0xffff;
68
69 switch (call) {
70 case SEMOP:
71 return sys_semtimedop (first, (struct sembuf __user *)ptr, second, NULL);
72 case SEMTIMEDOP:
73 return sys_semtimedop(first, (struct sembuf __user *)ptr, second,
74 (const struct timespec __user *)fifth);
75
76 case SEMGET:
77 return sys_semget (first, second, third);
78 case SEMCTL: {
79 union semun fourth;
80 if (!ptr)
81 return -EINVAL;
82 if (get_user(fourth.__pad, (void * __user *) ptr))
83 return -EFAULT;
84 return sys_semctl (first, second, third, fourth);
85 }
86
87 case MSGSND:
88 return sys_msgsnd (first, (struct msgbuf __user *) ptr,
89 second, third);
90 case MSGRCV:
91 switch (version) {
92 case 0: {
93 struct ipc_kludge tmp;
94 if (!ptr)
95 return -EINVAL;
96
97 if (copy_from_user(&tmp,
98 (struct ipc_kludge __user *) ptr,
99 sizeof (tmp)))
100 return -EFAULT;
101 return sys_msgrcv (first, tmp.msgp, second,
102 tmp.msgtyp, third);
103 }
104 default:
105 return sys_msgrcv (first,
106 (struct msgbuf __user *) ptr,
107 second, fifth, third);
108 }
109 case MSGGET:
110 return sys_msgget ((key_t) first, second);
111 case MSGCTL:
112 return sys_msgctl (first, second, (struct msqid_ds __user *) ptr);
113
114 case SHMAT: {
115 ulong raddr;
116 ret = do_shmat (first, (char __user *) ptr, second, &raddr);
117 if (ret)
118 return ret;
119 return put_user (raddr, (ulong __user *) third);
120 }
121 case SHMDT:
122 return sys_shmdt ((char __user *)ptr);
123 case SHMGET:
124 return sys_shmget (first, second, third);
125 case SHMCTL:
126 return sys_shmctl (first, second,
127 (struct shmid_ds __user *) ptr);
128 default:
129 return -ENOSYS;
130 }
131}
diff --git a/arch/cris/kernel/time.c b/arch/cris/kernel/time.c
index 074fe7dea96b..a05dd31f3efb 100644
--- a/arch/cris/kernel/time.c
+++ b/arch/cris/kernel/time.c
@@ -42,75 +42,11 @@ unsigned long loops_per_usec;
42extern unsigned long do_slow_gettimeoffset(void); 42extern unsigned long do_slow_gettimeoffset(void);
43static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset; 43static unsigned long (*do_gettimeoffset)(void) = do_slow_gettimeoffset;
44 44
45/* 45u32 arch_gettimeoffset(void)
46 * This version of gettimeofday has near microsecond resolution.
47 *
48 * Note: Division is quite slow on CRIS and do_gettimeofday is called
49 * rather often. Maybe we should do some kind of approximation here
50 * (a naive approximation would be to divide by 1024).
51 */
52void do_gettimeofday(struct timeval *tv)
53{
54 unsigned long flags;
55 signed long usec, sec;
56 local_irq_save(flags);
57 usec = do_gettimeoffset();
58
59 /*
60 * If time_adjust is negative then NTP is slowing the clock
61 * so make sure not to go into next possible interval.
62 * Better to lose some accuracy than have time go backwards..
63 */
64 if (unlikely(time_adjust < 0) && usec > tickadj)
65 usec = tickadj;
66
67 sec = xtime.tv_sec;
68 usec += xtime.tv_nsec / 1000;
69 local_irq_restore(flags);
70
71 while (usec >= 1000000) {
72 usec -= 1000000;
73 sec++;
74 }
75
76 tv->tv_sec = sec;
77 tv->tv_usec = usec;
78}
79
80EXPORT_SYMBOL(do_gettimeofday);
81
82int do_settimeofday(struct timespec *tv)
83{ 46{
84 time_t wtm_sec, sec = tv->tv_sec; 47 return do_gettimeoffset() * 1000;
85 long wtm_nsec, nsec = tv->tv_nsec;
86
87 if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
88 return -EINVAL;
89
90 write_seqlock_irq(&xtime_lock);
91 /*
92 * This is revolting. We need to set "xtime" correctly. However, the
93 * value in this location is the value at the most recent update of
94 * wall time. Discover what correction gettimeofday() would have
95 * made, and then undo it!
96 */
97 nsec -= do_gettimeoffset() * NSEC_PER_USEC;
98
99 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
100 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
101
102 set_normalized_timespec(&xtime, sec, nsec);
103 set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
104
105 ntp_clear();
106 write_sequnlock_irq(&xtime_lock);
107 clock_was_set();
108 return 0;
109} 48}
110 49
111EXPORT_SYMBOL(do_settimeofday);
112
113
114/* 50/*
115 * BUG: This routine does not handle hour overflow properly; it just 51 * BUG: This routine does not handle hour overflow properly; it just
116 * sets the minutes. Usually you'll only notice that after reboot! 52 * sets the minutes. Usually you'll only notice that after reboot!