diff options
Diffstat (limited to 'drivers/gpu/pvr/hash.h')
-rw-r--r-- | drivers/gpu/pvr/hash.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/drivers/gpu/pvr/hash.h b/drivers/gpu/pvr/hash.h new file mode 100644 index 00000000000..d45f4a98dda --- /dev/null +++ b/drivers/gpu/pvr/hash.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /********************************************************************** | ||
2 | * | ||
3 | * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful but, except | ||
10 | * as otherwise stated in writing, without any warranty; without even the | ||
11 | * implied warranty of merchantability or fitness for a particular purpose. | ||
12 | * See the GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in | ||
19 | * the file called "COPYING". | ||
20 | * | ||
21 | * Contact Information: | ||
22 | * Imagination Technologies Ltd. <gpl-support@imgtec.com> | ||
23 | * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK | ||
24 | * | ||
25 | ******************************************************************************/ | ||
26 | |||
27 | #ifndef _HASH_H_ | ||
28 | #define _HASH_H_ | ||
29 | |||
30 | #include "img_types.h" | ||
31 | #include "osfunc.h" | ||
32 | |||
33 | #if defined (__cplusplus) | ||
34 | extern "C" { | ||
35 | #endif | ||
36 | |||
37 | typedef IMG_UINT32 HASH_FUNC(IMG_SIZE_T uKeySize, IMG_VOID *pKey, IMG_UINT32 uHashTabLen); | ||
38 | typedef IMG_BOOL HASH_KEY_COMP(IMG_SIZE_T uKeySize, IMG_VOID *pKey1, IMG_VOID *pKey2); | ||
39 | |||
40 | typedef struct _HASH_TABLE_ HASH_TABLE; | ||
41 | |||
42 | IMG_UINT32 HASH_Func_Default (IMG_SIZE_T uKeySize, IMG_VOID *pKey, IMG_UINT32 uHashTabLen); | ||
43 | |||
44 | IMG_BOOL HASH_Key_Comp_Default (IMG_SIZE_T uKeySize, IMG_VOID *pKey1, IMG_VOID *pKey2); | ||
45 | |||
46 | HASH_TABLE * HASH_Create_Extended (IMG_UINT32 uInitialLen, IMG_SIZE_T uKeySize, HASH_FUNC *pfnHashFunc, HASH_KEY_COMP *pfnKeyComp); | ||
47 | |||
48 | HASH_TABLE * HASH_Create (IMG_UINT32 uInitialLen); | ||
49 | |||
50 | IMG_VOID HASH_Delete (HASH_TABLE *pHash); | ||
51 | |||
52 | IMG_BOOL HASH_Insert_Extended (HASH_TABLE *pHash, IMG_VOID *pKey, IMG_UINTPTR_T v); | ||
53 | |||
54 | IMG_BOOL HASH_Insert (HASH_TABLE *pHash, IMG_UINTPTR_T k, IMG_UINTPTR_T v); | ||
55 | |||
56 | IMG_UINTPTR_T HASH_Remove_Extended(HASH_TABLE *pHash, IMG_VOID *pKey); | ||
57 | |||
58 | IMG_UINTPTR_T HASH_Remove (HASH_TABLE *pHash, IMG_UINTPTR_T k); | ||
59 | |||
60 | IMG_UINTPTR_T HASH_Retrieve_Extended (HASH_TABLE *pHash, IMG_VOID *pKey); | ||
61 | |||
62 | IMG_UINTPTR_T HASH_Retrieve (HASH_TABLE *pHash, IMG_UINTPTR_T k); | ||
63 | |||
64 | #ifdef HASH_TRACE | ||
65 | IMG_VOID HASH_Dump (HASH_TABLE *pHash); | ||
66 | #endif | ||
67 | |||
68 | #if defined (__cplusplus) | ||
69 | } | ||
70 | #endif | ||
71 | |||
72 | #endif | ||
73 | |||