kern: add InfoType_IsSvcPermitted
This commit is contained in:
@@ -306,6 +306,10 @@ namespace ams::kern {
|
||||
}
|
||||
}
|
||||
|
||||
constexpr bool IsPermittedSvc(svc::SvcId id) const {
|
||||
return (id < m_svc_access_flags.GetCount()) && m_svc_access_flags[id];
|
||||
}
|
||||
|
||||
constexpr bool IsPermittedInterrupt(u32 id) const {
|
||||
return (id < m_irq_access_flags.GetCount()) && m_irq_access_flags[id];
|
||||
}
|
||||
|
||||
@@ -194,6 +194,10 @@ namespace ams::kern {
|
||||
return m_attached_object != nullptr;
|
||||
}
|
||||
|
||||
constexpr bool IsPermittedSvc(svc::SvcId svc_id) const {
|
||||
return m_capabilities.IsPermittedSvc(svc_id);
|
||||
}
|
||||
|
||||
constexpr bool IsPermittedInterrupt(int32_t interrupt_id) const {
|
||||
return m_capabilities.IsPermittedInterrupt(interrupt_id);
|
||||
}
|
||||
|
||||
@@ -285,6 +285,18 @@ namespace ams::kern::svc {
|
||||
*out = tick_count;
|
||||
}
|
||||
break;
|
||||
case ams::svc::InfoType_IsSvcPermitted:
|
||||
{
|
||||
/* Verify the input handle is invalid. */
|
||||
R_UNLESS(handle == ams::svc::InvalidHandle, svc::ResultInvalidHandle());
|
||||
|
||||
/* Verify the sub-type is valid. */
|
||||
R_UNLESS(info_subtype == svc::SvcId_SynchronizePreemptionState, svc::ResultInvalidCombination());
|
||||
|
||||
/* Get whether the svc is permitted. */
|
||||
*out = GetCurrentProcess().IsPermittedSvc(static_cast<svc::SvcId>(info_subtype));
|
||||
}
|
||||
break;
|
||||
case ams::svc::InfoType_MesosphereMeta:
|
||||
{
|
||||
/* Verify the handle is invalid. */
|
||||
|
||||
Reference in New Issue
Block a user