xref: /openbsd-src/sys/arch/sh/include/proc.h (revision f5d56f6d1abf3988ecad6e5bcc0d9e60de25e475)
1*f5d56f6dSguenther /*	$OpenBSD: proc.h,v 1.4 2017/04/13 03:52:25 guenther Exp $	*/
295c7671fSmiod /*	$NetBSD: proc.h,v 1.10 2005/12/11 12:18:58 christos Exp $	*/
395c7671fSmiod 
495c7671fSmiod /*
595c7671fSmiod  * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
695c7671fSmiod  * Copyright (c) 1991 Regents of the University of California.
795c7671fSmiod  * All rights reserved.
895c7671fSmiod  *
995c7671fSmiod  * Redistribution and use in source and binary forms, with or without
1095c7671fSmiod  * modification, are permitted provided that the following conditions
1195c7671fSmiod  * are met:
1295c7671fSmiod  * 1. Redistributions of source code must retain the above copyright
1395c7671fSmiod  *    notice, this list of conditions and the following disclaimer.
1495c7671fSmiod  * 2. Redistributions in binary form must reproduce the above copyright
1595c7671fSmiod  *    notice, this list of conditions and the following disclaimer in the
1695c7671fSmiod  *    documentation and/or other materials provided with the distribution.
1795c7671fSmiod  * 3. Neither the name of the University nor the names of its contributors
1895c7671fSmiod  *    may be used to endorse or promote products derived from this software
1995c7671fSmiod  *    without specific prior written permission.
2095c7671fSmiod  *
2195c7671fSmiod  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2295c7671fSmiod  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2395c7671fSmiod  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2495c7671fSmiod  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2595c7671fSmiod  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2695c7671fSmiod  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2795c7671fSmiod  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2895c7671fSmiod  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2995c7671fSmiod  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3095c7671fSmiod  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3195c7671fSmiod  * SUCH DAMAGE.
3295c7671fSmiod  *
3395c7671fSmiod  *	@(#)proc.h	7.1 (Berkeley) 5/15/91
3495c7671fSmiod  */
3595c7671fSmiod 
3695c7671fSmiod #ifndef _SH_PROC_H_
3795c7671fSmiod #define	_SH_PROC_H_
3895c7671fSmiod 
3995c7671fSmiod /*
4095c7671fSmiod  * Machine-dependent part of the proc structure for sh.
4195c7671fSmiod  */
4295c7671fSmiod 
4395c7671fSmiod #include <machine/param.h>
4495c7671fSmiod 
4595c7671fSmiod /* Kernel stack PTE */
4695c7671fSmiod struct md_upte {
4795c7671fSmiod 	uint32_t addr;
4895c7671fSmiod 	uint32_t data;
4995c7671fSmiod };
5095c7671fSmiod 
5195c7671fSmiod struct mdproc {
5295c7671fSmiod 	struct trapframe *md_regs;	/* user context */
5395c7671fSmiod 	struct pcb *md_pcb;		/* pcb access address */
5495c7671fSmiod 	volatile int md_astpending;	/* AST pending on return to userland */
5595c7671fSmiod 	int md_flags;			/* machine-dependent flags */
5695c7671fSmiod 	/* u-area PTE: *2 .. SH4 data/address data array access */
5795c7671fSmiod 	struct md_upte md_upte[UPAGES * 2];
5895c7671fSmiod };
5995c7671fSmiod 
6095c7671fSmiod /* md_flags */
6195c7671fSmiod #define	MDP_USEDFPU	0x0001	/* has used the FPU */
6290eb4bc5Skettenis #define	MDP_STEP	0x0002	/* single step */
6395c7671fSmiod 
6495c7671fSmiod #ifdef _KERNEL
6595c7671fSmiod #ifndef _LOCORE
6695c7671fSmiod extern void sh_proc0_init(void);
6795c7671fSmiod extern struct md_upte *curupte;	/* SH3 wired u-area hack */
6895c7671fSmiod #endif /* _LOCORE */
6995c7671fSmiod #endif /* _KERNEL */
7095c7671fSmiod #endif /* !_SH_PROC_H_ */
71