xref: /netbsd-src/sys/compat/linux/arch/arm/linux_machdep.h (revision ce099b40997c43048fb78bd578195f81d2456523)
1*ce099b40Smartin /*	$NetBSD: linux_machdep.h,v 1.6 2008/04/28 20:23:42 martin Exp $	*/
264625064Sbjh21 
364625064Sbjh21 /*-
464625064Sbjh21  * Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
564625064Sbjh21  * All rights reserved.
664625064Sbjh21  *
764625064Sbjh21  * This code is derived from software contributed to The NetBSD Foundation
864625064Sbjh21  * by Frank van der Linden.
964625064Sbjh21  *
1064625064Sbjh21  * Redistribution and use in source and binary forms, with or without
1164625064Sbjh21  * modification, are permitted provided that the following conditions
1264625064Sbjh21  * are met:
1364625064Sbjh21  * 1. Redistributions of source code must retain the above copyright
1464625064Sbjh21  *    notice, this list of conditions and the following disclaimer.
1564625064Sbjh21  * 2. Redistributions in binary form must reproduce the above copyright
1664625064Sbjh21  *    notice, this list of conditions and the following disclaimer in the
1764625064Sbjh21  *    documentation and/or other materials provided with the distribution.
1864625064Sbjh21  *
1964625064Sbjh21  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2064625064Sbjh21  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2164625064Sbjh21  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2264625064Sbjh21  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2364625064Sbjh21  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2464625064Sbjh21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2564625064Sbjh21  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2664625064Sbjh21  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2764625064Sbjh21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2864625064Sbjh21  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2964625064Sbjh21  * POSSIBILITY OF SUCH DAMAGE.
3064625064Sbjh21  */
3164625064Sbjh21 
3264625064Sbjh21 #ifndef _ARM_LINUX_MACHDEP_H_
3364625064Sbjh21 #define _ARM_LINUX_MACHDEP_H_
3464625064Sbjh21 
3528debea3Schristos #include <compat/linux/common/linux_signal.h>
3628debea3Schristos 
3764625064Sbjh21 struct linux_sigcontext {
3864625064Sbjh21 	u_int32_t	sc_trapno;
3964625064Sbjh21 	u_int32_t	sc_error_code;
406ad60873Sbjh21 	linux_old_sigset_t	sc_mask;
4164625064Sbjh21 	u_int32_t	sc_r0;
4264625064Sbjh21 	u_int32_t	sc_r1;
4364625064Sbjh21 	u_int32_t	sc_r2;
4464625064Sbjh21 	u_int32_t	sc_r3;
4564625064Sbjh21 	u_int32_t	sc_r4;
4664625064Sbjh21 	u_int32_t	sc_r5;
4764625064Sbjh21 	u_int32_t	sc_r6;
4864625064Sbjh21 	u_int32_t	sc_r7;
4964625064Sbjh21 	u_int32_t	sc_r8;
5064625064Sbjh21 	u_int32_t	sc_r9;
5164625064Sbjh21 	u_int32_t	sc_r10;
5264625064Sbjh21 	u_int32_t	sc_r11;
5364625064Sbjh21 	u_int32_t	sc_r12;
5464625064Sbjh21 	u_int32_t	sc_sp;
5564625064Sbjh21 	u_int32_t	sc_lr;
5664625064Sbjh21 	u_int32_t	sc_pc;
5764625064Sbjh21 	u_int32_t	sc_cpsr;
5864625064Sbjh21 	u_int32_t	sc_fault_address;
5964625064Sbjh21 };
6064625064Sbjh21 
6164625064Sbjh21 /*
6264625064Sbjh21  * We make the stack look like Linux expects it when calling a signal
6364625064Sbjh21  * handler, but use the BSD way of calling the handler and sigreturn().
6464625064Sbjh21  * This means that we need to pass the pointer to the handler too.
6564625064Sbjh21  * It is appended to the frame to not interfere with the rest of it.
6664625064Sbjh21  */
6764625064Sbjh21 
6864625064Sbjh21 struct linux_sigframe {
6964625064Sbjh21 	struct	linux_sigcontext sf_sc;
706ad60873Sbjh21 	unsigned long	sf_extramask[LINUX__NSIG_WORDS - 1];
7164625064Sbjh21 };
7264625064Sbjh21 
73f2af9174Sdsl void linux_syscall_intern(struct proc *);
745afa6838Sthorpej 
7564625064Sbjh21 #endif
76