-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve displaying AML code using fmt::Display
and Added more AML parsing
#114
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I copied parts of how `DebugStruct` is implemented in the `std` library in rust. Because we needed to have some kind of recursive structure. Due to us not having access to internal methods of `Formatter`, we needed to use another way. There is also another part of this commit. We fixed the parsing of `FieldDef` and `IndexFieldDef` and parsed the `flags` field. It was a bit annoying to separate that so I included it here in this PR. There are a lot more to improve on this, but this will make printing the data much much easier instead of worrying about `depth` and other items.
The current method as mentioned in the TODO is not good and we need to rewrite this and move to pure execution method to build the label lookup tree
Parsed the argument denoting the operation space
Didn't add newlines after each field definition
We want to also support identifying `Buffer` macros, these are macros in ASL that would generate Buffer, since we are dealing with AML directly, we have them compiled to Buffers, and we don't know what the source code actually contained. We can reverse the process, but we need to identify the macro used based on context with other elements.
Parsed all types of elements supported even though we didn't need to for some of them since the vm I'm using doesn't have `Connection` field.
I wasn't testing on this form, so I didn't notice the error
Return Acquire printing the hex value correctly Package number (this is very important as it was misleading
We are now storing which of them it is, since they are in essence just the same, we use the same struct to represent them
These are macros available in ASL that describe resources, and are compiled into Buffers in AML, so we are trying to bring them back into ASL because its meant to be read that way. This is part of the implementation, this thing is large and there are several types, so splitting it is good
Added parsing for `AddressSpace` resources, now the missing part is the connection resources, which will come later
Amjad50
changed the title
Improve displaying AML code using
Improve displaying AML code using Jul 16, 2024
fmt::Display
fmt::Display
and Added more AML parsing
Not much change really, but not sure what else to add. Not sure if it would be good to go into more details.
Used 4 tab size, and fixed all the remaining issues with display
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
I copied parts of how
DebugStruct
is implemented in thestd
library in rust. Because we needed to have some kind of recursive structure.And also added parsing for
ResourceTemplate
macros, and other structsRelated issue
None, it was just to make AML better
Changes
AML
code usingfmt::Display
, design inspired (copied) fromDebugStruct
inrust
std
flags
field inFieldDef
andIndexFieldDef
OperationRegion
Method
and added the flags it uses and so onResourceTemplate
macros, most are available except Connection descriptorsDevice
being printed asScope
Checklist
(created Add more tests for AML/ASL #115 for this 😄, too lazy to add it here)