source: bootcd/isolinux/syslinux-6.03/com32/include/sys/io.h @ 26ffad7

Last change on this file since 26ffad7 was e16e8f2, checked in by Edwin Eefting <edwin@datux.nl>, 3 years ago

bootstuff

  • Property mode set to 100644
File size: 761 bytes
Line 
1#ifndef _SYS_IO_H
2#define _SYS_IO_H
3
4#include <inttypes.h>
5
6static inline uint8_t inb(uint16_t p)
7{
8    uint8_t v;
9    asm volatile ("inb %1,%0":"=a" (v):"Nd"(p));
10    return v;
11}
12
13static inline uint16_t inw(uint16_t p)
14{
15    uint16_t v;
16    asm volatile ("inw %1,%0":"=a" (v):"Nd"(p));
17    return v;
18}
19
20static inline uint32_t inl(uint16_t p)
21{
22    uint32_t v;
23    asm volatile ("inl %1,%0":"=a" (v):"Nd"(p));
24    return v;
25}
26
27static inline void outb(uint8_t v, uint16_t p)
28{
29    asm volatile ("outb %0,%1"::"a" (v), "Nd"(p));
30}
31
32static inline void outw(uint16_t v, uint16_t p)
33{
34    asm volatile ("outw %0,%1"::"a" (v), "Nd"(p));
35}
36
37static inline void outl(uint32_t v, uint16_t p)
38{
39    asm volatile ("outl %0,%1"::"a" (v), "Nd"(p));
40}
41
42#endif /* _SYS_IO_H */
Note: See TracBrowser for help on using the repository browser.