root/memdump/io.h

Revision 93d2d1f5e8454645be7977656fce4f07513cde38, 0.8 KB (checked in by H. Peter Anvin <hpa@…>, 3 years ago)

Run Nindent on memdump/io.h

Automatically reformat memdump/io.h using Nindent.

Do this for all files except HDT, gPXE and externally maintained
libraries (zlib, tinyjpeg, libpng).

Signed-off-by: H. Peter Anvin <hpa@…>

  • Property mode set to 100644
Line 
1#ifndef IO_H
2#define IO_H
3
4static inline void outb(unsigned char v, unsigned short p)
5{
6    asm volatile ("outb %1,%0"::"d" (p), "a"(v));
7}
8
9static inline unsigned char inb(unsigned short p)
10{
11    unsigned char v;
12    asm volatile ("inb %1,%0":"=a" (v):"d"(p));
13    return v;
14}
15
16static inline void outw(unsigned short v, unsigned short p)
17{
18    asm volatile ("outw %1,%0"::"d" (p), "a"(v));
19}
20
21static inline unsigned short inw(unsigned short p)
22{
23    unsigned short v;
24    asm volatile ("inw %1,%0":"=a" (v):"d"(p));
25    return v;
26}
27
28static inline void outl(unsigned int v, unsigned short p)
29{
30    asm volatile ("outl %1,%0"::"d" (p), "a"(v));
31}
32
33static inline unsigned int inl(unsigned short p)
34{
35    unsigned int v;
36    asm volatile ("inl %1,%0":"=a" (v):"d"(p));
37    return v;
38}
39
40#endif
Note: See TracBrowser for help on using the browser.