diff options
author | Marius Strobl <marius@FreeBSD.org> | 2009-03-18 22:57:55 +0000 |
---|---|---|
committer | Marius Strobl <marius@FreeBSD.org> | 2009-03-18 22:57:55 +0000 |
commit | 84a441eba349200b35d91b62a35a5a2f9d1d91da (patch) | |
tree | 18e8f6f31113a364ae53b4e5bf0f5bae7f79c7ad | |
parent | 53d73bb6398770aa6ea49bdbdff02e9bcc821a31 (diff) |
Notes
-rw-r--r-- | sys/dev/mpt/mpt.h | 19 | ||||
-rw-r--r-- | sys/dev/mpt/mpt_cam.c | 7 | ||||
-rw-r--r-- | sys/dev/mpt/mpt_raid.c | 2 |
3 files changed, 23 insertions, 5 deletions
diff --git a/sys/dev/mpt/mpt.h b/sys/dev/mpt/mpt.h index 089f05ef05e6..56a023942b94 100644 --- a/sys/dev/mpt/mpt.h +++ b/sys/dev/mpt/mpt.h @@ -270,13 +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) +#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) +#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 7a67fbc34ea4..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); - kthread_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 9128424f6ca5..cde0fec0b654 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); - kthread_exit(0); + mpt_kthread_exit(0); } #if 0 |