示例#1
0
 public int sceKernelTrySendMsgPipe(MsgPipe MsgPipe, byte *Message, int Size, int WaitMode, int *ResultSizeAddr)
 {
     MsgPipe.Enqueue(Message, Size);
     if (ResultSizeAddr != null)
     {
         *ResultSizeAddr = Size;
     }
     return(0);
 }
        public MsgPipe sceKernelCreateMsgPipe(string Name, MemoryPartitions PartitionId, MsgPipeAttributes Attributes, int Size, void* Options)
        {
            if (Options != null) throw(new NotImplementedException());

            var MsgPipe = new MsgPipe()
            {
                Name = Name,
                PartitionId = PartitionId,
                Size = Size,
                Attributes = Attributes,
            };

            MsgPipe.Init(ThreadManager, MemoryManager.Memory, MemoryManager);

            return MsgPipe;
        }
示例#3
0
        public int sceKernelSendMsgPipe(MsgPipe MsgPipe, byte *Message, int Size, int WaitMode, int *ResultSizeAddr,
                                        uint *Timeout)
        {
            if (Timeout != null)
            {
                Logger.Unimplemented("sceKernelSendMsgPipe.Timeout != null");
            }

#if DEBUG_MSG_PIPES
            Console.Error.WriteLine("sceKernelSendMsgPipe");
#endif

            bool Transferred = false;
            while (!Transferred)
            {
                try
                {
                    //bool WaitiMsgPipe.OnAvailableForRecv.Count
                    MsgPipe.Enqueue(Message, Size);
                    ThreadManager.Current.CpuThreadState.Yield();
                    Transferred = true;
                }
                catch (SceKernelException)
                {
                    //throw(new NotImplementedException());
                    ThreadManager.Current.SetWaitAndPrepareWakeUp(HleThread.WaitType.None, "sceKernelSendMsgPipe",
                                                                  MsgPipe, WakeUpCallback =>
                    {
#if DEBUG_MSG_PIPES
                        Console.Error.WriteLine("sceKernelSendMsgPipe.wait");
#endif
                        MsgPipe.OnAvailableForSend.Enqueue(() =>
                        {
#if DEBUG_MSG_PIPES
                            Console.Error.WriteLine("sceKernelSendMsgPipe.awake");
#endif
                            WakeUpCallback();
                        });
                    }, HandleCallbacks: false);
                }
            }

            return(0);
        }
示例#4
0
        public MsgPipeId sceKernelCreateMsgPipe(string Name, HleMemoryManager.Partitions PartitionId, MsgPipeAttributes Attributes, int Size, void *Options)
        {
            if (Options != null)
            {
                throw(new NotImplementedException());
            }

            var MsgPipe = new MsgPipe()
            {
                Name        = Name,
                PartitionId = PartitionId,
                Size        = Size,
                Attributes  = Attributes,
            };

            MsgPipe.Init(HleState.ThreadManager, HleState.MemoryManager.Memory, HleState.MemoryManager);

            return(MessagePipeList.Create(MsgPipe));
        }
示例#5
0
        public MsgPipe sceKernelCreateMsgPipe(string Name, MemoryPartitions PartitionId, MsgPipeAttributes Attributes,
                                              int Size, void *Options)
        {
            if (Options != null)
            {
                throw new NotImplementedException();
            }

            var MsgPipe = new MsgPipe()
            {
                Name        = Name,
                PartitionId = PartitionId,
                Size        = Size,
                Attributes  = Attributes,
            };

            MsgPipe.Init(ThreadManager, MemoryManager.Memory, MemoryManager);

            return(MsgPipe);
        }
 public int sceKernelDeleteMsgPipe(MsgPipe MsgPipe)
 {
     MsgPipe.Delete();
     MsgPipe.RemoveUid(InjectContext);
     return 0;
 }
 public int sceKernelCancelMsgPipe(MsgPipe MsgPipe, int* psend, int* precv)
 {
     throw (new NotImplementedException());
 }
 public int sceKernelTrySendMsgPipe(MsgPipe MsgPipe, byte* Message, int Size, int WaitMode, int* ResultSizeAddr)
 {
     MsgPipe.Enqueue(Message, Size);
     if (ResultSizeAddr != null)
     {
         *ResultSizeAddr = Size;
     }
     return 0;
 }
 public int sceKernelTryReceiveMsgPipe(MsgPipe MsgPipe, byte* Message, int Size, int WaitMode, int* ResultSizeAddr)
 {
     MsgPipe.Dequeue(Message, Size, ResultSizeAddr);
     return 0;
 }
        public int sceKernelSendMsgPipe(MsgPipe MsgPipe, byte* Message, int Size, int WaitMode, int* ResultSizeAddr, uint* Timeout)
        {
            if (Timeout != null)
            {
                Logger.Unimplemented("sceKernelSendMsgPipe.Timeout != null");
            }

            #if DEBUG_MSG_PIPES
            Console.Error.WriteLine("sceKernelSendMsgPipe");
            #endif

            bool Transferred = false;
            while (!Transferred)
            {
                try
                {
                    //bool WaitiMsgPipe.OnAvailableForRecv.Count
                    MsgPipe.Enqueue(Message, Size);
                    ThreadManager.Current.CpuThreadState.Yield();
                    Transferred = true;
                }
                catch (SceKernelException)
                {
                    //throw(new NotImplementedException());
                    ThreadManager.Current.SetWaitAndPrepareWakeUp(HleThread.WaitType.None, "sceKernelSendMsgPipe", MsgPipe, WakeUpCallback =>
                    {
            #if DEBUG_MSG_PIPES
                        Console.Error.WriteLine("sceKernelSendMsgPipe.wait");
            #endif
                        MsgPipe.OnAvailableForSend.Enqueue(() =>
                        {
            #if DEBUG_MSG_PIPES
                            Console.Error.WriteLine("sceKernelSendMsgPipe.awake");
            #endif
                            WakeUpCallback();
                        });
                    }, HandleCallbacks: false);
                }
            }

            return 0;
        }
 public int sceKernelReferMsgPipeStatus(MsgPipe MsgPipe, /*SceKernelMppInfo*/void* SceKernelMppInfo)
 {
     throw(new NotImplementedException());
 }
示例#12
0
 public int sceKernelCancelMsgPipe(MsgPipe MsgPipe, int *psend, int *precv)
 {
     throw new NotImplementedException();
 }
示例#13
0
 public int sceKernelReferMsgPipeStatus(MsgPipe MsgPipe, /*SceKernelMppInfo*/ void *SceKernelMppInfo)
 {
     throw new NotImplementedException();
 }
示例#14
0
 public int sceKernelTryReceiveMsgPipe(MsgPipe MsgPipe, byte *Message, int Size, int WaitMode,
                                       int *ResultSizeAddr)
 {
     MsgPipe.Dequeue(Message, Size, ResultSizeAddr);
     return(0);
 }
示例#15
0
 public int sceKernelDeleteMsgPipe(MsgPipe MsgPipe)
 {
     MsgPipe.Delete();
     MsgPipe.RemoveUid(InjectContext);
     return(0);
 }
        public MsgPipeId sceKernelCreateMsgPipe(string Name, HleMemoryManager.Partitions PartitionId, MsgPipeAttributes Attributes, int Size, void* Options)
        {
            if (Options != null) throw(new NotImplementedException());

            var MsgPipe = new MsgPipe()
            {
                Name = Name,
                PartitionId = PartitionId,
                Size = Size,
                Attributes = Attributes,
            };

            MsgPipe.Init(HleState.ThreadManager, HleState.MemoryManager.Memory, HleState.MemoryManager);

            return MessagePipeList.Create(MsgPipe);
        }