File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,6 +92,9 @@ config CPU_BIG_ENDIAN
9292config CPU_LITTLE_ENDIAN
9393 def_bool !CPU_BIG_ENDIAN
9494
95+ config CC_HAVE_CALL0_ABI
96+ def_bool $(success,test "$(shell,echo __XTENSA_CALL0_ABI__ | $(CC) -mabi=call0 -E -P - 2>/dev/null)" = 1)
97+
9598menu "Processor type and features"
9699
97100choice
@@ -250,6 +253,38 @@ config FAST_SYSCALL_SPILL_REGISTERS
250253
251254 If unsure, say N.
252255
256+ choice
257+ prompt "Kernel ABI"
258+ default KERNEL_ABI_DEFAULT
259+ help
260+ Select ABI for the kernel code. This ABI is independent of the
261+ supported userspace ABI and any combination of the
262+ kernel/userspace ABI is possible and should work.
263+
264+ In case both kernel and userspace support only call0 ABI
265+ all register windows support code will be omitted from the
266+ build.
267+
268+ If unsure, choose the default ABI.
269+
270+ config KERNEL_ABI_DEFAULT
271+ bool "Default ABI"
272+ help
273+ Select this option to compile kernel code with the default ABI
274+ selected for the toolchain.
275+ Normally cores with windowed registers option use windowed ABI and
276+ cores without it use call0 ABI.
277+
278+ config KERNEL_ABI_CALL0
279+ bool "Call0 ABI" if CC_HAVE_CALL0_ABI
280+ help
281+ Select this option to compile kernel code with call0 ABI even with
282+ toolchain that defaults to windowed ABI.
283+ When this option is not selected the default toolchain ABI will
284+ be used for the kernel code.
285+
286+ endchoice
287+
253288config USER_ABI_CALL0
254289 bool
255290
Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ KBUILD_CFLAGS += -ffreestanding -D__linux__
3535KBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals
3636KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,)
3737KBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,)
38+ ifneq ($(CONFIG_KERNEL_ABI_CALL0 ) ,)
39+ KBUILD_CFLAGS += -mabi=call0
40+ KBUILD_AFLAGS += -mabi=call0
41+ endif
3842
3943KBUILD_AFLAGS += -mlongcalls -mtext-section-literals
4044
You can’t perform that action at this time.
0 commit comments