File: wrapped-string.c

package info (click to toggle)
indent 2.2.12-4%2Bdeb12u3
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 5,980 kB
  • sloc: ansic: 37,897; sh: 5,187; makefile: 708; yacc: 291; sed: 16; cpp: 5
file content (55 lines) | stat: -rw-r--r-- 911 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <stdio.h>
int main()
{
char *format = "\
%c %c %c
%c %c %c
%c %c %c\n";

printf(format, '1', '2', '3', '4', '5', '6', '7', '8', '9');
}

static inline void __generic_memcpy_fromfs(
        void * to, 
        const void * from, 
        unsigned long n)
{
    __asm__ volatile
	("	cld
		cmpl $3,%0
		jbe 1f
		movl %%edi,%%ecx
		negl %%ecx
		andl $3,%%ecx
		subl %%ecx,%0
		fs; rep; movsb
		movl %0,%%ecx
		shrl $2,%%ecx
		fs; rep; movsl
		andl $3,%0
	1:	movl %0,%%ecx
		fs; rep; movsb");
}
static inline void __generic_memcpy_fromfs(void * to, const void * from, unsigned long n)
{
    __asm__ volatile
	("	cld
		cmpl $3,%0
		jbe 1f
		movl %%edi,%%ecx
		negl %%ecx
		andl $3,%%ecx
		subl %%ecx,%0
		fs; rep; movsb
		movl %0,%%ecx
		shrl $2,%%ecx
		fs; rep; movsl
		andl $3,%0
	1:	movl %0,%%ecx
		fs; rep; movsb"
	:"=abd" (n)
	:"0" (n),"D" ((long) to),"S" ((long) from)
	:"cx","di","si", "memory");
}