We had a comment related to the #endif for CONFIG_USB_DC_STM32 however
the comment said CONFIG_USB_DC_STM, so fix it to match the ifdef.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
CONFIG_BOARD_STM32_NUCLEO_{L432KC,L476RG} where set in the respective
board defconfig files, however these symbols don't exist. We can just
remove them from the defconfig as we'll get the board Kconfig symbol
defined by default when selecting that board.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Some sys_rand32_get() implementation will use shared state and protect
that using some synchronization primitive such as a mutex or a
semaphore. It's too early in the boot process to use any of them,
which causes some issues.
Use the entropy API directly to set up the stack canaries.
This doesn't completely solve the problem, as some drivers will use the
same synchronization primitives anyway. Some drivers (e.g. the NRF5
entropy driver) provide an API to be used by ISRs that might be
suitable here, but not all drivers do that.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This was in prepare_multithreading(), which was moved
to after driver initialization and not before it.
The function now really just prepares system threads.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Remove non-existent Kconfig symbol references. An additional (but
related) change is the removal of all persistent storage symbols from
the Arduino 101 Bluetooth shell app, since BT_STORAGE no longer
exists.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
These tests have an enormous stack which can be troublesome
to align on MPU-based systems; just disable user mode on
them.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
STACK_ALIGN has somewhat different semantics across our arches,
particularly ARC.
These checks are unnecessary, _new_thread() is required
to properly align stack sizes anyway.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The introduction of `sanitycheck --list-tests` fails to properly parse
the subcases in tests/subsys/fs/nffs_api/ beacause four of them are
all packed with #ifdefs in a single src/main.c.
So this breaks that testcase in four:
- creating a common folder with the code itself
- moving the common code in */src/main.c to common/test_nffs.h and
adding ../common/*.c to the sources
- thinning each testcase.yaml to have only the needed testcase
definition
- adding zephyr_include_directories(../common) to the cmakefiles
so we now produce with --list-tests
- filesystem.nffs.basic.append
- filesystem.nffs.basic.corrupt_block
- filesystem.nffs.basic.corrupt_scratch
- filesystem.nffs.basic.fs_mount
- filesystem.nffs.basic.gc
- filesystem.nffs.basic.gc_on_oom
- filesystem.nffs.basic.incomplete_block
- filesystem.nffs.basic.large_write
- filesystem.nffs.basic.long_filename
- filesystem.nffs.basic.lost_found
- filesystem.nffs.basic.many_children
- filesystem.nffs.basic.mkdir
- filesystem.nffs.basic.open
- filesystem.nffs.basic.overwrite_many
- filesystem.nffs.basic.overwrite_one
- filesystem.nffs.basic.overwrite_three
- filesystem.nffs.basic.overwrite_two
- filesystem.nffs.basic.read
- filesystem.nffs.basic.readdir
- filesystem.nffs.basic.rename
- filesystem.nffs.basic.split_file
- filesystem.nffs.basic.unlink
- filesystem.nffs.basic.wear_level
- filesystem.nffs.cache.cache_large_file
- filesystem.nffs.cache.fs_mount
- filesystem.nffs.large.fs_mount
- filesystem.nffs.large.large_system
- filesystem.nffs.large.large_unlink
- filesystem.nffs.performance.fs_mount
- filesystem.nffs.performance.performance
30 total.
vs before, that we did:
- filesystem.nffs.basic.append
- filesystem.nffs.basic.corrupt_block
- filesystem.nffs.basic.corrupt_scratch
- filesystem.nffs.basic.fs_mount
- filesystem.nffs.basic.gc
- filesystem.nffs.basic.gc_on_oom
- filesystem.nffs.basic.incomplete_block
- filesystem.nffs.basic.large_write
- filesystem.nffs.basic.long_filename
- filesystem.nffs.basic.lost_found
- filesystem.nffs.basic.many_children
- filesystem.nffs.basic.mkdir
- filesystem.nffs.basic.open
- filesystem.nffs.basic.overwrite_many
- filesystem.nffs.basic.overwrite_one
- filesystem.nffs.basic.overwrite_three
- filesystem.nffs.basic.overwrite_two
- filesystem.nffs.basic.read
- filesystem.nffs.basic.readdir
- filesystem.nffs.basic.rename
- filesystem.nffs.basic.split_file
- filesystem.nffs.basic.unlink
- filesystem.nffs.basic.wear_level
- filesystem.nffs.cache.append
- filesystem.nffs.cache.corrupt_block
- filesystem.nffs.cache.corrupt_scratch
- filesystem.nffs.cache.fs_mount
...
- filesystem.nffs.cache.split_file
- filesystem.nffs.cache.unlink
- filesystem.nffs.cache.wear_level
- filesystem.nffs.large.append
- filesystem.nffs.large.corrupt_block
- filesystem.nffs.large.corrupt_scratch
...
- filesystem.nffs.large.split_file
- filesystem.nffs.large.unlink
- filesystem.nffs.large.wear_level
- filesystem.nffs.performance.append
- filesystem.nffs.performance.corrupt_block
...
- filesystem.nffs.performance.unlink
- filesystem.nffs.performance.wear_level
92 total.
(so it was repeating ALL the subcases for eatch main testcase)
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Rename _MsrRead() and _MsrWrite() to _x86_msr_read() and
_x86_msr_write() respectively.
Given that these functions are essentially implemented in assembly.
make them static inline. They can be inlined by the compiler quite
well, most of the time incurring in space savings due to better
handling of the cobbled registers.
Also simplifies the inline assembly, using constraints instead of
moving registers ourselves. Should shave off a few bytes from code
using these functions.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Very simple implementation of deadline scheduling. Works by storing a
single word in each thread containing a deadline, setting it (as a
delta from "now") via a single new API call, and using it as extra
input to the existing thread priority comparison function when
priorities are equal.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This patch adds a set of priorities at the (numerically) lowest end of
the range which have "meta-irq" behavior. Runnable threads at these
priorities will always be scheduled before threads at lower
priorities, EVEN IF those threads are otherwise cooperative and/or
have taken a scheduler lock.
Making such a thread runnable in any way thus has the effect of
"interrupting" the current task and running the meta-irq thread
synchronously, like an exception or system call. The intent is to use
these priorities to implement "interrupt bottom half" or "tasklet"
behavior, allowing driver subsystems to return from interrupt context
but be guaranteed that user code will not be executed (on the current
CPU) until the remaining work is finished.
As this breaks the "promise" of non-preemptibility granted by the
current API for cooperative threads, this tool probably shouldn't be
used from application code.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The scheduler rewrite added a regression in uniprocessor mode where
cooperative threads would be unexpectedly preempted, because nothing
was checking the preemption status of _current at the point where the
next-thread cache pointer was being updated.
Note that update_cache() needs a little more context: spots like
k_yield() that leave _current runable need to be able to tell it that
"yes, preemption is OK here even though the thread is cooperative'.
So it has a "preempt_ok" argument now.
Interestingly this didn't get caught because we don't test that. We
have lots and lots of tests of the converse cases (i.e. making sure
that threads get preempted when we expect them to), but nothing that
explicitly tries to jump in front of a cooperative thread.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This symbol started out as CONFIG_BLUETOOTH_MAX_CMD_LEN, which was
removed in commit 50678b03cb ("Bluetooth: Reuse HCI command buffers
for the command response").
The non-existing symbol in the assignment was then renamed to
CONFIG_BT_MAX_CMD_LEN by commit 2975ca0754 ("Bluetooth: Kconfig:
Rename CONFIG_BLUETOOTH_* to CONFIG_BT_*").
Remove the assignment.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The prj.conf file was using wrong VLAN tag option names.
The correct names are CONFIG_SAMPLE_VLAN_TAG and
CONFIG_SAMPLE_VLAN_TAG_2 as defined in Kconfig file.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Remove unused context switch code from the helper assembly file that
manages the SuperVisor Call invocations (SVCs). This is no longer in use
in the code, since all calls to __swap() now go through PendSV directly.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
When we introduced NEWLIB_LIBC_ALIGNED_HEAP_SIZE in commit
42a2c96422. We accidently had the Kconfig
symbol depend on CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT the leading
'CONFIG_' shouldn't exist.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
CONFIG_COMMAND_STACK_SIZE was removed in 4f798177cf ("kernel: remove
old micro/nanokernel C code"). Its help was "Microkernel server command
stack size (in packets)".
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
We had a typo in the Kconfig symbol that was being used to try and set
SYS_LOG_LEVEL. It should be CONFIG_SYS_LOG_NET_LOOPBACK_LEVEL.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
These were using the older name CONFIG_NET_NBUF_DATA_SIZE (note the
extra 'N'). The symbol was renamed in commit bf964cdd4c ("net:
Renaming net nbuf API to net pkt API").
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The SPI_DW_INTERRUPT_SEPARATED_LINES symbol was removed and replaced by
SPI_DW_PORT_{0,1,2,3}_INTERRUPT_SINGLE_LINE in commit 423f0095c7
("drivers/spi: Specify options per-port on DW driver"), but an
assignment to it remains.
Remove the assignment and set SPI_DW_PORT_0_INTERRUPT_SINGLE_LINE to 'n'
instead. The Arduino has a single SPI port.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This symbol does not exist. Not sure what was intended.
There's HAS_SEGER_RTT, but that symbol has no prompt, meaning .config
values have no effect on it. It is 'select'ed by the SoCs.
Remove the assignment, which is a no-op.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Not only removes a branch during normal operation, but also ensures
that, by initializing at the PRE_KERNEL_2 stage, and granting
privileges to all threads to the semaphore, this code will work in
early boot situations and in user mode.
This assumes that entropy drivers will all initialize during
PRE_KERNEL_1 stage. All in-tree drivers do that.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
To ensure that early code that requires entropy has the HWRNG devices
fully initialized, initialize them all during PRE_KERNEL_1 stage.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The initial user stack pointer gets rounded to STACK_ALIGN_SIZE,
which can be much finer granularity than MPU regions. With
certain stack size values passed to k_thread_create(), the stack
pointer can be set past the defined region for the user thread's
stack, causing an immediate MPU fault.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Upon return from a syscall handlers, the r1, r2, and r3 registers
could contain random kernel data that should not be leaked to user
mode. Zero these out before returning from _arm_do_syscall().
Fixes#7753.
The invocation macros need a clobber if r1, r2, or r3 are not used
to carry syscall arguments. This is a partial fix for #7754 but
there appear to be other issues.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Many boards do not enable user mode in their default configuration
even though they support it. However for purposes of our unit
testing we really do want it on all the time.
It's not enough to just flip on CONFIG_USERSPACE, the tests largely
assume that CONFIG_APPLICATION_MEMORY and CONFIG_DYNAMIC_OBJECTS
are enabled. Update CONFIG_TEST_USERSPACE to be on by default if
CONFIG_TEST is active, and hang CONFIG_DYNAMIC_OBJECTS on it too.
This problem was not previously detected as qemu_x86 has the
user mode options in its defconfig and it is currently the only
user mode compatible platform which runs in emulation.
Fixes#7692
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This is a workaround until #7704 is fixed, we are getting
an assembler error due to the r7 clobber in the syscall
invocation macros.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>