Merge upstream Atmosphere master into boot-storage
This commit is contained in:
14 files changed
+178
-98
No files matched your search
+2
-2
@@ -6,7 +6,7 @@
|
||||
[subrepo]
|
||||
remote = https://github.com/Atmosphere-NX/Atmosphere-libs
|
||||
branch = master
|
||||
commit = aae2da0155a490abd3bfd17a70ccd16bb73c916a
|
||||
parent = c68e08a101353a89777eb118d6bd21d1dba98ce5
|
||||
commit = cf48d23375cf36742876f4b014971b2ebabc6dc8
|
||||
parent = ff43bc566adb33c51a43b9ef45b0d3898ad39040
|
||||
method = merge
|
||||
cmdver = 0.4.9
|
||||
@@ -358,9 +358,10 @@ namespace ams::kern::board::nintendo::nx {
|
||||
/* NOTE: On 20.0.0+ (and even more-so 21.0.0+) the browser requires much more memory in the applet pool in order to function. */
|
||||
/* Thus, we have to reduce our extra system memory size by 26 MB to compensate. */
|
||||
/* NOTE: On 23.0.0+ we are patching memory allocation for each browser applet since there are only 3 of them now. */
|
||||
/* Given that the root "Reserved" region is 0x43E000 bytes and the "ReservedTbd" subregion is 0x540000 bytes, we can safely reclaim 9MB.*/
|
||||
/* Reclaiming unused memory and lying to the browser about memory limits allows us to go back to 40 MB of extra system memory. */
|
||||
/* TODO: Deduplicate post 23.0.0 and pre 20.0.0. For now, this structure helps with readability and is still subject to change. */
|
||||
if (kern::GetTargetFirmware() >= ams::TargetFirmware_23_0_0) {
|
||||
constexpr size_t ExtraSystemMemoryForAtmosphere_23_0_0 = 16_MB;
|
||||
constexpr size_t ExtraSystemMemoryForAtmosphere_23_0_0 = 40_MB;
|
||||
return base_pool_size - ExtraSystemMemoryForAtmosphere_23_0_0 - KTraceBufferSize;
|
||||
} else if (kern::GetTargetFirmware() >= ams::TargetFirmware_21_0_0) {
|
||||
constexpr size_t ExtraSystemMemoryForAtmosphere_21_0_0 = 7_MB;
|
||||
|
||||
@@ -104,6 +104,7 @@ namespace ams::hos {
|
||||
Version_22_1_0 = ::ams::TargetFirmware_22_1_0,
|
||||
Version_22_5_0 = ::ams::TargetFirmware_22_5_0,
|
||||
Version_23_0_0 = ::ams::TargetFirmware_23_0_0,
|
||||
Version_23_0_1 = ::ams::TargetFirmware_23_0_1,
|
||||
|
||||
Version_Current = ::ams::TargetFirmware_Current,
|
||||
|
||||
|
||||
@@ -167,8 +167,13 @@ namespace ams::socket {
|
||||
int ai_family;
|
||||
int ai_socktype;
|
||||
int ai_protocol;
|
||||
#if defined(ATMOSPHERE_OS_WINDOWS)
|
||||
int ai_addrlen;
|
||||
void *ai_addr;
|
||||
#else
|
||||
socklen_t ai_addrlen;
|
||||
struct sockaddr *ai_addr;
|
||||
#endif
|
||||
struct ares_addrinfo_node *ai_next;
|
||||
};
|
||||
|
||||
|
||||
@@ -46857,14 +46857,18 @@ size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx,
|
||||
/*-*************************************
|
||||
* Dependencies
|
||||
***************************************/
|
||||
/* qsort_r is an extension. */
|
||||
#if defined(__linux) || defined(__linux__) || defined(linux) || defined(__gnu_linux__) || \
|
||||
defined(__CYGWIN__) || defined(__MSYS__)
|
||||
#if !defined(_GNU_SOURCE) && !defined(__ANDROID__) /* NDK doesn't ship qsort_r(). */
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
/* qsort_r is an extension.
|
||||
*
|
||||
* Android NDK does not ship qsort_r().
|
||||
*/
|
||||
#if (defined(__linux__) && !defined(__ANDROID__)) || defined(__CYGWIN__) || defined(__MSYS__)
|
||||
# ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define __STDC_WANT_LIB_EXT1__ 1 /* request C11 Annex K, which includes qsort_s() */
|
||||
|
||||
#include <stdio.h> /* fprintf */
|
||||
#include <stdlib.h> /* malloc, free, qsort_r */
|
||||
|
||||
@@ -46875,6 +46879,7 @@ size_t ZSTD_decompressBlock(ZSTD_DCtx* dctx,
|
||||
# define ZDICT_STATIC_LINKING_ONLY
|
||||
#endif
|
||||
|
||||
/**** skipping file: ../common/debug.h ****/
|
||||
/**** skipping file: ../common/mem.h ****/
|
||||
/**** skipping file: ../common/pool.h ****/
|
||||
/**** skipping file: ../common/threading.h ****/
|
||||
@@ -47531,6 +47536,31 @@ void COVER_dictSelectionFree(COVER_dictSelection_t selection);
|
||||
#define COVER_MAX_SAMPLES_SIZE (sizeof(size_t) == 8 ? ((unsigned)-1) : ((unsigned)1 GB))
|
||||
#define COVER_DEFAULT_SPLITPOINT 1.0
|
||||
|
||||
/**
|
||||
* Select the qsort() variant used by cover
|
||||
*/
|
||||
#define ZDICT_QSORT_MIN 0
|
||||
#define ZDICT_QSORT_C90 ZDICT_QSORT_MIN
|
||||
#define ZDICT_QSORT_GNU 1
|
||||
#define ZDICT_QSORT_APPLE 2
|
||||
#define ZDICT_QSORT_MSVC 3
|
||||
#define ZDICT_QSORT_C11 ZDICT_QSORT_MAX
|
||||
#define ZDICT_QSORT_MAX 4
|
||||
|
||||
#ifndef ZDICT_QSORT
|
||||
# if defined(__APPLE__)
|
||||
# define ZDICT_QSORT ZDICT_QSORT_APPLE /* uses qsort_r() with a different order for parameters */
|
||||
# elif (defined(__linux__) && !defined(__ANDROID__)) || defined(__CYGWIN__) || defined(__MSYS__)
|
||||
# define ZDICT_QSORT ZDICT_QSORT_GNU /* uses qsort_r() */
|
||||
# elif defined(_WIN32) && defined(_MSC_VER)
|
||||
# define ZDICT_QSORT ZDICT_QSORT_MSVC /* uses qsort_s() with a different order for parameters */
|
||||
# elif defined(STDC_LIB_EXT1) && (STDC_LIB_EXT1 > 0) /* C11 Annex K */
|
||||
# define ZDICT_QSORT ZDICT_QSORT_C11 /* uses qsort_s() */
|
||||
# else
|
||||
# define ZDICT_QSORT ZDICT_QSORT_C90 /* uses standard qsort() which is not re-entrant (requires global variable) */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*-*************************************
|
||||
* Console display
|
||||
***************************************/
|
||||
@@ -47712,8 +47742,8 @@ typedef struct {
|
||||
unsigned d;
|
||||
} COVER_ctx_t;
|
||||
|
||||
#if !defined(_GNU_SOURCE) && !defined(__APPLE__) && !defined(_MSC_VER)
|
||||
/* C90 only offers qsort() that needs a global context. */
|
||||
#if ZDICT_QSORT == ZDICT_QSORT_C90
|
||||
/* Use global context for non-reentrant sort functions */
|
||||
static COVER_ctx_t *g_coverCtx = NULL;
|
||||
#endif
|
||||
|
||||
@@ -47759,9 +47789,9 @@ static int COVER_cmp8(COVER_ctx_t *ctx, const void *lp, const void *rp) {
|
||||
/**
|
||||
* Same as COVER_cmp() except ties are broken by pointer value
|
||||
*/
|
||||
#if (defined(_WIN32) && defined(_MSC_VER)) || defined(__APPLE__)
|
||||
#if (ZDICT_QSORT == ZDICT_QSORT_MSVC) || (ZDICT_QSORT == ZDICT_QSORT_APPLE)
|
||||
static int WIN_CDECL COVER_strict_cmp(void* g_coverCtx, const void* lp, const void* rp) {
|
||||
#elif defined(_GNU_SOURCE)
|
||||
#elif (ZDICT_QSORT == ZDICT_QSORT_GNU) || (ZDICT_QSORT == ZDICT_QSORT_C11)
|
||||
static int COVER_strict_cmp(const void *lp, const void *rp, void *g_coverCtx) {
|
||||
#else /* C90 fallback.*/
|
||||
static int COVER_strict_cmp(const void *lp, const void *rp) {
|
||||
@@ -47775,9 +47805,9 @@ static int COVER_strict_cmp(const void *lp, const void *rp) {
|
||||
/**
|
||||
* Faster version for d <= 8.
|
||||
*/
|
||||
#if (defined(_WIN32) && defined(_MSC_VER)) || defined(__APPLE__)
|
||||
#if (ZDICT_QSORT == ZDICT_QSORT_MSVC) || (ZDICT_QSORT == ZDICT_QSORT_APPLE)
|
||||
static int WIN_CDECL COVER_strict_cmp8(void* g_coverCtx, const void* lp, const void* rp) {
|
||||
#elif defined(_GNU_SOURCE)
|
||||
#elif (ZDICT_QSORT == ZDICT_QSORT_GNU) || (ZDICT_QSORT == ZDICT_QSORT_C11)
|
||||
static int COVER_strict_cmp8(const void *lp, const void *rp, void *g_coverCtx) {
|
||||
#else /* C90 fallback.*/
|
||||
static int COVER_strict_cmp8(const void *lp, const void *rp) {
|
||||
@@ -47794,26 +47824,28 @@ static int COVER_strict_cmp8(const void *lp, const void *rp) {
|
||||
* Hopefully when C11 become the norm, we will be able
|
||||
* to clean it up.
|
||||
*/
|
||||
static void stableSort(COVER_ctx_t *ctx) {
|
||||
#if defined(__APPLE__)
|
||||
static void stableSort(COVER_ctx_t *ctx)
|
||||
{
|
||||
DEBUG_STATIC_ASSERT(ZDICT_QSORT_MIN <= ZDICT_QSORT && ZDICT_QSORT <= ZDICT_QSORT_MAX);
|
||||
#if (ZDICT_QSORT == ZDICT_QSORT_APPLE)
|
||||
qsort_r(ctx->suffix, ctx->suffixSize, sizeof(U32),
|
||||
ctx,
|
||||
(ctx->d <= 8 ? &COVER_strict_cmp8 : &COVER_strict_cmp));
|
||||
#elif defined(_GNU_SOURCE)
|
||||
#elif (ZDICT_QSORT == ZDICT_QSORT_GNU)
|
||||
qsort_r(ctx->suffix, ctx->suffixSize, sizeof(U32),
|
||||
(ctx->d <= 8 ? &COVER_strict_cmp8 : &COVER_strict_cmp),
|
||||
ctx);
|
||||
#elif defined(_WIN32) && defined(_MSC_VER)
|
||||
#elif (ZDICT_QSORT == ZDICT_QSORT_MSVC)
|
||||
qsort_s(ctx->suffix, ctx->suffixSize, sizeof(U32),
|
||||
(ctx->d <= 8 ? &COVER_strict_cmp8 : &COVER_strict_cmp),
|
||||
ctx);
|
||||
#elif (ZDICT_QSORT == ZDICT_QSORT_C11)
|
||||
qsort_s(ctx->suffix, ctx->suffixSize, sizeof(U32),
|
||||
(ctx->d <= 8 ? &COVER_strict_cmp8 : &COVER_strict_cmp),
|
||||
ctx);
|
||||
#elif defined(__OpenBSD__)
|
||||
g_coverCtx = ctx;
|
||||
mergesort(ctx->suffix, ctx->suffixSize, sizeof(U32),
|
||||
(ctx->d <= 8 ? &COVER_strict_cmp8 : &COVER_strict_cmp));
|
||||
#else /* C90 fallback.*/
|
||||
g_coverCtx = ctx;
|
||||
/* TODO(cavalcanti): implement a reentrant qsort() when is not available. */
|
||||
/* TODO(cavalcanti): implement a reentrant qsort() when _r is not available. */
|
||||
qsort(ctx->suffix, ctx->suffixSize, sizeof(U32),
|
||||
(ctx->d <= 8 ? &COVER_strict_cmp8 : &COVER_strict_cmp));
|
||||
#endif
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MAJOR 1
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MINOR 12
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MICRO 0
|
||||
#define ATMOSPHERE_RELEASE_VERSION_MICRO 1
|
||||
|
||||
#define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO
|
||||
|
||||
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MAJOR 23
|
||||
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 0
|
||||
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO 0
|
||||
#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO 1
|
||||
@@ -102,8 +102,9 @@
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_22_1_0 ATMOSPHERE_TARGET_FIRMWARE(22, 1, 0)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_22_5_0 ATMOSPHERE_TARGET_FIRMWARE(22, 5, 0)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_23_0_0 ATMOSPHERE_TARGET_FIRMWARE(23, 0, 0)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_23_0_1 ATMOSPHERE_TARGET_FIRMWARE(23, 0, 1)
|
||||
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_23_0_0
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_23_0_1
|
||||
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_MIN ATMOSPHERE_TARGET_FIRMWARE(0, 0, 0)
|
||||
#define ATMOSPHERE_TARGET_FIRMWARE_MAX ATMOSPHERE_TARGET_FIRMWARE_CURRENT
|
||||
@@ -198,6 +199,7 @@ namespace ams {
|
||||
TargetFirmware_22_1_0 = ATMOSPHERE_TARGET_FIRMWARE_22_1_0,
|
||||
TargetFirmware_22_5_0 = ATMOSPHERE_TARGET_FIRMWARE_22_5_0,
|
||||
TargetFirmware_23_0_0 = ATMOSPHERE_TARGET_FIRMWARE_23_0_0,
|
||||
TargetFirmware_23_0_1 = ATMOSPHERE_TARGET_FIRMWARE_23_0_1,
|
||||
|
||||
TargetFirmware_Current = ATMOSPHERE_TARGET_FIRMWARE_CURRENT,
|
||||
|
||||
|
||||
Reference in new issue
Block a user