cregit-Linux how code gets into the kernel

Release 4.11 tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/preempt.h

#ifndef PREEMPT_H

#define PREEMPT_H

#include <stdbool.h>

#include "bug_on.h"

/* This flag contains garbage if preempt_disable_count is 0. */
extern __thread int thread_cpu_id;

/* Support recursive preemption disabling. */
extern __thread int preempt_disable_count;

void preempt_disable(void);
void preempt_enable(void);


static inline void preempt_disable_notrace(void) { preempt_disable(); }

Contributors

PersonTokensPropCommitsCommitProp
Lance Roy12100.00%1100.00%
Total12100.00%1100.00%


static inline void preempt_enable_no_resched(void) { preempt_enable(); }

Contributors

PersonTokensPropCommitsCommitProp
Lance Roy12100.00%1100.00%
Total12100.00%1100.00%


static inline void preempt_enable_notrace(void) { preempt_enable(); }

Contributors

PersonTokensPropCommitsCommitProp
Lance Roy12100.00%1100.00%
Total12100.00%1100.00%


static inline int preempt_count(void) { return preempt_disable_count; }

Contributors

PersonTokensPropCommitsCommitProp
Lance Roy12100.00%1100.00%
Total12100.00%1100.00%


static inline bool preemptible(void) { return !preempt_count(); }

Contributors

PersonTokensPropCommitsCommitProp
Lance Roy14100.00%1100.00%
Total14100.00%1100.00%


static inline int get_cpu(void) { preempt_disable(); return thread_cpu_id; }

Contributors

PersonTokensPropCommitsCommitProp
Lance Roy15100.00%1100.00%
Total15100.00%1100.00%


static inline void put_cpu(void) { preempt_enable(); }

Contributors

PersonTokensPropCommitsCommitProp
Lance Roy12100.00%1100.00%
Total12100.00%1100.00%


static inline void might_sleep(void) { BUG_ON(preempt_disable_count); }

Contributors

PersonTokensPropCommitsCommitProp
Lance Roy14100.00%1100.00%
Total14100.00%1100.00%

#endif

Overall Contributors

PersonTokensPropCommitsCommitProp
Lance Roy141100.00%1100.00%
Total141100.00%1100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.