@@ -472,41 +472,81 @@ impl ExceptionFrame {
472
472
}
473
473
474
474
/// Sets the stacked value of (general purpose) register 0.
475
+ ///
476
+ /// # Safety
477
+ ///
478
+ /// This affects the `r0` register of the preempted code, which must not rely on it getting
479
+ /// restored to its previous value.
475
480
pub unsafe fn set_r0 ( & mut self , value : u32 ) {
476
481
self . r0 = value;
477
482
}
478
483
479
484
/// Sets the stacked value of (general purpose) register 1.
485
+ ///
486
+ /// # Safety
487
+ ///
488
+ /// This affects the `r1` register of the preempted code, which must not rely on it getting
489
+ /// restored to its previous value.
480
490
pub unsafe fn set_r1 ( & mut self , value : u32 ) {
481
491
self . r1 = value;
482
492
}
483
493
484
494
/// Sets the stacked value of (general purpose) register 2.
495
+ ///
496
+ /// # Safety
497
+ ///
498
+ /// This affects the `r2` register of the preempted code, which must not rely on it getting
499
+ /// restored to its previous value.
485
500
pub unsafe fn set_r2 ( & mut self , value : u32 ) {
486
501
self . r2 = value;
487
502
}
488
503
489
504
/// Sets the stacked value of (general purpose) register 3.
505
+ ///
506
+ /// # Safety
507
+ ///
508
+ /// This affects the `r3` register of the preempted code, which must not rely on it getting
509
+ /// restored to its previous value.
490
510
pub unsafe fn set_r3 ( & mut self , value : u32 ) {
491
511
self . r3 = value;
492
512
}
493
513
494
514
/// Sets the stacked value of (general purpose) register 12.
515
+ ///
516
+ /// # Safety
517
+ ///
518
+ /// This affects the `r12` register of the preempted code, which must not rely on it getting
519
+ /// restored to its previous value.
495
520
pub unsafe fn set_r12 ( & mut self , value : u32 ) {
496
521
self . r12 = value;
497
522
}
498
523
499
524
/// Sets the stacked value of the Link Register.
525
+ ///
526
+ /// # Safety
527
+ ///
528
+ /// This affects the `lr` register of the preempted code, which must not rely on it getting
529
+ /// restored to its previous value.
500
530
pub unsafe fn set_lr ( & mut self , value : u32 ) {
501
531
self . lr = value;
502
532
}
503
533
504
534
/// Sets the stacked value of the Program Counter.
535
+ ///
536
+ /// # Safety
537
+ ///
538
+ /// This affects the `pc` register of the preempted code, which must not rely on it getting
539
+ /// restored to its previous value.
505
540
pub unsafe fn set_pc ( & mut self , value : u32 ) {
506
541
self . pc = value;
507
542
}
508
543
509
544
/// Sets the stacked value of the Program Status Register.
545
+ ///
546
+ /// # Safety
547
+ ///
548
+ /// This affects the `xPSR` registers (`IPSR`, `APSR`, and `EPSR`) of the preempted code, which
549
+ /// must not rely on them getting restored to their previous value.
510
550
pub unsafe fn set_xpsr ( & mut self , value : u32 ) {
511
551
self . xpsr = value;
512
552
}
0 commit comments