pcb.h revision 132516
1119815Smarcel/*	$NetBSD: pcb.h,v 1.10 2003/10/13 21:46:39 scw Exp $	*/
2119815Smarcel
3119815Smarcel/*
4119815Smarcel * Copyright (c) 2001 Matt Thomas <matt@3am-software.com>.
5119815Smarcel * Copyright (c) 1994 Mark Brinicombe.
6119815Smarcel * All rights reserved.
7119815Smarcel *
8119815Smarcel * Redistribution and use in source and binary forms, with or without
9119815Smarcel * modification, are permitted provided that the following conditions
10119815Smarcel * are met:
11119815Smarcel * 1. Redistributions of source code must retain the above copyright
12119815Smarcel *    notice, this list of conditions and the following disclaimer.
13119815Smarcel * 2. Redistributions in binary form must reproduce the above copyright
14119815Smarcel *    notice, this list of conditions and the following disclaimer in the
15119815Smarcel *    documentation and/or other materials provided with the distribution.
16119815Smarcel * 3. All advertising materials mentioning features or use of this software
17119815Smarcel *    must display the following acknowledgement:
18119815Smarcel *	This product includes software developed by the RiscBSD team.
19119815Smarcel * 4. The name "RiscBSD" nor the name of the author may be used to
20119815Smarcel *    endorse or promote products derived from this software without specific
21119815Smarcel *    prior written permission.
22119815Smarcel *
23119815Smarcel * THIS SOFTWARE IS PROVIDED BY RISCBSD ``AS IS'' AND ANY EXPRESS OR IMPLIED
24119815Smarcel * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25119815Smarcel * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26119815Smarcel * IN NO EVENT SHALL RISCBSD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27119815Smarcel * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28119815Smarcel * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29119815Smarcel * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30119815Smarcel * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31119815Smarcel * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32119815Smarcel * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33119815Smarcel * SUCH DAMAGE.
34119815Smarcel *
35119815Smarcel * $FreeBSD: head/sys/arm/include/pcb.h 132516 2004-07-21 22:04:32Z cognet $
36119815Smarcel */
37119815Smarcel
38119815Smarcel#ifndef	_MACHINE_PCB_H_
39119815Smarcel#define	_MACHINE_PCB_H_
40119815Smarcel
41119815Smarcel#include <machine/frame.h>
42119815Smarcel#include <machine/fp.h>
43119815Smarcel
44119815Smarcel
45119815Smarcelstruct trapframe;
46119815Smarcel
47119815Smarcelstruct pcb_arm32 {
48119815Smarcel	vm_offset_t	pcb32_pagedir;		/* PT hooks */
49119815Smarcel	uint32_t *pcb32_pl1vec;		/* PTR to vector_base L1 entry*/
50119815Smarcel	uint32_t pcb32_l1vec;			/* Value to stuff on ctx sw */
51119815Smarcel	u_int	pcb32_dacr;			/* Domain Access Control Reg */
52119815Smarcel	void	*pcb32_cstate;			/* &pmap->pm_cstate */
53119815Smarcel	/*
54119815Smarcel	 * WARNING!
55119815Smarcel	 * cpuswitch.S relies on pcb32_r8 being quad-aligned in struct pcb
56119815Smarcel	 * (due to the use of "strd" when compiled for XSCALE)
57119815Smarcel	 */
58119815Smarcel	u_int	pcb32_r8;			/* used */
59119815Smarcel	u_int	pcb32_r9;			/* used */
60119815Smarcel	u_int	pcb32_r10;			/* used */
61119815Smarcel	u_int	pcb32_r11;			/* used */
62119815Smarcel	u_int	pcb32_r12;			/* used */
63119815Smarcel	u_int	pcb32_sp;			/* used */
64119815Smarcel	u_int	pcb32_lr;
65119815Smarcel	u_int	pcb32_pc;
66119815Smarcel	u_int	pcb32_und_sp;
67119815Smarcel};
68119815Smarcel#define	pcb_pagedir	un_32.pcb32_pagedir
69119815Smarcel#define	pcb_pl1vec	un_32.pcb32_pl1vec
70119815Smarcel#define	pcb_l1vec	un_32.pcb32_l1vec
71119815Smarcel#define	pcb_dacr	un_32.pcb32_dacr
72119815Smarcel#define	pcb_cstate	un_32.pcb32_cstate
73119815Smarcel
74120452Smarcel/*
75119815Smarcel * WARNING!
76119815Smarcel * See warning for struct pcb_arm32, above, before changing struct pcb!
77119815Smarcel */
78120452Smarcelstruct pcb {
79119815Smarcel	u_int	pcb_flags;
80119815Smarcel#define	PCB_OWNFPU	0x00000001
81119815Smarcel#define PCB_NOALIGNFLT	0x00000002
82119815Smarcel	caddr_t	pcb_onfault;			/* On fault handler */
83119815Smarcel	struct	pcb_arm32 un_32;
84119815Smarcel	struct	fpe_sp_state pcb_fpstate;	/* Floating Point state */
85119815Smarcel};
86
87/*
88 * No additional data for core dumps.
89 */
90struct md_coredump {
91	int	md_empty;
92};
93
94void	makectx(struct trapframe *tf, struct pcb *pcb);
95
96#ifdef _KERNEL
97
98void    savectx(struct pcb *);
99#endif	/* _KERNEL */
100
101#endif	/* !_MACHINE_PCB_H_ */
102