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