Advertisement
rz2k

umplock_ioctl.h

Sep 16th, 2012
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.87 KB | None | 0 0
  1. /*
  2.  * Copyright (C) 2012 ARM Limited. All rights reserved.
  3.  *
  4.  * This program is free software and is provided to you under the terms of the GNU General Public License version 2
  5.  * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
  6.  *
  7.  * A copy of the licence is included with the program, and can also be obtained from Free Software
  8.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  9.  */
  10.  
  11. #ifndef __UMPLOCK_IOCTL_H__
  12. #define __UMPLOCK_IOCTL_H__
  13.  
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17.  
  18. #include <linux/types.h>
  19. #include <linux/ioctl.h>
  20.  
  21. #ifndef __user
  22. #define __user
  23. #endif
  24.  
  25.  
  26. /**
  27.  * @file umplock_ioctl.h
  28.  * This file describes the interface needed to use the Linux device driver.
  29.  * The interface is used by the userpace Mali DDK.
  30.  */
  31.  
  32. typedef enum
  33. {
  34.     _LOCK_ACCESS_RENDERABLE = 1,
  35.     _LOCK_ACCESS_TEXTURE,
  36.     _LOCK_ACCESS_CPU_WRITE,
  37.     _LOCK_ACCESS_CPU_READ,
  38. } _lock_access_usage;
  39.  
  40. typedef struct _lock_item_s
  41. {
  42.     unsigned int secure_id;
  43.     _lock_access_usage usage;
  44. } _lock_item_s;
  45.  
  46.  
  47. #define LOCK_IOCTL_GROUP 0x91
  48.  
  49. #define _LOCK_IOCTL_CREATE_CMD  0   /* create kernel lock item        */
  50. #define _LOCK_IOCTL_PROCESS_CMD 1   /* process kernel lock item       */
  51. #define _LOCK_IOCTL_RELEASE_CMD 2   /* release kernel lock item       */
  52. #define _LOCK_IOCTL_ZAP_CMD     3   /* clean up all kernel lock items */
  53.  
  54. #define LOCK_IOCTL_MAX_CMDS    4
  55.  
  56. #define LOCK_IOCTL_CREATE  _IOW( LOCK_IOCTL_GROUP, _LOCK_IOCTL_CREATE_CMD,  _lock_item_s )
  57. #define LOCK_IOCTL_PROCESS _IOW( LOCK_IOCTL_GROUP, _LOCK_IOCTL_PROCESS_CMD, _lock_item_s )
  58. #define LOCK_IOCTL_RELEASE _IOW( LOCK_IOCTL_GROUP, _LOCK_IOCTL_RELEASE_CMD, _lock_item_s )
  59. #define LOCK_IOCTL_ZAP     _IO ( LOCK_IOCTL_GROUP, _LOCK_IOCTL_ZAP_CMD )
  60.  
  61. #ifdef __cplusplus
  62. }
  63. #endif
  64.  
  65. #endif /* __UMPLOCK_IOCTL_H__ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement