/*-
* Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Frank van der Linden.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
struct linux_sigcontext {
int sc_gs;
int sc_fs;
int sc_es;
int sc_ds;
int sc_edi;
int sc_esi;
int sc_ebp;
int sc_esp;
int sc_ebx;
int sc_edx;
int sc_ecx;
int sc_eax;
int sc_trapno;
int sc_err;
int sc_eip;
int sc_cs;
int sc_eflags;
int sc_esp_at_signal;
int sc_ss;
struct linux_fpstate *sc_387;
/* XXX check this */
linux_old_sigset_t sc_mask;
int sc_cr2;
};
struct linux_libc_fpreg {
unsigned short significand[4];
unsigned short exponent;
};
struct linux_libc_fpstate {
unsigned long cw;
unsigned long sw;
unsigned long tag;
unsigned long ipoff;
unsigned long cssel;
unsigned long dataoff;
unsigned long datasel;
struct linux_libc_fpreg _st[8];
unsigned long status;
};
/*
* We make the stack look like Linux expects it when calling a signal
* handler, but use the BSD way of calling the handler and sigreturn().
* This means that we need to pass the pointer to the handler too.
* It is appended to the frame to not interfere with the rest of it.
*/
struct linux_rt_sigframe {
int sf_sig;
struct linux_siginfo *sf_sip;
struct linux_ucontext *sf_ucp;
struct linux_siginfo sf_si;
struct linux_ucontext sf_uc;
sig_t sf_handler;
};
/*
* Used in ugly patch to fake device numbers.
*/
/* Major device numbers for new style ptys. */
#define LINUX_PTC_MAJOR 2
#define LINUX_PTS_MAJOR 3
/* Major device numbers of VT device on both Linux and NetBSD. */
#define LINUX_CONS_MAJOR 4
/*
* Mode for KDSKBMODE which we don't have (we just use plain mode for this)
*/
#define LINUX_K_MEDIUMRAW 2
/*
* VT ioctl calls in Linux (the ones that the pcvt emulation in wscons can handle)
*/
#define LINUX_VT_OPENQRY 0x5600
#define LINUX_VT_GETMODE 0x5601
#define LINUX_VT_SETMODE 0x5602
#define LINUX_VT_GETSTATE 0x5603
#define LINUX_VT_RELDISP 0x5605
#define LINUX_VT_ACTIVATE 0x5606
#define LINUX_VT_WAITACTIVE 0x5607
#define LINUX_VT_DISALLOCATE 0x5608
/*
* This range used by VMWare (XXX)
*/
#define LINUX_VMWARE_NONE 200
#define LINUX_VMWARE_LAST 237
/*
* Range of ioctls to just pass on, so that modules (like VMWare) can
* handle them.
*/
#define LINUX_IOCTL_MIN_PASS LINUX_VMWARE_NONE
#define LINUX_IOCTL_MAX_PASS (LINUX_VMWARE_LAST+8)