Home | History | Annotate | Line # | Download | only in i386
linux_machdep.h revision 1.10.2.3
      1  1.10.2.2    bouyer /*	$NetBSD: linux_machdep.h,v 1.10.2.3 2000/12/13 15:49:46 bouyer Exp $	*/
      2       1.1      fvdl 
      3       1.9      fvdl /*-
      4  1.10.2.3    bouyer  * Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
      5       1.1      fvdl  * All rights reserved.
      6       1.1      fvdl  *
      7       1.9      fvdl  * This code is derived from software contributed to The NetBSD Foundation
      8       1.9      fvdl  * by Frank van der Linden.
      9       1.9      fvdl  *
     10       1.1      fvdl  * Redistribution and use in source and binary forms, with or without
     11       1.1      fvdl  * modification, are permitted provided that the following conditions
     12       1.1      fvdl  * are met:
     13       1.1      fvdl  * 1. Redistributions of source code must retain the above copyright
     14       1.1      fvdl  *    notice, this list of conditions and the following disclaimer.
     15       1.1      fvdl  * 2. Redistributions in binary form must reproduce the above copyright
     16       1.1      fvdl  *    notice, this list of conditions and the following disclaimer in the
     17       1.1      fvdl  *    documentation and/or other materials provided with the distribution.
     18       1.1      fvdl  * 3. All advertising materials mentioning features or use of this software
     19       1.1      fvdl  *    must display the following acknowledgement:
     20       1.9      fvdl  *	This product includes software developed by the NetBSD
     21       1.9      fvdl  *	Foundation, Inc. and its contributors.
     22       1.9      fvdl  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23       1.9      fvdl  *    contributors may be used to endorse or promote products derived
     24       1.9      fvdl  *    from this software without specific prior written permission.
     25       1.1      fvdl  *
     26       1.9      fvdl  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27       1.9      fvdl  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28       1.9      fvdl  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29       1.9      fvdl  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30       1.9      fvdl  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31       1.9      fvdl  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32       1.9      fvdl  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33       1.9      fvdl  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34       1.9      fvdl  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35       1.9      fvdl  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36       1.9      fvdl  * POSSIBILITY OF SUCH DAMAGE.
     37       1.1      fvdl  */
     38       1.1      fvdl 
     39       1.8       erh #ifndef _I386_LINUX_MACHDEP_H
     40       1.8       erh #define _I386_LINUX_MACHDEP_H
     41       1.1      fvdl 
     42       1.1      fvdl /*
     43       1.1      fvdl  * The Linux sigcontext, pretty much a standard 386 trapframe.
     44       1.1      fvdl  */
     45       1.1      fvdl 
     46       1.1      fvdl struct linux_sigcontext {
     47       1.3   mycroft 	int	sc_gs;
     48       1.3   mycroft 	int	sc_fs;
     49       1.7   mycroft 	int	sc_es;
     50       1.7   mycroft 	int	sc_ds;
     51       1.7   mycroft 	int	sc_edi;
     52       1.7   mycroft 	int	sc_esi;
     53       1.7   mycroft 	int	sc_ebp;
     54       1.3   mycroft 	int	sc_esp;
     55       1.7   mycroft 	int	sc_ebx;
     56       1.7   mycroft 	int	sc_edx;
     57       1.7   mycroft 	int	sc_ecx;
     58       1.7   mycroft 	int	sc_eax;
     59       1.7   mycroft 	int	sc_trapno;
     60       1.7   mycroft 	int	sc_err;
     61       1.7   mycroft 	int	sc_eip;
     62       1.7   mycroft 	int	sc_cs;
     63       1.7   mycroft 	int	sc_eflags;
     64       1.7   mycroft 	int	sc_esp_at_signal;
     65       1.7   mycroft 	int	sc_ss;
     66       1.3   mycroft 	int	sc_387;
     67      1.10      fvdl 	/* XXX check this */
     68      1.10      fvdl 	linux_old_sigset_t sc_mask;
     69       1.3   mycroft 	int	sc_cr2;
     70       1.1      fvdl };
     71       1.1      fvdl 
     72       1.1      fvdl /*
     73       1.1      fvdl  * We make the stack look like Linux expects it when calling a signal
     74       1.1      fvdl  * handler, but use the BSD way of calling the handler and sigreturn().
     75       1.1      fvdl  * This means that we need to pass the pointer to the handler too.
     76       1.1      fvdl  * It is appended to the frame to not interfere with the rest of it.
     77       1.1      fvdl  */
     78       1.1      fvdl 
     79       1.1      fvdl struct linux_sigframe {
     80       1.3   mycroft 	int	sf_sig;
     81       1.3   mycroft 	struct	linux_sigcontext sf_sc;
     82       1.3   mycroft 	sig_t	sf_handler;
     83       1.1      fvdl };
     84       1.2  christos 
     85       1.8       erh #ifdef _KERNEL
     86       1.8       erh __BEGIN_DECLS
     87       1.7   mycroft void linux_sendsig __P((sig_t, int, sigset_t *, u_long));
     88       1.5  christos dev_t linux_fakedev __P((dev_t));
     89       1.8       erh __END_DECLS
     90       1.8       erh #endif /* _KERNEL */
     91       1.4      fvdl 
     92       1.4      fvdl /*
     93       1.4      fvdl  * Major device numbers of VT device on both Linux and NetBSD. Used in
     94       1.4      fvdl  * ugly patch to fake device numbers.
     95       1.4      fvdl  */
     96       1.4      fvdl #define LINUX_CONS_MAJOR   4
     97       1.6  drochner #define NETBSD_WSCONS_MAJOR 47
     98       1.4      fvdl 
     99       1.4      fvdl /*
    100       1.4      fvdl  * Linux ioctl calls for the keyboard.
    101       1.4      fvdl  */
    102       1.4      fvdl #define LINUX_KDGKBMODE   0x4b44
    103       1.4      fvdl #define LINUX_KDSKBMODE   0x4b45
    104       1.4      fvdl #define LINUX_KDMKTONE    0x4b30
    105       1.4      fvdl #define LINUX_KDSETMODE   0x4b3a
    106       1.4      fvdl #define LINUX_KDENABIO    0x4b36
    107       1.4      fvdl #define LINUX_KDDISABIO   0x4b37
    108       1.4      fvdl #define LINUX_KDGETLED    0x4b31
    109       1.4      fvdl #define LINUX_KDSETLED    0x4b32
    110       1.6  drochner #define LINUX_KDGKBTYPE   0x4B33
    111       1.6  drochner #define LINUX_KDGKBENT    0x4B46
    112       1.6  drochner 
    113       1.4      fvdl /*
    114       1.4      fvdl  * Mode for KDSKBMODE which we don't have (we just use plain mode for this)
    115       1.4      fvdl  */
    116       1.4      fvdl #define LINUX_K_MEDIUMRAW 2
    117       1.4      fvdl 
    118       1.4      fvdl /*
    119  1.10.2.1    bouyer  * VT ioctl calls in Linux (the ones that the pcvt emulation in wscons can handle)
    120       1.4      fvdl  */
    121       1.4      fvdl #define LINUX_VT_OPENQRY    0x5600
    122       1.4      fvdl #define LINUX_VT_GETMODE    0x5601
    123       1.4      fvdl #define LINUX_VT_SETMODE    0x5602
    124       1.6  drochner #define LINUX_VT_GETSTATE   0x5603
    125       1.4      fvdl #define LINUX_VT_RELDISP    0x5605
    126       1.4      fvdl #define LINUX_VT_ACTIVATE   0x5606
    127       1.4      fvdl #define LINUX_VT_WAITACTIVE 0x5607
    128  1.10.2.3    bouyer #define LINUX_VT_DISALLOCATE	0x5608
    129  1.10.2.2    bouyer 
    130  1.10.2.2    bouyer /*
    131  1.10.2.3    bouyer  * This range used by VMWare (XXX)
    132  1.10.2.2    bouyer  */
    133  1.10.2.3    bouyer #define LINUX_VMWARE_NONE 200
    134  1.10.2.3    bouyer #define LINUX_VMWARE_LAST 237
    135  1.10.2.3    bouyer 
    136  1.10.2.3    bouyer /*
    137  1.10.2.3    bouyer  * Range of ioctls to just pass on, so that LKMs (like VMWare) can
    138  1.10.2.3    bouyer  * handle them.
    139  1.10.2.3    bouyer  */
    140  1.10.2.3    bouyer #define LINUX_IOCTL_MIN_PASS	LINUX_VMWARE_NONE
    141  1.10.2.3    bouyer #define LINUX_IOCTL_MAX_PASS	(LINUX_VMWARE_LAST+8)
    142  1.10.2.3    bouyer 
    143  1.10.2.3    bouyer void linux_syscall_intern __P((struct proc *));
    144       1.1      fvdl 
    145       1.8       erh #endif /* _I386_LINUX_MACHDEP_H */
    146