summaryrefslogtreecommitdiff
path: root/include/uapi/linux/pps.h
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-03-11 02:19:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-03-17 09:10:49 +0300
commitc2a49fe8eeef301b40d0c8065d817c5425d31b11 (patch)
tree1b0c80d3dab868c633fb80cfffbacab684fb8277 /include/uapi/linux/pps.h
parent2ac6665701afd1946e1c93bd1308e97fd2b0ce10 (diff)
downloadlinux-c2a49fe8eeef301b40d0c8065d817c5425d31b11.tar.xz
pps: fix padding issue with PPS_FETCH for ioctl_compat
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. Acked-by: Rodolfo Giometti <giometti@enneenne.com> Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi/linux/pps.h')
-rw-r--r--include/uapi/linux/pps.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/uapi/linux/pps.h b/include/uapi/linux/pps.h
index a9bb1d93451a..c1cb3825a8bc 100644
--- a/include/uapi/linux/pps.h
+++ b/include/uapi/linux/pps.h
@@ -55,6 +55,12 @@ struct pps_ktime {
__s32 nsec;
__u32 flags;
};
+
+struct pps_ktime_compat {
+ __s64 sec;
+ __s32 nsec;
+ __u32 flags;
+} __attribute__((packed, aligned(4)));
#define PPS_TIME_INVALID (1<<0) /* used to specify timeout==NULL */
struct pps_kinfo {
@@ -65,6 +71,14 @@ struct pps_kinfo {
int current_mode; /* current mode bits */
};
+struct pps_kinfo_compat {
+ __u32 assert_sequence; /* seq. num. of assert event */
+ __u32 clear_sequence; /* seq. num. of clear event */
+ struct pps_ktime_compat assert_tu; /* time of assert event */
+ struct pps_ktime_compat clear_tu; /* time of clear event */
+ int current_mode; /* current mode bits */
+};
+
struct pps_kparams {
int api_version; /* API version # */
int mode; /* mode bits */
@@ -114,6 +128,11 @@ struct pps_fdata {
struct pps_ktime timeout;
};
+struct pps_fdata_compat {
+ struct pps_kinfo_compat info;
+ struct pps_ktime_compat timeout;
+};
+
struct pps_bind_args {
int tsformat; /* format of time stamps */
int edge; /* selected event type */