#include #include #ifndef ZIVUOS_DISABLE_DYNAMIC #include #endif #include "process.h" #include "kernel.h" #include "models.h" #include "state.h" #ifndef ZV_ALLOC_STEP #define ZV_ALLOC_STEP 0x08 #endif void zv_process_init(zv_process_t *self, zv_worker_t worker) { self->worker = worker; self->state = ZV_STATE_CREATED; self->restorer->updater = (zv_updater_t) 0x00; self->param->pointer = (void *) 0x00; #ifndef ZIVUOS_DISABLE_DYNAMIC self->is_dynamic = false; #endif } #ifndef ZIVUOS_DISABLE_DYNAMIC zv_process_t * zv_process_create(zv_worker_t worker) { zv_process_t *self = (zv_process_t *) malloc(sizeof(zv_process_t)); if (self == NULL) { return NULL; } zv_process_init(self, worker); self->is_dynamic = true; return self; } #endif