Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
drm_buffer.c File Reference
#include <linux/export.h>
#include <drm/drm_buffer.h>

Go to the source code of this file.


int drm_buffer_alloc (struct drm_buffer **buf, int size)
 EXPORT_SYMBOL (drm_buffer_alloc)
int drm_buffer_copy_from_user (struct drm_buffer *buf, void __user *user_data, int size)
 EXPORT_SYMBOL (drm_buffer_copy_from_user)
void drm_buffer_free (struct drm_buffer *buf)
 EXPORT_SYMBOL (drm_buffer_free)
voiddrm_buffer_read_object (struct drm_buffer *buf, int objsize, void *stack_obj)
 EXPORT_SYMBOL (drm_buffer_read_object)

Function Documentation

int drm_buffer_alloc ( struct drm_buffer **  buf,
int  size 

Allocate the drm buffer object.

buf: Pointer to a pointer where the object is stored. size: The number of bytes to allocate.

Definition at line 44 of file drm_buffer.c.

int drm_buffer_copy_from_user ( struct drm_buffer buf,
void __user user_data,
int  size 

Copy the user data to the begin of the buffer and reset the processing iterator.

user_data: A pointer the data that is copied to the buffer. size: The Number of bytes to copy.

Definition at line 102 of file drm_buffer.c.

void drm_buffer_free ( struct drm_buffer buf)

Free the drm buffer object

Definition at line 135 of file drm_buffer.c.

void* drm_buffer_read_object ( struct drm_buffer buf,
int  objsize,
void stack_obj 

Read an object from buffer that may be split to multiple parts. If object is not split function just returns the pointer to object in buffer. But in case of split object data is copied to given stack object that is suplied by caller.

The processing location of the buffer is also advanced to the next byte after the object.

objsize: The size of the objet in bytes. stack_obj: A pointer to a memory location where object can be copied.

Definition at line 162 of file drm_buffer.c.

EXPORT_SYMBOL ( drm_buffer_alloc  )
EXPORT_SYMBOL ( drm_buffer_copy_from_user  )
EXPORT_SYMBOL ( drm_buffer_free  )
EXPORT_SYMBOL ( drm_buffer_read_object  )