/* $NetBSD: pcb.h,v 1.10 2003/10/13 21:46:39 scw Exp $ */12/*-3* SPDX-License-Identifier: BSD-4-Clause4*5* Copyright (c) 2001 Matt Thomas <[email protected]>.6* Copyright (c) 1994 Mark Brinicombe.7* All rights reserved.8*9* Redistribution and use in source and binary forms, with or without10* modification, are permitted provided that the following conditions11* are met:12* 1. Redistributions of source code must retain the above copyright13* notice, this list of conditions and the following disclaimer.14* 2. Redistributions in binary form must reproduce the above copyright15* notice, this list of conditions and the following disclaimer in the16* documentation and/or other materials provided with the distribution.17* 3. All advertising materials mentioning features or use of this software18* must display the following acknowledgement:19* This product includes software developed by the RiscBSD team.20* 4. The name "RiscBSD" nor the name of the author may be used to21* endorse or promote products derived from this software without specific22* prior written permission.23*24* THIS SOFTWARE IS PROVIDED BY RISCBSD ``AS IS'' AND ANY EXPRESS OR IMPLIED25* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF26* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.27* IN NO EVENT SHALL RISCBSD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,28* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES29* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR30* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)31* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT32* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY33* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF34* SUCH DAMAGE.35*/3637#ifndef _MACHINE_PCB_H_38#define _MACHINE_PCB_H_3940#include <machine/frame.h>41#include <machine/vfp.h>4243/*44* struct pcb is known to and used by kernel debuggers. Its layout must be kept45* stable. When adding extra fields that are accessed by kernel debuggers,46* debuggers should be backward compatible by using osreldate.47*48* WARNING!49* Keep pcb_regs first for faster access in switch.S50*/51struct pcb {52struct switchframe pcb_regs; /* CPU state */53u_int pcb_flags;54#define PCB_OWNFPU 0x0000000155#define PCB_NOALIGNFLT 0x0000000256caddr_t pcb_onfault; /* On fault handler */57vm_offset_t pcb_pagedir; /* TTB0 value */58/*59* XXX:60* Variables pcb_pl1vec, pcb_l1vec, pcb_dacr are used solely61* by old PMAP. Keep them here for PCB binary compatibility62* between old and new PMAP.63*/64uint32_t *pcb_pl1vec; /* PTR to vector_base L1 entry*/65uint32_t pcb_l1vec; /* Value to stuff on ctx sw */66u_int pcb_dacr; /* Domain Access Control Reg */6768struct vfp_state pcb_vfpstate; /* VP/NEON state */69u_int pcb_vfpcpu; /* VP/NEON last cpu */70#define PCB_FP_STARTED 0x0171#define PCB_FP_KERN 0x0272#define PCB_FP_NOSAVE 0x0473struct vfp_state *pcb_vfpsaved; /* VP/NEON state */74int pcb_fpflags;75} __aligned(8); /*76* We need the PCB to be aligned on 8 bytes, as we may77* access it using ldrd/strd, and ARM ABI require it78* to by aligned on 8 bytes.79*/8081/*82* No additional data for core dumps.83*/84struct md_coredump {85int md_empty;86};8788void makectx(struct trapframe *tf, struct pcb *pcb);8990#ifdef _KERNEL9192void savectx(struct pcb *) __returns_twice;93#endif /* _KERNEL */9495#endif /* !_MACHINE_PCB_H_ */969798