···11+/* 22+ * tie-asm.h -- compile-time HAL assembler definitions dependent on CORE & TIE33+ *44+ * NOTE: This header file is not meant to be included directly.55+ */66+77+/* This header file contains assembly-language definitions (assembly88+ macros, etc.) for this specific Xtensa processor's TIE extensions99+ and options. It is customized to this Xtensa processor configuration.1010+1111+ Copyright (c) 1999-2015 Cadence Design Systems Inc.1212+1313+ Permission is hereby granted, free of charge, to any person obtaining1414+ a copy of this software and associated documentation files (the1515+ "Software"), to deal in the Software without restriction, including1616+ without limitation the rights to use, copy, modify, merge, publish,1717+ distribute, sublicense, and/or sell copies of the Software, and to1818+ permit persons to whom the Software is furnished to do so, subject to1919+ the following conditions:2020+2121+ The above copyright notice and this permission notice shall be included2222+ in all copies or substantial portions of the Software.2323+2424+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,2525+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF2626+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.2727+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY2828+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,2929+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE3030+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */3131+3232+#ifndef _XTENSA_CORE_TIE_ASM_H3333+#define _XTENSA_CORE_TIE_ASM_H3434+3535+/* Selection parameter values for save-area save/restore macros: */3636+/* Option vs. TIE: */3737+#define XTHAL_SAS_TIE 0x0001 /* custom extension or coprocessor */3838+#define XTHAL_SAS_OPT 0x0002 /* optional (and not a coprocessor) */3939+#define XTHAL_SAS_ANYOT 0x0003 /* both of the above */4040+/* Whether used automatically by compiler: */4141+#define XTHAL_SAS_NOCC 0x0004 /* not used by compiler w/o special opts/code */4242+#define XTHAL_SAS_CC 0x0008 /* used by compiler without special opts/code */4343+#define XTHAL_SAS_ANYCC 0x000C /* both of the above */4444+/* ABI handling across function calls: */4545+#define XTHAL_SAS_CALR 0x0010 /* caller-saved */4646+#define XTHAL_SAS_CALE 0x0020 /* callee-saved */4747+#define XTHAL_SAS_GLOB 0x0040 /* global across function calls (in thread) */4848+#define XTHAL_SAS_ANYABI 0x0070 /* all of the above three */4949+/* Misc */5050+#define XTHAL_SAS_ALL 0xFFFF /* include all default NCP contents */5151+#define XTHAL_SAS3(optie,ccuse,abi) ( ((optie) & XTHAL_SAS_ANYOT) \5252+ | ((ccuse) & XTHAL_SAS_ANYCC) \5353+ | ((abi) & XTHAL_SAS_ANYABI) )5454+5555+5656+ /*5757+ * Macro to store all non-coprocessor (extra) custom TIE and optional state5858+ * (not including zero-overhead loop registers).5959+ * Required parameters:6060+ * ptr Save area pointer address register (clobbered)6161+ * (register must contain a 4 byte aligned address).6262+ * at1..at4 Four temporary address registers (first XCHAL_NCP_NUM_ATMPS6363+ * registers are clobbered, the remaining are unused).6464+ * Optional parameters:6565+ * continue If macro invoked as part of a larger store sequence, set to 16666+ * if this is not the first in the sequence. Defaults to 0.6767+ * ofs Offset from start of larger sequence (from value of first ptr6868+ * in sequence) at which to store. Defaults to next available space6969+ * (or 0 if <continue> is 0).7070+ * select Select what category(ies) of registers to store, as a bitmask7171+ * (see XTHAL_SAS_xxx constants). Defaults to all registers.7272+ * alloc Select what category(ies) of registers to allocate; if any7373+ * category is selected here that is not in <select>, space for7474+ * the corresponding registers is skipped without doing any store.7575+ */7676+ .macro xchal_ncp_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=07777+ xchal_sa_start \continue, \ofs7878+ // Optional global registers used by default by the compiler:7979+ .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\select)8080+ xchal_sa_align \ptr, 0, 1020, 4, 48181+ rur.THREADPTR \at1 // threadptr option8282+ s32i \at1, \ptr, .Lxchal_ofs_+08383+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 48484+ .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 08585+ xchal_sa_align \ptr, 0, 1020, 4, 48686+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 48787+ .endif8888+ // Optional caller-saved registers used by default by the compiler:8989+ .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\select)9090+ xchal_sa_align \ptr, 0, 1016, 4, 49191+ rsr.ACCLO \at1 // MAC16 option9292+ s32i \at1, \ptr, .Lxchal_ofs_+09393+ rsr.ACCHI \at1 // MAC16 option9494+ s32i \at1, \ptr, .Lxchal_ofs_+49595+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 89696+ .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 09797+ xchal_sa_align \ptr, 0, 1016, 4, 49898+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 89999+ .endif100100+ // Optional caller-saved registers not used by default by the compiler:101101+ .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select)102102+ xchal_sa_align \ptr, 0, 1000, 4, 4103103+ rsr.BR \at1 // boolean option104104+ s32i \at1, \ptr, .Lxchal_ofs_+0105105+ rsr.SCOMPARE1 \at1 // conditional store option106106+ s32i \at1, \ptr, .Lxchal_ofs_+4107107+ rsr.M0 \at1 // MAC16 option108108+ s32i \at1, \ptr, .Lxchal_ofs_+8109109+ rsr.M1 \at1 // MAC16 option110110+ s32i \at1, \ptr, .Lxchal_ofs_+12111111+ rsr.M2 \at1 // MAC16 option112112+ s32i \at1, \ptr, .Lxchal_ofs_+16113113+ rsr.M3 \at1 // MAC16 option114114+ s32i \at1, \ptr, .Lxchal_ofs_+20115115+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 24116116+ .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0117117+ xchal_sa_align \ptr, 0, 1000, 4, 4118118+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 24119119+ .endif120120+ .endm // xchal_ncp_store121121+122122+ /*123123+ * Macro to load all non-coprocessor (extra) custom TIE and optional state124124+ * (not including zero-overhead loop registers).125125+ * Required parameters:126126+ * ptr Save area pointer address register (clobbered)127127+ * (register must contain a 4 byte aligned address).128128+ * at1..at4 Four temporary address registers (first XCHAL_NCP_NUM_ATMPS129129+ * registers are clobbered, the remaining are unused).130130+ * Optional parameters:131131+ * continue If macro invoked as part of a larger load sequence, set to 1132132+ * if this is not the first in the sequence. Defaults to 0.133133+ * ofs Offset from start of larger sequence (from value of first ptr134134+ * in sequence) at which to load. Defaults to next available space135135+ * (or 0 if <continue> is 0).136136+ * select Select what category(ies) of registers to load, as a bitmask137137+ * (see XTHAL_SAS_xxx constants). Defaults to all registers.138138+ * alloc Select what category(ies) of registers to allocate; if any139139+ * category is selected here that is not in <select>, space for140140+ * the corresponding registers is skipped without doing any load.141141+ */142142+ .macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0143143+ xchal_sa_start \continue, \ofs144144+ // Optional global registers used by default by the compiler:145145+ .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\select)146146+ xchal_sa_align \ptr, 0, 1020, 4, 4147147+ l32i \at1, \ptr, .Lxchal_ofs_+0148148+ wur.THREADPTR \at1 // threadptr option149149+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 4150150+ .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0151151+ xchal_sa_align \ptr, 0, 1020, 4, 4152152+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 4153153+ .endif154154+ // Optional caller-saved registers used by default by the compiler:155155+ .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\select)156156+ xchal_sa_align \ptr, 0, 1016, 4, 4157157+ l32i \at1, \ptr, .Lxchal_ofs_+0158158+ wsr.ACCLO \at1 // MAC16 option159159+ l32i \at1, \ptr, .Lxchal_ofs_+4160160+ wsr.ACCHI \at1 // MAC16 option161161+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 8162162+ .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~(\alloc)) == 0163163+ xchal_sa_align \ptr, 0, 1016, 4, 4164164+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 8165165+ .endif166166+ // Optional caller-saved registers not used by default by the compiler:167167+ .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select)168168+ xchal_sa_align \ptr, 0, 1000, 4, 4169169+ l32i \at1, \ptr, .Lxchal_ofs_+0170170+ wsr.BR \at1 // boolean option171171+ l32i \at1, \ptr, .Lxchal_ofs_+4172172+ wsr.SCOMPARE1 \at1 // conditional store option173173+ l32i \at1, \ptr, .Lxchal_ofs_+8174174+ wsr.M0 \at1 // MAC16 option175175+ l32i \at1, \ptr, .Lxchal_ofs_+12176176+ wsr.M1 \at1 // MAC16 option177177+ l32i \at1, \ptr, .Lxchal_ofs_+16178178+ wsr.M2 \at1 // MAC16 option179179+ l32i \at1, \ptr, .Lxchal_ofs_+20180180+ wsr.M3 \at1 // MAC16 option181181+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 24182182+ .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0183183+ xchal_sa_align \ptr, 0, 1000, 4, 4184184+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 24185185+ .endif186186+ .endm // xchal_ncp_load187187+188188+189189+#define XCHAL_NCP_NUM_ATMPS 1190190+191191+ /* 192192+ * Macro to store the state of TIE coprocessor AudioEngineLX.193193+ * Required parameters:194194+ * ptr Save area pointer address register (clobbered)195195+ * (register must contain a 8 byte aligned address).196196+ * at1..at4 Four temporary address registers (first XCHAL_CP1_NUM_ATMPS197197+ * registers are clobbered, the remaining are unused).198198+ * Optional parameters are the same as for xchal_ncp_store.199199+ */200200+#define xchal_cp_AudioEngineLX_store xchal_cp1_store201201+ .macro xchal_cp1_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0202202+ xchal_sa_start \continue, \ofs203203+ // Custom caller-saved registers not used by default by the compiler:204204+ .ifeq (XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select)205205+ xchal_sa_align \ptr, 0, 0, 8, 8206206+ rur.AE_OVF_SAR \at1 // ureg 240207207+ s32i \at1, \ptr, .Lxchal_ofs_+0208208+ rur.AE_BITHEAD \at1 // ureg 241209209+ s32i \at1, \ptr, .Lxchal_ofs_+4210210+ rur.AE_TS_FTS_BU_BP \at1 // ureg 242211211+ s32i \at1, \ptr, .Lxchal_ofs_+8212212+ rur.AE_SD_NO \at1 // ureg 243213213+ s32i \at1, \ptr, .Lxchal_ofs_+12214214+ rur.AE_CBEGIN0 \at1 // ureg 246215215+ s32i \at1, \ptr, .Lxchal_ofs_+16216216+ rur.AE_CEND0 \at1 // ureg 247217217+ s32i \at1, \ptr, .Lxchal_ofs_+20218218+ ae_sp24x2s.i aep0, \ptr, .Lxchal_ofs_+24219219+ ae_sp24x2s.i aep1, \ptr, .Lxchal_ofs_+32220220+ ae_sp24x2s.i aep2, \ptr, .Lxchal_ofs_+40221221+ ae_sp24x2s.i aep3, \ptr, .Lxchal_ofs_+48222222+ ae_sp24x2s.i aep4, \ptr, .Lxchal_ofs_+56223223+ addi \ptr, \ptr, 64224224+ ae_sp24x2s.i aep5, \ptr, .Lxchal_ofs_+0225225+ ae_sp24x2s.i aep6, \ptr, .Lxchal_ofs_+8226226+ ae_sp24x2s.i aep7, \ptr, .Lxchal_ofs_+16227227+ ae_sq56s.i aeq0, \ptr, .Lxchal_ofs_+24228228+ ae_sq56s.i aeq1, \ptr, .Lxchal_ofs_+32229229+ ae_sq56s.i aeq2, \ptr, .Lxchal_ofs_+40230230+ ae_sq56s.i aeq3, \ptr, .Lxchal_ofs_+48231231+ .set .Lxchal_pofs_, .Lxchal_pofs_ + 64232232+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 56233233+ .elseif ((XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0234234+ xchal_sa_align \ptr, 0, 0, 8, 8235235+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 120236236+ .endif237237+ .endm // xchal_cp1_store238238+239239+ /* 240240+ * Macro to load the state of TIE coprocessor AudioEngineLX.241241+ * Required parameters:242242+ * ptr Save area pointer address register (clobbered)243243+ * (register must contain a 8 byte aligned address).244244+ * at1..at4 Four temporary address registers (first XCHAL_CP1_NUM_ATMPS245245+ * registers are clobbered, the remaining are unused).246246+ * Optional parameters are the same as for xchal_ncp_load.247247+ */248248+#define xchal_cp_AudioEngineLX_load xchal_cp1_load249249+ .macro xchal_cp1_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0250250+ xchal_sa_start \continue, \ofs251251+ // Custom caller-saved registers not used by default by the compiler:252252+ .ifeq (XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select)253253+ xchal_sa_align \ptr, 0, 0, 8, 8254254+ l32i \at1, \ptr, .Lxchal_ofs_+0255255+ wur.AE_OVF_SAR \at1 // ureg 240256256+ l32i \at1, \ptr, .Lxchal_ofs_+4257257+ wur.AE_BITHEAD \at1 // ureg 241258258+ l32i \at1, \ptr, .Lxchal_ofs_+8259259+ wur.AE_TS_FTS_BU_BP \at1 // ureg 242260260+ l32i \at1, \ptr, .Lxchal_ofs_+12261261+ wur.AE_SD_NO \at1 // ureg 243262262+ l32i \at1, \ptr, .Lxchal_ofs_+16263263+ wur.AE_CBEGIN0 \at1 // ureg 246264264+ l32i \at1, \ptr, .Lxchal_ofs_+20265265+ wur.AE_CEND0 \at1 // ureg 247266266+ ae_lp24x2.i aep0, \ptr, .Lxchal_ofs_+24267267+ ae_lp24x2.i aep1, \ptr, .Lxchal_ofs_+32268268+ ae_lp24x2.i aep2, \ptr, .Lxchal_ofs_+40269269+ ae_lp24x2.i aep3, \ptr, .Lxchal_ofs_+48270270+ ae_lp24x2.i aep4, \ptr, .Lxchal_ofs_+56271271+ addi \ptr, \ptr, 64272272+ ae_lp24x2.i aep5, \ptr, .Lxchal_ofs_+0273273+ ae_lp24x2.i aep6, \ptr, .Lxchal_ofs_+8274274+ ae_lp24x2.i aep7, \ptr, .Lxchal_ofs_+16275275+ addi \ptr, \ptr, 24276276+ ae_lq56.i aeq0, \ptr, .Lxchal_ofs_+0277277+ ae_lq56.i aeq1, \ptr, .Lxchal_ofs_+8278278+ ae_lq56.i aeq2, \ptr, .Lxchal_ofs_+16279279+ ae_lq56.i aeq3, \ptr, .Lxchal_ofs_+24280280+ .set .Lxchal_pofs_, .Lxchal_pofs_ + 88281281+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 32282282+ .elseif ((XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0283283+ xchal_sa_align \ptr, 0, 0, 8, 8284284+ .set .Lxchal_ofs_, .Lxchal_ofs_ + 120285285+ .endif286286+ .endm // xchal_cp1_load287287+288288+#define XCHAL_CP1_NUM_ATMPS 1289289+#define XCHAL_SA_NUM_ATMPS 1290290+291291+ /* Empty macros for unconfigured coprocessors: */292292+ .macro xchal_cp0_store p a b c d continue=0 ofs=-1 select=-1 ; .endm293293+ .macro xchal_cp0_load p a b c d continue=0 ofs=-1 select=-1 ; .endm294294+ .macro xchal_cp2_store p a b c d continue=0 ofs=-1 select=-1 ; .endm295295+ .macro xchal_cp2_load p a b c d continue=0 ofs=-1 select=-1 ; .endm296296+ .macro xchal_cp3_store p a b c d continue=0 ofs=-1 select=-1 ; .endm297297+ .macro xchal_cp3_load p a b c d continue=0 ofs=-1 select=-1 ; .endm298298+ .macro xchal_cp4_store p a b c d continue=0 ofs=-1 select=-1 ; .endm299299+ .macro xchal_cp4_load p a b c d continue=0 ofs=-1 select=-1 ; .endm300300+ .macro xchal_cp5_store p a b c d continue=0 ofs=-1 select=-1 ; .endm301301+ .macro xchal_cp5_load p a b c d continue=0 ofs=-1 select=-1 ; .endm302302+ .macro xchal_cp6_store p a b c d continue=0 ofs=-1 select=-1 ; .endm303303+ .macro xchal_cp6_load p a b c d continue=0 ofs=-1 select=-1 ; .endm304304+ .macro xchal_cp7_store p a b c d continue=0 ofs=-1 select=-1 ; .endm305305+ .macro xchal_cp7_load p a b c d continue=0 ofs=-1 select=-1 ; .endm306306+307307+#endif /*_XTENSA_CORE_TIE_ASM_H*/308308+
···11+/* 22+ * tie.h -- compile-time HAL definitions dependent on CORE & TIE configuration33+ *44+ * NOTE: This header file is not meant to be included directly.55+ */66+77+/* This header file describes this specific Xtensa processor's TIE extensions88+ that extend basic Xtensa core functionality. It is customized to this99+ Xtensa processor configuration.1010+1111+ Copyright (c) 1999-2015 Cadence Design Systems Inc.1212+1313+ Permission is hereby granted, free of charge, to any person obtaining1414+ a copy of this software and associated documentation files (the1515+ "Software"), to deal in the Software without restriction, including1616+ without limitation the rights to use, copy, modify, merge, publish,1717+ distribute, sublicense, and/or sell copies of the Software, and to1818+ permit persons to whom the Software is furnished to do so, subject to1919+ the following conditions:2020+2121+ The above copyright notice and this permission notice shall be included2222+ in all copies or substantial portions of the Software.2323+2424+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,2525+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF2626+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.2727+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY2828+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,2929+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE3030+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */3131+3232+#ifndef _XTENSA_CORE_TIE_H3333+#define _XTENSA_CORE_TIE_H3434+3535+#define XCHAL_CP_NUM 2 /* number of coprocessors */3636+#define XCHAL_CP_MAX 8 /* max CP ID + 1 (0 if none) */3737+#define XCHAL_CP_MASK 0x82 /* bitmask of all CPs by ID */3838+#define XCHAL_CP_PORT_MASK 0x80 /* bitmask of only port CPs */3939+4040+/* Basic parameters of each coprocessor: */4141+#define XCHAL_CP1_NAME "AudioEngineLX"4242+#define XCHAL_CP1_IDENT AudioEngineLX4343+#define XCHAL_CP1_SA_SIZE 120 /* size of state save area */4444+#define XCHAL_CP1_SA_ALIGN 8 /* min alignment of save area */4545+#define XCHAL_CP_ID_AUDIOENGINELX 1 /* coprocessor ID (0..7) */4646+#define XCHAL_CP7_NAME "XTIOP"4747+#define XCHAL_CP7_IDENT XTIOP4848+#define XCHAL_CP7_SA_SIZE 0 /* size of state save area */4949+#define XCHAL_CP7_SA_ALIGN 1 /* min alignment of save area */5050+#define XCHAL_CP_ID_XTIOP 7 /* coprocessor ID (0..7) */5151+5252+/* Filler info for unassigned coprocessors, to simplify arrays etc: */5353+#define XCHAL_CP0_SA_SIZE 05454+#define XCHAL_CP0_SA_ALIGN 15555+#define XCHAL_CP2_SA_SIZE 05656+#define XCHAL_CP2_SA_ALIGN 15757+#define XCHAL_CP3_SA_SIZE 05858+#define XCHAL_CP3_SA_ALIGN 15959+#define XCHAL_CP4_SA_SIZE 06060+#define XCHAL_CP4_SA_ALIGN 16161+#define XCHAL_CP5_SA_SIZE 06262+#define XCHAL_CP5_SA_ALIGN 16363+#define XCHAL_CP6_SA_SIZE 06464+#define XCHAL_CP6_SA_ALIGN 16565+6666+/* Save area for non-coprocessor optional and custom (TIE) state: */6767+#define XCHAL_NCP_SA_SIZE 366868+#define XCHAL_NCP_SA_ALIGN 46969+7070+/* Total save area for optional and custom state (NCP + CPn): */7171+#define XCHAL_TOTAL_SA_SIZE 160 /* with 16-byte align padding */7272+#define XCHAL_TOTAL_SA_ALIGN 8 /* actual minimum alignment */7373+7474+/*7575+ * Detailed contents of save areas.7676+ * NOTE: caller must define the XCHAL_SA_REG macro (not defined here)7777+ * before expanding the XCHAL_xxx_SA_LIST() macros.7878+ *7979+ * XCHAL_SA_REG(s,ccused,abikind,kind,opt,name,galign,align,asize,8080+ * dbnum,base,regnum,bitsz,gapsz,reset,x...)8181+ *8282+ * s = passed from XCHAL_*_LIST(s), eg. to select how to expand8383+ * ccused = set if used by compiler without special options or code8484+ * abikind = 0 (caller-saved), 1 (callee-saved), or 2 (thread-global)8585+ * kind = 0 (special reg), 1 (TIE user reg), or 2 (TIE regfile reg)8686+ * opt = 0 (custom TIE extension or coprocessor), or 1 (optional reg)8787+ * name = lowercase reg name (no quotes)8888+ * galign = group byte alignment (power of 2) (galign >= align)8989+ * align = register byte alignment (power of 2)9090+ * asize = allocated size in bytes (asize*8 == bitsz + gapsz + padsz)9191+ * (not including any pad bytes required to galign this or next reg)9292+ * dbnum = unique target number f/debug (see <xtensa-libdb-macros.h>)9393+ * base = reg shortname w/o index (or sr=special, ur=TIE user reg)9494+ * regnum = reg index in regfile, or special/TIE-user reg number9595+ * bitsz = number of significant bits (regfile width, or ur/sr mask bits)9696+ * gapsz = intervening bits, if bitsz bits not stored contiguously9797+ * (padsz = pad bits at end [TIE regfile] or at msbits [ur,sr] of asize)9898+ * reset = register reset value (or 0 if undefined at reset)9999+ * x = reserved for future use (0 until then)100100+ *101101+ * To filter out certain registers, e.g. to expand only the non-global102102+ * registers used by the compiler, you can do something like this:103103+ *104104+ * #define XCHAL_SA_REG(s,ccused,p...) SELCC##ccused(p)105105+ * #define SELCC0(p...)106106+ * #define SELCC1(abikind,p...) SELAK##abikind(p)107107+ * #define SELAK0(p...) REG(p)108108+ * #define SELAK1(p...) REG(p)109109+ * #define SELAK2(p...)110110+ * #define REG(kind,tie,name,galn,aln,asz,csz,dbnum,base,rnum,bsz,rst,x...) \111111+ * ...what you want to expand...112112+ */113113+114114+#define XCHAL_NCP_SA_NUM 9115115+#define XCHAL_NCP_SA_LIST(s) \116116+ XCHAL_SA_REG(s,1,2,1,1, threadptr, 4, 4, 4,0x03E7, ur,231, 32,0,0,0) \117117+ XCHAL_SA_REG(s,1,0,0,1, acclo, 4, 4, 4,0x0210, sr,16 , 32,0,0,0) \118118+ XCHAL_SA_REG(s,1,0,0,1, acchi, 4, 4, 4,0x0211, sr,17 , 8,0,0,0) \119119+ XCHAL_SA_REG(s,0,0,0,1, br, 4, 4, 4,0x0204, sr,4 , 16,0,0,0) \120120+ XCHAL_SA_REG(s,0,0,0,1, scompare1, 4, 4, 4,0x020C, sr,12 , 32,0,0,0) \121121+ XCHAL_SA_REG(s,0,0,0,1, m0, 4, 4, 4,0x0220, sr,32 , 32,0,0,0) \122122+ XCHAL_SA_REG(s,0,0,0,1, m1, 4, 4, 4,0x0221, sr,33 , 32,0,0,0) \123123+ XCHAL_SA_REG(s,0,0,0,1, m2, 4, 4, 4,0x0222, sr,34 , 32,0,0,0) \124124+ XCHAL_SA_REG(s,0,0,0,1, m3, 4, 4, 4,0x0223, sr,35 , 32,0,0,0)125125+126126+#define XCHAL_CP0_SA_NUM 0127127+#define XCHAL_CP0_SA_LIST(s) /* empty */128128+129129+#define XCHAL_CP1_SA_NUM 18130130+#define XCHAL_CP1_SA_LIST(s) \131131+ XCHAL_SA_REG(s,0,0,1,0, ae_ovf_sar, 8, 4, 4,0x03F0, ur,240, 7,0,0,0) \132132+ XCHAL_SA_REG(s,0,0,1,0, ae_bithead, 4, 4, 4,0x03F1, ur,241, 32,0,0,0) \133133+ XCHAL_SA_REG(s,0,0,1,0,ae_ts_fts_bu_bp, 4, 4, 4,0x03F2, ur,242, 16,0,0,0) \134134+ XCHAL_SA_REG(s,0,0,1,0, ae_sd_no, 4, 4, 4,0x03F3, ur,243, 28,0,0,0) \135135+ XCHAL_SA_REG(s,0,0,1,0, ae_cbegin0, 4, 4, 4,0x03F6, ur,246, 32,0,0,0) \136136+ XCHAL_SA_REG(s,0,0,1,0, ae_cend0, 4, 4, 4,0x03F7, ur,247, 32,0,0,0) \137137+ XCHAL_SA_REG(s,0,0,2,0, aep0, 8, 8, 8,0x0060, aep,0 , 48,0,0,0) \138138+ XCHAL_SA_REG(s,0,0,2,0, aep1, 8, 8, 8,0x0061, aep,1 , 48,0,0,0) \139139+ XCHAL_SA_REG(s,0,0,2,0, aep2, 8, 8, 8,0x0062, aep,2 , 48,0,0,0) \140140+ XCHAL_SA_REG(s,0,0,2,0, aep3, 8, 8, 8,0x0063, aep,3 , 48,0,0,0) \141141+ XCHAL_SA_REG(s,0,0,2,0, aep4, 8, 8, 8,0x0064, aep,4 , 48,0,0,0) \142142+ XCHAL_SA_REG(s,0,0,2,0, aep5, 8, 8, 8,0x0065, aep,5 , 48,0,0,0) \143143+ XCHAL_SA_REG(s,0,0,2,0, aep6, 8, 8, 8,0x0066, aep,6 , 48,0,0,0) \144144+ XCHAL_SA_REG(s,0,0,2,0, aep7, 8, 8, 8,0x0067, aep,7 , 48,0,0,0) \145145+ XCHAL_SA_REG(s,0,0,2,0, aeq0, 8, 8, 8,0x0068, aeq,0 , 56,0,0,0) \146146+ XCHAL_SA_REG(s,0,0,2,0, aeq1, 8, 8, 8,0x0069, aeq,1 , 56,0,0,0) \147147+ XCHAL_SA_REG(s,0,0,2,0, aeq2, 8, 8, 8,0x006A, aeq,2 , 56,0,0,0) \148148+ XCHAL_SA_REG(s,0,0,2,0, aeq3, 8, 8, 8,0x006B, aeq,3 , 56,0,0,0)149149+150150+#define XCHAL_CP2_SA_NUM 0151151+#define XCHAL_CP2_SA_LIST(s) /* empty */152152+153153+#define XCHAL_CP3_SA_NUM 0154154+#define XCHAL_CP3_SA_LIST(s) /* empty */155155+156156+#define XCHAL_CP4_SA_NUM 0157157+#define XCHAL_CP4_SA_LIST(s) /* empty */158158+159159+#define XCHAL_CP5_SA_NUM 0160160+#define XCHAL_CP5_SA_LIST(s) /* empty */161161+162162+#define XCHAL_CP6_SA_NUM 0163163+#define XCHAL_CP6_SA_LIST(s) /* empty */164164+165165+#define XCHAL_CP7_SA_NUM 0166166+#define XCHAL_CP7_SA_LIST(s) /* empty */167167+168168+/* Byte length of instruction from its first nibble (op0 field), per FLIX. */169169+#define XCHAL_OP0_FORMAT_LENGTHS 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,8170170+/* Byte length of instruction from its first byte, per FLIX. */171171+#define XCHAL_BYTE0_FORMAT_LENGTHS \172172+ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,\173173+ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,\174174+ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,\175175+ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,\176176+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,\177177+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,\178178+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,\179179+ 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8180180+181181+#endif /*_XTENSA_CORE_TIE_H*/182182+