Issue is that x86 32-bit aligns to 4-bytes instead of 8-bytes so this patchset works around the issue and corrects the data returned in pps_fdata_compat.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -55,6 +55,12 @@ struct pps_ktime { · 54 unmodified lines | |||
| 55 | __s32 nsec; | 55 | __s32 nsec; |
| 56 | __u32 flags; | 56 | __u32 flags; |
| 57 | }; | 57 | }; |
| 58 | |||
| 59 | struct pps_ktime_compat { | ||
| 60 | __s64 sec; | ||
| 61 | __s32 nsec; | ||
| 62 | __u32 flags; | ||
| 63 | } __attribute__((packed, aligned(4))); | ||
| 58 | #define PPS_TIME_INVALID (1<<0) /* used to specify timeout==NULL */ | 64 | #define PPS_TIME_INVALID (1<<0) /* used to specify timeout==NULL */ |
| 59 | 65 | ||
| 60 | struct pps_kinfo { | 66 | struct pps_kinfo { |
| @@ -65,6 +71,14 @@ struct pps_kinfo { · 4 unmodified lines | |||
| 65 | int current_mode; /* current mode bits */ | 71 | int current_mode; /* current mode bits */ |
| 66 | }; | 72 | }; |
| 67 | 73 | ||
| 74 | struct pps_kinfo_compat { | ||
| 75 | __u32 assert_sequence; /* seq. num. of assert event */ | ||
| 76 | __u32 clear_sequence; /* seq. num. of clear event */ | ||
| 77 | struct pps_ktime_compat assert_tu; /* time of assert event */ | ||
| 78 | struct pps_ktime_compat clear_tu; /* time of clear event */ | ||
| 79 | int current_mode; /* current mode bits */ | ||
| 80 | }; | ||
| 81 | |||
| 68 | struct pps_kparams { | 82 | struct pps_kparams { |
| 69 | int api_version; /* API version # */ | 83 | int api_version; /* API version # */ |
| 70 | int mode; /* mode bits */ | 84 | int mode; /* mode bits */ |
| @@ -114,6 +128,11 @@ struct pps_fdata { · 43 unmodified lines | |||
| 114 | struct pps_ktime timeout; | 128 | struct pps_ktime timeout; |
| 115 | }; | 129 | }; |
| 116 | 130 | ||
| 131 | struct pps_fdata_compat { | ||
| 132 | struct pps_kinfo_compat info; | ||
| 133 | struct pps_ktime_compat timeout; | ||
| 134 | }; | ||
| 135 | |||
| 117 | struct pps_bind_args { | 136 | struct pps_bind_args { |
| 118 | int tsformat; /* format of time stamps */ | 137 | int tsformat; /* format of time stamps */ |
| 119 | int edge; /* selected event type */ | 138 | int edge; /* selected event type */ |