Example #1
0
 private ArchAddressSpace(L4Handle value, Pointer UTCBStart, int utcb_size_log2)
 {
     this._value         = value;
     this.UTCBStart      = UTCBStart;
     this.utcb_num       = (1 << utcb_size_log2) / ArchDefinition.UTCBOffset;
     this.allocated_utcb = 0;
 }
Example #2
0
 private ArchAddressSpace(L4Handle value, Pointer UTCBStart, int utcb_size_log2)
 {
     this._value = value;
     this.UTCBStart = UTCBStart;
     this.utcb_num = (1 << utcb_size_log2) / ArchDefinition.UTCBOffset;
     this.allocated_utcb = 0;
 }
Example #3
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 #4
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 #5
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 #6
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);
        }