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. (#136)
This time with style fixes.
This commit is contained in:
@@ -252,6 +252,12 @@ Result Registration::RegisterServiceForPid(u64 pid, u64 service, u64 max_session
|
||||
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();
|
||||
if (free_service == NULL) {
|
||||
return 0xA15;
|
||||
@@ -288,6 +294,12 @@ Result Registration::RegisterServiceForSelf(u64 service, u64 max_sessions, bool
|
||||
if (HasService(service)) {
|
||||
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();
|
||||
if (free_service == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user