Linux-kernel mailing list archive 2000-01,: Problems compilling Kernel 2.2.13

# Problems compilling Kernel 2.2.13

julio moreno (juloym@usa.net)
3 Jan 00 22:48:21 ARST

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: julio moreno: "Problems compilling Kernel 2.2.13"
- Previous message: Jean-Miel Lee: "Re: How to mount ISO image file as a filesystem?"

[1.] Problem compilling the 2.2.13 kernel.
[2.] I has download the 2.2.13 kernel and pach but when I tried to compile it
(make zImage) I caught a error message of duplicated identifier
'csum_partial_copy' in
/usr/src/linux/arch/i386/lib/checksum.c lines 105 & 202 wich contains
104: unsigned int csum_partial_copy_fromuser (const char *src, char *dst,
int len, int sum) {
205: unsigned int csum_partial_copy (const char *src, char *dst, int len,
int sum) {
The declaration is right, but the compiller don't think the same.
[3.] Compilling kernel.
[4.] Linux version 2.0.36 (root@Julio) (gcc driver version egcs-2.91.60
19981201
egcs-1.1.1 release) executing gcc version 2.7.2.3) #8 Sat Dec 11 20:21:15
ART 1999
[6.] The error point to this file (checksum.c) in the lines starting with
'>>>>>>>>>>>'

/*
* INET An implementation of the TCP/IP protocol suite for the LINUX
* operating system. INET is implemented using the BSD Socket
* interface as the means of communication with the user level.
*
* IP/TCP/UDP checksumming routines
*
* Authors: Jorge Cwik, <jorge@laser.satlink.net>
* Arnt Gulbrandsen, <agulbra@nvg.unit.no>
* Tom May, <ftom@netcom.com>
* Lots of code moved from tcp.c and ip.c; see those files
* for more names.
*
* 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 <net/checksum.h>

/*
* computes a partial checksum, e.g. for TCP/UDP fragments
*/

unsigned int csum_partial (const unsigned char * buff, int len, unsigned int
sum) {
/*
* Experiments with ethernet and slip connections show that buff
* is aligned on either a 2-byte or 4-byte boundary. We get at
* least a 2x speedup on 486 and Pentium if it is 4-byte aligned.
* Fortunately, it is easy to convert 2-byte alignment to 4-byte
* alignment for the unrolled loop.
*/
__asm__("
testl $2, %%esi # Check alignment.
jz 2f # Jump if alignment is ok.
subl $2, %%ecx # Alignment uses up two bytes.
jae 1f # Jump if we had at least two bytes.
addl $2, %%ecx # ecx was < 2. Deal with it.
jmp 4f
1: movw (%%esi), %%bx
addl $2, %%esi
addw %%bx, %%ax
adcl $0, %%eax
2:
movl %%ecx, %%edx
shrl $5, %%ecx
jz 2f
testl %%esi, %%esi
1: movl (%%esi), %%ebx
adcl %%ebx, %%eax
movl 4(%%esi), %%ebx
adcl %%ebx, %%eax
movl 8(%%esi), %%ebx
adcl %%ebx, %%eax
movl 12(%%esi), %%ebx
adcl %%ebx, %%eax
movl 16(%%esi), %%ebx
adcl %%ebx, %%eax
movl 20(%%esi), %%ebx
adcl %%ebx, %%eax
movl 24(%%esi), %%ebx
adcl %%ebx, %%eax
movl 28(%%esi), %%ebx
adcl %%ebx, %%eax
lea 32(%%esi), %%esi
dec %%ecx
jne 1b
adcl $0, %%eax
2: movl %%edx, %%ecx
andl $0x1c, %%edx
je 4f
shrl $2, %%edx
testl %%esi, %%esi
3: adcl (%%esi), %%eax
lea 4(%%esi), %%esi
dec %%edx
jne 3b
adcl $0, %%eax
4: andl $3, %%ecx
jz 7f
cmpl $2, %%ecx
jb 5f
movw (%%esi),%%cx
leal 2(%%esi),%%esi
je 6f
shll $16,%%ecx
5: movb (%%esi),%%cl
6: addl %%ecx,%%eax
adcl $0, %%eax
7: "
: "=a"(sum)
: "0"(sum), "c"(len), "S"(buff)
: "bx", "cx", "dx", "si");
return(sum);
}

/*
* copy from fs while checksumming, otherwise like csum_partial
*/
>>>>>>>>>>>-------------------------------------------------------------
unsigned int csum_partial_copy_fromuser (const char *src, char *dst, int len,
int sum) {
__asm__("
testl $2, %%edi # Check alignment.
jz 2f # Jump if alignment is ok.
subl $2, %%ecx # Alignment uses up two bytes.
jae 1f # Jump if we had at least two bytes.
addl $2, %%ecx # ecx was < 2. Deal with it.
jmp 4f
1: movw %%fs:(%%esi), %%bx
addl $2, %%esi
movw %%bx, (%%edi)
addl $2, %%edi
addw %%bx, %%ax
adcl $0, %%eax
2:
movl %%ecx, %%edx
shrl $5, %%ecx
jz 2f
testl %%esi, %%esi
1: movl %%fs:(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, (%%edi)

movl %%fs:4(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 4(%%edi)

movl %%fs:8(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 8(%%edi)

movl %%fs:12(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 12(%%edi)

movl %%fs:16(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 16(%%edi)

movl %%fs:20(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 20(%%edi)

movl %%fs:24(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 24(%%edi)

movl %%fs:28(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 28(%%edi)

lea 32(%%esi), %%esi
lea 32(%%edi), %%edi
dec %%ecx
jne 1b
adcl $0, %%eax
2: movl %%edx, %%ecx
andl $28, %%edx
je 4f
shrl $2, %%edx
testl %%esi, %%esi
3: movl %%fs:(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, (%%edi)
lea 4(%%esi), %%esi
lea 4(%%edi), %%edi
dec %%edx
jne 3b
adcl $0, %%eax
4: andl $3, %%ecx
jz 7f
cmpl $2, %%ecx
jb 5f
movw %%fs:(%%esi), %%cx
leal 2(%%esi), %%esi
movw %%cx, (%%edi)
leal 2(%%edi), %%edi
je 6f
shll $16,%%ecx
5: movb %%fs:(%%esi), %%cl
movb %%cl, (%%edi)
6: addl %%ecx, %%eax
adcl $0, %%eax
7:
"
: "=a" (sum)
: "0"(sum), "c"(len), "S"(src), "D" (dst)
: "bx", "cx", "dx", "si", "di" );
return(sum);
}

/*
* copy from ds while checksumming, otherwise like csum_partial
*/
>>>>>>>>>>> ------------------------------------------------------------
unsigned int csum_partial_copy (const char *src, char *dst, int len, int sum)
{
__asm__("
testl $2, %%edi # Check alignment.
jz 2f # Jump if alignment is ok.
subl $2, %%ecx # Alignment uses up two bytes.
jae 1f # Jump if we had at least two bytes.
addl $2, %%ecx # ecx was < 2. Deal with it.
jmp 4f
1: movw (%%esi), %%bx
addl $2, %%esi
movw %%bx, (%%edi)
addl $2, %%edi
addw %%bx, %%ax
adcl $0, %%eax
2:
movl %%ecx, %%edx
shrl $5, %%ecx
jz 2f
testl %%esi, %%esi
1: movl (%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, (%%edi)

movl 4(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 4(%%edi)

movl 8(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 8(%%edi)

movl 12(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 12(%%edi)

movl 16(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 16(%%edi)

movl 20(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 20(%%edi)

movl 24(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 24(%%edi)

movl 28(%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, 28(%%edi)

lea 32(%%esi), %%esi
lea 32(%%edi), %%edi
dec %%ecx
jne 1b
adcl $0, %%eax
2: movl %%edx, %%ecx
andl $28, %%edx
je 4f
shrl $2, %%edx
testl %%esi, %%esi
3: movl (%%esi), %%ebx
adcl %%ebx, %%eax
movl %%ebx, (%%edi)
lea 4(%%esi), %%esi
lea 4(%%edi), %%edi
dec %%edx
jne 3b
adcl $0, %%eax
4: andl $3, %%ecx
jz 7f
cmpl $2, %%ecx
jb 5f
movw (%%esi), %%cx
leal 2(%%esi), %%esi
movw %%cx, (%%edi)
leal 2(%%edi), %%edi
je 6f
shll $16,%%ecx
5: movb (%%esi), %%cl
movb %%cl, (%%edi)
6: addl %%ecx, %%eax
adcl $0, %%eax
7:
"
: "=a" (sum)
: "0"(sum), "c"(len), "S"(src), "D" (dst)
: "bx", "cx", "dx", "si", "di" );
return(sum);
}

[7.] Processor: Pentium 200-MMX
Ra

____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

- Next message: julio moreno: "Problems compilling Kernel 2.2.13"
- Previous message: Jean-Miel Lee: "Re: How to mount ISO image file as a filesystem?"