1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3 * Copyright (c) 2021, Microsoft Corporation.
6 * Beau Belgrave <beaub@linux.microsoft.com>
8 #ifndef _UAPI_LINUX_USER_EVENTS_H
9 #define _UAPI_LINUX_USER_EVENTS_H
11 #include <linux/types.h>
12 #include <linux/ioctl.h>
15 #include <linux/uio.h>
20 #define USER_EVENTS_SYSTEM "user_events"
21 #define USER_EVENTS_PREFIX "u:"
23 /* Create dynamic location entry within a 32-bit value */
24 #define DYN_LOC(offset, size) ((size) << 16 | (offset))
27 * Describes an event registration and stores the results of the registration.
28 * This structure is passed to the DIAG_IOCSREG ioctl, callers at a minimum
29 * must set the size and name_args before invocation.
33 /* Input: Size of the user_reg structure being used */
36 /* Input: Pointer to string with event name, description and flags */
39 /* Output: Bitwise index of the event within the status page */
42 /* Output: Index of the event to use when writing data */
44 } __attribute__((__packed__));
46 #define DIAG_IOC_MAGIC '*'
48 /* Requests to register a user_event */
49 #define DIAG_IOCSREG _IOWR(DIAG_IOC_MAGIC, 0, struct user_reg*)
51 /* Requests to delete a user_event */
52 #define DIAG_IOCSDEL _IOW(DIAG_IOC_MAGIC, 1, char*)
54 #endif /* _UAPI_LINUX_USER_EVENTS_H */