]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/jdb/ppc32/jdb_tcb-ppc32.cpp
Update
[l4.git] / kernel / fiasco / src / jdb / ppc32 / jdb_tcb-ppc32.cpp
1 IMPLEMENTATION [ppc32]:
2
3 EXTENSION class Jdb_tcb
4 {
5   enum
6   {
7     Disasm_x = 41,
8     Disasm_y = 11,
9     Stack_y  = 20,
10   };
11 };
12
13 IMPLEMENT
14 void Jdb_tcb::print_entry_frame_regs(Thread *)
15 {
16   Jdb_entry_frame *ef = Jdb::get_entry_frame(Jdb::current_cpu);
17   int from_user       = ef->from_user();
18
19   printf("\n\n\nRegisters (before debug entry from %s mode):\n"
20          "[0]  %08lx %08lx %08lx  %08lx %08lx %08lx %08lx %08lx\n"
21          "[8]  %08lx %08lx %08lx  %08lx %08lx %08lx %08lx %08lx\n"
22          "[16] %08lx %08lx %08lx  %08lx %08lx %08lx %08lx %08lx\n"
23          "[24] %08lx %08lx %08lx  %08lx %08lx %08lx %08lx %08lx"
24          "\033[m\n sp = %08lx\n",
25          from_user ? "user" : "kernel",
26          ef->r[0],  ef->usp,   ef->r[1],  ef->r[2],  ef->r[3],
27          ef->r[4],  ef->r[5],  ef->r[6],  ef->r[7],  ef->r[8],
28          ef->r[9],  ef->r11,   ef->r12 ,  ef->r[10], ef->r[11],
29          ef->r[12], ef->r[13], ef->r[14], ef->r[15], ef->r[16],
30          ef->r[17], ef->r[18], ef->r[19], ef->r[20], ef->r[21],
31          ef->r[22], ef->r[23], ef->r[24], ef->r[25], ef->r[26],
32          ef->r[27], ef->r[28], ef->usp);
33 }
34
35 IMPLEMENT
36 void
37 Jdb_tcb::info_thread_state(Thread *t)
38 {
39   Jdb_tcb_ptr current((Address)t->get_kernel_sp());
40
41   printf("\n\n\nSRR0=%s%08lx\033[m USP=%08lx ULR=%08lx ENTRY IP=%08lx\n",
42       Jdb::esc_emph, current.top_value(-5), current.top_value(-3),
43       current.top_value(-4), current.top_value(-10));
44
45   printf("[0]  %08lx %08lx %08lx  %08lx %08lx %08lx %08lx %08lx\n"
46          "[8]  %08lx %08lx %08lx  %08lx %08lx %08lx %08lx %08lx\n"
47          "[16] %08lx %08lx %08lx  %08lx %08lx %08lx %08lx %08lx\n"
48          "[24] %08lx %08lx %08lx  %08lx %08lx %08lx %08lx %08lx"
49          "\033[m\n",
50          current.top_value(-39), //0
51          current.top_value(-3),  //1
52          current.top_value(-38), //2
53          current.top_value(-37), //3
54          current.top_value(-36), //4
55          current.top_value(-35), //5
56          current.top_value(-34), //6
57          current.top_value(-33), //7
58          current.top_value(-32), //8
59          current.top_value(-31), //9
60          current.top_value(-30), //10
61          current.top_value(-2),  //11
62          current.top_value(-1),  //12
63          current.top_value(-29), //13
64          current.top_value(-28), //14
65          current.top_value(-27), //15
66          current.top_value(-26), //16
67          current.top_value(-25), //17
68          current.top_value(-24), //18
69          current.top_value(-23), //19
70          current.top_value(-22), //20
71          current.top_value(-21), //21
72          current.top_value(-20), //22
73          current.top_value(-19), //23
74          current.top_value(-18), //24
75          current.top_value(-17), //25
76          current.top_value(-16), //26
77          current.top_value(-15), //27
78          current.top_value(-14), //28
79          current.top_value(-13), //29
80          current.top_value(-12), //30
81          current.top_value(-11) //31
82         );
83 }
84
85 IMPLEMENT
86 void
87 Jdb_tcb::print_return_frame_regs(Jdb_tcb_ptr const &, Address)
88 {}
89
90 IMPLEMENT_OVERRIDE
91 bool
92 Jdb_stack_view::edit_registers()
93 {
94   return false;
95 }
96
97 IMPLEMENT inline
98 bool
99 Jdb_tcb_ptr::is_user_value() const
100 {
101   return _offs >= Context::Size - 9 * sizeof(Mword);
102 }
103
104 IMPLEMENT inline
105 const char *
106 Jdb_tcb_ptr::user_value_desc() const
107 {
108   const char *desc[] = { "r12", "r11", "USP", "ULR", "SRR0", "SRR1",
109                          "CR", "CTR", "XER" };
110   return desc[(Context::Size - _offs) / sizeof(Mword) - 1];
111 }