提交 5d1a1dc4 编写于 作者: B Brian Anderson

rt: Rename stk_seg.limit to stk_seg.end

rust_task is using the word limit it two ways, so one has to change.
上级 3d7b89bc
......@@ -286,7 +286,6 @@ rust_scheduler::start_main_loop() {
scheduled_task->state->name);
place_task_in_tls(scheduled_task);
//pthread_setspecific(89, (void *)scheduled_task->stk->limit);
interrupt_flag = 0;
......
......@@ -51,8 +51,8 @@ new_stk(rust_scheduler *sched, rust_task *task, size_t minsz)
LOGPTR(task->sched, "new stk", (uintptr_t)stk);
memset(stk, 0, sizeof(stk_seg));
stk->next = task->stk;
stk->limit = (uintptr_t) &stk->data[minsz + RED_ZONE_SIZE];
LOGPTR(task->sched, "stk limit", stk->limit);
stk->end = (uintptr_t) &stk->data[minsz + RED_ZONE_SIZE];
LOGPTR(task->sched, "stk end", stk->end);
stk->valgrind_id =
VALGRIND_STACK_REGISTER(&stk->data[0],
&stk->data[minsz + RED_ZONE_SIZE]);
......@@ -106,7 +106,7 @@ rust_task::rust_task(rust_scheduler *sched, rust_task_list *state,
user.notify_enabled = 0;
stk = new_stk(sched, this, 0);
user.rust_sp = stk->limit;
user.rust_sp = stk->end;
if (supervisor) {
supervisor->ref();
}
......@@ -582,7 +582,7 @@ rust_task::new_stack(size_t stk_sz, void *args_addr, size_t args_sz) {
stk_seg *stk_seg = new_stk(sched, this, stk_sz + args_sz);
uint8_t *new_sp = (uint8_t*)stk_seg->limit;
uint8_t *new_sp = (uint8_t*)stk_seg->end;
size_t sizeof_retaddr = sizeof(void*);
// Make enough room on the new stack to hold the old stack pointer
// in addition to the function arguments
......@@ -608,7 +608,7 @@ rust_task::record_stack_limit() {
// account for those 256 bytes.
const unsigned LIMIT_OFFSET = 256;
A(sched,
(uintptr_t)stk->limit - RED_ZONE_SIZE
(uintptr_t)stk->end - RED_ZONE_SIZE
- (uintptr_t)stk->data >= LIMIT_OFFSET,
"Stack size must be greater than LIMIT_OFFSET");
record_sp(stk->data + LIMIT_OFFSET + RED_ZONE_SIZE);
......@@ -627,9 +627,9 @@ rust_task::reset_stack_limit() {
uintptr_t sp = get_sp();
// Not positive these bounds for sp are correct.
// I think that the first possible value for esp on a new
// stack is stk->limit, which points one word in front of
// stack is stk->end, which points one word in front of
// the first work to be pushed onto a new stack.
while (sp <= (uintptr_t)stk->data || stk->limit < sp) {
while (sp <= (uintptr_t)stk->data || stk->end < sp) {
del_stk(this, stk);
A(sched, stk != NULL, "Failed to find the current stack");
}
......
......@@ -25,7 +25,7 @@ struct rust_box;
struct stk_seg {
stk_seg *next;
uintptr_t limit;
uintptr_t end;
unsigned int valgrind_id;
#ifndef _LP64
uint32_t pad;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册