]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/arm/entry_frame-arm.cpp
update
[l4.git] / kernel / fiasco / src / kern / arm / entry_frame-arm.cpp
1 /*
2  * Fiasco Kernel-Entry Frame-Layout Code for ARM
3  */
4 INTERFACE [arm]:
5
6 #include "types.h"
7
8 EXTENSION class Syscall_frame
9 {
10 public:
11   //protected:
12   Mword r[13];
13   void dump();
14 };
15
16 EXTENSION class Return_frame
17 {
18 public:
19   //protected:
20   Mword usp;
21   Mword ulr;
22   Mword km_lr;
23   Mword pc;
24   Mword psr;
25 };
26
27 //---------------------------------------------------------------------------
28 IMPLEMENTATION [arm]:
29
30 #include <cstdio>
31
32 IMPLEMENT
33 void Syscall_frame::dump()
34 {
35   printf(" R0: %08lx  R1: %08lx  R2: %08lx  R3: %08lx\n",
36          r[0], r[1], r[2], r[3]);
37   printf(" R4: %08lx  R5: %08lx  R6: %08lx  R7: %08lx\n",
38          r[4], r[5], r[6], r[7]);
39   printf(" R8: %08lx  R9: %08lx R10: %08lx R11: %08lx\n",
40          r[8], r[9], r[10], r[11]);
41   printf("R12: %08lx\n", r[12]);
42 }
43
44 IMPLEMENT inline
45 Mword
46 Return_frame::ip() const
47 { return Return_frame::pc; }
48
49 IMPLEMENT inline
50 Mword
51 Return_frame::ip_syscall_page_user() const
52 { return Return_frame::pc; }
53
54 IMPLEMENT inline
55 void
56 Return_frame::ip(Mword _pc)
57 { Return_frame::pc = _pc; }
58
59 IMPLEMENT inline
60 Mword
61 Return_frame::sp() const
62 { return Return_frame::usp; }
63
64 IMPLEMENT inline
65 void
66 Return_frame::sp(Mword sp)
67 { Return_frame::usp = sp; }
68
69 //---------------------------------------------------------------------------
70 IMPLEMENT inline
71 Mword Syscall_frame::next_period() const
72 { return false; }
73
74 IMPLEMENT inline
75 void Syscall_frame::from(Mword id)
76 { r[4] = id; }
77
78 IMPLEMENT inline
79 Mword Syscall_frame::from_spec() const
80 { return r[4]; }
81
82
83 IMPLEMENT inline
84 L4_obj_ref Syscall_frame::ref() const
85 { return L4_obj_ref::from_raw(r[2]); }
86
87 IMPLEMENT inline
88 void Syscall_frame::ref(L4_obj_ref const &ref)
89 { r[2] = ref.raw(); }
90
91 IMPLEMENT inline
92 L4_timeout_pair Syscall_frame::timeout() const
93 { return L4_timeout_pair(r[3]); }
94
95 IMPLEMENT inline 
96 void Syscall_frame::timeout(L4_timeout_pair const &to)
97 { r[3] = to.raw(); }
98
99 IMPLEMENT inline Utcb *Syscall_frame::utcb() const
100 { return reinterpret_cast<Utcb*>(r[1]); }
101
102 IMPLEMENT inline L4_msg_tag Syscall_frame::tag() const
103 { return L4_msg_tag(r[0]); }
104
105 IMPLEMENT inline
106 void Syscall_frame::tag(L4_msg_tag const &tag)
107 { r[0] = tag.raw(); }
108