提交 6b85612e 创建 作者: Nickolai Zeldovich's avatar Nickolai Zeldovich

compile fixes for TREE

上级 f66a86ef
......@@ -56,22 +56,6 @@ extern "C" {
enum { crange_debug = 0 };
enum { crange_checking = 0 };
struct range {
u64 key;
u64 size;
void *value;
int curlevel; // the current levels it appears on
int nlevel; // the number of levels this range should appear
struct crange *cr; // the crange this range is part of
struct range** next; // one next pointer per level
struct spinlock *lock; // on separate cache line?
} __mpalign__;
struct crange {
int nlevel; // number of levels in the crange skip list
struct range crange_head; // a crange skip list starts with a sentinel range (key 0, sz 0)
};
void crange_check(struct crange *cr, struct range *absent);
//
......
......@@ -56,7 +56,21 @@ void consoleintr(int(*)(void));
#define assert(c) if (!(c)) { cprintf("%s:%d: ", __FILE__, __LINE__); panic("assertion failure"); }
// crange.c
struct range;
struct range {
u64 key;
u64 size;
void *value;
int curlevel; // the current levels it appears on
int nlevel; // the number of levels this range should appear
struct crange *cr; // the crange this range is part of
struct range** next; // one next pointer per level
struct spinlock *lock; // on separate cache line?
} __mpalign__;
struct crange {
int nlevel; // number of levels in the crange skip list
struct range crange_head; // a crange skip list starts with a sentinel range (key 0, sz 0)
};
struct crange* crange_alloc(int nlevel);
void crange_free(struct crange *cr);
......
......@@ -308,14 +308,14 @@ vmn_alloc(u64 npg, enum vmntype type)
#ifdef TREE
struct state {
int share;
void *pml4;
pml4e_t *pml4;
struct crange *cr;
};
static int
vmap_free_vma(struct clist_range *r, void *st)
vmap_free_vma(struct range *r, void *st)
{
delete r->value;
delete (vma *) r->value;
crange_del(r->cr, r->key, r->size);
return 1;
}
......@@ -346,7 +346,7 @@ vmap_lookup(struct vmap *m, uptr start, uptr len)
if(start + len < start)
panic("vmap_lookup bad len");
struct clist_range *r = crange_search(m->cr, start, len);
struct range *r = crange_search(m->cr, start, len, 0);
if (r != 0) {
struct vma *e = (struct vma *) (r->value);
if (e->va_end <= e->va_start)
......@@ -386,7 +386,7 @@ vmap_insert(struct vmap *m, struct vmnode *n, uptr va_start)
}
static int
vmap_copy_vma(struct clist_range *r, void *_st)
vmap_copy_vma(struct range *r, void *_st)
{
struct state *st = (struct state *) _st;
struct vma *e = (struct vma *) r->value;
......@@ -445,7 +445,7 @@ vmap_remove(struct vmap *m, uptr va_start, u64 len)
{
acquire(&m->lock);
uptr va_end = va_start + len;
struct clist_range *r = crange_search(m->cr, va_start, len);
struct range *r = crange_search(m->cr, va_start, len, 0);
if (r == 0)
panic("no vma?");
struct vma *e = (struct vma *) r->value;
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论