Skip to content

Commit 15a6598

Browse files
author
Anas Nashif
committed
Merge "Merge remote-tracking branch 'origin/core'"
2 parents 643f360 + 29fa81f commit 15a6598

File tree

137 files changed

+14962
-39
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+14962
-39
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ scripts/grub
3131
doc/reference/kconfig/CONFIG_*
3232
doc/reference/kconfig/index.rst
3333
tags
34+
.project
35+
.cproject
36+
.xxproject

Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ define rule_cc_o_c_1
9090
$(call echo-cmd,cc_o_c_1) $(cmd_cc_o_c_1);
9191
endef
9292

93-
cmd_cc_o_c_1 = $(CC) $(KBUILD_CFLAGS) $(ZEPHYRINCLUDE) -c -o $@ $<
93+
cmd_cc_o_c_1 = $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(ZEPHYRINCLUDE) -c -o $@ $<
9494

9595
arch/$(ARCH)/core/offsets/offsets.o: arch/$(ARCH)/core/offsets/offsets.c $(KCONFIG_CONFIG) \
9696
include/generated/generated_dts_board.h

Makefile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ ZEPHYRINCLUDE = \
376376
KBUILD_CPPFLAGS := -DKERNEL -D__ZEPHYR__=1
377377

378378
KBUILD_CFLAGS := -c -g -std=c99 \
379-
-fno-asynchronous-unwind-tables \
380379
-Wall \
381380
-Wformat \
382381
-Wformat-security \
@@ -595,6 +594,12 @@ drivers-y := drivers/
595594
ARCH = $(subst $(DQUOTE),,$(CONFIG_ARCH))
596595
export ARCH
597596

597+
ifeq ($(CONFIG_DEBUG),y)
598+
KBUILD_CFLAGS += -Og
599+
else
600+
KBUILD_CFLAGS += -Os
601+
endif
602+
598603
ifdef ZEPHYR_GCC_VARIANT
599604
include $(srctree)/scripts/Makefile.toolchain.$(ZEPHYR_GCC_VARIANT)
600605
else
@@ -632,11 +637,8 @@ KBUILD_CFLAGS += $(call cc-option,-fno-reorder-blocks,) \
632637
$(call cc-option,-fno-partial-inlining)
633638
endif
634639

635-
ifeq ($(CONFIG_DEBUG),y)
636-
KBUILD_CFLAGS += -Og
637-
else
638-
KBUILD_CFLAGS += -Os
639-
endif
640+
# Some GCC variants don't support these
641+
KBUILD_CFLAGS += $(call cc-option,-fno-asynchronous-unwind-tables,)
640642

641643
ifeq ($(CONFIG_STACK_CANARIES),y)
642644
KBUILD_CFLAGS += $(call cc-option,-fstack-protector-all,)
@@ -683,8 +685,10 @@ else
683685
# Use make W=1 to enable this warning (see scripts/Makefile.build)
684686
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)
685687
KBUILD_CFLAGS += $(call cc-option,-fno-reorder-functions)
688+
ifneq (${ZEPHYR_GCC_VARIANT},xcc)
686689
KBUILD_CFLAGS += $(call cc-option,-fno-defer-pop)
687690
endif
691+
endif
688692

689693
# We trigger additional mismatches with less inlining
690694
ifdef CONFIG_DEBUG_SECTION_MISMATCH

arch/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44
# Copyright (c) 2014-2015 Wind River Systems, Inc.
55
# Copyright (c) 2015 Intel Corporation
6+
# Copyright (c) 2016 Cadence Design Systems, Inc.
67
#
78
# SPDX-License-Identifier: Apache-2.0
89
#
@@ -29,6 +30,9 @@ config NIOS2
2930
config RISCV32
3031
bool "RISCV32 architecture"
3132

33+
config XTENSA
34+
bool "Xtensa architecture"
35+
3236
endchoice
3337

3438
#

arch/xtensa/Kbuild

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
subdir-ccflags-y +=-I$(srctree)/include/drivers
2+
subdir-ccflags-y +=-I$(srctree)/drivers
3+
subdir-asflags-y := ${subdir-ccflags-y}
4+
5+
ifneq ($(SOC_FAMILY),)
6+
obj-y += soc/$(SOC_FAMILY)/
7+
else
8+
obj-y += soc/$(SOC_PATH)/
9+
endif
10+
11+
obj-y += core/
12+
obj-y += core/startup/

arch/xtensa/Kconfig

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Kconfig - XTENSA architecture configuration options
2+
#
3+
# Copyright (c) 2016 Cadence Design Systems, Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
choice
7+
prompt "XTENSA core Selection"
8+
default sample_controller
9+
depends on XTENSA
10+
11+
source "arch/xtensa/soc/Kconfig.cores"
12+
endchoice
13+
14+
menu "XTENSA Options"
15+
depends on XTENSA
16+
17+
config ARCH
18+
default "xtensa"
19+
20+
config SYS_CLOCK_HW_CYCLES_PER_SEC
21+
int
22+
prompt "Hardware clock cycles per second, 2000000 for ISS"
23+
default 2000000
24+
range 1000000 1000000000
25+
help
26+
This option specifies hardware clock.
27+
28+
config XTENSA_NO_IPC
29+
bool "Core has no IPC support"
30+
select ATOMIC_OPERATIONS_C
31+
default n
32+
help
33+
Uncheck this if you core does not implment "SCOMPARE1" register and "s32c1i"
34+
isntruction.
35+
36+
config SW_ISR_TABLE
37+
bool
38+
prompt "Enable software interrupt handler table"
39+
default y
40+
help
41+
Enable an interrupt handler table implemented in software. This
42+
table, unlike ISRs connected directly in the vector table, allow
43+
a parameter to be passed to the interrupt handlers. Also, invoking
44+
the exeception/interrupt exit stub is automatically done.
45+
This has to be enabled for dynamically connecting interrupt handlers
46+
at runtime (SW_ISR_TABLE_DYNAMIC).
47+
48+
config IRQ_OFFLOAD
49+
bool "Enable IRQ offload"
50+
default n
51+
help
52+
Enable irq_offload() API which allows functions to be synchronously
53+
run in interrupt context. Uses one entry in the IDT. Mainly useful
54+
for test cases.
55+
56+
config SW_ISR_TABLE_DYNAMIC
57+
bool
58+
prompt "Allow installing interrupt handlers at runtime"
59+
depends on SW_ISR_TABLE
60+
default n
61+
help
62+
This option enables irq_connect_dynamic(). It moves the ISR table to
63+
SRAM so that it is writable. This has the side-effect of removing
64+
write-protection on the ISR table.
65+
66+
menu "Specific core configuration"
67+
68+
config IRQ_OFFLOAD_INTNUM
69+
int
70+
prompt "IRQ offload SW interrupt index"
71+
help
72+
The index of the software interrupt to be used for IRQ offload.
73+
74+
Please note that in order for IRQ offload to work correctly the selected
75+
interrupt shall have its priority shall not exceed XCHAL_EXCM_LEVEL.
76+
77+
source "arch/xtensa/soc/*/Kconfig"
78+
79+
endmenu
80+
81+
endmenu

arch/xtensa/Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
SOC_PATH=${XTENSA_CORE}
2+
export SOC_PATH
3+
4+
flagBoardType=
5+
ifeq ($(CONFIG_BOARD_XTENSA),y)
6+
flagBoardType= -DXT_BOARD
7+
endif
8+
ifeq ($(CONFIG_SIMULATOR_XTENSA),y)
9+
flagBoardType= -DXT_SIMULATOR
10+
endif
11+
12+
# XCC emits an annoying warning if this is used even though the
13+
# $(call cc-option,) test in toplevel Makefile passes.
14+
KBUILD_CFLAGS := $(filter-out -fno-omit-frame-pointer, \
15+
${KBUILD_CFLAGS})
16+
17+
# Put functions and data in their own binary sections so that ld can
18+
# garbage collect them
19+
KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) \
20+
$(call cc-option,-fdata-sections,)
21+
22+
KBUILD_AFLAGS += $(flagBoardType)
23+
KBUILD_CFLAGS += -DPROC_$(XTENSA_CORE) \
24+
-DCONFIG_$(XTENSA_CORE) \
25+
$(flagBoardType) \
26+
$(call cc-option,-fms-extensions,)
27+
28+
include $(srctree)/arch/$(ARCH)/core/Makefile
29+
include $(srctree)/arch/$(ARCH)/soc/$(SOC_PATH)/Makefile
30+
31+
cflags-$(CONFIG_LTO) += $(call cc-option,-flto,)
32+
33+
KBUILD_CFLAGS += $(cflags-y)
34+
KBUILD_CXXFLAGS += $(cflags-y)
35+
36+
QEMU_CPU_TYPE_xtensa ?= unsupported
37+
QEMU_FLAGS_xtensa = -cpu $(QEMU_CPU_TYPE_xtensa) \
38+
-machine sim -semihosting -nographic
39+
QEMU_xtensa = qemu-system-xtensa
40+
41+
export QEMU_FLAGS_xtensa QEMU_xtensa

arch/xtensa/core/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ccflags-y += -I$(srctree)/kernel/unified/include
2+
asflags-y += -I$(srctree)/kernel/unified/include --longcalls
3+
4+
ifdef CONFIG_ATOMIC_OPERATIONS_C
5+
# Use C routines from kernel/nanokernel/atomic.c
6+
obj-atomic=
7+
else
8+
# Use our own routines implmented in assembly
9+
obj-atomic=atomic.o
10+
endif
11+
obj-y = ${obj-atomic} cpu_idle.o fatal.o \
12+
swap.o thread.o xt_zephyr.o xtensa_context.o xtensa_intr_asm.o \
13+
xtensa_intr.o xtensa_vectors.o irq_manage.o
14+
obj-$(CONFIG_IRQ_OFFLOAD) += irq_offload.o
15+
obj-$(CONFIG_SIMULATOR_XTENSA) += crt1-sim.o
16+
obj-$(CONFIG_BOARD_XTENSA) += crt1-boards.o
17+
# Keep this last so that vague linking works
18+
obj-y += sw_isr_table.o

0 commit comments

Comments
 (0)