I didn’t write this patch, but it’s been forwarded to me and my understanding is that a Fusion-io customer wrote this a while back.
VSL (the software driver for Fusion-io cards) can be recompiled (all the real IP is pre-compiled in an included library), allowing VSL to be recompiled for variations in a given operating system. These small patches are necessary to get VSL for FreeBSD 9 to work on FreeBSD 10.
NOTE: THIS IS CURRENTLY BROKEN – I WILL FIX IT IF I CAN FIND THE RIGHT CODE
--- cdev.c.orig 2013-03-28 09:37:05.000000000 -0400
+++ cdev.c 2013-03-28 09:41:29.000000000 -0400
@@ -63,7 +63,7 @@
pdev = fusion_nand_get_softc(nand_dev);
pdev->cdev = make_dev(&fusion_ctl_ops, pdev->unit,
- UID_ROOT, GID_OPERATOR, 0660, fusion_nand_get_dev_name(nand_dev));
+ UID_ROOT, GID_OPERATOR, 0660, "%s",
+ fusion_nand_get_dev_name(nand_dev));
if (NULL == pdev->cdev)
{
--- kfio.c.orig 2013-03-28 09:42:44.000000000 -0400
+++ kfio.c 2013-03-28 10:16:36.000000000 -0400
@@ -540,7 +540,7 @@
{
struct mtx m = (struct mtx )lock;
- return _mtx_trylock(m, 0, file, line) ? 1 : 0;
+ return _mtx_trylock_flags_((volatile uintptr_t *)m, 0, file, line)
+ ? 1 : 0;
}
void _fusion_spin_unlock(fusion_spinlock_t lock, const char file, int line) @@ -573,7 +573,7 @@ {
struct sx s = (struct sx )lock;
- return _sx_try_xlock(s, file, line) ? 1 : 0;
+ return sx_try_xlock_(s, file, line) ? 1 : 0;
}
void _fusion_mutex_lock(fusion_mutex_t lock, const char file, int line) @@ -742,7 +742,7 @@
params->func = func;
params->args = data;
- kthread_create(fusion_kthread_wrapper, params, NULL, 0, 0, sbuf_data(s));
+ kthread_create(fusion_kthread_wrapper, params, NULL, 0, 0, "%s",
+ sbuf_data(s));
sbuf_delete(s);
}
Did you ever manage to figure this out? I’ve got several of these cards that it would be nice to use again.
Sorry for taking so much time to respond.
I haven’t taken the time to fix the patch. I might work on it next week.
I’m willing to throw 50 bucks so you can buy something for yourself