summaryrefslogtreecommitdiff
path: root/emulators/kqemu-kmod/files
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/kqemu-kmod/files')
-rw-r--r--emulators/kqemu-kmod/files/kqemu.in53
-rw-r--r--emulators/kqemu-kmod/files/patch-Makefile.freebsd9
-rw-r--r--emulators/kqemu-kmod/files/patch-common-Makefile22
-rw-r--r--emulators/kqemu-kmod/files/patch-common-interp.c15
-rw-r--r--emulators/kqemu-kmod/files/patch-common-kqemu_int.h19
-rw-r--r--emulators/kqemu-kmod/files/patch-fpucontext78
-rw-r--r--emulators/kqemu-kmod/files/patch-kqemu-freebsd.c69
-rw-r--r--emulators/kqemu-kmod/files/patch-unit2minorfix16
8 files changed, 0 insertions, 281 deletions
diff --git a/emulators/kqemu-kmod/files/kqemu.in b/emulators/kqemu-kmod/files/kqemu.in
deleted file mode 100644
index 1903deec4d71..000000000000
--- a/emulators/kqemu-kmod/files/kqemu.in
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-# $FreeBSD$
-#
-# PROVIDE: kqemu
-# KEYWORD: nojail
-#
-# Add the following line to /etc/rc.conf[.local] to enable kqemu
-#
-# kqemu_enable="YES"
-#
-
-. /etc/rc.subr
-
-name="kqemu"
-rcvar=kqemu_enable
-
-load_rc_config $name
-
-: ${kqemu_enable="NO"}
-
-start_cmd=kqemu_start
-stop_cmd=kqemu_stop
-
-kqemu_start()
-{
- # load aio if needed
- if ! kldstat -qm aio; then
- if kldload aio; then
- info 'aio module loaded.'
- else
- warn 'aio module failed to load.'
- return 1
- fi
- fi
- if ! kldstat -qm kqemu; then
- if kldload kqemu; then
- echo 'kqemu module loaded.'
- else
- warn 'kqemu module failed to load.'
- return 1
- fi
- fi
- return 0
-}
-
-kqemu_stop()
-{
- if kldstat -qm kqemu && kldunload kqemu; then
- echo 'kqemu module unloaded.'
- fi
-}
-
-run_rc_command "$1"
diff --git a/emulators/kqemu-kmod/files/patch-Makefile.freebsd b/emulators/kqemu-kmod/files/patch-Makefile.freebsd
deleted file mode 100644
index 1dd6108aefbb..000000000000
--- a/emulators/kqemu-kmod/files/patch-Makefile.freebsd
+++ /dev/null
@@ -1,9 +0,0 @@
---- Makefile.freebsd.orig
-+++ Makefile.freebsd
-@@ -8,3 +8,6 @@ OBJS= kqemu-mod-x86_64.o
- WERROR=
-
- .include <bsd.kmod.mk>
-+
-+CFLAGS:= ${CFLAGS:N-fformat-extensions}
-+CFLAGS:= ${CFLAGS:N-mno-align-long-strings}
diff --git a/emulators/kqemu-kmod/files/patch-common-Makefile b/emulators/kqemu-kmod/files/patch-common-Makefile
deleted file mode 100644
index a74cec5a4e1e..000000000000
--- a/emulators/kqemu-kmod/files/patch-common-Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-Index: common/Makefile
-@@ -47,9 +47,9 @@
- ifeq ($(ARCH), x86_64)
- COMMON_CFLAGS+=-mno-red-zone
- endif
--CFLAGS=$(COMMON_CFLAGS)
-+CFLAGS=$(COMMON_CFLAGS) ${DEBUG_FLAGS}
- MON_CFLAGS=$(COMMON_CFLAGS)
--KERNEL_CFLAGS=$(COMMON_CFLAGS)
-+KERNEL_CFLAGS=$(COMMON_CFLAGS) ${DEBUG_FLAGS}
-
- # Disable SSP if GCC supports it
- MON_CFLAGS+=$(call cc-option,$(MON_CC),-fno-stack-protector,)
-@@ -119,7 +119,7 @@
- $(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -c -o $@ $<
-
- %.o: %.S
-- $(CC) $(DEFINES) $(INCLUDES) -D__ASSEMBLY__ -c -o $@ $<
-+ $(CC) ${DEBUG_FLAGS} $(DEFINES) $(INCLUDES) -D__ASSEMBLY__ -c -o $@ $<
-
- clean:
- rm -f *.o *~ monitor-image.h genoffsets genmon monitor_def.h \
diff --git a/emulators/kqemu-kmod/files/patch-common-interp.c b/emulators/kqemu-kmod/files/patch-common-interp.c
deleted file mode 100644
index aea7cbeb5a67..000000000000
--- a/emulators/kqemu-kmod/files/patch-common-interp.c
+++ /dev/null
@@ -1,15 +0,0 @@
---- common/interp.c.orig
-+++ common/interp.c
-@@ -1623,11 +1623,11 @@ static void helper_wrmsr(struct kqemu_st
- {
- #ifdef __x86_64__
- struct kqemu_cpu_state *env = &s->cpu_state;
--#endif
- uint64_t val;
-
- val = ((uint32_t)s->regs1.eax) |
- ((uint64_t)((uint32_t)s->regs1.edx) << 32);
-+#endif
-
- switch((uint32_t)s->regs1.ecx) {
- #ifdef __x86_64__
diff --git a/emulators/kqemu-kmod/files/patch-common-kqemu_int.h b/emulators/kqemu-kmod/files/patch-common-kqemu_int.h
deleted file mode 100644
index 1d5edf76be9d..000000000000
--- a/emulators/kqemu-kmod/files/patch-common-kqemu_int.h
+++ /dev/null
@@ -1,19 +0,0 @@
---- common/kqemu_int.h.orig
-+++ common/kqemu_int.h
-@@ -17,8 +17,16 @@
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
- #ifndef __ASSEMBLY__
-+#ifdef __FreeBSD__
-+#include <sys/stddef.h>
-+#include <machine/stdarg.h>
-+#include <sys/cdefs.h>
-+#include <machine/_types.h>
-+typedef __size_t size_t;
-+#else
- #include <stddef.h>
- #include <stdarg.h>
-+#endif
-
- #ifndef NO_STD_TYPES
-
diff --git a/emulators/kqemu-kmod/files/patch-fpucontext b/emulators/kqemu-kmod/files/patch-fpucontext
deleted file mode 100644
index 186d131da2b2..000000000000
--- a/emulators/kqemu-kmod/files/patch-fpucontext
+++ /dev/null
@@ -1,78 +0,0 @@
-Index: common/kernel.c
-@@ -1240,6 +1240,11 @@
- case MON_REQ_EXCEPTION:
- exec_exception(s->arg0);
- break;
-+#ifdef __FreeBSD__
-+ case MON_REQ_LOADFPUCONTEXT:
-+ kqemu_loadfpucontext(s->arg0);
-+ break;
-+#endif
- default:
- kqemu_log("invalid mon request: %d\n", s->mon_req);
- break;
-Index: common/kqemu_int.h
-@@ -523,6 +523,7 @@
- MON_REQ_LOCK_USER_PAGE,
- MON_REQ_UNLOCK_USER_PAGE,
- MON_REQ_EXCEPTION,
-+ MON_REQ_LOADFPUCONTEXT,
- } MonitorRequest;
-
- #define INTERRUPT_ENTRY_SIZE 16
-Index: common/monitor.c
-@@ -1995,8 +1995,13 @@
- raise_exception_err(s, EXCP07_PREX, 0);
- } else {
- /* the host needs to restore the FPU state for us */
-+#ifndef __FreeBSD__
- s->mon_req = MON_REQ_EXCEPTION;
- s->arg0 = 0x07;
-+#else
-+ s->mon_req = MON_REQ_LOADFPUCONTEXT;
-+ s->arg0 = (unsigned long)s->cpu_state.cpl;
-+#endif
- monitor2kernel1(s);
- }
- }
-Index: kqemu-freebsd.c
-@@ -33,6 +33,11 @@
-
- #include <machine/vmparam.h>
- #include <machine/stdarg.h>
-+#ifdef __x86_64__
-+#include <machine/fpu.h>
-+#else
-+#include <machine/npx.h>
-+#endif
-
- #include "kqemu-kernel.h"
-
-@@ -172,6 +177,15 @@
- {
- }
-
-+void CDECL kqemu_loadfpucontext(unsigned long cpl)
-+{
-+#ifdef __x86_64__
-+ fpudna();
-+#else
-+ npxdna();
-+#endif
-+}
-+
- #if __FreeBSD_version < 500000
- static int
- curpriority_cmp(struct proc *p)
-Index: kqemu-kernel.h
-@@ -40,6 +40,10 @@
- void * CDECL kqemu_io_map(unsigned long page_index, unsigned int size);
- void CDECL kqemu_io_unmap(void *ptr, unsigned int size);
-
-+#ifdef __FreeBSD__
-+void CDECL kqemu_loadfpucontext(unsigned long cpl);
-+#endif
-+
- int CDECL kqemu_schedule(void);
-
- void CDECL kqemu_log(const char *fmt, ...);
diff --git a/emulators/kqemu-kmod/files/patch-kqemu-freebsd.c b/emulators/kqemu-kmod/files/patch-kqemu-freebsd.c
deleted file mode 100644
index 9b4d6ab137ec..000000000000
--- a/emulators/kqemu-kmod/files/patch-kqemu-freebsd.c
+++ /dev/null
@@ -1,69 +0,0 @@
-Index: kqemu-freebsd.c
-@@ -222,9 +222,17 @@
- int CDECL kqemu_schedule(void)
- {
- /* kqemu_log("kqemu_schedule\n"); */
-+#if __FreeBSD_version < 700044
- mtx_lock_spin(&sched_lock);
- mi_switch(SW_VOL, NULL);
- mtx_unlock_spin(&sched_lock);
-+#else
-+ /* -current no longer uses sched_lock */
-+ struct thread *td = curthread;
-+ thread_lock(td);
-+ mi_switch(SW_VOL, NULL);
-+ thread_unlock(td);
-+#endif
- return SIGPENDING(curthread);
- }
- #endif
-@@ -258,6 +266,10 @@
- static struct clonedevs *kqemuclones;
- static TAILQ_HEAD(,kqemu_instance) kqemuhead = TAILQ_HEAD_INITIALIZER(kqemuhead);
- static eventhandler_tag clonetag;
-+#ifndef D_NEEDMINOR
-+/* see http://svn.freebsd.org/viewvc/base?view=revision&revision=179726 */
-+#define D_NEEDMINOR 0
-+#endif
- #endif
-
- static d_close_t kqemu_close;
-@@ -282,7 +294,7 @@
- /* bmaj */ -1
- #else
- .d_version = D_VERSION,
-- .d_flags = D_NEEDGIANT,
-+ .d_flags = D_NEEDGIANT | D_NEEDMINOR,
- .d_open = kqemu_open,
- .d_ioctl = kqemu_ioctl,
- .d_close = kqemu_close,
-@@ -334,8 +346,15 @@
- #if __FreeBSD_version >= 500000
- dev->si_drv1 = NULL;
- TAILQ_REMOVE(&kqemuhead, ks, kqemu_ent);
-+#if __FreeBSD_version >= 700051
-+ destroy_dev_sched(dev);
-+#else
-+#if __FreeBSD_version >= 700024
-+ dev_relthread(dev);
-+#endif
- destroy_dev(dev);
- #endif
-+#endif
- free(ks, M_KQEMU);
- --kqemu_ref_count;
- }
-@@ -514,7 +533,13 @@
- while ((ks = TAILQ_FIRST(&kqemuhead)) != NULL) {
- kqemu_destroy(ks);
- }
-+#if __FreeBSD_version >= 700051
-+ drain_dev_clone_events();
-+#endif
- clone_cleanup(&kqemuclones);
-+#if __FreeBSD_version >= 700051
-+ destroy_dev_drain(&kqemu_cdevsw);
-+#endif
- #endif
- kqemu_global_delete(kqemu_gs);
- kqemu_gs = NULL;
diff --git a/emulators/kqemu-kmod/files/patch-unit2minorfix b/emulators/kqemu-kmod/files/patch-unit2minorfix
deleted file mode 100644
index 9531cdd327f8..000000000000
--- a/emulators/kqemu-kmod/files/patch-unit2minorfix
+++ /dev/null
@@ -1,16 +0,0 @@
---- kqemu-freebsd.c.orig 2009-02-12 03:45:30.607773000 -0600
-+++ kqemu-freebsd.c 2009-02-12 03:50:10.019986534 -0600
-@@ -381,7 +381,12 @@
-
- r = clone_create(&kqemuclones, &kqemu_cdevsw, &unit, dev, 0);
- if (r) {
-- *dev = make_dev(&kqemu_cdevsw, unit2minor(unit),
-+ *dev = make_dev(&kqemu_cdevsw,
-+#if __FreeBSD_version < 800062
-+ unit2minor(unit),
-+#else /* __FreeBSD_version >= 800062 */
-+ unit,
-+#endif /* __FreeBSD_version < 800062 */
- UID_ROOT, GID_WHEEL, 0660, "kqemu%d", unit);
- if (*dev != NULL) {
- dev_ref(*dev);