]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/jdb/arm/jdb_entry_frame-arm.cpp
update
[l4.git] / kernel / fiasco / src / jdb / arm / jdb_entry_frame-arm.cpp
1 INTERFACE [arm]:
2
3 #include "cpu.h"
4 #include "trap_state.h"
5 #include "tb_entry.h"
6
7 class Jdb_entry_frame : public Trap_state
8 {
9 public:
10   Address_type from_user() const;
11   Address ip() const;
12   bool debug_ipi() const;
13 };
14
15 class Jdb_output_frame : public Jdb_entry_frame
16 {};
17
18 class Jdb_status_page_frame : public Jdb_entry_frame
19 {};
20
21 class Jdb_log_frame : public Jdb_entry_frame
22 {};
23
24 class Jdb_log_3val_frame : public Jdb_log_frame
25 {};
26
27 class Jdb_debug_frame : public Jdb_entry_frame
28 {};
29
30 class Jdb_symbols_frame : public Jdb_debug_frame
31 {};
32
33 class Jdb_lines_frame : public Jdb_debug_frame
34 {};
35
36 class Jdb_get_cputime_frame : public Jdb_entry_frame
37 {};
38
39 class Jdb_thread_name_frame : public Jdb_entry_frame
40 {};
41
42 //---------------------------------------------------------------------------
43 IMPLEMENTATION[arm]:
44
45 #include <cstdio>
46 #include "processor.h"
47
48 #if 0
49 PUBLIC
50 void
51 Jdb_entry_frame::dump() const
52 {
53   printf(
54       "R[ 0- 3]: %08lx %08lx %08lx %08lx\n"
55       "R[ 4- 7]: %08lx %08lx %08lx %08lx\n"
56       "R[ 8-11]: %08lx %08lx %08lx %08lx\n"
57       "R[12-15]: %08lx %08lx %08lx %08lx\n"
58       "kernel sp = %08lx  cpsr = %08lx  spsr = %08lx\n",
59       r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8],
60       r[9], r[10], r[11], r[12], r[13], r[14], pc, ksp, cpsr, spsr);
61 }
62 #endif
63
64 IMPLEMENT inline
65 bool
66 Jdb_entry_frame::debug_ipi() const
67 { return error_code == 0x00e00002; }
68
69 IMPLEMENT inline NEEDS["processor.h"]
70 Address_type
71 Jdb_entry_frame::from_user() const
72 {
73   return (psr & Proc::Status_mode_mask) == Proc::Status_mode_user
74          ? ADDR_USER : ADDR_KERNEL;
75 }
76
77 PUBLIC inline
78 Address Jdb_entry_frame::ksp() const
79 { return Address(this); }
80
81 IMPLEMENT inline
82 Address Jdb_entry_frame::ip() const
83 { return pc; }
84
85 PUBLIC inline
86 Mword
87 Jdb_entry_frame::param() const
88 { return r[0]; }
89
90
91 PUBLIC inline
92 Unsigned8*
93 Jdb_log_frame::str() const
94 { return (Unsigned8*)r[1]; }
95
96 PUBLIC inline NEEDS["tb_entry.h"]
97 void
98 Jdb_log_frame::set_tb_entry(Tb_entry* tb_entry)
99 { r[0] = (Mword)tb_entry; }
100
101 //---------------------------------------------------------------------------
102 PUBLIC inline
103 Mword
104 Jdb_log_3val_frame::val1() const
105 { return r[2]; }
106
107 PUBLIC inline
108 Mword
109 Jdb_log_3val_frame::val2() const
110 { return r[3]; }
111
112 PUBLIC inline
113 Mword
114 Jdb_log_3val_frame::val3() const
115 { return r[4]; }
116
117 //---------------------------------------------------------------------------
118 PUBLIC inline
119 void
120 Jdb_status_page_frame::set(Address status_page)
121 { r[0] = (Mword)status_page; }