5 EXTENSION class Syscall_frame
8 Mword r[30]; //{r0, r2, r3, ..., r10, r13 .., r31, ip
12 EXTENSION class Return_frame
22 Mword r11; //+4 --two scratch registers for exception entry
29 //------------------------------------------------------------------------------
30 IMPLEMENTATION [sparc]:
37 Syscall_frame::dump() const
39 printf("IP: %08lx\n", r[29]);
40 printf("R[%2d]: %08lx R[%2d]: %08lx R[%2d]: %08lx R[%2d]: %08lx R[%2d]: %08lx\n",
41 0, r[0], 2, r[1], 3, r[2], 4, r[3], 5, r[4]);
42 printf("R[%2d]: %08lx R[%2d]: %08lx R[%2d]: %08lx R[%2d]: %08lx R[%2d]: %08lx\n",
43 6, r[5], 7, r[6], 8, r[7], 9, r[8], 10, r[9]);
48 Return_frame::srr1_bit_scan()
51 for(int i = 31; i >= 0; i--)
61 printf("SRR0 %08lx SRR1 %08lx SP %08lx\n"
62 "LR %08lx CTR %08lx CR %08lx XER %08lx\n",
63 srr0, srr1, usp, ulr, ctr, cr, xer);
69 Return_frame::dump_scratch()
71 printf("\nR[%2d]: %08lx\nR[%2d]: %08lx\n", 11, r11, 12, r12);
76 Return_frame::sp() const
78 return Return_frame::usp;
83 Return_frame::sp(Mword _sp)
85 Return_frame::usp = _sp;
90 Return_frame::ip() const
92 return Return_frame::srr0;
97 Return_frame::ip(Mword _pc)
99 Return_frame::srr0 = _pc;
102 IMPLEMENT inline NEEDS ["psr.h"]
104 Return_frame::user_mode()
107 /*return Msr::Msr_pr & srr1;*/
110 //---------------------------------------------------------------------------
111 //TODO cbass: set registers properly
113 Mword Syscall_frame::next_period() const
117 void Syscall_frame::from(Mword id)
118 { r[5] = id; /*r6*/ }
121 Mword Syscall_frame::from_spec() const
122 { return r[5]; /*r6*/ }
126 L4_obj_ref Syscall_frame::ref() const
127 { return L4_obj_ref::from_raw(r[3]); /*r4*/ }
130 void Syscall_frame::ref(L4_obj_ref const &ref)
131 { r[3] = ref.raw(); /*r4*/ }
134 L4_timeout_pair Syscall_frame::timeout() const
135 { return L4_timeout_pair(r[4]); /*r5*/ }
138 void Syscall_frame::timeout(L4_timeout_pair const &to)
139 { r[4] = to.raw(); /*r5*/ }
141 IMPLEMENT inline Utcb *Syscall_frame::utcb() const
142 { return reinterpret_cast<Utcb*>(r[1]); /*r2*/}
144 IMPLEMENT inline L4_msg_tag Syscall_frame::tag() const
145 { return L4_msg_tag(r[2]); /*r3*/ }
148 void Syscall_frame::tag(L4_msg_tag const &tag)
149 { r[2] = tag.raw(); /*r3*/ }