|
|
@ -477,12 +477,8 @@ err_stack_allocation_failed:
|
|
|
|
* to assume that sandbox->state is garbage.
|
|
|
|
* to assume that sandbox->state is garbage.
|
|
|
|
* @param sandbox an uninitialized sandbox
|
|
|
|
* @param sandbox an uninitialized sandbox
|
|
|
|
* @param sandbox_request the request we are initializing the sandbox from
|
|
|
|
* @param sandbox_request the request we are initializing the sandbox from
|
|
|
|
* @param allocation_timestamp timestamp of when the allocation
|
|
|
|
* @param allocation_timestamp timestamp of allocation
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
* TODO: Consider zeroing out allocation of the sandbox struct to be able to assert that we are only calling this on a
|
|
|
|
|
|
|
|
* clean allocation. Additionally, we might want to shift the sandbox states up, so zero is distinct from
|
|
|
|
|
|
|
|
* SANDBOX_INITIALIZED
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
sandbox_set_as_initialized(struct sandbox *sandbox, struct sandbox_request *sandbox_request,
|
|
|
|
sandbox_set_as_initialized(struct sandbox *sandbox, struct sandbox_request *sandbox_request,
|
|
|
|
uint64_t allocation_timestamp)
|
|
|
|
uint64_t allocation_timestamp)
|
|
|
@ -541,10 +537,9 @@ sandbox_set_as_initialized(struct sandbox *sandbox, struct sandbox_request *sand
|
|
|
|
* This occurs in the following scenarios:
|
|
|
|
* This occurs in the following scenarios:
|
|
|
|
* - A sandbox in the SANDBOX_INITIALIZED state completes initialization and is ready to be run
|
|
|
|
* - A sandbox in the SANDBOX_INITIALIZED state completes initialization and is ready to be run
|
|
|
|
* - A sandbox in the SANDBOX_BLOCKED state completes what was blocking it and is ready to be run
|
|
|
|
* - A sandbox in the SANDBOX_BLOCKED state completes what was blocking it and is ready to be run
|
|
|
|
* - A sandbox in the SANDBOX_RUNNING state is preempted before competion and is ready to be run
|
|
|
|
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param sandbox
|
|
|
|
* @param sandbox
|
|
|
|
**/
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
void
|
|
|
|
sandbox_set_as_runnable(struct sandbox *sandbox)
|
|
|
|
sandbox_set_as_runnable(struct sandbox *sandbox)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -588,9 +583,7 @@ sandbox_set_as_runnable(struct sandbox *sandbox)
|
|
|
|
* - A sandbox in the PREEMPTED state is now the highest priority work to execute
|
|
|
|
* - A sandbox in the PREEMPTED state is now the highest priority work to execute
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param sandbox
|
|
|
|
* @param sandbox
|
|
|
|
* @param active_context - the worker thread context that is going to execute this sandbox. Only provided
|
|
|
|
*/
|
|
|
|
* when performing a full mcontext restore
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
sandbox_set_as_running(struct sandbox *sandbox)
|
|
|
|
sandbox_set_as_running(struct sandbox *sandbox)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -779,7 +772,7 @@ sandbox_set_as_error(struct sandbox *sandbox)
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Transitions a sandbox from the SANDBOX_RETURNED state to the SANDBOX_COMPLETE state.
|
|
|
|
* Transitions a sandbox from the SANDBOX_RETURNED state to the SANDBOX_COMPLETE state.
|
|
|
|
* Adds the sandbox to the completion queue
|
|
|
|
* Adds the sandbox to the completion queue
|
|
|
|
* @param sandbox the sandbox erroring out
|
|
|
|
* @param sandbox
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
void
|
|
|
|
sandbox_set_as_complete(struct sandbox *sandbox)
|
|
|
|
sandbox_set_as_complete(struct sandbox *sandbox)
|
|
|
@ -872,7 +865,7 @@ err:
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Free Linear Memory, leaving stack in place
|
|
|
|
* Free Linear Memory, leaving stack in place
|
|
|
|
* @param sandbox
|
|
|
|
* @param sandbox
|
|
|
|
**/
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
void
|
|
|
|
sandbox_free_linear_memory(struct sandbox *sandbox)
|
|
|
|
sandbox_free_linear_memory(struct sandbox *sandbox)
|
|
|
|
{
|
|
|
|
{
|
|
|
|