diff options
Diffstat (limited to 'arch/um/include/as-layout.h')
-rw-r--r-- | arch/um/include/as-layout.h | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/arch/um/include/as-layout.h b/arch/um/include/as-layout.h index a5cdf953e04a..2b859e020ac6 100644 --- a/arch/um/include/as-layout.h +++ b/arch/um/include/as-layout.h | |||
@@ -10,23 +10,31 @@ | |||
10 | #include "kern_constants.h" | 10 | #include "kern_constants.h" |
11 | 11 | ||
12 | /* | 12 | /* |
13 | * Assembly doesn't want any casting, but C does, so define these | 13 | * Stolen from linux/const.h, which can't be directly included since |
14 | * without casts here, and define new symbols with casts inside the C | 14 | * this is used in userspace code, which has no access to the kernel |
15 | * section. | 15 | * headers. Changed to be suitable for adding casts to the start, |
16 | * rather than "UL" to the end. | ||
16 | */ | 17 | */ |
17 | #define ASM_STUB_CODE (UML_CONFIG_TOP_ADDR - 2 * UM_KERN_PAGE_SIZE) | ||
18 | #define ASM_STUB_DATA (UML_CONFIG_TOP_ADDR - UM_KERN_PAGE_SIZE) | ||
19 | #define ASM_STUB_START ASM_STUB_CODE | ||
20 | 18 | ||
21 | /* | 19 | /* Some constant macros are used in both assembler and |
22 | * This file is included by the assembly stubs, which just want the | 20 | * C code. Therefore we cannot annotate them always with |
23 | * definitions above. | 21 | * 'UL' and other type specifiers unilaterally. We |
22 | * use the following macros to deal with this. | ||
24 | */ | 23 | */ |
25 | #ifndef __ASSEMBLY__ | ||
26 | 24 | ||
27 | #define STUB_CODE ((unsigned long) ASM_STUB_CODE) | 25 | #ifdef __ASSEMBLY__ |
28 | #define STUB_DATA ((unsigned long) ASM_STUB_DATA) | 26 | #define _AC(X, Y) (Y) |
29 | #define STUB_START ((unsigned long) ASM_STUB_START) | 27 | #else |
28 | #define __AC(X, Y) (X (Y)) | ||
29 | #define _AC(X, Y) __AC(X, Y) | ||
30 | #endif | ||
31 | |||
32 | #define STUB_CODE _AC((unsigned long), \ | ||
33 | UML_CONFIG_TOP_ADDR - 2 * UM_KERN_PAGE_SIZE) | ||
34 | #define STUB_DATA _AC((unsigned long), UML_CONFIG_TOP_ADDR - UM_KERN_PAGE_SIZE) | ||
35 | #define STUB_START _AC(, STUB_CODE) | ||
36 | |||
37 | #ifndef __ASSEMBLY__ | ||
30 | 38 | ||
31 | #include "sysdep/ptrace.h" | 39 | #include "sysdep/ptrace.h" |
32 | 40 | ||