Пример #1
0
        internal unsafe int Read(Thread current, out userdesc val)
        {
            userdesc v;
            var      r = Read(current, &v, sizeof(userdesc));

            val = v;
            return(r);
        }
Пример #2
0
        public static int SetThreadArea(Thread current, UserPtr userDescriptor)
        {
            var info = new userdesc();

            if (userDescriptor.Read(current, out info) != 0)
            {
                return(-ErrorCode.EFAULT);
            }

            var ret = NativeMethods.l4api_set_thread_area(current.impl._value.thread, current.TLSArray, -1, ref info, 1);

            if (userDescriptor.Write(current, info) != 0)
            {
                return(-ErrorCode.EFAULT);
            }

            return(ret);
        }
Пример #3
0
 internal unsafe int Write(Thread current, userdesc r)
 {
     return Write(current, new Pointer(&r), sizeof(userdesc));
 }
Пример #4
0
 internal unsafe int Read(Thread current, out userdesc val)
 {
     userdesc v;
     var r = Read(current, &v, sizeof(userdesc));
     val = v;
     return r;
 }
Пример #5
0
 internal unsafe int Write(Thread current, userdesc r)
 {
     return(Write(current, new Pointer(&r), sizeof(userdesc)));
 }