Add highbit func,

Add sloopy atomic declaration which will need to be fixed (eventually)
Fill out more of the Solaris VM hooks
Adjust the create_thread function



git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@26 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
This commit is contained in:
behlendo
2008-03-06 23:12:55 +00:00
parent a713518f5d
commit 77b1fe8fa8
7 changed files with 88 additions and 12 deletions
+31
View File
@@ -8,6 +8,37 @@
int p0 = 0;
EXPORT_SYMBOL(p0);
int
highbit(unsigned long i)
{
register int h = 1;
if (i == 0)
return (0);
#if BITS_PER_LONG == 64
if (i & 0xffffffff00000000ul) {
h += 32; i >>= 32;
}
#endif
if (i & 0xffff0000) {
h += 16; i >>= 16;
}
if (i & 0xff00) {
h += 8; i >>= 8;
}
if (i & 0xf0) {
h += 4; i >>= 4;
}
if (i & 0xc) {
h += 2; i >>= 2;
}
if (i & 0x2) {
h += 1;
}
return (h);
}
EXPORT_SYMBOL(highbit);
static int __init spl_init(void)
{
printk(KERN_INFO "spl: Loaded Solaris Porting Layer v%s\n", VERSION);
+1 -1
View File
@@ -60,7 +60,7 @@ EXPORT_SYMBOL(__thread_exit);
* style callers likely never check for... since it can't fail. */
kthread_t *
__thread_create(caddr_t stk, size_t stksize, void (*proc)(void *),
void *args, size_t len, proc_t *pp, int state, pri_t pri)
void *args, size_t len, int *pp, int state, pri_t pri)
{
thread_priv_t tp;
DEFINE_WAIT(wait);
+1 -1
View File
@@ -51,7 +51,7 @@ splat_thread_test1(struct file *file, void *arg)
spin_lock(&tp.tp_lock);
thr = (kthread_t *)thread_create(NULL, 0, splat_thread_work, &tp, 0,
(proc_t *) &p0, TS_RUN, minclsyspri);
&p0, TS_RUN, minclsyspri);
/* Must never fail under Solaris, but we check anyway so we can
* report an error when this impossible thing happens */
if (thr == NULL) {