diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2007-10-11 05:13:21 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2007-10-11 05:13:21 -0400 |
commit | 2be2056cee405f3e3ca07e197ecd803e81cf5cb6 (patch) | |
tree | a80bd57af934d6293a8f5cf776e2cd7e0867f0f6 /arch/i386/lib/strstr.c | |
parent | 31834147ef934140c9d41afe130ac8606c2d7a81 (diff) |
i386: prepare shared lib/strstr.c
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/i386/lib/strstr.c')
-rw-r--r-- | arch/i386/lib/strstr.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/arch/i386/lib/strstr.c b/arch/i386/lib/strstr.c deleted file mode 100644 index a3dafbf59dae..000000000000 --- a/arch/i386/lib/strstr.c +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | #include <linux/string.h> | ||
2 | |||
3 | char * strstr(const char * cs,const char * ct) | ||
4 | { | ||
5 | int d0, d1; | ||
6 | register char * __res; | ||
7 | __asm__ __volatile__( | ||
8 | "movl %6,%%edi\n\t" | ||
9 | "repne\n\t" | ||
10 | "scasb\n\t" | ||
11 | "notl %%ecx\n\t" | ||
12 | "decl %%ecx\n\t" /* NOTE! This also sets Z if searchstring='' */ | ||
13 | "movl %%ecx,%%edx\n" | ||
14 | "1:\tmovl %6,%%edi\n\t" | ||
15 | "movl %%esi,%%eax\n\t" | ||
16 | "movl %%edx,%%ecx\n\t" | ||
17 | "repe\n\t" | ||
18 | "cmpsb\n\t" | ||
19 | "je 2f\n\t" /* also works for empty string, see above */ | ||
20 | "xchgl %%eax,%%esi\n\t" | ||
21 | "incl %%esi\n\t" | ||
22 | "cmpb $0,-1(%%eax)\n\t" | ||
23 | "jne 1b\n\t" | ||
24 | "xorl %%eax,%%eax\n\t" | ||
25 | "2:" | ||
26 | :"=a" (__res), "=&c" (d0), "=&S" (d1) | ||
27 | :"0" (0), "1" (0xffffffff), "2" (cs), "g" (ct) | ||
28 | :"dx", "di"); | ||
29 | return __res; | ||
30 | } | ||
31 | |||