[golan] Add Connect-IB, ConnectX-4 and ConnectX-4 Lx (Infiniband) support
[ipxe.git] / src / drivers / infiniband / mlx_utils / include / public / mlx_memory.h
1 #ifndef MLXUTILS_INCLUDE_PUBLIC_MEMORY_H_
2 #define MLXUTILS_INCLUDE_PUBLIC_MEMORY_H_
3
4 /*
5 * Copyright (C) 2015 Mellanox Technologies Ltd.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
21 */
22
23 FILE_LICENCE ( GPL2_OR_LATER );
24
25 #include "mlx_utils.h"
26
27
28 mlx_status
29 mlx_memory_alloc(
30 IN mlx_utils *utils,
31 IN mlx_size size,
32 OUT mlx_void **ptr
33 );
34
35 mlx_status
36 mlx_memory_zalloc(
37 IN mlx_utils *utils,
38 IN mlx_size size,
39 OUT mlx_void **ptr
40 );
41
42 mlx_status
43 mlx_memory_free(
44 IN mlx_utils *utils,
45 IN mlx_void **ptr
46 );
47 mlx_status
48 mlx_memory_alloc_dma(
49 IN mlx_utils *utils,
50 IN mlx_size size ,
51 IN mlx_size align,
52 OUT mlx_void **ptr
53 );
54
55 mlx_status
56 mlx_memory_free_dma(
57 IN mlx_utils *utils,
58 IN mlx_size size ,
59 IN mlx_void **ptr
60 );
61 mlx_status
62 mlx_memory_map_dma(
63 IN mlx_utils *utils,
64 IN mlx_void *Addr ,
65 IN mlx_size NumberOfBytes,
66 OUT mlx_physical_address *PhysAddr,
67 OUT mlx_void **Mapping
68 );
69
70 mlx_status
71 mlx_memory_ummap_dma(
72 IN mlx_utils *utils,
73 IN mlx_void *Mapping
74 );
75
76 mlx_status
77 mlx_memory_cmp(
78 IN mlx_utils *utils,
79 IN mlx_void *first_block,
80 IN mlx_void *second_block,
81 IN mlx_size size,
82 OUT mlx_uint32 *out
83 );
84
85 mlx_status
86 mlx_memory_set(
87 IN mlx_utils *utils,
88 IN mlx_void *block,
89 IN mlx_int32 value,
90 IN mlx_size size
91 );
92
93 mlx_status
94 mlx_memory_cpy(
95 IN mlx_utils *utils,
96 OUT mlx_void *destination_buffer,
97 IN mlx_void *source_buffer,
98 IN mlx_size length
99 );
100
101 mlx_status
102 mlx_memory_cpu_to_be32(
103 IN mlx_utils *utils,
104 IN mlx_uint32 source,
105 IN mlx_uint32 *destination
106 );
107
108 mlx_status
109 mlx_memory_be32_to_cpu(
110 IN mlx_utils *utils,
111 IN mlx_uint32 source,
112 IN mlx_uint32 *destination
113 );
114
115 #endif /* STUB_MLXUTILS_INCLUDE_PUBLIC_MEMORY_H_ */