Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(804)

Side by Side Diff: fusl/arch/x86_64/bits/io.h

Issue 1714623002: [fusl] clang-format fusl (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: headers too Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 static __inline void outb(unsigned char __val, unsigned short __port) 1 static __inline void outb(unsigned char __val, unsigned short __port) {
2 { 2 __asm__ volatile("outb %0,%1" : : "a"(__val), "dN"(__port));
3 » __asm__ volatile ("outb %0,%1" : : "a" (__val), "dN" (__port));
4 } 3 }
5 4
6 static __inline void outw(unsigned short __val, unsigned short __port) 5 static __inline void outw(unsigned short __val, unsigned short __port) {
7 { 6 __asm__ volatile("outw %0,%1" : : "a"(__val), "dN"(__port));
8 » __asm__ volatile ("outw %0,%1" : : "a" (__val), "dN" (__port));
9 } 7 }
10 8
11 static __inline void outl(unsigned int __val, unsigned short __port) 9 static __inline void outl(unsigned int __val, unsigned short __port) {
12 { 10 __asm__ volatile("outl %0,%1" : : "a"(__val), "dN"(__port));
13 » __asm__ volatile ("outl %0,%1" : : "a" (__val), "dN" (__port));
14 } 11 }
15 12
16 static __inline unsigned char inb(unsigned short __port) 13 static __inline unsigned char inb(unsigned short __port) {
17 { 14 unsigned char __val;
18 » unsigned char __val; 15 __asm__ volatile("inb %1,%0" : "=a"(__val) : "dN"(__port));
19 » __asm__ volatile ("inb %1,%0" : "=a" (__val) : "dN" (__port)); 16 return __val;
20 » return __val;
21 } 17 }
22 18
23 static __inline unsigned short inw(unsigned short __port) 19 static __inline unsigned short inw(unsigned short __port) {
24 { 20 unsigned short __val;
25 » unsigned short __val; 21 __asm__ volatile("inw %1,%0" : "=a"(__val) : "dN"(__port));
26 » __asm__ volatile ("inw %1,%0" : "=a" (__val) : "dN" (__port)); 22 return __val;
27 » return __val;
28 } 23 }
29 24
30 static __inline unsigned int inl(unsigned short __port) 25 static __inline unsigned int inl(unsigned short __port) {
31 { 26 unsigned int __val;
32 » unsigned int __val; 27 __asm__ volatile("inl %1,%0" : "=a"(__val) : "dN"(__port));
33 » __asm__ volatile ("inl %1,%0" : "=a" (__val) : "dN" (__port)); 28 return __val;
34 » return __val;
35 } 29 }
36 30
37 static __inline void outsb(unsigned short __port, const void *__buf, unsigned lo ng __n) 31 static __inline void outsb(unsigned short __port,
38 { 32 const void* __buf,
39 » __asm__ volatile ("cld; rep; outsb" 33 unsigned long __n) {
40 » » : "+S" (__buf), "+c" (__n) 34 __asm__ volatile("cld; rep; outsb" : "+S"(__buf), "+c"(__n) : "d"(__port));
41 » » : "d" (__port));
42 } 35 }
43 36
44 static __inline void outsw(unsigned short __port, const void *__buf, unsigned lo ng __n) 37 static __inline void outsw(unsigned short __port,
45 { 38 const void* __buf,
46 » __asm__ volatile ("cld; rep; outsw" 39 unsigned long __n) {
47 » » : "+S" (__buf), "+c" (__n) 40 __asm__ volatile("cld; rep; outsw" : "+S"(__buf), "+c"(__n) : "d"(__port));
48 » » : "d" (__port));
49 } 41 }
50 42
51 static __inline void outsl(unsigned short __port, const void *__buf, unsigned lo ng __n) 43 static __inline void outsl(unsigned short __port,
52 { 44 const void* __buf,
53 » __asm__ volatile ("cld; rep; outsl" 45 unsigned long __n) {
54 » » : "+S" (__buf), "+c"(__n) 46 __asm__ volatile("cld; rep; outsl" : "+S"(__buf), "+c"(__n) : "d"(__port));
55 » » : "d" (__port));
56 } 47 }
57 48
58 static __inline void insb(unsigned short __port, void *__buf, unsigned long __n) 49 static __inline void insb(unsigned short __port,
59 { 50 void* __buf,
60 » __asm__ volatile ("cld; rep; insb" 51 unsigned long __n) {
61 » » : "+D" (__buf), "+c" (__n) 52 __asm__ volatile("cld; rep; insb" : "+D"(__buf), "+c"(__n) : "d"(__port));
62 » » : "d" (__port));
63 } 53 }
64 54
65 static __inline void insw(unsigned short __port, void *__buf, unsigned long __n) 55 static __inline void insw(unsigned short __port,
66 { 56 void* __buf,
67 » __asm__ volatile ("cld; rep; insw" 57 unsigned long __n) {
68 » » : "+D" (__buf), "+c" (__n) 58 __asm__ volatile("cld; rep; insw" : "+D"(__buf), "+c"(__n) : "d"(__port));
69 » » : "d" (__port));
70 } 59 }
71 60
72 static __inline void insl(unsigned short __port, void *__buf, unsigned long __n) 61 static __inline void insl(unsigned short __port,
73 { 62 void* __buf,
74 » __asm__ volatile ("cld; rep; insl" 63 unsigned long __n) {
75 » » : "+D" (__buf), "+c" (__n) 64 __asm__ volatile("cld; rep; insl" : "+D"(__buf), "+c"(__n) : "d"(__port));
76 » » : "d" (__port));
77 } 65 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698