system/core
修訂 | 568089f28a635438d34e0073ea44ac08b32f56ab (tree) |
---|---|
時間 | 2017-08-08 17:13:14 |
作者 | Christopher Ferris <cferris@goog...> |
Commiter | Chih-Wei Huang |
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
@@ -131,8 +131,13 @@ static const char* get_sigcode(int signo, int code) { | ||
131 | 131 | #if defined(SEGV_BNDERR) |
132 | 132 | case SEGV_BNDERR: return "SEGV_BNDERR"; |
133 | 133 | #endif |
134 | +#if defined(SEGV_PKUERR) | |
135 | + case SEGV_PKUERR: return "SEGV_PKUERR"; | |
136 | +#endif | |
134 | 137 | } |
135 | -#if defined(SEGV_BNDERR) | |
138 | +#if defined(SEGV_PKUERR) | |
139 | + static_assert(NSIGSEGV == SEGV_PKUERR, "missing SEGV_* si_code"); | |
140 | +#elif defined(SEGV_BNDERR) | |
136 | 141 | static_assert(NSIGSEGV == SEGV_BNDERR, "missing SEGV_* si_code"); |
137 | 142 | #else |
138 | 143 | static_assert(NSIGSEGV == SEGV_ACCERR, "missing SEGV_* si_code"); |
@@ -21,13 +21,27 @@ | ||
21 | 21 | #include <stdint.h> |
22 | 22 | #include <string.h> |
23 | 23 | |
24 | -#include <linux/sync.h> | |
25 | 24 | #include <linux/sw_sync.h> |
26 | 25 | |
27 | 26 | #include <sys/ioctl.h> |
28 | 27 | #include <sys/stat.h> |
29 | 28 | #include <sys/types.h> |
30 | 29 | |
30 | +#include <sync/sync.h> | |
31 | + | |
32 | +// The sync code is undergoing a major change. Add enough in to get | |
33 | +// everything to compile wih the latest uapi headers. | |
34 | +struct sync_merge_data { | |
35 | + int32_t fd2; | |
36 | + char name[32]; | |
37 | + int32_t fence; | |
38 | +}; | |
39 | + | |
40 | +#define SYNC_IOC_MAGIC '>' | |
41 | +#define SYNC_IOC_WAIT _IOW(SYNC_IOC_MAGIC, 0, __s32) | |
42 | +#define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 1, struct sync_merge_data) | |
43 | +#define SYNC_IOC_FENCE_INFO _IOWR(SYNC_IOC_MAGIC, 2, struct sync_fence_info_data) | |
44 | + | |
31 | 45 | int sync_wait(int fd, int timeout) |
32 | 46 | { |
33 | 47 | __s32 to = timeout; |