Changes in kernel/arch/mips32/include/asm.h [d99c1d2:7a0359b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/mips32/include/asm.h
rd99c1d2 r7a0359b 27 27 */ 28 28 29 /** @addtogroup mips32 29 /** @addtogroup mips32 30 30 * @{ 31 31 */ … … 38 38 #include <typedefs.h> 39 39 #include <config.h> 40 #include <trace.h> 40 41 41 42 static inline void cpu_sleep(void) 42 NO_TRACE static inline void cpu_sleep(void) 43 43 { 44 /* Most of the simulators do not support */ 45 /* asm volatile ("wait"); */ 44 /* 45 * Unfortunatelly most of the simulators do not support 46 * 47 * asm volatile ( 48 * "wait" 49 * ); 50 * 51 */ 46 52 } 47 53 48 54 /** Return base address of current stack 49 * 55 * 50 56 * Return the base address of the current stack. 51 57 * The stack is assumed to be STACK_SIZE bytes long. 52 58 * The stack must start on page boundary. 59 * 53 60 */ 54 static inline uintptr_t get_stack_base(void)61 NO_TRACE static inline uintptr_t get_stack_base(void) 55 62 { 56 uintptr_t v;63 uintptr_t base; 57 64 58 65 asm volatile ( 59 "and % 0, $29, %1\n"60 : "=r" (v)61 : "r" (~(STACK_SIZE-1))66 "and %[base], $29, %[mask]\n" 67 : [base] "=r" (base) 68 : [mask] "r" (~(STACK_SIZE - 1)) 62 69 ); 63 70 64 return v;71 return base; 65 72 } 66 73 67 extern void cpu_halt(void) __attribute__((noreturn)); 68 extern void asm_delay_loop(uint32_t t); 69 extern void userspace_asm(uintptr_t ustack, uintptr_t uspace_uarg, 70 uintptr_t entry); 71 72 extern ipl_t interrupts_disable(void); 73 extern ipl_t interrupts_enable(void); 74 extern void interrupts_restore(ipl_t ipl); 75 extern ipl_t interrupts_read(void); 76 extern void asm_delay_loop(uint32_t t); 77 78 static inline void pio_write_8(ioport8_t *port, uint8_t v) 74 NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t v) 79 75 { 80 *port = v; 76 *port = v; 81 77 } 82 78 83 static inline void pio_write_16(ioport16_t *port, uint16_t v)79 NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t v) 84 80 { 85 *port = v; 81 *port = v; 86 82 } 87 83 88 static inline void pio_write_32(ioport32_t *port, uint32_t v)84 NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t v) 89 85 { 90 *port = v; 86 *port = v; 91 87 } 92 88 93 static inline uint8_t pio_read_8(ioport8_t *port)89 NO_TRACE static inline uint8_t pio_read_8(ioport8_t *port) 94 90 { 95 91 return *port; 96 92 } 97 93 98 static inline uint16_t pio_read_16(ioport16_t *port)94 NO_TRACE static inline uint16_t pio_read_16(ioport16_t *port) 99 95 { 100 96 return *port; 101 97 } 102 98 103 static inline uint32_t pio_read_32(ioport32_t *port)99 NO_TRACE static inline uint32_t pio_read_32(ioport32_t *port) 104 100 { 105 101 return *port; 106 102 } 103 104 extern void cpu_halt(void) __attribute__((noreturn)); 105 extern void asm_delay_loop(uint32_t); 106 extern void userspace_asm(uintptr_t, uintptr_t, uintptr_t); 107 108 extern ipl_t interrupts_disable(void); 109 extern ipl_t interrupts_enable(void); 110 extern void interrupts_restore(ipl_t); 111 extern ipl_t interrupts_read(void); 112 extern bool interrupts_disabled(void); 107 113 108 114 #endif
Note:
See TracChangeset
for help on using the changeset viewer.