[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/NEWLIB PATCH 09/16] sys/ptrace.h: Import from musl


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Thu, 22 Aug 2019 13:10:49 +0300
  • Cc: felipe.huici@xxxxxxxxx, charalampos.mainas@xxxxxxxxx
  • Delivery-date: Thu, 22 Aug 2019 10:11:41 +0000
  • Ironport-phdr: 9a23:bSjanBEFcocvUY23uqbZzJ1GYnF86YWxBRYc798ds5kLTJ7ypM6wAkXT6L1XgUPTWs2DsrQY0rCQ6vy9EjZbqb+681k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRoLerpBIHSk9631+ev8JHPfglEnjWwba5sIBmssAncuckbjYR8Jqs/1xDEvmZGd+NKyG1yOFmdhQz85sC+/J5i9yRfpfcs/NNeXKv5Yqo1U6VWACwpPG4p6sLrswLDTRaU6XsHTmoWiBtIDBPb4xz8Q5z8rzH1tut52CmdIM32UbU5Uims4qt3VBPljjoMOjgk+2/Vl8NwlrpWrhK/qRJizYDaY4abO/hwfq7GYd8WWXBMUtpLWiBdHo+xaZYEAeobPeZfqonwv0UDrRylBQmwBePvzCJDiHnr3a0izuQqDAbL0xAnH9IVrHTUrdP1OL0WUeCo1KnI0C7OYO9N2Tvn8IjIbwsureuWXbJ3aMfcz1QkGQ3CjlWVs4PlPjWV2/wIs2iG9OpgUfuji2omqw5qvjej3MAsipPGho8T11vK9j15zZ4oKdC3VUJ3e92pHZtKuy2EKYd7QNkuTm9wtConxbAKpIS3cSsKxZg92RLSZfKKf5KV7h/sSuqcJypzimh/d7KlnRmy9FCtyuj7VsapzllHtjFFktzQtnAV0BzT99SHRuN9/ki/3TaP0Bje6v9BIU8ulKrbL4QtzaIrlpYJqUTDAzT5lF/sjK+Rbkkk++6o5Pr7Yrj+u5OROJJ4hhv9P6kugMCzH/o0PwoUU2WV4ei80afs/Uz9QLVElP02lazZvYjGKsQcva65Hw5V0oA55xa7EjemyMkYkGIbI1JeYh6Hl5XpNErULPDiCvezm06snytzx/DaIr3hBY3ALn3CkLfnfLZ97FVcxBMuwt9B+ZJbFLUBLen3Wk/wr9zYEgQ5Pxa7wun5DtVxzIQeWXiAAqWBKqPdrUeI5v4zI+mLfIIapDb9JOI/5/H0iX82g1odfbGu3ZsMcny4G+5pI0SfYXX2mdcMCmEKsRQiQ+zuklKNSiRfaGivX6gk/DE0FJqmDZvfRoCqmLGB0jm0HplXZmBeFF+AC3fod5iFW/gQaSKfOclhnSIYWrilUYAuzguiuxHny+kvEu2B/ywetJX4kdR4+eDXvRUz7iBvSdSQ1SeKVW4nsHkPQmod27tjoEo17kqbzOAsiPtDCd1VofdUShoSPoWa1/FwTcr1DFGSNuyVQUqrF431SQo6Scg8locD
  • Ironport-sdr: OCIGBCkhC124dnUpMGvwTFkZeN00xCdwzx+ZgxlaQwTqoww+JH4CXx5ca/yBWTmf63B4t+719k G+mQB6+kxdTA==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

Copied as is from the official musl git mirror
git://git.musl-libc.org/musl, commit 6fcb440d.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 Makefile.uk                             |   1 +
 musl-imported/arch/x86_64/bits/ptrace.h |  13 +++
 musl-imported/include/sys/ptrace.h      | 109 ++++++++++++++++++++++++
 3 files changed, 123 insertions(+)
 create mode 100644 musl-imported/arch/x86_64/bits/ptrace.h
 create mode 100644 musl-imported/include/sys/ptrace.h

diff --git a/Makefile.uk b/Makefile.uk
index 36d8635..75e074a 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -68,6 +68,7 @@ LIBNEWLIB_LIBM = 
$(LIBNEWLIBC_ORIGIN)/$(LIBNEWLIB_SUBDIR)/newlib/libm
 LIBNEWLIBC_COMMON_INCLUDES-y     += -I$(LIBNEWLIBC_BASE)/include
 LIBNEWLIBC_COMMON_INCLUDES-y     += -I$(LIBNEWLIBC_BASE)/musl-imported/include
 LIBNEWLIBC_COMMON_INCLUDES-y     += 
-I$(LIBNEWLIBC_BASE)/musl-imported/arch/generic
+LIBNEWLIBC_COMMON_INCLUDES-$(CONFIG_ARCH_X86_64) += 
-I$(LIBNEWLIBC_BASE)/musl-imported/arch/x86_64
 LIBNEWLIBC_COMMON_INCLUDES-y     += -I$(LIBNEWLIB_LIBC)/include
 
 CINCLUDES-$(CONFIG_LIBNEWLIBC)   += $(LIBNEWLIBC_COMMON_INCLUDES-y)
