From 5e9e0b62959399d70b7f8077122dd80408fc05c5 Mon Sep 17 00:00:00 2001 From: Hiroki Sato Date: Sun, 17 Jul 2011 22:04:26 +0000 Subject: Fix build on 7.x. Reported by: pav --- multimedia/ptx-kmod/Makefile | 4 ---- multimedia/ptx-kmod/files/patch-dev-ptx-ptx.h | 14 +++++++++++ multimedia/ptx-kmod/files/patch-dev-ptx-ptx_proc.c | 28 ++++++++++++++++++++++ 3 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 multimedia/ptx-kmod/files/patch-dev-ptx-ptx.h create mode 100644 multimedia/ptx-kmod/files/patch-dev-ptx-ptx_proc.c (limited to 'multimedia') diff --git a/multimedia/ptx-kmod/Makefile b/multimedia/ptx-kmod/Makefile index 30e8b3cc3a40..02fe442fa38c 100644 --- a/multimedia/ptx-kmod/Makefile +++ b/multimedia/ptx-kmod/Makefile @@ -41,10 +41,6 @@ _KERNCONF?=$K IGNORE= requires kernel source to be installed .endif -.if ${OSVERSION} < 800000 -BROKEN= does not compile on FreeBSD 7.X -.endif - do-install: @${MKDIR} ${PREFIX}/${KMODDIR} ${INSTALL_KLD} ${BUILD_WRKSRC}/ptx.ko ${PREFIX}/${KMODDIR} diff --git a/multimedia/ptx-kmod/files/patch-dev-ptx-ptx.h b/multimedia/ptx-kmod/files/patch-dev-ptx-ptx.h new file mode 100644 index 000000000000..55e682ec04c8 --- /dev/null +++ b/multimedia/ptx-kmod/files/patch-dev-ptx-ptx.h @@ -0,0 +1,14 @@ +--- dev/ptx/ptx.h.orig 2011-07-18 06:50:50.000000000 +0900 ++++ dev/ptx/ptx.h 2011-07-18 06:51:26.000000000 +0900 +@@ -218,7 +218,11 @@ + struct cdev *dev[MAX_STREAM]; + struct ptx_stream stream[MAX_STREAM]; + ++#if (__FreeBSD_version < 800000) ++ struct proc *ptxdaemon; ++#else + struct thread *ptxdaemon; ++#endif + int ring_pos; + int data_pos; + diff --git a/multimedia/ptx-kmod/files/patch-dev-ptx-ptx_proc.c b/multimedia/ptx-kmod/files/patch-dev-ptx-ptx_proc.c new file mode 100644 index 000000000000..e25056cab5d1 --- /dev/null +++ b/multimedia/ptx-kmod/files/patch-dev-ptx-ptx_proc.c @@ -0,0 +1,28 @@ +--- dev/ptx/ptx_proc.c.orig 2011-07-18 06:48:32.000000000 +0900 ++++ dev/ptx/ptx_proc.c 2011-07-18 06:53:27.000000000 +0900 +@@ -23,8 +23,13 @@ + int + ptx_proc_start(struct ptx_softc *scp) + { ++#if (__FreeBSD_version < 800000) ++ int err = kthread_create(ptx_daemon, scp, &scp->ptxdaemon, ++ RFTHREAD, 0, "ptxdaemon"); ++#else + int err = kthread_add(ptx_daemon, scp, NULL, + &scp->ptxdaemon, RFTHREAD, 0, "ptxdaemon"); ++#endif + if (err) { + device_printf(scp->device, "ptx_proc_start: kthread_add retured %d\n", err); + return ENXIO; +@@ -81,7 +86,11 @@ + ptx_pause("ptxdmn", MSTOTICK(1)); + } + ++#if (__FreeBSD_version < 800000) ++ kthread_exit(0); ++#else + kthread_exit(); ++#endif + } + + static void -- cgit v1.2.3