Beispiel #1
0
 public AdhocObject(AdhocObject adhocObject)
 {
     networkAdapter = adhocObject.networkAdapter;
     id             = SceUidManager.getNewUid(uidPurpose);
     port           = adhocObject.port;
     BufSize        = adhocObject.bufSize;
 }
Beispiel #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;
        }
Beispiel #3
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);
        }
Beispiel #4
0
 public virtual void free()
 {
     Memory.Instance.memset(sysMemInfo.addr, (sbyte)0, sysMemInfo.allocatedSize);
     Modules.SysMemUserForUserModule.free(sysMemInfo);
     sysMemInfo = null;
     SceUidManager.releaseUid(uid, uidPurpose);
     uid = -1;
 }
Beispiel #5
0
 public virtual void delete()
 {
     if (sysMemInfo != null)
     {
         Modules.SysMemUserForUserModule.free(sysMemInfo);
     }
     SceUidManager.releaseUid(uid, uidPurpose);
 }
Beispiel #6
0
 public virtual void delete()
 {
     closeSocket();
     if (buffer != null)
     {
         Modules.SysMemUserForUserModule.free(buffer);
         buffer = null;
     }
     SceUidManager.releaseUid(id, uidPurpose);
 }
Beispiel #7
0
        public SceKernelEventFlagInfo(string name, int attr, int initPattern, int currentPattern)
        {
            this.name           = name;
            this.attr           = attr;
            this.initPattern    = initPattern;
            this.currentPattern = currentPattern;

            uid = SceUidManager.getNewUid("ThreadMan-eventflag");
            // It seems that a FIFO list is always used for EventFlags
            threadWaitingList = new ThreadWaitingListFIFO(SceKernelThreadInfo.PSP_WAIT_EVENTFLAG, uid);
        }
Beispiel #8
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);
        }
Beispiel #9
0
        public SceKernelVTimerInfo(string name)
        {
            this.name = name;
            active    = ACTIVE_STOPPED;

            uid = SceUidManager.getNewUid("ThreadMan-VTimer");
            vtimerInterruptHandler      = new VTimerInterruptHandler(this);
            vtimerInterruptAction       = new VTimerInterruptAction(this);
            vtimerInterruptResultAction = new VTimerInterruptResultAction(this);
            internalMemory = 0;
        }
Beispiel #10
0
        public SceKernelAlarmInfo(long schedule, int handlerAddress, int handlerArgument)
        {
            this.schedule        = schedule;
            this.handlerAddress  = handlerAddress;
            this.handlerArgument = handlerArgument;

            uid = SceUidManager.getNewUid(uidPurpose);
            alarmInterruptHandler      = new AlarmInterruptHandler(handlerAddress, handlerArgument);
            alarmInterruptAction       = new AlarmInterruptAction(this);
            alarmInterruptResultAction = new AlarmInterruptResultAction(this);
        }
Beispiel #11
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);
        }
Beispiel #12
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);
        }
Beispiel #13
0
        public SceKernelTls(string name, int partitionId, int attr, int blockSize, int alignedBlockSize, int numberBlocks, int alignment)
        {
            blockSize = alignUp(blockSize, 3);

            this.name             = name;
            this.attr             = attr;
            this.blockSize        = blockSize;
            this.alignedBlockSize = alignedBlockSize;
            this.numberBlocks     = numberBlocks;

            int type = alignment == 0 ? PSP_SMEM_Low : PSP_SMEM_LowAligned;

            if ((attr & PSP_ATTR_ADDR_HIGH) != 0)
            {
                type = alignment == 0 ? PSP_SMEM_High : PSP_SMEM_HighAligned;
            }

            int size = alignedBlockSize * numberBlocks;

            sysMemInfo = Modules.SysMemUserForUserModule.malloc(partitionId, name, type, size, alignment);
            uid        = SceUidManager.getNewUid(uidPurpose);

            threadIds = new int[numberBlocks];
        }
Beispiel #14
0
 public pspBaseCallback(int callbackFunction, int numberArguments)
 {
     this.callbackFunction = callbackFunction;
     arguments             = new int[numberArguments];
     uid = SceUidManager.getNewUid(callbackUidPurpose);
 }
Beispiel #15
0
 public AdhocObject(INetworkAdapter networkAdapter)
 {
     this.networkAdapter = networkAdapter;
     id = SceUidManager.getNewUid(uidPurpose);
 }
Beispiel #16
0
 public virtual void delete()
 {
     SceUidManager.releaseUid(uid, uidPurpose);
 }