[Linux-hls-cvs] hls/linux-2.6 bottom.c,1.3,1.4 hls_ctl.c,1.2,1.3 init.c,1.3,1.4
Status: Pre-Alpha
Brought to you by:
lucabe
|
From: Luca A. <lu...@us...> - 2005-01-22 12:06:36
|
Update of /cvsroot/linux-hls/hls/linux-2.6 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4892/linux-2.6 Modified Files: bottom.c hls_ctl.c init.c Log Message: 2.6 backend update... Still doesn't work, but it looks better ;-) Index: init.c =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/init.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** init.c 2 Nov 2004 07:39:29 -0000 1.3 --- init.c 22 Jan 2005 12:06:24 -0000 1.4 *************** *** 88,97 **** do_each_thread(dummy, t) { #ifdef __FP_DEAMONS__ ! if (t->tty == NULL) { #ifdef VERBOSE hls_printk("Giving T%d the highest priority\n", t->pid); #endif t->policy = SCHED_FIFO; t->rt_priority = HLS_SCHEDULING_PRIORITY + 1; t->private_data = NULL; } else { --- 88,101 ---- do_each_thread(dummy, t) { #ifdef __FP_DEAMONS__ ! if (t->signal->tty == NULL) { #ifdef VERBOSE hls_printk("Giving T%d the highest priority\n", t->pid); #endif + #if 0 t->policy = SCHED_FIFO; t->rt_priority = HLS_SCHEDULING_PRIORITY + 1; + #else + gensched_dispatch(t, GENSCHED_ENABLE); + #endif t->private_data = NULL; } else { Index: bottom.c =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/bottom.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bottom.c 2 Nov 2004 07:39:29 -0000 1.3 --- bottom.c 22 Jan 2005 12:06:24 -0000 1.4 *************** *** 76,83 **** --- 76,85 ---- if (t != NULL) { sched_non_running = (t->state != TASK_RUNNING); + #if 0 /* Inactive tasks are SCHED_NORMAL! */ if(t->policy != SCHED_FIFO) { printk("HLS ERROR: Scheduling an HLS task with policy != SCHED_FIFO...\n"); hls_printk("HLS ERROR: Scheduling an HLS task with policy != SCHED_FIFO...\n"); } + #endif /* Yes... Schedule it. * The linux dispatcher will do the dirty work for us... Index: hls_ctl.c =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/hls_ctl.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** hls_ctl.c 9 Oct 2004 10:26:56 -0000 1.2 --- hls_ctl.c 22 Jan 2005 12:06:24 -0000 1.3 *************** *** 210,223 **** /* We have to move to the new scheduler... */ ! #ifdef HLS_DEBUG ! hls_printk("hls_ctl: Moving to %s\n", target_sched->Name); ! #endif state = hls_thread_move(t, target_sched); if (state < 0) { return -EINVAL; } ! #ifdef HLS_DEBUG ! hls_printk(" ...and setting the parameters (Priority %d)!\n", hls_priority); ! #endif status = hls_setparam(th->vp, s_p, hls_priority); if (status == HLS_SUCCESS) { --- 210,219 ---- /* We have to move to the new scheduler... */ ! HLSDbgPrint (9, ("hls_ctl: Moving to %s\n", target_sched->Name)); state = hls_thread_move(t, target_sched); if (state < 0) { return -EINVAL; } ! HLSDbgPrint (9, (" ...and setting the parameters (Priority %d)!\n", hls_priority)); status = hls_setparam(th->vp, s_p, hls_priority); if (status == HLS_SUCCESS) { *************** *** 302,306 **** return -EFAULT; } - printk("Parse priority: %d\n", sched_p.sp.sched_priority); return sched_p.sp.sched_priority; --- 298,301 ---- *************** *** 335,339 **** int return_to_linux; - spin_lock_irqsave(&hls_lock, flags); p = find_process_by_pid(pid); if (p == NULL) { --- 330,333 ---- *************** *** 350,353 **** --- 344,348 ---- priority = HLS_DEFAULT_PRIORITY; #else + spin_lock_irqsave(&hls_lock, flags); HLSExitThreadHook(p); p->policy = SCHED_NORMAL; *************** *** 356,359 **** --- 351,355 ---- * No need to set s & sched_param */ + spin_unlock_irqrestore(&hls_lock, flags); return_to_linux = 1; #endif *************** *** 364,372 **** */ #ifdef NOLINUX_TASKS ! p->policy = SCHED_FIFO; p->rt_priority = HLS_IDLE_PRIORITY; HLSCreateThreadHook(p, p->state); #else ! printk("Policy %d != SCHED_HLS. Doing nothing... (already non-hls)\n", policy); #endif /* We do not need to call hls_ctl... --- 360,374 ---- */ #ifdef NOLINUX_TASKS ! spin_lock_irqsave(&hls_lock, flags); ! #if 0 ! p->policy = SCHED_FIFO; p->rt_priority = HLS_IDLE_PRIORITY; + #else + gensched_dispatch(p, GENSCHED_DISABLE); + #endif HLSCreateThreadHook(p, p->state); + spin_unlock_irqrestore(&hls_lock, flags); #else ! HLSDbgPrint (9, ("Policy %d != SCHED_HLS. Doing nothing... (already non-hls)\n", policy)); #endif /* We do not need to call hls_ctl... *************** *** 377,384 **** --- 379,392 ---- } else { if (p->private_data == NULL) { + spin_lock_irqsave(&hls_lock, flags); /* Transform in HLS */ + #if 0 p->policy = SCHED_FIFO; p->rt_priority = HLS_IDLE_PRIORITY; + #else + gensched_dispatch(p, GENSCHED_DISABLE); + #endif HLSCreateThreadHook(p, p->state); + spin_unlock_irqrestore(&hls_lock, flags); } /* Change scheduler to rt_sched */ *************** *** 394,399 **** if (return_to_linux >= 0) { - spin_unlock_irqrestore(&hls_lock, flags); - return return_to_linux; } --- 402,405 ---- *************** *** 402,407 **** sched_param = sp; if (priority < 0) { - spin_unlock_irqrestore(&hls_lock, flags); - return priority; } --- 408,411 ---- *************** *** 411,424 **** printk("HLS Error: %d has private_data = NULL???\n", p->pid); #ifdef NOLINUX_TASKS - spin_unlock_irqrestore(&hls_lock, flags); - return -EINVAL; #else p->policy = SCHED_FIFO; p->rt_priority = HLS_IDLE_PRIORITY; HLSCreateThreadHook(p, p->state); #endif } res = hls_ctl(p, s, sched_param, priority); --- 415,433 ---- printk("HLS Error: %d has private_data = NULL???\n", p->pid); #ifdef NOLINUX_TASKS return -EINVAL; #else + spin_lock_irqsave(&hls_lock, flags); + #if 0 p->policy = SCHED_FIFO; p->rt_priority = HLS_IDLE_PRIORITY; + #else + gensched_dispatch(p, GENSCHED_DISABLE); + #endif HLSCreateThreadHook(p, p->state); + spin_unlock_irqrestore(&hls_lock, flags); #endif } + spin_lock_irqsave(&hls_lock, flags); res = hls_ctl(p, s, sched_param, priority); |