mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-06-16 02:15:47 +00:00
aff11b757c
Signed-off-by: Pekka Enberg <penberg@kernel.org>
22 lines
377 B
C
22 lines
377 B
C
#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 */
|