]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/jdb/jdb_screen.cpp
update
[l4.git] / kernel / fiasco / src / jdb / jdb_screen.cpp
1 INTERFACE:
2
3 #include "types.h"
4
5 class Jdb_screen
6 {
7 public:
8   static const unsigned Mword_size_bmode = sizeof(Mword)*2;
9   static const unsigned Mword_size_cmode = sizeof(Mword);
10   static const unsigned Col_head_size = sizeof(Mword)*2;
11
12   static const char *Mword_adapter;
13   static const char *Mword_not_mapped;
14   static const char *Mword_blank;
15
16   static const char* const Reg_names[];
17   static const char Reg_prefix;
18   static const char *Line;
19
20   static const char* Root_page_table;
21
22 private:
23   static unsigned int _height;
24   static unsigned int _width;
25   static bool         _direct_enabled;
26 };
27
28 IMPLEMENTATION:
29
30 unsigned int Jdb_screen::_height         = 25; // default for native
31 unsigned int Jdb_screen::_width          = 80; // default
32 bool         Jdb_screen::_direct_enabled = true;
33
34 const char* Jdb_screen::Mword_adapter           = "~~~~~~~~~~~~~~~~";
35 const char* Jdb_screen::Mword_not_mapped        = "----------------";
36 const char* Jdb_screen::Mword_blank             = "                ";
37 const char* Jdb_screen::Line                    = "---------------------------"
38                                                   "---------------------------"
39                                                   "-----------------";
40 PUBLIC static
41 void
42 Jdb_screen::set_height(unsigned int h)
43 { _height = h; }
44
45 PUBLIC static
46 void
47 Jdb_screen::set_width(unsigned int w)
48 { _width = w; }
49
50 PUBLIC static inline
51 unsigned int
52 Jdb_screen::width()
53 { return _width; }
54
55 PUBLIC static inline
56 unsigned int
57 Jdb_screen::height()
58 { return _height; }
59
60 PUBLIC static inline
61 unsigned long
62 Jdb_screen::cols()
63 { return (width()-Col_head_size)/(Mword_size_bmode + 1) + 1; }
64
65 PUBLIC static inline
66 unsigned long
67 Jdb_screen::rows()
68 { return ((unsigned long)-1)/ ((cols()-1)*4) + 1; }
69
70 PUBLIC static inline
71 void
72 Jdb_screen::enable_direct(bool enable)
73 { _direct_enabled = enable; }
74
75 PUBLIC static inline
76 bool
77 Jdb_screen::direct_enabled()
78 { return _direct_enabled; }