Skip to content

Commit ead42b0

Browse files
committed
[nrf mergeup] Merge upstream up to commit 7d7fed0
Regular upmerge of zephyrproject-rtos/zephyr into downstream repository fw-nrfconnect-zephyr. Signed-off-by: Ioannis Glaropoulos <[email protected]>
2 parents 3a4b307 + 7d7fed0 commit ead42b0

File tree

1,699 files changed

+36518
-11824
lines changed

Some content is hidden

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

1,699 files changed

+36518
-11824
lines changed

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ endif()
3535
# For Zephyr more specifically this breaks (at least)
3636
# -fmacro-prefix-map=${ZEPHYR_BASE}=
3737

38-
project(Zephyr-Kernel VERSION ${PROJECT_VERSION})
39-
enable_language(C CXX ASM)
4038

4139
# Verify that the toolchain can compile a dummy file, if it is not we
4240
# won't be able to test for compatibility with certain C flags.

CODEOWNERS

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,13 @@
7979
/boards/arm/nrf*/ @carlescufi @lemrey @ioannisg
8080
/boards/arm/nucleo*/ @erwango
8181
/boards/arm/nucleo_f401re/ @rsalveti @idlethread
82+
/boards/arm/qemu_cortex_m*/ @ioannisg
8283
/boards/arm/sam4s_xplained/ @fallrisk
8384
/boards/arm/v2m_beetle/ @fvincenzo
8485
/boards/arm/olimexino_stm32/ @ydamigos
8586
/boards/arm/sensortile_box/ @avisconti
87+
/boards/arm/steval_fcu001v1/ @Navin-Sankar
88+
/boards/arm/stm32l1_disco/ @karlp
8689
/boards/arm/stm32*_disco/ @erwango
8790
/boards/arm/stm32f3_disco/ @ydamigos
8891
/boards/arm/stm32*_eval/ @erwango
@@ -116,16 +119,19 @@
116119
/drivers/bluetooth/ @joerchan @jhedberg @Vudentz
117120
/drivers/can/ @alexanderwachter
118121
/drivers/can/*mcp2515* @karstenkoenig
122+
/drivers/clock_control/*nrf* @nordic-krch
119123
/drivers/counter/ @nordic-krch
120124
/drivers/counter/counter_cmos.c @gnuless
121125
/drivers/display/ @vanwinkeljan
122126
/drivers/display/display_framebuf.c @gnuless
123127
/drivers/dma/*sam0* @Sizurka
124128
/drivers/espi/ @albertofloyd @franciscomunoz @scottwcpg
125129
/drivers/ps2/ @albertofloyd @franciscomunoz @scottwcpg
130+
/drivers/kscan/ @albertofloyd @franciscomunoz @scottwcpg
126131
/drivers/ethernet/ @jukkar @tbursztyka @pfalcon
127132
/drivers/flash/ @nashif
128133
/drivers/flash/*native_posix* @vanwinkeljan @aescolar
134+
/drivers/flash/*spi_nor* @pabigot
129135
/drivers/flash/*stm32* @superna9999
130136
/drivers/gpio/*ht16k33* @henrikbrixandersen
131137
/drivers/gpio/*stm32* @rsalveti @idlethread
@@ -175,7 +181,7 @@
175181
/drivers/i2c/i2c_rv32m1_lpi2c* @henrikbrixandersen
176182
/drivers/i2c/*sam0* @Sizurka
177183
/drivers/i2c/i2c_dw* @gnuless
178-
/drivers/*/*xec* @franciscomunoz @albertofloyd @scottwcpg
184+
/drivers/*/*xec* @franciscomunoz @albertofloyd @scottwcpg
179185
/drivers/wifi/ @jukkar @tbursztyka @pfalcon
180186
/drivers/wifi/eswifi/ @loicpoulain
181187
/dts/arc/ @vonhust @ruuddw @iriszzw
@@ -216,6 +222,7 @@
216222
/include/drivers/can.h @alexanderwachter
217223
/include/drivers/counter.h @nordic-krch
218224
/include/drivers/display.h @vanwinkeljan
225+
/include/drivers/espi.h @albertofloyd @franciscomunoz @scottwcpg
219226
/include/drivers/bluetooth/ @joerchan @jhedberg @Vudentz
220227
/include/drivers/led/ht16k33.h @henrikbrixandersen
221228
/include/drivers/interrupt_controller/ @andrewboie @gnuless
@@ -254,7 +261,6 @@
254261
/include/init.h @andrewboie @andyross
255262
/include/irq.h @andrewboie @andyross
256263
/include/irq_offload.h @andrewboie @andyross
257-
/include/espi.h @albertofloyd @franciscomunoz @scottwcpg
258264
/include/kernel.h @andrewboie @andyross
259265
/include/kernel_version.h @andrewboie @andyross
260266
/include/linker/app_smem*.ld @andrewboie
@@ -336,6 +342,7 @@
336342
/subsys/bluetooth/ @joerchan @jhedberg @Vudentz
337343
/subsys/bluetooth/controller/ @carlescufi @cvinayak @thoh-ot
338344
/subsys/bluetooth/mesh/ @jhedberg @trond-snekvik @joerchan @Vudentz
345+
/subsys/cpp/ @pabigot @vanwinkeljan
339346
/subsys/debug/ @nashif
340347
/subsys/disk/disk_access_spi_sdhc.c @JunYangNXP
341348
/subsys/disk/disk_access_sdhc.h @JunYangNXP

arch/arc/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,15 @@ config CACHE_FLUSHING
280280
If the d-cache is present, set this to y.
281281
If the d-cache is NOT present, set this to n.
282282

283+
config ARC_EXCEPTION_STACK_SIZE
284+
int "ARC exception handling stack size"
285+
default 768
286+
help
287+
Size in bytes of exception handling stack which is at the top of
288+
interrupt stack to get smaller memory footprint because exception
289+
is not frequent. To reduce the impact on interrupt handling,
290+
especially nested interrupt, it cannot be too large.
291+
283292
endmenu
284293

285294
config ARC_EXCEPTION_DEBUG

arch/arc/core/cpu_idle.S

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
#include <linker/sections.h>
1818
#include <arch/cpu.h>
1919

20-
GTEXT(k_cpu_idle)
21-
GTEXT(k_cpu_atomic_idle)
22-
GDATA(k_cpu_sleep_mode)
20+
GTEXT(z_arch_cpu_idle)
21+
GTEXT(z_arch_cpu_atomic_idle)
22+
GDATA(z_arc_cpu_sleep_mode)
2323

24-
SECTION_VAR(BSS, k_cpu_sleep_mode)
24+
SECTION_VAR(BSS, z_arc_cpu_sleep_mode)
2525
.balign 4
2626
.word 0
2727

@@ -33,15 +33,15 @@ SECTION_VAR(BSS, k_cpu_sleep_mode)
3333
* void nanCpuIdle(void)
3434
*/
3535

