These changes are the raw update to qemu-2.6.
[kvmfornfv.git] / qemu / roms / ipxe / src / arch / i386 / include / realmode.h
index dafc5a3..4defd3b 100644 (file)
@@ -10,7 +10,7 @@
  *
  */
 
-FILE_LICENCE ( GPL2_OR_LATER );
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 
 /*
  * Declaration of variables in .data16
@@ -64,6 +64,18 @@ FILE_LICENCE ( GPL2_OR_LATER );
  * assembler output to make sure that it's doing the right thing.
  */
 
+/**
+ * Convert segment:offset address to user buffer
+ *
+ * @v segment          Real-mode segment
+ * @v offset           Real-mode offset
+ * @ret buffer         User buffer
+ */
+static inline __always_inline userptr_t
+real_to_user ( unsigned int segment, unsigned int offset ) {
+       return ( phys_to_user ( ( segment << 4 ) + offset ) );
+}
+
 /**
  * Copy data to base memory
  *