xtensa: remove xtensa-asm2.h
xtensa-asm2.h only contains the function declaration of xtensa_init_stack() which is only used in one file. So make the actual implementation a static function in that file. Also there is really no need to expose stack init function as arch public API. So remove xtensa-asm2.h. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
6694390ac8
commit
43990d1c0e
3 changed files with 13 additions and 30 deletions
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <zephyr/debug/coredump.h>
|
#include <zephyr/debug/coredump.h>
|
||||||
#include <xtensa-asm2.h>
|
#include <xtensa-asm2-context.h>
|
||||||
#include <offsets.h>
|
#include <offsets.h>
|
||||||
|
|
||||||
#define ARCH_HDR_VER 1
|
#define ARCH_HDR_VER 1
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <xtensa-asm2.h>
|
#include <xtensa-asm2-context.h>
|
||||||
#include <zephyr/kernel.h>
|
#include <zephyr/kernel.h>
|
||||||
#include <ksched.h>
|
#include <ksched.h>
|
||||||
#include <zephyr/kernel_structs.h>
|
#include <zephyr/kernel_structs.h>
|
||||||
|
@ -38,7 +38,15 @@ __thread uint32_t is_user_mode;
|
||||||
|
|
||||||
#endif /* CONFIG_USERSPACE */
|
#endif /* CONFIG_USERSPACE */
|
||||||
|
|
||||||
void *xtensa_init_stack(struct k_thread *thread, int *stack_top,
|
/**
|
||||||
|
* Initializes a stack area such that it can be "restored" later and
|
||||||
|
* begin running with the specified function and three arguments. The
|
||||||
|
* entry function takes three arguments to match the signature of
|
||||||
|
* Zephyr's k_thread_entry_t. Thread will start with EXCM clear and
|
||||||
|
* INTLEVEL set to zero (i.e. it's a user thread, we don't start with
|
||||||
|
* anything masked, so don't assume that!).
|
||||||
|
*/
|
||||||
|
static void *init_stack(struct k_thread *thread, int *stack_top,
|
||||||
void (*entry)(void *, void *, void *),
|
void (*entry)(void *, void *, void *),
|
||||||
void *arg1, void *arg2, void *arg3)
|
void *arg1, void *arg2, void *arg3)
|
||||||
{
|
{
|
||||||
|
@ -120,8 +128,7 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
||||||
char *stack_ptr, k_thread_entry_t entry,
|
char *stack_ptr, k_thread_entry_t entry,
|
||||||
void *p1, void *p2, void *p3)
|
void *p1, void *p2, void *p3)
|
||||||
{
|
{
|
||||||
thread->switch_handle = xtensa_init_stack(thread,
|
thread->switch_handle = init_stack(thread, (int *)stack_ptr, entry,
|
||||||
(int *)stack_ptr, entry,
|
|
||||||
p1, p2, p3);
|
p1, p2, p3);
|
||||||
#ifdef CONFIG_KERNEL_COHERENCE
|
#ifdef CONFIG_KERNEL_COHERENCE
|
||||||
__ASSERT((((size_t)stack) % XCHAL_DCACHE_LINESIZE) == 0, "");
|
__ASSERT((((size_t)stack) % XCHAL_DCACHE_LINESIZE) == 0, "");
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2017, Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
#ifndef ZEPHYR_ARCH_XTENSA_INCLUDE_XTENSA_ASM2_H_
|
|
||||||
#define ZEPHYR_ARCH_XTENSA_INCLUDE_XTENSA_ASM2_H_
|
|
||||||
|
|
||||||
#include <zephyr/kernel_structs.h>
|
|
||||||
#include "xtensa-asm2-context.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializes a stack area such that it can be "restored" later and
|
|
||||||
* begin running with the specified function and three arguments. The
|
|
||||||
* entry function takes three arguments to match the signature of
|
|
||||||
* Zephyr's k_thread_entry_t. Thread will start with EXCM clear and
|
|
||||||
* INTLEVEL set to zero (i.e. it's a user thread, we don't start with
|
|
||||||
* anything masked, so don't assume that!).
|
|
||||||
*/
|
|
||||||
void *xtensa_init_stack(struct k_thread *thread, int *stack_top,
|
|
||||||
void (*entry)(void *, void *, void *),
|
|
||||||
void *arg1, void *arg2, void *arg3);
|
|
||||||
|
|
||||||
#endif /* ZEPHYR_ARCH_XTENSA_INCLUDE_XTENSA_ASM2_H_ */
|
|
Loading…
Add table
Add a link
Reference in a new issue