2019-07-18 04:04:00 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2019 Atmosphère-NX
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#include "smm_ams.h"
|
|
|
|
|
|
|
|
Result smManagerAtmosphereEndInitialDefers(void) {
|
2019-10-20 01:42:53 +01:00
|
|
|
return serviceDispatch(smManagerGetServiceSession(), 65000);
|
2019-07-18 04:04:00 +01:00
|
|
|
}
|
|
|
|
|
2019-11-21 12:03:19 +00:00
|
|
|
Result smManagerAtmosphereRegisterProcess(u64 pid, u64 tid, const CfgOverrideStatus *status, const void *acid_sac, size_t acid_sac_size, const void *aci_sac, size_t aci_sac_size) {
|
2019-10-20 01:42:53 +01:00
|
|
|
const struct {
|
2019-07-18 04:04:00 +01:00
|
|
|
u64 pid;
|
|
|
|
u64 tid;
|
2019-11-21 12:03:19 +00:00
|
|
|
CfgOverrideStatus status;
|
|
|
|
} in = { pid, tid, *status };
|
2019-10-20 01:42:53 +01:00
|
|
|
return serviceDispatchIn(smManagerGetServiceSession(), 65002, in,
|
|
|
|
.buffer_attrs = {
|
|
|
|
SfBufferAttr_In | SfBufferAttr_HipcMapAlias,
|
|
|
|
SfBufferAttr_In | SfBufferAttr_HipcMapAlias,
|
|
|
|
},
|
|
|
|
.buffers = {
|
|
|
|
{ acid_sac, acid_sac_size },
|
|
|
|
{ aci_sac, aci_sac_size },
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
2019-07-18 04:04:00 +01:00
|
|
|
|
2019-10-23 08:07:20 +01:00
|
|
|
static Result _smManagerAtmosphereCmdHas(bool *out, SmServiceName name, u32 cmd_id) {
|
2019-10-20 01:42:53 +01:00
|
|
|
u8 tmp;
|
2019-10-23 08:07:20 +01:00
|
|
|
Result rc = serviceDispatchInOut(smManagerGetServiceSession(), cmd_id, name, tmp);
|
2019-10-20 01:42:53 +01:00
|
|
|
if (R_SUCCEEDED(rc) && out) *out = tmp & 1;
|
2019-07-18 04:04:00 +01:00
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2019-10-23 08:07:20 +01:00
|
|
|
Result smManagerAtmosphereHasMitm(bool *out, SmServiceName name) {
|
|
|
|
return _smManagerAtmosphereCmdHas(out, name, 65001);
|
2019-07-18 04:04:00 +01:00
|
|
|
}
|