Skip to content
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

Change *_reservation to take physaddr #676

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KotorinMinami
Copy link
Contributor

Fix #670, edit Sail's C language code so that the load_reservation and match_reservation functions can accept physaddr type parameters

@@ -68,3 +67,13 @@ struct zMcause {
extern struct zMcause zmcause, zscause;

extern mach_bits zminstret;

enum kind_zphysaddr { Kind_zphysaddr };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having to duplicate this sail-internal representation does not sound like a good idea to me. IMO the C callback should just use the underlying bits.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If/when we switch to the struct Model { #include "model.c" } trick then we won't have to do this. But I agree, it's too error-prone until it's actually checked by the compiler.

Copy link
Collaborator

@arichardson arichardson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this just makes it more difficult to read for no real gain. If we want to ensure that load_reservation takes a physaddr we should make it a sail function that calls the C function with the raw bits. Not sure this adds much value over the current physaddrbits though.

Copy link

github-actions bot commented Jan 9, 2025

Test Results

396 tests  ±0   396 ✅ ±0   0s ⏱️ ±0s
  4 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 5ecc9d5. ± Comparison against base commit 601f3d8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change load_reservation, match_reservation, etc. to take physaddr
3 participants