]> granicus.if.org Git - strace/blobdiff - bpf.c
Remove HAVE_STRUCT_TCB_EXT_ARG, ext_arg, and u_lrval
[strace] / bpf.c
diff --git a/bpf.c b/bpf.c
index 20070b371bf33c1d1cc91481e6bf01c86c98356f..04c677a173adfc348830b2f3311fdcb7ad43b5e8 100644 (file)
--- a/bpf.c
+++ b/bpf.c
@@ -37,7 +37,8 @@
 #include "xlat/bpf_map_update_elem_flags.h"
 
 static int
-bpf_map_create(struct tcb *tcp, const long addr, unsigned int size)
+bpf_map_create(struct tcb *const tcp, const kernel_ulong_t addr,
+              unsigned int size)
 {
        struct {
                uint32_t map_type, key_size, value_size, max_entries;
@@ -61,7 +62,8 @@ bpf_map_create(struct tcb *tcp, const long addr, unsigned int size)
 }
 
 static void
-bpf_map_update_elem(struct tcb *tcp, const long addr, unsigned int size)
+bpf_map_update_elem(struct tcb *const tcp, const kernel_ulong_t addr,
+                   unsigned int size)
 {
        struct {
                uint32_t map_fd;
@@ -88,7 +90,8 @@ bpf_map_update_elem(struct tcb *tcp, const long addr, unsigned int size)
 }
 
 static void
-bpf_map_delete_elem(struct tcb *tcp, const long addr, unsigned int size)
+bpf_map_delete_elem(struct tcb *const tcp, const kernel_ulong_t addr,
+                   unsigned int size)
 {
        struct {
                uint32_t map_fd;
@@ -110,7 +113,8 @@ bpf_map_delete_elem(struct tcb *tcp, const long addr, unsigned int size)
 }
 
 static int
-bpf_map_io(struct tcb *tcp, const long addr, unsigned int size, const char *text)
+bpf_map_io(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int size,
+          const char *const text)
 {
        struct bpf_io_elem_struct {
                uint32_t map_fd;
@@ -142,7 +146,8 @@ bpf_map_io(struct tcb *tcp, const long addr, unsigned int size, const char *text
 }
 
 static int
-bpf_prog_load(struct tcb *tcp, const long addr, unsigned int size)
+bpf_prog_load(struct tcb *const tcp, const kernel_ulong_t addr,
+             unsigned int size)
 {
        struct {
                uint32_t prog_type, insn_cnt;
@@ -165,7 +170,7 @@ bpf_prog_load(struct tcb *tcp, const long addr, unsigned int size)
        printxval(bpf_prog_types, attr.prog_type, "BPF_PROG_TYPE_???");
        tprintf(", insn_cnt=%u, insns=%#" PRIx64 ", license=",
                attr.insn_cnt, attr.insns);
-       printstr(tcp, attr.license, -1);
+       printstr(tcp, attr.license);
        tprintf(", log_level=%u, log_size=%u, log_buf=%#" PRIx64 ", kern_version=%u}",
                attr.log_level, attr.log_size, attr.log_buf, attr.kern_version);
 
@@ -174,8 +179,8 @@ bpf_prog_load(struct tcb *tcp, const long addr, unsigned int size)
 
 SYS_FUNC(bpf)
 {
-       const int cmd = tcp->u_arg[0];
-       const long addr = tcp->u_arg[1];
+       const unsigned int cmd = tcp->u_arg[0];
+       const kernel_ulong_t addr = tcp->u_arg[1];
        const unsigned int size = tcp->u_arg[2];
        int rc = RVAL_DECODED;