aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/parisc/kernel/sys_parisc32.c141
-rw-r--r--arch/parisc/kernel/syscall_table.S4
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S2
-rw-r--r--drivers/video/console/Kconfig2
-rw-r--r--drivers/video/console/sticore.c14
-rw-r--r--include/asm-parisc/io.h10
-rw-r--r--include/asm-parisc/vga.h6
7 files changed, 25 insertions, 154 deletions
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index bb23ff71c28e..2989c6682bf6 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -285,147 +285,6 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat __user *statbuf)
285 return err; 285 return err;
286} 286}
287 287
288struct linux32_dirent {
289 u32 d_ino;
290 compat_off_t d_off;
291 u16 d_reclen;
292 char d_name[1];
293};
294
295struct old_linux32_dirent {
296 u32 d_ino;
297 u32 d_offset;
298 u16 d_namlen;
299 char d_name[1];
300};
301
302struct getdents32_callback {
303 struct linux32_dirent __user * current_dir;
304 struct linux32_dirent __user * previous;
305 int count;
306 int error;
307};
308
309struct readdir32_callback {
310 struct old_linux32_dirent __user * dirent;
311 int count;
312};
313
314#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))
315static int filldir32 (void *__buf, const char *name, int namlen,
316 loff_t offset, u64 ino, unsigned int d_type)
317{
318 struct linux32_dirent __user * dirent;
319 struct getdents32_callback * buf = (struct getdents32_callback *) __buf;
320 int reclen = ALIGN(NAME_OFFSET(dirent) + namlen + 1, 4);
321 u32 d_ino;
322
323 buf->error = -EINVAL; /* only used if we fail.. */
324 if (reclen > buf->count)
325 return -EINVAL;
326 d_ino = ino;
327 if (sizeof(d_ino) < sizeof(ino) && d_ino != ino)
328 return -EOVERFLOW;
329 dirent = buf->previous;
330 if (dirent)
331 put_user(offset, &dirent->d_off);
332 dirent = buf->current_dir;
333 buf->previous = dirent;
334 put_user(d_ino, &dirent->d_ino);
335 put_user(reclen, &dirent->d_reclen);
336 copy_to_user(dirent->d_name, name, namlen);
337 put_user(0, dirent->d_name + namlen);
338 dirent = ((void __user *)dirent) + reclen;
339 buf->current_dir = dirent;
340 buf->count -= reclen;
341 return 0;
342}
343
344asmlinkage long
345sys32_getdents (unsigned int fd, void __user * dirent, unsigned int count)
346{
347 struct file * file;
348 struct linux32_dirent __user * lastdirent;
349 struct getdents32_callback buf;
350 int error;
351
352 error = -EFAULT;
353 if (!access_ok(VERIFY_WRITE, dirent, count))
354 goto out;
355
356 error = -EBADF;
357 file = fget(fd);
358 if (!file)
359 goto out;
360
361 buf.current_dir = (struct linux32_dirent __user *) dirent;
362 buf.previous = NULL;
363 buf.count = count;
364 buf.error = 0;
365
366 error = vfs_readdir(file, filldir32, &buf);
367 if (error < 0)
368 goto out_putf;
369 error = buf.error;
370 lastdirent = buf.previous;
371 if (lastdirent) {
372 if (put_user(file->f_pos, &lastdirent->d_off))
373 error = -EFAULT;
374 else
375 error = count - buf.count;
376 }
377
378out_putf:
379 fput(file);
380out:
381 return error;
382}
383
384static int fillonedir32(void * __buf, const char * name, int namlen,
385 loff_t offset, u64 ino, unsigned int d_type)
386{
387 struct readdir32_callback * buf = (struct readdir32_callback *) __buf;
388 struct old_linux32_dirent __user * dirent;
389 u32 d_ino;
390
391 if (buf->count)
392 return -EINVAL;
393 d_ino = ino;
394 if (sizeof(d_ino) < sizeof(ino) && d_ino != ino)
395 return -EOVERFLOW;
396 buf->count++;
397 dirent = buf->dirent;
398 put_user(d_ino, &dirent->d_ino);
399 put_user(offset, &dirent->d_offset);
400 put_user(namlen, &dirent->d_namlen);
401 copy_to_user(dirent->d_name, name, namlen);
402 put_user(0, dirent->d_name + namlen);
403 return 0;
404}
405
406asmlinkage long
407sys32_readdir (unsigned int fd, void __user * dirent, unsigned int count)
408{
409 int error;
410 struct file * file;
411 struct readdir32_callback buf;
412
413 error = -EBADF;
414 file = fget(fd);
415 if (!file)
416 goto out;
417
418 buf.count = 0;
419 buf.dirent = dirent;
420
421 error = vfs_readdir(file, fillonedir32, &buf);
422 if (error >= 0)
423 error = buf.count;
424 fput(file);
425out:
426 return error;
427}
428
429/*** copied from mips64 ***/ 288/*** copied from mips64 ***/
430/* 289/*
431 * Ooo, nasty. We need here to frob 32-bit unsigned longs to 290 * Ooo, nasty. We need here to frob 32-bit unsigned longs to
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 627f3c28ad8c..2540786a970f 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -222,9 +222,7 @@
222 ENTRY_SAME(setfsgid) 222 ENTRY_SAME(setfsgid)
223 /* I think this might work */ 223 /* I think this might work */
224 ENTRY_SAME(llseek) /* 140 */ 224 ENTRY_SAME(llseek) /* 140 */
225 /* struct linux_dirent has longs, like 'unsigned long d_ino' which 225 ENTRY_COMP(getdents)
226 * almost definitely should be 'ino_t d_ino' but it's too late now */
227 ENTRY_DIFF(getdents)
228 /* it is POSSIBLE that select will be OK because even though fd_set 226 /* it is POSSIBLE that select will be OK because even though fd_set
229 * contains longs, the macros and sizes are clever. */ 227 * contains longs, the macros and sizes are clever. */
230 ENTRY_COMP(select) 228 ENTRY_COMP(select)
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index d4e6a93c8d9a..ee7a16eb6fdd 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -81,6 +81,8 @@ SECTIONS
81 __ex_table : { *(__ex_table) } 81 __ex_table : { *(__ex_table) }
82 __stop___ex_table = .; 82 __stop___ex_table = .;
83 83
84 NOTES
85
84 __start___unwind = .; /* unwind info */ 86 __start___unwind = .; /* unwind info */
85 .PARISC.unwind : { *(.PARISC.unwind) } 87 .PARISC.unwind : { *(.PARISC.unwind) }
86 __stop___unwind = .; 88 __stop___unwind = .;
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
index 49643969f9f8..5db6b1e489b0 100644
--- a/drivers/video/console/Kconfig
+++ b/drivers/video/console/Kconfig
@@ -145,7 +145,7 @@ config FRAMEBUFFER_CONSOLE_ROTATION
145 oriented. 145 oriented.
146 146
147config STI_CONSOLE 147config STI_CONSOLE
148 tristate "STI text console" 148 bool "STI text console"
149 depends on PARISC 149 depends on PARISC
150 default y 150 default y
151 help 151 help
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
index 870017d44970..e9ab657f0bb7 100644
--- a/drivers/video/console/sticore.c
+++ b/drivers/video/console/sticore.c
@@ -232,18 +232,14 @@ sti_bmove(struct sti_struct *sti, int src_y, int src_x,
232} 232}
233 233
234 234
235/* FIXME: Do we have another solution for this ? */ 235static void sti_flush(unsigned long start, unsigned long end)
236static void sti_flush(unsigned long from, unsigned long len)
237{ 236{
238 flush_data_cache(); 237 flush_icache_range(start, end);
239 flush_kernel_dcache_range(from, len);
240 flush_icache_range(from, from+len);
241} 238}
242 239
243void __devinit 240void __devinit
244sti_rom_copy(unsigned long base, unsigned long count, void *dest) 241sti_rom_copy(unsigned long base, unsigned long count, void *dest)
245{ 242{
246 unsigned long dest_len = count;
247 unsigned long dest_start = (unsigned long) dest; 243 unsigned long dest_start = (unsigned long) dest;
248 244
249 /* this still needs to be revisited (see arch/parisc/mm/init.c:246) ! */ 245 /* this still needs to be revisited (see arch/parisc/mm/init.c:246) ! */
@@ -260,7 +256,7 @@ sti_rom_copy(unsigned long base, unsigned long count, void *dest)
260 dest++; 256 dest++;
261 } 257 }
262 258
263 sti_flush(dest_start, dest_len); 259 sti_flush(dest_start, (unsigned long)dest);
264} 260}
265 261
266 262
@@ -663,7 +659,6 @@ sti_bmode_font_raw(struct sti_cooked_font *f)
663static void __devinit 659static void __devinit
664sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest) 660sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest)
665{ 661{
666 unsigned long dest_len = count;
667 unsigned long dest_start = (unsigned long) dest; 662 unsigned long dest_start = (unsigned long) dest;
668 663
669 while (count) { 664 while (count) {
@@ -672,7 +667,8 @@ sti_bmode_rom_copy(unsigned long base, unsigned long count, void *dest)
672 base += 4; 667 base += 4;
673 dest++; 668 dest++;
674 } 669 }
675 sti_flush(dest_start, dest_len); 670
671 sti_flush(dest_start, (unsigned long)dest);
676} 672}
677 673
678static struct sti_rom * __devinit 674static struct sti_rom * __devinit
diff --git a/include/asm-parisc/io.h b/include/asm-parisc/io.h
index c0fed91da3a2..4cc9bcec0564 100644
--- a/include/asm-parisc/io.h
+++ b/include/asm-parisc/io.h
@@ -15,6 +15,16 @@ extern unsigned long parisc_vmerge_max_size;
15#define virt_to_bus virt_to_phys 15#define virt_to_bus virt_to_phys
16#define bus_to_virt phys_to_virt 16#define bus_to_virt phys_to_virt
17 17
18static inline unsigned long isa_bus_to_virt(unsigned long addr) {
19 BUG();
20 return 0;
21}
22
23static inline unsigned long isa_virt_to_bus(void *addr) {
24 BUG();
25 return 0;
26}
27
18/* 28/*
19 * Memory mapped I/O 29 * Memory mapped I/O
20 * 30 *
diff --git a/include/asm-parisc/vga.h b/include/asm-parisc/vga.h
new file mode 100644
index 000000000000..154a84c843a7
--- /dev/null
+++ b/include/asm-parisc/vga.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_PARISC_VGA_H__
2#define __ASM_PARISC_VGA_H__
3
4/* nothing */
5
6#endif __ASM_PARISC_VGA_H__