HELLO·Android
系统源代码
IT资讯
技术文章
我的收藏
注册
登录
-
我收藏的文章
创建代码块
我的代码块
我的账号
Pie
|
9.0.0_r8
下载
查看原文件
收藏
根目录
hardware
intel
common
libwsbm
src
wsbm_driver.h
/************************************************************************** * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, TX., USA * All Rights Reserved. * Copyright 2009 VMware, Inc., Palo Alto, CA., USA * All Rights Reserved. * * 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, sub license, 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 (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. * * 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 NON-INFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS 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. * **************************************************************************/ /* * Authors: * Thomas Hellstrm
*/ #ifndef _WSBM_DRIVER_H #define _WSBM_DRIVER_H #include
#include "wsbm_util.h" #define WSBM_MUTEX_SPACE 16 #define WSBM_COND_SPACE 16 struct _WsbmMutex { struct _WsbmThreadFuncs *func; unsigned long storage[WSBM_MUTEX_SPACE]; }; struct _WsbmCond { struct _WsbmThreadFuncs *func; unsigned long storage[WSBM_COND_SPACE]; }; struct _WsbmThreadFuncs { int (*mutexInit) (struct _WsbmMutex *, struct _WsbmThreadFuncs *); void (*mutexFree) (struct _WsbmMutex *); void (*mutexLock) (struct _WsbmMutex *); void (*mutexUnlock) (struct _WsbmMutex *); int (*condInit) (struct _WsbmCond *, struct _WsbmThreadFuncs *); void (*condFree) (struct _WsbmCond *); void (*condWait) (struct _WsbmCond *, struct _WsbmMutex *); void (*condBroadcast) (struct _WsbmCond *); }; extern struct _WsbmThreadFuncs *wsbmCurThreadFunc; #define WSBM_MUTEX_INIT(_mutex) \ wsbmThreadFuncs()->mutexInit(_mutex,wsbmThreadFuncs()) #define WSBM_MUTEX_FREE(_mutex) \ { \ (_mutex)->func->mutexFree(_mutex); \ } #define WSBM_MUTEX_LOCK(_mutex) \ (_mutex)->func->mutexLock(_mutex); #define WSBM_MUTEX_UNLOCK(_mutex) \ (_mutex)->func->mutexUnlock(_mutex); #define WSBM_COND_INIT(_mutex) \ wsbmThreadFuncs()->condInit(_mutex, wsbmThreadFuncs()) #define WSBM_COND_FREE(_cond) \ { \ (_cond)->func->condFree(_cond); \ } #define WSBM_COND_WAIT(_cond, _mutex) \ (_cond)->func->condWait(_cond, _mutex); #define WSBM_COND_BROADCAST(_cond) \ (_cond)->func->condBroadcast(_cond); struct _WsbmVNodeFuncs { struct _ValidateNode *(*alloc) (struct _WsbmVNodeFuncs *, int); void (*free) (struct _ValidateNode *); void (*clear) (struct _ValidateNode *); }; extern struct _WsbmVNodeFuncs *wsbmCurVNodeFunc; struct _WsbmBufStorage; struct _WsbmKernelBuf; struct _ValidateNode { uint32_t hash; int type_id; struct _WsbmListHead head; struct _WsbmListHead hashHead; int listItem; uint64_t set_flags; uint64_t clr_flags; void *buf; struct _WsbmVNodeFuncs *func; }; static inline struct _WsbmVNodeFuncs * wsbmVNodeFuncs(void) { return wsbmCurVNodeFunc; } static inline struct _WsbmThreadFuncs * wsbmThreadFuncs(void) { return wsbmCurThreadFunc; } extern struct _WsbmThreadFuncs *wsbmNullThreadFuncs(void); extern struct _WsbmThreadFuncs *wsbmPThreadFuncs(void); #endif
C++程序
|
132行
|
3.83 KB
原始内容
高亮显示
复制内容
×
已收藏
收藏成功,您可以在我收藏的代码页面中查看,其地址为:
https://www.androidos.net.cn/my/collect/code
。
登录后可以享受更多权益
您还没有登录,登录后您可以:
收藏Android系统代码
收藏喜欢的文章
多个平台共享账号
去登录
首次使用?从这里
注册