/* * Copyright 2015, Michael Ellerman, IBM Corp. * Licensed under GPLv2. */ #ifndef _SELFTESTS_POWERPC_TM_TM_H #define _SELFTESTS_POWERPC_TM_TM_H #include #include #include #include "utils.h" static inline bool have_htm(void) { #ifdef PPC_FEATURE2_HTM return have_hwcap2(PPC_FEATURE2_HTM); #else printf("PPC_FEATURE2_HTM not defined, can't check AT_HWCAP2\n"); return false; #endif } static inline bool have_htm_nosc(void) { #ifdef PPC_FEATURE2_HTM_NOSC return have_hwcap2(PPC_FEATURE2_HTM_NOSC); #else printf("PPC_FEATURE2_HTM_NOSC not defined, can't check AT_HWCAP2\n"); return false; #endif } static inline long failure_code(void) { return __builtin_get_texasru() >> 24; } static inline bool failure_is_persistent(void) { return (failure_code() & TM_CAUSE_PERSISTENT) == TM_CAUSE_PERSISTENT; } static inline bool failure_is_syscall(void) { return (failure_code() & TM_CAUSE_SYSCALL) == TM_CAUSE_SYSCALL; } static inline bool failure_is_nesting(void) { return (__builtin_get_texasru() & 0x400000); } static inline int tcheck(void) { long cr; asm volatile ("tcheck 0" : "=r"(cr) : : "cr0"); return (cr >> 28) & 4; } static inline bool tcheck_doomed(void) { return tcheck() & 8; } static inline bool tcheck_active(void) { return tcheck() & 4; } static inline bool tcheck_suspended(void) { return tcheck() & 2; } static inline bool tcheck_transactional(void) { return tcheck() & 6; } #endif /* _SELFTESTS_POWERPC_TM_TM_H */ r> summaryrefslogtreecommitdiff
path: root/tools/lib
diff options
context:
space:
mode:
authorMickaël Salaün <mic@digikod.net>2017-02-10 00:21:40 +0100
committerDavid S. Miller <davem@davemloft.net>2017-02-10 15:56:07 -0500
commite5ff7c4019c6cb6e86bc9d6d16e8a8f921133c70 (patch)
treec3060074ae5ccfa0ddb873d09ab08e4992de855a /tools/lib
parent10ecc728fe12dbd206e2d4d8b6e96082632b969c (diff)
bpf: Use bpf_map_lookup_elem() from the library
Replace bpf_map_lookup() with bpf_map_lookup_elem() calls. Signed-off-by: Mickaël Salaün <mic@digikod.net> Cc: Alexei Starovoitov <ast@fb.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/bpf/bpf.c2
-rw-r--r--tools/lib/bpf/bpf.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c