iPXE
Defines | Functions
realmode.h File Reference
#include <stdint.h>
#include <registers.h>
#include <ipxe/uaccess.h>

Go to the source code of this file.

Defines

#define put_real(var, dest_seg, dest_off)   copy_to_real ( (dest_seg), (dest_off), &(var), sizeof (var) )
 Write a single variable to base memory.
#define get_real(var, src_seg, src_off)   copy_from_real ( &(var), (src_seg), (src_off), sizeof (var) )
 Read a single variable from base memory.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static __always_inline userptr_t real_to_user (unsigned int segment, unsigned int offset)
 Convert segment:offset address to user buffer.
static __always_inline void copy_to_real (unsigned int dest_seg, unsigned int dest_off, void *src, size_t n)
 Copy data to base memory.
static __always_inline void copy_from_real (void *dest, unsigned int src_seg, unsigned int src_off, size_t n)
 Copy data to base memory.

Define Documentation

#define put_real (   var,
  dest_seg,
  dest_off 
)    copy_to_real ( (dest_seg), (dest_off), &(var), sizeof (var) )

Write a single variable to base memory.

var Variable to write dest_seg Destination segment dest_off Destination offset

Definition at line 114 of file realmode.h.

#define get_real (   var,
  src_seg,
  src_off 
)    copy_from_real ( &(var), (src_seg), (src_off), sizeof (var) )

Read a single variable from base memory.

var Variable to read src_seg Source segment src_off Source offset

Definition at line 124 of file realmode.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static __always_inline userptr_t real_to_user ( unsigned int  segment,
unsigned int  offset 
) [inline, static]
static __always_inline void copy_to_real ( unsigned int  dest_seg,
unsigned int  dest_off,
void *  src,
size_t  n 
) [inline, static]

Copy data to base memory.

dest_seg Destination segment dest_off Destination offset src Source len Length

Definition at line 88 of file realmode.h.

References copy_to_user(), and real_to_user().

                                     {
        copy_to_user ( real_to_user ( dest_seg, dest_off ), 0, src, n );
}
static __always_inline void copy_from_real ( void *  dest,
unsigned int  src_seg,
unsigned int  src_off,
size_t  n 
) [inline, static]

Copy data to base memory.

dest Destination src_seg Source segment src_off Source offset len Length

Definition at line 102 of file realmode.h.

References copy_from_user(), and real_to_user().

                                                  {
        copy_from_user ( dest, real_to_user ( src_seg, src_off ), 0, n );
}