tie-asm.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * This header file contains assembly-language definitions (assembly
  3. * macros, etc.) for this specific Xtensa processor's TIE extensions
  4. * and options. It is customized to this Xtensa processor configuration.
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING" in the main directory of this archive
  8. * for more details.
  9. *
  10. * Copyright (C) 1999-2008 Tensilica Inc.
  11. */
  12. #ifndef _XTENSA_CORE_TIE_ASM_H
  13. #define _XTENSA_CORE_TIE_ASM_H
  14. /* Selection parameter values for save-area save/restore macros: */
  15. /* Option vs. TIE: */
  16. #define XTHAL_SAS_TIE 0x0001 /* custom extension or coprocessor */
  17. #define XTHAL_SAS_OPT 0x0002 /* optional (and not a coprocessor) */
  18. /* Whether used automatically by compiler: */
  19. #define XTHAL_SAS_NOCC 0x0004 /* not used by compiler w/o special opts/code */
  20. #define XTHAL_SAS_CC 0x0008 /* used by compiler without special opts/code */
  21. /* ABI handling across function calls: */
  22. #define XTHAL_SAS_CALR 0x0010 /* caller-saved */
  23. #define XTHAL_SAS_CALE 0x0020 /* callee-saved */
  24. #define XTHAL_SAS_GLOB 0x0040 /* global across function calls (in thread) */
  25. /* Misc */
  26. #define XTHAL_SAS_ALL 0xFFFF /* include all default NCP contents */
  27. /* Macro to save all non-coprocessor (extra) custom TIE and optional state
  28. * (not including zero-overhead loop registers).
  29. * Save area ptr (clobbered): ptr (1 byte aligned)
  30. * Scratch regs (clobbered): at1..at4 (only first XCHAL_NCP_NUM_ATMPS needed)
  31. */
  32. .macro xchal_ncp_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL
  33. xchal_sa_start \continue, \ofs
  34. .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~\select
  35. xchal_sa_align \ptr, 0, 1024-4, 4, 4
  36. rur \at1, THREADPTR // threadptr option
  37. s32i \at1, \ptr, .Lxchal_ofs_ + 0
  38. .set .Lxchal_ofs_, .Lxchal_ofs_ + 4
  39. .endif
  40. .endm // xchal_ncp_store
  41. /* Macro to save all non-coprocessor (extra) custom TIE and optional state
  42. * (not including zero-overhead loop registers).
  43. * Save area ptr (clobbered): ptr (1 byte aligned)
  44. * Scratch regs (clobbered): at1..at4 (only first XCHAL_NCP_NUM_ATMPS needed)
  45. */
  46. .macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL
  47. xchal_sa_start \continue, \ofs
  48. .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~\select
  49. xchal_sa_align \ptr, 0, 1024-4, 4, 4
  50. l32i \at1, \ptr, .Lxchal_ofs_ + 0
  51. wur \at1, THREADPTR // threadptr option
  52. .set .Lxchal_ofs_, .Lxchal_ofs_ + 4
  53. .endif
  54. .endm // xchal_ncp_load
  55. #define XCHAL_NCP_NUM_ATMPS 1
  56. #define XCHAL_SA_NUM_ATMPS 1
  57. #endif /*_XTENSA_CORE_TIE_ASM_H*/