Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
4e75852f
Commit
4e75852f
authored
Sep 16, 2002
by
Hirokazu Takahashi
Committed by
David S. Miller
Sep 16, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arch/i386/lib/checksum.S:csum_partial Handle oddly addressed buffers correctly.
parent
1ae26f93
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
3 deletions
+37
-3
arch/i386/lib/checksum.S
arch/i386/lib/checksum.S
+37
-3
No files found.
arch/i386/lib/checksum.S
View file @
4e75852f
...
@@ -55,8 +55,21 @@ csum_partial:
...
@@ -55,8 +55,21 @@ csum_partial:
movl
20
(%
esp
),%
eax
#
Function
arg
:
unsigned
int
sum
movl
20
(%
esp
),%
eax
#
Function
arg
:
unsigned
int
sum
movl
16
(%
esp
),%
ecx
#
Function
arg
:
int
len
movl
16
(%
esp
),%
ecx
#
Function
arg
:
int
len
movl
12
(%
esp
),%
esi
#
Function
arg
:
unsigned
char
*
buff
movl
12
(%
esp
),%
esi
#
Function
arg
:
unsigned
char
*
buff
testl
$
2
,
%
esi
#
Check
alignment
.
testl
$
3
,
%
esi
#
Check
alignment
.
jz
2
f
#
Jump
if
alignment
is
ok
.
jz
2
f
#
Jump
if
alignment
is
ok
.
testl
$
1
,
%
esi
#
Check
alignment
.
jz
10
f
#
Jump
if
alignment
is
boundary
of
2
bytes
.
#
buf
is
odd
dec
%
ecx
jl
8
f
movzbl
(%
esi
),
%
ebx
adcl
%
ebx
,
%
eax
roll
$
8
,
%
eax
inc
%
esi
testl
$
2
,
%
esi
jz
2
f
10
:
subl
$
2
,
%
ecx
#
Alignment
uses
up
two
bytes
.
subl
$
2
,
%
ecx
#
Alignment
uses
up
two
bytes
.
jae
1
f
#
Jump
if
we
had
at
least
two
bytes
.
jae
1
f
#
Jump
if
we
had
at
least
two
bytes
.
addl
$
2
,
%
ecx
#
ecx
was
<
2
.
Deal
with
it
.
addl
$
2
,
%
ecx
#
ecx
was
<
2
.
Deal
with
it
.
...
@@ -111,6 +124,10 @@ csum_partial:
...
@@ -111,6 +124,10 @@ csum_partial:
6
:
addl
%
ecx
,%
eax
6
:
addl
%
ecx
,%
eax
adcl
$
0
,
%
eax
adcl
$
0
,
%
eax
7
:
7
:
testl
$
1
,
12
(%
esp
)
jz
8
f
roll
$
8
,
%
eax
8
:
popl
%
ebx
popl
%
ebx
popl
%
esi
popl
%
esi
ret
ret
...
@@ -126,8 +143,8 @@ csum_partial:
...
@@ -126,8 +143,8 @@ csum_partial:
movl
16
(%
esp
),%
ecx
#
Function
arg
:
int
len
movl
16
(%
esp
),%
ecx
#
Function
arg
:
int
len
movl
12
(%
esp
),%
esi
#
Function
arg
:
const
unsigned
char
*
buf
movl
12
(%
esp
),%
esi
#
Function
arg
:
const
unsigned
char
*
buf
testl
$
2
,
%
esi
testl
$
3
,
%
esi
jnz
30
f
jnz
25
f
10
:
10
:
movl
%
ecx
,
%
edx
movl
%
ecx
,
%
edx
movl
%
ecx
,
%
ebx
movl
%
ecx
,
%
ebx
...
@@ -145,6 +162,19 @@ csum_partial:
...
@@ -145,6 +162,19 @@ csum_partial:
lea
2
(%
esi
),
%
esi
lea
2
(%
esi
),
%
esi
adcl
$
0
,
%
eax
adcl
$
0
,
%
eax
jmp
10
b
jmp
10
b
25
:
testl
$
1
,
%
esi
jz
30
f
#
buf
is
odd
dec
%
ecx
jl
90
f
movzbl
(%
esi
),
%
ebx
addl
%
ebx
,
%
eax
adcl
$
0
,
%
eax
roll
$
8
,
%
eax
inc
%
esi
testl
$
2
,
%
esi
jz
10
b
30
:
subl
$
2
,
%
ecx
30
:
subl
$
2
,
%
ecx
ja
20
b
ja
20
b
...
@@ -211,6 +241,10 @@ csum_partial:
...
@@ -211,6 +241,10 @@ csum_partial:
addl
%
ebx
,%
eax
addl
%
ebx
,%
eax
adcl
$
0
,%
eax
adcl
$
0
,%
eax
80
:
80
:
testl
$
1
,
12
(%
esp
)
jz
90
f
roll
$
8
,
%
eax
90
:
popl
%
ebx
popl
%
ebx
popl
%
esi
popl
%
esi
ret
ret
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment