diff options
author | cvs2svn <cvs2svn@FreeBSD.org> | 2008-05-31 23:01:15 +0000 |
---|---|---|
committer | cvs2svn <cvs2svn@FreeBSD.org> | 2008-05-31 23:01:15 +0000 |
commit | a54fe1ca9c33931d7c4381a84ee11454f9831c08 (patch) | |
tree | 16cc7f849128603b27ba13f7bdb8ae11e1eadd30 /emulators/kqemu-kmod-devel | |
parent | - Update to 1.11.3 (diff) |
This commit was manufactured by cvs2svn to create tag 'RELEASE_5_EOL'.5-eol
Diffstat (limited to 'emulators/kqemu-kmod-devel')
-rw-r--r-- | emulators/kqemu-kmod-devel/Makefile | 84 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/distinfo | 3 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/files/kqemu.in | 53 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/files/patch-Makefile.freebsd | 10 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/files/patch-common-Makefile | 22 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/files/patch-fpucontext | 78 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/files/patch-kqemu-freebsd.c | 49 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/files/patch-tssworkaround | 111 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/pkg-descr | 3 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/pkg-message | 7 |
10 files changed, 0 insertions, 420 deletions
diff --git a/emulators/kqemu-kmod-devel/Makefile b/emulators/kqemu-kmod-devel/Makefile deleted file mode 100644 index 36d363b3140b..000000000000 --- a/emulators/kqemu-kmod-devel/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -# New ports collection makefile for: kqemu-kmod -# Date created: 2005/10/25 -# Whom: nork@FreeBSD.org -# -# $FreeBSD$ -# - -PORTNAME= kqemu -PORTVERSION= 1.3.0.p11 -PORTREVISION= 7 -CATEGORIES= emulators kld -MASTER_SITES= http://fabrice.bellard.free.fr/qemu/ \ - http://qemu.org/ \ - ${MASTER_SITE_LOCAL} -MASTER_SITE_SUBDIR= nox -PKGNAMESUFFIX= -kmod -DISTNAME= ${PORTNAME}-${PORTVERSION:C/.p/pre/} -DIST_SUBDIR= kqemu - -MAINTAINER= nox@FreeBSD.org -COMMENT= Kernel Accelerator for QEMU CPU Emulator (development version) - -ONLY_FOR_ARCHS= i386 amd64 -HAS_CONFIGURE= yes -USE_GMAKE= yes -CONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC} - -USE_RC_SUBR= kqemu - -.include <bsd.port.pre.mk> - -PORTDOCS= kqemu-doc.html kqemu-tech.html -PLIST_FILES= "include/kqemu/kqemu.h" -PLIST_FILES+= "@dirrm include/kqemu" -PLIST_FILES+= "@cwd /" -PLIST_FILES+= ${KMODDIR:C,^/,,}/kqemu.ko -PLIST_FILES+= "@unexec kldxref ${KMODDIR}" - -MAKEFILE= Makefile.freebsd - -.if ${ARCH} == "amd64" -MAKE_ARGS+= ARCH=x86_64 -.endif - -# install where x11/nvidia-driver does also: -KMODDIR= /boot/modules - -MAKE_ENV+= KMODDIR="${KMODDIR}" - -.if !exists(${SRC_BASE}/sys/Makefile) -IGNORE= requires kernel source to be installed -.endif - -.if ${OSVERSION} >= 700024 && ${OSVERSION} < 700053 && !defined(NOKSE) -# XXX this is wrong if you have `nooption KSE' in your kernel config, -# please define NOKSE in that case (no longer a problem after attilio's -# Sun Jul 22 21:35:44 2007 UTC commit removing the KSE ABI incompatiblity) -CFLAGS+= -DKSE -.endif - -CFLAGS+= ${DEBUG_FLAGS} - -post-extract: -.if ${OSVERSION} >= 700024 && ${OSVERSION} < 700053 && !defined(NOKSE) - @${ECHO_MSG} "Compiling with -DKSE." - @${ECHO_MSG} "If this is wrong (i.e. you have \`nooption KSE' in your kernel config)," - @${ECHO_MSG} "then please define NOKSE." -.endif - -do-build: - @(cd ${BUILD_WRKSRC}/common; ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} Makefile ${MAKE_ARGS} ${ALL_TARGET}) - @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${ALL_TARGET}) - -do-install: - @(cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${INSTALL_TARGET}) - ${MKDIR} ${PREFIX}/include/kqemu - ${INSTALL_DATA} ${WRKSRC}/kqemu.h ${PREFIX}/include/kqemu -.if !defined(NOPORTDOCS) - ${MKDIR} ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/kqemu-doc.html ${WRKSRC}/kqemu-tech.html \ - ${DOCSDIR} -.endif - -.include <bsd.port.post.mk> diff --git a/emulators/kqemu-kmod-devel/distinfo b/emulators/kqemu-kmod-devel/distinfo deleted file mode 100644 index 783c7f9c74ce..000000000000 --- a/emulators/kqemu-kmod-devel/distinfo +++ /dev/null @@ -1,3 +0,0 @@ -MD5 (kqemu/kqemu-1.3.0pre11.tar.gz) = 970521874ef8b1ba4598925ace5936c3 -SHA256 (kqemu/kqemu-1.3.0pre11.tar.gz) = 541aef5797e5c6c6a76e354c17c6513ca21fe3372ec79493a32f7e51ba785b0f -SIZE (kqemu/kqemu-1.3.0pre11.tar.gz) = 161478 diff --git a/emulators/kqemu-kmod-devel/files/kqemu.in b/emulators/kqemu-kmod-devel/files/kqemu.in deleted file mode 100644 index 7662ca3cccd1..000000000000 --- a/emulators/kqemu-kmod-devel/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=${name}_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-devel/files/patch-Makefile.freebsd b/emulators/kqemu-kmod-devel/files/patch-Makefile.freebsd deleted file mode 100644 index b75420fa0cc7..000000000000 --- a/emulators/kqemu-kmod-devel/files/patch-Makefile.freebsd +++ /dev/null @@ -1,10 +0,0 @@ ---- Makefile.freebsd.orig Fri Jul 29 06:37:06 2005 -+++ Makefile.freebsd Tue Oct 25 21:08:43 2005 -@@ -5,6 +5,7 @@ - .elif ${MACHINE_ARCH} == "amd64" - OBJS= kqemu-mod-x86_64.o - .endif -+CC= cc - WERROR= - - .include <bsd.kmod.mk> diff --git a/emulators/kqemu-kmod-devel/files/patch-common-Makefile b/emulators/kqemu-kmod-devel/files/patch-common-Makefile deleted file mode 100644 index a74cec5a4e1e..000000000000 --- a/emulators/kqemu-kmod-devel/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-devel/files/patch-fpucontext b/emulators/kqemu-kmod-devel/files/patch-fpucontext deleted file mode 100644 index 186d131da2b2..000000000000 --- a/emulators/kqemu-kmod-devel/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-devel/files/patch-kqemu-freebsd.c b/emulators/kqemu-kmod-devel/files/patch-kqemu-freebsd.c deleted file mode 100644 index ac811e16d7fe..000000000000 --- a/emulators/kqemu-kmod-devel/files/patch-kqemu-freebsd.c +++ /dev/null @@ -1,49 +0,0 @@ -Index: kqemu-freebsd.c -@@ -208,9 +208,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 -@@ -320,8 +328,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; - } -@@ -500,7 +515,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-devel/files/patch-tssworkaround b/emulators/kqemu-kmod-devel/files/patch-tssworkaround deleted file mode 100644 index e735deb5f1de..000000000000 --- a/emulators/kqemu-kmod-devel/files/patch-tssworkaround +++ /dev/null @@ -1,111 +0,0 @@ -Index: kqemu-freebsd.c -@@ -38,6 +38,14 @@ - #else - #include <machine/npx.h> - #endif -+#ifdef __x86_64__ -+#include <sys/smp.h> -+#include <sys/pcpu.h> -+#include <machine/pcb.h> -+#include <machine/specialreg.h> -+#include <machine/segments.h> -+#include <machine/tss.h> -+#endif - - #include "kqemu-kernel.h" - -@@ -248,6 +256,57 @@ - va_end(ap); - } - -+#ifdef __x86_64__ -+int kqemu_cpu0gdtfixed; -+int kqemu_gdts_used; -+struct user_segment_descriptor *kqemu_gdts; -+struct region_descriptor kqemu_r_newgdt; -+extern struct pcpu __pcpu[]; -+ -+/* called with interrupts disabled */ -+void CDECL kqemu_tss_fixup(unsigned long kerngdtbase) -+{ -+ int gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); -+ unsigned cpuid = PCPU_GET(cpuid); -+ struct user_segment_descriptor *newgdt = gdt; -+ -+ if (mp_ncpus <= 1 || kerngdtbase != (unsigned long)gdt) -+ /* UP host or gdt already moved, nothing to do */ -+ return; -+ if (cpuid) { -+ /* move gdts of all but first cpu */ -+ if (!kqemu_gdts) -+ /* -+ * XXX gdt is allocated as -+ * struct user_segment_descriptor gdt[NGDT * MAXCPU]; -+ * so it has room for the moved copies; need to allocate at -+ * kldload (and only free if kqemu_gdts_used is zero) should this -+ * change in the future -+ */ -+ kqemu_gdts = &gdt[NGDT]; -+ ++kqemu_gdts_used; -+ newgdt = &kqemu_gdts[NGDT * (cpuid - 1)]; -+ bcopy(gdt, newgdt, NGDT * sizeof(gdt[0])); -+ kqemu_r_newgdt.rd_limit = NGDT * sizeof(gdt[0]) - 1; -+ kqemu_r_newgdt.rd_base = (long) newgdt; -+ } else { -+ if (kqemu_cpu0gdtfixed) -+ return; -+ ++kqemu_cpu0gdtfixed; -+ } -+ gdt_segs[GPROC0_SEL].ssd_base = (long) &common_tss[cpuid]; -+ ssdtosyssd(&gdt_segs[GPROC0_SEL], -+ (struct system_segment_descriptor *)&newgdt[GPROC0_SEL]); -+ if (cpuid) { -+ lgdt(&kqemu_r_newgdt); -+ wrmsr(MSR_GSBASE, (u_int64_t)&__pcpu[cpuid]); -+ wrmsr(MSR_KGSBASE, curthread->td_pcb->pcb_gsbase); -+ wrmsr(MSR_FSBASE, curthread->td_pcb->pcb_fsbase); -+ } -+ ltr(gsel_tss); -+} -+#endif -+ - struct kqemu_instance { - #if __FreeBSD_version >= 500000 - TAILQ_ENTRY(kqemu_instance) kqemu_ent; -Index: common/kernel.c -@@ -1025,6 +1025,9 @@ - #ifdef __x86_64__ - uint16_t saved_ds, saved_es; - unsigned long fs_base, gs_base; -+#ifdef __FreeBSD__ -+ struct kqemu_global_state *g = s->global_state; -+#endif - #endif - - #ifdef PROFILE -@@ -1188,6 +1191,13 @@ - apic_restore_nmi(s, apic_nmi_mask); - } - profile_record(s); -+#ifdef __FreeBSD__ -+#ifdef __x86_64__ -+ spin_lock(&g->lock); -+ kqemu_tss_fixup(s->kernel_gdt.base); -+ spin_unlock(&g->lock); -+#endif -+#endif - - if (s->mon_req == MON_REQ_IRQ) { - struct kqemu_exception_regs *r; -Index: kqemu-kernel.h -@@ -48,4 +48,10 @@ - - void CDECL kqemu_log(const char *fmt, ...); - -+#ifdef __FreeBSD__ -+#ifdef __x86_64__ -+void CDECL kqemu_tss_fixup(unsigned long kerngdtbase); -+#endif -+#endif -+ - #endif /* KQEMU_KERNEL_H */ diff --git a/emulators/kqemu-kmod-devel/pkg-descr b/emulators/kqemu-kmod-devel/pkg-descr deleted file mode 100644 index 2ca45618fce4..000000000000 --- a/emulators/kqemu-kmod-devel/pkg-descr +++ /dev/null @@ -1,3 +0,0 @@ -KQEMU is a qemu accelerator kernel module on x86/amd64. - -WWW: http://fabrice.bellard.free.fr/qemu/ diff --git a/emulators/kqemu-kmod-devel/pkg-message b/emulators/kqemu-kmod-devel/pkg-message deleted file mode 100644 index 6861b01d82fc..000000000000 --- a/emulators/kqemu-kmod-devel/pkg-message +++ /dev/null @@ -1,7 +0,0 @@ -==== -Notice: -If you installed this from a package and your kernel configuration -differs from the one on the package build machine (or your kernel source -is newer than the package), then the kld may not work, or even panic. -Consider building it from ports in that case. -==== |