aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher2015-04-20 11:04:22 -0500
committerAlex Deucher2015-08-05 12:47:48 -0500
commit09361395363805b5892d48d7bc10cf717e4d2927 (patch)
treec81192a93843d2f9af16df2b9ec71a66579314d5 /amdgpu/util_hash_table.h
parenta3c89dda5b519f6b217bebe97f6795b820931b78 (diff)
downloadexternal-libdrm-09361395363805b5892d48d7bc10cf717e4d2927.tar.gz
external-libdrm-09361395363805b5892d48d7bc10cf717e4d2927.tar.xz
external-libdrm-09361395363805b5892d48d7bc10cf717e4d2927.zip
drm: add libdrm_amdgpu (v7)
This is the new ioctl wrapper used by the new admgpu driver. It's primarily used by xf86-video-amdgpu and mesa. v2: fix amdgpu_drm.h install v3: Integrate some of the sugestions from Emil: clean up Makefile.am, configure.ac capitalize header guards fix _FILE_OFFSET_BITS with config.h use drm_mmap/drm_munmap Remove unused ARRAY_SIZE macro use shared list implementation use shared math implementation use drmGetNodeTypeFromFd helper v4: remove unused tiling defines v5: include amdgpu.h in Makefile.am v6: update amdgpu_drm.h v7: libdrm.h -> libdrm_macros.h Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'amdgpu/util_hash_table.h')
-rw-r--r--amdgpu/util_hash_table.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/amdgpu/util_hash_table.h b/amdgpu/util_hash_table.h
new file mode 100644
index 00000000..04fe7043
--- /dev/null
+++ b/amdgpu/util_hash_table.h
@@ -0,0 +1,65 @@
1/**************************************************************************
2 *
3 * Copyright 2008 VMware, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28/**
29 * General purpose hash table.
30 *
31 * @author José Fonseca <jfonseca@vmware.com>
32 */
33
34#ifndef U_HASH_TABLE_H_
35#define U_HASH_TABLE_H_
36
37/**
38 * Generic purpose hash table.
39 */
40struct util_hash_table;
41
42/**
43 * Create an hash table.
44 *
45 * @param hash hash function
46 * @param compare should return 0 for two equal keys.
47 */
48struct util_hash_table *util_hash_table_create(unsigned (*hash)(void *key),
49 int (*compare)(void *key1, void *key2));
50
51void util_hash_table_set(struct util_hash_table *ht, void *key, void *value);
52
53void *util_hash_table_get(struct util_hash_table *ht, void *key);
54
55void util_hash_table_remove(struct util_hash_table *ht, void *key);
56
57void util_hash_table_clear(struct util_hash_table *ht);
58
59void util_hash_table_foreach(struct util_hash_table *ht,
60 void (*callback)(void *key, void *value, void *data),
61 void *data);
62
63void util_hash_table_destroy(struct util_hash_table *ht);
64
65#endif /* U_HASH_TABLE_H_ */