Describe the bug
Using the following header file in zephyr is to find an error
sof/src/include/sof/lib/dma.h
log:
./../zephyr/../modules/audio/sof/src/arch/host/include/arch/atomic.h:18: error: conflicting types for 'atomic_t'
E:/work/ZC3827/ZCAN-IOT/zephyr/include/sys/atomic.h:21: error: previous declaration of 'atomic_t' was
here
In file included from ../../zephyr/../modules/audio/sof/src/include/sof/lib/dma.h:21,
from E:/work/drivers/sof_driver/i2s.c:11:
../../zephyr/../modules/audio/sof/src/include/sof/atomic.h:25: error: conflicting types for 'atomic_set'
zephyr/include/generated/syscalls/atomic_c.h:78: error: previous definition of 'atomic_set' was here
../../zephyr/../modules/audio/sof/src/include/sof/atomic.h:30: error: conflicting types for 'atomic_add'
zephyr/include/generated/syscalls/atomic_c.h:52: error: previous definition of 'atomic_add' was here
../../zephyr/../modules/audio/sof/src/include/sof/atomic.h:35: error: conflicting types for 'atomic_sub'
zephyr/include/generated/syscalls/atomic_c.h:65: error: previous definition of 'atomic_sub' was here
ninja: build stopped: subcommand failed.
I think if there is zephyr, these should not be provided by sof.Below is my modification
#ifndef __ZEPHYR__ ------------------------------------------------------------->here
static inline void atomic_init(atomic_t *a, int32_t value)
{
arch_atomic_init(a, value);
}
static inline int32_t atomic_read(const atomic_t *a)
{
return arch_atomic_read(a);
}
static inline void atomic_set(atomic_t *a, int32_t value)
{
arch_atomic_set(a, value);
}
static inline int32_t atomic_add(atomic_t *a, int32_t value)
{
return arch_atomic_add(a, value);
}
static inline int32_t atomic_sub(atomic_t *a, int32_t value)
{
return arch_atomic_sub(a, value);
}
#endif
Describe the bug
Using the following header file in zephyr is to find an error
sof/src/include/sof/lib/dma.h
log:
I think if there is zephyr, these should not be provided by sof.Below is my modification