632a4c9326
Many changes to code structure are included: - removed TIME_SLICE_IN_MS - removed sychronized_indexed_list - removed region_owned - kernel_owned move to kernel.h, task_owned moved to task.h - global configs moved to rust_globals.h - changed #pragma once to standard guard in rust_upcall.h - got rid of memory.h
40 lines
691 B
C
40 lines
691 B
C
#ifndef RUST_STACK_H
|
|
#define RUST_STACK_H
|
|
|
|
#include "rust_globals.h"
|
|
#include "memory_region.h"
|
|
|
|
struct rust_task;
|
|
|
|
struct stk_seg {
|
|
stk_seg *prev;
|
|
stk_seg *next;
|
|
uintptr_t end;
|
|
unsigned int valgrind_id;
|
|
#ifndef _LP64
|
|
uint32_t pad;
|
|
#endif
|
|
|
|
rust_task *task;
|
|
uintptr_t canary;
|
|
|
|
uint8_t data[];
|
|
};
|
|
|
|
stk_seg *
|
|
create_stack(memory_region *region, size_t sz);
|
|
|
|
void
|
|
destroy_stack(memory_region *region, stk_seg *stk);
|
|
|
|
// Must be called before each time a stack is reused to tell valgrind
|
|
// that the stack is accessible.
|
|
void
|
|
reuse_valgrind_stack(stk_seg *stk, uint8_t *sp);
|
|
|
|
// Run a sanity check
|
|
void
|
|
check_stack_canary(stk_seg *stk);
|
|
|
|
#endif /* RUST_STACK_H */
|