Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. Index: src/system/kernel/smp.cpp
  2. ===================================================================
  3. --- src/system/kernel/smp.cpp (revision 42484)
  4. +++ src/system/kernel/smp.cpp (working copy)
  5. @@ -1266,14 +1266,15 @@
  6. void
  7. call_all_cpus(void (*func)(void*, int), void* cookie)
  8. {
  9. + cpu_status state = disable_interrupts();
  10. +
  11. // if inter-CPU communication is not yet enabled, use the early mechanism
  12. if (!sICIEnabled) {
  13. call_all_cpus_early(func, cookie);
  14. + restore_interrupts(state);
  15. return;
  16. }
  17.  
  18. - cpu_status state = disable_interrupts();
  19. -
  20. if (smp_get_num_cpus() > 1) {
  21. smp_send_broadcast_ici(SMP_MSG_CALL_FUNCTION, (uint32)cookie,
  22. 0, 0, (void*)func, SMP_MSG_FLAG_ASYNC);
  23. @@ -1289,14 +1290,15 @@
  24. void
  25. call_all_cpus_sync(void (*func)(void*, int), void* cookie)
  26. {
  27. + cpu_status state = disable_interrupts();
  28. +
  29. // if inter-CPU communication is not yet enabled, use the early mechanism
  30. if (!sICIEnabled) {
  31. call_all_cpus_early(func, cookie);
  32. + restore_interrupts(state);
  33. return;
  34. }
  35.  
  36. - cpu_status state = disable_interrupts();
  37. -
  38. if (smp_get_num_cpus() > 1) {
  39. smp_send_broadcast_ici(SMP_MSG_CALL_FUNCTION, (uint32)cookie,
  40. 0, 0, (void*)func, SMP_MSG_FLAG_SYNC);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement