File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2020 Stefan Lankes, RWTH Aachen University
2
+ //
3
+ // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
4
+ // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5
+ // http://opensource.org/licenses/MIT>, at your option. This file may not be
6
+ // copied, modified, or distributed except according to those terms.
7
+
8
+ use crate :: arch:: irq:: * ;
9
+
10
+ /// `irqsave` guarantees that the call of the closure
11
+ /// will be not disturbed by an interrupt
12
+ #[ inline]
13
+ pub fn irqsave < F , R > ( f : F ) -> R
14
+ where
15
+ F : FnOnce ( ) -> R ,
16
+ {
17
+ let irq = irq_nested_disable ( ) ;
18
+ let ret = f ( ) ;
19
+ irq_nested_enable ( irq) ;
20
+ ret
21
+ }
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ pub mod macros;
29
29
#[ macro_use]
30
30
pub mod logging;
31
31
pub mod arch;
32
+ pub mod collections;
32
33
pub mod console;
33
34
pub mod consts;
34
35
pub mod errno;
You can’t perform that action at this time.
0 commit comments