Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions src/fuchsia/aarch64.rs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Commit "fuchsia: fix bits/signal.h types": the aarch64 and riscv64 definitions look new, please make sure the commit message is accurate

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Commit "fuchsia: fix bits/signal.h types": the commit message says "Architecture-specific types were wrongly defined. This is fixed now.", and a few other commits do something similar. That doesn't really say what changed - a message that describes the action helps review so we know what to look for, e.g.

Replace the x86_64 mcontext_t opaque field with gregs/fregs, matching upstream definitions.

(https://docs.kernel.org/process/submitting-patches.html#describe-your-changes has some good guidelines here. Not all of it is relevant here of course, but at least the "Describe user-visible impact" and "Describe your changes in imperative mood" bits are great guidelines for all commit messages.)

Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use crate::off_t;
use crate::prelude::*;

#[deprecated(
since = "0.2.187",
note = "This type doesn't exist. The Fuchsia SDK doesn't ship it."
)]
pub type __u64 = c_ulonglong;
pub type wchar_t = u32;
pub type nlink_t = c_ulong;
pub type blksize_t = c_long;

s! {
pub struct stat {
Expand All @@ -15,10 +16,10 @@ s! {
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
__pad0: Padding<c_ulong>,
__pad: Padding<c_ulong>,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
__pad1: Padding<c_int>,
__pad2: Padding<c_int>,
pub st_blocks: crate::blkcnt_t,
pub st_atime: crate::time_t,
pub st_atime_nsec: c_long,
Expand All @@ -29,6 +30,10 @@ s! {
__unused: Padding<[c_uint; 2]>,
}

#[deprecated(
since = "0.2.187",
note = "This type doesn't exist. It's not part of the Fuchsia SDK."
)]
pub struct stat64 {
pub st_dev: crate::dev_t,
pub st_ino: crate::ino_t,
Expand All @@ -51,6 +56,10 @@ s! {
__unused: Padding<[c_uint; 2]>,
}

#[deprecated(
since = "0.2.187",
note = "This type doesn't exist. It's not part of the Fuchsia SDK."
)]
pub struct ipc_perm {
pub __ipc_perm_key: crate::key_t,
pub uid: crate::uid_t,
Expand All @@ -62,6 +71,25 @@ s! {
__unused1: Padding<c_ulong>,
__unused2: Padding<c_ulong>,
}

// FIXME(f128): __reserved is meant to be an array of `long double`s. That
// requires native support for `f128`. This is currently missing.
pub struct mcontext_t {
pub fault_address: c_ulong,
pub regs: [c_ulong; 31],
pub sp: c_ulong,
pub pc: c_ulong,
pub pstate: c_ulong,
__reserved: Padding<[i128; 256]>,
}

pub struct ucontext_t {
pub uc_flags: c_ulong,
pub uc_link: *mut crate::ucontext_t,
pub uc_stack: crate::stack_t,
pub uc_sigmask: crate::sigset_t,
pub uc_mcontext: crate::mcontext_t,
}
}

// From https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/third_party/ulib/musl/include/bits/signal.h;l=20-21;drc=0827b18ab9540c46f8037f407d17ea15a79e9ba7
Expand Down
Loading
Loading