git subrepo pull --force emummc

subrepo:
  subdir:   "emummc"
  merged:   "2fc47cbb8"
upstream:
  origin:   "https://github.com/lulle2007200/emuMMC.git"
  branch:   "develop"
  commit:   "2fc47cbb8"
git-subrepo:
  version:  "0.4.9"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "30db3b8"
This commit is contained in:
lulle2007200
2025-05-12 14:22:12 +02:00
parent 0188898af4
commit 92c599f0f0
342 changed files with 106677 additions and 974 deletions

View File

@@ -22,6 +22,7 @@ void smcRebootToIramPayload(void)
SecmonArgs args;
args.X[0] = 0xC3000401; /* smcSetConfig */
args.X[1] = SplConfigItem_NeedsReboot; /* Exosphere reboot */
args.X[2] = 0;
args.X[3] = 2; /* Perform reboot to payload at 0x40010000 in IRAM. */
svcCallSecureMonitor(&args);
}
@@ -40,22 +41,20 @@ Result smcGetConfig(SplConfigItem config_item, u64 *out_config)
SecmonArgs args;
args.X[0] = 0xC3000002; /* smcGetConfig */
args.X[1] = (u64)config_item; /* config item */
Result rc = svcCallSecureMonitor(&args);
if (rc == 0)
svcCallSecureMonitor(&args);
Result rc = 0;
if (args.X[0] == 0)
{
if (args.X[0] == 0)
if (out_config)
{
if (out_config)
{
*out_config = args.X[1];
}
}
else
{
/* SPL result n = SMC result n */
rc = (26u | ((u32)args.X[0] << 9u));
*out_config = args.X[1];
}
}
else
{
/* SPL result n = SMC result n */
rc = (26u | ((u32)args.X[0] << 9u));
}
return rc;
}
@@ -108,14 +107,12 @@ Result smcCopyToIram(uintptr_t iram_addr, const void *src_addr, u32 size)
args.X[2] = (u64)iram_addr; /* IRAM address */
args.X[3] = size; /* Amount to copy */
args.X[4] = 1; /* 1 = Write */
Result rc = svcCallSecureMonitor(&args);
if (rc == 0)
svcCallSecureMonitor(&args);
Result rc = 0;
if (args.X[0] != 0)
{
if (args.X[0] != 0)
{
/* SPL result n = SMC result n */
rc = (26u | ((u32)args.X[0] << 9u));
}
/* SPL result n = SMC result n */
rc = (26u | ((u32)args.X[0] << 9u));
}
return rc;
}
@@ -128,14 +125,12 @@ Result smcCopyFromIram(void *dst_addr, uintptr_t iram_addr, u32 size)
args.X[2] = (u64)iram_addr; /* IRAM address */
args.X[3] = size; /* Amount to copy */
args.X[4] = 0; /* 0 = Read */
Result rc = svcCallSecureMonitor(&args);
if (rc == 0)
svcCallSecureMonitor(&args);
Result rc = 0;
if (args.X[0] != 0)
{
if (args.X[0] != 0)
{
/* SPL result n = SMC result n */
rc = (26u | ((u32)args.X[0] << 9u));
}
/* SPL result n = SMC result n */
rc = (26u | ((u32)args.X[0] << 9u));
}
return rc;
}
@@ -147,14 +142,12 @@ Result smcReadWriteRegister(u32 phys_addr, u32 value, u32 mask)
args.X[1] = phys_addr; /* MMIO address */
args.X[2] = mask; /* mask */
args.X[3] = value; /* value */
Result rc = svcCallSecureMonitor(&args);
if (rc == 0)
svcCallSecureMonitor(&args);
Result rc = 0;
if (args.X[0] != 0)
{
if (args.X[0] != 0)
{
/* SPL result n = SMC result n */
rc = (26u | ((u32)args.X[0] << 9u));
}
/* SPL result n = SMC result n */
rc = (26u | ((u32)args.X[0] << 9u));
}
return rc;
}
@@ -165,18 +158,16 @@ Result smcGetEmummcConfig(exo_emummc_mmc_t mmc_id, exo_emummc_config_t *out_cfg,
args.X[0] = 0xF0000404; /* smcAmsGetEmunandConfig */
args.X[1] = mmc_id;
args.X[2] = (u64)out_paths; /* out path */
Result rc = svcCallSecureMonitor(&args);
svcCallSecureMonitor(&args);
Result rc = 0;
if (args.X[0] != 0)
{
/* SPL result n = SMC result n */
rc = (26u | ((u32)args.X[0] << 9u));
}
if (rc == 0)
{
if (args.X[0] != 0)
{
/* SPL result n = SMC result n */
rc = (26u | ((u32)args.X[0] << 9u));
}
if (rc == 0)
{
memcpy(out_cfg, &args.X[1], sizeof(*out_cfg));
}
memcpy(out_cfg, &args.X[1], sizeof(*out_cfg));
}
return rc;
@@ -187,18 +178,16 @@ Result smcGenerateRandomBytes(void *dst, u32 size)
SecmonArgs args;
args.X[0] = 0xC3000006; /* smcGenerateRandomBytes */
args.X[1] = size;
Result rc = svcCallSecureMonitor(&args);
svcCallSecureMonitor(&args);
Result rc = 0;
if (args.X[0] != 0)
{
/* SPL result n = SMC result n */
rc = (26u | ((u32)args.X[0] << 9u));
}
if (rc == 0)
{
if (args.X[0] != 0)
{
/* SPL result n = SMC result n */
rc = (26u | ((u32)args.X[0] << 9u));
}
if (rc == 0)
{
memcpy(dst, &args.X[1], size);
}
memcpy(dst, &args.X[1], size);
}
return rc;
}