Don't use in constants file

This commit is contained in:
2025-07-28 10:41:45 +02:00
parent 0e4c64698f
commit 9c9aeabc97
5 changed files with 255 additions and 260 deletions

View File

@@ -1,11 +1,10 @@
section .rodata ; file descriptors
; file descriptors FD_stdin equ 0
FD_stdin equ 0 FD_stdout equ 1
FD_stdout equ 1 FD_stderr equ 2
FD_stderr equ 2
; ASCII ; ASCII
EOS equ 0 EOS equ 0
TAB equ 9 TAB equ 9
NL equ 10 NL equ 10
DQUO equ 34 DQUO equ 34

View File

@@ -1,135 +1,134 @@
section .rodata ENONE equ 0
ENONE equ 0 EPERM equ 1
EPERM equ 1 ENOENT equ 2
ENOENT equ 2 ESRCH equ 3
ESRCH equ 3 EINTR equ 4
EINTR equ 4 EIO equ 5
EIO equ 5 ENXIO equ 6
ENXIO equ 6 E2BIG equ 7
E2BIG equ 7 ENOEXEC equ 8
ENOEXEC equ 8 EBADF equ 9
EBADF equ 9 ECHILD equ 10
ECHILD equ 10 EAGAIN equ 11
EAGAIN equ 11 ENOMEM equ 12
ENOMEM equ 12 EACCES equ 13
EACCES equ 13 EFAULT equ 14
EFAULT equ 14 ENOTBLK equ 15
ENOTBLK equ 15 EBUSY equ 16
EBUSY equ 16 EEXIST equ 17
EEXIST equ 17 EXDEV equ 18
EXDEV equ 18 ENODEV equ 19
ENODEV equ 19 ENOTDIR equ 20
ENOTDIR equ 20 EISDIR equ 21
EISDIR equ 21 EINVAL equ 22
EINVAL equ 22 ENFILE equ 23
ENFILE equ 23 EMFILE equ 24
EMFILE equ 24 ENOTTY equ 25
ENOTTY equ 25 ETXTBSY equ 26
ETXTBSY equ 26 EFBIG equ 27
EFBIG equ 27 ENOSPC equ 28
ENOSPC equ 28 ESPIPE equ 29
ESPIPE equ 29 EROFS equ 30
EROFS equ 30 EMLINK equ 31
EMLINK equ 31 EPIPE equ 32
EPIPE equ 32 EDOM equ 33
EDOM equ 33 ERANGE equ 34
ERANGE equ 34 EDEADLK equ 35
EDEADLK equ 35 ENAMETOOLONG equ 36
ENAMETOOLONG equ 36 ENOLCK equ 37
ENOLCK equ 37 ENOSYS equ 38
ENOSYS equ 38 ENOTEMPTY equ 39
ENOTEMPTY equ 39 ELOOP equ 40
ELOOP equ 40 EWOULDBLOCK equ EAGAIN
EWOULDBLOCK equ EAGAIN ENOMSG equ 42
ENOMSG equ 42 EIDRM equ 43
EIDRM equ 43 ECHRNG equ 44
ECHRNG equ 44 EL2NSYNC equ 45
EL2NSYNC equ 45 EL3HLT equ 46
EL3HLT equ 46 EL3RST equ 47
EL3RST equ 47 ELNRNG equ 48
ELNRNG equ 48 EUNATCH equ 49
EUNATCH equ 49 ENOCSI equ 50
ENOCSI equ 50 EL2HLT equ 51
EL2HLT equ 51 EBADE equ 52
EBADE equ 52 EBADR equ 53
EBADR equ 53 EXFULL equ 54
EXFULL equ 54 ENOANO equ 55
ENOANO equ 55 EBADRQC equ 56
EBADRQC equ 56 EBADSLT equ 57
EBADSLT equ 57 EDEADLOCK equ EDEADLK
EDEADLOCK equ EDEADLK EBFONT equ 59
EBFONT equ 59 ENOSTR equ 60
ENOSTR equ 60 ENODATA equ 61
ENODATA equ 61 ETIME equ 62
ETIME equ 62 ENOSR equ 63
ENOSR equ 63 ENONET equ 64
ENONET equ 64 ENOPKG equ 65
ENOPKG equ 65 EREMOTE equ 66
EREMOTE equ 66 ENOLINK equ 67
ENOLINK equ 67 EADV equ 68
EADV equ 68 ESRMNT equ 69
ESRMNT equ 69 ECOMM equ 70
ECOMM equ 70 EPROTO equ 71
EPROTO equ 71 EMULTIHOP equ 72
EMULTIHOP equ 72 EDOTDOT equ 73
EDOTDOT equ 73 EBADMSG equ 74
EBADMSG equ 74 EOVERFLOW equ 75
EOVERFLOW equ 75 ENOTUNIQ equ 76
ENOTUNIQ equ 76 EBADFD equ 77
EBADFD equ 77 EREMCHG equ 78
EREMCHG equ 78 ELIBACC equ 79
ELIBACC equ 79 ELIBBAD equ 80
ELIBBAD equ 80 ELIBSCN equ 81
ELIBSCN equ 81 ELIBMAX equ 82
ELIBMAX equ 82 ELIBEXEC equ 83
ELIBEXEC equ 83 EILSEQ equ 84
EILSEQ equ 84 ERESTART equ 85
ERESTART equ 85 ESTRPIPE equ 86
ESTRPIPE equ 86 EUSERS equ 87
EUSERS equ 87 ENOTSOCK equ 88
ENOTSOCK equ 88 EDESTADDRREQ equ 89
EDESTADDRREQ equ 89 EMSGSIZE equ 90
EMSGSIZE equ 90 EPROTOTYPE equ 91
EPROTOTYPE equ 91 ENOPROTOOPT equ 92
ENOPROTOOPT equ 92 EPROTONOSUPPORT equ 93
EPROTONOSUPPORT equ 93 ESOCKTNOSUPPORT equ 94
ESOCKTNOSUPPORT equ 94 EOPNOTSUPP equ 95
EOPNOTSUPP equ 95 EPFNOSUPPORT equ 96
EPFNOSUPPORT equ 96 EAFNOSUPPORT equ 97
EAFNOSUPPORT equ 97 EADDRINUSE equ 98
EADDRINUSE equ 98 EADDRNOTAVAIL equ 99
EADDRNOTAVAIL equ 99 ENETDOWN equ 100
ENETDOWN equ 100 ENETUNREACH equ 101
ENETUNREACH equ 101 ENETRESET equ 102
ENETRESET equ 102 ECONNABORTED equ 103
ECONNABORTED equ 103 ECONNRESET equ 104
ECONNRESET equ 104 ENOBUFS equ 105
ENOBUFS equ 105 EISCONN equ 106
EISCONN equ 106 ENOTCONN equ 107
ENOTCONN equ 107 ESHUTDOWN equ 108
ESHUTDOWN equ 108 ETOOMANYREFS equ 109
ETOOMANYREFS equ 109 ETIMEDOUT equ 110
ETIMEDOUT equ 110 ECONNREFUSED equ 111
ECONNREFUSED equ 111 EHOSTDOWN equ 112
EHOSTDOWN equ 112 EHOSTUNREACH equ 113
EHOSTUNREACH equ 113 EALREADY equ 114
EALREADY equ 114 EINPROGRESS equ 115
EINPROGRESS equ 115 ESTALE equ 116
ESTALE equ 116 EUCLEAN equ 117
EUCLEAN equ 117 ENOTNAM equ 118
ENOTNAM equ 118 ENAVAIL equ 119
ENAVAIL equ 119 EISNAM equ 120
EISNAM equ 120 EREMOTEIO equ 121
EREMOTEIO equ 121 EDQUOT equ 122
EDQUOT equ 122 ENOMEDIUM equ 123
ENOMEDIUM equ 123 EMEDIUMTYPE equ 124
EMEDIUMTYPE equ 124 ECANCELED equ 125
ECANCELED equ 125 ENOKEY equ 126
ENOKEY equ 126 EKEYEXPIRED equ 127
EKEYEXPIRED equ 127 EKEYREVOKED equ 128
EKEYREVOKED equ 128 EKEYREJECTED equ 129
EKEYREJECTED equ 129 EOWNERDEAD equ 130
EOWNERDEAD equ 130 ENOTRECOVERABLE equ 131
ENOTRECOVERABLE equ 131 ERFKILL equ 132
ERFKILL equ 132 EHWPOISON equ 133
EHWPOISON equ 133

