loader: update for libstratosphere refactor

This commit is contained in:
Michael Scire 2018-10-29 22:33:56 -07:00 committed by SciresM
parent 8b71378920
commit c49cfbd6af
12 changed files with 150 additions and 272 deletions

View file

@ -23,12 +23,12 @@
static std::array<LaunchQueue::LaunchItem, LAUNCH_QUEUE_SIZE> g_launch_queue = {0};
Result LaunchQueue::add(u64 tid, const char *args, u64 arg_size) {
Result LaunchQueue::Add(u64 tid, const char *args, u64 arg_size) {
if(arg_size > LAUNCH_QUEUE_ARG_SIZE_MAX) {
return 0x209;
}
int idx = get_free_index(tid);
int idx = GetFreeIndex(tid);
if(idx == LAUNCH_QUEUE_FULL)
return 0x409;
@ -39,22 +39,22 @@ Result LaunchQueue::add(u64 tid, const char *args, u64 arg_size) {
return 0x0;
}
Result LaunchQueue::add_copy(u64 tid_base, u64 tid) {
int idx = get_index(tid_base);
Result LaunchQueue::AddCopy(u64 tid_base, u64 tid) {
int idx = GetIndex(tid_base);
if (idx == LAUNCH_QUEUE_FULL) {
return 0x0;
}
return add(tid, g_launch_queue[idx].args, g_launch_queue[idx].arg_size);
return Add(tid, g_launch_queue[idx].args, g_launch_queue[idx].arg_size);
}
Result LaunchQueue::add_item(const LaunchItem *item) {
Result LaunchQueue::AddItem(const LaunchItem *item) {
if(item->arg_size > LAUNCH_QUEUE_ARG_SIZE_MAX) {
return 0x209;
}
int idx = get_free_index(item->tid);
int idx = GetFreeIndex(item->tid);
if(idx == LAUNCH_QUEUE_FULL)
return 0x409;
@ -62,7 +62,7 @@ Result LaunchQueue::add_item(const LaunchItem *item) {
return 0x0;
}
int LaunchQueue::get_index(u64 tid) {
int LaunchQueue::GetIndex(u64 tid) {
auto it = std::find_if(g_launch_queue.begin(), g_launch_queue.end(), member_equals_fn(&LaunchQueue::LaunchItem::tid, tid));
if (it == g_launch_queue.end()) {
return LAUNCH_QUEUE_FULL;
@ -70,7 +70,7 @@ int LaunchQueue::get_index(u64 tid) {
return std::distance(g_launch_queue.begin(), it);
}
int LaunchQueue::get_free_index(u64 tid) {
int LaunchQueue::GetFreeIndex(u64 tid) {
for(unsigned int i = 0; i < LAUNCH_QUEUE_SIZE; i++) {
if(g_launch_queue[i].tid == tid || g_launch_queue[i].tid == 0x0) {
return i;
@ -79,19 +79,19 @@ int LaunchQueue::get_free_index(u64 tid) {
return LAUNCH_QUEUE_FULL;
}
bool LaunchQueue::contains(u64 tid) {
return get_index(tid) != LAUNCH_QUEUE_FULL;
bool LaunchQueue::Contains(u64 tid) {
return GetIndex(tid) != LAUNCH_QUEUE_FULL;
}
void LaunchQueue::clear() {
void LaunchQueue::Clear() {
for (unsigned int i = 0; i < LAUNCH_QUEUE_SIZE; i++) {
g_launch_queue[i].tid = 0;
}
}
LaunchQueue::LaunchItem *LaunchQueue::get_item(u64 tid) {
int idx = get_index(tid);
LaunchQueue::LaunchItem *LaunchQueue::GetItem(u64 tid) {
int idx = GetIndex(tid);
if (idx == LAUNCH_QUEUE_FULL) {
return NULL;
}