-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Original port to early 2.6 kernel using TI COFF toolchain. Brought up to date by Mark Salter <msalter@redhat.com> Signed-off-by: Aurelien Jacquiot <a-jacquiot@ti.com> Signed-off-by: Mark Salter <msalter@redhat.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
- Loading branch information
Showing
19 changed files
with
1,349 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (C) 2011 Texas Instruments Incorporated | ||
* Author: Mark Salter <msalter@redhat.com> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#ifndef _ASM_C6X_CHECKSUM_H | ||
#define _ASM_C6X_CHECKSUM_H | ||
|
||
static inline __wsum | ||
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len, | ||
unsigned short proto, __wsum sum) | ||
{ | ||
unsigned long long tmp; | ||
|
||
asm ("add .d1 %1,%5,%1\n" | ||
"|| addu .l1 %3,%4,%0\n" | ||
"addu .l1 %2,%0,%0\n" | ||
#ifndef CONFIG_CPU_BIG_ENDIAN | ||
"|| shl .s1 %1,8,%1\n" | ||
#endif | ||
"addu .l1 %1,%0,%0\n" | ||
"add .l1 %P0,%p0,%2\n" | ||
: "=&a"(tmp), "+a"(len), "+a"(sum) | ||
: "a" (saddr), "a" (daddr), "a" (proto)); | ||
return sum; | ||
} | ||
#define csum_tcpudp_nofold csum_tcpudp_nofold | ||
|
||
#include <asm-generic/checksum.h> | ||
|
||
#endif /* _ASM_C6X_CHECKSUM_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* as published by the Free Software Foundation; either version | ||
* 2 of the License, or (at your option) any later version. | ||
*/ | ||
#include <linux/module.h> | ||
#include <net/checksum.h> | ||
|
||
#include <asm/byteorder.h> | ||
|
||
/* | ||
* copy from fs while checksumming, otherwise like csum_partial | ||
*/ | ||
__wsum | ||
csum_partial_copy_from_user(const void __user *src, void *dst, int len, | ||
__wsum sum, int *csum_err) | ||
{ | ||
int missing; | ||
|
||
missing = __copy_from_user(dst, src, len); | ||
if (missing) { | ||
memset(dst + len - missing, 0, missing); | ||
*csum_err = -EFAULT; | ||
} else | ||
*csum_err = 0; | ||
|
||
return csum_partial(dst, len, sum); | ||
} | ||
EXPORT_SYMBOL(csum_partial_copy_from_user); | ||
|
||
/* These are from csum_64plus.S */ | ||
EXPORT_SYMBOL(csum_partial); | ||
EXPORT_SYMBOL(csum_partial_copy); | ||
EXPORT_SYMBOL(ip_compute_csum); | ||
EXPORT_SYMBOL(ip_fast_csum); |
Oops, something went wrong.