- Sep 14, 2017
-
-
Jeremy Soller authored
Improve error information Cleanup interrupt macros
-
- Jul 23, 2017
-
-
Connor Wood authored
-
Connor Wood authored
-
- Jun 18, 2017
-
-
Jeremy Soller authored
* Initial parser proof of concept * Added better error handling to the parser * Refactored into a better directory structure * Parse package length * Implemented named string, scope op * Properly bounds checked namestring * Fixed namestring regressions * Started work parsing DefRegionOp. NB: As TermArg is not yet implemented, a bug is present parsing the address offset and length. Additionally, a bug was fixed in NameString * Completed DefOpRegion implementation. TermArg remains unimplemented, stubbed out * Implemented TermArg parsing * Implemented integer parts of computational data * Implemented defField, and associated FieldList. FieldElement still remains stubbed * Implmenented FieldElement * Implmenented named field * Parsed DefMethod * Parsed ToHexString * Parsed ToBuffer * Parsed both subtract and sizeof * Fixed size bug in sizeof parsing * Parsed Store, fixed a parse bug where Target should be a SuperName not a TermArg * Parsed while * Parsed LLess * Parsed DerefOf * Parse Index * Parse increment * Parse device * Parse device * Parsed create dword field * Parsed if/else block * Properly parsed Target, rendered an AST from existing parse code, and stubbed out MethodInvocation parser method * Implemented deferred loading, and deferred method invocation parses * Parsed Or * Fixed a bunch of off-by-one errors. Shows what I get for copying code around * Parsed Return * Fixed a boolean logic error in the handling of the extended instruction namespace * Added DefBuffer to ComputationalData * Removed a temporary file * Parsed ReservedField * Parsed DefPackage, DefAnd, and ComputationalData::String * Parsed DefMutex * Parsed DefAlias and RevisionOp * Parsed DebugObj * Parsed DefRefOf * Parsed type 6 opcodes * Added ObjectReference and DDBHandle to DataRefObj parsing * Parsed DefVarPackage, in both Type2OpCode, and in DataObj * Parsed DefBankField * Parsed AccessField * Parsed ConnectField * Parsed CreateBitField * Parsed CreateByteField * Parsed CreateWordField * Parsed CreateQWordField * Parsed CreateField * Parsed DefDataRegion * Parsed DefEvent * Parsed IndexField * Parsed DefPowerRes * Parsed DefProcessor * Parsed DefThermalZone: * Parsed ExtendedAccessField * Parsed DefBreak, DefBreakPoint, DefContinue and DefNoop (all type 1 opcodes with no parameters and one byte) * Parsed DefFatal * Parsed DefLoad * Parsed DefNotify * Parsed DefRelease * Parsed DefReset * Parsed DefSignal * Parsed DefSleep * Parsed DefStall * Parsed DefUnload * Parsed DefAcquire * Parsed DefAnd * Parsed DefConcat * Parsed ConcatRes * Switched Concat and ConcatRes opcodes * Parsed CondRefOf * Parsed DefDecrement and DefCopyObject * Parsed DefDivide, fixed length calculation bug in a bunch of parse routines * Parsed DefFindSetLeftBit * Parsed DefFindSetRightBit * Parsed DefFromBCD * Parsed DefLAnd * Parsed DefLGreater * Parsed LNot * Parsed DefLOr * Parsed DefLoadTable * Parsed DefMatch * Parsed DefMid * Parsed DefMod * Parsed DefMultiply * Parsed DefNAnd * Parsed DefNOr * Parsed DefNot * Parsed DefObjectType * Parsed DefShiftLeft and DefShiftRight * Parsed DefTimer * Parsed DefToBCD, DefToDecimalString, DefToInteger and DefToString * Parsed DefXor * Parsed DefWait * Implemented a parser, abstract syntax tree, and basic infrastructure for the AML subsystem of the ACPI module. The entire AML grammar is parsed and placed into an abstract syntax tree, with one exception: method invocations, rather than parsing, defer the load until later on in the process, due to the way the grammar works. Still to be done: - Refactor the code: a lot of the parser is very repetitive, and could easily be refactored with the aid of macros. This would reduce the length and improve legibility, though not affect function. - More rigorous testing of parser: the parser has, thus far, only been tested on the DSDT in QEMU. There may be bugs present that are hidden. - Parse the SSDTs: the SSDTs should be parsed after the DSDT, and contain more AML bytecode to be treated as modifying the same namespace. Adding this would be simple, though not urgent. - Transform the AST into a concrete executable tree: the CET is what will hold all information necessary to execute control methods and evaluate namespace objects. While this could be done in the AST, due to the way AML is laid out this would be very inefficient and require a lot of repetitive transformations every time something is to be executed. Therefore, perform the transformations upfront. - Parse the deferred loads, and the method invocations contained within: Once the AST has been rendered into a CET, sufficient information will be present to parse method invocations and add those to the namespace. - Bytecode interpreter: Once the CET has been finalized with method invocation parsing, it can then be called and executed. - Control method executor: this should walk the namespace, locating the relevant control method, then calling the interpreter on it. - Namespace enumerator: the executor shall use this to walk the namespace, and it should also be publicly accessible to allow outside code to determine what devices are present in the system. - Memory accessor API: ACPI AML has a concept of memory access in certain device domains - for example, the PCI BAR registers. These are all device specific offsets, therefore device drivers, or more accurately bus drivers, should be capable of installing handlers to manage this memory access. - CET concatenation: The DSDT and SSDTs all affect the same namespace, therefore concatenating the resulting trees should be possible. - Type checking: some operations in AML are typed. This should be handled at tree transformation time or earlier, and could indeed done in the parse step with some modification to the parser. This is currently not the case. * Initial parser proof of concept * Added better error handling to the parser * Refactored into a better directory structure * Parse package length * Implemented named string, scope op * Properly bounds checked namestring * Fixed namestring regressions * Started work parsing DefRegionOp. NB: As TermArg is not yet implemented, a bug is present parsing the address offset and length. Additionally, a bug was fixed in NameString * Completed DefOpRegion implementation. TermArg remains unimplemented, stubbed out * Implemented TermArg parsing * Implemented integer parts of computational data * Implemented defField, and associated FieldList. FieldElement still remains stubbed * Implmenented FieldElement * Implmenented named field * Parsed DefMethod * Parsed ToHexString * Parsed ToBuffer * Parsed both subtract and sizeof * Fixed size bug in sizeof parsing * Parsed Store, fixed a parse bug where Target should be a SuperName not a TermArg * Parsed while * Parsed LLess * Parsed DerefOf * Parse Index * Parse increment * Parse device * Parse device * Parsed create dword field * Parsed if/else block * Properly parsed Target, rendered an AST from existing parse code, and stubbed out MethodInvocation parser method * Implemented deferred loading, and deferred method invocation parses * Parsed Or * Fixed a bunch of off-by-one errors. Shows what I get for copying code around * Parsed Return * Fixed a boolean logic error in the handling of the extended instruction namespace * Added DefBuffer to ComputationalData * Removed a temporary file * Parsed ReservedField * Parsed DefPackage, DefAnd, and ComputationalData::String * Parsed DefMutex * Parsed DefAlias and RevisionOp * Parsed DebugObj * Parsed DefRefOf * Parsed type 6 opcodes * Added ObjectReference and DDBHandle to DataRefObj parsing * Parsed DefVarPackage, in both Type2OpCode, and in DataObj * Parsed DefBankField * Parsed AccessField * Parsed ConnectField * Parsed CreateBitField * Parsed CreateByteField * Parsed CreateWordField * Parsed CreateQWordField * Parsed CreateField * Parsed DefDataRegion * Parsed DefEvent * Parsed IndexField * Parsed DefPowerRes * Parsed DefProcessor * Parsed DefThermalZone: * Parsed ExtendedAccessField * Parsed DefBreak, DefBreakPoint, DefContinue and DefNoop (all type 1 opcodes with no parameters and one byte) * Parsed DefFatal * Parsed DefLoad * Parsed DefNotify * Parsed DefRelease * Parsed DefReset * Parsed DefSignal * Parsed DefSleep * Parsed DefStall * Parsed DefUnload * Parsed DefAcquire * Parsed DefAnd * Parsed DefConcat * Parsed ConcatRes * Switched Concat and ConcatRes opcodes * Parsed CondRefOf * Parsed DefDecrement and DefCopyObject * Parsed DefDivide, fixed length calculation bug in a bunch of parse routines * Parsed DefFindSetLeftBit * Parsed DefFindSetRightBit * Parsed DefFromBCD * Parsed DefLAnd * Parsed DefLGreater * Parsed LNot * Parsed DefLOr * Parsed DefLoadTable * Parsed DefMatch * Parsed DefMid * Parsed DefMod * Parsed DefMultiply * Parsed DefNAnd * Parsed DefNOr * Parsed DefNot * Parsed DefObjectType * Parsed DefShiftLeft and DefShiftRight * Parsed DefTimer * Parsed DefToBCD, DefToDecimalString, DefToInteger and DefToString * Parsed DefXor * Parsed DefWait * Implemented a parser, abstract syntax tree, and basic infrastructure for the AML subsystem of the ACPI module. The entire AML grammar is parsed and placed into an abstract syntax tree, with one exception: method invocations, rather than parsing, defer the load until later on in the process, due to the way the grammar works. Still to be done: - Refactor the code: a lot of the parser is very repetitive, and could easily be refactored with the aid of macros. This would reduce the length and improve legibility, though not affect function. - More rigorous testing of parser: the parser has, thus far, only been tested on the DSDT in QEMU. There may be bugs present that are hidden. - Parse the SSDTs: the SSDTs should be parsed after the DSDT, and contain more AML bytecode to be treated as modifying the same namespace. Adding this would be simple, though not urgent. - Transform the AST into a concrete executable tree: the CET is what will hold all information necessary to execute control methods and evaluate namespace objects. While this could be done in the AST, due to the way AML is laid out this would be very inefficient and require a lot of repetitive transformations every time something is to be executed. Therefore, perform the transformations upfront. - Parse the deferred loads, and the method invocations contained within: Once the AST has been rendered into a CET, sufficient information will be present to parse method invocations and add those to the namespace. - Bytecode interpreter: Once the CET has been finalized with method invocation parsing, it can then be called and executed. - Control method executor: this should walk the namespace, locating the relevant control method, then calling the interpreter on it. - Namespace enumerator: the executor shall use this to walk the namespace, and it should also be publicly accessible to allow outside code to determine what devices are present in the system. - Memory accessor API: ACPI AML has a concept of memory access in certain device domains - for example, the PCI BAR registers. These are all device specific offsets, therefore device drivers, or more accurately bus drivers, should be capable of installing handlers to manage this memory access. - CET concatenation: The DSDT and SSDTs all affect the same namespace, therefore concatenating the resulting trees should be possible. - Type checking: some operations in AML are typed. This should be handled at tree transformation time or earlier, and could indeed done in the parse step with some modification to the parser. This is currently not the case. * Partial refactor of AML code * Further refactoring * Fully refactored type 2 opcode selector * Refactored type 6 opcode selector * Further refactored Type 2 opcode parsing * Implemented basic infrastructure in order to render the AST down to a namespace object * Resolved scopes into the namespace * Put OpRegion into namespace * Rendered field parsing to the namespace object * Methods now placed in namespace * Moved DefName into the namespace * Moved packages into the namespace * Converted shutdown sequence to use AML parser * Moved shutdown over to use AML parsing fully * Removed the no longer needed DSDT code * Better messages on unmapping failure * Disable preemption until paging bug is fixed * Refactor kernel mapping so that symbol table is mapped * Add symbol lookup (still very WIP) * Improve method of getting symbol name * Reenable preemption * Demangle symbols * Fix overallocation * Remove tilde files
-
- Apr 04, 2017
-
-
Jeremy Soller authored
-
- Jan 03, 2017
-
-
Jeremy Soller authored
-