zephyr/arch/xtensa/core/xtensa_hifi.S
Yong Cong Sin bbe5e1e6eb build: namespace the generated headers with zephyr/
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.

Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.

Updated the includes path of in-tree sources accordingly.

Most of the changes here are scripted, check the PR for more
info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00

54 lines
1.4 KiB
ArmAsm

/*
* Copyright (c) 2024 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/offsets.h>
#include <xtensa/config/tie.h>
#include <xtensa/config/tie-asm.h>
/*
* Load the HiFi registers from the hifi buffer in the BSA. Round the address
* of this buffer up to XCHAL_CP1_SA_ALIGN bytes to guarantee the necessary
* alignment.
*
* Upon entry ...
* A0 - return address (do not modify)
* A1 - address of BSA (do not modify)
* A2 - available for use
* A3 - available for use
*/
.global _xtensa_hifi_load
.align 4
_xtensa_hifi_load:
addi a2, a1, (___xtensa_irq_bsa_t_hifi_OFFSET + XCHAL_CP1_SA_ALIGN - 1)
movi a3, ~(XCHAL_CP1_SA_ALIGN - 1)
and a2, a2, a3
xchal_cp1_load a2 a3 a3 a3 a3 /* Only A2 and A3 are used by macro */
ret
/*
* Save the HiFi registers into the hifi buffer in the BSA. Round the address
* of this buffer up to XCHAL_CP1_SA_ALIGN bytes to guarantee the necessary
* alignment.
*
* A0 - return address (do not modify)
* A1 - address of BSA (do not modify)
* A2 - available for use
* A3 - available for use
*/
.global _xtensa_hifi_save
.align 4
_xtensa_hifi_save:
addi a2, a1, (___xtensa_irq_bsa_t_hifi_OFFSET + XCHAL_CP1_SA_ALIGN - 1)
movi a3, ~(XCHAL_CP1_SA_ALIGN - 1)
and a2, a2, a3
xchal_cp1_store a2 a3 a3 a3 a3 /* Only A2 and A3 are used by macro */
ret