/* $NetBSD: frame.h,v 1.5 2002/10/19 00:10:54 bjh21 Exp $ */12/*-3* SPDX-License-Identifier: BSD-4-Clause4*5* Copyright (c) 1994-1997 Mark Brinicombe.6* Copyright (c) 1994 Brini.7* All rights reserved.8*9* This code is derived from software written for Brini by Mark Brinicombe10*11* Redistribution and use in source and binary forms, with or without12* modification, are permitted provided that the following conditions13* are met:14* 1. Redistributions of source code must retain the above copyright15* notice, this list of conditions and the following disclaimer.16* 2. Redistributions in binary form must reproduce the above copyright17* notice, this list of conditions and the following disclaimer in the18* documentation and/or other materials provided with the distribution.19* 3. All advertising materials mentioning features or use of this software20* must display the following acknowledgement:21* This product includes software developed by Brini.22* 4. The name of the company nor the name of the author may be used to23* endorse or promote products derived from this software without specific24* prior written permission.25*26* THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED27* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF28* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.29* IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,30* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES31* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR32* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)33* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT34* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY35* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF36* SUCH DAMAGE.37*38* RiscBSD kernel project39*40* frame.h41*42* Stack frames structures43*44* Created : 30/09/9445*46*/4748#ifndef _MACHINE_FRAME_H_49#define _MACHINE_FRAME_H_5051#ifndef _LOCORE5253#include <sys/signal.h>54#include <sys/ucontext.h>5556/*57* Trap frame. Pushed onto the kernel stack on a trap (synchronous exception).58*/5960struct trapframe {61register_t tf_spsr;62register_t tf_r0;63register_t tf_r1;64register_t tf_r2;65register_t tf_r3;66register_t tf_r4;67register_t tf_r5;68register_t tf_r6;69register_t tf_r7;70register_t tf_r8;71register_t tf_r9;72register_t tf_r10;73register_t tf_r11;74register_t tf_r12;75register_t tf_usr_sp;76register_t tf_usr_lr;77register_t tf_svc_sp;78register_t tf_svc_lr;79register_t tf_pc;80register_t tf_pad;81};8283/* Register numbers */84#define tf_r13 tf_usr_sp85#define tf_r14 tf_usr_lr86#define tf_r15 tf_pc8788/*89* Signal frame. Pushed onto user stack before calling sigcode.90* The pointers are used in the trampoline code to locate the ucontext.91*/92struct sigframe {93siginfo_t sf_si; /* actual saved siginfo */94ucontext_t sf_uc; /* actual saved ucontext */95mcontext_vfp_t sf_vfp; /* actual saved VFP context */96};9798/*99* Switch frame.100*101* It is important this is a multiple of 8 bytes so the stack is correctly102* aligned when we create new threads.103*/104struct switchframe105{106register_t sf_r4;107register_t sf_r5;108register_t sf_r6;109register_t sf_r7;110register_t sf_r8;111register_t sf_r9;112register_t sf_r10;113register_t sf_r11;114register_t sf_r12;115register_t sf_sp;116register_t sf_lr;117register_t sf_pc;118register_t sf_tpidrurw;119register_t sf_spare0;120};121122/*123* Stack frame. Used during stack traces (db_trace.c)124*/125struct frame {126u_int fr_fp;127u_int fr_sp;128u_int fr_lr;129u_int fr_pc;130};131132#endif /* !_LOCORE */133134#endif /* _MACHINE_FRAME_H_ */135136137