2019-12-09 12:57:37 +01:00
|
|
|
/*
|
2021-10-04 21:59:10 +02:00
|
|
|
* Copyright (c) Atmosphère-NX
|
2019-12-09 12:57:37 +01:00
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
2022-03-06 21:08:20 +01:00
|
|
|
#include "smm_ams.os.horizon.h"
|
2019-12-09 12:57:37 +01:00
|
|
|
|
|
|
|
Result smManagerAtmosphereEndInitialDefers(void) {
|
2021-04-11 02:59:54 +02:00
|
|
|
return tipcDispatch(smManagerTipcGetServiceSession(), 65000);
|
2019-12-09 12:57:37 +01: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) {
|
|
|
|
const struct {
|
|
|
|
u64 pid;
|
|
|
|
u64 tid;
|
|
|
|
CfgOverrideStatus status;
|
|
|
|
} in = { pid, tid, *status };
|
2021-04-11 02:59:54 +02:00
|
|
|
return tipcDispatchIn(smManagerTipcGetServiceSession(), 65002, in,
|
2019-12-09 12:57:37 +01:00
|
|
|
.buffer_attrs = {
|
|
|
|
SfBufferAttr_In | SfBufferAttr_HipcMapAlias,
|
|
|
|
SfBufferAttr_In | SfBufferAttr_HipcMapAlias,
|
|
|
|
},
|
|
|
|
.buffers = {
|
|
|
|
{ acid_sac, acid_sac_size },
|
|
|
|
{ aci_sac, aci_sac_size },
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
static Result _smManagerAtmosphereCmdHas(bool *out, SmServiceName name, u32 cmd_id) {
|
|
|
|
u8 tmp;
|
2021-04-11 02:59:54 +02:00
|
|
|
Result rc = tipcDispatchInOut(smManagerTipcGetServiceSession(), cmd_id, name, tmp);
|
2019-12-09 12:57:37 +01:00
|
|
|
if (R_SUCCEEDED(rc) && out) *out = tmp & 1;
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
Result smManagerAtmosphereHasMitm(bool *out, SmServiceName name) {
|
|
|
|
return _smManagerAtmosphereCmdHas(out, name, 65001);
|
|
|
|
}
|