Пример #1
0
        public GenericCompletionEntry Take(uint handle)
        {
            if (Head == null)
                return null;

            if (Head.handle == handle)
            {
                var r = Head;
                Head = Head.next;
                return r;
            }

            var prev = Head;
            var h = Head.next;
            while (h != null && h.handle != handle)
            {
                prev = h;
                h = h.next;
            }

            if (h == null)
                return null;

            prev.next = h.next;
            h.next = null;
            return h;
        }
Пример #2
0
        public GenericCompletionEntry Take(uint handle)
        {
            if (Head == null)
            {
                return(null);
            }

            if (Head.handle == handle)
            {
                var r = Head;
                Head = Head.next;
                return(r);
            }

            var prev = Head;
            var h    = Head.next;

            while (h != null && h.handle != handle)
            {
                prev = h;
                h    = h.next;
            }

            if (h == null)
            {
                return(null);
            }

            prev.next = h.next;
            h.next    = null;
            return(h);
        }
Пример #3
0
        public static void ResumeFromCompletion(GenericCompletionEntry c, int arg1, int arg2, int arg3, int arg4, int arg5)
        {
            Contract.Requires(c != null);

            switch (c.kind)
            {
            case GenericCompletionEntry.Kind.BinderCompletionKind:
                BinderINode.Instance.HandleAsyncCall(c.BinderCompletion, arg1, arg2, arg3, arg4, arg5);
                break;

            case GenericCompletionEntry.Kind.PollCompletionKind:
                Net.HandlePollAsync(c.PollCompletion, arg1);
                break;

            case GenericCompletionEntry.Kind.SelectCompletionKind:
                Net.HandleSelectAsync(c.SelectCompletion, arg1);
                break;

            case GenericCompletionEntry.Kind.FutexCompletionKind:
                Futex.HandleFutexAsync(c.FutexCompletion, arg1);
                break;

            case GenericCompletionEntry.Kind.IOCompletionKind:
                Arch.ArchINode.HandleIOCP(c.IOCompletion, arg1, arg2);
                break;

            case GenericCompletionEntry.Kind.BridgeCompletionKind:
                HandleBridgeCompletion(c.BridgeCompletion, arg1);
                break;

            case GenericCompletionEntry.Kind.SocketCompletionKind:
                Net.HandleSocketCompletion(c.SocketCompletion, arg1);
                break;

            case GenericCompletionEntry.Kind.GetSocketParamCompletionKind:
                Net.HandleGetSockParamCompletion(c.GetSockParamCompletion, arg1, arg2);
                break;

            case GenericCompletionEntry.Kind.OpenFileCompletionKind:
                FileSystem.HandleOpenFileCompletion(c.OpenFileCompletion, arg1, arg2);
                break;

            default:
                Arch.Console.Write("ResumeFromCompletion: Unknown entry ");
                Arch.Console.Write((uint)c.kind);
                Arch.Console.WriteLine();
                break;
            }
        }
Пример #4
0
        public static void ResumeFromCompletion(GenericCompletionEntry c, int arg1, int arg2, int arg3, int arg4, int arg5)
        {
            Contract.Requires(c != null);

            switch (c.kind)
            {
                case GenericCompletionEntry.Kind.BinderCompletionKind:
                    BinderINode.Instance.HandleAsyncCall(c.BinderCompletion, arg1, arg2, arg3, arg4, arg5);
                    break;

                case GenericCompletionEntry.Kind.PollCompletionKind:
                    Net.HandlePollAsync(c.PollCompletion, arg1);
                    break;

                case GenericCompletionEntry.Kind.SelectCompletionKind:
                    Net.HandleSelectAsync(c.SelectCompletion, arg1);
                    break;

                case GenericCompletionEntry.Kind.FutexCompletionKind:
                    Futex.HandleFutexAsync(c.FutexCompletion, arg1);
                    break;

                case GenericCompletionEntry.Kind.IOCompletionKind:
                    Arch.ArchINode.HandleIOCP(c.IOCompletion, arg1, arg2);
                    break;

                case GenericCompletionEntry.Kind.BridgeCompletionKind:
                    HandleBridgeCompletion(c.BridgeCompletion, arg1);
                    break;

                case GenericCompletionEntry.Kind.SocketCompletionKind:
                    Net.HandleSocketCompletion(c.SocketCompletion, arg1);
                    break;

                case GenericCompletionEntry.Kind.GetSocketParamCompletionKind:
                    Net.HandleGetSockParamCompletion(c.GetSockParamCompletion, arg1, arg2);
                    break;

                case GenericCompletionEntry.Kind.OpenFileCompletionKind:
                    FileSystem.HandleOpenFileCompletion(c.OpenFileCompletion, arg1, arg2);
                    break;

                default:
                    Arch.Console.Write("ResumeFromCompletion: Unknown entry ");
                    Arch.Console.Write((uint)c.kind);
                    Arch.Console.WriteLine();
                    break;
            }
        }
Пример #5
0
 public void Enqueue(GenericCompletionEntry e)
 {
     e.next = Head;
     Head   = e;
 }
Пример #6
0
 public CompletionQueue()
 {
     Head       = null;
     freeHandle = 1;
 }
Пример #7
0
 public void Enqueue(GenericCompletionEntry e)
 {
     e.next = Head;
     Head = e;
 }
Пример #8
0
 public CompletionQueue()
 {
     Head = null;
     freeHandle = 1;
 }