chore: organize preprocessor includes

main
Sean McBride 4 years ago
parent f45b450360
commit 5ccf8bbd87

@ -1,5 +1,6 @@
#pragma once
#include <stdint.h>
#include <unistd.h>
#include <ucontext.h>

@ -1,10 +1,11 @@
#pragma once
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <ucontext.h>
#include <unistd.h>
#include <stdbool.h>
#define ARCH_NREGS (16 /* GP registers */ + 1 /* for IP */)
#define ARCH_SIG_JMP_OFF 8

@ -1,6 +1,6 @@
#pragma once
#include <sandbox_request.h>
#include "sandbox_request.h"
/* Returns pointer back if successful, null otherwise */
typedef sandbox_request_t *(*global_request_scheduler_add_fn_t)(void *);

@ -1,5 +1,5 @@
#pragma once
#include <global_request_scheduler.h>
#include "global_request_scheduler.h"
void global_request_scheduler_deque_initialize();

@ -1,5 +1,5 @@
#pragma once
#include <global_request_scheduler.h>
#include "global_request_scheduler.h"
void global_request_scheduler_minheap_initialize();

@ -1,6 +1,6 @@
#pragma once
#include <types.h>
#include "types.h"
/* all in-memory ptrs.. don't mess around with that! */
struct http_header {

@ -1,9 +1,10 @@
#pragma once
#include <http_parser.h>
#include <types.h>
#include <sys/uio.h>
#include "types.h"
/* Conditionally load libuv */
#ifdef USE_HTTP_UVIO
#include <uv.h>

@ -1,14 +1,14 @@
#pragma once
#include <assert.h>
#include <runtime.h>
#include <sandbox.h>
#include <sys/mman.h>
#include <pthread.h>
#include <signal.h>
#include <uv.h>
#include <http_request.h>
#include "http_request.h"
#include "runtime.h"
#include "sandbox.h"
/**
* Parses data read by the libuv stream chunk-by-chunk until the message is complete
* Then stops the stream and wakes up the sandbox

@ -1,7 +1,8 @@
#pragma once
#include <stdbool.h>
#include <sandbox.h>
#include "sandbox.h"
/* Returns pointer back if successful, null otherwise */
typedef struct sandbox *(*local_runqueue_add_fn_t)(struct sandbox *);

@ -1,7 +1,8 @@
#pragma once
#include <uv.h>
#include <types.h>
#include "types.h"
struct module {
char name[MODULE_MAX_NAME_LENGTH];

@ -7,8 +7,8 @@
#include "arch/context.h"
#include "deque.h"
#include <http_request.h>
#include <http_response.h>
#include "http_request.h"
#include "http_response.h"
#include "module.h"
#include "ps_list.h"
#include "software_interrupt.h"

@ -1,8 +1,8 @@
#pragma once
#include <stdbool.h>
#include <assert.h>
#include <signal.h>
#include <stdbool.h>
/************
* Externs *

@ -11,11 +11,11 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/uio.h>
#include <time.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/uio.h>
#define EXPORT __attribute__((visibility("default")))
#define IMPORT __attribute__((visibility("default")))

@ -1,6 +1,7 @@
#pragma once
#include <uv.h>
#include "types.h"
extern __thread uv_loop_t worker_thread_uvio_handle;

@ -1,6 +1,6 @@
#if defined(AARCH64) || defined(aarch64)
#include <runtime.h>
#include "runtime.h"
unsigned long long int
__getcycles(void)

@ -1,6 +1,6 @@
#if defined(X86_64) || defined(x86_64)
#include <runtime.h>
#include "runtime.h"
unsigned long long int
__getcycles(void)

@ -1,8 +1,9 @@
/* https://github.com/gwsystems/silverfish/blob/master/runtime/libc/libc_backing.c */
#include <runtime.h>
#include <worker_thread.h>
#include <ck_pr.h>
#include "runtime.h"
#include "worker_thread.h"
extern i32 inner_syscall_handler(i32 n, i32 a, i32 b, i32 c, i32 d, i32 e, i32 f);
i32

@ -1,4 +1,4 @@
#include <global_request_scheduler.h>
#include "global_request_scheduler.h"
/* The global of our polymorphic interface */

@ -1,4 +1,4 @@
#include <global_request_scheduler.h>
#include "global_request_scheduler.h"
static struct deque_sandbox *global_request_scheduler_deque;
static pthread_mutex_t global_request_scheduler_deque_mutex = PTHREAD_MUTEX_INITIALIZER;

@ -1,4 +1,4 @@
#include <global_request_scheduler.h>
#include "global_request_scheduler.h"
#include "priority_queue.h"
static struct priority_queue global_request_scheduler_minheap;

@ -1,9 +1,10 @@
#include <http_request.h>
#include <http_response.h>
#include <http_parser_settings.h>
#include <sandbox.h>
#include <uv.h>
#include "http_request.h"
#include "http_response.h"
#include "http_parser_settings.h"
#include "sandbox.h"
static http_parser_settings runtime_http_parser_settings;
/***********************************************************************

@ -1,4 +1,4 @@
#include <http_request.h>
#include "http_request.h"
/***************************************************
* General HTTP Request Functions *

@ -1,4 +1,4 @@
#include <http_response.h>
#include "http_response.h"
#ifdef USE_HTTP_UVIO
#include <uv.h>

@ -1,4 +1,4 @@
#include <local_runqueue.h>
#include "local_runqueue.h"
static struct local_runqueue_config local_runqueue;

@ -1,18 +1,18 @@
#include <ctype.h>
#include <dlfcn.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <sched.h>
#include <sys/resource.h>
#include <sys/time.h>
#include <unistd.h>
#include <module.h>
#include <runtime.h>
#include <sandbox.h>
#include <software_interrupt.h>
#include <worker_thread.h>
#include "module.h"
#include "runtime.h"
#include "sandbox.h"
#include "software_interrupt.h"
#include "worker_thread.h"
/* Conditionally used by debuglog when DEBUG is set */
#ifdef DEBUG

@ -4,10 +4,10 @@
#include <stdlib.h>
#include <uv.h>
#include "types.h"
#include "module.h"
#include "module_database.h"
#include "runtime.h"
#include "types.h"
/*************************
* Private Static Inline *

@ -1,5 +1,4 @@
#include <module_database.h>
#include "module_database.h"
/*******************
* Module Database *

@ -1,27 +1,18 @@
/* Something is not idempotent with this or some other include. If placed in Local Includes, error is triggered that
* memset was implicitly declared */
#include <runtime.h>
/***************************
* External Includes *
**************************/
#include <pthread.h>
#include <signal.h>
#include <sched.h> /* Wasmception. Included as submodule */
#include <sys/mman.h> /* Wasmception. Included as submodule */
#include <sched.h>
#include <sys/mman.h>
#include <uv.h>
/***************************
* Local Includes *
**************************/
#include <arch/context.h>
#include <http_parser_settings.h>
#include <module.h>
#include <sandbox_request.h>
#include <global_request_scheduler_deque.h>
#include <global_request_scheduler_minheap.h>
#include <software_interrupt.h>
#include <types.h>
#include "arch/context.h"
#include "global_request_scheduler_deque.h"
#include "global_request_scheduler_minheap.h"
#include "http_parser_settings.h"
#include "module.h"
#include "runtime.h"
#include "sandbox_request.h"
#include "software_interrupt.h"
#include "types.h"
/***************************
* Shared Process State *

@ -1,7 +1,7 @@
#include <assert.h>
#include <sys/mman.h>
#include <pthread.h>
#include <signal.h>
#include <sys/mman.h>
#include <uv.h>
#include "current_sandbox.h"

@ -1,19 +1,19 @@
#include <errno.h>
#include <pthread.h>
#include <signal.h>
#include <sys/time.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <ucontext.h>
#include <types.h>
#include <sandbox.h>
#include <module.h>
#include <arch/context.h>
#include <software_interrupt.h>
#include <current_sandbox.h>
#include "arch/context.h"
#include "current_sandbox.h"
#include "local_runqueue.h"
#include "module.h"
#include "sandbox.h"
#include "software_interrupt.h"
#include "types.h"
/*******************
* Process Globals *

@ -1,27 +1,18 @@
/* Something is not idempotent with this or some other include.
If placed in Local Includes, error is triggered that memset was implicitly declared */
#include <runtime.h>
/***************************
* External Includes *
**************************/
#include <pthread.h>
#include <signal.h>
#include <sched.h> /* Wasmception. Included as submodule */
#include <sys/mman.h> /* Wasmception. Included as submodule */
#include <sched.h>
#include <sys/mman.h>
#include <uv.h>
/***************************
* Local Includes *
**************************/
#include <current_sandbox.h>
#include <global_request_scheduler.h>
#include <local_completion_queue.h>
#include <local_runqueue.h>
#include <local_runqueue_list.h>
#include <local_runqueue_minheap.h>
#include <types.h>
#include <worker_thread.h>
#include "current_sandbox.h"
#include "global_request_scheduler.h"
#include "local_completion_queue.h"
#include "local_runqueue.h"
#include "local_runqueue_list.h"
#include "local_runqueue_minheap.h"
#include "runtime.h"
#include "types.h"
#include "worker_thread.h"
/***************************
* Worker Thread State *

Loading…
Cancel
Save