diff --git a/include/stratosphere/cfg/cfg_api.hpp b/include/stratosphere/cfg/cfg_api.hpp index 8c6e8cbd..9d4d88ec 100644 --- a/include/stratosphere/cfg/cfg_api.hpp +++ b/include/stratosphere/cfg/cfg_api.hpp @@ -16,6 +16,7 @@ #pragma once #include +#include "../os/os_common_types.hpp" #include "../ncm/ncm_types.hpp" namespace sts::cfg { diff --git a/include/stratosphere/ldr/ldr_types.hpp b/include/stratosphere/ldr/ldr_types.hpp index 6139cff4..ab92463e 100644 --- a/include/stratosphere/ldr/ldr_types.hpp +++ b/include/stratosphere/ldr/ldr_types.hpp @@ -20,11 +20,12 @@ #include #include "../svc/svc_types.hpp" #include "../ncm/ncm_types.hpp" +#include "../sf/sf_buffer_tags.hpp" namespace sts::ldr { /* General types. */ - struct ProgramInfo { + struct ProgramInfo : sf::LargeData { u8 main_thread_priority; u8 default_cpu_id; u16 flags; @@ -36,7 +37,7 @@ namespace sts::ldr { u32 aci_fah_size; u8 ac_buffer[0x3E0]; }; - static_assert(sizeof(ProgramInfo) == 0x400, "ProgramInfo definition!"); + static_assert(std::is_pod::value && sizeof(ProgramInfo) == 0x400, "ProgramInfo definition!"); enum ProgramInfoFlag { ProgramInfoFlag_SystemModule = (0 << 0), diff --git a/include/stratosphere/os/os_common_types.hpp b/include/stratosphere/os/os_common_types.hpp index 9c44ccdf..afdab148 100644 --- a/include/stratosphere/os/os_common_types.hpp +++ b/include/stratosphere/os/os_common_types.hpp @@ -15,6 +15,8 @@ */ #pragma once #include +#include "../results.hpp" +#include "../util.hpp" namespace sts::os { diff --git a/include/stratosphere/sf/sf_buffer_tags.hpp b/include/stratosphere/sf/sf_buffer_tags.hpp new file mode 100644 index 00000000..2c278f70 --- /dev/null +++ b/include/stratosphere/sf/sf_buffer_tags.hpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018-2019 Atmosphère-NX + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +namespace sts::sf { + + /* Helper structs for serialization of buffers. */ + struct LargeData{}; + + struct PrefersMapAliasTransferMode{}; + + struct PrefersPointerTransferMode{}; + + struct PrefersAutoSelectTransferMode{}; + +} \ No newline at end of file diff --git a/include/stratosphere/sf/sf_buffers.hpp b/include/stratosphere/sf/sf_buffers.hpp index 063a5a76..03e03fca 100644 --- a/include/stratosphere/sf/sf_buffers.hpp +++ b/include/stratosphere/sf/sf_buffers.hpp @@ -18,6 +18,7 @@ #include "sf_common.hpp" #include "sf_out.hpp" #include "cmif/sf_cmif_pointer_and_size.hpp" +#include "sf_buffer_tags.hpp" namespace sts::sf { @@ -47,15 +48,6 @@ namespace sts::sf { } - /* Helper structs for serialization of buffers. */ - struct LargeData{}; - - struct PrefersMapAliasTransferMode{}; - - struct PrefersPointerTransferMode{}; - - struct PrefersAutoSelectTransferMode{}; - template constexpr inline bool IsLargeData = std::is_base_of::value;