Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109833528
D25995.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D25995.diff
View Options
Index: head/sys/riscv/include/stack.h
===================================================================
--- head/sys/riscv/include/stack.h
+++ head/sys/riscv/include/stack.h
@@ -41,9 +41,9 @@
(va) <= VM_MAX_KERNEL_ADDRESS)
struct unwind_state {
- uint64_t fp;
- uint64_t sp;
- uint64_t pc;
+ uintptr_t fp;
+ uintptr_t sp;
+ uintptr_t pc;
};
int unwind_frame(struct unwind_state *);
Index: head/sys/riscv/riscv/db_trace.c
===================================================================
--- head/sys/riscv/riscv/db_trace.c
+++ head/sys/riscv/riscv/db_trace.c
@@ -108,9 +108,9 @@
db_printf("--- exception %ld, tval = %#lx\n",
tf->tf_scause & EXCP_MASK,
tf->tf_stval);
- frame->sp = (uint64_t)tf->tf_sp;
- frame->fp = (uint64_t)tf->tf_s[0];
- frame->pc = (uint64_t)tf->tf_sepc;
+ frame->sp = tf->tf_sp;
+ frame->fp = tf->tf_s[0];
+ frame->pc = tf->tf_sepc;
if (!INKERNEL(frame->fp))
break;
continue;
@@ -132,9 +132,9 @@
ctx = kdb_thr_ctx(thr);
- frame.sp = (uint64_t)ctx->pcb_sp;
- frame.fp = (uint64_t)ctx->pcb_s[0];
- frame.pc = (uint64_t)ctx->pcb_ra;
+ frame.sp = ctx->pcb_sp;
+ frame.fp = ctx->pcb_s[0];
+ frame.pc = ctx->pcb_ra;
db_stack_trace_cmd(&frame);
return (0);
}
@@ -143,12 +143,12 @@
db_trace_self(void)
{
struct unwind_state frame;
- uint64_t sp;
+ uintptr_t sp;
__asm __volatile("mv %0, sp" : "=&r" (sp));
frame.sp = sp;
- frame.fp = (uint64_t)__builtin_frame_address(0);
- frame.pc = (uint64_t)db_trace_self;
+ frame.fp = (uintptr_t)__builtin_frame_address(0);
+ frame.pc = (uintptr_t)db_trace_self;
db_stack_trace_cmd(&frame);
}
Index: head/sys/riscv/riscv/stack_machdep.c
===================================================================
--- head/sys/riscv/riscv/stack_machdep.c
+++ head/sys/riscv/riscv/stack_machdep.c
@@ -86,13 +86,13 @@
stack_save(struct stack *st)
{
struct unwind_state frame;
- uint64_t sp;
+ uintptr_t sp;
__asm __volatile("mv %0, sp" : "=&r" (sp));
frame.sp = sp;
- frame.fp = (uint64_t)__builtin_frame_address(0);
- frame.pc = (uint64_t)stack_save;
+ frame.fp = (uintptr_t)__builtin_frame_address(0);
+ frame.pc = (uintptr_t)stack_save;
stack_capture(st, &frame);
}
Index: head/sys/riscv/riscv/unwind.c
===================================================================
--- head/sys/riscv/riscv/unwind.c
+++ head/sys/riscv/riscv/unwind.c
@@ -42,7 +42,7 @@
int
unwind_frame(struct unwind_state *frame)
{
- uint64_t fp;
+ uintptr_t fp;
fp = frame->fp;
@@ -50,8 +50,8 @@
return (-1);
frame->sp = fp;
- frame->fp = *(uint64_t *)(fp - 16);
- frame->pc = *(uint64_t *)(fp - 8) - 4;
+ frame->fp = ((uintptr_t *)fp)[-2];
+ frame->pc = ((uintptr_t *)fp)[-1] - 4;
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 11, 3:00 AM (10 h, 22 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16588077
Default Alt Text
D25995.diff (2 KB)
Attached To
Mode
D25995: Use uintptr_t instead of uint64_t for pointers in stack frames.
Attached
Detach File
Event Timeline
Log In to Comment