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

netbsd adding mcontext related data for riscv64 #3468

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

devnexen
Copy link
Contributor

@devnexen devnexen commented Dec 9, 2023

@rustbot
Copy link
Collaborator

rustbot commented Dec 9, 2023

r? @JohnTitor

(rustbot has picked a reviewer for you, use r? to override)

@bors
Copy link
Contributor

bors commented Jan 8, 2024

☔ The latest upstream changes (presumably #3525) made this pull request unmergeable. Please resolve the merge conflicts.

@JohnTitor
Copy link
Member

Could you resolve conflicts and remove libc_union cfg?

#[cfg(not(libc_union))]
pub __qregs: [u128; 1],
Copy link
Member

Choose a reason for hiding this comment

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

The main branch doesn't need cfg anymore.

Comment on lines 54 to 60
if #[cfg(libc_const_size_of)] {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
} else {
#[doc(hidden)]
pub const _ALIGNBYTES: usize = 8 - 1;
}
Copy link
Member

Choose a reason for hiding this comment

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

pub(crate) can be used I think.

@devnexen devnexen force-pushed the netbsd_reg_update2 branch 3 times, most recently from 21e8f49 to 0b726ea Compare January 20, 2024 15:33
@tgross35
Copy link
Contributor

This probably needs a rebase at this point, but otherwise seems like it was waiting for review.

@rustbot review

@tgross35
Copy link
Contributor

Can this just be moved to netbsd/mod.rs? I'm not sure what is platform-specific here, if you have a header link that would help.

This should also get the semver test

@devnexen
Copy link
Contributor Author

well ucontext could possibly be make common but not mcontext which is very architecture dependent.

@devnexen devnexen force-pushed the netbsd_reg_update2 branch 3 times, most recently from c4957c2 to 0cf7b81 Compare August 29, 2024 22:49
Copy link
Contributor

@tgross35 tgross35 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 the trait should be dropped as mentioned. Otherwise lgtm, please add sources to the PR description.

Comment on lines 26 to 34
impl PartialEq for __c_anonymous__fpreg {
fn eq(&self, other: &__c_anonymous__fpreg) -> bool {
unsafe {
self.u_u64 == other.u_u64
|| self.u_ud == other.u_ud
}
}
}
impl Eq for __c_anonymous__fpreg {}
Copy link
Contributor

Choose a reason for hiding this comment

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

These should probably just be dropped, it would be weird to use float equality to compare integers.

@devnexen
Copy link
Contributor Author

@rustbot review

Comment on lines 19 to 24
pub union __c_anonymous__fpreg {
pub u_u64: u64,
pub u_d: ::c_double,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, one other thing - should this just be called __fpreg? From https://github.com/NetBSD/src/blob/0465e5c825effb130eca95499f5ac6454fe0d5ab/sys/arch/riscv/include/mcontext.h#L44C7-L47.

It would probably also be good to define

pub const _NGREG: usize = 32;
pub const _NFREG: usize = 33;
pub type __gregset_t = [__greg_t; _NGREG];
pub type __fregset_t = [__fpreg; _NFREG];

and then use those in mcontext

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Thanks!

@tgross35 tgross35 enabled auto-merge November 19, 2024 05:58
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Nov 19, 2024
@tgross35 tgross35 added this pull request to the merge queue Nov 19, 2024
Merged via the queue into rust-lang:main with commit 0569274 Nov 19, 2024
45 checks passed
@tgross35 tgross35 mentioned this pull request Nov 21, 2024
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-riscv O-unix S-waiting-on-review stable-applied This PR has been cherry-picked to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants