diff --git a/runtime/include/sandbox.h b/runtime/include/sandbox.h index 8b9cb2b..2c06bc7 100644 --- a/runtime/include/sandbox.h +++ b/runtime/include/sandbox.h @@ -10,7 +10,7 @@ #include #include "module.h" #include "ps_list.h" -#include "softint.h" +#include "software_interrupt.h" /************************** * Structs and Types * diff --git a/runtime/include/softint.h b/runtime/include/software_interrupt.h similarity index 83% rename from runtime/include/softint.h rename to runtime/include/software_interrupt.h index 75b953c..d935639 100644 --- a/runtime/include/softint.h +++ b/runtime/include/software_interrupt.h @@ -1,5 +1,5 @@ -#ifndef SFRT_SOFTINT_H -#define SFRT_SOFTINT_H +#ifndef SFRT_SOFTWARE_INTERRUPT_H +#define SFRT_SOFTWARE_INTERRUPT_H #include #include @@ -42,12 +42,12 @@ software_interrupt__is_enabled(void) } /** - * Blocks a signal on the current thread - * @param signal - the signal you want to block + * Masks a signal on the current thread + * @param signal - the signal you want to mask * @return 0 on success. Exits program otherwise **/ static inline int -software_interrupt__mask(int signal) +software_interrupt__mask_signal(int signal) { sigset_t set; int return_code; @@ -67,12 +67,12 @@ software_interrupt__mask(int signal) } /** - * Unblocks a signal on the current thread - * @param signal - the signal you want to block + * Unmasks a signal on the current thread + * @param signal - the signal you want to unmask * @return 0 on success. Exits program otherwise **/ static inline int -software_interrupt__unmask(int signal) +software_interrupt__unmask_signal(int signal) { sigset_t set; int return_code; @@ -99,4 +99,4 @@ void software_interrupt__initialize(void); void software_interrupt__arm_timer(void); void software_interrupt__disarm_timer(void); -#endif /* SFRT_SOFTINT_H */ +#endif /* SFRT_SOFTWARE_INTERRUPT_H */ diff --git a/runtime/src/main.c b/runtime/src/main.c index fd98e3c..f00d13c 100644 --- a/runtime/src/main.c +++ b/runtime/src/main.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include i32 log_file_descriptor = -1; u32 total_online_processors = 0; diff --git a/runtime/src/runtime.c b/runtime/src/runtime.c index b6e8228..53eed90 100644 --- a/runtime/src/runtime.c +++ b/runtime/src/runtime.c @@ -1,19 +1,28 @@ +// Something is not idempotent with this or some other include. +// If placed in Local Includes, error is triggered that memset was implicitly declared #include -#include -#include -#include + +/*************************** + * External Includes * + **************************/ +#include // POSIX Threads +#include // POSIX Signals +#include // Wasmception. Included as submodule +#include // Wasmception. Included as submodule +#include // Libub + +/*************************** + * Local Includes * + **************************/ #include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include - -#include "sandbox_request.h" /*************************** * Shared Process State * @@ -44,8 +53,8 @@ runtime__initialize(void) deque_init_sandbox(runtime__global_deque, SBOX_MAX_REQS); // Mask Signals - software_interrupt__mask(SIGUSR1); - software_interrupt__mask(SIGALRM); + software_interrupt__mask_signal(SIGUSR1); + software_interrupt__mask_signal(SIGALRM); // Initialize http_parser_settings global http_parser_settings__initialize(&runtime__http_parser_settings); @@ -417,8 +426,8 @@ worker_thread__main(void *return_code) software_interrupt__is_disabled = 0; worker_thread__next_context = NULL; #ifndef PREEMPT_DISABLE - software_interrupt__unmask(SIGALRM); - software_interrupt__unmask(SIGUSR1); + software_interrupt__unmask_signal(SIGALRM); + software_interrupt__unmask_signal(SIGUSR1); #endif uv_loop_init(&worker_thread__uvio_handle); worker_thread__is_in_callback = 0; diff --git a/runtime/src/softint.c b/runtime/src/software_interrupt.c similarity index 99% rename from runtime/src/softint.c rename to runtime/src/software_interrupt.c index f4cb05e..b20d9dc 100644 --- a/runtime/src/softint.c +++ b/runtime/src/software_interrupt.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include /***************************************