From f83c7923f956328a022cddcfcd2d13d797a22a63 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Wed, 24 Aug 2016 14:49:18 -0700 Subject: [PATCH] Update for kernel headers v4.7.2. The new uapi kernel headers added a new SEGV reason code, so add it to the tombstone code. Update sync.c to include the needed data structures itself. Someone else will be fixing this to work on old versus new kernels. Change-Id: Icb27713ea38a20003c7671a9bca262eebd96099b --- debuggerd/tombstone.cpp | 7 ++++++- libsync/sync.c | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/debuggerd/tombstone.cpp b/debuggerd/tombstone.cpp index 3ddd2b0aa..850676529 100644 --- a/debuggerd/tombstone.cpp +++ b/debuggerd/tombstone.cpp @@ -135,9 +135,14 @@ static const char* get_sigcode(int signo, int code) { case SEGV_ACCERR: return "SEGV_ACCERR"; #if defined(SEGV_BNDERR) case SEGV_BNDERR: return "SEGV_BNDERR"; +#endif +#if defined(SEGV_PKUERR) + case SEGV_PKUERR: return "SEGV_PKUERR"; #endif } -#if defined(SEGV_BNDERR) +#if defined(SEGV_PKUERR) + static_assert(NSIGSEGV == SEGV_PKUERR, "missing SEGV_* si_code"); +#elif defined(SEGV_BNDERR) static_assert(NSIGSEGV == SEGV_BNDERR, "missing SEGV_* si_code"); #else static_assert(NSIGSEGV == SEGV_ACCERR, "missing SEGV_* si_code"); diff --git a/libsync/sync.c b/libsync/sync.c index d73bb111c..169dc3678 100644 --- a/libsync/sync.c +++ b/libsync/sync.c @@ -21,13 +21,27 @@ #include #include -#include #include #include #include #include +#include + +// The sync code is undergoing a major change. Add enough in to get +// everything to compile wih the latest uapi headers. +struct sync_merge_data { + int32_t fd2; + char name[32]; + int32_t fence; +}; + +#define SYNC_IOC_MAGIC '>' +#define SYNC_IOC_WAIT _IOW(SYNC_IOC_MAGIC, 0, __s32) +#define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 1, struct sync_merge_data) +#define SYNC_IOC_FENCE_INFO _IOWR(SYNC_IOC_MAGIC, 2, struct sync_fence_info_data) + int sync_wait(int fd, int timeout) { __s32 to = timeout;