1 /*************************************************************************/ /*!
3 @Title Header for Services abstraction layer
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description Declaration of an interface layer used to abstract code that
6 can be compiled outside of the DDK, potentially in a
7 completely different OS.
8 All the headers included by this file must also be copied to
9 the alternative source tree.
10 All the functions declared here must have a DDK implementation
11 inside the DDK source tree (e.g. rgxlayer_impl.h/.c) and
12 another different implementation in case they are used outside
14 All of the functions accept as a first parameter a
15 "const void *hPrivate" argument. It should be used to pass
16 around any implementation specific data required.
17 @License Dual MIT/GPLv2
19 The contents of this file are subject to the MIT license as set out below.
21 Permission is hereby granted, free of charge, to any person obtaining a copy
22 of this software and associated documentation files (the "Software"), to deal
23 in the Software without restriction, including without limitation the rights
24 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25 copies of the Software, and to permit persons to whom the Software is
26 furnished to do so, subject to the following conditions:
28 The above copyright notice and this permission notice shall be included in
29 all copies or substantial portions of the Software.
31 Alternatively, the contents of this file may be used under the terms of
32 the GNU General Public License Version 2 ("GPL") in which case the provisions
33 of GPL are applicable instead of those above.
35 If you wish to allow use of your version of this file only under the terms of
36 GPL, and not to allow others to use your version of this file under the terms
37 of the MIT license, indicate your decision by deleting the provisions above
38 and replace them with the notice and other provisions required by GPL as set
39 out in the file called "GPL-COPYING" included in this distribution. If you do
40 not delete the provisions above, a recipient may use your version of this file
41 under the terms of either the MIT license or GPL.
43 This License is also included in this distribution in the file called
46 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
47 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
48 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
49 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
50 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
51 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
52 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
53 */ /**************************************************************************/
55 #if !defined (__RGXLAYER_H__)
56 #define __RGXLAYER_H__
58 #if defined (__cplusplus)
64 #include "img_types.h"
65 #include "pvrsrv_error.h" /* includes pvrsrv_errors.h */
66 #if defined(SUPPORT_KERNEL_SRVINIT)
67 #include "rgx_bvnc_defs_km.h"
70 #include "rgx_firmware_processor.h"
72 * rgx_meta.h and rgx_mips.h,
74 * rgx_cr_defs_km.h (under SUPPORT_KERNEL_SRVINIT),
75 * RGX_BVNC_CORE_KM_HEADER (rgxcore_km_B.V.N.C.h),
76 * RGX_BNC_CONFIG_KM_HEADER (rgxconfig_km_B.V.N.C.h)
79 #include "rgx_fwif_shared.h"
80 /* FIXME required because of RGXFWIF_DEV_VIRTADDR but this header
81 * includes a lot of other headers.. RGXFWIF_DEV_VIRTADDR must be moved
82 * somewhere else (either img_types.h or a new header) */
86 *******************************************************************************
90 @Description MemCopy implementation
92 @Input hPrivate : Implementation specific data
93 @Input pvDst : Pointer to the destination
94 @Input pvSrc : Pointer to the source location
95 @Input uiSize : The amount of memory to copy in bytes
99 ******************************************************************************/
101 void RGXMemCopy(const void *hPrivate,
107 *******************************************************************************
111 @Description MemSet implementation
113 @Input hPrivate : Implementation specific data
114 @Input pvDst : Pointer to the start of the memory region
115 @Input ui8Value : The value to be written
116 @Input uiSize : The number of bytes to be set to ui8Value
120 ******************************************************************************/
122 void RGXMemSet(const void *hPrivate,
128 *******************************************************************************
130 @Function RGXCommentLogInit
132 @Description Generic log function used for debugging or other purposes
134 @Input hPrivate : Implementation specific data
135 @Input pszString : Message to be printed
136 @Input ... : Variadic arguments
140 ******************************************************************************/
142 void RGXCommentLogInit(const void *hPrivate,
143 const IMG_CHAR *pszString,
147 *******************************************************************************
149 @Function RGXErrorLogInit
151 @Description Generic error log function used for debugging or other purposes
153 @Input hPrivate : Implementation specific data
154 @Input pszString : Message to be printed
155 @Input ... : Variadic arguments
159 ******************************************************************************/
161 void RGXErrorLogInit(const void *hPrivate,
162 const IMG_CHAR *pszString,
165 #if defined(SUPPORT_KERNEL_SRVINIT)
167 *******************************************************************************
169 @Function RGXDeviceHasFeatureInit
171 @Description Checks if a device has a particular feature
173 @Input hPrivate : Implementation specific data
174 @Input ui64Feature : Feature to check
176 @Return IMG_TRUE if the given feature is available, IMG_FALSE otherwise
178 ******************************************************************************/
180 IMG_BOOL RGXDeviceHasFeatureInit(const void *hPrivate, IMG_UINT64 ui64Feature);
184 *******************************************************************************
186 @Function RGXGetFWCorememSize
188 @Description Get the FW coremem size
190 @Input hPrivate : Implementation specific data
192 @Return FW coremem size
194 ******************************************************************************/
196 IMG_UINT32 RGXGetFWCorememSize(const void *hPrivate);
199 #if defined (__cplusplus)
203 #endif /* !defined (__RGXLAYER_H__) */