Path: blob/master/arch/powerpc/include/uapi/asm/sigcontext.h
26516 views
/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */1#ifndef _ASM_POWERPC_SIGCONTEXT_H2#define _ASM_POWERPC_SIGCONTEXT_H34/*5* This program is free software; you can redistribute it and/or6* modify it under the terms of the GNU General Public License7* as published by the Free Software Foundation; either version8* 2 of the License, or (at your option) any later version.9*/10#include <linux/compiler.h>11#include <asm/ptrace.h>12#ifdef __powerpc64__13#include <asm/elf.h>14#endif1516struct sigcontext {17unsigned long _unused[4];18int signal;19#ifdef __powerpc64__20int _pad0;21#endif22unsigned long handler;23unsigned long oldmask;24#ifdef __KERNEL__25struct user_pt_regs __user *regs;26#else27struct pt_regs *regs;28#endif29#ifdef __powerpc64__30elf_gregset_t gp_regs;31elf_fpregset_t fp_regs;32/*33* To maintain compatibility with current implementations the sigcontext is34* extended by appending a pointer (v_regs) to a quadword type (elf_vrreg_t)35* followed by an unstructured (vmx_reserve) field of 101 doublewords. This36* allows the array of vector registers to be quadword aligned independent of37* the alignment of the containing sigcontext or ucontext. It is the38* responsibility of the code setting the sigcontext to set this pointer to39* either NULL (if this processor does not support the VMX feature) or the40* address of the first quadword within the allocated (vmx_reserve) area.41*42* The pointer (v_regs) of vector type (elf_vrreg_t) is type compatible with43* an array of 34 quadword entries (elf_vrregset_t). The entries with44* indexes 0-31 contain the corresponding vector registers. The entry with45* index 32 contains the vscr as the last word (offset 12) within the46* quadword. This allows the vscr to be stored as either a quadword (since47* it must be copied via a vector register to/from storage) or as a word.48* The entry with index 33 contains the vrsave as the first word (offset 0)49* within the quadword.50*51* Part of the VSX data is stored here also by extending vmx_restore52* by an additional 32 double words. Architecturally the layout of53* the VSR registers and how they overlap on top of the legacy FPR and54* VR registers is shown below:55*56* VSR doubleword 0 VSR doubleword 157* ----------------------------------------------------------------58* VSR[0] | FPR[0] | |59* ----------------------------------------------------------------60* VSR[1] | FPR[1] | |61* ----------------------------------------------------------------62* | ... | |63* | ... | |64* ----------------------------------------------------------------65* VSR[30] | FPR[30] | |66* ----------------------------------------------------------------67* VSR[31] | FPR[31] | |68* ----------------------------------------------------------------69* VSR[32] | VR[0] |70* ----------------------------------------------------------------71* VSR[33] | VR[1] |72* ----------------------------------------------------------------73* | ... |74* | ... |75* ----------------------------------------------------------------76* VSR[62] | VR[30] |77* ----------------------------------------------------------------78* VSR[63] | VR[31] |79* ----------------------------------------------------------------80*81* FPR/VSR 0-31 doubleword 0 is stored in fp_regs, and VMX/VSR 32-6382* is stored at the start of vmx_reserve. vmx_reserve is extended for83* backwards compatility to store VSR 0-31 doubleword 1 after the VMX84* registers and vscr/vrsave.85*/86elf_vrreg_t __user *v_regs;87long vmx_reserve[ELF_NVRREG + ELF_NVRREG + 1 + 32];88#endif89};9091#endif /* _ASM_POWERPC_SIGCONTEXT_H */929394