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