Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93799
b: refs/heads/master
c: ddcb288
h: refs/heads/master
i:
  93797: 67bb102
  93795: 76d23e5
  93791: 833ce46
v: v3
  • Loading branch information
Harvey Harrison authored and Avi Kivity committed Apr 27, 2008
1 parent c57bea9 commit db756ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 790c73f6289a204f858ffdcbe4a2b38e91657ec6
refs/heads/master: ddcb2885e2902ebfc422eccd763b02c5ee22d68b
11 changes: 8 additions & 3 deletions trunk/arch/x86/kvm/x86_emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,15 @@ static u16 group2_table[] = {
(_type)_x; \
})

static inline unsigned long ad_mask(struct decode_cache *c)
{
return (1UL << (c->ad_bytes << 3)) - 1;
}

/* Access/update address held in a register, based on addressing mode. */
#define address_mask(reg) \
((c->ad_bytes == sizeof(unsigned long)) ? \
(reg) : ((reg) & ((1UL << (c->ad_bytes << 3)) - 1)))
(reg) : ((reg) & ad_mask(c)))
#define register_address(base, reg) \
((base) + address_mask(reg))
#define register_address_increment(reg, inc) \
Expand All @@ -494,9 +499,9 @@ static u16 group2_table[] = {
(reg) += _inc; \
else \
(reg) = ((reg) & \
~((1UL << (c->ad_bytes << 3)) - 1)) | \
~ad_mask(c)) | \
(((reg) + _inc) & \
((1UL << (c->ad_bytes << 3)) - 1)); \
ad_mask(c)); \
} while (0)

#define JMP_REL(rel) \
Expand Down

0 comments on commit db756ec

Please sign in to comment.