1 /*
2 * @file HWSpinLockCmd.h
3 *
4 * @brief IOCTL commands for Hardware Spinlock access.
5 *
6 *
7 * @ver 02.00.00.46_alpha1
8 *
9 * ============================================================================
10 *
11 * Copyright (c) 2008-2015, Texas Instruments Incorporated
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
16 *
17 * * Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 *
20 * * Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * * Neither the name of Texas Instruments Incorporated nor the names of
25 * its contributors may be used to endorse or promote products derived
26 * from this software without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
30 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
31 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
32 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
35 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
36 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
37 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
38 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 * Contact information for paper mail:
40 * Texas Instruments
41 * Post Office Box 655303
42 * Dallas, Texas 75265
43 * Contact information:
44 * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
45 * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
46 * ============================================================================
47 *
48 */
50 /* QNX specific headers */
51 #include <sys/ioctl.h>
53 #if !defined (HWSPINLOCKCMDBASE_H)
54 #define HWSPINLOCKCMDBASE_H
56 /*!
57 * @brief Base command ID for HwSpinLock
58 */
60 typedef enum {
61 HWSPINLOCK_CMD_CREATE = 1,
62 HWSPINLOCK_CMD_DELETE = 2,
63 HWSPINLOCK_CMD_ENTER = 3,
64 HWSPINLOCK_CMD_LEAVE = 4,
65 HWSPINLOCK_CMD_GETLOCKID = 5,
66 } HWSpinLock_cmd_types;
68 typedef struct {
69 int resID;
70 int protectType;
71 int handleID;
72 int *key;
73 int apiStatus;
74 }HWSpinLockDrv_CmdArgs;
76 #define HWSPINLOCKDRV_BASE_CMD (0x1D)
78 #define CMD_HWSPINLOCK_CREATE _IOWR(HWSPINLOCKDRV_BASE_CMD,\
79 HWSPINLOCK_CMD_CREATE,\
80 HWSpinLockDrv_CmdArgs)
82 #define CMD_HWSPINLOCK_DELETE _IOWR(HWSPINLOCKDRV_BASE_CMD,\
83 HWSPINLOCK_CMD_DELETE,\
84 HWSpinLockDrv_CmdArgs)
86 #define CMD_HWSPINLOCK_ENTER _IOWR(HWSPINLOCKDRV_BASE_CMD,\
87 HWSPINLOCK_CMD_ENTER,\
88 HWSpinLockDrv_CmdArgs)
90 #define CMD_HWSPINLOCK_LEAVE _IOWR(HWSPINLOCKDRV_BASE_CMD,\
91 HWSPINLOCK_CMD_LEAVE,\
92 HWSpinLockDrv_CmdArgs)
94 #define CMD_HWSPINLOCK_GETLOCKID _IOWR(HWSPINLOCKDRV_BASE_CMD,\
95 HWSPINLOCK_CMD_GETLOCKID,\
96 HWSpinLockDrv_CmdArgs)
98 #if defined (__cplusplus)
99 }
100 #endif /* defined (__cplusplus) */
103 #endif /* !defined (HWSPINLOCKCMDBASE_H) */