/* $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* WARNING!45* Keep pcb_regs first for faster access in switch.S46*/47struct pcb {48struct switchframe pcb_regs; /* CPU state */49u_int pcb_flags;50#define PCB_OWNFPU 0x0000000151#define PCB_NOALIGNFLT 0x0000000252caddr_t pcb_onfault; /* On fault handler */53vm_offset_t pcb_pagedir; /* TTB0 value */54/*55* XXX:56* Variables pcb_pl1vec, pcb_l1vec, pcb_dacr are used solely57* by old PMAP. Keep them here for PCB binary compatibility58* between old and new PMAP.59*/60uint32_t *pcb_pl1vec; /* PTR to vector_base L1 entry*/61uint32_t pcb_l1vec; /* Value to stuff on ctx sw */62u_int pcb_dacr; /* Domain Access Control Reg */6364struct vfp_state pcb_vfpstate; /* VP/NEON state */65u_int pcb_vfpcpu; /* VP/NEON last cpu */66#define PCB_FP_STARTED 0x0167#define PCB_FP_KERN 0x0268#define PCB_FP_NOSAVE 0x0469struct vfp_state *pcb_vfpsaved; /* VP/NEON state */70int pcb_fpflags;71} __aligned(8); /*72* We need the PCB to be aligned on 8 bytes, as we may73* access it using ldrd/strd, and ARM ABI require it74* to by aligned on 8 bytes.75*/7677/*78* No additional data for core dumps.79*/80struct md_coredump {81int md_empty;82};8384void makectx(struct trapframe *tf, struct pcb *pcb);8586#ifdef _KERNEL8788void savectx(struct pcb *) __returns_twice;89#endif /* _KERNEL */9091#endif /* !_MACHINE_PCB_H_ */929394