diff --git a/musl-imported/arch/x86_64/bits/ptrace.h 
b/musl-imported/arch/x86_64/bits/ptrace.h
new file mode 100644
index 0000000..7f8a09b
--- /dev/null
+++ b/musl-imported/arch/x86_64/bits/ptrace.h
@@ -0,0 +1,13 @@
+#define PTRACE_GET_THREAD_AREA         25
+#define PTRACE_SET_THREAD_AREA         26
+#define PTRACE_ARCH_PRCTL              30
+#define PTRACE_SYSEMU                  31
+#define PTRACE_SYSEMU_SINGLESTEP       32
+#define PTRACE_SINGLEBLOCK             33
+
+#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
+#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
+#define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL
+#define PT_SYSEMU PTRACE_SYSEMU
+#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
+#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
diff --git a/musl-imported/include/sys/ptrace.h 
b/musl-imported/include/sys/ptrace.h
new file mode 100644
index 0000000..229e1f3
--- /dev/null
+++ b/musl-imported/include/sys/ptrace.h
@@ -0,0 +1,109 @@
+#ifndef _SYS_PTRACE_H
+#define _SYS_PTRACE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+#define PTRACE_TRACEME 0
+#define PT_TRACE_ME PTRACE_TRACEME
+
+#define PTRACE_PEEKTEXT 1
+#define PTRACE_PEEKDATA 2
+#define PTRACE_PEEKUSER 3
+#define PTRACE_POKETEXT 4
+#define PTRACE_POKEDATA 5
+#define PTRACE_POKEUSER 6
+#define PTRACE_CONT 7
+#define PTRACE_KILL 8
+#define PTRACE_SINGLESTEP 9
+#define PTRACE_GETREGS 12
+#define PTRACE_SETREGS 13
+#define PTRACE_GETFPREGS 14
+#define PTRACE_SETFPREGS 15
+#define PTRACE_ATTACH 16
+#define PTRACE_DETACH 17
+#define PTRACE_GETFPXREGS 18
+#define PTRACE_SETFPXREGS 19
+#define PTRACE_SYSCALL 24
+#define PTRACE_SETOPTIONS 0x4200
+#define PTRACE_GETEVENTMSG 0x4201
+#define PTRACE_GETSIGINFO 0x4202
+#define PTRACE_SETSIGINFO 0x4203
+#define PTRACE_GETREGSET 0x4204
+#define PTRACE_SETREGSET 0x4205
+#define PTRACE_SEIZE 0x4206
+#define PTRACE_INTERRUPT 0x4207
+#define PTRACE_LISTEN 0x4208
+#define PTRACE_PEEKSIGINFO 0x4209
+#define PTRACE_GETSIGMASK 0x420a
+#define PTRACE_SETSIGMASK 0x420b
+#define PTRACE_SECCOMP_GET_FILTER 0x420c
+#define PTRACE_SECCOMP_GET_METADATA 0x420d
+
+#define PT_READ_I PTRACE_PEEKTEXT
+#define PT_READ_D PTRACE_PEEKDATA
+#define PT_READ_U PTRACE_PEEKUSER
+#define PT_WRITE_I PTRACE_POKETEXT
+#define PT_WRITE_D PTRACE_POKEDATA
+#define PT_WRITE_U PTRACE_POKEUSER
+#define PT_CONTINUE PTRACE_CONT
+#define PT_KILL PTRACE_KILL
+#define PT_STEP PTRACE_SINGLESTEP
+#define PT_GETREGS PTRACE_GETREGS
+#define PT_SETREGS PTRACE_SETREGS
+#define PT_GETFPREGS PTRACE_GETFPREGS
+#define PT_SETFPREGS PTRACE_SETFPREGS
+#define PT_ATTACH PTRACE_ATTACH
+#define PT_DETACH PTRACE_DETACH
+#define PT_GETFPXREGS PTRACE_GETFPXREGS
+#define PT_SETFPXREGS PTRACE_SETFPXREGS
+#define PT_SYSCALL PTRACE_SYSCALL
+#define PT_SETOPTIONS PTRACE_SETOPTIONS
+#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
+#define PT_GETSIGINFO PTRACE_GETSIGINFO
+#define PT_SETSIGINFO PTRACE_SETSIGINFO
+
+#define PTRACE_O_TRACESYSGOOD   0x00000001
+#define PTRACE_O_TRACEFORK      0x00000002
+#define PTRACE_O_TRACEVFORK     0x00000004
+#define PTRACE_O_TRACECLONE     0x00000008
+#define PTRACE_O_TRACEEXEC      0x00000010
+#define PTRACE_O_TRACEVFORKDONE 0x00000020
+#define PTRACE_O_TRACEEXIT      0x00000040
+#define PTRACE_O_TRACESECCOMP   0x00000080
+#define PTRACE_O_EXITKILL       0x00100000
+#define PTRACE_O_SUSPEND_SECCOMP 0x00200000
+#define PTRACE_O_MASK           0x003000ff
+
+#define PTRACE_EVENT_FORK 1
+#define PTRACE_EVENT_VFORK 2
+#define PTRACE_EVENT_CLONE 3
+#define PTRACE_EVENT_EXEC 4
+#define PTRACE_EVENT_VFORK_DONE 5
+#define PTRACE_EVENT_EXIT 6
+#define PTRACE_EVENT_SECCOMP 7
+#define PTRACE_EVENT_STOP 128
+
+#define PTRACE_PEEKSIGINFO_SHARED 1
+
+#include <bits/ptrace.h>
+
+struct __ptrace_peeksiginfo_args {
+       uint64_t off;
+       uint32_t flags;
+       int32_t nr;
+};
+
+struct __ptrace_seccomp_metadata {
+       uint64_t filter_off;
+       uint64_t flags;
+};
+
+long ptrace(int, ...);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.