1129198Scognet/*	$NetBSD: pcb.h,v 1.10 2003/10/13 21:46:39 scw Exp $	*/
2129198Scognet
3139735Simp/*-
4129198Scognet * Copyright (c) 2001 Matt Thomas <matt@3am-software.com>.
5129198Scognet * Copyright (c) 1994 Mark Brinicombe.
6129198Scognet * All rights reserved.
7129198Scognet *
8129198Scognet * Redistribution and use in source and binary forms, with or without
9129198Scognet * modification, are permitted provided that the following conditions
10129198Scognet * are met:
11129198Scognet * 1. Redistributions of source code must retain the above copyright
12129198Scognet *    notice, this list of conditions and the following disclaimer.
13129198Scognet * 2. Redistributions in binary form must reproduce the above copyright
14129198Scognet *    notice, this list of conditions and the following disclaimer in the
15129198Scognet *    documentation and/or other materials provided with the distribution.
16129198Scognet * 3. All advertising materials mentioning features or use of this software
17129198Scognet *    must display the following acknowledgement:
18129198Scognet *	This product includes software developed by the RiscBSD team.
19129198Scognet * 4. The name "RiscBSD" nor the name of the author may be used to
20129198Scognet *    endorse or promote products derived from this software without specific
21129198Scognet *    prior written permission.
22129198Scognet *
23129198Scognet * THIS SOFTWARE IS PROVIDED BY RISCBSD ``AS IS'' AND ANY EXPRESS OR IMPLIED
24129198Scognet * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25129198Scognet * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26129198Scognet * IN NO EVENT SHALL RISCBSD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27129198Scognet * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28129198Scognet * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29129198Scognet * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30129198Scognet * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31129198Scognet * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32129198Scognet * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33129198Scognet * SUCH DAMAGE.
34129198Scognet *
35129198Scognet * $FreeBSD: stable/11/sys/arm/include/pcb.h 317005 2017-04-16 07:33:47Z mmel $
36129198Scognet */
37129198Scognet
38129198Scognet#ifndef	_MACHINE_PCB_H_
39129198Scognet#define	_MACHINE_PCB_H_
40129198Scognet
41276190Sian#include <machine/frame.h>
42317005Smmel#include <machine/vfp.h>
43129198Scognet
44129198Scognet
45129198Scognet/*
46129198Scognet * WARNING!
47276190Sian * Keep pcb_regs first for faster access in switch.S
48129198Scognet */
49129198Scognetstruct pcb {
50276190Sian	struct switchframe pcb_regs;		/* CPU state */
51129198Scognet	u_int	pcb_flags;
52129198Scognet#define	PCB_OWNFPU	0x00000001
53129198Scognet#define PCB_NOALIGNFLT	0x00000002
54129198Scognet	caddr_t	pcb_onfault;			/* On fault handler */
55290979Szbb	vm_offset_t	pcb_pagedir;		/* TTB0 value */
56290979Szbb	/*
57290979Szbb	 * XXX:
58290979Szbb	 * Variables pcb_pl1vec, pcb_l1vec, pcb_dacr are used solely
59290979Szbb	 * by old PMAP. Keep them here for PCB binary compatibility
60290979Szbb	 * between old and new PMAP.
61290979Szbb	 */
62276190Sian	uint32_t *pcb_pl1vec;			/* PTR to vector_base L1 entry*/
63276190Sian	uint32_t pcb_l1vec;			/* Value to stuff on ctx sw */
64276190Sian	u_int	pcb_dacr;			/* Domain Access Control Reg */
65290979Szbb
66239268Sgonzo	struct vfp_state pcb_vfpstate;          /* VP/NEON state */
67239268Sgonzo	u_int pcb_vfpcpu;                       /* VP/NEON last cpu */
68290648Smmel} __aligned(8); /*
69257231Scognet		 * We need the PCB to be aligned on 8 bytes, as we may
70276190Sian		 * access it using ldrd/strd, and ARM ABI require it
71257231Scognet		 * to by aligned on 8 bytes.
72257231Scognet		 */
73129198Scognet
74129198Scognet/*
75129198Scognet * No additional data for core dumps.
76129198Scognet */
77129198Scognetstruct md_coredump {
78129198Scognet	int	md_empty;
79129198Scognet};
80129198Scognet
81132053Scognetvoid	makectx(struct trapframe *tf, struct pcb *pcb);
82132053Scognet
83129198Scognet#ifdef _KERNEL
84132516Scognet
85234785Sdimvoid    savectx(struct pcb *) __returns_twice;
86129198Scognet#endif	/* _KERNEL */
87129198Scognet
88129198Scognet#endif	/* !_MACHINE_PCB_H_ */
89