sigcontext.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /*
  3. * Author: Hanlu Li <lihanlu@loongson.cn>
  4. * Huacai Chen <chenhuacai@loongson.cn>
  5. *
  6. * Copyright (C) 2020-2022 Loongson Technology Corporation Limited
  7. */
  8. #ifndef _UAPI_ASM_SIGCONTEXT_H
  9. #define _UAPI_ASM_SIGCONTEXT_H
  10. #include <linux/types.h>
  11. /* FP context was used */
  12. #define SC_USED_FP (1 << 0)
  13. /* Address error was due to memory load */
  14. #define SC_ADDRERR_RD (1 << 30)
  15. /* Address error was due to memory store */
  16. #define SC_ADDRERR_WR (1 << 31)
  17. struct sigcontext {
  18. __u64 sc_pc;
  19. __u64 sc_regs[32];
  20. __u32 sc_flags;
  21. __u64 sc_extcontext[0] __attribute__((__aligned__(16)));
  22. };
  23. #define CONTEXT_INFO_ALIGN 16
  24. struct sctx_info {
  25. __u32 magic;
  26. __u32 size;
  27. __u64 padding; /* padding to 16 bytes */
  28. };
  29. /* FPU context */
  30. #define FPU_CTX_MAGIC 0x46505501
  31. #define FPU_CTX_ALIGN 8
  32. struct fpu_context {
  33. __u64 regs[32];
  34. __u64 fcc;
  35. __u32 fcsr;
  36. };
  37. /* LSX context */
  38. #define LSX_CTX_MAGIC 0x53580001
  39. #define LSX_CTX_ALIGN 16
  40. struct lsx_context {
  41. __u64 regs[2*32];
  42. __u64 fcc;
  43. __u32 fcsr;
  44. };
  45. /* LASX context */
  46. #define LASX_CTX_MAGIC 0x41535801
  47. #define LASX_CTX_ALIGN 32
  48. struct lasx_context {
  49. __u64 regs[4*32];
  50. __u64 fcc;
  51. __u32 fcsr;
  52. };
  53. /* LBT context */
  54. #define LBT_CTX_MAGIC 0x42540001
  55. #define LBT_CTX_ALIGN 8
  56. struct lbt_context {
  57. __u64 regs[4];
  58. __u32 eflags;
  59. __u32 ftop;
  60. };
  61. #endif /* _UAPI_ASM_SIGCONTEXT_H */