X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fpalacios-stubs.c;h=21aa4fdf0bc3ba8ab096a2295b1805518f7def38;hb=83942e281e4e17d6eb296d343094578dc50b3b0b;hp=26ada0beec55c5389f728f07b1565934844ae196;hpb=c58da27ff29c9cd0511c7c3f64eff2644fa85961;p=palacios.git diff --git a/linux_module/palacios-stubs.c b/linux_module/palacios-stubs.c index 26ada0b..21aa4fd 100644 --- a/linux_module/palacios-stubs.c +++ b/linux_module/palacios-stubs.c @@ -155,12 +155,11 @@ palacios_xcall( struct lnx_thread_arg { int (*fn)(void * arg); void * arg; - char * name; }; static int lnx_thread_target(void * arg) { struct lnx_thread_arg * thread_info = (struct lnx_thread_arg *)arg; - + int ret = 0; /* printk("Daemonizing new Palacios thread (name=%s)\n", thread_info->name); @@ -169,18 +168,20 @@ static int lnx_thread_target(void * arg) { */ - thread_info->fn(thread_info->arg); + ret = thread_info->fn(thread_info->arg); kfree(thread_info); // handle cleanup + + do_exit(ret); - return 0; + return 0; // should not get here. } /** * Creates a kernel thread. */ -static void +static void * palacios_start_kernel_thread( int (*fn) (void * arg), void * arg, @@ -190,10 +191,8 @@ palacios_start_kernel_thread( thread_info->fn = fn; thread_info->arg = arg; - thread_info->name = thread_name; - kthread_run( lnx_thread_target, thread_info, thread_name ); - return; + return kthread_run( lnx_thread_target, thread_info, thread_name ); } @@ -210,7 +209,6 @@ palacios_start_thread_on_cpu(int cpu_id, thread_info->fn = fn; thread_info->arg = arg; - thread_info->name = thread_name; thread = kthread_create( lnx_thread_target, thread_info, thread_name ); @@ -220,7 +218,7 @@ palacios_start_thread_on_cpu(int cpu_id, return NULL; } - kthread_bind(thread, cpu_id); + set_cpus_allowed_ptr(thread, cpumask_of(cpu_id)); wake_up_process(thread); return thread;