refactor: move WASM macros to wasm_types.h

master
Sean McBride 4 years ago
parent d95f25c46d
commit 8578176b98

@ -1,5 +1,6 @@
{
"files.associations": {
"*.ld": "llvm",
"*.inc": "cpp",
"arm_nnexamples_cifar10_parameter.h": "c",
"arm_nnexamples_cifar10_weights.h": "c",
@ -87,7 +88,8 @@
"debuglog.h": "c",
"worker_thread_execute_epoll_loop.h": "c",
"sandbox_set_as_running.h": "c",
"sandbox_summarize_page_allocations.h": "c"
"sandbox_summarize_page_allocations.h": "c",
"wasm_types.h": "c"
},
"files.exclude": {
"**/.git": true,

@ -21,12 +21,6 @@
#define PAGE_ALIGNED __attribute__((aligned(PAGE_SIZE)))
#define WEAK __attribute__((weak))
/* FIXME: per-module configuration? Issue #101 */
#define WASM_PAGE_SIZE (1024 * 64) /* 64KB */
#define WASM_START_PAGES (1 << 8) /* 16MB */
#define WASM_MAX_PAGES (1 << 15) /* 4GB */
#define WASM_STACK_SIZE (1 << 19) /* 512KB */
/* These are per module symbols and I'd need to dlsym for each module. instead just use global constants, see above
macros. The code generator compiles in the starting number of wasm pages, and the maximum number of pages If we try
and allocate more than max_pages, we should fault */

@ -2,6 +2,12 @@
#include <stdint.h>
/* FIXME: per-module configuration? Issue #101 */
#define WASM_PAGE_SIZE (1024 * 64) /* 64KB */
#define WASM_START_PAGES (1 << 8) /* 16MB */
#define WASM_MAX_PAGES (1 << 15) /* 4GB */
#define WASM_STACK_SIZE (1 << 19) /* 512KB */
/* bytes, not wasm pages */
struct wasm_memory {
void * start; /* after sandbox struct */

Loading…
Cancel
Save