-
Notifications
You must be signed in to change notification settings - Fork 47
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
platform: move I/O port driver into platform abstraction #463
Conversation
@peterfang This should enable you to implement the correct GHCI-based abstraction for I/O port accesses. After making a couple of different rounds of changes, it became apparent that the best way to make this work was not to have the console logic use native I/O operations, but to correctly implement a platform-specific version of the Feel free to test on top of this. However, this cannot merge until #462 merges because #462 changes the gdbstub adapter to use the platform abstraction as well, which is a prerequisite for the refactoring in this PR. |
Got it. I'll keep track of this PR and make updates to #419 accordingly. This will also be incorporated into #VE handling in the future. |
@msft-jlange Quick update: I combined all 3 of your PRs (#461, #462, #463) and updated my stage2 changes accordingly. I was able to boot stage2 successfully. |
d8bef31
to
29e6967
Compare
|
29e6967
to
d70ba95
Compare
The `SVSMIOPort` and `NativeIOPort` objects are platform-specific, and thus they should be implemented in the platform abstraction instead of in common code. Furthermore, the console serial port object is common and need not be duplicated in every platform abstraction. Signed-off-by: Jon Lange <[email protected]>
The test serial port must use the same platform abstraction as the rest of the I/O port abstraction. Since serial port construction is now platform-specific, the construction is moved to the first use of the test serial port. The serial port cell is changed to an `Option` to simplify the synchronization of the dynamic initialization across consumers. Also, for better abstraction, the operation to obtain the test serial port doesn't emit a byte; it simply returns the port so the caller can write whatever it wants. Signed-off-by: Jon Lange <[email protected]>
d70ba95
to
b722a58
Compare
It compiles now. Hopefully it works too. |
Tested this PR on a TDP platform with #419 and it worked as expected. |
The
SVSMIOPort
andNativeIOPort
objects are platform-specific, and thus they should be implemented in the platform abstraction instead of in common code. Furthermore, the console serial port object is common and need not be duplicated in every platform abstraction.