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.
This commit is contained in:
+19
-12
@@ -29,31 +29,38 @@
|
||||
*/
|
||||
__wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
__wsum __csum_partial_copy_user(const void *src, void *dst,
|
||||
int len, __wsum sum, int *err_ptr);
|
||||
|
||||
/*
|
||||
* this is a new version of the above that records errors it finds in *errp,
|
||||
* but continues and zeros the rest of the buffer.
|
||||
*/
|
||||
__wsum csum_partial_copy_from_user(const void __user *src,
|
||||
void *dst, int len,
|
||||
__wsum sum, int *errp);
|
||||
static inline
|
||||
__wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len,
|
||||
__wsum sum, int *err_ptr)
|
||||
{
|
||||
might_sleep();
|
||||
return __csum_partial_copy_user((__force void *)src, dst,
|
||||
len, sum, err_ptr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy and checksum to user
|
||||
*/
|
||||
#define HAVE_CSUM_COPY_USER
|
||||
static inline __wsum csum_and_copy_to_user (const void *src, void __user *dst,
|
||||
int len, __wsum sum,
|
||||
int *err_ptr)
|
||||
static inline
|
||||
__wsum csum_and_copy_to_user(const void *src, void __user *dst, int len,
|
||||
__wsum sum, int *err_ptr)
|
||||
{
|
||||
might_sleep();
|
||||
sum = csum_partial(src, len, sum);
|
||||
|
||||
if (copy_to_user(dst, src, len)) {
|
||||
if (access_ok(VERIFY_WRITE, dst, len))
|
||||
return __csum_partial_copy_user(src, (__force void *)dst,
|
||||
len, sum, err_ptr);
|
||||
if (len)
|
||||
*err_ptr = -EFAULT;
|
||||
return (__force __wsum)-1;
|
||||
}
|
||||
|
||||
return sum;
|
||||
return (__force __wsum)-1; /* invalid checksum */
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -31,14 +31,14 @@ static inline int irq_canonicalize(int irq)
|
||||
* functions will take over re-enabling the low-level mask.
|
||||
* Otherwise it will be done on return from exception.
|
||||
*/
|
||||
#define __DO_IRQ_SMTC_HOOK() \
|
||||
#define __DO_IRQ_SMTC_HOOK(irq) \
|
||||
do { \
|
||||
if (irq_hwmask[irq] & 0x0000ff00) \
|
||||
write_c0_tccontext(read_c0_tccontext() & \
|
||||
~(irq_hwmask[irq] & 0x0000ff00)); \
|
||||
} while (0)
|
||||
#else
|
||||
#define __DO_IRQ_SMTC_HOOK() do { } while (0)
|
||||
#define __DO_IRQ_SMTC_HOOK(irq) do { } while (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -52,7 +52,7 @@ do { \
|
||||
#define do_IRQ(irq) \
|
||||
do { \
|
||||
irq_enter(); \
|
||||
__DO_IRQ_SMTC_HOOK(); \
|
||||
__DO_IRQ_SMTC_HOOK(irq); \
|
||||
generic_handle_irq(irq); \
|
||||
irq_exit(); \
|
||||
} while (0)
|
||||
|
||||
Reference in New Issue
Block a user