lkml.org 
[lkml]   [1997]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: cli() and sti()
Date
On Sun, 2 Mar 1997 20:46:55 +0800 (GMT+0800), 
Duan Zhenhai <ccdzh@shoukui.pku.edu.cn> wrote:
>Hello,
> I read some code that like:
>
> save_flags(..);
> cli();
> .............
> restore_flags(..);
>
> and did not find they use sti.

Restore_flags puts the cpu flags back to what was were saved before
cli(). This includes resetting the interrupt flag to whatever it was
before cli() was issued. In some cases sti() is not safe because IF
may already be masked, safer to save the current state then restore it
instead of assuming IF was already 1.



\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.025 / U:0.980 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site