/*************************************************************************/ /*!
@Title PVR Common Bridge Module (kernel side)
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Receives calls from the user portion of services and
despatches them to functions in the kernel portion.
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include "img_defs.h"
#include "services.h"
#include "pvr_bridge_km.h"
#include "pvr_debug.h"
#include "ra.h"
#include "pvr_bridge.h"
#if defined(SUPPORT_SGX)
#include "sgx_bridge.h"
#endif
#if defined(SUPPORT_VGX)
#include "vgx_bridge.h"
#endif
#if defined(SUPPORT_MSVDX)
#include "msvdx_bridge.h"
#endif
#include "perproc.h"
#include "device.h"
#include "buffer_manager.h"
#include "refcount.h"
#include "pdump_km.h"
#include "syscommon.h"
#include "bridged_pvr_bridge.h"
#if defined(SUPPORT_SGX)
#include "bridged_sgx_bridge.h"
#endif
#if defined(SUPPORT_VGX)
#include "bridged_vgx_bridge.h"
#endif
#if defined(SUPPORT_MSVDX)
#include "bridged_msvdx_bridge.h"
#endif
#include "env_data.h"
#if defined (__linux__) || defined(__QNXNTO__)
#include "mmap.h"
#endif
#include "srvkm.h"
/* FIXME: we should include an OS specific header here to allow configuration of
* which functions should be excluded (like the shared srvclient bridge code)
* so that ports may choose to override certain things. */
/* For the purpose of maintainability, it is intended that this file should not
* contain large amounts of OS specific #ifdefs. Headers are fine, and perhaps
* a few one liners, but for anything more, please find a way to add e.g.
* an osfunc.c abstraction or override the entire function in question within
* env,*,pvr_bridge_k.c
*/
PVRSRV_BRIDGE_DISPATCH_TABLE_ENTRY g_BridgeDispatchTable[BRIDGE_DISPATCH_TABLE_ENTRY_COUNT];
#if defined(DEBUG_BRIDGE_KM)
PVRSRV_BRIDGE_GLOBAL_STATS g_BridgeGlobalStats;
#endif
#if defined(PVR_SECURE_HANDLES) || defined (SUPPORT_SID_INTERFACE)
static IMG_BOOL abSharedDeviceMemHeap[PVRSRV_MAX_CLIENT_HEAPS];
static IMG_BOOL *pbSharedDeviceMemHeap = abSharedDeviceMemHeap;
#else
static IMG_BOOL *pbSharedDeviceMemHeap = (IMG_BOOL*)IMG_NULL;
#endif
#if defined(DEBUG_BRIDGE_KM)
PVRSRV_ERROR
CopyFromUserWrapper(PVRSRV_PER_PROCESS_DATA *pProcData,
IMG_UINT32 ui32BridgeID,
IMG_VOID *pvDest,
IMG_VOID *pvSrc,
IMG_UINT32 ui32Size)
{
g_BridgeDispatchTable[ui32BridgeID].ui32CopyFromUserTotalBytes+=ui32Size;
g_BridgeGlobalStats.ui32TotalCopyFromUserBytes+=ui32Size;
return OSCopyFromUser(pProcData, pvDest, pvSrc, ui32Size);
}
PVRSRV_ERROR
CopyToUserWrapper(PVRSRV_PER_PROCESS_DATA *pProcData,
IMG_UINT32 ui32BridgeID,
IMG_VOID *pvDest,
IMG_VOID *pvSrc,
IMG_UINT32 ui32Size)
{
g_BridgeDispatchTable[ui32BridgeID].ui32CopyToUserTotalBytes+=ui32Size;
g_BridgeGlobalStats.ui32TotalCopyToUserBytes+=ui32Size;
return OSCopyToUser(pProcData, pvDest, pvSrc, ui32Size);
}
#endif
static IMG_INT
PVRSRVEnumerateDevicesBW(IMG_UINT32 ui32BridgeID,
IMG_VOID *psBridgeIn,
PVRSRV_BRIDGE_OUT_ENUMDEVICE *psEnumDeviceOUT,
PVRSRV_PER_PROCESS_DATA *psPerProc)
{
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_ENUM_DEVICES);
PVR_UNREFERENCED_PARAMETER(psPerProc);
PVR_UNREFERENCED_PARAMETER(psBridgeIn);
psEnumDeviceOUT->eError =
PVRSRVEnumerateDevicesKM(&psEnumDeviceOUT->ui32NumDevices,
psEnumDeviceOUT->asDeviceIdentifier);
return 0;
}
static IMG_INT
PVRSRVAcquireDeviceDataBW(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_ACQUIRE_DEVICEINFO *psAcquireDevInfoIN,
PVRSRV_BRIDGE_OUT_ACQUIRE_DEVICEINFO *psAcquireDevInfoOUT,
PVRSRV_PER_PROCESS_DATA *psPerProc)
{
IMG_HANDLE hDevCookieInt;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_ACQUIRE_DEVICEINFO);
psAcquireDevInfoOUT->eError =
PVRSRVAcquireDeviceDataKM(psAcquireDevInfoIN->uiDevIndex,
psAcquireDevInfoIN->eDeviceType,
&hDevCookieInt);
if(psAcquireDevInfoOUT->eError != PVRSRV_OK)
{
return 0;
}
/*
* Handle is not allocated in batch mode, as there is no resource
* allocation to undo if the handle allocation fails.
*/
psAcquireDevInfoOUT->eError =
PVRSRVAllocHandle(psPerProc->psHandleBase,
&psAcquireDevInfoOUT->hDevCookie,
hDevCookieInt,
PVRSRV_HANDLE_TYPE_DEV_NODE,
PVRSRV_HANDLE_ALLOC_FLAG_SHARED);
return 0;
}
static IMG_INT
PVRSRVCreateDeviceMemContextBW(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_CREATE_DEVMEMCONTEXT *psCreateDevMemContextIN,
PVRSRV_BRIDGE_OUT_CREATE_DEVMEMCONTEXT *psCreateDevMemContextOUT,
PVRSRV_PER_PROCESS_DATA *psPerProc)
{
IMG_HANDLE hDevCookieInt;
IMG_HANDLE hDevMemContextInt;
IMG_UINT32 i;
IMG_BOOL bCreated;
#if defined (SUPPORT_SID_INTERFACE)
PVRSRV_HEAP_INFO_KM asHeapInfo[PVRSRV_MAX_CLIENT_HEAPS];
#endif
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CREATE_DEVMEMCONTEXT);
/*
* We potentially need one handle for the device memory context,
* and one handle for each client heap.
*/
NEW_HANDLE_BATCH_OR_ERROR(psCreateDevMemContextOUT->eError, psPerProc, PVRSRV_MAX_CLIENT_HEAPS + 1)
psCreateDevMemContextOUT->eError =
PVRSRVLookupHandle(psPerProc->psHandleBase, &hDevCookieInt,
psCreateDevMemContextIN->hDevCookie,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psCreateDevMemContextOUT->eError != PVRSRV_OK)
{
return 0;
}
psCreateDevMemContextOUT->eError =
PVRSRVCreateDeviceMemContextKM(hDevCookieInt,
psPerProc,
&hDevMemContextInt,
&psCreateDevMemContextOUT->ui32ClientHeapCount,
#if defined (SUPPORT_SID_INTERFACE)
&asHeapInfo[0],
#else
&psCreateDevMemContextOUT->sHeapInfo[0],
#endif
&bCreated,
pbSharedDeviceMemHeap);
if(psCreateDevMemContextOUT->eError != PVRSRV_OK)
{
return 0;
}
/*
* Only allocate a handle if the device memory context was cre
没有合适的资源?快使用搜索试试~ 我知道了~
am3352交叉编译工具 gcc
需积分: 25 13 下载量 83 浏览量
2018-11-19
17:51:11
上传
评论
收藏 167.66MB GZ 举报
温馨提示
共2000个文件
h:3981个
list:463个
control:460个
am3352的交叉编译工具链!am3352的交叉编译工具链!am3352的交叉编译工具链!
资源推荐
资源详情
资源评论
收起资源包目录
am3352交叉编译工具 gcc (2000个子文件)
bridged_pvr_bridge.c 161KB
mmu.c 147KB
osfunc.c 124KB
sgxinit.c 117KB
bridged_sgx_bridge.c 113KB
buffer_manager.c 94KB
pdump_common.c 85KB
mm.c 85KB
deviceclass.c 81KB
handle.c 78KB
devicemem.c 70KB
ra.c 62KB
sgxutils.c 59KB
ltdl.c 54KB
ltdl.c 54KB
pvrsrv.c 49KB
omaplfb_displayclass.c 48KB
omaplfb_displayclass.c 48KB
omaplfb_displayclass.c 48KB
mmap.c 47KB
queue.c 46KB
dcigettext.c 45KB
localename.c 42KB
proc.c 39KB
sysconfig.c 37KB
plural.c 36KB
omaplfb_linux.c 33KB
loadmsgcat.c 33KB
omaplfb_linux.c 33KB
bc_cat.c 33KB
module.c 32KB
omaplfb_linux.c 32KB
sgxkick.c 32KB
resman.c 29KB
sgxtransfer.c 28KB
sgxreset.c 28KB
power.c 27KB
sysutils_linux.c 24KB
sysconfig.c 24KB
sysconfig.c 24KB
sysconfig.c 24KB
sysconfig.c 24KB
hash.c 23KB
lock.c 22KB
vasnprintf.c 22KB
pdump.c 21KB
sgxpower.c 18KB
pvr_drm.c 18KB
bufferclass_example_linux.c 18KB
bufferclass_example.c 18KB
refcount.c 17KB
sysutils_linux.c 15KB
sysutils_linux.c 15KB
pb.c 15KB
sysutils_linux.c 15KB
pvr_bridge_k.c 14KB
relocatable.c 14KB
sysutils_linux.c 14KB
pvr_debug.c 14KB
dyld.c 13KB
dyld.c 13KB
event.c 12KB
printf-parse.c 12KB
localcharset.c 12KB
perproc.c 12KB
xxmodule.c 12KB
bufferclass_example_private.c 12KB
fileman.c 11KB
rl-fgets.c 11KB
l10nflist.c 11KB
loadlibrary.c 11KB
loadlibrary.c 11KB
localealias.c 10KB
slist.c 10KB
slist.c 10KB
bindtextdom.c 9KB
preopen.c 9KB
preopen.c 9KB
printf.c 9KB
mem_debug.c 9KB
metrics.c 7KB
shl_load.c 7KB
shl_load.c 7KB
rlptytest.c 6KB
dlopen.c 6KB
dlopen.c 6KB
pvr_drm_stubs.c 6KB
lists.c 6KB
lt_dlloader.c 6KB
lt_dlloader.c 6KB
finddomain.c 6KB
argz.c 6KB
argz.c 6KB
mutils.c 6KB
excallback.c 6KB
mem.c 5KB
gobjectnotifyqueue.c 5KB
osperproc.c 5KB
load_add_on.c 5KB
load_add_on.c 5KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
iotcsdn
- 粉丝: 47
- 资源: 34
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功