diff options
| author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-05-15 10:26:50 -0400 |
|---|---|---|
| committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-05-15 10:26:50 -0400 |
| commit | 12e04ffcd93b25dfd726d46338c2ee7d23de556e (patch) | |
| tree | f91479a62805619168994fd3ee55e3ffa23fc24e /include/linux/context_tracking.h | |
| parent | 9eff37a8713939f218ab8bf0dc93f1d67af7b8b4 (diff) | |
| parent | f722406faae2d073cc1d01063d1123c35425939e (diff) | |
Merge tag 'v3.10-rc1' into stable/for-linus-3.10
Linux 3.10-rc1
* tag 'v3.10-rc1': (12273 commits)
Linux 3.10-rc1
[SCSI] qla2xxx: Update firmware link in Kconfig file.
[SCSI] iscsi class, qla4xxx: fix sess/conn refcounting when find fns are used
[SCSI] sas: unify the pointlessly separated enums sas_dev_type and sas_device_type
[SCSI] pm80xx: thermal, sas controller config and error handling update
[SCSI] pm80xx: NCQ error handling changes
[SCSI] pm80xx: WWN Modification for PM8081/88/89 controllers
[SCSI] pm80xx: Changed module name and debug messages update
[SCSI] pm80xx: Firmware flash memory free fix, with addition of new memory region for it
[SCSI] pm80xx: SPC new firmware changes for device id 0x8081 alone
[SCSI] pm80xx: Added SPCv/ve specific hardware functionalities and relevant changes in common files
[SCSI] pm80xx: MSI-X implementation for using 64 interrupts
[SCSI] pm80xx: Updated common functions common for SPC and SPCv/ve
[SCSI] pm80xx: Multiple inbound/outbound queue configuration
[SCSI] pm80xx: Added SPCv/ve specific ids, variables and modify for SPC
[SCSI] lpfc: fix up Kconfig dependencies
[SCSI] Handle MLQUEUE busy response in scsi_send_eh_cmnd
dm cache: set config value
dm cache: move config fns
dm thin: generate event when metadata threshold passed
...
Diffstat (limited to 'include/linux/context_tracking.h')
| -rw-r--r-- | include/linux/context_tracking.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index b28d161c1091..365f4a61bf04 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h | |||
| @@ -1,9 +1,9 @@ | |||
| 1 | #ifndef _LINUX_CONTEXT_TRACKING_H | 1 | #ifndef _LINUX_CONTEXT_TRACKING_H |
| 2 | #define _LINUX_CONTEXT_TRACKING_H | 2 | #define _LINUX_CONTEXT_TRACKING_H |
| 3 | 3 | ||
| 4 | #ifdef CONFIG_CONTEXT_TRACKING | ||
| 5 | #include <linux/sched.h> | 4 | #include <linux/sched.h> |
| 6 | #include <linux/percpu.h> | 5 | #include <linux/percpu.h> |
| 6 | #include <asm/ptrace.h> | ||
| 7 | 7 | ||
| 8 | struct context_tracking { | 8 | struct context_tracking { |
| 9 | /* | 9 | /* |
| @@ -13,12 +13,13 @@ struct context_tracking { | |||
| 13 | * may be further optimized using static keys. | 13 | * may be further optimized using static keys. |
| 14 | */ | 14 | */ |
| 15 | bool active; | 15 | bool active; |
| 16 | enum { | 16 | enum ctx_state { |
| 17 | IN_KERNEL = 0, | 17 | IN_KERNEL = 0, |
| 18 | IN_USER, | 18 | IN_USER, |
| 19 | } state; | 19 | } state; |
| 20 | }; | 20 | }; |
| 21 | 21 | ||
| 22 | #ifdef CONFIG_CONTEXT_TRACKING | ||
| 22 | DECLARE_PER_CPU(struct context_tracking, context_tracking); | 23 | DECLARE_PER_CPU(struct context_tracking, context_tracking); |
| 23 | 24 | ||
| 24 | static inline bool context_tracking_in_user(void) | 25 | static inline bool context_tracking_in_user(void) |
| @@ -33,12 +34,31 @@ static inline bool context_tracking_active(void) | |||
| 33 | 34 | ||
| 34 | extern void user_enter(void); | 35 | extern void user_enter(void); |
| 35 | extern void user_exit(void); | 36 | extern void user_exit(void); |
| 37 | |||
| 38 | static inline enum ctx_state exception_enter(void) | ||
| 39 | { | ||
| 40 | enum ctx_state prev_ctx; | ||
| 41 | |||
| 42 | prev_ctx = this_cpu_read(context_tracking.state); | ||
| 43 | user_exit(); | ||
| 44 | |||
| 45 | return prev_ctx; | ||
| 46 | } | ||
| 47 | |||
| 48 | static inline void exception_exit(enum ctx_state prev_ctx) | ||
| 49 | { | ||
| 50 | if (prev_ctx == IN_USER) | ||
| 51 | user_enter(); | ||
| 52 | } | ||
| 53 | |||
| 36 | extern void context_tracking_task_switch(struct task_struct *prev, | 54 | extern void context_tracking_task_switch(struct task_struct *prev, |
| 37 | struct task_struct *next); | 55 | struct task_struct *next); |
| 38 | #else | 56 | #else |
| 39 | static inline bool context_tracking_in_user(void) { return false; } | 57 | static inline bool context_tracking_in_user(void) { return false; } |
| 40 | static inline void user_enter(void) { } | 58 | static inline void user_enter(void) { } |
| 41 | static inline void user_exit(void) { } | 59 | static inline void user_exit(void) { } |
| 60 | static inline enum ctx_state exception_enter(void) { return 0; } | ||
| 61 | static inline void exception_exit(enum ctx_state prev_ctx) { } | ||
| 42 | static inline void context_tracking_task_switch(struct task_struct *prev, | 62 | static inline void context_tracking_task_switch(struct task_struct *prev, |
| 43 | struct task_struct *next) { } | 63 | struct task_struct *next) { } |
| 44 | #endif /* !CONFIG_CONTEXT_TRACKING */ | 64 | #endif /* !CONFIG_CONTEXT_TRACKING */ |
