@@ -314,7 +314,7 @@ use self::scb_consts::*;
314
314
315
315
#[ cfg( not( armv6m) ) ]
316
316
impl SCB {
317
- /// Enables I-cache if currently disabled
317
+ /// Enables I-cache if currently disabled.
318
318
///
319
319
/// This operation first invalidates the entire I-cache.
320
320
#[ inline]
@@ -338,7 +338,7 @@ impl SCB {
338
338
crate :: asm:: isb ( ) ;
339
339
}
340
340
341
- /// Disables I-cache if currently enabled
341
+ /// Disables I-cache if currently enabled.
342
342
///
343
343
/// This operation invalidates the entire I-cache after disabling.
344
344
#[ inline]
@@ -362,7 +362,7 @@ impl SCB {
362
362
crate :: asm:: isb ( ) ;
363
363
}
364
364
365
- /// Returns whether the I-cache is currently enabled
365
+ /// Returns whether the I-cache is currently enabled.
366
366
#[ inline( always) ]
367
367
pub fn icache_enabled ( ) -> bool {
368
368
crate :: asm:: dsb ( ) ;
@@ -372,7 +372,7 @@ impl SCB {
372
372
unsafe { ( * Self :: ptr ( ) ) . ccr . read ( ) & SCB_CCR_IC_MASK == SCB_CCR_IC_MASK }
373
373
}
374
374
375
- /// Invalidates entire I-cache
375
+ /// Invalidates the entire I-cache.
376
376
#[ inline]
377
377
pub fn invalidate_icache ( & mut self ) {
378
378
// NOTE(unsafe): No races as all CBP registers are write-only and stateless
@@ -385,7 +385,7 @@ impl SCB {
385
385
crate :: asm:: isb ( ) ;
386
386
}
387
387
388
- /// Enables D-cache if currently disabled
388
+ /// Enables D-cache if currently disabled.
389
389
///
390
390
/// This operation first invalidates the entire D-cache, ensuring it does
391
391
/// not contain stale values before being enabled.
@@ -407,7 +407,7 @@ impl SCB {
407
407
crate :: asm:: isb ( ) ;
408
408
}
409
409
410
- /// Disables D-cache if currently enabled
410
+ /// Disables D-cache if currently enabled.
411
411
///
412
412
/// This operation subsequently cleans and invalidates the entire D-cache,
413
413
/// ensuring all contents are safely written back to main memory after disabling.
@@ -426,7 +426,7 @@ impl SCB {
426
426
self . clean_invalidate_dcache ( cpuid) ;
427
427
}
428
428
429
- /// Returns whether the D-cache is currently enabled
429
+ /// Returns whether the D-cache is currently enabled.
430
430
#[ inline]
431
431
pub fn dcache_enabled ( ) -> bool {
432
432
crate :: asm:: dsb ( ) ;
@@ -436,7 +436,7 @@ impl SCB {
436
436
unsafe { ( * Self :: ptr ( ) ) . ccr . read ( ) & SCB_CCR_DC_MASK == SCB_CCR_DC_MASK }
437
437
}
438
438
439
- /// Invalidates entire D-cache
439
+ /// Invalidates the entire D-cache.
440
440
///
441
441
/// Note that calling this while the dcache is enabled will probably wipe out the
442
442
/// stack, depending on optimisations, therefore breaking returning to the call point.
@@ -461,7 +461,7 @@ impl SCB {
461
461
crate :: asm:: isb ( ) ;
462
462
}
463
463
464
- /// Cleans entire D-cache
464
+ /// Cleans the entire D-cache.
465
465
///
466
466
/// This function causes everything in the D-cache to be written back to main memory,
467
467
/// overwriting whatever is already there.
@@ -483,7 +483,7 @@ impl SCB {
483
483
crate :: asm:: isb ( ) ;
484
484
}
485
485
486
- /// Cleans and invalidates entire D-cache
486
+ /// Cleans and invalidates the entire D-cache.
487
487
///
488
488
/// This function causes everything in the D-cache to be written back to main memory,
489
489
/// and then marks the entire D-cache as invalid, causing future reads to first fetch
@@ -506,10 +506,10 @@ impl SCB {
506
506
crate :: asm:: isb ( ) ;
507
507
}
508
508
509
- /// Invalidates D-cache by address
509
+ /// Invalidates D-cache by address.
510
510
///
511
- /// * `addr`: the address to invalidate, which must be cache-line aligned
512
- /// * `size`: number of bytes to invalidate, which must be a multiple of the cache line size
511
+ /// * `addr`: The address to invalidate, which must be cache-line aligned.
512
+ /// * `size`: Number of bytes to invalidate, which must be a multiple of the cache line size.
513
513
///
514
514
/// Invalidates D-cache cache lines, starting from the first line containing `addr`,
515
515
/// finishing once at least `size` bytes have been invalidated.
@@ -530,7 +530,7 @@ impl SCB {
530
530
/// # Safety
531
531
///
532
532
/// After invalidating, the next read of invalidated data will be from main memory. This may
533
- /// cause recent writes to be lost, potentially including writes that initialised objects.
533
+ /// cause recent writes to be lost, potentially including writes that initialized objects.
534
534
/// Therefore, this method may cause uninitialised memory or invalid values to be read,
535
535
/// resulting in undefined behaviour. You must ensure that main memory contains valid and
536
536
/// initialised values before invalidating.
@@ -575,9 +575,9 @@ impl SCB {
575
575
crate :: asm:: isb ( ) ;
576
576
}
577
577
578
- /// Invalidates an object from the D-cache
578
+ /// Invalidates an object from the D-cache.
579
579
///
580
- /// * `obj`: Object to invalidate
580
+ /// * `obj`: The object to invalidate.
581
581
///
582
582
/// Invalidates D-cache starting from the first cache line containing `obj`,
583
583
/// continuing to invalidate cache lines until all of `obj` has been invalidated.
@@ -613,9 +613,9 @@ impl SCB {
613
613
self . invalidate_dcache_by_address ( obj as * const T as usize , core:: mem:: size_of :: < T > ( ) ) ;
614
614
}
615
615
616
- /// Invalidates a slice from the D-cache
616
+ /// Invalidates a slice from the D-cache.
617
617
///
618
- /// * `slice`: Slice to invalidate
618
+ /// * `slice`: The slice to invalidate.
619
619
///
620
620
/// Invalidates D-cache starting from the first cache line containing members of `slice`,
621
621
/// continuing to invalidate cache lines until all of `slice` has been invalidated.
@@ -652,10 +652,10 @@ impl SCB {
652
652
slice. len ( ) * core:: mem:: size_of :: < T > ( ) ) ;
653
653
}
654
654
655
- /// Cleans D-cache by address
655
+ /// Cleans D-cache by address.
656
656
///
657
- /// * `addr`: the address to clean
658
- /// * `size`: number of bytes to clean
657
+ /// * `addr`: The address to start cleaning at.
658
+ /// * `size`: The number of bytes to clean.
659
659
///
660
660
/// Cleans D-cache cache lines, starting from the first line containing `addr`,
661
661
/// finishing once at least `size` bytes have been invalidated.
@@ -701,9 +701,9 @@ impl SCB {
701
701
crate :: asm:: isb ( ) ;
702
702
}
703
703
704
- /// Cleans an object in D-cache
704
+ /// Cleans an object from the D-cache.
705
705
///
706
- /// * `obj`: Object to clean
706
+ /// * `obj`: The object to clean.
707
707
///
708
708
/// Cleans D-cache starting from the first cache line containing `obj`,
709
709
/// continuing to clean cache lines until all of `obj` has been cleaned.
@@ -717,9 +717,9 @@ impl SCB {
717
717
self . clean_dcache_by_address ( obj as * const T as usize , core:: mem:: size_of :: < T > ( ) ) ;
718
718
}
719
719
720
- /// Cleans a slice in D-cache
720
+ /// Cleans a slice from D-cache.
721
721
///
722
- /// * `slice`: Slice to clean
722
+ /// * `slice`: The slice to clean.
723
723
///
724
724
/// Cleans D-cache starting from the first cache line containing members of `slice`,
725
725
/// continuing to clean cache lines until all of `slice` has been cleaned.
@@ -734,10 +734,10 @@ impl SCB {
734
734
slice. len ( ) * core:: mem:: size_of :: < T > ( ) ) ;
735
735
}
736
736
737
- /// Cleans and invalidates D-cache by address
737
+ /// Cleans and invalidates D-cache by address.
738
738
///
739
- /// * `addr`: the address to clean and invalidate
740
- /// * `size`: number of bytes to clean and invalidate
739
+ /// * `addr`: The address to clean and invalidate.
740
+ /// * `size`: The number of bytes to clean and invalidate.
741
741
///
742
742
/// Cleans and invalidates D-cache starting from the first cache line containing `addr`,
743
743
/// finishing once at least `size` bytes have been cleaned and invalidated.
0 commit comments