We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Cr2::read_raw
1 parent bb82677 commit 4b525bbCopy full SHA for 4b525bb
src/registers/control.rs
@@ -253,6 +253,12 @@ mod x86_64 {
253
/// Read the current page fault linear address from the CR2 register.
254
#[inline]
255
pub fn read() -> VirtAddr {
256
+ VirtAddr::new(Self::read_raw())
257
+ }
258
+
259
+ /// Read the current page fault linear address from the CR2 register.
260
+ #[inline]
261
+ pub fn read_raw() -> u64 {
262
let value: u64;
263
264
#[cfg(feature = "inline_asm")]
@@ -264,7 +270,7 @@ mod x86_64 {
270
value = crate::asm::x86_64_asm_read_cr2();
265
271
}
266
272
267
- VirtAddr::new(value)
273
+ value
268
274
269
275
276
0 commit comments