xref: /freebsd/sys/arm64/include/frame.h (revision d060b420e0f6d8f6535dfcda6f580dad3f5613d3)
1147b9d04SAndrew Turner /*-
2147b9d04SAndrew Turner  * Copyright (c) 2014 Andrew Turner
3147b9d04SAndrew Turner  * Copyright (c) 2014 The FreeBSD Foundation
4147b9d04SAndrew Turner  * All rights reserved.
5147b9d04SAndrew Turner  *
6147b9d04SAndrew Turner  * This software was developed by Andrew Turner under
7147b9d04SAndrew Turner  * sponsorship from the FreeBSD Foundation.
8147b9d04SAndrew Turner  *
9147b9d04SAndrew Turner  * Redistribution and use in source and binary forms, with or without
10147b9d04SAndrew Turner  * modification, are permitted provided that the following conditions
11147b9d04SAndrew Turner  * are met:
12147b9d04SAndrew Turner  * 1. Redistributions of source code must retain the above copyright
13147b9d04SAndrew Turner  *    notice, this list of conditions and the following disclaimer.
14147b9d04SAndrew Turner  * 2. Redistributions in binary form must reproduce the above copyright
15147b9d04SAndrew Turner  *    notice, this list of conditions and the following disclaimer in the
16147b9d04SAndrew Turner  *    documentation and/or other materials provided with the distribution.
17147b9d04SAndrew Turner  *
18147b9d04SAndrew Turner  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19147b9d04SAndrew Turner  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20147b9d04SAndrew Turner  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21147b9d04SAndrew Turner  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22147b9d04SAndrew Turner  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23147b9d04SAndrew Turner  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24147b9d04SAndrew Turner  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25147b9d04SAndrew Turner  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26147b9d04SAndrew Turner  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27147b9d04SAndrew Turner  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28147b9d04SAndrew Turner  * SUCH DAMAGE.
29147b9d04SAndrew Turner  */
30147b9d04SAndrew Turner 
31d5d97bedSMike Karels #ifdef __arm__
32d5d97bedSMike Karels #include <arm/frame.h>
33d5d97bedSMike Karels #else /* !__arm__ */
34d5d97bedSMike Karels 
35147b9d04SAndrew Turner #ifndef _MACHINE_FRAME_H_
36147b9d04SAndrew Turner #define	_MACHINE_FRAME_H_
37147b9d04SAndrew Turner 
38147b9d04SAndrew Turner #ifndef LOCORE
39147b9d04SAndrew Turner 
40147b9d04SAndrew Turner #include <sys/signal.h>
41147b9d04SAndrew Turner #include <sys/ucontext.h>
42147b9d04SAndrew Turner 
43147b9d04SAndrew Turner /*
44147b9d04SAndrew Turner  * NOTE: keep this structure in sync with struct reg and struct mcontext.
45147b9d04SAndrew Turner  */
46147b9d04SAndrew Turner struct trapframe {
47147b9d04SAndrew Turner 	uint64_t tf_sp;
48147b9d04SAndrew Turner 	uint64_t tf_lr;
49147b9d04SAndrew Turner 	uint64_t tf_elr;
502ecbbcc7SZachary Leaf 	uint64_t tf_spsr;
512ecbbcc7SZachary Leaf 	uint64_t tf_esr;
52f4036a92SZachary Leaf 	uint64_t tf_far;
53147b9d04SAndrew Turner 	uint64_t tf_x[30];
54147b9d04SAndrew Turner };
55147b9d04SAndrew Turner 
56147b9d04SAndrew Turner /*
579c871ab5SAndrew Turner  * Signal frame, pushed onto the user stack.
58147b9d04SAndrew Turner  */
59147b9d04SAndrew Turner struct sigframe {
60147b9d04SAndrew Turner 	siginfo_t       sf_si;          /* actual saved siginfo */
61147b9d04SAndrew Turner 	ucontext_t      sf_uc;          /* actual saved ucontext */
62147b9d04SAndrew Turner };
63147b9d04SAndrew Turner 
64147b9d04SAndrew Turner /*
659c871ab5SAndrew Turner  * There is no fixed frame layout, other than to be 16-byte aligned.
66147b9d04SAndrew Turner  */
67147b9d04SAndrew Turner struct frame {
68147b9d04SAndrew Turner 	int dummy;
69147b9d04SAndrew Turner };
70147b9d04SAndrew Turner 
718c9c3144SOlivier Houchard #ifdef COMPAT_FREEBSD32
728c9c3144SOlivier Houchard struct sigframe32 {
73*d060b420SBrooks Davis 	struct __siginfo32		sf_si;
748c9c3144SOlivier Houchard 	ucontext32_t			sf_uc;
758c9c3144SOlivier Houchard 	mcontext32_vfp_t		sf_vfp;
768c9c3144SOlivier Houchard };
778c9c3144SOlivier Houchard #endif /* COMPAT_FREEBSD32 */
788c9c3144SOlivier Houchard 
79147b9d04SAndrew Turner #endif /* !LOCORE */
80147b9d04SAndrew Turner 
81147b9d04SAndrew Turner #endif /* !_MACHINE_FRAME_H_ */
82d5d97bedSMike Karels 
83d5d97bedSMike Karels #endif /* !__arm__ */
84