View File

@@ -1,81 +1,80 @@
section .rodata ; Open flags
; Open flags O_ACCMODE equ 00000003q
O_ACCMODE equ 00000003q O_RDONLY equ 00000000q
O_RDONLY equ 00000000q O_WRONLY equ 00000001q
O_WRONLY equ 00000001q O_RDWR equ 00000002q
O_RDWR equ 00000002q O_CREAT equ 00000100q ;create if not exist
O_CREAT equ 00000100q ;create if not exist O_EXCL equ 00000200q ;fail if file exists and O_EXCL+O_CREAT set
O_EXCL equ 00000200q ;fail if file exists and O_EXCL+O_CREAT set O_NOCTTY equ 00000400q
O_NOCTTY equ 00000400q O_TRUNC equ 00001000q
O_TRUNC equ 00001000q O_APPEND equ 00002000q
O_APPEND equ 00002000q O_NONBLOCK equ 00004000q
O_NONBLOCK equ 00004000q O_DSYNC equ 00010000q
O_DSYNC equ 00010000q FASYNC equ 00020000q
FASYNC equ 00020000q O_DIRECT equ 00040000q
O_DIRECT equ 00040000q O_LARGEFILE equ 00100000q
O_LARGEFILE equ 00100000q O_DIRECTORY equ 00200000q
O_DIRECTORY equ 00200000q O_NOFOLLOW equ 00400000q
O_NOFOLLOW equ 00400000q O_NOATIME equ 01000000q
O_NOATIME equ 01000000q O_CLOEXEC equ 02000000q
O_CLOEXEC equ 02000000q __O_SYNC equ 04000000q
__O_SYNC equ 04000000q O_SYNC equ (__O_SYNC | O_DSYNC)
O_SYNC equ (__O_SYNC | O_DSYNC) O_PATH equ 01000000q
O_PATH equ 01000000q __O_TMPFILE equ 02000000q
__O_TMPFILE equ 02000000q O_TMPFILE equ (__O_TMPFILE | O_DIRECTORY)
O_TMPFILE equ (__O_TMPFILE | O_DIRECTORY) O_NDELAY equ O_NONBLOCK
O_NDELAY equ O_NONBLOCK ; Permission flags
; Permission flags S_IXOTH equ 00001q ;o=x
S_IXOTH equ 00001q ;o=x S_IWOTH equ 00002q ;o=w
S_IWOTH equ 00002q ;o=w S_IROTH equ 00004q ;o=r
S_IROTH equ 00004q ;o=r S_IRWXO equ 00007q ;o=rwx
S_IRWXO equ 00007q ;o=rwx S_IXGRP equ 00010q ;g=x
S_IXGRP equ 00010q ;g=x S_IWGRP equ 00020q ;g=w
S_IWGRP equ 00020q ;g=w S_IRGRP equ 00040q ;g=r
S_IRGRP equ 00040q ;g=r S_IRWXG equ 00070q ;g=rwx
S_IRWXG equ 00070q ;g=rwx S_IXUSR equ 00100q ;u=x
S_IXUSR equ 00100q ;u=x S_IWUSR equ 00200q ;u=w
S_IWUSR equ 00200q ;u=w S_IRUSR equ 00400q ;u=r
S_IRUSR equ 00400q ;u=r S_IRWXU equ 00700q ;u=rwx
S_IRWXU equ 00700q ;u=rwx S_ISVTX equ 0001000q ;sticky bit
S_ISVTX equ 0001000q ;sticky bit S_ISGID equ 0002000q ;set-group-ID bit
S_ISGID equ 0002000q ;set-group-ID bit S_ISUID equ 0004000q ;set-user-ID bit
S_ISUID equ 0004000q ;set-user-ID bit DEF_MODE_FILE equ S_IWOTH | S_IROTH | S_IWGRP | S_IRGRP | S_IWUSR | S_IRUSR
DEF_MODE_FILE equ S_IWOTH | S_IROTH | S_IWGRP | S_IRGRP | S_IWUSR | S_IRUSR DEF_MODE_DIR equ S_IRWXO | S_IRWXG | S_IRWXU
DEF_MODE_DIR equ S_IRWXO | S_IRWXG | S_IRWXU ; Stat buffer fields
; Stat buffer fields ST_DEV equ 0 ; Device unsigned
ST_DEV equ 0 ; Device unsigned ST_INO equ 8 ; File serial number unsigned
ST_INO equ 8 ; File serial number unsigned ST_NLINK equ 16 ; Number of links unsigned
ST_NLINK equ 16 ; Number of links unsigned ST_MODE equ 24 ; File mode unsigned, 4 bytes
ST_MODE equ 24 ; File mode unsigned, 4 bytes ST_UID equ 28 ; User ID of the file's owner unsigned, 4 bytes
ST_UID equ 28 ; User ID of the file's owner unsigned, 4 bytes ST_GID equ 32 ; Group ID of the file's group unsigned, 4 bytes
ST_GID equ 32 ; Group ID of the file's group unsigned, 4 bytes ST__PAD0 equ 36
ST__PAD0 equ 36 ST_RDEV equ 40 ; Device number, if device unsigned
ST_RDEV equ 40 ; Device number, if device unsigned ST_SIZE equ 48 ; Size of file, in bytes signed
ST_SIZE equ 48 ; Size of file, in bytes signed ST_BLKSIZE equ 56 ; Optimal block size for I/O signed
ST_BLKSIZE equ 56 ; Optimal block size for I/O signed ST_BLOCKS equ 64 ; Number 512-byte blocks allocated signed
ST_BLOCKS equ 64 ; Number 512-byte blocks allocated signed ST_ATIME equ 72 ; Time of last access unsigned
ST_ATIME equ 72 ; Time of last access unsigned ST_ATIME_NSEC equ 80 ; unsigned
ST_ATIME_NSEC equ 80 ; unsigned ST_MTIME equ 88 ; Time of last modification unsigned
ST_MTIME equ 88 ; Time of last modification unsigned ST_MTIME_NSEC equ 96 ; unsigned
ST_MTIME_NSEC equ 96 ; unsigned ST_CTIME equ 104 ; Time of last status change unsigned
ST_CTIME equ 104 ; Time of last status change unsigned ST_CTIME_NSEC equ 112 ; unsigned
ST_CTIME_NSEC equ 112 ; unsigned ST__UNUSED equ 120
ST__UNUSED equ 120 ST__END equ 128 ; End of stat buffer
ST__END equ 128 ; End of stat buffer STATBUFF_SIZE equ ST__END
STATBUFF_SIZE equ ST__END
AT_FDCWD equ -100 AT_FDCWD equ -100
AT_SYMLINK_NOFOLLOW equ 0x100 AT_SYMLINK_NOFOLLOW equ 0x100
AT_SYMLINK_FOLLOW equ 0x400 AT_SYMLINK_FOLLOW equ 0x400
; File types ; File types
S_IFDIR equ 0040000q ; Directory S_IFDIR equ 0040000q ; Directory
S_IFCHR equ 0020000q ; Character device S_IFCHR equ 0020000q ; Character device
S_IFBLK equ 0060000q ; Block device S_IFBLK equ 0060000q ; Block device
S_IFREG equ 0100000q ; Regular file S_IFREG equ 0100000q ; Regular file
S_IFIFO equ 0010000q ; FIFO S_IFIFO equ 0010000q ; FIFO
S_IFLNK equ 0120000q ; Symbolic link S_IFLNK equ 0120000q ; Symbolic link
S_IFSOCK equ 0140000q ; Socket S_IFSOCK equ 0140000q ; Socket
; Seek options ; Seek options
SEEK_SET equ 0 SEEK_SET equ 0
SEEK_CUR equ 1 SEEK_CUR equ 1
SEEK_END equ 2 SEEK_END equ 2

View File

@@ -1,26 +1,25 @@
section .rodata RBP_OFFSET_CALLER equ 16
RBP_OFFSET_CALLER equ 16 SIZE_QWORD equ 8
SIZE_QWORD equ 8 SIZE_DWORD equ 4
SIZE_DWORD equ 4 SIZE_WORD equ 2
SIZE_WORD equ 2 SIZE_BYTE equ 1
SIZE_BYTE equ 1
MIN_UINT64 equ 0 MIN_UINT64 equ 0
MIN_UINT32 equ 0 MIN_UINT32 equ 0
MIN_UINT16 equ 0 MIN_UINT16 equ 0
MIN_UINT8 equ 0 MIN_UINT8 equ 0
MAX_UINT64 equ 0xFFFFFFFFFFFFFFFF MAX_UINT64 equ 0xFFFFFFFFFFFFFFFF
MAX_UINT32 equ 0xFFFFFFFF MAX_UINT32 equ 0xFFFFFFFF
MAX_UINT16 equ 0xFFFF MAX_UINT16 equ 0xFFFF
MAX_UINT8 equ 0xFF MAX_UINT8 equ 0xFF
MIN_INT64 equ ~0x7FFFFFFFFFFFFFFF MIN_INT64 equ ~0x7FFFFFFFFFFFFFFF
MIN_INT32 equ ~0x7FFFFFFF MIN_INT32 equ ~0x7FFFFFFF
MIN_INT16 equ ~0x7FFF MIN_INT16 equ ~0x7FFF
MIN_INT8 equ ~0x7F MIN_INT8 equ ~0x7F
MAX_INT64 equ 0x7FFFFFFFFFFFFFFF MAX_INT64 equ 0x7FFFFFFFFFFFFFFF
MAX_INT32 equ 0x7FFFFFFF MAX_INT32 equ 0x7FFFFFFF
MAX_INT16 equ 0x7FFF MAX_INT16 equ 0x7FFF
MAX_INT8 equ 0x7F MAX_INT8 equ 0x7F

View File

@@ -1,13 +1,12 @@
section .rodata NR_read equ 0
NR_read equ 0 NR_write equ 1
NR_write equ 1 NR_open equ 2
NR_open equ 2 NR_close equ 3
NR_close equ 3 ;NR_stat equ 4
;NR_stat equ 4 NR_fstat equ 5
NR_fstat equ 5 NR_lstat equ 6
NR_lstat equ 6 NR_lseek equ 8
NR_lseek equ 8 NR_exit equ 60
NR_exit equ 60 NR_creat equ 85
NR_creat equ 85 NR_umask equ 95
NR_umask equ 95 NR_newfstatat equ 262
NR_newfstatat equ 262