Spinlocks are written above the arch-provided _arch_irq_un/lock()
calls. But those aren't stubbed by the mocking layer, and as it's not
an "arch" I don't see an obvious place to put them. Handle them in
spinlock.h.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Mostly useless patch. All architectures have their own code for
atomic operations and don't use this fallback. Still, it's a trivial
locking setup and we might as well.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Each work_q object gets a separate spinlock to synchronize access
instead of the global lock. Note that there was a recursive lock
condition in k_delayed_work_cancel(), so that's been split out into an
internal unlocked version and the API entry point that wraps it with a
lock.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
The validation checking recently added to spinlocks is useful, but
requires kernel-internals like _current and _current_cpu in a header
context that tends to be needed before those are declared (or where we
don't want them declared), and is causing big header dependency
headaches.
Move it to C code, it's just a validation tool, not a performance
thing.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
We want a _Swap() variant that can atomically release/restore a
spinlock state in addition to the legacy irqlock. The function as it
was is now named "_Swap_irqlock()", while _Swap() now refers to a
spinlock and takes two arguments. The former will be going away once
existing users (not that many! Swap() is an internal API, and the
long port away from legacy irqlocking is going to be happening mostly
in drivers) are ported to spinlocks.
Obviously on uniprocessor setups, these produce identical code. But
SMP requires that the correct API be used to maintain the global lock.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
These two spots were duplicating logic that is already done inside
_reschedule(), which is the cleaner, less dangerous API. Use it where
possible when outside the scheduler internals.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Adding a set of BKMs on how to enable and configure UART1
for the nrf52840_pca10056 board. This instructions are likely valid
to most other nrf52840- family of boards.
Signed-off-by: Andrei Laperie <andrei.laperie@intel.com>
Clarify the docs for dt_str_val that if the name isn't found we return
and empty string. Also cleanup the code slightly as we don't need to
escape the double quote.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Replace generating CONFIG_ symbols with DT_ symbols for chosen
properties like 'zephyr,console' or 'zephyr,bt-mon-uart'. We now use a
kconfigfunctions (dt_str_val) to extract the info from dts into Kconfig.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This test seems to be fine in the current master, but doing
development, it easily starts to overflow RAM of some boards and/or
crash due to stack checks. So, decrease the ramdisk (the biggest
eater of RAM here) from default 96K to 80K, and bump main stack
size proactively.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Hardcoded 96KB starts to overload RAM regions and fail CI tests.
Quick test shows that 80KB ramdisk is ok, (passes tests/posix/fs).
And of course, targets with wealth of RAM may want to use bigger
ramdisks.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Add support for socket CAN functionality. This means that user
is able to use BSD socket interface to send and receive CAN
packets.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Implemented tests for the new join and detach features.
- The first tests multiple join operations.
- The second tests trying to join a detached thread.
- The third tests abandoning a join when the thread is detached after
creation.
Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
Implements osThreadJoin and osThreadDetach.
This implementation uses a semaphore to signal when a thread is
exiting so any join operations are signalled to continue. It supports
multiple join operations on a single thread, and ensures joins are
aborted if a thread is detached.
Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
Since we know do DTS before Kconfig we should try and remove dts from
creating Kconfig namespaced symbols and leave that to Kconfig. So
rename CONFIG_CCM_<FOO> to DT_CCM_<FOO>.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add prefixes to MSC enumerators, otherwise they are (ERROR) are
conflicting with other enumerators.
...
subsys/usb/class/mass_storage.c:149:2: error: redeclaration of
enumerator ‘ERROR’
ERROR, /* error */
^~~~~
...
ext/hal/st/stm32cube/stm32f4xx/soc/stm32f4xx.h:216:3: note: previous
definition of ‘ERROR’ was here
ERROR = 0U,
^~~~~
...
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add sample creating 2 serial USB ports and establishing communication
between those 2 ports.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add HID Device associated with the instance of the HID. This allows to
create several HID instances for multifunction composite device.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add new status callback with usb_cfg_data parameter to be able to
identify instance callback.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add interface parameter to interface configuration callback to be able
to configure several instances of the same class.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This adds BT_GATT_ENFORCE_CHANGE_UNAWARE option which when enable
returns -EAGAIN when notifying or indicating if the client is
change-unware to conform with following statement on the spec:
'BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 3, Part G page 2350:
Except for the Handle Value indication, the server shall not send
notifications and indications to such a client until it becomes
change-aware.'
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 3, Part G page 2405:
'For clients with a trusted relationship, the characteristic value
shall be persistent across connections. For clients without a
trusted relationship the characteristic value shall be set to the
default value at each connection.'
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This implement Robust Caching which is mandatory when Database Hash and
Service changed Characteristics are supported.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This implements the Database Hash characteristic which generates a hash
with the contents of certain attributes. The generation of hash is
usually offloaded to the systemwq using a delayed work so that when
application register multiple services only one hash needs to be
calculated.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>