@@ -158,8 +158,12 @@ mod x86_64 {
158158
159159 /// Write CR0 flags.
160160 ///
161- /// Preserves the value of reserved fields. Unsafe because it's possible to violate memory
162- /// safety by e.g. disabling paging.
161+ /// Preserves the value of reserved fields.
162+ ///
163+ /// ## Safety
164+ ///
165+ /// This function is unsafe because it's possible to violate memory
166+ /// safety through it, e.g. by disabling paging.
163167 #[ inline]
164168 pub unsafe fn write ( flags : Cr0Flags ) {
165169 let old_value = Self :: read_raw ( ) ;
@@ -171,8 +175,12 @@ mod x86_64 {
171175
172176 /// Write raw CR0 flags.
173177 ///
174- /// Does _not_ preserve any values, including reserved fields. Unsafe because it's possible to violate memory
175- /// safety by e.g. disabling paging.
178+ /// Does _not_ preserve any values, including reserved fields.
179+ ///
180+ /// ## Safety
181+ ///
182+ /// This function is unsafe because it's possible to violate memory
183+ /// safety through it, e.g. by disabling paging.
176184 #[ inline]
177185 pub unsafe fn write_raw ( value : u64 ) {
178186 #[ cfg( feature = "inline_asm" ) ]
@@ -184,8 +192,12 @@ mod x86_64 {
184192
185193 /// Updates CR0 flags.
186194 ///
187- /// Preserves the value of reserved fields. Unsafe because it's possible to violate memory
188- /// safety by e.g. disabling paging.
195+ /// Preserves the value of reserved fields.
196+ ///
197+ /// ## Safety
198+ ///
199+ /// This function is unsafe because it's possible to violate memory
200+ /// safety through it, e.g. by disabling paging.
189201 #[ inline]
190202 pub unsafe fn update < F > ( f : F )
191203 where
@@ -283,8 +295,13 @@ mod x86_64 {
283295
284296 /// Write CR4 flags.
285297 ///
286- /// Preserves the value of reserved fields. Unsafe because it's possible to violate memory
287- /// safety by e.g. physical address extension.
298+ /// Preserves the value of reserved fields.
299+ ///
300+ /// ## Safety
301+ ///
302+ /// This function is unsafe because it's possible to violate memory
303+ /// safety through it, e.g. by overwriting the physical address extension
304+ /// flag.
288305 #[ inline]
289306 pub unsafe fn write ( flags : Cr4Flags ) {
290307 let old_value = Self :: read_raw ( ) ;
@@ -296,8 +313,13 @@ mod x86_64 {
296313
297314 /// Write raw CR4 flags.
298315 ///
299- /// Does _not_ preserve any values, including reserved fields. Unsafe because it's possible to violate memory
300- /// safety by e.g. physical address extension.
316+ /// Does _not_ preserve any values, including reserved fields.
317+ ///
318+ /// ## Safety
319+ ///
320+ /// This function is unsafe because it's possible to violate memory
321+ /// safety through it, e.g. by overwriting the physical address extension
322+ /// flag.
301323 #[ inline]
302324 pub unsafe fn write_raw ( value : u64 ) {
303325 #[ cfg( feature = "inline_asm" ) ]
@@ -309,8 +331,12 @@ mod x86_64 {
309331
310332 /// Updates CR4 flags.
311333 ///
312- /// Preserves the value of reserved fields. Unsafe because it's possible to violate memory
313- /// safety by e.g. physical address extension.
334+ /// Preserves the value of reserved fields.
335+ /// ## Safety
336+ ///
337+ /// This function is unsafe because it's possible to violate memory
338+ /// safety through it, e.g. by overwriting the physical address extension
339+ /// flag.
314340 #[ inline]
315341 pub unsafe fn update < F > ( f : F )
316342 where
0 commit comments