From: Brian Behlendorf Date: Fri, 29 Jun 2012 18:54:52 +0000 (-0700) Subject: PowerPC Compatibility X-Git-Tag: spl-0.6.0-rc10~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44e406d712bedc893e053ab3a7db8ff8a8be0790;p=spl PowerPC Compatibility Usage of get_current() is not supported across all architectures. The correct interface to use is the '#define current' which will map to the appropriate function, usually current_thread_info(). Signed-off-by: Brian Behlendorf Closes #119 --- diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index 97257e0..04a62b1 100644 --- a/include/sys/sysmacros.h +++ b/include/sys/sysmacros.h @@ -71,7 +71,7 @@ #define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ #define proc_pageout NULL -#define curproc get_current() +#define curproc current #define max_ncpus num_possible_cpus() #define CPU_SEQID smp_processor_id() #define _NOTE(x) diff --git a/include/sys/thread.h b/include/sys/thread.h index c5f4234..3a70823 100644 --- a/include/sys/thread.h +++ b/include/sys/thread.h @@ -50,7 +50,7 @@ typedef void (*thread_func_t)(void *); #func, arg, len, pp, state, pri) #define thread_exit() __thread_exit() #define thread_join(t) VERIFY(0) -#define curthread get_current() +#define curthread current extern kthread_t *__thread_create(caddr_t stk, size_t stksize, thread_func_t func, const char *name, diff --git a/module/spl/spl-thread.c b/module/spl/spl-thread.c index b1aa811..9f6e223 100644 --- a/module/spl/spl-thread.c +++ b/module/spl/spl-thread.c @@ -60,7 +60,7 @@ thread_generic_wrapper(void *arg) func = tp->tp_func; args = tp->tp_args; set_current_state(tp->tp_state); - set_user_nice((kthread_t *)get_current(), PRIO_TO_NICE(tp->tp_pri)); + set_user_nice((kthread_t *)current, PRIO_TO_NICE(tp->tp_pri)); kmem_free(tp->tp_name, tp->tp_name_size); kmem_free(tp, sizeof(thread_priv_t));