info_page_client.h 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*************************************************************************/ /*!
  2. @File
  3. @Title Kernel/User mode general purpose shared memory.
  4. @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
  5. @Description General purpose shared memory (i.e. information page) mapped by
  6. kernel space driver and user space clients. All info page
  7. entries are sizeof(IMG_UINT32) on both 32/64-bit environments.
  8. @License Dual MIT/GPLv2
  9. The contents of this file are subject to the MIT license as set out below.
  10. Permission is hereby granted, free of charge, to any person obtaining a copy
  11. of this software and associated documentation files (the "Software"), to deal
  12. in the Software without restriction, including without limitation the rights
  13. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14. copies of the Software, and to permit persons to whom the Software is
  15. furnished to do so, subject to the following conditions:
  16. The above copyright notice and this permission notice shall be included in
  17. all copies or substantial portions of the Software.
  18. Alternatively, the contents of this file may be used under the terms of
  19. the GNU General Public License Version 2 ("GPL") in which case the provisions
  20. of GPL are applicable instead of those above.
  21. If you wish to allow use of your version of this file only under the terms of
  22. GPL, and not to allow others to use your version of this file under the terms
  23. of the MIT license, indicate your decision by deleting the provisions above
  24. and replace them with the notice and other provisions required by GPL as set
  25. out in the file called "GPL-COPYING" included in this distribution. If you do
  26. not delete the provisions above, a recipient may use your version of this file
  27. under the terms of either the MIT license or GPL.
  28. This License is also included in this distribution in the file called
  29. "MIT-COPYING".
  30. EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
  31. PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
  32. BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  33. PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
  34. COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  35. IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  36. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  37. */ /**************************************************************************/
  38. #ifndef INFO_PAGE_CLIENT_H
  39. #define INFO_PAGE_CLIENT_H
  40. #include "device_connection.h"
  41. #include "info_page_defs.h"
  42. #if defined(__KERNEL__)
  43. #include "pvrsrv.h"
  44. #endif
  45. /*************************************************************************/ /*!
  46. @Function GetInfoPage
  47. @Description Return Info Page address
  48. @Input hDevConnection - Services device connection
  49. @Return Info Page address
  50. */
  51. /*****************************************************************************/
  52. static INLINE IMG_PUINT32 GetInfoPage(SHARED_DEV_CONNECTION hDevConnection)
  53. {
  54. #if defined(__KERNEL__)
  55. return (PVRSRVGetPVRSRVData())->pui32InfoPage;
  56. #else
  57. return hDevConnection->pui32InfoPage;
  58. #endif
  59. }
  60. /*************************************************************************/ /*!
  61. @Function GetInfoPageDebugFlags
  62. @Description Return Info Page debug flags
  63. @Input hDevConnection - Services device connection
  64. @Return Info Page debug flags
  65. */
  66. /*****************************************************************************/
  67. static INLINE IMG_UINT32 GetInfoPageDebugFlags(SHARED_DEV_CONNECTION hDevConnection)
  68. {
  69. return GetInfoPage(hDevConnection)[DEBUG_FEATURE_FLAGS];
  70. }
  71. #endif /* INFO_PAGE_CLIENT_H */