36-
SECTION_FUNC(TEXT, k_cpu_idle)
36+
SECTION_FUNC(TEXT, z_arch_cpu_idle)
3737

3838
#ifdef CONFIG_TRACING
3939
push_s blink
4040
jl sys_trace_idle
4141
pop_s blink
4242
#endif
4343

44-
ld r1, [k_cpu_sleep_mode]
44+
ld r1, [z_arc_cpu_sleep_mode]
4545
or r1, r1, (1 << 4) /* set IRQ-enabled bit */
4646
sleep r1
4747
j_s [blink]
@@ -52,17 +52,17 @@ SECTION_FUNC(TEXT, k_cpu_idle)
5252
*
5353
* This function exits with interrupts restored to <key>.
5454
*
55-
* void k_cpu_atomic_idle(unsigned int key)
55+
* void z_arch_cpu_atomic_idle(unsigned int key)
5656
*/
57-
SECTION_FUNC(TEXT, k_cpu_atomic_idle)
57+
SECTION_FUNC(TEXT, z_arch_cpu_atomic_idle)
5858

5959
#ifdef CONFIG_TRACING
6060
push_s blink
6161
jl sys_trace_idle
6262
pop_s blink
6363
#endif
6464

65-
ld r1, [k_cpu_sleep_mode]
65+
ld r1, [z_arc_cpu_sleep_mode]
6666
or r1, r1, (1 << 4) /* set IRQ-enabled bit */
6767
sleep r1
6868
j_s.d [blink]

arch/arc/core/fast_irq.S

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,25 @@ firq_nest:
101101
* save original value of _ARC_V2_USER_SP and ilink into
102102
* the stack of interrupted context first, then restore them later
103103
*/
104-
st ilink, [sp]
105-
lr ilink, [_ARC_V2_USER_SP]
106-
st ilink, [sp, -4]
104+
push ilink
105+
PUSHAX ilink, _ARC_V2_USER_SP
106+
107107
/* sp here is the sp of interrupted context */
108108
sr sp, [_ARC_V2_USER_SP]
109+
/* here, bank 0 sp must go back to the value before push and
110+
* PUSHAX as we will switch to bank1, the pop and POPAX later will
111+
* change bank1's sp, not bank0's sp
112+
*/
113+
add sp, sp, 8
109114

110115
/* switch back to banked reg, only ilink can be used */
111116
lr ilink, [_ARC_V2_STATUS32]
112117
or ilink, ilink, _ARC_V2_STATUS32_RB(1)
113118
kflag ilink
114119
lr sp, [_ARC_V2_USER_SP]
115-
ld ilink, [sp, -4]
116-
sr ilink, [_ARC_V2_USER_SP]
117-
ld ilink, [sp]
120+
121+
POPAX ilink, _ARC_V2_USER_SP
122+
pop ilink
118123
firq_nest_1:
119124
#else
120125
firq_nest:

arch/arc/core/fault_s.S

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,17 @@ GTEXT(__ev_maligned)
3838
GTEXT(z_irq_do_offload);
3939
#endif
4040

41-
/* the necessary stack size for exception handling */
42-
#define EXCEPTION_STACK_SIZE 384
41+
42+
/*
43+
* The exception handling will use top part of interrupt stack to
44+
* get smaller memory footprint, because exception is not frequent.
45+
* To reduce the impact on interrupt handling, especially nested interrupt
46+
* the top part of interrupt stack cannot be too large, so add a check
47+
* here
48+
*/
49+
#if CONFIG_ARC_EXCEPTION_STACK_SIZE > (CONFIG_ISR_STACK_SIZE >> 1)
50+
#error "interrupt stack size is too small"
51+
#endif
4352

4453
/*
4554
* @brief Fault handler installed in the fault and reserved vectors
@@ -67,7 +76,7 @@ _exc_entry:
6776
*/
6877
mov_s ilink, sp
6978
_get_curr_cpu_irq_stack sp
70-
sub sp, sp, (CONFIG_ISR_STACK_SIZE - EXCEPTION_STACK_SIZE)
79+
sub sp, sp, (CONFIG_ISR_STACK_SIZE - CONFIG_ARC_EXCEPTION_STACK_SIZE)
7180

7281
/*
7382
* save caller saved registers
@@ -196,7 +205,7 @@ SECTION_SUBSEC_FUNC(TEXT,__fault,__ev_trap)
196205
#ifdef CONFIG_USERSPACE
197206
cmp ilink, _TRAP_S_CALL_SYSTEM_CALL
198207
bne _do_non_syscall_trap
199-
/* do sys_call */
208+
/* do sys_call */
200209
mov_s ilink, K_SYSCALL_LIMIT
201210
cmp r6, ilink
202211
blt valid_syscall_id
@@ -205,21 +214,27 @@ SECTION_SUBSEC_FUNC(TEXT,__fault,__ev_trap)
205214
mov_s r6, K_SYSCALL_BAD
206215

207216
valid_syscall_id:
217+
/* create a sys call frame
218+
* caller regs (r0 - 12) are saved in _create_irq_stack_frame
219+
* ok to use them later
220+
*/
221+
_create_irq_stack_frame
222+
208223
#ifdef CONFIG_ARC_SECURE_FIRMWARE
209-
lr ilink, [_ARC_V2_ERSEC_STAT]
210-
push ilink
224+
/* ERSEC_STAT is IOW/RAZ in normal mode */
225+
lr r0, [_ARC_V2_ERSEC_STAT]
226+
st_s r0, [sp, ___isf_t_sec_stat_OFFSET]
211227
#endif
212-
lr ilink, [_ARC_V2_ERET]
213-
push ilink
214-
lr ilink, [_ARC_V2_ERSTATUS]
215-
push ilink
216-
228+
lr r0,[_ARC_V2_ERET]
229+
st_s r0, [sp, ___isf_t_pc_OFFSET] /* eret into pc */
230+
lr r0,[_ARC_V2_ERSTATUS]
231+
st_s r0, [sp, ___isf_t_status32_OFFSET]
217232

218-
bclr ilink, ilink, _ARC_V2_STATUS32_U_BIT
219-
sr ilink, [_ARC_V2_ERSTATUS]
233+
bclr r0, r0, _ARC_V2_STATUS32_U_BIT
234+
sr r0, [_ARC_V2_ERSTATUS]
220235

221-
mov_s ilink, _arc_do_syscall
222-
sr ilink, [_ARC_V2_ERET]
236+
mov_s r0, _arc_do_syscall
237+
sr r0, [_ARC_V2_ERET]
223238

224239
rtie
225240

arch/arc/core/irq_offload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void z_irq_do_offload(void)
2020
offload_routine(offload_param);
2121
}
2222

23-
void irq_offload(irq_offload_routine_t routine, void *parameter)
23+
void z_arch_irq_offload(irq_offload_routine_t routine, void *parameter)
2424
{
2525
unsigned int key;
2626

arch/arc/core/reset.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <swap_macros.h>
1818

1919
GDATA(_interrupt_stack)
20-
GDATA(_main_stack)
20+
GDATA(z_main_stack)
2121
GDATA(_VectorTable)
2222

2323
/* use one of the available interrupt stacks during init */
@@ -154,7 +154,7 @@ _master_core_startup:
154154
* FIRQ stack when CONFIG_INIT_STACKS is enabled before switching to
155155
* one of them for the rest of the early boot
156156
*/
157-
mov_s sp, _main_stack
157+
mov_s sp, z_main_stack
158158
add sp, sp, CONFIG_MAIN_STACK_SIZE
159159

160160
mov_s r0, _interrupt_stack

arch/arc/core/thread.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ struct init_stack_frame {
5959
*
6060
* @return N/A
6161
*/
62-
void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
63-
size_t stackSize, k_thread_entry_t pEntry,
64-
void *parameter1, void *parameter2, void *parameter3,
65-
int priority, unsigned int options)
62+
void z_arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
63+
size_t stackSize, k_thread_entry_t pEntry,
64+
void *parameter1, void *parameter2, void *parameter3,
65+
int priority, unsigned int options)
6666
{
6767
char *pStackMem = Z_THREAD_STACK_BUFFER(stack);
6868
Z_ASSERT_VALID_PRIO(priority, pEntry);

arch/arc/core/thread_entry_wrapper.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ GTEXT(z_thread_entry_wrapper1)
2222
* @brief Wrapper for z_thread_entry
2323
*
2424
* The routine pops parameters for the z_thread_entry from stack frame, prepared
25-
* by the z_new_thread() routine.
25+
* by the z_arch_new_thread() routine.
2626
*
2727
* @return N/A
2828
*/

0 commit comments

Comments
 (0)