本文整理汇总了C++中Entry::add_rights方法的典型用法代码示例。如果您正苦于以下问题:C++ Entry::add_rights方法的具体用法?C++ Entry::add_rights怎么用?C++ Entry::add_rights使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entry
的用法示例。
在下文中一共展示了Entry::add_rights方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
typename Generic_obj_space<SPACE>::Status
Generic_obj_space<SPACE>::v_insert(Phys_addr phys, Addr const &virt, Size size,
unsigned char page_attribs)
{
(void)size;
assert (size.value() == 1);
Entry *c = get_cap(virt.value());
if (!c && !(c = caps_alloc(virt.value())))
return Insert_err_nomem;
assert (size.value() == 1);
if (c->valid())
{
if (c->obj() == phys)
{
if (EXPECT_FALSE(c->rights() == page_attribs))
return Insert_warn_exists;
c->add_rights(page_attribs);
return Insert_warn_attrib_upgrade;
}
else
return Insert_err_exists;
}
Obj::set_entry(virt, c);
c->set(phys, page_attribs);
return Insert_ok;
}
示例2: assert
Obj_space_phys<SPACE>::v_insert(Phys_addr phys, V_pfn const &virt, Page_order size,
Attr page_attribs)
{
(void)size;
assert (size == Page_order(0));
Entry *c = get_cap(virt);
if (!c && !(c = caps_alloc(virt)))
return Obj::Insert_err_nomem;
if (c->valid())
{
if (c->obj() == phys)
{
if (EXPECT_FALSE(c->rights() == page_attribs))
return Obj::Insert_warn_exists;
c->add_rights(page_attribs);
return Obj::Insert_warn_attrib_upgrade;
}
else
return Obj::Insert_err_exists;
}
Obj::set_entry(virt, c);
c->set(phys, page_attribs);
return Obj::Insert_ok;
}
示例3: assert
typename Generic_obj_space<SPACE>::Status
Generic_obj_space<SPACE>::v_insert(Phys_addr phys, Addr const &virt, Size size,
unsigned char page_attribs)
{
(void)size;
assert (size.value() == 1);
Entry *c;
if (Optimize_local
&& mem_space() == Mem_space::current_mem_space(current_cpu()))
{
c = cap_virt(virt.value());
if (!c)
return Insert_err_nomem;
Capability cap;
if (!Mem_layout::read_special_safe((Capability*)c, cap)
&& !caps_alloc(virt.value()))
return Insert_err_nomem;
}
else
{
c = alien_lookup(virt.value());
if (!c && !(c = caps_alloc(virt.value())))
return Insert_err_nomem;
Obj::set_entry(virt, c);
}
if (c->valid())
{
if (c->obj() == phys)
{
if (EXPECT_FALSE(c->rights() == page_attribs))
return Insert_warn_exists;
c->add_rights(page_attribs);
return Insert_warn_attrib_upgrade;
}
else
return Insert_err_exists;
}
c->set(phys, page_attribs);
return Insert_ok;
}
示例4: assert
Obj_space_virt<SPACE>::v_insert(Phys_addr phys, V_pfn const &virt, Order size,
Attr page_attribs)
{
(void)size;
assert (size == Order(0));
Entry *c;
if (Optimize_local
&& SPACE::mem_space(this) == Mem_space::current_mem_space(current_cpu()))
{
c = cap_virt(virt);
if (!c)
return Obj::Insert_err_nomem;
Capability cap;
if (!Mem_layout::read_special_safe((Capability*)c, cap)
&& !caps_alloc(virt))
return Obj::Insert_err_nomem;
}
else
{
c = get_cap(virt);
if (!c && !(c = caps_alloc(virt)))
return Obj::Insert_err_nomem;
Obj::set_entry(virt, c);
}
if (c->valid())
{
if (c->obj() == phys)
{
if (EXPECT_FALSE(c->rights() == page_attribs))
return Obj::Insert_warn_exists;
c->add_rights(page_attribs);
return Obj::Insert_warn_attrib_upgrade;
}
else
return Obj::Insert_err_exists;
}
c->set(phys, page_attribs);
return Obj::Insert_ok;
}