librm_mgmt.c File Reference

#include <stdint.h>
#include <realmode.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
uint16_t copy_user_to_rm_stack (userptr_t data, size_t size)
 Allocate space on the real-mode stack and copy data there from a user buffer.
void remove_user_from_rm_stack (userptr_t data, size_t size)
 Deallocate space on the real-mode stack, optionally copying back data to a user buffer.
 PROVIDE_UACCESS_INLINE (librm, phys_to_user)
 PROVIDE_UACCESS_INLINE (librm, user_to_phys)
 PROVIDE_UACCESS_INLINE (librm, virt_to_user)
 PROVIDE_UACCESS_INLINE (librm, user_to_virt)
 PROVIDE_UACCESS_INLINE (librm, userptr_add)
 PROVIDE_UACCESS_INLINE (librm, memcpy_user)
 PROVIDE_UACCESS_INLINE (librm, memmove_user)
 PROVIDE_UACCESS_INLINE (librm, memset_user)
 PROVIDE_UACCESS_INLINE (librm, strlen_user)
 PROVIDE_UACCESS_INLINE (librm, memchr_user)


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

uint16_t copy_user_to_rm_stack ( userptr_t  data,
size_t  size 
)

Allocate space on the real-mode stack and copy data there from a user buffer.

Parameters:
data User buffer
size Size of stack data
Return values:
sp New value of real-mode stack pointer

Definition at line 26 of file librm_mgmt.c.

References memcpy_user(), real_to_user(), rm_sp, and rm_ss.

Referenced by com32_cfarcall().

00026                                                                {
00027         userptr_t rm_stack;
00028         rm_sp -= size;
00029         rm_stack = real_to_user ( rm_ss, rm_sp );
00030         memcpy_user ( rm_stack, 0, data, 0, size );
00031         return rm_sp;
00032 };

void remove_user_from_rm_stack ( userptr_t  data,
size_t  size 
)

Deallocate space on the real-mode stack, optionally copying back data to a user buffer.

Parameters:
data User buffer
size Size of stack data

Definition at line 41 of file librm_mgmt.c.

References memcpy_user(), real_to_user(), rm_sp, and rm_ss.

Referenced by com32_cfarcall().

00041                                                                {
00042         if ( data ) {
00043                 userptr_t rm_stack = real_to_user ( rm_ss, rm_sp );
00044                 memcpy_user ( rm_stack, 0, data, 0, size );
00045         }
00046         rm_sp += size;
00047 };

PROVIDE_UACCESS_INLINE ( librm  ,
phys_to_user   
)

PROVIDE_UACCESS_INLINE ( librm  ,
user_to_phys   
)

PROVIDE_UACCESS_INLINE ( librm  ,
virt_to_user   
)

PROVIDE_UACCESS_INLINE ( librm  ,
user_to_virt   
)

PROVIDE_UACCESS_INLINE ( librm  ,
userptr_add   
)

PROVIDE_UACCESS_INLINE ( librm  ,
memcpy_user   
)

PROVIDE_UACCESS_INLINE ( librm  ,
memmove_user   
)

PROVIDE_UACCESS_INLINE ( librm  ,
memset_user   
)

PROVIDE_UACCESS_INLINE ( librm  ,
strlen_user   
)

PROVIDE_UACCESS_INLINE ( librm  ,
memchr_user   
)


Generated on Tue Apr 6 20:01:13 2010 for gPXE by  doxygen 1.5.7.1