Commit b6709dfe authored by Torne (Richard Coles)'s avatar Torne (Richard Coles) Committed by Commit Bot

Remove support for obsolete bionic versions.

The supported version of the Android NDK now provides sys/ucontext.h for
all architectures, and we no longer need to provide our own definitions.

Keep the ones used by PNaCl but update the defines to no longer use them
on Android.

Bug: 437330
Change-Id: Ia46c746b17b72261842284d4fed3772fea3a96ef
Reviewed-on: https://chromium-review.googlesource.com/1252243Reviewed-by: default avatarChris Palmer <palmer@chromium.org>
Commit-Queue: Richard Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595181}
parent 4eb88fc4
......@@ -417,7 +417,6 @@ component("sandbox_services") {
source_set("sandbox_services_headers") {
sources = [
"system_headers/arm64_linux_syscalls.h",
"system_headers/arm64_linux_ucontext.h",
"system_headers/arm_linux_syscalls.h",
"system_headers/arm_linux_ucontext.h",
"system_headers/i386_linux_ucontext.h",
......@@ -429,12 +428,9 @@ source_set("sandbox_services_headers") {
"system_headers/linux_time.h",
"system_headers/linux_ucontext.h",
"system_headers/mips64_linux_syscalls.h",
"system_headers/mips64_linux_ucontext.h",
"system_headers/mips_linux_syscalls.h",
"system_headers/mips_linux_ucontext.h",
"system_headers/x86_32_linux_syscalls.h",
"system_headers/x86_64_linux_syscalls.h",
"system_headers/x86_64_linux_ucontext.h",
]
}
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_UCONTEXT_H_
#define SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_UCONTEXT_H_
#if !defined(__BIONIC_HAVE_UCONTEXT_T)
#include <asm/sigcontext.h>
#include <signal.h>
#include <stdint.h>
// We also need greg_t for the sandbox, include it in this header as well.
typedef uint64_t greg_t;
struct ucontext_t {
unsigned long uc_flags;
struct ucontext* uc_link;
stack_t uc_stack;
sigset_t uc_sigmask;
/* glibc uses a 1024-bit sigset_t */
uint8_t unused[1024 / 8 - sizeof(sigset_t)];
/* last for future expansion */
struct sigcontext uc_mcontext;
};
#else
#include <sys/ucontext.h>
#endif // __BIONIC_HAVE_UCONTEXT_T
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_UCONTEXT_H_
......@@ -7,10 +7,6 @@
#include <stddef.h>
#if !defined(__BIONIC_HAVE_UCONTEXT_T)
#if !defined(__native_client_nonsfi__)
#include <asm/sigcontext.h>
#else
// In PNaCl toolchain, sigcontext and stack_t is not defined. So here declare
// them.
struct sigcontext {
......@@ -43,7 +39,6 @@ typedef struct sigaltstack {
size_t ss_size;
} stack_t;
#endif
// We also need greg_t for the sandbox, include it in this header as well.
typedef unsigned long greg_t;
......@@ -62,8 +57,4 @@ typedef struct ucontext {
unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
} ucontext_t;
#else
#include <sys/ucontext.h>
#endif // __BIONIC_HAVE_UCONTEXT_T
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM_LINUX_UCONTEXT_H_
......@@ -8,22 +8,15 @@
#include <stddef.h>
#include <stdint.h>
// We do something compatible with glibc. Hopefully, at some point Android will
// provide that for us, and __BIONIC_HAVE_UCONTEXT_T should be defined.
// This is mostly copied from breakpad (common/android/include/sys/ucontext.h),
// except we do use sigset_t for uc_sigmask instead of a custom type.
#if !defined(__BIONIC_HAVE_UCONTEXT_T)
#if !defined(__native_client_nonsfi__)
#include <asm/sigcontext.h>
#else
// In PNaCl toolchain, sigcontext is not defined. So here declare it.
typedef struct sigaltstack {
void* ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
#endif
/* 80-bit floating-point register */
struct _libc_fpreg {
......@@ -89,8 +82,4 @@ typedef struct ucontext {
struct _libc_fpstate __fpregs_mem;
} ucontext_t;
#else
#include <sys/ucontext.h>
#endif // __BIONIC_HAVE_UCONTEXT_T
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_ANDROID_I386_UCONTEXT_H_
......@@ -108,11 +108,6 @@ static_assert(LINUX_SIG_DFL == SIG_DFL, "LINUX_SIG_DFL == SIG_DFL");
typedef siginfo_t LinuxSigInfo;
#if defined(__ANDROID__)
// Android's signal.h doesn't define ucontext etc.
#include "sandbox/linux/system_headers/linux_ucontext.h"
#endif // defined(__ANDROID__)
#endif // !defined(__native_client_nonsfi__)
// struct sigset_t is different size in PNaCl from the Linux's.
......
......@@ -5,26 +5,18 @@
#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_UCONTEXT_H_
#define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_UCONTEXT_H_
#if defined(__ANDROID__) || defined(__native_client_nonsfi__)
#if defined(__native_client_nonsfi__)
#if defined(__arm__)
#include "sandbox/linux/system_headers/arm_linux_ucontext.h"
#elif defined(__i386__)
#include "sandbox/linux/system_headers/i386_linux_ucontext.h"
#elif defined(__x86_64__)
#include "sandbox/linux/system_headers/x86_64_linux_ucontext.h"
#elif defined(__mips32__)
#include "sandbox/linux/system_headers/mips_linux_ucontext.h"
#elif defined(__mips64__)
#include "sandbox/linux/system_headers/mips64_linux_ucontext.h"
#elif defined(__aarch64__)
#include "sandbox/linux/system_headers/arm64_linux_ucontext.h"
#else
#error "No support for your architecture in Android or PNaCl header"
#error "No support for your architecture in PNaCl header"
#endif
#else // defined(__ANDROID__) || defined(__native_client_nonsfi__)
#error "The header file included on non Android and non PNaCl."
#endif // defined(__ANDROID__) || defined(__native_client_nonsfi__)
#else // defined(__native_client_nonsfi__)
#error "The header file included on non PNaCl."
#endif // defined(__native_client_nonsfi__)
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_UCONTEXT_H_
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_UCONTEXT_H_
#define SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_UCONTEXT_H_
#include <stdint.h>
// This is mostly copied from breakpad (common/android/include/sys/ucontext.h),
// except we do use sigset_t for uc_sigmask instead of a custom type.
#if !defined(__BIONIC_HAVE_UCONTEXT_T)
// Ensure that 'stack_t' is defined.
#include <asm/signal.h>
// We also need greg_t for the sandbox, include it in this header as well.
typedef unsigned long greg_t;
typedef struct {
uint64_t gregs[32];
uint64_t fpregs[32];
uint64_t mdhi;
uint64_t hi1;
uint64_t hi2;
uint64_t hi3;
uint64_t mdlo;
uint64_t lo1;
uint64_t lo2;
uint64_t lo3;
uint64_t pc;
uint32_t fpc_csr;
uint32_t used_math;
uint32_t dsp;
uint32_t reserved;
} mcontext_t;
typedef struct ucontext {
uint32_t uc_flags;
struct ucontext* uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
sigset_t uc_sigmask;
// Other fields are not used by Google Breakpad. Don't define them.
} ucontext_t;
#else
#include <sys/ucontext.h>
#endif // __BIONIC_HAVE_UCONTEXT_T
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_UCONTEXT_H_
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_UCONTEXT_H_
#define SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_UCONTEXT_H_
#include <stdint.h>
// This is mostly copied from breakpad (common/android/include/sys/ucontext.h),
// except we do use sigset_t for uc_sigmask instead of a custom type.
#if !defined(__BIONIC_HAVE_UCONTEXT_T)
// Ensure that 'stack_t' is defined.
#include <asm/signal.h>
// We also need greg_t for the sandbox, include it in this header as well.
typedef unsigned long greg_t;
typedef struct {
uint32_t regmask;
uint32_t status;
uint64_t pc;
uint64_t gregs[32];
uint64_t fpregs[32];
uint32_t acx;
uint32_t fpc_csr;
uint32_t fpc_eir;
uint32_t used_math;
uint32_t dsp;
uint64_t mdhi;
uint64_t mdlo;
uint32_t hi1;
uint32_t lo1;
uint32_t hi2;
uint32_t lo2;
uint32_t hi3;
uint32_t lo3;
} mcontext_t;
typedef struct ucontext {
uint32_t uc_flags;
struct ucontext* uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
sigset_t uc_sigmask;
// Other fields are not used by Google Breakpad. Don't define them.
} ucontext_t;
#else
#include <sys/ucontext.h>
#endif // __BIONIC_HAVE_UCONTEXT_T
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_UCONTEXT_H_
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_UCONTEXT_H_
#define SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_UCONTEXT_H_
#include <stdint.h>
// We do something compatible with glibc. Hopefully, at some point Android will
// provide that for us, and __BIONIC_HAVE_UCONTEXT_T should be defined.
// Spec:
// http://refspecs.linuxfoundation.org/LSB_4.1.0/LSB-Core-AMD64/LSB-Core-AMD64/libc-ddefs.html#AEN5668
#if !defined(__BIONIC_HAVE_UCONTEXT_T)
#include <asm/sigcontext.h>
struct _libc_fpxreg {
unsigned short significand[4];
unsigned short exponent;
unsigned short padding[3];
};
struct _libc_xmmreg {
uint32_t element[4];
};
struct _libc_fpstate {
uint16_t cwd;
uint16_t swd;
uint16_t twd;
uint16_t fop;
uint64_t rip;
uint64_t rdp;
uint32_t mxcsr;
uint32_t mxcsr_mask;
struct _libc_fpxreg _st[8];
struct _libc_xmmreg _xmm[16];
uint32_t padding[24];
};
typedef uint64_t greg_t;
typedef struct {
greg_t gregs[23];
struct _libc_fpstate* fpregs;
unsigned long __reserved1[8];
} mcontext_t;
enum {
REG_R8 = 0,
REG_R9,
REG_R10,
REG_R11,
REG_R12,
REG_R13,
REG_R14,
REG_R15,
REG_RDI,
REG_RSI,
REG_RBP,
REG_RBX,
REG_RDX,
REG_RAX,
REG_RCX,
REG_RSP,
REG_RIP,
REG_EFL,
REG_CSGSFS,
REG_ERR,
REG_TRAPNO,
REG_OLDMASK,
REG_CR2,
NGREG,
};
typedef struct ucontext {
unsigned long uc_flags;
struct ucontext* uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
sigset_t uc_sigmask;
struct _libc_fpstate __fpregs_mem;
} ucontext_t;
#else
#include <sys/ucontext.h>
#endif // __BIONIC_HAVE_UCONTEXT_T
#endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_UCONTEXT_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment