Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136970167
D17549.id49107.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D17549.id49107.diff
View Options
Index: lib/libc/amd64/string/bzero.S
===================================================================
--- lib/libc/amd64/string/bzero.S
+++ /dev/null
@@ -1,7 +0,0 @@
-/* $FreeBSD */
-
-#include <machine/asm.h>
-__FBSDID("$FreeBSD$");
-
-#define BZERO
-#include "memset.S"
Index: lib/libc/amd64/string/bzero.c
===================================================================
--- /dev/null
+++ lib/libc/amd64/string/bzero.c
@@ -0,0 +1,15 @@
+/*-
+ * Public domain.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <string.h>
+
+void
+bzero(void *b, size_t len)
+{
+
+ memset(b, 0, len);
+}
Index: lib/libc/amd64/string/memset.S
===================================================================
--- lib/libc/amd64/string/memset.S
+++ lib/libc/amd64/string/memset.S
@@ -31,18 +31,12 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");
-.macro MEMSET bzero erms
-.if \bzero == 1
- movq %rsi,%rcx
- movq %rsi,%rdx
- xorl %eax,%eax
-.else
+.macro MEMSET erms
movq %rdi,%r9
movq %rdx,%rcx
movzbq %sil,%r8
movabs $0x0101010101010101,%rax
imulq %r8,%rax
-.endif
cmpq $32,%rcx
jb 1016f
@@ -95,9 +89,7 @@
jl 1000f
movb %al,(%rdi)
1000:
-.if \bzero == 0
movq %r9,%rax
-.endif
ret
1256:
@@ -112,20 +104,12 @@
andb $7,%cl
jne 1004b
.endif
-.if \bzero == 0
movq %r9,%rax
-.endif
ret
.endm
-#ifndef BZERO
ENTRY(memset)
- MEMSET bzero=0 erms=0
+ MEMSET erms=0
END(memset)
-#else
-ENTRY(bzero)
- MEMSET bzero=1 erms=0
-END(bzero)
-#endif
.section .note.GNU-stack,"",%progbits
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 21, 9:10 PM (2 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25805331
Default Alt Text
D17549.id49107.diff (1 KB)
Attached To
Mode
D17549: amd64: convert libc bzero to a C func to avoid future bloat
Attached
Detach File
Event Timeline
Log In to Comment