示例#1
0
文件: Cpu.cs 项目: andy-uq/TinyOS
        public void Sleep(uint sleep)
        {
            var handle = SleepTimer.Register(sleep);

            DeviceReadQueue.Enqueue(handle, CurrentProcess);
            CurrentProcess = null;
        }
示例#2
0
文件: Cpu.cs 项目: andy-uq/TinyOS
 public void Input(DeviceId deviceId, OpCodeFlag flag, uint rX)
 {
     if (Enum.IsDefined(typeof(DeviceId), deviceId))
     {
         DeviceReadQueue.Enqueue(deviceId, CurrentProcess, flag, rX);
         CurrentProcess = null;
     }
     else
     {
         CurrentProcess.Zf = true;
     }
 }
示例#3
0
文件: Cpu.cs 项目: andy-uq/TinyOS
        public void WaitEvent(uint eventNo)
        {
            if (eventNo == 0 || eventNo > EventCount)
            {
                return;
            }

            var ev = Events[eventNo - 1];

            DeviceReadQueue.Enqueue(ev.Handle, CurrentProcess);
            CurrentProcess = null;
        }
示例#4
0
文件: Cpu.cs 项目: andy-uq/TinyOS
        public void AcquireLock(uint lockNo)
        {
            if (lockNo == 0 || lockNo > LockCount)
            {
                return;
            }

            var @lock = Locks[lockNo - 1];

            if (@lock.Owner == CurrentProcess.Id || @lock.Owner == 0)
            {
                AcquireLock(CurrentProcess, @lock);
                return;
            }

            DeviceReadQueue.Enqueue(@lock.Handle, CurrentProcess);
            CurrentProcess = null;
        }