iPXE
mlx_memory.h
Go to the documentation of this file.
00001 #ifndef MLXUTILS_INCLUDE_PUBLIC_MEMORY_H_
00002 #define MLXUTILS_INCLUDE_PUBLIC_MEMORY_H_
00003 
00004 /*
00005  * Copyright (C) 2015 Mellanox Technologies Ltd.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License as
00009  * published by the Free Software Foundation; either version 2 of the
00010  * License, or any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020  * 02110-1301, USA.
00021  */
00022 
00023 FILE_LICENCE ( GPL2_OR_LATER );
00024 
00025 #include "mlx_utils.h"
00026 
00027 
00028 mlx_status
00029 mlx_memory_alloc(
00030                                 IN mlx_utils *utils,
00031                                 IN mlx_size size,
00032                                 OUT mlx_void **ptr
00033                                 );
00034 
00035 mlx_status
00036 mlx_memory_zalloc(
00037                                 IN mlx_utils *utils,
00038                                 IN mlx_size size,
00039                                 OUT mlx_void **ptr
00040                                 );
00041 
00042 mlx_status
00043 mlx_memory_free(
00044                                 IN mlx_utils *utils,
00045                                 IN mlx_void **ptr
00046                                 );
00047 mlx_status
00048 mlx_memory_alloc_dma(
00049                                         IN mlx_utils *utils,
00050                                         IN mlx_size size ,
00051                                         IN mlx_size align,
00052                                         OUT mlx_void **ptr
00053                                         );
00054 
00055 mlx_status
00056 mlx_memory_free_dma(
00057                                         IN mlx_utils *utils,
00058                                         IN mlx_size size ,
00059                                         IN mlx_void **ptr
00060                                         );
00061 mlx_status
00062 mlx_memory_map_dma(
00063                                         IN mlx_utils *utils,
00064                                         IN mlx_void *Addr ,
00065                                         IN mlx_size NumberOfBytes,
00066                                         OUT mlx_physical_address *PhysAddr,
00067                                         OUT mlx_void **Mapping
00068                                         );
00069 
00070 mlx_status
00071 mlx_memory_ummap_dma(
00072                                         IN mlx_utils *utils,
00073                                         IN mlx_void *Mapping
00074                                         );
00075 
00076 mlx_status
00077 mlx_memory_cmp(
00078                                         IN mlx_utils *utils,
00079                                         IN mlx_void *first_block,
00080                                         IN mlx_void *second_block,
00081                                         IN mlx_size size,
00082                                         OUT mlx_uint32 *out
00083                                         );
00084 
00085 mlx_status
00086 mlx_memory_set(
00087                                         IN mlx_utils *utils,
00088                                         IN mlx_void *block,
00089                                         IN mlx_int32 value,
00090                                         IN mlx_size size
00091                                         );
00092 
00093 mlx_status
00094 mlx_memory_cpy(
00095                                         IN mlx_utils *utils,
00096                                         OUT mlx_void *destination_buffer,
00097                                         IN mlx_void *source_buffer,
00098                                         IN mlx_size length
00099                                         );
00100 
00101 mlx_status
00102 mlx_memory_cpu_to_be32(
00103                         IN mlx_utils *utils,
00104                         IN mlx_uint32 source,
00105                         IN mlx_uint32 *destination
00106                         );
00107 
00108 mlx_status
00109 mlx_memory_be32_to_cpu(
00110                         IN mlx_utils *utils,
00111                         IN mlx_uint32 source,
00112                         IN mlx_uint32 *destination
00113                         );
00114 
00115 #endif /* STUB_MLXUTILS_INCLUDE_PUBLIC_MEMORY_H_ */