Example #1
0
        public SceKernelLwMutexInfo(TPointer workArea, string name, int count, int attr)
        {
            this.lwMutexUid = 0;
            this.lwMutexOpaqueWorkAreaAddr = workArea;
            this.name = name;
            this.attr = attr;

            initCount   = count;
            lockedCount = count;

            // If the initial count is 0, the lwmutex is not acquired.
            if (count > 0)
            {
                threadid = Modules.ThreadManForUserModule.CurrentThreadID;
            }
            else
            {
                threadid = -1;
            }

            uid = SceUidManager.getNewUid("ThreadMan-LwMutex");
            threadWaitingList = ThreadWaitingList.createThreadWaitingList(SceKernelThreadInfo.PSP_WAIT_LWMUTEX, uid, attr, LwMutexManager.PSP_LWMUTEX_ATTR_PRIORITY);

            lwMutexOpaqueWorkAreaAddr.setValue32(uid);
        }
Example #2
0
        public SceKernelMppInfo(string name, int partitionid, int attr, int size, int memType)
        {
            this.name = name;
            this.attr = attr;

            bufSize  = size;
            freeSize = size;

            if (size != 0)
            {
                sysMemInfo = Modules.SysMemUserForUserModule.malloc(partitionid, "ThreadMan-MsgPipe", memType, size, 0);
                address    = sysMemInfo.addr;
            }
            else
            {
                sysMemInfo = null;
                address    = 0;
            }

            uid = SceUidManager.getNewUid(uidPurpose);
            sendThreadWaitingList    = ThreadWaitingList.createThreadWaitingList(SceKernelThreadInfo.PSP_WAIT_MSGPIPE, uid, attr, MsgPipeManager.PSP_MPP_ATTR_SEND_PRIORITY);
            receiveThreadWaitingList = ThreadWaitingList.createThreadWaitingList(SceKernelThreadInfo.PSP_WAIT_MSGPIPE, uid, attr, MsgPipeManager.PSP_MPP_ATTR_RECEIVE_PRIORITY);
            this.partitionid         = partitionid;
            head = 0;
            tail = 0;
        }
Example #3
0
        public SceKernelSemaInfo(string name, int attr, int initCount, int maxCount)
        {
            this.name         = name;
            this.attr         = attr;
            this.initCount    = initCount;
            this.currentCount = initCount;
            this.maxCount     = maxCount;

            uid = SceUidManager.getNewUid("ThreadMan-sema");
            threadWaitingList = ThreadWaitingList.createThreadWaitingList(SceKernelThreadInfo.PSP_WAIT_SEMA, uid, attr, SemaManager.PSP_SEMA_ATTR_PRIORITY);
        }
Example #4
0
        public SceKernelMbxInfo(string name, int attr)
        {
            this.name = name;
            this.attr = attr;

            numMessages      = 0;
            firstMessageAddr = 0;
            lastMessageAddr  = 0;

            uid = SceUidManager.getNewUid("ThreadMan-Mbx");
            threadWaitingList = ThreadWaitingList.createThreadWaitingList(SceKernelThreadInfo.PSP_WAIT_MBX, uid, attr, MbxManager.PSP_MBX_ATTR_PRIORITY);
        }
Example #5
0
        public SceKernelMutexInfo(string name, int count, int attr)
        {
            this.name = name;
            this.attr = attr;

            initCount   = count;
            lockedCount = count;

            // If the initial count is 0, the mutex is not acquired.
            if (count > 0)
            {
                threadid = Modules.ThreadManForUserModule.CurrentThreadID;
            }
            else
            {
                threadid = -1;
            }

            uid = SceUidManager.getNewUid("ThreadMan-Mutex");
            threadWaitingList = ThreadWaitingList.createThreadWaitingList(SceKernelThreadInfo.PSP_WAIT_MUTEX, uid, attr, MutexManager.PSP_MUTEX_ATTR_PRIORITY);
        }