/drivers/gpu/pvr/mutex.h

https://bitbucket.org/wisechild/galaxy-nexus · C++ Header · 70 lines · 23 code · 22 blank · 25 comment · 0 complexity · d95cceb55da990c2bcb888f4051a6029 MD5 · raw file

  1. /**********************************************************************
  2. *
  3. * Copyright (C) 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. #ifndef __INCLUDED_LINUX_MUTEX_H_
  27. #define __INCLUDED_LINUX_MUTEX_H_
  28. #include <linux/version.h>
  29. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15))
  30. #include <linux/mutex.h>
  31. #else
  32. #include <asm/semaphore.h>
  33. #endif
  34. #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15))
  35. typedef struct mutex PVRSRV_LINUX_MUTEX;
  36. #else
  37. typedef struct {
  38. struct semaphore sSemaphore;
  39. atomic_t Count;
  40. }PVRSRV_LINUX_MUTEX;
  41. #endif
  42. extern IMG_VOID LinuxInitMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex);
  43. extern IMG_VOID LinuxLockMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex);
  44. extern PVRSRV_ERROR LinuxLockMutexInterruptible(PVRSRV_LINUX_MUTEX *psPVRSRVMutex);
  45. extern IMG_INT32 LinuxTryLockMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex);
  46. extern IMG_VOID LinuxUnLockMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex);
  47. extern IMG_BOOL LinuxIsLockedMutex(PVRSRV_LINUX_MUTEX *psPVRSRVMutex);
  48. #endif