当前位置: 首页>>代码示例>>C++>>正文


C++ Capability::rights方法代码示例

本文整理汇总了C++中Capability::rights方法的典型用法代码示例。如果您正苦于以下问题:C++ Capability::rights方法的具体用法?C++ Capability::rights怎么用?C++ Capability::rights使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Capability的用法示例。


在下文中一共展示了Capability::rights方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

bool
Generic_obj_space<SPACE>::v_lookup(Addr const &virt, Phys_addr *phys = 0,
                                   Size *size = 0, unsigned *attribs = 0)
{
  if (size) size->set_value(1);
  Entry *cap;

  if (Optimize_local
      && mem_space() == Mem_space::current_mem_space(current_cpu()))
    cap = cap_virt(virt.value());
  else
    cap = get_cap(virt.value());

  if (EXPECT_FALSE(!cap))
    {
      if (size) size->set_value(Caps_per_page);
      return false;
    }

  if (Optimize_local)
    {
      Capability c = Mem_layout::read_special_safe((Capability*)cap);

      if (phys) *phys = c.obj();
      if (c.valid() && attribs) *attribs = c.rights();
      return c.valid();
    }
  else
    {
      Obj::set_entry(virt, cap);
      if (phys) *phys = cap->obj();
      if (cap->valid() && attribs) *attribs = cap->rights();
      return cap->valid();
    }
}
开发者ID:ExpressOS,项目名称:third_party-l4re,代码行数:35,代码来源:obj_space-virt.cpp

示例2:

Kobject_iface *
Obj_space_virt<SPACE>::lookup_local(Cap_index virt, L4_fpage::Rights *rights)
{
  virt &= Cap_index(~(~0UL << Whole_space));
  Capability *c = reinterpret_cast<Capability*>(cap_virt(virt));
  Capability cap = Mem_layout::read_special_safe(c);
  if (rights) *rights = L4_fpage::Rights(cap.rights());
  return cap.obj();
}
开发者ID:KyulingLee,项目名称:Fiasco.OC,代码行数:9,代码来源:obj_space_virt_util.cpp

示例3:

inline
Kobject_iface *
Generic_obj_space<SPACE>::lookup_local(Address virt, unsigned char *rights = 0)
{
  Entry *c = get_cap(virt);

  if (EXPECT_FALSE(!c))
    return 0;

  Capability cap = *c;

  if (rights)
    *rights = cap.rights();

  return cap.obj();
}
开发者ID:MicroTrustRepos,项目名称:microkernel,代码行数:16,代码来源:obj_space-phys.cpp

示例4:

inline
Kobject_iface *
Obj_space_phys<SPACE>::lookup_local(Cap_index virt, L4_fpage::Rights *rights)
{
  Entry *c = get_cap(virt);

  if (EXPECT_FALSE(!c))
    return 0;

  Capability cap = *c;

  if (rights)
    *rights = L4_fpage::Rights(cap.rights());

  return cap.obj();
}
开发者ID:KyulingLee,项目名称:Fiasco.OC,代码行数:16,代码来源:obj_space_phys_util.cpp


注:本文中的Capability::rights方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。