mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-06 01:21:18 -04:00
kern: implement KHandleTable, other cleanup
This commit is contained in:
parent
d5a4c17ee7
commit
484f132651
41 changed files with 710 additions and 89 deletions
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
|
||||
#pragma once
|
||||
#include "../results.hpp"
|
||||
#include <vapours/results.hpp>
|
||||
|
||||
namespace ams::svc {
|
||||
|
||||
|
@ -28,6 +28,31 @@ namespace ams::svc {
|
|||
#error "Unknown target for svc::Handle"
|
||||
#endif
|
||||
|
||||
enum class PseudoHandle : Handle {
|
||||
CurrentThread = 0xFFFF8000,
|
||||
CurrentProcess = 0xFFFF8001,
|
||||
};
|
||||
|
||||
constexpr ALWAYS_INLINE bool operator==(const Handle &lhs, const PseudoHandle &rhs) {
|
||||
return static_cast<Handle>(lhs) == static_cast<Handle>(rhs);
|
||||
}
|
||||
|
||||
constexpr ALWAYS_INLINE bool operator==(const PseudoHandle &lhs, const Handle &rhs) {
|
||||
return static_cast<Handle>(lhs) == static_cast<Handle>(rhs);
|
||||
}
|
||||
|
||||
constexpr ALWAYS_INLINE bool operator!=(const Handle &lhs, const PseudoHandle &rhs) {
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
constexpr ALWAYS_INLINE bool operator!=(const PseudoHandle &lhs, const Handle &rhs) {
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
constexpr ALWAYS_INLINE bool IsPseudoHandle(const Handle &handle) {
|
||||
return handle == PseudoHandle::CurrentProcess || handle == PseudoHandle::CurrentThread;
|
||||
}
|
||||
|
||||
#ifdef ATMOSPHERE_ARCH_ARM64
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue