diff options
| author | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-08 18:07:31 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-08 18:07:31 -0500 |
| commit | 86302f417561fec802f88fdfc343265689d4a596 (patch) | |
| tree | 7fb35e3ba6a54f64316aeb0f4b4fc9947b1c0691 /include | |
| parent | 74bda9310fe9776f3d940057ac2e7881214577d6 (diff) | |
| parent | 2dbda7dceca81adfe57c8884be5c66e70822d89a (diff) | |
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
[MIPS] PNX8550: Fix system timer support
[MIPS] TX49: Fix use of CDEX build_store_reg()
[MIPS] pnx8550: Fix write_config_byte() PCI config space accessor
[MIPS] Fix build errors on SEAD
[MIPS] SMTC build fix
[MIPS] csum_partial and copy in parallel
[MIPS] Malta: Add missing MTD file.
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-mips/checksum.h | 31 | ||||
| -rw-r--r-- | include/asm-mips/irq.h | 6 |
2 files changed, 22 insertions, 15 deletions
diff --git a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h index 9b768c3b96b3..24cdcc6eaab8 100644 --- a/include/asm-mips/checksum.h +++ b/include/asm-mips/checksum.h | |||
| @@ -29,31 +29,38 @@ | |||
| 29 | */ | 29 | */ |
| 30 | __wsum csum_partial(const void *buff, int len, __wsum sum); | 30 | __wsum csum_partial(const void *buff, int len, __wsum sum); |
| 31 | 31 | ||
| 32 | __wsum __csum_partial_copy_user(const void *src, void *dst, | ||
| 33 | int len, __wsum sum, int *err_ptr); | ||
| 34 | |||
| 32 | /* | 35 | /* |
| 33 | * this is a new version of the above that records errors it finds in *errp, | 36 | * this is a new version of the above that records errors it finds in *errp, |
| 34 | * but continues and zeros the rest of the buffer. | 37 | * but continues and zeros the rest of the buffer. |
| 35 | */ | 38 | */ |
| 36 | __wsum csum_partial_copy_from_user(const void __user *src, | 39 | static inline |
| 37 | void *dst, int len, | 40 | __wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len, |
| 38 | __wsum sum, int *errp); | 41 | __wsum sum, int *err_ptr) |
| 42 | { | ||
| 43 | might_sleep(); | ||
| 44 | return __csum_partial_copy_user((__force void *)src, dst, | ||
| 45 | len, sum, err_ptr); | ||
| 46 | } | ||
| 39 | 47 | ||
| 40 | /* | 48 | /* |
| 41 | * Copy and checksum to user | 49 | * Copy and checksum to user |
| 42 | */ | 50 | */ |
| 43 | #define HAVE_CSUM_COPY_USER | 51 | #define HAVE_CSUM_COPY_USER |
| 44 | static inline __wsum csum_and_copy_to_user (const void *src, void __user *dst, | 52 | static inline |
| 45 | int len, __wsum sum, | 53 | __wsum csum_and_copy_to_user(const void *src, void __user *dst, int len, |
| 46 | int *err_ptr) | 54 | __wsum sum, int *err_ptr) |
| 47 | { | 55 | { |
| 48 | might_sleep(); | 56 | might_sleep(); |
| 49 | sum = csum_partial(src, len, sum); | 57 | if (access_ok(VERIFY_WRITE, dst, len)) |
| 50 | 58 | return __csum_partial_copy_user(src, (__force void *)dst, | |
| 51 | if (copy_to_user(dst, src, len)) { | 59 | len, sum, err_ptr); |
| 60 | if (len) | ||
| 52 | *err_ptr = -EFAULT; | 61 | *err_ptr = -EFAULT; |
| 53 | return (__force __wsum)-1; | ||
| 54 | } | ||
| 55 | 62 | ||
| 56 | return sum; | 63 | return (__force __wsum)-1; /* invalid checksum */ |
| 57 | } | 64 | } |
| 58 | 65 | ||
| 59 | /* | 66 | /* |
diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h index 67657089efa7..386da82e5774 100644 --- a/include/asm-mips/irq.h +++ b/include/asm-mips/irq.h | |||
| @@ -31,14 +31,14 @@ static inline int irq_canonicalize(int irq) | |||
| 31 | * functions will take over re-enabling the low-level mask. | 31 | * functions will take over re-enabling the low-level mask. |
| 32 | * Otherwise it will be done on return from exception. | 32 | * Otherwise it will be done on return from exception. |
| 33 | */ | 33 | */ |
| 34 | #define __DO_IRQ_SMTC_HOOK() \ | 34 | #define __DO_IRQ_SMTC_HOOK(irq) \ |
| 35 | do { \ | 35 | do { \ |
| 36 | if (irq_hwmask[irq] & 0x0000ff00) \ | 36 | if (irq_hwmask[irq] & 0x0000ff00) \ |
| 37 | write_c0_tccontext(read_c0_tccontext() & \ | 37 | write_c0_tccontext(read_c0_tccontext() & \ |
| 38 | ~(irq_hwmask[irq] & 0x0000ff00)); \ | 38 | ~(irq_hwmask[irq] & 0x0000ff00)); \ |
| 39 | } while (0) | 39 | } while (0) |
| 40 | #else | 40 | #else |
| 41 | #define __DO_IRQ_SMTC_HOOK() do { } while (0) | 41 | #define __DO_IRQ_SMTC_HOOK(irq) do { } while (0) |
| 42 | #endif | 42 | #endif |
| 43 | 43 | ||
| 44 | /* | 44 | /* |
| @@ -52,7 +52,7 @@ do { \ | |||
| 52 | #define do_IRQ(irq) \ | 52 | #define do_IRQ(irq) \ |
| 53 | do { \ | 53 | do { \ |
| 54 | irq_enter(); \ | 54 | irq_enter(); \ |
| 55 | __DO_IRQ_SMTC_HOOK(); \ | 55 | __DO_IRQ_SMTC_HOOK(irq); \ |
| 56 | generic_handle_irq(irq); \ | 56 | generic_handle_irq(irq); \ |
| 57 | irq_exit(); \ | 57 | irq_exit(); \ |
| 58 | } while (0) | 58 | } while (0) |
