Tamas Berghammer | 1e209fc | 2015-03-13 11:36:47 +0000 | [diff] [blame] | 1 | //===-- Procfs.h ---------------------------------------------- -*- C++ -*-===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Tamas Berghammer | 1e209fc | 2015-03-13 11:36:47 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | // source/Plugins/Process/Linux/Procfs.h defines the symbols we need from |
| 10 | // sys/procfs.h on Android/Linux for all supported architectures. |
| 11 | |
| 12 | #include <sys/ptrace.h> |
| 13 | |
| 14 | #ifdef __ANDROID__ |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 15 | #if defined(__arm64__) || defined(__aarch64__) |
Tamas Berghammer | 1e209fc | 2015-03-13 11:36:47 +0000 | [diff] [blame] | 16 | typedef unsigned long elf_greg_t; |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 17 | typedef elf_greg_t |
| 18 | elf_gregset_t[(sizeof(struct user_pt_regs) / sizeof(elf_greg_t))]; |
Tamas Berghammer | 1e209fc | 2015-03-13 11:36:47 +0000 | [diff] [blame] | 19 | typedef struct user_fpsimd_state elf_fpregset_t; |
| 20 | #ifndef NT_FPREGSET |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 21 | #define NT_FPREGSET NT_PRFPREG |
Tamas Berghammer | 1e209fc | 2015-03-13 11:36:47 +0000 | [diff] [blame] | 22 | #endif // NT_FPREGSET |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 23 | #elif defined(__mips__) |
Tamas Berghammer | 068f8a7 | 2015-05-26 11:58:52 +0000 | [diff] [blame] | 24 | #ifndef NT_FPREGSET |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 25 | #define NT_FPREGSET NT_PRFPREG |
Tamas Berghammer | 068f8a7 | 2015-05-26 11:58:52 +0000 | [diff] [blame] | 26 | #endif // NT_FPREGSET |
| 27 | #endif |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 28 | #else // __ANDROID__ |
Tamas Berghammer | 1e209fc | 2015-03-13 11:36:47 +0000 | [diff] [blame] | 29 | #include <sys/procfs.h> |
| 30 | #endif // __ANDROID__ |