Changeset e7b7be3f in mainline for kernel/arch/ia32xen/include/asm.h
- Timestamp:
- 2007-01-22T13:10:08Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0f3fc9b
- Parents:
- 62c63fc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32xen/include/asm.h
r62c63fc re7b7be3f 60 60 { \ 61 61 unative_t res; \ 62 __asm__volatile ("movl %%" #reg ", %0" : "=r" (res) ); \62 asm volatile ("movl %%" #reg ", %0" : "=r" (res) ); \ 63 63 return res; \ 64 64 } … … 66 66 #define GEN_WRITE_REG(reg) static inline void write_ ##reg (unative_t regn) \ 67 67 { \ 68 __asm__volatile ("movl %0, %%" #reg : : "r" (regn)); \68 asm volatile ("movl %0, %%" #reg : : "r" (regn)); \ 69 69 } 70 70 … … 93 93 * @param val Value to write 94 94 */ 95 static inline void outb(uint16_t port, uint8_t val) { __asm__volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); }95 static inline void outb(uint16_t port, uint8_t val) { asm volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); } 96 96 97 97 /** Word to port … … 102 102 * @param val Value to write 103 103 */ 104 static inline void outw(uint16_t port, uint16_t val) { __asm__volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port) ); }104 static inline void outw(uint16_t port, uint16_t val) { asm volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port) ); } 105 105 106 106 /** Double word to port … … 111 111 * @param val Value to write 112 112 */ 113 static inline void outl(uint16_t port, uint32_t val) { __asm__volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port) ); }113 static inline void outl(uint16_t port, uint32_t val) { asm volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port) ); } 114 114 115 115 /** Byte from port … … 120 120 * @return Value read 121 121 */ 122 static inline uint8_t inb(uint16_t port) { uint8_t val; __asm__volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) ); return val; }122 static inline uint8_t inb(uint16_t port) { uint8_t val; asm volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) ); return val; } 123 123 124 124 /** Word from port … … 129 129 * @return Value read 130 130 */ 131 static inline uint16_t inw(uint16_t port) { uint16_t val; __asm__volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port) ); return val; }131 static inline uint16_t inw(uint16_t port) { uint16_t val; asm volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port) ); return val; } 132 132 133 133 /** Double word from port … … 138 138 * @return Value read 139 139 */ 140 static inline uint32_t inl(uint16_t port) { uint32_t val; __asm__volatile ("inl %w1, %l0 \n" : "=a" (val) : "d" (port) ); return val; }140 static inline uint32_t inl(uint16_t port) { uint32_t val; asm volatile ("inl %w1, %l0 \n" : "=a" (val) : "d" (port) ); return val; } 141 141 142 142 /** Enable interrupts. … … 214 214 uintptr_t v; 215 215 216 __asm__volatile ("andl %%esp, %0\n" : "=r" (v) : "0" (~(STACK_SIZE-1)));216 asm volatile ("andl %%esp, %0\n" : "=r" (v) : "0" (~(STACK_SIZE-1))); 217 217 218 218 return v; … … 224 224 uintptr_t *ip; 225 225 226 __asm__volatile (226 asm volatile ( 227 227 "mov %%eip, %0" 228 228 : "=r" (ip) … … 237 237 static inline void invlpg(uintptr_t addr) 238 238 { 239 __asm__volatile ("invlpg %0\n" :: "m" (*(unative_t *)addr));239 asm volatile ("invlpg %0\n" :: "m" (*(unative_t *)addr)); 240 240 } 241 241 … … 246 246 static inline void gdtr_load(ptr_16_32_t *gdtr_reg) 247 247 { 248 __asm__volatile ("lgdtl %0\n" : : "m" (*gdtr_reg));248 asm volatile ("lgdtl %0\n" : : "m" (*gdtr_reg)); 249 249 } 250 250 … … 255 255 static inline void gdtr_store(ptr_16_32_t *gdtr_reg) 256 256 { 257 __asm__volatile ("sgdtl %0\n" : : "m" (*gdtr_reg));257 asm volatile ("sgdtl %0\n" : : "m" (*gdtr_reg)); 258 258 } 259 259 … … 264 264 static inline void tr_load(uint16_t sel) 265 265 { 266 __asm__volatile ("ltr %0" : : "r" (sel));266 asm volatile ("ltr %0" : : "r" (sel)); 267 267 } 268 268
Note:
See TracChangeset
for help on using the changeset viewer.