mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-06-16 02:15:47 +00:00
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:
committed by
Will Deacon
parent
f323796502
commit
1cbb2c50ce
@@ -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
@@ -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,4 +1,3 @@
|
||||
#include "kvm/segment.h"
|
||||
#include "kvm/bios.h"
|
||||
#include "kvm/vesa.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define KVM__KVM_ARCH_H
|
||||
|
||||
#include "kvm/interrupt.h"
|
||||
#include "kvm/segment.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user