On Saturday 03 July 2004 19:32, prasanna wakhare wrote: > hi, > interrupt comes to do any work its not at all > concerned with current process executing,it might be > the case that interrupt in interrupting other low But I think this case doesn't changes the kernel stack or %esp because the CPL matches the DPL,that means the current task_struct address can still be got through the "current" macro by manipulating %esp value. > priority interrupt,so current pointer is not valid > here, > in case of timer handler its work is to see that > timeslice of current process expired or exhausted if > it is then invoke the scheduler to schedule next one I think that the scheduler is called when on the interrupt return path rather than by the handler itself. > so it invokes with this specific task in mind, > I think in LDD author meant that one cant do any work > in interrupt concerning some specific process in mind > beleiving some process always running if interrupt > comes or anything like that. > correct me if i'm wrong > Prasanna Maybe, I should interpret those words like this: Because the scheduler is called at the interrupt return path, so we cannot guarantee that after "this" interrupt returns the current context is the context when the interrupt occures.But that doesn't matter much to the timer handler because it's already had this case in mind. Again, correct if wrong. > > --- Xia Nai <naixia@hotmail.com> wrote: > > hi,all > > In LDD2 Chapter6 "Flow of Time", it says "When > > running in interrupt mode" code > > is subject to a number of constraints, one of which > > is "The current pointer > > is not valid in interrupt mode, and cannot be used". > > > > But in the timer interrupt handler > > do_timer()-->update_process_times(), the > > "current" is explicitly referenced. > > > > Anyone explains this ? > > > > -- > > Kernelnewbies: Help each other learn about the Linux > > kernel. > > Archive: > > http://mail.nl.linux.org/kernelnewbies/ > > FAQ: http://kernelnewbies.org/faq/ > > > > > > > > > __________________________________ > Do you Yahoo!? > Yahoo! Mail - Helps protect you from nasty viruses. > http://promotions.yahoo.com/new_mail > > -- > Kernelnewbies: Help each other learn about the Linux kernel. > Archive: http://mail.nl.linux.org/kernelnewbies/ > FAQ: http://kernelnewbies.org/faq/ > > > -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/