提交 637baf23 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

misc fixes

上级 ab119414
...@@ -172,7 +172,7 @@ struct crange_locked { ...@@ -172,7 +172,7 @@ struct crange_locked {
crange_locked(crange_locked &&x); crange_locked(crange_locked &&x);
~crange_locked(); ~crange_locked();
range_iterator begin() const { return range_iterator(first_); }; range_iterator begin() const { return range_iterator(first_ ?: succ_); };
range_iterator end() const { return range_iterator(succ_); }; range_iterator end() const { return range_iterator(succ_); };
void replace(range *r); void replace(range *r);
}; };
......
...@@ -218,13 +218,13 @@ tlbflush() ...@@ -218,13 +218,13 @@ tlbflush()
{ {
u64 myreq = tlbflush_req++; u64 myreq = tlbflush_req++;
cli(); pushcli();
int myid = mycpu()->id; int myid = mycpu()->id;
lcr3(rcr3()); lcr3(rcr3());
for (int i = 0; i < ncpu; i++) for (int i = 0; i < ncpu; i++)
if (i != myid) if (i != myid)
lapic_tlbflush(i); lapic_tlbflush(i);
sti(); popcli();
for (int i = 0; i < ncpu; i++) for (int i = 0; i < ncpu; i++)
if (i != myid) if (i != myid)
......
...@@ -269,8 +269,8 @@ vmap::insert(vmnode *n, uptr vma_start) ...@@ -269,8 +269,8 @@ vmap::insert(vmnode *n, uptr vma_start)
u64 len = n->npages * PGSIZE; u64 len = n->npages * PGSIZE;
auto span = cr.search_lock(vma_start, len); auto span = cr.search_lock(vma_start, len);
for (auto x __attribute__((unused)): span) { for (auto e: span) {
cprintf("vmap::insert: overlap\n"); cprintf("vmap::insert: overlap 0x%lx @ 0x%lx\n", e->size, e->key);
return -1; return -1;
} }
...@@ -297,8 +297,8 @@ vmap::remove(uptr vma_start, uptr len) ...@@ -297,8 +297,8 @@ vmap::remove(uptr vma_start, uptr len)
uptr vma_end = vma_start + len; uptr vma_end = vma_start + len;
auto span = cr.search_lock(vma_start, len); auto span = cr.search_lock(vma_start, len);
for (auto x: span) { for (auto e: span) {
if (x->key < vma_start || x->key + x->size > vma_end) { if (e->key < vma_start || e->key + e->size > vma_end) {
cprintf("vmap::remove: partial unmap not supported\n"); cprintf("vmap::remove: partial unmap not supported\n");
return -1; return -1;
} }
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论