58,12 → 58,12 |
static inline void cpu_sleep(void) |
{ |
asm volatile ("hlt\n"); |
} |
}; |
|
static inline void cpu_halt(void) |
{ |
asm volatile ("hlt\n"); |
} |
}; |
|
|
/** Byte from port |
73,14 → 73,8 |
* @param port Port to read from |
* @return Value read |
*/ |
static inline uint8_t inb(uint16_t port) |
{ |
uint8_t val; |
static inline uint8_t inb(uint16_t port) { uint8_t val; __asm__ volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) ); return val; } |
|
asm volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port)); |
return val; |
} |
|
/** Byte to port |
* |
* Output byte to port |
88,16 → 82,10 |
* @param port Port to write to |
* @param val Value to write |
*/ |
static inline void outb(uint16_t port, uint8_t val) |
{ |
asm volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port)); |
} |
static inline void outb(uint16_t port, uint8_t val) { __asm__ volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); } |
|
/** Swap Hidden part of GS register with visible one */ |
static inline void swapgs(void) |
{ |
asm volatile("swapgs"); |
} |
static inline void swapgs(void) { __asm__ volatile("swapgs"); } |
|
/** Enable interrupts. |
* |