address_arbiter.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common_types.h"
  6. #include "core/hle/kernel/kernel.h"
  7. // Address arbiters are an underlying kernel synchronization object that can be created/used via
  8. // supervisor calls (SVCs). They function as sort of a global lock. Typically, games/other CTR
  9. // applications use them as an underlying mechanism to implement thread-safe barriers, events, and
  10. // semphores.
  11. ////////////////////////////////////////////////////////////////////////////////////////////////////
  12. // Kernel namespace
  13. namespace Kernel {
  14. /// Address arbitration types
  15. enum class ArbitrationType : u32 {
  16. Signal,
  17. WaitIfLessThan,
  18. DecrementAndWaitIfLessThan,
  19. WaitIfLessThanWithTimeout,
  20. DecrementAndWaitIfLessThanWithTimeout,
  21. };
  22. /// Arbitrate an address
  23. Result ArbitrateAddress(Handle handle, ArbitrationType type, u32 address, s32 value);
  24. /// Create an address arbiter
  25. Handle CreateAddressArbiter(const std::string& name = "Unknown");
  26. } // namespace FileSys