private void AddMethod(string name, byte numArgs, ReservedMethod.AcpiMethodImpl impl) { AbsoluteNodePath root = AbsoluteNodePath.CreateRoot(); Node node = acpiNamespace.CreateNodeAt(new AbsoluteNodePath(new string[] { name }), root); node.Value = new ReservedMethod(numArgs, SerializeFlag.NotSerialized, 0 /*syncLevel*/, impl);; }
public override void Visit(AmlParser.DefDevice defDevice) { AbsoluteNodePath oldPath = currentPath; Node node = acpiNamespace.LookupNode(defDevice.nameString.nodePath, currentPath); string[] segments = new string[currentPath.NameSegments.Length + defDevice.nameString.nodePath.NameSegments.Length]; int index = 0; foreach (string segment in currentPath.NameSegments) { segments[index++] = segment; } foreach (string segment in defDevice.nameString.nodePath.NameSegments) { segments[index++] = segment; } AbsoluteNodePath devPath = new AbsoluteNodePath(segments); node.Value = new AcpiObject.Device(devPath); currentPath = node.Path; foreach (AmlObject amlObject in defDevice.amlObjectList) { amlObject.Accept(this); } currentPath = oldPath; }
public AmlInterpreterThread(AcpiNamespace acpiNamespace, MethodResultCallback callback, IOperationRegionAccessor operationRegionAccessor) { this.acpiNamespace = acpiNamespace; this.currentPath = AbsoluteNodePath.CreateRoot(); this.callback = callback; this.operationRegionAccessor = operationRegionAccessor; }
public AmlInterpreterThread InvokeMethodOnNewThread(MethodResultCallback callback, AbsoluteNodePath nodePath, AcpiObject.AcpiObject[] parameters) { AmlInterpreterThread thread = new AmlInterpreterThread(acpiNamespace, callback, operationRegionAccessor); thread.InvokeMethod(nodePath, parameters); threadsReadyToRun.Enqueue(thread); return(thread); }
public override void Visit(AmlParser.DefScope defScope) { AbsoluteNodePath oldPath = currentPath; currentPath = acpiNamespace.LookupNode(defScope.nameString.nodePath, currentPath).Path; foreach (TermObj termObj in defScope.termList) { termObj.Accept(this); } currentPath = oldPath; }
public override void Visit(AmlParser.DefThermalZone defThermalZone) { AbsoluteNodePath oldPath = currentPath; Node node = acpiNamespace.CreateNodeAt(defThermalZone.nameString.nodePath, currentPath); currentPath = node.Path; foreach (AmlObject amlObject in defThermalZone.amlObjectList) { amlObject.Accept(this); } currentPath = oldPath; }
public void InvokeMethod(AbsoluteNodePath nodePath, AcpiObject.AcpiObject[] parameters) { Node methodNode = acpiNamespace.LookupNode(nodePath); if (methodNode == null) { throw new MethodNotFoundInterpretException(); } if (!(methodNode.Value is AcpiObject.BytecodeMethod)) { throw new AmlTypeException(); } this.currentPath = methodNode.Path; ((AcpiObject.Method)(methodNode.Value)).Invoke(this, parameters, acpiNamespace); }
public override void Visit(AmlParser.DefPowerRes defPowerRes) { AbsoluteNodePath oldPath = currentPath; Node node = acpiNamespace.LookupNode(defPowerRes.nameString.nodePath, currentPath); node.Value = new AcpiObject.PowerResource(defPowerRes.systemLevel.byteData, defPowerRes.resourceOrder.wordData); currentPath = node.Path; foreach (AmlObject amlObject in defPowerRes.amlObjectList) { amlObject.Accept(this); } currentPath = oldPath; }
public override void Visit(AmlParser.DefProcessor defProcessor) { AbsoluteNodePath oldPath = currentPath; Node node = acpiNamespace.LookupNode(defProcessor.nameString.nodePath, currentPath); node.Value = new AcpiObject.Processor(defProcessor.procID.byteData, defProcessor.pblkAddr.dWordData, defProcessor.pblkLen.byteData); currentPath = node.Path; foreach (AmlObject amlObject in defProcessor.amlObjectList) { amlObject.Accept(this); } currentPath = oldPath; }
public NamesVisitor(AcpiNamespace acpiNamespace) { this.acpiNamespace = acpiNamespace; this.currentPath = AbsoluteNodePath.CreateRoot(); }
public LoadTimeEvaluateVisitor(AcpiNamespace acpiNamespace, AbsoluteNodePath currentPath) { this.acpiNamespace = acpiNamespace; this.currentPath = currentPath; }
public ValuesVisitor(AmlLoader loader, AcpiNamespace acpiNamespace) { this.acpiNamespace = acpiNamespace; this.currentPath = AbsoluteNodePath.CreateRoot(); this.loader = loader; }
private void AddNamespace(string name) { AbsoluteNodePath root = AbsoluteNodePath.CreateRoot(); acpiNamespace.CreateNodeAt(new AbsoluteNodePath(new string[] { name }), root); }