1/*
2 * ====================================================
3 * Copyright (C) 1998, 2002 by Red Hat Inc. All rights reserved.
4 *
5 * Permission to use, copy, modify, and distribute this
6 * software is freely granted, provided that this notice
7 * is preserved.
8 * ====================================================
9 */
10
11	#include "i386mach.h"
12
13	.global SYM (strlen)
14       SOTYPE_FUNCTION(strlen)
15
16SYM (strlen):
17
18	pushl ebp
19	movl esp,ebp
20	pushl edi
21	movl 8(ebp),edx
22
23	cld
24	movl edx,edi
25	movl $4294967295,ecx
26	xor eax,eax
27	repnz
28	scasb
29	subl edx,edi
30	leal -1(edi),eax
31
32	leal -4(ebp),esp
33	popl edi
34	leave
35	ret
36