本文整理汇总了C++中ptu_uint_eq函数的典型用法代码示例。如果您正苦于以下问题:C++ ptu_uint_eq函数的具体用法?C++ ptu_uint_eq怎么用?C++ ptu_uint_eq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ptu_uint_eq函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read
static struct ptunit_result read(struct section_fixture *sfix)
{
uint8_t bytes[] = { 0xcc, 0x2, 0x4, 0x6 };
uint8_t buffer[] = { 0xcc, 0xcc, 0xcc };
int status;
sfix_write(sfix, bytes);
sfix->section = pt_mk_section(sfix->name, 0x1ull, 0x3ull);
ptu_ptr(sfix->section);
status = pt_section_map(sfix->section);
ptu_int_eq(status, 0);
status = pt_section_read(sfix->section, buffer, 2, 0x0ull);
ptu_int_eq(status, 2);
ptu_uint_eq(buffer[0], bytes[1]);
ptu_uint_eq(buffer[1], bytes[2]);
ptu_uint_eq(buffer[2], 0xcc);
status = pt_section_unmap(sfix->section);
ptu_int_eq(status, 0);
return ptu_passed();
}
示例2: init
static struct ptunit_result init(struct section_fixture *sfix)
{
ptu_ptr_eq(sfix->msec.section, &sfix->section);
ptu_uint_eq(sfix->msec.vaddr, sfix->vaddr);
ptu_uint_eq(sfix->msec.asid.size, sfix->asid.size);
ptu_uint_eq(sfix->msec.asid.cr3, sfix->asid.cr3);
return ptu_passed();
}
示例3: remove_bad_asid
static struct ptunit_result remove_bad_asid(struct image_fixture *ifix)
{
uint8_t buffer[] = { 0xcc, 0xcc, 0xcc };
int status;
status = pt_image_read(&ifix->image, buffer, 2, &ifix->asid[0],
0x1001ull);
ptu_int_eq(status, 2);
ptu_uint_eq(buffer[0], 0x01);
ptu_uint_eq(buffer[1], 0x02);
ptu_uint_eq(buffer[2], 0xcc);
status = pt_image_remove(&ifix->image, &ifix->section[0],
&ifix->asid[1], 0x1000ull);
ptu_int_eq(status, -pte_bad_image);
ptu_int_eq(ifix->status[0].deleted, 0);
ptu_int_eq(ifix->status[1].deleted, 0);
status = pt_image_read(&ifix->image, buffer, 2, &ifix->asid[0],
0x1003ull);
ptu_int_eq(status, 2);
ptu_uint_eq(buffer[0], 0x03);
ptu_uint_eq(buffer[1], 0x04);
ptu_uint_eq(buffer[2], 0xcc);
status = pt_image_read(&ifix->image, buffer, 2, &ifix->asid[1],
0x2005ull);
ptu_int_eq(status, 2);
ptu_uint_eq(buffer[0], 0x05);
ptu_uint_eq(buffer[1], 0x06);
ptu_uint_eq(buffer[2], 0xcc);
return ptu_passed();
}
示例4: remove_by_asid
static struct ptunit_result remove_by_asid(struct image_fixture *ifix)
{
uint8_t buffer[] = { 0xcc, 0xcc, 0xcc };
int status;
status = pt_image_read(&ifix->image, buffer, 2, &ifix->asid[0],
0x1001ull);
ptu_int_eq(status, 2);
ptu_uint_eq(buffer[0], 0x01);
ptu_uint_eq(buffer[1], 0x02);
ptu_uint_eq(buffer[2], 0xcc);
status = pt_image_remove_by_asid(&ifix->image, &ifix->asid[0]);
ptu_int_eq(status, 1);
ptu_int_ne(ifix->status[0].deleted, 0);
ptu_int_eq(ifix->status[1].deleted, 0);
status = pt_image_read(&ifix->image, buffer, sizeof(buffer),
&ifix->asid[0], 0x1003ull);
ptu_int_eq(status, -pte_nomap);
ptu_uint_eq(buffer[0], 0x01);
ptu_uint_eq(buffer[1], 0x02);
ptu_uint_eq(buffer[2], 0xcc);
status = pt_image_read(&ifix->image, buffer, 2, &ifix->asid[1],
0x2003ull);
ptu_int_eq(status, 2);
ptu_uint_eq(buffer[0], 0x03);
ptu_uint_eq(buffer[1], 0x04);
ptu_uint_eq(buffer[2], 0xcc);
return ptu_passed();
}
示例5: read_null_asid
static struct ptunit_result read_null_asid(struct image_fixture *ifix)
{
uint8_t buffer[] = { 0xcc, 0xcc, 0xcc };
int status;
status = pt_image_read(&ifix->image, buffer, 2, NULL, 0x2003ull);
ptu_int_eq(status, -pte_internal);
ptu_uint_eq(buffer[0], 0xcc);
ptu_uint_eq(buffer[1], 0xcc);
return ptu_passed();
}
示例6: read_nomem
static struct ptunit_result read_nomem(struct image_fixture *ifix)
{
uint8_t buffer[] = { 0xcc, 0xcc };
int status;
status = pt_image_read(&ifix->image, buffer, sizeof(buffer),
&ifix->asid[1], 0x1010ull);
ptu_int_eq(status, -pte_nomap);
ptu_uint_eq(buffer[0], 0xcc);
ptu_uint_eq(buffer[1], 0xcc);
return ptu_passed();
}
示例7: from_user_default
static struct ptunit_result from_user_default(void)
{
struct pt_asid asid;
int errcode;
errcode = pt_asid_from_user(&asid, NULL);
ptu_int_eq(errcode, 0);
ptu_uint_eq(asid.size, sizeof(asid));
ptu_uint_eq(asid.cr3, pt_asid_no_cr3);
ptu_uint_eq(asid.vmcs, pt_asid_no_vmcs);
return ptu_passed();
}
示例8: read_truncated
static struct ptunit_result read_truncated(struct image_fixture *ifix)
{
uint8_t buffer[] = { 0xcc, 0xcc };
int status;
status = pt_image_read(&ifix->image, buffer, sizeof(buffer),
&ifix->asid[0], 0x100full);
ptu_int_eq(status, 1);
ptu_uint_eq(buffer[0], 0x0f);
ptu_uint_eq(buffer[1], 0xcc);
return ptu_passed();
}
示例9: read_truncated
static struct ptunit_result read_truncated(struct section_fixture *sfix)
{
uint8_t buffer[] = { 0xcc, 0xcc };
int status;
status = pt_msec_read(&sfix->msec, buffer, 2, &sfix->asid,
sfix->vaddr + sfix->section.size - 1);
ptu_int_eq(status, 1);
ptu_uint_eq(buffer[0], sfix->mapping.content[sfix->mapping.size - 1]);
ptu_uint_eq(buffer[1], 0xcc);
return ptu_passed();
}
示例10: read
static struct ptunit_result read(struct image_fixture *ifix)
{
uint8_t buffer[] = { 0xcc, 0xcc, 0xcc };
int status;
status = pt_image_read(&ifix->image, buffer, 2, &ifix->asid[1],
0x2003ull);
ptu_int_eq(status, 2);
ptu_uint_eq(buffer[0], 0x03);
ptu_uint_eq(buffer[1], 0x04);
ptu_uint_eq(buffer[2], 0xcc);
return ptu_passed();
}
示例11: read_offset
static struct ptunit_result read_offset(struct section_fixture *sfix)
{
uint8_t buffer[] = { 0xcc, 0xcc, 0xcc };
int status;
status = pt_msec_read(&sfix->msec, buffer, 2, &sfix->asid,
sfix->vaddr + 3);
ptu_int_eq(status, 2);
ptu_uint_eq(buffer[0], sfix->mapping.content[3]);
ptu_uint_eq(buffer[1], sfix->mapping.content[4]);
ptu_uint_eq(buffer[2], 0xcc);
return ptu_passed();
}
示例12: from_user_small
static struct ptunit_result from_user_small(void)
{
struct pt_asid asid, user;
int errcode;
user.size = sizeof(user.size);
errcode = pt_asid_from_user(&asid, &user);
ptu_int_eq(errcode, 0);
ptu_uint_eq(asid.size, sizeof(asid));
ptu_uint_eq(asid.cr3, pt_asid_no_cr3);
ptu_uint_eq(asid.vmcs, pt_asid_no_vmcs);
return ptu_passed();
}
示例13: read_empty
static struct ptunit_result read_empty(struct image_fixture *ifix)
{
struct pt_asid asid;
uint8_t buffer[] = { 0xcc, 0xcc };
int status;
pt_asid_init(&asid);
status = pt_image_read(&ifix->image, buffer, sizeof(buffer), &asid,
0x1000ull);
ptu_int_eq(status, -pte_nomap);
ptu_uint_eq(buffer[0], 0xcc);
ptu_uint_eq(buffer[1], 0xcc);
return ptu_passed();
}
示例14: read_default_asid
static struct ptunit_result read_default_asid(struct section_fixture *sfix)
{
struct pt_asid asid;
uint8_t buffer[] = { 0xcc, 0xcc, 0xcc };
int status;
pt_asid_init(&asid);
status = pt_msec_read(&sfix->msec, buffer, 2, &asid, sfix->vaddr);
ptu_int_eq(status, 2);
ptu_uint_eq(buffer[0], sfix->mapping.content[0]);
ptu_uint_eq(buffer[1], sfix->mapping.content[1]);
ptu_uint_eq(buffer[2], 0xcc);
return ptu_passed();
}
示例15: asid
static struct ptunit_result asid(void)
{
struct pt_mapped_section msec;
struct pt_asid asid;
const struct pt_asid *pasid;
pt_asid_init(&asid);
asid.cr3 = 0xa00;
pt_msec_init(&msec, NULL, &asid, 0ull);
pasid = pt_msec_asid(&msec);
ptu_uint_eq(pasid->size, asid.size);
ptu_uint_eq(pasid->cr3, asid.cr3);
return ptu_passed();
}