TacOS  0.2
 Tout Structures de données Fichiers Fonctions Variables Définitions de type Énumérations Macros
ioports.h
Aller à la documentation de ce fichier.
1 
30 #ifndef _IOPORTS_H_
31 #define _IOPORTS_H_
32 
36 #define outb(value, port) \
37  __asm__ volatile ("outb %b0,%w1" \
38  ::"a" (value),"Nd" (port))
39 
43 #define inb(port) \
44 ({ \
45  unsigned char _v; \
46  __asm__ volatile ("inb %w1,%0" \
47  :"=a" (_v) \
48  :"Nd" (port)); \
49  _v; \
50 })
51 
55 #define outw(value, port) \
56  __asm__ volatile ("outw %w0,%w1" \
57  ::"a" (value),"Nd" (port))
58 
62 #define inw(port) \
63 ({ \
64  unsigned int _v; \
65  __asm__ volatile ("inw %w1,%w0" \
66  :"=a" (_v) \
67  :"Nd" (port)); \
68  _v; \
69 })
70 
74 #define outl(value, port) \
75  __asm__ volatile ("outl %0,%w1" \
76  ::"a" (value),"Nd" (port))
77 
81 #define inl(port) \
82 ({ \
83  unsigned int _v; \
84  __asm__ volatile ("inl %w1,%0" \
85  :"=a" (_v) \
86  :"Nd" (port)); \
87  _v; \
88 })
89 
90 #endif /* _IOPORTS_H_ */