Import qemu snapshot from 2005-02-27
QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation. QEMU has two operating modes: * Full system emulation. In this mode, QEMU emulates a full system (for example a PC), including a processor and various peripherials. It can be used to launch different Operating Systems without rebooting the PC or to debug system code. * User mode emulation (Linux host only). In this mode, .. many thanks for feedback from many people, and for Lars Hansson and Michael Schmidt for posting early work on the port of qemu to ports@ For now, only for macppc and i386, as these are currently the only archs that have reported success building qemu. QEMU can launch Linux processes compiled for one CPU on another CPU.
This commit is contained in:
parent
5d1a285793
commit
202b6aaad6
26
emulators/qemu/Makefile
Normal file
26
emulators/qemu/Makefile
Normal file
@ -0,0 +1,26 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
|
||||
ONLY_FOR_ARCHS= i386 macppc # no success building on other archs yet
|
||||
|
||||
COMMENT= "multi system emulator"
|
||||
DISTNAME= qemu-20050227
|
||||
CATEGORIES= emulators
|
||||
|
||||
HOMEPAGE= http://fabrice.bellard.free.fr/qemu/
|
||||
|
||||
MAINTAINER= Todd T. Fries <todd@openbsd.org>
|
||||
|
||||
PERMIT_PACKAGE_CDROM= Yes
|
||||
PERMIT_PACKAGE_FTP= Yes
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
|
||||
MASTER_SITES= ftp://ftp.FreeDaemonHosting.com/pub/users/todd/
|
||||
|
||||
LIB_DEPENDS= SDL::devel/sdl
|
||||
USE_GMAKE= Yes
|
||||
USE_X11= Yes
|
||||
WANTLIB= m z ossaudio X11 Xext usbhid util pthread c
|
||||
CONFIGURE_STYLE= gnu
|
||||
|
||||
.include <bsd.port.mk>
|
4
emulators/qemu/distinfo
Normal file
4
emulators/qemu/distinfo
Normal file
@ -0,0 +1,4 @@
|
||||
MD5 (qemu-20050227.tar.gz) = d1bf3565aae1a28ab30d942f67b19638
|
||||
RMD160 (qemu-20050227.tar.gz) = 5ada7c35e540a3df0383f4038a51826a58e8138c
|
||||
SHA1 (qemu-20050227.tar.gz) = b78fbf6e5c9fda5e0366148e1ad97dee73f74619
|
||||
SIZE (qemu-20050227.tar.gz) = 1120987
|
46
emulators/qemu/patches/patch-Makefile
Normal file
46
emulators/qemu/patches/patch-Makefile
Normal file
@ -0,0 +1,46 @@
|
||||
$OpenBSD: patch-Makefile,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- Makefile.orig Thu Feb 10 15:48:51 2005
|
||||
+++ Makefile Sun Feb 27 17:18:43 2005
|
||||
@@ -1,10 +1,10 @@
|
||||
-include config-host.mak
|
||||
|
||||
-CFLAGS=-Wall -O2 -g -fno-strict-aliasing
|
||||
+#CFLAGS=-Wall -O2 -g -fno-strict-aliasing
|
||||
ifdef CONFIG_DARWIN
|
||||
CFLAGS+= -mdynamic-no-pic
|
||||
endif
|
||||
-LDFLAGS=-g
|
||||
+#LDFLAGS=-g
|
||||
LIBS=
|
||||
DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
||||
TOOLS=qemu-img$(EXESUF)
|
||||
@@ -50,21 +50,19 @@ ar de en-us fi fr-be hr
|
||||
common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
|
||||
|
||||
install: all
|
||||
- mkdir -p "$(bindir)"
|
||||
- install -m 755 -s $(TOOLS) "$(bindir)"
|
||||
- mkdir -p "$(datadir)"
|
||||
+ mkdir -p $(PREFIX)/share/qemu
|
||||
+ install -m 755 -s $(TOOLS) $(PREFIX)/bin
|
||||
install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
|
||||
pc-bios/vgabios-cirrus.bin \
|
||||
pc-bios/ppc_rom.bin \
|
||||
pc-bios/proll.elf \
|
||||
- pc-bios/linux_boot.bin "$(datadir)"
|
||||
- mkdir -p "$(docdir)"
|
||||
- install -m 644 qemu-doc.html qemu-tech.html "$(docdir)"
|
||||
+ pc-bios/linux_boot.bin $(PREFIX)/share/qemu
|
||||
+ mkdir -p $(PREFIX)/share/doc/qemu
|
||||
+ install -m 644 qemu-doc.html qemu-tech.html $(PREFIX)/share/doc/qemu
|
||||
ifndef CONFIG_WIN32
|
||||
- mkdir -p "$(mandir)/man1"
|
||||
- install qemu.1 qemu-img.1 "$(mandir)/man1"
|
||||
- mkdir -p "$(datadir)/keymaps"
|
||||
- install -m 644 $(addprefix keymaps/,$(KEYMAPS)) "$(datadir)/keymaps"
|
||||
+ install qemu.1 qemu-img.1 $(PREFIX)/man/man1
|
||||
+ mkdir -p $(PREFIX)/share/qemu/keymaps
|
||||
+ install -m 644 $(addprefix keymaps/,$(KEYMAPS)) $(PREFIX)/share/qemu/keymaps
|
||||
endif
|
||||
for d in $(TARGET_DIRS); do \
|
||||
$(MAKE) -C $$d $@ || exit 1 ; \
|
53
emulators/qemu/patches/patch-Makefile_target
Normal file
53
emulators/qemu/patches/patch-Makefile_target
Normal file
@ -0,0 +1,53 @@
|
||||
$OpenBSD: patch-Makefile_target,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- Makefile.target.orig Tue Feb 22 13:27:14 2005
|
||||
+++ Makefile.target Tue Mar 1 17:22:05 2005
|
||||
@@ -14,7 +14,7 @@ ifdef CONFIG_USER_ONLY
|
||||
VPATH+=:$(SRC_PATH)/linux-user
|
||||
DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
|
||||
endif
|
||||
-CFLAGS=-Wall -O2 -g -fno-strict-aliasing
|
||||
+#CFLAGS=-Wall -O2 -g -fno-strict-aliasing
|
||||
#CFLAGS+=-Werror
|
||||
LDFLAGS=-g
|
||||
LIBS=
|
||||
@@ -127,6 +127,11 @@ else
|
||||
OP_CFLAGS+= -malign-functions=0
|
||||
endif
|
||||
|
||||
+ifeq ($(shell uname -s),OpenBSD)
|
||||
+OP_CFLAGS+= -fno-stack-protector
|
||||
+endif
|
||||
+
|
||||
+
|
||||
ifdef TARGET_GPROF
|
||||
USE_I386_LD=y
|
||||
endif
|
||||
@@ -312,7 +317,10 @@ AUDIODRV += sdlaudio.o
|
||||
endif
|
||||
ifdef CONFIG_OSS
|
||||
AUDIODRV += ossaudio.o
|
||||
+ifdef CONFIG_OSS_LIBRARY
|
||||
+LIBS += -lossaudio
|
||||
endif
|
||||
+endif
|
||||
|
||||
pc.o: DEFINES := -DUSE_SB16 $(DEFINES)
|
||||
|
||||
@@ -404,7 +412,7 @@ gen-op.h: op.o $(DYNGEN)
|
||||
$(DYNGEN) -g -o $@ $<
|
||||
|
||||
op.o: op.c
|
||||
- $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $<
|
||||
+ $(CC) $(OP_CFLAGS) $(DEFINES) -fno-stack-protector -c -o $@ $<
|
||||
|
||||
helper.o: helper.c
|
||||
$(CC) $(HELPER_CFLAGS) $(DEFINES) -c -o $@ $<
|
||||
@@ -439,7 +447,7 @@ clean:
|
||||
|
||||
install: all
|
||||
ifneq ($(PROGS),)
|
||||
- install -m 755 -s $(PROGS) "$(bindir)"
|
||||
+ install -m 755 -s $(PROGS) $(PREFIX)/bin/
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard .depend),)
|
14
emulators/qemu/patches/patch-audio_audio_c
Normal file
14
emulators/qemu/patches/patch-audio_audio_c
Normal file
@ -0,0 +1,14 @@
|
||||
$OpenBSD: patch-audio_audio_c,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- audio/audio.c.orig Mon Nov 15 04:51:33 2004
|
||||
+++ audio/audio.c Tue Feb 15 22:07:06 2005
|
||||
@@ -35,6 +35,10 @@
|
||||
#define ldebug(...)
|
||||
#endif
|
||||
|
||||
+#ifdef __OpenBSD__
|
||||
+#define INT16_MAX (32767)
|
||||
+#endif
|
||||
+
|
||||
#define QC_AUDIO_DRV "QEMU_AUDIO_DRV"
|
||||
#define QC_VOICES "QEMU_VOICES"
|
||||
#define QC_FIXED_FORMAT "QEMU_FIXED_FORMAT"
|
20
emulators/qemu/patches/patch-audio_ossaudio_c
Normal file
20
emulators/qemu/patches/patch-audio_ossaudio_c
Normal file
@ -0,0 +1,20 @@
|
||||
$OpenBSD: patch-audio_ossaudio_c,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- audio/ossaudio.c.orig Mon Nov 15 04:51:33 2004
|
||||
+++ audio/ossaudio.c Tue Feb 15 22:07:06 2005
|
||||
@@ -21,10 +21,15 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
+#ifdef __OpenBSD__
|
||||
+#include <stdlib.h>
|
||||
+#include <soundcard.h>
|
||||
+#else
|
||||
+#include <sys/soundcard.h>
|
||||
+#endif
|
||||
#include <sys/mman.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
-#include <sys/soundcard.h>
|
||||
#include <assert.h>
|
||||
#include "vl.h"
|
||||
|
55
emulators/qemu/patches/patch-configure
Normal file
55
emulators/qemu/patches/patch-configure
Normal file
@ -0,0 +1,55 @@
|
||||
$OpenBSD: patch-configure,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- configure.orig Sat Feb 19 11:24:28 2005
|
||||
+++ configure Sun Feb 27 15:47:13 2005
|
||||
@@ -41,7 +41,7 @@ case "$cpu" in
|
||||
alpha)
|
||||
cpu="alpha"
|
||||
;;
|
||||
- "Power Macintosh"|ppc|ppc64)
|
||||
+ "Power Macintosh"|macppc|ppc|ppc64)
|
||||
cpu="powerpc"
|
||||
;;
|
||||
mips)
|
||||
@@ -100,6 +100,7 @@ oss="yes"
|
||||
;;
|
||||
OpenBSD)
|
||||
bsd="yes"
|
||||
+openbsd="yes"
|
||||
oss="yes"
|
||||
;;
|
||||
Darwin)
|
||||
@@ -341,7 +342,7 @@ else
|
||||
if test -z "$prefix" ; then
|
||||
prefix="/usr/local"
|
||||
fi
|
||||
-mandir="$prefix/share/man"
|
||||
+mandir="$prefix/man"
|
||||
datadir="$prefix/share/qemu"
|
||||
docdir="$prefix/share/doc/qemu"
|
||||
bindir="$prefix/bin"
|
||||
@@ -533,6 +534,9 @@ fi
|
||||
if test "$oss" = "yes" ; then
|
||||
echo "CONFIG_OSS=yes" >> $config_mak
|
||||
echo "#define CONFIG_OSS 1" >> $config_h
|
||||
+ if test "$openbsd"="yes" ; then
|
||||
+ echo "CONFIG_OSS_LIBRARY=yes" >> $config_mak
|
||||
+ fi
|
||||
fi
|
||||
if test "$fmod" = "yes" ; then
|
||||
echo "CONFIG_FMOD=yes" >> $config_mak
|
||||
@@ -563,6 +567,15 @@ if [ "$bsd" = "yes" ] ; then
|
||||
echo "#define MAP_ANONYMOUS MAP_ANON" >> $config_h
|
||||
echo "#define _BSD 1" >> $config_h
|
||||
fi
|
||||
+
|
||||
+if [ "$openbsd" = "yes" ] ; then
|
||||
+ echo "#define ENOTSUP 4096" >> $config_h
|
||||
+ echo "#define PRIx64 \"llX\"" >> $config_h
|
||||
+ echo "#define qemu_siginfo siginfo_t" >> $config_h
|
||||
+else
|
||||
+ echo "#define qemu_siginfo struct siginfo" >> $config_h
|
||||
+fi
|
||||
+
|
||||
|
||||
for target in $target_list; do
|
||||
|
11
emulators/qemu/patches/patch-dis-asm_h
Normal file
11
emulators/qemu/patches/patch-dis-asm_h
Normal file
@ -0,0 +1,11 @@
|
||||
$OpenBSD: patch-dis-asm_h,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- dis-asm.h.orig Mon Jan 3 17:35:10 2005
|
||||
+++ dis-asm.h Sun Feb 27 15:47:13 2005
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
+#include "config.h"
|
||||
|
||||
#define PARAMS(x) x
|
||||
typedef void *PTR;
|
52
emulators/qemu/patches/patch-dyngen-exec_h
Normal file
52
emulators/qemu/patches/patch-dyngen-exec_h
Normal file
@ -0,0 +1,52 @@
|
||||
$OpenBSD: patch-dyngen-exec_h,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- dyngen-exec.h.orig Sun Nov 14 14:51:33 2004
|
||||
+++ dyngen-exec.h Sat Feb 26 03:21:02 2005
|
||||
@@ -20,11 +20,15 @@
|
||||
#if !defined(__DYNGEN_EXEC_H__)
|
||||
#define __DYNGEN_EXEC_H__
|
||||
|
||||
+#include "config.h"
|
||||
+
|
||||
/* NOTE: standard headers should be used with special care at this
|
||||
point because host CPU registers are used as global variables. Some
|
||||
host headers do not allow that. */
|
||||
#include <stddef.h>
|
||||
-
|
||||
+#ifdef __OpenBSD__
|
||||
+#include <sys/types.h>
|
||||
+#else
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
@@ -43,6 +47,7 @@ typedef signed long int64_t;
|
||||
#else
|
||||
typedef signed long long int64_t;
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#define INT8_MIN (-128)
|
||||
#define INT16_MIN (-32767-1)
|
||||
@@ -57,11 +62,15 @@ typedef signed long long int64_t;
|
||||
#define UINT32_MAX (4294967295U)
|
||||
#define UINT64_MAX ((uint64_t)(18446744073709551615))
|
||||
|
||||
+#ifdef __OpenBSD__
|
||||
+typedef struct __sFILE FILE;
|
||||
+#else
|
||||
typedef struct FILE FILE;
|
||||
extern int fprintf(FILE *, const char *, ...);
|
||||
extern int printf(const char *, ...);
|
||||
#undef NULL
|
||||
#define NULL 0
|
||||
+#endif
|
||||
#if defined(_BSD) && !defined(__APPLE__)
|
||||
#include <ieeefp.h>
|
||||
|
||||
@@ -70,6 +79,7 @@ extern int printf(const char *, ...);
|
||||
#define FE_UPWARD FP_RP
|
||||
#define FE_TOWARDZERO FP_RZ
|
||||
#define fesetround(x) fpsetround(x)
|
||||
+#define fegetround() fpgetround()
|
||||
#else
|
||||
#include <fenv.h>
|
||||
#endif
|
23
emulators/qemu/patches/patch-osdep_h
Normal file
23
emulators/qemu/patches/patch-osdep_h
Normal file
@ -0,0 +1,23 @@
|
||||
$OpenBSD: patch-osdep_h,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- osdep.h.orig Thu Feb 10 15:59:25 2005
|
||||
+++ osdep.h Sun Feb 27 15:47:13 2005
|
||||
@@ -2,6 +2,10 @@
|
||||
#define QEMU_OSDEP_H
|
||||
|
||||
#include <stdarg.h>
|
||||
+#ifdef __OpenBSD__
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/signal.h>
|
||||
+#endif
|
||||
|
||||
int qemu_vsnprintf(char *buf, int buflen, const char *fmt, va_list args);
|
||||
void qemu_vprintf(const char *fmt, va_list ap);
|
||||
@@ -31,7 +35,7 @@ extern void __longjmp(jmp_buf env, int v
|
||||
struct qemu_sigaction {
|
||||
union {
|
||||
void (*_sa_handler)(int);
|
||||
- void (*_sa_sigaction)(int, struct siginfo *, void *);
|
||||
+ void (*_sa_sigaction)(int, qemu_siginfo *, void *);
|
||||
} _u;
|
||||
unsigned long sa_flags;
|
||||
void (*sa_restorer)(void);
|
39
emulators/qemu/patches/patch-slirp_slirp_config_h
Normal file
39
emulators/qemu/patches/patch-slirp_slirp_config_h
Normal file
@ -0,0 +1,39 @@
|
||||
$OpenBSD: patch-slirp_slirp_config_h,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- slirp/slirp_config.h.orig Sat Feb 26 03:13:57 2005
|
||||
+++ slirp/slirp_config.h Sat Feb 26 03:15:10 2005
|
||||
@@ -92,7 +92,7 @@
|
||||
#undef BAD_SPRINTF
|
||||
|
||||
/* Define if you have readv */
|
||||
-#undef HAVE_READV
|
||||
+#define HAVE_READV
|
||||
|
||||
/* Define if iovec needs to be declared */
|
||||
#undef DECLARE_IOVEC
|
||||
@@ -104,7 +104,7 @@
|
||||
#undef DECLARE_SPRINTF
|
||||
|
||||
/* Define if you have a POSIX.1 sys/wait.h */
|
||||
-#undef HAVE_SYS_WAIT_H
|
||||
+#define HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have sys/select.h */
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
@@ -122,7 +122,7 @@
|
||||
#endif
|
||||
|
||||
/* Define if you have sys/signal.h */
|
||||
-#undef HAVE_SYS_SIGNAL_H
|
||||
+#define HAVE_SYS_SIGNAL_H
|
||||
|
||||
/* Define if you have sys/stropts.h */
|
||||
#undef HAVE_SYS_STROPTS_H
|
||||
@@ -198,7 +198,7 @@
|
||||
#undef HAVE_GRANTPT
|
||||
|
||||
/* Define if you have fchmod */
|
||||
-#undef HAVE_FCHMOD
|
||||
+#define HAVE_FCHMOD
|
||||
|
||||
/* Define if you have <sys/type32.h> */
|
||||
#undef HAVE_SYS_TYPES32_H
|
12
emulators/qemu/patches/patch-target-arm_cpu_h
Normal file
12
emulators/qemu/patches/patch-target-arm_cpu_h
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-target-arm_cpu_h,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- target-arm/cpu.h.orig Tue Feb 22 13:27:29 2005
|
||||
+++ target-arm/cpu.h Sun Feb 27 15:47:13 2005
|
||||
@@ -97,7 +97,7 @@ void cpu_arm_close(CPUARMState *s);
|
||||
signal handlers to inform the virtual CPU of exceptions. non zero
|
||||
is returned if the signal was handled by the virtual CPU. */
|
||||
struct siginfo;
|
||||
-int cpu_arm_signal_handler(int host_signum, struct siginfo *info,
|
||||
+int cpu_arm_signal_handler(int host_signum, qemu_siginfo *info,
|
||||
void *puc);
|
||||
|
||||
#define TARGET_PAGE_BITS 12
|
13
emulators/qemu/patches/patch-target-i386_cpu_h
Normal file
13
emulators/qemu/patches/patch-target-i386_cpu_h
Normal file
@ -0,0 +1,13 @@
|
||||
$OpenBSD: patch-target-i386_cpu_h,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- target-i386/cpu.h.orig Sat Feb 12 12:58:00 2005
|
||||
+++ target-i386/cpu.h Sun Feb 27 15:47:13 2005
|
||||
@@ -609,8 +609,7 @@ void cpu_x86_frstor(CPUX86State *s, uint
|
||||
/* you can call this signal handler from your SIGBUS and SIGSEGV
|
||||
signal handlers to inform the virtual CPU of exceptions. non zero
|
||||
is returned if the signal was handled by the virtual CPU. */
|
||||
-struct siginfo;
|
||||
-int cpu_x86_signal_handler(int host_signum, struct siginfo *info,
|
||||
+int cpu_x86_signal_handler(int host_signum, qemu_siginfo *info,
|
||||
void *puc);
|
||||
void cpu_x86_set_a20(CPUX86State *env, int a20_state);
|
||||
|
13
emulators/qemu/patches/patch-target-ppc_cpu_h
Normal file
13
emulators/qemu/patches/patch-target-ppc_cpu_h
Normal file
@ -0,0 +1,13 @@
|
||||
$OpenBSD: patch-target-ppc_cpu_h,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- target-ppc/cpu.h.orig Tue Feb 15 17:06:19 2005
|
||||
+++ target-ppc/cpu.h Sun Feb 27 15:47:13 2005
|
||||
@@ -163,8 +163,7 @@ void cpu_ppc_close(CPUPPCState *s);
|
||||
/* you can call this signal handler from your SIGBUS and SIGSEGV
|
||||
signal handlers to inform the virtual CPU of exceptions. non zero
|
||||
is returned if the signal was handled by the virtual CPU. */
|
||||
-struct siginfo;
|
||||
-int cpu_ppc_signal_handler(int host_signum, struct siginfo *info,
|
||||
+int cpu_ppc_signal_handler(int host_signum, qemu_siginfo *info,
|
||||
void *puc);
|
||||
|
||||
void do_interrupt (CPUPPCState *env);
|
57
emulators/qemu/patches/patch-target-ppc_op_helper_c
Normal file
57
emulators/qemu/patches/patch-target-ppc_op_helper_c
Normal file
@ -0,0 +1,57 @@
|
||||
$OpenBSD: patch-target-ppc_op_helper_c,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- target-ppc/op_helper.c.orig Tue Feb 15 17:06:19 2005
|
||||
+++ target-ppc/op_helper.c Sun Feb 27 15:47:13 2005
|
||||
@@ -226,6 +226,18 @@ void do_store_fpscr (uint32_t mask)
|
||||
/* Set rounding mode */
|
||||
switch (env->fpscr[0] & 0x3) {
|
||||
case 0:
|
||||
+#ifdef _BSD
|
||||
+ fpsetround(FP_RN);
|
||||
+ break;
|
||||
+ case 1:
|
||||
+ fpsetround(FP_RZ);
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ fpsetround(FP_RP);
|
||||
+ break;
|
||||
+ case 3:
|
||||
+ fpsetround(FP_RM);
|
||||
+#else
|
||||
/* Best approximation (round to nearest) */
|
||||
fesetround(FE_TONEAREST);
|
||||
break;
|
||||
@@ -240,6 +252,7 @@ void do_store_fpscr (uint32_t mask)
|
||||
case 3:
|
||||
/* Round toward -infinite */
|
||||
fesetround(FE_DOWNWARD);
|
||||
+#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -267,9 +280,14 @@ void do_fctiwz (void)
|
||||
double d;
|
||||
uint64_t i;
|
||||
} *p = (void *)&FT1;
|
||||
+#ifdef _BSD
|
||||
+ int cround = fpgetround();
|
||||
+ fpsetround(FP_RZ);
|
||||
+#else
|
||||
int cround = fegetround();
|
||||
|
||||
fesetround(FE_TOWARDZERO);
|
||||
+#endif
|
||||
if (FT0 > (double)0x7FFFFFFF)
|
||||
p->i = 0x7FFFFFFFULL << 32;
|
||||
else if (FT0 < -(double)0x80000000)
|
||||
@@ -278,7 +296,11 @@ void do_fctiwz (void)
|
||||
p->i = 0;
|
||||
p->i |= (uint32_t)FT0;
|
||||
FT0 = p->d;
|
||||
+#ifdef _BSD
|
||||
+ fpsetround(cround);
|
||||
+#else
|
||||
fesetround(cround);
|
||||
+#endif
|
||||
}
|
||||
|
||||
void do_fnmadd (void)
|
16
emulators/qemu/patches/patch-target-sparc_cpu_h
Normal file
16
emulators/qemu/patches/patch-target-sparc_cpu_h
Normal file
@ -0,0 +1,16 @@
|
||||
$OpenBSD: patch-target-sparc_cpu_h,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- target-sparc/cpu.h.orig Tue Feb 22 13:08:57 2005
|
||||
+++ target-sparc/cpu.h Sun Feb 27 17:05:36 2005
|
||||
@@ -189,8 +189,12 @@ void cpu_set_cwp(CPUSPARCState *env1, in
|
||||
cpu_set_cwp(env, _tmp & PSR_CWP & (NWINDOWS - 1)); \
|
||||
} while (0)
|
||||
|
||||
+#ifdef _BSD
|
||||
+int cpu_sparc_signal_handler(int hostsignum, qemu_siginfo *info, void *puc);
|
||||
+#else
|
||||
struct siginfo;
|
||||
int cpu_sparc_signal_handler(int hostsignum, struct siginfo *info, void *puc);
|
||||
+#endif
|
||||
|
||||
#define TARGET_PAGE_BITS 12 /* 4k */
|
||||
#include "cpu-all.h"
|
11
emulators/qemu/patches/patch-target-sparc_op_helper_c
Normal file
11
emulators/qemu/patches/patch-target-sparc_op_helper_c
Normal file
@ -0,0 +1,11 @@
|
||||
$OpenBSD: patch-target-sparc_op_helper_c,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- target-sparc/op_helper.c.orig Tue Feb 22 13:14:33 2005
|
||||
+++ target-sparc/op_helper.c Sun Feb 27 17:15:09 2005
|
||||
@@ -1,5 +1,7 @@
|
||||
#include <math.h>
|
||||
+#if !defined(_BSD) && !defined(__OpenBSD__)
|
||||
#include <fenv.h>
|
||||
+#endif
|
||||
#include "exec.h"
|
||||
|
||||
//#define DEBUG_MMU
|
47
emulators/qemu/patches/patch-vl_c
Normal file
47
emulators/qemu/patches/patch-vl_c
Normal file
@ -0,0 +1,47 @@
|
||||
$OpenBSD: patch-vl_c,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
--- vl.c.orig Thu Feb 10 16:00:06 2005
|
||||
+++ vl.c Tue Mar 1 15:53:26 2005
|
||||
@@ -42,7 +42,7 @@
|
||||
#include <dirent.h>
|
||||
#ifdef _BSD
|
||||
#include <sys/stat.h>
|
||||
-#ifndef __APPLE__
|
||||
+#if !defined(__APPLE__) && !defined(__OpenBSD__)
|
||||
#include <libutil.h>
|
||||
#endif
|
||||
#else
|
||||
@@ -1574,11 +1574,34 @@ static int tun_open(char *ifname, int if
|
||||
char *dev;
|
||||
struct stat s;
|
||||
|
||||
+#ifdef __OpenBSD__
|
||||
+ int i = 0, enoentcount = 0, err = 0;
|
||||
+ char dname[100];
|
||||
+
|
||||
+ for (; i < 10; i++) {
|
||||
+ snprintf(dname, sizeof dname, "%s%d", "/dev/tun", i);
|
||||
+ fd = open(dname, O_RDWR);
|
||||
+ if (fd >= 0)
|
||||
+ break;
|
||||
+ else if (errno != ENOENT || ++enoentcount > 3) {
|
||||
+ if (errno != EBUSY) {
|
||||
+ err = errno;
|
||||
+ break;
|
||||
+ }
|
||||
+ } else
|
||||
+ err = errno;
|
||||
+ }
|
||||
+ if (fd < 0) {
|
||||
+ fprintf(stderr, "warning: could not open %s (%s): no virtual network emulation\n", dname, strerror(err));
|
||||
+ return -1;
|
||||
+ }
|
||||
+#else
|
||||
fd = open("/dev/tap", O_RDWR);
|
||||
if (fd < 0) {
|
||||
fprintf(stderr, "warning: could not open /dev/tap: no virtual network emulation\n");
|
||||
return -1;
|
||||
}
|
||||
+#endif
|
||||
|
||||
fstat(fd, &s);
|
||||
dev = devname(s.st_rdev, S_IFCHR);
|
12
emulators/qemu/pkg/DESCR
Normal file
12
emulators/qemu/pkg/DESCR
Normal file
@ -0,0 +1,12 @@
|
||||
QEMU is a generic and open source processor emulator
|
||||
which achieves a good emulation speed by using dynamic translation.
|
||||
|
||||
QEMU has two operating modes:
|
||||
|
||||
* Full system emulation. In this mode, QEMU emulates
|
||||
a full system (for example a PC), including a processor and
|
||||
various peripherials. It can be used to launch different
|
||||
Operating Systems without rebooting the PC or to debug system code.
|
||||
|
||||
* User mode emulation (Linux host only). In this mode,
|
||||
QEMU can launch Linux processes compiled for one CPU on another CPU.
|
7
emulators/qemu/pkg/MESSAGE
Normal file
7
emulators/qemu/pkg/MESSAGE
Normal file
@ -0,0 +1,7 @@
|
||||
+---------------
|
||||
| Quick Start:
|
||||
| 1. get a bootable floppy image
|
||||
| 2. qemu-img create -f qcow virtual.hd 10G
|
||||
| 3. qemu -m 32 -fda floppy.fs -boot a virtual.hd
|
||||
+---------------
|
||||
|
54
emulators/qemu/pkg/PLIST
Normal file
54
emulators/qemu/pkg/PLIST
Normal file
@ -0,0 +1,54 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2005/03/07 16:41:28 todd Exp $
|
||||
bin/qemu
|
||||
bin/qemu-img
|
||||
bin/qemu-system-ppc
|
||||
bin/qemu-system-sparc
|
||||
bin/qemu-system-x86_64
|
||||
@man man/man1/qemu-img.1
|
||||
@man man/man1/qemu.1
|
||||
share/doc/qemu/
|
||||
share/doc/qemu/qemu-doc.html
|
||||
share/doc/qemu/qemu-tech.html
|
||||
share/qemu/
|
||||
share/qemu/bios.bin
|
||||
share/qemu/keymaps/
|
||||
share/qemu/keymaps/ar
|
||||
share/qemu/keymaps/common
|
||||
share/qemu/keymaps/da
|
||||
share/qemu/keymaps/de
|
||||
share/qemu/keymaps/de-ch
|
||||
share/qemu/keymaps/en-gb
|
||||
share/qemu/keymaps/en-us
|
||||
share/qemu/keymaps/es
|
||||
share/qemu/keymaps/et
|
||||
share/qemu/keymaps/fi
|
||||
share/qemu/keymaps/fo
|
||||
share/qemu/keymaps/fr
|
||||
share/qemu/keymaps/fr-be
|
||||
share/qemu/keymaps/fr-ca
|
||||
share/qemu/keymaps/fr-ch
|
||||
share/qemu/keymaps/hr
|
||||
share/qemu/keymaps/hu
|
||||
share/qemu/keymaps/is
|
||||
share/qemu/keymaps/it
|
||||
share/qemu/keymaps/ja
|
||||
share/qemu/keymaps/lt
|
||||
share/qemu/keymaps/lv
|
||||
share/qemu/keymaps/mk
|
||||
share/qemu/keymaps/modifiers
|
||||
share/qemu/keymaps/nl
|
||||
share/qemu/keymaps/nl-be
|
||||
share/qemu/keymaps/no
|
||||
share/qemu/keymaps/pl
|
||||
share/qemu/keymaps/pt
|
||||
share/qemu/keymaps/pt-br
|
||||
share/qemu/keymaps/ru
|
||||
share/qemu/keymaps/sl
|
||||
share/qemu/keymaps/sv
|
||||
share/qemu/keymaps/th
|
||||
share/qemu/keymaps/tr
|
||||
share/qemu/linux_boot.bin
|
||||
share/qemu/ppc_rom.bin
|
||||
share/qemu/proll.elf
|
||||
share/qemu/vgabios-cirrus.bin
|
||||
share/qemu/vgabios.bin
|
Loading…
x
Reference in New Issue
Block a user