summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/include/realmode.h
diff options
context:
space:
mode:
authorMichael Brown2015-03-05 03:30:58 +0100
committerMichael Brown2015-03-05 03:30:58 +0100
commit81166302a082210346e8006b37167bbaf89b3e85 (patch)
treece7ac80ed754124a761b16560582755daded888e /src/arch/i386/include/realmode.h
parent[build] Fix the REQUIRE_SYMBOL mechanism (diff)
downloadipxe-81166302a082210346e8006b37167bbaf89b3e85.tar.gz
ipxe-81166302a082210346e8006b37167bbaf89b3e85.tar.xz
ipxe-81166302a082210346e8006b37167bbaf89b3e85.zip
[i386] Move real_to_user() to realmode.h
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386/include/realmode.h')
-rw-r--r--src/arch/i386/include/realmode.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/arch/i386/include/realmode.h b/src/arch/i386/include/realmode.h
index 5727e5ac..4defd3b9 100644
--- a/src/arch/i386/include/realmode.h
+++ b/src/arch/i386/include/realmode.h
@@ -65,6 +65,18 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
*/
/**
+ * 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
*
* @v dest_seg Destination segment