arch/i386/kernel/cpu/cpufreq/powernow-k8.c: In function `powernow_k8_cpu_init_acpi':
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / m68k / lib / memset.c
blobd55fdb2ee9d3f0ad9b67e699b17f10e856982dde
1 #include <linux/types.h>
3 void * memset(void * s, int c, size_t count)
5 void *xs = s;
6 size_t temp, temp1;
8 if (!count)
9 return xs;
10 c &= 0xff;
11 c |= c << 8;
12 c |= c << 16;
13 if ((long) s & 1)
15 char *cs = s;
16 *cs++ = c;
17 s = cs;
18 count--;
20 if (count > 2 && (long) s & 2)
22 short *ss = s;
23 *ss++ = c;
24 s = ss;
25 count -= 2;
27 temp = count >> 2;
28 if (temp)
30 long *ls = s;
32 __asm__ __volatile__("movel %1,%2\n\t"
33 "andw #7,%2\n\t"
34 "lsrl #3,%1\n\t"
35 "negw %2\n\t"
36 "jmp %%pc@(2f,%2:w:2)\n\t"
37 "1:\t"
38 "movel %3,%0@+\n\t"
39 "movel %3,%0@+\n\t"
40 "movel %3,%0@+\n\t"
41 "movel %3,%0@+\n\t"
42 "movel %3,%0@+\n\t"
43 "movel %3,%0@+\n\t"
44 "movel %3,%0@+\n\t"
45 "movel %3,%0@+\n\t"
46 "2:\t"
47 "dbra %1,1b\n\t"
48 "clrw %1\n\t"
49 "subql #1,%1\n\t"
50 "jpl 1b\n\t"
51 : "=a" (ls), "=d" (temp), "=&d" (temp1)
52 : "d" (c), "0" (ls), "1" (temp)
54 s = ls;
56 if (count & 2)
58 short *ss = s;
59 *ss++ = c;
60 s = ss;
62 if (count & 1)
64 char *cs = s;
65 *cs = c;
67 return xs;