OSDN Git Service

crypto: ccp - Add support for setting user ID for dynamic boost control
[tomoyo/tomoyo-test1.git] / include / uapi / linux / psp-dbc.h
index d032f78..7443c78 100644 (file)
@@ -18,6 +18,7 @@
 
 #define DBC_NONCE_SIZE         16
 #define DBC_SIG_SIZE           32
+#define DBC_UID_SIZE           16
 
 /**
  * struct dbc_user_nonce - Nonce exchange structure (input/output).
@@ -35,6 +36,16 @@ struct dbc_user_nonce {
 } __packed;
 
 /**
+ * struct dbc_user_setuid - UID exchange structure (input).
+ * @uid:       16 byte value representing software identity
+ * @signature: 32 byte signature created by software using a previous nonce
+ */
+struct dbc_user_setuid {
+       __u8    uid[DBC_UID_SIZE];
+       __u8    signature[DBC_SIG_SIZE];
+} __packed;
+
+/**
  * Dynamic Boost Control (DBC) IOC
  *
  * possible return codes for all DBC IOCTLs:
@@ -64,4 +75,13 @@ struct dbc_user_nonce {
  */
 #define DBCIOCNONCE    _IOWR(DBC_IOC_TYPE, 0x1, struct dbc_user_nonce)
 
+/**
+ * DBCIOCUID - Set the user ID (UID) of a calling process.
+ *             The user ID is 8 bytes long. It must be programmed using a
+ *             32 byte signature built using the nonce fetched from
+ *             DBCIOCNONCE.
+ *             The UID can only be set once until the system is rebooted.
+ */
+#define DBCIOCUID      _IOW(DBC_IOC_TYPE, 0x2, struct dbc_user_setuid)
+
 #endif /* __PSP_DBC_USER_H__ */