diff --git a/sys/dev/mpt/mpt.h b/sys/dev/mpt/mpt.h index b3f7d61a526f..c0b0571f0015 100644 --- a/sys/dev/mpt/mpt.h +++ b/sys/dev/mpt/mpt.h @@ -270,18 +270,30 @@ void mpt_map_rquest(void *, bus_dma_segment_t *, int, int); #define mpt_setup_intr bus_setup_intr #endif +/* **************************** NewBUS CAM Support ****************************/ +#if __FreeBSD_version < 700049 +#define mpt_xpt_bus_register(sim, parent, bus) \ + xpt_bus_register(sim, bus) +#else +#define mpt_xpt_bus_register xpt_bus_register +#endif + /**************************** Kernel Thread Support ***************************/ -#if __FreeBSD_version > 500005 #if __FreeBSD_version > 800001 #define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ kproc_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#else +#define mpt_kthread_exit(status) \ + kproc_exit(status) +#elif __FreeBSD_version > 500005 #define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) -#endif +#define mpt_kthread_exit(status) \ + kthread_exit(status) #else #define mpt_kthread_create(func, farg, proc_ptr, flags, stackpgs, fmtstr, arg) \ kthread_create(func, farg, proc_ptr, fmtstr, arg) +#define mpt_kthread_exit(status) \ + kthread_exit(status) #endif /****************************** Timer Facilities ******************************/ diff --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c index 1e72afbd6ade..eab2083ebc7f 100644 --- a/sys/dev/mpt/mpt_cam.c +++ b/sys/dev/mpt/mpt_cam.c @@ -346,7 +346,7 @@ mpt_cam_attach(struct mpt_softc *mpt) * Register exactly this bus. */ MPT_LOCK(mpt); - if (xpt_bus_register(mpt->sim, mpt->dev, 0) != CAM_SUCCESS) { + if (mpt_xpt_bus_register(mpt->sim, mpt->dev, 0) != CAM_SUCCESS) { mpt_prt(mpt, "Bus registration Failed!\n"); error = ENOMEM; MPT_UNLOCK(mpt); @@ -385,7 +385,8 @@ mpt_cam_attach(struct mpt_softc *mpt) * Register this bus. */ MPT_LOCK(mpt); - if (xpt_bus_register(mpt->phydisk_sim, mpt->dev, 1) != CAM_SUCCESS) { + if (mpt_xpt_bus_register(mpt->phydisk_sim, mpt->dev, 1) != + CAM_SUCCESS) { mpt_prt(mpt, "Physical Disk Bus registration Failed!\n"); error = ENOMEM; MPT_UNLOCK(mpt); @@ -3988,7 +3989,7 @@ mpt_recovery_thread(void *arg) mpt->recovery_thread = NULL; wakeup(&mpt->recovery_thread); MPT_UNLOCK(mpt); - kproc_exit(0); + mpt_kthread_exit(0); } static int diff --git a/sys/dev/mpt/mpt_raid.c b/sys/dev/mpt/mpt_raid.c index ab8512261ecd..2b7c129064ef 100644 --- a/sys/dev/mpt/mpt_raid.c +++ b/sys/dev/mpt/mpt_raid.c @@ -722,7 +722,7 @@ mpt_raid_thread(void *arg) mpt->raid_thread = NULL; wakeup(&mpt->raid_thread); MPT_UNLOCK(mpt); - kproc_exit(0); + mpt_kthread_exit(0); } #if 0