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

Fix nonexistent sync_file_range2 syscall bug in aarch64,loongarch64 and riscv* #55

Merged
merged 1 commit into from
Sep 20, 2024
Merged
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
4 changes: 2 additions & 2 deletions src/arch/aarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ syscall_enum! {
fsync = 82,
/// See [fdatasync(2)](https://man7.org/linux/man-pages/man2/fdatasync.2.html) for more info on this syscall.
fdatasync = 83,
/// See [sync_file_range2(2)](https://man7.org/linux/man-pages/man2/sync_file_range2.2.html) for more info on this syscall.
sync_file_range2 = 84,
/// See [sync_file_range(2)](https://man7.org/linux/man-pages/man2/sync_file_range.2.html) for more info on this syscall.
sync_file_range = 84,
/// See [timerfd_create(2)](https://man7.org/linux/man-pages/man2/timerfd_create.2.html) for more info on this syscall.
timerfd_create = 85,
/// See [timerfd_settime(2)](https://man7.org/linux/man-pages/man2/timerfd_settime.2.html) for more info on this syscall.
Expand Down
4 changes: 2 additions & 2 deletions src/arch/loongarch64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ syscall_enum! {
fsync = 82,
/// See [fdatasync(2)](https://man7.org/linux/man-pages/man2/fdatasync.2.html) for more info on this syscall.
fdatasync = 83,
/// See [sync_file_range2(2)](https://man7.org/linux/man-pages/man2/sync_file_range2.2.html) for more info on this syscall.
sync_file_range2 = 84,
/// See [sync_file_range(2)](https://man7.org/linux/man-pages/man2/sync_file_range.2.html) for more info on this syscall.
sync_file_range = 84,
/// See [timerfd_create(2)](https://man7.org/linux/man-pages/man2/timerfd_create.2.html) for more info on this syscall.
timerfd_create = 85,
/// See [timerfd_settime(2)](https://man7.org/linux/man-pages/man2/timerfd_settime.2.html) for more info on this syscall.
Expand Down
4 changes: 2 additions & 2 deletions src/arch/riscv32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ syscall_enum! {
fsync = 82,
/// See [fdatasync(2)](https://man7.org/linux/man-pages/man2/fdatasync.2.html) for more info on this syscall.
fdatasync = 83,
/// See [sync_file_range2(2)](https://man7.org/linux/man-pages/man2/sync_file_range2.2.html) for more info on this syscall.
sync_file_range2 = 84,
/// See [sync_file_range(2)](https://man7.org/linux/man-pages/man2/sync_file_range.2.html) for more info on this syscall.
sync_file_range = 84,
/// See [timerfd_create(2)](https://man7.org/linux/man-pages/man2/timerfd_create.2.html) for more info on this syscall.
timerfd_create = 85,
/// See [timerfd_settime(2)](https://man7.org/linux/man-pages/man2/timerfd_settime.2.html) for more info on this syscall.
Expand Down
4 changes: 2 additions & 2 deletions src/arch/riscv64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ syscall_enum! {
fsync = 82,
/// See [fdatasync(2)](https://man7.org/linux/man-pages/man2/fdatasync.2.html) for more info on this syscall.
fdatasync = 83,
/// See [sync_file_range2(2)](https://man7.org/linux/man-pages/man2/sync_file_range2.2.html) for more info on this syscall.
sync_file_range2 = 84,
/// See [sync_file_range(2)](https://man7.org/linux/man-pages/man2/sync_file_range.2.html) for more info on this syscall.
sync_file_range = 84,
/// See [timerfd_create(2)](https://man7.org/linux/man-pages/man2/timerfd_create.2.html) for more info on this syscall.
timerfd_create = 85,
/// See [timerfd_settime(2)](https://man7.org/linux/man-pages/man2/timerfd_settime.2.html) for more info on this syscall.
Expand Down
26 changes: 17 additions & 9 deletions syscalls-gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ lazy_static! {
//"arch/arm64/include/asm/unistd.h",
],
blocklist: &[
// This syscall was renamed to `sync_file_range2` on aarch64.
// Thus, only `sync_file_range2` should appear in the syscall
// table.
"sync_file_range",
// NOTE: On aarch64 platforms, `sync_file_range2` only provides
// compatibility for aarch32.
"sync_file_range2",
],
}),
Source::Table(Table {
Expand Down Expand Up @@ -88,31 +87,40 @@ lazy_static! {
path: "arch/s390/kernel/syscalls/syscall.tbl",
abi: &[ABI::COMMON, ABI::B64],
}),
// For riscv32 and riscv64, see aarch64's explanation.
Source::Header(Header {
arch: "riscv32",
headers: &[
"include/uapi/asm-generic/unistd.h",
"arch/riscv/include/uapi/asm/unistd.h",
],
blocklist: &["sync_file_range"],
blocklist: &[
// It doesn't have defines `__NR_sync_file_range2` or
// `__ARCH_WANT_SYNC_FILE_RANGE2` in
// `arch/riscv/include/uapi/asm/unistd.h` header file
"sync_file_range2",
],
}),
Source::Header(Header {
arch: "riscv64",
headers: &[
"include/uapi/asm-generic/unistd.h",
"arch/riscv/include/uapi/asm/unistd.h",
],
blocklist: &["sync_file_range"],
blocklist: &[
// For riscv64, see riscv32's explanation.
"sync_file_range2",
],
}),
// For loongarch64, see aarch64's explanation.
Source::Header(Header {
arch: "loongarch64",
headers: &[
"include/uapi/asm-generic/unistd.h",
"arch/loongarch/include/uapi/asm/unistd.h",
],
blocklist: &["sync_file_range"],
blocklist: &[
// For loongarch64, see riscv32's explanation.
"sync_file_range2",
],
}),
];
}
Expand Down
Loading