1280364Sandrew/*-
2280364Sandrew * Copyright (c) 2014 Andrew Turner
3280364Sandrew * Copyright (c) 2014-2015 The FreeBSD Foundation
4280364Sandrew * All rights reserved.
5280364Sandrew *
6280364Sandrew * This software was developed by Andrew Turner under
7280364Sandrew * sponsorship from the FreeBSD Foundation.
8280364Sandrew *
9280364Sandrew * Redistribution and use in source and binary forms, with or without
10280364Sandrew * modification, are permitted provided that the following conditions
11280364Sandrew * are met:
12280364Sandrew * 1. Redistributions of source code must retain the above copyright
13280364Sandrew *    notice, this list of conditions and the following disclaimer.
14280364Sandrew * 2. Redistributions in binary form must reproduce the above copyright
15280364Sandrew *    notice, this list of conditions and the following disclaimer in the
16280364Sandrew *    documentation and/or other materials provided with the distribution.
17280364Sandrew *
18280364Sandrew * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19280364Sandrew * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20280364Sandrew * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21280364Sandrew * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22280364Sandrew * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23280364Sandrew * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24280364Sandrew * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25280364Sandrew * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26280364Sandrew * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27280364Sandrew * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28280364Sandrew * SUCH DAMAGE.
29280364Sandrew *
30280364Sandrew * $FreeBSD$
31280364Sandrew */
32280364Sandrew
33280364Sandrew#ifndef _MACHINE_UCONTEXT_H_
34280364Sandrew#define	_MACHINE_UCONTEXT_H_
35280364Sandrew
36280364Sandrewstruct gpregs {
37285313Sandrew	__register_t	gp_x[30];
38285313Sandrew	__register_t	gp_lr;
39285313Sandrew	__register_t	gp_sp;
40285313Sandrew	__register_t	gp_elr;
41285313Sandrew	__uint32_t	gp_spsr;
42285313Sandrew	int		gp_pad;
43280364Sandrew};
44280364Sandrew
45280364Sandrewstruct fpregs {
46280364Sandrew	__uint128_t	fp_q[32];
47285313Sandrew	__uint32_t	fp_sr;
48285313Sandrew	__uint32_t	fp_cr;
49285313Sandrew	int		fp_flags;
50285313Sandrew	int		fp_pad;
51280364Sandrew};
52280364Sandrew
53280364Sandrewstruct __mcontext {
54280364Sandrew	struct gpregs	mc_gpregs;
55280364Sandrew	struct fpregs	mc_fpregs;
56285313Sandrew	int		mc_flags;
57281017Sandrew#define	_MC_FP_VALID	0x1		/* Set when mc_fpregs has valid data */
58285313Sandrew	int		mc_pad;		/* Padding */
59285313Sandrew	__uint64_t	mc_spare[8];	/* Space for expansion, set to zero */
60280364Sandrew};
61280364Sandrew
62280364Sandrewtypedef struct __mcontext mcontext_t;
63280364Sandrew
64280364Sandrew#endif	/* !_MACHINE_UCONTEXT_H_ */
65