kvm tools: Move segment_to_flat() to kvm/segment.h

Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
Pekka Enberg
2011-09-30 18:37:59 +03:00
committed by Will Deacon
parent a022099de1
commit aff11b757c
2 changed files with 6 additions and 5 deletions
+1 -5
View File
@@ -2,6 +2,7 @@
#define KVM__KVM_H
#include "kvm/interrupt.h"
#include "kvm/segment.h"
#include <stdbool.h>
#include <linux/types.h>
@@ -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;
+5
View File
@@ -3,6 +3,11 @@
#include <linux/types.h>
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;