Changeset 128359eb in mainline for kernel/arch
- Timestamp:
- 2020-06-12T16:46:32Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ffccdff0
- Parents:
- 94e75cf
- Location:
- kernel/arch
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/abs32le/include/arch/asm.h
r94e75cf r128359eb 188 188 } 189 189 190 _NO_TRACE static inline uintptr_t get_stack_base(void)191 {192 /*193 * On real hardware this returns the address of the bottom194 * of the current CPU stack. The current_t structure is stored195 * on the bottom of stack and this is used to identify the196 * current CPU, current task, current thread and current197 * address space.198 */199 200 return 0;201 }202 203 190 #endif 204 191 -
kernel/arch/amd64/include/arch/asm.h
r94e75cf r128359eb 42 42 43 43 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024)) 44 45 /** Return base address of current stack.46 *47 * Return the base address of the current stack.48 * The stack is assumed to be STACK_SIZE bytes long.49 * The stack must start on page boundary.50 *51 */52 _NO_TRACE static inline uintptr_t get_stack_base(void)53 {54 uintptr_t v;55 56 asm volatile (57 "andq %%rsp, %[v]\n"58 : [v] "=r" (v)59 : "0" (~((uint64_t) STACK_SIZE - 1))60 );61 62 return v;63 }64 44 65 45 _NO_TRACE static inline void cpu_sleep(void) -
kernel/arch/arm32/include/arch/asm.h
r94e75cf r128359eb 95 95 } 96 96 97 /** Return base address of current stack.98 *99 * Return the base address of the current stack.100 * The stack is assumed to be STACK_SIZE bytes long.101 * The stack must start on page boundary.102 *103 */104 _NO_TRACE static inline uintptr_t get_stack_base(void)105 {106 uintptr_t v;107 108 asm volatile (109 "and %[v], sp, %[size]\n"110 : [v] "=r" (v)111 : [size] "r" (~(STACK_SIZE - 1))112 );113 114 return v;115 }116 117 97 extern void cpu_halt(void) __attribute__((noreturn)); 118 98 extern void asm_delay_loop(uint32_t t); -
kernel/arch/arm32/include/arch/context.h
r94e75cf r128359eb 42 42 #include <arch/regutils.h> 43 43 44 /* Put one item onto the stack to support get_stack_base()and align it up. */44 /* Put one item onto the stack to support CURRENT and align it up. */ 45 45 #define SP_DELTA (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) 46 46 -
kernel/arch/arm64/include/arch/asm.h
r94e75cf r128359eb 52 52 { 53 53 asm volatile ("wfe"); 54 }55 56 /** Return base address of current stack.57 *58 * Return the base address of the current stack.59 * The stack is assumed to be STACK_SIZE bytes long.60 * The stack must start on page boundary.61 */62 _NO_TRACE static inline uintptr_t get_stack_base(void)63 {64 uintptr_t v;65 66 asm volatile (67 "mov %[v], sp\n"68 "and %[v], %[v], %[size]\n"69 : [v] "=&r" (v)70 : [size] "r" (~((uint64_t) STACK_SIZE - 1))71 );72 73 return v;74 54 } 75 55 -
kernel/arch/arm64/include/arch/context.h
r94e75cf r128359eb 41 41 #include <arch/stack.h> 42 42 43 /* Put one item onto the stack to support get_stack_base()and align it up. */43 /* Put one item onto the stack to support CURRENT and align it up. */ 44 44 #define SP_DELTA (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) 45 45 -
kernel/arch/ia32/include/arch/asm.h
r94e75cf r128359eb 348 348 349 349 #endif /* PROCESSOR_i486 */ 350 351 /** Return base address of current stack352 *353 * Return the base address of the current stack.354 * The stack is assumed to be STACK_SIZE bytes long.355 * The stack must start on page boundary.356 *357 */358 _NO_TRACE static inline uintptr_t get_stack_base(void)359 {360 uintptr_t v;361 362 asm volatile (363 "andl %%esp, %[v]\n"364 : [v] "=r" (v)365 : "0" (~(STACK_SIZE - 1))366 );367 368 return v;369 }370 350 371 351 /** Invalidate TLB Entry. -
kernel/arch/ia32/include/arch/context.h
r94e75cf r128359eb 45 45 * First for pop of the saved register, second during ret instruction. 46 46 * 47 * One item is put onto stack to support get_stack_base().47 * One item is put onto stack to support CURRENT. 48 48 */ 49 49 #define SP_DELTA (8 + STACK_ITEM_SIZE) -
kernel/arch/ia64/include/arch/asm.h
r94e75cf r128359eb 160 160 } 161 161 162 /** Return base address of current memory stack.163 *164 * The memory stack is assumed to be STACK_SIZE / 2 long. Note that there is165 * also the RSE stack, which takes up the upper half of STACK_SIZE.166 * The memory stack must start on page boundary.167 */168 _NO_TRACE static inline uintptr_t get_stack_base(void)169 {170 uint64_t value;171 172 asm volatile (173 "mov %[value] = r12"174 : [value] "=r" (value)175 );176 177 return (value & (~(STACK_SIZE / 2 - 1)));178 }179 180 162 /** Return Processor State Register. 181 163 * -
kernel/arch/ia64/include/arch/context.h
r94e75cf r128359eb 46 46 * No need to allocate scratch area. 47 47 * 48 * One item is put onto the stack to support get_stack_base().48 * One item is put onto the stack to support CURRENT. 49 49 */ 50 50 #define SP_DELTA (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) -
kernel/arch/mips32/include/arch/asm.h
r94e75cf r128359eb 45 45 } 46 46 47 /** Return base address of current stack48 *49 * Return the base address of the current stack.50 * The stack is assumed to be STACK_SIZE bytes long.51 * The stack must start on page boundary.52 *53 */54 _NO_TRACE static inline uintptr_t get_stack_base(void)55 {56 uintptr_t base;57 58 asm volatile (59 "and %[base], $29, %[mask]\n"60 : [base] "=r" (base)61 : [mask] "r" (~(STACK_SIZE - 1))62 );63 64 return base;65 }66 67 47 _NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t v) 68 48 { -
kernel/arch/mips32/include/arch/context.h
r94e75cf r128359eb 41 41 42 42 /* 43 * Put one item onto the stack to support get_stack_base()and align it up.43 * Put one item onto the stack to support CURRENT and align it up. 44 44 */ 45 45 #define SP_DELTA (ABI_STACK_FRAME + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) -
kernel/arch/ppc32/include/arch/asm.h
r94e75cf r128359eb 163 163 } 164 164 165 /** Return base address of current stack.166 *167 * Return the base address of the current stack.168 * The stack is assumed to be STACK_SIZE bytes long.169 * The stack must start on page boundary.170 *171 */172 _NO_TRACE static inline uintptr_t get_stack_base(void)173 {174 uintptr_t base;175 176 asm volatile (177 "and %[base], %%sp, %[mask]\n"178 : [base] "=r" (base)179 : [mask] "r" (~(STACK_SIZE - 1))180 );181 182 return base;183 }184 185 165 _NO_TRACE static inline void cpu_sleep(void) 186 166 { -
kernel/arch/riscv64/include/arch/asm.h
r94e75cf r128359eb 91 91 } 92 92 93 _NO_TRACE static inline uintptr_t get_stack_base(void)94 {95 uintptr_t base;96 97 asm volatile (98 "and %[base], sp, %[mask]\n"99 : [base] "=r" (base)100 : [mask] "r" (~(STACK_SIZE - 1))101 );102 103 return base;104 }105 106 93 _NO_TRACE static inline void cpu_sleep(void) 107 94 { -
kernel/arch/sparc64/include/arch/asm.h
r94e75cf r128359eb 382 382 } 383 383 384 /** Return base address of current stack.385 *386 * Return the base address of the current stack.387 * The stack is assumed to be STACK_SIZE bytes long.388 * The stack must start on page boundary.389 *390 */391 _NO_TRACE static inline uintptr_t get_stack_base(void)392 {393 uintptr_t unbiased_sp;394 395 asm volatile (396 "add %%sp, %[stack_bias], %[unbiased_sp]\n"397 : [unbiased_sp] "=r" (unbiased_sp)398 : [stack_bias] "i" (STACK_BIAS)399 );400 401 return ALIGN_DOWN(unbiased_sp, STACK_SIZE);402 }403 404 384 /** Read Version Register. 405 385 *
Note:
See TracChangeset
for help on using the changeset viewer.