From 6478ff9b84fdbd86de8107dd4c92ac521a6c5533 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Thu, 16 Apr 2020 10:42:24 -0400 Subject: [PATCH] feat: WIP ps --- .../include/sandbox_request_scheduler_ps.h | 8 ++++ runtime/src/sandbox_request_scheduler_ps.c | 44 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 runtime/include/sandbox_request_scheduler_ps.h create mode 100644 runtime/src/sandbox_request_scheduler_ps.c diff --git a/runtime/include/sandbox_request_scheduler_ps.h b/runtime/include/sandbox_request_scheduler_ps.h new file mode 100644 index 0000000..e4db8de --- /dev/null +++ b/runtime/include/sandbox_request_scheduler_ps.h @@ -0,0 +1,8 @@ +#ifndef SFRT_SANDBOX_REQUEST_SCHEDULER_PS_H +#define SFRT_SANDBOX_REQUEST_SCHEDULER_PS_H + +#include + +void sandbox_request_scheduler_ps_initialize(); + +#endif /* SFRT_SANDBOX_REQUEST_SCHEDULER_PS_H */ \ No newline at end of file diff --git a/runtime/src/sandbox_request_scheduler_ps.c b/runtime/src/sandbox_request_scheduler_ps.c new file mode 100644 index 0000000..e9a6185 --- /dev/null +++ b/runtime/src/sandbox_request_scheduler_ps.c @@ -0,0 +1,44 @@ +#include +#include "priority_queue.h" + +// Local State +static struct priority_queue sandbox_request_scheduler_ps; + +/** + * Pushes a sandbox request to the global deque + * @param sandbox_request + * @returns pointer to request if added. NULL otherwise + **/ +static sandbox_request_t * +sandbox_request_scheduler_ps_add(void *sandbox_request_raw) +{ + // TODO +} + +/** + * + * @returns A Sandbox Request or NULL + **/ +static sandbox_request_t * +sandbox_request_scheduler_ps_remove(void) +{ + // TODO +} + +/** + * + **/ +void +sandbox_request_scheduler_ps_initialize() +{ + // Initialize local state + + // TODO + + + // Register Function Pointers for Abstract Scheduling API + sandbox_request_scheduler_config_t config = { .add = sandbox_request_scheduler_ps_add, + .remove = sandbox_request_scheduler_ps_remove }; + + sandbox_request_scheduler_initialize(&config); +} \ No newline at end of file