diff --git a/include/kvm/kvm.h b/include/kvm/kvm.h index bb40c4c..79fa97d 100644 --- a/include/kvm/kvm.h +++ b/include/kvm/kvm.h @@ -2,6 +2,7 @@ #define KVM__KVM_H #include "kvm/interrupt.h" +#include "kvm/segment.h" #include #include @@ -92,11 +93,6 @@ static inline bool host_ptr_in_ram(struct kvm *kvm, void *p) return kvm->ram_start <= p && p < (kvm->ram_start + kvm->ram_size); } -static inline u32 segment_to_flat(u16 selector, u16 offset) -{ - return ((u32)selector << 4) + (u32) offset; -} - static inline void *guest_flat_to_host(struct kvm *kvm, unsigned long offset) { return kvm->ram_start + offset; diff --git a/include/kvm/segment.h b/include/kvm/segment.h index 362e46d..9387a82 100644 --- a/include/kvm/segment.h +++ b/include/kvm/segment.h @@ -3,6 +3,11 @@ #include +static inline u32 segment_to_flat(u16 selector, u16 offset) +{ + return ((u32)selector << 4) + (u32) offset; +} + static inline u16 flat_to_seg16(u32 address) { return address >> 4;