Linux ARM, does schedule() jumps to user space ?

Mj Embd mj.embd at gmail.com
Fri Jan 3 07:50:56 EST 2014


On Fri, Jan 3, 2014 at 4:35 PM, Miles MH Chen <orca.chen at gmail.com> wrote:
> Hi MJ,
>
> The switch_to(prev, next) function stores the registers of task "prev" to
> its kernel stack, than restores registers
> of task "next" from its kernel stack than resumes task "next" in kernel
> mode.
How is the switch_to() function called from schedule ?
or what is the umberella function which calls switch_to

What is the flow in which schedule and switch_to is called

> If the selected task is a user process, it just takes the "return to user"
> path to user space.
>
> Regards,
> MH
>
>
> On Fri, Jan 3, 2014 at 6:31 PM, Mj Embd <mj.embd at gmail.com> wrote:
>>
>> Hi,
>>
>> A very basic question.
>> AFAIK schedule() selects the next process to run.
>> Now once it has selected the process, and say if the process is a user
>> space or kernel space one. how does the switch to user happens,
>>
>> a) Is it in schedule function . it has to be a arch level function
>> called from schedule()
>>
>> b) or Else where, so is there a umberlla function like
>>
>> somefunc()
>> {
>> task_ptr = schedule();
>> switch_to(task_ptr)
>>
>> ...
>>
>> }
>>
>> Can someone explain this
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>



-- 
-mj



More information about the Kernelnewbies mailing list