Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
ttm_mem_type_manager_func Struct Reference

#include <ttm_bo_driver.h>

Data Fields

int(* init )(struct ttm_mem_type_manager *man, unsigned long p_size)
 
int(* takedown )(struct ttm_mem_type_manager *man)
 
int(* get_node )(struct ttm_mem_type_manager *man, struct ttm_buffer_object *bo, struct ttm_placement *placement, struct ttm_mem_reg *mem)
 
void(* put_node )(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem)
 
void(* debug )(struct ttm_mem_type_manager *man, const char *prefix)
 

Detailed Description

Definition at line 152 of file ttm_bo_driver.h.

Field Documentation

struct ttm_mem_type_manager member debug

: Pointer to a memory type manager. : Prefix to be used in printout to identify the caller.

This function is called to print out the state of the memory type manager to aid debugging of out-of-memory conditions. It may not be called from within atomic context.

Definition at line 231 of file ttm_bo_driver.h.

struct ttm_mem_type_manager member get_node

: Pointer to a memory type manager. : Pointer to the buffer object we're allocating space for. : Placement details. : Pointer to a struct ttm_mem_reg to be filled in.

This function should allocate space in the memory type managed by . Placement details if applicable are given by . If successful, ::mm_node should be set to a non-null value, and start should be set to a value identifying the beginning of the range allocated, and the function should return zero. If the memory region accommodate the buffer object, ::mm_node should be set to NULL, and the function should return 0. If a system error occurred, preventing the request to be fulfilled, the function should return a negative error code.

Note that ::mm_node will only be dereferenced by struct ttm_mem_type_manager functions and optionally by the driver, which has knowledge of the underlying type.

This function may not be called from within atomic context, so an implementation can and must use either a mutex or a spinlock to protect any data structures managing the space.

Definition at line 203 of file ttm_bo_driver.h.

int(* init)(struct ttm_mem_type_manager *man, unsigned long p_size)

struct ttm_mem_type_manager member init

: Pointer to a memory type manager. : Implementation dependent, but typically the size of the range to be managed in pages.

Called to initialize a private range manager. The function is expected to initialize the man::priv member. Returns 0 on success, negative error code on failure.

Definition at line 164 of file ttm_bo_driver.h.

struct ttm_mem_type_manager member put_node

: Pointer to a memory type manager. : Pointer to a struct ttm_mem_reg to be filled in.

This function frees memory type resources previously allocated and that are identified by ::mm_node and start. May not be called from within atomic context.

Definition at line 218 of file ttm_bo_driver.h.

int(* takedown)(struct ttm_mem_type_manager *man)

struct ttm_mem_type_manager member takedown

: Pointer to a memory type manager.

Called to undo the setup done in init. All allocated resources should be freed.

Definition at line 174 of file ttm_bo_driver.h.


The documentation for this struct was generated from the following file: