Skip to content

Commit b778e8f

Browse files
committed
constants have different values on powerpc
1 parent 1bc266a commit b778e8f

File tree

1 file changed

+43
-19
lines changed
  • src/unix/linux_like/linux

1 file changed

+43
-19
lines changed

src/unix/linux_like/linux/mod.rs

+43-19
Original file line numberDiff line numberDiff line change
@@ -3736,25 +3736,49 @@ pub const HWTSTAMP_FILTER_NTP_ALL: ::c_uint = 15;
37363736
// linux/ptp_clock.h
37373737
pub const PTP_MAX_SAMPLES: ::c_uint = 25;
37383738

3739-
pub const PTP_CLOCK_GETCAPS: ::c_uint = 0x80503d01;
3740-
pub const PTP_EXTTS_REQUEST: ::c_uint = 0x40103d02;
3741-
pub const PTP_PEROUT_REQUEST: ::c_uint = 0x40383d03;
3742-
pub const PTP_ENABLE_PPS: ::c_uint = 0x40043d04;
3743-
pub const PTP_SYS_OFFSET: ::c_uint = 0x43403d05;
3744-
pub const PTP_PIN_GETFUNC: ::c_uint = 0xc0603d06;
3745-
pub const PTP_PIN_SETFUNC: ::c_uint = 0x40603d07;
3746-
pub const PTP_SYS_OFFSET_PRECISE: ::c_uint = 0xc0403d08;
3747-
pub const PTP_SYS_OFFSET_EXTENDED: ::c_uint = 0xc4c03d09;
3748-
3749-
pub const PTP_CLOCK_GETCAPS2: ::c_uint = 0x80503d0a;
3750-
pub const PTP_EXTTS_REQUEST2: ::c_uint = 0x40103d0b;
3751-
pub const PTP_PEROUT_REQUEST2: ::c_uint = 0x40383d0c;
3752-
pub const PTP_ENABLE_PPS2: ::c_uint = 0x40043d0d;
3753-
pub const PTP_SYS_OFFSET2: ::c_uint = 0x43403d0e;
3754-
pub const PTP_PIN_GETFUNC2: ::c_uint = 0xc0603d0f;
3755-
pub const PTP_PIN_SETFUNC2: ::c_uint = 0x40603d10;
3756-
pub const PTP_SYS_OFFSET_PRECISE2: ::c_uint = 0xc0403d11;
3757-
pub const PTP_SYS_OFFSET_EXTENDED2: ::c_uint = 0xc4c03d12;
3739+
cfg_if! {
3740+
if #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))] {
3741+
pub const PTP_CLOCK_GETCAPS: ::c_uint = 0x40503d01;
3742+
pub const PTP_EXTTS_REQUEST: ::c_uint = 0x80103d02;
3743+
pub const PTP_PEROUT_REQUEST: ::c_uint = 0x80383d03;
3744+
pub const PTP_ENABLE_PPS: ::c_uint = 0x80043d04;
3745+
pub const PTP_SYS_OFFSET: ::c_uint = 0x83403d05;
3746+
pub const PTP_PIN_GETFUNC: ::c_uint = 0xc0603d06;
3747+
pub const PTP_PIN_SETFUNC: ::c_uint = 0x80603d07;
3748+
pub const PTP_SYS_OFFSET_PRECISE: ::c_uint = 0xc0403d08;
3749+
pub const PTP_SYS_OFFSET_EXTENDED: ::c_uint = 0xc4c03d09;
3750+
3751+
pub const PTP_CLOCK_GETCAPS2: ::c_uint = 0x40503d0a;
3752+
pub const PTP_EXTTS_REQUEST2: ::c_uint = 0x80103d0b;
3753+
pub const PTP_PEROUT_REQUEST2: ::c_uint = 0x80383d0c;
3754+
pub const PTP_ENABLE_PPS2: ::c_uint = 0x80043d0d;
3755+
pub const PTP_SYS_OFFSET2: ::c_uint = 0x83403d0e;
3756+
pub const PTP_PIN_GETFUNC2: ::c_uint = 0xc0603d0f;
3757+
pub const PTP_PIN_SETFUNC2: ::c_uint = 0x80603d10;
3758+
pub const PTP_SYS_OFFSET_PRECISE2: ::c_uint = 0xc0403d11;
3759+
pub const PTP_SYS_OFFSET_EXTENDED2: ::c_uint = 0xc4c03d12;
3760+
} else {
3761+
pub const PTP_CLOCK_GETCAPS: ::c_uint = 0x80503d01;
3762+
pub const PTP_EXTTS_REQUEST: ::c_uint = 0x40103d02;
3763+
pub const PTP_PEROUT_REQUEST: ::c_uint = 0x40383d03;
3764+
pub const PTP_ENABLE_PPS: ::c_uint = 0x40043d04;
3765+
pub const PTP_SYS_OFFSET: ::c_uint = 0x43403d05;
3766+
pub const PTP_PIN_GETFUNC: ::c_uint = 0xc0603d06;
3767+
pub const PTP_PIN_SETFUNC: ::c_uint = 0x40603d07;
3768+
pub const PTP_SYS_OFFSET_PRECISE: ::c_uint = 0xc0403d08;
3769+
pub const PTP_SYS_OFFSET_EXTENDED: ::c_uint = 0xc4c03d09;
3770+
3771+
pub const PTP_CLOCK_GETCAPS2: ::c_uint = 0x80503d0a;
3772+
pub const PTP_EXTTS_REQUEST2: ::c_uint = 0x40103d0b;
3773+
pub const PTP_PEROUT_REQUEST2: ::c_uint = 0x40383d0c;
3774+
pub const PTP_ENABLE_PPS2: ::c_uint = 0x40043d0d;
3775+
pub const PTP_SYS_OFFSET2: ::c_uint = 0x43403d0e;
3776+
pub const PTP_PIN_GETFUNC2: ::c_uint = 0xc0603d0f;
3777+
pub const PTP_PIN_SETFUNC2: ::c_uint = 0x40603d10;
3778+
pub const PTP_SYS_OFFSET_PRECISE2: ::c_uint = 0xc0403d11;
3779+
pub const PTP_SYS_OFFSET_EXTENDED2: ::c_uint = 0xc4c03d12;
3780+
}
3781+
}
37583782

37593783
pub const PTP_PF_NONE: ::c_uint = 0;
37603784
pub const PTP_PF_EXTTS: ::c_uint = 1;

0 commit comments

Comments
 (0)