diff options
-rw-r--r-- | arch/mips/Makefile | 12 | ||||
-rw-r--r-- | include/asm-mips/page.h | 2 | ||||
-rw-r--r-- | include/asm-mips/pgtable-64.h | 2 | ||||
-rw-r--r-- | include/asm-mips/stackframe.h | 12 |
4 files changed, 13 insertions, 15 deletions
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 4337c492ed1b..ce7e02e613a7 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
@@ -577,19 +577,17 @@ endif | |||
577 | # Automatically detect the build format. By default we choose | 577 | # Automatically detect the build format. By default we choose |
578 | # the elf format according to the load address. | 578 | # the elf format according to the load address. |
579 | # We can always force a build with a 64-bits symbol format by | 579 | # We can always force a build with a 64-bits symbol format by |
580 | # passing 'BUILD_ELF32=no' option to the make's command line. | 580 | # passing 'KBUILD_SYM32=no' option to the make's command line. |
581 | # | 581 | # |
582 | ifdef CONFIG_64BIT | 582 | ifdef CONFIG_64BIT |
583 | ifndef BUILD_ELF32 | 583 | ifndef KBUILD_SYM32 |
584 | ifeq ($(shell expr $(load-y) \< 0xffffffff80000000), 0) | 584 | ifeq ($(shell expr $(load-y) \< 0xffffffff80000000), 0) |
585 | BUILD_ELF32 = y | 585 | KBUILD_SYM32 = y |
586 | endif | 586 | endif |
587 | endif | 587 | endif |
588 | 588 | ||
589 | ifeq ($(BUILD_ELF32), y) | 589 | ifeq ($(KBUILD_SYM32), y) |
590 | cflags-y += -msym32 | 590 | cflags-y += -msym32 -DKBUILD_64BIT_SYM32 |
591 | else | ||
592 | cflags-y += -DCONFIG_BUILD_ELF64 | ||
593 | endif | 591 | endif |
594 | endif | 592 | endif |
595 | 593 | ||
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index b92dd8c760da..c90fe560a0d9 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h | |||
@@ -142,7 +142,7 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
142 | /* | 142 | /* |
143 | * __pa()/__va() should be used only during mem init. | 143 | * __pa()/__va() should be used only during mem init. |
144 | */ | 144 | */ |
145 | #if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) | 145 | #ifdef KBUILD_64BIT_SYM32 |
146 | #define __pa(x) \ | 146 | #define __pa(x) \ |
147 | ({ \ | 147 | ({ \ |
148 | unsigned long __x = (unsigned long)(x); \ | 148 | unsigned long __x = (unsigned long)(x); \ |
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h index 49f5a1a2dfcd..a8aed9c6a159 100644 --- a/include/asm-mips/pgtable-64.h +++ b/include/asm-mips/pgtable-64.h | |||
@@ -104,7 +104,7 @@ | |||
104 | #define VMALLOC_START MAP_BASE | 104 | #define VMALLOC_START MAP_BASE |
105 | #define VMALLOC_END \ | 105 | #define VMALLOC_END \ |
106 | (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) | 106 | (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) |
107 | #if defined(CONFIG_MODULES) && !defined(CONFIG_BUILD_ELF64) && \ | 107 | #if defined(CONFIG_MODULES) && defined(KBUILD_64BIT_SYM32) && \ |
108 | VMALLOC_START != CKSSEG | 108 | VMALLOC_START != CKSSEG |
109 | /* Load modules into 32bit-compatible segment. */ | 109 | /* Load modules into 32bit-compatible segment. */ |
110 | #define MODULE_START CKSSEG | 110 | #define MODULE_START CKSSEG |
diff --git a/include/asm-mips/stackframe.h b/include/asm-mips/stackframe.h index ed33366b85b8..59334f598b78 100644 --- a/include/asm-mips/stackframe.h +++ b/include/asm-mips/stackframe.h | |||
@@ -91,14 +91,14 @@ | |||
91 | #else | 91 | #else |
92 | MFC0 k0, CP0_CONTEXT | 92 | MFC0 k0, CP0_CONTEXT |
93 | #endif | 93 | #endif |
94 | #if defined(CONFIG_BUILD_ELF64) || (defined(CONFIG_64BIT) && __GNUC__ < 4) | 94 | #if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32) |
95 | lui k1, %hi(kernelsp) | ||
96 | #else | ||
95 | lui k1, %highest(kernelsp) | 97 | lui k1, %highest(kernelsp) |
96 | daddiu k1, %higher(kernelsp) | 98 | daddiu k1, %higher(kernelsp) |
97 | dsll k1, 16 | 99 | dsll k1, 16 |
98 | daddiu k1, %hi(kernelsp) | 100 | daddiu k1, %hi(kernelsp) |
99 | dsll k1, 16 | 101 | dsll k1, 16 |
100 | #else | ||
101 | lui k1, %hi(kernelsp) | ||
102 | #endif | 102 | #endif |
103 | LONG_SRL k0, PTEBASE_SHIFT | 103 | LONG_SRL k0, PTEBASE_SHIFT |
104 | LONG_ADDU k1, k0 | 104 | LONG_ADDU k1, k0 |
@@ -116,14 +116,14 @@ | |||
116 | .endm | 116 | .endm |
117 | #else | 117 | #else |
118 | .macro get_saved_sp /* Uniprocessor variation */ | 118 | .macro get_saved_sp /* Uniprocessor variation */ |
119 | #if defined(CONFIG_BUILD_ELF64) || (defined(CONFIG_64BIT) && __GNUC__ < 4) | 119 | #if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32) |
120 | lui k1, %hi(kernelsp) | ||
121 | #else | ||
120 | lui k1, %highest(kernelsp) | 122 | lui k1, %highest(kernelsp) |
121 | daddiu k1, %higher(kernelsp) | 123 | daddiu k1, %higher(kernelsp) |
122 | dsll k1, k1, 16 | 124 | dsll k1, k1, 16 |
123 | daddiu k1, %hi(kernelsp) | 125 | daddiu k1, %hi(kernelsp) |
124 | dsll k1, k1, 16 | 126 | dsll k1, k1, 16 |
125 | #else | ||
126 | lui k1, %hi(kernelsp) | ||
127 | #endif | 127 | #endif |
128 | LONG_L k1, %lo(kernelsp)(k1) | 128 | LONG_L k1, %lo(kernelsp)(k1) |
129 | .endm | 129 | .endm |