1 #include <lunaix/trace.h>
4 trace_print_transistion_short(struct hart_state* hstate)
6 trace_log(" trigger: iv=%d, ecause=%p",
7 hart_vector_stamp(hstate),
11 #ifdef CONFIG_ARCH_X86_64
14 trace_print_transition_full(struct hart_state* hstate)
16 trace_log("hart state transition");
17 trace_log(" vector=%d, ecause=0x%x",
18 hart_vector_stamp(hstate),
21 trace_log(" rflags=0x%016lx", hstate->execp->rflags);
22 trace_log(" sp=0x%016lx, seg_sel=0x%04x",
25 trace_log(" ip=0x%016lx, seg_sel=0x%04x",
31 trace_dump_state(struct hart_state* hstate)
33 struct regcontext* rh = &hstate->registers;
34 struct exec_param* ep = hstate->execp;
35 trace_log("hart state dump (depth=%d)", hstate->depth);
36 trace_log(" rax=0x%016lx, rbx=0x%016lx",
38 trace_log(" rcx=0x%016lx, rdx=0x%016lx",
40 trace_log(" rdi=0x%016lx, rsi=0x%016lx",
43 trace_log(" r8=0x%016lx, r9=0x%016lx",
45 trace_log(" r10=0x%016lx, r11=0x%016lx",
47 trace_log(" r12=0x%016lx, r13=0x%016lx",
49 trace_log(" r14=0x%016lx, r15=0x%016lx",
52 trace_log(" cs=0x%04x, rip=0x%016lx",
54 trace_log(" ss=0x%04x, rsp=0x%016lx",
56 trace_log(" rflags=0x%016lx",
63 trace_print_transition_full(struct hart_state* hstate)
65 trace_log("hart state transition");
66 trace_log(" vector=%d, ecause=0x%x",
67 hart_vector_stamp(hstate),
69 trace_log(" eflags=0x%x", hstate->execp->eflags);
70 trace_log(" sp=%p, [seg_sel=0x%04x]",
73 trace_log(" ip=%p, seg_sel=0x%04x",
79 trace_dump_state(struct hart_state* hstate)
81 struct regcontext* rh = &hstate->registers;
82 struct exec_param* ep = hstate->execp;
83 trace_log("hart state dump (depth=%d)", hstate->depth);
84 trace_log(" eax=0x%08x, ebx=0x%08x, ecx=0x%08x",
85 rh->eax, rh->ebx, rh->ecx);
86 trace_log(" edx=0x%08x, ebp=0x%08x",
88 trace_log(" ds=0x%04x, edi=0x%08x",
90 trace_log(" es=0x%04x, esi=0x%08x",
92 trace_log(" fs=0x%04x, gs=0x%x",
94 trace_log(" cs=0x%04x, ip=0x%08x",
96 trace_log(" [ss=0x%04x],sp=0x%08x",
98 trace_log(" eflags=0x%08x",