rust/src/rt/rust_stack.h

36 lines
625 B
C
Raw Normal View History

#ifndef RUST_STACK_H
#define RUST_STACK_H
2012-02-27 17:42:22 -06:00
#include "memory_region.h"
struct stk_seg {
stk_seg *prev;
stk_seg *next;
uintptr_t end;
unsigned int valgrind_id;
#ifndef _LP64
uint32_t pad;
#endif
uintptr_t canary;
uint8_t data[];
};
stk_seg *
2012-02-27 17:42:22 -06:00
create_stack(memory_region *region, size_t sz);
void
2012-02-27 17:42:22 -06:00
destroy_stack(memory_region *region, stk_seg *stk);
2012-02-10 13:42:33 -06:00
// 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);
2012-02-10 13:42:33 -06:00
// Run a sanity check
void
check_stack_canary(stk_seg *stk);
#endif /* RUST_STACK_H */