/* * 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 */ b'>net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2016-11-16 12:21:19 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-12-21 06:53:17 -0200
commit9447082ae666fbf3adbe9c9152117daa31a8b737 (patch)
tree6838078a92f113c1097ebd7c46c51fb074f04251 /include/crypto/internal/rng.h
parentd183e4efcae8d88a2f252e546978658ca6d273cc (diff)
[media] smiapp: Implement power-on and power-off sequences without runtime PM
Power on the sensor when the module is loaded and power it off when it is removed. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/crypto/internal/rng.h')