DEEPAK PRABHU wrote:

A snippet from schedulers/rtl_sched.c shows you how to mark a critical
region.


int rtl_task_init(RT_TASK *task, void (*fn)(int), int data, int
stack_size, 
                        int priority,int fp) 
{
        int *st;
        long interrupt_state;

        if (task->magic == RT_TASK_MAGIC) {
                return -EINVAL;
        }

        st = (int *) kmalloc(stack_size, GFP_KERNEL);
        if (!st) {
                return -ENOMEM;
        }

        task->priority = priority; 
        task->magic = RT_TASK_MAGIC; 
        task->state = RT_TASK_DORMANT; 
        task->stack_bottom = st;
        task->stack = st + stack_size / sizeof(int);
        if(fp){
                rtl_fpu_task_init(task,rtl_current);
                }
        else task->uses_fp = 0;
        x86_init_stack(task,data,rt_startup);
--->        rtl_no_interrupts(interrupt_state);
        task->next = rt_tasks;
        rt_tasks = task;
--->        rtl_restore_interrupts(interrupt_state);
        return 0;

}


Hope this helps
Regards, Phil Wilshire

> 
> Hello
> 
>    We are in need of marking critical regions in drivers running under
> rtlinux and would like to know advice from anybody who has worked on
> this.
> 
> Deepak
> 
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
> --- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> ----
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/~rtlinux/
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/

Reply via email to