diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-12-08 01:07:56 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-12-08 01:07:56 -0500 |
commit | bef986502fa398b1785a3979b1aa17cd902d3527 (patch) | |
tree | b59c1afe7b1dfcc001b86e54863f550d7ddc8c34 /include/asm-sh64 | |
parent | 4bdbd2807deeccc0793d57fb5120d7a53f2c0b3c (diff) | |
parent | c99767974ebd2a719d849fdeaaa1674456f5283f (diff) |
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/usb/input/hid.h
Diffstat (limited to 'include/asm-sh64')
-rw-r--r-- | include/asm-sh64/checksum.h | 41 | ||||
-rw-r--r-- | include/asm-sh64/device.h | 7 | ||||
-rw-r--r-- | include/asm-sh64/dma-mapping.h | 2 | ||||
-rw-r--r-- | include/asm-sh64/setup.h | 6 | ||||
-rw-r--r-- | include/asm-sh64/unistd.h | 142 |
5 files changed, 28 insertions, 170 deletions
diff --git a/include/asm-sh64/checksum.h b/include/asm-sh64/checksum.h index fd034e9ae6e3..ba594ccb42e5 100644 --- a/include/asm-sh64/checksum.h +++ b/include/asm-sh64/checksum.h | |||
@@ -26,8 +26,7 @@ | |||
26 | * | 26 | * |
27 | * it's best to have buff aligned on a 32-bit boundary | 27 | * it's best to have buff aligned on a 32-bit boundary |
28 | */ | 28 | */ |
29 | asmlinkage unsigned int csum_partial(const unsigned char *buff, int len, | 29 | asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); |
30 | unsigned int sum); | ||
31 | 30 | ||
32 | /* | 31 | /* |
33 | * Note: when you get a NULL pointer exception here this means someone | 32 | * Note: when you get a NULL pointer exception here this means someone |
@@ -38,46 +37,34 @@ asmlinkage unsigned int csum_partial(const unsigned char *buff, int len, | |||
38 | */ | 37 | */ |
39 | 38 | ||
40 | 39 | ||
41 | unsigned int csum_partial_copy_nocheck(const char *src, char *dst, int len, | 40 | __wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, |
42 | unsigned int sum); | 41 | __wsum sum); |
43 | 42 | ||
44 | unsigned int csum_partial_copy_from_user(const char *src, char *dst, | 43 | __wsum csum_partial_copy_from_user(const void __user *src, void *dst, |
45 | int len, int sum, int *err_ptr); | 44 | int len, __wsum sum, int *err_ptr); |
46 | 45 | ||
47 | /* | 46 | static inline __sum16 csum_fold(__wsum csum) |
48 | * These are the old (and unsafe) way of doing checksums, a warning message will be | ||
49 | * printed if they are used and an exeption occurs. | ||
50 | * | ||
51 | * these functions should go away after some time. | ||
52 | */ | ||
53 | |||
54 | #define csum_partial_copy_fromuser csum_partial_copy | ||
55 | |||
56 | unsigned int csum_partial_copy(const char *src, char *dst, int len, | ||
57 | unsigned int sum); | ||
58 | |||
59 | static inline unsigned short csum_fold(unsigned int sum) | ||
60 | { | 47 | { |
48 | u32 sum = (__force u32)csum; | ||
61 | sum = (sum & 0xffff) + (sum >> 16); | 49 | sum = (sum & 0xffff) + (sum >> 16); |
62 | sum = (sum & 0xffff) + (sum >> 16); | 50 | sum = (sum & 0xffff) + (sum >> 16); |
63 | return ~(sum); | 51 | return (__force __sum16)~sum; |
64 | } | 52 | } |
65 | 53 | ||
66 | unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl); | 54 | __sum16 ip_fast_csum(const void *iph, unsigned int ihl); |
67 | 55 | ||
68 | unsigned long csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, | 56 | __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr, |
69 | unsigned short len, unsigned short proto, | 57 | unsigned short len, unsigned short proto, |
70 | unsigned int sum); | 58 | __wsum sum); |
71 | 59 | ||
72 | /* | 60 | /* |
73 | * computes the checksum of the TCP/UDP pseudo-header | 61 | * computes the checksum of the TCP/UDP pseudo-header |
74 | * returns a 16-bit checksum, already complemented | 62 | * returns a 16-bit checksum, already complemented |
75 | */ | 63 | */ |
76 | static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | 64 | static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr, |
77 | unsigned long daddr, | ||
78 | unsigned short len, | 65 | unsigned short len, |
79 | unsigned short proto, | 66 | unsigned short proto, |
80 | unsigned int sum) | 67 | __wsum sum) |
81 | { | 68 | { |
82 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); | 69 | return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); |
83 | } | 70 | } |
@@ -86,7 +73,7 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, | |||
86 | * this routine is used for miscellaneous IP-like checksums, mainly | 73 | * this routine is used for miscellaneous IP-like checksums, mainly |
87 | * in icmp.c | 74 | * in icmp.c |
88 | */ | 75 | */ |
89 | static inline unsigned short ip_compute_csum(unsigned char * buff, int len) | 76 | static inline __sum16 ip_compute_csum(const void *buff, int len) |
90 | { | 77 | { |
91 | return csum_fold(csum_partial(buff, len, 0)); | 78 | return csum_fold(csum_partial(buff, len, 0)); |
92 | } | 79 | } |
diff --git a/include/asm-sh64/device.h b/include/asm-sh64/device.h new file mode 100644 index 000000000000..d8f9872b0e2d --- /dev/null +++ b/include/asm-sh64/device.h | |||
@@ -0,0 +1,7 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h index 68e27a8fca31..5efe906c59f7 100644 --- a/include/asm-sh64/dma-mapping.h +++ b/include/asm-sh64/dma-mapping.h | |||
@@ -35,7 +35,7 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
35 | consistent_free(NULL, size, vaddr, dma_handle); | 35 | consistent_free(NULL, size, vaddr, dma_handle); |
36 | } | 36 | } |
37 | 37 | ||
38 | static inline void dma_cache_sync(void *vaddr, size_t size, | 38 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
39 | enum dma_data_direction dir) | 39 | enum dma_data_direction dir) |
40 | { | 40 | { |
41 | dma_cache_wback_inv((unsigned long)vaddr, size); | 41 | dma_cache_wback_inv((unsigned long)vaddr, size); |
diff --git a/include/asm-sh64/setup.h b/include/asm-sh64/setup.h index ebd42eb1b709..5b07b14c2927 100644 --- a/include/asm-sh64/setup.h +++ b/include/asm-sh64/setup.h | |||
@@ -1,6 +1,10 @@ | |||
1 | #ifndef __ASM_SH64_SETUP_H | 1 | #ifndef __ASM_SH64_SETUP_H |
2 | #define __ASM_SH64_SETUP_H | 2 | #define __ASM_SH64_SETUP_H |
3 | 3 | ||
4 | #define COMMAND_LINE_SIZE 256 | ||
5 | |||
6 | #ifdef __KERNEL__ | ||
7 | |||
4 | #define PARAM ((unsigned char *)empty_zero_page) | 8 | #define PARAM ((unsigned char *)empty_zero_page) |
5 | #define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000)) | 9 | #define MOUNT_ROOT_RDONLY (*(unsigned long *) (PARAM+0x000)) |
6 | #define RAMDISK_FLAGS (*(unsigned long *) (PARAM+0x004)) | 10 | #define RAMDISK_FLAGS (*(unsigned long *) (PARAM+0x004)) |
@@ -12,5 +16,7 @@ | |||
12 | #define COMMAND_LINE ((char *) (PARAM+256)) | 16 | #define COMMAND_LINE ((char *) (PARAM+256)) |
13 | #define COMMAND_LINE_SIZE 256 | 17 | #define COMMAND_LINE_SIZE 256 |
14 | 18 | ||
19 | #endif /* __KERNEL__ */ | ||
20 | |||
15 | #endif /* __ASM_SH64_SETUP_H */ | 21 | #endif /* __ASM_SH64_SETUP_H */ |
16 | 22 | ||
diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h index ee7828b27ad1..1f38a7aacaaf 100644 --- a/include/asm-sh64/unistd.h +++ b/include/asm-sh64/unistd.h | |||
@@ -347,148 +347,6 @@ | |||
347 | #ifdef __KERNEL__ | 347 | #ifdef __KERNEL__ |
348 | 348 | ||
349 | #define NR_syscalls 321 | 349 | #define NR_syscalls 321 |
350 | #include <linux/err.h> | ||
351 | |||
352 | /* user-visible error numbers are in the range -1 - -MAX_ERRNO: | ||
353 | * see <asm-sh64/errno.h> */ | ||
354 | |||
355 | #define __syscall_return(type, res) \ | ||
356 | do { \ | ||
357 | /* Note: when returning from kernel the return value is in r9 \ | ||
358 | ** This prevents conflicts between return value and arg1 \ | ||
359 | ** when dispatching signal handler, in other words makes \ | ||
360 | ** life easier in the system call epilogue (see entry.S) \ | ||
361 | */ \ | ||
362 | register unsigned long __sr2 __asm__ ("r2") = res; \ | ||
363 | if ((unsigned long)(res) >= (unsigned long)(-MAX_ERRNO)) { \ | ||
364 | errno = -(res); \ | ||
365 | __sr2 = -1; \ | ||
366 | } \ | ||
367 | return (type) (__sr2); \ | ||
368 | } while (0) | ||
369 | |||
370 | /* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */ | ||
371 | |||
372 | #define _syscall0(type,name) \ | ||
373 | type name(void) \ | ||
374 | { \ | ||
375 | register unsigned long __sc0 __asm__ ("r9") = ((0x10 << 16) | __NR_##name); \ | ||
376 | __asm__ __volatile__ ("trapa %1 !\t\t\t" #name "()" \ | ||
377 | : "=r" (__sc0) \ | ||
378 | : "r" (__sc0) ); \ | ||
379 | __syscall_return(type,__sc0); \ | ||
380 | } | ||
381 | |||
382 | /* | ||
383 | * The apparent spurious "dummy" assembler comment is *needed*, | ||
384 | * as without it, the compiler treats the arg<n> variables | ||
385 | * as no longer live just before the asm. The compiler can | ||
386 | * then optimize the storage into any registers it wishes. | ||
387 | * The additional dummy statement forces the compiler to put | ||
388 | * the arguments into the correct registers before the TRAPA. | ||
389 | */ | ||
390 | #define _syscall1(type,name,type1,arg1) \ | ||
391 | type name(type1 arg1) \ | ||
392 | { \ | ||
393 | register unsigned long __sc0 __asm__ ("r9") = ((0x11 << 16) | __NR_##name); \ | ||
394 | register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \ | ||
395 | __asm__ __volatile__ ("trapa %1 !\t\t\t" #name "(%2)" \ | ||
396 | : "=r" (__sc0) \ | ||
397 | : "r" (__sc0), "r" (__sc2)); \ | ||
398 | __asm__ __volatile__ ("!dummy %0 %1" \ | ||
399 | : \ | ||
400 | : "r" (__sc0), "r" (__sc2)); \ | ||
401 | __syscall_return(type,__sc0); \ | ||
402 | } | ||
403 | |||
404 | #define _syscall2(type,name,type1,arg1,type2,arg2) \ | ||
405 | type name(type1 arg1,type2 arg2) \ | ||
406 | { \ | ||
407 | register unsigned long __sc0 __asm__ ("r9") = ((0x12 << 16) | __NR_##name); \ | ||
408 | register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \ | ||
409 | register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2; \ | ||
410 | __asm__ __volatile__ ("trapa %1 !\t\t\t" #name "(%2,%3)" \ | ||
411 | : "=r" (__sc0) \ | ||
412 | : "r" (__sc0), "r" (__sc2), "r" (__sc3) ); \ | ||
413 | __asm__ __volatile__ ("!dummy %0 %1 %2" \ | ||
414 | : \ | ||
415 | : "r" (__sc0), "r" (__sc2), "r" (__sc3) ); \ | ||
416 | __syscall_return(type,__sc0); \ | ||
417 | } | ||
418 | |||
419 | #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ | ||
420 | type name(type1 arg1,type2 arg2,type3 arg3) \ | ||
421 | { \ | ||
422 | register unsigned long __sc0 __asm__ ("r9") = ((0x13 << 16) | __NR_##name); \ | ||
423 | register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \ | ||
424 | register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2; \ | ||
425 | register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3; \ | ||
426 | __asm__ __volatile__ ("trapa %1 !\t\t\t" #name "(%2,%3,%4)" \ | ||
427 | : "=r" (__sc0) \ | ||
428 | : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4) ); \ | ||
429 | __asm__ __volatile__ ("!dummy %0 %1 %2 %3" \ | ||
430 | : \ | ||
431 | : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4) ); \ | ||
432 | __syscall_return(type,__sc0); \ | ||
433 | } | ||
434 | |||
435 | #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ | ||
436 | type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ | ||
437 | { \ | ||
438 | register unsigned long __sc0 __asm__ ("r9") = ((0x14 << 16) | __NR_##name); \ | ||
439 | register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \ | ||
440 | register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2; \ | ||
441 | register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3; \ | ||
442 | register unsigned long __sc5 __asm__ ("r5") = (unsigned long) arg4; \ | ||
443 | __asm__ __volatile__ ("trapa %1 !\t\t\t" #name "(%2,%3,%4,%5)" \ | ||
444 | : "=r" (__sc0) \ | ||
445 | : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5) );\ | ||
446 | __asm__ __volatile__ ("!dummy %0 %1 %2 %3 %4" \ | ||
447 | : \ | ||
448 | : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5) );\ | ||
449 | __syscall_return(type,__sc0); \ | ||
450 | } | ||
451 | |||
452 | #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ | ||
453 | type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ | ||
454 | { \ | ||
455 | register unsigned long __sc0 __asm__ ("r9") = ((0x15 << 16) | __NR_##name); \ | ||
456 | register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \ | ||
457 | register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2; \ | ||
458 | register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3; \ | ||
459 | register unsigned long __sc5 __asm__ ("r5") = (unsigned long) arg4; \ | ||
460 | register unsigned long __sc6 __asm__ ("r6") = (unsigned long) arg5; \ | ||
461 | __asm__ __volatile__ ("trapa %1 !\t\t\t" #name "(%2,%3,%4,%5,%6)" \ | ||
462 | : "=r" (__sc0) \ | ||
463 | : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \ | ||
464 | "r" (__sc6)); \ | ||
465 | __asm__ __volatile__ ("!dummy %0 %1 %2 %3 %4 %5" \ | ||
466 | : \ | ||
467 | : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \ | ||
468 | "r" (__sc6)); \ | ||
469 | __syscall_return(type,__sc0); \ | ||
470 | } | ||
471 | |||
472 | #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5, type6, arg6) \ | ||
473 | type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \ | ||
474 | { \ | ||
475 | register unsigned long __sc0 __asm__ ("r9") = ((0x16 << 16) | __NR_##name); \ | ||
476 | register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \ | ||
477 | register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2; \ | ||
478 | register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3; \ | ||
479 | register unsigned long __sc5 __asm__ ("r5") = (unsigned long) arg4; \ | ||
480 | register unsigned long __sc6 __asm__ ("r6") = (unsigned long) arg5; \ | ||
481 | register unsigned long __sc7 __asm__ ("r7") = (unsigned long) arg6; \ | ||
482 | __asm__ __volatile__ ("trapa %1 !\t\t\t" #name "(%2,%3,%4,%5,%6,%7)" \ | ||
483 | : "=r" (__sc0) \ | ||
484 | : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \ | ||
485 | "r" (__sc6), "r" (__sc7)); \ | ||
486 | __asm__ __volatile__ ("!dummy %0 %1 %2 %3 %4 %5 %6" \ | ||
487 | : \ | ||
488 | : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \ | ||
489 | "r" (__sc6), "r" (__sc7)); \ | ||
490 | __syscall_return(type,__sc0); \ | ||
491 | } | ||
492 | 350 | ||
493 | #define __ARCH_WANT_IPC_PARSE_VERSION | 351 | #define __ARCH_WANT_IPC_PARSE_VERSION |
494 | #define __ARCH_WANT_OLD_READDIR | 352 | #define __ARCH_WANT_OLD_READDIR |