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
be0ff4bd
Commit
be0ff4bd
authored
Apr 12, 2002
by
David Mosberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make memset() detect the special-case of clear-to-zero and call __bzero() in that case.
parent
6b6fc449
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
9 deletions
+43
-9
arch/ia64/kernel/ia64_ksyms.c
arch/ia64/kernel/ia64_ksyms.c
+5
-1
arch/ia64/kernel/traps.c
arch/ia64/kernel/traps.c
+2
-1
arch/ia64/lib/memset.S
arch/ia64/lib/memset.S
+19
-4
include/asm-ia64/string.h
include/asm-ia64/string.h
+17
-3
No files found.
arch/ia64/kernel/ia64_ksyms.c
View file @
be0ff4bd
...
...
@@ -6,7 +6,11 @@
#include <linux/module.h>
#include <linux/string.h>
EXPORT_SYMBOL_NOVERS
(
memset
);
#undef memset
extern
void
*
memset
(
void
*
,
int
,
size_t
);
EXPORT_SYMBOL_NOVERS
(
memset
);
/* gcc generates direct calls to memset()... */
EXPORT_SYMBOL_NOVERS
(
__memset_generic
);
EXPORT_SYMBOL_NOVERS
(
__bzero
);
EXPORT_SYMBOL
(
memchr
);
EXPORT_SYMBOL
(
memcmp
);
EXPORT_SYMBOL_NOVERS
(
memcpy
);
...
...
arch/ia64/kernel/traps.c
View file @
be0ff4bd
...
...
@@ -214,7 +214,8 @@ ia64_ni_syscall (unsigned long arg0, unsigned long arg1, unsigned long arg2, uns
{
struct
pt_regs
*
regs
=
(
struct
pt_regs
*
)
&
stack
;
printk
(
"<sc%ld(%lx,%lx,%lx,%lx)>
\n
"
,
regs
->
r15
,
arg0
,
arg1
,
arg2
,
arg3
);
printk
(
"%s(%d): <sc%ld(%lx,%lx,%lx,%lx)>
\n
"
,
current
->
comm
,
current
->
pid
,
regs
->
r15
,
arg0
,
arg1
,
arg2
,
arg3
);
return
-
ENOSYS
;
}
...
...
arch/ia64/lib/memset.S
View file @
be0ff4bd
...
...
@@ -9,8 +9,8 @@
*
in1
:
byte
value
to
use
for
storing
*
in2
:
length
of
the
buffer
*
*
Copyright
(
C
)
1999
,
2001
Hewlett
-
Packard
Co
*
Copyright
(
C
)
1999
Stephane
Eranian
<
eranian
@
hpl
.
hp
.
com
>
*
Copyright
(
C
)
1999
,
2001
,
2002
Hewlett
-
Packard
Co
*
Stephane
Eranian
<
eranian
@
hpl
.
hp
.
com
>
*/
#include <asm/asmmacro.h>
...
...
@@ -30,7 +30,19 @@
#define saved_lc r20
#define tmp r21
GLOBAL_ENTRY
(
memset
)
GLOBAL_ENTRY
(
__bzero
)
.
prologue
.
save
ar
.
pfs
,
saved_pfs
alloc
saved_pfs
=
ar
.
pfs
,
0
,
0
,
3
,
0
mov
out2
=
out1
mov
out1
=
0
/
*
FALL
THROUGH
(
explicit
NOPs
so
that
next
alloc
is
preceded
by
stop
bit
!)
*/
nop.m
0
nop.f
0
nop.i
0
;;
END
(
__bzero
)
GLOBAL_ENTRY
(
__memset_generic
)
.
prologue
.
save
ar
.
pfs
,
saved_pfs
alloc
saved_pfs
=
ar
.
pfs
,
3
,
0
,
0
,
0
//
cnt
is
sink
here
...
...
@@ -105,4 +117,7 @@ GLOBAL_ENTRY(memset)
;;
(
p6
)
st1
[
buf
]=
val
//
only
1
byte
left
br.ret.sptk.many
rp
END
(
memset
)
END
(
__memset_generic
)
.
global
memset
memset
=
__memset_generic
//
alias
needed
for
gcc
include/asm-ia64/string.h
View file @
be0ff4bd
...
...
@@ -5,8 +5,8 @@
* Here is where we want to put optimized versions of the string
* routines.
*
* Copyright (C) 1998-2000 Hewlett-Packard Co
*
Copyright (C) 1998-2000
David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1998-2000
, 2002
Hewlett-Packard Co
*
David Mosberger-Tang <davidm@hpl.hp.com>
*/
#include <linux/config.h>
/* remove this once we remove the A-step workaround... */
...
...
@@ -17,7 +17,21 @@
#define __HAVE_ARCH_BCOPY 1
/* see arch/ia64/lib/memcpy.S */
extern
__kernel_size_t
strlen
(
const
char
*
);
extern
void
*
memset
(
void
*
,
int
,
__kernel_size_t
);
extern
void
*
memcpy
(
void
*
,
const
void
*
,
__kernel_size_t
);
extern
void
*
__memset_generic
(
void
*
,
int
,
__kernel_size_t
);
extern
void
__bzero
(
void
*
,
__kernel_size_t
);
#define memset(s, c, count) \
({ \
void *_s = (s); \
int _c = (c); \
__kernel_size_t _count = (count); \
\
if (__builtin_constant_p(_c) && _c == 0) \
__bzero(_s, _count); \
else \
__memset_generic(_s, _c, _count); \
})
#endif
/* _ASM_IA64_STRING_H */
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