From 6690b99702a0faa9506e332cac50e6a1206a0e2a Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sat, 23 Nov 2024 01:40:53 +0000 Subject: [PATCH 01/47] dtrace: Remove an unused typedef No functional change intended. MFC after: 1 week (cherry picked from commit 1905ce3a6bef5652ad36ced7df9da6d2acb96b69) --- sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h index cdd4cf21a2f9..45201447024e 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h @@ -51,11 +51,7 @@ extern "C" { #include #ifndef illumos -#ifdef __sparcv9 -typedef uint32_t pc_t; -#else typedef uintptr_t pc_t; -#endif typedef u_long greg_t; #endif From 4b460d7ec97902bc443a005c7464da7c8167ac21 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 22 Jan 2025 14:20:33 +0000 Subject: [PATCH 02/47] dtrace tests: Avoid hard-coding paths to required programs MFC after: 1 week Sponsored by: Innovate UK (cherry picked from commit 6e6a67e98652e1477973d031b27ce085d7f200c2) --- cddl/usr.sbin/dtrace/tests/dtrace.test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cddl/usr.sbin/dtrace/tests/dtrace.test.mk b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk index 001dc6253f82..da7c3a440be0 100644 --- a/cddl/usr.sbin/dtrace/tests/dtrace.test.mk +++ b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk @@ -12,7 +12,7 @@ ${TESTGROUP}EXEPACKAGE= ${PACKAGE} TESTWRAPPER= t_dtrace_contrib ATF_TESTS_SH+= ${TESTWRAPPER} -TEST_METADATA.t_dtrace_contrib+= required_files="/usr/local/bin/ksh /usr/local/bin/jq /usr/local/bin/perl /usr/local/bin/xmllint" +TEST_METADATA.t_dtrace_contrib+= required_progs="ksh jq perl xmllint" TEST_METADATA.t_dtrace_contrib+= required_user="root" GENTEST?= ${.CURDIR:H:H}/tools/gentest.sh From 375ded9b1c11b4edb9ce15017481e80009b6eae3 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 22 Jan 2025 14:34:29 +0000 Subject: [PATCH 03/47] dtrace: Fix the definition of pc_t This type is used only to store PC values corresponding to a thread stack trace, so a pointer type is not quite right. Switch to vm_offset_t, as in struct stack, to simplify a port of DTrace to CHERI. No functional change intended. MFC after: 1 week Sponsored by: Innovate UK (cherry picked from commit 8ce6b4f2c48eca758fac90b58924f9b2e38fbc49) --- sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h index 45201447024e..cfb97c71f262 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h @@ -51,7 +51,7 @@ extern "C" { #include #ifndef illumos -typedef uintptr_t pc_t; +typedef vm_offset_t pc_t; typedef u_long greg_t; #endif From 2035a30eab26e284ce245435e41d6232d987297c Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 22 Jan 2025 14:37:55 +0000 Subject: [PATCH 04/47] libdtrace: Use C99 designated initializers for dt_idops_t No functional change intended. MFC after: 1 week Sponsored by: Innovate UK (cherry picked from commit 61c4ac2df7b2b866c8ee5e944aedc96aa79bd315) --- .../lib/libdtrace/common/dt_ident.c | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c index 5ff772be041d..d03347d0e7c1 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c @@ -577,51 +577,51 @@ dt_idsize_none(dt_ident_t *idp) } const dt_idops_t dt_idops_assc = { - dt_idcook_assc, - dt_iddtor_sign, - dt_idsize_none, + .di_cook = dt_idcook_assc, + .di_dtor = dt_iddtor_sign, + .di_size = dt_idsize_none, }; const dt_idops_t dt_idops_func = { - dt_idcook_func, - dt_iddtor_sign, - dt_idsize_none, + .di_cook = dt_idcook_func, + .di_dtor = dt_iddtor_sign, + .di_size = dt_idsize_none, }; const dt_idops_t dt_idops_args = { - dt_idcook_args, - dt_iddtor_none, - dt_idsize_none, + .di_cook = dt_idcook_args, + .di_dtor = dt_iddtor_none, + .di_size = dt_idsize_none, }; const dt_idops_t dt_idops_regs = { - dt_idcook_regs, - dt_iddtor_free, - dt_idsize_none, + .di_cook = dt_idcook_regs, + .di_dtor = dt_iddtor_free, + .di_size = dt_idsize_none, }; const dt_idops_t dt_idops_type = { - dt_idcook_type, - dt_iddtor_free, - dt_idsize_type, + .di_cook = dt_idcook_type, + .di_dtor = dt_iddtor_free, + .di_size = dt_idsize_type, }; const dt_idops_t dt_idops_thaw = { - dt_idcook_thaw, - dt_iddtor_free, - dt_idsize_type, + .di_cook = dt_idcook_thaw, + .di_dtor = dt_iddtor_free, + .di_size = dt_idsize_type, }; const dt_idops_t dt_idops_inline = { - dt_idcook_inline, - dt_iddtor_inline, - dt_idsize_type, + .di_cook = dt_idcook_inline, + .di_dtor = dt_iddtor_inline, + .di_size = dt_idsize_type, }; const dt_idops_t dt_idops_probe = { - dt_idcook_thaw, - dt_iddtor_probe, - dt_idsize_none, + .di_cook = dt_idcook_thaw, + .di_dtor = dt_iddtor_probe, + .di_size = dt_idsize_none, }; static void From 06a1c6e011322cbb609f95154049d7d1a820b778 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 22 Jan 2025 15:15:18 +0000 Subject: [PATCH 05/47] dtrace/arm64: Simplify variable declarations in the invop handler Remove some unused variables and reduce the scope of some others. No functional change intended. MFC after: 1 week Sponsored by: Innovate UK (cherry picked from commit 8384a19adc88ef31794f5aed1d8c5621b7dff8c9) --- sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c index b4dae1cba539..20418e3a475b 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c @@ -262,17 +262,15 @@ dtrace_store64(uint64_t *addr, struct trapframe *frame, u_int reg) static int dtrace_invop_start(struct trapframe *frame) { - int data, invop, reg, update_sp; - register_t arg1, arg2; - register_t *sp; - int offs; - int tmp; - int i; + int data, invop, tmp; invop = dtrace_invop(frame->tf_elr, frame, frame->tf_x[0]); tmp = (invop & LDP_STP_MASK); if (tmp == STP_64 || tmp == LDP_64) { + register_t arg1, arg2, *sp; + int offs; + sp = (register_t *)frame->tf_sp; data = invop; arg1 = (data >> ARG1_SHIFT) & ARG1_MASK; From 6b0068f5573a47043def672dfe757a4766c8a24a Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 23 Jan 2025 19:08:46 +0000 Subject: [PATCH 06/47] dtrace: Use size_t instead of uintptr_t to represent buffer offsets This eases porting of DTrace to CHERI, where uintptr_t and size_t aren't interchangeable. No functional change intended. Reviewed by: Domagoj Stolfa MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D48625 --- .../opensolaris/uts/common/dtrace/dtrace.c | 19 +++++++++---------- .../opensolaris/uts/common/sys/dtrace_impl.h | 6 +++--- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 5a77fba8381c..92f12e59c0b3 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -473,7 +473,7 @@ static kmutex_t dtrace_errlock; #define DT_MASK_LO 0x00000000FFFFFFFFULL #define DTRACE_STORE(type, tomax, offset, what) \ - *((type *)((uintptr_t)(tomax) + (uintptr_t)offset)) = (type)(what); + *((type *)((uintptr_t)(tomax) + (size_t)offset)) = (type)(what); #if !defined(__x86) && !defined(__aarch64__) #define DTRACE_ALIGNCHECK(addr, size, flags) \ @@ -602,7 +602,7 @@ static uint64_t dtrace_helper(int, dtrace_mstate_t *, static dtrace_helpers_t *dtrace_helpers_create(proc_t *); static void dtrace_buffer_drop(dtrace_buffer_t *); static int dtrace_buffer_consumed(dtrace_buffer_t *, hrtime_t when); -static intptr_t dtrace_buffer_reserve(dtrace_buffer_t *, size_t, size_t, +static ssize_t dtrace_buffer_reserve(dtrace_buffer_t *, size_t, size_t, dtrace_state_t *, dtrace_mstate_t *); static int dtrace_state_option(dtrace_state_t *, dtrace_optid_t, dtrace_optval_t); @@ -2549,7 +2549,7 @@ dtrace_aggregate(dtrace_aggregation_t *agg, dtrace_buffer_t *dbuf, caddr_t tomax, data, kdata; dtrace_actkind_t action; dtrace_action_t *act; - uintptr_t offs; + size_t offs; if (buf == NULL) return; @@ -2844,7 +2844,7 @@ dtrace_speculation_commit(dtrace_state_t *state, processorid_t cpu, dtrace_buffer_t *src, *dest; uintptr_t daddr, saddr, dlimit, slimit; dtrace_speculation_state_t curstate, new = 0; - intptr_t offs; + ssize_t offs; uint64_t timestamp; if (which == 0) @@ -6909,7 +6909,6 @@ dtrace_action_breakpoint(dtrace_ecb_t *ecb) char c[DTRACE_FULLNAMELEN + 80], *str; char *msg = "dtrace: breakpoint action at probe "; char *ecbmsg = " (ecb "; - uintptr_t mask = (0xf << (sizeof (uintptr_t) * NBBY / 4)); uintptr_t val = (uintptr_t)ecb; int shift = (sizeof (uintptr_t) * NBBY) - 4, i = 0; @@ -6950,9 +6949,9 @@ dtrace_action_breakpoint(dtrace_ecb_t *ecb) c[i++] = *ecbmsg++; while (shift >= 0) { - mask = (uintptr_t)0xf << shift; + size_t mask = (size_t)0xf << shift; - if (val >= ((uintptr_t)1 << shift)) + if (val >= ((size_t)1 << shift)) c[i++] = "0123456789abcdef"[(val & mask) >> shift]; shift -= 4; } @@ -8037,7 +8036,7 @@ dtrace_hash_str(const char *p) } static dtrace_hash_t * -dtrace_hash_create(uintptr_t stroffs, uintptr_t nextoffs, uintptr_t prevoffs) +dtrace_hash_create(size_t stroffs, size_t nextoffs, size_t prevoffs) { dtrace_hash_t *hash = kmem_zalloc(sizeof (dtrace_hash_t), KM_SLEEP); @@ -12314,11 +12313,11 @@ dtrace_buffer_drop(dtrace_buffer_t *buf) * mstate. Returns the new offset in the buffer, or a negative value if an * error has occurred. */ -static intptr_t +static ssize_t dtrace_buffer_reserve(dtrace_buffer_t *buf, size_t needed, size_t align, dtrace_state_t *state, dtrace_mstate_t *mstate) { - intptr_t offs = buf->dtb_offset, soffs; + ssize_t offs = buf->dtb_offset, soffs; intptr_t woffs; caddr_t tomax; size_t total; diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h index cfb97c71f262..222f8e206da1 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h @@ -149,9 +149,9 @@ typedef struct dtrace_hash { int dth_size; /* size of hash table */ int dth_mask; /* mask to index into table */ int dth_nbuckets; /* total number of buckets */ - uintptr_t dth_nextoffs; /* offset of next in probe */ - uintptr_t dth_prevoffs; /* offset of prev in probe */ - uintptr_t dth_stroffs; /* offset of str in probe */ + size_t dth_nextoffs; /* offset of next in probe */ + size_t dth_prevoffs; /* offset of prev in probe */ + size_t dth_stroffs; /* offset of str in probe */ } dtrace_hash_t; /* From 8a0fe9d72ccb12cd4b46b1a92f6794c105acd540 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 23 Jan 2025 19:09:56 +0000 Subject: [PATCH 07/47] dtrace tests: Fix the ATF config variable name Fixes: 6e6a67e98652 ("dtrace tests: Avoid hard-coding paths to required programs") Sponsored by: Innovate UK --- cddl/usr.sbin/dtrace/tests/dtrace.test.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cddl/usr.sbin/dtrace/tests/dtrace.test.mk b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk index da7c3a440be0..54e2aec68dcc 100644 --- a/cddl/usr.sbin/dtrace/tests/dtrace.test.mk +++ b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk @@ -12,7 +12,7 @@ ${TESTGROUP}EXEPACKAGE= ${PACKAGE} TESTWRAPPER= t_dtrace_contrib ATF_TESTS_SH+= ${TESTWRAPPER} -TEST_METADATA.t_dtrace_contrib+= required_progs="ksh jq perl xmllint" +TEST_METADATA.t_dtrace_contrib+= required_programs="ksh jq perl xmllint" TEST_METADATA.t_dtrace_contrib+= required_user="root" GENTEST?= ${.CURDIR:H:H}/tools/gentest.sh From ea90dbb9ab8eefb9fdae6e35ac6542461dc8024c Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sat, 25 Jan 2025 15:57:37 +0000 Subject: [PATCH 08/47] libdtrace: Generalize handling of data models a bit Make it easier to support data models other than ILP32 and LP64 by avoiding constructs which assume that it must be one or the other. No functional change intended. MFC after: 2 weeks Sponsored by: Innovate UK (cherry picked from commit 096a5c6cd28c417456d5ce3598be15e6b656af5c) --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.c | 7 +++---- cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c | 8 +++++++- cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c index dc68c6ef5f72..162224478ec0 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c @@ -1378,7 +1378,7 @@ main(int argc, char *argv[]) argv[0], optarg); return (usage(stderr)); } - g_oflags &= ~DTRACE_O_LP64; + g_oflags &= ~DTRACE_O_MODEL_MASK; g_oflags |= DTRACE_O_ILP32; break; @@ -1389,7 +1389,7 @@ main(int argc, char *argv[]) argv[0], optarg); return (usage(stderr)); } - g_oflags &= ~DTRACE_O_ILP32; + g_oflags &= ~DTRACE_O_MODEL_MASK; g_oflags |= DTRACE_O_LP64; break; @@ -1460,8 +1460,7 @@ main(int argc, char *argv[]) * files. We ignore certain errors since we'll catch them later when * we actually process the object files. */ - if (g_mode == DMODE_LINK && - (g_oflags & (DTRACE_O_ILP32 | DTRACE_O_LP64)) == 0 && + if (g_mode == DMODE_LINK && (g_oflags & DTRACE_O_MODEL_MASK) == 0 && elf_version(EV_CURRENT) != EV_NONE) { int fd; Elf *elf; diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c index 8f8d20298e4c..40200771fd4d 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c @@ -1073,8 +1073,14 @@ dt_vopen(int version, int flags, int *errp, if (flags & ~DTRACE_O_MASK) return (set_open_errno(dtp, errp, EINVAL)); - if ((flags & DTRACE_O_LP64) && (flags & DTRACE_O_ILP32)) + switch (flags & DTRACE_O_MODEL_MASK) { + case 0: /* native model */ + case DTRACE_O_ILP32: + case DTRACE_O_LP64: + break; + default: return (set_open_errno(dtp, errp, EINVAL)); + } if (vector == NULL && arg != NULL) return (set_open_errno(dtp, errp, EINVAL)); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h index b380f5eb3313..1f4c5a2efd6b 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h @@ -70,6 +70,7 @@ typedef struct dtrace_aggdata dtrace_aggdata_t; #define DTRACE_O_NOSYS 0x02 /* do not load /system/object modules */ #define DTRACE_O_LP64 0x04 /* force D compiler to be LP64 */ #define DTRACE_O_ILP32 0x08 /* force D compiler to be ILP32 */ +#define DTRACE_O_MODEL_MASK (DTRACE_O_LP64 | DTRACE_O_ILP32) #define DTRACE_O_MASK 0x0f /* mask of valid flags to dtrace_open */ extern dtrace_hdl_t *dtrace_open(int, int, int *); From 8ad6b87aef935b69cd9ca463a0d0977660805038 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 29 Jan 2025 00:59:21 +0000 Subject: [PATCH 09/47] libdtrace: Use designators to initialize the opcode array No functional change intended. MFC after: 2 weeks Sponsored by: Innovate UK (cherry picked from commit 51688136b161089b317edc34c3a3e9b40d54a18a) --- .../opensolaris/lib/libdtrace/common/dt_dis.c | 160 +++++++++--------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c index d1335180ec97..41765efb7717 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c @@ -348,86 +348,86 @@ dt_dis(const dtrace_difo_t *dp, FILE *fp) void (*op_func)(const dtrace_difo_t *, const char *, dif_instr_t, FILE *); } optab[] = { - { "(illegal opcode)", dt_dis_str }, - { "or", dt_dis_log }, /* DIF_OP_OR */ - { "xor", dt_dis_log }, /* DIF_OP_XOR */ - { "and", dt_dis_log }, /* DIF_OP_AND */ - { "sll", dt_dis_log }, /* DIF_OP_SLL */ - { "srl", dt_dis_log }, /* DIF_OP_SRL */ - { "sub", dt_dis_log }, /* DIF_OP_SUB */ - { "add", dt_dis_log }, /* DIF_OP_ADD */ - { "mul", dt_dis_log }, /* DIF_OP_MUL */ - { "sdiv", dt_dis_log }, /* DIF_OP_SDIV */ - { "udiv", dt_dis_log }, /* DIF_OP_UDIV */ - { "srem", dt_dis_log }, /* DIF_OP_SREM */ - { "urem", dt_dis_log }, /* DIF_OP_UREM */ - { "not", dt_dis_r1rd }, /* DIF_OP_NOT */ - { "mov", dt_dis_r1rd }, /* DIF_OP_MOV */ - { "cmp", dt_dis_cmp }, /* DIF_OP_CMP */ - { "tst", dt_dis_tst }, /* DIF_OP_TST */ - { "ba", dt_dis_branch }, /* DIF_OP_BA */ - { "be", dt_dis_branch }, /* DIF_OP_BE */ - { "bne", dt_dis_branch }, /* DIF_OP_BNE */ - { "bg", dt_dis_branch }, /* DIF_OP_BG */ - { "bgu", dt_dis_branch }, /* DIF_OP_BGU */ - { "bge", dt_dis_branch }, /* DIF_OP_BGE */ - { "bgeu", dt_dis_branch }, /* DIF_OP_BGEU */ - { "bl", dt_dis_branch }, /* DIF_OP_BL */ - { "blu", dt_dis_branch }, /* DIF_OP_BLU */ - { "ble", dt_dis_branch }, /* DIF_OP_BLE */ - { "bleu", dt_dis_branch }, /* DIF_OP_BLEU */ - { "ldsb", dt_dis_load }, /* DIF_OP_LDSB */ - { "ldsh", dt_dis_load }, /* DIF_OP_LDSH */ - { "ldsw", dt_dis_load }, /* DIF_OP_LDSW */ - { "ldub", dt_dis_load }, /* DIF_OP_LDUB */ - { "lduh", dt_dis_load }, /* DIF_OP_LDUH */ - { "lduw", dt_dis_load }, /* DIF_OP_LDUW */ - { "ldx", dt_dis_load }, /* DIF_OP_LDX */ - { "ret", dt_dis_ret }, /* DIF_OP_RET */ - { "nop", dt_dis_str }, /* DIF_OP_NOP */ - { "setx", dt_dis_setx }, /* DIF_OP_SETX */ - { "sets", dt_dis_sets }, /* DIF_OP_SETS */ - { "scmp", dt_dis_cmp }, /* DIF_OP_SCMP */ - { "ldga", dt_dis_lda }, /* DIF_OP_LDGA */ - { "ldgs", dt_dis_ldv }, /* DIF_OP_LDGS */ - { "stgs", dt_dis_stv }, /* DIF_OP_STGS */ - { "ldta", dt_dis_lda }, /* DIF_OP_LDTA */ - { "ldts", dt_dis_ldv }, /* DIF_OP_LDTS */ - { "stts", dt_dis_stv }, /* DIF_OP_STTS */ - { "sra", dt_dis_log }, /* DIF_OP_SRA */ - { "call", dt_dis_call }, /* DIF_OP_CALL */ - { "pushtr", dt_dis_pushts }, /* DIF_OP_PUSHTR */ - { "pushtv", dt_dis_pushts }, /* DIF_OP_PUSHTV */ - { "popts", dt_dis_str }, /* DIF_OP_POPTS */ - { "flushts", dt_dis_str }, /* DIF_OP_FLUSHTS */ - { "ldgaa", dt_dis_ldv }, /* DIF_OP_LDGAA */ - { "ldtaa", dt_dis_ldv }, /* DIF_OP_LDTAA */ - { "stgaa", dt_dis_stv }, /* DIF_OP_STGAA */ - { "sttaa", dt_dis_stv }, /* DIF_OP_STTAA */ - { "ldls", dt_dis_ldv }, /* DIF_OP_LDLS */ - { "stls", dt_dis_stv }, /* DIF_OP_STLS */ - { "allocs", dt_dis_r1rd }, /* DIF_OP_ALLOCS */ - { "copys", dt_dis_log }, /* DIF_OP_COPYS */ - { "stb", dt_dis_store }, /* DIF_OP_STB */ - { "sth", dt_dis_store }, /* DIF_OP_STH */ - { "stw", dt_dis_store }, /* DIF_OP_STW */ - { "stx", dt_dis_store }, /* DIF_OP_STX */ - { "uldsb", dt_dis_load }, /* DIF_OP_ULDSB */ - { "uldsh", dt_dis_load }, /* DIF_OP_ULDSH */ - { "uldsw", dt_dis_load }, /* DIF_OP_ULDSW */ - { "uldub", dt_dis_load }, /* DIF_OP_ULDUB */ - { "ulduh", dt_dis_load }, /* DIF_OP_ULDUH */ - { "ulduw", dt_dis_load }, /* DIF_OP_ULDUW */ - { "uldx", dt_dis_load }, /* DIF_OP_ULDX */ - { "rldsb", dt_dis_load }, /* DIF_OP_RLDSB */ - { "rldsh", dt_dis_load }, /* DIF_OP_RLDSH */ - { "rldsw", dt_dis_load }, /* DIF_OP_RLDSW */ - { "rldub", dt_dis_load }, /* DIF_OP_RLDUB */ - { "rlduh", dt_dis_load }, /* DIF_OP_RLDUH */ - { "rlduw", dt_dis_load }, /* DIF_OP_RLDUW */ - { "rldx", dt_dis_load }, /* DIF_OP_RLDX */ - { "xlate", dt_dis_xlate }, /* DIF_OP_XLATE */ - { "xlarg", dt_dis_xlate }, /* DIF_OP_XLARG */ + [0] = { "(illegal opcode)", dt_dis_str }, + [DIF_OP_OR] = { "or", dt_dis_log }, + [DIF_OP_XOR] = { "xor", dt_dis_log }, + [DIF_OP_AND] = { "and", dt_dis_log }, + [DIF_OP_SLL] = { "sll", dt_dis_log }, + [DIF_OP_SRL] = { "srl", dt_dis_log }, + [DIF_OP_SUB] = { "sub", dt_dis_log }, + [DIF_OP_ADD] = { "add", dt_dis_log }, + [DIF_OP_MUL] = { "mul", dt_dis_log }, + [DIF_OP_SDIV] = { "sdiv", dt_dis_log }, + [DIF_OP_UDIV] = { "udiv", dt_dis_log }, + [DIF_OP_SREM] = { "srem", dt_dis_log }, + [DIF_OP_UREM] = { "urem", dt_dis_log }, + [DIF_OP_NOT] = { "not", dt_dis_r1rd }, + [DIF_OP_MOV] = { "mov", dt_dis_r1rd }, + [DIF_OP_CMP] = { "cmp", dt_dis_cmp }, + [DIF_OP_TST] = { "tst", dt_dis_tst }, + [DIF_OP_BA] = { "ba", dt_dis_branch }, + [DIF_OP_BE] = { "be", dt_dis_branch }, + [DIF_OP_BNE] = { "bne", dt_dis_branch }, + [DIF_OP_BG] = { "bg", dt_dis_branch }, + [DIF_OP_BGU] = { "bgu", dt_dis_branch }, + [DIF_OP_BGE] = { "bge", dt_dis_branch }, + [DIF_OP_BGEU] = { "bgeu", dt_dis_branch }, + [DIF_OP_BL] = { "bl", dt_dis_branch }, + [DIF_OP_BLU] = { "blu", dt_dis_branch }, + [DIF_OP_BLE] = { "ble", dt_dis_branch }, + [DIF_OP_BLEU] = { "bleu", dt_dis_branch }, + [DIF_OP_LDSB] = { "ldsb", dt_dis_load }, + [DIF_OP_LDSH] = { "ldsh", dt_dis_load }, + [DIF_OP_LDSW] = { "ldsw", dt_dis_load }, + [DIF_OP_LDUB] = { "ldub", dt_dis_load }, + [DIF_OP_LDUH] = { "lduh", dt_dis_load }, + [DIF_OP_LDUW] = { "lduw", dt_dis_load }, + [DIF_OP_LDX] = { "ldx", dt_dis_load }, + [DIF_OP_RET] = { "ret", dt_dis_ret }, + [DIF_OP_NOP] = { "nop", dt_dis_str }, + [DIF_OP_SETX] = { "setx", dt_dis_setx }, + [DIF_OP_SETS] = { "sets", dt_dis_sets }, + [DIF_OP_SCMP] = { "scmp", dt_dis_cmp }, + [DIF_OP_LDGA] = { "ldga", dt_dis_lda }, + [DIF_OP_LDGS] = { "ldgs", dt_dis_ldv }, + [DIF_OP_STGS] = { "stgs", dt_dis_stv }, + [DIF_OP_LDTA] = { "ldta", dt_dis_lda }, + [DIF_OP_LDTS] = { "ldts", dt_dis_ldv }, + [DIF_OP_STTS] = { "stts", dt_dis_stv }, + [DIF_OP_SRA] = { "sra", dt_dis_log }, + [DIF_OP_CALL] = { "call", dt_dis_call }, + [DIF_OP_PUSHTR] = { "pushtr", dt_dis_pushts }, + [DIF_OP_PUSHTV] = { "pushtv", dt_dis_pushts }, + [DIF_OP_POPTS] = { "popts", dt_dis_str }, + [DIF_OP_FLUSHTS] = { "flushts", dt_dis_str }, + [DIF_OP_LDGAA] = { "ldgaa", dt_dis_ldv }, + [DIF_OP_LDTAA] = { "ldtaa", dt_dis_ldv }, + [DIF_OP_STGAA] = { "stgaa", dt_dis_stv }, + [DIF_OP_STTAA] = { "sttaa", dt_dis_stv }, + [DIF_OP_LDLS] = { "ldls", dt_dis_ldv }, + [DIF_OP_STLS] = { "stls", dt_dis_stv }, + [DIF_OP_ALLOCS] = { "allocs", dt_dis_r1rd }, + [DIF_OP_COPYS] = { "copys", dt_dis_log }, + [DIF_OP_STB] = { "stb", dt_dis_store }, + [DIF_OP_STH] = { "sth", dt_dis_store }, + [DIF_OP_STW] = { "stw", dt_dis_store }, + [DIF_OP_STX] = { "stx", dt_dis_store }, + [DIF_OP_ULDSB] = { "uldsb", dt_dis_load }, + [DIF_OP_ULDSH] = { "uldsh", dt_dis_load }, + [DIF_OP_ULDSW] = { "uldsw", dt_dis_load }, + [DIF_OP_ULDUB] = { "uldub", dt_dis_load }, + [DIF_OP_ULDUH] = { "ulduh", dt_dis_load }, + [DIF_OP_ULDUW] = { "ulduw", dt_dis_load }, + [DIF_OP_ULDX] = { "uldx", dt_dis_load }, + [DIF_OP_RLDSB] = { "rldsb", dt_dis_load }, + [DIF_OP_RLDSH] = { "rldsh", dt_dis_load }, + [DIF_OP_RLDSW] = { "rldsw", dt_dis_load }, + [DIF_OP_RLDUB] = { "rldub", dt_dis_load }, + [DIF_OP_RLDUH] = { "rlduh", dt_dis_load }, + [DIF_OP_RLDUW] = { "rlduw", dt_dis_load }, + [DIF_OP_RLDX] = { "rldx", dt_dis_load }, + [DIF_OP_XLATE] = { "xlate", dt_dis_xlate }, + [DIF_OP_XLARG] = { "xlarg", dt_dis_xlate }, }; const struct opent *op; From c8ad5e1b0cacabd466f0188996df65413692403e Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Tue, 19 Nov 2024 21:06:46 +0000 Subject: [PATCH 10/47] sdt: Stop defining probe and provider structures as arrays There was no reason I can find for defining them this way. No functional change intended. Sponsored by: Innovate UK (cherry picked from commit e3f6ef5ade6a1865165bae55bbabd7cd8ec5da76) --- sys/sys/sdt.h | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h index 0987f1cc19c3..5fa612fcf632 100644 --- a/sys/sys/sdt.h +++ b/sys/sys/sdt.h @@ -161,28 +161,26 @@ SET_DECLARE(sdt_argtypes_set, struct sdt_argtype); sdt_provider_##prov #define SDT_PROVIDER_DEFINE(_prov) \ - struct sdt_provider _SDT_PROVIDER_NAME(_prov)[1] = { \ - [0] = { .name = #_prov }, \ + struct sdt_provider _SDT_PROVIDER_NAME(_prov) = { \ + .name = #_prov, \ }; \ DATA_SET(sdt_providers_set, _SDT_PROVIDER_NAME(_prov)) #define SDT_PROVIDER_DECLARE(prov) \ - extern struct sdt_provider _SDT_PROVIDER_NAME(prov)[1] + extern struct sdt_provider _SDT_PROVIDER_NAME(prov) #define SDT_PROBE_DEFINE(_prov, _mod, _func, _name) \ - struct sdt_probe _SDT_PROBE_NAME(_prov, _mod, _func, _name)[1] = { \ - [0] = { \ - .version = sizeof(struct sdt_probe), \ - .prov = _SDT_PROVIDER_NAME(_prov), \ - .mod = #_mod, \ - .func = #_func, \ - .name = #_name, \ - }, \ + struct sdt_probe _SDT_PROBE_NAME(_prov, _mod, _func, _name) = { \ + .version = sizeof(struct sdt_probe), \ + .prov = &_SDT_PROVIDER_NAME(_prov), \ + .mod = #_mod, \ + .func = #_func, \ + .name = #_name, \ }; \ DATA_SET(sdt_probes_set, _SDT_PROBE_NAME(_prov, _mod, _func, _name)) #define SDT_PROBE_DECLARE(prov, mod, func, name) \ - extern struct sdt_probe _SDT_PROBE_NAME(prov, mod, func, name)[1] + extern struct sdt_probe _SDT_PROBE_NAME(prov, mod, func, name) #define SDT_PROBES_ENABLED() __predict_false(sdt_probes_enabled) @@ -223,13 +221,13 @@ struct sdt_tracepoint { _SDT_ASM_WORD " 0\n" \ ".popsection\n" \ : \ - : _SDT_ASM_PROBE_CONSTRAINT (_SDT_PROBE_NAME(prov, mod, \ + : _SDT_ASM_PROBE_CONSTRAINT (&_SDT_PROBE_NAME(prov, mod, \ func, name)) \ : \ : __sdt_probe##uniq); \ if (0) { \ __sdt_probe##uniq:; \ - f(_SDT_PROBE_NAME(prov, mod, func, name)->id, __VA_ARGS__); \ + f(_SDT_PROBE_NAME(prov, mod, func, name).id, __VA_ARGS__); \ } \ } while (0) #define _SDT_PROBE(prov, mod, func, name, uniq, f, ...) \ @@ -246,7 +244,7 @@ __sdt_probe##uniq:; \ .ndx = _num, \ .type = _type, \ .xtype = _xtype, \ - .probe = _SDT_PROBE_NAME(_prov, _mod, _func, _name), \ + .probe = &_SDT_PROBE_NAME(_prov, _mod, _func, _name), \ }, \ }; \ DATA_SET(sdt_argtypes_set, \ From 07a75613ef4e0d4ab67c4fa9af5625da9e712d8f Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 29 Jan 2025 02:03:02 +0000 Subject: [PATCH 11/47] dtrace/arm64: Fix enumeration of FBT return probes On arm64, the FBT provider treats tail calls as return probes. Ignoring the question of whether this is really correct, the implementation is wrong: instr is a pointer to uint32_t, so the removed multiplication by the instruction size is wrong. As a result, FBT would create return probes for intra-function branches. MFC after: 2 weeks Sponsored by: Innovate UK (cherry picked from commit 4da070ce6c015a994ec4ecf3d31ee94810ea19f1) --- sys/cddl/dev/fbt/aarch64/fbt_isa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/cddl/dev/fbt/aarch64/fbt_isa.c b/sys/cddl/dev/fbt/aarch64/fbt_isa.c index 4f6d28c2f32b..ffe2f37a6d16 100644 --- a/sys/cddl/dev/fbt/aarch64/fbt_isa.c +++ b/sys/cddl/dev/fbt/aarch64/fbt_isa.c @@ -177,8 +177,7 @@ fbt_provide_module_function(linker_file_t lf, int symindx, break; else if ((*instr & B_MASK) == B_INSTR) { offs = (*instr & B_DATA_MASK); - offs *= 4; - target = (instr + offs); + target = instr + offs; start = (uint32_t *)symval->value; if (target >= limit || target < start) break; From 6b295f9e918a1d14315b8ebcb694d7d40e7ea29b Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 29 Jan 2025 02:55:25 +0000 Subject: [PATCH 12/47] linker: Improve handling of ifunc symbols When linker_file_function_listall() enumerates function symbols on purecap platforms, ifunc symbol values are sealed, whereas regular function symbols are not. This breaks dtrace's fbt and kinst providers, which use the returned capability to disassemble each function in the kernel. Moreover, the size of the symbol is wrong: it's the size of the resolver function rather than that of the implementation function. This latter problem is a bug upstream too. Fix both problems by looking up the full ELF symbol for the resolved function. This change is not quite correct, as it assumes that ifunc resolvers always return a symbol within the same linker file. However, this is true in practice today. --- sys/kern/link_elf.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 3daa4d55beef..ef337e9d497c 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -1790,8 +1790,17 @@ link_elf_symbol_values1(linker_file_t lf, c_linker_sym_t sym, return (ENOENT); symval->name = ef->strtab + es->st_name; val = (caddr_t)ef->address + es->st_value; - if (ELF_ST_TYPE(es->st_info) == STT_GNU_IFUNC) + while (ELF_ST_TYPE(es->st_info) == STT_GNU_IFUNC) { + c_linker_sym_t sym1; + long off; + val = ((caddr_t (*)(void))val)(); + if (link_elf_search_symbol(lf, (ptraddr_t)val, &sym1, + &off) != 0 || off != 0) + return (ENOENT); + es = (const Elf_Sym *)sym1; + val = (caddr_t)ef->address + es->st_value; + } #ifdef __CHERI_PURE_CAPABILITY__ val = make_capability(es, val); #endif @@ -1827,8 +1836,17 @@ link_elf_debug_symbol_values(linker_file_t lf, c_linker_sym_t sym, if (es >= ef->ddbsymtab && es < (ef->ddbsymtab + ef->ddbsymcnt)) { symval->name = ef->ddbstrtab + es->st_name; val = (caddr_t)ef->address + es->st_value; - if (ELF_ST_TYPE(es->st_info) == STT_GNU_IFUNC) + while (ELF_ST_TYPE(es->st_info) == STT_GNU_IFUNC) { + c_linker_sym_t sym1; + long off; + val = ((caddr_t (*)(void))val)(); + if (link_elf_search_symbol(lf, (ptraddr_t)val, &sym1, + &off) != 0 || off != 0) + return (ENOENT); + es = (const Elf_Sym *)sym1; + val = (caddr_t)ef->address + es->st_value; + } #ifdef __CHERI_PURE_CAPABILITY__ val = make_capability(es, val); #endif From 1c82ae646a7dc17cb67c5679b6467d18eabf5b5e Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 20 Nov 2024 17:07:37 +0000 Subject: [PATCH 13/47] sdt: Use .chericap to store pointers _SDT_ASM_WORD is a bit of a misnomer; it's used to store pointers as immediate values. In particular, we store a pointer to a struct sdt_probe in each SDT tracepoint structure, which is built using inline assembler directives. --- sys/sys/sdt.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h index 5fa612fcf632..af465aaee929 100644 --- a/sys/sys/sdt.h +++ b/sys/sys/sdt.h @@ -187,8 +187,12 @@ SET_DECLARE(sdt_argtypes_set, struct sdt_argtype); #ifdef _ILP32 #define _SDT_ASM_WORD ".long" #else +#ifdef __CHERI_PURE_CAPABILITY__ +#define _SDT_ASM_WORD ".chericap" +#else #define _SDT_ASM_WORD ".quad" #endif +#endif #ifndef _SDT_ASM_PROBE_CONSTRAINT #define _SDT_ASM_PROBE_CONSTRAINT "i" From 3ef81df1f4780f7c769d9dee5a5899f63ce74dc7 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 20 Nov 2024 22:15:56 +0000 Subject: [PATCH 14/47] sdt: Avoid setting subobject bounds when adding tracepoint definitions Taking the address of the probe symbol will cause the compiler to emit a setbounds instruction, but that doesn't work here. Work around that behaviour with __unbounded_addressof, since we just want the symbol name. --- sys/sys/sdt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/sdt.h b/sys/sys/sdt.h index af465aaee929..ce42aa641b2b 100644 --- a/sys/sys/sdt.h +++ b/sys/sys/sdt.h @@ -225,8 +225,8 @@ struct sdt_tracepoint { _SDT_ASM_WORD " 0\n" \ ".popsection\n" \ : \ - : _SDT_ASM_PROBE_CONSTRAINT (&_SDT_PROBE_NAME(prov, mod, \ - func, name)) \ + : _SDT_ASM_PROBE_CONSTRAINT (__unbounded_addressof( \ + _SDT_PROBE_NAME(prov, mod, func, name))) \ : \ : __sdt_probe##uniq); \ if (0) { \ From 89938db134eab9884cab3c3d24ede6a038c6c7aa Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Tue, 26 Nov 2024 17:00:15 -0500 Subject: [PATCH 15/47] sdt: Make sure that tracepoints carry a valid capability for patching This is needed in order to insert a breakpoint when enabling dtrace probes. --- sys/cddl/dev/sdt/sdt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/cddl/dev/sdt/sdt.c b/sys/cddl/dev/sdt/sdt.c index a8da618204af..4b3604be29d6 100644 --- a/sys/cddl/dev/sdt/sdt.c +++ b/sys/cddl/dev/sdt/sdt.c @@ -60,6 +60,10 @@ #include +#ifdef __CHERI_PURE_CAPABILITY__ +#include +#endif + /* DTrace methods. */ static void sdt_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *); static uint64_t sdt_getargval(void *, dtrace_id_t, void *, int, int); @@ -409,6 +413,13 @@ sdt_kld_load_probes(struct linker_file *lf) tp->probe->func, tp->probe->name); continue; } +#ifdef __CHERI_PURE_CAPABILITY__ + tp->patchpoint = (uintcap_t)cheri_setbounds( + cheri_setaddress(kernel_root_cap, tp->patchpoint), + INSN_SIZE); + tp->patchpoint = cheri_andperm(tp->patchpoint, + CHERI_PERM_STORE | CHERI_PERM_SEAL); +#endif STAILQ_INSERT_TAIL(&tp->probe->tracepoint_list, tp, tracepoint_entry); } From 3fa774aaacc535c3ad36dbb31e2dce82170d8be3 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 22 Jan 2025 16:33:23 +0000 Subject: [PATCH 16/47] dtrace/arm64: Add some support for FBT on Morello --- .../opensolaris/uts/common/sys/dtrace.h | 12 +++++ sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 52 ++++++++++++++++++- sys/cddl/dev/fbt/aarch64/fbt_isa.c | 39 +++++++++++--- 3 files changed, 95 insertions(+), 8 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h index 500ad522eb0e..ff0ea99200fe 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h @@ -2586,10 +2586,18 @@ extern int dtrace_instr_c_ret(uint32_t **instr); #define NOP_INSTR 0xd503201f +#ifdef __CHERI_PURE_CAPABILITY__ +#define RET_INSTR 0xc2c253c0 +#else #define RET_INSTR 0xd65f03c0 +#endif #define SUB_MASK 0xffc00000 #define SUB_INSTR 0xd1000000 +#ifdef __CHERI_PURE_CAPABILITY__ +#define SUBC_MASK 0xff800000 +#define SUBC_INSTR 0x02800000 +#endif #define SUB_RD_SHIFT 0 #define SUB_RN_SHIFT 5 #define SUB_R_MASK 0x1f @@ -2601,6 +2609,10 @@ extern int dtrace_instr_c_ret(uint32_t **instr); #define STP_64 0xa9800000 #define LDP_32 0x28c00000 #define LDP_64 0xa8c00000 +#ifdef __CHERI_PURE_CAPABILITY__ +#define STP_C_POSTIND 0x22800000 +#define STP_C_PREIND 0x62800000 +#endif #define LDP_STP_PREIND (1 << 24) #define LDP_STP_DIR (1 << 22) /* Load instruction */ #define ARG1_SHIFT 0 diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c index 20418e3a475b..f72186a7343e 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c @@ -246,6 +246,20 @@ dtrace_load64(uint64_t *addr, struct trapframe *frame, u_int reg) /* Nothing to do for load to xzr */ } +#ifdef __CHERI_PURE_CAPABILITY__ +static void +dtrace_storecap(uintcap_t *addr, struct trapframe *frame, u_int reg) +{ + + KASSERT(reg <= 31, ("dtrace_store64: Invalid register %u", reg)); + if (reg < nitems(frame->tf_x)) + *addr = frame->tf_x[reg]; + else if (reg == 30) /* lr */ + *addr = frame->tf_lr; + else if (reg == 31) /* xzr */ + *addr = 0; +} +#else static void dtrace_store64(uint64_t *addr, struct trapframe *frame, u_int reg) { @@ -258,6 +272,7 @@ dtrace_store64(uint64_t *addr, struct trapframe *frame, u_int reg) else if (reg == 31) /* xzr */ *addr = 0; } +#endif static int dtrace_invop_start(struct trapframe *frame) @@ -267,11 +282,33 @@ dtrace_invop_start(struct trapframe *frame) invop = dtrace_invop(frame->tf_elr, frame, frame->tf_x[0]); tmp = (invop & LDP_STP_MASK); +#ifdef __CHERI_PURE_CAPABILITY__ + if (tmp == STP_C_PREIND) { + uintcap_t *csp; + int arg1, arg2, offs; + + csp = (uintcap_t *)frame->tf_sp; + arg1 = (invop >> ARG1_SHIFT) & ARG1_MASK; + arg2 = (invop >> ARG2_SHIFT) & ARG2_MASK; + offs = (invop >> OFFSET_SHIFT) & OFFSET_MASK; + if (offs >> (OFFSET_SIZE - 1)) + csp -= (~offs & OFFSET_MASK) + 1; + else + csp += (offs); + dtrace_storecap(csp + 0, frame, arg1); + dtrace_storecap(csp + 1, frame, arg2); + + /* Update the stack pointer and program counter to continue */ + frame->tf_sp = (uintcap_t)csp; + frame->tf_elr += INSN_SIZE; + return (0); + } +#else if (tmp == STP_64 || tmp == LDP_64) { register_t arg1, arg2, *sp; int offs; - sp = (register_t *)frame->tf_sp; + sp = (register_t *)(uintptr_t)frame->tf_sp; data = invop; arg1 = (data >> ARG1_SHIFT) & ARG1_MASK; arg2 = (data >> ARG2_SHIFT) & ARG2_MASK; @@ -304,12 +341,21 @@ dtrace_invop_start(struct trapframe *frame) frame->tf_elr += INSN_SIZE; return (0); } +#endif +#ifdef __CHERI_PURE_CAPABILITY__ + if ((invop & SUBC_MASK) == SUBC_INSTR) { + frame->tf_sp -= (invop >> SUB_IMM_SHIFT) & SUB_IMM_MASK; + frame->tf_elr += INSN_SIZE; + return (0); + } +#else if ((invop & SUB_MASK) == SUB_INSTR) { frame->tf_sp -= (invop >> SUB_IMM_SHIFT) & SUB_IMM_MASK; frame->tf_elr += INSN_SIZE; return (0); } +#endif if (invop == NOP_INSTR) { frame->tf_elr += INSN_SIZE; @@ -325,7 +371,11 @@ dtrace_invop_start(struct trapframe *frame) } if (invop == RET_INSTR) { +#if __has_feature(capabilities) + trapframe_set_elr(frame, frame->tf_lr); +#else frame->tf_elr = frame->tf_lr; +#endif return (0); } diff --git a/sys/cddl/dev/fbt/aarch64/fbt_isa.c b/sys/cddl/dev/fbt/aarch64/fbt_isa.c index ffe2f37a6d16..fe5976309462 100644 --- a/sys/cddl/dev/fbt/aarch64/fbt_isa.c +++ b/sys/cddl/dev/fbt/aarch64/fbt_isa.c @@ -82,17 +82,18 @@ fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t val) int fbt_provide_module_function(linker_file_t lf, int symindx, - linker_symval_t *symval, void *opaque) + linker_symval_t *sym, void *opaque) { fbt_probe_t *fbt, *retfbt; uint32_t *target, *start; uint32_t *instr, *limit; const char *name; char *modname; + uintptr_t symval; int offs; modname = opaque; - name = symval->name; + name = sym->name; /* Check if function is excluded from instrumentation */ if (fbt_excluded(name)) @@ -106,8 +107,12 @@ fbt_provide_module_function(linker_file_t lf, int symindx, strcmp(name, "do_el1h_sync") == 0) return (1); - instr = (uint32_t *)(symval->value); - limit = (uint32_t *)(symval->value + symval->size); + symval = (uintptr_t)sym->value; +#ifdef __CHERI_PURE_CAPABILITY__ + symval &= ~0x1ul; +#endif + instr = (uint32_t *)symval; + limit = (uint32_t *)(symval + sym->size); /* * Ignore any bti instruction at the start of the function @@ -141,10 +146,22 @@ fbt_provide_module_function(linker_file_t lf, int symindx, */ if (((*instr >> ADDR_SHIFT) & ADDR_MASK) == 31) break; - } else if ((*instr & SUB_MASK) == SUB_INSTR && + } +#ifdef __CHERI_PURE_CAPABILITY__ + else if ((*instr & LDP_STP_MASK) == STP_C_PREIND && + ((*instr >> ADDR_SHIFT) & ADDR_MASK) == 31) + break; +#endif + else if ((*instr & SUB_MASK) == SUB_INSTR && + ((*instr >> SUB_RD_SHIFT) & SUB_R_MASK) == 31 && + ((*instr >> SUB_RN_SHIFT) & SUB_R_MASK) == 31) + break; +#ifdef __CHERI_PURE_CAPABILITY__ + else if ((*instr & SUBC_MASK) == SUBC_INSTR && ((*instr >> SUB_RD_SHIFT) & SUB_R_MASK) == 31 && ((*instr >> SUB_RN_SHIFT) & SUB_R_MASK) == 31) break; +#endif } found: if (instr >= limit) @@ -154,7 +171,11 @@ fbt_provide_module_function(linker_file_t lf, int symindx, fbt->fbtp_name = name; fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, name, FBT_ENTRY, FBT_AFRAMES, fbt); +#ifdef __CHERI_PURE_CAPABILITY__ + fbt->fbtp_patchpoint = cheri_setbounds(instr, INSN_SIZE); +#else fbt->fbtp_patchpoint = instr; +#endif fbt->fbtp_ctl = lf; fbt->fbtp_loadcnt = lf->loadcnt; fbt->fbtp_savedval = *instr; @@ -178,7 +199,7 @@ fbt_provide_module_function(linker_file_t lf, int symindx, else if ((*instr & B_MASK) == B_INSTR) { offs = (*instr & B_DATA_MASK); target = instr + offs; - start = (uint32_t *)symval->value; + start = (uint32_t *)symval; if (target >= limit || target < start) break; } @@ -201,7 +222,11 @@ fbt_provide_module_function(linker_file_t lf, int symindx, } retfbt = fbt; +#ifdef __CHERI_PURE_CAPABILITY__ + fbt->fbtp_patchpoint = cheri_setbounds(instr, INSN_SIZE); +#else fbt->fbtp_patchpoint = instr; +#endif fbt->fbtp_ctl = lf; fbt->fbtp_loadcnt = lf->loadcnt; fbt->fbtp_symindx = symindx; @@ -209,7 +234,7 @@ fbt_provide_module_function(linker_file_t lf, int symindx, fbt->fbtp_rval = DTRACE_INVOP_B; else fbt->fbtp_rval = DTRACE_INVOP_RET; - fbt->fbtp_roffset = (uintptr_t)instr - (uintptr_t)symval->value; + fbt->fbtp_roffset = (uintptr_t)instr - symval; fbt->fbtp_savedval = *instr; fbt->fbtp_patchval = FBT_PATCHVAL; fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)]; From 09f86aa7c254e5f2b1f572ba39e961c2e360afb1 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 22 Jan 2025 17:50:29 +0000 Subject: [PATCH 17/47] dtrace: Remove COMPAT_FREEBSD64 hooks --- .../opensolaris/uts/common/dtrace/dtrace.c | 47 +-- .../opensolaris/uts/common/sys/dtrace.h | 84 ------ sys/cddl/dev/dtrace/dtrace_ioctl.c | 73 ++--- sys/cddl/dev/dtrace/dtrace_ioctl_compat.c | 276 ------------------ 4 files changed, 31 insertions(+), 449 deletions(-) delete mode 100644 sys/cddl/dev/dtrace/dtrace_ioctl_compat.c diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 92f12e59c0b3..7613e50db913 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -13812,58 +13812,29 @@ dtrace_dof_predicate(dof_hdr_t *dof, dof_sec_t *sec, dtrace_vstate_t *vstate, return (dtrace_predicate_create(dp)); } -#ifdef COMPAT_FREEBSD64 -static dof_actdesc_t -freebsd64_dof_actdesc(dof_actdesc64_t *actdesc64) -{ - dof_actdesc_t actdesc; - actdesc.dofa_difo = actdesc64->dofa_difo; - actdesc.dofa_strtab = actdesc64->dofa_strtab; - actdesc.dofa_kind = actdesc64->dofa_kind; - actdesc.dofa_ntuple = actdesc64->dofa_ntuple; - actdesc.dofa_arg = actdesc64->dofa_arg; - actdesc.dofa_uarg = actdesc64->dofa_uarg; - return actdesc; -} -#endif - static dtrace_actdesc_t * dtrace_dof_actdesc(dof_hdr_t *dof, dof_sec_t *sec, dtrace_vstate_t *vstate, cred_t *cr) { dtrace_actdesc_t *act, *first = NULL, *last = NULL, *next; - dof_actdesc_t desc_storage; - dof_actdesc_t *desc = &desc_storage; + dof_actdesc_t *desc; dof_sec_t *difosec; size_t offs; uintptr_t daddr = (uintptr_t)dof; uint64_t arg; dtrace_actkind_t kind; - int sizeof_uarg; - int sizeof_dof_actdesc_t; - -#ifdef COMPAT_FREEBSD64 - if (!SV_CURPROC_FLAG(SV_CHERI)) { - sizeof_uarg = sizeof(uint64_t); - sizeof_dof_actdesc_t = sizeof(dof_actdesc64_t); - } else -#endif - { - sizeof_uarg = sizeof(dtrace_uarg_t); - sizeof_dof_actdesc_t = sizeof(dof_actdesc_t); - } if (sec->dofs_type != DOF_SECT_ACTDESC) { dtrace_dof_error(dof, "invalid action section"); return (NULL); } - if (sec->dofs_offset + sizeof_dof_actdesc_t > dof->dofh_loadsz) { + if (sec->dofs_offset + sizeof (dof_actdesc_t) > dof->dofh_loadsz) { dtrace_dof_error(dof, "truncated action description"); return (NULL); } - if (sec->dofs_align != sizeof_uarg) { + if (sec->dofs_align != sizeof (uint64_t)) { dtrace_dof_error(dof, "bad alignment in action description"); return (NULL); } @@ -13873,7 +13844,7 @@ dtrace_dof_actdesc(dof_hdr_t *dof, dof_sec_t *sec, dtrace_vstate_t *vstate, return (NULL); } - if (sec->dofs_entsize != sizeof_dof_actdesc_t) { + if (sec->dofs_entsize != sizeof (dof_actdesc_t)) { dtrace_dof_error(dof, "bad entry size in action description"); return (NULL); } @@ -13884,14 +13855,8 @@ dtrace_dof_actdesc(dof_hdr_t *dof, dof_sec_t *sec, dtrace_vstate_t *vstate, } for (offs = 0; offs < sec->dofs_size; offs += sec->dofs_entsize) { - uintptr_t act_desc = daddr + (uintptr_t)sec->dofs_offset + offs; -#ifdef COMPAT_FREEBSD64 - if (!SV_CURPROC_FLAG(SV_CHERI)) - desc_storage = - freebsd64_dof_actdesc((dof_actdesc64_t *)act_desc); - else -#endif - desc_storage = *(dof_actdesc_t *)act_desc; + desc = (dof_actdesc_t *)(daddr + + (uintptr_t)sec->dofs_offset + offs); kind = (dtrace_actkind_t)desc->dofa_kind; if ((DTRACEACT_ISPRINTFLIKE(kind) && diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h index ff0ea99200fe..4f1186f51db7 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h @@ -779,17 +779,6 @@ typedef struct dof_actdesc { dtrace_uarg_t dofa_uarg; /* user-supplied argument */ } dof_actdesc_t; -#if defined(_KERNEL) && defined(COMPAT_FREEBSD64) -typedef struct dof_actdesc64 { - dof_secidx_t dofa_difo; /* link to DOF_SECT_DIFOHDR */ - dof_secidx_t dofa_strtab; /* link to DOF_SECT_STRTAB section */ - uint32_t dofa_kind; /* action kind (DTRACEACT_* constant) */ - uint32_t dofa_ntuple; /* number of subsequent tuple actions */ - uint64_t dofa_arg; /* kind-specific argument */ - uint64_t dofa_uarg; -} dof_actdesc64_t; -#endif - typedef struct dof_difohdr { dtrace_diftype_t dofd_rtype; /* return type for this fragment */ dof_secidx_t dofd_links[1]; /* variable length array of indices */ @@ -996,18 +985,6 @@ typedef struct dtrace_recdesc { dtrace_uarg_t dtrd_uarg; /* user argument */ } dtrace_recdesc_t; -#if defined(_KERNEL) && defined(COMPAT_FREEBSD64) -typedef struct dtrace_recdesc64 { - dtrace_actkind_t dtrd_action; /* kind of action */ - uint32_t dtrd_size; /* size of record */ - uint32_t dtrd_offset; /* offset in ECB's data */ - uint16_t dtrd_alignment; /* required alignment */ - uint16_t dtrd_format; /* format, if any */ - uint64_t dtrd_arg; /* action argument */ - uint64_t dtrd_uarg; /* user argument */ -} dtrace_recdesc64_t; -#endif - typedef struct dtrace_eprobedesc { dtrace_epid_t dtepd_epid; /* enabled probe ID */ dtrace_id_t dtepd_probeid; /* probe ID */ @@ -1017,17 +994,6 @@ typedef struct dtrace_eprobedesc { dtrace_recdesc_t dtepd_rec[1]; /* records themselves */ } dtrace_eprobedesc_t; -#if defined(_KERNEL) && defined(COMPAT_FREEBSD64) -typedef struct dtrace_eprobedesc64 { - dtrace_epid_t dtepd_epid; /* enabled probe ID */ - dtrace_id_t dtepd_probeid; /* probe ID */ - uint64_t dtepd_uarg; /* library argument */ - uint32_t dtepd_size; /* total size */ - int dtepd_nrecs; /* number of records */ - dtrace_recdesc64_t dtepd_rec[1]; /* records themselves */ -} dtrace_eprobedesc64_t; -#endif - typedef struct dtrace_aggdesc { DTRACE_PTR(char, dtagd_name); /* not filled in by kernel */ dtrace_aggvarid_t dtagd_varid; /* not filled in by kernel */ @@ -1040,34 +1006,12 @@ typedef struct dtrace_aggdesc { dtrace_recdesc_t dtagd_rec[1]; /* record descriptions */ } dtrace_aggdesc_t; -#if defined(_KERNEL) && defined(COMPAT_FREEBSD64) -typedef struct dtrace_aggdesc64 { - uint64_t tagd_name; // char * /* not filled in by kernel */ - dtrace_aggvarid_t dtagd_varid; /* not filled in by kernel */ - int dtagd_flags; /* not filled in by kernel */ - dtrace_aggid_t dtagd_id; /* aggregation ID */ - dtrace_epid_t dtagd_epid; /* enabled probe ID */ - uint32_t dtagd_size; /* size in bytes */ - int dtagd_nrecs; /* number of records */ - uint32_t dtagd_pad; /* explicit padding */ - dtrace_recdesc64_t dtagd_rec[1]; /* record descriptions */ -} dtrace_aggdesc64_t; -#endif - typedef struct dtrace_fmtdesc { DTRACE_PTR(char, dtfd_string); /* format string */ int dtfd_length; /* length of format string */ uint16_t dtfd_format; /* format identifier */ } dtrace_fmtdesc_t; -#if defined(_KERNEL) && defined(COMPAT_FREEBSD64) -typedef struct dtrace_fmtdesc64 { - uint64_t dtfd_string; // char * /* format string */ - int dtfd_length; /* length of format string */ - uint16_t dtfd_format; /* format identifier */ -} dtrace_fmtdesc64_t; -#endif - #define DTRACE_SIZEOF_EPROBEDESC(desc) \ (sizeof (dtrace_eprobedesc_t) + ((desc)->dtepd_nrecs ? \ (((desc)->dtepd_nrecs - 1) * sizeof (dtrace_recdesc_t)) : 0)) @@ -1159,18 +1103,6 @@ typedef struct dtrace_bufdesc { uint64_t dtbd_timestamp; /* hrtime of snapshot */ } dtrace_bufdesc_t; -#if defined(_KERNEL) && defined(COMPAT_FREEBSD64) -typedef struct dtrace_bufdesc64 { - uint64_t dtbd_size; /* size of buffer */ - uint32_t dtbd_cpu; /* CPU or DTRACE_CPUALL */ - uint32_t dtbd_errors; /* number of errors */ - uint64_t dtbd_drops; /* number of drops */ - uint64_t dtbd_data; // char * /* data */ - uint64_t dtbd_oldest; /* offset of oldest record */ - uint64_t dtbd_timestamp; /* hrtime of snapshot */ -} dtrace_bufdesc64_t; -#endif - /* * Each record in the buffer (dtbd_data) begins with a header that includes * the epid and a timestamp. The timestamp is split into two 4-byte parts @@ -1389,13 +1321,6 @@ typedef struct { int n_matched; /* # matches returned by driver. */ } dtrace_enable_io_t; -#if defined(_KERNEL) && defined(COMPAT_FREEBSD64) -typedef struct { - uint64_t dof; /* DOF userland address written to driver. */ - int n_matched; /* # matches returned by driver. */ -} dtrace_enable_io64_t; -#endif - #define DTRACEIOC_ENABLE _IOWR('x',6,dtrace_enable_io_t) /* enable probes */ #define DTRACEIOC_AGGSNAP _IOW('x',7,dtrace_bufdesc_t * __kerncap) @@ -1421,15 +1346,6 @@ typedef struct { #define DTRACEIOC_REPLICATE _IOW('x',18,dtrace_repldesc_t) /* replicate enab */ -#if defined(_KERNEL) && defined(COMPAT_FREEBSD64) -#define DTRACEIOC_BUFSNAP64 _IOC_NEWTYPE(DTRACEIOC_BUFSNAP, uint64_t) -#define DTRACEIOC_ENABLE64 _IOC_NEWTYPE(DTRACEIOC_ENABLE, dtrace_enable_io64_t) -#define DTRACEIOC_AGGSNAP64 _IOC_NEWTYPE(DTRACEIOC_AGGSNAP, uint64_t) -#define DTRACEIOC_EPROBE64 _IOC_NEWTYPE(DTRACEIOC_EPROBE, uint64_t) -#define DTRACEIOC_AGGDESC64 _IOC_NEWTYPE(DTRACEIOC_AGGDESC, uint64_t) -#define DTRACEIOC_FORMAT64 _IOC_NEWTYPE(DTRACEIOC_FORMAT, dtrace_fmtdesc64_t) -#define DTRACEIOC_DOFGET64 _IOC_NEWTYPE(DTRACEIOC_DOFGET, uint64_t) -#endif #endif /* diff --git a/sys/cddl/dev/dtrace/dtrace_ioctl.c b/sys/cddl/dev/dtrace/dtrace_ioctl.c index a2969b920a0d..22ad389369da 100644 --- a/sys/cddl/dev/dtrace/dtrace_ioctl.c +++ b/sys/cddl/dev/dtrace/dtrace_ioctl.c @@ -20,27 +20,12 @@ * */ -#include -#include - static int dtrace_verbose_ioctl; SYSCTL_INT(_debug_dtrace, OID_AUTO, verbose_ioctl, CTLFLAG_RW, &dtrace_verbose_ioctl, 0, "log DTrace ioctls"); #define DTRACE_IOCTL_PRINTF(fmt, ...) if (dtrace_verbose_ioctl) printf(fmt, ## __VA_ARGS__ ) -#ifdef COMPAT_FREEBSD64 -#define SIZEOF(base_type) \ - (SV_CURPROC_FLAG(SV_CHERI) ? sizeof (base_type##_t) : \ - sizeof (base_type##64_t) ) -#define OFFSETOF(base_type, field) \ - (SV_CURPROC_FLAG(SV_CHERI) ? offsetof(base_type##_t, field) : \ - offsetof(base_type##64_t, field) ) -#else -#define SIZEOF(base_type) (sizeof (base_type##_t)) -#define OFFSETOF(base_type, field) offsetof(base_type##_t, field) -#endif - static int dtrace_ioctl_helper(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td) @@ -121,10 +106,9 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, state = state->dts_anon; } - cmd = dtrace_translate_ioctl_to_native(cmd); switch (cmd) { case DTRACEIOC_AGGDESC: { - void * __capability paggdesc = dtrace_make_aggdesc_cap(addr); + void * __capability paggdesc = *(dtrace_aggdesc_t * __capability *)addr; dtrace_aggdesc_t aggdesc; dtrace_action_t *act; dtrace_aggregation_t *agg; @@ -137,7 +121,7 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, DTRACE_IOCTL_PRINTF("%s(%d): DTRACEIOC_AGGDESC\n",__func__,__LINE__); - if (dtrace_copyin_aggdesc(paggdesc, &aggdesc) != 0) + if (copyincap(paggdesc, &aggdesc, sizeof (aggdesc)) != 0) return (EFAULT); mutex_enter(&dtrace_lock); @@ -185,14 +169,14 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, * the temporary buffer to be able to drop dtrace_lock() * across the copyout(), below. */ - size = SIZEOF(dtrace_aggdesc) + - (aggdesc.dtagd_nrecs * SIZEOF(dtrace_recdesc)); + size = sizeof (dtrace_aggdesc_t) + + (aggdesc.dtagd_nrecs * sizeof (dtrace_recdesc_t)); buf = kmem_alloc(size, KM_SLEEP); dest = (uintptr_t)buf; - dtrace_copy_aggdesc(&aggdesc, (void *)dest); - dest += OFFSETOF(dtrace_aggdesc, dtagd_rec[0]); + bcopy(&aggdesc, (void *)dest, sizeof (aggdesc)); + dest += offsetof(dtrace_aggdesc_t, dtagd_rec[0]); for (act = agg->dtag_first; ; act = act->dta_next) { dtrace_recdesc_t rec = act->dta_rec; @@ -210,9 +194,8 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, break; rec.dtrd_offset -= offs; - dtrace_copy_recdesc(&rec, (void *)dest); - rec.dtrd_offset += offs; - dest += SIZEOF(dtrace_recdesc); + bcopy(&rec, (void *)dest, sizeof (rec)); + dest += sizeof (dtrace_recdesc_t); if (act == &agg->dtag_action) break; @@ -230,14 +213,14 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, } case DTRACEIOC_AGGSNAP: case DTRACEIOC_BUFSNAP: { - void *__capability pdesc = dtrace_make_buffdesc_cap(addr); + void *__capability pdesc = *(dtrace_bufdesc_t * __capability *)addr; dtrace_bufdesc_t desc; caddr_t cached; dtrace_buffer_t *buf; dtrace_debug_output(); - if (dtrace_copyin_buffdesc(pdesc, &desc) != 0) + if (copyincap(pdesc, &desc, sizeof (desc)) != 0) return (EFAULT); DTRACE_IOCTL_PRINTF("%s(%d): %s curcpu %d cpu %d\n", @@ -279,7 +262,7 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, desc.dtbd_oldest = 0; sz = sizeof (desc); - if (dtrace_copyout_buffdesc(&desc, pdesc) != 0) + if (copyoutcap(&desc, pdesc, sz) != 0) return (EFAULT); return (0); @@ -307,7 +290,7 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, mutex_exit(&dtrace_lock); - if (dtrace_copyout_buffdesc(&desc, pdesc) != 0) + if (copyoutcap(&desc, pdesc, sizeof (desc)) != 0) return (EFAULT); buf->dtb_flags |= DTRACEBUF_CONSUMED; @@ -367,7 +350,7 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, /* * Finally, copy out the buffer description. */ - if (dtrace_copyout_buffdesc(&desc, pdesc) != 0) + if (copyoutcap(&desc, pdesc, sizeof (desc)) != 0) return (EFAULT); return (0); @@ -388,7 +371,7 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, return (0); } case DTRACEIOC_DOFGET: { - dof_hdr_t * __capability pdof = dtrace_make_pdof_cap(addr); + dof_hdr_t * __capability pdof = *(dof_hdr_t * __capability *)addr; dof_hdr_t hdr, *dof; int rval; uint64_t len; @@ -414,8 +397,7 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, dtrace_vstate_t *vstate; int err = 0; int rval; - dtrace_enable_io_t _p = dtrace_make_enable_io(addr); - dtrace_enable_io_t *p = &_p; + dtrace_enable_io_t *p = (dtrace_enable_io_t *) addr; DTRACE_IOCTL_PRINTF("%s(%d): DTRACEIOC_ENABLE\n",__func__,__LINE__); @@ -465,7 +447,6 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, dtrace_enabling_destroy(enab); } - dtrace_copy_enable_io(p, addr); mutex_exit(&cpu_lock); mutex_exit(&dtrace_lock); dtrace_dof_destroy(dof); @@ -473,7 +454,7 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, return (err); } case DTRACEIOC_EPROBE: { - void * __capability pepdesc = dtrace_make_eprobedesc_cap(addr); + void * __capability pepdesc = *(dtrace_eprobedesc_t * __capability *)addr; dtrace_eprobedesc_t epdesc; dtrace_ecb_t *ecb; dtrace_action_t *act; @@ -484,7 +465,7 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, DTRACE_IOCTL_PRINTF("%s(%d): DTRACEIOC_EPROBE\n",__func__,__LINE__); - if (copyincap(pepdesc, &epdesc, SIZEOF(dtrace_eprobedesc)) != 0) + if (copyincap(pepdesc, &epdesc, sizeof (dtrace_eprobedesc_t)) != 0) return (EFAULT); mutex_enter(&dtrace_lock); @@ -518,14 +499,14 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, * the temporary buffer to be able to drop dtrace_lock() * across the copyout(), below. */ - size = SIZEOF(dtrace_eprobedesc) + - (epdesc.dtepd_nrecs * SIZEOF(dtrace_recdesc)); + size = sizeof (dtrace_eprobedesc_t) + + (epdesc.dtepd_nrecs * sizeof (dtrace_recdesc_t)); buf = kmem_alloc(size, KM_SLEEP); dest = (uintptr_t)buf; - bcopy(&epdesc, (void *)dest, SIZEOF(dtrace_eprobedesc)); - dest += OFFSETOF(dtrace_eprobedesc, dtepd_rec[0]); + bcopy(&epdesc, (void *)dest, sizeof (dtrace_eprobedesc_t)); + dest += offsetof(dtrace_eprobedesc_t, dtepd_rec[0]); for (act = ecb->dte_action; act != NULL; act = act->dta_next) { if (DTRACEACT_ISAGG(act->dta_kind) || act->dta_intuple) @@ -534,8 +515,9 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, if (nrecs-- == 0) break; - dtrace_copy_recdesc(&act->dta_rec,(void *)dest); - dest += SIZEOF(dtrace_recdesc); + bcopy(&act->dta_rec, (void *)dest, + sizeof (dtrace_recdesc_t)); + dest += sizeof (dtrace_recdesc_t); } mutex_exit(&dtrace_lock); @@ -549,8 +531,7 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, return (0); } case DTRACEIOC_FORMAT: { - dtrace_fmtdesc_t _fmt = dtrace_make_fmtdesc(addr); - dtrace_fmtdesc_t *fmt = &_fmt; + dtrace_fmtdesc_t *fmt = (dtrace_fmtdesc_t *) addr; char *str; int len; @@ -585,7 +566,6 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, } } - dtrace_copy_fmtdesc(fmt, addr); mutex_exit(&dtrace_lock); return (0); } @@ -864,6 +844,3 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, } return (error); } - -#undef SIZEOF -#undef OFFSETOF diff --git a/sys/cddl/dev/dtrace/dtrace_ioctl_compat.c b/sys/cddl/dev/dtrace/dtrace_ioctl_compat.c deleted file mode 100644 index 7cc633a94b0b..000000000000 --- a/sys/cddl/dev/dtrace/dtrace_ioctl_compat.c +++ /dev/null @@ -1,276 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License (the "License"). - * You may not use this file except in compliance with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - * - * $FreeBSD$ - * - */ - -static void * __capability -dtrace_make_buffdesc_cap(caddr_t addr) -{ -#ifdef COMPAT_FREEBSD64 - if (!SV_CURPROC_FLAG(SV_CHERI)) - return (__USER_CAP_OBJ(*(dtrace_bufdesc64_t **)addr)); -#endif - return (*(dtrace_bufdesc_t * __capability *)addr); -} - -static int -dtrace_copyin_buffdesc(dtrace_bufdesc_t * __capability uaddr, - dtrace_bufdesc_t *bufdesc) -{ -#ifdef COMPAT_FREEBSD64 - if (!SV_CURPROC_FLAG(SV_CHERI)) { - dtrace_bufdesc64_t bufdesc64; - int error = copyin(uaddr, &bufdesc64, sizeof (bufdesc64)); - if (error != 0) - return (error); - bufdesc->dtbd_size = bufdesc64.dtbd_size; - bufdesc->dtbd_cpu = bufdesc64.dtbd_cpu; - bufdesc->dtbd_errors = bufdesc64.dtbd_errors; - bufdesc->dtbd_drops = bufdesc64.dtbd_drops; - bufdesc->dtbd_data = __USER_CAP_STR(bufdesc64.dtbd_data); - bufdesc->dtbd_oldest = bufdesc64.dtbd_oldest; - bufdesc->dtbd_timestamp = bufdesc64.dtbd_timestamp; - return (0); - } -#endif - return (copyincap(uaddr, bufdesc, sizeof (dtrace_bufdesc_t))); -} - -static int -dtrace_copyout_buffdesc(dtrace_bufdesc_t *bufdesc, - dtrace_bufdesc_t * __capability uaddr) -{ -#ifdef COMPAT_FREEBSD64 - if (!SV_CURPROC_FLAG(SV_CHERI)) { - dtrace_bufdesc64_t bufdesc64; - bufdesc64.dtbd_size = bufdesc->dtbd_size; - bufdesc64.dtbd_cpu = bufdesc->dtbd_cpu; - bufdesc64.dtbd_errors = bufdesc->dtbd_errors; - bufdesc64.dtbd_drops = bufdesc->dtbd_drops; - bufdesc64.dtbd_data = (__cheri_addr uint64_t)bufdesc->dtbd_data; - bufdesc64.dtbd_oldest = bufdesc->dtbd_oldest; - bufdesc64.dtbd_timestamp = bufdesc->dtbd_timestamp; - return (copyout(&bufdesc64, uaddr, sizeof(dtrace_bufdesc64_t))); - } -#endif - return (copyoutcap(bufdesc, uaddr, sizeof (dtrace_bufdesc_t))); -} - -static void -dtrace_copy_recdesc(const dtrace_recdesc_t *recdesc, void *dest) -{ -#ifdef COMPAT_FREEBSD64 - if (!SV_CURPROC_FLAG(SV_CHERI)) { - dtrace_recdesc64_t recdesc64; - recdesc64.dtrd_action = recdesc->dtrd_action; - recdesc64.dtrd_size = recdesc->dtrd_size; - recdesc64.dtrd_offset = recdesc->dtrd_offset; - recdesc64.dtrd_alignment = recdesc->dtrd_alignment; - recdesc64.dtrd_format = recdesc->dtrd_format; - recdesc64.dtrd_arg = recdesc->dtrd_arg; - recdesc64.dtrd_uarg = (__cheri_addr uint64_t)recdesc->dtrd_uarg; - bcopy(&recdesc64, dest, sizeof (dtrace_recdesc64_t)); - return; - } -#endif - bcopy(recdesc, dest, sizeof (dtrace_recdesc_t)); -} - -static void -dtrace_copy_aggdesc(const dtrace_aggdesc_t *aggdesc, void *dest) -{ -#ifdef COMPAT_FREEBSD64 - if (!SV_CURPROC_FLAG(SV_CHERI)) { - dtrace_aggdesc64_t aggdesc64; - aggdesc64.tagd_name = - (__cheri_addr uint64_t)aggdesc->dtagd_name; - aggdesc64.dtagd_varid = aggdesc->dtagd_varid; - aggdesc64.dtagd_flags = aggdesc->dtagd_flags; - aggdesc64.dtagd_id = aggdesc->dtagd_id; - aggdesc64.dtagd_epid = aggdesc->dtagd_epid; - aggdesc64.dtagd_size = aggdesc->dtagd_size; - aggdesc64.dtagd_nrecs = aggdesc->dtagd_nrecs; - aggdesc64.dtagd_pad = aggdesc->dtagd_pad; - bcopy(&aggdesc64, dest, sizeof (dtrace_aggdesc64_t)); - return; - } -#endif - bcopy(aggdesc, dest, sizeof (dtrace_aggdesc_t)); -} - -static void * __capability -dtrace_make_aggdesc_cap(caddr_t addr) -{ -#ifdef COMPAT_FREEBSD64 - if (!SV_CURPROC_FLAG(SV_CHERI)) - return (__USER_CAP_OBJ(*(dtrace_aggdesc64_t **)addr)); -#endif - return (*(dtrace_aggdesc_t * __capability *)addr); -} - -static int -dtrace_copyin_aggdesc(void * __capability uaddr, dtrace_aggdesc_t *aggdesc) -{ -#ifdef COMPAT_FREEBSD64 - if (!SV_CURPROC_FLAG(SV_CHERI)) { - dtrace_aggdesc64_t aggdesc64; - int error = copyin(uaddr, &aggdesc64, sizeof (aggdesc64)); - if (error != 0) - return (error); - aggdesc->dtagd_name = - __USER_CAP_STR((void *)aggdesc64.tagd_name); - aggdesc->dtagd_varid = aggdesc64.dtagd_varid; - aggdesc->dtagd_flags = aggdesc64.dtagd_flags; - aggdesc->dtagd_id = aggdesc64.dtagd_id; - aggdesc->dtagd_epid = aggdesc64.dtagd_epid; - aggdesc->dtagd_size = aggdesc64.dtagd_size; - aggdesc->dtagd_nrecs = aggdesc64.dtagd_nrecs; - aggdesc->dtagd_pad = aggdesc64.dtagd_pad; - return (0); - } -#endif - return (copyincap(uaddr, aggdesc, sizeof (dtrace_bufdesc_t))); -} - -static u_long -dtrace_translate_ioctl_to_native(u_long cmd) -{ - -#define CASE(VAL) \ - case VAL##64: \ - return (VAL) - -#ifdef COMPAT_FREEBSD64 - switch (cmd) { - CASE(DTRACEIOC_AGGDESC); - CASE(DTRACEIOC_AGGSNAP); - CASE(DTRACEIOC_BUFSNAP); - CASE(DTRACEIOC_DOFGET); - CASE(DTRACEIOC_ENABLE); - CASE(DTRACEIOC_EPROBE); - CASE(DTRACEIOC_FORMAT); - } -#endif -#undef CASE - - return (cmd); -} - -static dof_hdr_t * __capability -dtrace_make_pdof_cap(caddr_t addr) -{ -#ifdef COMPAT_FREEBSD64 - if (!SV_CURPROC_FLAG(SV_CHERI)) { - return (__USER_CAP_OBJ(*(dof_hdr_t **)addr)); - } -#endif - return (*(dof_hdr_t * __capability *)addr); -} - -static dtrace_enable_io_t -dtrace_make_enable_io(caddr_t addr) -{ -#ifdef COMPAT_FREEBSD64 - dtrace_enable_io_t enable; - - if (!SV_CURPROC_FLAG(SV_CHERI)) { - dtrace_enable_io64_t *p64 = (dtrace_enable_io64_t *)addr; - enable.dof = __USER_CAP_UNBOUND((void *)p64->dof); - enable.n_matched = p64->n_matched; - return (enable); - } -#endif - return (*(dtrace_enable_io_t *)addr); -} - -static void -dtrace_copy_enable_io(const dtrace_enable_io_t *from, caddr_t to) -{ -#ifdef COMPAT_FREEBSD64 - dtrace_enable_io_t enable; - - if (!SV_CURPROC_FLAG(SV_CHERI)) { - dtrace_enable_io64_t p64; - p64.dof = (__cheri_addr uint64_t)from->dof; - p64.n_matched = from->n_matched; - bcopy(&p64, (void *)to, sizeof (dtrace_enable_io64_t)); - return; - } -#endif - bcopy(from, (void *)to, sizeof (dtrace_enable_io_t)); -} - -static void * __capability -dtrace_make_eprobedesc_cap(caddr_t addr) -{ -#ifdef COMPAT_FREEBSD64 - if (!SV_CURPROC_FLAG(SV_CHERI)) { - return (__USER_CAP_OBJ(*(dtrace_eprobedesc64_t **)addr)); - } -#endif - return (*(dtrace_eprobedesc_t * __capability *)addr); -} - -static dtrace_fmtdesc_t -dtrace_make_fmtdesc(caddr_t addr) -{ -#ifdef COMPAT_FREEBSD64 - dtrace_fmtdesc_t desc; - if (!SV_CURPROC_FLAG(SV_CHERI)) { - dtrace_fmtdesc64_t *p64 = (dtrace_fmtdesc64_t *)addr; - desc.dtfd_string = __USER_CAP_STR(p64->dtfd_string); - desc.dtfd_length = p64->dtfd_length; - desc.dtfd_format = p64->dtfd_format; - return (desc); - } -#endif - return (*(dtrace_fmtdesc_t *)addr); -} - -static void -dtrace_copy_fmtdesc(const dtrace_fmtdesc_t *fmtdesc, caddr_t to) -{ -#ifdef COMPAT_FREEBSD64 - dtrace_fmtdesc_t desc; - if (!SV_CURPROC_FLAG(SV_CHERI)) { - dtrace_fmtdesc64_t fmt64; - fmt64.dtfd_string = (__cheri_addr uint64_t)fmtdesc->dtfd_string; - fmt64.dtfd_length = fmtdesc->dtfd_length; - fmt64.dtfd_format = fmtdesc->dtfd_format; - bcopy(&fmt64, (void *)to, sizeof (dtrace_fmtdesc64_t)); - return; - } -#endif - bcopy(fmtdesc, (void *)to, sizeof (dtrace_fmtdesc_t)); -} -/* - * CHERI CHANGES START - * { - * "updated": 20230509, - * "target_type": "kernel", - * "changes": [ - * "support", - * "ctoptr" - * ] - * } - * CHERI CHANGES END - */ From d3d26ed9e23cb3ced4d57e2f3e846c9315465655 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 22 Jan 2025 21:21:49 +0000 Subject: [PATCH 18/47] sys/tools/syscalls: Convert sysent probe parameters to intcap_t --- sys/tools/syscalls/config.lua | 2 ++ sys/tools/syscalls/scripts/systrace_args.lua | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/tools/syscalls/config.lua b/sys/tools/syscalls/config.lua index 29723ab60535..7256d6707d5a 100644 --- a/sys/tools/syscalls/config.lua +++ b/sys/tools/syscalls/config.lua @@ -48,6 +48,8 @@ local config = { abi_headers = "", abi_intptr_t = "intptr_t", ptr_intptr_t_cast = "intptr_t", + abi_intcap_t = "intcap_t", + ptr_intcap_t_cast = "intcap_t", ptr_qualified = "*", obsol = {}, unimpl = {}, diff --git a/sys/tools/syscalls/scripts/systrace_args.lua b/sys/tools/syscalls/scripts/systrace_args.lua index 88170b85e737..77b12373c5f3 100755 --- a/sys/tools/syscalls/scripts/systrace_args.lua +++ b/sys/tools/syscalls/scripts/systrace_args.lua @@ -43,9 +43,9 @@ function systrace_args.generate(tbl, config, fh) gen:write(string.format([[ static void -systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) +systrace_args(int sysnum, void *params, uintcap_t *uarg, int *n_args) { - int64_t *iarg = (int64_t *)uarg; + intcap_t *iarg = (intcap_t *)uarg; int a = 0; switch (sysnum) { ]])) @@ -144,11 +144,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz) end if util.isPtrType(argtype, - config.abi_intptr_t) then + config.abi_intcap_t) then gen:write(string.format([[ uarg[a++] = (%s)p->%s; /* %s */ ]], - config.ptr_intptr_t_cast, + config.ptr_intcap_t_cast, arg.name, argtype)) elseif argtype == "union l_semun" then gen:write(string.format([[ From 30b36366f4d4ca9ca60cf9c9b1ef01c574ed1468 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 22 Jan 2025 21:26:07 +0000 Subject: [PATCH 19/47] dtrace: Build systrace_freebsd32 only if COMPAT_FREEBSD32 is configured MFC after: 1 week Sponsored by: Innovate UK (cherry picked from commit 1e734f15c7099408f45d3b1ea433868d0468916f) --- sys/modules/dtrace/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/modules/dtrace/Makefile b/sys/modules/dtrace/Makefile index 9a67f517fc5c..3a3769b8b4b5 100644 --- a/sys/modules/dtrace/Makefile +++ b/sys/modules/dtrace/Makefile @@ -27,8 +27,10 @@ SUBDIR+= fasttrap .if ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_ARCH} == "powerpc64" +.if !empty(COMPAT_FREEBSD32_ENABLED) SUBDIR+= systrace_freebsd32 .endif +.endif .if ${MACHINE_CPUARCH} != "powerpc" || ${MACHINE_ARCH} == "powerpc64" SUBDIR+= sdt .endif From 294cfdb8136fa23c2ad45277fdd10218c149e5b9 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 22 Jan 2025 21:36:07 +0000 Subject: [PATCH 20/47] systrace: Use uintcap_t for probe arguments Otherwise capabilities are truncated. Note that dtrace_probe()'s arguments are uintptr_t, so we were already truncating 64-bit syscall arguments on 32-bit platforms. --- sys/cddl/dev/systrace/systrace.c | 2 +- sys/sys/sysent.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c index c14a663d1995..9bdcfc3faa68 100644 --- a/sys/cddl/dev/systrace/systrace.c +++ b/sys/cddl/dev/systrace/systrace.c @@ -184,7 +184,7 @@ static dtrace_provider_id_t systrace_id; static void systrace_probe(struct syscall_args *sa, enum systrace_probe_t type, int retval) { - uint64_t uargs[nitems(sa->args)]; + uintcap_t uargs[nitems(sa->args)]; dtrace_id_t id; int n_args, sysnum; diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index 63be29543f07..861b99ba9df8 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -49,7 +49,7 @@ typedef int sy_call_t(struct thread *, void *); typedef void (*systrace_probe_func_t)(struct syscall_args *, enum systrace_probe_t, int); -typedef void (*systrace_args_func_t)(int, void *, uint64_t *, int *); +typedef void (*systrace_args_func_t)(int, void *, uintcap_t *, int *); #ifdef _KERNEL extern systrace_probe_func_t systrace_probe_func; From 809583f7d5ceebdf69e77d30f10b65d39443ea63 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 22 Jan 2025 21:36:26 +0000 Subject: [PATCH 21/47] systrace: Regenerate --- .../freebsd32/freebsd32_systrace_args.c | 854 ++++++++-------- .../freebsd64/freebsd64_systrace_args.c | 910 ++++++++--------- sys/kern/systrace_args.c | 916 +++++++++--------- 3 files changed, 1340 insertions(+), 1340 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_systrace_args.c b/sys/compat/freebsd32/freebsd32_systrace_args.c index 6e73bc8ce1da..7870c8fda8ce 100644 --- a/sys/compat/freebsd32/freebsd32_systrace_args.c +++ b/sys/compat/freebsd32/freebsd32_systrace_args.c @@ -10,9 +10,9 @@ */ static void -systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) +systrace_args(int sysnum, void *params, uintcap_t *uarg, int *n_args) { - int64_t *iarg = (int64_t *)uarg; + intcap_t *iarg = (intcap_t *)uarg; int a = 0; switch (sysnum) { /* syscall */ @@ -36,7 +36,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 3: { struct read_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* void * */ + uarg[a++] = (intcap_t)p->buf; /* void * */ uarg[a++] = p->nbyte; /* size_t */ *n_args = 3; break; @@ -45,7 +45,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 4: { struct write_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* const void * */ + uarg[a++] = (intcap_t)p->buf; /* const void * */ uarg[a++] = p->nbyte; /* size_t */ *n_args = 3; break; @@ -53,7 +53,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* open */ case 5: { struct open_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flags; /* int */ iarg[a++] = p->mode; /* mode_t */ *n_args = 3; @@ -70,31 +70,31 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 7: { struct freebsd32_wait4_args *p = params; iarg[a++] = p->pid; /* int */ - uarg[a++] = (intptr_t)p->status; /* int * */ + uarg[a++] = (intcap_t)p->status; /* int * */ iarg[a++] = p->options; /* int */ - uarg[a++] = (intptr_t)p->rusage; /* struct rusage32 * */ + uarg[a++] = (intcap_t)p->rusage; /* struct rusage32 * */ *n_args = 4; break; } /* link */ case 9: { struct link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->to; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->to; /* const char * */ *n_args = 2; break; } /* unlink */ case 10: { struct unlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* chdir */ case 12: { struct chdir_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } @@ -108,7 +108,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* chmod */ case 15: { struct chmod_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ *n_args = 2; break; @@ -116,7 +116,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* chown */ case 16: { struct chown_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->uid; /* int */ iarg[a++] = p->gid; /* int */ *n_args = 3; @@ -125,7 +125,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* break */ case 17: { struct break_args *p = params; - uarg[a++] = (intptr_t)p->nsize; /* char * */ + uarg[a++] = (intcap_t)p->nsize; /* char * */ *n_args = 1; break; } @@ -137,17 +137,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* mount */ case 21: { struct mount_args *p = params; - uarg[a++] = (intptr_t)p->type; /* const char * */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->type; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->data; /* void * */ *n_args = 4; break; } /* unmount */ case 22: { struct unmount_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flags; /* int */ *n_args = 2; break; @@ -174,7 +174,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd32_ptrace_args *p = params; iarg[a++] = p->req; /* int */ iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->addr; /* char * */ + uarg[a++] = (intcap_t)p->addr; /* char * */ iarg[a++] = p->data; /* int */ *n_args = 4; break; @@ -183,7 +183,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 27: { struct freebsd32_recvmsg_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->msg; /* struct msghdr32 * */ + uarg[a++] = (intcap_t)p->msg; /* struct msghdr32 * */ iarg[a++] = p->flags; /* int */ *n_args = 3; break; @@ -192,7 +192,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 28: { struct freebsd32_sendmsg_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->msg; /* const struct msghdr32 * */ + uarg[a++] = (intcap_t)p->msg; /* const struct msghdr32 * */ iarg[a++] = p->flags; /* int */ *n_args = 3; break; @@ -201,11 +201,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 29: { struct recvfrom_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->buf; /* void * */ + uarg[a++] = (intcap_t)p->buf; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->from; /* struct sockaddr * */ - uarg[a++] = (intptr_t)p->fromlenaddr; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->from; /* struct sockaddr * */ + uarg[a++] = (intcap_t)p->fromlenaddr; /* __socklen_t * */ *n_args = 6; break; } @@ -213,8 +213,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 30: { struct accept_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* struct sockaddr * */ - uarg[a++] = (intptr_t)p->anamelen; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->name; /* struct sockaddr * */ + uarg[a++] = (intcap_t)p->anamelen; /* __socklen_t * */ *n_args = 3; break; } @@ -222,8 +222,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 31: { struct getpeername_args *p = params; iarg[a++] = p->fdes; /* int */ - uarg[a++] = (intptr_t)p->asa; /* struct sockaddr * */ - uarg[a++] = (intptr_t)p->alen; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->asa; /* struct sockaddr * */ + uarg[a++] = (intcap_t)p->alen; /* __socklen_t * */ *n_args = 3; break; } @@ -231,15 +231,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 32: { struct getsockname_args *p = params; iarg[a++] = p->fdes; /* int */ - uarg[a++] = (intptr_t)p->asa; /* struct sockaddr * */ - uarg[a++] = (intptr_t)p->alen; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->asa; /* struct sockaddr * */ + uarg[a++] = (intcap_t)p->alen; /* __socklen_t * */ *n_args = 3; break; } /* access */ case 33: { struct access_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->amode; /* int */ *n_args = 2; break; @@ -247,7 +247,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* chflags */ case 34: { struct chflags_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ uarg[a++] = p->flags; /* u_long */ *n_args = 2; break; @@ -293,7 +293,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* profil */ case 44: { struct profil_args *p = params; - uarg[a++] = (intptr_t)p->samples; /* char * */ + uarg[a++] = (intcap_t)p->samples; /* char * */ uarg[a++] = p->size; /* size_t */ uarg[a++] = p->offset; /* size_t */ uarg[a++] = p->scale; /* u_int */ @@ -303,7 +303,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* ktrace */ case 45: { struct ktrace_args *p = params; - uarg[a++] = (intptr_t)p->fname; /* const char * */ + uarg[a++] = (intcap_t)p->fname; /* const char * */ iarg[a++] = p->ops; /* int */ iarg[a++] = p->facs; /* int */ iarg[a++] = p->pid; /* int */ @@ -318,7 +318,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* getlogin */ case 49: { struct getlogin_args *p = params; - uarg[a++] = (intptr_t)p->namebuf; /* char * */ + uarg[a++] = (intcap_t)p->namebuf; /* char * */ uarg[a++] = p->namelen; /* u_int */ *n_args = 2; break; @@ -326,22 +326,22 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* setlogin */ case 50: { struct setlogin_args *p = params; - uarg[a++] = (intptr_t)p->namebuf; /* const char * */ + uarg[a++] = (intcap_t)p->namebuf; /* const char * */ *n_args = 1; break; } /* acct */ case 51: { struct acct_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd32_sigaltstack */ case 53: { struct freebsd32_sigaltstack_args *p = params; - uarg[a++] = (intptr_t)p->ss; /* const struct sigaltstack32 * */ - uarg[a++] = (intptr_t)p->oss; /* struct sigaltstack32 * */ + uarg[a++] = (intcap_t)p->ss; /* const struct sigaltstack32 * */ + uarg[a++] = (intcap_t)p->oss; /* struct sigaltstack32 * */ *n_args = 2; break; } @@ -350,7 +350,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd32_ioctl_args *p = params; iarg[a++] = p->fd; /* int */ uarg[a++] = p->com; /* u_long */ - uarg[a++] = (intptr_t)p->data; /* char * */ + uarg[a++] = (intcap_t)p->data; /* char * */ *n_args = 3; break; } @@ -364,23 +364,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* revoke */ case 56: { struct revoke_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* symlink */ case 57: { struct symlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->link; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->link; /* const char * */ *n_args = 2; break; } /* readlink */ case 58: { struct readlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->buf; /* char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->buf; /* char * */ uarg[a++] = p->count; /* size_t */ *n_args = 3; break; @@ -388,9 +388,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_execve */ case 59: { struct freebsd32_execve_args *p = params; - uarg[a++] = (intptr_t)p->fname; /* const char * */ - uarg[a++] = (intptr_t)p->argv; /* uint32_t * */ - uarg[a++] = (intptr_t)p->envv; /* uint32_t * */ + uarg[a++] = (intcap_t)p->fname; /* const char * */ + uarg[a++] = (intcap_t)p->argv; /* uint32_t * */ + uarg[a++] = (intcap_t)p->envv; /* uint32_t * */ *n_args = 3; break; } @@ -404,14 +404,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* chroot */ case 61: { struct chroot_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* msync */ case 65: { struct msync_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * */ + uarg[a++] = (intcap_t)p->addr; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->flags; /* int */ *n_args = 3; @@ -425,7 +425,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* munmap */ case 73: { struct munmap_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * */ + uarg[a++] = (intcap_t)p->addr; /* void * */ uarg[a++] = p->len; /* size_t */ *n_args = 2; break; @@ -433,7 +433,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_mprotect */ case 74: { struct freebsd32_mprotect_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * */ + uarg[a++] = (intcap_t)p->addr; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->prot; /* int */ *n_args = 3; @@ -442,7 +442,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* madvise */ case 75: { struct madvise_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * */ + uarg[a++] = (intcap_t)p->addr; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->behav; /* int */ *n_args = 3; @@ -451,9 +451,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* mincore */ case 78: { struct mincore_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* const void * */ + uarg[a++] = (intcap_t)p->addr; /* const void * */ uarg[a++] = p->len; /* size_t */ - uarg[a++] = (intptr_t)p->vec; /* char * */ + uarg[a++] = (intcap_t)p->vec; /* char * */ *n_args = 3; break; } @@ -461,7 +461,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 79: { struct getgroups_args *p = params; iarg[a++] = p->gidsetsize; /* int */ - uarg[a++] = (intptr_t)p->gidset; /* gid_t * */ + uarg[a++] = (intcap_t)p->gidset; /* gid_t * */ *n_args = 2; break; } @@ -469,7 +469,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 80: { struct setgroups_args *p = params; iarg[a++] = p->gidsetsize; /* int */ - uarg[a++] = (intptr_t)p->gidset; /* const gid_t * */ + uarg[a++] = (intcap_t)p->gidset; /* const gid_t * */ *n_args = 2; break; } @@ -490,15 +490,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 83: { struct freebsd32_setitimer_args *p = params; iarg[a++] = p->which; /* int */ - uarg[a++] = (intptr_t)p->itv; /* const struct itimerval32 * */ - uarg[a++] = (intptr_t)p->oitv; /* struct itimerval32 * */ + uarg[a++] = (intcap_t)p->itv; /* const struct itimerval32 * */ + uarg[a++] = (intcap_t)p->oitv; /* struct itimerval32 * */ *n_args = 3; break; } /* swapon */ case 85: { struct swapon_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ *n_args = 1; break; } @@ -506,7 +506,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 86: { struct freebsd32_getitimer_args *p = params; iarg[a++] = p->which; /* int */ - uarg[a++] = (intptr_t)p->itv; /* struct itimerval32 * */ + uarg[a++] = (intcap_t)p->itv; /* struct itimerval32 * */ *n_args = 2; break; } @@ -528,7 +528,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd32_fcntl_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->arg; /* intptr32_t */ + iarg[a++] = p->arg; /* intptr32_t */ *n_args = 3; break; } @@ -536,10 +536,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 93: { struct freebsd32_select_args *p = params; iarg[a++] = p->nd; /* int */ - uarg[a++] = (intptr_t)p->in; /* fd_set * */ - uarg[a++] = (intptr_t)p->ou; /* fd_set * */ - uarg[a++] = (intptr_t)p->ex; /* fd_set * */ - uarg[a++] = (intptr_t)p->tv; /* struct timeval32 * */ + uarg[a++] = (intcap_t)p->in; /* fd_set * */ + uarg[a++] = (intcap_t)p->ou; /* fd_set * */ + uarg[a++] = (intcap_t)p->ex; /* fd_set * */ + uarg[a++] = (intcap_t)p->tv; /* struct timeval32 * */ *n_args = 5; break; } @@ -572,7 +572,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 98: { struct connect_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->name; /* const struct sockaddr * */ iarg[a++] = p->namelen; /* __socklen_t */ *n_args = 3; break; @@ -589,7 +589,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 104: { struct bind_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->name; /* const struct sockaddr * */ iarg[a++] = p->namelen; /* __socklen_t */ *n_args = 3; break; @@ -600,7 +600,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->s; /* int */ iarg[a++] = p->level; /* int */ iarg[a++] = p->name; /* int */ - uarg[a++] = (intptr_t)p->val; /* const void * */ + uarg[a++] = (intcap_t)p->val; /* const void * */ iarg[a++] = p->valsize; /* __socklen_t */ *n_args = 5; break; @@ -616,8 +616,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_gettimeofday */ case 116: { struct freebsd32_gettimeofday_args *p = params; - uarg[a++] = (intptr_t)p->tp; /* struct timeval32 * */ - uarg[a++] = (intptr_t)p->tzp; /* struct timezone * */ + uarg[a++] = (intcap_t)p->tp; /* struct timeval32 * */ + uarg[a++] = (intcap_t)p->tzp; /* struct timezone * */ *n_args = 2; break; } @@ -625,7 +625,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 117: { struct freebsd32_getrusage_args *p = params; iarg[a++] = p->who; /* int */ - uarg[a++] = (intptr_t)p->rusage; /* struct rusage32 * */ + uarg[a++] = (intcap_t)p->rusage; /* struct rusage32 * */ *n_args = 2; break; } @@ -635,8 +635,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->s; /* int */ iarg[a++] = p->level; /* int */ iarg[a++] = p->name; /* int */ - uarg[a++] = (intptr_t)p->val; /* void * */ - uarg[a++] = (intptr_t)p->avalsize; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->val; /* void * */ + uarg[a++] = (intcap_t)p->avalsize; /* __socklen_t * */ *n_args = 5; break; } @@ -644,7 +644,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 120: { struct freebsd32_readv_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->iovp; /* const struct iovec32 * */ + uarg[a++] = (intcap_t)p->iovp; /* const struct iovec32 * */ uarg[a++] = p->iovcnt; /* u_int */ *n_args = 3; break; @@ -653,7 +653,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 121: { struct freebsd32_writev_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->iovp; /* const struct iovec32 * */ + uarg[a++] = (intcap_t)p->iovp; /* const struct iovec32 * */ uarg[a++] = p->iovcnt; /* u_int */ *n_args = 3; break; @@ -661,8 +661,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_settimeofday */ case 122: { struct freebsd32_settimeofday_args *p = params; - uarg[a++] = (intptr_t)p->tv; /* const struct timeval32 * */ - uarg[a++] = (intptr_t)p->tzp; /* const struct timezone * */ + uarg[a++] = (intcap_t)p->tv; /* const struct timeval32 * */ + uarg[a++] = (intcap_t)p->tzp; /* const struct timezone * */ *n_args = 2; break; } @@ -702,8 +702,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* rename */ case 128: { struct rename_args *p = params; - uarg[a++] = (intptr_t)p->from; /* const char * */ - uarg[a++] = (intptr_t)p->to; /* const char * */ + uarg[a++] = (intcap_t)p->from; /* const char * */ + uarg[a++] = (intcap_t)p->to; /* const char * */ *n_args = 2; break; } @@ -718,7 +718,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* mkfifo */ case 132: { struct mkfifo_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ *n_args = 2; break; @@ -727,10 +727,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 133: { struct sendto_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->buf; /* const void * */ + uarg[a++] = (intcap_t)p->buf; /* const void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->to; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->to; /* const struct sockaddr * */ iarg[a++] = p->tolen; /* __socklen_t */ *n_args = 6; break; @@ -749,14 +749,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->domain; /* int */ iarg[a++] = p->type; /* int */ iarg[a++] = p->protocol; /* int */ - uarg[a++] = (intptr_t)p->rsv; /* int * */ + uarg[a++] = (intcap_t)p->rsv; /* int * */ *n_args = 4; break; } /* mkdir */ case 136: { struct mkdir_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ *n_args = 2; break; @@ -764,23 +764,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* rmdir */ case 137: { struct rmdir_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd32_utimes */ case 138: { struct freebsd32_utimes_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->tptr; /* const struct timeval32 * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->tptr; /* const struct timeval32 * */ *n_args = 2; break; } /* freebsd32_adjtime */ case 140: { struct freebsd32_adjtime_args *p = params; - uarg[a++] = (intptr_t)p->delta; /* const struct timeval32 * */ - uarg[a++] = (intptr_t)p->olddelta; /* struct timeval32 * */ + uarg[a++] = (intcap_t)p->delta; /* const struct timeval32 * */ + uarg[a++] = (intcap_t)p->olddelta; /* struct timeval32 * */ *n_args = 2; break; } @@ -792,18 +792,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* quotactl */ case 148: { struct quotactl_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->cmd; /* int */ iarg[a++] = p->uid; /* int */ - uarg[a++] = (intptr_t)p->arg; /* void * */ + uarg[a++] = (intcap_t)p->arg; /* void * */ *n_args = 4; break; } /* getfh */ case 161: { struct getfh_args *p = params; - uarg[a++] = (intptr_t)p->fname; /* const char * */ - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * */ + uarg[a++] = (intcap_t)p->fname; /* const char * */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * */ *n_args = 2; break; } @@ -811,7 +811,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 165: { struct freebsd32_sysarch_args *p = params; iarg[a++] = p->op; /* int */ - uarg[a++] = (intptr_t)p->parms; /* char * */ + uarg[a++] = (intcap_t)p->parms; /* char * */ *n_args = 2; break; } @@ -820,7 +820,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct rtprio_args *p = params; iarg[a++] = p->function; /* int */ iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->rtp; /* struct rtprio * */ + uarg[a++] = (intcap_t)p->rtp; /* struct rtprio * */ *n_args = 3; break; } @@ -867,7 +867,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_ntp_adjtime */ case 176: { struct freebsd32_ntp_adjtime_args *p = params; - uarg[a++] = (intptr_t)p->tp; /* struct timex32 * */ + uarg[a++] = (intcap_t)p->tp; /* struct timex32 * */ *n_args = 1; break; } @@ -895,7 +895,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* pathconf */ case 191: { struct pathconf_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->name; /* int */ *n_args = 2; break; @@ -912,7 +912,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 194: { struct getrlimit_args *p = params; uarg[a++] = p->which; /* u_int */ - uarg[a++] = (intptr_t)p->rlp; /* struct rlimit * */ + uarg[a++] = (intcap_t)p->rlp; /* struct rlimit * */ *n_args = 2; break; } @@ -920,7 +920,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 195: { struct setrlimit_args *p = params; uarg[a++] = p->which; /* u_int */ - uarg[a++] = (intptr_t)p->rlp; /* struct rlimit * */ + uarg[a++] = (intcap_t)p->rlp; /* struct rlimit * */ *n_args = 2; break; } @@ -932,11 +932,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32___sysctl */ case 202: { struct freebsd32___sysctl_args *p = params; - uarg[a++] = (intptr_t)p->name; /* int * */ + uarg[a++] = (intcap_t)p->name; /* int * */ uarg[a++] = p->namelen; /* u_int */ - uarg[a++] = (intptr_t)p->old; /* void * */ - uarg[a++] = (intptr_t)p->oldlenp; /* uint32_t * */ - uarg[a++] = (intptr_t)p->new; /* const void * */ + uarg[a++] = (intcap_t)p->old; /* void * */ + uarg[a++] = (intcap_t)p->oldlenp; /* uint32_t * */ + uarg[a++] = (intcap_t)p->new; /* const void * */ uarg[a++] = p->newlen; /* size_t */ *n_args = 6; break; @@ -944,7 +944,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* mlock */ case 203: { struct mlock_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* const void * */ + uarg[a++] = (intcap_t)p->addr; /* const void * */ uarg[a++] = p->len; /* size_t */ *n_args = 2; break; @@ -952,7 +952,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* munlock */ case 204: { struct munlock_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* const void * */ + uarg[a++] = (intcap_t)p->addr; /* const void * */ uarg[a++] = p->len; /* size_t */ *n_args = 2; break; @@ -960,7 +960,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* undelete */ case 205: { struct undelete_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } @@ -968,7 +968,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 206: { struct freebsd32_futimes_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->tptr; /* const struct timeval32 * */ + uarg[a++] = (intcap_t)p->tptr; /* const struct timeval32 * */ *n_args = 2; break; } @@ -982,7 +982,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* poll */ case 209: { struct poll_args *p = params; - uarg[a++] = (intptr_t)p->fds; /* struct pollfd * */ + uarg[a++] = (intcap_t)p->fds; /* struct pollfd * */ uarg[a++] = p->nfds; /* u_int */ iarg[a++] = p->timeout; /* int */ *n_args = 3; @@ -1051,7 +1051,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 222: { struct semop_args *p = params; iarg[a++] = p->semid; /* int */ - uarg[a++] = (intptr_t)p->sops; /* struct sembuf * */ + uarg[a++] = (intcap_t)p->sops; /* struct sembuf * */ uarg[a++] = p->nsops; /* size_t */ *n_args = 3; break; @@ -1068,7 +1068,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 226: { struct freebsd32_msgsnd_args *p = params; iarg[a++] = p->msqid; /* int */ - uarg[a++] = (intptr_t)p->msgp; /* const void * */ + uarg[a++] = (intcap_t)p->msgp; /* const void * */ uarg[a++] = p->msgsz; /* size_t */ iarg[a++] = p->msgflg; /* int */ *n_args = 4; @@ -1078,7 +1078,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 227: { struct freebsd32_msgrcv_args *p = params; iarg[a++] = p->msqid; /* int */ - uarg[a++] = (intptr_t)p->msgp; /* void * */ + uarg[a++] = (intcap_t)p->msgp; /* void * */ uarg[a++] = p->msgsz; /* size_t */ iarg[a++] = p->msgtyp; /* int32_t */ iarg[a++] = p->msgflg; /* int */ @@ -1089,7 +1089,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 228: { struct shmat_args *p = params; iarg[a++] = p->shmid; /* int */ - uarg[a++] = (intptr_t)p->shmaddr; /* const void * */ + uarg[a++] = (intcap_t)p->shmaddr; /* const void * */ iarg[a++] = p->shmflg; /* int */ *n_args = 3; break; @@ -1097,7 +1097,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* shmdt */ case 230: { struct shmdt_args *p = params; - uarg[a++] = (intptr_t)p->shmaddr; /* const void * */ + uarg[a++] = (intcap_t)p->shmaddr; /* const void * */ *n_args = 1; break; } @@ -1114,7 +1114,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 232: { struct freebsd32_clock_gettime_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ - uarg[a++] = (intptr_t)p->tp; /* struct timespec32 * */ + uarg[a++] = (intcap_t)p->tp; /* struct timespec32 * */ *n_args = 2; break; } @@ -1122,7 +1122,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 233: { struct freebsd32_clock_settime_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ - uarg[a++] = (intptr_t)p->tp; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->tp; /* const struct timespec32 * */ *n_args = 2; break; } @@ -1130,7 +1130,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 234: { struct freebsd32_clock_getres_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ - uarg[a++] = (intptr_t)p->tp; /* struct timespec32 * */ + uarg[a++] = (intcap_t)p->tp; /* struct timespec32 * */ *n_args = 2; break; } @@ -1138,8 +1138,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 235: { struct freebsd32_ktimer_create_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ - uarg[a++] = (intptr_t)p->evp; /* struct sigevent32 * */ - uarg[a++] = (intptr_t)p->timerid; /* int * */ + uarg[a++] = (intcap_t)p->evp; /* struct sigevent32 * */ + uarg[a++] = (intcap_t)p->timerid; /* int * */ *n_args = 3; break; } @@ -1155,8 +1155,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd32_ktimer_settime_args *p = params; iarg[a++] = p->timerid; /* int */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->value; /* const struct itimerspec32 * */ - uarg[a++] = (intptr_t)p->ovalue; /* struct itimerspec32 * */ + uarg[a++] = (intcap_t)p->value; /* const struct itimerspec32 * */ + uarg[a++] = (intcap_t)p->ovalue; /* struct itimerspec32 * */ *n_args = 4; break; } @@ -1164,7 +1164,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 238: { struct freebsd32_ktimer_gettime_args *p = params; iarg[a++] = p->timerid; /* int */ - uarg[a++] = (intptr_t)p->value; /* struct itimerspec32 * */ + uarg[a++] = (intcap_t)p->value; /* struct itimerspec32 * */ *n_args = 2; break; } @@ -1178,29 +1178,29 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_nanosleep */ case 240: { struct freebsd32_nanosleep_args *p = params; - uarg[a++] = (intptr_t)p->rqtp; /* const struct timespec32 * */ - uarg[a++] = (intptr_t)p->rmtp; /* struct timespec32 * */ + uarg[a++] = (intcap_t)p->rqtp; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->rmtp; /* struct timespec32 * */ *n_args = 2; break; } /* ffclock_getcounter */ case 241: { struct ffclock_getcounter_args *p = params; - uarg[a++] = (intptr_t)p->ffcount; /* ffcounter * */ + uarg[a++] = (intcap_t)p->ffcount; /* ffcounter * */ *n_args = 1; break; } /* freebsd32_ffclock_setestimate */ case 242: { struct freebsd32_ffclock_setestimate_args *p = params; - uarg[a++] = (intptr_t)p->cest; /* struct ffclock_estimate32 * */ + uarg[a++] = (intcap_t)p->cest; /* struct ffclock_estimate32 * */ *n_args = 1; break; } /* freebsd32_ffclock_getestimate */ case 243: { struct freebsd32_ffclock_getestimate_args *p = params; - uarg[a++] = (intptr_t)p->cest; /* struct ffclock_estimate32 * */ + uarg[a++] = (intcap_t)p->cest; /* struct ffclock_estimate32 * */ *n_args = 1; break; } @@ -1209,8 +1209,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd32_clock_nanosleep_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->rqtp; /* const struct timespec32 * */ - uarg[a++] = (intptr_t)p->rmtp; /* struct timespec32 * */ + uarg[a++] = (intcap_t)p->rqtp; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->rmtp; /* struct timespec32 * */ *n_args = 4; break; } @@ -1220,14 +1220,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) uarg[a++] = p->id1; /* uint32_t */ uarg[a++] = p->id2; /* uint32_t */ iarg[a++] = p->which; /* int */ - uarg[a++] = (intptr_t)p->clock_id; /* clockid_t * */ + uarg[a++] = (intcap_t)p->clock_id; /* clockid_t * */ *n_args = 4; break; } /* minherit */ case 250: { struct minherit_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * */ + uarg[a++] = (intcap_t)p->addr; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->inherit; /* int */ *n_args = 3; @@ -1248,7 +1248,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* lchown */ case 254: { struct lchown_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->uid; /* int */ iarg[a++] = p->gid; /* int */ *n_args = 3; @@ -1257,14 +1257,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_aio_read */ case 255: { struct freebsd32_aio_read_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb32 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb32 * */ *n_args = 1; break; } /* freebsd32_aio_write */ case 256: { struct freebsd32_aio_write_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb32 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb32 * */ *n_args = 1; break; } @@ -1272,17 +1272,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 257: { struct freebsd32_lio_listio_args *p = params; iarg[a++] = p->mode; /* int */ - uarg[a++] = (intptr_t)p->acb_list; /* uint32_t * */ + uarg[a++] = (intcap_t)p->acb_list; /* uint32_t * */ iarg[a++] = p->nent; /* int */ - uarg[a++] = (intptr_t)p->sig; /* struct sigevent32 * */ + uarg[a++] = (intcap_t)p->sig; /* struct sigevent32 * */ *n_args = 4; break; } /* kbounce */ case 258: { struct kbounce_args *p = params; - uarg[a++] = (intptr_t)p->src; /* const void * */ - uarg[a++] = (intptr_t)p->dst; /* void * */ + uarg[a++] = (intcap_t)p->src; /* const void * */ + uarg[a++] = (intcap_t)p->dst; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->flags; /* int */ *n_args = 4; @@ -1291,7 +1291,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* flag_captured */ case 259: { struct flag_captured_args *p = params; - uarg[a++] = (intptr_t)p->message; /* const char * */ + uarg[a++] = (intcap_t)p->message; /* const char * */ uarg[a++] = p->key; /* uint32_t */ *n_args = 2; break; @@ -1299,7 +1299,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* lchmod */ case 274: { struct lchmod_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ *n_args = 2; break; @@ -1307,8 +1307,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_lutimes */ case 276: { struct freebsd32_lutimes_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->tptr; /* const struct timeval32 * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->tptr; /* const struct timeval32 * */ *n_args = 2; break; } @@ -1316,7 +1316,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 289: { struct freebsd32_preadv_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->iovp; /* struct iovec32 * */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec32 * */ uarg[a++] = p->iovcnt; /* u_int */ #ifdef PAD64_REQUIRED iarg[a++] = p->_pad; /* int */ @@ -1330,7 +1330,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 290: { struct freebsd32_pwritev_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->iovp; /* struct iovec32 * */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec32 * */ uarg[a++] = p->iovcnt; /* u_int */ #ifdef PAD64_REQUIRED iarg[a++] = p->_pad; /* int */ @@ -1343,7 +1343,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* fhopen */ case 298: { struct fhopen_args *p = params; - uarg[a++] = (intptr_t)p->u_fhp; /* const struct fhandle * */ + uarg[a++] = (intcap_t)p->u_fhp; /* const struct fhandle * */ iarg[a++] = p->flags; /* int */ *n_args = 2; break; @@ -1359,7 +1359,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 301: { struct freebsd32_modstat_args *p = params; iarg[a++] = p->modid; /* int */ - uarg[a++] = (intptr_t)p->stat; /* struct module_stat32 * */ + uarg[a++] = (intcap_t)p->stat; /* struct module_stat32 * */ *n_args = 2; break; } @@ -1373,14 +1373,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* modfind */ case 303: { struct modfind_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ *n_args = 1; break; } /* kldload */ case 304: { struct kldload_args *p = params; - uarg[a++] = (intptr_t)p->file; /* const char * */ + uarg[a++] = (intcap_t)p->file; /* const char * */ *n_args = 1; break; } @@ -1394,7 +1394,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* kldfind */ case 306: { struct kldfind_args *p = params; - uarg[a++] = (intptr_t)p->file; /* const char * */ + uarg[a++] = (intcap_t)p->file; /* const char * */ *n_args = 1; break; } @@ -1409,7 +1409,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 308: { struct freebsd32_kldstat_args *p = params; iarg[a++] = p->fileid; /* int */ - uarg[a++] = (intptr_t)p->stat; /* struct kld_file_stat32 * */ + uarg[a++] = (intcap_t)p->stat; /* struct kld_file_stat32 * */ *n_args = 2; break; } @@ -1448,16 +1448,16 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_aio_return */ case 314: { struct freebsd32_aio_return_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb32 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb32 * */ *n_args = 1; break; } /* freebsd32_aio_suspend */ case 315: { struct freebsd32_aio_suspend_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* uint32_t * */ + uarg[a++] = (intcap_t)p->aiocbp; /* uint32_t * */ iarg[a++] = p->nent; /* int */ - uarg[a++] = (intptr_t)p->timeout; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->timeout; /* const struct timespec32 * */ *n_args = 3; break; } @@ -1465,14 +1465,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 316: { struct freebsd32_aio_cancel_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb32 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb32 * */ *n_args = 2; break; } /* freebsd32_aio_error */ case 317: { struct freebsd32_aio_error_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb32 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb32 * */ *n_args = 1; break; } @@ -1496,7 +1496,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* __getcwd */ case 326: { struct __getcwd_args *p = params; - uarg[a++] = (intptr_t)p->buf; /* char * */ + uarg[a++] = (intcap_t)p->buf; /* char * */ uarg[a++] = p->buflen; /* size_t */ *n_args = 2; break; @@ -1505,7 +1505,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 327: { struct sched_setparam_args *p = params; iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->param; /* const struct sched_param * */ + uarg[a++] = (intcap_t)p->param; /* const struct sched_param * */ *n_args = 2; break; } @@ -1513,7 +1513,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 328: { struct sched_getparam_args *p = params; iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->param; /* struct sched_param * */ + uarg[a++] = (intcap_t)p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1522,7 +1522,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct sched_setscheduler_args *p = params; iarg[a++] = p->pid; /* pid_t */ iarg[a++] = p->policy; /* int */ - uarg[a++] = (intptr_t)p->param; /* const struct sched_param * */ + uarg[a++] = (intcap_t)p->param; /* const struct sched_param * */ *n_args = 3; break; } @@ -1556,14 +1556,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 334: { struct freebsd32_sched_rr_get_interval_args *p = params; iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->interval; /* struct timespec32 * */ + uarg[a++] = (intcap_t)p->interval; /* struct timespec32 * */ *n_args = 2; break; } /* utrace */ case 335: { struct utrace_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* const void * */ + uarg[a++] = (intcap_t)p->addr; /* const void * */ uarg[a++] = p->len; /* size_t */ *n_args = 2; break; @@ -1571,7 +1571,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_jail */ case 338: { struct freebsd32_jail_args *p = params; - uarg[a++] = (intptr_t)p->jailp; /* struct jail32 * */ + uarg[a++] = (intcap_t)p->jailp; /* struct jail32 * */ *n_args = 1; break; } @@ -1579,57 +1579,57 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 340: { struct sigprocmask_args *p = params; iarg[a++] = p->how; /* int */ - uarg[a++] = (intptr_t)p->set; /* const sigset_t * */ - uarg[a++] = (intptr_t)p->oset; /* sigset_t * */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->oset; /* sigset_t * */ *n_args = 3; break; } /* sigsuspend */ case 341: { struct sigsuspend_args *p = params; - uarg[a++] = (intptr_t)p->sigmask; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->sigmask; /* const sigset_t * */ *n_args = 1; break; } /* sigpending */ case 343: { struct sigpending_args *p = params; - uarg[a++] = (intptr_t)p->set; /* sigset_t * */ + uarg[a++] = (intcap_t)p->set; /* sigset_t * */ *n_args = 1; break; } /* freebsd32_sigtimedwait */ case 345: { struct freebsd32_sigtimedwait_args *p = params; - uarg[a++] = (intptr_t)p->set; /* const sigset_t * */ - uarg[a++] = (intptr_t)p->info; /* struct __siginfo32 * */ - uarg[a++] = (intptr_t)p->timeout; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->info; /* struct __siginfo32 * */ + uarg[a++] = (intcap_t)p->timeout; /* const struct timespec32 * */ *n_args = 3; break; } /* freebsd32_sigwaitinfo */ case 346: { struct freebsd32_sigwaitinfo_args *p = params; - uarg[a++] = (intptr_t)p->set; /* const sigset_t * */ - uarg[a++] = (intptr_t)p->info; /* struct __siginfo32 * */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->info; /* struct __siginfo32 * */ *n_args = 2; break; } /* __acl_get_file */ case 347: { struct __acl_get_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } /* __acl_set_file */ case 348: { struct __acl_set_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } @@ -1638,7 +1638,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct __acl_get_fd_args *p = params; iarg[a++] = p->filedes; /* int */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } @@ -1647,14 +1647,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct __acl_set_fd_args *p = params; iarg[a++] = p->filedes; /* int */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } /* __acl_delete_file */ case 351: { struct __acl_delete_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ *n_args = 2; break; @@ -1670,9 +1670,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* __acl_aclcheck_file */ case 353: { struct __acl_aclcheck_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } @@ -1681,28 +1681,28 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct __acl_aclcheck_fd_args *p = params; iarg[a++] = p->filedes; /* int */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } /* extattrctl */ case 355: { struct extattrctl_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->filename; /* const char * */ + uarg[a++] = (intcap_t)p->filename; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ *n_args = 5; break; } /* extattr_set_file */ case 356: { struct extattr_set_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1710,10 +1710,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* extattr_get_file */ case 357: { struct extattr_get_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1721,35 +1721,35 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* extattr_delete_file */ case 358: { struct extattr_delete_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ *n_args = 3; break; } /* freebsd32_aio_waitcomplete */ case 359: { struct freebsd32_aio_waitcomplete_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* uint32_t * */ - uarg[a++] = (intptr_t)p->timeout; /* struct timespec32 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* uint32_t * */ + uarg[a++] = (intcap_t)p->timeout; /* struct timespec32 * */ *n_args = 2; break; } /* getresuid */ case 360: { struct getresuid_args *p = params; - uarg[a++] = (intptr_t)p->ruid; /* uid_t * */ - uarg[a++] = (intptr_t)p->euid; /* uid_t * */ - uarg[a++] = (intptr_t)p->suid; /* uid_t * */ + uarg[a++] = (intcap_t)p->ruid; /* uid_t * */ + uarg[a++] = (intcap_t)p->euid; /* uid_t * */ + uarg[a++] = (intcap_t)p->suid; /* uid_t * */ *n_args = 3; break; } /* getresgid */ case 361: { struct getresgid_args *p = params; - uarg[a++] = (intptr_t)p->rgid; /* gid_t * */ - uarg[a++] = (intptr_t)p->egid; /* gid_t * */ - uarg[a++] = (intptr_t)p->sgid; /* gid_t * */ + uarg[a++] = (intcap_t)p->rgid; /* gid_t * */ + uarg[a++] = (intcap_t)p->egid; /* gid_t * */ + uarg[a++] = (intcap_t)p->sgid; /* gid_t * */ *n_args = 3; break; } @@ -1763,8 +1763,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct extattr_set_fd_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1774,8 +1774,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct extattr_get_fd_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1785,7 +1785,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct extattr_delete_fd_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ *n_args = 3; break; } @@ -1799,7 +1799,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* eaccess */ case 376: { struct eaccess_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->amode; /* int */ *n_args = 2; break; @@ -1807,7 +1807,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_nmount */ case 378: { struct freebsd32_nmount_args *p = params; - uarg[a++] = (intptr_t)p->iovp; /* struct iovec32 * */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec32 * */ uarg[a++] = p->iovcnt; /* unsigned int */ iarg[a++] = p->flags; /* int */ *n_args = 3; @@ -1817,8 +1817,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 390: { struct kenv_args *p = params; iarg[a++] = p->what; /* int */ - uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->value; /* char * */ iarg[a++] = p->len; /* int */ *n_args = 4; break; @@ -1826,7 +1826,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* lchflags */ case 391: { struct lchflags_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ uarg[a++] = p->flags; /* u_long */ *n_args = 2; break; @@ -1834,7 +1834,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* uuidgen */ case 392: { struct uuidgen_args *p = params; - uarg[a++] = (intptr_t)p->store; /* struct uuid * */ + uarg[a++] = (intcap_t)p->store; /* struct uuid * */ iarg[a++] = p->count; /* int */ *n_args = 2; break; @@ -1847,8 +1847,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) uarg[a++] = p->offset1; /* uint32_t */ uarg[a++] = p->offset2; /* uint32_t */ uarg[a++] = p->nbytes; /* size_t */ - uarg[a++] = (intptr_t)p->hdtr; /* struct sf_hdtr32 * */ - uarg[a++] = (intptr_t)p->sbytes; /* off_t * */ + uarg[a++] = (intcap_t)p->hdtr; /* struct sf_hdtr32 * */ + uarg[a++] = (intcap_t)p->sbytes; /* off_t * */ iarg[a++] = p->flags; /* int */ *n_args = 8; break; @@ -1856,9 +1856,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* mac_syscall */ case 394: { struct mac_syscall_args *p = params; - uarg[a++] = (intptr_t)p->policy; /* const char * */ + uarg[a++] = (intcap_t)p->policy; /* const char * */ iarg[a++] = p->call; /* int */ - uarg[a++] = (intptr_t)p->arg; /* void * */ + uarg[a++] = (intcap_t)p->arg; /* void * */ *n_args = 3; break; } @@ -1893,7 +1893,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* ksem_init */ case 404: { struct ksem_init_args *p = params; - uarg[a++] = (intptr_t)p->idp; /* int32_t * */ + uarg[a++] = (intcap_t)p->idp; /* int32_t * */ uarg[a++] = p->value; /* unsigned int */ *n_args = 2; break; @@ -1901,8 +1901,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* ksem_open */ case 405: { struct ksem_open_args *p = params; - uarg[a++] = (intptr_t)p->idp; /* int32_t * */ - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->idp; /* int32_t * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ iarg[a++] = p->oflag; /* int */ iarg[a++] = p->mode; /* mode_t */ uarg[a++] = p->value; /* unsigned int */ @@ -1912,7 +1912,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* ksem_unlink */ case 406: { struct ksem_unlink_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ *n_args = 1; break; } @@ -1920,7 +1920,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 407: { struct ksem_getvalue_args *p = params; iarg[a++] = p->id; /* int32_t */ - uarg[a++] = (intptr_t)p->val; /* int * */ + uarg[a++] = (intcap_t)p->val; /* int * */ *n_args = 2; break; } @@ -1934,10 +1934,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* extattr_set_link */ case 412: { struct extattr_set_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1945,10 +1945,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* extattr_get_link */ case 413: { struct extattr_get_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1956,9 +1956,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* extattr_delete_link */ case 414: { struct extattr_delete_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ *n_args = 3; break; } @@ -1966,62 +1966,62 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 416: { struct freebsd32_sigaction_args *p = params; iarg[a++] = p->sig; /* int */ - uarg[a++] = (intptr_t)p->act; /* const struct sigaction32 * */ - uarg[a++] = (intptr_t)p->oact; /* struct sigaction32 * */ + uarg[a++] = (intcap_t)p->act; /* const struct sigaction32 * */ + uarg[a++] = (intcap_t)p->oact; /* struct sigaction32 * */ *n_args = 3; break; } /* freebsd32_sigreturn */ case 417: { struct freebsd32_sigreturn_args *p = params; - uarg[a++] = (intptr_t)p->sigcntxp; /* const struct __ucontext32 * */ + uarg[a++] = (intcap_t)p->sigcntxp; /* const struct __ucontext32 * */ *n_args = 1; break; } /* freebsd32_getcontext */ case 421: { struct freebsd32_getcontext_args *p = params; - uarg[a++] = (intptr_t)p->ucp; /* struct __ucontext32 * */ + uarg[a++] = (intcap_t)p->ucp; /* struct __ucontext32 * */ *n_args = 1; break; } /* freebsd32_setcontext */ case 422: { struct freebsd32_setcontext_args *p = params; - uarg[a++] = (intptr_t)p->ucp; /* const struct __ucontext32 * */ + uarg[a++] = (intcap_t)p->ucp; /* const struct __ucontext32 * */ *n_args = 1; break; } /* freebsd32_swapcontext */ case 423: { struct freebsd32_swapcontext_args *p = params; - uarg[a++] = (intptr_t)p->oucp; /* struct __ucontext32 * */ - uarg[a++] = (intptr_t)p->ucp; /* const struct __ucontext32 * */ + uarg[a++] = (intcap_t)p->oucp; /* struct __ucontext32 * */ + uarg[a++] = (intcap_t)p->ucp; /* const struct __ucontext32 * */ *n_args = 2; break; } /* __acl_get_link */ case 425: { struct __acl_get_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } /* __acl_set_link */ case 426: { struct __acl_set_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } /* __acl_delete_link */ case 427: { struct __acl_delete_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ *n_args = 2; break; @@ -2029,31 +2029,31 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* __acl_aclcheck_link */ case 428: { struct __acl_aclcheck_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } /* sigwait */ case 429: { struct sigwait_args *p = params; - uarg[a++] = (intptr_t)p->set; /* const sigset_t * */ - uarg[a++] = (intptr_t)p->sig; /* int * */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->sig; /* int * */ *n_args = 2; break; } /* thr_exit */ case 431: { struct thr_exit_args *p = params; - uarg[a++] = (intptr_t)p->state; /* int32_t * */ + uarg[a++] = (intcap_t)p->state; /* int32_t * */ *n_args = 1; break; } /* thr_self */ case 432: { struct thr_self_args *p = params; - uarg[a++] = (intptr_t)p->id; /* int32_t * */ + uarg[a++] = (intcap_t)p->id; /* int32_t * */ *n_args = 1; break; } @@ -2077,7 +2077,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct extattr_list_fd_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 4; break; @@ -2085,9 +2085,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* extattr_list_file */ case 438: { struct extattr_list_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 4; break; @@ -2095,9 +2095,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* extattr_list_link */ case 439: { struct extattr_list_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 4; break; @@ -2106,14 +2106,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 441: { struct freebsd32_ksem_timedwait_args *p = params; iarg[a++] = p->id; /* int32_t */ - uarg[a++] = (intptr_t)p->abstime; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->abstime; /* const struct timespec32 * */ *n_args = 2; break; } /* freebsd32_thr_suspend */ case 442: { struct freebsd32_thr_suspend_args *p = params; - uarg[a++] = (intptr_t)p->timeout; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->timeout; /* const struct timespec32 * */ *n_args = 1; break; } @@ -2135,7 +2135,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* audit */ case 445: { struct audit_args *p = params; - uarg[a++] = (intptr_t)p->record; /* const void * */ + uarg[a++] = (intcap_t)p->record; /* const void * */ uarg[a++] = p->length; /* u_int */ *n_args = 2; break; @@ -2144,7 +2144,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 446: { struct auditon_args *p = params; iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->length; /* u_int */ *n_args = 3; break; @@ -2152,35 +2152,35 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* getauid */ case 447: { struct getauid_args *p = params; - uarg[a++] = (intptr_t)p->auid; /* uid_t * */ + uarg[a++] = (intcap_t)p->auid; /* uid_t * */ *n_args = 1; break; } /* setauid */ case 448: { struct setauid_args *p = params; - uarg[a++] = (intptr_t)p->auid; /* uid_t * */ + uarg[a++] = (intcap_t)p->auid; /* uid_t * */ *n_args = 1; break; } /* getaudit */ case 449: { struct getaudit_args *p = params; - uarg[a++] = (intptr_t)p->auditinfo; /* struct auditinfo * */ + uarg[a++] = (intcap_t)p->auditinfo; /* struct auditinfo * */ *n_args = 1; break; } /* setaudit */ case 450: { struct setaudit_args *p = params; - uarg[a++] = (intptr_t)p->auditinfo; /* struct auditinfo * */ + uarg[a++] = (intcap_t)p->auditinfo; /* struct auditinfo * */ *n_args = 1; break; } /* getaudit_addr */ case 451: { struct getaudit_addr_args *p = params; - uarg[a++] = (intptr_t)p->auditinfo_addr; /* struct auditinfo_addr * */ + uarg[a++] = (intcap_t)p->auditinfo_addr; /* struct auditinfo_addr * */ uarg[a++] = p->length; /* u_int */ *n_args = 2; break; @@ -2188,7 +2188,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* setaudit_addr */ case 452: { struct setaudit_addr_args *p = params; - uarg[a++] = (intptr_t)p->auditinfo_addr; /* struct auditinfo_addr * */ + uarg[a++] = (intcap_t)p->auditinfo_addr; /* struct auditinfo_addr * */ uarg[a++] = p->length; /* u_int */ *n_args = 2; break; @@ -2196,25 +2196,25 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* auditctl */ case 453: { struct auditctl_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd32__umtx_op */ case 454: { struct freebsd32__umtx_op_args *p = params; - uarg[a++] = (intptr_t)p->obj; /* void * */ + uarg[a++] = (intcap_t)p->obj; /* void * */ iarg[a++] = p->op; /* int */ uarg[a++] = p->val; /* u_long */ - uarg[a++] = (intptr_t)p->uaddr1; /* void * */ - uarg[a++] = (intptr_t)p->uaddr2; /* void * */ + uarg[a++] = (intcap_t)p->uaddr1; /* void * */ + uarg[a++] = (intcap_t)p->uaddr2; /* void * */ *n_args = 5; break; } /* freebsd32_thr_new */ case 455: { struct freebsd32_thr_new_args *p = params; - uarg[a++] = (intptr_t)p->param; /* struct thr_param32 * */ + uarg[a++] = (intcap_t)p->param; /* struct thr_param32 * */ iarg[a++] = p->param_size; /* int */ *n_args = 2; break; @@ -2224,17 +2224,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd32_sigqueue_args *p = params; iarg[a++] = p->pid; /* pid_t */ iarg[a++] = p->signum; /* int */ - uarg[a++] = (intptr_t)p->value; /* void * */ + uarg[a++] = (intcap_t)p->value; /* void * */ *n_args = 3; break; } /* freebsd32_kmq_open */ case 457: { struct freebsd32_kmq_open_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flags; /* int */ iarg[a++] = p->mode; /* mode_t */ - uarg[a++] = (intptr_t)p->attr; /* const struct mq_attr32 * */ + uarg[a++] = (intcap_t)p->attr; /* const struct mq_attr32 * */ *n_args = 4; break; } @@ -2242,8 +2242,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 458: { struct freebsd32_kmq_setattr_args *p = params; iarg[a++] = p->mqd; /* int */ - uarg[a++] = (intptr_t)p->attr; /* const struct mq_attr32 * */ - uarg[a++] = (intptr_t)p->oattr; /* struct mq_attr32 * */ + uarg[a++] = (intcap_t)p->attr; /* const struct mq_attr32 * */ + uarg[a++] = (intcap_t)p->oattr; /* struct mq_attr32 * */ *n_args = 3; break; } @@ -2251,10 +2251,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 459: { struct freebsd32_kmq_timedreceive_args *p = params; iarg[a++] = p->mqd; /* int */ - uarg[a++] = (intptr_t)p->msg_ptr; /* char * */ + uarg[a++] = (intcap_t)p->msg_ptr; /* char * */ uarg[a++] = p->msg_len; /* size_t */ - uarg[a++] = (intptr_t)p->msg_prio; /* unsigned * */ - uarg[a++] = (intptr_t)p->abs_timeout; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->msg_prio; /* unsigned * */ + uarg[a++] = (intcap_t)p->abs_timeout; /* const struct timespec32 * */ *n_args = 5; break; } @@ -2262,10 +2262,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 460: { struct freebsd32_kmq_timedsend_args *p = params; iarg[a++] = p->mqd; /* int */ - uarg[a++] = (intptr_t)p->msg_ptr; /* const char * */ + uarg[a++] = (intcap_t)p->msg_ptr; /* const char * */ uarg[a++] = p->msg_len; /* size_t */ uarg[a++] = p->msg_prio; /* unsigned */ - uarg[a++] = (intptr_t)p->abs_timeout; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->abs_timeout; /* const struct timespec32 * */ *n_args = 5; break; } @@ -2273,23 +2273,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 461: { struct freebsd32_kmq_notify_args *p = params; iarg[a++] = p->mqd; /* int */ - uarg[a++] = (intptr_t)p->sigev; /* const struct sigevent32 * */ + uarg[a++] = (intcap_t)p->sigev; /* const struct sigevent32 * */ *n_args = 2; break; } /* kmq_unlink */ case 462: { struct kmq_unlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd32_abort2 */ case 463: { struct freebsd32_abort2_args *p = params; - uarg[a++] = (intptr_t)p->why; /* const char * */ + uarg[a++] = (intcap_t)p->why; /* const char * */ iarg[a++] = p->nargs; /* int */ - uarg[a++] = (intptr_t)p->args; /* uint32_t * */ + uarg[a++] = (intcap_t)p->args; /* uint32_t * */ *n_args = 3; break; } @@ -2297,7 +2297,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 464: { struct thr_set_name_args *p = params; iarg[a++] = p->id; /* int32_t */ - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ *n_args = 2; break; } @@ -2305,7 +2305,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 465: { struct freebsd32_aio_fsync_args *p = params; iarg[a++] = p->op; /* int */ - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb32 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb32 * */ *n_args = 2; break; } @@ -2314,7 +2314,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct rtprio_thread_args *p = params; iarg[a++] = p->function; /* int */ iarg[a++] = p->lwpid; /* lwpid_t */ - uarg[a++] = (intptr_t)p->rtp; /* struct rtprio * */ + uarg[a++] = (intcap_t)p->rtp; /* struct rtprio * */ *n_args = 3; break; } @@ -2330,11 +2330,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 472: { struct sctp_generic_sendmsg_args *p = params; iarg[a++] = p->sd; /* int */ - uarg[a++] = (intptr_t)p->msg; /* void * */ + uarg[a++] = (intcap_t)p->msg; /* void * */ iarg[a++] = p->mlen; /* int */ - uarg[a++] = (intptr_t)p->to; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->to; /* const struct sockaddr * */ iarg[a++] = p->tolen; /* __socklen_t */ - uarg[a++] = (intptr_t)p->sinfo; /* struct sctp_sndrcvinfo * */ + uarg[a++] = (intcap_t)p->sinfo; /* struct sctp_sndrcvinfo * */ iarg[a++] = p->flags; /* int */ *n_args = 7; break; @@ -2343,11 +2343,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 473: { struct freebsd32_sctp_generic_sendmsg_iov_args *p = params; iarg[a++] = p->sd; /* int */ - uarg[a++] = (intptr_t)p->iov; /* struct iovec32 * */ + uarg[a++] = (intcap_t)p->iov; /* struct iovec32 * */ iarg[a++] = p->iovlen; /* int */ - uarg[a++] = (intptr_t)p->to; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->to; /* const struct sockaddr * */ iarg[a++] = p->tolen; /* __socklen_t */ - uarg[a++] = (intptr_t)p->sinfo; /* struct sctp_sndrcvinfo * */ + uarg[a++] = (intcap_t)p->sinfo; /* struct sctp_sndrcvinfo * */ iarg[a++] = p->flags; /* int */ *n_args = 7; break; @@ -2356,12 +2356,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 474: { struct freebsd32_sctp_generic_recvmsg_args *p = params; iarg[a++] = p->sd; /* int */ - uarg[a++] = (intptr_t)p->iov; /* struct iovec32 * */ + uarg[a++] = (intcap_t)p->iov; /* struct iovec32 * */ iarg[a++] = p->iovlen; /* int */ - uarg[a++] = (intptr_t)p->from; /* struct sockaddr * */ - uarg[a++] = (intptr_t)p->fromlenaddr; /* __socklen_t * */ - uarg[a++] = (intptr_t)p->sinfo; /* struct sctp_sndrcvinfo * */ - uarg[a++] = (intptr_t)p->msg_flags; /* int * */ + uarg[a++] = (intcap_t)p->from; /* struct sockaddr * */ + uarg[a++] = (intcap_t)p->fromlenaddr; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->sinfo; /* struct sctp_sndrcvinfo * */ + uarg[a++] = (intcap_t)p->msg_flags; /* int * */ *n_args = 7; break; } @@ -2369,7 +2369,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 475: { struct freebsd32_pread_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* void * */ + uarg[a++] = (intcap_t)p->buf; /* void * */ uarg[a++] = p->nbyte; /* size_t */ #ifdef PAD64_REQUIRED iarg[a++] = p->_pad; /* int */ @@ -2383,7 +2383,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 476: { struct freebsd32_pwrite_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* const void * */ + uarg[a++] = (intcap_t)p->buf; /* const void * */ uarg[a++] = p->nbyte; /* size_t */ #ifdef PAD64_REQUIRED iarg[a++] = p->_pad; /* int */ @@ -2396,7 +2396,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_mmap */ case 477: { struct freebsd32_mmap_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * */ + uarg[a++] = (intcap_t)p->addr; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->prot; /* int */ iarg[a++] = p->flags; /* int */ @@ -2425,7 +2425,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_truncate */ case 479: { struct freebsd32_truncate_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ #ifdef PAD64_REQUIRED iarg[a++] = p->_pad; /* int */ #endif @@ -2458,14 +2458,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* shm_unlink */ case 483: { struct shm_unlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* cpuset */ case 484: { struct cpuset_args *p = params; - uarg[a++] = (intptr_t)p->setid; /* cpusetid_t * */ + uarg[a++] = (intcap_t)p->setid; /* cpusetid_t * */ *n_args = 1; break; } @@ -2489,7 +2489,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->which; /* cpuwhich_t */ uarg[a++] = p->id1; /* uint32_t */ uarg[a++] = p->id2; /* uint32_t */ - uarg[a++] = (intptr_t)p->setid; /* cpusetid_t * */ + uarg[a++] = (intcap_t)p->setid; /* cpusetid_t * */ *n_args = 5; break; } @@ -2501,7 +2501,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) uarg[a++] = p->id1; /* uint32_t */ uarg[a++] = p->id2; /* uint32_t */ uarg[a++] = p->cpusetsize; /* size_t */ - uarg[a++] = (intptr_t)p->mask; /* cpuset_t * */ + uarg[a++] = (intcap_t)p->mask; /* cpuset_t * */ *n_args = 6; break; } @@ -2513,7 +2513,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) uarg[a++] = p->id1; /* uint32_t */ uarg[a++] = p->id2; /* uint32_t */ uarg[a++] = p->cpusetsize; /* size_t */ - uarg[a++] = (intptr_t)p->mask; /* const cpuset_t * */ + uarg[a++] = (intcap_t)p->mask; /* const cpuset_t * */ *n_args = 6; break; } @@ -2521,7 +2521,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 489: { struct faccessat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->amode; /* int */ iarg[a++] = p->flag; /* int */ *n_args = 4; @@ -2531,7 +2531,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 490: { struct fchmodat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ iarg[a++] = p->flag; /* int */ *n_args = 4; @@ -2541,7 +2541,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 491: { struct fchownat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ uarg[a++] = p->uid; /* uid_t */ iarg[a++] = p->gid; /* gid_t */ iarg[a++] = p->flag; /* int */ @@ -2552,8 +2552,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 492: { struct freebsd32_fexecve_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->argv; /* uint32_t * */ - uarg[a++] = (intptr_t)p->envv; /* uint32_t * */ + uarg[a++] = (intcap_t)p->argv; /* uint32_t * */ + uarg[a++] = (intcap_t)p->envv; /* uint32_t * */ *n_args = 3; break; } @@ -2561,8 +2561,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 494: { struct freebsd32_futimesat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->times; /* const struct timeval32 * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->times; /* const struct timeval32 * */ *n_args = 3; break; } @@ -2570,9 +2570,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 495: { struct linkat_args *p = params; iarg[a++] = p->fd1; /* int */ - uarg[a++] = (intptr_t)p->path1; /* const char * */ + uarg[a++] = (intcap_t)p->path1; /* const char * */ iarg[a++] = p->fd2; /* int */ - uarg[a++] = (intptr_t)p->path2; /* const char * */ + uarg[a++] = (intcap_t)p->path2; /* const char * */ iarg[a++] = p->flag; /* int */ *n_args = 5; break; @@ -2581,7 +2581,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 496: { struct mkdirat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ *n_args = 3; break; @@ -2590,7 +2590,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 497: { struct mkfifoat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ *n_args = 3; break; @@ -2599,7 +2599,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 499: { struct openat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flag; /* int */ iarg[a++] = p->mode; /* mode_t */ *n_args = 4; @@ -2609,8 +2609,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 500: { struct readlinkat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->buf; /* char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->buf; /* char * */ uarg[a++] = p->bufsize; /* size_t */ *n_args = 4; break; @@ -2619,18 +2619,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 501: { struct renameat_args *p = params; iarg[a++] = p->oldfd; /* int */ - uarg[a++] = (intptr_t)p->old; /* const char * */ + uarg[a++] = (intcap_t)p->old; /* const char * */ iarg[a++] = p->newfd; /* int */ - uarg[a++] = (intptr_t)p->new; /* const char * */ + uarg[a++] = (intcap_t)p->new; /* const char * */ *n_args = 4; break; } /* symlinkat */ case 502: { struct symlinkat_args *p = params; - uarg[a++] = (intptr_t)p->path1; /* const char * */ + uarg[a++] = (intcap_t)p->path1; /* const char * */ iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path2; /* const char * */ + uarg[a++] = (intcap_t)p->path2; /* const char * */ *n_args = 3; break; } @@ -2638,7 +2638,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 503: { struct unlinkat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flag; /* int */ *n_args = 3; break; @@ -2653,14 +2653,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* gssd_syscall */ case 505: { struct gssd_syscall_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd32_jail_get */ case 506: { struct freebsd32_jail_get_args *p = params; - uarg[a++] = (intptr_t)p->iovp; /* struct iovec32 * */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec32 * */ uarg[a++] = p->iovcnt; /* unsigned int */ iarg[a++] = p->flags; /* int */ *n_args = 3; @@ -2669,7 +2669,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_jail_set */ case 507: { struct freebsd32_jail_set_args *p = params; - uarg[a++] = (intptr_t)p->iovp; /* struct iovec32 * */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec32 * */ uarg[a++] = p->iovcnt; /* unsigned int */ iarg[a++] = p->flags; /* int */ *n_args = 3; @@ -2688,7 +2688,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->semid; /* int */ iarg[a++] = p->semnum; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->arg; /* union semun32 * */ + uarg[a++] = (intcap_t)p->arg; /* union semun32 * */ *n_args = 4; break; } @@ -2697,7 +2697,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd32_msgctl_args *p = params; iarg[a++] = p->msqid; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* struct msqid_ds32 * */ + uarg[a++] = (intcap_t)p->buf; /* struct msqid_ds32 * */ *n_args = 3; break; } @@ -2706,14 +2706,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd32_shmctl_args *p = params; iarg[a++] = p->shmid; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* struct shmid_ds32 * */ + uarg[a++] = (intcap_t)p->buf; /* struct shmid_ds32 * */ *n_args = 3; break; } /* lpathconf */ case 513: { struct lpathconf_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->name; /* int */ *n_args = 2; break; @@ -2723,7 +2723,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct __cap_rights_get_args *p = params; iarg[a++] = p->version; /* int */ iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->rightsp; /* cap_rights_t * */ + uarg[a++] = (intcap_t)p->rightsp; /* cap_rights_t * */ *n_args = 3; break; } @@ -2735,14 +2735,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* cap_getmode */ case 517: { struct cap_getmode_args *p = params; - uarg[a++] = (intptr_t)p->modep; /* u_int * */ + uarg[a++] = (intcap_t)p->modep; /* u_int * */ *n_args = 1; break; } /* pdfork */ case 518: { struct pdfork_args *p = params; - uarg[a++] = (intptr_t)p->fdp; /* int * */ + uarg[a++] = (intcap_t)p->fdp; /* int * */ iarg[a++] = p->flags; /* int */ *n_args = 2; break; @@ -2759,7 +2759,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 520: { struct pdgetpid_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->pidp; /* pid_t * */ + uarg[a++] = (intcap_t)p->pidp; /* pid_t * */ *n_args = 2; break; } @@ -2767,18 +2767,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 522: { struct freebsd32_pselect_args *p = params; iarg[a++] = p->nd; /* int */ - uarg[a++] = (intptr_t)p->in; /* fd_set * */ - uarg[a++] = (intptr_t)p->ou; /* fd_set * */ - uarg[a++] = (intptr_t)p->ex; /* fd_set * */ - uarg[a++] = (intptr_t)p->ts; /* const struct timespec32 * */ - uarg[a++] = (intptr_t)p->sm; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->in; /* fd_set * */ + uarg[a++] = (intcap_t)p->ou; /* fd_set * */ + uarg[a++] = (intcap_t)p->ex; /* fd_set * */ + uarg[a++] = (intcap_t)p->ts; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->sm; /* const sigset_t * */ *n_args = 6; break; } /* getloginclass */ case 523: { struct getloginclass_args *p = params; - uarg[a++] = (intptr_t)p->namebuf; /* char * */ + uarg[a++] = (intcap_t)p->namebuf; /* char * */ uarg[a++] = p->namelen; /* size_t */ *n_args = 2; break; @@ -2786,16 +2786,16 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* setloginclass */ case 524: { struct setloginclass_args *p = params; - uarg[a++] = (intptr_t)p->namebuf; /* const char * */ + uarg[a++] = (intcap_t)p->namebuf; /* const char * */ *n_args = 1; break; } /* rctl_get_racct */ case 525: { struct rctl_get_racct_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * */ + uarg[a++] = (intcap_t)p->outbufp; /* void * */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2803,9 +2803,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* rctl_get_rules */ case 526: { struct rctl_get_rules_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * */ + uarg[a++] = (intcap_t)p->outbufp; /* void * */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2813,9 +2813,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* rctl_get_limits */ case 527: { struct rctl_get_limits_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * */ + uarg[a++] = (intcap_t)p->outbufp; /* void * */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2823,9 +2823,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* rctl_add_rule */ case 528: { struct rctl_add_rule_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * */ + uarg[a++] = (intcap_t)p->outbufp; /* void * */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2833,9 +2833,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* rctl_remove_rule */ case 529: { struct rctl_remove_rule_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * */ + uarg[a++] = (intcap_t)p->outbufp; /* void * */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2878,10 +2878,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) #endif uarg[a++] = p->id1; /* uint32_t */ uarg[a++] = p->id2; /* uint32_t */ - uarg[a++] = (intptr_t)p->status; /* int * */ + uarg[a++] = (intcap_t)p->status; /* int * */ iarg[a++] = p->options; /* int */ - uarg[a++] = (intptr_t)p->wrusage; /* struct __wrusage32 * */ - uarg[a++] = (intptr_t)p->info; /* struct __siginfo32 * */ + uarg[a++] = (intcap_t)p->wrusage; /* struct __wrusage32 * */ + uarg[a++] = (intcap_t)p->info; /* struct __siginfo32 * */ *n_args = 8; break; } @@ -2889,7 +2889,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 533: { struct cap_rights_limit_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->rightsp; /* cap_rights_t * */ + uarg[a++] = (intcap_t)p->rightsp; /* cap_rights_t * */ *n_args = 2; break; } @@ -2897,7 +2897,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 534: { struct freebsd32_cap_ioctls_limit_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->cmds; /* const uint32_t * */ + uarg[a++] = (intcap_t)p->cmds; /* const uint32_t * */ uarg[a++] = p->ncmds; /* size_t */ *n_args = 3; break; @@ -2906,7 +2906,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 535: { struct freebsd32_cap_ioctls_get_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->cmds; /* uint32_t * */ + uarg[a++] = (intcap_t)p->cmds; /* uint32_t * */ uarg[a++] = p->maxcmds; /* size_t */ *n_args = 3; break; @@ -2923,7 +2923,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 537: { struct cap_fcntls_get_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->fcntlrightsp; /* uint32_t * */ + uarg[a++] = (intcap_t)p->fcntlrightsp; /* uint32_t * */ *n_args = 2; break; } @@ -2932,7 +2932,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct bindat_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->name; /* const struct sockaddr * */ iarg[a++] = p->namelen; /* __socklen_t */ *n_args = 4; break; @@ -2942,7 +2942,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct connectat_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->name; /* const struct sockaddr * */ iarg[a++] = p->namelen; /* __socklen_t */ *n_args = 4; break; @@ -2951,7 +2951,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 540: { struct chflagsat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ uarg[a++] = p->flags; /* u_long */ iarg[a++] = p->atflag; /* int */ *n_args = 4; @@ -2961,8 +2961,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 541: { struct accept4_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* struct sockaddr * */ - uarg[a++] = (intptr_t)p->anamelen; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->name; /* struct sockaddr * */ + uarg[a++] = (intcap_t)p->anamelen; /* __socklen_t * */ iarg[a++] = p->flags; /* int */ *n_args = 4; break; @@ -2970,7 +2970,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* pipe2 */ case 542: { struct pipe2_args *p = params; - uarg[a++] = (intptr_t)p->fildes; /* int * */ + uarg[a++] = (intcap_t)p->fildes; /* int * */ iarg[a++] = p->flags; /* int */ *n_args = 2; break; @@ -2978,7 +2978,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_aio_mlock */ case 543: { struct freebsd32_aio_mlock_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb32 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb32 * */ *n_args = 1; break; } @@ -2992,17 +2992,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) uarg[a++] = p->id1; /* uint32_t */ uarg[a++] = p->id2; /* uint32_t */ iarg[a++] = p->com; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->data; /* void * */ *n_args = 6; break; } /* freebsd32_ppoll */ case 545: { struct freebsd32_ppoll_args *p = params; - uarg[a++] = (intptr_t)p->fds; /* struct pollfd * */ + uarg[a++] = (intcap_t)p->fds; /* struct pollfd * */ uarg[a++] = p->nfds; /* u_int */ - uarg[a++] = (intptr_t)p->ts; /* const struct timespec32 * */ - uarg[a++] = (intptr_t)p->set; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->ts; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * */ *n_args = 4; break; } @@ -3010,7 +3010,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 546: { struct freebsd32_futimens_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->times; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->times; /* const struct timespec32 * */ *n_args = 2; break; } @@ -3018,8 +3018,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 547: { struct freebsd32_utimensat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->times; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->times; /* const struct timespec32 * */ iarg[a++] = p->flag; /* int */ *n_args = 4; break; @@ -3035,7 +3035,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 551: { struct freebsd32_fstat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->sb; /* struct stat32 * */ + uarg[a++] = (intcap_t)p->sb; /* struct stat32 * */ *n_args = 2; break; } @@ -3043,8 +3043,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 552: { struct freebsd32_fstatat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->buf; /* struct stat32 * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->buf; /* struct stat32 * */ iarg[a++] = p->flag; /* int */ *n_args = 4; break; @@ -3052,8 +3052,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_fhstat */ case 553: { struct freebsd32_fhstat_args *p = params; - uarg[a++] = (intptr_t)p->u_fhp; /* const struct fhandle * */ - uarg[a++] = (intptr_t)p->sb; /* struct stat32 * */ + uarg[a++] = (intcap_t)p->u_fhp; /* const struct fhandle * */ + uarg[a++] = (intcap_t)p->sb; /* struct stat32 * */ *n_args = 2; break; } @@ -3061,17 +3061,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 554: { struct getdirentries_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* char * */ + uarg[a++] = (intcap_t)p->buf; /* char * */ uarg[a++] = p->count; /* size_t */ - uarg[a++] = (intptr_t)p->basep; /* off_t * */ + uarg[a++] = (intcap_t)p->basep; /* off_t * */ *n_args = 4; break; } /* statfs */ case 555: { struct statfs_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->buf; /* struct statfs * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->buf; /* struct statfs * */ *n_args = 2; break; } @@ -3079,14 +3079,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 556: { struct fstatfs_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* struct statfs * */ + uarg[a++] = (intcap_t)p->buf; /* struct statfs * */ *n_args = 2; break; } /* freebsd32_getfsstat */ case 557: { struct freebsd32_getfsstat_args *p = params; - uarg[a++] = (intptr_t)p->buf; /* struct statfs * */ + uarg[a++] = (intcap_t)p->buf; /* struct statfs * */ iarg[a++] = p->bufsize; /* int32_t */ iarg[a++] = p->mode; /* int */ *n_args = 3; @@ -3095,8 +3095,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* fhstatfs */ case 558: { struct fhstatfs_args *p = params; - uarg[a++] = (intptr_t)p->u_fhp; /* const struct fhandle * */ - uarg[a++] = (intptr_t)p->buf; /* struct statfs * */ + uarg[a++] = (intcap_t)p->u_fhp; /* const struct fhandle * */ + uarg[a++] = (intcap_t)p->buf; /* struct statfs * */ *n_args = 2; break; } @@ -3104,7 +3104,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 559: { struct freebsd32_mknodat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ #ifdef PAD64_REQUIRED iarg[a++] = p->_pad; /* int */ @@ -3118,11 +3118,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 560: { struct freebsd32_kevent_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->changelist; /* const struct kevent32 * */ + uarg[a++] = (intcap_t)p->changelist; /* const struct kevent32 * */ iarg[a++] = p->nchanges; /* int */ - uarg[a++] = (intptr_t)p->eventlist; /* struct kevent32 * */ + uarg[a++] = (intcap_t)p->eventlist; /* struct kevent32 * */ iarg[a++] = p->nevents; /* int */ - uarg[a++] = (intptr_t)p->timeout; /* const struct timespec32 * */ + uarg[a++] = (intcap_t)p->timeout; /* const struct timespec32 * */ *n_args = 6; break; } @@ -3134,8 +3134,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) uarg[a++] = p->id1; /* uint32_t */ uarg[a++] = p->id2; /* uint32_t */ uarg[a++] = p->domainsetsize; /* size_t */ - uarg[a++] = (intptr_t)p->mask; /* domainset_t * */ - uarg[a++] = (intptr_t)p->policy; /* int * */ + uarg[a++] = (intcap_t)p->mask; /* domainset_t * */ + uarg[a++] = (intcap_t)p->policy; /* int * */ *n_args = 7; break; } @@ -3147,7 +3147,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) uarg[a++] = p->id1; /* uint32_t */ uarg[a++] = p->id2; /* uint32_t */ uarg[a++] = p->domainsetsize; /* size_t */ - uarg[a++] = (intptr_t)p->mask; /* domainset_t * */ + uarg[a++] = (intcap_t)p->mask; /* domainset_t * */ iarg[a++] = p->policy; /* int */ *n_args = 7; break; @@ -3155,7 +3155,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* getrandom */ case 563: { struct getrandom_args *p = params; - uarg[a++] = (intptr_t)p->buf; /* void * */ + uarg[a++] = (intcap_t)p->buf; /* void * */ uarg[a++] = p->buflen; /* size_t */ uarg[a++] = p->flags; /* unsigned int */ *n_args = 3; @@ -3165,8 +3165,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 564: { struct getfhat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* char * */ - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * */ + uarg[a++] = (intcap_t)p->path; /* char * */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * */ iarg[a++] = p->flags; /* int */ *n_args = 4; break; @@ -3174,25 +3174,25 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* fhlink */ case 565: { struct fhlink_args *p = params; - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * */ - uarg[a++] = (intptr_t)p->to; /* const char * */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * */ + uarg[a++] = (intcap_t)p->to; /* const char * */ *n_args = 2; break; } /* fhlinkat */ case 566: { struct fhlinkat_args *p = params; - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * */ iarg[a++] = p->tofd; /* int */ - uarg[a++] = (intptr_t)p->to; /* const char * */ + uarg[a++] = (intcap_t)p->to; /* const char * */ *n_args = 3; break; } /* fhreadlink */ case 567: { struct fhreadlink_args *p = params; - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * */ - uarg[a++] = (intptr_t)p->buf; /* char * */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * */ + uarg[a++] = (intcap_t)p->buf; /* char * */ uarg[a++] = p->bufsize; /* size_t */ *n_args = 3; break; @@ -3201,7 +3201,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 568: { struct funlinkat_args *p = params; iarg[a++] = p->dfd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->fd; /* int */ iarg[a++] = p->flag; /* int */ *n_args = 4; @@ -3211,9 +3211,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 569: { struct copy_file_range_args *p = params; iarg[a++] = p->infd; /* int */ - uarg[a++] = (intptr_t)p->inoffp; /* off_t * */ + uarg[a++] = (intcap_t)p->inoffp; /* off_t * */ iarg[a++] = p->outfd; /* int */ - uarg[a++] = (intptr_t)p->outoffp; /* off_t * */ + uarg[a++] = (intcap_t)p->outoffp; /* off_t * */ uarg[a++] = p->len; /* size_t */ uarg[a++] = p->flags; /* unsigned int */ *n_args = 6; @@ -3222,11 +3222,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32___sysctlbyname */ case 570: { struct freebsd32___sysctlbyname_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ uarg[a++] = p->namelen; /* size_t */ - uarg[a++] = (intptr_t)p->old; /* void * */ - uarg[a++] = (intptr_t)p->oldlenp; /* uint32_t * */ - uarg[a++] = (intptr_t)p->new; /* void * */ + uarg[a++] = (intcap_t)p->old; /* void * */ + uarg[a++] = (intcap_t)p->oldlenp; /* uint32_t * */ + uarg[a++] = (intcap_t)p->new; /* void * */ uarg[a++] = p->newlen; /* size_t */ *n_args = 6; break; @@ -3234,19 +3234,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* shm_open2 */ case 571: { struct shm_open2_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flags; /* int */ iarg[a++] = p->mode; /* mode_t */ iarg[a++] = p->shmflags; /* int */ - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ *n_args = 5; break; } /* shm_rename */ case 572: { struct shm_rename_args *p = params; - uarg[a++] = (intptr_t)p->path_from; /* const char * */ - uarg[a++] = (intptr_t)p->path_to; /* const char * */ + uarg[a++] = (intcap_t)p->path_from; /* const char * */ + uarg[a++] = (intcap_t)p->path_to; /* const char * */ iarg[a++] = p->flags; /* int */ *n_args = 3; break; @@ -3255,7 +3255,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 573: { struct sigfastblock_args *p = params; iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->ptr; /* void * */ + uarg[a++] = (intcap_t)p->ptr; /* void * */ *n_args = 2; break; } @@ -3263,8 +3263,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 574: { struct __realpathat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->buf; /* char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->buf; /* char * */ uarg[a++] = p->size; /* size_t */ iarg[a++] = p->flags; /* int */ *n_args = 5; @@ -3283,7 +3283,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 576: { struct rpctls_syscall_args *p = params; iarg[a++] = p->op; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 2; break; } @@ -3291,7 +3291,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 577: { struct freebsd32___specialfd_args *p = params; iarg[a++] = p->type; /* int */ - uarg[a++] = (intptr_t)p->req; /* const void * */ + uarg[a++] = (intcap_t)p->req; /* const void * */ uarg[a++] = p->len; /* size_t */ *n_args = 3; break; @@ -3299,14 +3299,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd32_aio_writev */ case 578: { struct freebsd32_aio_writev_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb32 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb32 * */ *n_args = 1; break; } /* freebsd32_aio_readv */ case 579: { struct freebsd32_aio_readv_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb32 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb32 * */ *n_args = 1; break; } @@ -3315,9 +3315,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct fspacectl_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->rqsr; /* const struct spacectl_range * */ + uarg[a++] = (intcap_t)p->rqsr; /* const struct spacectl_range * */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->rmsr; /* struct spacectl_range * */ + uarg[a++] = (intcap_t)p->rmsr; /* struct spacectl_range * */ *n_args = 5; break; } @@ -3329,7 +3329,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* swapoff */ case 582: { struct swapoff_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ uarg[a++] = p->flags; /* u_int */ *n_args = 2; break; @@ -3362,7 +3362,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 586: { struct freebsd32_timerfd_gettime_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->curr_value; /* struct itimerspec32 * */ + uarg[a++] = (intcap_t)p->curr_value; /* struct itimerspec32 * */ *n_args = 2; break; } @@ -3371,8 +3371,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd32_timerfd_settime_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->new_value; /* const struct itimerspec32 * */ - uarg[a++] = (intptr_t)p->old_value; /* struct itimerspec32 * */ + uarg[a++] = (intcap_t)p->new_value; /* const struct itimerspec32 * */ + uarg[a++] = (intcap_t)p->old_value; /* struct itimerspec32 * */ *n_args = 4; break; } @@ -3382,8 +3382,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->pid1; /* pid_t */ iarg[a++] = p->pid2; /* pid_t */ iarg[a++] = p->type; /* int */ - uarg[a++] = (intptr_t)p->idx1; /* uintptr32_t */ - uarg[a++] = (intptr_t)p->idx2; /* uintptr32_t */ + uarg[a++] = p->idx1; /* uintptr32_t */ + uarg[a++] = p->idx2; /* uintptr32_t */ *n_args = 5; break; } @@ -3392,7 +3392,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct getrlimitusage_args *p = params; uarg[a++] = p->which; /* u_int */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->res; /* rlim_t * */ + uarg[a++] = (intcap_t)p->res; /* rlim_t * */ *n_args = 3; break; } diff --git a/sys/compat/freebsd64/freebsd64_systrace_args.c b/sys/compat/freebsd64/freebsd64_systrace_args.c index 4cdb465f598b..9b0346adb955 100644 --- a/sys/compat/freebsd64/freebsd64_systrace_args.c +++ b/sys/compat/freebsd64/freebsd64_systrace_args.c @@ -7,9 +7,9 @@ */ static void -systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) +systrace_args(int sysnum, void *params, uintcap_t *uarg, int *n_args) { - int64_t *iarg = (int64_t *)uarg; + intcap_t *iarg = (intcap_t *)uarg; int a = 0; switch (sysnum) { /* syscall */ @@ -33,7 +33,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 3: { struct freebsd64_read_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* void * */ + uarg[a++] = (intcap_t)p->buf; /* void * */ uarg[a++] = p->nbyte; /* size_t */ *n_args = 3; break; @@ -42,7 +42,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 4: { struct freebsd64_write_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* const void * */ + uarg[a++] = (intcap_t)p->buf; /* const void * */ uarg[a++] = p->nbyte; /* size_t */ *n_args = 3; break; @@ -50,7 +50,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_open */ case 5: { struct freebsd64_open_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flags; /* int */ iarg[a++] = p->mode; /* mode_t */ *n_args = 3; @@ -67,31 +67,31 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 7: { struct freebsd64_wait4_args *p = params; iarg[a++] = p->pid; /* int */ - uarg[a++] = (intptr_t)p->status; /* int * */ + uarg[a++] = (intcap_t)p->status; /* int * */ iarg[a++] = p->options; /* int */ - uarg[a++] = (intptr_t)p->rusage; /* struct rusage * */ + uarg[a++] = (intcap_t)p->rusage; /* struct rusage * */ *n_args = 4; break; } /* freebsd64_link */ case 9: { struct freebsd64_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->to; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->to; /* const char * */ *n_args = 2; break; } /* freebsd64_unlink */ case 10: { struct freebsd64_unlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd64_chdir */ case 12: { struct freebsd64_chdir_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } @@ -105,7 +105,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_chmod */ case 15: { struct freebsd64_chmod_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ *n_args = 2; break; @@ -113,7 +113,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_chown */ case 16: { struct freebsd64_chown_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->uid; /* int */ iarg[a++] = p->gid; /* int */ *n_args = 3; @@ -122,7 +122,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_break */ case 17: { struct freebsd64_break_args *p = params; - uarg[a++] = (intptr_t)p->nsize; /* char * */ + uarg[a++] = (intcap_t)p->nsize; /* char * */ *n_args = 1; break; } @@ -134,17 +134,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_mount */ case 21: { struct freebsd64_mount_args *p = params; - uarg[a++] = (intptr_t)p->type; /* const char * */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->type; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->data; /* void * */ *n_args = 4; break; } /* freebsd64_unmount */ case 22: { struct freebsd64_unmount_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flags; /* int */ *n_args = 2; break; @@ -171,7 +171,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_ptrace_args *p = params; iarg[a++] = p->req; /* int */ iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->addr; /* char * */ + uarg[a++] = (intcap_t)p->addr; /* char * */ iarg[a++] = p->data; /* int */ *n_args = 4; break; @@ -180,7 +180,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 27: { struct freebsd64_recvmsg_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->msg; /* struct msghdr64 * */ + uarg[a++] = (intcap_t)p->msg; /* struct msghdr64 * */ iarg[a++] = p->flags; /* int */ *n_args = 3; break; @@ -189,7 +189,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 28: { struct freebsd64_sendmsg_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->msg; /* const struct msghdr64 * */ + uarg[a++] = (intcap_t)p->msg; /* const struct msghdr64 * */ iarg[a++] = p->flags; /* int */ *n_args = 3; break; @@ -198,11 +198,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 29: { struct freebsd64_recvfrom_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->buf; /* void * */ + uarg[a++] = (intcap_t)p->buf; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->from; /* struct sockaddr * */ - uarg[a++] = (intptr_t)p->fromlenaddr; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->from; /* struct sockaddr * */ + uarg[a++] = (intcap_t)p->fromlenaddr; /* __socklen_t * */ *n_args = 6; break; } @@ -210,8 +210,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 30: { struct freebsd64_accept_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* struct sockaddr * */ - uarg[a++] = (intptr_t)p->anamelen; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->name; /* struct sockaddr * */ + uarg[a++] = (intcap_t)p->anamelen; /* __socklen_t * */ *n_args = 3; break; } @@ -219,8 +219,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 31: { struct freebsd64_getpeername_args *p = params; iarg[a++] = p->fdes; /* int */ - uarg[a++] = (intptr_t)p->asa; /* struct sockaddr * */ - uarg[a++] = (intptr_t)p->alen; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->asa; /* struct sockaddr * */ + uarg[a++] = (intcap_t)p->alen; /* __socklen_t * */ *n_args = 3; break; } @@ -228,15 +228,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 32: { struct freebsd64_getsockname_args *p = params; iarg[a++] = p->fdes; /* int */ - uarg[a++] = (intptr_t)p->asa; /* struct sockaddr * */ - uarg[a++] = (intptr_t)p->alen; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->asa; /* struct sockaddr * */ + uarg[a++] = (intcap_t)p->alen; /* __socklen_t * */ *n_args = 3; break; } /* freebsd64_access */ case 33: { struct freebsd64_access_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->amode; /* int */ *n_args = 2; break; @@ -244,7 +244,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_chflags */ case 34: { struct freebsd64_chflags_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ uarg[a++] = p->flags; /* u_long */ *n_args = 2; break; @@ -290,7 +290,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_profil */ case 44: { struct freebsd64_profil_args *p = params; - uarg[a++] = (intptr_t)p->samples; /* char * */ + uarg[a++] = (intcap_t)p->samples; /* char * */ uarg[a++] = p->size; /* size_t */ uarg[a++] = p->offset; /* size_t */ uarg[a++] = p->scale; /* u_int */ @@ -300,7 +300,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_ktrace */ case 45: { struct freebsd64_ktrace_args *p = params; - uarg[a++] = (intptr_t)p->fname; /* const char * */ + uarg[a++] = (intcap_t)p->fname; /* const char * */ iarg[a++] = p->ops; /* int */ iarg[a++] = p->facs; /* int */ iarg[a++] = p->pid; /* int */ @@ -315,7 +315,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_getlogin */ case 49: { struct freebsd64_getlogin_args *p = params; - uarg[a++] = (intptr_t)p->namebuf; /* char * */ + uarg[a++] = (intcap_t)p->namebuf; /* char * */ uarg[a++] = p->namelen; /* u_int */ *n_args = 2; break; @@ -323,22 +323,22 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_setlogin */ case 50: { struct freebsd64_setlogin_args *p = params; - uarg[a++] = (intptr_t)p->namebuf; /* const char * */ + uarg[a++] = (intcap_t)p->namebuf; /* const char * */ *n_args = 1; break; } /* freebsd64_acct */ case 51: { struct freebsd64_acct_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd64_sigaltstack */ case 53: { struct freebsd64_sigaltstack_args *p = params; - uarg[a++] = (intptr_t)p->ss; /* const struct sigaltstack64 * */ - uarg[a++] = (intptr_t)p->oss; /* struct sigaltstack64 * */ + uarg[a++] = (intcap_t)p->ss; /* const struct sigaltstack64 * */ + uarg[a++] = (intcap_t)p->oss; /* struct sigaltstack64 * */ *n_args = 2; break; } @@ -347,7 +347,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_ioctl_args *p = params; iarg[a++] = p->fd; /* int */ uarg[a++] = p->com; /* u_long */ - uarg[a++] = (intptr_t)p->data; /* char * */ + uarg[a++] = (intcap_t)p->data; /* char * */ *n_args = 3; break; } @@ -361,23 +361,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_revoke */ case 56: { struct freebsd64_revoke_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd64_symlink */ case 57: { struct freebsd64_symlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->link; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->link; /* const char * */ *n_args = 2; break; } /* freebsd64_readlink */ case 58: { struct freebsd64_readlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->buf; /* char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->buf; /* char * */ uarg[a++] = p->count; /* size_t */ *n_args = 3; break; @@ -385,9 +385,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_execve */ case 59: { struct freebsd64_execve_args *p = params; - uarg[a++] = (intptr_t)p->fname; /* const char * */ - uarg[a++] = (intptr_t)p->argv; /* char ** */ - uarg[a++] = (intptr_t)p->envv; /* char ** */ + uarg[a++] = (intcap_t)p->fname; /* const char * */ + uarg[a++] = (intcap_t)p->argv; /* char ** */ + uarg[a++] = (intcap_t)p->envv; /* char ** */ *n_args = 3; break; } @@ -401,14 +401,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_chroot */ case 61: { struct freebsd64_chroot_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd64_msync */ case 65: { struct freebsd64_msync_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * */ + uarg[a++] = (intcap_t)p->addr; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->flags; /* int */ *n_args = 3; @@ -422,7 +422,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_munmap */ case 73: { struct freebsd64_munmap_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * */ + uarg[a++] = (intcap_t)p->addr; /* void * */ uarg[a++] = p->len; /* size_t */ *n_args = 2; break; @@ -430,7 +430,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_mprotect */ case 74: { struct freebsd64_mprotect_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * */ + uarg[a++] = (intcap_t)p->addr; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->prot; /* int */ *n_args = 3; @@ -439,7 +439,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_madvise */ case 75: { struct freebsd64_madvise_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * */ + uarg[a++] = (intcap_t)p->addr; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->behav; /* int */ *n_args = 3; @@ -448,9 +448,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_mincore */ case 78: { struct freebsd64_mincore_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* const void * */ + uarg[a++] = (intcap_t)p->addr; /* const void * */ uarg[a++] = p->len; /* size_t */ - uarg[a++] = (intptr_t)p->vec; /* char * */ + uarg[a++] = (intcap_t)p->vec; /* char * */ *n_args = 3; break; } @@ -458,7 +458,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 79: { struct freebsd64_getgroups_args *p = params; iarg[a++] = p->gidsetsize; /* int */ - uarg[a++] = (intptr_t)p->gidset; /* gid_t * */ + uarg[a++] = (intcap_t)p->gidset; /* gid_t * */ *n_args = 2; break; } @@ -466,7 +466,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 80: { struct freebsd64_setgroups_args *p = params; iarg[a++] = p->gidsetsize; /* int */ - uarg[a++] = (intptr_t)p->gidset; /* const gid_t * */ + uarg[a++] = (intcap_t)p->gidset; /* const gid_t * */ *n_args = 2; break; } @@ -487,15 +487,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 83: { struct freebsd64_setitimer_args *p = params; iarg[a++] = p->which; /* int */ - uarg[a++] = (intptr_t)p->itv; /* const struct itimerval * */ - uarg[a++] = (intptr_t)p->oitv; /* struct itimerval * */ + uarg[a++] = (intcap_t)p->itv; /* const struct itimerval * */ + uarg[a++] = (intcap_t)p->oitv; /* struct itimerval * */ *n_args = 3; break; } /* freebsd64_swapon */ case 85: { struct freebsd64_swapon_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ *n_args = 1; break; } @@ -503,7 +503,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 86: { struct freebsd64_getitimer_args *p = params; iarg[a++] = p->which; /* int */ - uarg[a++] = (intptr_t)p->itv; /* struct itimerval * */ + uarg[a++] = (intcap_t)p->itv; /* struct itimerval * */ *n_args = 2; break; } @@ -523,7 +523,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_cheri_cidcap_alloc */ case 91: { struct freebsd64_cheri_cidcap_alloc_args *p = params; - uarg[a++] = (intptr_t)p->cidp; /* uintcap_t * */ + uarg[a++] = (intcap_t)p->cidp; /* uintcap_t * */ *n_args = 1; break; } @@ -532,7 +532,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_fcntl_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->arg; /* intptr64_t */ + iarg[a++] = p->arg; /* intptr64_t */ *n_args = 3; break; } @@ -540,10 +540,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 93: { struct freebsd64_select_args *p = params; iarg[a++] = p->nd; /* int */ - uarg[a++] = (intptr_t)p->in; /* fd_set * */ - uarg[a++] = (intptr_t)p->ou; /* fd_set * */ - uarg[a++] = (intptr_t)p->ex; /* fd_set * */ - uarg[a++] = (intptr_t)p->tv; /* struct timeval * */ + uarg[a++] = (intcap_t)p->in; /* fd_set * */ + uarg[a++] = (intcap_t)p->ou; /* fd_set * */ + uarg[a++] = (intcap_t)p->ex; /* fd_set * */ + uarg[a++] = (intcap_t)p->tv; /* struct timeval * */ *n_args = 5; break; } @@ -576,7 +576,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 98: { struct freebsd64_connect_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->name; /* const struct sockaddr * */ iarg[a++] = p->namelen; /* __socklen_t */ *n_args = 3; break; @@ -593,7 +593,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 104: { struct freebsd64_bind_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->name; /* const struct sockaddr * */ iarg[a++] = p->namelen; /* __socklen_t */ *n_args = 3; break; @@ -604,7 +604,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->s; /* int */ iarg[a++] = p->level; /* int */ iarg[a++] = p->name; /* int */ - uarg[a++] = (intptr_t)p->val; /* const void * */ + uarg[a++] = (intcap_t)p->val; /* const void * */ iarg[a++] = p->valsize; /* __socklen_t */ *n_args = 5; break; @@ -620,8 +620,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_gettimeofday */ case 116: { struct freebsd64_gettimeofday_args *p = params; - uarg[a++] = (intptr_t)p->tp; /* struct timeval * */ - uarg[a++] = (intptr_t)p->tzp; /* struct timezone * */ + uarg[a++] = (intcap_t)p->tp; /* struct timeval * */ + uarg[a++] = (intcap_t)p->tzp; /* struct timezone * */ *n_args = 2; break; } @@ -629,7 +629,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 117: { struct freebsd64_getrusage_args *p = params; iarg[a++] = p->who; /* int */ - uarg[a++] = (intptr_t)p->rusage; /* struct rusage * */ + uarg[a++] = (intcap_t)p->rusage; /* struct rusage * */ *n_args = 2; break; } @@ -639,8 +639,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->s; /* int */ iarg[a++] = p->level; /* int */ iarg[a++] = p->name; /* int */ - uarg[a++] = (intptr_t)p->val; /* void * */ - uarg[a++] = (intptr_t)p->avalsize; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->val; /* void * */ + uarg[a++] = (intcap_t)p->avalsize; /* __socklen_t * */ *n_args = 5; break; } @@ -648,7 +648,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 120: { struct freebsd64_readv_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->iovp; /* const struct iovec64 * */ + uarg[a++] = (intcap_t)p->iovp; /* const struct iovec64 * */ uarg[a++] = p->iovcnt; /* u_int */ *n_args = 3; break; @@ -657,7 +657,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 121: { struct freebsd64_writev_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->iovp; /* const struct iovec64 * */ + uarg[a++] = (intcap_t)p->iovp; /* const struct iovec64 * */ uarg[a++] = p->iovcnt; /* u_int */ *n_args = 3; break; @@ -665,8 +665,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_settimeofday */ case 122: { struct freebsd64_settimeofday_args *p = params; - uarg[a++] = (intptr_t)p->tv; /* const struct timeval * */ - uarg[a++] = (intptr_t)p->tzp; /* const struct timezone * */ + uarg[a++] = (intcap_t)p->tv; /* const struct timeval * */ + uarg[a++] = (intcap_t)p->tzp; /* const struct timezone * */ *n_args = 2; break; } @@ -706,8 +706,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_rename */ case 128: { struct freebsd64_rename_args *p = params; - uarg[a++] = (intptr_t)p->from; /* const char * */ - uarg[a++] = (intptr_t)p->to; /* const char * */ + uarg[a++] = (intcap_t)p->from; /* const char * */ + uarg[a++] = (intcap_t)p->to; /* const char * */ *n_args = 2; break; } @@ -722,7 +722,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_mkfifo */ case 132: { struct freebsd64_mkfifo_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ *n_args = 2; break; @@ -731,10 +731,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 133: { struct freebsd64_sendto_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->buf; /* const void * */ + uarg[a++] = (intcap_t)p->buf; /* const void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->to; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->to; /* const struct sockaddr * */ iarg[a++] = p->tolen; /* __socklen_t */ *n_args = 6; break; @@ -753,14 +753,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->domain; /* int */ iarg[a++] = p->type; /* int */ iarg[a++] = p->protocol; /* int */ - uarg[a++] = (intptr_t)p->rsv; /* int * */ + uarg[a++] = (intcap_t)p->rsv; /* int * */ *n_args = 4; break; } /* freebsd64_mkdir */ case 136: { struct freebsd64_mkdir_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ *n_args = 2; break; @@ -768,23 +768,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_rmdir */ case 137: { struct freebsd64_rmdir_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd64_utimes */ case 138: { struct freebsd64_utimes_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->tptr; /* const struct timeval * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->tptr; /* const struct timeval * */ *n_args = 2; break; } /* freebsd64_adjtime */ case 140: { struct freebsd64_adjtime_args *p = params; - uarg[a++] = (intptr_t)p->delta; /* const struct timeval * */ - uarg[a++] = (intptr_t)p->olddelta; /* struct timeval * */ + uarg[a++] = (intcap_t)p->delta; /* const struct timeval * */ + uarg[a++] = (intcap_t)p->olddelta; /* struct timeval * */ *n_args = 2; break; } @@ -796,10 +796,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_quotactl */ case 148: { struct freebsd64_quotactl_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->cmd; /* int */ iarg[a++] = p->uid; /* int */ - uarg[a++] = (intptr_t)p->arg; /* void * */ + uarg[a++] = (intcap_t)p->arg; /* void * */ *n_args = 4; break; } @@ -809,7 +809,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->debug_level; /* int */ iarg[a++] = p->grace_period; /* int */ iarg[a++] = p->addr_count; /* int */ - uarg[a++] = (intptr_t)p->addrs; /* char ** */ + uarg[a++] = (intcap_t)p->addrs; /* char ** */ *n_args = 4; break; } @@ -817,23 +817,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 155: { struct freebsd64_nfssvc_args *p = params; iarg[a++] = p->flag; /* int */ - uarg[a++] = (intptr_t)p->argp; /* void * */ + uarg[a++] = (intcap_t)p->argp; /* void * */ *n_args = 2; break; } /* freebsd64_lgetfh */ case 160: { struct freebsd64_lgetfh_args *p = params; - uarg[a++] = (intptr_t)p->fname; /* const char * */ - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * */ + uarg[a++] = (intcap_t)p->fname; /* const char * */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * */ *n_args = 2; break; } /* freebsd64_getfh */ case 161: { struct freebsd64_getfh_args *p = params; - uarg[a++] = (intptr_t)p->fname; /* const char * */ - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * */ + uarg[a++] = (intcap_t)p->fname; /* const char * */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * */ *n_args = 2; break; } @@ -841,7 +841,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 165: { struct freebsd64_sysarch_args *p = params; iarg[a++] = p->op; /* int */ - uarg[a++] = (intptr_t)p->parms; /* char * */ + uarg[a++] = (intcap_t)p->parms; /* char * */ *n_args = 2; break; } @@ -850,7 +850,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_rtprio_args *p = params; iarg[a++] = p->function; /* int */ iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->rtp; /* struct rtprio * */ + uarg[a++] = (intcap_t)p->rtp; /* struct rtprio * */ *n_args = 3; break; } @@ -897,7 +897,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_ntp_adjtime */ case 176: { struct freebsd64_ntp_adjtime_args *p = params; - uarg[a++] = (intptr_t)p->tp; /* struct timex * */ + uarg[a++] = (intcap_t)p->tp; /* struct timex * */ *n_args = 1; break; } @@ -925,7 +925,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_pathconf */ case 191: { struct freebsd64_pathconf_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->name; /* int */ *n_args = 2; break; @@ -942,7 +942,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 194: { struct freebsd64_getrlimit_args *p = params; uarg[a++] = p->which; /* u_int */ - uarg[a++] = (intptr_t)p->rlp; /* struct rlimit * */ + uarg[a++] = (intcap_t)p->rlp; /* struct rlimit * */ *n_args = 2; break; } @@ -950,7 +950,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 195: { struct freebsd64_setrlimit_args *p = params; uarg[a++] = p->which; /* u_int */ - uarg[a++] = (intptr_t)p->rlp; /* struct rlimit * */ + uarg[a++] = (intcap_t)p->rlp; /* struct rlimit * */ *n_args = 2; break; } @@ -962,11 +962,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64___sysctl */ case 202: { struct freebsd64___sysctl_args *p = params; - uarg[a++] = (intptr_t)p->name; /* int * */ + uarg[a++] = (intcap_t)p->name; /* int * */ uarg[a++] = p->namelen; /* u_int */ - uarg[a++] = (intptr_t)p->old; /* void * */ - uarg[a++] = (intptr_t)p->oldlenp; /* size_t * */ - uarg[a++] = (intptr_t)p->new; /* const void * */ + uarg[a++] = (intcap_t)p->old; /* void * */ + uarg[a++] = (intcap_t)p->oldlenp; /* size_t * */ + uarg[a++] = (intcap_t)p->new; /* const void * */ uarg[a++] = p->newlen; /* size_t */ *n_args = 6; break; @@ -974,7 +974,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_mlock */ case 203: { struct freebsd64_mlock_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* const void * */ + uarg[a++] = (intcap_t)p->addr; /* const void * */ uarg[a++] = p->len; /* size_t */ *n_args = 2; break; @@ -982,7 +982,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_munlock */ case 204: { struct freebsd64_munlock_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* const void * */ + uarg[a++] = (intcap_t)p->addr; /* const void * */ uarg[a++] = p->len; /* size_t */ *n_args = 2; break; @@ -990,7 +990,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_undelete */ case 205: { struct freebsd64_undelete_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } @@ -998,7 +998,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 206: { struct freebsd64_futimes_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->tptr; /* const struct timeval * */ + uarg[a++] = (intcap_t)p->tptr; /* const struct timeval * */ *n_args = 2; break; } @@ -1012,7 +1012,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_poll */ case 209: { struct freebsd64_poll_args *p = params; - uarg[a++] = (intptr_t)p->fds; /* struct pollfd * */ + uarg[a++] = (intcap_t)p->fds; /* struct pollfd * */ uarg[a++] = p->nfds; /* u_int */ iarg[a++] = p->timeout; /* int */ *n_args = 3; @@ -1081,7 +1081,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 222: { struct freebsd64_semop_args *p = params; iarg[a++] = p->semid; /* int */ - uarg[a++] = (intptr_t)p->sops; /* struct sembuf * */ + uarg[a++] = (intcap_t)p->sops; /* struct sembuf * */ uarg[a++] = p->nsops; /* size_t */ *n_args = 3; break; @@ -1098,7 +1098,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 226: { struct freebsd64_msgsnd_args *p = params; iarg[a++] = p->msqid; /* int */ - uarg[a++] = (intptr_t)p->msgp; /* const void * */ + uarg[a++] = (intcap_t)p->msgp; /* const void * */ uarg[a++] = p->msgsz; /* size_t */ iarg[a++] = p->msgflg; /* int */ *n_args = 4; @@ -1108,7 +1108,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 227: { struct freebsd64_msgrcv_args *p = params; iarg[a++] = p->msqid; /* int */ - uarg[a++] = (intptr_t)p->msgp; /* void * */ + uarg[a++] = (intcap_t)p->msgp; /* void * */ uarg[a++] = p->msgsz; /* size_t */ iarg[a++] = p->msgtyp; /* long */ iarg[a++] = p->msgflg; /* int */ @@ -1119,7 +1119,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 228: { struct freebsd64_shmat_args *p = params; iarg[a++] = p->shmid; /* int */ - uarg[a++] = (intptr_t)p->shmaddr; /* const void * */ + uarg[a++] = (intcap_t)p->shmaddr; /* const void * */ iarg[a++] = p->shmflg; /* int */ *n_args = 3; break; @@ -1127,7 +1127,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_shmdt */ case 230: { struct freebsd64_shmdt_args *p = params; - uarg[a++] = (intptr_t)p->shmaddr; /* const void * */ + uarg[a++] = (intcap_t)p->shmaddr; /* const void * */ *n_args = 1; break; } @@ -1144,7 +1144,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 232: { struct freebsd64_clock_gettime_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ - uarg[a++] = (intptr_t)p->tp; /* struct timespec * */ + uarg[a++] = (intcap_t)p->tp; /* struct timespec * */ *n_args = 2; break; } @@ -1152,7 +1152,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 233: { struct freebsd64_clock_settime_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ - uarg[a++] = (intptr_t)p->tp; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->tp; /* const struct timespec * */ *n_args = 2; break; } @@ -1160,7 +1160,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 234: { struct freebsd64_clock_getres_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ - uarg[a++] = (intptr_t)p->tp; /* struct timespec * */ + uarg[a++] = (intcap_t)p->tp; /* struct timespec * */ *n_args = 2; break; } @@ -1168,8 +1168,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 235: { struct freebsd64_ktimer_create_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ - uarg[a++] = (intptr_t)p->evp; /* struct sigevent64 * */ - uarg[a++] = (intptr_t)p->timerid; /* int * */ + uarg[a++] = (intcap_t)p->evp; /* struct sigevent64 * */ + uarg[a++] = (intcap_t)p->timerid; /* int * */ *n_args = 3; break; } @@ -1185,8 +1185,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_ktimer_settime_args *p = params; iarg[a++] = p->timerid; /* int */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->value; /* const struct itimerspec * */ - uarg[a++] = (intptr_t)p->ovalue; /* struct itimerspec * */ + uarg[a++] = (intcap_t)p->value; /* const struct itimerspec * */ + uarg[a++] = (intcap_t)p->ovalue; /* struct itimerspec * */ *n_args = 4; break; } @@ -1194,7 +1194,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 238: { struct freebsd64_ktimer_gettime_args *p = params; iarg[a++] = p->timerid; /* int */ - uarg[a++] = (intptr_t)p->value; /* struct itimerspec * */ + uarg[a++] = (intcap_t)p->value; /* struct itimerspec * */ *n_args = 2; break; } @@ -1208,29 +1208,29 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_nanosleep */ case 240: { struct freebsd64_nanosleep_args *p = params; - uarg[a++] = (intptr_t)p->rqtp; /* const struct timespec * */ - uarg[a++] = (intptr_t)p->rmtp; /* struct timespec * */ + uarg[a++] = (intcap_t)p->rqtp; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->rmtp; /* struct timespec * */ *n_args = 2; break; } /* freebsd64_ffclock_getcounter */ case 241: { struct freebsd64_ffclock_getcounter_args *p = params; - uarg[a++] = (intptr_t)p->ffcount; /* ffcounter * */ + uarg[a++] = (intcap_t)p->ffcount; /* ffcounter * */ *n_args = 1; break; } /* freebsd64_ffclock_setestimate */ case 242: { struct freebsd64_ffclock_setestimate_args *p = params; - uarg[a++] = (intptr_t)p->cest; /* struct ffclock_estimate * */ + uarg[a++] = (intcap_t)p->cest; /* struct ffclock_estimate * */ *n_args = 1; break; } /* freebsd64_ffclock_getestimate */ case 243: { struct freebsd64_ffclock_getestimate_args *p = params; - uarg[a++] = (intptr_t)p->cest; /* struct ffclock_estimate * */ + uarg[a++] = (intcap_t)p->cest; /* struct ffclock_estimate * */ *n_args = 1; break; } @@ -1239,8 +1239,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_clock_nanosleep_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->rqtp; /* const struct timespec * */ - uarg[a++] = (intptr_t)p->rmtp; /* struct timespec * */ + uarg[a++] = (intcap_t)p->rqtp; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->rmtp; /* struct timespec * */ *n_args = 4; break; } @@ -1249,21 +1249,21 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_clock_getcpuclockid2_args *p = params; iarg[a++] = p->id; /* id_t */ iarg[a++] = p->which; /* int */ - uarg[a++] = (intptr_t)p->clock_id; /* clockid_t * */ + uarg[a++] = (intcap_t)p->clock_id; /* clockid_t * */ *n_args = 3; break; } /* freebsd64_ntp_gettime */ case 248: { struct freebsd64_ntp_gettime_args *p = params; - uarg[a++] = (intptr_t)p->ntvp; /* struct ntptimeval * */ + uarg[a++] = (intcap_t)p->ntvp; /* struct ntptimeval * */ *n_args = 1; break; } /* freebsd64_minherit */ case 250: { struct freebsd64_minherit_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * */ + uarg[a++] = (intcap_t)p->addr; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->inherit; /* int */ *n_args = 3; @@ -1284,7 +1284,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_lchown */ case 254: { struct freebsd64_lchown_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->uid; /* int */ iarg[a++] = p->gid; /* int */ *n_args = 3; @@ -1293,14 +1293,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_aio_read */ case 255: { struct freebsd64_aio_read_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb64 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb64 * */ *n_args = 1; break; } /* freebsd64_aio_write */ case 256: { struct freebsd64_aio_write_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb64 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb64 * */ *n_args = 1; break; } @@ -1308,17 +1308,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 257: { struct freebsd64_lio_listio_args *p = params; iarg[a++] = p->mode; /* int */ - uarg[a++] = (intptr_t)p->acb_list; /* struct aiocb64 * const * */ + uarg[a++] = (intcap_t)p->acb_list; /* struct aiocb64 * const * */ iarg[a++] = p->nent; /* int */ - uarg[a++] = (intptr_t)p->sig; /* struct sigevent64 * */ + uarg[a++] = (intcap_t)p->sig; /* struct sigevent64 * */ *n_args = 4; break; } /* freebsd64_kbounce */ case 258: { struct freebsd64_kbounce_args *p = params; - uarg[a++] = (intptr_t)p->src; /* const void * */ - uarg[a++] = (intptr_t)p->dst; /* void * */ + uarg[a++] = (intcap_t)p->src; /* const void * */ + uarg[a++] = (intcap_t)p->dst; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->flags; /* int */ *n_args = 4; @@ -1327,7 +1327,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_flag_captured */ case 259: { struct freebsd64_flag_captured_args *p = params; - uarg[a++] = (intptr_t)p->message; /* const char * */ + uarg[a++] = (intcap_t)p->message; /* const char * */ uarg[a++] = p->key; /* uint32_t */ *n_args = 2; break; @@ -1335,7 +1335,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_lchmod */ case 274: { struct freebsd64_lchmod_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ *n_args = 2; break; @@ -1343,8 +1343,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_lutimes */ case 276: { struct freebsd64_lutimes_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->tptr; /* const struct timeval * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->tptr; /* const struct timeval * */ *n_args = 2; break; } @@ -1352,7 +1352,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 289: { struct freebsd64_preadv_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->iovp; /* struct iovec64 * */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec64 * */ uarg[a++] = p->iovcnt; /* u_int */ iarg[a++] = p->offset; /* off_t */ *n_args = 4; @@ -1362,7 +1362,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 290: { struct freebsd64_pwritev_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->iovp; /* struct iovec64 * */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec64 * */ uarg[a++] = p->iovcnt; /* u_int */ iarg[a++] = p->offset; /* off_t */ *n_args = 4; @@ -1371,7 +1371,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_fhopen */ case 298: { struct freebsd64_fhopen_args *p = params; - uarg[a++] = (intptr_t)p->u_fhp; /* const struct fhandle * */ + uarg[a++] = (intcap_t)p->u_fhp; /* const struct fhandle * */ iarg[a++] = p->flags; /* int */ *n_args = 2; break; @@ -1387,7 +1387,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 301: { struct freebsd64_modstat_args *p = params; iarg[a++] = p->modid; /* int */ - uarg[a++] = (intptr_t)p->stat; /* struct module_stat * */ + uarg[a++] = (intcap_t)p->stat; /* struct module_stat * */ *n_args = 2; break; } @@ -1401,14 +1401,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_modfind */ case 303: { struct freebsd64_modfind_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ *n_args = 1; break; } /* freebsd64_kldload */ case 304: { struct freebsd64_kldload_args *p = params; - uarg[a++] = (intptr_t)p->file; /* const char * */ + uarg[a++] = (intcap_t)p->file; /* const char * */ *n_args = 1; break; } @@ -1422,7 +1422,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_kldfind */ case 306: { struct freebsd64_kldfind_args *p = params; - uarg[a++] = (intptr_t)p->file; /* const char * */ + uarg[a++] = (intcap_t)p->file; /* const char * */ *n_args = 1; break; } @@ -1437,7 +1437,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 308: { struct freebsd64_kldstat_args *p = params; iarg[a++] = p->fileid; /* int */ - uarg[a++] = (intptr_t)p->stat; /* struct kld_file_stat64 * */ + uarg[a++] = (intcap_t)p->stat; /* struct kld_file_stat64 * */ *n_args = 2; break; } @@ -1476,16 +1476,16 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_aio_return */ case 314: { struct freebsd64_aio_return_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb64 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb64 * */ *n_args = 1; break; } /* freebsd64_aio_suspend */ case 315: { struct freebsd64_aio_suspend_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* const struct aiocb64 * const * */ + uarg[a++] = (intcap_t)p->aiocbp; /* const struct aiocb64 * const * */ iarg[a++] = p->nent; /* int */ - uarg[a++] = (intptr_t)p->timeout; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->timeout; /* const struct timespec * */ *n_args = 3; break; } @@ -1493,14 +1493,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 316: { struct freebsd64_aio_cancel_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb64 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb64 * */ *n_args = 2; break; } /* freebsd64_aio_error */ case 317: { struct freebsd64_aio_error_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb64 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb64 * */ *n_args = 1; break; } @@ -1524,7 +1524,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64___getcwd */ case 326: { struct freebsd64___getcwd_args *p = params; - uarg[a++] = (intptr_t)p->buf; /* char * */ + uarg[a++] = (intcap_t)p->buf; /* char * */ uarg[a++] = p->buflen; /* size_t */ *n_args = 2; break; @@ -1533,7 +1533,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 327: { struct freebsd64_sched_setparam_args *p = params; iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->param; /* const struct sched_param * */ + uarg[a++] = (intcap_t)p->param; /* const struct sched_param * */ *n_args = 2; break; } @@ -1541,7 +1541,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 328: { struct freebsd64_sched_getparam_args *p = params; iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->param; /* struct sched_param * */ + uarg[a++] = (intcap_t)p->param; /* struct sched_param * */ *n_args = 2; break; } @@ -1550,7 +1550,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_sched_setscheduler_args *p = params; iarg[a++] = p->pid; /* pid_t */ iarg[a++] = p->policy; /* int */ - uarg[a++] = (intptr_t)p->param; /* const struct sched_param * */ + uarg[a++] = (intcap_t)p->param; /* const struct sched_param * */ *n_args = 3; break; } @@ -1584,14 +1584,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 334: { struct freebsd64_sched_rr_get_interval_args *p = params; iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->interval; /* struct timespec * */ + uarg[a++] = (intcap_t)p->interval; /* struct timespec * */ *n_args = 2; break; } /* freebsd64_utrace */ case 335: { struct freebsd64_utrace_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* const void * */ + uarg[a++] = (intcap_t)p->addr; /* const void * */ uarg[a++] = p->len; /* size_t */ *n_args = 2; break; @@ -1601,14 +1601,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_kldsym_args *p = params; iarg[a++] = p->fileid; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->data; /* void * */ *n_args = 3; break; } /* freebsd64_jail */ case 338: { struct freebsd64_jail_args *p = params; - uarg[a++] = (intptr_t)p->jailp; /* struct jail64 * */ + uarg[a++] = (intcap_t)p->jailp; /* struct jail64 * */ *n_args = 1; break; } @@ -1616,9 +1616,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 339: { struct freebsd64_nnpfs_syscall_args *p = params; iarg[a++] = p->operation; /* int */ - uarg[a++] = (intptr_t)p->a_pathP; /* char * */ + uarg[a++] = (intcap_t)p->a_pathP; /* char * */ iarg[a++] = p->a_opcode; /* int */ - uarg[a++] = (intptr_t)p->a_paramsP; /* void * */ + uarg[a++] = (intcap_t)p->a_paramsP; /* void * */ iarg[a++] = p->a_followSymlinks; /* int */ *n_args = 5; break; @@ -1627,57 +1627,57 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 340: { struct freebsd64_sigprocmask_args *p = params; iarg[a++] = p->how; /* int */ - uarg[a++] = (intptr_t)p->set; /* const sigset_t * */ - uarg[a++] = (intptr_t)p->oset; /* sigset_t * */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->oset; /* sigset_t * */ *n_args = 3; break; } /* freebsd64_sigsuspend */ case 341: { struct freebsd64_sigsuspend_args *p = params; - uarg[a++] = (intptr_t)p->sigmask; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->sigmask; /* const sigset_t * */ *n_args = 1; break; } /* freebsd64_sigpending */ case 343: { struct freebsd64_sigpending_args *p = params; - uarg[a++] = (intptr_t)p->set; /* sigset_t * */ + uarg[a++] = (intcap_t)p->set; /* sigset_t * */ *n_args = 1; break; } /* freebsd64_sigtimedwait */ case 345: { struct freebsd64_sigtimedwait_args *p = params; - uarg[a++] = (intptr_t)p->set; /* const sigset_t * */ - uarg[a++] = (intptr_t)p->info; /* struct __siginfo64 * */ - uarg[a++] = (intptr_t)p->timeout; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->info; /* struct __siginfo64 * */ + uarg[a++] = (intcap_t)p->timeout; /* const struct timespec * */ *n_args = 3; break; } /* freebsd64_sigwaitinfo */ case 346: { struct freebsd64_sigwaitinfo_args *p = params; - uarg[a++] = (intptr_t)p->set; /* const sigset_t * */ - uarg[a++] = (intptr_t)p->info; /* struct __siginfo64 * */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->info; /* struct __siginfo64 * */ *n_args = 2; break; } /* freebsd64___acl_get_file */ case 347: { struct freebsd64___acl_get_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } /* freebsd64___acl_set_file */ case 348: { struct freebsd64___acl_set_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } @@ -1686,7 +1686,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64___acl_get_fd_args *p = params; iarg[a++] = p->filedes; /* int */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } @@ -1695,14 +1695,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64___acl_set_fd_args *p = params; iarg[a++] = p->filedes; /* int */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } /* freebsd64___acl_delete_file */ case 351: { struct freebsd64___acl_delete_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ *n_args = 2; break; @@ -1718,9 +1718,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64___acl_aclcheck_file */ case 353: { struct freebsd64___acl_aclcheck_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } @@ -1729,28 +1729,28 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64___acl_aclcheck_fd_args *p = params; iarg[a++] = p->filedes; /* int */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } /* freebsd64_extattrctl */ case 355: { struct freebsd64_extattrctl_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->filename; /* const char * */ + uarg[a++] = (intcap_t)p->filename; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ *n_args = 5; break; } /* freebsd64_extattr_set_file */ case 356: { struct freebsd64_extattr_set_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1758,10 +1758,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_extattr_get_file */ case 357: { struct freebsd64_extattr_get_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1769,35 +1769,35 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_extattr_delete_file */ case 358: { struct freebsd64_extattr_delete_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ *n_args = 3; break; } /* freebsd64_aio_waitcomplete */ case 359: { struct freebsd64_aio_waitcomplete_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb64 ** */ - uarg[a++] = (intptr_t)p->timeout; /* struct timespec * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb64 ** */ + uarg[a++] = (intcap_t)p->timeout; /* struct timespec * */ *n_args = 2; break; } /* freebsd64_getresuid */ case 360: { struct freebsd64_getresuid_args *p = params; - uarg[a++] = (intptr_t)p->ruid; /* uid_t * */ - uarg[a++] = (intptr_t)p->euid; /* uid_t * */ - uarg[a++] = (intptr_t)p->suid; /* uid_t * */ + uarg[a++] = (intcap_t)p->ruid; /* uid_t * */ + uarg[a++] = (intcap_t)p->euid; /* uid_t * */ + uarg[a++] = (intcap_t)p->suid; /* uid_t * */ *n_args = 3; break; } /* freebsd64_getresgid */ case 361: { struct freebsd64_getresgid_args *p = params; - uarg[a++] = (intptr_t)p->rgid; /* gid_t * */ - uarg[a++] = (intptr_t)p->egid; /* gid_t * */ - uarg[a++] = (intptr_t)p->sgid; /* gid_t * */ + uarg[a++] = (intcap_t)p->rgid; /* gid_t * */ + uarg[a++] = (intcap_t)p->egid; /* gid_t * */ + uarg[a++] = (intcap_t)p->sgid; /* gid_t * */ *n_args = 3; break; } @@ -1811,8 +1811,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_extattr_set_fd_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1822,8 +1822,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_extattr_get_fd_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1833,7 +1833,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_extattr_delete_fd_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ *n_args = 3; break; } @@ -1847,7 +1847,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_eaccess */ case 376: { struct freebsd64_eaccess_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->amode; /* int */ *n_args = 2; break; @@ -1868,7 +1868,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_nmount */ case 378: { struct freebsd64_nmount_args *p = params; - uarg[a++] = (intptr_t)p->iovp; /* struct iovec64 * */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec64 * */ uarg[a++] = p->iovcnt; /* unsigned int */ iarg[a++] = p->flags; /* int */ *n_args = 3; @@ -1877,14 +1877,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64___mac_get_proc */ case 384: { struct freebsd64___mac_get_proc_args *p = params; - uarg[a++] = (intptr_t)p->mac_p; /* struct mac64 * */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac64 * */ *n_args = 1; break; } /* freebsd64___mac_set_proc */ case 385: { struct freebsd64___mac_set_proc_args *p = params; - uarg[a++] = (intptr_t)p->mac_p; /* struct mac64 * */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac64 * */ *n_args = 1; break; } @@ -1892,15 +1892,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 386: { struct freebsd64___mac_get_fd_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac64 * */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac64 * */ *n_args = 2; break; } /* freebsd64___mac_get_file */ case 387: { struct freebsd64___mac_get_file_args *p = params; - uarg[a++] = (intptr_t)p->path_p; /* const char * */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac64 * */ + uarg[a++] = (intcap_t)p->path_p; /* const char * */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac64 * */ *n_args = 2; break; } @@ -1908,15 +1908,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 388: { struct freebsd64___mac_set_fd_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac64 * */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac64 * */ *n_args = 2; break; } /* freebsd64___mac_set_file */ case 389: { struct freebsd64___mac_set_file_args *p = params; - uarg[a++] = (intptr_t)p->path_p; /* const char * */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac64 * */ + uarg[a++] = (intcap_t)p->path_p; /* const char * */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac64 * */ *n_args = 2; break; } @@ -1924,8 +1924,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 390: { struct freebsd64_kenv_args *p = params; iarg[a++] = p->what; /* int */ - uarg[a++] = (intptr_t)p->name; /* const char * */ - uarg[a++] = (intptr_t)p->value; /* char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->value; /* char * */ iarg[a++] = p->len; /* int */ *n_args = 4; break; @@ -1933,7 +1933,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_lchflags */ case 391: { struct freebsd64_lchflags_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ uarg[a++] = p->flags; /* u_long */ *n_args = 2; break; @@ -1941,7 +1941,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_uuidgen */ case 392: { struct freebsd64_uuidgen_args *p = params; - uarg[a++] = (intptr_t)p->store; /* struct uuid * */ + uarg[a++] = (intcap_t)p->store; /* struct uuid * */ iarg[a++] = p->count; /* int */ *n_args = 2; break; @@ -1953,8 +1953,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->s; /* int */ iarg[a++] = p->offset; /* off_t */ uarg[a++] = p->nbytes; /* size_t */ - uarg[a++] = (intptr_t)p->hdtr; /* struct sf_hdtr64 * */ - uarg[a++] = (intptr_t)p->sbytes; /* off_t * */ + uarg[a++] = (intcap_t)p->hdtr; /* struct sf_hdtr64 * */ + uarg[a++] = (intcap_t)p->sbytes; /* off_t * */ iarg[a++] = p->flags; /* int */ *n_args = 7; break; @@ -1962,9 +1962,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_mac_syscall */ case 394: { struct freebsd64_mac_syscall_args *p = params; - uarg[a++] = (intptr_t)p->policy; /* const char * */ + uarg[a++] = (intcap_t)p->policy; /* const char * */ iarg[a++] = p->call; /* int */ - uarg[a++] = (intptr_t)p->arg; /* void * */ + uarg[a++] = (intcap_t)p->arg; /* void * */ *n_args = 3; break; } @@ -1999,7 +1999,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_ksem_init */ case 404: { struct freebsd64_ksem_init_args *p = params; - uarg[a++] = (intptr_t)p->idp; /* semid_t * */ + uarg[a++] = (intcap_t)p->idp; /* semid_t * */ uarg[a++] = p->value; /* unsigned int */ *n_args = 2; break; @@ -2007,8 +2007,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_ksem_open */ case 405: { struct freebsd64_ksem_open_args *p = params; - uarg[a++] = (intptr_t)p->idp; /* semid_t * */ - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->idp; /* semid_t * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ iarg[a++] = p->oflag; /* int */ iarg[a++] = p->mode; /* mode_t */ uarg[a++] = p->value; /* unsigned int */ @@ -2018,7 +2018,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_ksem_unlink */ case 406: { struct freebsd64_ksem_unlink_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ *n_args = 1; break; } @@ -2026,7 +2026,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 407: { struct freebsd64_ksem_getvalue_args *p = params; iarg[a++] = p->id; /* semid_t */ - uarg[a++] = (intptr_t)p->val; /* int * */ + uarg[a++] = (intcap_t)p->val; /* int * */ *n_args = 2; break; } @@ -2041,33 +2041,33 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 409: { struct freebsd64___mac_get_pid_args *p = params; iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac64 * */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac64 * */ *n_args = 2; break; } /* freebsd64___mac_get_link */ case 410: { struct freebsd64___mac_get_link_args *p = params; - uarg[a++] = (intptr_t)p->path_p; /* const char * */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac64 * */ + uarg[a++] = (intcap_t)p->path_p; /* const char * */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac64 * */ *n_args = 2; break; } /* freebsd64___mac_set_link */ case 411: { struct freebsd64___mac_set_link_args *p = params; - uarg[a++] = (intptr_t)p->path_p; /* const char * */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac64 * */ + uarg[a++] = (intcap_t)p->path_p; /* const char * */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac64 * */ *n_args = 2; break; } /* freebsd64_extattr_set_link */ case 412: { struct freebsd64_extattr_set_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -2075,10 +2075,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_extattr_get_link */ case 413: { struct freebsd64_extattr_get_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -2086,19 +2086,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_extattr_delete_link */ case 414: { struct freebsd64_extattr_delete_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * */ + uarg[a++] = (intcap_t)p->attrname; /* const char * */ *n_args = 3; break; } /* freebsd64___mac_execve */ case 415: { struct freebsd64___mac_execve_args *p = params; - uarg[a++] = (intptr_t)p->fname; /* const char * */ - uarg[a++] = (intptr_t)p->argv; /* char ** */ - uarg[a++] = (intptr_t)p->envv; /* char ** */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac64 * */ + uarg[a++] = (intcap_t)p->fname; /* const char * */ + uarg[a++] = (intcap_t)p->argv; /* char ** */ + uarg[a++] = (intcap_t)p->envv; /* char ** */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac64 * */ *n_args = 4; break; } @@ -2106,62 +2106,62 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 416: { struct freebsd64_sigaction_args *p = params; iarg[a++] = p->sig; /* int */ - uarg[a++] = (intptr_t)p->act; /* const struct sigaction64 * */ - uarg[a++] = (intptr_t)p->oact; /* struct sigaction64 * */ + uarg[a++] = (intcap_t)p->act; /* const struct sigaction64 * */ + uarg[a++] = (intcap_t)p->oact; /* struct sigaction64 * */ *n_args = 3; break; } /* freebsd64_sigreturn */ case 417: { struct freebsd64_sigreturn_args *p = params; - uarg[a++] = (intptr_t)p->sigcntxp; /* const struct __ucontext64 * */ + uarg[a++] = (intcap_t)p->sigcntxp; /* const struct __ucontext64 * */ *n_args = 1; break; } /* freebsd64_getcontext */ case 421: { struct freebsd64_getcontext_args *p = params; - uarg[a++] = (intptr_t)p->ucp; /* struct __ucontext64 * */ + uarg[a++] = (intcap_t)p->ucp; /* struct __ucontext64 * */ *n_args = 1; break; } /* freebsd64_setcontext */ case 422: { struct freebsd64_setcontext_args *p = params; - uarg[a++] = (intptr_t)p->ucp; /* const struct __ucontext64 * */ + uarg[a++] = (intcap_t)p->ucp; /* const struct __ucontext64 * */ *n_args = 1; break; } /* freebsd64_swapcontext */ case 423: { struct freebsd64_swapcontext_args *p = params; - uarg[a++] = (intptr_t)p->oucp; /* struct __ucontext64 * */ - uarg[a++] = (intptr_t)p->ucp; /* const struct __ucontext64 * */ + uarg[a++] = (intcap_t)p->oucp; /* struct __ucontext64 * */ + uarg[a++] = (intcap_t)p->ucp; /* const struct __ucontext64 * */ *n_args = 2; break; } /* freebsd64___acl_get_link */ case 425: { struct freebsd64___acl_get_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } /* freebsd64___acl_set_link */ case 426: { struct freebsd64___acl_set_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } /* freebsd64___acl_delete_link */ case 427: { struct freebsd64___acl_delete_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ *n_args = 2; break; @@ -2169,25 +2169,25 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64___acl_aclcheck_link */ case 428: { struct freebsd64___acl_aclcheck_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * */ *n_args = 3; break; } /* freebsd64_sigwait */ case 429: { struct freebsd64_sigwait_args *p = params; - uarg[a++] = (intptr_t)p->set; /* const sigset_t * */ - uarg[a++] = (intptr_t)p->sig; /* int * */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->sig; /* int * */ *n_args = 2; break; } /* freebsd64_thr_create */ case 430: { struct freebsd64_thr_create_args *p = params; - uarg[a++] = (intptr_t)p->ctx; /* struct __ucontext64 * */ - uarg[a++] = (intptr_t)p->id; /* long * */ + uarg[a++] = (intcap_t)p->ctx; /* struct __ucontext64 * */ + uarg[a++] = (intcap_t)p->id; /* long * */ iarg[a++] = p->flags; /* int */ *n_args = 3; break; @@ -2195,14 +2195,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_thr_exit */ case 431: { struct freebsd64_thr_exit_args *p = params; - uarg[a++] = (intptr_t)p->state; /* long * */ + uarg[a++] = (intcap_t)p->state; /* long * */ *n_args = 1; break; } /* freebsd64_thr_self */ case 432: { struct freebsd64_thr_self_args *p = params; - uarg[a++] = (intptr_t)p->id; /* long * */ + uarg[a++] = (intcap_t)p->id; /* long * */ *n_args = 1; break; } @@ -2226,7 +2226,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_extattr_list_fd_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 4; break; @@ -2234,9 +2234,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_extattr_list_file */ case 438: { struct freebsd64_extattr_list_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 4; break; @@ -2244,9 +2244,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_extattr_list_link */ case 439: { struct freebsd64_extattr_list_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 4; break; @@ -2255,14 +2255,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 441: { struct freebsd64_ksem_timedwait_args *p = params; iarg[a++] = p->id; /* semid_t */ - uarg[a++] = (intptr_t)p->abstime; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->abstime; /* const struct timespec * */ *n_args = 2; break; } /* freebsd64_thr_suspend */ case 442: { struct freebsd64_thr_suspend_args *p = params; - uarg[a++] = (intptr_t)p->timeout; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->timeout; /* const struct timespec * */ *n_args = 1; break; } @@ -2284,7 +2284,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_audit */ case 445: { struct freebsd64_audit_args *p = params; - uarg[a++] = (intptr_t)p->record; /* const void * */ + uarg[a++] = (intcap_t)p->record; /* const void * */ uarg[a++] = p->length; /* u_int */ *n_args = 2; break; @@ -2293,7 +2293,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 446: { struct freebsd64_auditon_args *p = params; iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->data; /* void * */ uarg[a++] = p->length; /* u_int */ *n_args = 3; break; @@ -2301,35 +2301,35 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_getauid */ case 447: { struct freebsd64_getauid_args *p = params; - uarg[a++] = (intptr_t)p->auid; /* uid_t * */ + uarg[a++] = (intcap_t)p->auid; /* uid_t * */ *n_args = 1; break; } /* freebsd64_setauid */ case 448: { struct freebsd64_setauid_args *p = params; - uarg[a++] = (intptr_t)p->auid; /* uid_t * */ + uarg[a++] = (intcap_t)p->auid; /* uid_t * */ *n_args = 1; break; } /* freebsd64_getaudit */ case 449: { struct freebsd64_getaudit_args *p = params; - uarg[a++] = (intptr_t)p->auditinfo; /* struct auditinfo * */ + uarg[a++] = (intcap_t)p->auditinfo; /* struct auditinfo * */ *n_args = 1; break; } /* freebsd64_setaudit */ case 450: { struct freebsd64_setaudit_args *p = params; - uarg[a++] = (intptr_t)p->auditinfo; /* struct auditinfo * */ + uarg[a++] = (intcap_t)p->auditinfo; /* struct auditinfo * */ *n_args = 1; break; } /* freebsd64_getaudit_addr */ case 451: { struct freebsd64_getaudit_addr_args *p = params; - uarg[a++] = (intptr_t)p->auditinfo_addr; /* struct auditinfo_addr * */ + uarg[a++] = (intcap_t)p->auditinfo_addr; /* struct auditinfo_addr * */ uarg[a++] = p->length; /* u_int */ *n_args = 2; break; @@ -2337,7 +2337,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_setaudit_addr */ case 452: { struct freebsd64_setaudit_addr_args *p = params; - uarg[a++] = (intptr_t)p->auditinfo_addr; /* struct auditinfo_addr * */ + uarg[a++] = (intcap_t)p->auditinfo_addr; /* struct auditinfo_addr * */ uarg[a++] = p->length; /* u_int */ *n_args = 2; break; @@ -2345,25 +2345,25 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_auditctl */ case 453: { struct freebsd64_auditctl_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd64__umtx_op */ case 454: { struct freebsd64__umtx_op_args *p = params; - uarg[a++] = (intptr_t)p->obj; /* void * */ + uarg[a++] = (intcap_t)p->obj; /* void * */ iarg[a++] = p->op; /* int */ uarg[a++] = p->val; /* u_long */ - uarg[a++] = (intptr_t)p->uaddr1; /* void * */ - uarg[a++] = (intptr_t)p->uaddr2; /* void * */ + uarg[a++] = (intcap_t)p->uaddr1; /* void * */ + uarg[a++] = (intcap_t)p->uaddr2; /* void * */ *n_args = 5; break; } /* freebsd64_thr_new */ case 455: { struct freebsd64_thr_new_args *p = params; - uarg[a++] = (intptr_t)p->param; /* struct thr_param64 * */ + uarg[a++] = (intcap_t)p->param; /* struct thr_param64 * */ iarg[a++] = p->param_size; /* int */ *n_args = 2; break; @@ -2373,17 +2373,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_sigqueue_args *p = params; iarg[a++] = p->pid; /* pid_t */ iarg[a++] = p->signum; /* int */ - uarg[a++] = (intptr_t)p->value; /* void * */ + uarg[a++] = (intcap_t)p->value; /* void * */ *n_args = 3; break; } /* freebsd64_kmq_open */ case 457: { struct freebsd64_kmq_open_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flags; /* int */ iarg[a++] = p->mode; /* mode_t */ - uarg[a++] = (intptr_t)p->attr; /* const struct mq_attr * */ + uarg[a++] = (intcap_t)p->attr; /* const struct mq_attr * */ *n_args = 4; break; } @@ -2391,8 +2391,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 458: { struct freebsd64_kmq_setattr_args *p = params; iarg[a++] = p->mqd; /* int */ - uarg[a++] = (intptr_t)p->attr; /* const struct mq_attr * */ - uarg[a++] = (intptr_t)p->oattr; /* struct mq_attr * */ + uarg[a++] = (intcap_t)p->attr; /* const struct mq_attr * */ + uarg[a++] = (intcap_t)p->oattr; /* struct mq_attr * */ *n_args = 3; break; } @@ -2400,10 +2400,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 459: { struct freebsd64_kmq_timedreceive_args *p = params; iarg[a++] = p->mqd; /* int */ - uarg[a++] = (intptr_t)p->msg_ptr; /* char * */ + uarg[a++] = (intcap_t)p->msg_ptr; /* char * */ uarg[a++] = p->msg_len; /* size_t */ - uarg[a++] = (intptr_t)p->msg_prio; /* unsigned * */ - uarg[a++] = (intptr_t)p->abs_timeout; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->msg_prio; /* unsigned * */ + uarg[a++] = (intcap_t)p->abs_timeout; /* const struct timespec * */ *n_args = 5; break; } @@ -2411,10 +2411,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 460: { struct freebsd64_kmq_timedsend_args *p = params; iarg[a++] = p->mqd; /* int */ - uarg[a++] = (intptr_t)p->msg_ptr; /* const char * */ + uarg[a++] = (intcap_t)p->msg_ptr; /* const char * */ uarg[a++] = p->msg_len; /* size_t */ uarg[a++] = p->msg_prio; /* unsigned */ - uarg[a++] = (intptr_t)p->abs_timeout; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->abs_timeout; /* const struct timespec * */ *n_args = 5; break; } @@ -2422,23 +2422,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 461: { struct freebsd64_kmq_notify_args *p = params; iarg[a++] = p->mqd; /* int */ - uarg[a++] = (intptr_t)p->sigev; /* const struct sigevent64 * */ + uarg[a++] = (intcap_t)p->sigev; /* const struct sigevent64 * */ *n_args = 2; break; } /* freebsd64_kmq_unlink */ case 462: { struct freebsd64_kmq_unlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd64_abort2 */ case 463: { struct freebsd64_abort2_args *p = params; - uarg[a++] = (intptr_t)p->why; /* const char * */ + uarg[a++] = (intcap_t)p->why; /* const char * */ iarg[a++] = p->nargs; /* int */ - uarg[a++] = (intptr_t)p->args; /* void ** */ + uarg[a++] = (intcap_t)p->args; /* void ** */ *n_args = 3; break; } @@ -2446,7 +2446,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 464: { struct freebsd64_thr_set_name_args *p = params; iarg[a++] = p->id; /* long */ - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ *n_args = 2; break; } @@ -2454,7 +2454,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 465: { struct freebsd64_aio_fsync_args *p = params; iarg[a++] = p->op; /* int */ - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb64 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb64 * */ *n_args = 2; break; } @@ -2463,7 +2463,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_rtprio_thread_args *p = params; iarg[a++] = p->function; /* int */ iarg[a++] = p->lwpid; /* lwpid_t */ - uarg[a++] = (intptr_t)p->rtp; /* struct rtprio * */ + uarg[a++] = (intcap_t)p->rtp; /* struct rtprio * */ *n_args = 3; break; } @@ -2479,11 +2479,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 472: { struct freebsd64_sctp_generic_sendmsg_args *p = params; iarg[a++] = p->sd; /* int */ - uarg[a++] = (intptr_t)p->msg; /* void * */ + uarg[a++] = (intcap_t)p->msg; /* void * */ iarg[a++] = p->mlen; /* int */ - uarg[a++] = (intptr_t)p->to; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->to; /* const struct sockaddr * */ iarg[a++] = p->tolen; /* __socklen_t */ - uarg[a++] = (intptr_t)p->sinfo; /* struct sctp_sndrcvinfo * */ + uarg[a++] = (intcap_t)p->sinfo; /* struct sctp_sndrcvinfo * */ iarg[a++] = p->flags; /* int */ *n_args = 7; break; @@ -2492,11 +2492,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 473: { struct freebsd64_sctp_generic_sendmsg_iov_args *p = params; iarg[a++] = p->sd; /* int */ - uarg[a++] = (intptr_t)p->iov; /* struct iovec64 * */ + uarg[a++] = (intcap_t)p->iov; /* struct iovec64 * */ iarg[a++] = p->iovlen; /* int */ - uarg[a++] = (intptr_t)p->to; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->to; /* const struct sockaddr * */ iarg[a++] = p->tolen; /* __socklen_t */ - uarg[a++] = (intptr_t)p->sinfo; /* struct sctp_sndrcvinfo * */ + uarg[a++] = (intcap_t)p->sinfo; /* struct sctp_sndrcvinfo * */ iarg[a++] = p->flags; /* int */ *n_args = 7; break; @@ -2505,12 +2505,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 474: { struct freebsd64_sctp_generic_recvmsg_args *p = params; iarg[a++] = p->sd; /* int */ - uarg[a++] = (intptr_t)p->iov; /* struct iovec64 * */ + uarg[a++] = (intcap_t)p->iov; /* struct iovec64 * */ iarg[a++] = p->iovlen; /* int */ - uarg[a++] = (intptr_t)p->from; /* struct sockaddr * */ - uarg[a++] = (intptr_t)p->fromlenaddr; /* __socklen_t * */ - uarg[a++] = (intptr_t)p->sinfo; /* struct sctp_sndrcvinfo * */ - uarg[a++] = (intptr_t)p->msg_flags; /* int * */ + uarg[a++] = (intcap_t)p->from; /* struct sockaddr * */ + uarg[a++] = (intcap_t)p->fromlenaddr; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->sinfo; /* struct sctp_sndrcvinfo * */ + uarg[a++] = (intcap_t)p->msg_flags; /* int * */ *n_args = 7; break; } @@ -2518,7 +2518,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 475: { struct freebsd64_pread_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* void * */ + uarg[a++] = (intcap_t)p->buf; /* void * */ uarg[a++] = p->nbyte; /* size_t */ iarg[a++] = p->offset; /* off_t */ *n_args = 4; @@ -2528,7 +2528,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 476: { struct freebsd64_pwrite_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* const void * */ + uarg[a++] = (intcap_t)p->buf; /* const void * */ uarg[a++] = p->nbyte; /* size_t */ iarg[a++] = p->offset; /* off_t */ *n_args = 4; @@ -2537,7 +2537,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_mmap */ case 477: { struct freebsd64_mmap_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * */ + uarg[a++] = (intcap_t)p->addr; /* void * */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->prot; /* int */ iarg[a++] = p->flags; /* int */ @@ -2558,7 +2558,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_truncate */ case 479: { struct freebsd64_truncate_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->length; /* off_t */ *n_args = 2; break; @@ -2583,14 +2583,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_shm_unlink */ case 483: { struct freebsd64_shm_unlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd64_cpuset */ case 484: { struct freebsd64_cpuset_args *p = params; - uarg[a++] = (intptr_t)p->setid; /* cpusetid_t * */ + uarg[a++] = (intcap_t)p->setid; /* cpusetid_t * */ *n_args = 1; break; } @@ -2609,7 +2609,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->level; /* cpulevel_t */ iarg[a++] = p->which; /* cpuwhich_t */ iarg[a++] = p->id; /* id_t */ - uarg[a++] = (intptr_t)p->setid; /* cpusetid_t * */ + uarg[a++] = (intcap_t)p->setid; /* cpusetid_t * */ *n_args = 4; break; } @@ -2620,7 +2620,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->which; /* cpuwhich_t */ iarg[a++] = p->id; /* id_t */ uarg[a++] = p->cpusetsize; /* size_t */ - uarg[a++] = (intptr_t)p->mask; /* cpuset_t * */ + uarg[a++] = (intcap_t)p->mask; /* cpuset_t * */ *n_args = 5; break; } @@ -2631,7 +2631,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->which; /* cpuwhich_t */ iarg[a++] = p->id; /* id_t */ uarg[a++] = p->cpusetsize; /* size_t */ - uarg[a++] = (intptr_t)p->mask; /* const cpuset_t * */ + uarg[a++] = (intcap_t)p->mask; /* const cpuset_t * */ *n_args = 5; break; } @@ -2639,7 +2639,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 489: { struct freebsd64_faccessat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->amode; /* int */ iarg[a++] = p->flag; /* int */ *n_args = 4; @@ -2649,7 +2649,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 490: { struct freebsd64_fchmodat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ iarg[a++] = p->flag; /* int */ *n_args = 4; @@ -2659,7 +2659,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 491: { struct freebsd64_fchownat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ uarg[a++] = p->uid; /* uid_t */ iarg[a++] = p->gid; /* gid_t */ iarg[a++] = p->flag; /* int */ @@ -2670,8 +2670,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 492: { struct freebsd64_fexecve_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->argv; /* char ** */ - uarg[a++] = (intptr_t)p->envv; /* char ** */ + uarg[a++] = (intcap_t)p->argv; /* char ** */ + uarg[a++] = (intcap_t)p->envv; /* char ** */ *n_args = 3; break; } @@ -2679,8 +2679,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 494: { struct freebsd64_futimesat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->times; /* const struct timeval * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->times; /* const struct timeval * */ *n_args = 3; break; } @@ -2688,9 +2688,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 495: { struct freebsd64_linkat_args *p = params; iarg[a++] = p->fd1; /* int */ - uarg[a++] = (intptr_t)p->path1; /* const char * */ + uarg[a++] = (intcap_t)p->path1; /* const char * */ iarg[a++] = p->fd2; /* int */ - uarg[a++] = (intptr_t)p->path2; /* const char * */ + uarg[a++] = (intcap_t)p->path2; /* const char * */ iarg[a++] = p->flag; /* int */ *n_args = 5; break; @@ -2699,7 +2699,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 496: { struct freebsd64_mkdirat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ *n_args = 3; break; @@ -2708,7 +2708,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 497: { struct freebsd64_mkfifoat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ *n_args = 3; break; @@ -2717,7 +2717,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 499: { struct freebsd64_openat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flag; /* int */ iarg[a++] = p->mode; /* mode_t */ *n_args = 4; @@ -2727,8 +2727,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 500: { struct freebsd64_readlinkat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->buf; /* char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->buf; /* char * */ uarg[a++] = p->bufsize; /* size_t */ *n_args = 4; break; @@ -2737,18 +2737,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 501: { struct freebsd64_renameat_args *p = params; iarg[a++] = p->oldfd; /* int */ - uarg[a++] = (intptr_t)p->old; /* const char * */ + uarg[a++] = (intcap_t)p->old; /* const char * */ iarg[a++] = p->newfd; /* int */ - uarg[a++] = (intptr_t)p->new; /* const char * */ + uarg[a++] = (intcap_t)p->new; /* const char * */ *n_args = 4; break; } /* freebsd64_symlinkat */ case 502: { struct freebsd64_symlinkat_args *p = params; - uarg[a++] = (intptr_t)p->path1; /* const char * */ + uarg[a++] = (intcap_t)p->path1; /* const char * */ iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path2; /* const char * */ + uarg[a++] = (intcap_t)p->path2; /* const char * */ *n_args = 3; break; } @@ -2756,7 +2756,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 503: { struct freebsd64_unlinkat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flag; /* int */ *n_args = 3; break; @@ -2771,14 +2771,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_gssd_syscall */ case 505: { struct freebsd64_gssd_syscall_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 1; break; } /* freebsd64_jail_get */ case 506: { struct freebsd64_jail_get_args *p = params; - uarg[a++] = (intptr_t)p->iovp; /* struct iovec64 * */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec64 * */ uarg[a++] = p->iovcnt; /* unsigned int */ iarg[a++] = p->flags; /* int */ *n_args = 3; @@ -2787,7 +2787,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_jail_set */ case 507: { struct freebsd64_jail_set_args *p = params; - uarg[a++] = (intptr_t)p->iovp; /* struct iovec64 * */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec64 * */ uarg[a++] = p->iovcnt; /* unsigned int */ iarg[a++] = p->flags; /* int */ *n_args = 3; @@ -2806,7 +2806,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->semid; /* int */ iarg[a++] = p->semnum; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->arg; /* union semun64 * */ + uarg[a++] = (intcap_t)p->arg; /* union semun64 * */ *n_args = 4; break; } @@ -2815,7 +2815,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_msgctl_args *p = params; iarg[a++] = p->msqid; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* struct msqid_ds64 * */ + uarg[a++] = (intcap_t)p->buf; /* struct msqid_ds64 * */ *n_args = 3; break; } @@ -2824,14 +2824,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_shmctl_args *p = params; iarg[a++] = p->shmid; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* struct shmid_ds * */ + uarg[a++] = (intcap_t)p->buf; /* struct shmid_ds * */ *n_args = 3; break; } /* freebsd64_lpathconf */ case 513: { struct freebsd64_lpathconf_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->name; /* int */ *n_args = 2; break; @@ -2841,7 +2841,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64___cap_rights_get_args *p = params; iarg[a++] = p->version; /* int */ iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->rightsp; /* cap_rights_t * */ + uarg[a++] = (intcap_t)p->rightsp; /* cap_rights_t * */ *n_args = 3; break; } @@ -2853,14 +2853,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_cap_getmode */ case 517: { struct freebsd64_cap_getmode_args *p = params; - uarg[a++] = (intptr_t)p->modep; /* u_int * */ + uarg[a++] = (intcap_t)p->modep; /* u_int * */ *n_args = 1; break; } /* freebsd64_pdfork */ case 518: { struct freebsd64_pdfork_args *p = params; - uarg[a++] = (intptr_t)p->fdp; /* int * */ + uarg[a++] = (intcap_t)p->fdp; /* int * */ iarg[a++] = p->flags; /* int */ *n_args = 2; break; @@ -2877,7 +2877,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 520: { struct freebsd64_pdgetpid_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->pidp; /* pid_t * */ + uarg[a++] = (intcap_t)p->pidp; /* pid_t * */ *n_args = 2; break; } @@ -2885,18 +2885,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 522: { struct freebsd64_pselect_args *p = params; iarg[a++] = p->nd; /* int */ - uarg[a++] = (intptr_t)p->in; /* fd_set * */ - uarg[a++] = (intptr_t)p->ou; /* fd_set * */ - uarg[a++] = (intptr_t)p->ex; /* fd_set * */ - uarg[a++] = (intptr_t)p->ts; /* const struct timespec * */ - uarg[a++] = (intptr_t)p->sm; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->in; /* fd_set * */ + uarg[a++] = (intcap_t)p->ou; /* fd_set * */ + uarg[a++] = (intcap_t)p->ex; /* fd_set * */ + uarg[a++] = (intcap_t)p->ts; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->sm; /* const sigset_t * */ *n_args = 6; break; } /* freebsd64_getloginclass */ case 523: { struct freebsd64_getloginclass_args *p = params; - uarg[a++] = (intptr_t)p->namebuf; /* char * */ + uarg[a++] = (intcap_t)p->namebuf; /* char * */ uarg[a++] = p->namelen; /* size_t */ *n_args = 2; break; @@ -2904,16 +2904,16 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_setloginclass */ case 524: { struct freebsd64_setloginclass_args *p = params; - uarg[a++] = (intptr_t)p->namebuf; /* const char * */ + uarg[a++] = (intcap_t)p->namebuf; /* const char * */ *n_args = 1; break; } /* freebsd64_rctl_get_racct */ case 525: { struct freebsd64_rctl_get_racct_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * */ + uarg[a++] = (intcap_t)p->outbufp; /* void * */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2921,9 +2921,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_rctl_get_rules */ case 526: { struct freebsd64_rctl_get_rules_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * */ + uarg[a++] = (intcap_t)p->outbufp; /* void * */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2931,9 +2931,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_rctl_get_limits */ case 527: { struct freebsd64_rctl_get_limits_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * */ + uarg[a++] = (intcap_t)p->outbufp; /* void * */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2941,9 +2941,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_rctl_add_rule */ case 528: { struct freebsd64_rctl_add_rule_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * */ + uarg[a++] = (intcap_t)p->outbufp; /* void * */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2951,9 +2951,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_rctl_remove_rule */ case 529: { struct freebsd64_rctl_remove_rule_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * */ + uarg[a++] = (intcap_t)p->outbufp; /* void * */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2982,10 +2982,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_wait6_args *p = params; iarg[a++] = p->idtype; /* idtype_t */ iarg[a++] = p->id; /* id_t */ - uarg[a++] = (intptr_t)p->status; /* int * */ + uarg[a++] = (intcap_t)p->status; /* int * */ iarg[a++] = p->options; /* int */ - uarg[a++] = (intptr_t)p->wrusage; /* struct __wrusage * */ - uarg[a++] = (intptr_t)p->info; /* struct __siginfo64 * */ + uarg[a++] = (intcap_t)p->wrusage; /* struct __wrusage * */ + uarg[a++] = (intcap_t)p->info; /* struct __siginfo64 * */ *n_args = 6; break; } @@ -2993,7 +2993,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 533: { struct freebsd64_cap_rights_limit_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->rightsp; /* cap_rights_t * */ + uarg[a++] = (intcap_t)p->rightsp; /* cap_rights_t * */ *n_args = 2; break; } @@ -3001,7 +3001,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 534: { struct freebsd64_cap_ioctls_limit_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->cmds; /* const u_long * */ + uarg[a++] = (intcap_t)p->cmds; /* const u_long * */ uarg[a++] = p->ncmds; /* size_t */ *n_args = 3; break; @@ -3010,7 +3010,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 535: { struct freebsd64_cap_ioctls_get_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->cmds; /* u_long * */ + uarg[a++] = (intcap_t)p->cmds; /* u_long * */ uarg[a++] = p->maxcmds; /* size_t */ *n_args = 3; break; @@ -3027,7 +3027,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 537: { struct freebsd64_cap_fcntls_get_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->fcntlrightsp; /* uint32_t * */ + uarg[a++] = (intcap_t)p->fcntlrightsp; /* uint32_t * */ *n_args = 2; break; } @@ -3036,7 +3036,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_bindat_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->name; /* const struct sockaddr * */ iarg[a++] = p->namelen; /* __socklen_t */ *n_args = 4; break; @@ -3046,7 +3046,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_connectat_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* const struct sockaddr * */ + uarg[a++] = (intcap_t)p->name; /* const struct sockaddr * */ iarg[a++] = p->namelen; /* __socklen_t */ *n_args = 4; break; @@ -3055,7 +3055,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 540: { struct freebsd64_chflagsat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ uarg[a++] = p->flags; /* u_long */ iarg[a++] = p->atflag; /* int */ *n_args = 4; @@ -3065,8 +3065,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 541: { struct freebsd64_accept4_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* struct sockaddr * */ - uarg[a++] = (intptr_t)p->anamelen; /* __socklen_t * */ + uarg[a++] = (intcap_t)p->name; /* struct sockaddr * */ + uarg[a++] = (intcap_t)p->anamelen; /* __socklen_t * */ iarg[a++] = p->flags; /* int */ *n_args = 4; break; @@ -3074,7 +3074,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_pipe2 */ case 542: { struct freebsd64_pipe2_args *p = params; - uarg[a++] = (intptr_t)p->fildes; /* int * */ + uarg[a++] = (intcap_t)p->fildes; /* int * */ iarg[a++] = p->flags; /* int */ *n_args = 2; break; @@ -3082,7 +3082,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_aio_mlock */ case 543: { struct freebsd64_aio_mlock_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb64 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb64 * */ *n_args = 1; break; } @@ -3092,17 +3092,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->idtype; /* idtype_t */ iarg[a++] = p->id; /* id_t */ iarg[a++] = p->com; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * */ + uarg[a++] = (intcap_t)p->data; /* void * */ *n_args = 4; break; } /* freebsd64_ppoll */ case 545: { struct freebsd64_ppoll_args *p = params; - uarg[a++] = (intptr_t)p->fds; /* struct pollfd * */ + uarg[a++] = (intcap_t)p->fds; /* struct pollfd * */ uarg[a++] = p->nfds; /* u_int */ - uarg[a++] = (intptr_t)p->ts; /* const struct timespec * */ - uarg[a++] = (intptr_t)p->set; /* const sigset_t * */ + uarg[a++] = (intcap_t)p->ts; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * */ *n_args = 4; break; } @@ -3110,7 +3110,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 546: { struct freebsd64_futimens_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->times; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->times; /* const struct timespec * */ *n_args = 2; break; } @@ -3118,8 +3118,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 547: { struct freebsd64_utimensat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->times; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->times; /* const struct timespec * */ iarg[a++] = p->flag; /* int */ *n_args = 4; break; @@ -3135,7 +3135,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 551: { struct freebsd64_fstat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->sb; /* struct stat * */ + uarg[a++] = (intcap_t)p->sb; /* struct stat * */ *n_args = 2; break; } @@ -3143,8 +3143,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 552: { struct freebsd64_fstatat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->buf; /* struct stat * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->buf; /* struct stat * */ iarg[a++] = p->flag; /* int */ *n_args = 4; break; @@ -3152,8 +3152,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_fhstat */ case 553: { struct freebsd64_fhstat_args *p = params; - uarg[a++] = (intptr_t)p->u_fhp; /* const struct fhandle * */ - uarg[a++] = (intptr_t)p->sb; /* struct stat * */ + uarg[a++] = (intcap_t)p->u_fhp; /* const struct fhandle * */ + uarg[a++] = (intcap_t)p->sb; /* struct stat * */ *n_args = 2; break; } @@ -3161,17 +3161,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 554: { struct freebsd64_getdirentries_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* char * */ + uarg[a++] = (intcap_t)p->buf; /* char * */ uarg[a++] = p->count; /* size_t */ - uarg[a++] = (intptr_t)p->basep; /* off_t * */ + uarg[a++] = (intcap_t)p->basep; /* off_t * */ *n_args = 4; break; } /* freebsd64_statfs */ case 555: { struct freebsd64_statfs_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->buf; /* struct statfs * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->buf; /* struct statfs * */ *n_args = 2; break; } @@ -3179,14 +3179,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 556: { struct freebsd64_fstatfs_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* struct statfs * */ + uarg[a++] = (intcap_t)p->buf; /* struct statfs * */ *n_args = 2; break; } /* freebsd64_getfsstat */ case 557: { struct freebsd64_getfsstat_args *p = params; - uarg[a++] = (intptr_t)p->buf; /* struct statfs * */ + uarg[a++] = (intcap_t)p->buf; /* struct statfs * */ iarg[a++] = p->bufsize; /* long */ iarg[a++] = p->mode; /* int */ *n_args = 3; @@ -3195,8 +3195,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_fhstatfs */ case 558: { struct freebsd64_fhstatfs_args *p = params; - uarg[a++] = (intptr_t)p->u_fhp; /* const struct fhandle * */ - uarg[a++] = (intptr_t)p->buf; /* struct statfs * */ + uarg[a++] = (intcap_t)p->u_fhp; /* const struct fhandle * */ + uarg[a++] = (intcap_t)p->buf; /* struct statfs * */ *n_args = 2; break; } @@ -3204,7 +3204,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 559: { struct freebsd64_mknodat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->mode; /* mode_t */ iarg[a++] = p->dev; /* dev_t */ *n_args = 4; @@ -3214,11 +3214,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 560: { struct freebsd64_kevent_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->changelist; /* const struct kevent64 * */ + uarg[a++] = (intcap_t)p->changelist; /* const struct kevent64 * */ iarg[a++] = p->nchanges; /* int */ - uarg[a++] = (intptr_t)p->eventlist; /* struct kevent64 * */ + uarg[a++] = (intcap_t)p->eventlist; /* struct kevent64 * */ iarg[a++] = p->nevents; /* int */ - uarg[a++] = (intptr_t)p->timeout; /* const struct timespec * */ + uarg[a++] = (intcap_t)p->timeout; /* const struct timespec * */ *n_args = 6; break; } @@ -3229,8 +3229,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->which; /* cpuwhich_t */ iarg[a++] = p->id; /* id_t */ uarg[a++] = p->domainsetsize; /* size_t */ - uarg[a++] = (intptr_t)p->mask; /* domainset_t * */ - uarg[a++] = (intptr_t)p->policy; /* int * */ + uarg[a++] = (intcap_t)p->mask; /* domainset_t * */ + uarg[a++] = (intcap_t)p->policy; /* int * */ *n_args = 6; break; } @@ -3241,7 +3241,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->which; /* cpuwhich_t */ iarg[a++] = p->id; /* id_t */ uarg[a++] = p->domainsetsize; /* size_t */ - uarg[a++] = (intptr_t)p->mask; /* domainset_t * */ + uarg[a++] = (intcap_t)p->mask; /* domainset_t * */ iarg[a++] = p->policy; /* int */ *n_args = 6; break; @@ -3249,7 +3249,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_getrandom */ case 563: { struct freebsd64_getrandom_args *p = params; - uarg[a++] = (intptr_t)p->buf; /* void * */ + uarg[a++] = (intcap_t)p->buf; /* void * */ uarg[a++] = p->buflen; /* size_t */ uarg[a++] = p->flags; /* unsigned int */ *n_args = 3; @@ -3259,8 +3259,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 564: { struct freebsd64_getfhat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* char * */ - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * */ + uarg[a++] = (intcap_t)p->path; /* char * */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * */ iarg[a++] = p->flags; /* int */ *n_args = 4; break; @@ -3268,25 +3268,25 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_fhlink */ case 565: { struct freebsd64_fhlink_args *p = params; - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * */ - uarg[a++] = (intptr_t)p->to; /* const char * */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * */ + uarg[a++] = (intcap_t)p->to; /* const char * */ *n_args = 2; break; } /* freebsd64_fhlinkat */ case 566: { struct freebsd64_fhlinkat_args *p = params; - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * */ iarg[a++] = p->tofd; /* int */ - uarg[a++] = (intptr_t)p->to; /* const char * */ + uarg[a++] = (intcap_t)p->to; /* const char * */ *n_args = 3; break; } /* freebsd64_fhreadlink */ case 567: { struct freebsd64_fhreadlink_args *p = params; - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * */ - uarg[a++] = (intptr_t)p->buf; /* char * */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * */ + uarg[a++] = (intcap_t)p->buf; /* char * */ uarg[a++] = p->bufsize; /* size_t */ *n_args = 3; break; @@ -3295,7 +3295,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 568: { struct freebsd64_funlinkat_args *p = params; iarg[a++] = p->dfd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->fd; /* int */ iarg[a++] = p->flag; /* int */ *n_args = 4; @@ -3305,9 +3305,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 569: { struct freebsd64_copy_file_range_args *p = params; iarg[a++] = p->infd; /* int */ - uarg[a++] = (intptr_t)p->inoffp; /* off_t * */ + uarg[a++] = (intcap_t)p->inoffp; /* off_t * */ iarg[a++] = p->outfd; /* int */ - uarg[a++] = (intptr_t)p->outoffp; /* off_t * */ + uarg[a++] = (intcap_t)p->outoffp; /* off_t * */ uarg[a++] = p->len; /* size_t */ uarg[a++] = p->flags; /* unsigned int */ *n_args = 6; @@ -3316,11 +3316,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64___sysctlbyname */ case 570: { struct freebsd64___sysctlbyname_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ uarg[a++] = p->namelen; /* size_t */ - uarg[a++] = (intptr_t)p->old; /* void * */ - uarg[a++] = (intptr_t)p->oldlenp; /* size_t * */ - uarg[a++] = (intptr_t)p->new; /* void * */ + uarg[a++] = (intcap_t)p->old; /* void * */ + uarg[a++] = (intcap_t)p->oldlenp; /* size_t * */ + uarg[a++] = (intcap_t)p->new; /* void * */ uarg[a++] = p->newlen; /* size_t */ *n_args = 6; break; @@ -3328,19 +3328,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_shm_open2 */ case 571: { struct freebsd64_shm_open2_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ iarg[a++] = p->flags; /* int */ iarg[a++] = p->mode; /* mode_t */ iarg[a++] = p->shmflags; /* int */ - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ *n_args = 5; break; } /* freebsd64_shm_rename */ case 572: { struct freebsd64_shm_rename_args *p = params; - uarg[a++] = (intptr_t)p->path_from; /* const char * */ - uarg[a++] = (intptr_t)p->path_to; /* const char * */ + uarg[a++] = (intcap_t)p->path_from; /* const char * */ + uarg[a++] = (intcap_t)p->path_to; /* const char * */ iarg[a++] = p->flags; /* int */ *n_args = 3; break; @@ -3349,7 +3349,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 573: { struct freebsd64_sigfastblock_args *p = params; iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->ptr; /* void * */ + uarg[a++] = (intcap_t)p->ptr; /* void * */ *n_args = 2; break; } @@ -3357,8 +3357,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 574: { struct freebsd64___realpathat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ - uarg[a++] = (intptr_t)p->buf; /* char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->buf; /* char * */ uarg[a++] = p->size; /* size_t */ iarg[a++] = p->flags; /* int */ *n_args = 5; @@ -3377,7 +3377,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 576: { struct freebsd64_rpctls_syscall_args *p = params; iarg[a++] = p->op; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * */ + uarg[a++] = (intcap_t)p->path; /* const char * */ *n_args = 2; break; } @@ -3385,7 +3385,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 577: { struct freebsd64___specialfd_args *p = params; iarg[a++] = p->type; /* int */ - uarg[a++] = (intptr_t)p->req; /* const void * */ + uarg[a++] = (intcap_t)p->req; /* const void * */ uarg[a++] = p->len; /* size_t */ *n_args = 3; break; @@ -3393,14 +3393,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_aio_writev */ case 578: { struct freebsd64_aio_writev_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb64 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb64 * */ *n_args = 1; break; } /* freebsd64_aio_readv */ case 579: { struct freebsd64_aio_readv_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb64 * */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb64 * */ *n_args = 1; break; } @@ -3409,9 +3409,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_fspacectl_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->rqsr; /* const struct spacectl_range * */ + uarg[a++] = (intcap_t)p->rqsr; /* const struct spacectl_range * */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->rmsr; /* struct spacectl_range * */ + uarg[a++] = (intcap_t)p->rmsr; /* struct spacectl_range * */ *n_args = 5; break; } @@ -3423,7 +3423,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* freebsd64_swapoff */ case 582: { struct freebsd64_swapoff_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * */ + uarg[a++] = (intcap_t)p->name; /* const char * */ uarg[a++] = p->flags; /* u_int */ *n_args = 2; break; @@ -3456,7 +3456,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 586: { struct freebsd64_timerfd_gettime_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->curr_value; /* struct itimerspec * */ + uarg[a++] = (intcap_t)p->curr_value; /* struct itimerspec * */ *n_args = 2; break; } @@ -3465,8 +3465,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_timerfd_settime_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->new_value; /* const struct itimerspec * */ - uarg[a++] = (intptr_t)p->old_value; /* struct itimerspec * */ + uarg[a++] = (intcap_t)p->new_value; /* const struct itimerspec * */ + uarg[a++] = (intcap_t)p->old_value; /* struct itimerspec * */ *n_args = 4; break; } @@ -3476,8 +3476,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->pid1; /* pid_t */ iarg[a++] = p->pid2; /* pid_t */ iarg[a++] = p->type; /* int */ - uarg[a++] = (intptr_t)p->idx1; /* uintptr64_t */ - uarg[a++] = (intptr_t)p->idx2; /* uintptr64_t */ + uarg[a++] = p->idx1; /* uintptr64_t */ + uarg[a++] = p->idx2; /* uintptr64_t */ *n_args = 5; break; } @@ -3486,7 +3486,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct freebsd64_getrlimitusage_args *p = params; uarg[a++] = p->which; /* u_int */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->res; /* rlim_t * */ + uarg[a++] = (intcap_t)p->res; /* rlim_t * */ *n_args = 3; break; } diff --git a/sys/kern/systrace_args.c b/sys/kern/systrace_args.c index bb8a5be90901..ac2050efe9b1 100644 --- a/sys/kern/systrace_args.c +++ b/sys/kern/systrace_args.c @@ -7,9 +7,9 @@ */ static void -systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) +systrace_args(int sysnum, void *params, uintcap_t *uarg, int *n_args) { - int64_t *iarg = (int64_t *)uarg; + intcap_t *iarg = (intcap_t *)uarg; int a = 0; switch (sysnum) { /* syscall */ @@ -33,7 +33,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 3: { struct read_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* void * __kerncap */ uarg[a++] = p->nbyte; /* size_t */ *n_args = 3; break; @@ -42,7 +42,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 4: { struct write_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* const void * __kerncap */ uarg[a++] = p->nbyte; /* size_t */ *n_args = 3; break; @@ -50,7 +50,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* open */ case 5: { struct open_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->flags; /* int */ iarg[a++] = p->mode; /* mode_t */ *n_args = 3; @@ -67,31 +67,31 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 7: { struct wait4_args *p = params; iarg[a++] = p->pid; /* int */ - uarg[a++] = (intptr_t)p->status; /* int * __kerncap */ + uarg[a++] = (intcap_t)p->status; /* int * __kerncap */ iarg[a++] = p->options; /* int */ - uarg[a++] = (intptr_t)p->rusage; /* struct rusage * __kerncap */ + uarg[a++] = (intcap_t)p->rusage; /* struct rusage * __kerncap */ *n_args = 4; break; } /* link */ case 9: { struct link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->to; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->to; /* const char * __kerncap */ *n_args = 2; break; } /* unlink */ case 10: { struct unlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ *n_args = 1; break; } /* chdir */ case 12: { struct chdir_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ *n_args = 1; break; } @@ -105,7 +105,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* chmod */ case 15: { struct chmod_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->mode; /* mode_t */ *n_args = 2; break; @@ -113,7 +113,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* chown */ case 16: { struct chown_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->uid; /* int */ iarg[a++] = p->gid; /* int */ *n_args = 3; @@ -122,7 +122,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* break */ case 17: { struct break_args *p = params; - uarg[a++] = (intptr_t)p->nsize; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->nsize; /* char * __kerncap */ *n_args = 1; break; } @@ -134,17 +134,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* mount */ case 21: { struct mount_args *p = params; - uarg[a++] = (intptr_t)p->type; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->type; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* void * __kerncap */ *n_args = 4; break; } /* unmount */ case 22: { struct unmount_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->flags; /* int */ *n_args = 2; break; @@ -171,7 +171,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct ptrace_args *p = params; iarg[a++] = p->req; /* int */ iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->addr; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->addr; /* char * __kerncap */ iarg[a++] = p->data; /* int */ *n_args = 4; break; @@ -180,7 +180,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 27: { struct recvmsg_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->msg; /* struct msghdr * __kerncap */ + uarg[a++] = (intcap_t)p->msg; /* struct msghdr * __kerncap */ iarg[a++] = p->flags; /* int */ *n_args = 3; break; @@ -189,7 +189,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 28: { struct sendmsg_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->msg; /* const struct msghdr * __kerncap */ + uarg[a++] = (intcap_t)p->msg; /* const struct msghdr * __kerncap */ iarg[a++] = p->flags; /* int */ *n_args = 3; break; @@ -198,11 +198,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 29: { struct recvfrom_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->buf; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* void * __kerncap */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->from; /* struct sockaddr * __kerncap */ - uarg[a++] = (intptr_t)p->fromlenaddr; /* __socklen_t * __kerncap */ + uarg[a++] = (intcap_t)p->from; /* struct sockaddr * __kerncap */ + uarg[a++] = (intcap_t)p->fromlenaddr; /* __socklen_t * __kerncap */ *n_args = 6; break; } @@ -210,8 +210,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 30: { struct accept_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* struct sockaddr * __kerncap */ - uarg[a++] = (intptr_t)p->anamelen; /* __socklen_t * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* struct sockaddr * __kerncap */ + uarg[a++] = (intcap_t)p->anamelen; /* __socklen_t * __kerncap */ *n_args = 3; break; } @@ -219,8 +219,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 31: { struct getpeername_args *p = params; iarg[a++] = p->fdes; /* int */ - uarg[a++] = (intptr_t)p->asa; /* struct sockaddr * __kerncap */ - uarg[a++] = (intptr_t)p->alen; /* __socklen_t * __kerncap */ + uarg[a++] = (intcap_t)p->asa; /* struct sockaddr * __kerncap */ + uarg[a++] = (intcap_t)p->alen; /* __socklen_t * __kerncap */ *n_args = 3; break; } @@ -228,15 +228,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 32: { struct getsockname_args *p = params; iarg[a++] = p->fdes; /* int */ - uarg[a++] = (intptr_t)p->asa; /* struct sockaddr * __kerncap */ - uarg[a++] = (intptr_t)p->alen; /* __socklen_t * __kerncap */ + uarg[a++] = (intcap_t)p->asa; /* struct sockaddr * __kerncap */ + uarg[a++] = (intcap_t)p->alen; /* __socklen_t * __kerncap */ *n_args = 3; break; } /* access */ case 33: { struct access_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->amode; /* int */ *n_args = 2; break; @@ -244,7 +244,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* chflags */ case 34: { struct chflags_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ uarg[a++] = p->flags; /* u_long */ *n_args = 2; break; @@ -290,7 +290,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* profil */ case 44: { struct profil_args *p = params; - uarg[a++] = (intptr_t)p->samples; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->samples; /* char * __kerncap */ uarg[a++] = p->size; /* size_t */ uarg[a++] = p->offset; /* size_t */ uarg[a++] = p->scale; /* u_int */ @@ -300,7 +300,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* ktrace */ case 45: { struct ktrace_args *p = params; - uarg[a++] = (intptr_t)p->fname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->fname; /* const char * __kerncap */ iarg[a++] = p->ops; /* int */ iarg[a++] = p->facs; /* int */ iarg[a++] = p->pid; /* int */ @@ -315,7 +315,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* getlogin */ case 49: { struct getlogin_args *p = params; - uarg[a++] = (intptr_t)p->namebuf; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->namebuf; /* char * __kerncap */ uarg[a++] = p->namelen; /* u_int */ *n_args = 2; break; @@ -323,22 +323,22 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* setlogin */ case 50: { struct setlogin_args *p = params; - uarg[a++] = (intptr_t)p->namebuf; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->namebuf; /* const char * __kerncap */ *n_args = 1; break; } /* acct */ case 51: { struct acct_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ *n_args = 1; break; } /* sigaltstack */ case 53: { struct sigaltstack_args *p = params; - uarg[a++] = (intptr_t)p->ss; /* const struct sigaltstack * __kerncap */ - uarg[a++] = (intptr_t)p->oss; /* struct sigaltstack * __kerncap */ + uarg[a++] = (intcap_t)p->ss; /* const struct sigaltstack * __kerncap */ + uarg[a++] = (intcap_t)p->oss; /* struct sigaltstack * __kerncap */ *n_args = 2; break; } @@ -347,7 +347,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct ioctl_args *p = params; iarg[a++] = p->fd; /* int */ uarg[a++] = p->com; /* u_long */ - uarg[a++] = (intptr_t)p->data; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* char * __kerncap */ *n_args = 3; break; } @@ -361,23 +361,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* revoke */ case 56: { struct revoke_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ *n_args = 1; break; } /* symlink */ case 57: { struct symlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->link; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->link; /* const char * __kerncap */ *n_args = 2; break; } /* readlink */ case 58: { struct readlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->buf; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* char * __kerncap */ uarg[a++] = p->count; /* size_t */ *n_args = 3; break; @@ -385,9 +385,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* execve */ case 59: { struct execve_args *p = params; - uarg[a++] = (intptr_t)p->fname; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->argv; /* char * __kerncap * __kerncap */ - uarg[a++] = (intptr_t)p->envv; /* char * __kerncap * __kerncap */ + uarg[a++] = (intcap_t)p->fname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->argv; /* char * __kerncap * __kerncap */ + uarg[a++] = (intcap_t)p->envv; /* char * __kerncap * __kerncap */ *n_args = 3; break; } @@ -401,14 +401,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* chroot */ case 61: { struct chroot_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ *n_args = 1; break; } /* msync */ case 65: { struct msync_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->addr; /* void * __kerncap */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->flags; /* int */ *n_args = 3; @@ -422,7 +422,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* munmap */ case 73: { struct munmap_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->addr; /* void * __kerncap */ uarg[a++] = p->len; /* size_t */ *n_args = 2; break; @@ -430,7 +430,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* mprotect */ case 74: { struct mprotect_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->addr; /* void * __kerncap */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->prot; /* int */ *n_args = 3; @@ -439,7 +439,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* madvise */ case 75: { struct madvise_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->addr; /* void * __kerncap */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->behav; /* int */ *n_args = 3; @@ -448,9 +448,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* mincore */ case 78: { struct mincore_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->addr; /* const void * __kerncap */ uarg[a++] = p->len; /* size_t */ - uarg[a++] = (intptr_t)p->vec; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->vec; /* char * __kerncap */ *n_args = 3; break; } @@ -458,7 +458,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 79: { struct getgroups_args *p = params; iarg[a++] = p->gidsetsize; /* int */ - uarg[a++] = (intptr_t)p->gidset; /* gid_t * __kerncap */ + uarg[a++] = (intcap_t)p->gidset; /* gid_t * __kerncap */ *n_args = 2; break; } @@ -466,7 +466,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 80: { struct setgroups_args *p = params; iarg[a++] = p->gidsetsize; /* int */ - uarg[a++] = (intptr_t)p->gidset; /* const gid_t * __kerncap */ + uarg[a++] = (intcap_t)p->gidset; /* const gid_t * __kerncap */ *n_args = 2; break; } @@ -487,15 +487,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 83: { struct setitimer_args *p = params; iarg[a++] = p->which; /* int */ - uarg[a++] = (intptr_t)p->itv; /* const struct itimerval * __kerncap */ - uarg[a++] = (intptr_t)p->oitv; /* struct itimerval * __kerncap */ + uarg[a++] = (intcap_t)p->itv; /* const struct itimerval * __kerncap */ + uarg[a++] = (intcap_t)p->oitv; /* struct itimerval * __kerncap */ *n_args = 3; break; } /* swapon */ case 85: { struct swapon_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* const char * __kerncap */ *n_args = 1; break; } @@ -503,7 +503,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 86: { struct getitimer_args *p = params; iarg[a++] = p->which; /* int */ - uarg[a++] = (intptr_t)p->itv; /* struct itimerval * __kerncap */ + uarg[a++] = (intcap_t)p->itv; /* struct itimerval * __kerncap */ *n_args = 2; break; } @@ -523,7 +523,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* cheri_cidcap_alloc */ case 91: { struct cheri_cidcap_alloc_args *p = params; - uarg[a++] = (intptr_t)p->cidp; /* uintcap_t * __kerncap */ + uarg[a++] = (intcap_t)p->cidp; /* uintcap_t * __kerncap */ *n_args = 1; break; } @@ -532,7 +532,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct fcntl_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->arg; /* intcap_t */ + uarg[a++] = (intcap_t)p->arg; /* intcap_t */ *n_args = 3; break; } @@ -540,10 +540,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 93: { struct select_args *p = params; iarg[a++] = p->nd; /* int */ - uarg[a++] = (intptr_t)p->in; /* fd_set * __kerncap */ - uarg[a++] = (intptr_t)p->ou; /* fd_set * __kerncap */ - uarg[a++] = (intptr_t)p->ex; /* fd_set * __kerncap */ - uarg[a++] = (intptr_t)p->tv; /* struct timeval * __kerncap */ + uarg[a++] = (intcap_t)p->in; /* fd_set * __kerncap */ + uarg[a++] = (intcap_t)p->ou; /* fd_set * __kerncap */ + uarg[a++] = (intcap_t)p->ex; /* fd_set * __kerncap */ + uarg[a++] = (intcap_t)p->tv; /* struct timeval * __kerncap */ *n_args = 5; break; } @@ -576,7 +576,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 98: { struct connect_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* const struct sockaddr * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* const struct sockaddr * __kerncap */ iarg[a++] = p->namelen; /* __socklen_t */ *n_args = 3; break; @@ -593,7 +593,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 104: { struct bind_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* const struct sockaddr * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* const struct sockaddr * __kerncap */ iarg[a++] = p->namelen; /* __socklen_t */ *n_args = 3; break; @@ -604,7 +604,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->s; /* int */ iarg[a++] = p->level; /* int */ iarg[a++] = p->name; /* int */ - uarg[a++] = (intptr_t)p->val; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->val; /* const void * __kerncap */ iarg[a++] = p->valsize; /* __socklen_t */ *n_args = 5; break; @@ -620,8 +620,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* gettimeofday */ case 116: { struct gettimeofday_args *p = params; - uarg[a++] = (intptr_t)p->tp; /* struct timeval * __kerncap */ - uarg[a++] = (intptr_t)p->tzp; /* struct timezone * __kerncap */ + uarg[a++] = (intcap_t)p->tp; /* struct timeval * __kerncap */ + uarg[a++] = (intcap_t)p->tzp; /* struct timezone * __kerncap */ *n_args = 2; break; } @@ -629,7 +629,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 117: { struct getrusage_args *p = params; iarg[a++] = p->who; /* int */ - uarg[a++] = (intptr_t)p->rusage; /* struct rusage * __kerncap */ + uarg[a++] = (intcap_t)p->rusage; /* struct rusage * __kerncap */ *n_args = 2; break; } @@ -639,8 +639,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->s; /* int */ iarg[a++] = p->level; /* int */ iarg[a++] = p->name; /* int */ - uarg[a++] = (intptr_t)p->val; /* void * __kerncap */ - uarg[a++] = (intptr_t)p->avalsize; /* __socklen_t * __kerncap */ + uarg[a++] = (intcap_t)p->val; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->avalsize; /* __socklen_t * __kerncap */ *n_args = 5; break; } @@ -648,7 +648,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 120: { struct readv_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->iovp; /* const struct iovec * __kerncap */ + uarg[a++] = (intcap_t)p->iovp; /* const struct iovec * __kerncap */ uarg[a++] = p->iovcnt; /* u_int */ *n_args = 3; break; @@ -657,7 +657,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 121: { struct writev_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->iovp; /* const struct iovec * __kerncap */ + uarg[a++] = (intcap_t)p->iovp; /* const struct iovec * __kerncap */ uarg[a++] = p->iovcnt; /* u_int */ *n_args = 3; break; @@ -665,8 +665,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* settimeofday */ case 122: { struct settimeofday_args *p = params; - uarg[a++] = (intptr_t)p->tv; /* const struct timeval * __kerncap */ - uarg[a++] = (intptr_t)p->tzp; /* const struct timezone * __kerncap */ + uarg[a++] = (intcap_t)p->tv; /* const struct timeval * __kerncap */ + uarg[a++] = (intcap_t)p->tzp; /* const struct timezone * __kerncap */ *n_args = 2; break; } @@ -706,8 +706,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* rename */ case 128: { struct rename_args *p = params; - uarg[a++] = (intptr_t)p->from; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->to; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->from; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->to; /* const char * __kerncap */ *n_args = 2; break; } @@ -722,7 +722,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* mkfifo */ case 132: { struct mkfifo_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->mode; /* mode_t */ *n_args = 2; break; @@ -731,10 +731,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 133: { struct sendto_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->buf; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* const void * __kerncap */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->to; /* const struct sockaddr * __kerncap */ + uarg[a++] = (intcap_t)p->to; /* const struct sockaddr * __kerncap */ iarg[a++] = p->tolen; /* __socklen_t */ *n_args = 6; break; @@ -753,14 +753,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->domain; /* int */ iarg[a++] = p->type; /* int */ iarg[a++] = p->protocol; /* int */ - uarg[a++] = (intptr_t)p->rsv; /* int * __kerncap */ + uarg[a++] = (intcap_t)p->rsv; /* int * __kerncap */ *n_args = 4; break; } /* mkdir */ case 136: { struct mkdir_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->mode; /* mode_t */ *n_args = 2; break; @@ -768,23 +768,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* rmdir */ case 137: { struct rmdir_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ *n_args = 1; break; } /* utimes */ case 138: { struct utimes_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->tptr; /* const struct timeval * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->tptr; /* const struct timeval * __kerncap */ *n_args = 2; break; } /* adjtime */ case 140: { struct adjtime_args *p = params; - uarg[a++] = (intptr_t)p->delta; /* const struct timeval * __kerncap */ - uarg[a++] = (intptr_t)p->olddelta; /* struct timeval * __kerncap */ + uarg[a++] = (intcap_t)p->delta; /* const struct timeval * __kerncap */ + uarg[a++] = (intcap_t)p->olddelta; /* struct timeval * __kerncap */ *n_args = 2; break; } @@ -796,10 +796,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* quotactl */ case 148: { struct quotactl_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->cmd; /* int */ iarg[a++] = p->uid; /* int */ - uarg[a++] = (intptr_t)p->arg; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->arg; /* void * __kerncap */ *n_args = 4; break; } @@ -809,7 +809,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->debug_level; /* int */ iarg[a++] = p->grace_period; /* int */ iarg[a++] = p->addr_count; /* int */ - uarg[a++] = (intptr_t)p->addrs; /* char * __kerncap * __kerncap */ + uarg[a++] = (intcap_t)p->addrs; /* char * __kerncap * __kerncap */ *n_args = 4; break; } @@ -817,23 +817,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 155: { struct nfssvc_args *p = params; iarg[a++] = p->flag; /* int */ - uarg[a++] = (intptr_t)p->argp; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->argp; /* void * __kerncap */ *n_args = 2; break; } /* lgetfh */ case 160: { struct lgetfh_args *p = params; - uarg[a++] = (intptr_t)p->fname; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * __kerncap */ + uarg[a++] = (intcap_t)p->fname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * __kerncap */ *n_args = 2; break; } /* getfh */ case 161: { struct getfh_args *p = params; - uarg[a++] = (intptr_t)p->fname; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * __kerncap */ + uarg[a++] = (intcap_t)p->fname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * __kerncap */ *n_args = 2; break; } @@ -841,7 +841,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 165: { struct sysarch_args *p = params; iarg[a++] = p->op; /* int */ - uarg[a++] = (intptr_t)p->parms; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->parms; /* char * __kerncap */ *n_args = 2; break; } @@ -850,7 +850,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct rtprio_args *p = params; iarg[a++] = p->function; /* int */ iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->rtp; /* struct rtprio * __kerncap */ + uarg[a++] = (intcap_t)p->rtp; /* struct rtprio * __kerncap */ *n_args = 3; break; } @@ -897,7 +897,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* ntp_adjtime */ case 176: { struct ntp_adjtime_args *p = params; - uarg[a++] = (intptr_t)p->tp; /* struct timex * __kerncap */ + uarg[a++] = (intcap_t)p->tp; /* struct timex * __kerncap */ *n_args = 1; break; } @@ -925,7 +925,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* pathconf */ case 191: { struct pathconf_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->name; /* int */ *n_args = 2; break; @@ -942,7 +942,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 194: { struct getrlimit_args *p = params; uarg[a++] = p->which; /* u_int */ - uarg[a++] = (intptr_t)p->rlp; /* struct rlimit * __kerncap */ + uarg[a++] = (intcap_t)p->rlp; /* struct rlimit * __kerncap */ *n_args = 2; break; } @@ -950,7 +950,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 195: { struct setrlimit_args *p = params; uarg[a++] = p->which; /* u_int */ - uarg[a++] = (intptr_t)p->rlp; /* struct rlimit * __kerncap */ + uarg[a++] = (intcap_t)p->rlp; /* struct rlimit * __kerncap */ *n_args = 2; break; } @@ -962,11 +962,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* __sysctl */ case 202: { struct __sysctl_args *p = params; - uarg[a++] = (intptr_t)p->name; /* int * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* int * __kerncap */ uarg[a++] = p->namelen; /* u_int */ - uarg[a++] = (intptr_t)p->old; /* void * __kerncap */ - uarg[a++] = (intptr_t)p->oldlenp; /* size_t * __kerncap */ - uarg[a++] = (intptr_t)p->new; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->old; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->oldlenp; /* size_t * __kerncap */ + uarg[a++] = (intcap_t)p->new; /* const void * __kerncap */ uarg[a++] = p->newlen; /* size_t */ *n_args = 6; break; @@ -974,7 +974,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* mlock */ case 203: { struct mlock_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->addr; /* const void * __kerncap */ uarg[a++] = p->len; /* size_t */ *n_args = 2; break; @@ -982,7 +982,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* munlock */ case 204: { struct munlock_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->addr; /* const void * __kerncap */ uarg[a++] = p->len; /* size_t */ *n_args = 2; break; @@ -990,7 +990,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* undelete */ case 205: { struct undelete_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ *n_args = 1; break; } @@ -998,7 +998,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 206: { struct futimes_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->tptr; /* const struct timeval * __kerncap */ + uarg[a++] = (intcap_t)p->tptr; /* const struct timeval * __kerncap */ *n_args = 2; break; } @@ -1012,7 +1012,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* poll */ case 209: { struct poll_args *p = params; - uarg[a++] = (intptr_t)p->fds; /* struct pollfd * __kerncap */ + uarg[a++] = (intcap_t)p->fds; /* struct pollfd * __kerncap */ uarg[a++] = p->nfds; /* u_int */ iarg[a++] = p->timeout; /* int */ *n_args = 3; @@ -1081,7 +1081,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 222: { struct semop_args *p = params; iarg[a++] = p->semid; /* int */ - uarg[a++] = (intptr_t)p->sops; /* struct sembuf * __kerncap */ + uarg[a++] = (intcap_t)p->sops; /* struct sembuf * __kerncap */ uarg[a++] = p->nsops; /* size_t */ *n_args = 3; break; @@ -1098,7 +1098,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 226: { struct msgsnd_args *p = params; iarg[a++] = p->msqid; /* int */ - uarg[a++] = (intptr_t)p->msgp; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->msgp; /* const void * __kerncap */ uarg[a++] = p->msgsz; /* size_t */ iarg[a++] = p->msgflg; /* int */ *n_args = 4; @@ -1108,7 +1108,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 227: { struct msgrcv_args *p = params; iarg[a++] = p->msqid; /* int */ - uarg[a++] = (intptr_t)p->msgp; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->msgp; /* void * __kerncap */ uarg[a++] = p->msgsz; /* size_t */ iarg[a++] = p->msgtyp; /* long */ iarg[a++] = p->msgflg; /* int */ @@ -1119,7 +1119,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 228: { struct shmat_args *p = params; iarg[a++] = p->shmid; /* int */ - uarg[a++] = (intptr_t)p->shmaddr; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->shmaddr; /* const void * __kerncap */ iarg[a++] = p->shmflg; /* int */ *n_args = 3; break; @@ -1127,7 +1127,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* shmdt */ case 230: { struct shmdt_args *p = params; - uarg[a++] = (intptr_t)p->shmaddr; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->shmaddr; /* const void * __kerncap */ *n_args = 1; break; } @@ -1144,7 +1144,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 232: { struct clock_gettime_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ - uarg[a++] = (intptr_t)p->tp; /* struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->tp; /* struct timespec * __kerncap */ *n_args = 2; break; } @@ -1152,7 +1152,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 233: { struct clock_settime_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ - uarg[a++] = (intptr_t)p->tp; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->tp; /* const struct timespec * __kerncap */ *n_args = 2; break; } @@ -1160,7 +1160,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 234: { struct clock_getres_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ - uarg[a++] = (intptr_t)p->tp; /* struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->tp; /* struct timespec * __kerncap */ *n_args = 2; break; } @@ -1168,8 +1168,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 235: { struct ktimer_create_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ - uarg[a++] = (intptr_t)p->evp; /* struct sigevent * __kerncap */ - uarg[a++] = (intptr_t)p->timerid; /* int * __kerncap */ + uarg[a++] = (intcap_t)p->evp; /* struct sigevent * __kerncap */ + uarg[a++] = (intcap_t)p->timerid; /* int * __kerncap */ *n_args = 3; break; } @@ -1185,8 +1185,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct ktimer_settime_args *p = params; iarg[a++] = p->timerid; /* int */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->value; /* const struct itimerspec * __kerncap */ - uarg[a++] = (intptr_t)p->ovalue; /* struct itimerspec * __kerncap */ + uarg[a++] = (intcap_t)p->value; /* const struct itimerspec * __kerncap */ + uarg[a++] = (intcap_t)p->ovalue; /* struct itimerspec * __kerncap */ *n_args = 4; break; } @@ -1194,7 +1194,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 238: { struct ktimer_gettime_args *p = params; iarg[a++] = p->timerid; /* int */ - uarg[a++] = (intptr_t)p->value; /* struct itimerspec * __kerncap */ + uarg[a++] = (intcap_t)p->value; /* struct itimerspec * __kerncap */ *n_args = 2; break; } @@ -1208,29 +1208,29 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* nanosleep */ case 240: { struct nanosleep_args *p = params; - uarg[a++] = (intptr_t)p->rqtp; /* const struct timespec * __kerncap */ - uarg[a++] = (intptr_t)p->rmtp; /* struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->rqtp; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->rmtp; /* struct timespec * __kerncap */ *n_args = 2; break; } /* ffclock_getcounter */ case 241: { struct ffclock_getcounter_args *p = params; - uarg[a++] = (intptr_t)p->ffcount; /* ffcounter * __kerncap */ + uarg[a++] = (intcap_t)p->ffcount; /* ffcounter * __kerncap */ *n_args = 1; break; } /* ffclock_setestimate */ case 242: { struct ffclock_setestimate_args *p = params; - uarg[a++] = (intptr_t)p->cest; /* struct ffclock_estimate * __kerncap */ + uarg[a++] = (intcap_t)p->cest; /* struct ffclock_estimate * __kerncap */ *n_args = 1; break; } /* ffclock_getestimate */ case 243: { struct ffclock_getestimate_args *p = params; - uarg[a++] = (intptr_t)p->cest; /* struct ffclock_estimate * __kerncap */ + uarg[a++] = (intcap_t)p->cest; /* struct ffclock_estimate * __kerncap */ *n_args = 1; break; } @@ -1239,8 +1239,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct clock_nanosleep_args *p = params; iarg[a++] = p->clock_id; /* clockid_t */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->rqtp; /* const struct timespec * __kerncap */ - uarg[a++] = (intptr_t)p->rmtp; /* struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->rqtp; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->rmtp; /* struct timespec * __kerncap */ *n_args = 4; break; } @@ -1249,21 +1249,21 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct clock_getcpuclockid2_args *p = params; iarg[a++] = p->id; /* id_t */ iarg[a++] = p->which; /* int */ - uarg[a++] = (intptr_t)p->clock_id; /* clockid_t * __kerncap */ + uarg[a++] = (intcap_t)p->clock_id; /* clockid_t * __kerncap */ *n_args = 3; break; } /* ntp_gettime */ case 248: { struct ntp_gettime_args *p = params; - uarg[a++] = (intptr_t)p->ntvp; /* struct ntptimeval * __kerncap */ + uarg[a++] = (intcap_t)p->ntvp; /* struct ntptimeval * __kerncap */ *n_args = 1; break; } /* minherit */ case 250: { struct minherit_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->addr; /* void * __kerncap */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->inherit; /* int */ *n_args = 3; @@ -1284,7 +1284,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* lchown */ case 254: { struct lchown_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->uid; /* int */ iarg[a++] = p->gid; /* int */ *n_args = 3; @@ -1293,14 +1293,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* aio_read */ case 255: { struct aio_read_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb * __kerncap */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb * __kerncap */ *n_args = 1; break; } /* aio_write */ case 256: { struct aio_write_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb * __kerncap */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb * __kerncap */ *n_args = 1; break; } @@ -1308,17 +1308,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 257: { struct lio_listio_args *p = params; iarg[a++] = p->mode; /* int */ - uarg[a++] = (intptr_t)p->acb_list; /* struct aiocb * __kerncap const * __kerncap */ + uarg[a++] = (intcap_t)p->acb_list; /* struct aiocb * __kerncap const * __kerncap */ iarg[a++] = p->nent; /* int */ - uarg[a++] = (intptr_t)p->sig; /* struct sigevent * __kerncap */ + uarg[a++] = (intcap_t)p->sig; /* struct sigevent * __kerncap */ *n_args = 4; break; } /* kbounce */ case 258: { struct kbounce_args *p = params; - uarg[a++] = (intptr_t)p->src; /* const void * __kerncap */ - uarg[a++] = (intptr_t)p->dst; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->src; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->dst; /* void * __kerncap */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->flags; /* int */ *n_args = 4; @@ -1327,7 +1327,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* flag_captured */ case 259: { struct flag_captured_args *p = params; - uarg[a++] = (intptr_t)p->message; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->message; /* const char * __kerncap */ uarg[a++] = p->key; /* uint32_t */ *n_args = 2; break; @@ -1336,8 +1336,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 260: { struct cheri_revoke_get_shadow_args *p = params; iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->arena; /* void * __kerncap */ - uarg[a++] = (intptr_t)p->shadow; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->arena; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->shadow; /* void * __kerncap */ *n_args = 3; break; } @@ -1346,14 +1346,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct cheri_revoke_args *p = params; iarg[a++] = p->flags; /* int */ uarg[a++] = p->start_epoch; /* uint64_t */ - uarg[a++] = (intptr_t)p->crsi; /* struct cheri_revoke_syscall_info * __kerncap */ + uarg[a++] = (intcap_t)p->crsi; /* struct cheri_revoke_syscall_info * __kerncap */ *n_args = 3; break; } /* lchmod */ case 274: { struct lchmod_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->mode; /* mode_t */ *n_args = 2; break; @@ -1361,8 +1361,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* lutimes */ case 276: { struct lutimes_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->tptr; /* const struct timeval * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->tptr; /* const struct timeval * __kerncap */ *n_args = 2; break; } @@ -1370,7 +1370,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 289: { struct preadv_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->iovp; /* struct iovec * __kerncap */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec * __kerncap */ uarg[a++] = p->iovcnt; /* u_int */ iarg[a++] = p->offset; /* off_t */ *n_args = 4; @@ -1380,7 +1380,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 290: { struct pwritev_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->iovp; /* struct iovec * __kerncap */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec * __kerncap */ uarg[a++] = p->iovcnt; /* u_int */ iarg[a++] = p->offset; /* off_t */ *n_args = 4; @@ -1389,7 +1389,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* fhopen */ case 298: { struct fhopen_args *p = params; - uarg[a++] = (intptr_t)p->u_fhp; /* const struct fhandle * __kerncap */ + uarg[a++] = (intcap_t)p->u_fhp; /* const struct fhandle * __kerncap */ iarg[a++] = p->flags; /* int */ *n_args = 2; break; @@ -1405,7 +1405,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 301: { struct modstat_args *p = params; iarg[a++] = p->modid; /* int */ - uarg[a++] = (intptr_t)p->stat; /* struct module_stat * __kerncap */ + uarg[a++] = (intcap_t)p->stat; /* struct module_stat * __kerncap */ *n_args = 2; break; } @@ -1419,14 +1419,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* modfind */ case 303: { struct modfind_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* const char * __kerncap */ *n_args = 1; break; } /* kldload */ case 304: { struct kldload_args *p = params; - uarg[a++] = (intptr_t)p->file; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->file; /* const char * __kerncap */ *n_args = 1; break; } @@ -1440,7 +1440,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* kldfind */ case 306: { struct kldfind_args *p = params; - uarg[a++] = (intptr_t)p->file; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->file; /* const char * __kerncap */ *n_args = 1; break; } @@ -1455,7 +1455,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 308: { struct kldstat_args *p = params; iarg[a++] = p->fileid; /* int */ - uarg[a++] = (intptr_t)p->stat; /* struct kld_file_stat * __kerncap */ + uarg[a++] = (intcap_t)p->stat; /* struct kld_file_stat * __kerncap */ *n_args = 2; break; } @@ -1494,16 +1494,16 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* aio_return */ case 314: { struct aio_return_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb * __kerncap */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb * __kerncap */ *n_args = 1; break; } /* aio_suspend */ case 315: { struct aio_suspend_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* const struct aiocb * __kerncap const * __kerncap */ + uarg[a++] = (intcap_t)p->aiocbp; /* const struct aiocb * __kerncap const * __kerncap */ iarg[a++] = p->nent; /* int */ - uarg[a++] = (intptr_t)p->timeout; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->timeout; /* const struct timespec * __kerncap */ *n_args = 3; break; } @@ -1511,14 +1511,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 316: { struct aio_cancel_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb * __kerncap */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb * __kerncap */ *n_args = 2; break; } /* aio_error */ case 317: { struct aio_error_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb * __kerncap */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb * __kerncap */ *n_args = 1; break; } @@ -1542,7 +1542,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* __getcwd */ case 326: { struct __getcwd_args *p = params; - uarg[a++] = (intptr_t)p->buf; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* char * __kerncap */ uarg[a++] = p->buflen; /* size_t */ *n_args = 2; break; @@ -1551,7 +1551,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 327: { struct sched_setparam_args *p = params; iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->param; /* const struct sched_param * __kerncap */ + uarg[a++] = (intcap_t)p->param; /* const struct sched_param * __kerncap */ *n_args = 2; break; } @@ -1559,7 +1559,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 328: { struct sched_getparam_args *p = params; iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->param; /* struct sched_param * __kerncap */ + uarg[a++] = (intcap_t)p->param; /* struct sched_param * __kerncap */ *n_args = 2; break; } @@ -1568,7 +1568,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct sched_setscheduler_args *p = params; iarg[a++] = p->pid; /* pid_t */ iarg[a++] = p->policy; /* int */ - uarg[a++] = (intptr_t)p->param; /* const struct sched_param * __kerncap */ + uarg[a++] = (intcap_t)p->param; /* const struct sched_param * __kerncap */ *n_args = 3; break; } @@ -1602,14 +1602,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 334: { struct sched_rr_get_interval_args *p = params; iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->interval; /* struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->interval; /* struct timespec * __kerncap */ *n_args = 2; break; } /* utrace */ case 335: { struct utrace_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->addr; /* const void * __kerncap */ uarg[a++] = p->len; /* size_t */ *n_args = 2; break; @@ -1619,14 +1619,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct kldsym_args *p = params; iarg[a++] = p->fileid; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* void * __kerncap */ *n_args = 3; break; } /* jail */ case 338: { struct jail_args *p = params; - uarg[a++] = (intptr_t)p->jailp; /* struct jail * __kerncap */ + uarg[a++] = (intcap_t)p->jailp; /* struct jail * __kerncap */ *n_args = 1; break; } @@ -1634,9 +1634,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 339: { struct nnpfs_syscall_args *p = params; iarg[a++] = p->operation; /* int */ - uarg[a++] = (intptr_t)p->a_pathP; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->a_pathP; /* char * __kerncap */ iarg[a++] = p->a_opcode; /* int */ - uarg[a++] = (intptr_t)p->a_paramsP; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->a_paramsP; /* void * __kerncap */ iarg[a++] = p->a_followSymlinks; /* int */ *n_args = 5; break; @@ -1645,57 +1645,57 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 340: { struct sigprocmask_args *p = params; iarg[a++] = p->how; /* int */ - uarg[a++] = (intptr_t)p->set; /* const sigset_t * __kerncap */ - uarg[a++] = (intptr_t)p->oset; /* sigset_t * __kerncap */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * __kerncap */ + uarg[a++] = (intcap_t)p->oset; /* sigset_t * __kerncap */ *n_args = 3; break; } /* sigsuspend */ case 341: { struct sigsuspend_args *p = params; - uarg[a++] = (intptr_t)p->sigmask; /* const sigset_t * __kerncap */ + uarg[a++] = (intcap_t)p->sigmask; /* const sigset_t * __kerncap */ *n_args = 1; break; } /* sigpending */ case 343: { struct sigpending_args *p = params; - uarg[a++] = (intptr_t)p->set; /* sigset_t * __kerncap */ + uarg[a++] = (intcap_t)p->set; /* sigset_t * __kerncap */ *n_args = 1; break; } /* sigtimedwait */ case 345: { struct sigtimedwait_args *p = params; - uarg[a++] = (intptr_t)p->set; /* const sigset_t * __kerncap */ - uarg[a++] = (intptr_t)p->info; /* struct __siginfo * __kerncap */ - uarg[a++] = (intptr_t)p->timeout; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * __kerncap */ + uarg[a++] = (intcap_t)p->info; /* struct __siginfo * __kerncap */ + uarg[a++] = (intcap_t)p->timeout; /* const struct timespec * __kerncap */ *n_args = 3; break; } /* sigwaitinfo */ case 346: { struct sigwaitinfo_args *p = params; - uarg[a++] = (intptr_t)p->set; /* const sigset_t * __kerncap */ - uarg[a++] = (intptr_t)p->info; /* struct __siginfo * __kerncap */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * __kerncap */ + uarg[a++] = (intcap_t)p->info; /* struct __siginfo * __kerncap */ *n_args = 2; break; } /* __acl_get_file */ case 347: { struct __acl_get_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * __kerncap */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * __kerncap */ *n_args = 3; break; } /* __acl_set_file */ case 348: { struct __acl_set_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * __kerncap */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * __kerncap */ *n_args = 3; break; } @@ -1704,7 +1704,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct __acl_get_fd_args *p = params; iarg[a++] = p->filedes; /* int */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * __kerncap */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * __kerncap */ *n_args = 3; break; } @@ -1713,14 +1713,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct __acl_set_fd_args *p = params; iarg[a++] = p->filedes; /* int */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * __kerncap */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * __kerncap */ *n_args = 3; break; } /* __acl_delete_file */ case 351: { struct __acl_delete_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->type; /* __acl_type_t */ *n_args = 2; break; @@ -1736,9 +1736,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* __acl_aclcheck_file */ case 353: { struct __acl_aclcheck_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * __kerncap */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * __kerncap */ *n_args = 3; break; } @@ -1747,28 +1747,28 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct __acl_aclcheck_fd_args *p = params; iarg[a++] = p->filedes; /* int */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * __kerncap */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * __kerncap */ *n_args = 3; break; } /* extattrctl */ case 355: { struct extattrctl_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->filename; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->filename; /* const char * __kerncap */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->attrname; /* const char * __kerncap */ *n_args = 5; break; } /* extattr_set_file */ case 356: { struct extattr_set_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->data; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->attrname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* void * __kerncap */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1776,10 +1776,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* extattr_get_file */ case 357: { struct extattr_get_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->data; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->attrname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* void * __kerncap */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1787,35 +1787,35 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* extattr_delete_file */ case 358: { struct extattr_delete_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->attrname; /* const char * __kerncap */ *n_args = 3; break; } /* aio_waitcomplete */ case 359: { struct aio_waitcomplete_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb * __kerncap * __kerncap */ - uarg[a++] = (intptr_t)p->timeout; /* struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb * __kerncap * __kerncap */ + uarg[a++] = (intcap_t)p->timeout; /* struct timespec * __kerncap */ *n_args = 2; break; } /* getresuid */ case 360: { struct getresuid_args *p = params; - uarg[a++] = (intptr_t)p->ruid; /* uid_t * __kerncap */ - uarg[a++] = (intptr_t)p->euid; /* uid_t * __kerncap */ - uarg[a++] = (intptr_t)p->suid; /* uid_t * __kerncap */ + uarg[a++] = (intcap_t)p->ruid; /* uid_t * __kerncap */ + uarg[a++] = (intcap_t)p->euid; /* uid_t * __kerncap */ + uarg[a++] = (intcap_t)p->suid; /* uid_t * __kerncap */ *n_args = 3; break; } /* getresgid */ case 361: { struct getresgid_args *p = params; - uarg[a++] = (intptr_t)p->rgid; /* gid_t * __kerncap */ - uarg[a++] = (intptr_t)p->egid; /* gid_t * __kerncap */ - uarg[a++] = (intptr_t)p->sgid; /* gid_t * __kerncap */ + uarg[a++] = (intcap_t)p->rgid; /* gid_t * __kerncap */ + uarg[a++] = (intcap_t)p->egid; /* gid_t * __kerncap */ + uarg[a++] = (intcap_t)p->sgid; /* gid_t * __kerncap */ *n_args = 3; break; } @@ -1829,8 +1829,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct extattr_set_fd_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->data; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->attrname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* void * __kerncap */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1840,8 +1840,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct extattr_get_fd_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->data; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->attrname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* void * __kerncap */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -1851,7 +1851,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct extattr_delete_fd_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->attrname; /* const char * __kerncap */ *n_args = 3; break; } @@ -1865,7 +1865,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* eaccess */ case 376: { struct eaccess_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->amode; /* int */ *n_args = 2; break; @@ -1886,7 +1886,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* nmount */ case 378: { struct nmount_args *p = params; - uarg[a++] = (intptr_t)p->iovp; /* struct iovec * __kerncap */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec * __kerncap */ uarg[a++] = p->iovcnt; /* unsigned int */ iarg[a++] = p->flags; /* int */ *n_args = 3; @@ -1895,14 +1895,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* __mac_get_proc */ case 384: { struct __mac_get_proc_args *p = params; - uarg[a++] = (intptr_t)p->mac_p; /* struct mac * __kerncap */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac * __kerncap */ *n_args = 1; break; } /* __mac_set_proc */ case 385: { struct __mac_set_proc_args *p = params; - uarg[a++] = (intptr_t)p->mac_p; /* struct mac * __kerncap */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac * __kerncap */ *n_args = 1; break; } @@ -1910,15 +1910,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 386: { struct __mac_get_fd_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac * __kerncap */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac * __kerncap */ *n_args = 2; break; } /* __mac_get_file */ case 387: { struct __mac_get_file_args *p = params; - uarg[a++] = (intptr_t)p->path_p; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac * __kerncap */ + uarg[a++] = (intcap_t)p->path_p; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac * __kerncap */ *n_args = 2; break; } @@ -1926,15 +1926,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 388: { struct __mac_set_fd_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac * __kerncap */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac * __kerncap */ *n_args = 2; break; } /* __mac_set_file */ case 389: { struct __mac_set_file_args *p = params; - uarg[a++] = (intptr_t)p->path_p; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac * __kerncap */ + uarg[a++] = (intcap_t)p->path_p; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac * __kerncap */ *n_args = 2; break; } @@ -1942,8 +1942,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 390: { struct kenv_args *p = params; iarg[a++] = p->what; /* int */ - uarg[a++] = (intptr_t)p->name; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->value; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->value; /* char * __kerncap */ iarg[a++] = p->len; /* int */ *n_args = 4; break; @@ -1951,7 +1951,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* lchflags */ case 391: { struct lchflags_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ uarg[a++] = p->flags; /* u_long */ *n_args = 2; break; @@ -1959,7 +1959,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* uuidgen */ case 392: { struct uuidgen_args *p = params; - uarg[a++] = (intptr_t)p->store; /* struct uuid * __kerncap */ + uarg[a++] = (intcap_t)p->store; /* struct uuid * __kerncap */ iarg[a++] = p->count; /* int */ *n_args = 2; break; @@ -1971,8 +1971,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->s; /* int */ iarg[a++] = p->offset; /* off_t */ uarg[a++] = p->nbytes; /* size_t */ - uarg[a++] = (intptr_t)p->hdtr; /* struct sf_hdtr * __kerncap */ - uarg[a++] = (intptr_t)p->sbytes; /* off_t * __kerncap */ + uarg[a++] = (intcap_t)p->hdtr; /* struct sf_hdtr * __kerncap */ + uarg[a++] = (intcap_t)p->sbytes; /* off_t * __kerncap */ iarg[a++] = p->flags; /* int */ *n_args = 7; break; @@ -1980,9 +1980,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* mac_syscall */ case 394: { struct mac_syscall_args *p = params; - uarg[a++] = (intptr_t)p->policy; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->policy; /* const char * __kerncap */ iarg[a++] = p->call; /* int */ - uarg[a++] = (intptr_t)p->arg; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->arg; /* void * __kerncap */ *n_args = 3; break; } @@ -2017,7 +2017,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* ksem_init */ case 404: { struct ksem_init_args *p = params; - uarg[a++] = (intptr_t)p->idp; /* semid_t * __kerncap */ + uarg[a++] = (intcap_t)p->idp; /* semid_t * __kerncap */ uarg[a++] = p->value; /* unsigned int */ *n_args = 2; break; @@ -2025,8 +2025,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* ksem_open */ case 405: { struct ksem_open_args *p = params; - uarg[a++] = (intptr_t)p->idp; /* semid_t * __kerncap */ - uarg[a++] = (intptr_t)p->name; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->idp; /* semid_t * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* const char * __kerncap */ iarg[a++] = p->oflag; /* int */ iarg[a++] = p->mode; /* mode_t */ uarg[a++] = p->value; /* unsigned int */ @@ -2036,7 +2036,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* ksem_unlink */ case 406: { struct ksem_unlink_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* const char * __kerncap */ *n_args = 1; break; } @@ -2044,7 +2044,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 407: { struct ksem_getvalue_args *p = params; iarg[a++] = p->id; /* semid_t */ - uarg[a++] = (intptr_t)p->val; /* int * __kerncap */ + uarg[a++] = (intcap_t)p->val; /* int * __kerncap */ *n_args = 2; break; } @@ -2059,33 +2059,33 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 409: { struct __mac_get_pid_args *p = params; iarg[a++] = p->pid; /* pid_t */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac * __kerncap */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac * __kerncap */ *n_args = 2; break; } /* __mac_get_link */ case 410: { struct __mac_get_link_args *p = params; - uarg[a++] = (intptr_t)p->path_p; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac * __kerncap */ + uarg[a++] = (intcap_t)p->path_p; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac * __kerncap */ *n_args = 2; break; } /* __mac_set_link */ case 411: { struct __mac_set_link_args *p = params; - uarg[a++] = (intptr_t)p->path_p; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac * __kerncap */ + uarg[a++] = (intcap_t)p->path_p; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac * __kerncap */ *n_args = 2; break; } /* extattr_set_link */ case 412: { struct extattr_set_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->data; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->attrname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* void * __kerncap */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -2093,10 +2093,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* extattr_get_link */ case 413: { struct extattr_get_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->data; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->attrname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* void * __kerncap */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 5; break; @@ -2104,19 +2104,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* extattr_delete_link */ case 414: { struct extattr_delete_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->attrname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->attrname; /* const char * __kerncap */ *n_args = 3; break; } /* __mac_execve */ case 415: { struct __mac_execve_args *p = params; - uarg[a++] = (intptr_t)p->fname; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->argv; /* char * __kerncap * __kerncap */ - uarg[a++] = (intptr_t)p->envv; /* char * __kerncap * __kerncap */ - uarg[a++] = (intptr_t)p->mac_p; /* struct mac * __kerncap */ + uarg[a++] = (intcap_t)p->fname; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->argv; /* char * __kerncap * __kerncap */ + uarg[a++] = (intcap_t)p->envv; /* char * __kerncap * __kerncap */ + uarg[a++] = (intcap_t)p->mac_p; /* struct mac * __kerncap */ *n_args = 4; break; } @@ -2124,62 +2124,62 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 416: { struct sigaction_args *p = params; iarg[a++] = p->sig; /* int */ - uarg[a++] = (intptr_t)p->act; /* const struct sigaction * __kerncap */ - uarg[a++] = (intptr_t)p->oact; /* struct sigaction * __kerncap */ + uarg[a++] = (intcap_t)p->act; /* const struct sigaction * __kerncap */ + uarg[a++] = (intcap_t)p->oact; /* struct sigaction * __kerncap */ *n_args = 3; break; } /* sigreturn */ case 417: { struct sigreturn_args *p = params; - uarg[a++] = (intptr_t)p->sigcntxp; /* const struct __ucontext * __kerncap */ + uarg[a++] = (intcap_t)p->sigcntxp; /* const struct __ucontext * __kerncap */ *n_args = 1; break; } /* getcontext */ case 421: { struct getcontext_args *p = params; - uarg[a++] = (intptr_t)p->ucp; /* struct __ucontext * __kerncap */ + uarg[a++] = (intcap_t)p->ucp; /* struct __ucontext * __kerncap */ *n_args = 1; break; } /* setcontext */ case 422: { struct setcontext_args *p = params; - uarg[a++] = (intptr_t)p->ucp; /* const struct __ucontext * __kerncap */ + uarg[a++] = (intcap_t)p->ucp; /* const struct __ucontext * __kerncap */ *n_args = 1; break; } /* swapcontext */ case 423: { struct swapcontext_args *p = params; - uarg[a++] = (intptr_t)p->oucp; /* struct __ucontext * __kerncap */ - uarg[a++] = (intptr_t)p->ucp; /* const struct __ucontext * __kerncap */ + uarg[a++] = (intcap_t)p->oucp; /* struct __ucontext * __kerncap */ + uarg[a++] = (intcap_t)p->ucp; /* const struct __ucontext * __kerncap */ *n_args = 2; break; } /* __acl_get_link */ case 425: { struct __acl_get_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * __kerncap */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * __kerncap */ *n_args = 3; break; } /* __acl_set_link */ case 426: { struct __acl_set_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * __kerncap */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * __kerncap */ *n_args = 3; break; } /* __acl_delete_link */ case 427: { struct __acl_delete_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->type; /* __acl_type_t */ *n_args = 2; break; @@ -2187,25 +2187,25 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* __acl_aclcheck_link */ case 428: { struct __acl_aclcheck_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->type; /* __acl_type_t */ - uarg[a++] = (intptr_t)p->aclp; /* struct acl * __kerncap */ + uarg[a++] = (intcap_t)p->aclp; /* struct acl * __kerncap */ *n_args = 3; break; } /* sigwait */ case 429: { struct sigwait_args *p = params; - uarg[a++] = (intptr_t)p->set; /* const sigset_t * __kerncap */ - uarg[a++] = (intptr_t)p->sig; /* int * __kerncap */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * __kerncap */ + uarg[a++] = (intcap_t)p->sig; /* int * __kerncap */ *n_args = 2; break; } /* thr_create */ case 430: { struct thr_create_args *p = params; - uarg[a++] = (intptr_t)p->ctx; /* struct __ucontext * __kerncap */ - uarg[a++] = (intptr_t)p->id; /* long * __kerncap */ + uarg[a++] = (intcap_t)p->ctx; /* struct __ucontext * __kerncap */ + uarg[a++] = (intcap_t)p->id; /* long * __kerncap */ iarg[a++] = p->flags; /* int */ *n_args = 3; break; @@ -2213,14 +2213,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* thr_exit */ case 431: { struct thr_exit_args *p = params; - uarg[a++] = (intptr_t)p->state; /* long * __kerncap */ + uarg[a++] = (intcap_t)p->state; /* long * __kerncap */ *n_args = 1; break; } /* thr_self */ case 432: { struct thr_self_args *p = params; - uarg[a++] = (intptr_t)p->id; /* long * __kerncap */ + uarg[a++] = (intcap_t)p->id; /* long * __kerncap */ *n_args = 1; break; } @@ -2244,7 +2244,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct extattr_list_fd_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* void * __kerncap */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 4; break; @@ -2252,9 +2252,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* extattr_list_file */ case 438: { struct extattr_list_file_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* void * __kerncap */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 4; break; @@ -2262,9 +2262,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* extattr_list_link */ case 439: { struct extattr_list_link_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->attrnamespace; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* void * __kerncap */ uarg[a++] = p->nbytes; /* size_t */ *n_args = 4; break; @@ -2273,14 +2273,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 441: { struct ksem_timedwait_args *p = params; iarg[a++] = p->id; /* semid_t */ - uarg[a++] = (intptr_t)p->abstime; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->abstime; /* const struct timespec * __kerncap */ *n_args = 2; break; } /* thr_suspend */ case 442: { struct thr_suspend_args *p = params; - uarg[a++] = (intptr_t)p->timeout; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->timeout; /* const struct timespec * __kerncap */ *n_args = 1; break; } @@ -2302,7 +2302,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* audit */ case 445: { struct audit_args *p = params; - uarg[a++] = (intptr_t)p->record; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->record; /* const void * __kerncap */ uarg[a++] = p->length; /* u_int */ *n_args = 2; break; @@ -2311,7 +2311,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 446: { struct auditon_args *p = params; iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* void * __kerncap */ uarg[a++] = p->length; /* u_int */ *n_args = 3; break; @@ -2319,35 +2319,35 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* getauid */ case 447: { struct getauid_args *p = params; - uarg[a++] = (intptr_t)p->auid; /* uid_t * __kerncap */ + uarg[a++] = (intcap_t)p->auid; /* uid_t * __kerncap */ *n_args = 1; break; } /* setauid */ case 448: { struct setauid_args *p = params; - uarg[a++] = (intptr_t)p->auid; /* uid_t * __kerncap */ + uarg[a++] = (intcap_t)p->auid; /* uid_t * __kerncap */ *n_args = 1; break; } /* getaudit */ case 449: { struct getaudit_args *p = params; - uarg[a++] = (intptr_t)p->auditinfo; /* struct auditinfo * __kerncap */ + uarg[a++] = (intcap_t)p->auditinfo; /* struct auditinfo * __kerncap */ *n_args = 1; break; } /* setaudit */ case 450: { struct setaudit_args *p = params; - uarg[a++] = (intptr_t)p->auditinfo; /* struct auditinfo * __kerncap */ + uarg[a++] = (intcap_t)p->auditinfo; /* struct auditinfo * __kerncap */ *n_args = 1; break; } /* getaudit_addr */ case 451: { struct getaudit_addr_args *p = params; - uarg[a++] = (intptr_t)p->auditinfo_addr; /* struct auditinfo_addr * __kerncap */ + uarg[a++] = (intcap_t)p->auditinfo_addr; /* struct auditinfo_addr * __kerncap */ uarg[a++] = p->length; /* u_int */ *n_args = 2; break; @@ -2355,7 +2355,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* setaudit_addr */ case 452: { struct setaudit_addr_args *p = params; - uarg[a++] = (intptr_t)p->auditinfo_addr; /* struct auditinfo_addr * __kerncap */ + uarg[a++] = (intcap_t)p->auditinfo_addr; /* struct auditinfo_addr * __kerncap */ uarg[a++] = p->length; /* u_int */ *n_args = 2; break; @@ -2363,25 +2363,25 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* auditctl */ case 453: { struct auditctl_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ *n_args = 1; break; } /* _umtx_op */ case 454: { struct _umtx_op_args *p = params; - uarg[a++] = (intptr_t)p->obj; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->obj; /* void * __kerncap */ iarg[a++] = p->op; /* int */ uarg[a++] = p->val; /* u_long */ - uarg[a++] = (intptr_t)p->uaddr1; /* void * __kerncap */ - uarg[a++] = (intptr_t)p->uaddr2; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->uaddr1; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->uaddr2; /* void * __kerncap */ *n_args = 5; break; } /* thr_new */ case 455: { struct thr_new_args *p = params; - uarg[a++] = (intptr_t)p->param; /* struct thr_param * __kerncap */ + uarg[a++] = (intcap_t)p->param; /* struct thr_param * __kerncap */ iarg[a++] = p->param_size; /* int */ *n_args = 2; break; @@ -2391,17 +2391,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct sigqueue_args *p = params; iarg[a++] = p->pid; /* pid_t */ iarg[a++] = p->signum; /* int */ - uarg[a++] = (intptr_t)p->value; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->value; /* void * __kerncap */ *n_args = 3; break; } /* kmq_open */ case 457: { struct kmq_open_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->flags; /* int */ iarg[a++] = p->mode; /* mode_t */ - uarg[a++] = (intptr_t)p->attr; /* const struct mq_attr * __kerncap */ + uarg[a++] = (intcap_t)p->attr; /* const struct mq_attr * __kerncap */ *n_args = 4; break; } @@ -2409,8 +2409,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 458: { struct kmq_setattr_args *p = params; iarg[a++] = p->mqd; /* int */ - uarg[a++] = (intptr_t)p->attr; /* const struct mq_attr * __kerncap */ - uarg[a++] = (intptr_t)p->oattr; /* struct mq_attr * __kerncap */ + uarg[a++] = (intcap_t)p->attr; /* const struct mq_attr * __kerncap */ + uarg[a++] = (intcap_t)p->oattr; /* struct mq_attr * __kerncap */ *n_args = 3; break; } @@ -2418,10 +2418,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 459: { struct kmq_timedreceive_args *p = params; iarg[a++] = p->mqd; /* int */ - uarg[a++] = (intptr_t)p->msg_ptr; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->msg_ptr; /* char * __kerncap */ uarg[a++] = p->msg_len; /* size_t */ - uarg[a++] = (intptr_t)p->msg_prio; /* unsigned * __kerncap */ - uarg[a++] = (intptr_t)p->abs_timeout; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->msg_prio; /* unsigned * __kerncap */ + uarg[a++] = (intcap_t)p->abs_timeout; /* const struct timespec * __kerncap */ *n_args = 5; break; } @@ -2429,10 +2429,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 460: { struct kmq_timedsend_args *p = params; iarg[a++] = p->mqd; /* int */ - uarg[a++] = (intptr_t)p->msg_ptr; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->msg_ptr; /* const char * __kerncap */ uarg[a++] = p->msg_len; /* size_t */ uarg[a++] = p->msg_prio; /* unsigned */ - uarg[a++] = (intptr_t)p->abs_timeout; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->abs_timeout; /* const struct timespec * __kerncap */ *n_args = 5; break; } @@ -2440,23 +2440,23 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 461: { struct kmq_notify_args *p = params; iarg[a++] = p->mqd; /* int */ - uarg[a++] = (intptr_t)p->sigev; /* const struct sigevent * __kerncap */ + uarg[a++] = (intcap_t)p->sigev; /* const struct sigevent * __kerncap */ *n_args = 2; break; } /* kmq_unlink */ case 462: { struct kmq_unlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ *n_args = 1; break; } /* abort2 */ case 463: { struct abort2_args *p = params; - uarg[a++] = (intptr_t)p->why; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->why; /* const char * __kerncap */ iarg[a++] = p->nargs; /* int */ - uarg[a++] = (intptr_t)p->args; /* void * __kerncap * __kerncap */ + uarg[a++] = (intcap_t)p->args; /* void * __kerncap * __kerncap */ *n_args = 3; break; } @@ -2464,7 +2464,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 464: { struct thr_set_name_args *p = params; iarg[a++] = p->id; /* long */ - uarg[a++] = (intptr_t)p->name; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* const char * __kerncap */ *n_args = 2; break; } @@ -2472,7 +2472,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 465: { struct aio_fsync_args *p = params; iarg[a++] = p->op; /* int */ - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb * __kerncap */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb * __kerncap */ *n_args = 2; break; } @@ -2481,7 +2481,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct rtprio_thread_args *p = params; iarg[a++] = p->function; /* int */ iarg[a++] = p->lwpid; /* lwpid_t */ - uarg[a++] = (intptr_t)p->rtp; /* struct rtprio * __kerncap */ + uarg[a++] = (intcap_t)p->rtp; /* struct rtprio * __kerncap */ *n_args = 3; break; } @@ -2497,11 +2497,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 472: { struct sctp_generic_sendmsg_args *p = params; iarg[a++] = p->sd; /* int */ - uarg[a++] = (intptr_t)p->msg; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->msg; /* void * __kerncap */ iarg[a++] = p->mlen; /* int */ - uarg[a++] = (intptr_t)p->to; /* const struct sockaddr * __kerncap */ + uarg[a++] = (intcap_t)p->to; /* const struct sockaddr * __kerncap */ iarg[a++] = p->tolen; /* __socklen_t */ - uarg[a++] = (intptr_t)p->sinfo; /* struct sctp_sndrcvinfo * __kerncap */ + uarg[a++] = (intcap_t)p->sinfo; /* struct sctp_sndrcvinfo * __kerncap */ iarg[a++] = p->flags; /* int */ *n_args = 7; break; @@ -2510,11 +2510,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 473: { struct sctp_generic_sendmsg_iov_args *p = params; iarg[a++] = p->sd; /* int */ - uarg[a++] = (intptr_t)p->iov; /* struct iovec * __kerncap */ + uarg[a++] = (intcap_t)p->iov; /* struct iovec * __kerncap */ iarg[a++] = p->iovlen; /* int */ - uarg[a++] = (intptr_t)p->to; /* const struct sockaddr * __kerncap */ + uarg[a++] = (intcap_t)p->to; /* const struct sockaddr * __kerncap */ iarg[a++] = p->tolen; /* __socklen_t */ - uarg[a++] = (intptr_t)p->sinfo; /* struct sctp_sndrcvinfo * __kerncap */ + uarg[a++] = (intcap_t)p->sinfo; /* struct sctp_sndrcvinfo * __kerncap */ iarg[a++] = p->flags; /* int */ *n_args = 7; break; @@ -2523,12 +2523,12 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 474: { struct sctp_generic_recvmsg_args *p = params; iarg[a++] = p->sd; /* int */ - uarg[a++] = (intptr_t)p->iov; /* struct iovec * __kerncap */ + uarg[a++] = (intcap_t)p->iov; /* struct iovec * __kerncap */ iarg[a++] = p->iovlen; /* int */ - uarg[a++] = (intptr_t)p->from; /* struct sockaddr * __kerncap */ - uarg[a++] = (intptr_t)p->fromlenaddr; /* __socklen_t * __kerncap */ - uarg[a++] = (intptr_t)p->sinfo; /* struct sctp_sndrcvinfo * __kerncap */ - uarg[a++] = (intptr_t)p->msg_flags; /* int * __kerncap */ + uarg[a++] = (intcap_t)p->from; /* struct sockaddr * __kerncap */ + uarg[a++] = (intcap_t)p->fromlenaddr; /* __socklen_t * __kerncap */ + uarg[a++] = (intcap_t)p->sinfo; /* struct sctp_sndrcvinfo * __kerncap */ + uarg[a++] = (intcap_t)p->msg_flags; /* int * __kerncap */ *n_args = 7; break; } @@ -2536,7 +2536,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 475: { struct pread_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* void * __kerncap */ uarg[a++] = p->nbyte; /* size_t */ iarg[a++] = p->offset; /* off_t */ *n_args = 4; @@ -2546,7 +2546,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 476: { struct pwrite_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* const void * __kerncap */ uarg[a++] = p->nbyte; /* size_t */ iarg[a++] = p->offset; /* off_t */ *n_args = 4; @@ -2555,7 +2555,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* mmap */ case 477: { struct mmap_args *p = params; - uarg[a++] = (intptr_t)p->addr; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->addr; /* void * __kerncap */ uarg[a++] = p->len; /* size_t */ iarg[a++] = p->prot; /* int */ iarg[a++] = p->flags; /* int */ @@ -2576,7 +2576,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* truncate */ case 479: { struct truncate_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->length; /* off_t */ *n_args = 2; break; @@ -2601,14 +2601,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* shm_unlink */ case 483: { struct shm_unlink_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ *n_args = 1; break; } /* cpuset */ case 484: { struct cpuset_args *p = params; - uarg[a++] = (intptr_t)p->setid; /* cpusetid_t * __kerncap */ + uarg[a++] = (intcap_t)p->setid; /* cpusetid_t * __kerncap */ *n_args = 1; break; } @@ -2627,7 +2627,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->level; /* cpulevel_t */ iarg[a++] = p->which; /* cpuwhich_t */ iarg[a++] = p->id; /* id_t */ - uarg[a++] = (intptr_t)p->setid; /* cpusetid_t * __kerncap */ + uarg[a++] = (intcap_t)p->setid; /* cpusetid_t * __kerncap */ *n_args = 4; break; } @@ -2638,7 +2638,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->which; /* cpuwhich_t */ iarg[a++] = p->id; /* id_t */ uarg[a++] = p->cpusetsize; /* size_t */ - uarg[a++] = (intptr_t)p->mask; /* cpuset_t * __kerncap */ + uarg[a++] = (intcap_t)p->mask; /* cpuset_t * __kerncap */ *n_args = 5; break; } @@ -2649,7 +2649,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->which; /* cpuwhich_t */ iarg[a++] = p->id; /* id_t */ uarg[a++] = p->cpusetsize; /* size_t */ - uarg[a++] = (intptr_t)p->mask; /* const cpuset_t * __kerncap */ + uarg[a++] = (intcap_t)p->mask; /* const cpuset_t * __kerncap */ *n_args = 5; break; } @@ -2657,7 +2657,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 489: { struct faccessat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->amode; /* int */ iarg[a++] = p->flag; /* int */ *n_args = 4; @@ -2667,7 +2667,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 490: { struct fchmodat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->mode; /* mode_t */ iarg[a++] = p->flag; /* int */ *n_args = 4; @@ -2677,7 +2677,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 491: { struct fchownat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ uarg[a++] = p->uid; /* uid_t */ iarg[a++] = p->gid; /* gid_t */ iarg[a++] = p->flag; /* int */ @@ -2688,8 +2688,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 492: { struct fexecve_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->argv; /* char * __kerncap * __kerncap */ - uarg[a++] = (intptr_t)p->envv; /* char * __kerncap * __kerncap */ + uarg[a++] = (intcap_t)p->argv; /* char * __kerncap * __kerncap */ + uarg[a++] = (intcap_t)p->envv; /* char * __kerncap * __kerncap */ *n_args = 3; break; } @@ -2697,8 +2697,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 494: { struct futimesat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->times; /* const struct timeval * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->times; /* const struct timeval * __kerncap */ *n_args = 3; break; } @@ -2706,9 +2706,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 495: { struct linkat_args *p = params; iarg[a++] = p->fd1; /* int */ - uarg[a++] = (intptr_t)p->path1; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path1; /* const char * __kerncap */ iarg[a++] = p->fd2; /* int */ - uarg[a++] = (intptr_t)p->path2; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path2; /* const char * __kerncap */ iarg[a++] = p->flag; /* int */ *n_args = 5; break; @@ -2717,7 +2717,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 496: { struct mkdirat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->mode; /* mode_t */ *n_args = 3; break; @@ -2726,7 +2726,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 497: { struct mkfifoat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->mode; /* mode_t */ *n_args = 3; break; @@ -2735,7 +2735,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 499: { struct openat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->flag; /* int */ iarg[a++] = p->mode; /* mode_t */ *n_args = 4; @@ -2745,8 +2745,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 500: { struct readlinkat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->buf; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* char * __kerncap */ uarg[a++] = p->bufsize; /* size_t */ *n_args = 4; break; @@ -2755,18 +2755,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 501: { struct renameat_args *p = params; iarg[a++] = p->oldfd; /* int */ - uarg[a++] = (intptr_t)p->old; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->old; /* const char * __kerncap */ iarg[a++] = p->newfd; /* int */ - uarg[a++] = (intptr_t)p->new; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->new; /* const char * __kerncap */ *n_args = 4; break; } /* symlinkat */ case 502: { struct symlinkat_args *p = params; - uarg[a++] = (intptr_t)p->path1; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path1; /* const char * __kerncap */ iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path2; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path2; /* const char * __kerncap */ *n_args = 3; break; } @@ -2774,7 +2774,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 503: { struct unlinkat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->flag; /* int */ *n_args = 3; break; @@ -2789,14 +2789,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* gssd_syscall */ case 505: { struct gssd_syscall_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ *n_args = 1; break; } /* jail_get */ case 506: { struct jail_get_args *p = params; - uarg[a++] = (intptr_t)p->iovp; /* struct iovec * __kerncap */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec * __kerncap */ uarg[a++] = p->iovcnt; /* unsigned int */ iarg[a++] = p->flags; /* int */ *n_args = 3; @@ -2805,7 +2805,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* jail_set */ case 507: { struct jail_set_args *p = params; - uarg[a++] = (intptr_t)p->iovp; /* struct iovec * __kerncap */ + uarg[a++] = (intcap_t)p->iovp; /* struct iovec * __kerncap */ uarg[a++] = p->iovcnt; /* unsigned int */ iarg[a++] = p->flags; /* int */ *n_args = 3; @@ -2824,7 +2824,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->semid; /* int */ iarg[a++] = p->semnum; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->arg; /* union semun * __kerncap */ + uarg[a++] = (intcap_t)p->arg; /* union semun * __kerncap */ *n_args = 4; break; } @@ -2833,7 +2833,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct msgctl_args *p = params; iarg[a++] = p->msqid; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* struct msqid_ds * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* struct msqid_ds * __kerncap */ *n_args = 3; break; } @@ -2842,14 +2842,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct shmctl_args *p = params; iarg[a++] = p->shmid; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* struct shmid_ds * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* struct shmid_ds * __kerncap */ *n_args = 3; break; } /* lpathconf */ case 513: { struct lpathconf_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->name; /* int */ *n_args = 2; break; @@ -2859,7 +2859,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct __cap_rights_get_args *p = params; iarg[a++] = p->version; /* int */ iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->rightsp; /* cap_rights_t * __kerncap */ + uarg[a++] = (intcap_t)p->rightsp; /* cap_rights_t * __kerncap */ *n_args = 3; break; } @@ -2871,14 +2871,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* cap_getmode */ case 517: { struct cap_getmode_args *p = params; - uarg[a++] = (intptr_t)p->modep; /* u_int * __kerncap */ + uarg[a++] = (intcap_t)p->modep; /* u_int * __kerncap */ *n_args = 1; break; } /* pdfork */ case 518: { struct pdfork_args *p = params; - uarg[a++] = (intptr_t)p->fdp; /* int * __kerncap */ + uarg[a++] = (intcap_t)p->fdp; /* int * __kerncap */ iarg[a++] = p->flags; /* int */ *n_args = 2; break; @@ -2895,7 +2895,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 520: { struct pdgetpid_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->pidp; /* pid_t * __kerncap */ + uarg[a++] = (intcap_t)p->pidp; /* pid_t * __kerncap */ *n_args = 2; break; } @@ -2903,18 +2903,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 522: { struct pselect_args *p = params; iarg[a++] = p->nd; /* int */ - uarg[a++] = (intptr_t)p->in; /* fd_set * __kerncap */ - uarg[a++] = (intptr_t)p->ou; /* fd_set * __kerncap */ - uarg[a++] = (intptr_t)p->ex; /* fd_set * __kerncap */ - uarg[a++] = (intptr_t)p->ts; /* const struct timespec * __kerncap */ - uarg[a++] = (intptr_t)p->sm; /* const sigset_t * __kerncap */ + uarg[a++] = (intcap_t)p->in; /* fd_set * __kerncap */ + uarg[a++] = (intcap_t)p->ou; /* fd_set * __kerncap */ + uarg[a++] = (intcap_t)p->ex; /* fd_set * __kerncap */ + uarg[a++] = (intcap_t)p->ts; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->sm; /* const sigset_t * __kerncap */ *n_args = 6; break; } /* getloginclass */ case 523: { struct getloginclass_args *p = params; - uarg[a++] = (intptr_t)p->namebuf; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->namebuf; /* char * __kerncap */ uarg[a++] = p->namelen; /* size_t */ *n_args = 2; break; @@ -2922,16 +2922,16 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* setloginclass */ case 524: { struct setloginclass_args *p = params; - uarg[a++] = (intptr_t)p->namebuf; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->namebuf; /* const char * __kerncap */ *n_args = 1; break; } /* rctl_get_racct */ case 525: { struct rctl_get_racct_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * __kerncap */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->outbufp; /* void * __kerncap */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2939,9 +2939,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* rctl_get_rules */ case 526: { struct rctl_get_rules_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * __kerncap */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->outbufp; /* void * __kerncap */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2949,9 +2949,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* rctl_get_limits */ case 527: { struct rctl_get_limits_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * __kerncap */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->outbufp; /* void * __kerncap */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2959,9 +2959,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* rctl_add_rule */ case 528: { struct rctl_add_rule_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * __kerncap */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->outbufp; /* void * __kerncap */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -2969,9 +2969,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* rctl_remove_rule */ case 529: { struct rctl_remove_rule_args *p = params; - uarg[a++] = (intptr_t)p->inbufp; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->inbufp; /* const void * __kerncap */ uarg[a++] = p->inbuflen; /* size_t */ - uarg[a++] = (intptr_t)p->outbufp; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->outbufp; /* void * __kerncap */ uarg[a++] = p->outbuflen; /* size_t */ *n_args = 4; break; @@ -3000,10 +3000,10 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct wait6_args *p = params; iarg[a++] = p->idtype; /* idtype_t */ iarg[a++] = p->id; /* id_t */ - uarg[a++] = (intptr_t)p->status; /* int * __kerncap */ + uarg[a++] = (intcap_t)p->status; /* int * __kerncap */ iarg[a++] = p->options; /* int */ - uarg[a++] = (intptr_t)p->wrusage; /* struct __wrusage * __kerncap */ - uarg[a++] = (intptr_t)p->info; /* struct __siginfo * __kerncap */ + uarg[a++] = (intcap_t)p->wrusage; /* struct __wrusage * __kerncap */ + uarg[a++] = (intcap_t)p->info; /* struct __siginfo * __kerncap */ *n_args = 6; break; } @@ -3011,7 +3011,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 533: { struct cap_rights_limit_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->rightsp; /* cap_rights_t * __kerncap */ + uarg[a++] = (intcap_t)p->rightsp; /* cap_rights_t * __kerncap */ *n_args = 2; break; } @@ -3019,7 +3019,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 534: { struct cap_ioctls_limit_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->cmds; /* const u_long * __kerncap */ + uarg[a++] = (intcap_t)p->cmds; /* const u_long * __kerncap */ uarg[a++] = p->ncmds; /* size_t */ *n_args = 3; break; @@ -3028,7 +3028,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 535: { struct cap_ioctls_get_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->cmds; /* u_long * __kerncap */ + uarg[a++] = (intcap_t)p->cmds; /* u_long * __kerncap */ uarg[a++] = p->maxcmds; /* size_t */ *n_args = 3; break; @@ -3045,7 +3045,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 537: { struct cap_fcntls_get_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->fcntlrightsp; /* uint32_t * __kerncap */ + uarg[a++] = (intcap_t)p->fcntlrightsp; /* uint32_t * __kerncap */ *n_args = 2; break; } @@ -3054,7 +3054,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct bindat_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* const struct sockaddr * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* const struct sockaddr * __kerncap */ iarg[a++] = p->namelen; /* __socklen_t */ *n_args = 4; break; @@ -3064,7 +3064,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct connectat_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* const struct sockaddr * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* const struct sockaddr * __kerncap */ iarg[a++] = p->namelen; /* __socklen_t */ *n_args = 4; break; @@ -3073,7 +3073,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 540: { struct chflagsat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ uarg[a++] = p->flags; /* u_long */ iarg[a++] = p->atflag; /* int */ *n_args = 4; @@ -3083,8 +3083,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 541: { struct accept4_args *p = params; iarg[a++] = p->s; /* int */ - uarg[a++] = (intptr_t)p->name; /* struct sockaddr * __kerncap */ - uarg[a++] = (intptr_t)p->anamelen; /* __socklen_t * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* struct sockaddr * __kerncap */ + uarg[a++] = (intcap_t)p->anamelen; /* __socklen_t * __kerncap */ iarg[a++] = p->flags; /* int */ *n_args = 4; break; @@ -3092,7 +3092,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* pipe2 */ case 542: { struct pipe2_args *p = params; - uarg[a++] = (intptr_t)p->fildes; /* int * __kerncap */ + uarg[a++] = (intcap_t)p->fildes; /* int * __kerncap */ iarg[a++] = p->flags; /* int */ *n_args = 2; break; @@ -3100,7 +3100,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* aio_mlock */ case 543: { struct aio_mlock_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb * __kerncap */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb * __kerncap */ *n_args = 1; break; } @@ -3110,17 +3110,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->idtype; /* idtype_t */ iarg[a++] = p->id; /* id_t */ iarg[a++] = p->com; /* int */ - uarg[a++] = (intptr_t)p->data; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->data; /* void * __kerncap */ *n_args = 4; break; } /* ppoll */ case 545: { struct ppoll_args *p = params; - uarg[a++] = (intptr_t)p->fds; /* struct pollfd * __kerncap */ + uarg[a++] = (intcap_t)p->fds; /* struct pollfd * __kerncap */ uarg[a++] = p->nfds; /* u_int */ - uarg[a++] = (intptr_t)p->ts; /* const struct timespec * __kerncap */ - uarg[a++] = (intptr_t)p->set; /* const sigset_t * __kerncap */ + uarg[a++] = (intcap_t)p->ts; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->set; /* const sigset_t * __kerncap */ *n_args = 4; break; } @@ -3128,7 +3128,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 546: { struct futimens_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->times; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->times; /* const struct timespec * __kerncap */ *n_args = 2; break; } @@ -3136,8 +3136,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 547: { struct utimensat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->times; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->times; /* const struct timespec * __kerncap */ iarg[a++] = p->flag; /* int */ *n_args = 4; break; @@ -3153,7 +3153,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 551: { struct fstat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->sb; /* struct stat * __kerncap */ + uarg[a++] = (intcap_t)p->sb; /* struct stat * __kerncap */ *n_args = 2; break; } @@ -3161,8 +3161,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 552: { struct fstatat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->buf; /* struct stat * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* struct stat * __kerncap */ iarg[a++] = p->flag; /* int */ *n_args = 4; break; @@ -3170,8 +3170,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* fhstat */ case 553: { struct fhstat_args *p = params; - uarg[a++] = (intptr_t)p->u_fhp; /* const struct fhandle * __kerncap */ - uarg[a++] = (intptr_t)p->sb; /* struct stat * __kerncap */ + uarg[a++] = (intcap_t)p->u_fhp; /* const struct fhandle * __kerncap */ + uarg[a++] = (intcap_t)p->sb; /* struct stat * __kerncap */ *n_args = 2; break; } @@ -3179,17 +3179,17 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 554: { struct getdirentries_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* char * __kerncap */ uarg[a++] = p->count; /* size_t */ - uarg[a++] = (intptr_t)p->basep; /* off_t * __kerncap */ + uarg[a++] = (intcap_t)p->basep; /* off_t * __kerncap */ *n_args = 4; break; } /* statfs */ case 555: { struct statfs_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->buf; /* struct statfs * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* struct statfs * __kerncap */ *n_args = 2; break; } @@ -3197,14 +3197,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 556: { struct fstatfs_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->buf; /* struct statfs * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* struct statfs * __kerncap */ *n_args = 2; break; } /* getfsstat */ case 557: { struct getfsstat_args *p = params; - uarg[a++] = (intptr_t)p->buf; /* struct statfs * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* struct statfs * __kerncap */ iarg[a++] = p->bufsize; /* long */ iarg[a++] = p->mode; /* int */ *n_args = 3; @@ -3213,8 +3213,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* fhstatfs */ case 558: { struct fhstatfs_args *p = params; - uarg[a++] = (intptr_t)p->u_fhp; /* const struct fhandle * __kerncap */ - uarg[a++] = (intptr_t)p->buf; /* struct statfs * __kerncap */ + uarg[a++] = (intcap_t)p->u_fhp; /* const struct fhandle * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* struct statfs * __kerncap */ *n_args = 2; break; } @@ -3222,7 +3222,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 559: { struct mknodat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->mode; /* mode_t */ iarg[a++] = p->dev; /* dev_t */ *n_args = 4; @@ -3232,11 +3232,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 560: { struct kevent_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->changelist; /* const struct kevent * __kerncap */ + uarg[a++] = (intcap_t)p->changelist; /* const struct kevent * __kerncap */ iarg[a++] = p->nchanges; /* int */ - uarg[a++] = (intptr_t)p->eventlist; /* struct kevent * __kerncap */ + uarg[a++] = (intcap_t)p->eventlist; /* struct kevent * __kerncap */ iarg[a++] = p->nevents; /* int */ - uarg[a++] = (intptr_t)p->timeout; /* const struct timespec * __kerncap */ + uarg[a++] = (intcap_t)p->timeout; /* const struct timespec * __kerncap */ *n_args = 6; break; } @@ -3247,8 +3247,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->which; /* cpuwhich_t */ iarg[a++] = p->id; /* id_t */ uarg[a++] = p->domainsetsize; /* size_t */ - uarg[a++] = (intptr_t)p->mask; /* domainset_t * __kerncap */ - uarg[a++] = (intptr_t)p->policy; /* int * __kerncap */ + uarg[a++] = (intcap_t)p->mask; /* domainset_t * __kerncap */ + uarg[a++] = (intcap_t)p->policy; /* int * __kerncap */ *n_args = 6; break; } @@ -3259,7 +3259,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->which; /* cpuwhich_t */ iarg[a++] = p->id; /* id_t */ uarg[a++] = p->domainsetsize; /* size_t */ - uarg[a++] = (intptr_t)p->mask; /* domainset_t * __kerncap */ + uarg[a++] = (intcap_t)p->mask; /* domainset_t * __kerncap */ iarg[a++] = p->policy; /* int */ *n_args = 6; break; @@ -3267,7 +3267,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* getrandom */ case 563: { struct getrandom_args *p = params; - uarg[a++] = (intptr_t)p->buf; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* void * __kerncap */ uarg[a++] = p->buflen; /* size_t */ uarg[a++] = p->flags; /* unsigned int */ *n_args = 3; @@ -3277,8 +3277,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 564: { struct getfhat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* char * __kerncap */ - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * __kerncap */ iarg[a++] = p->flags; /* int */ *n_args = 4; break; @@ -3286,25 +3286,25 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* fhlink */ case 565: { struct fhlink_args *p = params; - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * __kerncap */ - uarg[a++] = (intptr_t)p->to; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * __kerncap */ + uarg[a++] = (intcap_t)p->to; /* const char * __kerncap */ *n_args = 2; break; } /* fhlinkat */ case 566: { struct fhlinkat_args *p = params; - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * __kerncap */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * __kerncap */ iarg[a++] = p->tofd; /* int */ - uarg[a++] = (intptr_t)p->to; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->to; /* const char * __kerncap */ *n_args = 3; break; } /* fhreadlink */ case 567: { struct fhreadlink_args *p = params; - uarg[a++] = (intptr_t)p->fhp; /* struct fhandle * __kerncap */ - uarg[a++] = (intptr_t)p->buf; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->fhp; /* struct fhandle * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* char * __kerncap */ uarg[a++] = p->bufsize; /* size_t */ *n_args = 3; break; @@ -3313,7 +3313,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 568: { struct funlinkat_args *p = params; iarg[a++] = p->dfd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->fd; /* int */ iarg[a++] = p->flag; /* int */ *n_args = 4; @@ -3323,9 +3323,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 569: { struct copy_file_range_args *p = params; iarg[a++] = p->infd; /* int */ - uarg[a++] = (intptr_t)p->inoffp; /* off_t * __kerncap */ + uarg[a++] = (intcap_t)p->inoffp; /* off_t * __kerncap */ iarg[a++] = p->outfd; /* int */ - uarg[a++] = (intptr_t)p->outoffp; /* off_t * __kerncap */ + uarg[a++] = (intcap_t)p->outoffp; /* off_t * __kerncap */ uarg[a++] = p->len; /* size_t */ uarg[a++] = p->flags; /* unsigned int */ *n_args = 6; @@ -3334,11 +3334,11 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* __sysctlbyname */ case 570: { struct __sysctlbyname_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* const char * __kerncap */ uarg[a++] = p->namelen; /* size_t */ - uarg[a++] = (intptr_t)p->old; /* void * __kerncap */ - uarg[a++] = (intptr_t)p->oldlenp; /* size_t * __kerncap */ - uarg[a++] = (intptr_t)p->new; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->old; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->oldlenp; /* size_t * __kerncap */ + uarg[a++] = (intcap_t)p->new; /* void * __kerncap */ uarg[a++] = p->newlen; /* size_t */ *n_args = 6; break; @@ -3346,19 +3346,19 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* shm_open2 */ case 571: { struct shm_open2_args *p = params; - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ iarg[a++] = p->flags; /* int */ iarg[a++] = p->mode; /* mode_t */ iarg[a++] = p->shmflags; /* int */ - uarg[a++] = (intptr_t)p->name; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* const char * __kerncap */ *n_args = 5; break; } /* shm_rename */ case 572: { struct shm_rename_args *p = params; - uarg[a++] = (intptr_t)p->path_from; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->path_to; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path_from; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path_to; /* const char * __kerncap */ iarg[a++] = p->flags; /* int */ *n_args = 3; break; @@ -3367,7 +3367,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 573: { struct sigfastblock_args *p = params; iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->ptr; /* void * __kerncap */ + uarg[a++] = (intcap_t)p->ptr; /* void * __kerncap */ *n_args = 2; break; } @@ -3375,8 +3375,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 574: { struct __realpathat_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ - uarg[a++] = (intptr_t)p->buf; /* char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->buf; /* char * __kerncap */ uarg[a++] = p->size; /* size_t */ iarg[a++] = p->flags; /* int */ *n_args = 5; @@ -3395,7 +3395,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 576: { struct rpctls_syscall_args *p = params; iarg[a++] = p->op; /* int */ - uarg[a++] = (intptr_t)p->path; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->path; /* const char * __kerncap */ *n_args = 2; break; } @@ -3403,7 +3403,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 577: { struct __specialfd_args *p = params; iarg[a++] = p->type; /* int */ - uarg[a++] = (intptr_t)p->req; /* const void * __kerncap */ + uarg[a++] = (intcap_t)p->req; /* const void * __kerncap */ uarg[a++] = p->len; /* size_t */ *n_args = 3; break; @@ -3411,14 +3411,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* aio_writev */ case 578: { struct aio_writev_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb * __kerncap */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb * __kerncap */ *n_args = 1; break; } /* aio_readv */ case 579: { struct aio_readv_args *p = params; - uarg[a++] = (intptr_t)p->aiocbp; /* struct aiocb * __kerncap */ + uarg[a++] = (intcap_t)p->aiocbp; /* struct aiocb * __kerncap */ *n_args = 1; break; } @@ -3427,9 +3427,9 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct fspacectl_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->cmd; /* int */ - uarg[a++] = (intptr_t)p->rqsr; /* const struct spacectl_range * __kerncap */ + uarg[a++] = (intcap_t)p->rqsr; /* const struct spacectl_range * __kerncap */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->rmsr; /* struct spacectl_range * __kerncap */ + uarg[a++] = (intcap_t)p->rmsr; /* struct spacectl_range * __kerncap */ *n_args = 5; break; } @@ -3441,7 +3441,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) /* swapoff */ case 582: { struct swapoff_args *p = params; - uarg[a++] = (intptr_t)p->name; /* const char * __kerncap */ + uarg[a++] = (intcap_t)p->name; /* const char * __kerncap */ uarg[a++] = p->flags; /* u_int */ *n_args = 2; break; @@ -3474,7 +3474,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) case 586: { struct timerfd_gettime_args *p = params; iarg[a++] = p->fd; /* int */ - uarg[a++] = (intptr_t)p->curr_value; /* struct itimerspec * __kerncap */ + uarg[a++] = (intcap_t)p->curr_value; /* struct itimerspec * __kerncap */ *n_args = 2; break; } @@ -3483,8 +3483,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct timerfd_settime_args *p = params; iarg[a++] = p->fd; /* int */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->new_value; /* const struct itimerspec * __kerncap */ - uarg[a++] = (intptr_t)p->old_value; /* struct itimerspec * __kerncap */ + uarg[a++] = (intcap_t)p->new_value; /* const struct itimerspec * __kerncap */ + uarg[a++] = (intcap_t)p->old_value; /* struct itimerspec * __kerncap */ *n_args = 4; break; } @@ -3494,8 +3494,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) iarg[a++] = p->pid1; /* pid_t */ iarg[a++] = p->pid2; /* pid_t */ iarg[a++] = p->type; /* int */ - uarg[a++] = (intptr_t)p->idx1; /* uintcap_t */ - uarg[a++] = (intptr_t)p->idx2; /* uintcap_t */ + uarg[a++] = (intcap_t)p->idx1; /* uintcap_t */ + uarg[a++] = (intcap_t)p->idx2; /* uintcap_t */ *n_args = 5; break; } @@ -3504,7 +3504,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) struct getrlimitusage_args *p = params; uarg[a++] = p->which; /* u_int */ iarg[a++] = p->flags; /* int */ - uarg[a++] = (intptr_t)p->res; /* rlim_t * __kerncap */ + uarg[a++] = (intcap_t)p->res; /* rlim_t * __kerncap */ *n_args = 3; break; } From ac8492fd8a07e54483c1a9309e1f7a71641a8d18 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 23 Jan 2025 16:07:38 +0000 Subject: [PATCH 22/47] sdt: Fix format strings for uintptr_t --- sys/arm64/arm64/sdt_machdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/sdt_machdep.c b/sys/arm64/arm64/sdt_machdep.c index 23324ffbf333..ad1044bd2c32 100644 --- a/sys/arm64/arm64/sdt_machdep.c +++ b/sys/arm64/arm64/sdt_machdep.c @@ -48,8 +48,8 @@ sdt_tracepoint_patch(uintptr_t patchpoint, uintptr_t target) uint32_t instr; KASSERT(sdt_tracepoint_valid(patchpoint, target), - ("%s: invalid tracepoint %#lx -> %#lx", - __func__, patchpoint, target)); + ("%s: invalid tracepoint %#jx -> %#jx", + __func__, (uintmax_t)patchpoint, (uintmax_t)target)); if (!arm64_get_writable_addr((void *)patchpoint, &addr)) panic("%s: Unable to write new instruction", __func__); From 5eea5d2c675ed3f5c085f320421e4b89fd343dc6 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Thu, 23 Jan 2025 16:08:24 +0000 Subject: [PATCH 23/47] kinst: Use a vm_pointer_t to store a trampoine address --- sys/cddl/dev/kinst/trampoline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cddl/dev/kinst/trampoline.c b/sys/cddl/dev/kinst/trampoline.c index adc4eaa7fceb..edc69cd649b4 100644 --- a/sys/cddl/dev/kinst/trampoline.c +++ b/sys/cddl/dev/kinst/trampoline.c @@ -73,7 +73,7 @@ static struct trampchunk * kinst_trampchunk_alloc(void) { struct trampchunk *chunk; - vm_offset_t trampaddr; + vm_pointer_t trampaddr; int error __diagused; sx_assert(&kinst_tramp_sx, SX_XLOCKED); From ad51be473ea9fad0bc44badb30fe86a51e32055c Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Fri, 24 Jan 2025 02:03:09 +0000 Subject: [PATCH 24/47] dtrace: Cast to ptraddr_t instead of uintptr_t where appropriate --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 7613e50db913..60a0bf13548a 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -500,7 +500,7 @@ static kmutex_t dtrace_errlock; #define DTRACE_RANGE_REMAIN(remp, addr, baseaddr, basesz) \ do { \ if ((remp) != NULL) { \ - *(remp) = (uintptr_t)(baseaddr) + (basesz) - (addr); \ + *(remp) = (ptraddr_t)(baseaddr) + (basesz) - (addr); \ } \ } while (0) @@ -6037,7 +6037,8 @@ inetout: regs[rd] = (uintptr_t)end + 1; case DIF_SUBR_MEMREF: { uintptr_t size = 2 * sizeof(uintptr_t); uintptr_t *memref = (uintptr_t *) P2ROUNDUP(mstate->dtms_scratch_ptr, sizeof(uintptr_t)); - size_t scratch_size = ((uintptr_t) memref - mstate->dtms_scratch_ptr) + size; + size_t scratch_size = ((ptraddr_t) memref - + (ptraddr_t) mstate->dtms_scratch_ptr) + size; /* address and length */ memref[0] = tupregs[0].dttk_value; @@ -6910,7 +6911,7 @@ dtrace_action_breakpoint(dtrace_ecb_t *ecb) char *msg = "dtrace: breakpoint action at probe "; char *ecbmsg = " (ecb "; uintptr_t val = (uintptr_t)ecb; - int shift = (sizeof (uintptr_t) * NBBY) - 4, i = 0; + int shift = (sizeof (ptraddr_t) * NBBY) - 4, i = 0; if (dtrace_destructive_disallow) return; From e0a289f68efecf7467cad4f44600a6af59a089c6 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Fri, 24 Jan 2025 02:03:29 +0000 Subject: [PATCH 25/47] dtrace: Make fuword* and copy(in|out) wrappers capability aware - Make dtrace_fuword* operate on a capability, even in hybrid kernels. - Add dtrace_fucap(), used to implement ustack(). - Make assembly subroutines, e.g., dtrace_casptr(), work in purecap kernels. --- .../opensolaris/uts/common/dtrace/dtrace.c | 34 ++++---- .../opensolaris/uts/common/sys/dtrace_impl.h | 19 +++-- sys/cddl/dev/dtrace/aarch64/dtrace_asm.S | 85 ++++++++++++++++--- sys/cddl/dev/dtrace/aarch64/dtrace_isa.c | 64 +++++++++----- 4 files changed, 143 insertions(+), 59 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 60a0bf13548a..0373c024c412 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -6312,44 +6312,44 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, break; case DIF_OP_ULDSB: DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - regs[rd] = (int8_t) - dtrace_fuword8((void *)(uintptr_t)regs[r1]); + regs[rd] = (int8_t)dtrace_fuword8( + (void * __capability)(uintptr_t)regs[r1]); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); break; case DIF_OP_ULDSH: DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - regs[rd] = (int16_t) - dtrace_fuword16((void *)(uintptr_t)regs[r1]); + regs[rd] = (int16_t)dtrace_fuword16( + (void * __capability)(uintptr_t)regs[r1]); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); break; case DIF_OP_ULDSW: DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - regs[rd] = (int32_t) - dtrace_fuword32((void *)(uintptr_t)regs[r1]); + regs[rd] = (int32_t)dtrace_fuword32( + (void * __capability)(uintptr_t)regs[r1]); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); break; case DIF_OP_ULDUB: DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - regs[rd] = - dtrace_fuword8((void *)(uintptr_t)regs[r1]); + regs[rd] = dtrace_fuword8( + (void * __capability)(uintptr_t)regs[r1]); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); break; case DIF_OP_ULDUH: DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - regs[rd] = - dtrace_fuword16((void *)(uintptr_t)regs[r1]); + regs[rd] = dtrace_fuword16( + (void * __capability)(uintptr_t)regs[r1]); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); break; case DIF_OP_ULDUW: DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - regs[rd] = - dtrace_fuword32((void *)(uintptr_t)regs[r1]); + regs[rd] = dtrace_fuword32( + (void * __capability)(uintptr_t)regs[r1]); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); break; case DIF_OP_ULDX: DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - regs[rd] = - dtrace_fuword64((void *)(uintptr_t)regs[r1]); + regs[rd] = dtrace_fuword64( + (void * __capability)(uintptr_t)regs[r1]); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); break; case DIF_OP_RET: @@ -7238,7 +7238,8 @@ dtrace_store_by_ref(dtrace_difo_t *dp, caddr_t tomax, size_t size, c = dtrace_load8(val++); } else if (c != '\0' && dtkind == DIF_TF_BYUREF) { DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - c = dtrace_fuword8((void *)(uintptr_t)val++); + c = dtrace_fuword8( + (void * __capability)(uintptr_t)val++); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); if (*flags & CPU_DTRACE_FAULT) break; @@ -7256,7 +7257,8 @@ dtrace_store_by_ref(dtrace_difo_t *dp, caddr_t tomax, size_t size, c = dtrace_load8(val++); } else if (dtkind == DIF_TF_BYUREF) { DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - c = dtrace_fuword8((void *)(uintptr_t)val++); + c = dtrace_fuword8( + (void * __capability)(uintptr_t)val++); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); if (*flags & CPU_DTRACE_FAULT) break; diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h index 222f8e206da1..2711efd41ef4 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h @@ -1282,10 +1282,10 @@ extern int dtrace_getipl(void); extern uintptr_t dtrace_caller(int); extern uint32_t dtrace_cas32(uint32_t *, uint32_t, uint32_t); extern void *dtrace_casptr(volatile void *, volatile void *, volatile void *); -extern void dtrace_copyin(uintptr_t, uintptr_t, size_t, volatile uint16_t *); -extern void dtrace_copyinstr(uintptr_t, uintptr_t, size_t, volatile uint16_t *); -extern void dtrace_copyout(uintptr_t, uintptr_t, size_t, volatile uint16_t *); -extern void dtrace_copyoutstr(uintptr_t, uintptr_t, size_t, +extern void dtrace_copyin(uintcap_t, uintptr_t, size_t, volatile uint16_t *); +extern void dtrace_copyinstr(uintcap_t, uintptr_t, size_t, volatile uint16_t *); +extern void dtrace_copyout(uintptr_t, uintcap_t, size_t, volatile uint16_t *); +extern void dtrace_copyoutstr(uintptr_t, uintcap_t, size_t, volatile uint16_t *); extern void dtrace_getpcstack(pc_t *, int, int, uint32_t *); extern ulong_t dtrace_getreg(struct trapframe *, uint_t); @@ -1294,10 +1294,13 @@ extern void dtrace_getupcstack(uint64_t *, int); extern void dtrace_getufpstack(uint64_t *, uint64_t *, int); extern int dtrace_getustackdepth(void); extern uintptr_t dtrace_fulword(void *); -extern uint8_t dtrace_fuword8(void *); -extern uint16_t dtrace_fuword16(void *); -extern uint32_t dtrace_fuword32(void *); -extern uint64_t dtrace_fuword64(void *); +extern uint8_t dtrace_fuword8(void * __capability); +extern uint16_t dtrace_fuword16(void * __capability); +extern uint32_t dtrace_fuword32(void * __capability); +extern uint64_t dtrace_fuword64(void * __capability); +#if __has_feature(capabilities) +extern uintcap_t dtrace_fucap(void * __capability); +#endif extern void dtrace_probe_error(dtrace_state_t *, dtrace_epid_t, int, int, int, uintptr_t); extern int dtrace_assfail(const char *, const char *, int); diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S b/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S index a934733251a3..deba89d3fe59 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_asm.S @@ -68,53 +68,102 @@ ENTRY(dtrace_interrupt_enable) END(dtrace_interrupt_enable) /* uint8_t -dtrace_fuword8_nocheck(void *addr) +dtrace_fuword8_nocheck(void * __capability addr) */ ENTRY(dtrace_fuword8_nocheck) +#if __has_feature(capabilities) + ENTER_C64 + ldtrb w0, [c0] + EXIT_C64 +#else ldtrb w0, [x0] +#endif RET END(dtrace_fuword8_nocheck) /* uint16_t -dtrace_fuword16_nocheck(void *addr) +dtrace_fuword16_nocheck(void * __capability addr) */ ENTRY(dtrace_fuword16_nocheck) +#if __has_feature(capabilities) + ENTER_C64 + ldtrh w0, [c0] + EXIT_C64 +#else ldtrh w0, [x0] +#endif RET END(dtrace_fuword16_nocheck) /* uint32_t -dtrace_fuword32_nocheck(void *addr) +dtrace_fuword32_nocheck(void * __capability addr) */ ENTRY(dtrace_fuword32_nocheck) +#if __has_feature(capabilities) + ENTER_C64 + ldtr w0, [c0] + EXIT_C64 +#else ldtr w0, [x0] +#endif RET END(dtrace_fuword32_nocheck) /* uint64_t -dtrace_fuword64_nocheck(void *addr) +dtrace_fuword64_nocheck(void * __capability addr) */ ENTRY(dtrace_fuword64_nocheck) +#if __has_feature(capabilities) + ENTER_C64 + ldtr x0, [c0] + EXIT_C64 +#else ldtr x0, [x0] +#endif RET END(dtrace_fuword64_nocheck) +#if __has_feature(capabilities) +/* +uintcap_t +dtrace_fuwordcap_nocheck(void * __capability addr) +*/ +ENTRY(dtrace_fucap_nocheck) + ENTER_C64 + ldtr c0, [c0] + EXIT_C64 + RET +END(dtrace_fucap_nocheck) +#endif + /* void dtrace_copy(uintptr_t uaddr, uintptr_t kaddr, size_t size) */ ENTRY(dtrace_copy) cbz x2, 2f /* If len == 0 then skip loop */ + ENTER_C64 +#if __has_feature(capabilities) && !defined(__CHERI_PURE_CAPABILITY__) + cvtd c1, x1 /* Store through a capability */ + scbnds c1, c1, x2 /* Set the bounds */ +#endif 1: +#if __has_feature(capabilities) + ldtrb w4, [c0] /* Load from uaddr */ + add c0, c0, #1 + strb w4, [c1], #1 /* Store in kaddr */ +#else ldtrb w4, [x0] /* Load from uaddr */ add x0, x0, #1 strb w4, [x1], #1 /* Store in kaddr */ +#endif sub x2, x2, #1 /* len-- */ cbnz x2, 1b 2: + EXIT_C64 RET END(dtrace_copy) @@ -126,14 +175,26 @@ XXX: Check for flags? */ ENTRY(dtrace_copystr) cbz x2, 2f /* If len == 0 then skip loop */ + ENTER_C64 +#if __has_feature(capabilities) && !defined(__CHERI_PURE_CAPABILITY__) + cvtd c1, x1 /* Store through a capability */ + scbnds c1, c1, x2 /* Set the bounds */ +#endif 1: +#if __has_feature(capabilities) + ldtrb w4, [c0] /* Load from uaddr */ + add c0, c0, #1 + strb w4, [c1], #1 /* Store in kaddr */ +#else ldtrb w4, [x0] /* Load from uaddr */ add x0, x0, #1 strb w4, [x1], #1 /* Store in kaddr */ +#endif cbz w4, 2f /* If == 0 then break */ sub x2, x2, #1 /* len-- */ cbnz x2, 1b 2: + EXIT_C64 RET END(dtrace_copystr) @@ -151,10 +212,10 @@ uint32_t dtrace_cas32(uint32_t *target, uint32_t cmp, uint32_t new) */ ENTRY(dtrace_cas32) -1: ldxr w3, [x0] /* Load target */ +1: ldxr w3, [PTR(0)] /* Load target */ cmp w3, w1 /* Check if *target == cmp */ bne 2f /* No, return */ - stxr w12, w2, [x0] /* Store new to target */ + stxr w12, w2, [PTR(0)] /* Store new to target */ cbnz w12, 1b /* Try again if store not succeed */ 2: mov w0, w3 /* Return the value loaded from target */ RET @@ -165,12 +226,12 @@ void * dtrace_casptr(volatile void *target, volatile void *cmp, volatile void *new) */ ENTRY(dtrace_casptr) -1: ldxr x3, [x0] /* Load target */ - cmp x3, x1 /* Check if *target == cmp */ - bne 2f /* No, return */ - stxr w12, x2, [x0] /* Store new to target */ - cbnz w12, 1b /* Try again if store not succeed */ -2: mov x0, x3 /* Return the value loaded from target */ +1: ldxr PTR(3), [PTR(0)] /* Load target */ + cmp PTR(3), PTR(1) /* Check if *target == cmp */ + bne 2f /* No, return */ + stxr w12, PTR(2), [PTR(0)] /* Store new to target */ + cbnz w12, 1b /* Try again if store not succeed */ +2: mov PTR(0), PTR(3) /* Return the value loaded from target */ RET END(dtrace_casptr) diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c index ff0e068006bd..14c99f85590d 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c @@ -53,10 +53,13 @@ #define MAX_USTACK_DEPTH 2048 -uint8_t dtrace_fuword8_nocheck(void *); -uint16_t dtrace_fuword16_nocheck(void *); -uint32_t dtrace_fuword32_nocheck(void *); -uint64_t dtrace_fuword64_nocheck(void *); +uint8_t dtrace_fuword8_nocheck(void * __capability); +uint16_t dtrace_fuword16_nocheck(void * __capability); +uint32_t dtrace_fuword32_nocheck(void * __capability); +uint64_t dtrace_fuword64_nocheck(void * __capability); +#if __has_feature(capabilities) +uintcap_t dtrace_fucap_nocheck(void * __capability); +#endif void dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, @@ -133,9 +136,9 @@ dtrace_getustack_common(uint64_t *pcstack, int pcstack_limit, uintptr_t pc, if (fp == 0) break; - pc = dtrace_fuword64((void *)(fp + + pc = dtrace_fuword64((void * __capability)(fp + offsetof(struct unwind_state, pc))); - fp = dtrace_fuword64((void *)fp); + fp = dtrace_fuword64((void * __capability)fp); if (fp == oldfp) { *flags |= CPU_DTRACE_BADSTACK; @@ -321,7 +324,7 @@ dtrace_getreg(struct trapframe *frame, uint_t reg) } static int -dtrace_copycheck(uintptr_t uaddr, uintptr_t kaddr, size_t size) +dtrace_copycheck(uintcap_t uaddr, uintptr_t kaddr, size_t size) { if (uaddr + size > VM_MAXUSER_ADDRESS || uaddr + size < uaddr) { @@ -334,7 +337,7 @@ dtrace_copycheck(uintptr_t uaddr, uintptr_t kaddr, size_t size) } void -dtrace_copyin(uintptr_t uaddr, uintptr_t kaddr, size_t size, +dtrace_copyin(uintcap_t uaddr, uintptr_t kaddr, size_t size, volatile uint16_t *flags) { @@ -343,7 +346,7 @@ dtrace_copyin(uintptr_t uaddr, uintptr_t kaddr, size_t size, } void -dtrace_copyout(uintptr_t kaddr, uintptr_t uaddr, size_t size, +dtrace_copyout(uintptr_t kaddr, uintcap_t uaddr, size_t size, volatile uint16_t *flags) { @@ -352,7 +355,7 @@ dtrace_copyout(uintptr_t kaddr, uintptr_t uaddr, size_t size, } void -dtrace_copyinstr(uintptr_t uaddr, uintptr_t kaddr, size_t size, +dtrace_copyinstr(uintcap_t uaddr, uintptr_t kaddr, size_t size, volatile uint16_t *flags) { @@ -361,7 +364,7 @@ dtrace_copyinstr(uintptr_t uaddr, uintptr_t kaddr, size_t size, } void -dtrace_copyoutstr(uintptr_t kaddr, uintptr_t uaddr, size_t size, +dtrace_copyoutstr(uintptr_t kaddr, uintcap_t uaddr, size_t size, volatile uint16_t *flags) { @@ -370,12 +373,12 @@ dtrace_copyoutstr(uintptr_t kaddr, uintptr_t uaddr, size_t size, } uint8_t -dtrace_fuword8(void *uaddr) +dtrace_fuword8(void * __capability uaddr) { - if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + if ((uintcap_t)uaddr > VM_MAXUSER_ADDRESS) { DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); - cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + cpu_core[curcpu].cpuc_dtrace_illval = (uintcap_t)uaddr; return (0); } @@ -383,12 +386,12 @@ dtrace_fuword8(void *uaddr) } uint16_t -dtrace_fuword16(void *uaddr) +dtrace_fuword16(void * __capability uaddr) { - if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + if ((uintcap_t)uaddr > VM_MAXUSER_ADDRESS) { DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); - cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + cpu_core[curcpu].cpuc_dtrace_illval = (uintcap_t)uaddr; return (0); } @@ -396,12 +399,12 @@ dtrace_fuword16(void *uaddr) } uint32_t -dtrace_fuword32(void *uaddr) +dtrace_fuword32(void * __capability uaddr) { - if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + if ((uintcap_t)uaddr > VM_MAXUSER_ADDRESS) { DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); - cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + cpu_core[curcpu].cpuc_dtrace_illval = (uintcap_t)uaddr; return (0); } @@ -409,14 +412,29 @@ dtrace_fuword32(void *uaddr) } uint64_t -dtrace_fuword64(void *uaddr) +dtrace_fuword64(void * __capability uaddr) { - if ((uintptr_t)uaddr > VM_MAXUSER_ADDRESS) { + if ((uintcap_t)uaddr > VM_MAXUSER_ADDRESS) { DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); - cpu_core[curcpu].cpuc_dtrace_illval = (uintptr_t)uaddr; + cpu_core[curcpu].cpuc_dtrace_illval = (uintcap_t)uaddr; return (0); } return (dtrace_fuword64_nocheck(uaddr)); } + +#if __has_feature(capabilities) +uintcap_t +dtrace_fucap(void * __capability uaddr) +{ + + if ((uintcap_t)uaddr > VM_MAXUSER_ADDRESS) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = (uintcap_t)uaddr; + return (0); + } + + return (dtrace_fucap_nocheck(uaddr)); +} +#endif From ff2ccfafa05f643ecba8b36c7a4c15a565f19c1b Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Fri, 24 Jan 2025 02:35:59 +0000 Subject: [PATCH 26/47] dtrace: Avoid applying subobject bounds in dtrace_ecb_aggregation_create() --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 0373c024c412..170503a13ff1 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -11480,7 +11480,7 @@ dtrace_ecb_aggregation_create(dtrace_ecb_t *ecb, dtrace_actdesc_t *desc) act->dta_intuple = 1; } - return (&agg->dtag_action); + return ((dtrace_action_t *) agg); } static void From 3f45c07cba174ba66b5829d2faa2857a4a5af260 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Fri, 24 Jan 2025 02:51:14 +0000 Subject: [PATCH 27/47] libdtrace: Add a new data model for CHERI The P128 model is used for purecap targets instead of LP64. It's identical to LP64 except, of course, that pointers are 128 bits wide. --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.c | 24 +++++++++-- .../contrib/opensolaris/common/ctf/ctf_open.c | 1 + .../opensolaris/lib/libdtrace/common/dt_dof.c | 4 +- .../lib/libdtrace/common/dt_module.c | 40 +++++++++++++++---- .../lib/libdtrace/common/dt_open.c | 5 ++- .../lib/libdtrace/common/dt_printf.c | 3 +- .../opensolaris/lib/libdtrace/common/dtrace.h | 5 ++- .../opensolaris/uts/common/dtrace/dtrace.c | 3 +- .../opensolaris/uts/common/sys/ctf_api.h | 5 +++ .../opensolaris/uts/common/sys/dtrace.h | 1 + 10 files changed, 74 insertions(+), 17 deletions(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c index 162224478ec0..58c84b7737c1 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c @@ -54,6 +54,7 @@ #ifdef __FreeBSD__ #include #include +#include #endif #undef NORETURN /* needed because libxo redefines it */ @@ -81,7 +82,7 @@ typedef struct dtrace_cmd { #define E_USAGE 2 static const char DTRACE_OPTSTR[] = - "3:6:aAb:Bc:CdD:ef:FGhHi:I:lL:m:n:o:Op:P:qs:SU:vVwx:X:Z"; + "1:3:6:aAb:Bc:CdD:ef:FGhHi:I:lL:m:n:o:Op:P:qs:SU:vVwx:X:Z"; static char **g_argv; static int g_argc; @@ -150,7 +151,8 @@ usage(FILE *fp) (void) fprintf(fp, "\n" "\t-32 generate 32-bit D programs and ELF files\n" - "\t-64 generate 64-bit D programs and ELF files\n\n" + "\t-64 generate 64-bit D programs and ELF files\n" + "\t-128 generate 64-bit, 128-bit pointer D programs and ELF files\n\n" "\t-a claim anonymous tracing state\n" "\t-A generate driver.conf(4) directives for anonymous tracing\n" "\t-b set trace buffer size\n" @@ -1371,6 +1373,16 @@ main(int argc, char *argv[]) for (optind = 1; optind < argc; optind++) { while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != -1) { switch (c) { + case '1': + if (strcmp(optarg, "128") != 0) { + (void) fprintf(stderr, + "%s: illegal option -- 1%s\n", + argv[0], optarg); + return (usage(stderr)); + } + g_oflags &= ~DTRACE_O_MODEL_MASK; + g_oflags |= DTRACE_O_P128; + break; case '3': if (strcmp(optarg, "2") != 0) { (void) fprintf(stderr, @@ -1490,9 +1502,13 @@ main(int argc, char *argv[]) fatal("can't mix 32-bit and 64-bit " "object files\n"); } - g_oflags |= DTRACE_O_LP64; + if (ELF_IS_CHERI(&ehdr)) + g_oflags |= DTRACE_O_P128; + else + g_oflags |= DTRACE_O_LP64; } else if (ehdr.e_ident[EI_CLASS] == ELFCLASS32) { - if (g_oflags & DTRACE_O_LP64) { + if (g_oflags & + (DTRACE_O_LP64 | DTRACE_O_P128)) { fatal("can't mix 32-bit and 64-bit " "object files\n"); } diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_open.c b/cddl/contrib/opensolaris/common/ctf/ctf_open.c index cdc3e2f028fe..a5173a233746 100644 --- a/cddl/contrib/opensolaris/common/ctf/ctf_open.c +++ b/cddl/contrib/opensolaris/common/ctf/ctf_open.c @@ -35,6 +35,7 @@ static const ctf_dmodel_t _libctf_models[] = { { "ILP32", CTF_MODEL_ILP32, 4, 1, 2, 4, 4 }, { "LP64", CTF_MODEL_LP64, 8, 1, 2, 4, 8 }, + { "P128", CTF_MODEL_P128, 16, 1, 2, 4, 8 }, { NULL, 0, 0, 0, 0, 0, 0 } }; diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c index 92ea48214b03..9a80cdf0a99e 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c @@ -601,7 +601,9 @@ dof_hdr(dtrace_hdl_t *dtp, uint8_t dofversion, dof_hdr_t *hp) hp->dofh_ident[DOF_ID_MAG2] = DOF_MAG_MAG2; hp->dofh_ident[DOF_ID_MAG3] = DOF_MAG_MAG3; - if (dtp->dt_conf.dtc_ctfmodel == CTF_MODEL_LP64) + if (dtp->dt_conf.dtc_ctfmodel == CTF_MODEL_P128) + hp->dofh_ident[DOF_ID_MODEL] = DOF_MODEL_P128; + else if (dtp->dt_conf.dtc_ctfmodel == CTF_MODEL_LP64) hp->dofh_ident[DOF_ID_MODEL] = DOF_MODEL_LP64; else hp->dofh_ident[DOF_ID_MODEL] = DOF_MODEL_ILP32; diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c index 5c1af673f5a7..ec4c75c995d1 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c @@ -476,6 +476,17 @@ static const dt_modops_t dt_modops_64 = { .do_symaddr = dt_module_symaddr64 }; +/* + * ELF symbols are the same in CHERI, but we use a separate table so that + * there's a 1-1 correspondance with data models. + */ +static const dt_modops_t dt_modops_128 = { + .do_syminit = dt_module_syminit64, + .do_symsort = dt_module_symsort64, + .do_symname = dt_module_symname64, + .do_symaddr = dt_module_symaddr64 +}; + dt_module_t * dt_module_create(dtrace_hdl_t *dtp, const char *name) { @@ -500,10 +511,17 @@ dt_module_create(dtrace_hdl_t *dtp, const char *name) dtp->dt_mods[h] = dmp; dtp->dt_nmods++; - if (dtp->dt_conf.dtc_ctfmodel == CTF_MODEL_LP64) + switch (dtp->dt_conf.dtc_ctfmodel) { + case CTF_MODEL_P128: + dmp->dm_ops = &dt_modops_128; + break; + case CTF_MODEL_LP64: dmp->dm_ops = &dt_modops_64; - else + break; + default: dmp->dm_ops = &dt_modops_32; + break; + } /* * Modules for userland processes are special. They always refer to a @@ -791,7 +809,8 @@ dt_module_load(dtrace_hdl_t *dtp, dt_module_t *dmp) dmp->dm_symtab.cts_flags = 0; dmp->dm_symtab.cts_data = NULL; dmp->dm_symtab.cts_size = 0; - dmp->dm_symtab.cts_entsize = dmp->dm_ops == &dt_modops_64 ? + dmp->dm_symtab.cts_entsize = + (dmp->dm_ops == &dt_modops_64 || dmp->dm_ops == &dt_modops_128) ? sizeof (Elf64_Sym) : sizeof (Elf32_Sym); dmp->dm_symtab.cts_offset = 0; @@ -879,7 +898,9 @@ dt_module_getctf(dtrace_hdl_t *dtp, dt_module_t *dmp) if (dmp->dm_ctfp != NULL || dt_module_load(dtp, dmp) != 0) return (dmp->dm_ctfp); - if (dmp->dm_ops == &dt_modops_64) + if (dmp->dm_ops == &dt_modops_128) + model = CTF_MODEL_P128; + else if (dmp->dm_ops == &dt_modops_64) model = CTF_MODEL_LP64; else model = CTF_MODEL_ILP32; @@ -1098,7 +1119,7 @@ dt_module_extern(dtrace_hdl_t *dtp, dt_module_t *dmp, const char * dt_module_modelname(dt_module_t *dmp) { - if (dmp->dm_ops == &dt_modops_64) + if (dmp->dm_ops == &dt_modops_64 || dmp->dm_ops == &dt_modops_128) return ("64-bit"); else return ("32-bit"); @@ -1196,13 +1217,19 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) return; } + gelf_getehdr(dmp->dm_elf, &ehdr); switch (gelf_getclass(dmp->dm_elf)) { case ELFCLASS32: dmp->dm_ops = &dt_modops_32; bits = 32; break; case ELFCLASS64: - dmp->dm_ops = &dt_modops_64; +#if __CHERI_PURE_CAPABILITY__ + if (ELF_IS_CHERI(&ehdr)) + dmp->dm_ops = &dt_modops_128; + else +#endif + dmp->dm_ops = &dt_modops_64; bits = 64; break; default: @@ -1211,7 +1238,6 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat) return; } mapbase = (uintptr_t)k_stat->address; - gelf_getehdr(dmp->dm_elf, &ehdr); is_elf_obj = (ehdr.e_type == ET_REL); if (is_elf_obj) { dmp->dm_sec_offsets = diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c index 40200771fd4d..926c7a34f92e 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c @@ -1077,6 +1077,7 @@ dt_vopen(int version, int flags, int *errp, case 0: /* native model */ case DTRACE_O_ILP32: case DTRACE_O_LP64: + case DTRACE_O_P128: break; default: return (set_open_errno(dtp, errp, EINVAL)); @@ -1258,7 +1259,9 @@ dt_vopen(int version, int flags, int *errp, else if (dt_ioctl(dtp, DTRACEIOC_CONF, &dtp->dt_conf) != 0) return (set_open_errno(dtp, errp, errno)); - if (flags & DTRACE_O_LP64) + if (flags & DTRACE_O_P128) + dtp->dt_conf.dtc_ctfmodel = CTF_MODEL_P128; + else if (flags & DTRACE_O_LP64) dtp->dt_conf.dtc_ctfmodel = CTF_MODEL_LP64; else if (flags & DTRACE_O_ILP32) dtp->dt_conf.dtc_ctfmodel = CTF_MODEL_ILP32; diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c index 2db6056fd0ce..a8f8773d1beb 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c @@ -958,7 +958,8 @@ dt_printf_create(dtrace_hdl_t *dtp, const char *s) goto fmt_switch; case '?': - if (dtp->dt_conf.dtc_ctfmodel == CTF_MODEL_LP64) + if (dtp->dt_conf.dtc_ctfmodel == CTF_MODEL_LP64 || + dtp->dt_conf.dtc_ctfmodel == CTF_MODEL_P128) pfd->pfd_width = 16; else pfd->pfd_width = 8; diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h index 1f4c5a2efd6b..d0f3f2de5c08 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h @@ -70,8 +70,9 @@ typedef struct dtrace_aggdata dtrace_aggdata_t; #define DTRACE_O_NOSYS 0x02 /* do not load /system/object modules */ #define DTRACE_O_LP64 0x04 /* force D compiler to be LP64 */ #define DTRACE_O_ILP32 0x08 /* force D compiler to be ILP32 */ -#define DTRACE_O_MODEL_MASK (DTRACE_O_LP64 | DTRACE_O_ILP32) -#define DTRACE_O_MASK 0x0f /* mask of valid flags to dtrace_open */ +#define DTRACE_O_P128 0x10 /* force D compiler to be P128 */ +#define DTRACE_O_MODEL_MASK (DTRACE_O_LP64 | DTRACE_O_ILP32 | DTRACE_O_P128) +#define DTRACE_O_MASK 0x1f /* mask of valid flags to dtrace_open */ extern dtrace_hdl_t *dtrace_open(int, int, int *); extern dtrace_hdl_t *dtrace_vopen(int, int, int *, diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 170503a13ff1..262896ef58e2 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -14124,7 +14124,8 @@ dtrace_dof_slurp(dof_hdr_t *dof, dtrace_vstate_t *vstate, cred_t *cr, } if (dof->dofh_ident[DOF_ID_MODEL] != DOF_MODEL_ILP32 && - dof->dofh_ident[DOF_ID_MODEL] != DOF_MODEL_LP64) { + dof->dofh_ident[DOF_ID_MODEL] != DOF_MODEL_LP64 && + dof->dofh_ident[DOF_ID_MODEL] != DOF_MODEL_P128) { dtrace_dof_error(dof, "DOF has invalid data model"); return (-1); } diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h b/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h index 6b7ab01b6929..7f58f1c3513b 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/ctf_api.h @@ -125,8 +125,13 @@ typedef struct ctf_lblinfo { */ #define CTF_MODEL_ILP32 1 /* object data model is ILP32 */ #define CTF_MODEL_LP64 2 /* object data model is LP64 */ +#define CTF_MODEL_P128 3 /* object data model is P128 */ #ifdef _LP64 +#ifdef __CHERI_PURE_CAPABILITY__ +#define CTF_MODEL_NATIVE CTF_MODEL_P128 +#else #define CTF_MODEL_NATIVE CTF_MODEL_LP64 +#endif #else #define CTF_MODEL_NATIVE CTF_MODEL_ILP32 #endif diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h index 4f1186f51db7..92d8620806f9 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h @@ -665,6 +665,7 @@ typedef struct dof_hdr { #define DOF_MODEL_NONE 0 /* DOF_ID_MODEL */ #define DOF_MODEL_ILP32 1 #define DOF_MODEL_LP64 2 +#define DOF_MODEL_P128 3 #ifdef _LP64 #define DOF_MODEL_NATIVE DOF_MODEL_LP64 From 5fbe2829721d1f2d7078050a9c973bd3dbe82fd6 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sat, 25 Jan 2025 15:16:23 +0000 Subject: [PATCH 28/47] dtrace: Extend use of the dtrace_uarg_t type This type needs to be large enough to hold a 64-bit integer or a pointer. Fields of this type might need to be returned to userspace, so we must be sure not to truncate them or clear capability tags. --- .../opensolaris/lib/libdtrace/common/dt_dof.c | 2 +- .../opensolaris/uts/common/dtrace/dtrace.c | 12 +++++------ .../opensolaris/uts/common/sys/dtrace.h | 21 +++++++------------ .../opensolaris/uts/common/sys/dtrace_impl.h | 2 +- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c index 9a80cdf0a99e..d8a5735b3b06 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c @@ -815,7 +815,7 @@ dtrace_dof_create(dtrace_hdl_t *dtp, dtrace_prog_t *pgp, uint_t flags) dofe.dofe_uarg = edp->dted_uarg; (void) dof_add_lsect(ddo, &dofe, DOF_SECT_ECBDESC, - sizeof (uint64_t), 0, 0, sizeof (dof_ecbdesc_t)); + sizeof (dtrace_uarg_t), 0, 0, sizeof (dof_ecbdesc_t)); } /* diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 262896ef58e2..32749159cf00 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -11028,7 +11028,7 @@ dtrace_predicate_release(dtrace_predicate_t *pred, dtrace_vstate_t *vstate) */ static dtrace_actdesc_t * dtrace_actdesc_create(dtrace_actkind_t kind, uint32_t ntuple, - dtrace_uarg_t uarg, uint64_t arg) + dtrace_uarg_t uarg, dtrace_uarg_t arg) { dtrace_actdesc_t *act; @@ -11513,7 +11513,7 @@ dtrace_ecb_action_add(dtrace_ecb_t *ecb, dtrace_actdesc_t *desc) dtrace_recdesc_t *rec; dtrace_state_t *state = ecb->dte_state; dtrace_optval_t *opt = state->dts_options, nframes = 0, strsize; - uint64_t arg = desc->dtad_arg; + dtrace_uarg_t arg = desc->dtad_arg; ASSERT(MUTEX_HELD(&dtrace_lock)); ASSERT(ecb->dte_action == NULL || ecb->dte_action->dta_refcnt == 1); @@ -13824,7 +13824,7 @@ dtrace_dof_actdesc(dof_hdr_t *dof, dof_sec_t *sec, dtrace_vstate_t *vstate, dof_sec_t *difosec; size_t offs; uintptr_t daddr = (uintptr_t)dof; - uint64_t arg; + dtrace_uarg_t arg; dtrace_actkind_t kind; if (sec->dofs_type != DOF_SECT_ACTDESC) { @@ -13837,7 +13837,7 @@ dtrace_dof_actdesc(dof_hdr_t *dof, dof_sec_t *sec, dtrace_vstate_t *vstate, return (NULL); } - if (sec->dofs_align != sizeof (uint64_t)) { + if (sec->dofs_align != sizeof (dtrace_uarg_t)) { dtrace_dof_error(dof, "bad alignment in action description"); return (NULL); } @@ -13902,7 +13902,7 @@ dtrace_dof_actdesc(dof_hdr_t *dof, dof_sec_t *sec, dtrace_vstate_t *vstate, i -= desc->dofa_arg; fmt = kmem_alloc(i + 1, KM_SLEEP); bcopy(&str[desc->dofa_arg], fmt, i + 1); - arg = (uint64_t)(uintptr_t)fmt; + arg = (uintptr_t)fmt; } else { if (kind == DTRACEACT_PRINTA) { ASSERT(desc->dofa_strtab == DOF_SECIDX_NONE); @@ -13962,7 +13962,7 @@ dtrace_dof_ecbdesc(dof_hdr_t *dof, dof_sec_t *sec, dtrace_vstate_t *vstate, return (NULL); } - if (sec->dofs_align != sizeof (uint64_t)) { + if (sec->dofs_align != sizeof (dtrace_uarg_t)) { dtrace_dof_error(dof, "bad alignment in ECB description"); return (NULL); } diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h index 92d8620806f9..a626f18d46d5 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h @@ -105,6 +105,7 @@ typedef int64_t dtrace_aggvarid_t; /* aggregation variable identifier */ typedef uint16_t dtrace_actkind_t; /* action kind */ typedef int64_t dtrace_optval_t; /* option value */ typedef uint32_t dtrace_cacheid_t; /* predicate cache identifier */ +typedef uint64ptr_t dtrace_uarg_t; /* user argument cookie */ typedef enum dtrace_probespec { DTRACE_PROBESPEC_NONE = -1, @@ -748,18 +749,12 @@ typedef struct dof_sec { ((x) == DOF_SECT_XLEXPORT) || ((x) == DOF_SECT_PREXPORT) || \ ((x) == DOF_SECT_PRENOFFS)) -#if __has_feature(capabilities) -typedef kuintcap_t dtrace_uarg_t; -#else -typedef uint64_t dtrace_uarg_t; -#endif - typedef struct dof_ecbdesc { dof_secidx_t dofe_probes; /* link to DOF_SECT_PROBEDESC */ dof_secidx_t dofe_pred; /* link to DOF_SECT_DIFOHDR */ dof_secidx_t dofe_actions; /* link to DOF_SECT_ACTDESC */ uint32_t dofe_pad; /* reserved for future use */ - uint64_t dofe_uarg; /* user-supplied library argument */ + dtrace_uarg_t dofe_uarg; /* user-supplied library argument */ } dof_ecbdesc_t; typedef struct dof_probedesc { @@ -776,7 +771,7 @@ typedef struct dof_actdesc { dof_secidx_t dofa_strtab; /* link to DOF_SECT_STRTAB section */ uint32_t dofa_kind; /* action kind (DTRACEACT_* constant) */ uint32_t dofa_ntuple; /* number of subsequent tuple actions */ - uint64_t dofa_arg; /* kind-specific argument */ + dtrace_uarg_t dofa_arg; /* kind-specific argument */ dtrace_uarg_t dofa_uarg; /* user-supplied argument */ } dof_actdesc_t; @@ -946,8 +941,8 @@ typedef struct dtrace_actdesc { struct dtrace_actdesc *dtad_next; /* next action */ dtrace_actkind_t dtad_kind; /* kind of action */ uint32_t dtad_ntuple; /* number in tuple */ - uint64_t dtad_arg; /* action argument */ - dtrace_uarg_t dtad_uarg; /* user argument */ + dtrace_uarg_t dtad_arg; /* action argument */ + dtrace_uarg_t dtad_uarg; /* user argument */ int dtad_refcnt; /* reference count */ } dtrace_actdesc_t; @@ -955,7 +950,7 @@ typedef struct dtrace_ecbdesc { dtrace_actdesc_t *dted_action; /* action description(s) */ dtrace_preddesc_t dted_pred; /* predicate description */ dtrace_probedesc_t dted_probe; /* probe description */ - uint64_t dted_uarg; /* library argument */ + dtrace_uarg_t dted_uarg; /* library argument */ int dted_refcnt; /* reference count */ } dtrace_ecbdesc_t; @@ -982,14 +977,14 @@ typedef struct dtrace_recdesc { uint32_t dtrd_offset; /* offset in ECB's data */ uint16_t dtrd_alignment; /* required alignment */ uint16_t dtrd_format; /* format, if any */ - uint64_t dtrd_arg; /* action argument */ + dtrace_uarg_t dtrd_arg; /* action argument */ dtrace_uarg_t dtrd_uarg; /* user argument */ } dtrace_recdesc_t; typedef struct dtrace_eprobedesc { dtrace_epid_t dtepd_epid; /* enabled probe ID */ dtrace_id_t dtepd_probeid; /* probe ID */ - uint64_t dtepd_uarg; /* library argument */ + dtrace_uarg_t dtepd_uarg; /* library argument */ uint32_t dtepd_size; /* total size */ int dtepd_nrecs; /* number of records */ dtrace_recdesc_t dtepd_rec[1]; /* records themselves */ diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h index 2711efd41ef4..ea82c0ba24c0 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h @@ -229,7 +229,7 @@ struct dtrace_ecb { uint32_t dte_cond; /* security condition */ dtrace_probe_t *dte_probe; /* pointer to probe */ dtrace_action_t *dte_action_last; /* last action on ECB */ - uint64_t dte_uarg; /* library argument */ + dtrace_uarg_t dte_uarg; /* library argument */ }; struct dtrace_predicate { From 4450611d406610c30c716992d11969b5ab0a972e Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sat, 25 Jan 2025 16:23:34 +0000 Subject: [PATCH 29/47] dtrace: Convert more incorrect uses of uintptr_t to size_t No functional change intended. Sponsored by: Innovate UK --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 32749159cf00..89d47cd7c0cf 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -987,7 +987,7 @@ dtrace_canload_remains(uint64_t addr, size_t sz, size_t *remain, } if ((fp = mstate->dtms_getf) != NULL) { - uintptr_t psz = sizeof (void *); + size_t psz = sizeof (void *); vnode_t *vp; vnodeops_t *op; @@ -6035,7 +6035,7 @@ inetout: regs[rd] = (uintptr_t)end + 1; } case DIF_SUBR_MEMREF: { - uintptr_t size = 2 * sizeof(uintptr_t); + size_t size = 2 * sizeof(uintptr_t); uintptr_t *memref = (uintptr_t *) P2ROUNDUP(mstate->dtms_scratch_ptr, sizeof(uintptr_t)); size_t scratch_size = ((ptraddr_t) memref - (ptraddr_t) mstate->dtms_scratch_ptr) + size; From d952d944348774827ef2b87cf98928cb80347b14 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sat, 25 Jan 2025 17:08:15 +0000 Subject: [PATCH 30/47] dtrace: Introduce dtrace_difval_t --- .../opensolaris/uts/common/dtrace/dtrace.c | 96 ++++++++++--------- .../opensolaris/uts/common/sys/dtrace_impl.h | 5 +- 2 files changed, 54 insertions(+), 47 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 89d47cd7c0cf..6cc451e6de8e 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -597,7 +597,7 @@ static int dtrace_enabling_match(dtrace_enabling_t *, int *); static void dtrace_enabling_matchall(void); static void dtrace_enabling_reap(void); static dtrace_state_t *dtrace_anon_grab(void); -static uint64_t dtrace_helper(int, dtrace_mstate_t *, +static dtrace_difval_t dtrace_helper(int, dtrace_mstate_t *, dtrace_state_t *, uint64_t, uint64_t); static dtrace_helpers_t *dtrace_helpers_create(proc_t *); static void dtrace_buffer_drop(dtrace_buffer_t *); @@ -2538,7 +2538,8 @@ dtrace_aggregate_sum(uint64_t *oval, uint64_t nval, uint64_t arg) */ static void dtrace_aggregate(dtrace_aggregation_t *agg, dtrace_buffer_t *dbuf, - intptr_t offset, dtrace_buffer_t *buf, uint64_t expr, uint64_t arg) + intptr_t offset, dtrace_buffer_t *buf, dtrace_difval_t expr, + dtrace_difval_t arg) { dtrace_recdesc_t *rec = &agg->dtag_action.dta_rec; uint32_t i, ndx, size, fsize; @@ -3317,7 +3318,7 @@ dtrace_dif_varstrz(uintptr_t addr, size_t strsz, dtrace_state_t *state, * This function implements the DIF emulator's variable lookups. The emulator * passes a reserved variable identifier and optional built-in array index. */ -static uint64_t +static dtrace_difval_t dtrace_dif_variable(dtrace_mstate_t *mstate, dtrace_state_t *state, uint64_t v, uint64_t ndx) { @@ -3337,7 +3338,7 @@ dtrace_dif_variable(dtrace_mstate_t *mstate, dtrace_state_t *state, uint64_t v, sizeof (mstate->dtms_arg[0])) { int aframes = mstate->dtms_probe->dtpr_aframes + 2; dtrace_provider_t *pv; - uint64_t val; + dtrace_difval_t val; pv = mstate->dtms_probe->dtpr_provider; if (pv->dtpv_pops.dtps_getargval != NULL) @@ -3388,7 +3389,7 @@ dtrace_dif_variable(dtrace_mstate_t *mstate, dtrace_state_t *state, uint64_t v, case DIF_VAR_CURTHREAD: if (!dtrace_priv_proc(state)) return (0); - return ((uint64_t)(uintptr_t)curthread); + return ((uintptr_t)curthread); case DIF_VAR_TIMESTAMP: if (!(mstate->dtms_present & DTRACE_MSTATE_TIMESTAMP)) { @@ -4232,7 +4233,7 @@ dtrace_json(uint64_t size, uintptr_t json, char *elemlist, int nelems, * happen is that a bogus program can obtain bogus results. */ static void -dtrace_dif_subr(uint_t subr, uint_t rd, uint64_t *regs, +dtrace_dif_subr(uint_t subr, uint_t rd, dtrace_difval_t *regs, dtrace_key_t *tupregs, int nargs, dtrace_mstate_t *mstate, dtrace_state_t *state) { @@ -6095,7 +6096,7 @@ inetout: regs[rd] = (uintptr_t)end + 1; * DIF object. This function is deliberately void of assertions as all of * the necessary checks are handled by a call to dtrace_difo_validate(). */ -static uint64_t +static dtrace_difval_t dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, dtrace_vstate_t *vstate, dtrace_state_t *state) { @@ -6104,7 +6105,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, const char *strtab = difo->dtdo_strtab; const uint64_t *inttab = difo->dtdo_inttab; - uint64_t rval = 0; + dtrace_difval_t rval = 0; dtrace_statvar_t *svar; dtrace_dstate_t *dstate = &vstate->dtvs_dynvars; dtrace_difv_t *v; @@ -6112,8 +6113,8 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, volatile uintptr_t *illval = &cpu_core[curcpu].cpuc_dtrace_illval; dtrace_key_t tupregs[DIF_DTR_NREGS + 2]; /* +2 for thread and id */ - uint64_t regs[DIF_DIR_NREGS]; - uint64_t *tmp; + dtrace_difval_t regs[DIF_DIR_NREGS]; + dtrace_difval_t *tmp; uint8_t cc_n = 0, cc_z = 0, cc_v = 0, cc_c = 0; int64_t cc_r; @@ -6140,28 +6141,28 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, switch (DIF_INSTR_OP(instr)) { case DIF_OP_OR: - regs[rd] = regs[r1] | regs[r2]; + regs[rd] = regs[r1] | (uint64_t)regs[r2]; break; case DIF_OP_XOR: - regs[rd] = regs[r1] ^ regs[r2]; + regs[rd] = regs[r1] ^ (uint64_t)regs[r2]; break; case DIF_OP_AND: - regs[rd] = regs[r1] & regs[r2]; + regs[rd] = regs[r1] & (uint64_t)regs[r2]; break; case DIF_OP_SLL: - regs[rd] = regs[r1] << regs[r2]; + regs[rd] = regs[r1] << (uint64_t)regs[r2]; break; case DIF_OP_SRL: - regs[rd] = regs[r1] >> regs[r2]; + regs[rd] = regs[r1] >> (uint64_t)regs[r2]; break; case DIF_OP_SUB: - regs[rd] = regs[r1] - regs[r2]; + regs[rd] = regs[r1] - (uint64_t)regs[r2]; break; case DIF_OP_ADD: - regs[rd] = regs[r1] + regs[r2]; + regs[rd] = regs[r1] + (uint64_t)regs[r2]; break; case DIF_OP_MUL: - regs[rd] = regs[r1] * regs[r2]; + regs[rd] = regs[r1] * (uint64_t)regs[r2]; break; case DIF_OP_SDIV: if (regs[r2] == 0) { @@ -6362,7 +6363,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, regs[rd] = inttab[DIF_INSTR_INTEGER(instr)]; break; case DIF_OP_SETS: - regs[rd] = (uint64_t)(uintptr_t) + regs[rd] = (uintptr_t) (strtab + DIF_INSTR_STRING(instr)); break; case DIF_OP_SCMP: { @@ -6424,7 +6425,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, */ regs[rd] = 0; } else { - regs[rd] = a + sizeof (uint64_t); + regs[rd] = a + sizeof (dtrace_difval_t); } break; @@ -6456,7 +6457,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, break; } else { *(uint8_t *)a = 0; - a += sizeof (uint64_t); + a += sizeof (dtrace_difval_t); } if (!dtrace_vcanload( (void *)(uintptr_t)regs[rd], &v->dtdv_type, @@ -6505,7 +6506,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, size_t sz = v->dtdv_type.dtdt_size; size_t lim; - sz += sizeof (uint64_t); + sz += sizeof (dtrace_difval_t); ASSERT(svar->dtsv_size == NCPU * sz); a += curcpu * sz; @@ -6517,14 +6518,15 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, */ regs[rd] = 0; } else { - regs[rd] = a + sizeof (uint64_t); + regs[rd] = a + sizeof (dtrace_difval_t); } break; } - ASSERT(svar->dtsv_size == NCPU * sizeof (uint64_t)); - tmp = (uint64_t *)(uintptr_t)svar->dtsv_data; + ASSERT(svar->dtsv_size == + NCPU * sizeof (dtrace_difval_t)); + tmp = (dtrace_difval_t *)(uintptr_t)svar->dtsv_data; regs[rd] = tmp[curcpu]; break; @@ -6545,7 +6547,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, size_t sz = v->dtdv_type.dtdt_size; size_t lim; - sz += sizeof (uint64_t); + sz += sizeof (dtrace_difval_t); ASSERT(svar->dtsv_size == NCPU * sz); a += curcpu * sz; @@ -6554,7 +6556,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, break; } else { *(uint8_t *)a = 0; - a += sizeof (uint64_t); + a += sizeof (dtrace_difval_t); } if (!dtrace_vcanload( @@ -6567,8 +6569,9 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, break; } - ASSERT(svar->dtsv_size == NCPU * sizeof (uint64_t)); - tmp = (uint64_t *)(uintptr_t)svar->dtsv_data; + ASSERT(svar->dtsv_size == + NCPU * sizeof (dtrace_difval_t)); + tmp = (dtrace_difval_t *)(uintptr_t)svar->dtsv_data; tmp[curcpu] = regs[rd]; break; @@ -6805,7 +6808,8 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, case DIF_OP_ALLOCS: { uintptr_t ptr = P2ROUNDUP(mstate->dtms_scratch_ptr, 8); - size_t size = ptr - mstate->dtms_scratch_ptr + regs[r1]; + size_t size = ptr - mstate->dtms_scratch_ptr + + (size_t)regs[r1]; /* * Rounding up the user allocation size could have @@ -7216,10 +7220,11 @@ dtrace_action_ustack(dtrace_mstate_t *mstate, dtrace_state_t *state, static void dtrace_store_by_ref(dtrace_difo_t *dp, caddr_t tomax, size_t size, - size_t *valoffsp, uint64_t *valp, uint64_t end, int intuple, int dtkind) + size_t *valoffsp, dtrace_difval_t *valp, uint64_t end, int intuple, + int dtkind) { volatile uint16_t *flags; - uint64_t val = *valp; + dtrace_difval_t val = *valp; size_t valoffs = *valoffsp; flags = (volatile uint16_t *)&cpu_core[curcpu].cpuc_dtrace_flags; @@ -7411,7 +7416,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, * arguments to aggregating actions, one iteration of the * action loop will use the last iteration's value. */ - uint64_t val = 0; + dtrace_difval_t val = 0; mstate.dtms_present = DTRACE_MSTATE_ARGS | DTRACE_MSTATE_PROBE; mstate.dtms_getf = NULL; @@ -7569,7 +7574,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, if (pred != NULL) { dtrace_difo_t *dp = pred->dtp_difo; - uint64_t rval; + dtrace_difval_t rval; rval = dtrace_dif_emulate(dp, &mstate, vstate, state); @@ -7598,7 +7603,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, valoffs = offs + rec->dtrd_offset; if (DTRACEACT_ISAGG(act->dta_kind)) { - uint64_t v = 0xbad; + dtrace_difval_t v = 0xbad; dtrace_aggregation_t *agg; agg = (dtrace_aggregation_t *)act; @@ -10682,9 +10687,9 @@ dtrace_difo_init(dtrace_difo_t *dp, dtrace_vstate_t *vstate) if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) dsize = NCPU * (v->dtdv_type.dtdt_size + - sizeof (uint64_t)); + sizeof (dtrace_difval_t)); else - dsize = NCPU * sizeof (uint64_t); + dsize = NCPU * sizeof (dtrace_difval_t); break; @@ -10694,7 +10699,7 @@ dtrace_difo_init(dtrace_difo_t *dp, dtrace_vstate_t *vstate) if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) dsize = v->dtdv_type.dtdt_size + - sizeof (uint64_t); + sizeof (dtrace_difval_t); break; @@ -10728,7 +10733,7 @@ dtrace_difo_init(dtrace_difo_t *dp, dtrace_vstate_t *vstate) svar->dtsv_var = *v; if ((svar->dtsv_size = dsize) != 0) { - svar->dtsv_data = (uint64_t)(uintptr_t) + svar->dtsv_data = (uintptr_t) kmem_zalloc(dsize, KM_SLEEP); } @@ -11721,7 +11726,8 @@ dtrace_ecb_action_add(dtrace_ecb_t *ecb, dtrace_actdesc_t *desc) rec = &action->dta_rec; size = rec->dtrd_size; - for (mask = sizeof (uint64_t) - 1; size != 0 && mask > 0; mask >>= 1) { + for (mask = sizeof (uint64_t) - 1; size != 0 && mask > 0; + mask >>= 1) { if (!(size & mask)) { align = mask + 1; break; @@ -15689,7 +15695,7 @@ dtrace_helper_trace(dtrace_helper_action_t *helper, * framework? (Well, a hell of a lot simpler, for starters...) */ size = sizeof (dtrace_helptrace_t) + dtrace_helptrace_nlocals * - sizeof (uint64_t) - sizeof (uint64_t); + sizeof (dtrace_difval_t) - sizeof (dtrace_difval_t); /* * Iterate until we can allocate a slot in the trace buffer. @@ -15728,20 +15734,20 @@ dtrace_helper_trace(dtrace_helper_action_t *helper, if ((svar = vstate->dtvs_locals[i]) == NULL) continue; - ASSERT(svar->dtsv_size >= NCPU * sizeof (uint64_t)); + ASSERT(svar->dtsv_size >= NCPU * sizeof (dtrace_difval_t)); ent->dtht_locals[i] = - ((uint64_t *)(uintptr_t)svar->dtsv_data)[curcpu]; + ((dtrace_difval_t *)(uintptr_t)svar->dtsv_data)[curcpu]; } } -static uint64_t +static dtrace_difval_t dtrace_helper(int which, dtrace_mstate_t *mstate, dtrace_state_t *state, uint64_t arg0, uint64_t arg1) { uint16_t *flags = &cpu_core[curcpu].cpuc_dtrace_flags; uint64_t sarg0 = mstate->dtms_arg[0]; uint64_t sarg1 = mstate->dtms_arg[1]; - uint64_t rval = 0; + dtrace_difval_t rval = 0; dtrace_helpers_t *helpers = curproc->p_dtrace_helpers; dtrace_helper_action_t *helper; dtrace_vstate_t *vstate; diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h index ea82c0ba24c0..35be244c996b 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h @@ -82,6 +82,7 @@ typedef struct dtrace_state dtrace_state_t; typedef uint32_t dtrace_optid_t; typedef uint32_t dtrace_specid_t; typedef uint64_t dtrace_genid_t; +typedef uint64ptr_t dtrace_difval_t; /* * DTrace Probes @@ -877,7 +878,7 @@ typedef struct dtrace_dstate { * dynamically-allocated DIFV_SCOPE_GLOBAL variables. */ typedef struct dtrace_statvar { - uint64_t dtsv_data; /* data or pointer to it */ + dtrace_difval_t dtsv_data; /* data or pointer to it */ size_t dtsv_size; /* size of pointed-to data */ int dtsv_refcnt; /* reference count */ dtrace_difv_t dtsv_var; /* variable metadata */ @@ -1069,7 +1070,7 @@ typedef struct dtrace_helptrace { int dtht_fault; /* type of fault (if any) */ int dtht_fltoffs; /* DIF offset */ uint64_t dtht_illval; /* faulting value */ - uint64_t dtht_locals[1]; /* local variables */ + dtrace_difval_t dtht_locals[1]; /* local variables */ } dtrace_helptrace_t; /* From f6292271f1800926293a5ed42b6b1a897ea7045b Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sat, 25 Jan 2025 17:30:48 +0000 Subject: [PATCH 31/47] dtrace: Return a uint64ptr_t from provider getarg routines --- sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h | 4 ++-- .../contrib/opensolaris/uts/common/sys/dtrace_impl.h | 6 +----- sys/cddl/dev/dtrace/aarch64/dtrace_isa.c | 12 ++++++------ sys/cddl/dev/sdt/sdt.c | 4 ++-- sys/cddl/dev/systrace/systrace.c | 4 ++-- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h index a626f18d46d5..1ba369f93c87 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h @@ -1692,7 +1692,7 @@ typedef struct dof_helper { * dtrace_register(), dtrace_unregister(), dtrace_invalidate(), and * dtrace_condense(). * - * 1.9 uint64_t dtps_getargval(void *arg, dtrace_id_t id, void *parg, + * 1.9 uint64ptr_t dtps_getargval(void *arg, dtrace_id_t id, void *parg, * int argno, int aframes) * * 1.9.1 Overview @@ -2142,7 +2142,7 @@ typedef struct dtrace_pops { void (*dtps_resume)(void *arg, dtrace_id_t id, void *parg); void (*dtps_getargdesc)(void *arg, dtrace_id_t id, void *parg, dtrace_argdesc_t *desc); - uint64_t (*dtps_getargval)(void *arg, dtrace_id_t id, void *parg, + uint64ptr_t (*dtps_getargval)(void *arg, dtrace_id_t id, void *parg, int argno, int aframes); int (*dtps_usermode)(void *arg, dtrace_id_t id, void *parg); void (*dtps_destroy)(void *arg, dtrace_id_t id, void *parg); diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h index 35be244c996b..3cae1f839ec2 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h @@ -1273,11 +1273,7 @@ typedef struct dtrace_toxrange { uintptr_t dtt_limit; /* limit of toxic range */ } dtrace_toxrange_t; -#ifdef illumos -extern uint64_t dtrace_getarg(int, int); -#else -extern uint64_t __noinline dtrace_getarg(int, int); -#endif +extern uint64ptr_t dtrace_getarg(int, int); extern greg_t dtrace_getfp(void); extern int dtrace_getipl(void); extern uintptr_t dtrace_caller(int); diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c index 14c99f85590d..6fdaedf37b98 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c @@ -244,7 +244,7 @@ dtrace_getufpstack(uint64_t *pcstack, uint64_t *fpstack, int pcstack_limit) printf("IMPLEMENT ME: %s\n", __func__); } -uint64_t +uint64ptr_t dtrace_getarg(int arg, int aframes __unused) { struct trapframe *tf; @@ -259,20 +259,20 @@ dtrace_getarg(int arg, int aframes __unused) return (tf->tf_x[arg]); } else { uintptr_t p; - uint64_t val; + uint64ptr_t val; - p = (tf->tf_sp + (arg - 8) * sizeof(uint64_t)); - if ((p & 7) != 0) { + p = (tf->tf_sp + (arg - 8) * sizeof(uint64ptr_t)); + if ((p & (sizeof(uint64ptr_t) - 1)) != 0) { DTRACE_CPUFLAG_SET(CPU_DTRACE_BADALIGN); cpu_core[curcpu].cpuc_dtrace_illval = p; return (0); } - if (!kstack_contains(curthread, p, sizeof(uint64_t))) { + if (!kstack_contains(curthread, p, sizeof(uint64ptr_t))) { DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); cpu_core[curcpu].cpuc_dtrace_illval = p; return (0); } - memcpy(&val, (void *)p, sizeof(uint64_t)); + memcpy(&val, (void *)p, sizeof(uint64ptr_t)); return (val); } } diff --git a/sys/cddl/dev/sdt/sdt.c b/sys/cddl/dev/sdt/sdt.c index 4b3604be29d6..e87057e6dd81 100644 --- a/sys/cddl/dev/sdt/sdt.c +++ b/sys/cddl/dev/sdt/sdt.c @@ -66,7 +66,7 @@ /* DTrace methods. */ static void sdt_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *); -static uint64_t sdt_getargval(void *, dtrace_id_t, void *, int, int); +static uint64ptr_t sdt_getargval(void *, dtrace_id_t, void *, int, int); static void sdt_provide_probes(void *, dtrace_probedesc_t *); static void sdt_destroy(void *, dtrace_id_t, void *); static void sdt_enable(void *, dtrace_id_t, void *); @@ -344,7 +344,7 @@ sdt_getargdesc(void *arg, dtrace_id_t id, void *parg, dtrace_argdesc_t *desc) * FreeBSD's SDT implement currently only supports up to 6 arguments, so we just * need to handle arg5 here. */ -static uint64_t +static uint64ptr_t sdt_getargval(void *arg __unused, dtrace_id_t id __unused, void *parg __unused, int argno, int aframes __unused) { diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c index 9bdcfc3faa68..92f1cecee4c5 100644 --- a/sys/cddl/dev/systrace/systrace.c +++ b/sys/cddl/dev/systrace/systrace.c @@ -139,7 +139,7 @@ static void systrace_unload(void *); static void systrace_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *); -static uint64_t systrace_getargval(void *, dtrace_id_t, void *, int, int); +static uint64ptr_t systrace_getargval(void *, dtrace_id_t, void *, int, int); static void systrace_provide(void *, dtrace_probedesc_t *); static void systrace_destroy(void *, dtrace_id_t, void *); static void systrace_enable(void *, dtrace_id_t, void *); @@ -245,7 +245,7 @@ systrace_getargdesc(void *arg, dtrace_id_t id, void *parg, desc->dtargd_ndx = DTRACE_ARGNONE; } -static uint64_t +static uint64ptr_t systrace_getargval(void *arg __unused, dtrace_id_t id __unused, void *parg __unused, int argno, int aframes __unused) { From 3eef6501a7c209085d0708b6ebc0018c6006cb97 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sat, 25 Jan 2025 17:36:09 +0000 Subject: [PATCH 32/47] dtrace tests: Exclude json and usdt tests for now They do not build on arm64, as we don't implement USDT there. --- cddl/usr.sbin/dtrace/tests/common/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cddl/usr.sbin/dtrace/tests/common/Makefile b/cddl/usr.sbin/dtrace/tests/common/Makefile index a7c3aac9c6f5..1d9569bb37b3 100644 --- a/cddl/usr.sbin/dtrace/tests/common/Makefile +++ b/cddl/usr.sbin/dtrace/tests/common/Makefile @@ -85,6 +85,8 @@ TESTS_SUBDIRS+= aggs \ vars \ version \ +TESTS_SUBDIRS:= ${TESTS_SUBDIRS:Njson:Nusdt} + .PATH: ${.CURDIR:H:H:H:H:H}/tests KYUAFILE= YES From 88d779491e5853c6c11c5b6adda0549953e449e6 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sat, 25 Jan 2025 19:58:52 +0000 Subject: [PATCH 33/47] ctfconvert: Teach the DWARF parser about intcap encodings These arise in purecap binaries, e.g.,: <1><1954>: Abbrev Number: 8 (DW_TAG_base_type) <1955> DW_AT_name : (indirect string) unsigned __intcap <1959> DW_AT_encoding : 161 (UNKNOWN) <195a> DW_AT_byte_size : 16 and <1><34eb>: Abbrev Number: 8 (DW_TAG_base_type) <34ec> DW_AT_name : (indirect string) __intcap <34f0> DW_AT_encoding : 160 (UNKNOWN) <34f1> DW_AT_byte_size : 16 We don't seem to have symbolic names for these. --- cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c index 42faaad65db5..645388dd9c88 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c @@ -1438,6 +1438,13 @@ die_base_from_dwarf(dwarf_t *dw, Dwarf_Die base, Dwarf_Off off, size_t sz) intr->intr_signed = 1; intr->intr_fformat = die_base_type2enc(dw, off, enc, sz); break; + case 160: /* signed intcap_t */ + intr->intr_type = INTR_INT; + intr->intr_signed = 1; + break; + case 161: /* unsigned intcap_t */ + intr->intr_type = INTR_INT; + break; default: terminate("die %llu: unknown base type encoding 0x%llx\n", off, enc); From 014fce918d9f6a86605de641072eeb7eb276d35e Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sun, 26 Jan 2025 15:14:47 +0000 Subject: [PATCH 34/47] dtrace: Add a new probe error type for CHERI exceptions Flag capability violations with CPU_DTRACE_CHERI so that userspace has some clue as to what's causing errors. It would be nice to have more specific errors, but we are limited by a limited range of values for CPU_DTRACE_* flags. --- .../lib/libdtrace/common/dt_error.c | 1 + sys/cddl/compat/opensolaris/sys/cpuvar_defs.h | 8 +++++++- .../opensolaris/uts/common/dtrace/dtrace.c | 1 + .../opensolaris/uts/common/sys/dtrace.h | 1 + sys/cddl/dev/dtrace/aarch64/dtrace_subr.c | 20 ++++++++++++++++++- 5 files changed, 29 insertions(+), 2 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c index 339e2de5d150..27bf19336d4b 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_error.c @@ -229,6 +229,7 @@ dtrace_faultstr(dtrace_hdl_t *dtp, int fault) { DTRACEFLT_TUPOFLOW, "tuple stack overflow" }, { DTRACEFLT_BADSTACK, "bad stack" }, { DTRACEFLT_LIBRARY, "library-level fault" }, + { DTRACEFLT_CHERI, "CHERI exception" }, { 0, NULL } }; diff --git a/sys/cddl/compat/opensolaris/sys/cpuvar_defs.h b/sys/cddl/compat/opensolaris/sys/cpuvar_defs.h index d99eaea7947e..f4c63b92679b 100644 --- a/sys/cddl/compat/opensolaris/sys/cpuvar_defs.h +++ b/sys/cddl/compat/opensolaris/sys/cpuvar_defs.h @@ -45,12 +45,18 @@ #endif #define CPU_DTRACE_ENTRY 0x0800 /* pid provider hint to ustack() */ #define CPU_DTRACE_BADSTACK 0x1000 /* DTrace fault: bad stack */ +#define CPU_DTRACE_CHERI 0x8000 /* CHERI exception */ +#if __has_feature(capabilities) +#define CPU_DTRACE_CHERI_FAULT CPU_DTRACE_CHERI +#else +#define CPU_DTRACE_CHERI_FAULT 0 +#endif #define CPU_DTRACE_FAULT (CPU_DTRACE_BADADDR | CPU_DTRACE_BADALIGN | \ CPU_DTRACE_DIVZERO | CPU_DTRACE_ILLOP | \ CPU_DTRACE_NOSCRATCH | CPU_DTRACE_KPRIV | \ CPU_DTRACE_UPRIV | CPU_DTRACE_TUPOFLOW | \ - CPU_DTRACE_BADSTACK) + CPU_DTRACE_BADSTACK | CPU_DTRACE_CHERI_FAULT) #define CPU_DTRACE_ERROR (CPU_DTRACE_FAULT | CPU_DTRACE_DROP) #define PANICSTKSIZE 8192 diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 6cc451e6de8e..96c25c3af9f1 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -583,6 +583,7 @@ dtrace_load##bits(uintptr_t addr) \ ((flags) & CPU_DTRACE_BADALIGN) ? DTRACEFLT_BADALIGN : \ ((flags) & CPU_DTRACE_NOSCRATCH) ? DTRACEFLT_NOSCRATCH : \ ((flags) & CPU_DTRACE_BADSTACK) ? DTRACEFLT_BADSTACK : \ + ((flags) & CPU_DTRACE_CHERI) ? DTRACEFLT_CHERI : \ DTRACEFLT_UNKNOWN) #define DTRACEACT_ISSTRING(act) \ diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h index 1ba369f93c87..794cd6ea866e 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h @@ -1185,6 +1185,7 @@ typedef struct dtrace_conf { #define DTRACEFLT_UPRIV 7 /* Illegal user access */ #define DTRACEFLT_TUPOFLOW 8 /* Tuple stack overflow */ #define DTRACEFLT_BADSTACK 9 /* Bad stack */ +#define DTRACEFLT_CHERI 10 /* CHERI exception */ #define DTRACEFLT_LIBRARY 1000 /* Library-level fault */ diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c index f72186a7343e..8d1eb873fac3 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c @@ -204,8 +204,26 @@ dtrace_trap(struct trapframe *frame, u_int type) */ switch (type) { case EXCP_DATA_ABORT: +#if __has_feature(capabilities) + switch (frame->tf_esr & ISS_DATA_DFSC_MASK) { + case ISS_DATA_DFSC_CAP_TAG: + case ISS_DATA_DFSC_CAP_SEALED: + case ISS_DATA_DFSC_CAP_BOUND: + case ISS_DATA_DFSC_CAP_PERM: + cpu_core[curcpu].cpuc_dtrace_flags |= + CPU_DTRACE_CHERI; + break; + default: + cpu_core[curcpu].cpuc_dtrace_flags |= + CPU_DTRACE_BADADDR; + break; + } +#else + cpu_core[curcpu].cpuc_dtrace_flags |= + CPU_DTRACE_BADADDR; +#endif + /* Flag a bad address. */ - cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; cpu_core[curcpu].cpuc_dtrace_illval = frame->tf_far; /* From aa329c80a2c6ee3f4bd1550f1e5b36a5e2cbbafe Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sun, 26 Jan 2025 15:16:40 +0000 Subject: [PATCH 35/47] libdtrace: Add support for printing capabilities --- .../lib/libdtrace/common/dt_print.c | 8 ++++++- .../lib/libdtrace/common/dt_printf.c | 21 ++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c index 9bbd12e5544f..5bfa69906c2c 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c @@ -219,6 +219,11 @@ dt_print_hex(FILE *fp, caddr_t addr, size_t size) xo_emit("{:value/%#llx}", (unsigned long long)*(uint64_t *)addr); break; +#if __has_feature(capabilities) + case sizeof (uintcap_t): + xo_emit("{:value/%#lp}", *(uintcap_t *)addr); + break; +#endif default: xo_emit("<{:warning} {:size/%u}>", "invalid size", (uint_t)size); @@ -265,7 +270,8 @@ dt_print_int(ctf_id_t base, ulong_t off, dt_printarg_t *pap) * an even power of two byte size, or is larger than 8 bytes. */ size = e.cte_bits / NBBY; - if (size > 8 || (e.cte_bits % NBBY) != 0 || (size & (size - 1)) != 0) { + if (size > sizeof (uint64ptr_t) || (e.cte_bits % NBBY) != 0 || + (size & (size - 1)) != 0) { print_bitfield(pap, off, &e); return; } diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c index a8f8773d1beb..3429624f8501 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_printf.c @@ -298,11 +298,27 @@ pfprint_uint(dtrace_hdl_t *dtp, FILE *fp, const char *format, case sizeof (uint64_t): return (dt_printf(dtp, fp, format, *((uint64_t *)addr) / normal)); +#if __has_feature(capabilities) + case sizeof (uintcap_t): + return (dt_printf(dtp, fp, format, + *((uintcap_t *)addr) / normal)); +#endif default: return (dt_set_errno(dtp, EDT_DMISMATCH)); } } +#if __has_feature(capabilities) +static int +pfprint_ptr(dtrace_hdl_t *dtp, FILE *fp, const char *format, + const dt_pfargd_t *pfd, const void *addr, size_t size, uint64_t normal) +{ + if (size != sizeof (uintcap_t)) + return (dt_set_errno(dtp, EDT_DMISMATCH)); + return (dt_printf(dtp, fp, format, *((uintcap_t *)addr) / normal)); +} +#endif + static int pfprint_dint(dtrace_hdl_t *dtp, FILE *fp, const char *format, const dt_pfargd_t *pfd, const void *addr, size_t size, uint64_t normal) @@ -694,6 +710,9 @@ static const dt_pfconv_t _dtrace_conversions[] = { { "ls", "ls", pfproto_wstr, pfcheck_wstr, pfprint_wstr }, { "lx", "x", "long", pfcheck_xlong, pfprint_uint }, { "lX", "X", "long", pfcheck_xlong, pfprint_uint }, +#if __has_feature(capabilities) +{ "lp", "lp", "uintcap_t", pfcheck_addr, pfprint_ptr }, +#endif { "lld", "d", "long long", pfcheck_type, pfprint_sint }, { "lli", "i", "long long", pfcheck_type, pfprint_sint }, { "llo", "o", "unsigned long long", pfcheck_type, pfprint_uint }, @@ -1178,7 +1197,7 @@ dt_printf_validate(dt_pfargv_t *pfv, uint_t flags, if (pfc->pfc_print == &pfprint_sint || pfc->pfc_print == &pfprint_uint || pfc->pfc_print == &pfprint_dint) { - if (dt_node_type_size(vnp) == sizeof (uint64_t)) + if (dt_node_type_size(vnp) >= sizeof (uint64_t)) (void) strcpy(pfd->pfd_fmt, "ll"); } else if (pfc->pfc_print == &pfprint_fp) { if (dt_node_type_size(vnp) == sizeof (long double)) From 316af71250f0939b34efa92ab819761295b6b128 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sun, 26 Jan 2025 16:09:30 +0000 Subject: [PATCH 36/47] dtrace: Improve a few MD subroutines - Make dtrace_getreg() return a uintcap_t on CHERI platforms, otherwise register values get truncated, e.g., regs[R_X0]. - Make stack unwinding work better on arm64. unwind_frame() can't handle exception frames, so stack traces were previously getting truncated. This is a stopgap however, as it doesn't handle unwinding through, e.g., kernel data aborts. --- .../opensolaris/uts/common/sys/dtrace_impl.h | 2 +- sys/cddl/dev/dtrace/aarch64/dtrace_isa.c | 29 +++++++++++++++---- sys/cddl/dev/dtrace/riscv/dtrace_isa.c | 2 +- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h index 3cae1f839ec2..a126c147bd94 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h @@ -1285,7 +1285,7 @@ extern void dtrace_copyout(uintptr_t, uintcap_t, size_t, volatile uint16_t *); extern void dtrace_copyoutstr(uintptr_t, uintcap_t, size_t, volatile uint16_t *); extern void dtrace_getpcstack(pc_t *, int, int, uint32_t *); -extern ulong_t dtrace_getreg(struct trapframe *, uint_t); +extern uintcap_t dtrace_getreg(struct trapframe *, uint_t); extern int dtrace_getstackdepth(int); extern void dtrace_getupcstack(uint64_t *, int); extern void dtrace_getufpstack(uint64_t *, uint64_t *, int); diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c index 6fdaedf37b98..05a37b341213 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c @@ -75,10 +75,17 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, pcstack[depth++] = (pc_t) intrpc; } - aframes++; + if (curthread->t_dtrace_trapframe != NULL) { + struct trapframe *tf; - state.fp = (uintptr_t)__builtin_frame_address(0); - state.pc = (uintptr_t)dtrace_getpcstack; + tf = curthread->t_dtrace_trapframe; + aframes = 0; + pcstack[depth++] = tf->tf_lr; + state.fp = tf->tf_x[29]; + } else { + aframes++; + state.fp = (uintptr_t)__builtin_frame_address(0); + } while (depth < pcstack_limit) { if (!unwind_frame(curthread, &state)) @@ -136,9 +143,19 @@ dtrace_getustack_common(uint64_t *pcstack, int pcstack_limit, uintptr_t pc, if (fp == 0) break; - pc = dtrace_fuword64((void * __capability)(fp + +#if __has_feature(capabilities) + if (!cheri_can_access((void * __capability)fp, + CHERI_PERM_LOAD | CHERI_PERM_LOAD_CAP, + (ptraddr_t)fp, sizeof (struct unwind_state))) + break; + pc = dtrace_fucap( + (void * __capability)(fp + sizeof (uintcap_t))); + fp = dtrace_fucap((void * __capability)fp); +#else + pc = dtrace_fuword64((void *)(fp + offsetof(struct unwind_state, pc))); - fp = dtrace_fuword64((void * __capability)fp); + fp = dtrace_fuword64((void *)fp); +#endif if (fp == oldfp) { *flags |= CPU_DTRACE_BADSTACK; @@ -304,7 +321,7 @@ dtrace_getstackdepth(int aframes) return (depth - aframes); } -ulong_t +uintcap_t dtrace_getreg(struct trapframe *frame, uint_t reg) { switch (reg) { diff --git a/sys/cddl/dev/dtrace/riscv/dtrace_isa.c b/sys/cddl/dev/dtrace/riscv/dtrace_isa.c index 7a66d93d4ba9..ee2aff2760e0 100644 --- a/sys/cddl/dev/dtrace/riscv/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/riscv/dtrace_isa.c @@ -315,7 +315,7 @@ dtrace_getstackdepth(int aframes) return (depth - aframes); } -ulong_t +uintcap_t dtrace_getreg(struct trapframe *frame, uint_t reg) { switch (reg) { From 5a73f784c27501ecb0e81c72380b9e72497471e4 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sun, 26 Jan 2025 16:23:36 +0000 Subject: [PATCH 37/47] libdtrace: Use the right width for CPU registers --- cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c index d03347d0e7c1..e1d53ea30270 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_ident.c @@ -464,7 +464,12 @@ dt_idcook_regs(dt_node_t *dnp, dt_ident_t *idp, int argc, dt_node_t *ap) (longlong_t)ap->dn_value, idp->di_name); } - if (dt_type_lookup("uint64_t", &dtt) == -1) { +#if __has_feature(capabilities) + const char *t = "uintcap_t"; +#else + const char *t = "uint64_t"; +#endif + if (dt_type_lookup(t, &dtt) == -1) { xyerror(D_UNKNOWN, "failed to resolve type of %s: %s\n", idp->di_name, dtrace_errmsg(dtp, dtrace_errno(dtp))); } From 5f5aa500db8946f78a1c66b9bdbb04bf2229279d Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Mon, 27 Jan 2025 17:05:08 +0000 Subject: [PATCH 38/47] dtrace: Add capability load and store DIF instructions These will be emitted by the libdtrace DIF compiler when loading or storing capabilities. --- .../opensolaris/uts/common/dtrace/dtrace.c | 89 +++++++++++++++++++ .../opensolaris/uts/common/sys/dtrace.h | 8 ++ 2 files changed, 97 insertions(+) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 96c25c3af9f1..180339c3c71f 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -558,6 +558,37 @@ dtrace_load##bits(uintptr_t addr) \ return (!(*flags & CPU_DTRACE_FAULT) ? rval : 0); \ } +#if __has_feature(capabilities) +static uintcap_t +dtrace_loadcap(uintcap_t addr) +{ + size_t size = 16; + uintcap_t rval; + volatile uint16_t *flags = (volatile uint16_t *) + &cpu_core[curcpu].cpuc_dtrace_flags; + + DTRACE_ALIGNCHECK(addr, size, flags); + + for (int i = 0; i < dtrace_toxranges; i++) { + if (addr >= dtrace_toxrange[i].dtt_limit) + continue; + + if (addr + size <= dtrace_toxrange[i].dtt_base) + continue; + + *flags |= CPU_DTRACE_BADADDR; + cpu_core[curcpu].cpuc_dtrace_illval = addr; + return (0); + } + + *flags |= CPU_DTRACE_NOFAULT; + rval = *((__cheri_fromcap volatile uintcap_t *)addr); + *flags &= ~CPU_DTRACE_NOFAULT; + + return (!(*flags & CPU_DTRACE_FAULT) ? rval : 0); +} +#endif + #ifdef _LP64 #define dtrace_loadptr dtrace_load64 #else @@ -6312,6 +6343,20 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, case DIF_OP_LDX: regs[rd] = dtrace_load64(regs[r1]); break; +#if __has_feature(capabilities) + case DIF_OP_RLDC: + if (!dtrace_canload(regs[r1], 16, mstate, vstate)) + break; + /*FALLTHROUGH*/ + case DIF_OP_LDC: + regs[rd] = dtrace_loadcap(regs[r1]); + break; +#else + case DIF_OP_RLDC: + case DIF_OP_LDC: + *flags |= CPU_DTRACE_ILLOP; + break; +#endif case DIF_OP_ULDSB: DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); regs[rd] = (int8_t)dtrace_fuword8( @@ -6354,6 +6399,16 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, (void * __capability)(uintptr_t)regs[r1]); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); break; + case DIF_OP_ULDC: +#if __has_feature(capabilities) + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); + regs[rd] = dtrace_fucap( + (void * __capability)(uintcap_t)regs[r1]); + DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); +#else + *flags |= CPU_DTRACE_ILLOP; +#endif + break; case DIF_OP_RET: rval = regs[rd]; pc = textlen; @@ -6895,6 +6950,24 @@ dtrace_dif_emulate(dtrace_difo_t *difo, dtrace_mstate_t *mstate, } *((uint64_t *)(uintptr_t)regs[rd]) = regs[r1]; break; + + case DIF_OP_STC: +#if __has_feature(capabilities) + if (!dtrace_canstore(regs[rd], 16, mstate, vstate)) { + *flags |= CPU_DTRACE_BADADDR; + *illval = regs[rd]; + break; + } + if (regs[rd] & 15) { + *flags |= CPU_DTRACE_BADALIGN; + *illval = regs[rd]; + break; + } + *((uintcap_t *)(uintptr_t)regs[rd]) = regs[r1]; +#else + *flags |= CPU_DTRACE_ILLOP; +#endif + break; } } @@ -9862,6 +9935,9 @@ dtrace_difo_validate(dtrace_difo_t *dp, dtrace_vstate_t *vstate, uint_t nregs, case DIF_OP_LDUH: case DIF_OP_LDUW: case DIF_OP_LDX: +#if __has_feature(capabilities) + case DIF_OP_LDC: +#endif if (r1 >= nregs) err += efunc(pc, "invalid register %u\n", r1); if (r2 != 0) @@ -9881,6 +9957,9 @@ dtrace_difo_validate(dtrace_difo_t *dp, dtrace_vstate_t *vstate, uint_t nregs, case DIF_OP_RLDUH: case DIF_OP_RLDUW: case DIF_OP_RLDX: +#if __has_feature(capabilities) + case DIF_OP_RLDC: +#endif if (r1 >= nregs) err += efunc(pc, "invalid register %u\n", r1); if (r2 != 0) @@ -9897,6 +9976,9 @@ dtrace_difo_validate(dtrace_difo_t *dp, dtrace_vstate_t *vstate, uint_t nregs, case DIF_OP_ULDUH: case DIF_OP_ULDUW: case DIF_OP_ULDX: +#if __has_feature(capabilities) + case DIF_OP_ULDC: +#endif if (r1 >= nregs) err += efunc(pc, "invalid register %u\n", r1); if (r2 != 0) @@ -9910,6 +9992,9 @@ dtrace_difo_validate(dtrace_difo_t *dp, dtrace_vstate_t *vstate, uint_t nregs, case DIF_OP_STH: case DIF_OP_STW: case DIF_OP_STX: +#if __has_feature(capabilities) + case DIF_OP_STC: +#endif if (r1 >= nregs) err += efunc(pc, "invalid register %u\n", r1); if (r2 != 0) @@ -10447,6 +10532,10 @@ dtrace_difo_cacheable(dtrace_difo_t *dp) (op >= DIF_OP_RLDSB && op <= DIF_OP_RLDX) || op == DIF_OP_LDGA || op == DIF_OP_STTS) return (0); +#if __has_feature(capabilities) + if (op == DIF_OP_LDC || op == DIF_OP_RLDC || op == DIF_OP_ULDC) + return (0); +#endif } return (1); diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h index 794cd6ea866e..a0be67c6c798 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h @@ -211,6 +211,14 @@ typedef enum dtrace_probespec { #define DIF_OP_XLATE 78 /* xlate xlrindex, rd */ #define DIF_OP_XLARG 79 /* xlarg xlrindex, rd */ +/* + * CHERI-specific opcodes. + */ +#define DIF_OP_LDC 90 /* ldc [r1], rd */ +#define DIF_OP_ULDC 91 /* uldc [r1], rd */ +#define DIF_OP_RLDC 92 /* rldc [r1], rd */ +#define DIF_OP_STC 93 /* stc r1, [rd] */ + #define DIF_INTOFF_MAX 0xffff /* highest integer table offset */ #define DIF_STROFF_MAX 0xffff /* highest string table offset */ #define DIF_REGISTER_MAX 0xff /* highest register number */ From 0d36ec4dac79fdcfb4bef3a43aa8cda0f885bfda Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Mon, 27 Jan 2025 17:08:42 +0000 Subject: [PATCH 39/47] libdtrace: Emit LDC and STC DIF instructions when appropriate --- .../opensolaris/lib/libdtrace/common/dt_cg.c | 29 +++++++++++++++---- .../opensolaris/lib/libdtrace/common/dt_dis.c | 6 ++++ 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c index e4580a8ab340..6de079a4ff9d 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cg.c @@ -135,8 +135,8 @@ clp2(size_t x) /* * Lookup the correct load opcode to use for the specified node and CTF type. - * We determine the size and convert it to a 3-bit index. Our lookup table - * is constructed to use a 5-bit index, consisting of the 3-bit size 0-7, a + * We determine the size and convert it to a 4-bit index. Our lookup table + * is constructed to use a 6-bit index, consisting of the 4-bit size 0-15, a * bit for the sign, and a bit for userland address. For example, a 4-byte * signed load from userland would be at the following table index: * user=1 sign=1 size=4 => binary index 11011 = decimal index 27 @@ -147,12 +147,20 @@ dt_cg_load(dt_node_t *dnp, ctf_file_t *ctfp, ctf_id_t type) static const uint_t ops[] = { DIF_OP_LDUB, DIF_OP_LDUH, 0, DIF_OP_LDUW, 0, 0, 0, DIF_OP_LDX, + 0, 0, 0, 0, + 0, 0, 0, DIF_OP_LDC, DIF_OP_LDSB, DIF_OP_LDSH, 0, DIF_OP_LDSW, 0, 0, 0, DIF_OP_LDX, + 0, 0, 0, 0, + 0, 0, 0, DIF_OP_LDC, DIF_OP_ULDUB, DIF_OP_ULDUH, 0, DIF_OP_ULDUW, 0, 0, 0, DIF_OP_ULDX, + 0, 0, 0, 0, + 0, 0, 0, DIF_OP_ULDC, DIF_OP_ULDSB, DIF_OP_ULDSH, 0, DIF_OP_ULDSW, 0, 0, 0, DIF_OP_ULDX, + 0, 0, 0, 0, + 0, 0, 0, DIF_OP_ULDC, }; ctf_encoding_t e; @@ -169,7 +177,7 @@ dt_cg_load(dt_node_t *dnp, ctf_file_t *ctfp, ctf_id_t type) else size = ctf_type_size(ctfp, type); - if (size < 1 || size > 8 || (size & (size - 1)) != 0) { + if (size < 1 || size > 16 || (size & (size - 1)) != 0) { xyerror(D_UNKNOWN, "internal error -- cg cannot load " "size %ld when passed by value\n", (long)size); } @@ -177,10 +185,11 @@ dt_cg_load(dt_node_t *dnp, ctf_file_t *ctfp, ctf_id_t type) size--; /* convert size to 3-bit index */ if (dnp->dn_flags & DT_NF_SIGNED) - size |= 0x08; - if (dnp->dn_flags & DT_NF_USERLAND) size |= 0x10; + if (dnp->dn_flags & DT_NF_USERLAND) + size |= 0x20; + assert(ops[size] != 0); return (ops[size]); } @@ -445,6 +454,11 @@ dt_cg_store(dt_node_t *src, dt_irlist_t *dlp, dt_regset_t *drp, dt_node_t *dst) case 8: instr = DIF_INSTR_STORE(DIF_OP_STX, reg, dst->dn_reg); break; +#if __has_feature(capabilities) + case 16: + instr = DIF_INSTR_STORE(DIF_OP_STC, reg, dst->dn_reg); + break; +#endif default: xyerror(D_UNKNOWN, "internal error -- cg cannot store " "size %lu when passed by value\n", (ulong_t)size); @@ -1421,6 +1435,11 @@ dt_cg_xlate_member(const char *name, ctf_id_t type, ulong_t off, void *arg) case 8: instr = DIF_INSTR_STORE(DIF_OP_STX, treg, reg); break; +#if __has_feature(capabilities) + case 16: + instr = DIF_INSTR_STORE(DIF_OP_STC, treg, reg); + break; +#endif default: xyerror(D_UNKNOWN, "internal error -- unexpected " "size: %lu\n", (ulong_t)size); diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c index 41765efb7717..c37bd8f140c1 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dis.c @@ -428,6 +428,12 @@ dt_dis(const dtrace_difo_t *dp, FILE *fp) [DIF_OP_RLDX] = { "rldx", dt_dis_load }, [DIF_OP_XLATE] = { "xlate", dt_dis_xlate }, [DIF_OP_XLARG] = { "xlarg", dt_dis_xlate }, +#if __has_feature(capabilities) + [DIF_OP_LDC] = { "ldc", dt_dis_load }, + [DIF_OP_RLDC] = { "rldc", dt_dis_load }, + [DIF_OP_ULDC] = { "uldc", dt_dis_load }, + [DIF_OP_STC] = { "stc", dt_dis_store }, +#endif }; const struct opent *op; From 850a735ad7daad7e25220e788453b6a65ea538de Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 29 Jan 2025 15:16:28 +0000 Subject: [PATCH 40/47] dtrace: Permit storing capability-sized values to the trace buffer Such values are generally given 8 byte-alignment instead of 16 byte-alignment since this requires fewer modifications elsewhere and we do not preserve capability tags anyway. --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index 180339c3c71f..c0a2e66f468e 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -8021,6 +8021,12 @@ dtrace_probe(dtrace_id_t id, uintptr_t arg0, uintptr_t arg1, case sizeof (uint64_t): DTRACE_STORE(uint64_t, tomax, valoffs, val); break; +#if __has_feature(capabilities) + case sizeof (uintcap_t): + memcpy(tomax + valoffs, &val, + sizeof (dtrace_difval_t)); + break; +#endif default: /* * Any other size should have been returned by @@ -10174,6 +10180,9 @@ dtrace_difo_validate(dtrace_difo_t *dp, dtrace_vstate_t *vstate, uint_t nregs, case sizeof (uint16_t): case sizeof (uint32_t): case sizeof (uint64_t): +#if __has_feature(capabilities) + case sizeof(uintcap_t): +#endif break; default: From ba62ac3fc13c1f049b13e14335adc5afdbc21742 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 29 Jan 2025 15:25:06 +0000 Subject: [PATCH 41/47] dtrace: Fix handling of dynamic state in purecap kernels - Dynamic variable chunks need to be rounded up to the capability size in order to preserve alignment. - Dynamic variable keys may be capabilities. --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 2 +- sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index c0a2e66f468e..0a930639751b 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -10713,7 +10713,7 @@ dtrace_difo_chunksize(dtrace_difo_t *dp, dtrace_vstate_t *vstate) * We have the size. If this is larger than the chunk size * for our dynamic variable state, reset the chunk size. */ - size = P2ROUNDUP(size, sizeof (uint64_t)); + size = P2ROUNDUP(size, sizeof (uint64ptr_t)); /* * Before setting the chunk size, check that we're not going diff --git a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h index a126c147bd94..7437a85b52b8 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h +++ b/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h @@ -780,7 +780,7 @@ typedef struct dtrace_speculation { * emulation code, the hash bucket is unlocked. */ typedef struct dtrace_key { - uint64_t dttk_value; /* data value or data pointer */ + uint64ptr_t dttk_value; /* data value or data pointer */ uint64_t dttk_size; /* 0 if by-val, >0 if by-ref */ } dtrace_key_t; From 27bb3b627505ce1952d826bce0ab35ee04bff667 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 29 Jan 2025 16:28:09 +0000 Subject: [PATCH 42/47] dtrace/arm64: Avoid calling memcpy() in dtrace_getarg() memcpy() might be instrumented by FBT or kinst, so we can end up reentering dtrace_probe(), which is forbidden. We've already checked that the pointer is suitably aligned, so just dereference it directly. --- sys/cddl/dev/dtrace/aarch64/dtrace_isa.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c index 05a37b341213..675022a06869 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c @@ -276,7 +276,6 @@ dtrace_getarg(int arg, int aframes __unused) return (tf->tf_x[arg]); } else { uintptr_t p; - uint64ptr_t val; p = (tf->tf_sp + (arg - 8) * sizeof(uint64ptr_t)); if ((p & (sizeof(uint64ptr_t) - 1)) != 0) { @@ -289,8 +288,7 @@ dtrace_getarg(int arg, int aframes __unused) cpu_core[curcpu].cpuc_dtrace_illval = p; return (0); } - memcpy(&val, (void *)p, sizeof(uint64ptr_t)); - return (val); + return (*((uint64ptr_t *)p)); } } From e1917f38922ca0d7e11192864f1c7f24c04bb316 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 29 Jan 2025 16:29:40 +0000 Subject: [PATCH 43/47] dtrace/arm64: Handle purecap function prologues in kinst --- sys/cddl/dev/kinst/aarch64/kinst_isa.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sys/cddl/dev/kinst/aarch64/kinst_isa.c b/sys/cddl/dev/kinst/aarch64/kinst_isa.c index 20ca26219a55..793eaddfeb27 100644 --- a/sys/cddl/dev/kinst/aarch64/kinst_isa.c +++ b/sys/cddl/dev/kinst/aarch64/kinst_isa.c @@ -346,10 +346,22 @@ kinst_make_probe(linker_file_t lf, int symindx, linker_symval_t *symval, */ if (((*tmp >> ADDR_SHIFT) & ADDR_MASK) == 31) found = true; - } else if ((*tmp & SUB_MASK) == SUB_INSTR && + } +#ifdef __CHERI_PURE_CAPABILITY__ + else if ((*tmp & LDP_STP_MASK) == STP_C_PREIND && + ((*tmp >> ADDR_SHIFT) & ADDR_MASK) == 31) + found = true; +#endif + else if ((*tmp & SUB_MASK) == SUB_INSTR && + ((*tmp >> SUB_RD_SHIFT) & SUB_R_MASK) == 31 && + ((*tmp >> SUB_RN_SHIFT) & SUB_R_MASK) == 31) + found = true; +#ifdef __CHERI_PURE_CAPABILITY__ + else if ((*tmp & SUBC_MASK) == SUBC_INSTR && ((*tmp >> SUB_RD_SHIFT) & SUB_R_MASK) == 31 && ((*tmp >> SUB_RN_SHIFT) & SUB_R_MASK) == 31) found = true; +#endif } if (!found) From e17ac4ee48ed6ddcd3e120d966bece920b843ee1 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 29 Jan 2025 23:05:36 +0000 Subject: [PATCH 44/47] dtrace/arm64: Synthesize patchpoint capabilities The kernel linker gives us read-only capabilities for function symbol values, but we need to be able to overwrite tracepoints with breakpoints. For each tracepoint, derive a patchpoint capability from kernel_root_cap. --- sys/cddl/dev/fbt/aarch64/fbt_isa.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/cddl/dev/fbt/aarch64/fbt_isa.c b/sys/cddl/dev/fbt/aarch64/fbt_isa.c index fe5976309462..1bef59a4f21e 100644 --- a/sys/cddl/dev/fbt/aarch64/fbt_isa.c +++ b/sys/cddl/dev/fbt/aarch64/fbt_isa.c @@ -80,6 +80,19 @@ fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t val) cpu_icache_sync_range(fbt->fbtp_patchpoint, 4); } +#ifdef __CHERI_PURE_CAPABILITY__ +static fbt_patchval_t * +fbt_make_tracepoint_capability(uint32_t *instr) +{ + fbt_patchval_t *cap; + + cap = cheri_setaddress(kernel_root_cap, (ptraddr_t)instr); + cap = cheri_setbounds(cap, INSN_SIZE); + cap = cheri_andperm(cap, CHERI_PERM_STORE); + return (cap); +} +#endif + int fbt_provide_module_function(linker_file_t lf, int symindx, linker_symval_t *sym, void *opaque) @@ -172,7 +185,7 @@ fbt_provide_module_function(linker_file_t lf, int symindx, fbt->fbtp_id = dtrace_probe_create(fbt_id, modname, name, FBT_ENTRY, FBT_AFRAMES, fbt); #ifdef __CHERI_PURE_CAPABILITY__ - fbt->fbtp_patchpoint = cheri_setbounds(instr, INSN_SIZE); + fbt->fbtp_patchpoint = fbt_make_tracepoint_capability(instr); #else fbt->fbtp_patchpoint = instr; #endif @@ -223,7 +236,7 @@ fbt_provide_module_function(linker_file_t lf, int symindx, retfbt = fbt; #ifdef __CHERI_PURE_CAPABILITY__ - fbt->fbtp_patchpoint = cheri_setbounds(instr, INSN_SIZE); + fbt->fbtp_patchpoint = fbt_make_tracepoint_capability(instr); #else fbt->fbtp_patchpoint = instr; #endif From 976f0392751f6eb807c7fdf0a00839d45d85b000 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 15 Feb 2023 21:23:11 +0000 Subject: [PATCH 45/47] share/mk: Enable WITH_DTRACE by default --- share/mk/src.opts.mk | 5 ----- sys/conf/kern.opts.mk | 2 -- 2 files changed, 7 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index e04a15a3f911..5a5c79123537 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -353,11 +353,6 @@ BROKEN_OPTIONS+=NS_CACHING BROKEN_OPTIONS+=OFED .endif -.if ${__C} == "cheri" || ${__C} == "morello" || \ - ${__T:Maarch64*c*} || ${__T:Mriscv*c*} -BROKEN_OPTIONS+=DTRACE -.endif - # EFI doesn't exist on powerpc (well, officially) and doesn't work on i386 .if ${__T:Mpowerpc*} || ${__T} == "i386" BROKEN_OPTIONS+=EFI diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index 184ac735207c..9c5d77536d70 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -96,8 +96,6 @@ __DEFAULT_YES_OPTIONS += FDT .endif .if ${MACHINE_CPU:Mcheri} -# Broken post OpenZFS import -BROKEN_OPTIONS+=CDDL # iw_cxgbe fails to build BROKEN_OPTIONS+=OFED .endif From 2d0c820e432c10247ee924b7f0aa4aedcb49605c Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 15 Feb 2023 21:23:48 +0000 Subject: [PATCH 46/47] arm64: Enable KDTRACE_HOOKS in GENERIC-MORELLO Much of dtrace's functionality is now available, but with some caveats: - dtrace(1)'s -c option doesn't work yet, - capability tags are not preserved, so while they can be pretty-printed, they are always displayed as invalid, even when this is not the case, - there are no intrinsics that operate on CHERI capabilities, e.g., it's not possible to check whether a capability tag is set, - global variables accesses, e.g., `ticks, don't work, - dtrace with hybrid kernels is untested, - the kinst provider is untested and should not be used. Aside from these caveats, most of dtrace's functionality should just work. --- sys/arm64/conf/GENERIC-MORELLO | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/arm64/conf/GENERIC-MORELLO b/sys/arm64/conf/GENERIC-MORELLO index dcd888537b46..80f4db38b209 100644 --- a/sys/arm64/conf/GENERIC-MORELLO +++ b/sys/arm64/conf/GENERIC-MORELLO @@ -34,9 +34,6 @@ options CHERI_CAPREVOKE_CLEARTAGS # Needs porting to use __USER_CAP nooptions COMPAT_FREEBSD32 -# DTrace doesn't work with CHERI yet -nooptions KDTRACE_HOOKS # Kernel DTrace hooks - # Doesn't build with Morello LLVM nooptions PAC From 3003ee179b06c593d2d3606753aed96d5a19919f Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 29 Jan 2025 17:42:12 +0000 Subject: [PATCH 47/47] dtrace: Add a sysctl to block loading of dtrace.ko in CHERI kernels The DTrace port is experimental and not suitable for use in production environments. Add some friction to make sure that users understand this. --- sys/cddl/dev/dtrace/dtrace_modevent.c | 12 ++++++++++++ sys/kern/kern_dtrace.c | 8 ++++++++ sys/sys/dtrace_bsd.h | 2 ++ 3 files changed, 22 insertions(+) diff --git a/sys/cddl/dev/dtrace/dtrace_modevent.c b/sys/cddl/dev/dtrace/dtrace_modevent.c index aeb237be31a0..0263c35f214d 100644 --- a/sys/cddl/dev/dtrace/dtrace_modevent.c +++ b/sys/cddl/dev/dtrace/dtrace_modevent.c @@ -28,6 +28,18 @@ dtrace_modevent(module_t mod __unused, int type, void *data __unused) switch (type) { case MOD_LOAD: + if (!dtrace_enabled) { + printf( + "DTrace is experimental on this platform and is disabled by default.\n"); + printf( + "Set the debug.dtrace_enabled sysctl to 1 to allow dtrace.ko to load.\n"); + printf( + "Be prepared for bugs and kernel panics if you use DTrace.\n"); + printf( + "Please report bugs at https://github.com/CTSRD-CHERI/cheribsd"); + return (ENOTSUP); + } + break; case MOD_UNLOAD: diff --git a/sys/kern/kern_dtrace.c b/sys/kern/kern_dtrace.c index bc6292f5539d..d9e2c0c960be 100644 --- a/sys/kern/kern_dtrace.c +++ b/sys/kern/kern_dtrace.c @@ -48,6 +48,14 @@ FEATURE(kdtrace_hooks, static MALLOC_DEFINE(M_KDTRACE, "kdtrace", "DTrace hooks"); +#if __has_feature(capabilities) +int dtrace_enabled = 0; +#else +int dtrace_enabled = 1; +#endif +SYSCTL_INT(_debug, OID_AUTO, dtrace_enabled, CTLFLAG_RWTUN, &dtrace_enabled, 0, + "DTrace enabled"); + /* Hooks used in the machine-dependent trap handlers. */ dtrace_trap_func_t dtrace_trap_func; dtrace_doubletrap_func_t dtrace_doubletrap_func; diff --git a/sys/sys/dtrace_bsd.h b/sys/sys/dtrace_bsd.h index 4d5f9d827728..8fc0d07c18e9 100644 --- a/sys/sys/dtrace_bsd.h +++ b/sys/sys/dtrace_bsd.h @@ -175,4 +175,6 @@ void kdtrace_thread_dtor(struct thread *td); uint64_t dtrace_gethrtime(void); uint64_t dtrace_gethrestime(void); +extern int dtrace_enabled; + #endif /* _SYS_DTRACE_BSD_H */