diff --git a/exosphere/Makefile b/exosphere/Makefile
index 09630e14d..14a03900d 100644
--- a/exosphere/Makefile
+++ b/exosphere/Makefile
@@ -156,6 +156,8 @@ $(OUTPUT).bin : $(OUTPUT).elf
$(OUTPUT).elf : $(OFILES)
+my_libc.o: CFLAGS += -fno-builtin
+
%.elf:
@echo linking $(notdir $@)
$(LD) $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@
diff --git a/exosphere/src/mmu.h b/exosphere/src/mmu.h
index e1ded58fe..ed4cba784 100644
--- a/exosphere/src/mmu.h
+++ b/exosphere/src/mmu.h
@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-
+
#ifndef EXOSPHERE_MMU_H
#define EXOSPHERE_MMU_H
@@ -134,7 +134,7 @@
#define TCR_EL2_RSVD (BIT(31) | BIT(23))
#define TCR_EL3_RSVD (BIT(31) | BIT(23))
-static inline void mmu_init_table(uintptr_t *tbl, size_t num_entries) {
+static inline void mmu_init_table(volatile uintptr_t *tbl, size_t num_entries) {
for(size_t i = 0; i < num_entries / 8; i++) {
tbl[i] = MMU_PTE_TYPE_FAULT;
}
diff --git a/exosphere/src/my_libc.c b/exosphere/src/my_libc.c
index 2117f2483..ffd1b595b 100644
--- a/exosphere/src/my_libc.c
+++ b/exosphere/src/my_libc.c
@@ -75,7 +75,7 @@ __libc_fini_array (void)
{
size_t count;
size_t i;
-
+
count = __fini_array_end - __fini_array_start;
for (i = count; i > 0; i--)
__fini_array_start[i-1] ();
@@ -170,7 +170,7 @@ memmove (void *dst_void,
}
else
{
- /* Use optimizing algorithm for a non-destructive copy to closely
+ /* Use optimizing algorithm for a non-destructive copy to closely
match memcpy. If the size is small or either SRC or DST is unaligned,
then punt into the byte copy loop. This should be rare. */
if (!TOO_SMALL(length) && !UNALIGNED (src, dst))
@@ -561,7 +561,7 @@ memcmp (const void *m1,
s2++;
}
return 0;
-#else
+#else
unsigned char *s1 = (unsigned char *) m1;
unsigned char *s2 = (unsigned char *) m2;
unsigned long *a1;
@@ -572,13 +572,13 @@ memcmp (const void *m1,
not turn up in inner loops. */
if (!TOO_SMALL(n) && !UNALIGNED(s1,s2))
{
- /* Otherwise, load and compare the blocks of memory one
+ /* Otherwise, load and compare the blocks of memory one
word at a time. */
a1 = (unsigned long*) s1;
a2 = (unsigned long*) s2;
while (n >= LBLOCKSIZE)
{
- if (*a1 != *a2)
+ if (*a1 != *a2)
break;
a1++;
a2++;
@@ -703,7 +703,7 @@ strchr (const char *s1,
/*
FUNCTION
<>---character string compare
-
+
INDEX
strcmp
SYNOPSIS
@@ -736,7 +736,7 @@ QUICKREF
int
strcmp (const char *s1,
const char *s2)
-{
+{
#if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
while (*s1 != '\0' && *s1 == *s2)
{
@@ -751,7 +751,7 @@ strcmp (const char *s1,
/* If s1 or s2 are unaligned, then compare bytes. */
if (!UNALIGNED (s1, s2))
- {
+ {
/* If s1 and s2 are word-aligned, compare them a word at a time. */
a1 = (unsigned long*)s1;
a2 = (unsigned long*)s2;
@@ -915,7 +915,7 @@ strlen (const char *str)
/*
FUNCTION
<>---character string compare
-
+
INDEX
strncmp
SYNOPSIS
@@ -944,7 +944,7 @@ QUICKREF
#define UNALIGNED(X, Y) \
(((long)X & (sizeof (long) - 1)) | ((long)Y & (sizeof (long) - 1)))
-int
+int
strncmp (const char *s1,
const char *s2,
size_t n)
@@ -1103,10 +1103,10 @@ strncpy (char *__restrict dst0,
#endif /* not PREFER_SIZE_OVER_SPEED */
}
-/*
+/*
FUNCTION
<>---character string length
-
+
INDEX
strnlen
SYNOPSIS
diff --git a/fusee/fusee-primary/Makefile b/fusee/fusee-primary/Makefile
index 98fa93e81..3124e7925 100644
--- a/fusee/fusee-primary/Makefile
+++ b/fusee/fusee-primary/Makefile
@@ -119,7 +119,7 @@ all: check_rebootstub $(BUILD)
check_rebootstub:
@$(MAKE) -C $(AMS)/exosphere/rebootstub all
-$(BUILD):
+$(BUILD): check_rebootstub
@[ -d $@ ] || mkdir -p $@
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
diff --git a/fusee/fusee-primary/src/fs_utils.c b/fusee/fusee-primary/src/fs_utils.c
index 5b9b9f8fd..da561a266 100644
--- a/fusee/fusee-primary/src/fs_utils.c
+++ b/fusee/fusee-primary/src/fs_utils.c
@@ -23,13 +23,16 @@ FATFS sd_fs;
static bool g_sd_mounted = false;
static bool g_sd_initialized = false;
static bool g_ahb_redirect_enabled = false;
+sdmmc_t g_sd_sdmmc;
+sdmmc_device_t g_sd_device;
+
bool mount_sd(void)
{
/* Already mounted. */
if (g_sd_mounted)
return true;
-
+
/* Enable AHB redirection if necessary. */
if (!g_ahb_redirect_enabled) {
mc_enable_ahb_redirect();
@@ -41,7 +44,7 @@ bool mount_sd(void)
if (sdmmc_device_sd_init(&g_sd_device, &g_sd_sdmmc, SDMMC_BUS_WIDTH_4BIT, SDMMC_SPEED_UHS_SDR104))
{
g_sd_initialized = true;
-
+
/* Mount SD. */
if (f_mount(&sd_fs, "", 1) == FR_OK) {
print(SCREEN_LOG_LEVEL_INFO, "Mounted SD card!\n");
@@ -63,7 +66,7 @@ void unmount_sd(void)
sdmmc_device_finish(&g_sd_device);
g_sd_mounted = false;
}
-
+
/* Disable AHB redirection if necessary. */
if (g_ahb_redirect_enabled) {
mc_disable_ahb_redirect();
@@ -81,13 +84,13 @@ uint32_t get_file_size(const char *filename)
FIL f;
if (f_open(&f, filename, FA_READ) != FR_OK)
return 0;
-
+
/* Get the file size. */
uint32_t file_size = f_size(&f);
-
+
/* Close the file. */
f_close(&f);
-
+
return file_size;
}
@@ -101,10 +104,10 @@ int read_from_file(void *dst, uint32_t dst_size, const char *filename)
FIL f;
if (f_open(&f, filename, FA_READ) != FR_OK)
return 0;
-
+
/* Sync. */
f_sync(&f);
-
+
/* Read from file. */
UINT br = 0;
int res = f_read(&f, dst, dst_size, &br);
@@ -118,7 +121,7 @@ int write_to_file(void *src, uint32_t src_size, const char *filename)
/* SD card hasn't been mounted yet. */
if (!g_sd_mounted)
return 0;
-
+
/* Open the file for writing. */
FIL f;
if (f_open(&f, filename, FA_CREATE_ALWAYS | FA_WRITE) != FR_OK)
diff --git a/fusee/fusee-primary/src/fs_utils.h b/fusee/fusee-primary/src/fs_utils.h
index 8cb0f326c..1e25b2b82 100644
--- a/fusee/fusee-primary/src/fs_utils.h
+++ b/fusee/fusee-primary/src/fs_utils.h
@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-
+
#ifndef FUSEE_FS_UTILS_H
#define FUSEE_FS_UTILS_H
@@ -23,8 +23,8 @@
#include "sdmmc/sdmmc.h"
#include "utils.h"
-sdmmc_t g_sd_sdmmc;
-sdmmc_device_t g_sd_device;
+extern sdmmc_t g_sd_sdmmc;
+extern sdmmc_device_t g_sd_device;
bool mount_sd(void);
void unmount_sd(void);
diff --git a/fusee/fusee-primary/src/lib/ini.c b/fusee/fusee-primary/src/lib/ini.c
index 63626c72d..ccf4640d2 100644
--- a/fusee/fusee-primary/src/lib/ini.c
+++ b/fusee/fusee-primary/src/lib/ini.c
@@ -70,7 +70,10 @@ static char* find_chars_or_comment(const char* s, const char* chars)
/* Version of strncpy that ensures dest (size bytes) is null-terminated. */
static char* strncpy0(char* dest, const char* src, size_t size)
{
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(dest, src, size - 1);
+#pragma GCC diagnostic pop
dest[size - 1] = '\0';
return dest;
}
diff --git a/fusee/fusee-secondary/src/lib/ini.c b/fusee/fusee-secondary/src/lib/ini.c
index 63626c72d..ccf4640d2 100644
--- a/fusee/fusee-secondary/src/lib/ini.c
+++ b/fusee/fusee-secondary/src/lib/ini.c
@@ -70,7 +70,10 @@ static char* find_chars_or_comment(const char* s, const char* chars)
/* Version of strncpy that ensures dest (size bytes) is null-terminated. */
static char* strncpy0(char* dest, const char* src, size_t size)
{
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(dest, src, size - 1);
+#pragma GCC diagnostic pop
dest[size - 1] = '\0';
return dest;
}
diff --git a/fusee/fusee-secondary/src/nxboot.c b/fusee/fusee-secondary/src/nxboot.c
index 07974428f..d82b9b1eb 100644
--- a/fusee/fusee-secondary/src/nxboot.c
+++ b/fusee/fusee-secondary/src/nxboot.c
@@ -119,10 +119,16 @@ static int emummc_ini_handler(void *user, const char *section, const char *name,
} else if (strcmp(name, EMUMMC_ID_KEY) == 0) {
sscanf(value, "%lx", &emummc_cfg->id);
} else if (strcmp(name, EMUMMC_PATH_KEY) == 0) {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(emummc_cfg->path, value, sizeof(emummc_cfg->path) - 1);
+#pragma GCC diagnostic pop
emummc_cfg->path[sizeof(emummc_cfg->path) - 1] = '\0';
} else if (strcmp(name, EMUMMC_NINTENDO_PATH_KEY) == 0) {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(emummc_cfg->nintendo_path, value, sizeof(emummc_cfg->nintendo_path) - 1);
+#pragma GCC diagnostic pop
emummc_cfg->nintendo_path[sizeof(emummc_cfg->nintendo_path) - 1] = '\0';
} else {
return 0;
@@ -356,7 +362,10 @@ static bool nxboot_configure_emummc(exo_emummc_config_t *exo_emummc_config) {
/* Initialize values from emummc config. */
exo_emummc_config->base_cfg.id = emummc_cfg.id;
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(exo_emummc_config->emu_dir_path, emummc_cfg.nintendo_path, sizeof(exo_emummc_config->emu_dir_path));
+#pragma GCC diagnostic pop
exo_emummc_config->emu_dir_path[sizeof(exo_emummc_config->emu_dir_path) - 1] = '\0';
if (emummc_cfg.enabled) {
@@ -370,7 +379,10 @@ static bool nxboot_configure_emummc(exo_emummc_config_t *exo_emummc_config) {
}
} else if (is_valid_folder(emummc_cfg.path)) {
exo_emummc_config->base_cfg.type = EMUMMC_TYPE_FILES;
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(exo_emummc_config->file_cfg.path, emummc_cfg.path, sizeof(exo_emummc_config->file_cfg.path));
+#pragma GCC diagnostic pop
exo_emummc_config->file_cfg.path[sizeof(exo_emummc_config->file_cfg.path) - 1] = '\0';
int num_parts = 0;
diff --git a/libraries/config/common.mk b/libraries/config/common.mk
index 964a7d0aa..4d68b232e 100644
--- a/libraries/config/common.mk
+++ b/libraries/config/common.mk
@@ -18,7 +18,7 @@ export ATMOSPHERE_DEFINES := -DATMOSPHERE
export ATMOSPHERE_SETTINGS := -fPIE -g
export ATMOSPHERE_CFLAGS := -Wall -ffunction-sections -fdata-sections -fno-strict-aliasing -fwrapv \
-fno-asynchronous-unwind-tables -fno-unwind-tables -fno-stack-protector
-export ATMOSPHERE_CXXFLAGS := -fno-rtti -fno-exceptions -std=gnu++17
+export ATMOSPHERE_CXXFLAGS := -fno-rtti -fno-exceptions -std=gnu++20
export ATMOSPHERE_ASFLAGS :=
diff --git a/libraries/libmesosphere/Makefile b/libraries/libmesosphere/Makefile
index c9c190e90..747fd2856 100644
--- a/libraries/libmesosphere/Makefile
+++ b/libraries/libmesosphere/Makefile
@@ -6,8 +6,7 @@ include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../config/common.mk
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
-#PRECOMPILED_HEADERS := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/include/mesosphere.hpp
-PRECOMPILED_HEADERS :=
+PRECOMPILED_HEADERS := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/include/mesosphere.hpp
DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_MESOSPHERE
SETTINGS := $(ATMOSPHERE_SETTINGS) -O2 -mgeneral-regs-only -ffixed-x18 -Werror -fno-non-call-exceptions
@@ -122,6 +121,8 @@ $(filter-out kern_svc_tables.o, $(OFILES)) : $(GCH_FILES)
$(OFILES_SRC) : $(HFILES_BIN)
+kern_libc_generic.o: CFLAGS += -fno-builtin
+
#---------------------------------------------------------------------------------
%_bin.h %.bin.o : %.bin
#---------------------------------------------------------------------------------
diff --git a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_controller.hpp b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_controller.hpp
index a6d7a180e..ce276c1a7 100644
--- a/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_controller.hpp
+++ b/libraries/libmesosphere/include/mesosphere/arch/arm64/kern_k_interrupt_controller.hpp
@@ -72,7 +72,7 @@ namespace ams::kern::arch::arm64 {
SgirTargetListFilter_Reserved = (3 << 24),
};
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
static_assert(sizeof(GicDistributor) == 0x1000);
struct GicCpuInterface {
@@ -98,7 +98,7 @@ namespace ams::kern::arch::arm64 {
u32 dir;
u32 _0x1004[1023];
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
static_assert(sizeof(GicCpuInterface) == 0x2000);
struct KInterruptController {
@@ -164,11 +164,11 @@ namespace ams::kern::arch::arm64 {
}
void SetTarget(s32 irq, s32 core_id) const {
- this->gicd->itargetsr.bytes[irq] |= GetGicMask(core_id);
+ this->gicd->itargetsr.bytes[irq] = this->gicd->itargetsr.bytes[irq] | GetGicMask(core_id);
}
void ClearTarget(s32 irq, s32 core_id) const {
- this->gicd->itargetsr.bytes[irq] &= ~GetGicMask(core_id);
+ this->gicd->itargetsr.bytes[irq] = this->gicd->itargetsr.bytes[irq] & ~GetGicMask(core_id);
}
void SetPriorityLevel(s32 irq, s32 level) const {
diff --git a/libraries/libmesosphere/include/mesosphere/init/kern_init_layout.hpp b/libraries/libmesosphere/include/mesosphere/init/kern_init_layout.hpp
index 620ef85fe..3d379ca03 100644
--- a/libraries/libmesosphere/include/mesosphere/init/kern_init_layout.hpp
+++ b/libraries/libmesosphere/include/mesosphere/init/kern_init_layout.hpp
@@ -32,7 +32,7 @@ namespace ams::kern::init {
u32 init_array_offset;
u32 init_array_end_offset;
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
static_assert(sizeof(KernelLayout) == 0x30);
}
\ No newline at end of file
diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp
index 2ffc28691..01648d3ec 100644
--- a/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp
+++ b/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp
@@ -185,10 +185,7 @@ namespace ams::kern {
T *obj;
private:
constexpr ALWAYS_INLINE void Swap(KScopedAutoObject &rhs) {
- /* TODO: C++20 constexpr std::swap */
- T *tmp = rhs.obj;
- rhs.obj = this->obj;
- this->obj = tmp;
+ std::swap(this->obj, rhs.obj);
}
public:
constexpr ALWAYS_INLINE KScopedAutoObject() : obj(nullptr) { /* ... */ }
diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_capabilities.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_capabilities.hpp
index bac44a218..72d48666a 100644
--- a/libraries/libmesosphere/include/mesosphere/kern_k_capabilities.hpp
+++ b/libraries/libmesosphere/include/mesosphere/kern_k_capabilities.hpp
@@ -64,7 +64,7 @@ namespace ams::kern {
static constexpr u32 GetCapabilityId(CapabilityType type) {
const u32 flag = GetCapabilityFlag(type);
- if (true /* C++20: std::is_constant_evaluated() */) {
+ if (std::is_constant_evaluated()) {
return CountTrailingZero(flag);
} else {
return static_cast(__builtin_ctz(flag));
@@ -84,7 +84,7 @@ namespace ams::kern {
template
static constexpr inline u32 CapabilityId = []() -> u32 {
const u32 flag = static_cast(Type) + 1;
- if (true /* C++20: std::is_constant_evaluated() */) {
+ if (std::is_constant_evaluated()) {
for (u32 i = 0; i < BITSIZEOF(u32); i++) {
if (flag & (1u << i)) {
return i;
diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_current_context.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_current_context.hpp
index ae8a7947d..442f04fed 100644
--- a/libraries/libmesosphere/include/mesosphere/kern_k_current_context.hpp
+++ b/libraries/libmesosphere/include/mesosphere/kern_k_current_context.hpp
@@ -31,8 +31,10 @@ namespace ams::kern {
s32 core_id;
void *exception_stack_top;
};
- static_assert(std::is_pod::value);
+ static_assert(std::is_standard_layout::value && std::is_trivially_destructible::value);
static_assert(sizeof(KCurrentContext) <= cpu::DataCacheLineSize);
+ static_assert(sizeof(std::atomic) == sizeof(KThread *));
+ static_assert(sizeof(std::atomic) == sizeof(KProcess *));
namespace impl {
diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_page_table_base.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_page_table_base.hpp
index 0ebfb206d..2298dd9dd 100644
--- a/libraries/libmesosphere/include/mesosphere/kern_k_page_table_base.hpp
+++ b/libraries/libmesosphere/include/mesosphere/kern_k_page_table_base.hpp
@@ -65,7 +65,7 @@ namespace ams::kern {
Node *next;
u8 buffer[PageSize - sizeof(Node *)];
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
private:
Node *root;
public:
diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_priority_queue.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_priority_queue.hpp
index 3b471b4d0..033c59373 100644
--- a/libraries/libmesosphere/include/mesosphere/kern_k_priority_queue.hpp
+++ b/libraries/libmesosphere/include/mesosphere/kern_k_priority_queue.hpp
@@ -18,39 +18,34 @@
namespace ams::kern {
- /*
- TODO: C++20
+ template
+ concept KPriorityQueueAffinityMask = !std::is_reference::value && requires (T &t) {
+ { t.GetAffinityMask() } -> std::convertible_to;
+ { t.SetAffinityMask(std::declval()) };
- template
- concept KPriorityQueueAffinityMask = !std::is_reference::value && requires (T &t) {
- { t.GetAffinityMask() } -> std::convertible_to;
- { t.SetAffinityMask(std::declval()) };
+ { t.GetAffinity(std::declval()) } -> std::same_as;
+ { t.SetAffinity(std::declval(), std::declval()) };
+ { t.SetAll() };
+ };
- { t.GetAffinity(std::declval()) } -> std::same_as;
- { t.SetAffinity(std::declval(), std::declval()) };
- { t.SetAll() };
- };
+ template
+ concept KPriorityQueueMember = !std::is_reference::value && requires (T &t) {
+ { typename T::QueueEntry() };
+ { (typename T::QueueEntry()).Initialize() };
+ { (typename T::QueueEntry()).SetPrev(std::addressof(t)) };
+ { (typename T::QueueEntry()).SetNext(std::addressof(t)) };
+ { (typename T::QueueEntry()).GetNext() } -> std::same_as;
+ { (typename T::QueueEntry()).GetPrev() } -> std::same_as;
+ { t.GetPriorityQueueEntry(std::declval()) } -> std::same_as;
- template
- concept KPriorityQueueMember = !std::is_reference::value && requires (T &t) {
- { typename T::QueueEntry() };
- { (typename T::QueueEntry()).Initialize() };
- { (typename T::QueueEntry()).SetPrev(std::addressof(t)) };
- { (typename T::QueueEntry()).SetNext(std::addressof(t)) };
- { (typename T::QueueEntry()).GetNext() } -> std::same_as;
- { (typename T::QueueEntry()).GetPrev() } -> std::same_as;
- { t.GetPriorityQueueEntry(std::declval()) } -> std::same_as;
+ { t.GetAffinityMask() };
+ { typename std::remove_cvref::type() } -> KPriorityQueueAffinityMask;
- { t.GetAffinityMask() };
- { typename std::remove_cvref::type() } -> KPriorityQueueAffinityMask;
+ { t.GetActiveCore() } -> std::convertible_to;
+ { t.GetPriority() } -> std::convertible_to;
+ };
- { t.GetActiveCore() } -> std::convertible_to;
- { t.GetPriority() } -> std::convertible_to;
- };
- */
-
-
- template /* TODO C++20: requires KPriorityQueueMember */
+ template requires KPriorityQueueMember
class KPriorityQueue {
public:
using AffinityMaskType = typename std::remove_cv().GetAffinityMask())>::type>::type;
diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_scheduler.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_scheduler.hpp
index 5fb57ad2f..2e8247f5a 100644
--- a/libraries/libmesosphere/include/mesosphere/kern_k_scheduler.hpp
+++ b/libraries/libmesosphere/include/mesosphere/kern_k_scheduler.hpp
@@ -33,8 +33,6 @@ namespace ams::kern {
NON_COPYABLE(KScheduler);
NON_MOVEABLE(KScheduler);
public:
- using LockType = KAbstractSchedulerLock;
-
static constexpr s32 HighestCoreMigrationAllowedPriority = 2;
static_assert(ams::svc::LowestThreadPriority >= HighestCoreMigrationAllowedPriority);
static_assert(ams::svc::HighestThreadPriority <= HighestCoreMigrationAllowedPriority);
@@ -50,9 +48,6 @@ namespace ams::kern {
private:
friend class KScopedSchedulerLock;
friend class KScopedSchedulerLockAndSleep;
- static bool s_scheduler_update_needed;
- static LockType s_scheduler_lock;
- static KSchedulerPriorityQueue s_priority_queue;
private:
SchedulingState state;
bool is_active;
@@ -160,6 +155,12 @@ namespace ams::kern {
}
NOINLINE u64 UpdateHighestPriorityThread(KThread *thread);
+ public:
+ using LockType = KAbstractSchedulerLock;
+ private:
+ static bool s_scheduler_update_needed;
+ static KSchedulerPriorityQueue s_priority_queue;
+ static LockType s_scheduler_lock;
};
class KScopedSchedulerLock : KScopedLock {
diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_scheduler_lock.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_scheduler_lock.hpp
index 3be30f901..355719f13 100644
--- a/libraries/libmesosphere/include/mesosphere/kern_k_scheduler_lock.hpp
+++ b/libraries/libmesosphere/include/mesosphere/kern_k_scheduler_lock.hpp
@@ -23,19 +23,14 @@ namespace ams::kern {
class KThread;
- /*
- TODO: C++20
+ template
+ concept KSchedulerLockable = !std::is_reference::value && requires(T) {
+ { T::DisableScheduling() } -> std::same_as;
+ { T::EnableScheduling(std::declval()) } -> std::same_as;
+ { T::UpdateHighestPriorityThreads() } -> std::convertible_to;
+ };
- template
- concept KSchedulerLockable = !std::is_reference::value && requires {
- { T::DisableScheduling() } -> std::same_as;
- { T::EnableScheduling(std::declval()) } -> std::same_as;
- { T::UpdateHighestPriorityThreads() } -> std::convertible_to;
- };
-
- */
-
- template /* TODO C++20: requires KSchedulerLockable */
+ template requires KSchedulerLockable
class KAbstractSchedulerLock {
private:
KAlignedSpinLock spin_lock;
diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_scoped_lock.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_scoped_lock.hpp
index fd6756b2c..8ae0fecbc 100644
--- a/libraries/libmesosphere/include/mesosphere/kern_k_scoped_lock.hpp
+++ b/libraries/libmesosphere/include/mesosphere/kern_k_scoped_lock.hpp
@@ -18,18 +18,13 @@
namespace ams::kern {
- /*
- TODO: C++20
+ template
+ concept KLockable = !std::is_reference::value && requires (T &t) {
+ { t.Lock() } -> std::same_as;
+ { t.Unlock() } -> std::same_as;
+ };
- template
- concept KLockable = !std::is_reference::value && requires (T &t) {
- { t.Lock() } -> std::same_as;
- { t.Unlock() } -> std::same_as;
- };
-
- */
-
- template /* TODO C++20: requires KLockable */
+ template requires KLockable
class KScopedLock {
NON_COPYABLE(KScopedLock);
NON_MOVEABLE(KScopedLock);
diff --git a/libraries/libmesosphere/include/mesosphere/svc/kern_svc_k_user_pointer.hpp b/libraries/libmesosphere/include/mesosphere/svc/kern_svc_k_user_pointer.hpp
index fce28f594..5d707d52e 100644
--- a/libraries/libmesosphere/include/mesosphere/svc/kern_svc_k_user_pointer.hpp
+++ b/libraries/libmesosphere/include/mesosphere/svc/kern_svc_k_user_pointer.hpp
@@ -22,47 +22,35 @@ namespace ams::kern::svc {
namespace impl {
- /* TODO: C++20
- template
- concept Pointer = std::is_pointer::value;
-
- template
- concept NonConstPointer = Pointer && !std::is_const::type>::value;
-
- template
- concept ConstPointer = Pointer && std::is_const::type>::value;
-
- template
- concept AlignedNPointer = Pointer && alignof(typename std::remove_pointer::type) >= N && util::IsAligned(sizeof(typename std::remove_pointer::type), N);
-
- template
- concept Aligned8Pointer = AlignedNPointer;
-
- template
- concept Aligned16Pointer = AlignedNPointer && Aligned8;
-
- template
- concept Aligned32Pointer = AlignedNPointer && Aligned16;
-
- template
- concept Aligned64Pointer = AlignedNPointer && Aligned32;
- */
+ template
+ concept Pointer = std::is_pointer::value;
template
- constexpr inline bool IsPointer = std::is_pointer::value;
+ concept NonConstPointer = Pointer && !std::is_const::type>::value;
template
- constexpr inline bool IsConstPointer = IsPointer && std::is_const::type>::value;
-
- template
- constexpr inline bool IsNonConstPointer = IsPointer && !std::is_const::type>::value;
+ concept ConstPointer = Pointer && std::is_const::type>::value;
template
- constexpr inline bool IsAlignedNPointer = IsPointer && alignof(typename std::remove_pointer::type) >= N && util::IsAligned(sizeof(typename std::remove_pointer::type), N);
+ concept AlignedNPointer = Pointer && alignof(typename std::remove_pointer::type) >= N && util::IsAligned(sizeof(typename std::remove_pointer::type), N);
- template /* requires Aligned8Pointer<_T> */
- class KUserPointerImplTraits {
- static_assert(IsAlignedNPointer<_T, sizeof(u8)>);
+ template
+ concept Aligned8Pointer = AlignedNPointer;
+
+ template
+ concept Aligned16Pointer = AlignedNPointer && Aligned8Pointer;
+
+ template
+ concept Aligned32Pointer = AlignedNPointer && Aligned16Pointer;
+
+ template
+ concept Aligned64Pointer = AlignedNPointer && Aligned32Pointer;
+
+ template
+ class KUserPointerImplTraits;
+
+ template requires Aligned8Pointer<_T>
+ class KUserPointerImplTraits<_T> {
public:
using T = typename std::remove_const::type>::type;
public:
@@ -77,9 +65,8 @@ namespace ams::kern::svc {
}
};
- template /* requires Aligned32Pointer<_T> */
- class KUserPointerImplTraits<_T, typename std::enable_if && !IsAlignedNPointer<_T, sizeof(u64)>>::type> {
- static_assert(IsAlignedNPointer<_T, sizeof(u32)>);
+ template requires Aligned32Pointer<_T>
+ class KUserPointerImplTraits<_T> {
public:
using T = typename std::remove_const::type>::type;
public:
@@ -94,9 +81,8 @@ namespace ams::kern::svc {
}
};
- template /* requires Aligned64Pointer<_T> */
- class KUserPointerImplTraits<_T, typename std::enable_if>::type> {
- static_assert(IsAlignedNPointer<_T, sizeof(u64)>);
+ template requires Aligned64Pointer<_T>
+ class KUserPointerImplTraits<_T> {
public:
using T = typename std::remove_const::type>::type;
public:
@@ -111,8 +97,11 @@ namespace ams::kern::svc {
}
};
- template /* requires Aligned8Pointer<_T> */
- class KUserPointerImpl : impl::KUserPointerTag {
+ template
+ class KUserPointerImpl;
+
+ template requires Aligned8Pointer<_T>
+ class KUserPointerImpl<_T> : impl::KUserPointerTag {
private:
using Traits = KUserPointerImplTraits<_T>;
protected:
@@ -170,11 +159,11 @@ namespace ams::kern::svc {
}
- template
- class KUserPointer;
+ template
+ struct KUserPointer;
- template /* requires impl::ConstPointer */
- struct KUserPointer>::type> : public impl::KUserPointerImpl {
+ template requires impl::ConstPointer
+ struct KUserPointer : public impl::KUserPointerImpl {
public:
static constexpr bool IsInput = true;
public:
@@ -186,8 +175,8 @@ namespace ams::kern::svc {
using impl::KUserPointerImpl::GetUnsafePointer;
};
- template /* requires impl::NonConstPointer */
- struct KUserPointer>::type> : public impl::KUserPointerImpl {
+ template requires impl::NonConstPointer
+ struct KUserPointer : public impl::KUserPointerImpl {
public:
static constexpr bool IsInput = false;
public:
diff --git a/libraries/libmesosphere/source/kern_k_address_space_info.cpp b/libraries/libmesosphere/source/kern_k_address_space_info.cpp
index e8c04ec91..1d81e14d7 100644
--- a/libraries/libmesosphere/source/kern_k_address_space_info.cpp
+++ b/libraries/libmesosphere/source/kern_k_address_space_info.cpp
@@ -22,19 +22,19 @@ namespace ams::kern {
constexpr uintptr_t Invalid = std::numeric_limits::max();
constexpr KAddressSpaceInfo AddressSpaceInfos[] = {
- { .bit_width = 32, .address = 2_MB, .size = 1_GB - 2_MB, KAddressSpaceInfo::Type_32Bit, },
- { .bit_width = 32, .address = 1_GB, .size = 4_GB - 1_GB, KAddressSpaceInfo::Type_Small64Bit, },
- { .bit_width = 32, .address = Invalid, .size = 1_GB, KAddressSpaceInfo::Type_Heap, },
- { .bit_width = 32, .address = Invalid, .size = 1_GB, KAddressSpaceInfo::Type_Alias, },
- { .bit_width = 36, .address = 128_MB, .size = 2_GB - 128_MB, KAddressSpaceInfo::Type_32Bit, },
- { .bit_width = 36, .address = 2_GB, .size = 64_GB - 2_GB, KAddressSpaceInfo::Type_Small64Bit, },
- { .bit_width = 36, .address = Invalid, .size = 6_GB, KAddressSpaceInfo::Type_Heap, },
- { .bit_width = 36, .address = Invalid, .size = 6_GB, KAddressSpaceInfo::Type_Alias, },
- { .bit_width = 39, .address = 128_MB, .size = 512_GB - 128_MB, KAddressSpaceInfo::Type_Large64Bit, },
- { .bit_width = 39, .address = Invalid, .size = 64_GB, KAddressSpaceInfo::Type_32Bit, },
- { .bit_width = 39, .address = Invalid, .size = 6_GB, KAddressSpaceInfo::Type_Heap, },
- { .bit_width = 39, .address = Invalid, .size = 64_GB, KAddressSpaceInfo::Type_Alias, },
- { .bit_width = 39, .address = Invalid, .size = 2_GB, KAddressSpaceInfo::Type_Stack, },
+ { .bit_width = 32, .address = 2_MB, .size = 1_GB - 2_MB, .type = KAddressSpaceInfo::Type_32Bit, },
+ { .bit_width = 32, .address = 1_GB, .size = 4_GB - 1_GB, .type = KAddressSpaceInfo::Type_Small64Bit, },
+ { .bit_width = 32, .address = Invalid, .size = 1_GB, .type = KAddressSpaceInfo::Type_Heap, },
+ { .bit_width = 32, .address = Invalid, .size = 1_GB, .type = KAddressSpaceInfo::Type_Alias, },
+ { .bit_width = 36, .address = 128_MB, .size = 2_GB - 128_MB, .type = KAddressSpaceInfo::Type_32Bit, },
+ { .bit_width = 36, .address = 2_GB, .size = 64_GB - 2_GB, .type = KAddressSpaceInfo::Type_Small64Bit, },
+ { .bit_width = 36, .address = Invalid, .size = 6_GB, .type = KAddressSpaceInfo::Type_Heap, },
+ { .bit_width = 36, .address = Invalid, .size = 6_GB, .type = KAddressSpaceInfo::Type_Alias, },
+ { .bit_width = 39, .address = 128_MB, .size = 512_GB - 128_MB, .type = KAddressSpaceInfo::Type_Large64Bit, },
+ { .bit_width = 39, .address = Invalid, .size = 64_GB, .type = KAddressSpaceInfo::Type_32Bit, },
+ { .bit_width = 39, .address = Invalid, .size = 6_GB, .type = KAddressSpaceInfo::Type_Heap, },
+ { .bit_width = 39, .address = Invalid, .size = 64_GB, .type = KAddressSpaceInfo::Type_Alias, },
+ { .bit_width = 39, .address = Invalid, .size = 2_GB, .type = KAddressSpaceInfo::Type_Stack, },
};
constexpr bool IsAllowedIndexForAddress(size_t index) {
diff --git a/libraries/libmesosphere/source/kern_k_object_name.cpp b/libraries/libmesosphere/source/kern_k_object_name.cpp
index 763122450..b5fd505a4 100644
--- a/libraries/libmesosphere/source/kern_k_object_name.cpp
+++ b/libraries/libmesosphere/source/kern_k_object_name.cpp
@@ -19,9 +19,8 @@ namespace ams::kern {
namespace {
- /* TODO: C++20 constinit */
- KLightLock g_object_list_lock;
- KObjectName::List g_object_list;
+ constinit KLightLock g_object_list_lock;
+ constinit KObjectName::List g_object_list;
}
diff --git a/libraries/libstratosphere/Makefile b/libraries/libstratosphere/Makefile
index 15aad5a6c..a87f062f5 100644
--- a/libraries/libstratosphere/Makefile
+++ b/libraries/libstratosphere/Makefile
@@ -15,6 +15,8 @@ include $(DEVKITPRO)/libnx/switch_rules
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
+PRECOMPILED_HEADERS := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/include/stratosphere.hpp
+
DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_STRATOSPHERE -D_GNU_SOURCE
SETTINGS := $(ATMOSPHERE_SETTINGS) -O2
CFLAGS := $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE)
@@ -40,7 +42,7 @@ LIBDIRS := $(PORTLIBS) $(LIBNX) $(ATMOSPHERE_LIBRARIES_DIR)/libvapours
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
-export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
+export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) $(CURDIR)/include \
$(foreach dir,$(DATA),$(CURDIR)/$(dir))
CFILES := $(foreach dir,$(SOURCES),$(filter-out $(notdir $(wildcard $(dir)/*.arch.*.c)) $(notdir $(wildcard $(dir)/*.board.*.c)) $(notdir $(wildcard $(dir)/*.os.*.c)), \
@@ -77,6 +79,7 @@ endif
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
+export GCH_FILES := $(foreach hdr,$(PRECOMPILED_HEADERS:.hpp=.gch),$(notdir $(hdr)))
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES)))
@@ -125,6 +128,8 @@ DEPENDS := $(OFILES:.o=.d)
#---------------------------------------------------------------------------------
$(OUTPUT) : $(OFILES)
+$(OFILES) : $(GCH_FILES)
+
$(OFILES_SRC) : $(HFILES_BIN)
#---------------------------------------------------------------------------------
diff --git a/libraries/libstratosphere/include/stratosphere/ams/ams_types.hpp b/libraries/libstratosphere/include/stratosphere/ams/ams_types.hpp
index 73b69fba7..b16de724b 100644
--- a/libraries/libstratosphere/include/stratosphere/ams/ams_types.hpp
+++ b/libraries/libstratosphere/include/stratosphere/ams/ams_types.hpp
@@ -104,7 +104,7 @@ namespace ams {
};
static_assert(sizeof(FatalErrorContext) == 0x450, "sizeof(FatalErrorContext)");
- static_assert(std::is_pod::value, "FatalErrorContext");
+ static_assert(util::is_pod::value, "FatalErrorContext");
#ifdef ATMOSPHERE_GIT_BRANCH
NX_CONSTEXPR const char *GetGitBranch() {
diff --git a/libraries/libstratosphere/include/stratosphere/capsrv/capsrv_screen_shot_decode_option.hpp b/libraries/libstratosphere/include/stratosphere/capsrv/capsrv_screen_shot_decode_option.hpp
index 5b0ba29e1..6606470b5 100644
--- a/libraries/libstratosphere/include/stratosphere/capsrv/capsrv_screen_shot_decode_option.hpp
+++ b/libraries/libstratosphere/include/stratosphere/capsrv/capsrv_screen_shot_decode_option.hpp
@@ -41,6 +41,6 @@ namespace ams::capsrv {
};
static_assert(sizeof(ScreenShotDecodeOption) == 0x20);
static_assert(sizeof(ScreenShotDecodeOption) == sizeof(::CapsScreenShotDecodeOption));
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
}
diff --git a/libraries/libstratosphere/include/stratosphere/cfg/cfg_types.hpp b/libraries/libstratosphere/include/stratosphere/cfg/cfg_types.hpp
index 6f2bffc40..b7d5847f0 100644
--- a/libraries/libstratosphere/include/stratosphere/cfg/cfg_types.hpp
+++ b/libraries/libstratosphere/include/stratosphere/cfg/cfg_types.hpp
@@ -49,7 +49,7 @@ namespace ams::cfg {
};
static_assert(sizeof(OverrideStatus) == 0x10, "sizeof(OverrideStatus)");
- static_assert(std::is_pod::value, "std::is_pod::value");
+ static_assert(util::is_pod::value, "util::is_pod::value");
constexpr inline bool operator==(const OverrideStatus &lhs, const OverrideStatus &rhs) {
return std::memcmp(&lhs, &rhs, sizeof(lhs)) == 0;
diff --git a/libraries/libstratosphere/include/stratosphere/dmnt/dmnt_cheat_types.hpp b/libraries/libstratosphere/include/stratosphere/dmnt/dmnt_cheat_types.hpp
index 017e73407..53ab40bf8 100644
--- a/libraries/libstratosphere/include/stratosphere/dmnt/dmnt_cheat_types.hpp
+++ b/libraries/libstratosphere/include/stratosphere/dmnt/dmnt_cheat_types.hpp
@@ -36,7 +36,7 @@ namespace ams::dmnt::cheat {
u8 main_nso_build_id[0x20];
};
- static_assert(std::is_pod::value && sizeof(CheatProcessMetadata) == 0x70, "CheatProcessMetadata definition!");
+ static_assert(util::is_pod::value && sizeof(CheatProcessMetadata) == 0x70, "CheatProcessMetadata definition!");
struct CheatDefinition : sf::LargeData, sf::PrefersMapAliasTransferMode {
char readable_name[0x40];
@@ -50,8 +50,8 @@ namespace ams::dmnt::cheat {
CheatDefinition definition;
};
- static_assert(std::is_pod::value, "CheatDefinition");
- static_assert(std::is_pod::value, "CheatEntry");
+ static_assert(util::is_pod::value, "CheatDefinition");
+ static_assert(util::is_pod::value, "CheatEntry");
struct FrozenAddressValue {
u64 value;
diff --git a/libraries/libstratosphere/include/stratosphere/erpt/erpt_types.hpp b/libraries/libstratosphere/include/stratosphere/erpt/erpt_types.hpp
index bc29605e2..d26cf6e16 100644
--- a/libraries/libstratosphere/include/stratosphere/erpt/erpt_types.hpp
+++ b/libraries/libstratosphere/include/stratosphere/erpt/erpt_types.hpp
@@ -108,7 +108,7 @@ namespace ams::erpt {
};
using ReportFlagSet = util::BitFlagSet;
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
static_assert(sizeof(ReportFlagSet) == sizeof(u32));
struct ReportInfo {
@@ -149,7 +149,7 @@ namespace ams::erpt {
};
using AttachmentFlagSet = util::BitFlagSet;
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
static_assert(sizeof(AttachmentFlagSet) == sizeof(u32));
constexpr inline u32 AttachmentNameSizeMax = 0x20;
diff --git a/libraries/libstratosphere/include/stratosphere/fatal/fatal_types.hpp b/libraries/libstratosphere/include/stratosphere/fatal/fatal_types.hpp
index f2a9dc917..1228e7af5 100644
--- a/libraries/libstratosphere/include/stratosphere/fatal/fatal_types.hpp
+++ b/libraries/libstratosphere/include/stratosphere/fatal/fatal_types.hpp
@@ -75,44 +75,44 @@ namespace ams::fatal {
static constexpr size_t MaxStackTraceDepth = 0x20;
static constexpr const char *RegisterNameStrings[RegisterName_Count] = {
- u8"X0",
- u8"X1",
- u8"X2",
- u8"X3",
- u8"X4",
- u8"X5",
- u8"X6",
- u8"X7",
- u8"X8",
- u8"X9",
- u8"X10",
- u8"X11",
- u8"X12",
- u8"X13",
- u8"X14",
- u8"X15",
- u8"X16",
- u8"X17",
- u8"X18",
- u8"X19",
- u8"X20",
- u8"X21",
- u8"X22",
- u8"X23",
- u8"X24",
- u8"X25",
- u8"X26",
- u8"X27",
- u8"X28",
- u8"FP",
- u8"LR",
- u8"SP",
- u8"PC",
- u8"PState",
- u8"Afsr0",
- u8"Afsr1",
- u8"Esr",
- u8"Far",
+ "X0",
+ "X1",
+ "X2",
+ "X3",
+ "X4",
+ "X5",
+ "X6",
+ "X7",
+ "X8",
+ "X9",
+ "X10",
+ "X11",
+ "X12",
+ "X13",
+ "X14",
+ "X15",
+ "X16",
+ "X17",
+ "X18",
+ "X19",
+ "X20",
+ "X21",
+ "X22",
+ "X23",
+ "X24",
+ "X25",
+ "X26",
+ "X27",
+ "X28",
+ "FP",
+ "LR",
+ "SP",
+ "PC",
+ "PState",
+ "Afsr0",
+ "Afsr1",
+ "Esr",
+ "Far",
};
/* Registers, exception context. N left names for these fields in fatal .rodata. */
@@ -209,27 +209,27 @@ namespace ams::fatal {
static constexpr size_t MaxStackTraceDepth = 0x20;
static constexpr const char *RegisterNameStrings[RegisterName_Count] = {
- u8"R0",
- u8"R1",
- u8"R2",
- u8"R3",
- u8"R4",
- u8"R5",
- u8"R6",
- u8"R7",
- u8"R8",
- u8"R9",
- u8"R10",
- u8"FP",
- u8"IP",
- u8"LR",
- u8"SP",
- u8"PC",
- u8"PState",
- u8"Afsr0",
- u8"Afsr1",
- u8"Esr",
- u8"Far",
+ "R0",
+ "R1",
+ "R2",
+ "R3",
+ "R4",
+ "R5",
+ "R6",
+ "R7",
+ "R8",
+ "R9",
+ "R10",
+ "FP",
+ "IP",
+ "LR",
+ "SP",
+ "PC",
+ "PState",
+ "Afsr0",
+ "Afsr1",
+ "Esr",
+ "Far",
};
/* Registers, exception context. N left names for these fields in fatal .rodata. */
@@ -311,9 +311,9 @@ namespace ams::fatal {
}
};
- static_assert(std::is_pod::value && sizeof(aarch64::CpuContext) == 0x248, "aarch64::CpuContext definition!");
- static_assert(std::is_pod::value && sizeof(aarch32::CpuContext) == 0xE0, "aarch32::CpuContext definition!");
- static_assert(std::is_pod::value && sizeof(CpuContext) == 0x250, "CpuContext definition!");
+ static_assert(util::is_pod::value && sizeof(aarch64::CpuContext) == 0x248, "aarch64::CpuContext definition!");
+ static_assert(util::is_pod::value && sizeof(aarch32::CpuContext) == 0xE0, "aarch32::CpuContext definition!");
+ static_assert(util::is_pod::value && sizeof(CpuContext) == 0x250, "CpuContext definition!");
namespace srv {
diff --git a/libraries/libstratosphere/include/stratosphere/fs/fs_common.hpp b/libraries/libstratosphere/include/stratosphere/fs/fs_common.hpp
index 4f6a6436d..e91ae9835 100644
--- a/libraries/libstratosphere/include/stratosphere/fs/fs_common.hpp
+++ b/libraries/libstratosphere/include/stratosphere/fs/fs_common.hpp
@@ -43,6 +43,6 @@ namespace ams::fs {
return this->Get();
}
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
}
\ No newline at end of file
diff --git a/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_hierarchical_rom_file_table.hpp b/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_hierarchical_rom_file_table.hpp
index d2306154b..25651f7e3 100644
--- a/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_hierarchical_rom_file_table.hpp
+++ b/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_hierarchical_rom_file_table.hpp
@@ -28,7 +28,7 @@ namespace ams::fs {
Position next_dir;
Position next_file;
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
using DirectoryInfo = RomDirectoryInfo;
using FileInfo = RomFileInfo;
@@ -56,13 +56,13 @@ namespace ams::fs {
Position dir;
Position file;
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
struct RomFileEntry {
Position next;
FileInfo info;
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
static constexpr inline u32 MaxKeyLength = RomPathTool::MaxPathLength;
@@ -109,7 +109,7 @@ namespace ams::fs {
return RomPathTool::IsEqualPath(reinterpret_cast(aux_lhs), reinterpret_cast(aux_rhs), aux_lhs_size / sizeof(RomPathChar));
}
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
struct EntryKey {
RomEntryKey key;
@@ -126,7 +126,7 @@ namespace ams::fs {
return hash;
}
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
using DirectoryEntryMapTable = EntryMapTable;
using FileEntryMapTable = EntryMapTable;
diff --git a/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_rom_key_value_storage.hpp b/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_rom_key_value_storage.hpp
index 044e17b78..455f1cdff 100644
--- a/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_rom_key_value_storage.hpp
+++ b/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_rom_key_value_storage.hpp
@@ -31,7 +31,7 @@ namespace ams::fs {
BucketIndex ind;
Position pos;
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
private:
static constexpr inline Position InvalidPosition = ~Position();
@@ -41,7 +41,7 @@ namespace ams::fs {
Position next;
u32 size;
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
private:
s64 bucket_count;
SubStorage bucket_storage;
diff --git a/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_rom_path_tool.hpp b/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_rom_path_tool.hpp
index c57b1fe9d..7fc957c92 100644
--- a/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_rom_path_tool.hpp
+++ b/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_rom_path_tool.hpp
@@ -26,7 +26,7 @@ namespace ams::fs {
size_t length;
const RomPathChar *path;
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
constexpr void InitializeRomEntryName(RomEntryName *entry) {
AMS_ABORT_UNLESS(entry != nullptr);
diff --git a/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_rom_types.hpp b/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_rom_types.hpp
index 86a646e45..f746af65e 100644
--- a/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_rom_types.hpp
+++ b/libraries/libstratosphere/include/stratosphere/fs/fs_dbm_rom_types.hpp
@@ -34,19 +34,19 @@ namespace ams::fs {
s64 file_entry_size;
s64 body_offset;
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
static_assert(sizeof(RomFileSystemInformation) == 0x50);
struct RomDirectoryInfo {
/* ... */
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
struct RomFileInfo {
Int64 offset;
Int64 size;
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
namespace RomStringTraits {
diff --git a/libraries/libstratosphere/include/stratosphere/fs/fs_file.hpp b/libraries/libstratosphere/include/stratosphere/fs/fs_file.hpp
index 51fab7070..36e7d790b 100644
--- a/libraries/libstratosphere/include/stratosphere/fs/fs_file.hpp
+++ b/libraries/libstratosphere/include/stratosphere/fs/fs_file.hpp
@@ -34,7 +34,7 @@ namespace ams::fs {
return !(lhs == rhs);
}
- static_assert(std::is_pod::value && sizeof(ReadOption) == sizeof(u32));
+ static_assert(util::is_pod::value && sizeof(ReadOption) == sizeof(u32));
struct WriteOption {
u32 value;
@@ -58,7 +58,7 @@ namespace ams::fs {
return !(lhs == rhs);
}
- static_assert(std::is_pod::value && sizeof(WriteOption) == sizeof(u32));
+ static_assert(util::is_pod::value && sizeof(WriteOption) == sizeof(u32));
struct FileHandle {
void *handle;
diff --git a/libraries/libstratosphere/include/stratosphere/fs/fs_memory_management.hpp b/libraries/libstratosphere/include/stratosphere/fs/fs_memory_management.hpp
index cc9a31a2f..03e344745 100644
--- a/libraries/libstratosphere/include/stratosphere/fs/fs_memory_management.hpp
+++ b/libraries/libstratosphere/include/stratosphere/fs/fs_memory_management.hpp
@@ -42,7 +42,7 @@ namespace ams::fs {
template
std::unique_ptr MakeUnique() {
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
return std::unique_ptr(static_cast(::ams::fs::impl::Allocate(sizeof(T))), Deleter(sizeof(T)));
}
diff --git a/libraries/libstratosphere/include/stratosphere/fs/fs_query_range.hpp b/libraries/libstratosphere/include/stratosphere/fs/fs_query_range.hpp
index 5cdc45c21..1c0fbdebf 100644
--- a/libraries/libstratosphere/include/stratosphere/fs/fs_query_range.hpp
+++ b/libraries/libstratosphere/include/stratosphere/fs/fs_query_range.hpp
@@ -36,7 +36,7 @@ namespace ams::fs {
}
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
static_assert(sizeof(QueryRangeInfo) == 0x40);
static_assert(sizeof(QueryRangeInfo) == sizeof(::FsRangeInfo));
diff --git a/libraries/libstratosphere/include/stratosphere/fs/fs_rights_id.hpp b/libraries/libstratosphere/include/stratosphere/fs/fs_rights_id.hpp
index e13bca7bf..9dae55eb5 100644
--- a/libraries/libstratosphere/include/stratosphere/fs/fs_rights_id.hpp
+++ b/libraries/libstratosphere/include/stratosphere/fs/fs_rights_id.hpp
@@ -23,7 +23,7 @@ namespace ams::fs {
u64 data64[2];
};
static_assert(sizeof(RightsId) == 0x10);
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
inline bool operator==(const RightsId &lhs, const RightsId &rhs) {
return std::memcmp(std::addressof(lhs), std::addressof(rhs), sizeof(RightsId)) == 0;
diff --git a/libraries/libstratosphere/include/stratosphere/fs/fs_save_data_types.hpp b/libraries/libstratosphere/include/stratosphere/fs/fs_save_data_types.hpp
index 8d49efe3f..e663d67dc 100644
--- a/libraries/libstratosphere/include/stratosphere/fs/fs_save_data_types.hpp
+++ b/libraries/libstratosphere/include/stratosphere/fs/fs_save_data_types.hpp
@@ -51,7 +51,7 @@ namespace ams::fs {
struct UserId {
u64 data[2];
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
constexpr inline bool operator<(const UserId &lhs, const UserId &rhs) {
if (lhs.data[0] < rhs.data[0]) {
@@ -92,7 +92,7 @@ namespace ams::fs {
bool pseudo;
u8 reserved[0x1A];
};
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
static_assert(sizeof(SaveDataCreationInfo) == 0x40);
struct SaveDataAttribute {
@@ -154,6 +154,6 @@ namespace ams::fs {
u8 unused[0x190];
};
static_assert(sizeof(SaveDataExtraData) == 0x200);
- static_assert(std::is_pod::value);
+ static_assert(util::is_pod::value);
}
diff --git a/libraries/libstratosphere/include/stratosphere/fssrv/fssrv_sf_path.hpp b/libraries/libstratosphere/include/stratosphere/fssrv/fssrv_sf_path.hpp
index a847a258d..16d7976de 100644
--- a/libraries/libstratosphere/include/stratosphere/fssrv/fssrv_sf_path.hpp
+++ b/libraries/libstratosphere/include/stratosphere/fssrv/fssrv_sf_path.hpp
@@ -43,7 +43,7 @@ namespace ams::fssrv::sf {
}
};
- static_assert(std::is_pod::value && sizeof(Path) == FS_MAX_PATH);
+ static_assert(util::is_pod