mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-07-04 16:42:14 +02:00
sm: add compile-time option to put a lower bound on session limits, which lets us do things like accessing fsp-ldr without killing ldr.
This time with style fixes.
This commit is contained in:
parent
40a6b7bb54
commit
3434a41e00
@ -34,7 +34,7 @@ ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE
|
|||||||
CFLAGS := -g -Wall -O2 -ffunction-sections \
|
CFLAGS := -g -Wall -O2 -ffunction-sections \
|
||||||
$(ARCH) $(DEFINES)
|
$(ARCH) $(DEFINES)
|
||||||
|
|
||||||
CFLAGS += $(INCLUDE) -D__SWITCH__ -DSM_ENABLE_SMHAX -DSM_ENABLE_MITM
|
CFLAGS += $(INCLUDE) -D__SWITCH__ -DSM_ENABLE_SMHAX -DSM_ENABLE_MITM -DSM_MINIMUM_SESSION_LIMIT=8
|
||||||
|
|
||||||
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17
|
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++17
|
||||||
|
|
||||||
|
@ -252,6 +252,12 @@ Result Registration::RegisterServiceForPid(u64 pid, u64 service, u64 max_session
|
|||||||
return 0x815;
|
return 0x815;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SM_MINIMUM_SESSION_LIMIT
|
||||||
|
if (max_sessions < SM_MINIMUM_SESSION_LIMIT) {
|
||||||
|
max_sessions = SM_MINIMUM_SESSION_LIMIT;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Registration::Service *free_service = GetFreeService();
|
Registration::Service *free_service = GetFreeService();
|
||||||
if (free_service == NULL) {
|
if (free_service == NULL) {
|
||||||
return 0xA15;
|
return 0xA15;
|
||||||
@ -289,6 +295,12 @@ Result Registration::RegisterServiceForSelf(u64 service, u64 max_sessions, bool
|
|||||||
return 0x815;
|
return 0x815;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef SM_MINIMUM_SESSION_LIMIT
|
||||||
|
if (max_sessions < SM_MINIMUM_SESSION_LIMIT) {
|
||||||
|
max_sessions = SM_MINIMUM_SESSION_LIMIT;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
Registration::Service *free_service = GetFreeService();
|
Registration::Service *free_service = GetFreeService();
|
||||||
if (free_service == NULL) {
|
if (free_service == NULL) {
|
||||||
return 0xA15;
|
return 0xA15;
|
||||||
|
Loading…
Reference in New Issue
Block a user