Debian Codegraph @

test/dapltest/udapl/udapl_tdep.c

raw
1 /*
2 * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved.
3 *
4 * This Software is licensed under one of the following licenses:
5 *
6 * 1) under the terms of the "Common Public License 1.0" a copy of which is
7 * in the file LICENSE.txt in the root directory. The license is also
8 * available from the Open Source Initiative, see
9 * http://www.opensource.org/licenses/cpl.php.
10 *
11 * 2) under the terms of the "The BSD License" a copy of which is in the file
12 * LICENSE2.txt in the root directory. The license is also available from
13 * the Open Source Initiative, see
14 * http://www.opensource.org/licenses/bsd-license.php.
15 *
16 * 3) under the terms of the "GNU General Public License (GPL) Version 2" a
17 * copy of which is in the file LICENSE3.txt in the root directory. The
18 * license is also available from the Open Source Initiative, see
19 * http://www.opensource.org/licenses/gpl-license.php.
20 *
21 * Licensee has the right to choose one of the above licenses.
22 *
23 * Redistributions of source code must retain the above copyright
24 * notice and one of the license notices.
25 *
26 * Redistributions in binary form must reproduce both the above copyright
27 * notice, one of the license notices in the documentation
28 * and/or other materials provided with the distribution.
29 */
30
31 #include "dapl_proto.h"
32
33 void DT_Tdep_Init(void)
34 {
35 DT_Mdep_LockInit(&g_PerfTestLock); /* For kDAPL, this is done in kdapl_module.c */
36 }
37
38 void DT_Tdep_End(void)
39 {
40 DT_Mdep_LockDestroy(&g_PerfTestLock); /* For kDAPL, this is done in kdapl_module.c */
41 }
42
43 DAT_RETURN DT_Tdep_Execute_Test(Params_t * params_ptr)
44 {
45 return DT_Execute_Test(params_ptr);
46 }
47
48 DAT_RETURN
49 DT_Tdep_lmr_create(DAT_IA_HANDLE ia_handle,
50 DAT_MEM_TYPE mem_type,
51 DAT_REGION_DESCRIPTION region,
52 DAT_VLEN len,
53 DAT_PZ_HANDLE pz_handle,
54 DAT_MEM_PRIV_FLAGS priv_flag,
55 DAT_LMR_HANDLE * lmr_handle_ptr,
56 DAT_LMR_CONTEXT * lmr_context_ptr,
57 DAT_RMR_CONTEXT * rmr_context_ptr,
58 DAT_VLEN * reg_size_ptr, DAT_VADDR * reg_addr_ptr)
59 {
60 return dat_lmr_create(ia_handle,
61 mem_type,
62 region,
63 len,
64 pz_handle,
65 priv_flag,
66 DAT_VA_TYPE_VA,
67 lmr_handle_ptr,
68 lmr_context_ptr,
69 rmr_context_ptr, reg_size_ptr, reg_addr_ptr);
70 }
71
72 DAT_RETURN
73 DT_Tdep_evd_create(DAT_IA_HANDLE ia_handle,
74 DAT_COUNT evd_min_qlen,
75 DAT_CNO_HANDLE cno_handle,
76 DAT_EVD_FLAGS evd_flags, DAT_EVD_HANDLE * evd_handle_ptr)
77 {
78 return dat_evd_create(ia_handle,
79 evd_min_qlen,
80 DAT_HANDLE_NULL, evd_flags, evd_handle_ptr);
81 }
82
83 DAT_RETURN DT_Tdep_evd_free(DAT_EVD_HANDLE evd_handle)
84 {
85 return dat_evd_free(evd_handle);
86 }
87
88 DAT_RETURN
89 DT_Tdep_evd_wait(DAT_EVD_HANDLE evd_handle,
90 DAT_TIMEOUT timeout, DAT_EVENT * event)
91 {
92 DAT_COUNT count;
93
94 return dat_evd_wait(evd_handle, timeout, 1, event, &count);
95 }
96
97 void DT_Tdep_PT_Printf(DT_Tdep_Print_Head * phead, const char *fmt, ...)
98 {
99 char buffer[256];
100 va_list args;
101
102 va_start(args, fmt);
103 vsprintf(buffer, fmt, args);
104 va_end(args);
105
106 printf("%s", buffer);
107 }
108
109 DAT_RETURN DT_Tdep_evd_dequeue(DAT_EVD_HANDLE evd_handle, DAT_EVENT * event)
110 {
111 return dat_evd_dequeue(evd_handle, event);
112 }