Rev 348 | Rev 353 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 348 | Rev 352 | ||
---|---|---|---|
Line 40... | Line 40... | ||
40 | 40 | ||
41 | extern __u8 inb(int port); |
41 | extern __u8 inb(int port); |
42 | extern __u16 inw(int port); |
42 | extern __u16 inw(int port); |
43 | extern __u32 inl(int port); |
43 | extern __u32 inl(int port); |
44 | 44 | ||
45 | extern void outb(int port, __u8 b); |
- | |
46 | extern void outw(int port, __u16 w); |
45 | extern void outw(int port, __u16 w); |
47 | extern void outl(int port, __u32 l); |
46 | extern void outl(int port, __u32 l); |
48 | 47 | ||
49 | extern void enable_l_apic_in_msr(void); |
48 | extern void enable_l_apic_in_msr(void); |
50 | 49 | ||
Line 82... | Line 81... | ||
82 | * |
81 | * |
83 | * @return Value read. |
82 | * @return Value read. |
84 | */ |
83 | */ |
85 | static inline __u32 read_cr3(void) { __u32 v; __asm__ volatile ("movl %%cr3,%0\n" : "=r" (v)); return v; } |
84 | static inline __u32 read_cr3(void) { __u32 v; __asm__ volatile ("movl %%cr3,%0\n" : "=r" (v)); return v; } |
86 | 85 | ||
- | 86 | /** Byte to port |
|
- | 87 | * |
|
- | 88 | * Output byte to port |
|
- | 89 | * |
|
- | 90 | * @param port Port to write to |
|
- | 91 | * @param val Value to write |
|
- | 92 | */ |
|
- | 93 | static inline void outb(__u16 port, __u8 val) { __asm__ volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); } |
|
- | 94 | ||
- | 95 | ||
87 | /** Set priority level low |
96 | /** Set priority level low |
88 | * |
97 | * |
89 | * Enable interrupts and return previous |
98 | * Enable interrupts and return previous |
90 | * value of EFLAGS. |
99 | * value of EFLAGS. |
91 | */ |
100 | */ |
Line 164... | Line 173... | ||
164 | __asm__ volatile("rdtsc\n" : "=A" (v)); |
173 | __asm__ volatile("rdtsc\n" : "=A" (v)); |
165 | 174 | ||
166 | return v; |
175 | return v; |
167 | } |
176 | } |
168 | 177 | ||
- | 178 | ||
169 | #endif |
179 | #endif |