xref: /netbsd-src/sys/arch/sh3/include/proc.h (revision db1a0ab8b6149975a743c190e2be6265a94c47e9)
1*db1a0ab8Sjdolecek /*	$NetBSD: proc.h,v 1.18 2019/01/08 20:08:28 jdolecek Exp $	*/
2aad01611Sagc 
3aad01611Sagc /*
4f0d2889eSwiz  * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
5aad01611Sagc  * Copyright (c) 1991 Regents of the University of California.
6aad01611Sagc  * All rights reserved.
7aad01611Sagc  *
8aad01611Sagc  * Redistribution and use in source and binary forms, with or without
9aad01611Sagc  * modification, are permitted provided that the following conditions
10aad01611Sagc  * are met:
11aad01611Sagc  * 1. Redistributions of source code must retain the above copyright
12aad01611Sagc  *    notice, this list of conditions and the following disclaimer.
13aad01611Sagc  * 2. Redistributions in binary form must reproduce the above copyright
14aad01611Sagc  *    notice, this list of conditions and the following disclaimer in the
15aad01611Sagc  *    documentation and/or other materials provided with the distribution.
16aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
17aad01611Sagc  *    may be used to endorse or promote products derived from this software
18aad01611Sagc  *    without specific prior written permission.
19aad01611Sagc  *
20aad01611Sagc  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21aad01611Sagc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22aad01611Sagc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23aad01611Sagc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24aad01611Sagc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25aad01611Sagc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26aad01611Sagc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27aad01611Sagc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28aad01611Sagc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29aad01611Sagc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30aad01611Sagc  * SUCH DAMAGE.
31aad01611Sagc  *
32aad01611Sagc  *	@(#)proc.h	7.1 (Berkeley) 5/15/91
33aad01611Sagc  */
3465363da2Sitojun 
354c6260b9Such #ifndef _SH3_PROC_H_
364c6260b9Such #define	_SH3_PROC_H_
3749784e4bSthorpej 
3865363da2Sitojun /*
3965363da2Sitojun  * Machine-dependent part of the proc structure for sh3.
4065363da2Sitojun  */
414c6260b9Such 
424c6260b9Such /* Kernel stack PTE */
434c6260b9Such struct md_upte {
44496eb1f3Suwe 	uint32_t addr;
45496eb1f3Suwe 	uint32_t data;
464c6260b9Such };
474c6260b9Such 
4849784e4bSthorpej struct mdlwp {
494c6260b9Such 	struct trapframe *md_regs;	/* user context */
505cf2727aSuch 	struct pcb *md_pcb;		/* pcb access address */
5165363da2Sitojun 	int md_flags;			/* machine-dependent flags */
52b07ec3fcSad 	volatile int md_astpending;	/* AST pending on return to userland */
534c6260b9Such 	/* u-area PTE: *2 .. SH4 data/address data array access */
544c6260b9Such 	struct md_upte md_upte[UPAGES * 2];
5565363da2Sitojun };
5665363da2Sitojun 
5765363da2Sitojun /* md_flags */
58d2228640Sdsl #define	MDL_USEDFPU	0x0001	/* has used the FPU */
59d2228640Sdsl #define	MDL_SSTEP	0x0002	/* single-stepped with PT_STEP */
60672baca1Such 
618bcd5596She struct lwp;
628bcd5596She 
6349784e4bSthorpej struct mdproc {
6451d0cd96Suwe 	void (*md_syscall)(struct lwp *, struct trapframe *);
6549784e4bSthorpej };
6649784e4bSthorpej 
67672baca1Such #ifdef _KERNEL
684c6260b9Such #ifndef _LOCORE
69496eb1f3Suwe extern void sh_proc0_init(void);
704c6260b9Such #endif /* _LOCORE */
714c6260b9Such #endif /* _KERNEL */
724c6260b9Such #endif /* !_SH3_PROC_H_ */
73