cregit-Linux how code gets into the kernel

Release 4.10 tools/testing/selftests/powerpc/tm/tm.h

/*
 * Copyright 2015, Michael Ellerman, IBM Corp.
 * Licensed under GPLv2.
 */

#ifndef _SELFTESTS_POWERPC_TM_TM_H

#define _SELFTESTS_POWERPC_TM_TM_H

#include <asm/tm.h>
#include <asm/cputable.h>
#include <stdbool.h>

#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 }

Contributors

PersonTokensPropCommitsCommitProp
michael ellermanmichael ellerman30100.00%1100.00%
Total30100.00%1100.00%


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 }

Contributors

PersonTokensPropCommitsCommitProp
michael ellermanmichael ellerman30100.00%1100.00%
Total30100.00%1100.00%


static inline long failure_code(void) { return __builtin_get_texasru() >> 24; }

Contributors

PersonTokensPropCommitsCommitProp
cyril burcyril bur15100.00%1100.00%
Total15100.00%1100.00%


static inline bool failure_is_persistent(void) { return (failure_code() & TM_CAUSE_PERSISTENT) == TM_CAUSE_PERSISTENT; }

Contributors

PersonTokensPropCommitsCommitProp
cyril burcyril bur19100.00%1100.00%
Total19100.00%1100.00%


static inline bool failure_is_syscall(void) { return (failure_code() & TM_CAUSE_SYSCALL) == TM_CAUSE_SYSCALL; }

Contributors

PersonTokensPropCommitsCommitProp
cyril burcyril bur19100.00%1100.00%
Total19100.00%1100.00%


static inline bool failure_is_nesting(void) { return (__builtin_get_texasru() & 0x400000); }

Contributors

PersonTokensPropCommitsCommitProp
cyril burcyril bur17100.00%1100.00%
Total17100.00%1100.00%


static inline int tcheck(void) { long cr; asm volatile ("tcheck 0" : "=r"(cr) : : "cr0"); return (cr >> 28) & 4; }

Contributors

PersonTokensPropCommitsCommitProp
cyril burcyril bur24100.00%1100.00%
Total24100.00%1100.00%


static inline bool tcheck_doomed(void) { return tcheck() & 8; }

Contributors

PersonTokensPropCommitsCommitProp
cyril burcyril bur15100.00%1100.00%
Total15100.00%1100.00%


static inline bool tcheck_active(void) { return tcheck() & 4; }

Contributors

PersonTokensPropCommitsCommitProp
cyril burcyril bur15100.00%1100.00%
Total15100.00%1100.00%


static inline bool tcheck_suspended(void) { return tcheck() & 2; }

Contributors

PersonTokensPropCommitsCommitProp
cyril burcyril bur15100.00%1100.00%
Total15100.00%1100.00%


static inline bool tcheck_transactional(void) { return tcheck() & 6; }

Contributors

PersonTokensPropCommitsCommitProp
cyril burcyril bur15100.00%1100.00%
Total15100.00%1100.00%

#endif /* _SELFTESTS_POWERPC_TM_TM_H */

Overall Contributors

PersonTokensPropCommitsCommitProp
cyril burcyril bur15866.95%250.00%
michael ellermanmichael ellerman7732.63%125.00%
simon guosimon guo10.42%125.00%
Total236100.00%4100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.