@@ -51,6 +51,14 @@ bitflags! {
5151 }
5252}
5353
54+ impl Cr0Flags {
55+ #[ deprecated = "use the safe `from_bits_retain` method instead" ]
56+ /// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
57+ pub unsafe fn from_bits_unchecked ( bits : u64 ) -> Self {
58+ Self :: from_bits_retain ( bits)
59+ }
60+ }
61+
5462/// Contains the Page Fault Linear Address (PFLA).
5563///
5664/// When a page fault occurs, the CPU sets this register to the faulting virtual address.
@@ -74,6 +82,14 @@ bitflags! {
7482 }
7583}
7684
85+ impl Cr3Flags {
86+ #[ deprecated = "use the safe `from_bits_retain` method instead" ]
87+ /// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
88+ pub unsafe fn from_bits_unchecked ( bits : u64 ) -> Self {
89+ Self :: from_bits_retain ( bits)
90+ }
91+ }
92+
7793/// Contains various control flags that enable architectural extensions, and
7894/// indicate support for specific processor capabilities.
7995#[ derive( Debug ) ]
@@ -162,6 +178,14 @@ bitflags! {
162178 }
163179}
164180
181+ impl Cr4Flags {
182+ #[ deprecated = "use the safe `from_bits_retain` method instead" ]
183+ /// Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
184+ pub unsafe fn from_bits_unchecked ( bits : u64 ) -> Self {
185+ Self :: from_bits_retain ( bits)
186+ }
187+ }
188+
165189#[ cfg( feature = "instructions" ) ]
166190mod x86_64 {
167191 use super :: * ;
0 commit comments