3
3
use crate :: error:: { Error , Result } ;
4
4
use crate :: time;
5
5
use crate :: { declare_per_core, get_per_core, get_per_core_mut} ;
6
+ use num_enum:: TryFromPrimitive ;
6
7
use raw_cpuid:: CpuId ;
7
8
use x86:: msr;
8
9
@@ -17,21 +18,21 @@ const IA32_APIC_BASE_EXD: u64 = 1 << 10;
17
18
/// BSP mask
18
19
const IA32_APIC_BASE_BSP : u64 = 1 << 8 ;
19
20
20
- #[ derive( Debug ) ]
21
+ #[ derive( Debug , TryFromPrimitive ) ]
21
22
#[ repr( u8 ) ]
22
23
/// ICR destination shorthand values
23
24
pub enum DstShorthand {
24
25
/// No shorthand used
25
26
NoShorthand = 0x00 ,
26
- // TODO(dlrobertson): Is there any reason to include self? AFAIK
27
- // SELF_IPI negates the need for it.
27
+ /// Send only to myself
28
+ MySelf = 0x01 ,
28
29
/// Broadcast including myself
29
30
AllIncludingSelf = 0x02 ,
30
31
/// Broadcast excluding myself
31
32
AllExcludingSelf = 0x03 ,
32
33
}
33
34
34
- #[ derive( Debug ) ]
35
+ #[ derive( Debug , TryFromPrimitive ) ]
35
36
#[ repr( u8 ) ]
36
37
/// INIT IPI Level
37
38
pub enum Level {
@@ -41,7 +42,7 @@ pub enum Level {
41
42
Assert = 0x01 ,
42
43
}
43
44
44
- #[ derive( Debug ) ]
45
+ #[ derive( Debug , TryFromPrimitive ) ]
45
46
#[ repr( u8 ) ]
46
47
/// ICR trigger modes
47
48
pub enum TriggerMode {
@@ -51,7 +52,7 @@ pub enum TriggerMode {
51
52
Level = 0x01 ,
52
53
}
53
54
54
- #[ derive( Debug ) ]
55
+ #[ derive( Debug , TryFromPrimitive ) ]
55
56
#[ repr( u8 ) ]
56
57
/// ICR mode of the Destination field
57
58
pub enum DstMode {
@@ -61,7 +62,7 @@ pub enum DstMode {
61
62
Logical = 0x01 ,
62
63
}
63
64
64
- #[ derive( Debug ) ]
65
+ #[ derive( Debug , TryFromPrimitive ) ]
65
66
#[ repr( u8 ) ]
66
67
/// ICR delivery mode
67
68
pub enum DeliveryMode {
0 commit comments