Skip to content

Commit 833bb66

Browse files
dcpleungkartben
authored andcommitted
xtensa: fix thread_page_tables_get being unused
thread_page_tables_get() is only used when userspace is enabled. So move it with userspace #ifdef, or else compiler would complain about it being unused. Fixes #88421 Signed-off-by: Daniel Leung <daniel.leung@intel.com>
1 parent e0f5241 commit 833bb66

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

arch/xtensa/core/ptables.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,6 @@ static const struct xtensa_mmu_range mmu_zephyr_ranges[] = {
157157
},
158158
};
159159

160-
static inline uint32_t *thread_page_tables_get(const struct k_thread *thread)
161-
{
162-
#ifdef CONFIG_USERSPACE
163-
if ((thread->base.user_options & K_USER) != 0U) {
164-
return thread->arch.ptables;
165-
}
166-
#endif
167-
168-
return xtensa_kernel_ptables;
169-
}
170-
171160
/**
172161
* @brief Check if the page table entry is illegal.
173162
*
@@ -732,6 +721,15 @@ void xtensa_mmu_tlb_shootdown(void)
732721

733722
#ifdef CONFIG_USERSPACE
734723

724+
static inline uint32_t *thread_page_tables_get(const struct k_thread *thread)
725+
{
726+
if ((thread->base.user_options & K_USER) != 0U) {
727+
return thread->arch.ptables;
728+
}
729+
730+
return xtensa_kernel_ptables;
731+
}
732+
735733
static inline uint32_t *alloc_l1_table(void)
736734
{
737735
uint16_t idx;

0 commit comments

Comments
 (0)