mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-27 21:24:11 -04:00
libmesosphere: move .s to kernel (prevent manifesting in kernelldr)
This commit is contained in:
parent
8c93eb5712
commit
364b04b68a
21 changed files with 100 additions and 53 deletions
|
@ -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;
|
||||
|
|
|
@ -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) { /* ... */ }
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue