Changes in kernel/arch/ia32/include/asm.h [3d6beaa:b808660] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/include/asm.h
r3d6beaa rb808660 41 41 #include <typedefs.h> 42 42 #include <config.h> 43 #include <trace.h> 43 44 44 45 extern uint32_t interrupt_handler_size; 45 46 46 extern void paging_on(void);47 48 extern void interrupt_handlers(void);49 50 extern void enable_l_apic_in_msr(void);51 52 53 extern void asm_delay_loop(uint32_t t);54 extern void asm_fake_loop(uint32_t t);55 56 57 47 /** Halt CPU 58 48 * … … 60 50 * 61 51 */ 62 static inline __attribute__((noreturn)) void cpu_halt(void)52 NO_TRACE static inline __attribute__((noreturn)) void cpu_halt(void) 63 53 { 64 54 while (true) { … … 69 59 } 70 60 71 static inline void cpu_sleep(void) 72 { 73 asm volatile ("hlt\n"); 74 } 75 76 #define GEN_READ_REG(reg) static inline unative_t read_ ##reg (void) \ 61 NO_TRACE static inline void cpu_sleep(void) 62 { 63 asm volatile ( 64 "hlt\n" 65 ); 66 } 67 68 #define GEN_READ_REG(reg) NO_TRACE static inline unative_t read_ ##reg (void) \ 77 69 { \ 78 70 unative_t res; \ … … 84 76 } 85 77 86 #define GEN_WRITE_REG(reg) static inline void write_ ##reg (unative_t regn) \78 #define GEN_WRITE_REG(reg) NO_TRACE static inline void write_ ##reg (unative_t regn) \ 87 79 { \ 88 80 asm volatile ( \ … … 119 111 * 120 112 */ 121 static inline void pio_write_8(ioport8_t *port, uint8_t val)113 NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t val) 122 114 { 123 115 asm volatile ( 124 116 "outb %b[val], %w[port]\n" 125 :: [val] "a" (val), [port] "d" (port) 117 :: [val] "a" (val), 118 [port] "d" (port) 126 119 ); 127 120 } … … 135 128 * 136 129 */ 137 static inline void pio_write_16(ioport16_t *port, uint16_t val)130 NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t val) 138 131 { 139 132 asm volatile ( 140 133 "outw %w[val], %w[port]\n" 141 :: [val] "a" (val), [port] "d" (port) 134 :: [val] "a" (val), 135 [port] "d" (port) 142 136 ); 143 137 } … … 151 145 * 152 146 */ 153 static inline void pio_write_32(ioport32_t *port, uint32_t val)147 NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t val) 154 148 { 155 149 asm volatile ( 156 150 "outl %[val], %w[port]\n" 157 :: [val] "a" (val), [port] "d" (port) 151 :: [val] "a" (val), 152 [port] "d" (port) 158 153 ); 159 154 } … … 167 162 * 168 163 */ 169 static inline uint8_t pio_read_8(ioport8_t *port)164 NO_TRACE static inline uint8_t pio_read_8(ioport8_t *port) 170 165 { 171 166 uint8_t val; … … 188 183 * 189 184 */ 190 static inline uint16_t pio_read_16(ioport16_t *port)185 NO_TRACE static inline uint16_t pio_read_16(ioport16_t *port) 191 186 { 192 187 uint16_t val; … … 209 204 * 210 205 */ 211 static inline uint32_t pio_read_32(ioport32_t *port)206 NO_TRACE static inline uint32_t pio_read_32(ioport32_t *port) 212 207 { 213 208 uint32_t val; … … 230 225 * 231 226 */ 232 static inline ipl_t interrupts_enable(void)227 NO_TRACE static inline ipl_t interrupts_enable(void) 233 228 { 234 229 ipl_t v; … … 252 247 * 253 248 */ 254 static inline ipl_t interrupts_disable(void)249 NO_TRACE static inline ipl_t interrupts_disable(void) 255 250 { 256 251 ipl_t v; … … 273 268 * 274 269 */ 275 static inline void interrupts_restore(ipl_t ipl)270 NO_TRACE static inline void interrupts_restore(ipl_t ipl) 276 271 { 277 272 asm volatile ( … … 287 282 * 288 283 */ 289 static inline ipl_t interrupts_read(void)284 NO_TRACE static inline ipl_t interrupts_read(void) 290 285 { 291 286 ipl_t v; … … 305 300 * 306 301 */ 307 static inline bool interrupts_disabled(void)302 NO_TRACE static inline bool interrupts_disabled(void) 308 303 { 309 304 ipl_t v; … … 319 314 320 315 /** Write to MSR */ 321 static inline void write_msr(uint32_t msr, uint64_t value)316 NO_TRACE static inline void write_msr(uint32_t msr, uint64_t value) 322 317 { 323 318 asm volatile ( 324 319 "wrmsr" 325 :: "c" (msr), "a" ((uint32_t) (value)), 320 :: "c" (msr), 321 "a" ((uint32_t) (value)), 326 322 "d" ((uint32_t) (value >> 32)) 327 323 ); 328 324 } 329 325 330 static inline uint64_t read_msr(uint32_t msr)326 NO_TRACE static inline uint64_t read_msr(uint32_t msr) 331 327 { 332 328 uint32_t ax, dx; … … 334 330 asm volatile ( 335 331 "rdmsr" 336 : "=a" (ax), "=d" (dx) 332 : "=a" (ax), 333 "=d" (dx) 337 334 : "c" (msr) 338 335 ); … … 349 346 * 350 347 */ 351 static inline uintptr_t get_stack_base(void)348 NO_TRACE static inline uintptr_t get_stack_base(void) 352 349 { 353 350 uintptr_t v; … … 367 364 * 368 365 */ 369 static inline void invlpg(uintptr_t addr)366 NO_TRACE static inline void invlpg(uintptr_t addr) 370 367 { 371 368 asm volatile ( … … 380 377 * 381 378 */ 382 static inline void gdtr_load(ptr_16_32_t *gdtr_reg)379 NO_TRACE static inline void gdtr_load(ptr_16_32_t *gdtr_reg) 383 380 { 384 381 asm volatile ( … … 393 390 * 394 391 */ 395 static inline void gdtr_store(ptr_16_32_t *gdtr_reg)392 NO_TRACE static inline void gdtr_store(ptr_16_32_t *gdtr_reg) 396 393 { 397 394 asm volatile ( … … 406 403 * 407 404 */ 408 static inline void idtr_load(ptr_16_32_t *idtr_reg)405 NO_TRACE static inline void idtr_load(ptr_16_32_t *idtr_reg) 409 406 { 410 407 asm volatile ( … … 419 416 * 420 417 */ 421 static inline void tr_load(uint16_t sel)418 NO_TRACE static inline void tr_load(uint16_t sel) 422 419 { 423 420 asm volatile ( … … 427 424 } 428 425 426 extern void paging_on(void); 427 extern void enable_l_apic_in_msr(void); 428 429 extern void asm_delay_loop(uint32_t); 430 extern void asm_fake_loop(uint32_t); 431 432 extern uintptr_t int_0; 433 extern uintptr_t int_1; 434 extern uintptr_t int_2; 435 extern uintptr_t int_3; 436 extern uintptr_t int_4; 437 extern uintptr_t int_5; 438 extern uintptr_t int_6; 439 extern uintptr_t int_7; 440 extern uintptr_t int_8; 441 extern uintptr_t int_9; 442 extern uintptr_t int_10; 443 extern uintptr_t int_11; 444 extern uintptr_t int_12; 445 extern uintptr_t int_13; 446 extern uintptr_t int_14; 447 extern uintptr_t int_15; 448 extern uintptr_t int_16; 449 extern uintptr_t int_17; 450 extern uintptr_t int_18; 451 extern uintptr_t int_19; 452 extern uintptr_t int_20; 453 extern uintptr_t int_21; 454 extern uintptr_t int_22; 455 extern uintptr_t int_23; 456 extern uintptr_t int_24; 457 extern uintptr_t int_25; 458 extern uintptr_t int_26; 459 extern uintptr_t int_27; 460 extern uintptr_t int_28; 461 extern uintptr_t int_29; 462 extern uintptr_t int_30; 463 extern uintptr_t int_31; 464 extern uintptr_t int_32; 465 extern uintptr_t int_33; 466 extern uintptr_t int_34; 467 extern uintptr_t int_35; 468 extern uintptr_t int_36; 469 extern uintptr_t int_37; 470 extern uintptr_t int_38; 471 extern uintptr_t int_39; 472 extern uintptr_t int_40; 473 extern uintptr_t int_41; 474 extern uintptr_t int_42; 475 extern uintptr_t int_43; 476 extern uintptr_t int_44; 477 extern uintptr_t int_45; 478 extern uintptr_t int_46; 479 extern uintptr_t int_47; 480 extern uintptr_t int_48; 481 extern uintptr_t int_49; 482 extern uintptr_t int_50; 483 extern uintptr_t int_51; 484 extern uintptr_t int_52; 485 extern uintptr_t int_53; 486 extern uintptr_t int_54; 487 extern uintptr_t int_55; 488 extern uintptr_t int_56; 489 extern uintptr_t int_57; 490 extern uintptr_t int_58; 491 extern uintptr_t int_59; 492 extern uintptr_t int_60; 493 extern uintptr_t int_61; 494 extern uintptr_t int_62; 495 extern uintptr_t int_63; 496 429 497 #endif 430 498
Note:
See TracChangeset
for help on using the changeset viewer.