Example #1
0
 public static void ReturnFromPageFault(L4Handle target, out Msgtag tag, ref MessageRegisters mr, uint pfa, Pointer physicalPage, uint permssion)
 {
     var virt_page_addr = ArchDefinition.PageIndex(physicalPage.ToUInt32());
     var fpage = new L4FPage(virt_page_addr, ArchDefinition.PageShift, (int)permssion);
     tag = new Msgtag(0, 0, 1, 0);
     mr.mr0 = (int)(ArchDefinition.PageIndex(pfa) | Msgtag.L4_ITEM_MAP);
     mr.mr1 = (int)fpage.raw;
     NativeMethods.l4api_ipc_send(target, NativeMethods.l4api_utcb(), tag, Timeout.Never);
 }
Example #2
0
        public static unsafe void ReturnFromSyscall(L4Handle target, ref ExceptionRegisters regs, int retval)
        {
            var p_exc = NativeMethods.l4api_utcb_exc();
            *p_exc = regs;

            // Skip the int $0x80 instruction
            p_exc->ip += 2;
            p_exc->eax = retval;

            var tag = new Msgtag(0, ExceptionRegisters.L4_UTCB_EXCEPTION_REGS_SIZE, 0, 0);
            NativeMethods.l4api_ipc_send(target, NativeMethods.l4api_utcb(), tag, Timeout.Never);
        }
Example #3
0
        public static unsafe void ReturnFromSyscall(L4Handle target, ref ExceptionRegisters regs, int retval)
        {
            var p_exc = NativeMethods.l4api_utcb_exc();

            *p_exc = regs;

            // Skip the int $0x80 instruction
            p_exc->ip += 2;
            p_exc->eax = retval;

            var tag = new Msgtag(0, ExceptionRegisters.L4_UTCB_EXCEPTION_REGS_SIZE, 0, 0);

            NativeMethods.l4api_ipc_send(target, NativeMethods.l4api_utcb(), tag, Timeout.Never);
        }