2 * Fiasco Kernel-Entry Frame-Layout Code for ARM
8 EXTENSION class Syscall_frame
16 EXTENSION class Return_frame
27 //---------------------------------------------------------------------------
31 #include "processor.h"
34 void Syscall_frame::dump()
36 printf(" R0: %08lx R1: %08lx R2: %08lx R3: %08lx\n",
37 r[0], r[1], r[2], r[3]);
38 printf(" R4: %08lx R5: %08lx R6: %08lx R7: %08lx\n",
39 r[4], r[5], r[6], r[7]);
40 printf(" R8: %08lx R9: %08lx R10: %08lx R11: %08lx\n",
41 r[8], r[9], r[10], r[11]);
42 printf("R12: %08lx\n", r[12]);
45 PUBLIC inline NEEDS["processor.h"]
47 Return_frame::psr_set_mode(unsigned char m)
49 psr = (psr & ~Proc::Status_mode_mask) | m;
54 Return_frame::ip() const
55 { return Return_frame::pc; }
59 Return_frame::ip_syscall_page_user() const
60 { return Return_frame::pc; }
64 Return_frame::ip(Mword _pc)
65 { Return_frame::pc = _pc; }
69 Return_frame::sp() const
70 { return Return_frame::usp; }
74 Return_frame::sp(Mword sp)
75 { Return_frame::usp = sp; }
77 //---------------------------------------------------------------------------
79 Mword Syscall_frame::next_period() const
83 void Syscall_frame::from(Mword id)
87 Mword Syscall_frame::from_spec() const
92 L4_obj_ref Syscall_frame::ref() const
93 { return L4_obj_ref::from_raw(r[2]); }
96 void Syscall_frame::ref(L4_obj_ref const &ref)
100 L4_timeout_pair Syscall_frame::timeout() const
101 { return L4_timeout_pair(r[3]); }
104 void Syscall_frame::timeout(L4_timeout_pair const &to)
107 IMPLEMENT inline Utcb *Syscall_frame::utcb() const
108 { return reinterpret_cast<Utcb*>(r[1]); }
110 IMPLEMENT inline L4_msg_tag Syscall_frame::tag() const
111 { return L4_msg_tag(r[0]); }
114 void Syscall_frame::tag(L4_msg_tag const &tag)
115 { r[0] = tag.raw(); }
118 //------------------------------------------------------------------
119 IMPLEMENTATION [arm && !hyp]:
123 Return_frame::check_valid_user_psr() const
124 { return (psr & Proc::Status_mode_mask) == Proc::PSR_m_usr; }
126 //------------------------------------------------------------------
127 IMPLEMENTATION [arm && hyp]:
131 Return_frame::check_valid_user_psr() const
132 { return (psr & Proc::Status_mode_mask) != Proc::PSR_m_hyp; }