Home | History | Annotate | Line # | Download | only in alpha
linux_machdep.h revision 1.5
      1  1.5  mycroft /*	$NetBSD: linux_machdep.h,v 1.5 2000/12/14 18:10:14 mycroft Exp $	*/
      2  1.1      erh 
      3  1.1      erh /*-
      4  1.4  mycroft  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
      5  1.1      erh  * All rights reserved.
      6  1.1      erh  *
      7  1.1      erh  * This code is derived from software contributed to The NetBSD Foundation
      8  1.1      erh  * by Eric Haszlakiewicz.
      9  1.1      erh  *
     10  1.1      erh  * Redistribution and use in source and binary forms, with or without
     11  1.1      erh  * modification, are permitted provided that the following conditions
     12  1.1      erh  * are met:
     13  1.1      erh  * 1. Redistributions of source code must retain the above copyright
     14  1.1      erh  *    notice, this list of conditions and the following disclaimer.
     15  1.1      erh  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1      erh  *    notice, this list of conditions and the following disclaimer in the
     17  1.1      erh  *    documentation and/or other materials provided with the distribution.
     18  1.1      erh  * 3. All advertising materials mentioning features or use of this software
     19  1.1      erh  *    must display the following acknowledgement:
     20  1.1      erh  *	This product includes software developed by the NetBSD
     21  1.1      erh  *	Foundation, Inc. and its contributors.
     22  1.1      erh  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.1      erh  *    contributors may be used to endorse or promote products derived
     24  1.1      erh  *    from this software without specific prior written permission.
     25  1.1      erh  *
     26  1.1      erh  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.1      erh  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.1      erh  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.1      erh  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.1      erh  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.1      erh  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.1      erh  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.1      erh  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.1      erh  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.1      erh  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.1      erh  * POSSIBILITY OF SUCH DAMAGE.
     37  1.1      erh  */
     38  1.1      erh 
     39  1.1      erh #ifndef _ALPHA_LINUX_MACHDEP_H
     40  1.1      erh #define _ALPHA_LINUX_MACHDEP_H
     41  1.1      erh 
     42  1.1      erh /*
     43  1.1      erh  * The Linux sigcontext, pretty much a standard alpha trapframe.
     44  1.1      erh  */
     45  1.1      erh struct linux_sigcontext {
     46  1.1      erh 	long		sc_onstack;
     47  1.1      erh 	long		sc_mask;
     48  1.1      erh 	long		sc_pc;
     49  1.1      erh 	long		sc_ps;
     50  1.1      erh 	long		sc_regs[32];
     51  1.1      erh 	long		sc_ownedfp;
     52  1.1      erh 	long		sc_fpregs[32];
     53  1.1      erh 	unsigned long	sc_fpcr;
     54  1.1      erh 	unsigned long	sc_fp_control;
     55  1.1      erh 	unsigned long	sc_reserved1, sc_reserved2;
     56  1.1      erh 	unsigned long	sc_ssize;
     57  1.1      erh 	char *		sc_sbase;
     58  1.1      erh 	unsigned long	sc_traparg_a0;
     59  1.1      erh 	unsigned long	sc_traparg_a1;
     60  1.1      erh 	unsigned long	sc_traparg_a2;
     61  1.1      erh 	unsigned long	sc_fp_trap_pc;
     62  1.1      erh 	unsigned long	sc_fp_trigger_sum;
     63  1.1      erh 	unsigned long	sc_fp_trigger_inst;
     64  1.1      erh };
     65  1.1      erh 
     66  1.1      erh struct linux_ucontext {
     67  1.1      erh 	u_long			uc_flags;
     68  1.1      erh 	struct linux_ucontext	*uc_link;
     69  1.1      erh 	linux_old_sigset_t	uc_osf_sigmask;
     70  1.1      erh 	linux_stack_t		uc_stack;
     71  1.1      erh 	struct linux_sigcontext	uc_mcontext;
     72  1.1      erh 	linux_sigset_t		uc_sigmask;
     73  1.1      erh };
     74  1.1      erh 
     75  1.1      erh /*
     76  1.1      erh  * We make the stack look like Linux expects it when calling a signal
     77  1.1      erh  * handler, but use the BSD way of calling the handler and sigreturn().
     78  1.1      erh  */
     79  1.1      erh 
     80  1.1      erh #define LINUX_INSN_MOV_R30_R16	0x47fe0410
     81  1.1      erh #define LINUX_INSN_LDI_R0	0x201f0000
     82  1.1      erh #define LINUX_INSN_CALLSYS	0x00000083
     83  1.1      erh 
     84  1.1      erh struct linux_sigframe {
     85  1.1      erh 	struct		linux_sigcontext sf_sc;
     86  1.1      erh 	unsigned long	extramask[LINUX__NSIG_WORDS-1];
     87  1.1      erh 	unsigned int	retcode[3];
     88  1.1      erh };
     89  1.1      erh 
     90  1.1      erh struct linux_rt_sigframe {
     91  1.1      erh 	struct linux_siginfo	info;
     92  1.1      erh 	struct linux_ucontext	uc;
     93  1.1      erh 	unsigned int		retcode[3];
     94  1.1      erh };
     95  1.1      erh 
     96  1.1      erh #ifdef _KERNEL
     97  1.1      erh __BEGIN_DECLS
     98  1.1      erh void setup_linux_rt_sigframe __P((struct trapframe *, int, sigset_t *));
     99  1.1      erh void setup_linux_sigframe __P((struct trapframe *, int, sigset_t *));
    100  1.2      erh int linux_restore_sigcontext __P((struct proc *, struct linux_sigcontext,
    101  1.2      erh 				  sigset_t *));
    102  1.1      erh void linux_sendsig __P((sig_t, int, sigset_t *, u_long));
    103  1.1      erh dev_t linux_fakedev __P((dev_t));
    104  1.5  mycroft void linux_syscall_intern __P((struct proc *));
    105  1.1      erh __END_DECLS
    106  1.1      erh #endif /* !_KERNEL */
    107  1.1      erh 
    108  1.1      erh #endif /* _ALPHA_LINUX_MACHDEP_H */
    109