diff options
author | Hollis Blanchard <hollisb@us.ibm.com> | 2008-11-05 10:36:12 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-12-31 09:51:50 -0500 |
commit | 0f55dc481ea5c4f87fc0161cb1b8c6e2cafae8fc (patch) | |
tree | 18b5bb0ad449607690329c6c23083886cb39a9bc /arch/powerpc/kvm/44x_tlb.h | |
parent | a0d7b9f246074fab1f42678d203ef4ba281505f2 (diff) |
KVM: ppc: Rename "struct tlbe" to "struct kvmppc_44x_tlbe"
This will ease ports to other cores.
Also remove unused "struct kvm_tlb" while we're at it.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/44x_tlb.h')
-rw-r--r-- | arch/powerpc/kvm/44x_tlb.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/arch/powerpc/kvm/44x_tlb.h b/arch/powerpc/kvm/44x_tlb.h index 2ccd46b6f6b7..e5b0a76798bd 100644 --- a/arch/powerpc/kvm/44x_tlb.h +++ b/arch/powerpc/kvm/44x_tlb.h | |||
@@ -25,48 +25,50 @@ | |||
25 | 25 | ||
26 | extern int kvmppc_44x_tlb_index(struct kvm_vcpu *vcpu, gva_t eaddr, | 26 | extern int kvmppc_44x_tlb_index(struct kvm_vcpu *vcpu, gva_t eaddr, |
27 | unsigned int pid, unsigned int as); | 27 | unsigned int pid, unsigned int as); |
28 | extern struct tlbe *kvmppc_44x_dtlb_search(struct kvm_vcpu *vcpu, gva_t eaddr); | 28 | extern struct kvmppc_44x_tlbe *kvmppc_44x_dtlb_search(struct kvm_vcpu *vcpu, |
29 | extern struct tlbe *kvmppc_44x_itlb_search(struct kvm_vcpu *vcpu, gva_t eaddr); | 29 | gva_t eaddr); |
30 | extern struct kvmppc_44x_tlbe *kvmppc_44x_itlb_search(struct kvm_vcpu *vcpu, | ||
31 | gva_t eaddr); | ||
30 | 32 | ||
31 | /* TLB helper functions */ | 33 | /* TLB helper functions */ |
32 | static inline unsigned int get_tlb_size(const struct tlbe *tlbe) | 34 | static inline unsigned int get_tlb_size(const struct kvmppc_44x_tlbe *tlbe) |
33 | { | 35 | { |
34 | return (tlbe->word0 >> 4) & 0xf; | 36 | return (tlbe->word0 >> 4) & 0xf; |
35 | } | 37 | } |
36 | 38 | ||
37 | static inline gva_t get_tlb_eaddr(const struct tlbe *tlbe) | 39 | static inline gva_t get_tlb_eaddr(const struct kvmppc_44x_tlbe *tlbe) |
38 | { | 40 | { |
39 | return tlbe->word0 & 0xfffffc00; | 41 | return tlbe->word0 & 0xfffffc00; |
40 | } | 42 | } |
41 | 43 | ||
42 | static inline gva_t get_tlb_bytes(const struct tlbe *tlbe) | 44 | static inline gva_t get_tlb_bytes(const struct kvmppc_44x_tlbe *tlbe) |
43 | { | 45 | { |
44 | unsigned int pgsize = get_tlb_size(tlbe); | 46 | unsigned int pgsize = get_tlb_size(tlbe); |
45 | return 1 << 10 << (pgsize << 1); | 47 | return 1 << 10 << (pgsize << 1); |
46 | } | 48 | } |
47 | 49 | ||
48 | static inline gva_t get_tlb_end(const struct tlbe *tlbe) | 50 | static inline gva_t get_tlb_end(const struct kvmppc_44x_tlbe *tlbe) |
49 | { | 51 | { |
50 | return get_tlb_eaddr(tlbe) + get_tlb_bytes(tlbe) - 1; | 52 | return get_tlb_eaddr(tlbe) + get_tlb_bytes(tlbe) - 1; |
51 | } | 53 | } |
52 | 54 | ||
53 | static inline u64 get_tlb_raddr(const struct tlbe *tlbe) | 55 | static inline u64 get_tlb_raddr(const struct kvmppc_44x_tlbe *tlbe) |
54 | { | 56 | { |
55 | u64 word1 = tlbe->word1; | 57 | u64 word1 = tlbe->word1; |
56 | return ((word1 & 0xf) << 32) | (word1 & 0xfffffc00); | 58 | return ((word1 & 0xf) << 32) | (word1 & 0xfffffc00); |
57 | } | 59 | } |
58 | 60 | ||
59 | static inline unsigned int get_tlb_tid(const struct tlbe *tlbe) | 61 | static inline unsigned int get_tlb_tid(const struct kvmppc_44x_tlbe *tlbe) |
60 | { | 62 | { |
61 | return tlbe->tid & 0xff; | 63 | return tlbe->tid & 0xff; |
62 | } | 64 | } |
63 | 65 | ||
64 | static inline unsigned int get_tlb_ts(const struct tlbe *tlbe) | 66 | static inline unsigned int get_tlb_ts(const struct kvmppc_44x_tlbe *tlbe) |
65 | { | 67 | { |
66 | return (tlbe->word0 >> 8) & 0x1; | 68 | return (tlbe->word0 >> 8) & 0x1; |
67 | } | 69 | } |
68 | 70 | ||
69 | static inline unsigned int get_tlb_v(const struct tlbe *tlbe) | 71 | static inline unsigned int get_tlb_v(const struct kvmppc_44x_tlbe *tlbe) |
70 | { | 72 | { |
71 | return (tlbe->word0 >> 9) & 0x1; | 73 | return (tlbe->word0 >> 9) & 0x1; |
72 | } | 74 | } |
@@ -81,7 +83,7 @@ static inline unsigned int get_mmucr_sts(const struct kvm_vcpu *vcpu) | |||
81 | return (vcpu->arch.mmucr >> 16) & 0x1; | 83 | return (vcpu->arch.mmucr >> 16) & 0x1; |
82 | } | 84 | } |
83 | 85 | ||
84 | static inline gpa_t tlb_xlate(struct tlbe *tlbe, gva_t eaddr) | 86 | static inline gpa_t tlb_xlate(struct kvmppc_44x_tlbe *tlbe, gva_t eaddr) |
85 | { | 87 | { |
86 | unsigned int pgmask = get_tlb_bytes(tlbe) - 1; | 88 | unsigned int pgmask = get_tlb_bytes(tlbe) - 1; |
87 | 89 | ||