kvmtool: remove kvm/segment.h

This header just holds three trivial functions, but pulls in
linux/types.h, which calls for trouble when compiling BIOS files on
x86-64 multiarch machines.
Remove unnecessary includes and move the definitions into the files
where they are used.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
This commit is contained in:
Andre Przywara
2015-06-01 15:51:10 +01:00
committed by Will Deacon
parent f323796502
commit 1cbb2c50ce
5 changed files with 12 additions and 25 deletions
-21
View File
@@ -1,21 +0,0 @@
#ifndef KVM_SEGMENT_H
#define KVM_SEGMENT_H
#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;
}
static inline u16 flat_to_off16(u32 address, u32 segment)
{
return address - (segment << 4);
}
#endif /* KVM_SEGMENT_H */
+11 -1
View File
@@ -1,10 +1,20 @@
#include "asm/bios/types.h"
#include "kvm/e820.h"
#include "kvm/segment.h"
#include "kvm/bios.h"
#include <asm/processor-flags.h>
static inline u16 flat_to_seg16(u32 address)
{
return address >> 4;
}
static inline u16 flat_to_off16(u32 address, u32 segment)
{
return address - (segment << 4);
}
static inline void set_fs(u16 seg)
{
asm volatile("movw %0,%%fs" : : "rm" (seg));
-1
View File
@@ -1,4 +1,3 @@
#include "kvm/segment.h"
#include "kvm/bios.h"
#include "kvm/vesa.h"
-1
View File
@@ -2,7 +2,6 @@
#define KVM__KVM_ARCH_H
#include "kvm/interrupt.h"
#include "kvm/segment.h"
#include <stdbool.h>
#include <linux/types.h>
+1 -1
View File
@@ -201,7 +201,7 @@ void kvm__irq_trigger(struct kvm *kvm, int irq)
static inline void *guest_real_to_host(struct kvm *kvm, u16 selector, u16 offset)
{
unsigned long flat = segment_to_flat(selector, offset);
unsigned long flat = ((u32)selector << 4) + offset;
return guest_flat_to_host(kvm, flat);
}