Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soc/intel_adsp: Correct linker syntax for ancient binutils #38374

Merged
merged 2 commits into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmake/compiler/xcc/compiler_flags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ if(CC STREQUAL "clang")
include(${ZEPHYR_BASE}/cmake/compiler/clang/compiler_flags.cmake)
else()
include(${ZEPHYR_BASE}/cmake/compiler/gcc/compiler_flags.cmake)

# XCC is based on GCC 4.2 which has a somewhat pedantic take on the
# fact that linkage semantics differed between C99 and GNU at the
# time. Suppress the warning, it's the best we can do given that
# it's a legacy compiler.
set_compiler_property(APPEND PROPERTY warning_base "-fgnu89-inline")
endif()
34 changes: 17 additions & 17 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,23 @@ static ALWAYS_INLINE struct k_thread *_priq_dumb_mask_best(sys_dlist_t *pq)
}
#endif

ALWAYS_INLINE void z_priq_dumb_add(sys_dlist_t *pq, struct k_thread *thread)
{
struct k_thread *t;

__ASSERT_NO_MSG(!z_is_idle_thread_object(thread));

SYS_DLIST_FOR_EACH_CONTAINER(pq, t, base.qnode_dlist) {
if (z_sched_prio_cmp(thread, t) > 0) {
sys_dlist_insert(&t->base.qnode_dlist,
&thread->base.qnode_dlist);
return;
}
}

sys_dlist_append(pq, &thread->base.qnode_dlist);
}

/* _current is never in the run queue until context switch on
* SMP configurations, see z_requeue_current()
*/
Expand Down Expand Up @@ -927,23 +944,6 @@ void *z_get_next_switch_handle(void *interrupted)
}
#endif

ALWAYS_INLINE void z_priq_dumb_add(sys_dlist_t *pq, struct k_thread *thread)
{
struct k_thread *t;

__ASSERT_NO_MSG(!z_is_idle_thread_object(thread));

SYS_DLIST_FOR_EACH_CONTAINER(pq, t, base.qnode_dlist) {
if (z_sched_prio_cmp(thread, t) > 0) {
sys_dlist_insert(&t->base.qnode_dlist,
&thread->base.qnode_dlist);
return;
}
}

sys_dlist_append(pq, &thread->base.qnode_dlist);
}

void z_priq_dumb_remove(sys_dlist_t *pq, struct k_thread *thread)
{
__ASSERT_NO_MSG(!z_is_idle_thread_object(thread));
Expand Down
4 changes: 3 additions & 1 deletion soc/xtensa/intel_adsp/cavs_v15/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ PROVIDE(_MemErrorHandler = 0x00000000);
* the output tooling ignores it, but it will cause the linker to emit
* 512MB of unused data into the output file!)
*
* (Note clumsy syntax because XCC doesn't understand the "~" operator)
*
*/
#define SEGSTART_CACHED (ALIGN(64) | 0x20000000)
#define SEGSTART_UNCACHED (ALIGN(64) & ~0x20000000)
#define SEGSTART_UNCACHED (ALIGN(64) & 0xdfffffff) /* == ~0x20000000 */

MEMORY
{
Expand Down
4 changes: 3 additions & 1 deletion soc/xtensa/intel_adsp/cavs_v18/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ PROVIDE(_MemErrorHandler = 0x00000000);
* the output tooling ignores it, but it will cause the linker to emit
* 512MB of unused data into the output file!)
*
* (Note clumsy syntax because XCC doesn't understand the "~" operator)
*
*/
#define SEGSTART_CACHED (ALIGN(64) | 0x20000000)
#define SEGSTART_UNCACHED (ALIGN(64) & ~0x20000000)
#define SEGSTART_UNCACHED (ALIGN(64) & 0xdfffffff) /* == ~0x20000000 */

MEMORY
{
Expand Down
3 changes: 2 additions & 1 deletion soc/xtensa/intel_adsp/cavs_v25/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ PROVIDE(_MemErrorHandler = 0x00000000);
* the output tooling ignores it, but it will cause the linker to emit
* 512MB of unused data into the output file!)
*
* (Note clumsy syntax because XCC doesn't understand the "~" operator)
*/
#ifdef CONFIG_KERNEL_COHERENCE
#define SEGSTART_CACHED (ALIGN(64) | 0x20000000)
#define SEGSTART_UNCACHED (ALIGN(64) & ~0x20000000)
#define SEGSTART_UNCACHED (ALIGN(64) & 0xdfffffff) /* == ~0x20000000 */
#else
#define SEGSTART_CACHED /**/
#define SEGSTART_UNCACHED /**/
Expand Down