diff options
-rw-r--r-- | arch/um/include/choose-mode.h | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/arch/um/include/choose-mode.h b/arch/um/include/choose-mode.h index 8e6b62f5e9ac..f25fa83a5da6 100644 --- a/arch/um/include/choose-mode.h +++ b/arch/um/include/choose-mode.h | |||
@@ -11,6 +11,13 @@ | |||
11 | #if defined(UML_CONFIG_MODE_TT) && defined(UML_CONFIG_MODE_SKAS) | 11 | #if defined(UML_CONFIG_MODE_TT) && defined(UML_CONFIG_MODE_SKAS) |
12 | #define CHOOSE_MODE(tt, skas) (mode_tt ? (tt) : (skas)) | 12 | #define CHOOSE_MODE(tt, skas) (mode_tt ? (tt) : (skas)) |
13 | 13 | ||
14 | extern int mode_tt; | ||
15 | static inline void *__choose_mode(void *tt, void *skas) { | ||
16 | return mode_tt ? tt : skas; | ||
17 | } | ||
18 | |||
19 | #define __CHOOSE_MODE(tt, skas) (*( (typeof(tt) *) __choose_mode(&(tt), &(skas)))) | ||
20 | |||
14 | #elif defined(UML_CONFIG_MODE_SKAS) | 21 | #elif defined(UML_CONFIG_MODE_SKAS) |
15 | #define CHOOSE_MODE(tt, skas) (skas) | 22 | #define CHOOSE_MODE(tt, skas) (skas) |
16 | 23 | ||
@@ -21,22 +28,8 @@ | |||
21 | #define CHOOSE_MODE_PROC(tt, skas, args...) \ | 28 | #define CHOOSE_MODE_PROC(tt, skas, args...) \ |
22 | CHOOSE_MODE(tt(args), skas(args)) | 29 | CHOOSE_MODE(tt(args), skas(args)) |
23 | 30 | ||
24 | extern int mode_tt; | 31 | #ifndef __CHOOSE_MODE |
25 | static inline void *__choose_mode(void *tt, void *skas) { | 32 | #define __CHOOSE_MODE(tt, skas) CHOOSE_MODE(tt, skas) |
26 | return mode_tt ? tt : skas; | ||
27 | } | ||
28 | |||
29 | #define __CHOOSE_MODE(tt, skas) (*( (typeof(tt) *) __choose_mode(&(tt), &(skas)))) | ||
30 | |||
31 | #endif | 33 | #endif |
32 | 34 | ||
33 | /* | 35 | #endif |
34 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
35 | * Emacs will notice this stuff at the end of the file and automatically | ||
36 | * adjust the settings for this buffer only. This must remain at the end | ||
37 | * of the file. | ||
38 | * --------------------------------------------------------------------------- | ||
39 | * Local variables: | ||
40 | * c-file-style: "linux" | ||
41 | * End: | ||
42 | */ | ||