private KernelResult ResetSignal(int handle) { KProcess currentProcess = _system.Scheduler.GetCurrentProcess(); KReadableEvent readableEvent = currentProcess.HandleTable.GetObject <KReadableEvent>(handle); KernelResult result; if (readableEvent != null) { result = readableEvent.ClearIfSignaled(); } else { KProcess process = currentProcess.HandleTable.GetKProcess(handle); if (process != null) { result = process.ClearIfNotExited(); } else { result = KernelResult.InvalidHandle; } } return(result); }
public void GetNativeHandle(uint typeId, out KReadableEvent readableEvent) { if (typeId == 0xF) { readableEvent = GetWaitBufferFreeEvent(); } else { throw new NotImplementedException($"Unimplemented native event type {typeId}!"); } }
protected override void GetNativeHandle(int binderId, uint typeId, out KReadableEvent readableEvent) { IBinder binder = GetBinderObjectById(binderId); if (binder == null) { readableEvent = null; Logger.PrintError(LogClass.SurfaceFlinger, $"Invalid binder id {binderId}"); return; } binder.GetNativeHandle(typeId, out readableEvent); }
private KernelResult ClearEvent(int handle) { KernelResult result; KWritableEvent writableEvent = _process.HandleTable.GetObject <KWritableEvent>(handle); if (writableEvent == null) { KReadableEvent readableEvent = _process.HandleTable.GetObject <KReadableEvent>(handle); result = readableEvent?.Clear() ?? KernelResult.InvalidHandle; } else { result = writableEvent.Clear(); } return(result); }
protected abstract void GetNativeHandle(int binderId, uint typeId, out KReadableEvent readableEvent);
public KEvent(Horizon system) { ReadableEvent = new KReadableEvent(system, this); WritableEvent = new KWritableEvent(this); }
public KEvent(KernelContext context) { ReadableEvent = new KReadableEvent(context, this); WritableEvent = new KWritableEvent(context, this); }