summaryrefslogtreecommitdiff
path: root/sys/arm/include/stack.h
AgeCommit message (Collapse)Author
2023-08-16sys: Remove $FreeBSD$: two-line .h patternWarner Losh
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-02-02kstack_contains(): account for struct pcb on stackKonstantin Belousov
for arm64, arm, powerpc, and riscv Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38320
2023-02-02Move kstack_contains() and GET_STACK_USAGE() to MD machine/stack.hKonstantin Belousov
Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38320
2019-12-15Rewrite arm kernel stack unwind code to work when unwinding through modules.Ian Lepore
The arm kernel stack unwinder has apparently never been able to unwind when the path of execution leads through a kernel module. There was code that tried to handle modules by looking for the unwind data in them, but it did so by trying to find symbols which have never existed in arm kernel modules. That caused the unwind code to panic, and because part of panic handling calls into the unwind code, that just created a recursion loop. Locating the unwind data in a loaded module requires accessing the Elf section headers to find the SHT_ARM_EXIDX section. For preloaded modules those headers are present in a metadata blob. For dynamically loaded modules, the headers are present only while the loading is in progress; the memory is freed once the module is ready to use. For that reason, there is new code in kern/link_elf.c, wrapped in #ifdef __arm__, to extract the unwind info while the headers are loaded. The values are saved into new fields in the linker_file structure which are also conditional on __arm__. In arm/unwind.c there is new code to locally cache the per-module info needed to find the unwind tables. The local cache is crafted for lockless read access, because the unwind code often needs to run in context where sleeping is not allowed. A large comment block describes the local cache list, so I won't repeat it all here. Notes: svn path=/head/; revision=355780
2015-02-19Allow the ARM unwinder to work through modules. This will be used to addAndrew Turner
support for unwinding from dtrace. Tested by: gnn (with dtrace) Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=278996
2015-02-17Pull the ARM ddb unwind code out to a new file. This will allow it to beAndrew Turner
used by other places that expect to unwind the stack, e.g. dtrace and stack(9). As I have written most of this code I'm changing the license to the standard FreeBSD license. I have received approval from the other developers who have changed any of the affected code. Approved by: ian, imp, rpaulo, eadler (all license change) Notes: svn path=/head/; revision=278895
2012-06-13trim trailing whitespaceWarner Losh
Notes: svn path=/head/; revision=236992
2007-12-02Break out stack(9) from ddb(4):Robert Watson
- Introduce per-architecture stack_machdep.c to hold stack_save(9). - Introduce per-architecture machine/stack.h to capture any common definitions required between db_trace.c and stack_machdep.c. - Add new kernel option "options STACK"; we will build in stack(9) if it is defined, or also if "options DDB" is defined to provide compatibility with existing users of stack(9). Add new stack_save_td(9) function, which allows the capture of a stacktrace of another thread rather than the current thread, which the existing stack_save(9) was limited to. It requires that the thread be neither swapped out nor running, which is the responsibility of the consumer to enforce. Update stack(9) man page. Build tested: amd64, arm, i386, ia64, powerpc, sparc64, sun4v Runtime tested: amd64 (rwatson), arm (cognet), i386 (rwatson) Notes: svn path=/head/; revision=174195