Advertisement
Guest User

kernel reenter patch

a guest
Jul 2nd, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.89 KB | None | 0 0
  1. diff --git a/repos/base-hw/src/core/include/kernel/lock.h b/repos/base-hw/src/core/include/kernel/lock.h
  2. index de49428..3564058 100644
  3. --- a/repos/base-hw/src/core/include/kernel/lock.h
  4. +++ b/repos/base-hw/src/core/include/kernel/lock.h
  5. @@ -19,6 +19,7 @@
  6.  #include <base/lock_guard.h>
  7.  #include <cpu/atomic.h>
  8.  #include <cpu/memory_barrier.h>
  9. +#include <cpu.h>
  10.  
  11.  namespace Kernel
  12.  {
  13. @@ -43,7 +44,17 @@ class Kernel::Lock
  14.         /**
  15.          * Request the lock
  16.          */
  17. -       void lock() { while (!Genode::cmpxchg(&_locked, 0, 1)); }
  18. +       void lock()
  19. +       {
  20. +           if (!Genode::cmpxchg(&_locked, 0, 1)) {
  21. +               PERR("An exception was raised during kernel execution!");
  22. +               PERR("DFSR=%p IFSR=%p DFAR=%p",
  23. +                    (void*)Genode::Cpu::Dfsr::read(),
  24. +                    (void*)Genode::Cpu::Ifsr::read(),
  25. +                    (void*)Genode::Cpu::Dfar::read());
  26. +               while (true) ;
  27. +           }
  28. +       }
  29.  
  30.         /**
  31.          * Free the lock
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement