kern: greatly improve codegen for atomics, scheduler

This commit is contained in:
Michael Scire
2021-01-08 02:13:36 -08:00
parent f051f707ed
commit 4aa18b06e8
19 changed files with 67 additions and 46 deletions

View File

@@ -63,6 +63,7 @@ namespace ams::kern {
m_tls_address = Null<KProcessAddress>;
const uintptr_t kern_stack_top_address = reinterpret_cast<uintptr_t>(kern_stack_top);
MESOSPHERE_UNUSED(kern_stack_top_address);
/* Next, assert things based on the type. */
switch (type) {
@@ -1161,7 +1162,7 @@ namespace ams::kern {
/* Determine if this is the first termination request. */
const bool first_request = [&] ALWAYS_INLINE_LAMBDA () -> bool {
/* Perform an atomic compare-and-swap from false to true. */
bool expected = false;
u8 expected = false;
return m_termination_requested.compare_exchange_strong(expected, true);
}();