diff --git a/sys/cddl/compat/opensolaris/sys/mutex.h b/sys/cddl/compat/opensolaris/sys/mutex.h index 8756cd0534f4..f6858a7b161d 100644 --- a/sys/cddl/compat/opensolaris/sys/mutex.h +++ b/sys/cddl/compat/opensolaris/sys/mutex.h @@ -32,9 +32,9 @@ #ifdef _KERNEL #include -#include #include #include_next +#include #include typedef enum { diff --git a/sys/cddl/compat/opensolaris/sys/proc.h b/sys/cddl/compat/opensolaris/sys/proc.h index 73fbcdadf1d2..dfacebc45e28 100644 --- a/sys/cddl/compat/opensolaris/sys/proc.h +++ b/sys/cddl/compat/opensolaris/sys/proc.h @@ -34,13 +34,16 @@ #include_next #include #include +#include +#include +#include #include #ifdef _KERNEL #define CPU curcpu -#define minclsyspri 0 -#define maxclsyspri 0 +#define minclsyspri PRIBIO +#define maxclsyspri PVM #define max_ncpus mp_ncpus #define boot_max_ncpus mp_ncpus @@ -58,6 +61,7 @@ static __inline kthread_t * thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, size_t len, proc_t *pp, int state, pri_t pri) { + kthread_t *td; proc_t *p; int error; @@ -70,7 +74,15 @@ thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, error = kproc_create(proc, arg, &p, 0, stksize / PAGE_SIZE, "solthread %p", proc); - return (error == 0 ? FIRST_THREAD_IN_PROC(p) : NULL); + if (error != 0) + td = NULL; + else { + td = FIRST_THREAD_IN_PROC(p); + thread_lock(td); + sched_prio(td, pri); + thread_unlock(td); + } + return (td); } #define thread_exit() kproc_exit(0)