Changeset 7f1c620 in mainline for arch/ia32/include/asm.h
- Timestamp:
- 2006-07-04T17:17:56Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0ffa3ef5
- Parents:
- 991779c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/include/asm.h
r991779c5 r7f1c620 41 41 #include <config.h> 42 42 43 extern __u32interrupt_handler_size;43 extern uint32_t interrupt_handler_size; 44 44 45 45 extern void paging_on(void); … … 50 50 51 51 52 extern void asm_delay_loop( __u32t);53 extern void asm_fake_loop( __u32t);52 extern void asm_delay_loop(uint32_t t); 53 extern void asm_fake_loop(uint32_t t); 54 54 55 55 … … 61 61 static inline void cpu_sleep(void) { __asm__("hlt\n"); }; 62 62 63 #define GEN_READ_REG(reg) static inline __nativeread_ ##reg (void) \63 #define GEN_READ_REG(reg) static inline unative_t read_ ##reg (void) \ 64 64 { \ 65 __nativeres; \65 unative_t res; \ 66 66 __asm__ volatile ("movl %%" #reg ", %0" : "=r" (res) ); \ 67 67 return res; \ 68 68 } 69 69 70 #define GEN_WRITE_REG(reg) static inline void write_ ##reg ( __nativeregn) \70 #define GEN_WRITE_REG(reg) static inline void write_ ##reg (unative_t regn) \ 71 71 { \ 72 72 __asm__ volatile ("movl %0, %%" #reg : : "r" (regn)); \ … … 99 99 * @param val Value to write 100 100 */ 101 static inline void outb( __u16 port, __u8val) { __asm__ volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); }101 static inline void outb(uint16_t port, uint8_t val) { __asm__ volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); } 102 102 103 103 /** Word to port … … 108 108 * @param val Value to write 109 109 */ 110 static inline void outw( __u16 port, __u16val) { __asm__ volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port) ); }110 static inline void outw(uint16_t port, uint16_t val) { __asm__ volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port) ); } 111 111 112 112 /** Double word to port … … 117 117 * @param val Value to write 118 118 */ 119 static inline void outl( __u16 port, __u32val) { __asm__ volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port) ); }119 static inline void outl(uint16_t port, uint32_t val) { __asm__ volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port) ); } 120 120 121 121 /** Byte from port … … 126 126 * @return Value read 127 127 */ 128 static inline __u8 inb(__u16 port) { __u8val; __asm__ volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) ); return val; }128 static inline uint8_t inb(uint16_t port) { uint8_t val; __asm__ volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) ); return val; } 129 129 130 130 /** Word from port … … 135 135 * @return Value read 136 136 */ 137 static inline __u16 inw(__u16 port) { __u16val; __asm__ volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port) ); return val; }137 static inline uint16_t inw(uint16_t port) { uint16_t val; __asm__ volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port) ); return val; } 138 138 139 139 /** Double word from port … … 144 144 * @return Value read 145 145 */ 146 static inline __u32 inl(__u16 port) { __u32val; __asm__ volatile ("inl %w1, %l0 \n" : "=a" (val) : "d" (port) ); return val; }146 static inline uint32_t inl(uint16_t port) { uint32_t val; __asm__ volatile ("inl %w1, %l0 \n" : "=a" (val) : "d" (port) ); return val; } 147 147 148 148 /** Enable interrupts. … … 220 220 * The stack must start on page boundary. 221 221 */ 222 static inline __addressget_stack_base(void)223 { 224 __addressv;222 static inline uintptr_t get_stack_base(void) 223 { 224 uintptr_t v; 225 225 226 226 __asm__ volatile ("andl %%esp, %0\n" : "=r" (v) : "0" (~(STACK_SIZE-1))); … … 229 229 } 230 230 231 static inline __u64rdtsc(void)232 { 233 __u64v;231 static inline uint64_t rdtsc(void) 232 { 233 uint64_t v; 234 234 235 235 __asm__ volatile("rdtsc\n" : "=A" (v)); … … 239 239 240 240 /** Return current IP address */ 241 static inline __address* get_ip()242 { 243 __address*ip;241 static inline uintptr_t * get_ip() 242 { 243 uintptr_t *ip; 244 244 245 245 __asm__ volatile ( … … 254 254 * @param addr Address on a page whose TLB entry is to be invalidated. 255 255 */ 256 static inline void invlpg( __addressaddr)257 { 258 __asm__ volatile ("invlpg %0\n" :: "m" (*( __native*)addr));256 static inline void invlpg(uintptr_t addr) 257 { 258 __asm__ volatile ("invlpg %0\n" :: "m" (*(unative_t *)addr)); 259 259 } 260 260 … … 290 290 * @param sel Selector specifying descriptor of TSS segment. 291 291 */ 292 static inline void tr_load( __u16sel)292 static inline void tr_load(uint16_t sel) 293 293 { 294 294 __asm__ volatile ("ltr %0" : : "r" (sel));
Note:
See TracChangeset
for help on using the changeset viewer.