mem: move printing of mmap_flags to a separate function
* mem.c (print_mmap_flags): New function. (print_mmap, SYS_FUNC(remap_file_pages)): Use it.
This commit is contained in:
parent
1abb9ffd20
commit
078ecf4049
25
mem.c
25
mem.c
@ -55,6 +55,17 @@ SYS_FUNC(brk)
|
|||||||
#include "xlat/mmap_prot.h"
|
#include "xlat/mmap_prot.h"
|
||||||
#include "xlat/mmap_flags.h"
|
#include "xlat/mmap_flags.h"
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_mmap_flags(kernel_ulong_t flags)
|
||||||
|
{
|
||||||
|
#ifdef MAP_TYPE
|
||||||
|
printxval64(mmap_flags, flags & MAP_TYPE, "MAP_???");
|
||||||
|
addflags(mmap_flags, flags & ~MAP_TYPE);
|
||||||
|
#else
|
||||||
|
printflags64(mmap_flags, flags, "MAP_???");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_mmap(struct tcb *tcp, kernel_ulong_t *u_arg, unsigned long long offset)
|
print_mmap(struct tcb *tcp, kernel_ulong_t *u_arg, unsigned long long offset)
|
||||||
{
|
{
|
||||||
@ -68,12 +79,7 @@ print_mmap(struct tcb *tcp, kernel_ulong_t *u_arg, unsigned long long offset)
|
|||||||
tprintf(", %" PRI_klu ", ", len);
|
tprintf(", %" PRI_klu ", ", len);
|
||||||
printflags64(mmap_prot, prot, "PROT_???");
|
printflags64(mmap_prot, prot, "PROT_???");
|
||||||
tprints(", ");
|
tprints(", ");
|
||||||
#ifdef MAP_TYPE
|
print_mmap_flags(flags);
|
||||||
printxval64(mmap_flags, flags & MAP_TYPE, "MAP_???");
|
|
||||||
addflags(mmap_flags, flags & ~MAP_TYPE);
|
|
||||||
#else
|
|
||||||
printflags64(mmap_flags, flags, "MAP_???");
|
|
||||||
#endif
|
|
||||||
tprints(", ");
|
tprints(", ");
|
||||||
printfd(tcp, fd);
|
printfd(tcp, fd);
|
||||||
tprintf(", %#llx", offset);
|
tprintf(", %#llx", offset);
|
||||||
@ -317,12 +323,7 @@ SYS_FUNC(remap_file_pages)
|
|||||||
tprintf(", %" PRI_klu ", ", size);
|
tprintf(", %" PRI_klu ", ", size);
|
||||||
printflags64(mmap_prot, prot, "PROT_???");
|
printflags64(mmap_prot, prot, "PROT_???");
|
||||||
tprintf(", %" PRI_klu ", ", pgoff);
|
tprintf(", %" PRI_klu ", ", pgoff);
|
||||||
#ifdef MAP_TYPE
|
print_mmap_flags(flags);
|
||||||
printxval64(mmap_flags, flags & MAP_TYPE, "MAP_???");
|
|
||||||
addflags(mmap_flags, flags & ~MAP_TYPE);
|
|
||||||
#else
|
|
||||||
printflags64(mmap_flags, flags, "MAP_???");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return RVAL_DECODED;
|
return RVAL_DECODED;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user