File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -103,12 +103,12 @@ where
103103/// x86_64::instructions::hlt(); // wait for the next interrupt
104104/// }
105105///
106- /// // avoid this race by using `enable_interrupts_and_hlt `:
106+ /// // avoid this race by using `enable_and_hlt `:
107107///
108108/// x86_64::instructions::interrupts::disable();
109109/// if nothing_to_do() {
110110/// // <- no interrupts can occur here (interrupts are disabled)
111- /// x86_64::instructions::interrupts::enable_interrupts_and_hlt ();
111+ /// x86_64::instructions::interrupts::enable_and_hlt ();
112112/// }
113113///
114114/// ```
@@ -128,7 +128,7 @@ where
128128/// See <http://lkml.iu.edu/hypermail/linux/kernel/1009.2/01406.html> for more
129129/// information.
130130#[ inline]
131- pub fn enable_interrupts_and_hlt ( ) {
131+ pub fn enable_and_hlt ( ) {
132132 #[ cfg( feature = "inline_asm" ) ]
133133 unsafe {
134134 asm ! ( "sti; hlt" , options( nomem, nostack) ) ;
@@ -139,6 +139,13 @@ pub fn enable_interrupts_and_hlt() {
139139 }
140140}
141141
142+ /// Alias for [`enable_and_hlt`][enable_and_hlt] for backwards compatibility.
143+ #[ inline]
144+ #[ deprecated( note = "Use enable_and_hlt instead" ) ]
145+ pub fn enable_interrupts_and_hlt ( ) {
146+ enable_and_hlt ( ) ;
147+ }
148+
142149/// Cause a breakpoint exception by invoking the `int3` instruction.
143150#[ inline]
144151pub fn int3 ( ) {
You can’t perform that action at this time.
0 commit comments