Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Krishna Vinnakota
CSEP551
Commits
d0f3efca
Commit
d0f3efca
authored
13 years ago
by
Austin Clements
Browse files
Options
Downloads
Patches
Plain Diff
Use stosl in memset; makes boot time bearable
parent
e25b74ca
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
string.c
+5
-1
5 additions, 1 deletion
string.c
x86.h
+9
-0
9 additions, 0 deletions
x86.h
with
14 additions
and
1 deletion
string.c
+
5
−
1
View file @
d0f3efca
...
...
@@ -4,7 +4,11 @@
void
*
memset
(
void
*
dst
,
int
c
,
uint
n
)
{
stosb
(
dst
,
c
,
n
);
if
((
int
)
dst
%
4
==
0
&&
n
%
4
==
0
){
c
&=
0xFF
;
stosl
(
dst
,
(
c
<<
24
)
|
(
c
<<
16
)
|
(
c
<<
8
)
|
c
,
n
/
4
);
}
else
stosb
(
dst
,
c
,
n
);
return
dst
;
}
...
...
This diff is collapsed.
Click to expand it.
x86.h
+
9
−
0
View file @
d0f3efca
...
...
@@ -48,6 +48,15 @@ stosb(void *addr, int data, int cnt)
"memory"
,
"cc"
);
}
static
inline
void
stosl
(
void
*
addr
,
int
data
,
int
cnt
)
{
asm
volatile
(
"cld; rep stosl"
:
"=D"
(
addr
),
"=c"
(
cnt
)
:
"0"
(
addr
),
"1"
(
cnt
),
"a"
(
data
)
:
"memory"
,
"cc"
);
}
struct
segdesc
;
static
inline
void
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment