LCOV - code coverage report
Current view: top level - home/jenkins/libs/bsp/bspInterrupts/include/interrupts - SuspendResumeAllInterruptsLock.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 3 3 100.0 %
Date: 2025-05-20 09:12:59 Functions: 0 0 -

          Line data    Source code
       1             : // Copyright 2024 Accenture.
       2             : 
       3             : #pragma once
       4             : 
       5             : #include "interrupts/suspendResumeAllInterrupts.h"
       6             : 
       7             : namespace interrupts
       8             : {
       9             : class SuspendResumeAllInterruptsLock
      10             : {
      11             : public:
      12             :     // [PUBLICAPI_START]
      13             :     /**
      14             :      * Suspend all interrupts and store previous state in an class internal variable
      15             :      */
      16           1 :     void suspend()
      17             :     {
      18           1 :         fOldMachineStateRegisterValue = getMachineStateRegisterValueAndSuspendAllInterrupts();
      19             :     }
      20             : 
      21             :     /**
      22             :      * Resume all interrupts restoring the interrupt state that has been saved during the suspend()
      23             :      * call from the class internal variable
      24             :      */
      25           1 :     void resume() { resumeAllInterrupts(fOldMachineStateRegisterValue); }
      26             : 
      27             :     // [PUBLICAPI_END]
      28             : 
      29             : private:
      30             :     uint32_t fOldMachineStateRegisterValue{};
      31             : };
      32             : 
      33             : } /* namespace interrupts */

Generated by: LCOV version 1.14