Stratosphere: Skeleton ldr:dmnt

This commit is contained in:
Michael Scire 2018-04-18 03:30:34 -06:00
parent 21fa9ff17c
commit c4db563261
5 changed files with 65 additions and 4 deletions

View file

@ -1,11 +1,28 @@
#include <switch.h>
#include <algorithm>
#include "ldr_launch_queue.hpp"
#include <switch.h>
namespace LaunchQueue {
static LaunchItem g_launch_queue[LAUNCH_QUEUE_SIZE];
Result add(LaunchItem *item) {
Result 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);
if(idx == LAUNCH_QUEUE_FULL)
return 0x409;
g_launch_queue[idx].tid = tid;
g_launch_queue[idx].arg_size = arg_size;
std::copy(args, args + arg_size, g_launch_queue[idx].args);
return 0x0;
}
Result add_item(const LaunchItem *item) {
if(item->arg_size > LAUNCH_QUEUE_ARG_SIZE_MAX) {
return 0x209;
}