LCOV - code coverage report
Current view: top level - home/jenkins/libs/bsp/bspInterrupts/include/interrupts - SuspendResumeAllInterruptsScopedLock.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 3 3 100.0 %
Date: 2025-06-27 13:41:45 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 SuspendResumeAllInterruptsScopedLock
      10             : {
      11             : public:
      12             :     // [PUBLICAPI_START]
      13             :     /**
      14             :      * Create a lock object instance with disabling of all interrupts
      15             :      * Store the current interrupt state on instance creation in a private member variable
      16             :      */
      17        8366 :     SuspendResumeAllInterruptsScopedLock()
      18        8366 :     : fOldMachineStateRegisterValue(getMachineStateRegisterValueAndSuspendAllInterrupts())
      19             :     {}
      20             : 
      21             :     /**
      22             :      * Destroy the lock object instance and restore the internally stored interrupt state from
      23             :      * before this object instance has been created
      24             :      */
      25        8366 :     ~SuspendResumeAllInterruptsScopedLock() { resumeAllInterrupts(fOldMachineStateRegisterValue); }
      26             : 
      27             :     // [PUBLICAPI_END]
      28             : 
      29             : private:
      30             :     uint32_t fOldMachineStateRegisterValue;
      31             : };
      32             : 
      33             : } /* namespace interrupts */

Generated by: LCOV version 1.14