kernel/poll: Mark incompatibility with KERNEL_COHERENCE
The k_poll implementation places a struct _poller on the stack and shares it with other threads, which is incompatible with the KERNEL_COHERENCE model of cached stacks. Make this a hard build failure instead of a kconfig dependency for clarity. The failures if a user actually enables both are subtle and difficult to debug. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
544a38ee62
commit
4a8b3d194c
9 changed files with 17 additions and 1 deletions
|
@ -243,11 +243,19 @@ static int k_poll_poller_cb(struct k_poll_event *event, uint32_t state)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_KERNEL_COHERENCE
|
||||||
|
#error CONFIG_POLL and CONFIG_KERNEL_COHERENCE are not compatible
|
||||||
|
#endif
|
||||||
|
|
||||||
int z_impl_k_poll(struct k_poll_event *events, int num_events,
|
int z_impl_k_poll(struct k_poll_event *events, int num_events,
|
||||||
k_timeout_t timeout)
|
k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
int events_registered;
|
int events_registered;
|
||||||
k_spinlock_key_t key;
|
k_spinlock_key_t key;
|
||||||
|
|
||||||
|
/* FIXME: this shared data is stack-allocated and needs
|
||||||
|
* proper treatment to be compatible with KERNEL_COHERENCE.
|
||||||
|
*/
|
||||||
struct _poller poller = { .is_polling = true,
|
struct _poller poller = { .is_polling = true,
|
||||||
.thread = _current,
|
.thread = _current,
|
||||||
.cb = k_poll_poller_cb };
|
.cb = k_poll_poller_cb };
|
||||||
|
|
|
@ -3,10 +3,11 @@ tests:
|
||||||
tags: kernel userspace
|
tags: kernel userspace
|
||||||
build_on_all: true
|
build_on_all: true
|
||||||
min_flash: 33
|
min_flash: 33
|
||||||
|
filter: not CONFIG_KERNEL_COHERENCE
|
||||||
kernel.common.misra:
|
kernel.common.misra:
|
||||||
tags: kernel userspace
|
tags: kernel userspace
|
||||||
min_flash: 33
|
min_flash: 33
|
||||||
# Some configurations are known-incompliant and won't build
|
# Some configurations are known-incompliant and won't build
|
||||||
filter: not ((CONFIG_I2C or CONFIG_SPI) and CONFIG_USERSPACE)
|
filter: not ((CONFIG_I2C or CONFIG_SPI) and CONFIG_USERSPACE or CONFIG_KERNEL_COHERENCE)
|
||||||
extra_configs:
|
extra_configs:
|
||||||
- CONFIG_MISRA_SANE=y
|
- CONFIG_MISRA_SANE=y
|
||||||
|
|
|
@ -4,3 +4,4 @@ tests:
|
||||||
kernel.fifo.poll:
|
kernel.fifo.poll:
|
||||||
extra_args: CONF_FILE="prj_poll.conf"
|
extra_args: CONF_FILE="prj_poll.conf"
|
||||||
tags: kernel
|
tags: kernel
|
||||||
|
filter: not CONFIG_KERNEL_COHERENCE
|
||||||
|
|
|
@ -4,3 +4,4 @@ tests:
|
||||||
kernel.fifo.timeout.poll:
|
kernel.fifo.timeout.poll:
|
||||||
extra_args: CONF_FILE="prj_poll.conf"
|
extra_args: CONF_FILE="prj_poll.conf"
|
||||||
tags: kernel
|
tags: kernel
|
||||||
|
filter: not CONFIG_KERNEL_COHERENCE
|
||||||
|
|
|
@ -4,3 +4,4 @@ tests:
|
||||||
kernel.fifo.usage.poll:
|
kernel.fifo.usage.poll:
|
||||||
extra_args: CONF_FILE="prj_poll.conf"
|
extra_args: CONF_FILE="prj_poll.conf"
|
||||||
tags: kernel
|
tags: kernel
|
||||||
|
filter: not CONFIG_KERNEL_COHERENCE
|
||||||
|
|
|
@ -2,3 +2,4 @@ tests:
|
||||||
kernel.poll:
|
kernel.poll:
|
||||||
tags: kernel userspace
|
tags: kernel userspace
|
||||||
platform_exclude: nrf52dk_nrf52810
|
platform_exclude: nrf52dk_nrf52810
|
||||||
|
filter: not CONFIG_KERNEL_COHERENCE
|
||||||
|
|
|
@ -4,3 +4,4 @@ tests:
|
||||||
kernel.queue.poll:
|
kernel.queue.poll:
|
||||||
extra_args: CONF_FILE="prj_poll.conf"
|
extra_args: CONF_FILE="prj_poll.conf"
|
||||||
tags: kernel userspace
|
tags: kernel userspace
|
||||||
|
filter: not CONFIG_KERNEL_COHERENCE
|
||||||
|
|
|
@ -2,3 +2,4 @@ tests:
|
||||||
kernel.workqueue:
|
kernel.workqueue:
|
||||||
min_flash: 34
|
min_flash: 34
|
||||||
tags: kernel
|
tags: kernel
|
||||||
|
filter: not CONFIG_KERNEL_COHERENCE
|
||||||
|
|
|
@ -2,3 +2,4 @@ tests:
|
||||||
kernel.workqueue.api:
|
kernel.workqueue.api:
|
||||||
min_flash: 34
|
min_flash: 34
|
||||||
tags: kernel userspace
|
tags: kernel userspace
|
||||||
|
filter: not CONFIG_KERNEL_COHERENCE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue