]> Joshua Wise's Git repositories - netwatch.git/blame_incremental - include/raw/io.h
add a lot of copyright headers
[netwatch.git] / include / raw / io.h
... / ...
CommitLineData
1/* io.h
2 * I/O port access macros
3 * NetWatch system management mode administration console
4 *
5 * Copyright (c) 2008 Jacob Potter and Joshua Wise. All rights reserved.
6 * This program is free software; you can redistribute and/or modify it under
7 * the terms found in the file LICENSE in the root of this source tree.
8 *
9 */
10
11
12#ifndef __IO_H
13#define __IO_H
14
15#define inb(port) __extension__ ({ unsigned char val; asm volatile("inb %%dx, %0" : "=a" ((unsigned char)(val)) : "d" ((unsigned short)(port))); val; })
16#define inw(port) __extension__ ({ unsigned short val; asm volatile("inw %%dx, %0" : "=a" ((unsigned short)(val)) : "d" ((unsigned short)(port))); val; })
17#define inl(port) __extension__ ({ unsigned long val; asm volatile("inl %%dx, %0" : "=a" ((unsigned long)(val)) : "d" ((unsigned short)(port))); val; })
18#define outb(port, val) __extension__ ({ asm volatile("outb %0, %%dx" : : "a" ((unsigned char)(val)) , "d" ((unsigned short)(port))); })
19#define outw(port, val) __extension__ ({ asm volatile("outw %0, %%dx" : : "a" ((unsigned short)(val)) , "d" ((unsigned short)(port))); })
20#define outl(port, val) __extension__ ({ asm volatile("outl %0, %%dx" : : "a" ((unsigned long)(val)) , "d" ((unsigned short)(port))); })
21
22#endif
This page took 0.018355 seconds and 4 git commands to generate.