]> granicus.if.org Git - strace/commitdiff
bpf: change address argument type from long to kernel_ureg_t
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 21 Dec 2016 02:43:47 +0000 (02:43 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 25 Dec 2016 11:32:44 +0000 (11:32 +0000)
* bpf.c (bpf_map_create, bpf_map_update_elem, bpf_map_delete_elem,
bpf_map_io, bpf_prog_load, SYS_FUNC(bpf)): Change address argument
type from long to kernel_ureg_t.

bpf.c

diff --git a/bpf.c b/bpf.c
index 20070b371bf33c1d1cc91481e6bf01c86c98356f..d18c05df8256f397ead39b71b3c1fd900378ed8c 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_ureg_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_ureg_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_ureg_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_ureg_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_ureg_t addr,
+             unsigned int size)
 {
        struct {
                uint32_t prog_type, insn_cnt;
@@ -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_ureg_t addr = tcp->u_arg[1];
        const unsigned int size = tcp->u_arg[2];
        int rc = RVAL_DECODED;