-
Notifications
You must be signed in to change notification settings - Fork 194
feat(opentmk): opentmk framework with first testcase #1210
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
6d32033
feat: opentmk init
mayank-microsoft 351199b
feat: added docs
mayank-microsoft 3e1673e
refactor(opentmk): interrupt handler doesn't need to save state for a…
mayank-microsoft 056bf7d
reafctor(opentmk): remove dead code
mayank-microsoft 6d37a84
chore: resolve PR feedback
mayank-microsoft 53e0da2
chore: resolve PR feedback
mayank-microsoft 7eb38ff
refactor: resolve PR feedback
mayank-microsoft 2d2aec4
reafactor: errors for hyper-v error handling
mayank-microsoft 4cd03a5
feat: add test for a negitive case where parition has not enabled VTL1
mayank-microsoft bb22270
docs: add documentation for structs
mayank-microsoft e9fef3a
rtc+broken misc test
mayank-microsoft 9a0ef26
clippy fixup
mayank-microsoft e02ee17
broken
mayank-microsoft 48d300a
chore: add tpm working
mayank-microsoft 7bdf91f
feat: add new cvm tests
mayank-microsoft 1104901
lint: add lints for imports
mayank-microsoft c0f3e0a
chore: resolve PR comments
mayank-microsoft 7f33bbd
chore: resolve PR comments
mayank-microsoft a49da94
feat: compiles on Arm64
mayank-microsoft 9bdf302
chore: resolve copilot comments
mayank-microsoft fc0b866
chore: remove default impl for channel
mayank-microsoft 7019671
cleanup
mayank-microsoft 7d70c67
fix: compiler error
mayank-microsoft 43e04f0
chore: add back features
mayank-microsoft 4560aa6
feat: add register intercept test
mayank-microsoft d28f9c3
lint: ran cargo fmt
mayank-microsoft 1b31943
fix: changes to make register intercepts CVM ready
mayank-microsoft a20e5cb
refactor: reduce number of cfgs
mayank-microsoft 84297d4
chore: resolve PR comments
mayank-microsoft c22989a
chore: pr comments resolve
mayank-microsoft 151ae4f
chore: resolve PR comment
mayank-microsoft 7f241aa
chore: resolve PR comments
mayank-microsoft f961d8a
chore: resolve PR comments
mayank-microsoft 63becb0
chore: adding reason for inline(never)
mayank-microsoft 2be9b2d
chore: update error description
mayank-microsoft cc9205d
chore: resolve PR comments
mayank-microsoft 93845da
chore: updates for clippy pass
mayank-microsoft 8c436ec
chore: unimplemented functions should not have irrelavant docs
mayank-microsoft 909f2b0
chore: depende on minimal_rt for aarch64 serial port communication
mayank-microsoft 66ee0b7
chore: resolve PR comments
mayank-microsoft 1d687da
chore: resolve PR comments
mayank-microsoft 119afb5
Merge branch 'main' into target-opentmk
mattkur c32ecbf
Merge branch 'main' into target-opentmk
mayank-microsoft 77e7129
Cargo.lock merge fix
mattkur 4105362
cleanup: remove files not required with the PR merged
mayank-microsoft ff51df4
chore: refactor for PR comments
mayank-microsoft a0d6037
chore: [WIP] flowey fixups
mayank-microsoft e67c794
chore: resolve lint errors
mayank-microsoft 96603fe
chore: resolve lint error
mayank-microsoft 3ca6418
build: fix failure fixes
mayank-microsoft c0f8aca
fix: build errors
mayank-microsoft b95eaf6
fix: nightly feature ci failures
mayank-microsoft b725ef5
fix: ci failures
mayank-microsoft 0952aec
fix: build failures
mayank-microsoft 19a7312
chore: resolve copilot comments
mayank-microsoft 1af6f82
Merge branch 'main' into target-opentmk
mayank-microsoft a61d548
chore: resolve copilot comments
mayank-microsoft 083a52f
fix: no_mangle should be unsafe
mayank-microsoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -186,20 +186,30 @@ impl<T> Receiver<T> { | |
| /// Tries to receive an element from the front of the queue while blocking | ||
| /// Returns Ok(value) if successful, Err(RecvError) otherwise | ||
| pub fn recv(&self) -> Result<T, RecvError> { | ||
| // Use a separate scope for the lock to ensure it's released promptly | ||
| let result = { | ||
| let mut buffer = self.inner.buffer.lock(); | ||
| buffer.pop_front() | ||
| }; | ||
| match result { | ||
| Some(val) => Ok(val), | ||
| None => { | ||
| // Check if there are any senders left | ||
| if self.inner.senders.load(Ordering::SeqCst) == 0 { | ||
| Err(RecvError::Disconnected) | ||
| } else { | ||
| Err(RecvError::Empty) | ||
| loop { | ||
| // Use a separate scope for the lock to ensure it's released promptly | ||
| let result = { | ||
| let mut buffer = self.inner.buffer.lock(); | ||
| buffer.pop_front() | ||
| }; | ||
| let r = match result { | ||
| Some(val) => Ok(val), | ||
| None => { | ||
| // Check if there are any senders left | ||
| if self.inner.senders.load(Ordering::SeqCst) == 0 { | ||
| Err(RecvError::Disconnected) | ||
| } else { | ||
| Err(RecvError::Empty) | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| if let Err(err) = r { | ||
| if err != RecvError::Empty { | ||
| return Err(err); | ||
| } | ||
| } else { | ||
| return r; | ||
| } | ||
| } | ||
| } | ||
|
Comment on lines
+186
to
+215
|
||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't no_mangle an unsafe attribute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, read up more about it now. with edition 2024, it should be marked unsafe.