mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-06-16 02:15:47 +00:00
kvm tools: Move segment_to_flat() to kvm/segment.h
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
committed by
Will Deacon
parent
a022099de1
commit
aff11b757c
+1
-5
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user