File tree 3 files changed +41
-0
lines changed
3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ config X86
83
83
select ARCH_IS_SET
84
84
select ATOMIC_OPERATIONS_BUILTIN
85
85
select ARCH_SUPPORTS_COREDUMP
86
+ select ARCH_SUPPORTS_COREDUMP_PRIV_STACKS
86
87
select ARCH_SUPPORTS_ROM_START if !X86_64
87
88
select CPU_HAS_MMU
88
89
select ARCH_MEM_DOMAIN_DATA if USERSPACE && !X86_COMMON_PAGE_TABLE
Original file line number Diff line number Diff line change 5
5
*/
6
6
7
7
#include <string.h>
8
+ #include <zephyr/kernel.h>
8
9
#include <zephyr/debug/coredump.h>
9
10
10
11
#define ARCH_HDR_VER 1
@@ -80,3 +81,22 @@ uint16_t arch_coredump_tgt_code_get(void)
80
81
{
81
82
return COREDUMP_TGT_X86 ;
82
83
}
84
+
85
+ #if defined(CONFIG_DEBUG_COREDUMP_DUMP_THREAD_PRIV_STACK )
86
+ void arch_coredump_priv_stack_dump (struct k_thread * thread )
87
+ {
88
+ struct z_x86_thread_stack_header * hdr_stack_obj ;
89
+ uintptr_t start_addr , end_addr ;
90
+
91
+ #if defined(CONFIG_THREAD_STACK_MEM_MAPPED )
92
+ hdr_stack_obj = (struct z_x86_thread_stack_header * )thread -> stack_info .mapped .addr ;
93
+ #else
94
+ hdr_stack_obj = (struct z_x86_thread_stack_header * )thread -> stack_obj ;
95
+ #endif /* CONFIG_THREAD_STACK_MEM_MAPPED) */
96
+
97
+ start_addr = (uintptr_t )& hdr_stack_obj -> privilege_stack [0 ];
98
+ end_addr = start_addr + sizeof (hdr_stack_obj -> privilege_stack );
99
+
100
+ coredump_memory_dump (start_addr , end_addr );
101
+ }
102
+ #endif /* CONFIG_DEBUG_COREDUMP_DUMP_THREAD_PRIV_STACK */
Original file line number Diff line number Diff line change 5
5
*/
6
6
7
7
#include <string.h>
8
+ #include <zephyr/kernel.h>
8
9
#include <zephyr/debug/coredump.h>
9
10
10
11
#define ARCH_HDR_VER 1
@@ -106,3 +107,22 @@ uint16_t arch_coredump_tgt_code_get(void)
106
107
{
107
108
return COREDUMP_TGT_X86_64 ;
108
109
}
110
+
111
+ #if defined(CONFIG_DEBUG_COREDUMP_DUMP_THREAD_PRIV_STACK )
112
+ void arch_coredump_priv_stack_dump (struct k_thread * thread )
113
+ {
114
+ struct z_x86_thread_stack_header * hdr_stack_obj ;
115
+ uintptr_t start_addr , end_addr ;
116
+
117
+ #if defined(CONFIG_THREAD_STACK_MEM_MAPPED )
118
+ hdr_stack_obj = (struct z_x86_thread_stack_header * )thread -> stack_info .mapped .addr ;
119
+ #else
120
+ hdr_stack_obj = (struct z_x86_thread_stack_header * )thread -> stack_obj ;
121
+ #endif /* CONFIG_THREAD_STACK_MEM_MAPPED) */
122
+
123
+ start_addr = (uintptr_t )& hdr_stack_obj -> privilege_stack [0 ];
124
+ end_addr = start_addr + sizeof (hdr_stack_obj -> privilege_stack );
125
+
126
+ coredump_memory_dump (start_addr , end_addr );
127
+ }
128
+ #endif /* CONFIG_DEBUG_COREDUMP_DUMP_THREAD_PRIV_STACK */
You can’t perform that action at this time.
0 commit comments