1129198Scognet/*	$NetBSD: mcontext.h,v 1.4 2003/10/08 22:43:01 thorpej Exp $	*/
2129198Scognet
3129198Scognet/*-
4129198Scognet * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
587575Sobrien * All rights reserved.
687575Sobrien *
7129198Scognet * This code is derived from software contributed to The NetBSD Foundation
8129198Scognet * by Klaus Klein and by Jason R. Thorpe of Wasabi Systems, Inc.
987575Sobrien *
1087575Sobrien * Redistribution and use in source and binary forms, with or without
1187575Sobrien * modification, are permitted provided that the following conditions
1287575Sobrien * are met:
1387575Sobrien * 1. Redistributions of source code must retain the above copyright
1487575Sobrien *    notice, this list of conditions and the following disclaimer.
1587575Sobrien * 2. Redistributions in binary form must reproduce the above copyright
1687575Sobrien *    notice, this list of conditions and the following disclaimer in the
1787575Sobrien *    documentation and/or other materials provided with the distribution.
1887575Sobrien *
19129198Scognet * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20129198Scognet * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21129198Scognet * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22129198Scognet * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23129198Scognet * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24129198Scognet * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25129198Scognet * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26129198Scognet * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27129198Scognet * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28129198Scognet * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29129198Scognet * POSSIBILITY OF SUCH DAMAGE.
3087575Sobrien *
3187575Sobrien * $FreeBSD: stable/11/sys/arm/include/ucontext.h 323423 2017-09-11 03:24:50Z ian $
3287575Sobrien */
3387575Sobrien
34129198Scognet#ifndef _MACHINE_MCONTEXT_H_
35129198Scognet#define _MACHINE_MCONTEXT_H_
36129198Scognet/*
37129198Scognet * General register state
38129198Scognet */
39129198Scognet#define _NGREG		17
40129198Scognettypedef unsigned int	__greg_t;
41129198Scognettypedef __greg_t	__gregset_t[_NGREG];
4287575Sobrien
43129198Scognet#define _REG_R0		0
44129198Scognet#define _REG_R1		1
45129198Scognet#define _REG_R2		2
46129198Scognet#define _REG_R3		3
47129198Scognet#define _REG_R4		4
48129198Scognet#define _REG_R5		5
49129198Scognet#define _REG_R6		6
50129198Scognet#define _REG_R7		7
51129198Scognet#define _REG_R8		8
52129198Scognet#define _REG_R9		9
53129198Scognet#define _REG_R10	10
54129198Scognet#define _REG_R11	11
55129198Scognet#define _REG_R12	12
56129198Scognet#define _REG_R13	13
57129198Scognet#define _REG_R14	14
58129198Scognet#define _REG_R15	15
59129198Scognet#define _REG_CPSR	16
60129198Scognet/* Convenience synonyms */
61129198Scognet#define _REG_FP		_REG_R11
62129198Scognet#define _REG_SP		_REG_R13
63129198Scognet#define _REG_LR		_REG_R14
64129198Scognet#define _REG_PC		_REG_R15
6587575Sobrien
66129198Scognet/*
67129198Scognet * Floating point register state
68129198Scognet */
69129198Scognettypedef struct {
70317005Smmel	__uint64_t	mcv_reg[32];
71317005Smmel	__uint32_t	mcv_fpscr;
72317005Smmel} mcontext_vfp_t;
73129198Scognet
74129198Scognettypedef struct {
75317005Smmel	__gregset_t	__gregs;
76129198Scognet
77317005Smmel	/*
78317005Smmel	 * Originally, rest of this structure was named __fpu, 35 * 4 bytes
79317005Smmel	 * long, never accessed from kernel.
80317005Smmel	 */
81323423Sian	__size_t	mc_vfp_size;
82317005Smmel	void 		*mc_vfp_ptr;
83317005Smmel	unsigned int	mc_spare[33];
8487575Sobrien} mcontext_t;
8587575Sobrien
86317005Smmel#define UC_
87129198Scognet#endif	/* !_MACHINE_MCONTEXT_H_ */
88