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;
|
||||
}
|
||||
|
||||
#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,
|
||||
k_timeout_t timeout)
|
||||
{
|
||||
int events_registered;
|
||||
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,
|
||||
.thread = _current,
|
||||
.cb = k_poll_poller_cb };
|
||||
|
|
|
@ -3,10 +3,11 @@ tests:
|
|||
tags: kernel userspace
|
||||
build_on_all: true
|
||||
min_flash: 33
|
||||
filter: not CONFIG_KERNEL_COHERENCE
|
||||
kernel.common.misra:
|
||||
tags: kernel userspace
|
||||
min_flash: 33
|
||||
# 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:
|
||||
- CONFIG_MISRA_SANE=y
|
||||
|
|
|
@ -4,3 +4,4 @@ tests:
|
|||
kernel.fifo.poll:
|
||||
extra_args: CONF_FILE="prj_poll.conf"
|
||||
tags: kernel
|
||||
filter: not CONFIG_KERNEL_COHERENCE
|
||||
|
|
|
@ -4,3 +4,4 @@ tests:
|
|||
kernel.fifo.timeout.poll:
|
||||
extra_args: CONF_FILE="prj_poll.conf"
|
||||
tags: kernel
|
||||
filter: not CONFIG_KERNEL_COHERENCE
|
||||
|
|
|
@ -4,3 +4,4 @@ tests:
|
|||
kernel.fifo.usage.poll:
|
||||
extra_args: CONF_FILE="prj_poll.conf"
|
||||
tags: kernel
|
||||
filter: not CONFIG_KERNEL_COHERENCE
|
||||
|
|
|
@ -2,3 +2,4 @@ tests:
|
|||
kernel.poll:
|
||||
tags: kernel userspace
|
||||
platform_exclude: nrf52dk_nrf52810
|
||||
filter: not CONFIG_KERNEL_COHERENCE
|
||||
|
|
|
@ -4,3 +4,4 @@ tests:
|
|||
kernel.queue.poll:
|
||||
extra_args: CONF_FILE="prj_poll.conf"
|
||||
tags: kernel userspace
|
||||
filter: not CONFIG_KERNEL_COHERENCE
|
||||
|
|
|
@ -2,3 +2,4 @@ tests:
|
|||
kernel.workqueue:
|
||||
min_flash: 34
|
||||
tags: kernel
|
||||
filter: not CONFIG_KERNEL_COHERENCE
|
||||
|
|
|
@ -2,3 +2,4 @@ tests:
|
|||
kernel.workqueue.api:
|
||||
min_flash: 34
|
||||
tags: kernel userspace
|
||||
filter: not CONFIG_KERNEL_COHERENCE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue