more uapi bits

This commit is contained in:
2026-10-18 14:47:02 +02:00
parent 27b2905dd7
commit 0ed321f622
7 changed files with 421 additions and 0 deletions
+237
View File
@@ -0,0 +1,237 @@
/* SPDX-License-Identifier: Unlicense */
#ifndef __ZINNIA_UAPI_INPUT_H
#define __ZINNIA_UAPI_INPUT_H
#include <stdint.h>
#include <uapi/ioctls.h>
#include <uapi/time.h>
struct __input_event {
struct __timeval time;
uint16_t type;
uint16_t code;
int32_t value;
};
struct __input_id {
uint16_t bustype;
uint16_t vendor;
uint16_t product;
uint16_t version;
};
struct __input_absinfo {
int32_t value;
int32_t minimum;
int32_t maximum;
int32_t fuzz;
int32_t flat;
int32_t resolution;
};
#define __EV_SYN 0x00
#define __EV_KEY 0x01
#define __EV_REL 0x02
#define __EV_ABS 0x03
#define __EV_MSC 0x04
#define __EV_CNT 0x20
#define __SYN_REPORT 0
#define __REL_X 0x00
#define __REL_Y 0x01
#define __REL_WHEEL 0x08
#define __REL_MAX 0x0f
#define __REL_CNT 0x10
#define __ABS_X 0x00
#define __ABS_Y 0x01
#define __ABS_Z 0x02
#define __ABS_RX 0x03
#define __ABS_RY 0x04
#define __ABS_RZ 0x05
#define __ABS_THROTTLE 0x06
#define __ABS_RUDDER 0x07
#define __ABS_WHEEL 0x08
#define __ABS_HAT0X 0x10
#define __ABS_HAT0Y 0x11
#define __ABS_MAX 0x3f
#define __ABS_CNT 0x40
#define __KEY_RESERVED 0
#define __KEY_ESC 1
#define __KEY_1 2
#define __KEY_2 3
#define __KEY_3 4
#define __KEY_4 5
#define __KEY_5 6
#define __KEY_6 7
#define __KEY_7 8
#define __KEY_8 9
#define __KEY_9 10
#define __KEY_0 11
#define __KEY_MINUS 12
#define __KEY_EQUAL 13
#define __KEY_BACKSPACE 14
#define __KEY_TAB 15
#define __KEY_Q 16
#define __KEY_W 17
#define __KEY_E 18
#define __KEY_R 19
#define __KEY_T 20
#define __KEY_Y 21
#define __KEY_U 22
#define __KEY_I 23
#define __KEY_O 24
#define __KEY_P 25
#define __KEY_LEFTBRACE 26
#define __KEY_RIGHTBRACE 27
#define __KEY_ENTER 28
#define __KEY_LEFTCTRL 29
#define __KEY_A 30
#define __KEY_S 31
#define __KEY_D 32
#define __KEY_F 33
#define __KEY_G 34
#define __KEY_H 35
#define __KEY_J 36
#define __KEY_K 37
#define __KEY_L 38
#define __KEY_SEMICOLON 39
#define __KEY_APOSTROPHE 40
#define __KEY_GRAVE 41
#define __KEY_LEFTSHIFT 42
#define __KEY_BACKSLASH 43
#define __KEY_Z 44
#define __KEY_X 45
#define __KEY_C 46
#define __KEY_V 47
#define __KEY_B 48
#define __KEY_N 49
#define __KEY_M 50
#define __KEY_COMMA 51
#define __KEY_DOT 52
#define __KEY_SLASH 53
#define __KEY_RIGHTSHIFT 54
#define __KEY_KPASTERISK 55
#define __KEY_LEFTALT 56
#define __KEY_SPACE 57
#define __KEY_CAPSLOCK 58
#define __KEY_F1 59
#define __KEY_F2 60
#define __KEY_F3 61
#define __KEY_F4 62
#define __KEY_F5 63
#define __KEY_F6 64
#define __KEY_F7 65
#define __KEY_F8 66
#define __KEY_F9 67
#define __KEY_F10 68
#define __KEY_NUMLOCK 69
#define __KEY_SCROLLLOCK 70
#define __KEY_KP7 71
#define __KEY_KP8 72
#define __KEY_KP9 73
#define __KEY_KPMINUS 74
#define __KEY_KP4 75
#define __KEY_KP5 76
#define __KEY_KP6 77
#define __KEY_KPPLUS 78
#define __KEY_KP1 79
#define __KEY_KP2 80
#define __KEY_KP3 81
#define __KEY_KP0 82
#define __KEY_KPDOT 83
#define __KEY_F11 87
#define __KEY_F12 88
#define __KEY_KPENTER 96
#define __KEY_RIGHTCTRL 97
#define __KEY_KPSLASH 98
#define __KEY_SYSRQ 99
#define __KEY_RIGHTALT 100
#define __KEY_HOME 102
#define __KEY_UP 103
#define __KEY_PAGEUP 104
#define __KEY_LEFT 105
#define __KEY_RIGHT 106
#define __KEY_END 107
#define __KEY_DOWN 108
#define __KEY_PAGEDOWN 109
#define __KEY_INSERT 110
#define __KEY_DELETE 111
#define __KEY_LEFTMETA 125
#define __KEY_RIGHTMETA 126
#define __KEY_F13 183
#define __KEY_F14 184
#define __KEY_F15 185
#define __KEY_F16 186
#define __KEY_F17 187
#define __KEY_F18 188
#define __KEY_F19 189
#define __KEY_F20 190
#define __KEY_F21 191
#define __KEY_F22 192
#define __KEY_F23 193
#define __KEY_F24 194
#define __KEY_CNT 0x300
#define __BTN_MISC 0x100
#define __BTN_LEFT 0x110
#define __BTN_RIGHT 0x111
#define __BTN_MIDDLE 0x112
#define __BTN_SIDE 0x113
#define __BTN_EXTRA 0x114
#define __BTN_FORWARD 0x115
#define __BTN_BACK 0x116
#define __BTN_TRIGGER 0x120
#define __BTN_THUMB 0x121
#define __BTN_THUMB2 0x122
#define __BTN_TOP 0x123
#define __BTN_TOP2 0x124
#define __BTN_PINKIE 0x125
#define __BTN_BASE 0x126
#define __BTN_BASE2 0x127
#define __BTN_BASE3 0x128
#define __BTN_BASE4 0x129
#define __BTN_BASE5 0x12a
#define __BTN_BASE6 0x12b
#define __BTN_SOUTH 0x130
#define __BTN_EAST 0x131
#define __BTN_C 0x132
#define __BTN_NORTH 0x133
#define __BTN_WEST 0x134
#define __BTN_Z 0x135
#define __BTN_TL 0x136
#define __BTN_TR 0x137
#define __BTN_TL2 0x138
#define __BTN_TR2 0x139
#define __BTN_SELECT 0x13a
#define __BTN_START 0x13b
#define __BTN_MODE 0x13c
#define __BTN_THUMBL 0x13d
#define __BTN_THUMBR 0x13e
#define __BUS_USB 0x03
#define __BUS_I8042 0x11
#define __EV_VERSION 0x010001
#define __EVIOCGVERSION __IOR('E', 0x01, int)
#define __EVIOCGID __IOR('E', 0x02, struct __input_id)
#define __EVIOCGNAME(len) __IOC(__IOC_OUT, 'E', 0x06, len)
#define __EVIOCGPHYS(len) __IOC(__IOC_OUT, 'E', 0x07, len)
#define __EVIOCGUNIQ(len) __IOC(__IOC_OUT, 'E', 0x08, len)
#define __EVIOCGPROP(len) __IOC(__IOC_OUT, 'E', 0x09, len)
#define __EVIOCGKEY(len) __IOC(__IOC_OUT, 'E', 0x18, len)
#define __EVIOCGLED(len) __IOC(__IOC_OUT, 'E', 0x19, len)
#define __EVIOCGSND(len) __IOC(__IOC_OUT, 'E', 0x1A, len)
#define __EVIOCGSW(len) __IOC(__IOC_OUT, 'E', 0x1B, len)
#define __EVIOCGBIT(ev, len) __IOC(__IOC_OUT, 'E', 0x20 + (ev), len)
#define __EVIOCGABS(abs) __IOR('E', 0x40 + (abs), struct __input_absinfo)
#define __EVIOCGRAB __IOW('E', 0x90, int)
#define __EVIOCREVOKE __IOW('E', 0x91, int)
#define __EVIOCSCLOCKID __IOW('E', 0xA0, int)
#endif
+3
View File
@@ -11,6 +11,9 @@
#define __IO(group, num) __IOC(__IOC_VOID, (group), (num), 0) #define __IO(group, num) __IOC(__IOC_VOID, (group), (num), 0)
#define __IOR(group, num, type) __IOC(__IOC_OUT, (group), (num), sizeof(type)) #define __IOR(group, num, type) __IOC(__IOC_OUT, (group), (num), sizeof(type))
#define __IOW(group, num, type) __IOC(__IOC_IN, (group), (num), sizeof(type)) #define __IOW(group, num, type) __IOC(__IOC_IN, (group), (num), sizeof(type))
#define __IOC_GROUP(req) (((req) >> 8) & 0xFF)
#define __IOC_NUM(req) ((req) & 0xFF)
#define __IOC_LEN(req) (((req) >> 16) & 0x3FFF)
#define __TCGETS 0x5401 #define __TCGETS 0x5401
#define __TCSETS 0x5402 #define __TCSETS 0x5402
+15
View File
@@ -0,0 +1,15 @@
/* SPDX-License-Identifier: Unlicense */
#ifndef __ZINNIA_UAPI_REBOOT_H
#define __ZINNIA_UAPI_REBOOT_H
#define __REBOOT_MAGIC 0xDEADBEEF
#define __RB_AUTOBOOT 0xdeadb007
#define __RB_HALT_SYSTEM 0xdeaddead
#define __RB_ENABLE_CAD 0xdeadcad1
#define __RB_DISABLE_CAD 0xdeadcad0
#define __RB_POWER_OFF 0xdead00ff
#define __RB_SW_SUSPEND 0xdead2222
#define __RB_KEXEC 0xdeadecec
#endif
+24
View File
@@ -2,6 +2,7 @@
#ifndef __ZINNIA_UAPI_RESOURCE_H #ifndef __ZINNIA_UAPI_RESOURCE_H
#define __ZINNIA_UAPI_RESOURCE_H #define __ZINNIA_UAPI_RESOURCE_H
#include <uapi/time.h>
#include <uapi/types.h> #include <uapi/types.h>
#define __PRIO_PROCESS 0 #define __PRIO_PROCESS 0
@@ -20,6 +21,10 @@
#define __RLIMIT_AS 9 #define __RLIMIT_AS 9
#define __RLIMIT_NLIMITS 16 #define __RLIMIT_NLIMITS 16
#define __RUSAGE_SELF 0
#define __RUSAGE_CHILDREN (-1)
#define __RUSAGE_THREAD 1
#define __RLIM_INFINITY ((__rlim_t) - 1) #define __RLIM_INFINITY ((__rlim_t) - 1)
struct __rlimit { struct __rlimit {
@@ -27,4 +32,23 @@ struct __rlimit {
__rlim_t rlim_max; __rlim_t rlim_max;
}; };
struct __rusage {
struct __timeval ru_utime;
struct __timeval ru_stime;
long ru_maxrss;
long ru_ixrss;
long ru_idrss;
long ru_isrss;
long ru_minflt;
long ru_majflt;
long ru_nswap;
long ru_inblock;
long ru_oublock;
long ru_msgsnd;
long ru_msgrcv;
long ru_nsignals;
long ru_nvcsw;
long ru_nivcsw;
};
#endif #endif
+28
View File
@@ -125,4 +125,32 @@ struct __sigevent {
__pid_t sigev_notify_thread_id; __pid_t sigev_notify_thread_id;
}; };
#define __SFD_CLOEXEC __O_CLOEXEC
#define __SFD_NONBLOCK __O_NONBLOCK
struct __signalfd_siginfo {
uint32_t ssi_signo;
int32_t ssi_errno;
int32_t ssi_code;
uint32_t ssi_pid;
uint32_t ssi_uid;
int32_t ssi_fd;
uint32_t ssi_tid;
uint32_t ssi_band;
uint32_t ssi_overrun;
uint32_t ssi_trapno;
int32_t ssi_status;
int32_t ssi_int;
uint64_t ssi_ptr;
uint64_t ssi_utime;
uint64_t ssi_stime;
uint64_t ssi_addr;
uint16_t ssi_addr_lsb;
uint16_t __pad2;
int32_t ssi_syscall;
uint64_t ssi_call_addr;
uint32_t ssi_arch;
uint8_t __pad[28];
};
#endif #endif
+112
View File
@@ -0,0 +1,112 @@
/* SPDX-License-Identifier: Unlicense */
#ifndef __ZINNIA_UAPI_SOCKET_H
#define __ZINNIA_UAPI_SOCKET_H
#include <stdint.h>
#include <uapi/types.h>
typedef uint32_t __socklen_t;
typedef uint16_t __sa_family_t;
struct __msghdr {
uintptr_t msg_name;
__socklen_t msg_namelen;
uintptr_t msg_iov;
int msg_iovlen;
uintptr_t msg_control;
__socklen_t msg_controllen;
int msg_flags;
};
struct __cmsghdr {
__socklen_t cmsg_len;
int cmsg_level;
int cmsg_type;
};
struct __sockaddr {
__sa_family_t sa_family;
char sa_data[14];
};
struct __sockaddr_storage {
__sa_family_t ss_family;
char __padding[128 - sizeof(__sa_family_t) - sizeof(uintptr_t)];
uintptr_t __alignment;
};
struct __sockaddr_un {
__sa_family_t sun_family;
char sun_path[108];
};
struct __ucred {
__pid_t pid;
__uid_t uid;
__gid_t gid;
};
#define __SCM_RIGHTS 1
#define __SCM_CREDENTIALS 0x02
#define __SOCK_DGRAM (1 << 0)
#define __SOCK_RAW (1 << 1)
#define __SOCK_STREAM (1 << 2)
#define __SOCK_SEQPACKET (1 << 3)
#define __SOCK_NONBLOCK (1 << 15)
#define __SOCK_CLOEXEC (1 << 16)
#define __SOCK_CLOFORK (1 << 17)
#define __SOL_SOCKET 1
#define __SO_ACCEPTCONN 1
#define __SO_BROADCAST 2
#define __SO_DEBUG 3
#define __SO_DONTROUTE 4
#define __SO_ERROR 5
#define __SO_KEEPALIVE 6
#define __SO_LINGER 7
#define __SO_OOBINLINE 8
#define __SO_RCVBUF 9
#define __SO_RCVLOWAT 10
#define __SO_RCVTIMEO 11
#define __SO_REUSEADDR 12
#define __SO_SNDBUF 13
#define __SO_SNDLOWAT 14
#define __SO_SNDTIMEO 15
#define __SO_TYPE 16
#define __SO_SNDBUFFORCE 17
#define __SO_PEERCRED 18
#define __SO_PASSCRED 20
#define __SO_RCVBUFFORCE 21
#define __SO_PROTOCOL 23
#define __SO_REUSEPORT 24
#define __SO_DOMAIN 28
#define __SOMAXCONN 128
#define __MSG_CTRUNC 0x1
#define __MSG_DONTROUTE 0x2
#define __MSG_EOR 0x4
#define __MSG_OOB 0x8
#define __MSG_NOSIGNAL 0x10
#define __MSG_PEEK 0x20
#define __MSG_TRUNC 0x40
#define __MSG_WAITALL 0x80
#define __MSG_FIN 0x200
#define __MSG_CONFIRM 0x800
#define __MSG_DONTWAIT 0x1000
#define __MSG_CMSG_CLOEXEC 0x2000
#define __MSG_MORE 0x4000
#define __AF_UNSPEC 0
#define __AF_INET 1
#define __AF_INET6 2
#define __AF_UNIX 3
#define __AF_PACKET 11
#define __SHUT_RD 1
#define __SHUT_WR 2
#define __SHUT_RDWR (__SHUT_RD | __SHUT_WR)
#endif
+2
View File
@@ -44,4 +44,6 @@ struct __itimerspec {
#define __TFD_NONBLOCK __O_NONBLOCK #define __TFD_NONBLOCK __O_NONBLOCK
#define __TFD_TIMER_ABSTIME 1 #define __TFD_TIMER_ABSTIME 1
#define __TIMER_ABSTIME 1
#endif #endif