/* SPDX-License-Identifier: GPL-2.0-or-later */1/*2* Copyright (C) 2001 Matthew Wilcox <willy at parisc-linux.org>3* Copyright (C) 2003 Carlos O'Donell <carlos at parisc-linux.org>4*/5#ifndef _PARISC64_KERNEL_SIGNAL32_H6#define _PARISC64_KERNEL_SIGNAL32_H78#include <linux/compat.h>910/* 32-bit ucontext as seen from an 64-bit kernel */11struct compat_ucontext {12compat_uint_t uc_flags;13compat_uptr_t uc_link;14compat_stack_t uc_stack; /* struct compat_sigaltstack (12 bytes)*/15/* FIXME: Pad out to get uc_mcontext to start at an 8-byte aligned boundary */16compat_uint_t pad[1];17struct compat_sigcontext uc_mcontext;18compat_sigset_t uc_sigmask; /* mask last for extensibility */19};2021/* ELF32 signal handling */2223/* In a deft move of uber-hackery, we decide to carry the top half of all24* 64-bit registers in a non-portable, non-ABI, hidden structure.25* Userspace can read the hidden structure if it *wants* but is never26* guaranteed to be in the same place. In fact the uc_sigmask from the27* ucontext_t structure may push the hidden register file downards28*/29struct compat_regfile {30/* Upper half of all the 64-bit registers that were truncated31on a copy to a 32-bit userspace */32compat_int_t rf_gr[32];33compat_int_t rf_iasq[2];34compat_int_t rf_iaoq[2];35compat_int_t rf_sar;36};3738struct compat_rt_sigframe {39unsigned int tramp[2]; /* holds original return address */40compat_siginfo_t info;41struct compat_ucontext uc;42/* Hidden location of truncated registers, *must* be last. */43struct compat_regfile regs;44};4546/*47* The 32-bit ABI wants at least 48 bytes for a function call frame:48* 16 bytes for arg0-arg3, and 32 bytes for magic (the only part of49* which Linux/parisc uses is sp-20 for the saved return pointer...)50* Then, the stack pointer must be rounded to a cache line (64 bytes).51*/52#define SIGFRAME32 6453#define FUNCTIONCALLFRAME32 4854#define PARISC_RT_SIGFRAME_SIZE32 (((sizeof(struct compat_rt_sigframe) + FUNCTIONCALLFRAME32) + SIGFRAME32) & -SIGFRAME32)5556long restore_sigcontext32(struct compat_sigcontext __user *sc,57struct compat_regfile __user *rf,58struct pt_regs *regs);59long setup_sigcontext32(struct compat_sigcontext __user *sc,60struct compat_regfile __user *rf,61struct pt_regs *regs, int in_syscall);6263#endif646566