1 #include <lunaix/trace.h>
4 trace_print_transistion_short(struct hart_state* hstate)
6 trace_log(" trigger: iv=%d, ecause=%p, frame=%p",
7 hart_vector_stamp(hstate),
9 hart_stack_frame(hstate));
12 #ifdef CONFIG_ARCH_X86_64
15 trace_print_transition_full(struct hart_state* hstate)
17 trace_log("hart state transition");
18 trace_log(" vector=%d, ecause=0x%x",
19 hart_vector_stamp(hstate),
22 trace_log(" rflags=0x%016lx", hstate->execp->rflags);
23 trace_log(" sp=0x%016lx, seg_sel=0x%04x",
26 trace_log(" ip=0x%016lx, seg_sel=0x%04x",
32 trace_dump_state(struct hart_state* hstate)
34 struct regcontext* rh = &hstate->registers;
35 struct exec_param* ep = hstate->execp;
36 trace_log("hart state dump (depth=%d)", hstate->depth);
37 trace_log(" rax=0x%016lx, rbx=0x%016lx",
39 trace_log(" rcx=0x%016lx, rdx=0x%016lx",
41 trace_log(" rdi=0x%016lx, rsi=0x%016lx",
44 trace_log(" r08=0x%016lx, r09=0x%016lx",
46 trace_log(" r10=0x%016lx, r11=0x%016lx",
48 trace_log(" r12=0x%016lx, r13=0x%016lx",
50 trace_log(" r14=0x%016lx, r15=0x%016lx",
53 trace_log(" cs=0x%04x, rip=0x%016lx",
55 trace_log(" ss=0x%04x, rsp=0x%016lx",
57 trace_log(" rflags=0x%016lx",
64 trace_print_transition_full(struct hart_state* hstate)
66 trace_log("hart state transition");
67 trace_log(" vector=%d, ecause=0x%x",
68 hart_vector_stamp(hstate),
70 trace_log(" eflags=0x%x", hstate->execp->eflags);
71 trace_log(" sp=%p, [seg_sel=0x%04x]",
74 trace_log(" ip=%p, seg_sel=0x%04x",
80 trace_dump_state(struct hart_state* hstate)
82 struct regcontext* rh = &hstate->registers;
83 struct exec_param* ep = hstate->execp;
84 trace_log("hart state dump (depth=%d)", hstate->depth);
85 trace_log(" eax=0x%08x, ebx=0x%08x, ecx=0x%08x",
86 rh->eax, rh->ebx, rh->ecx);
87 trace_log(" edx=0x%08x, ebp=0x%08x",
89 trace_log(" ds=0x%04x, edi=0x%08x",
91 trace_log(" es=0x%04x, esi=0x%08x",
93 trace_log(" fs=0x%04x, gs=0x%x",
95 trace_log(" cs=0x%04x, ip=0x%08x",
97 trace_log(" [ss=0x%04x],sp=0x%08x",
99 trace_log(" eflags=0x%08x",