Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/regress/sys/arch/i386 Remove the vm86 tests.



details:   https://anonhg.NetBSD.org/src/rev/0c45f794d018
branches:  trunk
changeset: 355740:0c45f794d018
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sat Aug 12 07:40:43 2017 +0000

description:
Remove the vm86 tests.

diffstat:

 regress/sys/arch/i386/Makefile          |    4 +-
 regress/sys/arch/i386/vm86/Makefile     |   14 ---
 regress/sys/arch/i386/vm86/vm86test.c   |  141 --------------------------------
 regress/sys/arch/i386/vm86/vm86test.exp |    9 --
 4 files changed, 2 insertions(+), 166 deletions(-)

diffs (188 lines):

diff -r d06d79ecf15e -r 0c45f794d018 regress/sys/arch/i386/Makefile
--- a/regress/sys/arch/i386/Makefile    Sat Aug 12 07:35:08 2017 +0000
+++ b/regress/sys/arch/i386/Makefile    Sat Aug 12 07:40:43 2017 +0000
@@ -1,6 +1,6 @@
-#      $NetBSD: Makefile,v 1.7 2008/01/04 15:39:25 yamt Exp $
+#      $NetBSD: Makefile,v 1.8 2017/08/12 07:40:43 maxv Exp $
 
-SUBDIR+= ldt vm86
+SUBDIR+= ldt
 #SUBDIR+= ioperm iopl
 
 .include <bsd.subdir.mk>
diff -r d06d79ecf15e -r 0c45f794d018 regress/sys/arch/i386/vm86/Makefile
--- a/regress/sys/arch/i386/vm86/Makefile       Sat Aug 12 07:35:08 2017 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2003/08/16 15:02:35 drochner Exp $
-
-NOMAN=         # defined
-
-PROG=          vm86test
-LDADD+=                -li386
-CLEANFILES+=   vm86test.out
-
-regress:
-       ./${PROG} 2>vm86test.out
-       ./${PROG} dummyarg 2>>vm86test.out
-       tail +4 ${.CURDIR}/vm86test.exp | diff - vm86test.out
-
-.include <bsd.prog.mk>
diff -r d06d79ecf15e -r 0c45f794d018 regress/sys/arch/i386/vm86/vm86test.c
--- a/regress/sys/arch/i386/vm86/vm86test.c     Sat Aug 12 07:35:08 2017 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/* $NetBSD: vm86test.c,v 1.3 2003/09/11 19:14:01 christos Exp $ */
-
-/*
- * Copyright (c) 2003
- *     Matthias Drochner.  All rights reserved.
- *
- * 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 AUTHOR 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 AUTHOR 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.
- */
-
-#include <sys/types.h>
-#include <signal.h>
-#include <ucontext.h>
-#include <machine/segments.h>
-#include <machine/sysarch.h>
-#include <machine/vm86.h>
-#include <sys/mman.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <err.h>
-
-void urghdl(int, siginfo_t *, void *);
-
-/*
- * Some code to execute in vm86 mode. Uses INT 0x20 to print some status info
- * and INT 0x21 to exit.
- * We don't use an IDT, so the interrupts must be vectored to the user task.
- */
-const char vmcode[] = {
-       0xcd, /* INTxx */
-       0x20,
-       0xfb, /* STI */
-       0xcd, /* INTxx */
-       0x20,
-       0xfa, /* CLI */
-       0xcd, /* INTxx */
-       0x21,
-};
-
-/*
- * XXX before our text segment, must be below 1M to be addressable.
- * Also chosen to start >=64k, to catch the longstanding kernel bug which
- * caused the stack segment to be ignored in the !SA_ONSTACK case.
- */
-#define VMCODEBASE (void *)0x80000
-#define VMSIZE 0x4000
-
-void
-urghdl(int sig, siginfo_t *si, void *vuc)
-{
-       stack_t oss;
-       ucontext_t *uc = vuc;
-       int res, ip, eflags, code;
-
-       ip = uc->uc_mcontext.__gregs[_REG_EIP];
-       eflags = uc->uc_mcontext.__gregs[_REG_EFL];
-       code = si->si_trap;
-
-       res = sigaltstack(0, &oss);
-       if (res < 0)
-               err(6, "sigaltstack in handler");
-       fprintf(stderr, "urghdl called @ip=%04x, code=%04x, ", ip, code);
-       fprintf(stderr, "eflags=%08x, stackflags=%01x\n",
-               eflags, oss.ss_flags);
-       if (code == VM86_MAKEVAL(VM86_INTx, 0x21))
-               exit (0);
-}
-
-struct vm86_struct vm; /* zero inited */
-
-int
-main(int argc, char **argv)
-{
-       void *mapaddr;
-       unsigned int codeaddr;
-       struct sigaction sa;
-       int usealtstack, res;
-       stack_t ss;
-
-       usealtstack = 0;
-       if (argc > 1)
-               usealtstack = 1;
-
-       mapaddr = mmap(VMCODEBASE, VMSIZE, PROT_READ|PROT_WRITE|PROT_EXEC,
-                      MAP_ANON|MAP_FIXED, -1, 0);
-       if (mapaddr == (void *)-1)
-               err(1, "mmap");
-
-       memcpy(mapaddr, vmcode, sizeof(vmcode));
-
-       codeaddr = (unsigned int)mapaddr;
-       vm.substr.regs[_REG_CS] = codeaddr >> 4;
-       vm.substr.regs[_REG_EIP] = codeaddr & 15; /* unnecessary here */
-       vm.substr.ss_cpu_type = VCPU_586;
-       vm.int_byuser[4] = 0x03; /* vector INT 0x20 and 0x21 */
-
-       if (usealtstack) {
-               ss.ss_sp = malloc(SIGSTKSZ);
-               ss.ss_size = SIGSTKSZ;
-               ss.ss_flags = 0;
-               res = sigaltstack(&ss, 0);
-               if (res < 0)
-                       err (2, "sigaltstack");
-       } else {
-               vm.substr.regs[_REG_SS] = codeaddr >> 4;
-               vm.substr.regs[_REG_ESP] = VMSIZE - (codeaddr & 15); /* hmm */
-       }
-
-       sa.sa_sigaction = urghdl;
-       sigemptyset(&sa.sa_mask);
-       sa.sa_flags = SA_SIGINFO | (usealtstack ? SA_ONSTACK : 0);
-       res = sigaction(SIGURG, &sa, 0);
-       if (res < 0)
-               err(3, "sigaction");
-
-       res = i386_vm86(&vm);
-       if (res < 0)
-               err(4, "vm86");
-
-       /* NOTREACHED */
-       exit (5);
-}
diff -r d06d79ecf15e -r 0c45f794d018 regress/sys/arch/i386/vm86/vm86test.exp
--- a/regress/sys/arch/i386/vm86/vm86test.exp   Sat Aug 12 07:35:08 2017 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-# $NetBSD: vm86test.exp,v 1.1 2003/08/16 15:02:36 drochner Exp $
-# real output must start in line 4
-
-urghdl called @ip=0002, code=2001, eflags=00030002, stackflags=4
-urghdl called @ip=0005, code=2001, eflags=00030202, stackflags=4
-urghdl called @ip=0008, code=2101, eflags=00030002, stackflags=4
-urghdl called @ip=0002, code=2001, eflags=00030002, stackflags=1
-urghdl called @ip=0005, code=2001, eflags=00030202, stackflags=1
-urghdl called @ip=0008, code=2101, eflags=00030002, stackflags=1



Home | Main Index | Thread Index | Old Index