libmesosphere: move .s to kernel (prevent manifesting in kernelldr)

This commit is contained in:
Michael Scire 2020-02-13 22:05:20 -08:00
parent 8c93eb5712
commit 364b04b68a
21 changed files with 100 additions and 53 deletions

View file

@ -28,6 +28,8 @@ namespace ams::kern {
UartRegister_LSR = 5,
UartRegister_IRSA_CSR = 8,
UartRegister_DLL = 0,
UartRegister_DLH = 1,
};
@ -71,8 +73,9 @@ namespace ams::kern {
/* Disable UART interrupts. */
WriteUartRegister(UartRegister_IER, 0x00);
/* Configure the FIFOO to be enabled and clear receive. */
/* Configure the FIFO to be enabled and clear receive. */
WriteUartRegister(UartRegister_FCR, 0x03);
WriteUartRegister(UartRegister_IRSA_CSR, 0x02);
ReadUartRegister(UartRegister_FCR);
return true;

View file

@ -260,7 +260,7 @@ namespace ams::kern {
void KSystemControl::StopSystem() {
if (g_call_smc_on_panic) {
/* Display a panic screen via secure monitor. */
smc::Panic(0xF00);
/* TODO: Enable in release: smc::Panic(0xF00); */
}
while (true) { /* ... */ }
}

View file

@ -116,7 +116,7 @@ namespace ams::kern::smc {
void GetConfig(u64 *out, size_t num_qwords, ConfigItem config_item) {
SecureMonitorArguments args = { FunctionId_GetConfig, static_cast<u32>(config_item) };
CallPrivilegedSecureMonitorFunctionForInit(args);
MESOSPHERE_ABORT_UNLESS((static_cast<SmcResult>(args.x[0]) == SmcResult::Success));
MESOSPHERE_INIT_ABORT_UNLESS((static_cast<SmcResult>(args.x[0]) == SmcResult::Success));
for (size_t i = 0; i < num_qwords && i < 7; i++) {
out[i] = args.x[1 + i];
}
@ -125,10 +125,10 @@ namespace ams::kern::smc {
void GenerateRandomBytes(void *dst, size_t size) {
/* Call SmcGenerateRandomBytes() */
SecureMonitorArguments args = { FunctionId_GenerateRandomBytes, size };
MESOSPHERE_ABORT_UNLESS(size <= sizeof(args) - sizeof(args.x[0]));
MESOSPHERE_INIT_ABORT_UNLESS(size <= sizeof(args) - sizeof(args.x[0]));
CallPrivilegedSecureMonitorFunctionForInit(args);
MESOSPHERE_ABORT_UNLESS((static_cast<SmcResult>(args.x[0]) == SmcResult::Success));
MESOSPHERE_INIT_ABORT_UNLESS((static_cast<SmcResult>(args.x[0]) == SmcResult::Success));
/* Copy output. */
std::memcpy(dst, &args.x[1], size);