162306a36Sopenharmony_ci/* 262306a36Sopenharmony_ci * This header file contains assembly-language definitions (assembly 362306a36Sopenharmony_ci * macros, etc.) for this specific Xtensa processor's TIE extensions 462306a36Sopenharmony_ci * and options. It is customized to this Xtensa processor configuration. 562306a36Sopenharmony_ci * 662306a36Sopenharmony_ci * This file is subject to the terms and conditions of the GNU General Public 762306a36Sopenharmony_ci * License. See the file "COPYING" in the main directory of this archive 862306a36Sopenharmony_ci * for more details. 962306a36Sopenharmony_ci * 1062306a36Sopenharmony_ci * Copyright (C) 1999-2008 Tensilica Inc. 1162306a36Sopenharmony_ci */ 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci#ifndef _XTENSA_CORE_TIE_ASM_H 1462306a36Sopenharmony_ci#define _XTENSA_CORE_TIE_ASM_H 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci/* Selection parameter values for save-area save/restore macros: */ 1762306a36Sopenharmony_ci/* Option vs. TIE: */ 1862306a36Sopenharmony_ci#define XTHAL_SAS_TIE 0x0001 /* custom extension or coprocessor */ 1962306a36Sopenharmony_ci#define XTHAL_SAS_OPT 0x0002 /* optional (and not a coprocessor) */ 2062306a36Sopenharmony_ci/* Whether used automatically by compiler: */ 2162306a36Sopenharmony_ci#define XTHAL_SAS_NOCC 0x0004 /* not used by compiler w/o special opts/code */ 2262306a36Sopenharmony_ci#define XTHAL_SAS_CC 0x0008 /* used by compiler without special opts/code */ 2362306a36Sopenharmony_ci/* ABI handling across function calls: */ 2462306a36Sopenharmony_ci#define XTHAL_SAS_CALR 0x0010 /* caller-saved */ 2562306a36Sopenharmony_ci#define XTHAL_SAS_CALE 0x0020 /* callee-saved */ 2662306a36Sopenharmony_ci#define XTHAL_SAS_GLOB 0x0040 /* global across function calls (in thread) */ 2762306a36Sopenharmony_ci/* Misc */ 2862306a36Sopenharmony_ci#define XTHAL_SAS_ALL 0xFFFF /* include all default NCP contents */ 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci/* Macro to save all non-coprocessor (extra) custom TIE and optional state 3362306a36Sopenharmony_ci * (not including zero-overhead loop registers). 3462306a36Sopenharmony_ci * Save area ptr (clobbered): ptr (1 byte aligned) 3562306a36Sopenharmony_ci * Scratch regs (clobbered): at1..at4 (only first XCHAL_NCP_NUM_ATMPS needed) 3662306a36Sopenharmony_ci */ 3762306a36Sopenharmony_ci .macro xchal_ncp_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL 3862306a36Sopenharmony_ci xchal_sa_start \continue, \ofs 3962306a36Sopenharmony_ci .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~\select 4062306a36Sopenharmony_ci xchal_sa_align \ptr, 0, 1024-4, 4, 4 4162306a36Sopenharmony_ci rur \at1, THREADPTR // threadptr option 4262306a36Sopenharmony_ci s32i \at1, \ptr, .Lxchal_ofs_ + 0 4362306a36Sopenharmony_ci .set .Lxchal_ofs_, .Lxchal_ofs_ + 4 4462306a36Sopenharmony_ci .endif 4562306a36Sopenharmony_ci .endm // xchal_ncp_store 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ci/* Macro to save all non-coprocessor (extra) custom TIE and optional state 4862306a36Sopenharmony_ci * (not including zero-overhead loop registers). 4962306a36Sopenharmony_ci * Save area ptr (clobbered): ptr (1 byte aligned) 5062306a36Sopenharmony_ci * Scratch regs (clobbered): at1..at4 (only first XCHAL_NCP_NUM_ATMPS needed) 5162306a36Sopenharmony_ci */ 5262306a36Sopenharmony_ci .macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL 5362306a36Sopenharmony_ci xchal_sa_start \continue, \ofs 5462306a36Sopenharmony_ci .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~\select 5562306a36Sopenharmony_ci xchal_sa_align \ptr, 0, 1024-4, 4, 4 5662306a36Sopenharmony_ci l32i \at1, \ptr, .Lxchal_ofs_ + 0 5762306a36Sopenharmony_ci wur \at1, THREADPTR // threadptr option 5862306a36Sopenharmony_ci .set .Lxchal_ofs_, .Lxchal_ofs_ + 4 5962306a36Sopenharmony_ci .endif 6062306a36Sopenharmony_ci .endm // xchal_ncp_load 6162306a36Sopenharmony_ci 6262306a36Sopenharmony_ci 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci#define XCHAL_NCP_NUM_ATMPS 1 6562306a36Sopenharmony_ci 6662306a36Sopenharmony_ci 6762306a36Sopenharmony_ci#define XCHAL_SA_NUM_ATMPS 1 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci#endif /*_XTENSA_CORE_TIE_ASM_H*/ 7062306a36Sopenharmony_ci 71