18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * uctx.h: Sparc64 {set,get}context() register state layouts.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef __SPARC64_UCTX_H
98c2ecf20Sopenharmony_ci#define __SPARC64_UCTX_H
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define MC_TSTATE	0
128c2ecf20Sopenharmony_ci#define MC_PC		1
138c2ecf20Sopenharmony_ci#define MC_NPC		2
148c2ecf20Sopenharmony_ci#define MC_Y		3
158c2ecf20Sopenharmony_ci#define MC_G1		4
168c2ecf20Sopenharmony_ci#define MC_G2		5
178c2ecf20Sopenharmony_ci#define MC_G3		6
188c2ecf20Sopenharmony_ci#define MC_G4		7
198c2ecf20Sopenharmony_ci#define MC_G5		8
208c2ecf20Sopenharmony_ci#define MC_G6		9
218c2ecf20Sopenharmony_ci#define MC_G7		10
228c2ecf20Sopenharmony_ci#define MC_O0		11
238c2ecf20Sopenharmony_ci#define MC_O1		12
248c2ecf20Sopenharmony_ci#define MC_O2		13
258c2ecf20Sopenharmony_ci#define MC_O3		14
268c2ecf20Sopenharmony_ci#define MC_O4		15
278c2ecf20Sopenharmony_ci#define MC_O5		16
288c2ecf20Sopenharmony_ci#define MC_O6		17
298c2ecf20Sopenharmony_ci#define MC_O7		18
308c2ecf20Sopenharmony_ci#define MC_NGREG	19
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_citypedef unsigned long mc_greg_t;
338c2ecf20Sopenharmony_citypedef mc_greg_t mc_gregset_t[MC_NGREG];
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#define MC_MAXFPQ	16
368c2ecf20Sopenharmony_cistruct mc_fq {
378c2ecf20Sopenharmony_ci	unsigned long	*mcfq_addr;
388c2ecf20Sopenharmony_ci	unsigned int	mcfq_insn;
398c2ecf20Sopenharmony_ci};
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_cistruct mc_fpu {
428c2ecf20Sopenharmony_ci	union {
438c2ecf20Sopenharmony_ci		unsigned int	sregs[32];
448c2ecf20Sopenharmony_ci		unsigned long	dregs[32];
458c2ecf20Sopenharmony_ci		long double	qregs[16];
468c2ecf20Sopenharmony_ci	} mcfpu_fregs;
478c2ecf20Sopenharmony_ci	unsigned long	mcfpu_fsr;
488c2ecf20Sopenharmony_ci	unsigned long	mcfpu_fprs;
498c2ecf20Sopenharmony_ci	unsigned long	mcfpu_gsr;
508c2ecf20Sopenharmony_ci	struct mc_fq	*mcfpu_fq;
518c2ecf20Sopenharmony_ci	unsigned char	mcfpu_qcnt;
528c2ecf20Sopenharmony_ci	unsigned char	mcfpu_qentsz;
538c2ecf20Sopenharmony_ci	unsigned char	mcfpu_enab;
548c2ecf20Sopenharmony_ci};
558c2ecf20Sopenharmony_citypedef struct mc_fpu mc_fpu_t;
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_citypedef struct {
588c2ecf20Sopenharmony_ci	mc_gregset_t	mc_gregs;
598c2ecf20Sopenharmony_ci	mc_greg_t	mc_fp;
608c2ecf20Sopenharmony_ci	mc_greg_t	mc_i7;
618c2ecf20Sopenharmony_ci	mc_fpu_t	mc_fpregs;
628c2ecf20Sopenharmony_ci} mcontext_t;
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_cistruct ucontext {
658c2ecf20Sopenharmony_ci	struct ucontext		*uc_link;
668c2ecf20Sopenharmony_ci	unsigned long		uc_flags;
678c2ecf20Sopenharmony_ci	sigset_t		uc_sigmask;
688c2ecf20Sopenharmony_ci	mcontext_t		uc_mcontext;
698c2ecf20Sopenharmony_ci};
708c2ecf20Sopenharmony_citypedef struct ucontext ucontext_t;
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci#endif /* __SPARC64_UCTX_H */
73