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: releng/11.0/sys/arm/include/ucontext.h 266570 2014-05-23 00:21:02Z imp $ 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 */ 69129198Scognet/* Note: the storage layout of this structure must be identical to ARMFPE! */ 70129198Scognettypedef struct { 71129198Scognet unsigned int __fp_fpsr; 72129198Scognet struct { 73129198Scognet unsigned int __fp_exponent; 74129198Scognet unsigned int __fp_mantissa_hi; 75129198Scognet unsigned int __fp_mantissa_lo; 76129198Scognet } __fp_fr[8]; 77129198Scognet} __fpregset_t; 78129198Scognet 79129198Scognettypedef struct { 80129198Scognet unsigned int __vfp_fpscr; 81129198Scognet unsigned int __vfp_fstmx[33]; 82129198Scognet unsigned int __vfp_fpsid; 83129198Scognet} __vfpregset_t; 84129198Scognet 85129198Scognettypedef struct { 86129198Scognet __gregset_t __gregs; 87129198Scognet union { 88129198Scognet __fpregset_t __fpregs; 89129198Scognet __vfpregset_t __vfpregs; 90129198Scognet } __fpu; 9187575Sobrien} mcontext_t; 9287575Sobrien 93129198Scognet/* Machine-dependent uc_flags */ 94129198Scognet#define _UC_ARM_VFP 0x00010000 /* FPU field is VFP */ 95129198Scognet 96129198Scognet/* used by signal delivery to indicate status of signal stack */ 97129198Scognet#define _UC_SETSTACK 0x00020000 98129198Scognet#define _UC_CLRSTACK 0x00040000 99129198Scognet 100129198Scognet#endif /* !_MACHINE_MCONTEXT_H_ */ 101