authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-05-19 22:26:23+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-05-20 16:54:00+02:00
logf291b8b9bccf223418eaeea2efc8ca87851e59eb
treefbb6ca4da8df5db661117399b98b7bf38b89454f
parent6d5002028a2fe71b67d8106b30c6602bc8e44121

cc,wasi: remove unused headers and sources


624 files changed, 0 insertions(+), 35900 deletions(-)

lib/libc/wasi/expected/wasm32-wasi/defined-symbols.txt deleted-1200
...@@ -1,1200 +0,0 @@
1_CLOCK_MONOTONIC
2_CLOCK_PROCESS_CPUTIME_ID
3_CLOCK_REALTIME
4_CLOCK_THREAD_CPUTIME_ID
5_Exit
6_IO_feof_unlocked
7_IO_ferror_unlocked
8_IO_getc
9_IO_getc_unlocked
10_IO_putc
11_IO_putc_unlocked
12__EINVAL
13__ENOMEM
14__SIG_ERR
15__SIG_IGN
16__asctime_r
17__assert_fail
18__c_dot_utf8
19__c_dot_utf8_locale
20__c_locale
21__clock
22__clock_gettime
23__cos
24__cosdf
25__cosl
26__crypt_blowfish
27__crypt_des
28__crypt_md5
29__crypt_r
30__crypt_sha256
31__crypt_sha512
32__ctype_b_loc
33__ctype_get_mb_cur_max
34__ctype_tolower_loc
35__ctype_toupper_loc
36__cxa_atexit
37__cxa_finalize
38__des_setkey
39__do_des
40__duplocale
41__env_rm_add
42__env_rm_add
43__env_rm_add
44__env_rm_add
45__exp2f_data
46__exp_data
47__expo2
48__expo2f
49__fbufsize
50__fclose_ca
51__fdopen
52__fesetround
53__fgetwc_unlocked
54__flbf
55__floatscan
56__fmodeflags
57__fopen_rb_ca
58__fpending
59__fpurge
60__fputwc_unlocked
61__freadable
62__freadahead
63__freading
64__freadptr
65__freadptrinc
66__freelocale
67__fseeko
68__fseeko_unlocked
69__fseterr
70__fsetlocking
71__fsmu8
72__ftello
73__ftello_unlocked
74__funcs_on_exit
75__funcs_on_exit
76__funcs_on_quick_exit
77__funcs_on_quick_exit
78__fwritable
79__fwritex
80__fwriting
81__get_locale
82__getdelim
83__getentropy
84__getopt_msg
85__gmtime_r
86__hwcap
87__inet_aton
88__intscan
89__invtrigl_R
90__isalnum_l
91__isalpha_l
92__isatty
93__isblank_l
94__iscntrl_l
95__isdigit_l
96__isgraph_l
97__islower_l
98__isoc99_fscanf
99__isoc99_fwscanf
100__isoc99_scanf
101__isoc99_sscanf
102__isoc99_swscanf
103__isoc99_vfscanf
104__isoc99_vfwscanf
105__isoc99_vscanf
106__isoc99_vsscanf
107__isoc99_vswscanf
108__isoc99_vwscanf
109__isoc99_wscanf
110__isprint_l
111__ispunct_l
112__isspace_l
113__isupper_l
114__iswalnum_l
115__iswalpha_l
116__iswblank_l
117__iswcntrl_l
118__iswctype_l
119__iswdigit_l
120__iswgraph_l
121__iswlower_l
122__iswprint_l
123__iswpunct_l
124__iswspace_l
125__iswupper_l
126__iswxdigit_l
127__isxdigit_l
128__lctrans
129__lctrans_cur
130__lctrans_impl
131__lctrans_impl
132__ldexp_cexp
133__ldexp_cexpf
134__lgamma_r
135__lgammaf_r
136__lgammal_r
137__libc
138__libc_calloc
139__libc_free
140__libc_malloc
141__loc_is_allocated
142__localtime_r
143__log2_data
144__log2f_data
145__log_data
146__logf_data
147__lseek
148__main_argc_argv
149__main_void
150__math_divzero
151__math_divzerof
152__math_invalid
153__math_invalidf
154__math_invalidl
155__math_oflow
156__math_oflowf
157__math_uflow
158__math_uflowf
159__math_xflow
160__math_xflowf
161__memrchr
162__mo_lookup
163__month_to_secs
164__newlocale
165__nl_langinfo
166__nl_langinfo_l
167__ofl_add
168__ofl_lock
169__ofl_unlock
170__optpos
171__optreset
172__original_main
173__overflow
174__p1evll
175__pio2_hi
176__pio2_lo
177__pleval
178__polevll
179__posix_getopt
180__pow_log_data
181__powf_log2_data
182__progname
183__progname_full
184__putenv
185__rand48_step
186__reallocarray
187__rem_pio2
188__rem_pio2_large
189__rem_pio2f
190__rem_pio2l
191__rsqrt_tab
192__secs_to_tm
193__secs_to_zone
194__seed48
195__shgetc
196__shlim
197__signgam
198__sin
199__sindf
200__sinl
201__small_printf
202__stderr_FILE
203__stderr_used
204__stderr_used
205__stderr_used
206__stdin_FILE
207__stdin_used
208__stdin_used
209__stdio_close
210__stdio_exit
211__stdio_exit
212__stdio_exit_needed
213__stdio_read
214__stdio_seek
215__stdio_write
216__stdout_FILE
217__stdout_used
218__stdout_used
219__stdout_used
220__stdout_write
221__stpcpy
222__stpncpy
223__strcasecmp_l
224__strchrnul
225__strcoll_l
226__strerror_l
227__strftime_fmt_1
228__strftime_l
229__strncasecmp_l
230__strtoimax_internal
231__strtol_internal
232__strtoll_internal
233__strtoul_internal
234__strtoull_internal
235__strtoumax_internal
236__strxfrm_l
237__sysinfo
238__sysv_signal
239__tan
240__tandf
241__tanl
242__tm_to_secs
243__tm_to_tzname
244__tolower_l
245__toread
246__toread_needs_stdio_exit
247__toupper_l
248__towctrans_l
249__towlower_l
250__towrite
251__towrite_needs_stdio_exit
252__towupper_l
253__tre_mem_alloc_impl
254__tre_mem_destroy
255__tre_mem_new_impl
256__tsearch_balance
257__uflow
258__unlist_locked_file
259__uselocale
260__utc
261__wasi_args_get
262__wasi_args_sizes_get
263__wasi_clock_res_get
264__wasi_clock_time_get
265__wasi_environ_get
266__wasi_environ_sizes_get
267__wasi_fd_advise
268__wasi_fd_allocate
269__wasi_fd_close
270__wasi_fd_datasync
271__wasi_fd_fdstat_get
272__wasi_fd_fdstat_set_flags
273__wasi_fd_fdstat_set_rights
274__wasi_fd_filestat_get
275__wasi_fd_filestat_set_size
276__wasi_fd_filestat_set_times
277__wasi_fd_pread
278__wasi_fd_prestat_dir_name
279__wasi_fd_prestat_get
280__wasi_fd_pwrite
281__wasi_fd_read
282__wasi_fd_readdir
283__wasi_fd_renumber
284__wasi_fd_seek
285__wasi_fd_sync
286__wasi_fd_tell
287__wasi_fd_write
288__wasi_path_create_directory
289__wasi_path_filestat_get
290__wasi_path_filestat_set_times
291__wasi_path_link
292__wasi_path_open
293__wasi_path_readlink
294__wasi_path_remove_directory
295__wasi_path_rename
296__wasi_path_symlink
297__wasi_path_unlink_file
298__wasi_poll_oneoff
299__wasi_proc_exit
300__wasi_proc_raise
301__wasi_random_get
302__wasi_sched_yield
303__wasi_sock_recv
304__wasi_sock_send
305__wasi_sock_shutdown
306__wasilibc_access
307__wasilibc_cwd
308__wasilibc_ensure_environ
309__wasilibc_environ
310__wasilibc_environ
311__wasilibc_fd_renumber
312__wasilibc_find_abspath
313__wasilibc_find_relpath
314__wasilibc_find_relpath_alloc
315__wasilibc_initialize_environ
316__wasilibc_link
317__wasilibc_link_newat
318__wasilibc_link_oldat
319__wasilibc_nocwd___wasilibc_rmdirat
320__wasilibc_nocwd___wasilibc_unlinkat
321__wasilibc_nocwd_faccessat
322__wasilibc_nocwd_fstatat
323__wasilibc_nocwd_linkat
324__wasilibc_nocwd_mkdirat_nomode
325__wasilibc_nocwd_openat_nomode
326__wasilibc_nocwd_opendirat
327__wasilibc_nocwd_readlinkat
328__wasilibc_nocwd_renameat
329__wasilibc_nocwd_scandirat
330__wasilibc_nocwd_symlinkat
331__wasilibc_nocwd_utimensat
332__wasilibc_open_nomode
333__wasilibc_register_preopened_fd
334__wasilibc_rename_newat
335__wasilibc_rename_oldat
336__wasilibc_rmdirat
337__wasilibc_stat
338__wasilibc_tell
339__wasilibc_unlinkat
340__wasilibc_utimens
341__wasm_call_dtors
342__wcscoll_l
343__wcsftime_l
344__wcsxfrm_l
345__wctrans_l
346__wctype_l
347__xpg_basename
348__xpg_strerror_r
349__year_to_secs
350_environ
351_exit
352_flushlbf
353_initialize
354_start
355_start
356a64l
357abort
358abs
359access
360acos
361acosf
362acosh
363acoshf
364acoshl
365acosl
366aligned_alloc
367alphasort
368alphasort64
369arc4random
370arc4random_buf
371arc4random_uniform
372asctime
373asctime_r
374asin
375asinf
376asinh
377asinhf
378asinhl
379asinl
380asprintf
381at_quick_exit
382atan
383atan2
384atan2f
385atan2l
386atanf
387atanh
388atanhf
389atanhl
390atanl
391atexit
392atof
393atoi
394atol
395atoll
396basename
397bcmp
398bcopy
399bsd_signal
400bsearch
401btowc
402bzero
403c16rtomb
404c32rtomb
405cabs
406cabsf
407cabsl
408cacos
409cacosf
410cacosh
411cacoshf
412cacoshl
413cacosl
414calloc
415carg
416cargf
417cargl
418casin
419casinf
420casinh
421casinhf
422casinhl
423casinl
424catan
425catanf
426catanh
427catanhf
428catanhl
429catanl
430catclose
431catgets
432catopen
433cbrt
434cbrtf
435cbrtl
436ccos
437ccosf
438ccosh
439ccoshf
440ccoshl
441ccosl
442ceil
443ceilf
444ceill
445cexp
446cexpf
447cexpl
448chdir
449cimag
450cimagf
451cimagl
452clearenv
453clearerr
454clearerr_unlocked
455clock
456clock_getres
457clock_gettime
458clock_nanosleep
459clog
460clogf
461clogl
462close
463closedir
464confstr
465conj
466conjf
467conjl
468copysign
469copysignf
470copysignl
471cos
472cosf
473cosh
474coshf
475coshl
476cosl
477cpow
478cpowf
479cpowl
480cproj
481cprojf
482cprojl
483creal
484crealf
485creall
486creat
487creat64
488crypt
489crypt_r
490csin
491csinf
492csinh
493csinhf
494csinhl
495csinl
496csqrt
497csqrtf
498csqrtl
499ctan
500ctanf
501ctanh
502ctanhf
503ctanhl
504ctanl
505ctime
506ctime_r
507difftime
508dirfd
509dirname
510div
511dprintf
512drand48
513drem
514dremf
515duplocale
516ecvt
517encrypt
518environ
519erand48
520erf
521erfc
522erfcf
523erfcl
524erff
525erfl
526errno
527exit
528exp
529exp10
530exp10f
531exp10l
532exp2
533exp2f
534exp2l
535expf
536expl
537explicit_bzero
538expm1
539expm1f
540expm1l
541fabs
542fabsf
543fabsl
544faccessat
545fclose
546fcntl
547fcvt
548fdatasync
549fdclosedir
550fdim
551fdimf
552fdiml
553fdopen
554fdopendir
555feclearexcept
556fegetenv
557fegetexceptflag
558fegetround
559feholdexcept
560feof
561feof_unlocked
562feraiseexcept
563ferror
564ferror_unlocked
565fesetenv
566fesetexceptflag
567fesetround
568fetestexcept
569feupdateenv
570fflush
571fflush_unlocked
572ffs
573ffsl
574ffsll
575fgetc
576fgetc_unlocked
577fgetln
578fgetpos
579fgetpos64
580fgets
581fgets_unlocked
582fgetwc
583fgetwc_unlocked
584fgetws
585fgetws_unlocked
586fileno
587fileno_unlocked
588finite
589finitef
590floor
591floorf
592floorl
593fma
594fmaf
595fmal
596fmax
597fmaxf
598fmaxl
599fmemopen
600fmin
601fminf
602fminl
603fmod
604fmodf
605fmodl
606fmtmsg
607fnmatch
608fopen
609fopen64
610fopencookie
611fpathconf
612fprintf
613fpurge
614fputc
615fputc_unlocked
616fputs
617fputs_unlocked
618fputwc
619fputwc_unlocked
620fputws
621fputws_unlocked
622fread
623fread_unlocked
624free
625freelocale
626freopen
627freopen64
628frexp
629frexpf
630frexpl
631fscanf
632fseek
633fseeko
634fseeko64
635fsetpos
636fsetpos64
637fstat
638fstatat
639fsync
640ftell
641ftello
642ftello64
643ftime
644ftruncate
645futimens
646fwide
647fwprintf
648fwrite
649fwrite_unlocked
650fwscanf
651gcvt
652get_avphys_pages
653get_nprocs
654get_nprocs_conf
655get_phys_pages
656getc
657getc_unlocked
658getchar
659getchar_unlocked
660getcwd
661getdate
662getdate_err
663getdelim
664getdomainname
665getentropy
666getenv
667gethostid
668getline
669getopt
670getopt_long
671getopt_long_only
672getpid
673getrusage
674getsockopt
675getsubopt
676gettimeofday
677getw
678getwc
679getwc_unlocked
680getwchar
681getwchar_unlocked
682glob
683glob64
684globfree
685globfree64
686gmtime
687gmtime_r
688hcreate
689hcreate_r
690hdestroy
691hdestroy_r
692hsearch
693hsearch_r
694htonl
695htons
696hypot
697hypotf
698hypotl
699iconv
700iconv_close
701iconv_open
702ilogb
703ilogbf
704ilogbl
705imaxabs
706imaxdiv
707in6addr_any
708in6addr_loopback
709index
710inet_aton
711inet_ntop
712inet_pton
713initstate
714insque
715ioctl
716iprintf
717isalnum
718isalnum_l
719isalpha
720isalpha_l
721isascii
722isatty
723isblank
724isblank_l
725iscntrl
726iscntrl_l
727isdigit
728isdigit_l
729isgraph
730isgraph_l
731islower
732islower_l
733isprint
734isprint_l
735ispunct
736ispunct_l
737isspace
738isspace_l
739isupper
740isupper_l
741iswalnum
742iswalnum_l
743iswalpha
744iswalpha_l
745iswblank
746iswblank_l
747iswcntrl
748iswcntrl_l
749iswctype
750iswctype_l
751iswdigit
752iswdigit_l
753iswgraph
754iswgraph_l
755iswlower
756iswlower_l
757iswprint
758iswprint_l
759iswpunct
760iswpunct_l
761iswspace
762iswspace_l
763iswupper
764iswupper_l
765iswxdigit
766iswxdigit_l
767isxdigit
768isxdigit_l
769j0
770j0f
771j1
772j1f
773jn
774jnf
775jrand48
776l64a
777labs
778lcong48
779ldexp
780ldexpf
781ldexpl
782ldiv
783lfind
784lgamma
785lgamma_r
786lgammaf
787lgammaf_r
788lgammal
789lgammal_r
790link
791linkat
792llabs
793lldiv
794llrint
795llrintf
796llrintl
797llround
798llroundf
799llroundl
800localeconv
801localtime
802localtime_r
803log
804log10
805log10f
806log10l
807log1p
808log1pf
809log1pl
810log2
811log2f
812log2l
813logb
814logbf
815logbl
816logf
817logl
818lrand48
819lrint
820lrintf
821lrintl
822lround
823lroundf
824lroundl
825lsearch
826lseek
827lstat
828malloc
829malloc_usable_size
830mblen
831mbrlen
832mbrtoc16
833mbrtoc32
834mbrtowc
835mbsinit
836mbsnrtowcs
837mbsrtowcs
838mbstowcs
839mbtowc
840memccpy
841memchr
842memcmp
843memcpy
844memmem
845memmove
846mempcpy
847memrchr
848memset
849mkdir
850mkdirat
851mktime
852mmap
853modf
854modff
855modfl
856mrand48
857munmap
858nan
859nanf
860nanl
861nanosleep
862nearbyint
863nearbyintf
864nearbyintl
865newlocale
866nextafter
867nextafterf
868nextafterl
869nexttoward
870nexttowardf
871nexttowardl
872nftw
873nftw64
874nl_langinfo
875nl_langinfo_l
876nrand48
877ntohl
878ntohs
879open
880open_memstream
881open_wmemstream
882openat
883opendir
884opendirat
885optarg
886opterr
887optind
888optopt
889optreset
890pathconf
891perror
892poll
893posix_close
894posix_fadvise
895posix_fallocate
896posix_memalign
897pow
898pow10
899pow10f
900pow10l
901powf
902powl
903pread
904preadv
905printf
906program_invocation_name
907program_invocation_short_name
908pselect
909psignal
910putc
911putc_unlocked
912putchar
913putchar_unlocked
914putenv
915puts
916putw
917putwc
918putwc_unlocked
919putwchar
920putwchar_unlocked
921pwrite
922pwritev
923qsort
924quick_exit
925raise
926rand
927rand_r
928random
929read
930readdir
931readlink
932readlinkat
933readv
934realloc
935reallocarray
936recv
937regcomp
938regerror
939regexec
940regfree
941remainder
942remainderf
943remainderl
944remove
945remque
946remquo
947remquof
948remquol
949rename
950renameat
951rewind
952rewinddir
953rindex
954rint
955rintf
956rintl
957rmdir
958round
959roundf
960roundl
961sbrk
962scalb
963scalbf
964scalbln
965scalblnf
966scalblnl
967scalbn
968scalbnf
969scalbnl
970scandir
971scandirat
972scanf
973sched_yield
974seed48
975seekdir
976select
977send
978setbuf
979setbuffer
980setenv
981setkey
982setlinebuf
983setlocale
984setstate
985setvbuf
986shutdown
987signal
988signgam
989significand
990significandf
991sin
992sincos
993sincosf
994sincosl
995sinf
996sinh
997sinhf
998sinhl
999sinl
1000sleep
1001snprintf
1002sprintf
1003sqrt
1004sqrtf
1005sqrtl
1006srand
1007srand48
1008srandom
1009sscanf
1010stat
1011stderr
1012stdin
1013stdout
1014stpcpy
1015stpncpy
1016strcasecmp
1017strcasecmp_l
1018strcasestr
1019strcat
1020strchr
1021strchrnul
1022strcmp
1023strcoll
1024strcoll_l
1025strcpy
1026strcspn
1027strdup
1028strerror
1029strerror_l
1030strerror_r
1031strfmon
1032strfmon_l
1033strftime
1034strftime_l
1035strlcat
1036strlcpy
1037strlen
1038strncasecmp
1039strncasecmp_l
1040strncat
1041strncmp
1042strncpy
1043strndup
1044strnlen
1045strpbrk
1046strptime
1047strrchr
1048strsep
1049strsignal
1050strspn
1051strstr
1052strtod
1053strtod_l
1054strtof
1055strtof_l
1056strtoimax
1057strtok
1058strtok_r
1059strtol
1060strtold
1061strtold_l
1062strtoll
1063strtoul
1064strtoull
1065strtoumax
1066strverscmp
1067strxfrm
1068strxfrm_l
1069swab
1070swprintf
1071swscanf
1072symlink
1073symlinkat
1074sysconf
1075tan
1076tanf
1077tanh
1078tanhf
1079tanhl
1080tanl
1081tdelete
1082tdestroy
1083telldir
1084tfind
1085tgamma
1086tgammaf
1087tgammal
1088time
1089timegm
1090times
1091timespec_get
1092toascii
1093tolower
1094tolower_l
1095toupper
1096toupper_l
1097towctrans
1098towctrans_l
1099towlower
1100towlower_l
1101towupper
1102towupper_l
1103trunc
1104truncate
1105truncf
1106truncl
1107tsearch
1108twalk
1109uname
1110ungetc
1111ungetwc
1112unlink
1113unlinkat
1114unsetenv
1115uselocale
1116usleep
1117utime
1118utimensat
1119vasprintf
1120vdprintf
1121versionsort
1122versionsort64
1123vfprintf
1124vfscanf
1125vfwprintf
1126vfwscanf
1127vprintf
1128vscanf
1129vsnprintf
1130vsprintf
1131vsscanf
1132vswprintf
1133vswscanf
1134vwprintf
1135vwscanf
1136wcpcpy
1137wcpncpy
1138wcrtomb
1139wcscasecmp
1140wcscasecmp_l
1141wcscat
1142wcschr
1143wcscmp
1144wcscoll
1145wcscoll_l
1146wcscpy
1147wcscspn
1148wcsdup
1149wcsftime
1150wcsftime_l
1151wcslen
1152wcsncasecmp
1153wcsncasecmp_l
1154wcsncat
1155wcsncmp
1156wcsncpy
1157wcsnlen
1158wcsnrtombs
1159wcspbrk
1160wcsrchr
1161wcsrtombs
1162wcsspn
1163wcsstr
1164wcstod
1165wcstof
1166wcstoimax
1167wcstok
1168wcstol
1169wcstold
1170wcstoll
1171wcstombs
1172wcstoul
1173wcstoull
1174wcstoumax
1175wcswcs
1176wcswidth
1177wcsxfrm
1178wcsxfrm_l
1179wctob
1180wctomb
1181wctrans
1182wctrans_l
1183wctype
1184wctype_l
1185wcwidth
1186wmemchr
1187wmemcmp
1188wmemcpy
1189wmemmove
1190wmemset
1191wprintf
1192write
1193writev
1194wscanf
1195y0
1196y0f
1197y1
1198y1f
1199yn
1200ynf
lib/libc/wasi/expected/wasm32-wasi/include-all.c deleted-170
...@@ -1,170 +0,0 @@
1#include <__errno.h>
2#include <__errno_values.h>
3#include <__fd_set.h>
4#include <__function___isatty.h>
5#include <__functions_malloc.h>
6#include <__functions_memcpy.h>
7#include <__header_dirent.h>
8#include <__header_fcntl.h>
9#include <__header_inttypes.h>
10#include <__header_netinet_in.h>
11#include <__header_poll.h>
12#include <__header_stdlib.h>
13#include <__header_string.h>
14#include <__header_sys_ioctl.h>
15#include <__header_sys_resource.h>
16#include <__header_sys_socket.h>
17#include <__header_sys_stat.h>
18#include <__header_time.h>
19#include <__header_unistd.h>
20#include <__macro_FD_SETSIZE.h>
21#include <__macro_PAGESIZE.h>
22#include <__mode_t.h>
23#include <__seek.h>
24#include <__struct_dirent.h>
25#include <__struct_in6_addr.h>
26#include <__struct_in_addr.h>
27#include <__struct_iovec.h>
28#include <__struct_msghdr.h>
29#include <__struct_pollfd.h>
30#include <__struct_rusage.h>
31#include <__struct_sockaddr.h>
32#include <__struct_sockaddr_in.h>
33#include <__struct_sockaddr_in6.h>
34#include <__struct_sockaddr_storage.h>
35#include <__struct_sockaddr_un.h>
36#include <__struct_stat.h>
37#include <__struct_timespec.h>
38#include <__struct_timeval.h>
39#include <__struct_tm.h>
40#include <__struct_tms.h>
41#include <__typedef_DIR.h>
42#include <__typedef_blkcnt_t.h>
43#include <__typedef_blksize_t.h>
44#include <__typedef_clock_t.h>
45#include <__typedef_clockid_t.h>
46#include <__typedef_dev_t.h>
47#include <__typedef_fd_set.h>
48#include <__typedef_gid_t.h>
49#include <__typedef_in_addr_t.h>
50#include <__typedef_in_port_t.h>
51#include <__typedef_ino_t.h>
52#include <__typedef_mode_t.h>
53#include <__typedef_nfds_t.h>
54#include <__typedef_nlink_t.h>
55#include <__typedef_off_t.h>
56#include <__typedef_sa_family_t.h>
57#include <__typedef_sigset_t.h>
58#include <__typedef_socklen_t.h>
59#include <__typedef_ssize_t.h>
60#include <__typedef_suseconds_t.h>
61#include <__typedef_time_t.h>
62#include <__typedef_uid_t.h>
63#include <alloca.h>
64#include <ar.h>
65#include <arpa/ftp.h>
66#include <arpa/inet.h>
67#include <arpa/nameser.h>
68#include <arpa/nameser_compat.h>
69#include <arpa/telnet.h>
70#include <arpa/tftp.h>
71#include <assert.h>
72#include <byteswap.h>
73#include <complex.h>
74#include <cpio.h>
75#include <crypt.h>
76#include <ctype.h>
77#include <dirent.h>
78#include <endian.h>
79#include <err.h>
80#include <errno.h>
81#include <fcntl.h>
82#include <features.h>
83#include <fenv.h>
84#include <float.h>
85#include <fmtmsg.h>
86#include <fnmatch.h>
87#include <ftw.h>
88#include <getopt.h>
89#include <glob.h>
90#include <iconv.h>
91#include <ifaddrs.h>
92#include <inttypes.h>
93#include <iso646.h>
94#include <langinfo.h>
95#include <libgen.h>
96#include <limits.h>
97#include <locale.h>
98#include <malloc.h>
99#include <math.h>
100#include <memory.h>
101#include <monetary.h>
102#include <mqueue.h>
103#include <netinet/icmp6.h>
104#include <netinet/igmp.h>
105#include <netinet/in.h>
106#include <netinet/in_systm.h>
107#include <netinet/ip.h>
108#include <netinet/ip6.h>
109#include <netinet/ip_icmp.h>
110#include <netinet/tcp.h>
111#include <netinet/udp.h>
112#include <netpacket/packet.h>
113#include <nl_types.h>
114#include <poll.h>
115#include <regex.h>
116#include <sched.h>
117#include <search.h>
118#include <semaphore.h>
119#include <stdalign.h>
120#include <stdbool.h>
121#include <stdc-predef.h>
122#include <stdint.h>
123#include <stdio.h>
124#include <stdio_ext.h>
125#include <stdlib.h>
126#include <stdnoreturn.h>
127#include <string.h>
128#include <strings.h>
129#include <stropts.h>
130#include <sys/dir.h>
131#include <sys/errno.h>
132#include <sys/eventfd.h>
133#include <sys/fcntl.h>
134#include <sys/file.h>
135#include <sys/ioctl.h>
136#include <sys/param.h>
137#include <sys/poll.h>
138#include <sys/random.h>
139#include <sys/reg.h>
140#include <sys/select.h>
141#include <sys/socket.h>
142#include <sys/stat.h>
143#include <sys/stropts.h>
144#include <sys/syscall.h>
145#include <sys/sysinfo.h>
146#include <sys/time.h>
147#include <sys/timeb.h>
148#include <sys/timex.h>
149#include <sys/ttydefaults.h>
150#include <sys/types.h>
151#include <sys/uio.h>
152#include <sys/un.h>
153#include <sys/utsname.h>
154#include <syscall.h>
155#include <sysexits.h>
156#include <tar.h>
157#include <tgmath.h>
158#include <threads.h>
159#include <time.h>
160#include <uchar.h>
161#include <unistd.h>
162#include <utime.h>
163#include <values.h>
164#include <wasi/api.h>
165#include <wasi/libc-environ.h>
166#include <wasi/libc-find-relpath.h>
167#include <wasi/libc-nocwd.h>
168#include <wasi/libc.h>
169#include <wchar.h>
170#include <wctype.h>
lib/libc/wasi/expected/wasm32-wasi/predefined-macros.txt deleted-3384
...@@ -1,3384 +0,0 @@
1#define ABDAY_1 0x20000
2#define ABDAY_2 0x20001
3#define ABDAY_3 0x20002
4#define ABDAY_4 0x20003
5#define ABDAY_5 0x20004
6#define ABDAY_6 0x20005
7#define ABDAY_7 0x20006
8#define ABMON_1 0x2000E
9#define ABMON_10 0x20017
10#define ABMON_11 0x20018
11#define ABMON_12 0x20019
12#define ABMON_2 0x2000F
13#define ABMON_3 0x20010
14#define ABMON_4 0x20011
15#define ABMON_5 0x20012
16#define ABMON_6 0x20013
17#define ABMON_7 0x20014
18#define ABMON_8 0x20015
19#define ABMON_9 0x20016
20#define ABORT 238
21#define ACK 04
22#define ADD ns_uop_add
23#define ADJ_ESTERROR 0x0008
24#define ADJ_FREQUENCY 0x0002
25#define ADJ_MAXERROR 0x0004
26#define ADJ_MICRO 0x1000
27#define ADJ_NANO 0x2000
28#define ADJ_OFFSET 0x0001
29#define ADJ_OFFSET_SINGLESHOT 0x8001
30#define ADJ_OFFSET_SS_READ 0xa001
31#define ADJ_SETOFFSET 0x0100
32#define ADJ_STATUS 0x0010
33#define ADJ_TAI 0x0080
34#define ADJ_TICK 0x4000
35#define ADJ_TIMECONST 0x0020
36#define AF_INET 1
37#define AF_INET6 2
38#define AF_UNIX 3
39#define AF_UNSPEC 0
40#define ALT_DIGITS 0x2002F
41#define AM_STR 0x20026
42#define ANYMARK 0x01
43#define AO 245
44#define AREGTYPE '\0'
45#define ARFMAG "`\n"
46#define ARG_MAX 131072
47#define ARMAG "!<arch>\n"
48#define AT_EACCESS (0x0)
49#define AT_FDCWD (-2)
50#define AT_REMOVEDIR (0x4)
51#define AT_SYMLINK_FOLLOW (0x2)
52#define AT_SYMLINK_NOFOLLOW (0x1)
53#define AUTHTYPE_CNT 5
54#define AUTHTYPE_KERBEROS_V4 1
55#define AUTHTYPE_KERBEROS_V5 2
56#define AUTHTYPE_MINK 4
57#define AUTHTYPE_NAME(x) authtype_names[x]
58#define AUTHTYPE_NAME_OK(x) ((unsigned int)(x) < AUTHTYPE_CNT)
59#define AUTHTYPE_NULL 0
60#define AUTHTYPE_SPX 3
61#define AUTHTYPE_TEST 99
62#define AUTH_HOW_MASK 2
63#define AUTH_HOW_MUTUAL 2
64#define AUTH_HOW_ONE_WAY 0
65#define AUTH_WHO_CLIENT 0
66#define AUTH_WHO_MASK 1
67#define AUTH_WHO_SERVER 1
68#define AYT 246
69#define BIG_ENDIAN __BIG_ENDIAN
70#define BITSPERBYTE CHAR_BIT
71#define BLKTYPE '4'
72#define BLK_BYTECOUNT 2
73#define BLK_EOF 0x40
74#define BLK_EOR 0x80
75#define BLK_ERRORS 0x20
76#define BLK_RESTART 0x10
77#define BREAK 243
78#define BUFSIZ 1024
79#define BYTE_ORDER __BYTE_ORDER
80#define CANBSIZ 255
81#define CBRK CEOL
82#define CDISCARD CTRL('o')
83#define CDSUSP CTRL('y')
84#define CEOF CTRL('d')
85#define CEOL '\0'
86#define CEOT CEOF
87#define CERASE 0177
88#define CFLUSH CDISCARD
89#define CHARBITS (sizeof(char) * 8)
90#define CHARCLASS_NAME_MAX 14
91#define CHAR_BIT 8
92#define CHAR_MAX 127
93#define CHAR_MIN (-128)
94#define CHRTYPE '3'
95#define CINTR CTRL('c')
96#define CKILL CTRL('u')
97#define CLNEXT CTRL('v')
98#define CLOCKS_PER_SEC ((clock_t)1000000000)
99#define CLOCK_MONOTONIC (&_CLOCK_MONOTONIC)
100#define CLOCK_PROCESS_CPUTIME_ID (&_CLOCK_PROCESS_CPUTIME_ID)
101#define CLOCK_REALTIME (&_CLOCK_REALTIME)
102#define CLOCK_THREAD_CPUTIME_ID (&_CLOCK_THREAD_CPUTIME_ID)
103#define CMIN 1
104#define CMPLX(x,y) __CMPLX(x, y, double)
105#define CMPLXF(x,y) __CMPLX(x, y, float)
106#define CMPLXL(x,y) __CMPLX(x, y, long double)
107#define CODESET 14
108#define COLL_WEIGHTS_MAX 2
109#define COMPLETE 2
110#define CONTINUE 3
111#define CONTTYPE '7'
112#define CQUIT 034
113#define CREPRINT CTRL('r')
114#define CRNCYSTR 0x4000F
115#define CRPRNT CREPRINT
116#define CSTART CTRL('q')
117#define CSTATUS '\0'
118#define CSTOP CTRL('s')
119#define CSUSP CTRL('z')
120#define CTIME 0
121#define CTRL(x) ((x)&037)
122#define CWERASE CTRL('w')
123#define C_ANY ns_c_any
124#define C_CHAOS ns_c_chaos
125#define C_HS ns_c_hs
126#define C_IN ns_c_in
127#define C_IRGRP 000040
128#define C_IROTH 000004
129#define C_IRUSR 000400
130#define C_ISBLK 060000
131#define C_ISCHR 020000
132#define C_ISCTG 0110000
133#define C_ISDIR 040000
134#define C_ISFIFO 010000
135#define C_ISGID 002000
136#define C_ISLNK 0120000
137#define C_ISREG 0100000
138#define C_ISSOCK 0140000
139#define C_ISUID 004000
140#define C_ISVTX 001000
141#define C_IWGRP 000020
142#define C_IWOTH 000002
143#define C_IWUSR 000200
144#define C_IXGRP 000010
145#define C_IXOTH 000001
146#define C_IXUSR 000100
147#define C_NONE ns_c_none
148#define DATA 03
149#define DAY_1 0x20007
150#define DAY_2 0x20008
151#define DAY_3 0x20009
152#define DAY_4 0x2000A
153#define DAY_5 0x2000B
154#define DAY_6 0x2000C
155#define DAY_7 0x2000D
156#define DBL_DECIMAL_DIG 17
157#define DBL_DIG 15
158#define DBL_EPSILON 2.22044604925031308085e-16
159#define DBL_HAS_SUBNORM 1
160#define DBL_MANT_DIG 53
161#define DBL_MAX 1.79769313486231570815e+308
162#define DBL_MAX_10_EXP 308
163#define DBL_MAX_EXP 1024
164#define DBL_MIN 2.22507385850720138309e-308
165#define DBL_MIN_10_EXP (-307)
166#define DBL_MIN_EXP (-1021)
167#define DBL_TRUE_MIN 4.94065645841246544177e-324
168#define DECIMAL_DIG 36
169#define DELAYTIMER_MAX 0x7fffffff
170#define DELETE ns_uop_delete
171#define DEV_BSIZE 512
172#define DIRTYPE '5'
173#define DM 242
174#define DMAXEXP DBL_MAX_EXP
175#define DMINEXP DBL_MIN_EXP
176#define DO 253
177#define DONT 254
178#define DOUBLEBITS (sizeof(double) * 8)
179#define DT_BLK __WASI_FILETYPE_BLOCK_DEVICE
180#define DT_CHR __WASI_FILETYPE_CHARACTER_DEVICE
181#define DT_DIR __WASI_FILETYPE_DIRECTORY
182#define DT_FIFO __WASI_FILETYPE_SOCKET_STREAM
183#define DT_LNK __WASI_FILETYPE_SYMBOLIC_LINK
184#define DT_REG __WASI_FILETYPE_REGULAR_FILE
185#define DT_UNKNOWN __WASI_FILETYPE_UNKNOWN
186#define D_FMT 0x20029
187#define D_T_FMT 0x20028
188#define E2BIG __WASI_ERRNO_2BIG
189#define EACCES __WASI_ERRNO_ACCES
190#define EACCESS 2
191#define EADDRINUSE __WASI_ERRNO_ADDRINUSE
192#define EADDRNOTAVAIL __WASI_ERRNO_ADDRNOTAVAIL
193#define EAFNOSUPPORT __WASI_ERRNO_AFNOSUPPORT
194#define EAGAIN __WASI_ERRNO_AGAIN
195#define EALREADY __WASI_ERRNO_ALREADY
196#define EBADF __WASI_ERRNO_BADF
197#define EBADID 5
198#define EBADMSG __WASI_ERRNO_BADMSG
199#define EBADOP 4
200#define EBUSY __WASI_ERRNO_BUSY
201#define EC 247
202#define ECANCELED __WASI_ERRNO_CANCELED
203#define ECHILD __WASI_ERRNO_CHILD
204#define ECONNABORTED __WASI_ERRNO_CONNABORTED
205#define ECONNREFUSED __WASI_ERRNO_CONNREFUSED
206#define ECONNRESET __WASI_ERRNO_CONNRESET
207#define EDEADLK __WASI_ERRNO_DEADLK
208#define EDESTADDRREQ __WASI_ERRNO_DESTADDRREQ
209#define EDOM __WASI_ERRNO_DOM
210#define EDQUOT __WASI_ERRNO_DQUOT
211#define EEXIST __WASI_ERRNO_EXIST
212#define EEXISTS 6
213#define EFAULT __WASI_ERRNO_FAULT
214#define EFBIG __WASI_ERRNO_FBIG
215#define EFD_CLOEXEC O_CLOEXEC
216#define EFD_NONBLOCK O_NONBLOCK
217#define EFD_SEMAPHORE 1
218#define EHOSTUNREACH __WASI_ERRNO_HOSTUNREACH
219#define EIDRM __WASI_ERRNO_IDRM
220#define EILSEQ __WASI_ERRNO_ILSEQ
221#define EINPROGRESS __WASI_ERRNO_INPROGRESS
222#define EINTR __WASI_ERRNO_INTR
223#define EINVAL __WASI_ERRNO_INVAL
224#define EIO __WASI_ERRNO_IO
225#define EISCONN __WASI_ERRNO_ISCONN
226#define EISDIR __WASI_ERRNO_ISDIR
227#define EL 248
228#define ELOOP __WASI_ERRNO_LOOP
229#define EMFILE __WASI_ERRNO_MFILE
230#define EMLINK __WASI_ERRNO_MLINK
231#define EMSGSIZE __WASI_ERRNO_MSGSIZE
232#define EMULTIHOP __WASI_ERRNO_MULTIHOP
233#define ENAMETOOLONG __WASI_ERRNO_NAMETOOLONG
234#define ENCRYPT_CNT 9
235#define ENCRYPT_DEC_KEYID 8
236#define ENCRYPT_ENC_KEYID 7
237#define ENCRYPT_END 4
238#define ENCRYPT_IS 0
239#define ENCRYPT_NAME(x) encrypt_names[x]
240#define ENCRYPT_NAME_OK(x) ((unsigned int)(x) < ENCRYPT_CNT)
241#define ENCRYPT_REPLY 2
242#define ENCRYPT_REQEND 6
243#define ENCRYPT_REQSTART 5
244#define ENCRYPT_START 3
245#define ENCRYPT_SUPPORT 1
246#define ENCTYPE_ANY 0
247#define ENCTYPE_CNT 3
248#define ENCTYPE_DES_CFB64 1
249#define ENCTYPE_DES_OFB64 2
250#define ENCTYPE_NAME(x) enctype_names[x]
251#define ENCTYPE_NAME_OK(x) ((unsigned int)(x) < ENCTYPE_CNT)
252#define ENETDOWN __WASI_ERRNO_NETDOWN
253#define ENETRESET __WASI_ERRNO_NETRESET
254#define ENETUNREACH __WASI_ERRNO_NETUNREACH
255#define ENFILE __WASI_ERRNO_NFILE
256#define ENOBUFS __WASI_ERRNO_NOBUFS
257#define ENODEV __WASI_ERRNO_NODEV
258#define ENOENT __WASI_ERRNO_NOENT
259#define ENOEXEC __WASI_ERRNO_NOEXEC
260#define ENOLCK __WASI_ERRNO_NOLCK
261#define ENOLINK __WASI_ERRNO_NOLINK
262#define ENOMEM __WASI_ERRNO_NOMEM
263#define ENOMSG __WASI_ERRNO_NOMSG
264#define ENOPROTOOPT __WASI_ERRNO_NOPROTOOPT
265#define ENOSPACE 3
266#define ENOSPC __WASI_ERRNO_NOSPC
267#define ENOSYS __WASI_ERRNO_NOSYS
268#define ENOTCAPABLE __WASI_ERRNO_NOTCAPABLE
269#define ENOTCONN __WASI_ERRNO_NOTCONN
270#define ENOTDIR __WASI_ERRNO_NOTDIR
271#define ENOTEMPTY __WASI_ERRNO_NOTEMPTY
272#define ENOTFOUND 1
273#define ENOTRECOVERABLE __WASI_ERRNO_NOTRECOVERABLE
274#define ENOTSOCK __WASI_ERRNO_NOTSOCK
275#define ENOTSUP __WASI_ERRNO_NOTSUP
276#define ENOTTY __WASI_ERRNO_NOTTY
277#define ENOUSER 7
278#define ENV_ESC 2
279#define ENV_USERVAR 3
280#define ENXIO __WASI_ERRNO_NXIO
281#define EOF (-1)
282#define EOPNOTSUPP ENOTSUP
283#define EOR 239
284#define EOVERFLOW __WASI_ERRNO_OVERFLOW
285#define EOWNERDEAD __WASI_ERRNO_OWNERDEAD
286#define EPERM __WASI_ERRNO_PERM
287#define EPIPE __WASI_ERRNO_PIPE
288#define EPROTO __WASI_ERRNO_PROTO
289#define EPROTONOSUPPORT __WASI_ERRNO_PROTONOSUPPORT
290#define EPROTOTYPE __WASI_ERRNO_PROTOTYPE
291#define ERA 0x2002C
292#define ERANGE __WASI_ERRNO_RANGE
293#define ERA_D_FMT 0x2002E
294#define ERA_D_T_FMT 0x20030
295#define ERA_T_FMT 0x20031
296#define EROFS __WASI_ERRNO_ROFS
297#define ERROR 05
298#define ESPIPE __WASI_ERRNO_SPIPE
299#define ESRCH __WASI_ERRNO_SRCH
300#define ESTALE __WASI_ERRNO_STALE
301#define ETIMEDOUT __WASI_ERRNO_TIMEDOUT
302#define ETXTBSY __WASI_ERRNO_TXTBSY
303#define EUNDEF 0
304#define EWOULDBLOCK EAGAIN
305#define EXDEV __WASI_ERRNO_XDEV
306#define EXIT_FAILURE 1
307#define EXIT_SUCCESS 0
308#define EX_CANTCREAT 73
309#define EX_CONFIG 78
310#define EX_DATAERR 65
311#define EX_IOERR 74
312#define EX_NOHOST 68
313#define EX_NOINPUT 66
314#define EX_NOPERM 77
315#define EX_NOUSER 67
316#define EX_OK 0
317#define EX_OSERR 71
318#define EX_OSFILE 72
319#define EX_PROTOCOL 76
320#define EX_SOFTWARE 70
321#define EX_TEMPFAIL 75
322#define EX_UNAVAILABLE 69
323#define EX_USAGE 64
324#define EX__BASE 64
325#define EX__MAX 78
326#define FD_CLOEXEC (1)
327#define FD_CLR(fd,set) (FD_CLR((fd), (set)))
328#define FD_COPY(from,to) (FD_COPY((from), (to)))
329#define FD_ISSET(fd,set) (FD_ISSET((fd), (set)))
330#define FD_SET(fd,set) (FD_SET((fd), (set)))
331#define FD_SETSIZE 1024
332#define FD_ZERO(set) (FD_ZERO((set)))
333#define FE_ALL_EXCEPT 0
334#define FE_DFL_ENV ((const fenv_t *) -1)
335#define FE_TONEAREST 0
336#define FIFOTYPE '6'
337#define FILENAME_MAX 4096
338#define FILESIZEBITS 64
339#define FIONBIO 2
340#define FIONREAD 1
341#define FLOATBITS (sizeof(float) * 8)
342#define FLT_DECIMAL_DIG 9
343#define FLT_DIG 6
344#define FLT_EPSILON 1.1920928955078125e-07F
345#define FLT_EVAL_METHOD 0
346#define FLT_HAS_SUBNORM 1
347#define FLT_MANT_DIG 24
348#define FLT_MAX 3.40282346638528859812e+38F
349#define FLT_MAX_10_EXP 38
350#define FLT_MAX_EXP 128
351#define FLT_MIN 1.17549435082228750797e-38F
352#define FLT_MIN_10_EXP (-37)
353#define FLT_MIN_EXP (-125)
354#define FLT_RADIX 2
355#define FLT_ROUNDS (__builtin_flt_rounds())
356#define FLT_TRUE_MIN 1.40129846432481707092e-45F
357#define FLUSHBAND 0x04
358#define FLUSHR 0x01
359#define FLUSHRW 0x03
360#define FLUSHW 0x02
361#define FMAXEXP FLT_MAX_EXP
362#define FMINEXP FLT_MIN_EXP
363#define FMNAMESZ 8
364#define FNM_CASEFOLD 0x10
365#define FNM_FILE_NAME FNM_PATHNAME
366#define FNM_LEADING_DIR 0x8
367#define FNM_NOESCAPE 0x2
368#define FNM_NOMATCH 1
369#define FNM_NOSYS (-1)
370#define FNM_PATHNAME 0x1
371#define FNM_PERIOD 0x4
372#define FOPEN_MAX 1000
373#define FORMERR ns_r_formerr
374#define FORM_C 3
375#define FORM_N 1
376#define FORM_T 2
377#define FP_ILOGB0 FP_ILOGBNAN
378#define FP_ILOGBNAN (-1-0x7fffffff)
379#define FP_INFINITE 1
380#define FP_NAN 0
381#define FP_NORMAL 4
382#define FP_SUBNORMAL 3
383#define FP_ZERO 2
384#define FSETLOCKING_BYCALLER 2
385#define FSETLOCKING_INTERNAL 1
386#define FSETLOCKING_QUERY 0
387#define FTW_CHDIR 4
388#define FTW_D 2
389#define FTW_DEPTH 8
390#define FTW_DNR 3
391#define FTW_DP 6
392#define FTW_F 1
393#define FTW_MOUNT 2
394#define FTW_NS 4
395#define FTW_PHYS 1
396#define FTW_SL 5
397#define FTW_SLN 7
398#define F_GETFD (1)
399#define F_GETFL (3)
400#define F_LOCK 1
401#define F_OK (0)
402#define F_SETFD (2)
403#define F_SETFL (4)
404#define F_TEST 3
405#define F_TLOCK 2
406#define F_ULOCK 0
407#define GA 249
408#define GETLONG NS_GET32
409#define GETSHORT NS_GET16
410#define GLOB_ABORTED 2
411#define GLOB_APPEND 0x20
412#define GLOB_DOOFFS 0x08
413#define GLOB_ERR 0x01
414#define GLOB_MARK 0x02
415#define GLOB_NOCHECK 0x10
416#define GLOB_NOESCAPE 0x40
417#define GLOB_NOMATCH 3
418#define GLOB_NOSORT 0x04
419#define GLOB_NOSPACE 1
420#define GLOB_NOSYS 4
421#define GLOB_PERIOD 0x80
422#define GROUP_FILTER_SIZE(numsrc) (sizeof(struct group_filter) - sizeof(struct sockaddr_storage) + (numsrc) * sizeof(struct sockaddr_storage))
423#define HFIXEDSZ NS_HFIXEDSZ
424#define HIBITL MINLONG
425#define HIBITS MINSHORT
426#define HOST_NAME_MAX 255
427#define HUGE 3.40282346638528859812e+38F
428#define HUGE_VAL ((double)INFINITY)
429#define HUGE_VALF INFINITY
430#define HUGE_VALL ((long double)INFINITY)
431#define I _Complex_I
432#define IAC 255
433#define ICMP6_DST_UNREACH 1
434#define ICMP6_DST_UNREACH_ADDR 3
435#define ICMP6_DST_UNREACH_ADMIN 1
436#define ICMP6_DST_UNREACH_BEYONDSCOPE 2
437#define ICMP6_DST_UNREACH_NOPORT 4
438#define ICMP6_DST_UNREACH_NOROUTE 0
439#define ICMP6_ECHO_REPLY 129
440#define ICMP6_ECHO_REQUEST 128
441#define ICMP6_FILTER 1
442#define ICMP6_FILTER_BLOCK 1
443#define ICMP6_FILTER_BLOCKOTHERS 3
444#define ICMP6_FILTER_PASS 2
445#define ICMP6_FILTER_PASSONLY 4
446#define ICMP6_FILTER_SETBLOCK(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) |= (1 << ((type) & 31))))
447#define ICMP6_FILTER_SETBLOCKALL(filterp) memset (filterp, 0xFF, sizeof (struct icmp6_filter));
448#define ICMP6_FILTER_SETPASS(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) &= ~(1 << ((type) & 31))))
449#define ICMP6_FILTER_SETPASSALL(filterp) memset (filterp, 0, sizeof (struct icmp6_filter));
450#define ICMP6_FILTER_WILLBLOCK(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) != 0)
451#define ICMP6_FILTER_WILLPASS(type,filterp) ((((filterp)->icmp6_filt[(type) >> 5]) & (1 << ((type) & 31))) == 0)
452#define ICMP6_INFOMSG_MASK 0x80
453#define ICMP6_PACKET_TOO_BIG 2
454#define ICMP6_PARAMPROB_HEADER 0
455#define ICMP6_PARAMPROB_NEXTHEADER 1
456#define ICMP6_PARAMPROB_OPTION 2
457#define ICMP6_PARAM_PROB 4
458#define ICMP6_ROUTER_RENUMBERING 138
459#define ICMP6_RR_FLAGS_FORCEAPPLY 0x20
460#define ICMP6_RR_FLAGS_PREVDONE 0x08
461#define ICMP6_RR_FLAGS_REQRESULT 0x40
462#define ICMP6_RR_FLAGS_SPECSITE 0x10
463#define ICMP6_RR_FLAGS_TEST 0x80
464#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
465#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
466#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x10
467#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x20
468#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
469#define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
470#define ICMP6_TIME_EXCEEDED 3
471#define ICMP6_TIME_EXCEED_REASSEMBLY 1
472#define ICMP6_TIME_EXCEED_TRANSIT 0
473#define ICMP_ADDRESS 17
474#define ICMP_ADDRESSREPLY 18
475#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
476#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8)
477#define ICMP_DEST_UNREACH 3
478#define ICMP_ECHO 8
479#define ICMP_ECHOREPLY 0
480#define ICMP_EXC_FRAGTIME 1
481#define ICMP_EXC_TTL 0
482#define ICMP_FRAG_NEEDED 4
483#define ICMP_HOST_ANO 10
484#define ICMP_HOST_ISOLATED 8
485#define ICMP_HOST_UNKNOWN 7
486#define ICMP_HOST_UNREACH 1
487#define ICMP_HOST_UNR_TOS 12
488#define ICMP_INFOTYPE(type) ((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || (type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || (type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || (type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || (type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
489#define ICMP_INFO_REPLY 16
490#define ICMP_INFO_REQUEST 15
491#define ICMP_IREQ 15
492#define ICMP_IREQREPLY 16
493#define ICMP_MASKLEN 12
494#define ICMP_MASKREPLY 18
495#define ICMP_MASKREQ 17
496#define ICMP_MAXTYPE 18
497#define ICMP_MINLEN 8
498#define ICMP_NET_ANO 9
499#define ICMP_NET_UNKNOWN 6
500#define ICMP_NET_UNREACH 0
501#define ICMP_NET_UNR_TOS 11
502#define ICMP_PARAMETERPROB 12
503#define ICMP_PARAMPROB 12
504#define ICMP_PARAMPROB_OPTABSENT 1
505#define ICMP_PKT_FILTERED 13
506#define ICMP_PORT_UNREACH 3
507#define ICMP_PREC_CUTOFF 15
508#define ICMP_PREC_VIOLATION 14
509#define ICMP_PROT_UNREACH 2
510#define ICMP_REDIRECT 5
511#define ICMP_REDIRECT_HOST 1
512#define ICMP_REDIRECT_NET 0
513#define ICMP_REDIRECT_TOSHOST 3
514#define ICMP_REDIRECT_TOSNET 2
515#define ICMP_REDIR_HOST 1
516#define ICMP_REDIR_HOSTTOS 3
517#define ICMP_REDIR_NET 0
518#define ICMP_REDIR_NETTOS 2
519#define ICMP_ROUTERADVERT 9
520#define ICMP_ROUTERSOLICIT 10
521#define ICMP_SOURCEQUENCH 4
522#define ICMP_SOURCE_QUENCH 4
523#define ICMP_SR_FAILED 5
524#define ICMP_TIMESTAMP 13
525#define ICMP_TIMESTAMPREPLY 14
526#define ICMP_TIME_EXCEEDED 11
527#define ICMP_TIMXCEED 11
528#define ICMP_TIMXCEED_INTRANS 0
529#define ICMP_TIMXCEED_REASS 1
530#define ICMP_TSLEN (8 + 3 * sizeof (n_time))
531#define ICMP_TSTAMP 13
532#define ICMP_TSTAMPREPLY 14
533#define ICMP_UNREACH 3
534#define ICMP_UNREACH_FILTER_PROHIB 13
535#define ICMP_UNREACH_HOST 1
536#define ICMP_UNREACH_HOST_PRECEDENCE 14
537#define ICMP_UNREACH_HOST_PROHIB 10
538#define ICMP_UNREACH_HOST_UNKNOWN 7
539#define ICMP_UNREACH_ISOLATED 8
540#define ICMP_UNREACH_NEEDFRAG 4
541#define ICMP_UNREACH_NET 0
542#define ICMP_UNREACH_NET_PROHIB 9
543#define ICMP_UNREACH_NET_UNKNOWN 6
544#define ICMP_UNREACH_PORT 3
545#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15
546#define ICMP_UNREACH_PROTOCOL 2
547#define ICMP_UNREACH_SRCFAIL 5
548#define ICMP_UNREACH_TOSHOST 12
549#define ICMP_UNREACH_TOSNET 11
550#define IGMP_AWAKENING_MEMBER 5
551#define IGMP_DELAYING_MEMBER 1
552#define IGMP_DVMRP 0x13
553#define IGMP_HOST_LEAVE_MESSAGE IGMP_V2_LEAVE_GROUP
554#define IGMP_HOST_MEMBERSHIP_QUERY IGMP_MEMBERSHIP_QUERY
555#define IGMP_HOST_MEMBERSHIP_REPORT IGMP_V1_MEMBERSHIP_REPORT
556#define IGMP_HOST_NEW_MEMBERSHIP_REPORT IGMP_V2_MEMBERSHIP_REPORT
557#define IGMP_IDLE_MEMBER 2
558#define IGMP_LAZY_MEMBER 3
559#define IGMP_MAX_HOST_REPORT_DELAY 10
560#define IGMP_MEMBERSHIP_QUERY 0x11
561#define IGMP_MINLEN 8
562#define IGMP_MTRACE 0x1f
563#define IGMP_MTRACE_RESP 0x1e
564#define IGMP_PIM 0x14
565#define IGMP_SLEEPING_MEMBER 4
566#define IGMP_TIMER_SCALE 10
567#define IGMP_TRACE 0x15
568#define IGMP_V1_MEMBERSHIP_REPORT 0x12
569#define IGMP_V2_LEAVE_GROUP 0x17
570#define IGMP_V2_MEMBERSHIP_REPORT 0x16
571#define IGMP_v1_ROUTER 1
572#define IGMP_v2_ROUTER 2
573#define IN6ADDRSZ NS_IN6ADDRSZ
574#define IN6ADDR_ANY_INIT { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }
575#define IN6ADDR_LOOPBACK_INIT { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 } }
576#define IN6_ARE_ADDR_EQUAL(a,b) __ARE_4_EQUAL((const uint32_t *)(a), (const uint32_t *)(b))
577#define IN6_IS_ADDR_LINKLOCAL(a) ((((uint8_t *) (a))[0]) == 0xfe && (((uint8_t *) (a))[1] & 0xc0) == 0x80)
578#define IN6_IS_ADDR_LOOPBACK(a) (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && ((uint32_t *) (a))[2] == 0 && ((uint8_t *) (a))[12] == 0 && ((uint8_t *) (a))[13] == 0 && ((uint8_t *) (a))[14] == 0 && ((uint8_t *) (a))[15] == 1 )
579#define IN6_IS_ADDR_MC_GLOBAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0xe))
580#define IN6_IS_ADDR_MC_LINKLOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x2))
581#define IN6_IS_ADDR_MC_NODELOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x1))
582#define IN6_IS_ADDR_MC_ORGLOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x8))
583#define IN6_IS_ADDR_MC_SITELOCAL(a) (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x5))
584#define IN6_IS_ADDR_MULTICAST(a) (((uint8_t *) (a))[0] == 0xff)
585#define IN6_IS_ADDR_SITELOCAL(a) ((((uint8_t *) (a))[0]) == 0xfe && (((uint8_t *) (a))[1] & 0xc0) == 0xc0)
586#define IN6_IS_ADDR_UNSPECIFIED(a) (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && ((uint32_t *) (a))[2] == 0 && ((uint32_t *) (a))[3] == 0)
587#define IN6_IS_ADDR_V4COMPAT(a) (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && ((uint32_t *) (a))[2] == 0 && ((uint8_t *) (a))[15] > 1)
588#define IN6_IS_ADDR_V4MAPPED(a) (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && ((uint8_t *) (a))[8] == 0 && ((uint8_t *) (a))[9] == 0 && ((uint8_t *) (a))[10] == 0xff && ((uint8_t *) (a))[11] == 0xff)
589#define INADDRSZ NS_INADDRSZ
590#define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001)
591#define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002)
592#define INADDR_ALLSNOOPERS_GROUP ((in_addr_t) 0xe000006a)
593#define INADDR_ANY ((in_addr_t) 0x00000000)
594#define INADDR_BROADCAST ((in_addr_t) 0xffffffff)
595#define INADDR_LOOPBACK ((in_addr_t) 0x7f000001)
596#define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff)
597#define INADDR_NONE ((in_addr_t) 0xffffffff)
598#define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000)
599#define INDIR_MASK NS_CMPRSFLGS
600#define INET6_ADDRSTRLEN 46
601#define INET_ADDRSTRLEN 16
602#define INFINITY 1e5000f
603#define INT16SZ NS_INT16SZ
604#define INT16_C(c) c
605#define INT16_MAX (0x7fff)
606#define INT16_MIN (-1-0x7fff)
607#define INT32SZ NS_INT32SZ
608#define INT32_C(c) c
609#define INT32_MAX (0x7fffffff)
610#define INT32_MIN (-1-0x7fffffff)
611#define INT64_C(c) c ## LL
612#define INT64_MAX (0x7fffffffffffffff)
613#define INT64_MIN (-1-0x7fffffffffffffff)
614#define INT8SZ NS_INT8SZ
615#define INT8_C(c) c
616#define INT8_MAX (0x7f)
617#define INT8_MIN (-1-0x7f)
618#define INTBITS (sizeof(int) * 8)
619#define INTMAX_C(c) c ## LL
620#define INTMAX_MAX INT64_MAX
621#define INTMAX_MIN INT64_MIN
622#define INTPTR_MAX INT32_MAX
623#define INTPTR_MIN INT32_MIN
624#define INT_FAST16_MAX INT16_MAX
625#define INT_FAST16_MIN INT16_MIN
626#define INT_FAST32_MAX INT32_MAX
627#define INT_FAST32_MIN INT32_MIN
628#define INT_FAST64_MAX INT64_MAX
629#define INT_FAST64_MIN INT64_MIN
630#define INT_FAST8_MAX INT8_MAX
631#define INT_FAST8_MIN INT8_MIN
632#define INT_LEAST16_MAX INT16_MAX
633#define INT_LEAST16_MIN INT16_MIN
634#define INT_LEAST32_MAX INT32_MAX
635#define INT_LEAST32_MIN INT32_MIN
636#define INT_LEAST64_MAX INT64_MAX
637#define INT_LEAST64_MIN INT64_MIN
638#define INT_LEAST8_MAX INT8_MAX
639#define INT_LEAST8_MIN INT8_MIN
640#define INT_MAX 0x7fffffff
641#define INT_MIN (-1-0x7fffffff)
642#define IN_BADCLASS(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000)
643#define IN_CLASSA(a) ((((in_addr_t)(a)) & 0x80000000) == 0)
644#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
645#define IN_CLASSA_MAX 128
646#define IN_CLASSA_NET 0xff000000
647#define IN_CLASSA_NSHIFT 24
648#define IN_CLASSB(a) ((((in_addr_t)(a)) & 0xc0000000) == 0x80000000)
649#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
650#define IN_CLASSB_MAX 65536
651#define IN_CLASSB_NET 0xffff0000
652#define IN_CLASSB_NSHIFT 16
653#define IN_CLASSC(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000)
654#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
655#define IN_CLASSC_NET 0xffffff00
656#define IN_CLASSC_NSHIFT 8
657#define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000)
658#define IN_EXPERIMENTAL(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000)
659#define IN_LOOPBACKNET 127
660#define IN_MULTICAST(a) IN_CLASSD(a)
661#define IOV_MAX 1024
662#define IP 244
663#define IP6F_MORE_FRAG 0x0100
664#define IP6F_OFF_MASK 0xf8ff
665#define IP6F_RESERVED_MASK 0x0600
666#define IP6OPT_JUMBO 0xc2
667#define IP6OPT_JUMBO_LEN 6
668#define IP6OPT_NSAP_ADDR 0xc3
669#define IP6OPT_PAD1 0
670#define IP6OPT_PADN 1
671#define IP6OPT_ROUTER_ALERT 0x05
672#define IP6OPT_TUNNEL_LIMIT 0x04
673#define IP6OPT_TYPE(o) ((o) & 0xc0)
674#define IP6OPT_TYPE_DISCARD 0x40
675#define IP6OPT_TYPE_FORCEICMP 0x80
676#define IP6OPT_TYPE_ICMP 0xc0
677#define IP6OPT_TYPE_MUTABLE 0x20
678#define IP6OPT_TYPE_SKIP 0x00
679#define IP6_ALERT_AN 0x0200
680#define IP6_ALERT_MLD 0x0000
681#define IP6_ALERT_RSVP 0x0100
682#define IPDEFTTL 64
683#define IPFRAGTTL 60
684#define IPOPT_CLASS(o) ((o) & IPOPT_CLASS_MASK)
685#define IPOPT_CLASS_MASK 0x60
686#define IPOPT_CONTROL 0x00
687#define IPOPT_COPIED(o) ((o) & IPOPT_COPY)
688#define IPOPT_COPY 0x80
689#define IPOPT_DEBMEAS 0x40
690#define IPOPT_END IPOPT_EOL
691#define IPOPT_EOL 0
692#define IPOPT_LSRR 131
693#define IPOPT_MEASUREMENT IPOPT_DEBMEAS
694#define IPOPT_MINOFF 4
695#define IPOPT_NOOP IPOPT_NOP
696#define IPOPT_NOP 1
697#define IPOPT_NUMBER(o) ((o) & IPOPT_NUMBER_MASK)
698#define IPOPT_NUMBER_MASK 0x1f
699#define IPOPT_OFFSET 2
700#define IPOPT_OLEN 1
701#define IPOPT_OPTVAL 0
702#define IPOPT_RA 148
703#define IPOPT_RESERVED1 0x20
704#define IPOPT_RESERVED2 0x60
705#define IPOPT_RR 7
706#define IPOPT_SATID 136
707#define IPOPT_SEC IPOPT_SECURITY
708#define IPOPT_SECURITY 130
709#define IPOPT_SECUR_CONFID 0xf135
710#define IPOPT_SECUR_EFTO 0x789a
711#define IPOPT_SECUR_MMMM 0xbc4d
712#define IPOPT_SECUR_RESTR 0xaf13
713#define IPOPT_SECUR_SECRET 0xd788
714#define IPOPT_SECUR_TOPSECRET 0x6bc5
715#define IPOPT_SECUR_UNCLASS 0x0000
716#define IPOPT_SID IPOPT_SATID
717#define IPOPT_SSRR 137
718#define IPOPT_TIMESTAMP IPOPT_TS
719#define IPOPT_TS 68
720#define IPOPT_TS_PRESPEC 3
721#define IPOPT_TS_TSANDADDR 1
722#define IPOPT_TS_TSONLY 0
723#define IPPORT_RESERVED 1024
724#define IPPROTO_ICMP 1
725#define IPPROTO_IP 0
726#define IPPROTO_IPV6 41
727#define IPPROTO_RAW 255
728#define IPPROTO_TCP 6
729#define IPPROTO_UDP 17
730#define IPTOS_CLASS(x) ((x) & IPTOS_CLASS_MASK)
731#define IPTOS_CLASS_CS0 0x00
732#define IPTOS_CLASS_CS1 0x20
733#define IPTOS_CLASS_CS2 0x40
734#define IPTOS_CLASS_CS3 0x60
735#define IPTOS_CLASS_CS4 0x80
736#define IPTOS_CLASS_CS5 0xa0
737#define IPTOS_CLASS_CS6 0xc0
738#define IPTOS_CLASS_CS7 0xe0
739#define IPTOS_CLASS_DEFAULT IPTOS_CLASS_CS0
740#define IPTOS_CLASS_MASK 0xe0
741#define IPTOS_DSCP(x) ((x) & IPTOS_DSCP_MASK)
742#define IPTOS_DSCP_AF11 0x28
743#define IPTOS_DSCP_AF12 0x30
744#define IPTOS_DSCP_AF13 0x38
745#define IPTOS_DSCP_AF21 0x48
746#define IPTOS_DSCP_AF22 0x50
747#define IPTOS_DSCP_AF23 0x58
748#define IPTOS_DSCP_AF31 0x68
749#define IPTOS_DSCP_AF32 0x70
750#define IPTOS_DSCP_AF33 0x78
751#define IPTOS_DSCP_AF41 0x88
752#define IPTOS_DSCP_AF42 0x90
753#define IPTOS_DSCP_AF43 0x98
754#define IPTOS_DSCP_EF 0xb8
755#define IPTOS_DSCP_MASK 0xfc
756#define IPTOS_ECN(x) ((x) & IPTOS_ECN_MASK)
757#define IPTOS_ECN_CE 0x03
758#define IPTOS_ECN_ECT0 0x02
759#define IPTOS_ECN_ECT1 0x01
760#define IPTOS_ECN_MASK 0x03
761#define IPTOS_ECN_NOT_ECT 0x00
762#define IPTOS_LOWCOST 0x02
763#define IPTOS_LOWDELAY 0x10
764#define IPTOS_MINCOST IPTOS_LOWCOST
765#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK)
766#define IPTOS_PREC_CRITIC_ECP 0xa0
767#define IPTOS_PREC_FLASH 0x60
768#define IPTOS_PREC_FLASHOVERRIDE 0x80
769#define IPTOS_PREC_IMMEDIATE 0x40
770#define IPTOS_PREC_INTERNETCONTROL 0xc0
771#define IPTOS_PREC_MASK 0xe0
772#define IPTOS_PREC_NETCONTROL 0xe0
773#define IPTOS_PREC_PRIORITY 0x20
774#define IPTOS_PREC_ROUTINE 0x00
775#define IPTOS_RELIABILITY 0x04
776#define IPTOS_THROUGHPUT 0x08
777#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK)
778#define IPTOS_TOS_MASK 0x1E
779#define IPTTLDEC 1
780#define IPV6_2292DSTOPTS 4
781#define IPV6_2292HOPLIMIT 8
782#define IPV6_2292HOPOPTS 3
783#define IPV6_2292PKTINFO 2
784#define IPV6_2292PKTOPTIONS 6
785#define IPV6_2292RTHDR 5
786#define IPV6_ADDRFORM 1
787#define IPV6_ADDR_PREFERENCES 72
788#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
789#define IPV6_AUTHHDR 10
790#define IPV6_AUTOFLOWLABEL 70
791#define IPV6_CHECKSUM 7
792#define IPV6_DONTFRAG 62
793#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
794#define IPV6_DSTOPTS 59
795#define IPV6_FREEBIND 78
796#define IPV6_HDRINCL 36
797#define IPV6_HOPLIMIT 52
798#define IPV6_HOPOPTS 54
799#define IPV6_IPSEC_POLICY 34
800#define IPV6_JOIN_ANYCAST 27
801#define IPV6_JOIN_GROUP 20
802#define IPV6_LEAVE_ANYCAST 28
803#define IPV6_LEAVE_GROUP 21
804#define IPV6_MINHOPCOUNT 73
805#define IPV6_MTU 24
806#define IPV6_MTU_DISCOVER 23
807#define IPV6_MULTICAST_ALL 29
808#define IPV6_MULTICAST_HOPS 18
809#define IPV6_MULTICAST_IF 17
810#define IPV6_MULTICAST_LOOP 19
811#define IPV6_NEXTHOP 9
812#define IPV6_ORIGDSTADDR 74
813#define IPV6_PATHMTU 61
814#define IPV6_PKTINFO 50
815#define IPV6_PMTUDISC_DO 2
816#define IPV6_PMTUDISC_DONT 0
817#define IPV6_PMTUDISC_INTERFACE 4
818#define IPV6_PMTUDISC_OMIT 5
819#define IPV6_PMTUDISC_PROBE 3
820#define IPV6_PMTUDISC_WANT 1
821#define IPV6_PREFER_SRC_CGA 0x0008
822#define IPV6_PREFER_SRC_COA 0x0004
823#define IPV6_PREFER_SRC_HOME 0x0400
824#define IPV6_PREFER_SRC_NONCGA 0x0800
825#define IPV6_PREFER_SRC_PUBLIC 0x0002
826#define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100
827#define IPV6_PREFER_SRC_TMP 0x0001
828#define IPV6_RECVDSTOPTS 58
829#define IPV6_RECVERR 25
830#define IPV6_RECVFRAGSIZE 77
831#define IPV6_RECVHOPLIMIT 51
832#define IPV6_RECVHOPOPTS 53
833#define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
834#define IPV6_RECVPATHMTU 60
835#define IPV6_RECVPKTINFO 49
836#define IPV6_RECVRTHDR 56
837#define IPV6_RECVTCLASS 66
838#define IPV6_ROUTER_ALERT 22
839#define IPV6_ROUTER_ALERT_ISOLATE 30
840#define IPV6_RTHDR 57
841#define IPV6_RTHDRDSTOPTS 55
842#define IPV6_RTHDR_LOOSE 0
843#define IPV6_RTHDR_STRICT 1
844#define IPV6_RTHDR_TYPE_0 0
845#define IPV6_RXDSTOPTS IPV6_DSTOPTS
846#define IPV6_RXHOPOPTS IPV6_HOPOPTS
847#define IPV6_TCLASS 67
848#define IPV6_TRANSPARENT 75
849#define IPV6_UNICAST_HOPS 16
850#define IPV6_UNICAST_IF 76
851#define IPV6_V6ONLY 26
852#define IPV6_XFRM_POLICY 35
853#define IPVERSION 4
854#define IP_ADD_MEMBERSHIP 35
855#define IP_ADD_SOURCE_MEMBERSHIP 39
856#define IP_BIND_ADDRESS_NO_PORT 24
857#define IP_BLOCK_SOURCE 38
858#define IP_CHECKSUM 23
859#define IP_DEFAULT_MULTICAST_LOOP 1
860#define IP_DEFAULT_MULTICAST_TTL 1
861#define IP_DF 0x4000
862#define IP_DROP_MEMBERSHIP 36
863#define IP_DROP_SOURCE_MEMBERSHIP 40
864#define IP_FREEBIND 15
865#define IP_HDRINCL 3
866#define IP_IPSEC_POLICY 16
867#define IP_MAXPACKET 65535
868#define IP_MAX_MEMBERSHIPS 20
869#define IP_MF 0x2000
870#define IP_MINTTL 21
871#define IP_MSFILTER 41
872#define IP_MSFILTER_SIZE(numsrc) (sizeof(struct ip_msfilter) - sizeof(struct in_addr) + (numsrc) * sizeof(struct in_addr))
873#define IP_MSS 576
874#define IP_MTU 14
875#define IP_MTU_DISCOVER 10
876#define IP_MULTICAST_ALL 49
877#define IP_MULTICAST_IF 32
878#define IP_MULTICAST_LOOP 34
879#define IP_MULTICAST_TTL 33
880#define IP_NODEFRAG 22
881#define IP_OFFMASK 0x1fff
882#define IP_OPTIONS 4
883#define IP_ORIGDSTADDR 20
884#define IP_PASSSEC 18
885#define IP_PKTINFO 8
886#define IP_PKTOPTIONS 9
887#define IP_PMTUDISC 10
888#define IP_PMTUDISC_DO 2
889#define IP_PMTUDISC_DONT 0
890#define IP_PMTUDISC_INTERFACE 4
891#define IP_PMTUDISC_OMIT 5
892#define IP_PMTUDISC_PROBE 3
893#define IP_PMTUDISC_WANT 1
894#define IP_RECVERR 11
895#define IP_RECVERR_RFC4884 26
896#define IP_RECVFRAGSIZE 25
897#define IP_RECVOPTS 6
898#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
899#define IP_RECVRETOPTS IP_RETOPTS
900#define IP_RECVTOS 13
901#define IP_RECVTTL 12
902#define IP_RETOPTS 7
903#define IP_RF 0x8000
904#define IP_ROUTER_ALERT 5
905#define IP_TOS 1
906#define IP_TRANSPARENT 19
907#define IP_TTL 2
908#define IP_UNBLOCK_SOURCE 37
909#define IP_UNICAST_IF 50
910#define IP_XFRM_POLICY 17
911#define IQUERY ns_o_iquery
912#define I_ATMARK (__SID |31)
913#define I_CANPUT (__SID |34)
914#define I_CKBAND (__SID |29)
915#define I_FDINSERT (__SID |16)
916#define I_FIND (__SID |11)
917#define I_FLUSH (__SID | 5)
918#define I_FLUSHBAND (__SID |28)
919#define I_GETBAND (__SID |30)
920#define I_GETCLTIME (__SID |33)
921#define I_GETSIG (__SID |10)
922#define I_GRDOPT (__SID | 7)
923#define I_GWROPT (__SID |20)
924#define I_LINK (__SID |12)
925#define I_LIST (__SID |21)
926#define I_LOOK (__SID | 4)
927#define I_NREAD (__SID | 1)
928#define I_PEEK (__SID |15)
929#define I_PLINK (__SID |22)
930#define I_POP (__SID | 3)
931#define I_PUNLINK (__SID |23)
932#define I_PUSH (__SID | 2)
933#define I_RECVFD (__SID |14)
934#define I_SENDFD (__SID |17)
935#define I_SETCLTIME (__SID |32)
936#define I_SETSIG (__SID | 9)
937#define I_SRDOPT (__SID | 6)
938#define I_STR (__SID | 8)
939#define I_SWROPT (__SID |19)
940#define I_UNLINK (__SID |13)
941#define LASTMARK 0x02
942#define LC_ALL 6
943#define LC_ALL_MASK 0x7fffffff
944#define LC_COLLATE 3
945#define LC_COLLATE_MASK (1<<LC_COLLATE)
946#define LC_CTYPE 0
947#define LC_CTYPE_MASK (1<<LC_CTYPE)
948#define LC_GLOBAL_LOCALE ((locale_t)-1)
949#define LC_MESSAGES 5
950#define LC_MESSAGES_MASK (1<<LC_MESSAGES)
951#define LC_MONETARY 4
952#define LC_MONETARY_MASK (1<<LC_MONETARY)
953#define LC_NUMERIC 1
954#define LC_NUMERIC_MASK (1<<LC_NUMERIC)
955#define LC_TIME 2
956#define LC_TIME_MASK (1<<LC_TIME)
957#define LDBL_DECIMAL_DIG DECIMAL_DIG
958#define LDBL_DIG 33
959#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
960#define LDBL_HAS_SUBNORM 1
961#define LDBL_MANT_DIG 113
962#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
963#define LDBL_MAX_10_EXP 4932
964#define LDBL_MAX_EXP 16384
965#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
966#define LDBL_MIN_10_EXP (-4931)
967#define LDBL_MIN_EXP (-16381)
968#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
969#define LFLOW_OFF 0
970#define LFLOW_ON 1
971#define LFLOW_RESTART_ANY 2
972#define LFLOW_RESTART_XON 3
973#define LITTLE_ENDIAN __LITTLE_ENDIAN
974#define LLONG_MAX 0x7fffffffffffffffLL
975#define LLONG_MIN (-LLONG_MAX-1)
976#define LM_FORWARDMASK 2
977#define LM_MODE 1
978#define LM_SLC 3
979#define LNKTYPE '1'
980#define LOCK_EX 2
981#define LOCK_NB 4
982#define LOCK_SH 1
983#define LOCK_UN 8
984#define LONGBITS (sizeof(long) * 8)
985#define LONG_BIT 32
986#define LONG_MAX __LONG_MAX
987#define LONG_MIN (-LONG_MAX-1)
988#define L_INCR 1
989#define L_SET 0
990#define L_XTND 2
991#define L_ctermid 20
992#define L_cuserid 20
993#define MAGIC "070707"
994#define MATH_ERREXCEPT 2
995#define MATH_ERRNO 1
996#define MAX(a,b) (((a)>(b))?(a):(b))
997#define MAXCDNAME NS_MAXCDNAME
998#define MAXDNAME NS_MAXDNAME
999#define MAXDOUBLE DBL_MAX
1000#define MAXFLOAT FLT_MAX
1001#define MAXHOSTNAMELEN 64
1002#define MAXINT INT_MAX
1003#define MAXLABEL NS_MAXLABEL
1004#define MAXLONG LONG_MAX
1005#define MAXNAMLEN 255
1006#define MAXPATHLEN 4096
1007#define MAXSHORT SHRT_MAX
1008#define MAXSYMLINKS 20
1009#define MAXTC 6
1010#define MAXTTL 255
1011#define MAX_IPOPTLEN 40
1012#define MB_CUR_MAX (__ctype_get_mb_cur_max())
1013#define MB_LEN_MAX 4
1014#define MCAST_BLOCK_SOURCE 43
1015#define MCAST_EXCLUDE 0
1016#define MCAST_INCLUDE 1
1017#define MCAST_JOIN_GROUP 42
1018#define MCAST_JOIN_SOURCE_GROUP 46
1019#define MCAST_LEAVE_GROUP 45
1020#define MCAST_LEAVE_SOURCE_GROUP 47
1021#define MCAST_MSFILTER 48
1022#define MCAST_UNBLOCK_SOURCE 44
1023#define MIN(a,b) (((a)<(b))?(a):(b))
1024#define MINDOUBLE DBL_MIN
1025#define MINFLOAT FLT_MIN
1026#define MININT INT_MIN
1027#define MINLONG LONG_MIN
1028#define MINSHORT SHRT_MIN
1029#define MLD_LISTENER_QUERY 130
1030#define MLD_LISTENER_REDUCTION 132
1031#define MLD_LISTENER_REPORT 131
1032#define MM_APPL 8
1033#define MM_CONSOLE 512
1034#define MM_ERROR 2
1035#define MM_FIRM 4
1036#define MM_HALT 1
1037#define MM_HARD 1
1038#define MM_INFO 4
1039#define MM_NOCON 4
1040#define MM_NOMSG 1
1041#define MM_NOSEV 0
1042#define MM_NOTOK (-1)
1043#define MM_NRECOV 128
1044#define MM_NULLACT ((char*)0)
1045#define MM_NULLLBL ((char*)0)
1046#define MM_NULLMC 0L
1047#define MM_NULLSEV 0
1048#define MM_NULLTAG ((char*)0)
1049#define MM_NULLTXT ((char*)0)
1050#define MM_OK 0
1051#define MM_OPSYS 32
1052#define MM_PRINT 256
1053#define MM_RECOVER 64
1054#define MM_SOFT 2
1055#define MM_UTIL 16
1056#define MM_WARNING 3
1057#define MODE_ACK 0x04
1058#define MODE_B 2
1059#define MODE_C 3
1060#define MODE_ECHO 0x0200
1061#define MODE_EDIT 0x01
1062#define MODE_FLOW 0x0100
1063#define MODE_FORCE 0x1000
1064#define MODE_INBIN 0x0400
1065#define MODE_LIT_ECHO 0x10
1066#define MODE_MASK 0x1f
1067#define MODE_OUTBIN 0x0800
1068#define MODE_S 1
1069#define MODE_SOFT_TAB 0x08
1070#define MODE_TRAPSIG 0x02
1071#define MOD_CLKA ADJ_OFFSET_SINGLESHOT
1072#define MOD_CLKB ADJ_TICK
1073#define MOD_ESTERROR ADJ_ESTERROR
1074#define MOD_FREQUENCY ADJ_FREQUENCY
1075#define MOD_MAXERROR ADJ_MAXERROR
1076#define MOD_MICRO ADJ_MICRO
1077#define MOD_NANO ADJ_NANO
1078#define MOD_OFFSET ADJ_OFFSET
1079#define MOD_STATUS ADJ_STATUS
1080#define MOD_TAI ADJ_TAI
1081#define MOD_TIMECONST ADJ_TIMECONST
1082#define MON_1 0x2001A
1083#define MON_10 0x20023
1084#define MON_11 0x20024
1085#define MON_12 0x20025
1086#define MON_2 0x2001B
1087#define MON_3 0x2001C
1088#define MON_4 0x2001D
1089#define MON_5 0x2001E
1090#define MON_6 0x2001F
1091#define MON_7 0x20020
1092#define MON_8 0x20021
1093#define MON_9 0x20022
1094#define MORECTL 1
1095#define MOREDATA 2
1096#define MSG_ANY 0x02
1097#define MSG_BAND 0x04
1098#define MSG_HIPRI 0x01
1099#define MSG_PEEK __WASI_RIFLAGS_RECV_PEEK
1100#define MSG_TRUNC __WASI_RIFLAGS_RECV_DATA_TRUNCATED
1101#define MSG_WAITALL __WASI_RIFLAGS_RECV_WAITALL
1102#define MUXID_ALL (-1)
1103#define M_1_PI 0.31830988618379067154
1104#define M_2_PI 0.63661977236758134308
1105#define M_2_SQRTPI 1.12837916709551257390
1106#define M_E 2.7182818284590452354
1107#define M_LN10 2.30258509299404568402
1108#define M_LN2 0.69314718055994530942
1109#define M_LOG10E 0.43429448190325182765
1110#define M_LOG2E 1.4426950408889634074
1111#define M_PI 3.14159265358979323846
1112#define M_PI_2 1.57079632679489661923
1113#define M_PI_4 0.78539816339744830962
1114#define M_SQRT1_2 0.70710678118654752440
1115#define M_SQRT2 1.41421356237309504880
1116#define NAMESERVER_PORT NS_DEFAULTPORT
1117#define NAME_MAX 255
1118#define NAN (0.0f/0.0f)
1119#define NBBY 8
1120#define NCARGS 131072
1121#define NDEBUG 1
1122#define ND_NA_FLAG_OVERRIDE 0x00000020
1123#define ND_NA_FLAG_ROUTER 0x00000080
1124#define ND_NA_FLAG_SOLICITED 0x00000040
1125#define ND_NEIGHBOR_ADVERT 136
1126#define ND_NEIGHBOR_SOLICIT 135
1127#define ND_OPT_HOME_AGENT_INFO 8
1128#define ND_OPT_MTU 5
1129#define ND_OPT_PI_FLAG_AUTO 0x40
1130#define ND_OPT_PI_FLAG_ONLINK 0x80
1131#define ND_OPT_PI_FLAG_RADDR 0x20
1132#define ND_OPT_PREFIX_INFORMATION 3
1133#define ND_OPT_REDIRECTED_HEADER 4
1134#define ND_OPT_RTR_ADV_INTERVAL 7
1135#define ND_OPT_SOURCE_LINKADDR 1
1136#define ND_OPT_TARGET_LINKADDR 2
1137#define ND_RA_FLAG_HOME_AGENT 0x20
1138#define ND_RA_FLAG_MANAGED 0x80
1139#define ND_RA_FLAG_OTHER 0x40
1140#define ND_REDIRECT 137
1141#define ND_ROUTER_ADVERT 134
1142#define ND_ROUTER_SOLICIT 133
1143#define NEW_ENV_VALUE 1
1144#define NEW_ENV_VAR 0
1145#define NGROUPS 32
1146#define NGROUPS_MAX 32
1147#define NL_ARGMAX 9
1148#define NL_CAT_LOCALE 1
1149#define NL_LANGMAX 32
1150#define NL_LOCALE_NAME(cat) _NL_LOCALE_NAME(cat)
1151#define NL_MSGMAX 32767
1152#define NL_NMAX 16
1153#define NL_SETD 1
1154#define NL_SETMAX 255
1155#define NL_TEXTMAX 2048
1156#define NOERROR ns_r_noerror
1157#define NOEXPR 0x50001
1158#define NOFILE 256
1159#define NOGROUP (-1)
1160#define NOP 241
1161#define NOSTR 0x50003
1162#define NOTAUTH ns_r_notauth
1163#define NOTIMP ns_r_notimpl
1164#define NOTZONE ns_r_notzone
1165#define NR_ICMP_TYPES 18
1166#define NR_ICMP_UNREACH 15
1167#define NSLC 18
1168#define NS_ALG_DH 2
1169#define NS_ALG_DSA 3
1170#define NS_ALG_DSS NS_ALG_DSA
1171#define NS_ALG_EXPIRE_ONLY 253
1172#define NS_ALG_MD5RSA 1
1173#define NS_ALG_PRIVATE_OID 254
1174#define NS_CMPRSFLGS 0xc0
1175#define NS_DEFAULTPORT 53
1176#define NS_DSA_MAX_BYTES 405
1177#define NS_DSA_MIN_SIZE 213
1178#define NS_DSA_SIG_SIZE 41
1179#define NS_GET16(s,cp) (void)((s) = ns_get16(((cp)+=2)-2))
1180#define NS_GET32(l,cp) (void)((l) = ns_get32(((cp)+=4)-4))
1181#define NS_HFIXEDSZ 12
1182#define NS_IN6ADDRSZ 16
1183#define NS_INADDRSZ 4
1184#define NS_INT16SZ 2
1185#define NS_INT32SZ 4
1186#define NS_INT8SZ 1
1187#define NS_KEY_EXTENDED_FLAGS 0x1000
1188#define NS_KEY_NAME_ENTITY 0x0200
1189#define NS_KEY_NAME_RESERVED 0x0300
1190#define NS_KEY_NAME_TYPE 0x0300
1191#define NS_KEY_NAME_USER 0x0000
1192#define NS_KEY_NAME_ZONE 0x0100
1193#define NS_KEY_NO_AUTH 0x8000
1194#define NS_KEY_NO_CONF 0x4000
1195#define NS_KEY_PROT_ANY 255
1196#define NS_KEY_PROT_DNSSEC 3
1197#define NS_KEY_PROT_EMAIL 2
1198#define NS_KEY_PROT_IPSEC 4
1199#define NS_KEY_PROT_TLS 1
1200#define NS_KEY_RESERVED10 0x0020
1201#define NS_KEY_RESERVED11 0x0010
1202#define NS_KEY_RESERVED2 0x2000
1203#define NS_KEY_RESERVED4 0x0800
1204#define NS_KEY_RESERVED5 0x0400
1205#define NS_KEY_RESERVED8 0x0080
1206#define NS_KEY_RESERVED9 0x0040
1207#define NS_KEY_RESERVED_BITMASK ( NS_KEY_RESERVED2 | NS_KEY_RESERVED4 | NS_KEY_RESERVED5 | NS_KEY_RESERVED8 | NS_KEY_RESERVED9 | NS_KEY_RESERVED10 | NS_KEY_RESERVED11 )
1208#define NS_KEY_RESERVED_BITMASK2 0xFFFF
1209#define NS_KEY_SIGNATORYMASK 0x000F
1210#define NS_KEY_TYPEMASK 0xC000
1211#define NS_KEY_TYPE_AUTH_CONF 0x0000
1212#define NS_KEY_TYPE_AUTH_ONLY 0x4000
1213#define NS_KEY_TYPE_CONF_ONLY 0x8000
1214#define NS_KEY_TYPE_NO_KEY 0xC000
1215#define NS_MAXCDNAME 255
1216#define NS_MAXDNAME 1025
1217#define NS_MAXLABEL 63
1218#define NS_MAXMSG 65535
1219#define NS_MD5RSA_MAX_BASE64 (((NS_MD5RSA_MAX_BYTES+2)/3)*4)
1220#define NS_MD5RSA_MAX_BITS 4096
1221#define NS_MD5RSA_MAX_BYTES ((NS_MD5RSA_MAX_BITS+7/8)*2+3)
1222#define NS_MD5RSA_MAX_SIZE ((NS_MD5RSA_MAX_BITS+7)/8)
1223#define NS_MD5RSA_MIN_BITS 512
1224#define NS_MD5RSA_MIN_SIZE ((NS_MD5RSA_MIN_BITS+7)/8)
1225#define NS_NOTIFY_OP ns_o_notify
1226#define NS_NXT_BITS 8
1227#define NS_NXT_BIT_CLEAR(n,p) (p[(n)/NS_NXT_BITS] &= ~(0x80>>((n)%NS_NXT_BITS)))
1228#define NS_NXT_BIT_ISSET(n,p) (p[(n)/NS_NXT_BITS] & (0x80>>((n)%NS_NXT_BITS)))
1229#define NS_NXT_BIT_SET(n,p) (p[(n)/NS_NXT_BITS] |= (0x80>>((n)%NS_NXT_BITS)))
1230#define NS_NXT_MAX 127
1231#define NS_OPT_DNSSEC_OK 0x8000U
1232#define NS_OPT_NSID 3
1233#define NS_PACKETSZ 512
1234#define NS_PUT16(s,cp) ns_put16((s), ((cp)+=2)-2)
1235#define NS_PUT32(l,cp) ns_put32((l), ((cp)+=4)-4)
1236#define NS_QFIXEDSZ 4
1237#define NS_RRFIXEDSZ 10
1238#define NS_SIG_ALG 2
1239#define NS_SIG_EXPIR 8
1240#define NS_SIG_FOOT 16
1241#define NS_SIG_LABELS 3
1242#define NS_SIG_OTTL 4
1243#define NS_SIG_SIGNED 12
1244#define NS_SIG_SIGNER 18
1245#define NS_SIG_TYPE 0
1246#define NS_TSIG_ALG_HMAC_MD5 "HMAC-MD5.SIG-ALG.REG.INT"
1247#define NS_TSIG_ERROR_FORMERR -12
1248#define NS_TSIG_ERROR_NO_SPACE -11
1249#define NS_TSIG_ERROR_NO_TSIG -10
1250#define NS_TSIG_FUDGE 300
1251#define NS_TSIG_TCP_COUNT 100
1252#define NS_UPDATE_OP ns_o_update
1253#define NTELOPTS (1+TELOPT_NEW_ENVIRON)
1254#define NULL ((void*)0)
1255#define NXDOMAIN ns_r_nxdomain
1256#define NXRRSET ns_r_nxrrset
1257#define NZERO 20
1258#define OLD_ENV_VALUE 0
1259#define OLD_ENV_VAR 1
1260#define ONCE_FLAG_INIT 0
1261#define O_ACCMODE (O_EXEC | O_RDWR | O_SEARCH)
1262#define O_APPEND __WASI_FDFLAGS_APPEND
1263#define O_CLOEXEC (0)
1264#define O_CREAT (__WASI_OFLAGS_CREAT << 12)
1265#define O_DIRECTORY (__WASI_OFLAGS_DIRECTORY << 12)
1266#define O_DSYNC __WASI_FDFLAGS_DSYNC
1267#define O_EXCL (__WASI_OFLAGS_EXCL << 12)
1268#define O_EXEC (0x02000000)
1269#define O_NOCTTY (0)
1270#define O_NOFOLLOW (0x01000000)
1271#define O_NONBLOCK __WASI_FDFLAGS_NONBLOCK
1272#define O_RDONLY (0x04000000)
1273#define O_RDWR (O_RDONLY | O_WRONLY)
1274#define O_RSYNC __WASI_FDFLAGS_RSYNC
1275#define O_SEARCH (0x08000000)
1276#define O_SYNC __WASI_FDFLAGS_SYNC
1277#define O_TRUNC (__WASI_OFLAGS_TRUNC << 12)
1278#define O_TTY_INIT (0)
1279#define O_WRONLY (0x10000000)
1280#define PACKETSZ NS_PACKETSZ
1281#define PACKET_ADD_MEMBERSHIP 1
1282#define PACKET_AUXDATA 8
1283#define PACKET_BROADCAST 1
1284#define PACKET_COPY_THRESH 7
1285#define PACKET_DROP_MEMBERSHIP 2
1286#define PACKET_FANOUT 18
1287#define PACKET_FANOUT_DATA 22
1288#define PACKET_FASTROUTE 6
1289#define PACKET_HDRLEN 11
1290#define PACKET_HOST 0
1291#define PACKET_IGNORE_OUTGOING 23
1292#define PACKET_LOOPBACK 5
1293#define PACKET_LOSS 14
1294#define PACKET_MR_ALLMULTI 2
1295#define PACKET_MR_MULTICAST 0
1296#define PACKET_MR_PROMISC 1
1297#define PACKET_MR_UNICAST 3
1298#define PACKET_MULTICAST 2
1299#define PACKET_ORIGDEV 9
1300#define PACKET_OTHERHOST 3
1301#define PACKET_OUTGOING 4
1302#define PACKET_QDISC_BYPASS 20
1303#define PACKET_RECV_OUTPUT 3
1304#define PACKET_RESERVE 12
1305#define PACKET_ROLLOVER_STATS 21
1306#define PACKET_RX_RING 5
1307#define PACKET_STATISTICS 6
1308#define PACKET_TIMESTAMP 17
1309#define PACKET_TX_HAS_OFF 19
1310#define PACKET_TX_RING 13
1311#define PACKET_TX_TIMESTAMP 16
1312#define PACKET_VERSION 10
1313#define PACKET_VNET_HDR 15
1314#define PAGESIZE (0x10000)
1315#define PAGE_SIZE PAGESIZE
1316#define PATH_MAX 4096
1317#define PDP_ENDIAN __PDP_ENDIAN
1318#define PM_STR 0x20027
1319#define POLLERR 0x1000
1320#define POLLHUP 0x2000
1321#define POLLIN POLLRDNORM
1322#define POLLNVAL 0x4000
1323#define POLLOUT POLLWRNORM
1324#define POLLRDNORM 0x1
1325#define POLLWRNORM 0x2
1326#define POSIX_CLOSE_RESTART 0
1327#define POSIX_FADV_DONTNEED __WASI_ADVICE_DONTNEED
1328#define POSIX_FADV_NOREUSE __WASI_ADVICE_NOREUSE
1329#define POSIX_FADV_NORMAL __WASI_ADVICE_NORMAL
1330#define POSIX_FADV_RANDOM __WASI_ADVICE_RANDOM
1331#define POSIX_FADV_SEQUENTIAL __WASI_ADVICE_SEQUENTIAL
1332#define POSIX_FADV_WILLNEED __WASI_ADVICE_WILLNEED
1333#define PRELIM 1
1334#define PRIX16 __UINT16_FMTX__
1335#define PRIX32 __UINT32_FMTX__
1336#define PRIX64 __UINT64_FMTX__
1337#define PRIX8 __UINT8_FMTX__
1338#define PRIXFAST16 __UINT_FAST16_FMTX__
1339#define PRIXFAST32 __UINT_FAST32_FMTX__
1340#define PRIXFAST64 __UINT_FAST64_FMTX__
1341#define PRIXFAST8 __UINT_FAST8_FMTX__
1342#define PRIXLEAST16 __UINT_LEAST16_FMTX__
1343#define PRIXLEAST32 __UINT_LEAST32_FMTX__
1344#define PRIXLEAST64 __UINT_LEAST64_FMTX__
1345#define PRIXLEAST8 __UINT_LEAST8_FMTX__
1346#define PRIXMAX __UINTMAX_FMTX__
1347#define PRIXPTR __UINTPTR_FMTX__
1348#define PRId16 __INT16_FMTd__
1349#define PRId32 __INT32_FMTd__
1350#define PRId64 __INT64_FMTd__
1351#define PRId8 __INT8_FMTd__
1352#define PRIdFAST16 __INT_FAST16_FMTd__
1353#define PRIdFAST32 __INT_FAST32_FMTd__
1354#define PRIdFAST64 __INT_FAST64_FMTd__
1355#define PRIdFAST8 __INT_FAST8_FMTd__
1356#define PRIdLEAST16 __INT_LEAST16_FMTd__
1357#define PRIdLEAST32 __INT_LEAST32_FMTd__
1358#define PRIdLEAST64 __INT_LEAST64_FMTd__
1359#define PRIdLEAST8 __INT_LEAST8_FMTd__
1360#define PRIdMAX __INTMAX_FMTd__
1361#define PRIdPTR __INTPTR_FMTd__
1362#define PRIi16 __INT16_FMTi__
1363#define PRIi32 __INT32_FMTi__
1364#define PRIi64 __INT64_FMTi__
1365#define PRIi8 __INT8_FMTi__
1366#define PRIiFAST16 __INT_FAST16_FMTi__
1367#define PRIiFAST32 __INT_FAST32_FMTi__
1368#define PRIiFAST64 __INT_FAST64_FMTi__
1369#define PRIiFAST8 __INT_FAST8_FMTi__
1370#define PRIiLEAST16 __INT_LEAST16_FMTi__
1371#define PRIiLEAST32 __INT_LEAST32_FMTi__
1372#define PRIiLEAST64 __INT_LEAST64_FMTi__
1373#define PRIiLEAST8 __INT_LEAST8_FMTi__
1374#define PRIiMAX __INTMAX_FMTi__
1375#define PRIiPTR __INTPTR_FMTi__
1376#define PRIo16 __UINT16_FMTo__
1377#define PRIo32 __UINT32_FMTo__
1378#define PRIo64 __UINT64_FMTo__
1379#define PRIo8 __UINT8_FMTo__
1380#define PRIoFAST16 __UINT_FAST16_FMTo__
1381#define PRIoFAST32 __UINT_FAST32_FMTo__
1382#define PRIoFAST64 __UINT_FAST64_FMTo__
1383#define PRIoFAST8 __UINT_FAST8_FMTo__
1384#define PRIoLEAST16 __UINT_LEAST16_FMTo__
1385#define PRIoLEAST32 __UINT_LEAST32_FMTo__
1386#define PRIoLEAST64 __UINT_LEAST64_FMTo__
1387#define PRIoLEAST8 __UINT_LEAST8_FMTo__
1388#define PRIoMAX __UINTMAX_FMTo__
1389#define PRIoPTR __UINTPTR_FMTo__
1390#define PRIu16 __UINT16_FMTu__
1391#define PRIu32 __UINT32_FMTu__
1392#define PRIu64 __UINT64_FMTu__
1393#define PRIu8 __UINT8_FMTu__
1394#define PRIuFAST16 __UINT_FAST16_FMTu__
1395#define PRIuFAST32 __UINT_FAST32_FMTu__
1396#define PRIuFAST64 __UINT_FAST64_FMTu__
1397#define PRIuFAST8 __UINT_FAST8_FMTu__
1398#define PRIuLEAST16 __UINT_LEAST16_FMTu__
1399#define PRIuLEAST32 __UINT_LEAST32_FMTu__
1400#define PRIuLEAST64 __UINT_LEAST64_FMTu__
1401#define PRIuLEAST8 __UINT_LEAST8_FMTu__
1402#define PRIuMAX __UINTMAX_FMTu__
1403#define PRIuPTR __UINTPTR_FMTu__
1404#define PRIx16 __UINT16_FMTx__
1405#define PRIx32 __UINT32_FMTx__
1406#define PRIx64 __UINT64_FMTx__
1407#define PRIx8 __UINT8_FMTx__
1408#define PRIxFAST16 __UINT_FAST16_FMTx__
1409#define PRIxFAST32 __UINT_FAST32_FMTx__
1410#define PRIxFAST64 __UINT_FAST64_FMTx__
1411#define PRIxFAST8 __UINT_FAST8_FMTx__
1412#define PRIxLEAST16 __UINT_LEAST16_FMTx__
1413#define PRIxLEAST32 __UINT_LEAST32_FMTx__
1414#define PRIxLEAST64 __UINT_LEAST64_FMTx__
1415#define PRIxLEAST8 __UINT_LEAST8_FMTx__
1416#define PRIxMAX __UINTMAX_FMTx__
1417#define PRIxPTR __UINTPTR_FMTx__
1418#define PTRBITS (sizeof(char *) * 8)
1419#define PTRDIFF_MAX INT32_MAX
1420#define PTRDIFF_MIN INT32_MIN
1421#define PUTLONG NS_PUT32
1422#define PUTSHORT NS_PUT16
1423#define QFIXEDSZ NS_QFIXEDSZ
1424#define QUERY ns_o_query
1425#define RADIXCHAR 0x10000
1426#define RAND_MAX (0x7fffffff)
1427#define REC_EOF '\002'
1428#define REC_EOR '\001'
1429#define REC_ESC '\377'
1430#define REFUSED ns_r_refused
1431#define REGTYPE '0'
1432#define REG_BADBR 10
1433#define REG_BADPAT 2
1434#define REG_BADRPT 13
1435#define REG_EBRACE 9
1436#define REG_EBRACK 7
1437#define REG_ECOLLATE 3
1438#define REG_ECTYPE 4
1439#define REG_EESCAPE 5
1440#define REG_ENOSYS -1
1441#define REG_EPAREN 8
1442#define REG_ERANGE 11
1443#define REG_ESPACE 12
1444#define REG_ESUBREG 6
1445#define REG_EXTENDED 1
1446#define REG_ICASE 2
1447#define REG_NEWLINE 4
1448#define REG_NOMATCH 1
1449#define REG_NOSUB 8
1450#define REG_NOTBOL 1
1451#define REG_NOTEOL 2
1452#define REG_OK 0
1453#define RE_DUP_MAX 255
1454#define RMSGD 0x0001
1455#define RMSGN 0x0002
1456#define RNORM 0x0000
1457#define RPM_PCO_ADD 1
1458#define RPM_PCO_CHANGE 2
1459#define RPM_PCO_SETGLOBAL 3
1460#define RPROTDAT 0x0004
1461#define RPROTDIS 0x0008
1462#define RPROTMASK 0x001C
1463#define RPROTNORM 0x0010
1464#define RRFIXEDSZ NS_RRFIXEDSZ
1465#define RRQ 01
1466#define RS_HIPRI 0x01
1467#define RUSAGE_CHILDREN 2
1468#define RUSAGE_SELF 1
1469#define R_OK (4)
1470#define SARMAG 8
1471#define SB 250
1472#define SCHAR_MAX 127
1473#define SCHAR_MIN (-128)
1474#define SCNd16 __INT16_FMTd__
1475#define SCNd32 __INT32_FMTd__
1476#define SCNd64 __INT64_FMTd__
1477#define SCNd8 __INT8_FMTd__
1478#define SCNdFAST16 __INT_FAST16_FMTd__
1479#define SCNdFAST32 __INT_FAST32_FMTd__
1480#define SCNdFAST64 __INT_FAST64_FMTd__
1481#define SCNdFAST8 __INT_FAST8_FMTd__
1482#define SCNdLEAST16 __INT_LEAST16_FMTd__
1483#define SCNdLEAST32 __INT_LEAST32_FMTd__
1484#define SCNdLEAST64 __INT_LEAST64_FMTd__
1485#define SCNdLEAST8 __INT_LEAST8_FMTd__
1486#define SCNdMAX __INTMAX_FMTd__
1487#define SCNdPTR __INTPTR_FMTd__
1488#define SCNi16 __INT16_FMTi__
1489#define SCNi32 __INT32_FMTi__
1490#define SCNi64 __INT64_FMTi__
1491#define SCNi8 __INT8_FMTi__
1492#define SCNiFAST16 __INT_FAST16_FMTi__
1493#define SCNiFAST32 __INT_FAST32_FMTi__
1494#define SCNiFAST64 __INT_FAST64_FMTi__
1495#define SCNiFAST8 __INT_FAST8_FMTi__
1496#define SCNiLEAST16 __INT_LEAST16_FMTi__
1497#define SCNiLEAST32 __INT_LEAST32_FMTi__
1498#define SCNiLEAST64 __INT_LEAST64_FMTi__
1499#define SCNiLEAST8 __INT_LEAST8_FMTi__
1500#define SCNiMAX __INTMAX_FMTi__
1501#define SCNiPTR __INTPTR_FMTi__
1502#define SCNo16 __UINT16_FMTo__
1503#define SCNo32 __UINT32_FMTo__
1504#define SCNo64 __UINT64_FMTo__
1505#define SCNo8 __UINT8_FMTo__
1506#define SCNoFAST16 __UINT_FAST16_FMTo__
1507#define SCNoFAST32 __UINT_FAST32_FMTo__
1508#define SCNoFAST64 __UINT_FAST64_FMTo__
1509#define SCNoFAST8 __UINT_FAST8_FMTo__
1510#define SCNoLEAST16 __UINT_LEAST16_FMTo__
1511#define SCNoLEAST32 __UINT_LEAST32_FMTo__
1512#define SCNoLEAST64 __UINT_LEAST64_FMTo__
1513#define SCNoLEAST8 __UINT_LEAST8_FMTo__
1514#define SCNoMAX __UINTMAX_FMTo__
1515#define SCNoPTR __UINTPTR_FMTo__
1516#define SCNu16 __UINT16_FMTu__
1517#define SCNu32 __UINT32_FMTu__
1518#define SCNu64 __UINT64_FMTu__
1519#define SCNu8 __UINT8_FMTu__
1520#define SCNuFAST16 __UINT_FAST16_FMTu__
1521#define SCNuFAST32 __UINT_FAST32_FMTu__
1522#define SCNuFAST64 __UINT_FAST64_FMTu__
1523#define SCNuFAST8 __UINT_FAST8_FMTu__
1524#define SCNuLEAST16 __UINT_LEAST16_FMTu__
1525#define SCNuLEAST32 __UINT_LEAST32_FMTu__
1526#define SCNuLEAST64 __UINT_LEAST64_FMTu__
1527#define SCNuLEAST8 __UINT_LEAST8_FMTu__
1528#define SCNuMAX __UINTMAX_FMTu__
1529#define SCNuPTR __UINTPTR_FMTu__
1530#define SCNx16 __UINT16_FMTx__
1531#define SCNx32 __UINT32_FMTx__
1532#define SCNx64 __UINT64_FMTx__
1533#define SCNx8 __UINT8_FMTx__
1534#define SCNxFAST16 __UINT_FAST16_FMTx__
1535#define SCNxFAST32 __UINT_FAST32_FMTx__
1536#define SCNxFAST64 __UINT_FAST64_FMTx__
1537#define SCNxFAST8 __UINT_FAST8_FMTx__
1538#define SCNxLEAST16 __UINT_LEAST16_FMTx__
1539#define SCNxLEAST32 __UINT_LEAST32_FMTx__
1540#define SCNxLEAST64 __UINT_LEAST64_FMTx__
1541#define SCNxLEAST8 __UINT_LEAST8_FMTx__
1542#define SCNxMAX __UINTMAX_FMTx__
1543#define SCNxPTR __UINTPTR_FMTx__
1544#define SE 240
1545#define SEEK_CUR __WASI_WHENCE_CUR
1546#define SEEK_END __WASI_WHENCE_END
1547#define SEEK_SET __WASI_WHENCE_SET
1548#define SEGSIZE 512
1549#define SEM_FAILED ((sem_t *)0)
1550#define SERVFAIL ns_r_servfail
1551#define SHORTBITS (sizeof(short) * 8)
1552#define SHRT_MAX 0x7fff
1553#define SHRT_MIN (-1-0x7fff)
1554#define SHUT_RD __WASI_SDFLAGS_RD
1555#define SHUT_RDWR (SHUT_RD | SHUT_WR)
1556#define SHUT_WR __WASI_SDFLAGS_WR
1557#define SIG_ATOMIC_MAX INT32_MAX
1558#define SIG_ATOMIC_MIN INT32_MIN
1559#define SIZE_MAX UINT32_MAX
1560#define SI_LOAD_SHIFT 16
1561#define SLC_ABORT 7
1562#define SLC_ACK 0x80
1563#define SLC_AO 4
1564#define SLC_AYT 5
1565#define SLC_BRK 2
1566#define SLC_CANTCHANGE 1
1567#define SLC_DEFAULT 3
1568#define SLC_EC 10
1569#define SLC_EL 11
1570#define SLC_EOF 8
1571#define SLC_EOR 6
1572#define SLC_EW 12
1573#define SLC_FLAGS 1
1574#define SLC_FLUSHIN 0x40
1575#define SLC_FLUSHOUT 0x20
1576#define SLC_FORW1 17
1577#define SLC_FORW2 18
1578#define SLC_FUNC 0
1579#define SLC_IP 3
1580#define SLC_LEVELBITS 0x03
1581#define SLC_LNEXT 14
1582#define SLC_NAME(x) slc_names[x]
1583#define SLC_NAMELIST "0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", "ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", "LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
1584#define SLC_NAMES SLC_NAMELIST
1585#define SLC_NAME_OK(x) ((unsigned int)(x) <= NSLC)
1586#define SLC_NOSUPPORT 0
1587#define SLC_RP 13
1588#define SLC_SUSP 9
1589#define SLC_SYNCH 1
1590#define SLC_VALUE 2
1591#define SLC_VARIABLE 2
1592#define SLC_XOFF 16
1593#define SLC_XON 15
1594#define SNDPIPE 0x002
1595#define SNDZERO 0x001
1596#define SOCK_CLOEXEC (0x00002000)
1597#define SOCK_DGRAM __WASI_FILETYPE_SOCKET_DGRAM
1598#define SOCK_NONBLOCK (0x00004000)
1599#define SOCK_STREAM __WASI_FILETYPE_SOCKET_STREAM
1600#define SOL_SOCKET 0x7fffffff
1601#define SOL_TCP 6
1602#define SOL_UDP 17
1603#define SO_TYPE 3
1604#define SSIZE_MAX LONG_MAX
1605#define STATUS ns_o_status
1606#define STA_CLK 0x8000
1607#define STA_CLOCKERR 0x1000
1608#define STA_DEL 0x0020
1609#define STA_FLL 0x0008
1610#define STA_FREQHOLD 0x0080
1611#define STA_INS 0x0010
1612#define STA_MODE 0x4000
1613#define STA_NANO 0x2000
1614#define STA_PLL 0x0001
1615#define STA_PPSERROR 0x0800
1616#define STA_PPSFREQ 0x0002
1617#define STA_PPSJITTER 0x0200
1618#define STA_PPSSIGNAL 0x0100
1619#define STA_PPSTIME 0x0004
1620#define STA_PPSWANDER 0x0400
1621#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | STA_PPSERROR | STA_CLOCKERR | STA_NANO | STA_MODE | STA_CLK)
1622#define STA_UNSYNC 0x0040
1623#define STDERR_FILENO 2
1624#define STDIN_FILENO 0
1625#define STDOUT_FILENO 1
1626#define STRU_F 1
1627#define STRU_P 3
1628#define STRU_R 2
1629#define SUN_LEN(s) (2+strlen((s)->sun_path))
1630#define SUSP 237
1631#define SYMLOOP_MAX 40
1632#define SYMTYPE '2'
1633#define SYNCH 242
1634#define S_ADDT ns_s_ar
1635#define S_BANDURG 0x0200
1636#define S_ERROR 0x0010
1637#define S_HANGUP 0x0020
1638#define S_HIPRI 0x0002
1639#define S_IEXEC S_IXUSR
1640#define S_IFBLK (0x6000)
1641#define S_IFCHR (0x2000)
1642#define S_IFDIR (0x4000)
1643#define S_IFIFO (0xc000)
1644#define S_IFLNK (0xa000)
1645#define S_IFMT (S_IFBLK | S_IFCHR | S_IFDIR | S_IFIFO | S_IFLNK | S_IFREG | S_IFSOCK)
1646#define S_IFREG (0x8000)
1647#define S_IFSOCK (0xc000)
1648#define S_INPUT 0x0001
1649#define S_IREAD S_IRUSR
1650#define S_IRGRP (0x20)
1651#define S_IROTH (0x4)
1652#define S_IRUSR (0x100)
1653#define S_IRWXG (S_IXGRP | S_IWGRP | S_IRGRP)
1654#define S_IRWXO (S_IXOTH | S_IWOTH | S_IROTH)
1655#define S_IRWXU (S_IXUSR | S_IWUSR | S_IRUSR)
1656#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK)
1657#define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR)
1658#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
1659#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO)
1660#define S_ISGID (0x400)
1661#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK)
1662#define S_ISREG(m) (((m)&S_IFMT) == S_IFREG)
1663#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK)
1664#define S_ISUID (0x800)
1665#define S_ISVTX (0x200)
1666#define S_IWGRP (0x10)
1667#define S_IWOTH (0x2)
1668#define S_IWRITE S_IWUSR
1669#define S_IWUSR (0x80)
1670#define S_IXGRP (0x8)
1671#define S_IXOTH (0x1)
1672#define S_IXUSR (0x40)
1673#define S_MSG 0x0008
1674#define S_OUTPUT 0x0004
1675#define S_PREREQ ns_s_pr
1676#define S_RDBAND 0x0080
1677#define S_RDNORM 0x0040
1678#define S_UPDATE ns_s_ud
1679#define S_WRBAND 0x0100
1680#define S_WRNORM S_OUTPUT
1681#define S_ZONE ns_s_zn
1682#define TCPI_OPT_ECN 8
1683#define TCPI_OPT_SACK 2
1684#define TCPI_OPT_TIMESTAMPS 1
1685#define TCPI_OPT_WSCALE 4
1686#define TCPOLEN_MAXSEG 4
1687#define TCPOLEN_SACK_PERMITTED 2
1688#define TCPOLEN_TIMESTAMP 10
1689#define TCPOLEN_WINDOW 3
1690#define TCPOPT_EOL 0
1691#define TCPOPT_MAXSEG 2
1692#define TCPOPT_NOP 1
1693#define TCPOPT_SACK 5
1694#define TCPOPT_SACK_PERMITTED 4
1695#define TCPOPT_TIMESTAMP 8
1696#define TCPOPT_WINDOW 3
1697#define TCP_CA_CWR 2
1698#define TCP_CA_Disorder 1
1699#define TCP_CA_Loss 4
1700#define TCP_CA_Open 0
1701#define TCP_CA_Recovery 3
1702#define TCP_CC_INFO 26
1703#define TCP_CLOSE 7
1704#define TCP_CLOSE_WAIT 8
1705#define TCP_CLOSING 11
1706#define TCP_CM_INQ TCP_INQ
1707#define TCP_CONGESTION 13
1708#define TCP_CORK 3
1709#define TCP_DEFER_ACCEPT 9
1710#define TCP_ENCAP_ESPINTCP 7
1711#define TCP_ESTABLISHED 1
1712#define TCP_FASTOPEN 23
1713#define TCP_FASTOPEN_CONNECT 30
1714#define TCP_FASTOPEN_KEY 33
1715#define TCP_FASTOPEN_NO_COOKIE 34
1716#define TCP_FIN_WAIT1 4
1717#define TCP_FIN_WAIT2 5
1718#define TCP_INFO 11
1719#define TCP_INQ 36
1720#define TCP_KEEPCNT 6
1721#define TCP_KEEPIDLE 4
1722#define TCP_KEEPINTVL 5
1723#define TCP_LAST_ACK 9
1724#define TCP_LINGER2 8
1725#define TCP_LISTEN 10
1726#define TCP_MAXSEG 2
1727#define TCP_MD5SIG 14
1728#define TCP_MD5SIG_EXT 32
1729#define TCP_MD5SIG_FLAG_IFINDEX 0x2
1730#define TCP_MD5SIG_FLAG_PREFIX 0x1
1731#define TCP_MD5SIG_MAXKEYLEN 80
1732#define TCP_NODELAY 1
1733#define TCP_NOTSENT_LOWAT 25
1734#define TCP_QUEUE_SEQ 21
1735#define TCP_QUICKACK 12
1736#define TCP_REPAIR 19
1737#define TCP_REPAIR_OFF 0
1738#define TCP_REPAIR_OFF_NO_WP -1
1739#define TCP_REPAIR_ON 1
1740#define TCP_REPAIR_OPTIONS 22
1741#define TCP_REPAIR_QUEUE 20
1742#define TCP_REPAIR_WINDOW 29
1743#define TCP_SAVED_SYN 28
1744#define TCP_SAVE_SYN 27
1745#define TCP_SYNCNT 7
1746#define TCP_SYN_RECV 3
1747#define TCP_SYN_SENT 2
1748#define TCP_THIN_DUPACK 17
1749#define TCP_THIN_LINEAR_TIMEOUTS 16
1750#define TCP_TIMESTAMP 24
1751#define TCP_TIME_WAIT 6
1752#define TCP_TX_DELAY 37
1753#define TCP_ULP 31
1754#define TCP_USER_TIMEOUT 18
1755#define TCP_WINDOW_CLAMP 10
1756#define TCP_ZEROCOPY_RECEIVE 35
1757#define TELCMD(x) telcmds[(x)-TELCMD_FIRST]
1758#define TELCMD_FIRST xEOF
1759#define TELCMD_LAST IAC
1760#define TELCMD_OK(x) ((unsigned int)(x) <= TELCMD_LAST && (unsigned int)(x) >= TELCMD_FIRST)
1761#define TELOPT_3270REGIME 29
1762#define TELOPT_AUTHENTICATION 37
1763#define TELOPT_BINARY 0
1764#define TELOPT_BM 19
1765#define TELOPT_DET 20
1766#define TELOPT_ECHO 1
1767#define TELOPT_ENCRYPT 38
1768#define TELOPT_EOR 25
1769#define TELOPT_EXOPL 255
1770#define TELOPT_LFLOW 33
1771#define TELOPT_LINEMODE 34
1772#define TELOPT_LOGOUT 18
1773#define TELOPT_NAMS 4
1774#define TELOPT_NAOCRD 10
1775#define TELOPT_NAOFFD 13
1776#define TELOPT_NAOHTD 12
1777#define TELOPT_NAOHTS 11
1778#define TELOPT_NAOL 8
1779#define TELOPT_NAOLFD 16
1780#define TELOPT_NAOP 9
1781#define TELOPT_NAOVTD 15
1782#define TELOPT_NAOVTS 14
1783#define TELOPT_NAWS 31
1784#define TELOPT_NEW_ENVIRON 39
1785#define TELOPT_OLD_ENVIRON 36
1786#define TELOPT_OUTMRK 27
1787#define TELOPT_RCP 2
1788#define TELOPT_RCTE 7
1789#define TELOPT_SGA 3
1790#define TELOPT_SNDLOC 23
1791#define TELOPT_STATUS 5
1792#define TELOPT_SUPDUP 21
1793#define TELOPT_SUPDUPOUTPUT 22
1794#define TELOPT_TM 6
1795#define TELOPT_TSPEED 32
1796#define TELOPT_TTYLOC 28
1797#define TELOPT_TTYPE 24
1798#define TELOPT_TUID 26
1799#define TELOPT_X3PAD 30
1800#define TELOPT_XASCII 17
1801#define TELOPT_XDISPLOC 35
1802#define TELQUAL_INFO 2
1803#define TELQUAL_IS 0
1804#define TELQUAL_NAME 3
1805#define TELQUAL_REPLY 2
1806#define TELQUAL_SEND 1
1807#define TGEXEC 00010
1808#define TGREAD 00040
1809#define TGWRITE 00020
1810#define THOUSEP 0x10001
1811#define TH_ACK 0x10
1812#define TH_FIN 0x01
1813#define TH_PUSH 0x08
1814#define TH_RST 0x04
1815#define TH_SYN 0x02
1816#define TH_URG 0x20
1817#define TIMER_ABSTIME __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME
1818#define TIMESPEC_TO_TIMEVAL(tv,ts) ( (tv)->tv_sec = (ts)->tv_sec, (tv)->tv_usec = (ts)->tv_nsec / 1000, (void)0 )
1819#define TIMEVAL_TO_TIMESPEC(tv,ts) ( (ts)->tv_sec = (tv)->tv_sec, (ts)->tv_nsec = (tv)->tv_usec * 1000, (void)0 )
1820#define TIME_BAD TIME_ERROR
1821#define TIME_DEL 2
1822#define TIME_ERROR 5
1823#define TIME_INS 1
1824#define TIME_OK 0
1825#define TIME_OOP 3
1826#define TIME_UTC 1
1827#define TIME_WAIT 4
1828#define TMAGIC "ustar"
1829#define TMAGLEN 6
1830#define TOEXEC 00001
1831#define TOREAD 00004
1832#define TOWRITE 00002
1833#define TRANSIENT 4
1834#define TSGID 02000
1835#define TSS_DTOR_ITERATIONS 4
1836#define TSUID 04000
1837#define TSVTX 01000
1838#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
1839#define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY)
1840#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
1841#define TTYDEF_OFLAG (OPOST | ONLCR | XTABS)
1842#define TTYDEF_SPEED (B9600)
1843#define TTY_NAME_MAX 32
1844#define TUEXEC 00100
1845#define TUREAD 00400
1846#define TUWRITE 00200
1847#define TVERSION "00"
1848#define TVERSLEN 2
1849#define TYPE_A 1
1850#define TYPE_E 2
1851#define TYPE_I 3
1852#define TYPE_L 4
1853#define TZNAME_MAX 6
1854#define T_A ns_t_a
1855#define T_A6 ns_t_a6
1856#define T_AAAA ns_t_aaaa
1857#define T_AFSDB ns_t_afsdb
1858#define T_ANY ns_t_any
1859#define T_ATMA ns_t_atma
1860#define T_AXFR ns_t_axfr
1861#define T_CNAME ns_t_cname
1862#define T_DNAME ns_t_dname
1863#define T_EID ns_t_eid
1864#define T_FMT 0x2002A
1865#define T_FMT_AMPM 0x2002B
1866#define T_GPOS ns_t_gpos
1867#define T_HINFO ns_t_hinfo
1868#define T_ISDN ns_t_isdn
1869#define T_IXFR ns_t_ixfr
1870#define T_KEY ns_t_key
1871#define T_LOC ns_t_loc
1872#define T_MAILA ns_t_maila
1873#define T_MAILB ns_t_mailb
1874#define T_MB ns_t_mb
1875#define T_MD ns_t_md
1876#define T_MF ns_t_mf
1877#define T_MG ns_t_mg
1878#define T_MINFO ns_t_minfo
1879#define T_MR ns_t_mr
1880#define T_MX ns_t_mx
1881#define T_NAPTR ns_t_naptr
1882#define T_NIMLOC ns_t_nimloc
1883#define T_NS ns_t_ns
1884#define T_NSAP ns_t_nsap
1885#define T_NSAP_PTR ns_t_nsap_ptr
1886#define T_NULL ns_t_null
1887#define T_NXT ns_t_nxt
1888#define T_PTR ns_t_ptr
1889#define T_PX ns_t_px
1890#define T_RP ns_t_rp
1891#define T_RT ns_t_rt
1892#define T_SIG ns_t_sig
1893#define T_SOA ns_t_soa
1894#define T_SRV ns_t_srv
1895#define T_TSIG ns_t_tsig
1896#define T_TXT ns_t_txt
1897#define T_WKS ns_t_wks
1898#define T_X25 ns_t_x25
1899#define UCHAR_MAX 255
1900#define UDP_CORK 1
1901#define UDP_ENCAP 100
1902#define UDP_ENCAP_ESPINUDP 2
1903#define UDP_ENCAP_ESPINUDP_NON_IKE 1
1904#define UDP_ENCAP_GTP0 4
1905#define UDP_ENCAP_GTP1U 5
1906#define UDP_ENCAP_L2TPINUDP 3
1907#define UDP_ENCAP_RXRPC 6
1908#define UDP_GRO 104
1909#define UDP_NO_CHECK6_RX 102
1910#define UDP_NO_CHECK6_TX 101
1911#define UDP_SEGMENT 103
1912#define UINT16_C(c) c
1913#define UINT16_MAX (0xffff)
1914#define UINT32_C(c) c ## U
1915#define UINT32_MAX (0xffffffffu)
1916#define UINT64_C(c) c ## ULL
1917#define UINT64_MAX (0xffffffffffffffffu)
1918#define UINT8_C(c) c
1919#define UINT8_MAX (0xff)
1920#define UINTMAX_C(c) c ## ULL
1921#define UINTMAX_MAX UINT64_MAX
1922#define UINTPTR_MAX UINT32_MAX
1923#define UINT_FAST16_MAX UINT16_MAX
1924#define UINT_FAST32_MAX UINT32_MAX
1925#define UINT_FAST64_MAX UINT64_MAX
1926#define UINT_FAST8_MAX UINT8_MAX
1927#define UINT_LEAST16_MAX UINT16_MAX
1928#define UINT_LEAST32_MAX UINT32_MAX
1929#define UINT_LEAST64_MAX UINT64_MAX
1930#define UINT_LEAST8_MAX UINT8_MAX
1931#define UINT_MAX 0xffffffffU
1932#define UIO_MAXIOV 1024
1933#define ULLONG_MAX (2ULL*LLONG_MAX+1)
1934#define ULONG_MAX (2UL*LONG_MAX+1)
1935#define USHRT_MAX 0xffff
1936#define UTIME_NOW (-1)
1937#define UTIME_OMIT (-2)
1938#define WCHAR_MAX (0x7fffffff+L'\0')
1939#define WCHAR_MIN (-1-0x7fffffff+L'\0')
1940#define WEOF 0xffffffffU
1941#define WILL 251
1942#define WINT_MAX UINT32_MAX
1943#define WINT_MIN 0U
1944#define WONT 252
1945#define WORD_BIT 32
1946#define WRQ 02
1947#define W_OK (2)
1948#define X_OK (1)
1949#define YESEXPR 0x50000
1950#define YESSTR 0x50002
1951#define YXDOMAIN ns_r_yxdomain
1952#define YXRRSET ns_r_yxrrset
1953#define _ALLOCA_H
1954#define _ALL_SOURCE 1
1955#define _ARPA_FTP_H
1956#define _ARPA_INET_H
1957#define _ARPA_NAMESER_H
1958#define _ARPA_TELNET_H
1959#define _ARPA_TFTP_H
1960#define _AR_H
1961#define _BYTESWAP_H
1962#define _COMPLEX_H
1963#define _CPIO_H
1964#define _CRYPT_H
1965#define _CS_GNU_LIBC_VERSION 2
1966#define _CS_GNU_LIBPTHREAD_VERSION 3
1967#define _CS_PATH 0
1968#define _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS 4
1969#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 1116
1970#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 1117
1971#define _CS_POSIX_V6_ILP32_OFF32_LIBS 1118
1972#define _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS 1119
1973#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 1120
1974#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 1121
1975#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 1122
1976#define _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS 1123
1977#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 1124
1978#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 1125
1979#define _CS_POSIX_V6_LP64_OFF64_LIBS 1126
1980#define _CS_POSIX_V6_LP64_OFF64_LINTFLAGS 1127
1981#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 1128
1982#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 1129
1983#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 1130
1984#define _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS 1131
1985#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 1
1986#define _CS_POSIX_V7_ILP32_OFF32_CFLAGS 1132
1987#define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS 1133
1988#define _CS_POSIX_V7_ILP32_OFF32_LIBS 1134
1989#define _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS 1135
1990#define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS 1136
1991#define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS 1137
1992#define _CS_POSIX_V7_ILP32_OFFBIG_LIBS 1138
1993#define _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS 1139
1994#define _CS_POSIX_V7_LP64_OFF64_CFLAGS 1140
1995#define _CS_POSIX_V7_LP64_OFF64_LDFLAGS 1141
1996#define _CS_POSIX_V7_LP64_OFF64_LIBS 1142
1997#define _CS_POSIX_V7_LP64_OFF64_LINTFLAGS 1143
1998#define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS 1144
1999#define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS 1145
2000#define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS 1146
2001#define _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS 1147
2002#define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS 5
2003#define _CS_V6_ENV 1148
2004#define _CS_V7_ENV 1149
2005#define _CTYPE_H
2006#define _Complex_I (0.0f+1.0fi)
2007#define _DIRENT_H
2008#define _DIRENT_HAVE_D_TYPE
2009#define _ENDIAN_H
2010#define _ERRNO_H
2011#define _ERR_H
2012#define _FCNTL_H
2013#define _FEATURES_H
2014#define _FENV_H
2015#define _FLOAT_H
2016#define _FMTMSG_H
2017#define _FNMATCH_H
2018#define _FTW_H
2019#define _GETOPT_H
2020#define _GLOB_H
2021#define _GNU_SOURCE 1
2022#define _ICONV_H
2023#define _IFADDRS_H
2024#define _ILP32 1
2025#define _INTTYPES_H
2026#define _IOFBF 0
2027#define _IOLBF 1
2028#define _IONBF 2
2029#define _ISO646_H
2030#define _LANGINFO_H
2031#define _LIBGEN_H
2032#define _LIMITS_H
2033#define _LOCALE_H
2034#define _MALLOC_H
2035#define _MATH_H
2036#define _MONETARY_H
2037#define _MQUEUE_H
2038#define _NETINET_ICMP6_H
2039#define _NETINET_IGMP_H
2040#define _NETINET_IN_H
2041#define _NETINET_IN_SYSTM_H
2042#define _NETINET_IP6_H
2043#define _NETINET_IP_H
2044#define _NETINET_IP_ICMP_H
2045#define _NETINET_TCP_H
2046#define _NETINET_UDP_H
2047#define _NETPACKET_PACKET_H
2048#define _NL_LOCALE_NAME(cat) (((cat)<<16) | 0xffff)
2049#define _NL_TYPES_H
2050#define _PC_2_SYMLINKS 20
2051#define _PC_ALLOC_SIZE_MIN 18
2052#define _PC_ASYNC_IO 10
2053#define _PC_CHOWN_RESTRICTED 6
2054#define _PC_FILESIZEBITS 13
2055#define _PC_LINK_MAX 0
2056#define _PC_MAX_CANON 1
2057#define _PC_MAX_INPUT 2
2058#define _PC_NAME_MAX 3
2059#define _PC_NO_TRUNC 7
2060#define _PC_PATH_MAX 4
2061#define _PC_PIPE_BUF 5
2062#define _PC_PRIO_IO 11
2063#define _PC_REC_INCR_XFER_SIZE 14
2064#define _PC_REC_MAX_XFER_SIZE 15
2065#define _PC_REC_MIN_XFER_SIZE 16
2066#define _PC_REC_XFER_ALIGN 17
2067#define _PC_SOCK_MAXBUF 12
2068#define _PC_SYMLINK_MAX 19
2069#define _PC_SYNC_IO 9
2070#define _PC_VDISABLE 8
2071#define _POLL_H
2072#define _POSIX2_BC_BASE_MAX 99
2073#define _POSIX2_BC_DIM_MAX 2048
2074#define _POSIX2_BC_SCALE_MAX 99
2075#define _POSIX2_BC_STRING_MAX 1000
2076#define _POSIX2_CHARCLASS_NAME_MAX 14
2077#define _POSIX2_COLL_WEIGHTS_MAX 2
2078#define _POSIX2_C_BIND _POSIX_VERSION
2079#define _POSIX2_EXPR_NEST_MAX 32
2080#define _POSIX2_LINE_MAX 2048
2081#define _POSIX2_RE_DUP_MAX 255
2082#define _POSIX2_VERSION _POSIX_VERSION
2083#define _POSIX_ADVISORY_INFO _POSIX_VERSION
2084#define _POSIX_AIO_LISTIO_MAX 2
2085#define _POSIX_AIO_MAX 1
2086#define _POSIX_ARG_MAX 4096
2087#define _POSIX_BARRIERS _POSIX_VERSION
2088#define _POSIX_CHILD_MAX 25
2089#define _POSIX_CHOWN_RESTRICTED 1
2090#define _POSIX_CLOCKRES_MIN 20000000
2091#define _POSIX_CLOCK_SELECTION _POSIX_VERSION
2092#define _POSIX_CPUTIME _POSIX_VERSION
2093#define _POSIX_DELAYTIMER_MAX 32
2094#define _POSIX_FSYNC _POSIX_VERSION
2095#define _POSIX_HOST_NAME_MAX 255
2096#define _POSIX_IPV6 _POSIX_VERSION
2097#define _POSIX_LINK_MAX 8
2098#define _POSIX_LOGIN_NAME_MAX 9
2099#define _POSIX_MAX_CANON 255
2100#define _POSIX_MAX_INPUT 255
2101#define _POSIX_MONOTONIC_CLOCK _POSIX_VERSION
2102#define _POSIX_MQ_OPEN_MAX 8
2103#define _POSIX_MQ_PRIO_MAX 32
2104#define _POSIX_NAME_MAX 14
2105#define _POSIX_NGROUPS_MAX 8
2106#define _POSIX_NO_TRUNC 1
2107#define _POSIX_OPEN_MAX 20
2108#define _POSIX_PATH_MAX 256
2109#define _POSIX_PIPE_BUF 512
2110#define _POSIX_READER_WRITER_LOCKS _POSIX_VERSION
2111#define _POSIX_REALTIME_SIGNALS _POSIX_VERSION
2112#define _POSIX_REGEXP 1
2113#define _POSIX_RE_DUP_MAX 255
2114#define _POSIX_RTSIG_MAX 8
2115#define _POSIX_SEM_NSEMS_MAX 256
2116#define _POSIX_SEM_VALUE_MAX 32767
2117#define _POSIX_SIGQUEUE_MAX 32
2118#define _POSIX_SPIN_LOCKS _POSIX_VERSION
2119#define _POSIX_SSIZE_MAX 32767
2120#define _POSIX_SS_REPL_MAX 4
2121#define _POSIX_STREAM_MAX 8
2122#define _POSIX_SYMLINK_MAX 255
2123#define _POSIX_SYMLOOP_MAX 8
2124#define _POSIX_THREADS _POSIX_VERSION
2125#define _POSIX_THREAD_ATTR_STACKADDR _POSIX_VERSION
2126#define _POSIX_THREAD_ATTR_STACKSIZE _POSIX_VERSION
2127#define _POSIX_THREAD_CPUTIME _POSIX_VERSION
2128#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
2129#define _POSIX_THREAD_KEYS_MAX 128
2130#define _POSIX_THREAD_PRIORITY_SCHEDULING _POSIX_VERSION
2131#define _POSIX_THREAD_PROCESS_SHARED _POSIX_VERSION
2132#define _POSIX_THREAD_SAFE_FUNCTIONS _POSIX_VERSION
2133#define _POSIX_THREAD_THREADS_MAX 64
2134#define _POSIX_TIMEOUTS _POSIX_VERSION
2135#define _POSIX_TIMERS _POSIX_VERSION
2136#define _POSIX_TIMER_MAX 32
2137#define _POSIX_TRACE_EVENT_NAME_MAX 30
2138#define _POSIX_TRACE_NAME_MAX 8
2139#define _POSIX_TRACE_SYS_MAX 8
2140#define _POSIX_TRACE_USER_EVENT_MAX 32
2141#define _POSIX_TTY_NAME_MAX 9
2142#define _POSIX_TZNAME_MAX 6
2143#define _POSIX_V6_ILP32_OFFBIG (1)
2144#define _POSIX_V7_ILP32_OFFBIG (1)
2145#define _POSIX_VDISABLE 0
2146#define _POSIX_VERSION 200809L
2147#define _PTRDIFF_T
2148#define _REGEX_H
2149#define _SCHED_H
2150#define _SC_2_CHAR_TERM 95
2151#define _SC_2_C_BIND 47
2152#define _SC_2_C_DEV 48
2153#define _SC_2_FORT_DEV 49
2154#define _SC_2_FORT_RUN 50
2155#define _SC_2_LOCALEDEF 52
2156#define _SC_2_PBS 168
2157#define _SC_2_PBS_ACCOUNTING 169
2158#define _SC_2_PBS_CHECKPOINT 175
2159#define _SC_2_PBS_LOCATE 170
2160#define _SC_2_PBS_MESSAGE 171
2161#define _SC_2_PBS_TRACK 172
2162#define _SC_2_SW_DEV 51
2163#define _SC_2_UPE 97
2164#define _SC_2_VERSION 46
2165#define _SC_ADVISORY_INFO 132
2166#define _SC_AIO_LISTIO_MAX 23
2167#define _SC_AIO_MAX 24
2168#define _SC_AIO_PRIO_DELTA_MAX 25
2169#define _SC_ARG_MAX 0
2170#define _SC_ASYNCHRONOUS_IO 12
2171#define _SC_ATEXIT_MAX 87
2172#define _SC_AVPHYS_PAGES 86
2173#define _SC_BARRIERS 133
2174#define _SC_BC_BASE_MAX 36
2175#define _SC_BC_DIM_MAX 37
2176#define _SC_BC_SCALE_MAX 38
2177#define _SC_BC_STRING_MAX 39
2178#define _SC_CHILD_MAX 1
2179#define _SC_CLK_TCK 2
2180#define _SC_CLOCK_SELECTION 137
2181#define _SC_COLL_WEIGHTS_MAX 40
2182#define _SC_CPUTIME 138
2183#define _SC_DELAYTIMER_MAX 26
2184#define _SC_EXPR_NEST_MAX 42
2185#define _SC_FSYNC 15
2186#define _SC_GETGR_R_SIZE_MAX 69
2187#define _SC_GETPW_R_SIZE_MAX 70
2188#define _SC_HOST_NAME_MAX 180
2189#define _SC_IOV_MAX 60
2190#define _SC_IPV6 235
2191#define _SC_JOB_CONTROL 7
2192#define _SC_LINE_MAX 43
2193#define _SC_LOGIN_NAME_MAX 71
2194#define _SC_MAPPED_FILES 16
2195#define _SC_MEMLOCK 17
2196#define _SC_MEMLOCK_RANGE 18
2197#define _SC_MEMORY_PROTECTION 19
2198#define _SC_MESSAGE_PASSING 20
2199#define _SC_MONOTONIC_CLOCK 149
2200#define _SC_MQ_OPEN_MAX 27
2201#define _SC_MQ_PRIO_MAX 28
2202#define _SC_NGROUPS_MAX 3
2203#define _SC_NPROCESSORS_CONF 83
2204#define _SC_NPROCESSORS_ONLN 84
2205#define _SC_NZERO 109
2206#define _SC_OPEN_MAX 4
2207#define _SC_PAGESIZE 30
2208#define _SC_PAGE_SIZE 30
2209#define _SC_PASS_MAX 88
2210#define _SC_PHYS_PAGES 85
2211#define _SC_PRIORITIZED_IO 13
2212#define _SC_PRIORITY_SCHEDULING 10
2213#define _SC_RAW_SOCKETS 236
2214#define _SC_READER_WRITER_LOCKS 153
2215#define _SC_REALTIME_SIGNALS 9
2216#define _SC_REGEXP 155
2217#define _SC_RE_DUP_MAX 44
2218#define _SC_RTSIG_MAX 31
2219#define _SC_SAVED_IDS 8
2220#define _SC_SEMAPHORES 21
2221#define _SC_SEM_NSEMS_MAX 32
2222#define _SC_SEM_VALUE_MAX 33
2223#define _SC_SHARED_MEMORY_OBJECTS 22
2224#define _SC_SHELL 157
2225#define _SC_SIGQUEUE_MAX 34
2226#define _SC_SPAWN 159
2227#define _SC_SPIN_LOCKS 154
2228#define _SC_SPORADIC_SERVER 160
2229#define _SC_SS_REPL_MAX 241
2230#define _SC_STREAMS 174
2231#define _SC_STREAM_MAX 5
2232#define _SC_SYMLOOP_MAX 173
2233#define _SC_SYNCHRONIZED_IO 14
2234#define _SC_THREADS 67
2235#define _SC_THREAD_ATTR_STACKADDR 77
2236#define _SC_THREAD_ATTR_STACKSIZE 78
2237#define _SC_THREAD_CPUTIME 139
2238#define _SC_THREAD_DESTRUCTOR_ITERATIONS 73
2239#define _SC_THREAD_KEYS_MAX 74
2240#define _SC_THREAD_PRIORITY_SCHEDULING 79
2241#define _SC_THREAD_PRIO_INHERIT 80
2242#define _SC_THREAD_PRIO_PROTECT 81
2243#define _SC_THREAD_PROCESS_SHARED 82
2244#define _SC_THREAD_ROBUST_PRIO_INHERIT 247
2245#define _SC_THREAD_ROBUST_PRIO_PROTECT 248
2246#define _SC_THREAD_SAFE_FUNCTIONS 68
2247#define _SC_THREAD_SPORADIC_SERVER 161
2248#define _SC_THREAD_STACK_MIN 75
2249#define _SC_THREAD_THREADS_MAX 76
2250#define _SC_TIMEOUTS 164
2251#define _SC_TIMERS 11
2252#define _SC_TIMER_MAX 35
2253#define _SC_TRACE 181
2254#define _SC_TRACE_EVENT_FILTER 182
2255#define _SC_TRACE_EVENT_NAME_MAX 242
2256#define _SC_TRACE_INHERIT 183
2257#define _SC_TRACE_LOG 184
2258#define _SC_TRACE_NAME_MAX 243
2259#define _SC_TRACE_SYS_MAX 244
2260#define _SC_TRACE_USER_EVENT_MAX 245
2261#define _SC_TTY_NAME_MAX 72
2262#define _SC_TYPED_MEMORY_OBJECTS 165
2263#define _SC_TZNAME_MAX 6
2264#define _SC_UIO_MAXIOV 60
2265#define _SC_V6_ILP32_OFF32 176
2266#define _SC_V6_ILP32_OFFBIG 177
2267#define _SC_V6_LP64_OFF64 178
2268#define _SC_V6_LPBIG_OFFBIG 179
2269#define _SC_V7_ILP32_OFF32 237
2270#define _SC_V7_ILP32_OFFBIG 238
2271#define _SC_V7_LP64_OFF64 239
2272#define _SC_V7_LPBIG_OFFBIG 240
2273#define _SC_VERSION 29
2274#define _SC_XBS5_ILP32_OFF32 125
2275#define _SC_XBS5_ILP32_OFFBIG 126
2276#define _SC_XBS5_LP64_OFF64 127
2277#define _SC_XBS5_LPBIG_OFFBIG 128
2278#define _SC_XOPEN_CRYPT 92
2279#define _SC_XOPEN_ENH_I18N 93
2280#define _SC_XOPEN_LEGACY 129
2281#define _SC_XOPEN_REALTIME 130
2282#define _SC_XOPEN_REALTIME_THREADS 131
2283#define _SC_XOPEN_SHM 94
2284#define _SC_XOPEN_STREAMS 246
2285#define _SC_XOPEN_UNIX 91
2286#define _SC_XOPEN_VERSION 89
2287#define _SC_XOPEN_XCU_VERSION 90
2288#define _SC_XOPEN_XPG2 98
2289#define _SC_XOPEN_XPG3 99
2290#define _SC_XOPEN_XPG4 100
2291#define _SEARCH_H
2292#define _SEMAPHORE_H
2293#define _SIZE_T
2294#define _STDALIGN_H
2295#define _STDBOOL_H
2296#define _STDC_PREDEF_H
2297#define _STDINT_H
2298#define _STDIO_EXT_H
2299#define _STDIO_H
2300#define _STDLIB_H
2301#define _STDNORETURN_H
2302#define _STRINGS_H
2303#define _STRING_H
2304#define _STROPTS_H
2305#define _SYSEXITS_H
2306#define _SYS_EVENTFD_H
2307#define _SYS_FILE_H
2308#define _SYS_IOCTL_H
2309#define _SYS_PARAM_H
2310#define _SYS_RANDOM_H
2311#define _SYS_REG_H
2312#define _SYS_SELECT_H
2313#define _SYS_SOCKET_H
2314#define _SYS_STAT_H
2315#define _SYS_SYSCALL_H
2316#define _SYS_SYSINFO_H
2317#define _SYS_TIMEB_H
2318#define _SYS_TIMEX_H
2319#define _SYS_TIME_H
2320#define _SYS_TTYDEFAULTS_H
2321#define _SYS_TYPES_H
2322#define _SYS_UIO_H
2323#define _SYS_UN_H
2324#define _SYS_UTSNAME_H
2325#define _TAR_H
2326#define _TGMATH_H
2327#define _THREADS_H
2328#define _TIME_H
2329#define _UCHAR_H
2330#define _UNISTD_H
2331#define _UTIME_H
2332#define _VALUES_H
2333#define _VA_LIST
2334#define _WCHAR_H
2335#define _WCHAR_T
2336#define _WCTYPE_H
2337#define _WINT_T
2338#define _XOPEN_ENH_I18N 1
2339#define _XOPEN_IOV_MAX 16
2340#define _XOPEN_NAME_MAX 255
2341#define _XOPEN_PATH_MAX 1024
2342#define _XOPEN_UNIX 1
2343#define _XOPEN_VERSION 700
2344#define __ARE_4_EQUAL(a,b) (!( (0[a]-0[b]) | (1[a]-1[b]) | (2[a]-2[b]) | (3[a]-3[b]) ))
2345#define __ATOMIC_ACQUIRE 2
2346#define __ATOMIC_ACQ_REL 4
2347#define __ATOMIC_CONSUME 1
2348#define __ATOMIC_RELAXED 0
2349#define __ATOMIC_RELEASE 3
2350#define __ATOMIC_SEQ_CST 5
2351#define __BIGGEST_ALIGNMENT__ 16
2352#define __BIG_ENDIAN 4321
2353#define __BIND 19950621
2354#define __BYTE_ORDER __BYTE_ORDER__
2355#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
2356#define __CHAR16_TYPE__ unsigned short
2357#define __CHAR32_TYPE__ unsigned int
2358#define __CHAR_BIT__ 8
2359#define __compiler_ATOMIC_BOOL_LOCK_FREE 2
2360#define __compiler_ATOMIC_CHAR16_T_LOCK_FREE 2
2361#define __compiler_ATOMIC_CHAR32_T_LOCK_FREE 2
2362#define __compiler_ATOMIC_CHAR_LOCK_FREE 2
2363#define __compiler_ATOMIC_INT_LOCK_FREE 2
2364#define __compiler_ATOMIC_LLONG_LOCK_FREE 2
2365#define __compiler_ATOMIC_LONG_LOCK_FREE 2
2366#define __compiler_ATOMIC_POINTER_LOCK_FREE 2
2367#define __compiler_ATOMIC_SHORT_LOCK_FREE 2
2368#define __compiler_ATOMIC_WCHAR_T_LOCK_FREE 2
2369#define __CLANG_MAX_ALIGN_T_DEFINED
2370#define __CMPLX(x,y,t) (__builtin_complex((t)(x), (t)(y)))
2371#define __CONSTANT_CFSTRINGS__ 1
2372#define __DBLCX(x) (__IS_CX(x) && sizeof(x) == sizeof(double complex))
2373#define __DBL_DECIMAL_DIG__ 17
2374#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
2375#define __DBL_DIG__ 15
2376#define __DBL_EPSILON__ 2.2204460492503131e-16
2377#define __DBL_HAS_DENORM__ 1
2378#define __DBL_HAS_INFINITY__ 1
2379#define __DBL_HAS_QUIET_NAN__ 1
2380#define __DBL_MANT_DIG__ 53
2381#define __DBL_MAX_10_EXP__ 308
2382#define __DBL_MAX_EXP__ 1024
2383#define __DBL_MAX__ 1.7976931348623157e+308
2384#define __DBL_MIN_10_EXP__ (-307)
2385#define __DBL_MIN_EXP__ (-1021)
2386#define __DBL_MIN__ 2.2250738585072014e-308
2387#define __DECIMAL_DIG__ __LDBL_DECIMAL_DIG__
2388#define __DEFINED_FILE
2389#define __DEFINED___isoc_va_list
2390#define __DEFINED_blkcnt_t
2391#define __DEFINED_blksize_t
2392#define __DEFINED_clock_t
2393#define __DEFINED_clockid_t
2394#define __DEFINED_cnd_t
2395#define __DEFINED_dev_t
2396#define __DEFINED_double_t
2397#define __DEFINED_float_t
2398#define __DEFINED_fsblkcnt_t
2399#define __DEFINED_fsfilcnt_t
2400#define __DEFINED_gid_t
2401#define __DEFINED_id_t
2402#define __DEFINED_ino_t
2403#define __DEFINED_int16_t
2404#define __DEFINED_int32_t
2405#define __DEFINED_int64_t
2406#define __DEFINED_int8_t
2407#define __DEFINED_intmax_t
2408#define __DEFINED_intptr_t
2409#define __DEFINED_key_t
2410#define __DEFINED_locale_t
2411#define __DEFINED_mbstate_t
2412#define __DEFINED_mode_t
2413#define __DEFINED_mtx_t
2414#define __DEFINED_nlink_t
2415#define __DEFINED_off_t
2416#define __DEFINED_pid_t
2417#define __DEFINED_pthread_attr_t
2418#define __DEFINED_pthread_barrier_t
2419#define __DEFINED_pthread_barrierattr_t
2420#define __DEFINED_pthread_cond_t
2421#define __DEFINED_pthread_condattr_t
2422#define __DEFINED_pthread_key_t
2423#define __DEFINED_pthread_mutex_t
2424#define __DEFINED_pthread_mutexattr_t
2425#define __DEFINED_pthread_once_t
2426#define __DEFINED_pthread_rwlock_t
2427#define __DEFINED_pthread_rwlockattr_t
2428#define __DEFINED_pthread_spinlock_t
2429#define __DEFINED_pthread_t
2430#define __DEFINED_register_t
2431#define __DEFINED_regoff_t
2432#define __DEFINED_sa_family_t
2433#define __DEFINED_sigset_t
2434#define __DEFINED_size_t
2435#define __DEFINED_socklen_t
2436#define __DEFINED_ssize_t
2437#define __DEFINED_suseconds_t
2438#define __DEFINED_time_t
2439#define __DEFINED_timer_t
2440#define __DEFINED_u_int64_t
2441#define __DEFINED_uid_t
2442#define __DEFINED_uint16_t
2443#define __DEFINED_uint32_t
2444#define __DEFINED_uint64_t
2445#define __DEFINED_uint8_t
2446#define __DEFINED_uintmax_t
2447#define __DEFINED_uintptr_t
2448#define __DEFINED_useconds_t
2449#define __DEFINED_va_list
2450#define __DEFINED_wchar_t
2451#define __DEFINED_wctype_t
2452#define __DEFINED_wint_t
2453#define __FINITE_MATH_ONLY__ 0
2454#define __FLT(x) (__IS_REAL(x) && sizeof(x) == sizeof(float))
2455#define __FLTCX(x) (__IS_CX(x) && sizeof(x) == sizeof(float complex))
2456#define __FLT_DECIMAL_DIG__ 9
2457#define __FLT_DENORM_MIN__ 1.40129846e-45F
2458#define __FLT_DIG__ 6
2459#define __FLT_EPSILON__ 1.19209290e-7F
2460#define __FLT_EVAL_METHOD__ 0
2461#define __FLT_HAS_DENORM__ 1
2462#define __FLT_HAS_INFINITY__ 1
2463#define __FLT_HAS_QUIET_NAN__ 1
2464#define __FLT_MANT_DIG__ 24
2465#define __FLT_MAX_10_EXP__ 38
2466#define __FLT_MAX_EXP__ 128
2467#define __FLT_MAX__ 3.40282347e+38F
2468#define __FLT_MIN_10_EXP__ (-37)
2469#define __FLT_MIN_EXP__ (-125)
2470#define __FLT_MIN__ 1.17549435e-38F
2471#define __FLT_RADIX__ 2
2472#define __compiler_ATOMIC_BOOL_LOCK_FREE 2
2473#define __compiler_ATOMIC_CHAR16_T_LOCK_FREE 2
2474#define __compiler_ATOMIC_CHAR32_T_LOCK_FREE 2
2475#define __compiler_ATOMIC_CHAR_LOCK_FREE 2
2476#define __compiler_ATOMIC_INT_LOCK_FREE 2
2477#define __compiler_ATOMIC_LLONG_LOCK_FREE 2
2478#define __compiler_ATOMIC_LONG_LOCK_FREE 2
2479#define __compiler_ATOMIC_POINTER_LOCK_FREE 2
2480#define __compiler_ATOMIC_SHORT_LOCK_FREE 2
2481#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
2482#define __compiler_ATOMIC_WCHAR_T_LOCK_FREE 2
2483#define __GNUC_STDC_INLINE__ 1
2484#define __GNUC_VA_LIST 1
2485#define __GXX_ABI_VERSION 1002
2486#define __ILP32__ 1
2487#define __INT16_C_SUFFIX__
2488#define __INT16_FMTd__ "hd"
2489#define __INT16_FMTi__ "hi"
2490#define __INT16_MAX__ 32767
2491#define __INT16_TYPE__ short
2492#define __INT32_C_SUFFIX__
2493#define __INT32_FMTd__ "d"
2494#define __INT32_FMTi__ "i"
2495#define __INT32_MAX__ 2147483647
2496#define __INT32_TYPE__ int
2497#define __INT64_C_SUFFIX__ LL
2498#define __INT64_FMTd__ "lld"
2499#define __INT64_FMTi__ "lli"
2500#define __INT64_MAX__ 9223372036854775807LL
2501#define __INT64_TYPE__ long long int
2502#define __INT8_C_SUFFIX__
2503#define __INT8_FMTd__ "hhd"
2504#define __INT8_FMTi__ "hhi"
2505#define __INT8_MAX__ 127
2506#define __INT8_TYPE__ signed char
2507#define __INTMAX_C_SUFFIX__ LL
2508#define __INTMAX_FMTd__ "lld"
2509#define __INTMAX_FMTi__ "lli"
2510#define __INTMAX_MAX__ 9223372036854775807LL
2511#define __INTMAX_TYPE__ long long int
2512#define __INTMAX_WIDTH__ 64
2513#define __INTPTR_FMTd__ "ld"
2514#define __INTPTR_FMTi__ "li"
2515#define __INTPTR_MAX__ 2147483647L
2516#define __INTPTR_TYPE__ long int
2517#define __INTPTR_WIDTH__ 32
2518#define __INT_FAST16_FMTd__ "hd"
2519#define __INT_FAST16_FMTi__ "hi"
2520#define __INT_FAST16_MAX__ 32767
2521#define __INT_FAST16_TYPE__ short
2522#define __INT_FAST32_FMTd__ "d"
2523#define __INT_FAST32_FMTi__ "i"
2524#define __INT_FAST32_MAX__ 2147483647
2525#define __INT_FAST32_TYPE__ int
2526#define __INT_FAST64_FMTd__ "lld"
2527#define __INT_FAST64_FMTi__ "lli"
2528#define __INT_FAST64_MAX__ 9223372036854775807LL
2529#define __INT_FAST64_TYPE__ long long int
2530#define __INT_FAST8_FMTd__ "hhd"
2531#define __INT_FAST8_FMTi__ "hhi"
2532#define __INT_FAST8_MAX__ 127
2533#define __INT_FAST8_TYPE__ signed char
2534#define __INT_LEAST16_FMTd__ "hd"
2535#define __INT_LEAST16_FMTi__ "hi"
2536#define __INT_LEAST16_MAX__ 32767
2537#define __INT_LEAST16_TYPE__ short
2538#define __INT_LEAST32_FMTd__ "d"
2539#define __INT_LEAST32_FMTi__ "i"
2540#define __INT_LEAST32_MAX__ 2147483647
2541#define __INT_LEAST32_TYPE__ int
2542#define __INT_LEAST64_FMTd__ "lld"
2543#define __INT_LEAST64_FMTi__ "lli"
2544#define __INT_LEAST64_MAX__ 9223372036854775807LL
2545#define __INT_LEAST64_TYPE__ long long int
2546#define __INT_LEAST8_FMTd__ "hhd"
2547#define __INT_LEAST8_FMTi__ "hhi"
2548#define __INT_LEAST8_MAX__ 127
2549#define __INT_LEAST8_TYPE__ signed char
2550#define __INT_MAX__ 2147483647
2551#define __IS_CX(x) (__IS_FP(x) && sizeof(x) == sizeof((x)+I))
2552#define __IS_FP(x) (sizeof((x)+1ULL) == sizeof((x)+1.0f))
2553#define __IS_REAL(x) (__IS_FP(x) && 2*sizeof(x) == sizeof((x)+I))
2554#define __LDBL(x) (__IS_REAL(x) && sizeof(x) == sizeof(long double) && sizeof(long double) != sizeof(double))
2555#define __LDBLCX(x) (__IS_CX(x) && sizeof(x) == sizeof(long double complex) && sizeof(long double) != sizeof(double))
2556#define __LDBL_DECIMAL_DIG__ 36
2557#define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L
2558#define __LDBL_DIG__ 33
2559#define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L
2560#define __LDBL_HAS_DENORM__ 1
2561#define __LDBL_HAS_INFINITY__ 1
2562#define __LDBL_HAS_QUIET_NAN__ 1
2563#define __LDBL_MANT_DIG__ 113
2564#define __LDBL_MAX_10_EXP__ 4932
2565#define __LDBL_MAX_EXP__ 16384
2566#define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L
2567#define __LDBL_MIN_10_EXP__ (-4931)
2568#define __LDBL_MIN_EXP__ (-16381)
2569#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
2570#define __LITTLE_ENDIAN 1234
2571#define __LITTLE_ENDIAN__ 1
2572#define __LONG_LONG_MAX__ 9223372036854775807LL
2573#define __LONG_MAX __LONG_MAX__
2574#define __LONG_MAX__ 2147483647L
2575#define __NAMESER 19991006
2576#define __NEED_FILE
2577#define __NEED___isoc_va_list
2578#define __NEED_blkcnt_t
2579#define __NEED_blksize_t
2580#define __NEED_clock_t
2581#define __NEED_clockid_t
2582#define __NEED_cnd_t
2583#define __NEED_dev_t
2584#define __NEED_double_t
2585#define __NEED_float_t
2586#define __NEED_fsblkcnt_t
2587#define __NEED_fsfilcnt_t
2588#define __NEED_gid_t
2589#define __NEED_id_t
2590#define __NEED_ino_t
2591#define __NEED_int16_t
2592#define __NEED_int32_t
2593#define __NEED_int64_t
2594#define __NEED_int8_t
2595#define __NEED_intmax_t
2596#define __NEED_intptr_t
2597#define __NEED_key_t
2598#define __NEED_locale_t
2599#define __NEED_mbstate_t
2600#define __NEED_mode_t
2601#define __NEED_mtx_t
2602#define __NEED_nlink_t
2603#define __NEED_off_t
2604#define __NEED_pid_t
2605#define __NEED_pthread_attr_t
2606#define __NEED_pthread_barrier_t
2607#define __NEED_pthread_barrierattr_t
2608#define __NEED_pthread_cond_t
2609#define __NEED_pthread_condattr_t
2610#define __NEED_pthread_key_t
2611#define __NEED_pthread_mutex_t
2612#define __NEED_pthread_mutexattr_t
2613#define __NEED_pthread_once_t
2614#define __NEED_pthread_rwlock_t
2615#define __NEED_pthread_rwlockattr_t
2616#define __NEED_pthread_spinlock_t
2617#define __NEED_pthread_t
2618#define __NEED_register_t
2619#define __NEED_regoff_t
2620#define __NEED_sa_family_t
2621#define __NEED_sigset_t
2622#define __NEED_size_t
2623#define __NEED_socklen_t
2624#define __NEED_ssize_t
2625#define __NEED_struct_iovec
2626#define __NEED_struct_timespec
2627#define __NEED_struct_timeval
2628#define __NEED_suseconds_t
2629#define __NEED_time_t
2630#define __NEED_timer_t
2631#define __NEED_u_int64_t
2632#define __NEED_uid_t
2633#define __NEED_uint16_t
2634#define __NEED_uint32_t
2635#define __NEED_uint64_t
2636#define __NEED_uint8_t
2637#define __NEED_uintmax_t
2638#define __NEED_uintptr_t
2639#define __NEED_useconds_t
2640#define __NEED_va_list
2641#define __NEED_wchar_t
2642#define __NEED_wctype_t
2643#define __NEED_wint_t
2644#define __OBJC_BOOL_IS_BOOL 0
2645#define __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES 3
2646#define __OPENCL_MEMORY_SCOPE_DEVICE 2
2647#define __OPENCL_MEMORY_SCOPE_SUB_GROUP 4
2648#define __OPENCL_MEMORY_SCOPE_WORK_GROUP 1
2649#define __OPENCL_MEMORY_SCOPE_WORK_ITEM 0
2650#define __OPTIMIZE__ 1
2651#define __ORDER_BIG_ENDIAN__ 4321
2652#define __ORDER_LITTLE_ENDIAN__ 1234
2653#define __ORDER_PDP_ENDIAN__ 3412
2654#define __PDP_ENDIAN 3412
2655#define __POINTER_WIDTH__ 32
2656#define __PRAGMA_REDEFINE_EXTNAME 1
2657#define __PTRDIFF_FMTd__ "ld"
2658#define __PTRDIFF_FMTi__ "li"
2659#define __PTRDIFF_MAX__ 2147483647L
2660#define __PTRDIFF_TYPE__ long int
2661#define __PTRDIFF_WIDTH__ 32
2662#define __REDIR(x,y) __typeof__(x) x __asm__(#y)
2663#define __RETCAST(x)
2664#define __RETCAST_2(x,y)
2665#define __RETCAST_3(x,y,z)
2666#define __RETCAST_CX(x)
2667#define __RETCAST_REAL(x)
2668#define __SCHAR_MAX__ 127
2669#define __SHRT_MAX__ 32767
2670#define __SID ('S' << 8)
2671#define __SIG_ATOMIC_MAX__ 2147483647L
2672#define __SIG_ATOMIC_WIDTH__ 32
2673#define __SIZEOF_DOUBLE__ 8
2674#define __SIZEOF_FLOAT__ 4
2675#define __SIZEOF_INT128__ 16
2676#define __SIZEOF_INT__ 4
2677#define __SIZEOF_LONG_DOUBLE__ 16
2678#define __SIZEOF_LONG_LONG__ 8
2679#define __SIZEOF_LONG__ 4
2680#define __SIZEOF_POINTER__ 4
2681#define __SIZEOF_PTRDIFF_T__ 4
2682#define __SIZEOF_SHORT__ 2
2683#define __SIZEOF_SIZE_T__ 4
2684#define __SIZEOF_WCHAR_T__ 4
2685#define __SIZEOF_WINT_T__ 4
2686#define __SIZE_FMTX__ "lX"
2687#define __SIZE_FMTo__ "lo"
2688#define __SIZE_FMTu__ "lu"
2689#define __SIZE_FMTx__ "lx"
2690#define __SIZE_MAX__ 4294967295UL
2691#define __SIZE_TYPE__ long unsigned int
2692#define __SIZE_WIDTH__ 32
2693#define __STDARG_H
2694#define __STDC_HOSTED__ 1
2695#define __STDC_IEC_559__ 1
2696#define __STDC_ISO_10646__ 201206L
2697#define __STDC_UTF_16__ 1
2698#define __STDC_UTF_32__ 1
2699#define __STDC_VERSION__ 201710L
2700#define __STDC__ 1
2701#define __STDDEF_H
2702#define __UAPI_DEF_IN6_ADDR 0
2703#define __UAPI_DEF_IN6_ADDR_ALT 0
2704#define __UAPI_DEF_IN6_PKTINFO 0
2705#define __UAPI_DEF_IN_ADDR 0
2706#define __UAPI_DEF_IN_CLASS 0
2707#define __UAPI_DEF_IN_IPPROTO 0
2708#define __UAPI_DEF_IN_PKTINFO 0
2709#define __UAPI_DEF_IP6_MTUINFO 0
2710#define __UAPI_DEF_IPHDR 0
2711#define __UAPI_DEF_IPPROTO_V6 0
2712#define __UAPI_DEF_IPV6_MREQ 0
2713#define __UAPI_DEF_IPV6_OPTIONS 0
2714#define __UAPI_DEF_IP_MREQ 0
2715#define __UAPI_DEF_SOCKADDR_IN 0
2716#define __UAPI_DEF_SOCKADDR_IN6 0
2717#define __UINT16_C_SUFFIX__
2718#define __UINT16_FMTX__ "hX"
2719#define __UINT16_FMTo__ "ho"
2720#define __UINT16_FMTu__ "hu"
2721#define __UINT16_FMTx__ "hx"
2722#define __UINT16_MAX__ 65535
2723#define __UINT16_TYPE__ unsigned short
2724#define __UINT32_C_SUFFIX__ U
2725#define __UINT32_FMTX__ "X"
2726#define __UINT32_FMTo__ "o"
2727#define __UINT32_FMTu__ "u"
2728#define __UINT32_FMTx__ "x"
2729#define __UINT32_MAX__ 4294967295U
2730#define __UINT32_TYPE__ unsigned int
2731#define __UINT64_C_SUFFIX__ ULL
2732#define __UINT64_FMTX__ "llX"
2733#define __UINT64_FMTo__ "llo"
2734#define __UINT64_FMTu__ "llu"
2735#define __UINT64_FMTx__ "llx"
2736#define __UINT64_MAX__ 18446744073709551615ULL
2737#define __UINT64_TYPE__ long long unsigned int
2738#define __UINT8_C_SUFFIX__
2739#define __UINT8_FMTX__ "hhX"
2740#define __UINT8_FMTo__ "hho"
2741#define __UINT8_FMTu__ "hhu"
2742#define __UINT8_FMTx__ "hhx"
2743#define __UINT8_MAX__ 255
2744#define __UINT8_TYPE__ unsigned char
2745#define __UINTMAX_C_SUFFIX__ ULL
2746#define __UINTMAX_FMTX__ "llX"
2747#define __UINTMAX_FMTo__ "llo"
2748#define __UINTMAX_FMTu__ "llu"
2749#define __UINTMAX_FMTx__ "llx"
2750#define __UINTMAX_MAX__ 18446744073709551615ULL
2751#define __UINTMAX_TYPE__ long long unsigned int
2752#define __UINTMAX_WIDTH__ 64
2753#define __UINTPTR_FMTX__ "lX"
2754#define __UINTPTR_FMTo__ "lo"
2755#define __UINTPTR_FMTu__ "lu"
2756#define __UINTPTR_FMTx__ "lx"
2757#define __UINTPTR_MAX__ 4294967295UL
2758#define __UINTPTR_TYPE__ long unsigned int
2759#define __UINTPTR_WIDTH__ 32
2760#define __UINT_FAST16_FMTX__ "hX"
2761#define __UINT_FAST16_FMTo__ "ho"
2762#define __UINT_FAST16_FMTu__ "hu"
2763#define __UINT_FAST16_FMTx__ "hx"
2764#define __UINT_FAST16_MAX__ 65535
2765#define __UINT_FAST16_TYPE__ unsigned short
2766#define __UINT_FAST32_FMTX__ "X"
2767#define __UINT_FAST32_FMTo__ "o"
2768#define __UINT_FAST32_FMTu__ "u"
2769#define __UINT_FAST32_FMTx__ "x"
2770#define __UINT_FAST32_MAX__ 4294967295U
2771#define __UINT_FAST32_TYPE__ unsigned int
2772#define __UINT_FAST64_FMTX__ "llX"
2773#define __UINT_FAST64_FMTo__ "llo"
2774#define __UINT_FAST64_FMTu__ "llu"
2775#define __UINT_FAST64_FMTx__ "llx"
2776#define __UINT_FAST64_MAX__ 18446744073709551615ULL
2777#define __UINT_FAST64_TYPE__ long long unsigned int
2778#define __UINT_FAST8_FMTX__ "hhX"
2779#define __UINT_FAST8_FMTo__ "hho"
2780#define __UINT_FAST8_FMTu__ "hhu"
2781#define __UINT_FAST8_FMTx__ "hhx"
2782#define __UINT_FAST8_MAX__ 255
2783#define __UINT_FAST8_TYPE__ unsigned char
2784#define __UINT_LEAST16_FMTX__ "hX"
2785#define __UINT_LEAST16_FMTo__ "ho"
2786#define __UINT_LEAST16_FMTu__ "hu"
2787#define __UINT_LEAST16_FMTx__ "hx"
2788#define __UINT_LEAST16_MAX__ 65535
2789#define __UINT_LEAST16_TYPE__ unsigned short
2790#define __UINT_LEAST32_FMTX__ "X"
2791#define __UINT_LEAST32_FMTo__ "o"
2792#define __UINT_LEAST32_FMTu__ "u"
2793#define __UINT_LEAST32_FMTx__ "x"
2794#define __UINT_LEAST32_MAX__ 4294967295U
2795#define __UINT_LEAST32_TYPE__ unsigned int
2796#define __UINT_LEAST64_FMTX__ "llX"
2797#define __UINT_LEAST64_FMTo__ "llo"
2798#define __UINT_LEAST64_FMTu__ "llu"
2799#define __UINT_LEAST64_FMTx__ "llx"
2800#define __UINT_LEAST64_MAX__ 18446744073709551615ULL
2801#define __UINT_LEAST64_TYPE__ long long unsigned int
2802#define __UINT_LEAST8_FMTX__ "hhX"
2803#define __UINT_LEAST8_FMTo__ "hho"
2804#define __UINT_LEAST8_FMTu__ "hhu"
2805#define __UINT_LEAST8_FMTx__ "hhx"
2806#define __UINT_LEAST8_MAX__ 255
2807#define __UINT_LEAST8_TYPE__ unsigned char
2808#define __USER_LABEL_PREFIX__
2809#define __USE_TIME_BITS64 1
2810#define __WASI_ADVICE_DONTNEED (UINT8_C(4))
2811#define __WASI_ADVICE_NOREUSE (UINT8_C(5))
2812#define __WASI_ADVICE_NORMAL (UINT8_C(0))
2813#define __WASI_ADVICE_RANDOM (UINT8_C(2))
2814#define __WASI_ADVICE_SEQUENTIAL (UINT8_C(1))
2815#define __WASI_ADVICE_WILLNEED (UINT8_C(3))
2816#define __WASI_CLOCKID_MONOTONIC (UINT32_C(1))
2817#define __WASI_CLOCKID_PROCESS_CPUTIME_ID (UINT32_C(2))
2818#define __WASI_CLOCKID_REALTIME (UINT32_C(0))
2819#define __WASI_CLOCKID_THREAD_CPUTIME_ID (UINT32_C(3))
2820#define __WASI_DIRCOOKIE_START (UINT64_C(0))
2821#define __WASI_ERRNO_2BIG (UINT16_C(1))
2822#define __WASI_ERRNO_ACCES (UINT16_C(2))
2823#define __WASI_ERRNO_ADDRINUSE (UINT16_C(3))
2824#define __WASI_ERRNO_ADDRNOTAVAIL (UINT16_C(4))
2825#define __WASI_ERRNO_AFNOSUPPORT (UINT16_C(5))
2826#define __WASI_ERRNO_AGAIN (UINT16_C(6))
2827#define __WASI_ERRNO_ALREADY (UINT16_C(7))
2828#define __WASI_ERRNO_BADF (UINT16_C(8))
2829#define __WASI_ERRNO_BADMSG (UINT16_C(9))
2830#define __WASI_ERRNO_BUSY (UINT16_C(10))
2831#define __WASI_ERRNO_CANCELED (UINT16_C(11))
2832#define __WASI_ERRNO_CHILD (UINT16_C(12))
2833#define __WASI_ERRNO_CONNABORTED (UINT16_C(13))
2834#define __WASI_ERRNO_CONNREFUSED (UINT16_C(14))
2835#define __WASI_ERRNO_CONNRESET (UINT16_C(15))
2836#define __WASI_ERRNO_DEADLK (UINT16_C(16))
2837#define __WASI_ERRNO_DESTADDRREQ (UINT16_C(17))
2838#define __WASI_ERRNO_DOM (UINT16_C(18))
2839#define __WASI_ERRNO_DQUOT (UINT16_C(19))
2840#define __WASI_ERRNO_EXIST (UINT16_C(20))
2841#define __WASI_ERRNO_FAULT (UINT16_C(21))
2842#define __WASI_ERRNO_FBIG (UINT16_C(22))
2843#define __WASI_ERRNO_HOSTUNREACH (UINT16_C(23))
2844#define __WASI_ERRNO_IDRM (UINT16_C(24))
2845#define __WASI_ERRNO_ILSEQ (UINT16_C(25))
2846#define __WASI_ERRNO_INPROGRESS (UINT16_C(26))
2847#define __WASI_ERRNO_INTR (UINT16_C(27))
2848#define __WASI_ERRNO_INVAL (UINT16_C(28))
2849#define __WASI_ERRNO_IO (UINT16_C(29))
2850#define __WASI_ERRNO_ISCONN (UINT16_C(30))
2851#define __WASI_ERRNO_ISDIR (UINT16_C(31))
2852#define __WASI_ERRNO_LOOP (UINT16_C(32))
2853#define __WASI_ERRNO_MFILE (UINT16_C(33))
2854#define __WASI_ERRNO_MLINK (UINT16_C(34))
2855#define __WASI_ERRNO_MSGSIZE (UINT16_C(35))
2856#define __WASI_ERRNO_MULTIHOP (UINT16_C(36))
2857#define __WASI_ERRNO_NAMETOOLONG (UINT16_C(37))
2858#define __WASI_ERRNO_NETDOWN (UINT16_C(38))
2859#define __WASI_ERRNO_NETRESET (UINT16_C(39))
2860#define __WASI_ERRNO_NETUNREACH (UINT16_C(40))
2861#define __WASI_ERRNO_NFILE (UINT16_C(41))
2862#define __WASI_ERRNO_NOBUFS (UINT16_C(42))
2863#define __WASI_ERRNO_NODEV (UINT16_C(43))
2864#define __WASI_ERRNO_NOENT (UINT16_C(44))
2865#define __WASI_ERRNO_NOEXEC (UINT16_C(45))
2866#define __WASI_ERRNO_NOLCK (UINT16_C(46))
2867#define __WASI_ERRNO_NOLINK (UINT16_C(47))
2868#define __WASI_ERRNO_NOMEM (UINT16_C(48))
2869#define __WASI_ERRNO_NOMSG (UINT16_C(49))
2870#define __WASI_ERRNO_NOPROTOOPT (UINT16_C(50))
2871#define __WASI_ERRNO_NOSPC (UINT16_C(51))
2872#define __WASI_ERRNO_NOSYS (UINT16_C(52))
2873#define __WASI_ERRNO_NOTCAPABLE (UINT16_C(76))
2874#define __WASI_ERRNO_NOTCONN (UINT16_C(53))
2875#define __WASI_ERRNO_NOTDIR (UINT16_C(54))
2876#define __WASI_ERRNO_NOTEMPTY (UINT16_C(55))
2877#define __WASI_ERRNO_NOTRECOVERABLE (UINT16_C(56))
2878#define __WASI_ERRNO_NOTSOCK (UINT16_C(57))
2879#define __WASI_ERRNO_NOTSUP (UINT16_C(58))
2880#define __WASI_ERRNO_NOTTY (UINT16_C(59))
2881#define __WASI_ERRNO_NXIO (UINT16_C(60))
2882#define __WASI_ERRNO_OVERFLOW (UINT16_C(61))
2883#define __WASI_ERRNO_OWNERDEAD (UINT16_C(62))
2884#define __WASI_ERRNO_PERM (UINT16_C(63))
2885#define __WASI_ERRNO_PIPE (UINT16_C(64))
2886#define __WASI_ERRNO_PROTO (UINT16_C(65))
2887#define __WASI_ERRNO_PROTONOSUPPORT (UINT16_C(66))
2888#define __WASI_ERRNO_PROTOTYPE (UINT16_C(67))
2889#define __WASI_ERRNO_RANGE (UINT16_C(68))
2890#define __WASI_ERRNO_ROFS (UINT16_C(69))
2891#define __WASI_ERRNO_SPIPE (UINT16_C(70))
2892#define __WASI_ERRNO_SRCH (UINT16_C(71))
2893#define __WASI_ERRNO_STALE (UINT16_C(72))
2894#define __WASI_ERRNO_SUCCESS (UINT16_C(0))
2895#define __WASI_ERRNO_TIMEDOUT (UINT16_C(73))
2896#define __WASI_ERRNO_TXTBSY (UINT16_C(74))
2897#define __WASI_ERRNO_XDEV (UINT16_C(75))
2898#define __WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP ((__wasi_eventrwflags_t)(1 << 0))
2899#define __WASI_EVENTTYPE_CLOCK (UINT8_C(0))
2900#define __WASI_EVENTTYPE_FD_READ (UINT8_C(1))
2901#define __WASI_EVENTTYPE_FD_WRITE (UINT8_C(2))
2902#define __WASI_FDFLAGS_APPEND ((__wasi_fdflags_t)(1 << 0))
2903#define __WASI_FDFLAGS_DSYNC ((__wasi_fdflags_t)(1 << 1))
2904#define __WASI_FDFLAGS_NONBLOCK ((__wasi_fdflags_t)(1 << 2))
2905#define __WASI_FDFLAGS_RSYNC ((__wasi_fdflags_t)(1 << 3))
2906#define __WASI_FDFLAGS_SYNC ((__wasi_fdflags_t)(1 << 4))
2907#define __WASI_FILETYPE_BLOCK_DEVICE (UINT8_C(1))
2908#define __WASI_FILETYPE_CHARACTER_DEVICE (UINT8_C(2))
2909#define __WASI_FILETYPE_DIRECTORY (UINT8_C(3))
2910#define __WASI_FILETYPE_REGULAR_FILE (UINT8_C(4))
2911#define __WASI_FILETYPE_SOCKET_DGRAM (UINT8_C(5))
2912#define __WASI_FILETYPE_SOCKET_STREAM (UINT8_C(6))
2913#define __WASI_FILETYPE_SYMBOLIC_LINK (UINT8_C(7))
2914#define __WASI_FILETYPE_UNKNOWN (UINT8_C(0))
2915#define __WASI_FSTFLAGS_ATIM ((__wasi_fstflags_t)(1 << 0))
2916#define __WASI_FSTFLAGS_ATIM_NOW ((__wasi_fstflags_t)(1 << 1))
2917#define __WASI_FSTFLAGS_MTIM ((__wasi_fstflags_t)(1 << 2))
2918#define __WASI_FSTFLAGS_MTIM_NOW ((__wasi_fstflags_t)(1 << 3))
2919#define __WASI_LOOKUPFLAGS_SYMLINK_FOLLOW ((__wasi_lookupflags_t)(1 << 0))
2920#define __WASI_OFLAGS_CREAT ((__wasi_oflags_t)(1 << 0))
2921#define __WASI_OFLAGS_DIRECTORY ((__wasi_oflags_t)(1 << 1))
2922#define __WASI_OFLAGS_EXCL ((__wasi_oflags_t)(1 << 2))
2923#define __WASI_OFLAGS_TRUNC ((__wasi_oflags_t)(1 << 3))
2924#define __WASI_PREOPENTYPE_DIR (UINT8_C(0))
2925#define __WASI_RIFLAGS_RECV_PEEK ((__wasi_riflags_t)(1 << 0))
2926#define __WASI_RIFLAGS_RECV_WAITALL ((__wasi_riflags_t)(1 << 1))
2927#define __WASI_RIGHTS_FD_ADVISE ((__wasi_rights_t)(1 << 7))
2928#define __WASI_RIGHTS_FD_ALLOCATE ((__wasi_rights_t)(1 << 8))
2929#define __WASI_RIGHTS_FD_DATASYNC ((__wasi_rights_t)(1 << 0))
2930#define __WASI_RIGHTS_FD_FDSTAT_SET_FLAGS ((__wasi_rights_t)(1 << 3))
2931#define __WASI_RIGHTS_FD_FILESTAT_GET ((__wasi_rights_t)(1 << 21))
2932#define __WASI_RIGHTS_FD_FILESTAT_SET_SIZE ((__wasi_rights_t)(1 << 22))
2933#define __WASI_RIGHTS_FD_FILESTAT_SET_TIMES ((__wasi_rights_t)(1 << 23))
2934#define __WASI_RIGHTS_FD_READ ((__wasi_rights_t)(1 << 1))
2935#define __WASI_RIGHTS_FD_READDIR ((__wasi_rights_t)(1 << 14))
2936#define __WASI_RIGHTS_FD_SEEK ((__wasi_rights_t)(1 << 2))
2937#define __WASI_RIGHTS_FD_SYNC ((__wasi_rights_t)(1 << 4))
2938#define __WASI_RIGHTS_FD_TELL ((__wasi_rights_t)(1 << 5))
2939#define __WASI_RIGHTS_FD_WRITE ((__wasi_rights_t)(1 << 6))
2940#define __WASI_RIGHTS_PATH_CREATE_DIRECTORY ((__wasi_rights_t)(1 << 9))
2941#define __WASI_RIGHTS_PATH_CREATE_FILE ((__wasi_rights_t)(1 << 10))
2942#define __WASI_RIGHTS_PATH_FILESTAT_GET ((__wasi_rights_t)(1 << 18))
2943#define __WASI_RIGHTS_PATH_FILESTAT_SET_SIZE ((__wasi_rights_t)(1 << 19))
2944#define __WASI_RIGHTS_PATH_FILESTAT_SET_TIMES ((__wasi_rights_t)(1 << 20))
2945#define __WASI_RIGHTS_PATH_LINK_SOURCE ((__wasi_rights_t)(1 << 11))
2946#define __WASI_RIGHTS_PATH_LINK_TARGET ((__wasi_rights_t)(1 << 12))
2947#define __WASI_RIGHTS_PATH_OPEN ((__wasi_rights_t)(1 << 13))
2948#define __WASI_RIGHTS_PATH_READLINK ((__wasi_rights_t)(1 << 15))
2949#define __WASI_RIGHTS_PATH_REMOVE_DIRECTORY ((__wasi_rights_t)(1 << 25))
2950#define __WASI_RIGHTS_PATH_RENAME_SOURCE ((__wasi_rights_t)(1 << 16))
2951#define __WASI_RIGHTS_PATH_RENAME_TARGET ((__wasi_rights_t)(1 << 17))
2952#define __WASI_RIGHTS_PATH_SYMLINK ((__wasi_rights_t)(1 << 24))
2953#define __WASI_RIGHTS_PATH_UNLINK_FILE ((__wasi_rights_t)(1 << 26))
2954#define __WASI_RIGHTS_POLL_FD_READWRITE ((__wasi_rights_t)(1 << 27))
2955#define __WASI_RIGHTS_SOCK_SHUTDOWN ((__wasi_rights_t)(1 << 28))
2956#define __WASI_ROFLAGS_RECV_DATA_TRUNCATED ((__wasi_roflags_t)(1 << 0))
2957#define __WASI_SDFLAGS_RD ((__wasi_sdflags_t)(1 << 0))
2958#define __WASI_SDFLAGS_WR ((__wasi_sdflags_t)(1 << 1))
2959#define __WASI_SIGNAL_ABRT (UINT8_C(6))
2960#define __WASI_SIGNAL_ALRM (UINT8_C(14))
2961#define __WASI_SIGNAL_BUS (UINT8_C(7))
2962#define __WASI_SIGNAL_CHLD (UINT8_C(16))
2963#define __WASI_SIGNAL_CONT (UINT8_C(17))
2964#define __WASI_SIGNAL_FPE (UINT8_C(8))
2965#define __WASI_SIGNAL_HUP (UINT8_C(1))
2966#define __WASI_SIGNAL_ILL (UINT8_C(4))
2967#define __WASI_SIGNAL_INT (UINT8_C(2))
2968#define __WASI_SIGNAL_KILL (UINT8_C(9))
2969#define __WASI_SIGNAL_NONE (UINT8_C(0))
2970#define __WASI_SIGNAL_PIPE (UINT8_C(13))
2971#define __WASI_SIGNAL_POLL (UINT8_C(28))
2972#define __WASI_SIGNAL_PROF (UINT8_C(26))
2973#define __WASI_SIGNAL_PWR (UINT8_C(29))
2974#define __WASI_SIGNAL_QUIT (UINT8_C(3))
2975#define __WASI_SIGNAL_SEGV (UINT8_C(11))
2976#define __WASI_SIGNAL_STOP (UINT8_C(18))
2977#define __WASI_SIGNAL_SYS (UINT8_C(30))
2978#define __WASI_SIGNAL_TERM (UINT8_C(15))
2979#define __WASI_SIGNAL_TRAP (UINT8_C(5))
2980#define __WASI_SIGNAL_TSTP (UINT8_C(19))
2981#define __WASI_SIGNAL_TTIN (UINT8_C(20))
2982#define __WASI_SIGNAL_TTOU (UINT8_C(21))
2983#define __WASI_SIGNAL_URG (UINT8_C(22))
2984#define __WASI_SIGNAL_USR1 (UINT8_C(10))
2985#define __WASI_SIGNAL_USR2 (UINT8_C(12))
2986#define __WASI_SIGNAL_VTALRM (UINT8_C(25))
2987#define __WASI_SIGNAL_WINCH (UINT8_C(27))
2988#define __WASI_SIGNAL_XCPU (UINT8_C(23))
2989#define __WASI_SIGNAL_XFSZ (UINT8_C(24))
2990#define __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME ((__wasi_subclockflags_t)(1 << 0))
2991#define __WASI_WHENCE_CUR (UINT8_C(1))
2992#define __WASI_WHENCE_END (UINT8_C(2))
2993#define __WASI_WHENCE_SET (UINT8_C(0))
2994#define __WCHAR_MAX__ 2147483647
2995#define __WCHAR_TYPE__ int
2996#define __WCHAR_WIDTH__ 32
2997#define __WINT_MAX__ 2147483647
2998#define __WINT_TYPE__ int
2999#define __WINT_WIDTH__ 32
3000#define __WORDSIZE 64
3001#define __alignas_is_defined 1
3002#define __alignof_is_defined 1
3003#define __bitop(x,i,o) ((x)[(i)/8] o (1<<(i)%8))
3004#define __bool_true_false_are_defined 1
3005#define __inline inline
3006#define __restrict restrict
3007#define __tg_complex(fun,x) (__RETCAST_CX(x)( __FLTCX((x)+I) && __IS_FP(x) ? fun ## f (x) : __LDBLCX((x)+I) ? fun ## l (x) : fun(x) ))
3008#define __tg_complex_retreal(fun,x) (__RETCAST_REAL(x)( __FLTCX((x)+I) && __IS_FP(x) ? fun ## f (x) : __LDBLCX((x)+I) ? fun ## l (x) : fun(x) ))
3009#define __tg_real(fun,x) (__RETCAST(x)__tg_real_nocast(fun, x))
3010#define __tg_real_2(fun,x,y) (__RETCAST_2(x, y)( __FLT(x) && __FLT(y) ? fun ## f (x, y) : __LDBL((x)+(y)) ? fun ## l (x, y) : fun(x, y) ))
3011#define __tg_real_2_1(fun,x,y) (__RETCAST(x)( __FLT(x) ? fun ## f (x, y) : __LDBL(x) ? fun ## l (x, y) : fun(x, y) ))
3012#define __tg_real_complex(fun,x) (__RETCAST(x)( __FLTCX(x) ? c ## fun ## f (x) : __DBLCX(x) ? c ## fun (x) : __LDBLCX(x) ? c ## fun ## l (x) : __FLT(x) ? fun ## f (x) : __LDBL(x) ? fun ## l (x) : fun(x) ))
3013#define __tg_real_complex_fabs(x) (__RETCAST_REAL(x)( __FLTCX(x) ? cabsf(x) : __DBLCX(x) ? cabs(x) : __LDBLCX(x) ? cabsl(x) : __FLT(x) ? fabsf(x) : __LDBL(x) ? fabsl(x) : fabs(x) ))
3014#define __tg_real_complex_pow(x,y) (__RETCAST_2(x, y)( __FLTCX((x)+(y)) && __IS_FP(x) && __IS_FP(y) ? cpowf(x, y) : __FLTCX((x)+(y)) ? cpow(x, y) : __DBLCX((x)+(y)) ? cpow(x, y) : __LDBLCX((x)+(y)) ? cpowl(x, y) : __FLT(x) && __FLT(y) ? powf(x, y) : __LDBL((x)+(y)) ? powl(x, y) : pow(x, y) ))
3015#define __tg_real_fma(x,y,z) (__RETCAST_3(x, y, z)( __FLT(x) && __FLT(y) && __FLT(z) ? fmaf(x, y, z) : __LDBL((x)+(y)+(z)) ? fmal(x, y, z) : fma(x, y, z) ))
3016#define __tg_real_nocast(fun,x) ( __FLT(x) ? fun ## f (x) : __LDBL(x) ? fun ## l (x) : fun(x) )
3017#define __tg_real_remquo(x,y,z) (__RETCAST_2(x, y)( __FLT(x) && __FLT(y) ? remquof(x, y, z) : __LDBL((x)+(y)) ? remquol(x, y, z) : remquo(x, y, z) ))
3018#define __tm_gmtoff tm_gmtoff
3019#define __tm_zone tm_zone
3020#define __va_copy(d,s) __builtin_va_copy(d,s)
3021#define __wasi__ 1
3022#define __wasi_api_h
3023#define __wasi_libc_environ_h
3024#define __wasi_libc_find_relpath_h
3025#define __wasi_libc_h
3026#define __wasi_libc_nocwd_h
3027#define __wasilibc___errno_h
3028#define __wasilibc___errno_values_h
3029#define __wasilibc___fd_set_h
3030#define __wasilibc___function___isatty_h
3031#define __wasilibc___functions_malloc_h
3032#define __wasilibc___functions_memcpy_h
3033#define __wasilibc___header_dirent_h
3034#define __wasilibc___header_fcntl_h
3035#define __wasilibc___header_netinet_in_h
3036#define __wasilibc___header_poll_h
3037#define __wasilibc___header_stdlib_h
3038#define __wasilibc___header_string_h
3039#define __wasilibc___header_sys_ioctl_h
3040#define __wasilibc___header_sys_resource_h
3041#define __wasilibc___header_sys_socket_h
3042#define __wasilibc___header_sys_stat_h
3043#define __wasilibc___header_time_h
3044#define __wasilibc___header_unistd_h
3045#define __wasilibc___include_inttypes_h
3046#define __wasilibc___macro_FD_SETSIZE_h
3047#define __wasilibc___macro_PAGESIZE_h
3048#define __wasilibc___mode_t_h
3049#define __wasilibc___seek_h
3050#define __wasilibc___struct_dirent_h
3051#define __wasilibc___struct_in6_addr_h
3052#define __wasilibc___struct_in_addr_h
3053#define __wasilibc___struct_iovec_h
3054#define __wasilibc___struct_msghdr_h
3055#define __wasilibc___struct_pollfd_h
3056#define __wasilibc___struct_rusage_h
3057#define __wasilibc___struct_sockaddr_h
3058#define __wasilibc___struct_sockaddr_in6_h
3059#define __wasilibc___struct_sockaddr_in_h
3060#define __wasilibc___struct_sockaddr_storage_h
3061#define __wasilibc___struct_sockaddr_un_h
3062#define __wasilibc___struct_stat_h
3063#define __wasilibc___struct_timespec_h
3064#define __wasilibc___struct_timeval_h
3065#define __wasilibc___struct_tm_h
3066#define __wasilibc___struct_tms_h
3067#define __wasilibc___typedef_DIR_h
3068#define __wasilibc___typedef_blkcnt_t_h
3069#define __wasilibc___typedef_blksize_t_h
3070#define __wasilibc___typedef_clock_t_h
3071#define __wasilibc___typedef_clockid_t_h
3072#define __wasilibc___typedef_dev_t_h
3073#define __wasilibc___typedef_fd_set_h
3074#define __wasilibc___typedef_gid_t_h
3075#define __wasilibc___typedef_in_addr_t_h
3076#define __wasilibc___typedef_in_port_t_h
3077#define __wasilibc___typedef_ino_t_h
3078#define __wasilibc___typedef_mode_t_h
3079#define __wasilibc___typedef_nfds_t_h
3080#define __wasilibc___typedef_nlink_t_h
3081#define __wasilibc___typedef_off_t_h
3082#define __wasilibc___typedef_sa_family_t_h
3083#define __wasilibc___typedef_sigset_t_h
3084#define __wasilibc___typedef_socklen_t_h
3085#define __wasilibc___typedef_ssize_t_h
3086#define __wasilibc___typedef_suseconds_t_h
3087#define __wasilibc___typedef_time_t_h
3088#define __wasilibc___typedef_uid_t_h
3089#define __wasm 1
3090#define __wasm32 1
3091#define __wasm32__ 1
3092#define __wasm__ 1
3093#define _tolower(a) ((a)|0x20)
3094#define _toupper(a) ((a)&0x5f)
3095#define acos(x) __tg_real_complex(acos, (x))
3096#define acosh(x) __tg_real_complex(acosh, (x))
3097#define alignas _Alignas
3098#define alignof _Alignof
3099#define alloca __builtin_alloca
3100#define alphasort64 alphasort
3101#define and &&
3102#define and_eq &=
3103#define asin(x) __tg_real_complex(asin, (x))
3104#define asinh(x) __tg_real_complex(asinh, (x))
3105#define assert(x) (void)0
3106#define atan(x) __tg_real_complex(atan, (x))
3107#define atan2(x,y) __tg_real_2(atan2, (x), (y))
3108#define atanh(x) __tg_real_complex(atanh, (x))
3109#define be16toh(x) __bswap16(x)
3110#define be32toh(x) __bswap32(x)
3111#define be64toh(x) __bswap64(x)
3112#define betoh16(x) __bswap16(x)
3113#define betoh32(x) __bswap32(x)
3114#define betoh64(x) __bswap64(x)
3115#define bitand &
3116#define bitor |
3117#define blkcnt64_t blkcnt_t
3118#define bool _Bool
3119#define bswap_16(x) __bswap_16(x)
3120#define bswap_32(x) __bswap_32(x)
3121#define bswap_64(x) __bswap_64(x)
3122#define carg(x) __tg_complex_retreal(carg, (x))
3123#define cbrt(x) __tg_real(cbrt, (x))
3124#define ceil(x) __tg_real(ceil, (x))
3125#define cimag(x) __tg_complex_retreal(cimag, (x))
3126#define cimagf(x) (__builtin_cimagf(x))
3127#define cimagl(x) (__builtin_cimagl(x))
3128#define clrbit(x,i) __bitop(x,i,&=~)
3129#define compl ~
3130#define complex _Complex
3131#define conj(x) __tg_complex(conj, (x))
3132#define copysign(x,y) __tg_real_2(copysign, (x), (y))
3133#define cos(x) __tg_real_complex(cos, (x))
3134#define cosh(x) __tg_real_complex(cosh, (x))
3135#define cproj(x) __tg_complex(cproj, (x))
3136#define creal(x) __tg_complex_retreal(creal, (x))
3137#define crealf(x) (__builtin_crealf(x))
3138#define creall(x) (__builtin_creall(x))
3139#define creat64 creat
3140#define d_fileno d_ino
3141#define direct dirent
3142#define dirent64 dirent
3143#define erf(x) __tg_real(erf, (x))
3144#define erfc(x) __tg_real(erfc, (x))
3145#define errno errno
3146#define exp(x) __tg_real_complex(exp, (x))
3147#define exp2(x) __tg_real(exp2, (x))
3148#define expm1(x) __tg_real(expm1, (x))
3149#define fabs(x) __tg_real_complex_fabs(x)
3150#define false 0
3151#define fdim(x,y) __tg_real_2(fdim, (x), (y))
3152#define fgetpos64 fgetpos
3153#define floor(x) __tg_real(floor, (x))
3154#define fma(x,y,z) __tg_real_fma((x), (y), (z))
3155#define fmax(x,y) __tg_real_2(fmax, (x), (y))
3156#define fmin(x,y) __tg_real_2(fmin, (x), (y))
3157#define fmod(x,y) __tg_real_2(fmod, (x), (y))
3158#define fopen64 fopen
3159#define fpclassify(x) (__builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, x))
3160#define fpos64_t fpos_t
3161#define freopen64 freopen
3162#define frexp(x,y) __tg_real_2_1(frexp, (x), (y))
3163#define fsblkcnt64_t fsblkcnt_t
3164#define fseeko64 fseeko
3165#define fsetpos64 fsetpos
3166#define fsfilcnt64_t fsfilcnt_t
3167#define fstat64 fstat
3168#define fstatat64 fstatat
3169#define ftello64 ftello
3170#define ftruncate64 ftruncate
3171#define getdents64 getdents
3172#define glob64 glob
3173#define glob64_t glob_t
3174#define globfree64 globfree
3175#define howmany(n,d) (((n)+((d)-1))/(d))
3176#define htobe16(x) __bswap16(x)
3177#define htobe32(x) __bswap32(x)
3178#define htobe64(x) __bswap64(x)
3179#define htole16(x) (uint16_t)(x)
3180#define htole32(x) (uint32_t)(x)
3181#define htole64(x) (uint64_t)(x)
3182#define hypot(x,y) __tg_real_2(hypot, (x), (y))
3183#define icmp6_data16 icmp6_dataun.icmp6_un_data16
3184#define icmp6_data32 icmp6_dataun.icmp6_un_data32
3185#define icmp6_data8 icmp6_dataun.icmp6_un_data8
3186#define icmp6_id icmp6_data16[0]
3187#define icmp6_maxdelay icmp6_data16[0]
3188#define icmp6_mtu icmp6_data32[0]
3189#define icmp6_pptr icmp6_data32[0]
3190#define icmp6_seq icmp6_data16[1]
3191#define icmp_data icmp_dun.id_data
3192#define icmp_gwaddr icmp_hun.ih_gwaddr
3193#define icmp_id icmp_hun.ih_idseq.icd_id
3194#define icmp_ip icmp_dun.id_ip.idi_ip
3195#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
3196#define icmp_mask icmp_dun.id_mask
3197#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
3198#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
3199#define icmp_otime icmp_dun.id_ts.its_otime
3200#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
3201#define icmp_pptr icmp_hun.ih_pptr
3202#define icmp_radv icmp_dun.id_radv
3203#define icmp_rtime icmp_dun.id_ts.its_rtime
3204#define icmp_seq icmp_hun.ih_idseq.icd_seq
3205#define icmp_ttime icmp_dun.id_ts.its_ttime
3206#define icmp_void icmp_hun.ih_void
3207#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
3208#define ifa_broadaddr ifa_ifu.ifu_broadaddr
3209#define ifa_dstaddr ifa_ifu.ifu_dstaddr
3210#define ilogb(x) __tg_real_nocast(ilogb, (x))
3211#define ino64_t ino_t
3212#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow
3213#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim
3214#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim
3215#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
3216#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen
3217#define ip6_vfc ip6_ctlun.ip6_un2_vfc
3218#define isalpha(a) (0 ? isalpha(a) : (((unsigned)(a)|32)-'a') < 26)
3219#define isascii(a) (0 ? isascii(a) : (unsigned)(a) < 128)
3220#define isclr(x,i) !isset(x,i)
3221#define isdigit(a) (0 ? isdigit(a) : ((unsigned)(a)-'0') < 10)
3222#define isfinite(x) (__builtin_isfinite(x))
3223#define isgraph(a) (0 ? isgraph(a) : ((unsigned)(a)-0x21) < 0x5e)
3224#define isgreater(x,y) (__builtin_isgreater(x, y))
3225#define isgreaterequal(x,y) (__builtin_isgreaterequal(x, y))
3226#define isinf(x) (__builtin_isinf(x))
3227#define isless(x,y) (__builtin_isless(x, y))
3228#define islessequal(x,y) (__builtin_islessequal(x, y))
3229#define islessgreater(x,y) (__builtin_islessgreater(x, y))
3230#define islower(a) (0 ? islower(a) : ((unsigned)(a)-'a') < 26)
3231#define isnan(x) (__builtin_isnan(x))
3232#define isnormal(x) (__builtin_isnormal(x))
3233#define isprint(a) (0 ? isprint(a) : ((unsigned)(a)-0x20) < 0x5f)
3234#define isset(x,i) __bitop(x,i,&)
3235#define isspace(a) __isspace(a)
3236#define isunordered(x,y) (__builtin_isunordered(x, y))
3237#define isupper(a) (0 ? isupper(a) : ((unsigned)(a)-'A') < 26)
3238#define iswdigit(a) (0 ? iswdigit(a) : ((unsigned)(a)-'0') < 10)
3239#define ldexp(x,y) __tg_real_2_1(ldexp, (x), (y))
3240#define le16toh(x) (uint16_t)(x)
3241#define le32toh(x) (uint32_t)(x)
3242#define le64toh(x) (uint64_t)(x)
3243#define letoh16(x) (uint16_t)(x)
3244#define letoh32(x) (uint32_t)(x)
3245#define letoh64(x) (uint64_t)(x)
3246#define lgamma(x) __tg_real(lgamma, (x))
3247#define llrint(x) __tg_real_nocast(llrint, (x))
3248#define llround(x) __tg_real_nocast(llround, (x))
3249#define loff_t off_t
3250#define log(x) __tg_real_complex(log, (x))
3251#define log10(x) __tg_real(log10, (x))
3252#define log1p(x) __tg_real(log1p, (x))
3253#define log2(x) __tg_real(log2, (x))
3254#define logb(x) __tg_real(logb, (x))
3255#define lrint(x) __tg_real_nocast(lrint, (x))
3256#define lround(x) __tg_real_nocast(lround, (x))
3257#define lseek(fd,offset,whence) ({ off_t __f = (fd); off_t __o = (offset); off_t __w = (whence); __builtin_constant_p((offset)) && __builtin_constant_p((whence)) && __o == 0 && __w == SEEK_CUR ? __wasilibc_tell(__f) : lseek(__f, __o, __w); })
3258#define lseek64 lseek
3259#define lstat64 lstat
3260#define math_errhandling 2
3261#define mld_cksum mld_icmp6_hdr.icmp6_cksum
3262#define mld_code mld_icmp6_hdr.icmp6_code
3263#define mld_maxdelay mld_icmp6_hdr.icmp6_data16[0]
3264#define mld_reserved mld_icmp6_hdr.icmp6_data16[1]
3265#define mld_type mld_icmp6_hdr.icmp6_type
3266#define nd_na_cksum nd_na_hdr.icmp6_cksum
3267#define nd_na_code nd_na_hdr.icmp6_code
3268#define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0]
3269#define nd_na_type nd_na_hdr.icmp6_type
3270#define nd_ns_cksum nd_ns_hdr.icmp6_cksum
3271#define nd_ns_code nd_ns_hdr.icmp6_code
3272#define nd_ns_reserved nd_ns_hdr.icmp6_data32[0]
3273#define nd_ns_type nd_ns_hdr.icmp6_type
3274#define nd_ra_cksum nd_ra_hdr.icmp6_cksum
3275#define nd_ra_code nd_ra_hdr.icmp6_code
3276#define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0]
3277#define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1]
3278#define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1]
3279#define nd_ra_type nd_ra_hdr.icmp6_type
3280#define nd_rd_cksum nd_rd_hdr.icmp6_cksum
3281#define nd_rd_code nd_rd_hdr.icmp6_code
3282#define nd_rd_reserved nd_rd_hdr.icmp6_data32[0]
3283#define nd_rd_type nd_rd_hdr.icmp6_type
3284#define nd_rs_cksum nd_rs_hdr.icmp6_cksum
3285#define nd_rs_code nd_rs_hdr.icmp6_code
3286#define nd_rs_reserved nd_rs_hdr.icmp6_data32[0]
3287#define nd_rs_type nd_rs_hdr.icmp6_type
3288#define nearbyint(x) __tg_real(nearbyint, (x))
3289#define nextafter(x,y) __tg_real_2(nextafter, (x), (y))
3290#define nexttoward(x,y) __tg_real_2(nexttoward, (x), (y))
3291#define nftw64 nftw
3292#define no_argument 0
3293#define noreturn _Noreturn
3294#define not !
3295#define not_eq !=
3296#define ns_msg_base(handle) ((handle)._msg + 0)
3297#define ns_msg_count(handle,section) ((handle)._counts[section] + 0)
3298#define ns_msg_end(handle) ((handle)._eom + 0)
3299#define ns_msg_getflag(handle,flag) (((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift)
3300#define ns_msg_id(handle) ((handle)._id + 0)
3301#define ns_msg_size(handle) ((handle)._eom - (handle)._msg)
3302#define ns_rr_class(rr) ((ns_class)((rr).rr_class + 0))
3303#define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".")
3304#define ns_rr_rdata(rr) ((rr).rdata + 0)
3305#define ns_rr_rdlen(rr) ((rr).rdlength + 0)
3306#define ns_rr_ttl(rr) ((rr).ttl + 0)
3307#define ns_rr_type(rr) ((ns_type)((rr).type + 0))
3308#define ns_t_mrr_p(t) ((t) == ns_t_tsig || (t) == ns_t_opt)
3309#define ns_t_qt_p(t) (ns_t_xfr_p(t) || (t) == ns_t_any || (t) == ns_t_mailb || (t) == ns_t_maila)
3310#define ns_t_rr_p(t) (!ns_t_qt_p(t) && !ns_t_mrr_p(t))
3311#define ns_t_udp_p(t) ((t) != ns_t_axfr && (t) != ns_t_zxfr)
3312#define ns_t_xfr_p(t) ((t) == ns_t_axfr || (t) == ns_t_ixfr || (t) == ns_t_zxfr)
3313#define off64_t off_t
3314#define offsetof(t,d) __builtin_offsetof(t, d)
3315#define open64 open
3316#define openat64 openat
3317#define optional_argument 2
3318#define or ||
3319#define or_eq |=
3320#define posix_fadvise64 posix_fadvise
3321#define posix_fallocate64 posix_fallocate
3322#define pow(x,y) __tg_real_complex_pow((x), (y))
3323#define powerof2(n) !(((n)-1) & (n))
3324#define pread64 pread
3325#define preadv64 preadv
3326#define pwrite64 pwrite
3327#define pwritev64 pwritev
3328#define readdir64 readdir
3329#define remainder(x,y) __tg_real_2(remainder, (x), (y))
3330#define remquo(x,y,z) __tg_real_remquo((x), (y), (z))
3331#define required_argument 1
3332#define rint(x) __tg_real(rint, (x))
3333#define round(x) __tg_real(round, (x))
3334#define roundup(n,d) (howmany(n,d)*(d))
3335#define rr_cksum rr_hdr.icmp6_cksum
3336#define rr_code rr_hdr.icmp6_code
3337#define rr_seqnum rr_hdr.icmp6_data32[0]
3338#define rr_type rr_hdr.icmp6_type
3339#define scalbln(x,y) __tg_real_2_1(scalbln, (x), (y))
3340#define scalbn(x,y) __tg_real_2_1(scalbn, (x), (y))
3341#define scandir64 scandir
3342#define setbit(x,i) __bitop(x,i,|=)
3343#define signbit(x) (__builtin_signbit(x))
3344#define sin(x) __tg_real_complex(sin, (x))
3345#define sinh(x) __tg_real_complex(sinh, (x))
3346#define sqrt(x) __tg_real_complex(sqrt, (x))
3347#define st_atime st_atim.tv_sec
3348#define st_ctime st_ctim.tv_sec
3349#define st_mtime st_mtim.tv_sec
3350#define stat64 stat
3351#define static_assert _Static_assert
3352#define stderr (stderr)
3353#define stdin (stdin)
3354#define stdout (stdout)
3355#define strdupa(x) strcpy(alloca(strlen(x)+1),x)
3356#define tan(x) __tg_real_complex(tan, (x))
3357#define tanh(x) __tg_real_complex(tanh, (x))
3358#define telcmds ((char [][6]){ "EOF", "SUSP", "ABORT", "EOR", "SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC", "EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0 })
3359#define tgamma(x) __tg_real(tgamma, (x))
3360#define th_block th_u.tu_block
3361#define th_code th_u.tu_code
3362#define th_msg th_data
3363#define th_stuff th_u.tu_stuff
3364#define thrd_equal(A,B) ((A) == (B))
3365#define thread_local _Thread_local
3366#define timeradd(s,t,a) (void) ( (a)->tv_sec = (s)->tv_sec + (t)->tv_sec, ((a)->tv_usec = (s)->tv_usec + (t)->tv_usec) >= 1000000 && ((a)->tv_usec -= 1000000, (a)->tv_sec++) )
3367#define timerclear(t) ((t)->tv_sec = (t)->tv_usec = 0)
3368#define timercmp(s,t,op) ((s)->tv_sec == (t)->tv_sec ? (s)->tv_usec op (t)->tv_usec : (s)->tv_sec op (t)->tv_sec)
3369#define timerisset(t) ((t)->tv_sec || (t)->tv_usec)
3370#define timersub(s,t,a) (void) ( (a)->tv_sec = (s)->tv_sec - (t)->tv_sec, ((a)->tv_usec = (s)->tv_usec - (t)->tv_usec) < 0 && ((a)->tv_usec += 1000000, (a)->tv_sec--) )
3371#define true 1
3372#define trunc(x) __tg_real(trunc, (x))
3373#define uh_dport dest
3374#define uh_sport source
3375#define uh_sum check
3376#define uh_ulen len
3377#define va_arg(ap,type) __builtin_va_arg(ap, type)
3378#define va_copy(dest,src) __builtin_va_copy(dest, src)
3379#define va_end(ap) __builtin_va_end(ap)
3380#define va_start(ap,param) __builtin_va_start(ap, param)
3381#define versionsort64 versionsort
3382#define xEOF 236
3383#define xor ^
3384#define xor_eq ^=
lib/libc/wasi/expected/wasm32-wasi/undefined-symbols.txt deleted-68
...@@ -1,68 +0,0 @@
1__addtf3
2__divtf3
3__eqtf2
4__extenddftf2
5__extendsftf2
6__fixtfdi
7__fixtfsi
8__fixunstfsi
9__floatsitf
10__floatunsitf
11__getf2
12__gttf2
13__heap_base
14__imported_wasi_snapshot_preview1_args_get
15__imported_wasi_snapshot_preview1_args_sizes_get
16__imported_wasi_snapshot_preview1_clock_res_get
17__imported_wasi_snapshot_preview1_clock_time_get
18__imported_wasi_snapshot_preview1_environ_get
19__imported_wasi_snapshot_preview1_environ_sizes_get
20__imported_wasi_snapshot_preview1_fd_advise
21__imported_wasi_snapshot_preview1_fd_allocate
22__imported_wasi_snapshot_preview1_fd_close
23__imported_wasi_snapshot_preview1_fd_datasync
24__imported_wasi_snapshot_preview1_fd_fdstat_get
25__imported_wasi_snapshot_preview1_fd_fdstat_set_flags
26__imported_wasi_snapshot_preview1_fd_fdstat_set_rights
27__imported_wasi_snapshot_preview1_fd_filestat_get
28__imported_wasi_snapshot_preview1_fd_filestat_set_size
29__imported_wasi_snapshot_preview1_fd_filestat_set_times
30__imported_wasi_snapshot_preview1_fd_pread
31__imported_wasi_snapshot_preview1_fd_prestat_dir_name
32__imported_wasi_snapshot_preview1_fd_prestat_get
33__imported_wasi_snapshot_preview1_fd_pwrite
34__imported_wasi_snapshot_preview1_fd_read
35__imported_wasi_snapshot_preview1_fd_readdir
36__imported_wasi_snapshot_preview1_fd_renumber
37__imported_wasi_snapshot_preview1_fd_seek
38__imported_wasi_snapshot_preview1_fd_sync
39__imported_wasi_snapshot_preview1_fd_tell
40__imported_wasi_snapshot_preview1_fd_write
41__imported_wasi_snapshot_preview1_path_create_directory
42__imported_wasi_snapshot_preview1_path_filestat_get
43__imported_wasi_snapshot_preview1_path_filestat_set_times
44__imported_wasi_snapshot_preview1_path_link
45__imported_wasi_snapshot_preview1_path_open
46__imported_wasi_snapshot_preview1_path_readlink
47__imported_wasi_snapshot_preview1_path_remove_directory
48__imported_wasi_snapshot_preview1_path_rename
49__imported_wasi_snapshot_preview1_path_symlink
50__imported_wasi_snapshot_preview1_path_unlink_file
51__imported_wasi_snapshot_preview1_poll_oneoff
52__imported_wasi_snapshot_preview1_proc_exit
53__imported_wasi_snapshot_preview1_proc_raise
54__imported_wasi_snapshot_preview1_random_get
55__imported_wasi_snapshot_preview1_sched_yield
56__imported_wasi_snapshot_preview1_sock_recv
57__imported_wasi_snapshot_preview1_sock_send
58__imported_wasi_snapshot_preview1_sock_shutdown
59__letf2
60__lttf2
61__netf2
62__stack_pointer
63__subtf3
64__trunctfdf2
65__trunctfsf2
66__unordtf2
67__wasm_call_ctors
68main
lib/libc/wasi/libc-bottom-half/headers/public/__errno.h deleted-20
...@@ -1,20 +0,0 @@
1#ifndef __wasilibc___errno_h
2#define __wasilibc___errno_h
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#ifdef __cplusplus
9extern thread_local int errno;
10#else
11extern _Thread_local int errno;
12#endif
13
14#define errno errno
15
16#ifdef __cplusplus
17}
18#endif
19
20#endif
lib/libc/wasi/libc-bottom-half/headers/public/__errno_values.h deleted-86
...@@ -1,86 +0,0 @@
1#ifndef __wasilibc___errno_values_h
2#define __wasilibc___errno_values_h
3
4#include <wasi/api.h>
5
6#define E2BIG __WASI_ERRNO_2BIG
7#define EACCES __WASI_ERRNO_ACCES
8#define EADDRINUSE __WASI_ERRNO_ADDRINUSE
9#define EADDRNOTAVAIL __WASI_ERRNO_ADDRNOTAVAIL
10#define EAFNOSUPPORT __WASI_ERRNO_AFNOSUPPORT
11#define EAGAIN __WASI_ERRNO_AGAIN
12#define EALREADY __WASI_ERRNO_ALREADY
13#define EBADF __WASI_ERRNO_BADF
14#define EBADMSG __WASI_ERRNO_BADMSG
15#define EBUSY __WASI_ERRNO_BUSY
16#define ECANCELED __WASI_ERRNO_CANCELED
17#define ECHILD __WASI_ERRNO_CHILD
18#define ECONNABORTED __WASI_ERRNO_CONNABORTED
19#define ECONNREFUSED __WASI_ERRNO_CONNREFUSED
20#define ECONNRESET __WASI_ERRNO_CONNRESET
21#define EDEADLK __WASI_ERRNO_DEADLK
22#define EDESTADDRREQ __WASI_ERRNO_DESTADDRREQ
23#define EDOM __WASI_ERRNO_DOM
24#define EDQUOT __WASI_ERRNO_DQUOT
25#define EEXIST __WASI_ERRNO_EXIST
26#define EFAULT __WASI_ERRNO_FAULT
27#define EFBIG __WASI_ERRNO_FBIG
28#define EHOSTUNREACH __WASI_ERRNO_HOSTUNREACH
29#define EIDRM __WASI_ERRNO_IDRM
30#define EILSEQ __WASI_ERRNO_ILSEQ
31#define EINPROGRESS __WASI_ERRNO_INPROGRESS
32#define EINTR __WASI_ERRNO_INTR
33#define EINVAL __WASI_ERRNO_INVAL
34#define EIO __WASI_ERRNO_IO
35#define EISCONN __WASI_ERRNO_ISCONN
36#define EISDIR __WASI_ERRNO_ISDIR
37#define ELOOP __WASI_ERRNO_LOOP
38#define EMFILE __WASI_ERRNO_MFILE
39#define EMLINK __WASI_ERRNO_MLINK
40#define EMSGSIZE __WASI_ERRNO_MSGSIZE
41#define EMULTIHOP __WASI_ERRNO_MULTIHOP
42#define ENAMETOOLONG __WASI_ERRNO_NAMETOOLONG
43#define ENETDOWN __WASI_ERRNO_NETDOWN
44#define ENETRESET __WASI_ERRNO_NETRESET
45#define ENETUNREACH __WASI_ERRNO_NETUNREACH
46#define ENFILE __WASI_ERRNO_NFILE
47#define ENOBUFS __WASI_ERRNO_NOBUFS
48#define ENODEV __WASI_ERRNO_NODEV
49#define ENOENT __WASI_ERRNO_NOENT
50#define ENOEXEC __WASI_ERRNO_NOEXEC
51#define ENOLCK __WASI_ERRNO_NOLCK
52#define ENOLINK __WASI_ERRNO_NOLINK
53#define ENOMEM __WASI_ERRNO_NOMEM
54#define ENOMSG __WASI_ERRNO_NOMSG
55#define ENOPROTOOPT __WASI_ERRNO_NOPROTOOPT
56#define ENOSPC __WASI_ERRNO_NOSPC
57#define ENOSYS __WASI_ERRNO_NOSYS
58#define ENOTCONN __WASI_ERRNO_NOTCONN
59#define ENOTDIR __WASI_ERRNO_NOTDIR
60#define ENOTEMPTY __WASI_ERRNO_NOTEMPTY
61#define ENOTRECOVERABLE __WASI_ERRNO_NOTRECOVERABLE
62#define ENOTSOCK __WASI_ERRNO_NOTSOCK
63#define ENOTSUP __WASI_ERRNO_NOTSUP
64#define ENOTTY __WASI_ERRNO_NOTTY
65#define ENXIO __WASI_ERRNO_NXIO
66#define EOVERFLOW __WASI_ERRNO_OVERFLOW
67#define EOWNERDEAD __WASI_ERRNO_OWNERDEAD
68#define EPERM __WASI_ERRNO_PERM
69#define EPIPE __WASI_ERRNO_PIPE
70#define EPROTO __WASI_ERRNO_PROTO
71#define EPROTONOSUPPORT __WASI_ERRNO_PROTONOSUPPORT
72#define EPROTOTYPE __WASI_ERRNO_PROTOTYPE
73#define ERANGE __WASI_ERRNO_RANGE
74#define EROFS __WASI_ERRNO_ROFS
75#define ESPIPE __WASI_ERRNO_SPIPE
76#define ESRCH __WASI_ERRNO_SRCH
77#define ESTALE __WASI_ERRNO_STALE
78#define ETIMEDOUT __WASI_ERRNO_TIMEDOUT
79#define ETXTBSY __WASI_ERRNO_TXTBSY
80#define EXDEV __WASI_ERRNO_XDEV
81#define ENOTCAPABLE __WASI_ERRNO_NOTCAPABLE
82
83#define EOPNOTSUPP ENOTSUP
84#define EWOULDBLOCK EAGAIN
85
86#endif
lib/libc/wasi/libc-bottom-half/headers/public/__fd_set.h deleted-76
...@@ -1,76 +0,0 @@
1#ifndef __wasilibc___fd_set_h
2#define __wasilibc___fd_set_h
3
4#include <__typedef_fd_set.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10static __inline void FD_CLR(int __fd, fd_set *__set) {
11 size_t __n = __set->__nfds;
12 for (int *__p = __set->__fds, *__e = __p + __n;
13 __p < __e; ++__p)
14 {
15 if (*__p == __fd) {
16 *__p = __e[-1];
17 __set->__nfds = __n - 1;
18 return;
19 }
20 }
21}
22
23static __inline
24#ifdef __cplusplus
25bool
26#else
27_Bool
28#endif
29FD_ISSET(int __fd, const fd_set *__set)
30{
31 size_t __n = __set->__nfds;
32 for (const int *__p = __set->__fds, *__e = __p + __n;
33 __p < __e; ++__p)
34 {
35 if (*__p == __fd) {
36 return 1;
37 }
38 }
39 return 0;
40}
41
42static __inline void FD_SET(int __fd, fd_set *__set) {
43 size_t __n = __set->__nfds;
44 for (const int *__p = __set->__fds, *__e = __p + __n;
45 __p < __e; ++__p)
46 {
47 if (*__p == __fd) {
48 return;
49 }
50 }
51 __set->__nfds = __n + 1;
52 __set->__fds[__n] = __fd;
53}
54
55static __inline void FD_ZERO(fd_set *__set) {
56 __set->__nfds = 0;
57}
58
59static __inline void FD_COPY(const fd_set *__restrict __from,
60 fd_set *__restrict __to) {
61 size_t __n = __from->__nfds;
62 __to->__nfds = __n;
63 __builtin_memcpy(__to->__fds, __from->__fds, __n * sizeof(int));
64}
65
66#define FD_CLR(fd, set) (FD_CLR((fd), (set)))
67#define FD_ISSET(fd, set) (FD_ISSET((fd), (set)))
68#define FD_SET(fd, set) (FD_SET((fd), (set)))
69#define FD_ZERO(set) (FD_ZERO((set)))
70#define FD_COPY(from, to) (FD_COPY((from), (to)))
71
72#ifdef __cplusplus
73}
74#endif
75
76#endif
lib/libc/wasi/libc-bottom-half/headers/public/__function___isatty.h deleted-14
...@@ -1,14 +0,0 @@
1#ifndef __wasilibc___function___isatty_h
2#define __wasilibc___function___isatty_h
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8int __isatty(int fd);
9
10#ifdef __cplusplus
11}
12#endif
13
14#endif
lib/libc/wasi/libc-bottom-half/headers/public/__functions_malloc.h deleted-26
...@@ -1,26 +0,0 @@
1#ifndef __wasilibc___functions_malloc_h
2#define __wasilibc___functions_malloc_h
3
4#define __need_size_t
5#define __need_wchar_t
6#define __need_NULL
7#include <stddef.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13void *malloc(size_t __size) __attribute__((__malloc__, __warn_unused_result__));
14void free(void *__ptr);
15void *calloc(size_t __nmemb, size_t __size) __attribute__((__malloc__, __warn_unused_result__));
16void *realloc(void *__ptr, size_t __size) __attribute__((__warn_unused_result__));
17
18#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
19void *reallocarray(void *__ptr, size_t __nmemb, size_t __size) __attribute__((__warn_unused_result__));
20#endif
21
22#ifdef __cplusplus
23}
24#endif
25
26#endif
lib/libc/wasi/libc-bottom-half/headers/public/__functions_memcpy.h deleted-20
...@@ -1,20 +0,0 @@
1#ifndef __wasilibc___functions_memcpy_h
2#define __wasilibc___functions_memcpy_h
3
4#define __need_size_t
5#define __need_NULL
6#include <stddef.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12void *memcpy(void *__restrict__ __dst, const void *__restrict__ __src, size_t __n) __attribute__((__nothrow__, __leaf__, __nonnull__(1, 2)));
13void *memmove(void *__dst, const void *__src, size_t __n) __attribute__((__nothrow__, __leaf__, __nonnull__(1, 2)));
14void *memset(void *__dst, int __c, size_t __n) __attribute__((__nothrow__, __leaf__, __nonnull__(1)));
15
16#ifdef __cplusplus
17}
18#endif
19
20#endif
lib/libc/wasi/libc-bottom-half/headers/public/__header_dirent.h deleted-39
...@@ -1,39 +0,0 @@
1#ifndef __wasilibc___header_dirent_h
2#define __wasilibc___header_dirent_h
3
4#include <wasi/api.h>
5
6#define DT_BLK __WASI_FILETYPE_BLOCK_DEVICE
7#define DT_CHR __WASI_FILETYPE_CHARACTER_DEVICE
8#define DT_DIR __WASI_FILETYPE_DIRECTORY
9#define DT_FIFO __WASI_FILETYPE_SOCKET_STREAM
10#define DT_LNK __WASI_FILETYPE_SYMBOLIC_LINK
11#define DT_REG __WASI_FILETYPE_REGULAR_FILE
12#define DT_UNKNOWN __WASI_FILETYPE_UNKNOWN
13
14#include <__struct_dirent.h>
15#include <__typedef_DIR.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21int closedir(DIR *);
22DIR *opendir(const char *);
23DIR *fdopendir(int);
24int fdclosedir(DIR *);
25struct dirent *readdir(DIR *);
26void rewinddir(DIR *);
27void seekdir(DIR *, long);
28long telldir(DIR *);
29DIR *opendirat(int, const char *);
30void rewinddir(DIR *);
31int scandirat(int, const char *, struct dirent ***,
32 int (*)(const struct dirent *),
33 int (*)(const struct dirent **, const struct dirent **));
34
35#ifdef __cplusplus
36}
37#endif
38
39#endif
lib/libc/wasi/libc-bottom-half/headers/public/__header_fcntl.h deleted-61
...@@ -1,61 +0,0 @@
1#ifndef __wasilibc___header_fcntl_h
2#define __wasilibc___header_fcntl_h
3
4#include <wasi/api.h>
5#include <__seek.h>
6#include <__mode_t.h>
7
8#define O_APPEND __WASI_FDFLAGS_APPEND
9#define O_DSYNC __WASI_FDFLAGS_DSYNC
10#define O_NONBLOCK __WASI_FDFLAGS_NONBLOCK
11#define O_RSYNC __WASI_FDFLAGS_RSYNC
12#define O_SYNC __WASI_FDFLAGS_SYNC
13#define O_CREAT (__WASI_OFLAGS_CREAT << 12)
14#define O_DIRECTORY (__WASI_OFLAGS_DIRECTORY << 12)
15#define O_EXCL (__WASI_OFLAGS_EXCL << 12)
16#define O_TRUNC (__WASI_OFLAGS_TRUNC << 12)
17
18#define O_NOFOLLOW (0x01000000)
19#define O_EXEC (0x02000000)
20#define O_RDONLY (0x04000000)
21#define O_SEARCH (0x08000000)
22#define O_WRONLY (0x10000000)
23
24/*
25 * O_CLOEXEC is defined to be zero, as WASI has no exec-style functions.
26 */
27#define O_CLOEXEC (0)
28
29/*
30 * O_TTY_INIT is defined to be zero, meaning that WASI implementations are
31 * expected to always initialize a terminal the first time it's opened.
32 */
33#define O_TTY_INIT (0)
34
35#define O_NOCTTY (0)
36
37#define O_RDWR (O_RDONLY | O_WRONLY)
38#define O_ACCMODE (O_EXEC | O_RDWR | O_SEARCH)
39
40#define POSIX_FADV_DONTNEED __WASI_ADVICE_DONTNEED
41#define POSIX_FADV_NOREUSE __WASI_ADVICE_NOREUSE
42#define POSIX_FADV_NORMAL __WASI_ADVICE_NORMAL
43#define POSIX_FADV_RANDOM __WASI_ADVICE_RANDOM
44#define POSIX_FADV_SEQUENTIAL __WASI_ADVICE_SEQUENTIAL
45#define POSIX_FADV_WILLNEED __WASI_ADVICE_WILLNEED
46
47#define F_GETFD (1)
48#define F_SETFD (2)
49#define F_GETFL (3)
50#define F_SETFL (4)
51
52#define FD_CLOEXEC (1)
53
54#define AT_EACCESS (0x0)
55#define AT_SYMLINK_NOFOLLOW (0x1)
56#define AT_SYMLINK_FOLLOW (0x2)
57#define AT_REMOVEDIR (0x4)
58
59#define AT_FDCWD (-2)
60
61#endif
lib/libc/wasi/libc-bottom-half/headers/public/__header_inttypes.h deleted-182
...@@ -1,182 +0,0 @@
1#ifndef __wasilibc___include_inttypes_h
2#define __wasilibc___include_inttypes_h
3
4#include <stdint.h>
5
6#define __need_wchar_t
7#include <stddef.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13typedef struct { intmax_t quot, rem; } imaxdiv_t;
14
15intmax_t imaxabs(intmax_t);
16imaxdiv_t imaxdiv(intmax_t, intmax_t);
17intmax_t strtoimax(const char *__restrict, char **__restrict, int);
18uintmax_t strtoumax(const char *__restrict, char **__restrict, int);
19intmax_t wcstoimax(const wchar_t *__restrict, wchar_t **__restrict, int);
20uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int);
21
22#define PRId16 __INT16_FMTd__
23#define PRIi16 __INT16_FMTi__
24#define PRId32 __INT32_FMTd__
25#define PRIi32 __INT32_FMTi__
26#define PRId64 __INT64_FMTd__
27#define PRIi64 __INT64_FMTi__
28#define PRId8 __INT8_FMTd__
29#define PRIi8 __INT8_FMTi__
30#define PRIdMAX __INTMAX_FMTd__
31#define PRIiMAX __INTMAX_FMTi__
32#define PRIdPTR __INTPTR_FMTd__
33#define PRIiPTR __INTPTR_FMTi__
34#define PRIdFAST16 __INT_FAST16_FMTd__
35#define PRIiFAST16 __INT_FAST16_FMTi__
36#define PRIdFAST32 __INT_FAST32_FMTd__
37#define PRIiFAST32 __INT_FAST32_FMTi__
38#define PRIdFAST64 __INT_FAST64_FMTd__
39#define PRIiFAST64 __INT_FAST64_FMTi__
40#define PRIdFAST8 __INT_FAST8_FMTd__
41#define PRIiFAST8 __INT_FAST8_FMTi__
42#define PRIdLEAST16 __INT_LEAST16_FMTd__
43#define PRIiLEAST16 __INT_LEAST16_FMTi__
44#define PRIdLEAST32 __INT_LEAST32_FMTd__
45#define PRIiLEAST32 __INT_LEAST32_FMTi__
46#define PRIdLEAST64 __INT_LEAST64_FMTd__
47#define PRIiLEAST64 __INT_LEAST64_FMTi__
48#define PRIdLEAST8 __INT_LEAST8_FMTd__
49#define PRIiLEAST8 __INT_LEAST8_FMTi__
50#define PRIX16 __UINT16_FMTX__
51#define PRIo16 __UINT16_FMTo__
52#define PRIu16 __UINT16_FMTu__
53#define PRIx16 __UINT16_FMTx__
54#define PRIX32 __UINT32_FMTX__
55#define PRIo32 __UINT32_FMTo__
56#define PRIu32 __UINT32_FMTu__
57#define PRIx32 __UINT32_FMTx__
58#define PRIX64 __UINT64_FMTX__
59#define PRIo64 __UINT64_FMTo__
60#define PRIu64 __UINT64_FMTu__
61#define PRIx64 __UINT64_FMTx__
62#define PRIX8 __UINT8_FMTX__
63#define PRIo8 __UINT8_FMTo__
64#define PRIu8 __UINT8_FMTu__
65#define PRIx8 __UINT8_FMTx__
66#define PRIXMAX __UINTMAX_FMTX__
67#define PRIoMAX __UINTMAX_FMTo__
68#define PRIuMAX __UINTMAX_FMTu__
69#define PRIxMAX __UINTMAX_FMTx__
70#define PRIXPTR __UINTPTR_FMTX__
71#define PRIoPTR __UINTPTR_FMTo__
72#define PRIuPTR __UINTPTR_FMTu__
73#define PRIxPTR __UINTPTR_FMTx__
74#define PRIXFAST16 __UINT_FAST16_FMTX__
75#define PRIoFAST16 __UINT_FAST16_FMTo__
76#define PRIuFAST16 __UINT_FAST16_FMTu__
77#define PRIxFAST16 __UINT_FAST16_FMTx__
78#define PRIXFAST32 __UINT_FAST32_FMTX__
79#define PRIoFAST32 __UINT_FAST32_FMTo__
80#define PRIuFAST32 __UINT_FAST32_FMTu__
81#define PRIxFAST32 __UINT_FAST32_FMTx__
82#define PRIXFAST64 __UINT_FAST64_FMTX__
83#define PRIoFAST64 __UINT_FAST64_FMTo__
84#define PRIuFAST64 __UINT_FAST64_FMTu__
85#define PRIxFAST64 __UINT_FAST64_FMTx__
86#define PRIXFAST8 __UINT_FAST8_FMTX__
87#define PRIoFAST8 __UINT_FAST8_FMTo__
88#define PRIuFAST8 __UINT_FAST8_FMTu__
89#define PRIxFAST8 __UINT_FAST8_FMTx__
90#define PRIXLEAST16 __UINT_LEAST16_FMTX__
91#define PRIoLEAST16 __UINT_LEAST16_FMTo__
92#define PRIuLEAST16 __UINT_LEAST16_FMTu__
93#define PRIxLEAST16 __UINT_LEAST16_FMTx__
94#define PRIXLEAST32 __UINT_LEAST32_FMTX__
95#define PRIoLEAST32 __UINT_LEAST32_FMTo__
96#define PRIuLEAST32 __UINT_LEAST32_FMTu__
97#define PRIxLEAST32 __UINT_LEAST32_FMTx__
98#define PRIXLEAST64 __UINT_LEAST64_FMTX__
99#define PRIoLEAST64 __UINT_LEAST64_FMTo__
100#define PRIuLEAST64 __UINT_LEAST64_FMTu__
101#define PRIxLEAST64 __UINT_LEAST64_FMTx__
102#define PRIXLEAST8 __UINT_LEAST8_FMTX__
103#define PRIoLEAST8 __UINT_LEAST8_FMTo__
104#define PRIuLEAST8 __UINT_LEAST8_FMTu__
105#define PRIxLEAST8 __UINT_LEAST8_FMTx__
106
107#define SCNd16 __INT16_FMTd__
108#define SCNi16 __INT16_FMTi__
109#define SCNd32 __INT32_FMTd__
110#define SCNi32 __INT32_FMTi__
111#define SCNd64 __INT64_FMTd__
112#define SCNi64 __INT64_FMTi__
113#define SCNd8 __INT8_FMTd__
114#define SCNi8 __INT8_FMTi__
115#define SCNdMAX __INTMAX_FMTd__
116#define SCNiMAX __INTMAX_FMTi__
117#define SCNdPTR __INTPTR_FMTd__
118#define SCNiPTR __INTPTR_FMTi__
119#define SCNdFAST16 __INT_FAST16_FMTd__
120#define SCNiFAST16 __INT_FAST16_FMTi__
121#define SCNdFAST32 __INT_FAST32_FMTd__
122#define SCNiFAST32 __INT_FAST32_FMTi__
123#define SCNdFAST64 __INT_FAST64_FMTd__
124#define SCNiFAST64 __INT_FAST64_FMTi__
125#define SCNdFAST8 __INT_FAST8_FMTd__
126#define SCNiFAST8 __INT_FAST8_FMTi__
127#define SCNdLEAST16 __INT_LEAST16_FMTd__
128#define SCNiLEAST16 __INT_LEAST16_FMTi__
129#define SCNdLEAST32 __INT_LEAST32_FMTd__
130#define SCNiLEAST32 __INT_LEAST32_FMTi__
131#define SCNdLEAST64 __INT_LEAST64_FMTd__
132#define SCNiLEAST64 __INT_LEAST64_FMTi__
133#define SCNdLEAST8 __INT_LEAST8_FMTd__
134#define SCNiLEAST8 __INT_LEAST8_FMTi__
135#define SCNo16 __UINT16_FMTo__
136#define SCNu16 __UINT16_FMTu__
137#define SCNx16 __UINT16_FMTx__
138#define SCNo32 __UINT32_FMTo__
139#define SCNu32 __UINT32_FMTu__
140#define SCNx32 __UINT32_FMTx__
141#define SCNo64 __UINT64_FMTo__
142#define SCNu64 __UINT64_FMTu__
143#define SCNx64 __UINT64_FMTx__
144#define SCNo8 __UINT8_FMTo__
145#define SCNu8 __UINT8_FMTu__
146#define SCNx8 __UINT8_FMTx__
147#define SCNoMAX __UINTMAX_FMTo__
148#define SCNuMAX __UINTMAX_FMTu__
149#define SCNxMAX __UINTMAX_FMTx__
150#define SCNoPTR __UINTPTR_FMTo__
151#define SCNuPTR __UINTPTR_FMTu__
152#define SCNxPTR __UINTPTR_FMTx__
153#define SCNoFAST16 __UINT_FAST16_FMTo__
154#define SCNuFAST16 __UINT_FAST16_FMTu__
155#define SCNxFAST16 __UINT_FAST16_FMTx__
156#define SCNoFAST32 __UINT_FAST32_FMTo__
157#define SCNuFAST32 __UINT_FAST32_FMTu__
158#define SCNxFAST32 __UINT_FAST32_FMTx__
159#define SCNoFAST64 __UINT_FAST64_FMTo__
160#define SCNuFAST64 __UINT_FAST64_FMTu__
161#define SCNxFAST64 __UINT_FAST64_FMTx__
162#define SCNoFAST8 __UINT_FAST8_FMTo__
163#define SCNuFAST8 __UINT_FAST8_FMTu__
164#define SCNxFAST8 __UINT_FAST8_FMTx__
165#define SCNoLEAST16 __UINT_LEAST16_FMTo__
166#define SCNuLEAST16 __UINT_LEAST16_FMTu__
167#define SCNxLEAST16 __UINT_LEAST16_FMTx__
168#define SCNoLEAST32 __UINT_LEAST32_FMTo__
169#define SCNuLEAST32 __UINT_LEAST32_FMTu__
170#define SCNxLEAST32 __UINT_LEAST32_FMTx__
171#define SCNoLEAST64 __UINT_LEAST64_FMTo__
172#define SCNuLEAST64 __UINT_LEAST64_FMTu__
173#define SCNxLEAST64 __UINT_LEAST64_FMTx__
174#define SCNoLEAST8 __UINT_LEAST8_FMTo__
175#define SCNuLEAST8 __UINT_LEAST8_FMTu__
176#define SCNxLEAST8 __UINT_LEAST8_FMTx__
177
178#ifdef __cplusplus
179}
180#endif
181
182#endif
lib/libc/wasi/libc-bottom-half/headers/public/__header_netinet_in.h deleted-30
...@@ -1,30 +0,0 @@
1#ifndef __wasilibc___header_netinet_in_h
2#define __wasilibc___header_netinet_in_h
3
4#include <__struct_in_addr.h>
5#include <__struct_in6_addr.h>
6#include <__struct_sockaddr_in.h>
7#include <__struct_sockaddr_in6.h>
8
9#define IPPROTO_IP 0
10#define IPPROTO_ICMP 1
11#define IPPROTO_TCP 6
12#define IPPROTO_UDP 17
13#define IPPROTO_IPV6 41
14#define IPPROTO_RAW 255
15
16#define IN6ADDR_ANY_INIT { { \
17 0x00, 0x00, 0x00, 0x00, \
18 0x00, 0x00, 0x00, 0x00, \
19 0x00, 0x00, 0x00, 0x00, \
20 0x00, 0x00, 0x00, 0x00 \
21} }
22
23#define IN6ADDR_LOOPBACK_INIT { { \
24 0x00, 0x00, 0x00, 0x00, \
25 0x00, 0x00, 0x00, 0x00, \
26 0x00, 0x00, 0x00, 0x00, \
27 0x00, 0x00, 0x00, 0x01 \
28} }
29
30#endif
lib/libc/wasi/libc-bottom-half/headers/public/__header_poll.h deleted-27
...@@ -1,27 +0,0 @@
1#ifndef __wasilibc___header_poll_h
2#define __wasilibc___header_poll_h
3
4#include <__struct_pollfd.h>
5#include <__typedef_nfds_t.h>
6
7#define POLLRDNORM 0x1
8#define POLLWRNORM 0x2
9
10#define POLLIN POLLRDNORM
11#define POLLOUT POLLWRNORM
12
13#define POLLERR 0x1000
14#define POLLHUP 0x2000
15#define POLLNVAL 0x4000
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21int poll(struct pollfd[], nfds_t, int);
22
23#ifdef __cplusplus
24}
25#endif
26
27#endif
lib/libc/wasi/libc-bottom-half/headers/public/__header_stdlib.h deleted-21
...@@ -1,21 +0,0 @@
1#ifndef __wasilibc___header_stdlib_h
2#define __wasilibc___header_stdlib_h
3
4#define __need_size_t
5#include <stddef.h>
6
7#include <__functions_malloc.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13void abort(void) __attribute__((__noreturn__));
14void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
15void _Exit(int) __attribute__((__noreturn__));
16
17#ifdef __cplusplus
18}
19#endif
20
21#endif
lib/libc/wasi/libc-bottom-half/headers/public/__header_string.h deleted-23
...@@ -1,23 +0,0 @@
1#ifndef __wasilibc___header_string_h
2#define __wasilibc___header_string_h
3
4#define __need_size_t
5#define __need_NULL
6#include <stddef.h>
7
8#include <__functions_memcpy.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14size_t strlen(const char *) __attribute__((__nothrow__, __leaf__, __pure__, __nonnull__(1)));
15char *strdup(const char *) __attribute__((__nothrow__, __nonnull__(1)));
16int strcmp(const char *, const char *) __attribute__((__nothrow__, __pure__, __nonnull__(1, 2)));
17void *memchr(const void *, int, size_t) __attribute__((__nothrow__, __pure__, __nonnull__(1)));
18
19#ifdef __cplusplus
20}
21#endif
22
23#endif
lib/libc/wasi/libc-bottom-half/headers/public/__header_sys_ioctl.h deleted-17
...@@ -1,17 +0,0 @@
1#ifndef __wasilibc___header_sys_ioctl_h
2#define __wasilibc___header_sys_ioctl_h
3
4#define FIONREAD 1
5#define FIONBIO 2
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11int ioctl(int, int, ...);
12
13#ifdef __cplusplus
14}
15#endif
16
17#endif
lib/libc/wasi/libc-bottom-half/headers/public/__header_sys_resource.h deleted-19
...@@ -1,19 +0,0 @@
1#ifndef __wasilibc___header_sys_resource_h
2#define __wasilibc___header_sys_resource_h
3
4#include <__struct_rusage.h>
5
6#define RUSAGE_SELF 1
7#define RUSAGE_CHILDREN 2
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13int getrusage(int who, struct rusage *usage);
14
15#ifdef __cplusplus
16}
17#endif
18
19#endif
lib/libc/wasi/libc-bottom-half/headers/public/__header_sys_socket.h deleted-41
...@@ -1,41 +0,0 @@
1#ifndef __wasilibc___header_sys_socket_h
2#define __wasilibc___header_sys_socket_h
3
4#include <__struct_msghdr.h>
5#include <__struct_sockaddr.h>
6#include <__struct_sockaddr_storage.h>
7
8#include <wasi/api.h>
9
10#define SHUT_RD __WASI_SDFLAGS_RD
11#define SHUT_WR __WASI_SDFLAGS_WR
12#define SHUT_RDWR (SHUT_RD | SHUT_WR)
13
14#define MSG_PEEK __WASI_RIFLAGS_RECV_PEEK
15#define MSG_WAITALL __WASI_RIFLAGS_RECV_WAITALL
16#define MSG_TRUNC __WASI_RIFLAGS_RECV_DATA_TRUNCATED
17
18#define SOCK_DGRAM __WASI_FILETYPE_SOCKET_DGRAM
19#define SOCK_STREAM __WASI_FILETYPE_SOCKET_STREAM
20
21#define SOCK_NONBLOCK (0x00004000)
22#define SOCK_CLOEXEC (0x00002000)
23
24#define SOL_SOCKET 0x7fffffff
25
26#define SO_TYPE 3
27
28#define AF_UNSPEC 0
29#define AF_INET 1
30#define AF_INET6 2
31#define AF_UNIX 3
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37#ifdef __cplusplus
38}
39#endif
40
41#endif
lib/libc/wasi/libc-bottom-half/headers/public/__header_sys_stat.h deleted-15
...@@ -1,15 +0,0 @@
1#ifndef __wasilibc___header_sys_stat_h
2#define __wasilibc___header_sys_stat_h
3
4#include <__struct_stat.h>
5
6#define st_atime st_atim.tv_sec
7#define st_mtime st_mtim.tv_sec
8#define st_ctime st_ctim.tv_sec
9
10#include <__mode_t.h>
11
12#define UTIME_NOW (-1)
13#define UTIME_OMIT (-2)
14
15#endif
lib/libc/wasi/libc-bottom-half/headers/public/__header_time.h deleted-37
...@@ -1,37 +0,0 @@
1#ifndef __wasilibc___header_time_h
2#define __wasilibc___header_time_h
3
4#define __need_size_t
5#define __need_NULL
6#include <stddef.h>
7
8#include <__typedef_time_t.h>
9#include <__struct_timespec.h>
10#include <__struct_tm.h>
11#include <__typedef_clockid_t.h>
12
13#include <wasi/api.h>
14
15#define TIMER_ABSTIME __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME
16
17extern const struct __clockid _CLOCK_MONOTONIC;
18#define CLOCK_MONOTONIC (&_CLOCK_MONOTONIC)
19extern const struct __clockid _CLOCK_PROCESS_CPUTIME_ID;
20#define CLOCK_PROCESS_CPUTIME_ID (&_CLOCK_PROCESS_CPUTIME_ID)
21extern const struct __clockid _CLOCK_REALTIME;
22#define CLOCK_REALTIME (&_CLOCK_REALTIME)
23extern const struct __clockid _CLOCK_THREAD_CPUTIME_ID;
24#define CLOCK_THREAD_CPUTIME_ID (&_CLOCK_THREAD_CPUTIME_ID)
25
26/*
27 * TIME_UTC is the only standardized time base value.
28 */
29#define TIME_UTC 1
30
31/*
32 * Note that XSI specifies CLOCKS_PER_SEC to be 1000000, rather than
33 * 1000000000; the clock API is providing more precision than XSI specifies.
34 */
35#define CLOCKS_PER_SEC ((clock_t)1000000000)
36
37#endif
lib/libc/wasi/libc-bottom-half/headers/public/__header_unistd.h deleted-28
...@@ -1,28 +0,0 @@
1#ifndef __wasilibc___header_unistd_h
2#define __wasilibc___header_unistd_h
3
4struct stat;
5
6#include <__seek.h>
7
8#define F_OK (0)
9#define X_OK (1)
10#define W_OK (2)
11#define R_OK (4)
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17int close(int fd);
18int faccessat(int, const char *, int, int);
19int fstatat(int, const char *__restrict, struct stat *__restrict, int);
20int renameat(int, const char *, int, const char *);
21int openat(int, const char *, int, ...);
22void *sbrk(intptr_t increment);
23
24#ifdef __cplusplus
25}
26#endif
27
28#endif
lib/libc/wasi/libc-bottom-half/headers/public/__macro_FD_SETSIZE.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc___macro_FD_SETSIZE_h
2#define __wasilibc___macro_FD_SETSIZE_h
3
4#define FD_SETSIZE 1024
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/__macro_PAGESIZE.h deleted-11
...@@ -1,11 +0,0 @@
1#ifndef __wasilibc___macro_PAGESIZE_h
2#define __wasilibc___macro_PAGESIZE_h
3
4/*
5 * The page size in WebAssembly is fixed at 64 KiB. If this ever changes,
6 * it's expected that applications will need to opt in, so we can change
7 * this.
8 */
9#define PAGESIZE (0x10000)
10
11#endif
lib/libc/wasi/libc-bottom-half/headers/public/__mode_t.h deleted-38
...@@ -1,38 +0,0 @@
1#ifndef __wasilibc___mode_t_h
2#define __wasilibc___mode_t_h
3
4#define S_IFMT \
5 (S_IFBLK | S_IFCHR | S_IFDIR | S_IFIFO | S_IFLNK | S_IFREG | S_IFSOCK)
6#define S_IFBLK (0x6000)
7#define S_IFCHR (0x2000)
8#define S_IFDIR (0x4000)
9#define S_IFLNK (0xa000)
10#define S_IFREG (0x8000)
11#define S_IFSOCK (0xc000)
12#define S_IFIFO (0xc000)
13
14#define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK)
15#define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR)
16#define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
17#define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO)
18#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK)
19#define S_ISREG(m) (((m)&S_IFMT) == S_IFREG)
20#define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK)
21
22#define S_IXOTH (0x1)
23#define S_IWOTH (0x2)
24#define S_IROTH (0x4)
25#define S_IRWXO (S_IXOTH | S_IWOTH | S_IROTH)
26#define S_IXGRP (0x8)
27#define S_IWGRP (0x10)
28#define S_IRGRP (0x20)
29#define S_IRWXG (S_IXGRP | S_IWGRP | S_IRGRP)
30#define S_IXUSR (0x40)
31#define S_IWUSR (0x80)
32#define S_IRUSR (0x100)
33#define S_IRWXU (S_IXUSR | S_IWUSR | S_IRUSR)
34#define S_ISVTX (0x200)
35#define S_ISGID (0x400)
36#define S_ISUID (0x800)
37
38#endif
lib/libc/wasi/libc-bottom-half/headers/public/__seek.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc___seek_h
2#define __wasilibc___seek_h
3
4#include <wasi/api.h>
5
6#define SEEK_CUR __WASI_WHENCE_CUR
7#define SEEK_END __WASI_WHENCE_END
8#define SEEK_SET __WASI_WHENCE_SET
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_dirent.h deleted-14
...@@ -1,14 +0,0 @@
1#ifndef __wasilibc___struct_dirent_h
2#define __wasilibc___struct_dirent_h
3
4#include <__typedef_ino_t.h>
5
6#define _DIRENT_HAVE_D_TYPE
7
8struct dirent {
9 ino_t d_ino;
10 unsigned char d_type;
11 char d_name[];
12};
13
14#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_in6_addr.h deleted-8
...@@ -1,8 +0,0 @@
1#ifndef __wasilibc___struct_in6_addr_h
2#define __wasilibc___struct_in6_addr_h
3
4struct in6_addr {
5 _Alignas(int32_t) unsigned char s6_addr[16];
6};
7
8#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_in_addr.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc___struct_in_addr_h
2#define __wasilibc___struct_in_addr_h
3
4#include <__typedef_in_addr_t.h>
5
6struct in_addr {
7 in_addr_t s_addr;
8};
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_iovec.h deleted-12
...@@ -1,12 +0,0 @@
1#ifndef __wasilibc___struct_iovec_h
2#define __wasilibc___struct_iovec_h
3
4#define __need_size_t
5#include <stddef.h>
6
7struct iovec {
8 void *iov_base;
9 size_t iov_len;
10};
11
12#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_msghdr.h deleted-16
...@@ -1,16 +0,0 @@
1#ifndef __wasilibc___struct_msghdr_h
2#define __wasilibc___struct_msghdr_h
3
4#include <__typedef_socklen_t.h>
5
6struct msghdr {
7 void *msg_name;
8 socklen_t msg_namelen;
9 struct iovec *msg_iov;
10 int msg_iovlen;
11 void *msg_control;
12 socklen_t msg_controllen;
13 int msg_flags;
14};
15
16#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_pollfd.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc___struct_pollfd_h
2#define __wasilibc___struct_pollfd_h
3
4struct pollfd {
5 int fd;
6 short events;
7 short revents;
8};
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_rusage.h deleted-12
...@@ -1,12 +0,0 @@
1#ifndef __wasilibc___struct_rusage_h
2#define __wasilibc___struct_rusage_h
3
4#include <__struct_timeval.h>
5
6/* TODO: Add more features here. */
7struct rusage {
8 struct timeval ru_utime;
9 struct timeval ru_stime;
10};
11
12#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_sockaddr.h deleted-14
...@@ -1,14 +0,0 @@
1#ifndef __wasilibc___struct_sockaddr_h
2#define __wasilibc___struct_sockaddr_h
3
4#define __need_STDDEF_H_misc
5#include <stddef.h>
6
7#include <__typedef_sa_family_t.h>
8
9struct sockaddr {
10 _Alignas(max_align_t) sa_family_t sa_family;
11 char sa_data[0];
12};
13
14#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_sockaddr_in.h deleted-17
...@@ -1,17 +0,0 @@
1#ifndef __wasilibc___struct_sockaddr_in_h
2#define __wasilibc___struct_sockaddr_in_h
3
4#define __need_STDDEF_H_misc
5#include <stddef.h>
6
7#include <__typedef_sa_family_t.h>
8#include <__typedef_in_port_t.h>
9#include <__struct_in_addr.h>
10
11struct sockaddr_in {
12 _Alignas(max_align_t) sa_family_t sin_family;
13 in_port_t sin_port;
14 struct in_addr sin_addr;
15};
16
17#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_sockaddr_in6.h deleted-19
...@@ -1,19 +0,0 @@
1#ifndef __wasilibc___struct_sockaddr_in6_h
2#define __wasilibc___struct_sockaddr_in6_h
3
4#define __need_STDDEF_H_misc
5#include <stddef.h>
6
7#include <__typedef_sa_family_t.h>
8#include <__typedef_in_port_t.h>
9#include <__struct_in6_addr.h>
10
11struct sockaddr_in6 {
12 _Alignas(max_align_t) sa_family_t sin6_family;
13 in_port_t sin6_port;
14 unsigned sin6_flowinfo;
15 struct in6_addr sin6_addr;
16 unsigned sin6_scope_id;
17};
18
19#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_sockaddr_storage.h deleted-14
...@@ -1,14 +0,0 @@
1#ifndef __wasilibc___struct_sockaddr_storage_h
2#define __wasilibc___struct_sockaddr_storage_h
3
4#define __need_STDDEF_H_misc
5#include <stddef.h>
6
7#include <__typedef_sa_family_t.h>
8
9struct sockaddr_storage {
10 _Alignas(max_align_t) sa_family_t ss_family;
11 char __ss_data[32];
12};
13
14#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_sockaddr_un.h deleted-13
...@@ -1,13 +0,0 @@
1#ifndef __wasilibc___struct_sockaddr_un_h
2#define __wasilibc___struct_sockaddr_un_h
3
4#define __need_STDDEF_H_misc
5#include <stddef.h>
6
7#include <__typedef_sa_family_t.h>
8
9struct sockaddr_un {
10 _Alignas(max_align_t) sa_family_t sun_family;
11};
12
13#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_stat.h deleted-35
...@@ -1,35 +0,0 @@
1#ifndef __wasilibc___struct_stat_h
2#define __wasilibc___struct_stat_h
3
4#include <__typedef_dev_t.h>
5#include <__typedef_ino_t.h>
6#include <__typedef_nlink_t.h>
7#include <__typedef_mode_t.h>
8#include <__typedef_uid_t.h>
9#include <__typedef_gid_t.h>
10#include <__typedef_off_t.h>
11#include <__typedef_blksize_t.h>
12#include <__typedef_blkcnt_t.h>
13#include <__struct_timespec.h>
14
15struct stat {
16 dev_t st_dev;
17 ino_t st_ino;
18 nlink_t st_nlink;
19
20 mode_t st_mode;
21 uid_t st_uid;
22 gid_t st_gid;
23 unsigned int __pad0;
24 dev_t st_rdev;
25 off_t st_size;
26 blksize_t st_blksize;
27 blkcnt_t st_blocks;
28
29 struct timespec st_atim;
30 struct timespec st_mtim;
31 struct timespec st_ctim;
32 long long __reserved[3];
33};
34
35#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_timespec.h deleted-12
...@@ -1,12 +0,0 @@
1#ifndef __wasilibc___struct_timespec_h
2#define __wasilibc___struct_timespec_h
3
4#include <__typedef_time_t.h>
5
6/* As specified in POSIX. */
7struct timespec {
8 time_t tv_sec;
9 long tv_nsec;
10};
11
12#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_timeval.h deleted-13
...@@ -1,13 +0,0 @@
1#ifndef __wasilibc___struct_timeval_h
2#define __wasilibc___struct_timeval_h
3
4#include <__typedef_time_t.h>
5#include <__typedef_suseconds_t.h>
6
7/* As specified in POSIX. */
8struct timeval {
9 time_t tv_sec;
10 suseconds_t tv_usec;
11};
12
13#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_tm.h deleted-19
...@@ -1,19 +0,0 @@
1#ifndef __wasilibc___struct_tm_h
2#define __wasilibc___struct_tm_h
3
4struct tm {
5 int tm_sec;
6 int tm_min;
7 int tm_hour;
8 int tm_mday;
9 int tm_mon;
10 int tm_year;
11 int tm_wday;
12 int tm_yday;
13 int tm_isdst;
14 int __tm_gmtoff;
15 const char *__tm_zone;
16 int __tm_nsec;
17};
18
19#endif
lib/libc/wasi/libc-bottom-half/headers/public/__struct_tms.h deleted-13
...@@ -1,13 +0,0 @@
1#ifndef __wasilibc___struct_tms_h
2#define __wasilibc___struct_tms_h
3
4#include <__typedef_clock_t.h>
5
6struct tms {
7 clock_t tms_utime;
8 clock_t tms_stime;
9 clock_t tms_cutime;
10 clock_t tms_cstime;
11};
12
13#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_DIR.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc___typedef_DIR_h
2#define __wasilibc___typedef_DIR_h
3
4typedef struct _DIR DIR;
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_blkcnt_t.h deleted-7
...@@ -1,7 +0,0 @@
1#ifndef __wasilibc___typedef_blkcnt_t_h
2#define __wasilibc___typedef_blkcnt_t_h
3
4/* Define these as 64-bit signed integers to support files larger than 2 GiB. */
5typedef long long blkcnt_t;
6
7#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_blksize_t.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc___typedef_blksize_t_h
2#define __wasilibc___typedef_blksize_t_h
3
4typedef long blksize_t;
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_clock_t.h deleted-7
...@@ -1,7 +0,0 @@
1#ifndef __wasilibc___typedef_clock_t_h
2#define __wasilibc___typedef_clock_t_h
3
4/* Define this as a 64-bit signed integer to avoid wraparounds. */
5typedef long long clock_t;
6
7#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_clockid_t.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc___typedef_clockid_t_h
2#define __wasilibc___typedef_clockid_t_h
3
4typedef const struct __clockid *clockid_t;
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_dev_t.h deleted-7
...@@ -1,7 +0,0 @@
1#ifndef __wasilibc___typedef_dev_t_h
2#define __wasilibc___typedef_dev_t_h
3
4/* Define these as 64-bit integers to support billions of devices. */
5typedef unsigned long long dev_t;
6
7#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_fd_set.h deleted-14
...@@ -1,14 +0,0 @@
1#ifndef __wasilibc___typedef_fd_set_h
2#define __wasilibc___typedef_fd_set_h
3
4#define __need_size_t
5#include <stddef.h>
6
7#include <__macro_FD_SETSIZE.h>
8
9typedef struct {
10 size_t __nfds;
11 int __fds[FD_SETSIZE];
12} fd_set;
13
14#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_gid_t.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc___typedef_gid_t_h
2#define __wasilibc___typedef_gid_t_h
3
4typedef unsigned gid_t;
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_in_addr_t.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc___typedef_in_addr_t_h
2#define __wasilibc___typedef_in_addr_t_h
3
4typedef unsigned in_addr_t;
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_in_port_t.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc___typedef_in_port_t_h
2#define __wasilibc___typedef_in_port_t_h
3
4typedef unsigned short in_port_t;
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_ino_t.h deleted-7
...@@ -1,7 +0,0 @@
1#ifndef __wasilibc___typedef_ino_t_h
2#define __wasilibc___typedef_ino_t_h
3
4/* Define these as 64-bit integers to support billions of inodes. */
5typedef unsigned long long ino_t;
6
7#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_mode_t.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc___typedef_mode_t_h
2#define __wasilibc___typedef_mode_t_h
3
4typedef unsigned mode_t;
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_nfds_t.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc___typedef_nfds_t_h
2#define __wasilibc___typedef_nfds_t_h
3
4typedef unsigned long nfds_t;
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_nlink_t.h deleted-7
...@@ -1,7 +0,0 @@
1#ifndef __wasilibc___typedef_nlink_t_h
2#define __wasilibc___typedef_nlink_t_h
3
4/* Define these as 64-bit unsigned integers to support billions of links. */
5typedef unsigned long long nlink_t;
6
7#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_off_t.h deleted-7
...@@ -1,7 +0,0 @@
1#ifndef __wasilibc___typedef_off_t_h
2#define __wasilibc___typedef_off_t_h
3
4/* Define these as 64-bit signed integers to support files larger than 2 GiB. */
5typedef long long off_t;
6
7#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_sa_family_t.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc___typedef_sa_family_t_h
2#define __wasilibc___typedef_sa_family_t_h
3
4typedef unsigned short sa_family_t;
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_sigset_t.h deleted-7
...@@ -1,7 +0,0 @@
1#ifndef __wasilibc___typedef_sigset_t_h
2#define __wasilibc___typedef_sigset_t_h
3
4/* TODO: This is just a placeholder for now. Keep this in sync with musl. */
5typedef unsigned char sigset_t;
6
7#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_socklen_t.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc___typedef_socklen_t_h
2#define __wasilibc___typedef_socklen_t_h
3
4typedef unsigned socklen_t;
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_ssize_t.h deleted-7
...@@ -1,7 +0,0 @@
1#ifndef __wasilibc___typedef_ssize_t_h
2#define __wasilibc___typedef_ssize_t_h
3
4/* This is defined to be the same size as size_t. */
5typedef long ssize_t;
6
7#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_suseconds_t.h deleted-8
...@@ -1,8 +0,0 @@
1#ifndef __wasilibc___typedef_suseconds_t_h
2#define __wasilibc___typedef_suseconds_t_h
3
4/* Define this to be 64-bit as its main use is in struct timeval where the
5 extra space would otherwise be padding. */
6typedef long long suseconds_t;
7
8#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_time_t.h deleted-7
...@@ -1,7 +0,0 @@
1#ifndef __wasilibc___typedef_time_t_h
2#define __wasilibc___typedef_time_t_h
3
4/* Define this as a 64-bit signed integer to avoid the 2038 bug. */
5typedef long long time_t;
6
7#endif
lib/libc/wasi/libc-bottom-half/headers/public/__typedef_uid_t.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc___typedef_uid_t_h
2#define __wasilibc___typedef_uid_t_h
3
4typedef unsigned uid_t;
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/dirent.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc_dirent_h
2#define __wasilibc_dirent_h
3
4/*
5 * Include the real implementation, which is factored into a separate file so
6 * that it can be reused by other libc dirent implementations.
7 */
8#include <__header_dirent.h>
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/errno.h deleted-7
...@@ -1,7 +0,0 @@
1#ifndef __wasilibc_errno_h
2#define __wasilibc_errno_h
3
4#include <__errno.h>
5#include <__errno_values.h>
6
7#endif
lib/libc/wasi/libc-bottom-half/headers/public/fcntl.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc_fcntl_h
2#define __wasilibc_fcntl_h
3
4/*
5 * Include the real implementation, which is factored into a separate file so
6 * that it can be reused by other libc fcntl implementations.
7 */
8#include <__header_fcntl.h>
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/inttypes.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc_inttypes_h
2#define __wasilibc_inttypes_h
3
4/*
5 * Include the real implementation, which is factored into a separate file so
6 * that it can be reused by other libc stdlib implementations.
7 */
8#include <__header_inttypes.h>
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/netinet/in.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc_netinet_in_h
2#define __wasilibc_netinet_in_h
3
4#include <__header_netinet_in.h>
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/poll.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc_poll_h
2#define __wasilibc_poll_h
3
4/*
5 * Include the real implementation, which is factored into a separate file so
6 * that it can be reused by other libc poll implementations.
7 */
8#include <__header_poll.h>
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/stdlib.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc_stdlib_h
2#define __wasilibc_stdlib_h
3
4/*
5 * Include the real implementation, which is factored into a separate file so
6 * that it can be reused by other libc stdlib implementations.
7 */
8#include <__functions_malloc.h>
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/string.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc_string_h
2#define __wasilibc_string_h
3
4/*
5 * Include the real implementation, which is factored into a separate file so
6 * that it can be reused by other libc string implementations.
7 */
8#include <__header_string.h>
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/sys/ioctl.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc_sys_ioctl_h
2#define __wasilibc_sys_ioctl_h
3
4/*
5 * Include the real implementation, which is factored into a separate file so
6 * that it can be reused by other libc ioctl implementations.
7 */
8#include <__header_sys_ioctl.h>
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/sys/resource.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc_sys_resource_h
2#define __wasilibc_sys_resource_h
3
4/*
5 * Include the real implementation, which is factored into a separate file so
6 * that it can be reused by other libc resource implementations.
7 */
8#include <__header_sys_resource.h>
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/sys/select.h deleted-18
...@@ -1,18 +0,0 @@
1#ifndef __wasilibc_sys_select_h
2#define __wasilibc_sys_select_h
3
4#include <__fd_set.h>
5#include <__struct_timespec.h>
6#include <__struct_timeval.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12int pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *);
13
14#ifdef __cplusplus
15}
16#endif
17
18#endif
lib/libc/wasi/libc-bottom-half/headers/public/sys/socket.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc_sys_socket_h
2#define __wasilibc_sys_socket_h
3
4#include <__header_sys_socket.h>
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/sys/stat.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc_sys_stat_h
2#define __wasilibc_sys_stat_h
3
4/*
5 * Include the real implementation, which is factored into a separate file so
6 * that it can be reused by other libc stat implementations.
7 */
8#include <__header_sys_stat.h>
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/sys/time.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc_sys_time_h
2#define __wasilibc_sys_time_h
3
4#include <__struct_timeval.h>
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/sys/times.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc_sys_times_h
2#define __wasilibc_sys_times_h
3
4#include <__struct_tms.h>
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/sys/types.h deleted-16
...@@ -1,16 +0,0 @@
1#ifndef __wasilibc_sys_types_h
2#define __wasilibc_sys_types_h
3
4#define __need_size_t
5#include <stddef.h>
6
7#include <__typedef_clock_t.h>
8#include <__typedef_time_t.h>
9#include <__typedef_blksize_t.h>
10#include <__typedef_off_t.h>
11#include <__typedef_ssize_t.h>
12#include <__typedef_suseconds_t.h>
13#include <__typedef_nlink_t.h>
14#include <__typedef_clockid_t.h>
15
16#endif
lib/libc/wasi/libc-bottom-half/headers/public/sys/uio.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc_sys_uio_h
2#define __wasilibc_sys_uio_h
3
4#include <__struct_iovec.h>
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/sys/un.h deleted-6
...@@ -1,6 +0,0 @@
1#ifndef __wasilibc_sys_un_h
2#define __wasilibc_sys_un_h
3
4#include <__struct_sockaddr_un.h>
5
6#endif
lib/libc/wasi/libc-bottom-half/headers/public/time.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc_time_h
2#define __wasilibc_time_h
3
4/*
5 * Include the real implementation, which is factored into a separate file so
6 * that it can be reused by other libc time implementations.
7 */
8#include <__header_time.h>
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/unistd.h deleted-10
...@@ -1,10 +0,0 @@
1#ifndef __wasilibc_unistd_h
2#define __wasilibc_unistd_h
3
4/*
5 * Include the real implementation, which is factored into a separate file so
6 * that it can be reused by other libc unistd implementations.
7 */
8#include <__header_unistd.h>
9
10#endif
lib/libc/wasi/libc-bottom-half/headers/public/wasi/api.h deleted-2280
...@@ -1,2280 +0,0 @@
1/**
2 * THIS FILE IS AUTO-GENERATED from the following files:
3 * wasi_snapshot_preview1.witx
4 *
5 * To regenerate this file execute:
6 *
7 * cargo run --manifest-path tools/wasi-headers/Cargo.toml generate-libc
8 *
9 * Modifications to this file will cause CI to fail, the code generator tool
10 * must be modified to change this file.
11 *
12 * @file
13 * This file describes the [WASI] interface, consisting of functions, types,
14 * and defined values (macros).
15 *
16 * The interface described here is greatly inspired by [CloudABI]'s clean,
17 * thoughtfully-designed, capability-oriented, POSIX-style API.
18 *
19 * [CloudABI]: https://github.com/NuxiNL/cloudlibc
20 * [WASI]: https://github.com/WebAssembly/WASI/
21 */
22
23#ifndef __wasi_api_h
24#define __wasi_api_h
25
26#ifndef __wasi__
27#error <wasi/api.h> is only supported on WASI platforms.
28#endif
29
30#ifndef __wasm32__
31#error <wasi/api.h> only supports wasm32; doesn't yet support wasm64
32#endif
33
34#include <stddef.h>
35#include <stdint.h>
36
37_Static_assert(_Alignof(int8_t) == 1, "non-wasi data layout");
38_Static_assert(_Alignof(uint8_t) == 1, "non-wasi data layout");
39_Static_assert(_Alignof(int16_t) == 2, "non-wasi data layout");
40_Static_assert(_Alignof(uint16_t) == 2, "non-wasi data layout");
41_Static_assert(_Alignof(int32_t) == 4, "non-wasi data layout");
42_Static_assert(_Alignof(uint32_t) == 4, "non-wasi data layout");
43_Static_assert(_Alignof(int64_t) == 8, "non-wasi data layout");
44_Static_assert(_Alignof(uint64_t) == 8, "non-wasi data layout");
45_Static_assert(_Alignof(void*) == 4, "non-wasi data layout");
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
51// TODO: Encoding this in witx.
52#define __WASI_DIRCOOKIE_START (UINT64_C(0))
53typedef __SIZE_TYPE__ __wasi_size_t;
54
55_Static_assert(sizeof(__wasi_size_t) == 4, "witx calculated size");
56_Static_assert(_Alignof(__wasi_size_t) == 4, "witx calculated align");
57
58/**
59 * Non-negative file size or length of a region within a file.
60 */
61typedef uint64_t __wasi_filesize_t;
62
63_Static_assert(sizeof(__wasi_filesize_t) == 8, "witx calculated size");
64_Static_assert(_Alignof(__wasi_filesize_t) == 8, "witx calculated align");
65
66/**
67 * Timestamp in nanoseconds.
68 */
69typedef uint64_t __wasi_timestamp_t;
70
71_Static_assert(sizeof(__wasi_timestamp_t) == 8, "witx calculated size");
72_Static_assert(_Alignof(__wasi_timestamp_t) == 8, "witx calculated align");
73
74/**
75 * Identifiers for clocks.
76 */
77typedef uint32_t __wasi_clockid_t;
78
79/**
80 * The clock measuring real time. Time value zero corresponds with
81 * 1970-01-01T00:00:00Z.
82 */
83#define __WASI_CLOCKID_REALTIME (UINT32_C(0))
84
85/**
86 * The store-wide monotonic clock, which is defined as a clock measuring
87 * real time, whose value cannot be adjusted and which cannot have negative
88 * clock jumps. The epoch of this clock is undefined. The absolute time
89 * value of this clock therefore has no meaning.
90 */
91#define __WASI_CLOCKID_MONOTONIC (UINT32_C(1))
92
93/**
94 * The CPU-time clock associated with the current process.
95 */
96#define __WASI_CLOCKID_PROCESS_CPUTIME_ID (UINT32_C(2))
97
98/**
99 * The CPU-time clock associated with the current thread.
100 */
101#define __WASI_CLOCKID_THREAD_CPUTIME_ID (UINT32_C(3))
102
103_Static_assert(sizeof(__wasi_clockid_t) == 4, "witx calculated size");
104_Static_assert(_Alignof(__wasi_clockid_t) == 4, "witx calculated align");
105
106/**
107 * Error codes returned by functions.
108 * Not all of these error codes are returned by the functions provided by this
109 * API; some are used in higher-level library layers, and others are provided
110 * merely for alignment with POSIX.
111 */
112typedef uint16_t __wasi_errno_t;
113
114/**
115 * No error occurred. System call completed successfully.
116 */
117#define __WASI_ERRNO_SUCCESS (UINT16_C(0))
118
119/**
120 * Argument list too long.
121 */
122#define __WASI_ERRNO_2BIG (UINT16_C(1))
123
124/**
125 * Permission denied.
126 */
127#define __WASI_ERRNO_ACCES (UINT16_C(2))
128
129/**
130 * Address in use.
131 */
132#define __WASI_ERRNO_ADDRINUSE (UINT16_C(3))
133
134/**
135 * Address not available.
136 */
137#define __WASI_ERRNO_ADDRNOTAVAIL (UINT16_C(4))
138
139/**
140 * Address family not supported.
141 */
142#define __WASI_ERRNO_AFNOSUPPORT (UINT16_C(5))
143
144/**
145 * Resource unavailable, or operation would block.
146 */
147#define __WASI_ERRNO_AGAIN (UINT16_C(6))
148
149/**
150 * Connection already in progress.
151 */
152#define __WASI_ERRNO_ALREADY (UINT16_C(7))
153
154/**
155 * Bad file descriptor.
156 */
157#define __WASI_ERRNO_BADF (UINT16_C(8))
158
159/**
160 * Bad message.
161 */
162#define __WASI_ERRNO_BADMSG (UINT16_C(9))
163
164/**
165 * Device or resource busy.
166 */
167#define __WASI_ERRNO_BUSY (UINT16_C(10))
168
169/**
170 * Operation canceled.
171 */
172#define __WASI_ERRNO_CANCELED (UINT16_C(11))
173
174/**
175 * No child processes.
176 */
177#define __WASI_ERRNO_CHILD (UINT16_C(12))
178
179/**
180 * Connection aborted.
181 */
182#define __WASI_ERRNO_CONNABORTED (UINT16_C(13))
183
184/**
185 * Connection refused.
186 */
187#define __WASI_ERRNO_CONNREFUSED (UINT16_C(14))
188
189/**
190 * Connection reset.
191 */
192#define __WASI_ERRNO_CONNRESET (UINT16_C(15))
193
194/**
195 * Resource deadlock would occur.
196 */
197#define __WASI_ERRNO_DEADLK (UINT16_C(16))
198
199/**
200 * Destination address required.
201 */
202#define __WASI_ERRNO_DESTADDRREQ (UINT16_C(17))
203
204/**
205 * Mathematics argument out of domain of function.
206 */
207#define __WASI_ERRNO_DOM (UINT16_C(18))
208
209/**
210 * Reserved.
211 */
212#define __WASI_ERRNO_DQUOT (UINT16_C(19))
213
214/**
215 * File exists.
216 */
217#define __WASI_ERRNO_EXIST (UINT16_C(20))
218
219/**
220 * Bad address.
221 */
222#define __WASI_ERRNO_FAULT (UINT16_C(21))
223
224/**
225 * File too large.
226 */
227#define __WASI_ERRNO_FBIG (UINT16_C(22))
228
229/**
230 * Host is unreachable.
231 */
232#define __WASI_ERRNO_HOSTUNREACH (UINT16_C(23))
233
234/**
235 * Identifier removed.
236 */
237#define __WASI_ERRNO_IDRM (UINT16_C(24))
238
239/**
240 * Illegal byte sequence.
241 */
242#define __WASI_ERRNO_ILSEQ (UINT16_C(25))
243
244/**
245 * Operation in progress.
246 */
247#define __WASI_ERRNO_INPROGRESS (UINT16_C(26))
248
249/**
250 * Interrupted function.
251 */
252#define __WASI_ERRNO_INTR (UINT16_C(27))
253
254/**
255 * Invalid argument.
256 */
257#define __WASI_ERRNO_INVAL (UINT16_C(28))
258
259/**
260 * I/O error.
261 */
262#define __WASI_ERRNO_IO (UINT16_C(29))
263
264/**
265 * Socket is connected.
266 */
267#define __WASI_ERRNO_ISCONN (UINT16_C(30))
268
269/**
270 * Is a directory.
271 */
272#define __WASI_ERRNO_ISDIR (UINT16_C(31))
273
274/**
275 * Too many levels of symbolic links.
276 */
277#define __WASI_ERRNO_LOOP (UINT16_C(32))
278
279/**
280 * File descriptor value too large.
281 */
282#define __WASI_ERRNO_MFILE (UINT16_C(33))
283
284/**
285 * Too many links.
286 */
287#define __WASI_ERRNO_MLINK (UINT16_C(34))
288
289/**
290 * Message too large.
291 */
292#define __WASI_ERRNO_MSGSIZE (UINT16_C(35))
293
294/**
295 * Reserved.
296 */
297#define __WASI_ERRNO_MULTIHOP (UINT16_C(36))
298
299/**
300 * Filename too long.
301 */
302#define __WASI_ERRNO_NAMETOOLONG (UINT16_C(37))
303
304/**
305 * Network is down.
306 */
307#define __WASI_ERRNO_NETDOWN (UINT16_C(38))
308
309/**
310 * Connection aborted by network.
311 */
312#define __WASI_ERRNO_NETRESET (UINT16_C(39))
313
314/**
315 * Network unreachable.
316 */
317#define __WASI_ERRNO_NETUNREACH (UINT16_C(40))
318
319/**
320 * Too many files open in system.
321 */
322#define __WASI_ERRNO_NFILE (UINT16_C(41))
323
324/**
325 * No buffer space available.
326 */
327#define __WASI_ERRNO_NOBUFS (UINT16_C(42))
328
329/**
330 * No such device.
331 */
332#define __WASI_ERRNO_NODEV (UINT16_C(43))
333
334/**
335 * No such file or directory.
336 */
337#define __WASI_ERRNO_NOENT (UINT16_C(44))
338
339/**
340 * Executable file format error.
341 */
342#define __WASI_ERRNO_NOEXEC (UINT16_C(45))
343
344/**
345 * No locks available.
346 */
347#define __WASI_ERRNO_NOLCK (UINT16_C(46))
348
349/**
350 * Reserved.
351 */
352#define __WASI_ERRNO_NOLINK (UINT16_C(47))
353
354/**
355 * Not enough space.
356 */
357#define __WASI_ERRNO_NOMEM (UINT16_C(48))
358
359/**
360 * No message of the desired type.
361 */
362#define __WASI_ERRNO_NOMSG (UINT16_C(49))
363
364/**
365 * Protocol not available.
366 */
367#define __WASI_ERRNO_NOPROTOOPT (UINT16_C(50))
368
369/**
370 * No space left on device.
371 */
372#define __WASI_ERRNO_NOSPC (UINT16_C(51))
373
374/**
375 * Function not supported.
376 */
377#define __WASI_ERRNO_NOSYS (UINT16_C(52))
378
379/**
380 * The socket is not connected.
381 */
382#define __WASI_ERRNO_NOTCONN (UINT16_C(53))
383
384/**
385 * Not a directory or a symbolic link to a directory.
386 */
387#define __WASI_ERRNO_NOTDIR (UINT16_C(54))
388
389/**
390 * Directory not empty.
391 */
392#define __WASI_ERRNO_NOTEMPTY (UINT16_C(55))
393
394/**
395 * State not recoverable.
396 */
397#define __WASI_ERRNO_NOTRECOVERABLE (UINT16_C(56))
398
399/**
400 * Not a socket.
401 */
402#define __WASI_ERRNO_NOTSOCK (UINT16_C(57))
403
404/**
405 * Not supported, or operation not supported on socket.
406 */
407#define __WASI_ERRNO_NOTSUP (UINT16_C(58))
408
409/**
410 * Inappropriate I/O control operation.
411 */
412#define __WASI_ERRNO_NOTTY (UINT16_C(59))
413
414/**
415 * No such device or address.
416 */
417#define __WASI_ERRNO_NXIO (UINT16_C(60))
418
419/**
420 * Value too large to be stored in data type.
421 */
422#define __WASI_ERRNO_OVERFLOW (UINT16_C(61))
423
424/**
425 * Previous owner died.
426 */
427#define __WASI_ERRNO_OWNERDEAD (UINT16_C(62))
428
429/**
430 * Operation not permitted.
431 */
432#define __WASI_ERRNO_PERM (UINT16_C(63))
433
434/**
435 * Broken pipe.
436 */
437#define __WASI_ERRNO_PIPE (UINT16_C(64))
438
439/**
440 * Protocol error.
441 */
442#define __WASI_ERRNO_PROTO (UINT16_C(65))
443
444/**
445 * Protocol not supported.
446 */
447#define __WASI_ERRNO_PROTONOSUPPORT (UINT16_C(66))
448
449/**
450 * Protocol wrong type for socket.
451 */
452#define __WASI_ERRNO_PROTOTYPE (UINT16_C(67))
453
454/**
455 * Result too large.
456 */
457#define __WASI_ERRNO_RANGE (UINT16_C(68))
458
459/**
460 * Read-only file system.
461 */
462#define __WASI_ERRNO_ROFS (UINT16_C(69))
463
464/**
465 * Invalid seek.
466 */
467#define __WASI_ERRNO_SPIPE (UINT16_C(70))
468
469/**
470 * No such process.
471 */
472#define __WASI_ERRNO_SRCH (UINT16_C(71))
473
474/**
475 * Reserved.
476 */
477#define __WASI_ERRNO_STALE (UINT16_C(72))
478
479/**
480 * Connection timed out.
481 */
482#define __WASI_ERRNO_TIMEDOUT (UINT16_C(73))
483
484/**
485 * Text file busy.
486 */
487#define __WASI_ERRNO_TXTBSY (UINT16_C(74))
488
489/**
490 * Cross-device link.
491 */
492#define __WASI_ERRNO_XDEV (UINT16_C(75))
493
494/**
495 * Extension: Capabilities insufficient.
496 */
497#define __WASI_ERRNO_NOTCAPABLE (UINT16_C(76))
498
499_Static_assert(sizeof(__wasi_errno_t) == 2, "witx calculated size");
500_Static_assert(_Alignof(__wasi_errno_t) == 2, "witx calculated align");
501
502/**
503 * File descriptor rights, determining which actions may be performed.
504 */
505typedef uint64_t __wasi_rights_t;
506
507/**
508 * The right to invoke `fd_datasync`.
509 * If `path_open` is set, includes the right to invoke
510 * `path_open` with `fdflags::dsync`.
511 */
512#define __WASI_RIGHTS_FD_DATASYNC ((__wasi_rights_t)(1 << 0))
513
514/**
515 * The right to invoke `fd_read` and `sock_recv`.
516 * If `rights::fd_seek` is set, includes the right to invoke `fd_pread`.
517 */
518#define __WASI_RIGHTS_FD_READ ((__wasi_rights_t)(1 << 1))
519
520/**
521 * The right to invoke `fd_seek`. This flag implies `rights::fd_tell`.
522 */
523#define __WASI_RIGHTS_FD_SEEK ((__wasi_rights_t)(1 << 2))
524
525/**
526 * The right to invoke `fd_fdstat_set_flags`.
527 */
528#define __WASI_RIGHTS_FD_FDSTAT_SET_FLAGS ((__wasi_rights_t)(1 << 3))
529
530/**
531 * The right to invoke `fd_sync`.
532 * If `path_open` is set, includes the right to invoke
533 * `path_open` with `fdflags::rsync` and `fdflags::dsync`.
534 */
535#define __WASI_RIGHTS_FD_SYNC ((__wasi_rights_t)(1 << 4))
536
537/**
538 * The right to invoke `fd_seek` in such a way that the file offset
539 * remains unaltered (i.e., `whence::cur` with offset zero), or to
540 * invoke `fd_tell`.
541 */
542#define __WASI_RIGHTS_FD_TELL ((__wasi_rights_t)(1 << 5))
543
544/**
545 * The right to invoke `fd_write` and `sock_send`.
546 * If `rights::fd_seek` is set, includes the right to invoke `fd_pwrite`.
547 */
548#define __WASI_RIGHTS_FD_WRITE ((__wasi_rights_t)(1 << 6))
549
550/**
551 * The right to invoke `fd_advise`.
552 */
553#define __WASI_RIGHTS_FD_ADVISE ((__wasi_rights_t)(1 << 7))
554
555/**
556 * The right to invoke `fd_allocate`.
557 */
558#define __WASI_RIGHTS_FD_ALLOCATE ((__wasi_rights_t)(1 << 8))
559
560/**
561 * The right to invoke `path_create_directory`.
562 */
563#define __WASI_RIGHTS_PATH_CREATE_DIRECTORY ((__wasi_rights_t)(1 << 9))
564
565/**
566 * If `path_open` is set, the right to invoke `path_open` with `oflags::creat`.
567 */
568#define __WASI_RIGHTS_PATH_CREATE_FILE ((__wasi_rights_t)(1 << 10))
569
570/**
571 * The right to invoke `path_link` with the file descriptor as the
572 * source directory.
573 */
574#define __WASI_RIGHTS_PATH_LINK_SOURCE ((__wasi_rights_t)(1 << 11))
575
576/**
577 * The right to invoke `path_link` with the file descriptor as the
578 * target directory.
579 */
580#define __WASI_RIGHTS_PATH_LINK_TARGET ((__wasi_rights_t)(1 << 12))
581
582/**
583 * The right to invoke `path_open`.
584 */
585#define __WASI_RIGHTS_PATH_OPEN ((__wasi_rights_t)(1 << 13))
586
587/**
588 * The right to invoke `fd_readdir`.
589 */
590#define __WASI_RIGHTS_FD_READDIR ((__wasi_rights_t)(1 << 14))
591
592/**
593 * The right to invoke `path_readlink`.
594 */
595#define __WASI_RIGHTS_PATH_READLINK ((__wasi_rights_t)(1 << 15))
596
597/**
598 * The right to invoke `path_rename` with the file descriptor as the source directory.
599 */
600#define __WASI_RIGHTS_PATH_RENAME_SOURCE ((__wasi_rights_t)(1 << 16))
601
602/**
603 * The right to invoke `path_rename` with the file descriptor as the target directory.
604 */
605#define __WASI_RIGHTS_PATH_RENAME_TARGET ((__wasi_rights_t)(1 << 17))
606
607/**
608 * The right to invoke `path_filestat_get`.
609 */
610#define __WASI_RIGHTS_PATH_FILESTAT_GET ((__wasi_rights_t)(1 << 18))
611
612/**
613 * The right to change a file's size (there is no `path_filestat_set_size`).
614 * If `path_open` is set, includes the right to invoke `path_open` with `oflags::trunc`.
615 */
616#define __WASI_RIGHTS_PATH_FILESTAT_SET_SIZE ((__wasi_rights_t)(1 << 19))
617
618/**
619 * The right to invoke `path_filestat_set_times`.
620 */
621#define __WASI_RIGHTS_PATH_FILESTAT_SET_TIMES ((__wasi_rights_t)(1 << 20))
622
623/**
624 * The right to invoke `fd_filestat_get`.
625 */
626#define __WASI_RIGHTS_FD_FILESTAT_GET ((__wasi_rights_t)(1 << 21))
627
628/**
629 * The right to invoke `fd_filestat_set_size`.
630 */
631#define __WASI_RIGHTS_FD_FILESTAT_SET_SIZE ((__wasi_rights_t)(1 << 22))
632
633/**
634 * The right to invoke `fd_filestat_set_times`.
635 */
636#define __WASI_RIGHTS_FD_FILESTAT_SET_TIMES ((__wasi_rights_t)(1 << 23))
637
638/**
639 * The right to invoke `path_symlink`.
640 */
641#define __WASI_RIGHTS_PATH_SYMLINK ((__wasi_rights_t)(1 << 24))
642
643/**
644 * The right to invoke `path_remove_directory`.
645 */
646#define __WASI_RIGHTS_PATH_REMOVE_DIRECTORY ((__wasi_rights_t)(1 << 25))
647
648/**
649 * The right to invoke `path_unlink_file`.
650 */
651#define __WASI_RIGHTS_PATH_UNLINK_FILE ((__wasi_rights_t)(1 << 26))
652
653/**
654 * If `rights::fd_read` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_read`.
655 * If `rights::fd_write` is set, includes the right to invoke `poll_oneoff` to subscribe to `eventtype::fd_write`.
656 */
657#define __WASI_RIGHTS_POLL_FD_READWRITE ((__wasi_rights_t)(1 << 27))
658
659/**
660 * The right to invoke `sock_shutdown`.
661 */
662#define __WASI_RIGHTS_SOCK_SHUTDOWN ((__wasi_rights_t)(1 << 28))
663
664/**
665 * A file descriptor handle.
666 */
667typedef int __wasi_fd_t;
668
669_Static_assert(sizeof(__wasi_fd_t) == 4, "witx calculated size");
670_Static_assert(_Alignof(__wasi_fd_t) == 4, "witx calculated align");
671
672/**
673 * A region of memory for scatter/gather reads.
674 */
675typedef struct __wasi_iovec_t {
676 /**
677 * The address of the buffer to be filled.
678 */
679 uint8_t * buf;
680
681 /**
682 * The length of the buffer to be filled.
683 */
684 __wasi_size_t buf_len;
685
686} __wasi_iovec_t;
687
688_Static_assert(sizeof(__wasi_iovec_t) == 8, "witx calculated size");
689_Static_assert(_Alignof(__wasi_iovec_t) == 4, "witx calculated align");
690_Static_assert(offsetof(__wasi_iovec_t, buf) == 0, "witx calculated offset");
691_Static_assert(offsetof(__wasi_iovec_t, buf_len) == 4, "witx calculated offset");
692
693/**
694 * A region of memory for scatter/gather writes.
695 */
696typedef struct __wasi_ciovec_t {
697 /**
698 * The address of the buffer to be written.
699 */
700 const uint8_t * buf;
701
702 /**
703 * The length of the buffer to be written.
704 */
705 __wasi_size_t buf_len;
706
707} __wasi_ciovec_t;
708
709_Static_assert(sizeof(__wasi_ciovec_t) == 8, "witx calculated size");
710_Static_assert(_Alignof(__wasi_ciovec_t) == 4, "witx calculated align");
711_Static_assert(offsetof(__wasi_ciovec_t, buf) == 0, "witx calculated offset");
712_Static_assert(offsetof(__wasi_ciovec_t, buf_len) == 4, "witx calculated offset");
713
714/**
715 * Relative offset within a file.
716 */
717typedef int64_t __wasi_filedelta_t;
718
719_Static_assert(sizeof(__wasi_filedelta_t) == 8, "witx calculated size");
720_Static_assert(_Alignof(__wasi_filedelta_t) == 8, "witx calculated align");
721
722/**
723 * The position relative to which to set the offset of the file descriptor.
724 */
725typedef uint8_t __wasi_whence_t;
726
727/**
728 * Seek relative to start-of-file.
729 */
730#define __WASI_WHENCE_SET (UINT8_C(0))
731
732/**
733 * Seek relative to current position.
734 */
735#define __WASI_WHENCE_CUR (UINT8_C(1))
736
737/**
738 * Seek relative to end-of-file.
739 */
740#define __WASI_WHENCE_END (UINT8_C(2))
741
742_Static_assert(sizeof(__wasi_whence_t) == 1, "witx calculated size");
743_Static_assert(_Alignof(__wasi_whence_t) == 1, "witx calculated align");
744
745/**
746 * A reference to the offset of a directory entry.
747 *
748 * The value 0 signifies the start of the directory.
749 */
750typedef uint64_t __wasi_dircookie_t;
751
752_Static_assert(sizeof(__wasi_dircookie_t) == 8, "witx calculated size");
753_Static_assert(_Alignof(__wasi_dircookie_t) == 8, "witx calculated align");
754
755/**
756 * The type for the `dirent::d_namlen` field of `dirent` struct.
757 */
758typedef uint32_t __wasi_dirnamlen_t;
759
760_Static_assert(sizeof(__wasi_dirnamlen_t) == 4, "witx calculated size");
761_Static_assert(_Alignof(__wasi_dirnamlen_t) == 4, "witx calculated align");
762
763/**
764 * File serial number that is unique within its file system.
765 */
766typedef uint64_t __wasi_inode_t;
767
768_Static_assert(sizeof(__wasi_inode_t) == 8, "witx calculated size");
769_Static_assert(_Alignof(__wasi_inode_t) == 8, "witx calculated align");
770
771/**
772 * The type of a file descriptor or file.
773 */
774typedef uint8_t __wasi_filetype_t;
775
776/**
777 * The type of the file descriptor or file is unknown or is different from any of the other types specified.
778 */
779#define __WASI_FILETYPE_UNKNOWN (UINT8_C(0))
780
781/**
782 * The file descriptor or file refers to a block device inode.
783 */
784#define __WASI_FILETYPE_BLOCK_DEVICE (UINT8_C(1))
785
786/**
787 * The file descriptor or file refers to a character device inode.
788 */
789#define __WASI_FILETYPE_CHARACTER_DEVICE (UINT8_C(2))
790
791/**
792 * The file descriptor or file refers to a directory inode.
793 */
794#define __WASI_FILETYPE_DIRECTORY (UINT8_C(3))
795
796/**
797 * The file descriptor or file refers to a regular file inode.
798 */
799#define __WASI_FILETYPE_REGULAR_FILE (UINT8_C(4))
800
801/**
802 * The file descriptor or file refers to a datagram socket.
803 */
804#define __WASI_FILETYPE_SOCKET_DGRAM (UINT8_C(5))
805
806/**
807 * The file descriptor or file refers to a byte-stream socket.
808 */
809#define __WASI_FILETYPE_SOCKET_STREAM (UINT8_C(6))
810
811/**
812 * The file refers to a symbolic link inode.
813 */
814#define __WASI_FILETYPE_SYMBOLIC_LINK (UINT8_C(7))
815
816_Static_assert(sizeof(__wasi_filetype_t) == 1, "witx calculated size");
817_Static_assert(_Alignof(__wasi_filetype_t) == 1, "witx calculated align");
818
819/**
820 * A directory entry.
821 */
822typedef struct __wasi_dirent_t {
823 /**
824 * The offset of the next directory entry stored in this directory.
825 */
826 __wasi_dircookie_t d_next;
827
828 /**
829 * The serial number of the file referred to by this directory entry.
830 */
831 __wasi_inode_t d_ino;
832
833 /**
834 * The length of the name of the directory entry.
835 */
836 __wasi_dirnamlen_t d_namlen;
837
838 /**
839 * The type of the file referred to by this directory entry.
840 */
841 __wasi_filetype_t d_type;
842
843} __wasi_dirent_t;
844
845_Static_assert(sizeof(__wasi_dirent_t) == 24, "witx calculated size");
846_Static_assert(_Alignof(__wasi_dirent_t) == 8, "witx calculated align");
847_Static_assert(offsetof(__wasi_dirent_t, d_next) == 0, "witx calculated offset");
848_Static_assert(offsetof(__wasi_dirent_t, d_ino) == 8, "witx calculated offset");
849_Static_assert(offsetof(__wasi_dirent_t, d_namlen) == 16, "witx calculated offset");
850_Static_assert(offsetof(__wasi_dirent_t, d_type) == 20, "witx calculated offset");
851
852/**
853 * File or memory access pattern advisory information.
854 */
855typedef uint8_t __wasi_advice_t;
856
857/**
858 * The application has no advice to give on its behavior with respect to the specified data.
859 */
860#define __WASI_ADVICE_NORMAL (UINT8_C(0))
861
862/**
863 * The application expects to access the specified data sequentially from lower offsets to higher offsets.
864 */
865#define __WASI_ADVICE_SEQUENTIAL (UINT8_C(1))
866
867/**
868 * The application expects to access the specified data in a random order.
869 */
870#define __WASI_ADVICE_RANDOM (UINT8_C(2))
871
872/**
873 * The application expects to access the specified data in the near future.
874 */
875#define __WASI_ADVICE_WILLNEED (UINT8_C(3))
876
877/**
878 * The application expects that it will not access the specified data in the near future.
879 */
880#define __WASI_ADVICE_DONTNEED (UINT8_C(4))
881
882/**
883 * The application expects to access the specified data once and then not reuse it thereafter.
884 */
885#define __WASI_ADVICE_NOREUSE (UINT8_C(5))
886
887_Static_assert(sizeof(__wasi_advice_t) == 1, "witx calculated size");
888_Static_assert(_Alignof(__wasi_advice_t) == 1, "witx calculated align");
889
890/**
891 * File descriptor flags.
892 */
893typedef uint16_t __wasi_fdflags_t;
894
895/**
896 * Append mode: Data written to the file is always appended to the file's end.
897 */
898#define __WASI_FDFLAGS_APPEND ((__wasi_fdflags_t)(1 << 0))
899
900/**
901 * Write according to synchronized I/O data integrity completion. Only the data stored in the file is synchronized.
902 */
903#define __WASI_FDFLAGS_DSYNC ((__wasi_fdflags_t)(1 << 1))
904
905/**
906 * Non-blocking mode.
907 */
908#define __WASI_FDFLAGS_NONBLOCK ((__wasi_fdflags_t)(1 << 2))
909
910/**
911 * Synchronized read I/O operations.
912 */
913#define __WASI_FDFLAGS_RSYNC ((__wasi_fdflags_t)(1 << 3))
914
915/**
916 * Write according to synchronized I/O file integrity completion. In
917 * addition to synchronizing the data stored in the file, the implementation
918 * may also synchronously update the file's metadata.
919 */
920#define __WASI_FDFLAGS_SYNC ((__wasi_fdflags_t)(1 << 4))
921
922/**
923 * File descriptor attributes.
924 */
925typedef struct __wasi_fdstat_t {
926 /**
927 * File type.
928 */
929 __wasi_filetype_t fs_filetype;
930
931 /**
932 * File descriptor flags.
933 */
934 __wasi_fdflags_t fs_flags;
935
936 /**
937 * Rights that apply to this file descriptor.
938 */
939 __wasi_rights_t fs_rights_base;
940
941 /**
942 * Maximum set of rights that may be installed on new file descriptors that
943 * are created through this file descriptor, e.g., through `path_open`.
944 */
945 __wasi_rights_t fs_rights_inheriting;
946
947} __wasi_fdstat_t;
948
949_Static_assert(sizeof(__wasi_fdstat_t) == 24, "witx calculated size");
950_Static_assert(_Alignof(__wasi_fdstat_t) == 8, "witx calculated align");
951_Static_assert(offsetof(__wasi_fdstat_t, fs_filetype) == 0, "witx calculated offset");
952_Static_assert(offsetof(__wasi_fdstat_t, fs_flags) == 2, "witx calculated offset");
953_Static_assert(offsetof(__wasi_fdstat_t, fs_rights_base) == 8, "witx calculated offset");
954_Static_assert(offsetof(__wasi_fdstat_t, fs_rights_inheriting) == 16, "witx calculated offset");
955
956/**
957 * Identifier for a device containing a file system. Can be used in combination
958 * with `inode` to uniquely identify a file or directory in the filesystem.
959 */
960typedef uint64_t __wasi_device_t;
961
962_Static_assert(sizeof(__wasi_device_t) == 8, "witx calculated size");
963_Static_assert(_Alignof(__wasi_device_t) == 8, "witx calculated align");
964
965/**
966 * Which file time attributes to adjust.
967 */
968typedef uint16_t __wasi_fstflags_t;
969
970/**
971 * Adjust the last data access timestamp to the value stored in `filestat::atim`.
972 */
973#define __WASI_FSTFLAGS_ATIM ((__wasi_fstflags_t)(1 << 0))
974
975/**
976 * Adjust the last data access timestamp to the time of clock `clockid::realtime`.
977 */
978#define __WASI_FSTFLAGS_ATIM_NOW ((__wasi_fstflags_t)(1 << 1))
979
980/**
981 * Adjust the last data modification timestamp to the value stored in `filestat::mtim`.
982 */
983#define __WASI_FSTFLAGS_MTIM ((__wasi_fstflags_t)(1 << 2))
984
985/**
986 * Adjust the last data modification timestamp to the time of clock `clockid::realtime`.
987 */
988#define __WASI_FSTFLAGS_MTIM_NOW ((__wasi_fstflags_t)(1 << 3))
989
990/**
991 * Flags determining the method of how paths are resolved.
992 */
993typedef uint32_t __wasi_lookupflags_t;
994
995/**
996 * As long as the resolved path corresponds to a symbolic link, it is expanded.
997 */
998#define __WASI_LOOKUPFLAGS_SYMLINK_FOLLOW ((__wasi_lookupflags_t)(1 << 0))
999
1000/**
1001 * Open flags used by `path_open`.
1002 */
1003typedef uint16_t __wasi_oflags_t;
1004
1005/**
1006 * Create file if it does not exist.
1007 */
1008#define __WASI_OFLAGS_CREAT ((__wasi_oflags_t)(1 << 0))
1009
1010/**
1011 * Fail if not a directory.
1012 */
1013#define __WASI_OFLAGS_DIRECTORY ((__wasi_oflags_t)(1 << 1))
1014
1015/**
1016 * Fail if file already exists.
1017 */
1018#define __WASI_OFLAGS_EXCL ((__wasi_oflags_t)(1 << 2))
1019
1020/**
1021 * Truncate file to size 0.
1022 */
1023#define __WASI_OFLAGS_TRUNC ((__wasi_oflags_t)(1 << 3))
1024
1025/**
1026 * Number of hard links to an inode.
1027 */
1028typedef uint64_t __wasi_linkcount_t;
1029
1030_Static_assert(sizeof(__wasi_linkcount_t) == 8, "witx calculated size");
1031_Static_assert(_Alignof(__wasi_linkcount_t) == 8, "witx calculated align");
1032
1033/**
1034 * File attributes.
1035 */
1036typedef struct __wasi_filestat_t {
1037 /**
1038 * Device ID of device containing the file.
1039 */
1040 __wasi_device_t dev;
1041
1042 /**
1043 * File serial number.
1044 */
1045 __wasi_inode_t ino;
1046
1047 /**
1048 * File type.
1049 */
1050 __wasi_filetype_t filetype;
1051
1052 /**
1053 * Number of hard links to the file.
1054 */
1055 __wasi_linkcount_t nlink;
1056
1057 /**
1058 * For regular files, the file size in bytes. For symbolic links, the length in bytes of the pathname contained in the symbolic link.
1059 */
1060 __wasi_filesize_t size;
1061
1062 /**
1063 * Last data access timestamp.
1064 */
1065 __wasi_timestamp_t atim;
1066
1067 /**
1068 * Last data modification timestamp.
1069 */
1070 __wasi_timestamp_t mtim;
1071
1072 /**
1073 * Last file status change timestamp.
1074 */
1075 __wasi_timestamp_t ctim;
1076
1077} __wasi_filestat_t;
1078
1079_Static_assert(sizeof(__wasi_filestat_t) == 64, "witx calculated size");
1080_Static_assert(_Alignof(__wasi_filestat_t) == 8, "witx calculated align");
1081_Static_assert(offsetof(__wasi_filestat_t, dev) == 0, "witx calculated offset");
1082_Static_assert(offsetof(__wasi_filestat_t, ino) == 8, "witx calculated offset");
1083_Static_assert(offsetof(__wasi_filestat_t, filetype) == 16, "witx calculated offset");
1084_Static_assert(offsetof(__wasi_filestat_t, nlink) == 24, "witx calculated offset");
1085_Static_assert(offsetof(__wasi_filestat_t, size) == 32, "witx calculated offset");
1086_Static_assert(offsetof(__wasi_filestat_t, atim) == 40, "witx calculated offset");
1087_Static_assert(offsetof(__wasi_filestat_t, mtim) == 48, "witx calculated offset");
1088_Static_assert(offsetof(__wasi_filestat_t, ctim) == 56, "witx calculated offset");
1089
1090/**
1091 * User-provided value that may be attached to objects that is retained when
1092 * extracted from the implementation.
1093 */
1094typedef uint64_t __wasi_userdata_t;
1095
1096_Static_assert(sizeof(__wasi_userdata_t) == 8, "witx calculated size");
1097_Static_assert(_Alignof(__wasi_userdata_t) == 8, "witx calculated align");
1098
1099/**
1100 * Type of a subscription to an event or its occurrence.
1101 */
1102typedef uint8_t __wasi_eventtype_t;
1103
1104/**
1105 * The time value of clock `subscription_clock::id` has
1106 * reached timestamp `subscription_clock::timeout`.
1107 */
1108#define __WASI_EVENTTYPE_CLOCK (UINT8_C(0))
1109
1110/**
1111 * File descriptor `subscription_fd_readwrite::file_descriptor` has data
1112 * available for reading. This event always triggers for regular files.
1113 */
1114#define __WASI_EVENTTYPE_FD_READ (UINT8_C(1))
1115
1116/**
1117 * File descriptor `subscription_fd_readwrite::file_descriptor` has capacity
1118 * available for writing. This event always triggers for regular files.
1119 */
1120#define __WASI_EVENTTYPE_FD_WRITE (UINT8_C(2))
1121
1122_Static_assert(sizeof(__wasi_eventtype_t) == 1, "witx calculated size");
1123_Static_assert(_Alignof(__wasi_eventtype_t) == 1, "witx calculated align");
1124
1125/**
1126 * The state of the file descriptor subscribed to with
1127 * `eventtype::fd_read` or `eventtype::fd_write`.
1128 */
1129typedef uint16_t __wasi_eventrwflags_t;
1130
1131/**
1132 * The peer of this socket has closed or disconnected.
1133 */
1134#define __WASI_EVENTRWFLAGS_FD_READWRITE_HANGUP ((__wasi_eventrwflags_t)(1 << 0))
1135
1136/**
1137 * The contents of an `event` when type is `eventtype::fd_read` or
1138 * `eventtype::fd_write`.
1139 */
1140typedef struct __wasi_event_fd_readwrite_t {
1141 /**
1142 * The number of bytes available for reading or writing.
1143 */
1144 __wasi_filesize_t nbytes;
1145
1146 /**
1147 * The state of the file descriptor.
1148 */
1149 __wasi_eventrwflags_t flags;
1150
1151} __wasi_event_fd_readwrite_t;
1152
1153_Static_assert(sizeof(__wasi_event_fd_readwrite_t) == 16, "witx calculated size");
1154_Static_assert(_Alignof(__wasi_event_fd_readwrite_t) == 8, "witx calculated align");
1155_Static_assert(offsetof(__wasi_event_fd_readwrite_t, nbytes) == 0, "witx calculated offset");
1156_Static_assert(offsetof(__wasi_event_fd_readwrite_t, flags) == 8, "witx calculated offset");
1157
1158/**
1159 * An event that occurred.
1160 */
1161typedef struct __wasi_event_t {
1162 /**
1163 * User-provided value that got attached to `subscription::userdata`.
1164 */
1165 __wasi_userdata_t userdata;
1166
1167 /**
1168 * If non-zero, an error that occurred while processing the subscription request.
1169 */
1170 __wasi_errno_t error;
1171
1172 /**
1173 * The type of event that occured
1174 */
1175 __wasi_eventtype_t type;
1176
1177 /**
1178 * The contents of the event, if it is an `eventtype::fd_read` or
1179 * `eventtype::fd_write`. `eventtype::clock` events ignore this field.
1180 */
1181 __wasi_event_fd_readwrite_t fd_readwrite;
1182
1183} __wasi_event_t;
1184
1185_Static_assert(sizeof(__wasi_event_t) == 32, "witx calculated size");
1186_Static_assert(_Alignof(__wasi_event_t) == 8, "witx calculated align");
1187_Static_assert(offsetof(__wasi_event_t, userdata) == 0, "witx calculated offset");
1188_Static_assert(offsetof(__wasi_event_t, error) == 8, "witx calculated offset");
1189_Static_assert(offsetof(__wasi_event_t, type) == 10, "witx calculated offset");
1190_Static_assert(offsetof(__wasi_event_t, fd_readwrite) == 16, "witx calculated offset");
1191
1192/**
1193 * Flags determining how to interpret the timestamp provided in
1194 * `subscription_clock::timeout`.
1195 */
1196typedef uint16_t __wasi_subclockflags_t;
1197
1198/**
1199 * If set, treat the timestamp provided in
1200 * `subscription_clock::timeout` as an absolute timestamp of clock
1201 * `subscription_clock::id`. If clear, treat the timestamp
1202 * provided in `subscription_clock::timeout` relative to the
1203 * current time value of clock `subscription_clock::id`.
1204 */
1205#define __WASI_SUBCLOCKFLAGS_SUBSCRIPTION_CLOCK_ABSTIME ((__wasi_subclockflags_t)(1 << 0))
1206
1207/**
1208 * The contents of a `subscription` when type is `eventtype::clock`.
1209 */
1210typedef struct __wasi_subscription_clock_t {
1211 /**
1212 * The clock against which to compare the timestamp.
1213 */
1214 __wasi_clockid_t id;
1215
1216 /**
1217 * The absolute or relative timestamp.
1218 */
1219 __wasi_timestamp_t timeout;
1220
1221 /**
1222 * The amount of time that the implementation may wait additionally
1223 * to coalesce with other events.
1224 */
1225 __wasi_timestamp_t precision;
1226
1227 /**
1228 * Flags specifying whether the timeout is absolute or relative
1229 */
1230 __wasi_subclockflags_t flags;
1231
1232} __wasi_subscription_clock_t;
1233
1234_Static_assert(sizeof(__wasi_subscription_clock_t) == 32, "witx calculated size");
1235_Static_assert(_Alignof(__wasi_subscription_clock_t) == 8, "witx calculated align");
1236_Static_assert(offsetof(__wasi_subscription_clock_t, id) == 0, "witx calculated offset");
1237_Static_assert(offsetof(__wasi_subscription_clock_t, timeout) == 8, "witx calculated offset");
1238_Static_assert(offsetof(__wasi_subscription_clock_t, precision) == 16, "witx calculated offset");
1239_Static_assert(offsetof(__wasi_subscription_clock_t, flags) == 24, "witx calculated offset");
1240
1241/**
1242 * The contents of a `subscription` when type is type is
1243 * `eventtype::fd_read` or `eventtype::fd_write`.
1244 */
1245typedef struct __wasi_subscription_fd_readwrite_t {
1246 /**
1247 * The file descriptor on which to wait for it to become ready for reading or writing.
1248 */
1249 __wasi_fd_t file_descriptor;
1250
1251} __wasi_subscription_fd_readwrite_t;
1252
1253_Static_assert(sizeof(__wasi_subscription_fd_readwrite_t) == 4, "witx calculated size");
1254_Static_assert(_Alignof(__wasi_subscription_fd_readwrite_t) == 4, "witx calculated align");
1255_Static_assert(offsetof(__wasi_subscription_fd_readwrite_t, file_descriptor) == 0, "witx calculated offset");
1256
1257/**
1258 * The contents of a `subscription`.
1259 */
1260typedef union __wasi_subscription_u_u_t {
1261 __wasi_subscription_clock_t clock;
1262 __wasi_subscription_fd_readwrite_t fd_read;
1263 __wasi_subscription_fd_readwrite_t fd_write;
1264} __wasi_subscription_u_u_t;
1265typedef struct __wasi_subscription_u_t {
1266 uint8_t tag;
1267 __wasi_subscription_u_u_t u;
1268} __wasi_subscription_u_t;
1269
1270_Static_assert(sizeof(__wasi_subscription_u_t) == 40, "witx calculated size");
1271_Static_assert(_Alignof(__wasi_subscription_u_t) == 8, "witx calculated align");
1272
1273/**
1274 * Subscription to an event.
1275 */
1276typedef struct __wasi_subscription_t {
1277 /**
1278 * User-provided value that is attached to the subscription in the
1279 * implementation and returned through `event::userdata`.
1280 */
1281 __wasi_userdata_t userdata;
1282
1283 /**
1284 * The type of the event to which to subscribe, and its contents
1285 */
1286 __wasi_subscription_u_t u;
1287
1288} __wasi_subscription_t;
1289
1290_Static_assert(sizeof(__wasi_subscription_t) == 48, "witx calculated size");
1291_Static_assert(_Alignof(__wasi_subscription_t) == 8, "witx calculated align");
1292_Static_assert(offsetof(__wasi_subscription_t, userdata) == 0, "witx calculated offset");
1293_Static_assert(offsetof(__wasi_subscription_t, u) == 8, "witx calculated offset");
1294
1295/**
1296 * Exit code generated by a process when exiting.
1297 */
1298typedef uint32_t __wasi_exitcode_t;
1299
1300_Static_assert(sizeof(__wasi_exitcode_t) == 4, "witx calculated size");
1301_Static_assert(_Alignof(__wasi_exitcode_t) == 4, "witx calculated align");
1302
1303/**
1304 * Signal condition.
1305 */
1306typedef uint8_t __wasi_signal_t;
1307
1308/**
1309 * No signal. Note that POSIX has special semantics for `kill(pid, 0)`,
1310 * so this value is reserved.
1311 */
1312#define __WASI_SIGNAL_NONE (UINT8_C(0))
1313
1314/**
1315 * Hangup.
1316 * Action: Terminates the process.
1317 */
1318#define __WASI_SIGNAL_HUP (UINT8_C(1))
1319
1320/**
1321 * Terminate interrupt signal.
1322 * Action: Terminates the process.
1323 */
1324#define __WASI_SIGNAL_INT (UINT8_C(2))
1325
1326/**
1327 * Terminal quit signal.
1328 * Action: Terminates the process.
1329 */
1330#define __WASI_SIGNAL_QUIT (UINT8_C(3))
1331
1332/**
1333 * Illegal instruction.
1334 * Action: Terminates the process.
1335 */
1336#define __WASI_SIGNAL_ILL (UINT8_C(4))
1337
1338/**
1339 * Trace/breakpoint trap.
1340 * Action: Terminates the process.
1341 */
1342#define __WASI_SIGNAL_TRAP (UINT8_C(5))
1343
1344/**
1345 * Process abort signal.
1346 * Action: Terminates the process.
1347 */
1348#define __WASI_SIGNAL_ABRT (UINT8_C(6))
1349
1350/**
1351 * Access to an undefined portion of a memory object.
1352 * Action: Terminates the process.
1353 */
1354#define __WASI_SIGNAL_BUS (UINT8_C(7))
1355
1356/**
1357 * Erroneous arithmetic operation.
1358 * Action: Terminates the process.
1359 */
1360#define __WASI_SIGNAL_FPE (UINT8_C(8))
1361
1362/**
1363 * Kill.
1364 * Action: Terminates the process.
1365 */
1366#define __WASI_SIGNAL_KILL (UINT8_C(9))
1367
1368/**
1369 * User-defined signal 1.
1370 * Action: Terminates the process.
1371 */
1372#define __WASI_SIGNAL_USR1 (UINT8_C(10))
1373
1374/**
1375 * Invalid memory reference.
1376 * Action: Terminates the process.
1377 */
1378#define __WASI_SIGNAL_SEGV (UINT8_C(11))
1379
1380/**
1381 * User-defined signal 2.
1382 * Action: Terminates the process.
1383 */
1384#define __WASI_SIGNAL_USR2 (UINT8_C(12))
1385
1386/**
1387 * Write on a pipe with no one to read it.
1388 * Action: Ignored.
1389 */
1390#define __WASI_SIGNAL_PIPE (UINT8_C(13))
1391
1392/**
1393 * Alarm clock.
1394 * Action: Terminates the process.
1395 */
1396#define __WASI_SIGNAL_ALRM (UINT8_C(14))
1397
1398/**
1399 * Termination signal.
1400 * Action: Terminates the process.
1401 */
1402#define __WASI_SIGNAL_TERM (UINT8_C(15))
1403
1404/**
1405 * Child process terminated, stopped, or continued.
1406 * Action: Ignored.
1407 */
1408#define __WASI_SIGNAL_CHLD (UINT8_C(16))
1409
1410/**
1411 * Continue executing, if stopped.
1412 * Action: Continues executing, if stopped.
1413 */
1414#define __WASI_SIGNAL_CONT (UINT8_C(17))
1415
1416/**
1417 * Stop executing.
1418 * Action: Stops executing.
1419 */
1420#define __WASI_SIGNAL_STOP (UINT8_C(18))
1421
1422/**
1423 * Terminal stop signal.
1424 * Action: Stops executing.
1425 */
1426#define __WASI_SIGNAL_TSTP (UINT8_C(19))
1427
1428/**
1429 * Background process attempting read.
1430 * Action: Stops executing.
1431 */
1432#define __WASI_SIGNAL_TTIN (UINT8_C(20))
1433
1434/**
1435 * Background process attempting write.
1436 * Action: Stops executing.
1437 */
1438#define __WASI_SIGNAL_TTOU (UINT8_C(21))
1439
1440/**
1441 * High bandwidth data is available at a socket.
1442 * Action: Ignored.
1443 */
1444#define __WASI_SIGNAL_URG (UINT8_C(22))
1445
1446/**
1447 * CPU time limit exceeded.
1448 * Action: Terminates the process.
1449 */
1450#define __WASI_SIGNAL_XCPU (UINT8_C(23))
1451
1452/**
1453 * File size limit exceeded.
1454 * Action: Terminates the process.
1455 */
1456#define __WASI_SIGNAL_XFSZ (UINT8_C(24))
1457
1458/**
1459 * Virtual timer expired.
1460 * Action: Terminates the process.
1461 */
1462#define __WASI_SIGNAL_VTALRM (UINT8_C(25))
1463
1464/**
1465 * Profiling timer expired.
1466 * Action: Terminates the process.
1467 */
1468#define __WASI_SIGNAL_PROF (UINT8_C(26))
1469
1470/**
1471 * Window changed.
1472 * Action: Ignored.
1473 */
1474#define __WASI_SIGNAL_WINCH (UINT8_C(27))
1475
1476/**
1477 * I/O possible.
1478 * Action: Terminates the process.
1479 */
1480#define __WASI_SIGNAL_POLL (UINT8_C(28))
1481
1482/**
1483 * Power failure.
1484 * Action: Terminates the process.
1485 */
1486#define __WASI_SIGNAL_PWR (UINT8_C(29))
1487
1488/**
1489 * Bad system call.
1490 * Action: Terminates the process.
1491 */
1492#define __WASI_SIGNAL_SYS (UINT8_C(30))
1493
1494_Static_assert(sizeof(__wasi_signal_t) == 1, "witx calculated size");
1495_Static_assert(_Alignof(__wasi_signal_t) == 1, "witx calculated align");
1496
1497/**
1498 * Flags provided to `sock_recv`.
1499 */
1500typedef uint16_t __wasi_riflags_t;
1501
1502/**
1503 * Returns the message without removing it from the socket's receive queue.
1504 */
1505#define __WASI_RIFLAGS_RECV_PEEK ((__wasi_riflags_t)(1 << 0))
1506
1507/**
1508 * On byte-stream sockets, block until the full amount of data can be returned.
1509 */
1510#define __WASI_RIFLAGS_RECV_WAITALL ((__wasi_riflags_t)(1 << 1))
1511
1512/**
1513 * Flags returned by `sock_recv`.
1514 */
1515typedef uint16_t __wasi_roflags_t;
1516
1517/**
1518 * Returned by `sock_recv`: Message data has been truncated.
1519 */
1520#define __WASI_ROFLAGS_RECV_DATA_TRUNCATED ((__wasi_roflags_t)(1 << 0))
1521
1522/**
1523 * Flags provided to `sock_send`. As there are currently no flags
1524 * defined, it must be set to zero.
1525 */
1526typedef uint16_t __wasi_siflags_t;
1527
1528_Static_assert(sizeof(__wasi_siflags_t) == 2, "witx calculated size");
1529_Static_assert(_Alignof(__wasi_siflags_t) == 2, "witx calculated align");
1530
1531/**
1532 * Which channels on a socket to shut down.
1533 */
1534typedef uint8_t __wasi_sdflags_t;
1535
1536/**
1537 * Disables further receive operations.
1538 */
1539#define __WASI_SDFLAGS_RD ((__wasi_sdflags_t)(1 << 0))
1540
1541/**
1542 * Disables further send operations.
1543 */
1544#define __WASI_SDFLAGS_WR ((__wasi_sdflags_t)(1 << 1))
1545
1546/**
1547 * Identifiers for preopened capabilities.
1548 */
1549typedef uint8_t __wasi_preopentype_t;
1550
1551/**
1552 * A pre-opened directory.
1553 */
1554#define __WASI_PREOPENTYPE_DIR (UINT8_C(0))
1555
1556_Static_assert(sizeof(__wasi_preopentype_t) == 1, "witx calculated size");
1557_Static_assert(_Alignof(__wasi_preopentype_t) == 1, "witx calculated align");
1558
1559/**
1560 * The contents of a $prestat when type is `preopentype::dir`.
1561 */
1562typedef struct __wasi_prestat_dir_t {
1563 /**
1564 * The length of the directory name for use with `fd_prestat_dir_name`.
1565 */
1566 __wasi_size_t pr_name_len;
1567
1568} __wasi_prestat_dir_t;
1569
1570_Static_assert(sizeof(__wasi_prestat_dir_t) == 4, "witx calculated size");
1571_Static_assert(_Alignof(__wasi_prestat_dir_t) == 4, "witx calculated align");
1572_Static_assert(offsetof(__wasi_prestat_dir_t, pr_name_len) == 0, "witx calculated offset");
1573
1574/**
1575 * Information about a pre-opened capability.
1576 */
1577typedef union __wasi_prestat_u_t {
1578 __wasi_prestat_dir_t dir;
1579} __wasi_prestat_u_t;
1580typedef struct __wasi_prestat_t {
1581 uint8_t tag;
1582 __wasi_prestat_u_t u;
1583} __wasi_prestat_t;
1584
1585_Static_assert(sizeof(__wasi_prestat_t) == 8, "witx calculated size");
1586_Static_assert(_Alignof(__wasi_prestat_t) == 4, "witx calculated align");
1587
1588/**
1589 * @defgroup wasi_snapshot_preview1
1590 * @{
1591 */
1592
1593/**
1594 * Read command-line argument data.
1595 * The size of the array should match that returned by `args_sizes_get`
1596 */
1597__wasi_errno_t __wasi_args_get(
1598 uint8_t * * argv,
1599 uint8_t * argv_buf
1600) __attribute__((__warn_unused_result__));
1601/**
1602 * Return command-line argument data sizes.
1603 * @return
1604 * Returns the number of arguments and the size of the argument string
1605 * data, or an error.
1606 */
1607__wasi_errno_t __wasi_args_sizes_get(
1608 __wasi_size_t *retptr0,
1609 __wasi_size_t *retptr1
1610) __attribute__((__warn_unused_result__));
1611/**
1612 * Read environment variable data.
1613 * The sizes of the buffers should match that returned by `environ_sizes_get`.
1614 */
1615__wasi_errno_t __wasi_environ_get(
1616 uint8_t * * environ,
1617 uint8_t * environ_buf
1618) __attribute__((__warn_unused_result__));
1619/**
1620 * Return environment variable data sizes.
1621 * @return
1622 * Returns the number of environment variable arguments and the size of the
1623 * environment variable data.
1624 */
1625__wasi_errno_t __wasi_environ_sizes_get(
1626 __wasi_size_t *retptr0,
1627 __wasi_size_t *retptr1
1628) __attribute__((__warn_unused_result__));
1629/**
1630 * Return the resolution of a clock.
1631 * Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks,
1632 * return `errno::inval`.
1633 * Note: This is similar to `clock_getres` in POSIX.
1634 * @return
1635 * The resolution of the clock, or an error if one happened.
1636 */
1637__wasi_errno_t __wasi_clock_res_get(
1638 /**
1639 * The clock for which to return the resolution.
1640 */
1641 __wasi_clockid_t id,
1642 __wasi_timestamp_t *retptr0
1643) __attribute__((__warn_unused_result__));
1644/**
1645 * Return the time value of a clock.
1646 * Note: This is similar to `clock_gettime` in POSIX.
1647 * @return
1648 * The time value of the clock.
1649 */
1650__wasi_errno_t __wasi_clock_time_get(
1651 /**
1652 * The clock for which to return the time.
1653 */
1654 __wasi_clockid_t id,
1655 /**
1656 * The maximum lag (exclusive) that the returned time value may have, compared to its actual value.
1657 */
1658 __wasi_timestamp_t precision,
1659 __wasi_timestamp_t *retptr0
1660) __attribute__((__warn_unused_result__));
1661/**
1662 * Provide file advisory information on a file descriptor.
1663 * Note: This is similar to `posix_fadvise` in POSIX.
1664 */
1665__wasi_errno_t __wasi_fd_advise(
1666 __wasi_fd_t fd,
1667 /**
1668 * The offset within the file to which the advisory applies.
1669 */
1670 __wasi_filesize_t offset,
1671 /**
1672 * The length of the region to which the advisory applies.
1673 */
1674 __wasi_filesize_t len,
1675 /**
1676 * The advice.
1677 */
1678 __wasi_advice_t advice
1679) __attribute__((__warn_unused_result__));
1680/**
1681 * Force the allocation of space in a file.
1682 * Note: This is similar to `posix_fallocate` in POSIX.
1683 */
1684__wasi_errno_t __wasi_fd_allocate(
1685 __wasi_fd_t fd,
1686 /**
1687 * The offset at which to start the allocation.
1688 */
1689 __wasi_filesize_t offset,
1690 /**
1691 * The length of the area that is allocated.
1692 */
1693 __wasi_filesize_t len
1694) __attribute__((__warn_unused_result__));
1695/**
1696 * Close a file descriptor.
1697 * Note: This is similar to `close` in POSIX.
1698 */
1699__wasi_errno_t __wasi_fd_close(
1700 __wasi_fd_t fd
1701) __attribute__((__warn_unused_result__));
1702/**
1703 * Synchronize the data of a file to disk.
1704 * Note: This is similar to `fdatasync` in POSIX.
1705 */
1706__wasi_errno_t __wasi_fd_datasync(
1707 __wasi_fd_t fd
1708) __attribute__((__warn_unused_result__));
1709/**
1710 * Get the attributes of a file descriptor.
1711 * Note: This returns similar flags to `fsync(fd, F_GETFL)` in POSIX, as well as additional fields.
1712 * @return
1713 * The buffer where the file descriptor's attributes are stored.
1714 */
1715__wasi_errno_t __wasi_fd_fdstat_get(
1716 __wasi_fd_t fd,
1717 __wasi_fdstat_t *retptr0
1718) __attribute__((__warn_unused_result__));
1719/**
1720 * Adjust the flags associated with a file descriptor.
1721 * Note: This is similar to `fcntl(fd, F_SETFL, flags)` in POSIX.
1722 */
1723__wasi_errno_t __wasi_fd_fdstat_set_flags(
1724 __wasi_fd_t fd,
1725 /**
1726 * The desired values of the file descriptor flags.
1727 */
1728 __wasi_fdflags_t flags
1729) __attribute__((__warn_unused_result__));
1730/**
1731 * Adjust the rights associated with a file descriptor.
1732 * This can only be used to remove rights, and returns `errno::notcapable` if called in a way that would attempt to add rights
1733 */
1734__wasi_errno_t __wasi_fd_fdstat_set_rights(
1735 __wasi_fd_t fd,
1736 /**
1737 * The desired rights of the file descriptor.
1738 */
1739 __wasi_rights_t fs_rights_base,
1740 __wasi_rights_t fs_rights_inheriting
1741) __attribute__((__warn_unused_result__));
1742/**
1743 * Return the attributes of an open file.
1744 * @return
1745 * The buffer where the file's attributes are stored.
1746 */
1747__wasi_errno_t __wasi_fd_filestat_get(
1748 __wasi_fd_t fd,
1749 __wasi_filestat_t *retptr0
1750) __attribute__((__warn_unused_result__));
1751/**
1752 * Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros.
1753 * Note: This is similar to `ftruncate` in POSIX.
1754 */
1755__wasi_errno_t __wasi_fd_filestat_set_size(
1756 __wasi_fd_t fd,
1757 /**
1758 * The desired file size.
1759 */
1760 __wasi_filesize_t size
1761) __attribute__((__warn_unused_result__));
1762/**
1763 * Adjust the timestamps of an open file or directory.
1764 * Note: This is similar to `futimens` in POSIX.
1765 */
1766__wasi_errno_t __wasi_fd_filestat_set_times(
1767 __wasi_fd_t fd,
1768 /**
1769 * The desired values of the data access timestamp.
1770 */
1771 __wasi_timestamp_t atim,
1772 /**
1773 * The desired values of the data modification timestamp.
1774 */
1775 __wasi_timestamp_t mtim,
1776 /**
1777 * A bitmask indicating which timestamps to adjust.
1778 */
1779 __wasi_fstflags_t fst_flags
1780) __attribute__((__warn_unused_result__));
1781/**
1782 * Read from a file descriptor, without using and updating the file descriptor's offset.
1783 * Note: This is similar to `preadv` in POSIX.
1784 * @return
1785 * The number of bytes read.
1786 */
1787__wasi_errno_t __wasi_fd_pread(
1788 __wasi_fd_t fd,
1789 /**
1790 * List of scatter/gather vectors in which to store data.
1791 */
1792 const __wasi_iovec_t *iovs,
1793 /**
1794 * The length of the array pointed to by `iovs`.
1795 */
1796 size_t iovs_len,
1797 /**
1798 * The offset within the file at which to read.
1799 */
1800 __wasi_filesize_t offset,
1801 __wasi_size_t *retptr0
1802) __attribute__((__warn_unused_result__));
1803/**
1804 * Return a description of the given preopened file descriptor.
1805 * @return
1806 * The buffer where the description is stored.
1807 */
1808__wasi_errno_t __wasi_fd_prestat_get(
1809 __wasi_fd_t fd,
1810 __wasi_prestat_t *retptr0
1811) __attribute__((__warn_unused_result__));
1812/**
1813 * Return a description of the given preopened file descriptor.
1814 */
1815__wasi_errno_t __wasi_fd_prestat_dir_name(
1816 __wasi_fd_t fd,
1817 /**
1818 * A buffer into which to write the preopened directory name.
1819 */
1820 uint8_t * path,
1821 __wasi_size_t path_len
1822) __attribute__((__warn_unused_result__));
1823/**
1824 * Write to a file descriptor, without using and updating the file descriptor's offset.
1825 * Note: This is similar to `pwritev` in POSIX.
1826 * @return
1827 * The number of bytes written.
1828 */
1829__wasi_errno_t __wasi_fd_pwrite(
1830 __wasi_fd_t fd,
1831 /**
1832 * List of scatter/gather vectors from which to retrieve data.
1833 */
1834 const __wasi_ciovec_t *iovs,
1835 /**
1836 * The length of the array pointed to by `iovs`.
1837 */
1838 size_t iovs_len,
1839 /**
1840 * The offset within the file at which to write.
1841 */
1842 __wasi_filesize_t offset,
1843 __wasi_size_t *retptr0
1844) __attribute__((__warn_unused_result__));
1845/**
1846 * Read from a file descriptor.
1847 * Note: This is similar to `readv` in POSIX.
1848 * @return
1849 * The number of bytes read.
1850 */
1851__wasi_errno_t __wasi_fd_read(
1852 __wasi_fd_t fd,
1853 /**
1854 * List of scatter/gather vectors to which to store data.
1855 */
1856 const __wasi_iovec_t *iovs,
1857 /**
1858 * The length of the array pointed to by `iovs`.
1859 */
1860 size_t iovs_len,
1861 __wasi_size_t *retptr0
1862) __attribute__((__warn_unused_result__));
1863/**
1864 * Read directory entries from a directory.
1865 * When successful, the contents of the output buffer consist of a sequence of
1866 * directory entries. Each directory entry consists of a `dirent` object,
1867 * followed by `dirent::d_namlen` bytes holding the name of the directory
1868 * entry.
1869 * This function fills the output buffer as much as possible, potentially
1870 * truncating the last directory entry. This allows the caller to grow its
1871 * read buffer size in case it's too small to fit a single large directory
1872 * entry, or skip the oversized directory entry.
1873 * @return
1874 * The number of bytes stored in the read buffer. If less than the size of the read buffer, the end of the directory has been reached.
1875 */
1876__wasi_errno_t __wasi_fd_readdir(
1877 __wasi_fd_t fd,
1878 /**
1879 * The buffer where directory entries are stored
1880 */
1881 uint8_t * buf,
1882 __wasi_size_t buf_len,
1883 /**
1884 * The location within the directory to start reading
1885 */
1886 __wasi_dircookie_t cookie,
1887 __wasi_size_t *retptr0
1888) __attribute__((__warn_unused_result__));
1889/**
1890 * Atomically replace a file descriptor by renumbering another file descriptor.
1891 * Due to the strong focus on thread safety, this environment does not provide
1892 * a mechanism to duplicate or renumber a file descriptor to an arbitrary
1893 * number, like `dup2()`. This would be prone to race conditions, as an actual
1894 * file descriptor with the same number could be allocated by a different
1895 * thread at the same time.
1896 * This function provides a way to atomically renumber file descriptors, which
1897 * would disappear if `dup2()` were to be removed entirely.
1898 */
1899__wasi_errno_t __wasi_fd_renumber(
1900 __wasi_fd_t fd,
1901 /**
1902 * The file descriptor to overwrite.
1903 */
1904 __wasi_fd_t to
1905) __attribute__((__warn_unused_result__));
1906/**
1907 * Move the offset of a file descriptor.
1908 * Note: This is similar to `lseek` in POSIX.
1909 * @return
1910 * The new offset of the file descriptor, relative to the start of the file.
1911 */
1912__wasi_errno_t __wasi_fd_seek(
1913 __wasi_fd_t fd,
1914 /**
1915 * The number of bytes to move.
1916 */
1917 __wasi_filedelta_t offset,
1918 /**
1919 * The base from which the offset is relative.
1920 */
1921 __wasi_whence_t whence,
1922 __wasi_filesize_t *retptr0
1923) __attribute__((__warn_unused_result__));
1924/**
1925 * Synchronize the data and metadata of a file to disk.
1926 * Note: This is similar to `fsync` in POSIX.
1927 */
1928__wasi_errno_t __wasi_fd_sync(
1929 __wasi_fd_t fd
1930) __attribute__((__warn_unused_result__));
1931/**
1932 * Return the current offset of a file descriptor.
1933 * Note: This is similar to `lseek(fd, 0, SEEK_CUR)` in POSIX.
1934 * @return
1935 * The current offset of the file descriptor, relative to the start of the file.
1936 */
1937__wasi_errno_t __wasi_fd_tell(
1938 __wasi_fd_t fd,
1939 __wasi_filesize_t *retptr0
1940) __attribute__((__warn_unused_result__));
1941/**
1942 * Write to a file descriptor.
1943 * Note: This is similar to `writev` in POSIX.
1944 */
1945__wasi_errno_t __wasi_fd_write(
1946 __wasi_fd_t fd,
1947 /**
1948 * List of scatter/gather vectors from which to retrieve data.
1949 */
1950 const __wasi_ciovec_t *iovs,
1951 /**
1952 * The length of the array pointed to by `iovs`.
1953 */
1954 size_t iovs_len,
1955 __wasi_size_t *retptr0
1956) __attribute__((__warn_unused_result__));
1957/**
1958 * Create a directory.
1959 * Note: This is similar to `mkdirat` in POSIX.
1960 */
1961__wasi_errno_t __wasi_path_create_directory(
1962 __wasi_fd_t fd,
1963 /**
1964 * The path at which to create the directory.
1965 */
1966 const char *path
1967) __attribute__((__warn_unused_result__));
1968/**
1969 * Return the attributes of a file or directory.
1970 * Note: This is similar to `stat` in POSIX.
1971 * @return
1972 * The buffer where the file's attributes are stored.
1973 */
1974__wasi_errno_t __wasi_path_filestat_get(
1975 __wasi_fd_t fd,
1976 /**
1977 * Flags determining the method of how the path is resolved.
1978 */
1979 __wasi_lookupflags_t flags,
1980 /**
1981 * The path of the file or directory to inspect.
1982 */
1983 const char *path,
1984 __wasi_filestat_t *retptr0
1985) __attribute__((__warn_unused_result__));
1986/**
1987 * Adjust the timestamps of a file or directory.
1988 * Note: This is similar to `utimensat` in POSIX.
1989 */
1990__wasi_errno_t __wasi_path_filestat_set_times(
1991 __wasi_fd_t fd,
1992 /**
1993 * Flags determining the method of how the path is resolved.
1994 */
1995 __wasi_lookupflags_t flags,
1996 /**
1997 * The path of the file or directory to operate on.
1998 */
1999 const char *path,
2000 /**
2001 * The desired values of the data access timestamp.
2002 */
2003 __wasi_timestamp_t atim,
2004 /**
2005 * The desired values of the data modification timestamp.
2006 */
2007 __wasi_timestamp_t mtim,
2008 /**
2009 * A bitmask indicating which timestamps to adjust.
2010 */
2011 __wasi_fstflags_t fst_flags
2012) __attribute__((__warn_unused_result__));
2013/**
2014 * Create a hard link.
2015 * Note: This is similar to `linkat` in POSIX.
2016 */
2017__wasi_errno_t __wasi_path_link(
2018 __wasi_fd_t old_fd,
2019 /**
2020 * Flags determining the method of how the path is resolved.
2021 */
2022 __wasi_lookupflags_t old_flags,
2023 /**
2024 * The source path from which to link.
2025 */
2026 const char *old_path,
2027 /**
2028 * The working directory at which the resolution of the new path starts.
2029 */
2030 __wasi_fd_t new_fd,
2031 /**
2032 * The destination path at which to create the hard link.
2033 */
2034 const char *new_path
2035) __attribute__((__warn_unused_result__));
2036/**
2037 * Open a file or directory.
2038 * The returned file descriptor is not guaranteed to be the lowest-numbered
2039 * file descriptor not currently open; it is randomized to prevent
2040 * applications from depending on making assumptions about indexes, since this
2041 * is error-prone in multi-threaded contexts. The returned file descriptor is
2042 * guaranteed to be less than 2**31.
2043 * Note: This is similar to `openat` in POSIX.
2044 * @return
2045 * The file descriptor of the file that has been opened.
2046 */
2047__wasi_errno_t __wasi_path_open(
2048 __wasi_fd_t fd,
2049 /**
2050 * Flags determining the method of how the path is resolved.
2051 */
2052 __wasi_lookupflags_t dirflags,
2053 /**
2054 * The relative path of the file or directory to open, relative to the
2055 * `path_open::fd` directory.
2056 */
2057 const char *path,
2058 /**
2059 * The method by which to open the file.
2060 */
2061 __wasi_oflags_t oflags,
2062 /**
2063 * The initial rights of the newly created file descriptor. The
2064 * implementation is allowed to return a file descriptor with fewer rights
2065 * than specified, if and only if those rights do not apply to the type of
2066 * file being opened.
2067 * The *base* rights are rights that will apply to operations using the file
2068 * descriptor itself, while the *inheriting* rights are rights that apply to
2069 * file descriptors derived from it.
2070 */
2071 __wasi_rights_t fs_rights_base,
2072 __wasi_rights_t fs_rights_inheriting,
2073 __wasi_fdflags_t fdflags,
2074 __wasi_fd_t *retptr0
2075) __attribute__((__warn_unused_result__));
2076/**
2077 * Read the contents of a symbolic link.
2078 * Note: This is similar to `readlinkat` in POSIX.
2079 * @return
2080 * The number of bytes placed in the buffer.
2081 */
2082__wasi_errno_t __wasi_path_readlink(
2083 __wasi_fd_t fd,
2084 /**
2085 * The path of the symbolic link from which to read.
2086 */
2087 const char *path,
2088 /**
2089 * The buffer to which to write the contents of the symbolic link.
2090 */
2091 uint8_t * buf,
2092 __wasi_size_t buf_len,
2093 __wasi_size_t *retptr0
2094) __attribute__((__warn_unused_result__));
2095/**
2096 * Remove a directory.
2097 * Return `errno::notempty` if the directory is not empty.
2098 * Note: This is similar to `unlinkat(fd, path, AT_REMOVEDIR)` in POSIX.
2099 */
2100__wasi_errno_t __wasi_path_remove_directory(
2101 __wasi_fd_t fd,
2102 /**
2103 * The path to a directory to remove.
2104 */
2105 const char *path
2106) __attribute__((__warn_unused_result__));
2107/**
2108 * Rename a file or directory.
2109 * Note: This is similar to `renameat` in POSIX.
2110 */
2111__wasi_errno_t __wasi_path_rename(
2112 __wasi_fd_t fd,
2113 /**
2114 * The source path of the file or directory to rename.
2115 */
2116 const char *old_path,
2117 /**
2118 * The working directory at which the resolution of the new path starts.
2119 */
2120 __wasi_fd_t new_fd,
2121 /**
2122 * The destination path to which to rename the file or directory.
2123 */
2124 const char *new_path
2125) __attribute__((__warn_unused_result__));
2126/**
2127 * Create a symbolic link.
2128 * Note: This is similar to `symlinkat` in POSIX.
2129 */
2130__wasi_errno_t __wasi_path_symlink(
2131 /**
2132 * The contents of the symbolic link.
2133 */
2134 const char *old_path,
2135 __wasi_fd_t fd,
2136 /**
2137 * The destination path at which to create the symbolic link.
2138 */
2139 const char *new_path
2140) __attribute__((__warn_unused_result__));
2141/**
2142 * Unlink a file.
2143 * Return `errno::isdir` if the path refers to a directory.
2144 * Note: This is similar to `unlinkat(fd, path, 0)` in POSIX.
2145 */
2146__wasi_errno_t __wasi_path_unlink_file(
2147 __wasi_fd_t fd,
2148 /**
2149 * The path to a file to unlink.
2150 */
2151 const char *path
2152) __attribute__((__warn_unused_result__));
2153/**
2154 * Concurrently poll for the occurrence of a set of events.
2155 * @return
2156 * The number of events stored.
2157 */
2158__wasi_errno_t __wasi_poll_oneoff(
2159 /**
2160 * The events to which to subscribe.
2161 */
2162 const __wasi_subscription_t * in,
2163 /**
2164 * The events that have occurred.
2165 */
2166 __wasi_event_t * out,
2167 /**
2168 * Both the number of subscriptions and events.
2169 */
2170 __wasi_size_t nsubscriptions,
2171 __wasi_size_t *retptr0
2172) __attribute__((__warn_unused_result__));
2173/**
2174 * Terminate the process normally. An exit code of 0 indicates successful
2175 * termination of the program. The meanings of other values is dependent on
2176 * the environment.
2177 */
2178_Noreturn void __wasi_proc_exit(
2179 /**
2180 * The exit code returned by the process.
2181 */
2182 __wasi_exitcode_t rval
2183);
2184/**
2185 * Send a signal to the process of the calling thread.
2186 * Note: This is similar to `raise` in POSIX.
2187 */
2188__wasi_errno_t __wasi_proc_raise(
2189 /**
2190 * The signal condition to trigger.
2191 */
2192 __wasi_signal_t sig
2193) __attribute__((__warn_unused_result__));
2194/**
2195 * Temporarily yield execution of the calling thread.
2196 * Note: This is similar to `sched_yield` in POSIX.
2197 */
2198__wasi_errno_t __wasi_sched_yield(
2199 void
2200) __attribute__((__warn_unused_result__));
2201/**
2202 * Write high-quality random data into a buffer.
2203 * This function blocks when the implementation is unable to immediately
2204 * provide sufficient high-quality random data.
2205 * This function may execute slowly, so when large mounts of random data are
2206 * required, it's advisable to use this function to seed a pseudo-random
2207 * number generator, rather than to provide the random data directly.
2208 */
2209__wasi_errno_t __wasi_random_get(
2210 /**
2211 * The buffer to fill with random data.
2212 */
2213 uint8_t * buf,
2214 __wasi_size_t buf_len
2215) __attribute__((__warn_unused_result__));
2216/**
2217 * Receive a message from a socket.
2218 * Note: This is similar to `recv` in POSIX, though it also supports reading
2219 * the data into multiple buffers in the manner of `readv`.
2220 * @return
2221 * Number of bytes stored in ri_data and message flags.
2222 */
2223__wasi_errno_t __wasi_sock_recv(
2224 __wasi_fd_t fd,
2225 /**
2226 * List of scatter/gather vectors to which to store data.
2227 */
2228 const __wasi_iovec_t *ri_data,
2229 /**
2230 * The length of the array pointed to by `ri_data`.
2231 */
2232 size_t ri_data_len,
2233 /**
2234 * Message flags.
2235 */
2236 __wasi_riflags_t ri_flags,
2237 __wasi_size_t *retptr0,
2238 __wasi_roflags_t *retptr1
2239) __attribute__((__warn_unused_result__));
2240/**
2241 * Send a message on a socket.
2242 * Note: This is similar to `send` in POSIX, though it also supports writing
2243 * the data from multiple buffers in the manner of `writev`.
2244 * @return
2245 * Number of bytes transmitted.
2246 */
2247__wasi_errno_t __wasi_sock_send(
2248 __wasi_fd_t fd,
2249 /**
2250 * List of scatter/gather vectors to which to retrieve data
2251 */
2252 const __wasi_ciovec_t *si_data,
2253 /**
2254 * The length of the array pointed to by `si_data`.
2255 */
2256 size_t si_data_len,
2257 /**
2258 * Message flags.
2259 */
2260 __wasi_siflags_t si_flags,
2261 __wasi_size_t *retptr0
2262) __attribute__((__warn_unused_result__));
2263/**
2264 * Shut down socket send and receive channels.
2265 * Note: This is similar to `shutdown` in POSIX.
2266 */
2267__wasi_errno_t __wasi_sock_shutdown(
2268 __wasi_fd_t fd,
2269 /**
2270 * Which channels on the socket to shut down.
2271 */
2272 __wasi_sdflags_t how
2273) __attribute__((__warn_unused_result__));
2274/** @} */
2275
2276#ifdef __cplusplus
2277}
2278#endif
2279
2280#endif
lib/libc/wasi/libc-bottom-half/headers/public/wasi/libc-environ.h deleted-19
...@@ -1,19 +0,0 @@
1#ifndef __wasi_libc_environ_h
2#define __wasi_libc_environ_h
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8/// Initialize the global environment variable state. Only needs to be
9/// called once; most users should call `__wasilibc_ensure_environ` instead.
10void __wasilibc_initialize_environ(void);
11
12/// If `__wasilibc_initialize_environ` has not yet been called, call it.
13void __wasilibc_ensure_environ(void);
14
15#ifdef __cplusplus
16}
17#endif
18
19#endif
lib/libc/wasi/libc-bottom-half/headers/public/wasi/libc-find-relpath.h deleted-79
...@@ -1,79 +0,0 @@
1#ifndef __wasi_libc_find_relpath_h
2#define __wasi_libc_find_relpath_h
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8/**
9 * Look up the given `path`, relative to the cwd, in the preopened directory
10 * map. If a suitable entry is found, then the file descriptor for that entry
11 * is returned. Additionally the absolute path of the directory's file
12 * descriptor is returned in `abs_prefix` and the relative portion that needs
13 * to be opened is stored in `*relative_path`.
14 *
15 * The `relative_path` argument must be a pointer to a buffer valid for
16 * `relative_path_len` bytes, and this may be used as storage for the relative
17 * portion of the path being returned through `*relative_path`.
18 *
19 * See documentation on `__wasilibc_find_abspath` for more info about what the
20 * paths look like.
21 *
22 * Returns -1 on failure. Errno is set to either:
23 *
24 * * ENOMEM - failed to allocate memory for internal routines.
25 * * ENOENT - the `path` could not be found relative to any preopened dir.
26 * * ERANGE - the `relative_path` buffer is too small to hold the relative path.
27 */
28int __wasilibc_find_relpath(const char *path,
29 const char **__restrict__ abs_prefix,
30 char **relative_path,
31 size_t relative_path_len);
32
33/**
34 * Look up the given `path`, which is interpreted as absolute, in the preopened
35 * directory map. If a suitable entry is found, then the file descriptor for
36 * that entry is returned. Additionally the relative portion of the path to
37 * where the fd is opened is returned through `relative_path`, the absolute
38 * prefix which was matched is stored to `abs_prefix`, and `relative_path` may
39 * be an interior pointer to the `abspath` string.
40 *
41 * The `abs_prefix` returned string will not contain a leading `/`. Note that
42 * this may be the empty string. Additionally the returned `relative_path` will
43 * not contain a leading `/`. The `relative_path` return will not return an
44 * empty string, it will return `"."` instead if it would otherwise do so.
45 *
46 * Returns -1 on failure. Errno is set to either:
47 *
48 * * ENOMEM - failed to allocate memory for internal routines.
49 * * ENOENT - the `path` could not be found relative to any preopened dir.
50 */
51int __wasilibc_find_abspath(const char *abspath,
52 const char **__restrict__ abs_prefix,
53 const char **__restrict__ relative_path);
54
55/**
56 * Same as `__wasilibc_find_relpath`, except that this function will interpret
57 * `relative` as a malloc'd buffer that will be `realloc`'d to the appropriate
58 * size to contain the relative path.
59 *
60 * Note that this is a weak symbol and if it's not defined you can use
61 * `__wasilibc_find_relpath`. The weak-nature of this symbols means that if it's
62 * not otherwise included in the compilation then `chdir` wasn't used an there's
63 * no need for this symbol.
64 *
65 * See documentation on `__wasilibc_find_relpath` for more information.
66 */
67int __wasilibc_find_relpath_alloc(
68 const char *path,
69 const char **abs,
70 char **relative,
71 size_t *relative_len,
72 int can_realloc
73) __attribute__((weak));
74
75#ifdef __cplusplus
76}
77#endif
78
79#endif
lib/libc/wasi/libc-bottom-half/headers/public/wasi/libc-nocwd.h deleted-58
...@@ -1,58 +0,0 @@
1#ifndef __wasi_libc_nocwd_h
2#define __wasi_libc_nocwd_h
3
4/*
5 * In order to support AT_FDCWD, we need to wrap the *at functions to handle
6 * it by calling back into the non-at versions which perform libpreopen
7 * queries. These __wasilibc_nocwd_* forms are the underlying calls which
8 * assume AT_FDCWD has already been resolved.
9 */
10
11#define __need_size_t
12#include <stddef.h>
13#include <__typedef_ssize_t.h>
14#include <__typedef_mode_t.h>
15#include <__typedef_DIR.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21struct timespec;
22struct stat;
23struct dirent;
24
25int __wasilibc_nocwd___wasilibc_unlinkat(int, const char *)
26 __attribute__((__warn_unused_result__));
27int __wasilibc_nocwd___wasilibc_rmdirat(int, const char *)
28 __attribute__((__warn_unused_result__));
29int __wasilibc_nocwd_linkat(int, const char *, int, const char *, int)
30 __attribute__((__warn_unused_result__));
31int __wasilibc_nocwd_symlinkat(const char *, int, const char *)
32 __attribute__((__warn_unused_result__));
33ssize_t __wasilibc_nocwd_readlinkat(int, const char *__restrict, char *__restrict, size_t)
34 __attribute__((__warn_unused_result__));
35int __wasilibc_nocwd_faccessat(int, const char *, int, int)
36 __attribute__((__warn_unused_result__));
37int __wasilibc_nocwd_renameat(int, const char *, int, const char *)
38 __attribute__((__warn_unused_result__));
39int __wasilibc_nocwd_openat_nomode(int, const char *, int)
40 __attribute__((__warn_unused_result__));
41int __wasilibc_nocwd_fstatat(int, const char *__restrict, struct stat *__restrict, int)
42 __attribute__((__warn_unused_result__));
43int __wasilibc_nocwd_mkdirat_nomode(int, const char *)
44 __attribute__((__warn_unused_result__));
45int __wasilibc_nocwd_utimensat(int, const char *, const struct timespec [2], int)
46 __attribute__((__warn_unused_result__));
47DIR *__wasilibc_nocwd_opendirat(int, const char *)
48 __attribute__((__warn_unused_result__));
49int __wasilibc_nocwd_scandirat(int, const char *, struct dirent ***,
50 int (*)(const struct dirent *),
51 int (*)(const struct dirent **, const struct dirent **))
52 __attribute__((__warn_unused_result__));
53
54#ifdef __cplusplus
55}
56#endif
57
58#endif
lib/libc/wasi/libc-bottom-half/headers/public/wasi/libc.h deleted-65
...@@ -1,65 +0,0 @@
1#ifndef __wasi_libc_h
2#define __wasi_libc_h
3
4#include <__typedef_off_t.h>
5#include <__struct_timespec.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11struct stat;
12struct timespec;
13
14/// Register the given pre-opened file descriptor under the given path.
15///
16/// This function does not take ownership of `prefix` (it makes its own copy).
17int __wasilibc_register_preopened_fd(int fd, const char *prefix);
18
19/// Renumber `fd` to `newfd`; similar to `dup2` but does a move rather than a
20/// copy.
21int __wasilibc_fd_renumber(int fd, int newfd)
22 __attribute__((__warn_unused_result__));
23
24/// Like `unlinkat`, but without depending on `__wasi_path_remove_directory`.
25int __wasilibc_unlinkat(int fd, const char *path)
26 __attribute__((__warn_unused_result__));
27
28/// An `*at` version of rmdir.
29int __wasilibc_rmdirat(int fd, const char *path)
30 __attribute__((__warn_unused_result__));
31
32/// Like `open`, but without the varargs in the signature.
33int __wasilibc_open_nomode(const char *path, int oflag);
34
35/// Like `openat`, but without the varargs in the signature.
36int __wasilibc_openat_nomode(int fd, const char *path, int oflag);
37
38/// Return the current file offset. Like `lseek(fd, 0, SEEK_CUR)`, but without
39/// depending on `lseek`.
40off_t __wasilibc_tell(int fd)
41 __attribute__((__warn_unused_result__));
42
43/* Non-`at` forms of various `*at` functions. */
44int __wasilibc_access(const char *pathname, int mode, int flags)
45 __attribute__((__warn_unused_result__));
46int __wasilibc_stat(const char *__restrict pathname, struct stat *__restrict statbuf, int flags)
47 __attribute__((__warn_unused_result__));
48int __wasilibc_utimens(const char *pathname, const struct timespec times[2], int flags)
49 __attribute__((__warn_unused_result__));
50int __wasilibc_link(const char *oldpath, const char *newpath, int flags)
51 __attribute__((__warn_unused_result__));
52int __wasilibc_link_oldat(int olddirfd, const char *oldpath, const char *newpath, int flags)
53 __attribute__((__warn_unused_result__));
54int __wasilibc_link_newat(const char *oldpath, int newdirfd, const char *newpath, int flags)
55 __attribute__((__warn_unused_result__));
56int __wasilibc_rename_oldat(int olddirfd, const char *oldpath, const char *newpath)
57 __attribute__((__warn_unused_result__));
58int __wasilibc_rename_newat(const char *oldpath, int newdirfd, const char *newpath)
59 __attribute__((__warn_unused_result__));
60
61#ifdef __cplusplus
62}
63#endif
64
65#endif
lib/libc/wasi/libc-bottom-half/headers/public/wchar.h deleted-9
...@@ -1,9 +0,0 @@
1#ifndef __wasilibc_wchar_h
2#define __wasilibc_wchar_h
3
4#define __need_size_t
5#define __need_wchar_t
6#define __need_NULL
7#include <stddef.h>
8
9#endif
lib/libc/wasi/libc-top-half/README.md deleted-25
...@@ -1,25 +0,0 @@
1# WASI libc "top half".
2
3The WASI libc "top half" is conceptually the upper half of a traditional libc
4implementation, consisting of C standard library and other relatively
5higher-level functionality.
6
7Code in the musl directory is based on musl revision
8040c1d16b468c50c04fc94edff521f1637708328, which is v1.2.0, from
9git://git.musl-libc.org/musl.
10
11Whole files which are unused are omitted. Changes to upstream code are wrapped
12in preprocessor directives controlled by the macro `__wasilibc_unmodified_upstream`.
13
14Some major known missing areas include:
15 - threads
16 - aio
17 - setjmp
18 - signals
19 - ipc
20 - termios
21 - nss
22 - timezones
23 - non-builtin locales
24 - TIOCGWINSZ (because cloudabi lacks it; affects isatty, line buffering for stdout)
25 - O\_CLOEXEC, O\_NOCTTY (because cloudabi lacks them)
lib/libc/wasi/libc-top-half/musl/INSTALL deleted-191
...@@ -1,191 +0,0 @@
1
2Quick Installation Guide for musl libc
3======================================
4
5There are many different ways to install musl depending on your usage
6case. This document covers only the build and installation of musl by
7itself, which is useful for upgrading an existing musl-based system or
8compiler toolchain, or for using the provided musl-gcc wrapper with an
9existing non-musl-based compiler.
10
11Building complete native or cross-compiler toolchains is outside the
12scope of this INSTALL file. More information can be found on the musl
13website and community wiki.
14
15
16Build Prerequisites
17-------------------
18
19The only build-time prerequisites for musl are GNU Make and a
20freestanding C99 compiler toolchain targeting the desired instruction
21set architecture and ABI, with support for a minimal subset of "GNU C"
22extensions consisting mainly of gcc-style inline assembly, weak
23aliases, hidden visibility, and stand-alone assembly source files.
24
25GCC, LLVM/clang, Firm/cparser, and PCC have all successfully built
26musl, but GCC is the most widely used/tested. Recent compiler (and
27binutils) versions should be used if possible since some older
28versions have bugs which affect musl.
29
30The system used to build musl does not need to be Linux-based, nor do
31the Linux kernel headers need to be available.
32
33
34
35Supported Targets
36-----------------
37
38musl can be built for the following CPU instruction set architecture
39and ABI combinations:
40
41* i386
42 * Minimum CPU model is actually 80486 unless kernel emulation of
43 the `cmpxchg` instruction is added
44
45* x86_64
46 * ILP32 ABI (x32) is available as a separate arch but is still
47 experimental
48
49* ARM
50 * EABI, standard or hard-float VFP variant
51 * Little-endian default; big-endian variants also supported
52 * Compiler toolchains only support armv4t and later
53
54* AArch64
55 * Little-endian default; big-endian variants also supported
56
57* MIPS
58 * ABI is o32, fp32/fpxx (except on r6 which is fp64)
59 * Big-endian default; little-endian variants also supported
60 * Default ABI variant uses FPU registers; alternate soft-float ABI
61 that does not use FPU registers or instructions is available
62 * MIPS2 or later, or kernel emulation of ll/sc (standard in Linux)
63 is required
64 * MIPS32r6, an incompatible ISA, is supported as a variant "mipsr6"
65
66* MIPS64
67 * ABI is n64 (LP64) or n32 (ILP32)
68 * Big-endian default; little-endian variants also supported
69 * Default ABI variant uses FPU registers; alternate soft-float ABI
70 that does not use FPU registers or instructions is available
71
72* PowerPC
73 * Compiler toolchain must provide 64-bit long double, not IBM
74 double-double or IEEE quad
75 * For dynamic linking, compiler toolchain must be configured for
76 "secure PLT" variant
77
78* PowerPC64
79 * Both little and big endian variants are supported
80 * Compiler toolchain must provide 64-bit long double, not IBM
81 double-double or IEEE quad
82 * Compiler toolchain must use the new (ELFv2) ABI regardless of
83 whether it is for little or big endian
84
85* S390X (64-bit S390)
86
87* SuperH (SH)
88 * Standard ELF ABI or FDPIC ABI (shared-text without MMU)
89 * Little-endian by default; big-endian variant also supported
90 * Full FPU ABI or soft-float ABI is supported, but the
91 single-precision-only FPU ABI is not
92
93* Microblaze
94 * Big-endian default; little-endian variants also supported
95 * Soft-float
96 * Requires support for lwx/swx instructions
97
98* OpenRISC 1000 (or1k)
99
100* RISC-V 64
101 * Little endian
102 * Hard, soft, and hard-single/soft-double floating point ABIs
103 * Standard ELF; no shared-text NOMMU support
104
105
106
107Build and Installation Procedure
108--------------------------------
109
110To build and install musl:
111
1121. Run the provided configure script from the top-level source
113 directory, passing on its command line any desired options.
114
1152. Run "make" to compile.
116
1173. Run "make install" with appropriate privileges to write to the
118 target locations.
119
120The configure script attempts to determine automatically the correct
121target architecture based on the compiler being used. For some
122compilers, this may not be possible. If detection fails or selects the
123wrong architecture, you can provide an explicit selection on the
124configure command line.
125
126By default, configure installs to a prefix of "/usr/local/musl". This
127differs from the behavior of most configure scripts, and is chosen
128specifically to avoid clashing with libraries already present on the
129system. DO NOT set the prefix to "/usr", "/usr/local", or "/" unless
130you're upgrading libc on an existing musl-based system. Doing so will
131break your existing system when you run "make install" and it may be
132difficult to recover.
133
134
135
136Notes on Dynamic Linking
137------------------------
138
139If dynamic linking is enabled, one file needs to be installed outside
140of the installation prefix: /lib/ld-musl-$ARCH.so.1. This is the
141dynamic linker. Its pathname is hard-coded into all dynamic-linked
142programs, so for the sake of being able to share binaries between
143systems, a consistent location should be used everywhere. Note that
144the same applies to glibc and its dynamic linker, which is named
145/lib/ld-linux.so.2 on i386 systems.
146
147If for some reason it is impossible to install the dynamic linker in
148its standard location (for example, if you are installing without root
149privileges), the --syslibdir option to configure can be used to
150provide a different location
151
152At runtime, the dynamic linker needs to know the paths to search for
153shared libraries. You should create a text file named
154/etc/ld-musl-$ARCH.path (where $ARCH matches the architecture name
155used in the dynamic linker) containing a list of directories where you
156want the dynamic linker to search for shared libraries, separated by
157colons or newlines. If the dynamic linker has been installed in a
158non-default location, the path file also needs to reside at that
159location (../etc relative to the chosen syslibdir).
160
161If you do not intend to use dynamic linking, you may disable it by
162passing --disable-shared to configure; this also cuts the build time
163in half.
164
165
166
167Checking for Successful Installation
168------------------------------------
169
170After installing, you should be able to use musl via the musl-gcc
171wrapper. For example:
172
173cat > hello.c <<EOF
174#include <stdio.h>
175int main()
176{
177 printf("hello, world!\n");
178 return 0;
179}
180EOF
181/usr/local/musl/bin/musl-gcc hello.c
182./a.out
183
184To configure autoconf-based program to compile and link against musl,
185set the CC variable to musl-gcc when running configure, as in:
186
187CC=musl-gcc ./configure ...
188
189You will probably also want to use --prefix when building libraries to
190ensure that they are installed under the musl prefix and not in the
191main host system library directories.
lib/libc/wasi/libc-top-half/musl/Makefile deleted-237
...@@ -1,237 +0,0 @@
1#
2# Makefile for musl (requires GNU make)
3#
4# This is how simple every makefile should be...
5# No, I take that back - actually most should be less than half this size.
6#
7# Use config.mak to override any of the following variables.
8# Do not make changes here.
9#
10
11srcdir = .
12exec_prefix = /usr/local
13bindir = $(exec_prefix)/bin
14
15prefix = /usr/local/musl
16includedir = $(prefix)/include
17libdir = $(prefix)/lib
18syslibdir = /lib
19
20MALLOC_DIR = mallocng
21SRC_DIRS = $(addprefix $(srcdir)/,src/* src/malloc/$(MALLOC_DIR) crt ldso $(COMPAT_SRC_DIRS))
22BASE_GLOBS = $(addsuffix /*.c,$(SRC_DIRS))
23ARCH_GLOBS = $(addsuffix /$(ARCH)/*.[csS],$(SRC_DIRS))
24BASE_SRCS = $(sort $(wildcard $(BASE_GLOBS)))
25ARCH_SRCS = $(sort $(wildcard $(ARCH_GLOBS)))
26BASE_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(BASE_SRCS)))
27ARCH_OBJS = $(patsubst $(srcdir)/%,%.o,$(basename $(ARCH_SRCS)))
28REPLACED_OBJS = $(sort $(subst /$(ARCH)/,/,$(ARCH_OBJS)))
29ALL_OBJS = $(addprefix obj/, $(filter-out $(REPLACED_OBJS), $(sort $(BASE_OBJS) $(ARCH_OBJS))))
30
31LIBC_OBJS = $(filter obj/src/%,$(ALL_OBJS)) $(filter obj/compat/%,$(ALL_OBJS))
32LDSO_OBJS = $(filter obj/ldso/%,$(ALL_OBJS:%.o=%.lo))
33CRT_OBJS = $(filter obj/crt/%,$(ALL_OBJS))
34
35AOBJS = $(LIBC_OBJS)
36LOBJS = $(LIBC_OBJS:.o=.lo)
37GENH = obj/include/bits/alltypes.h obj/include/bits/syscall.h
38GENH_INT = obj/src/internal/version.h
39IMPH = $(addprefix $(srcdir)/, src/internal/stdio_impl.h src/internal/pthread_impl.h src/internal/locale_impl.h src/internal/libc.h)
40
41LDFLAGS =
42LDFLAGS_AUTO =
43LIBCC = -lgcc
44CPPFLAGS =
45CFLAGS =
46CFLAGS_AUTO = -Os -pipe
47CFLAGS_C99FSE = -std=c99 -ffreestanding -nostdinc
48
49CFLAGS_ALL = $(CFLAGS_C99FSE)
50CFLAGS_ALL += -D_XOPEN_SOURCE=700 -I$(srcdir)/arch/$(ARCH) -I$(srcdir)/arch/generic -Iobj/src/internal -I$(srcdir)/src/include -I$(srcdir)/src/internal -Iobj/include -I$(srcdir)/include
51CFLAGS_ALL += $(CPPFLAGS) $(CFLAGS_AUTO) $(CFLAGS)
52
53LDFLAGS_ALL = $(LDFLAGS_AUTO) $(LDFLAGS)
54
55AR = $(CROSS_COMPILE)ar
56RANLIB = $(CROSS_COMPILE)ranlib
57INSTALL = $(srcdir)/tools/install.sh
58
59ARCH_INCLUDES = $(wildcard $(srcdir)/arch/$(ARCH)/bits/*.h)
60GENERIC_INCLUDES = $(wildcard $(srcdir)/arch/generic/bits/*.h)
61INCLUDES = $(wildcard $(srcdir)/include/*.h $(srcdir)/include/*/*.h)
62ALL_INCLUDES = $(sort $(INCLUDES:$(srcdir)/%=%) $(GENH:obj/%=%) $(ARCH_INCLUDES:$(srcdir)/arch/$(ARCH)/%=include/%) $(GENERIC_INCLUDES:$(srcdir)/arch/generic/%=include/%))
63
64EMPTY_LIB_NAMES = m rt pthread crypt util xnet resolv dl
65EMPTY_LIBS = $(EMPTY_LIB_NAMES:%=lib/lib%.a)
66CRT_LIBS = $(addprefix lib/,$(notdir $(CRT_OBJS)))
67STATIC_LIBS = lib/libc.a
68SHARED_LIBS = lib/libc.so
69TOOL_LIBS = lib/musl-gcc.specs
70ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS)
71ALL_TOOLS = obj/musl-gcc
72
73WRAPCC_GCC = gcc
74WRAPCC_CLANG = clang
75
76LDSO_PATHNAME = $(syslibdir)/ld-musl-$(ARCH)$(SUBARCH).so.1
77
78-include config.mak
79-include $(srcdir)/arch/$(ARCH)/arch.mak
80
81ifeq ($(ARCH),)
82
83all:
84 @echo "Please set ARCH in config.mak before running make."
85 @exit 1
86
87else
88
89all: $(ALL_LIBS) $(ALL_TOOLS)
90
91OBJ_DIRS = $(sort $(patsubst %/,%,$(dir $(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(GENH) $(GENH_INT))) obj/include)
92
93$(ALL_LIBS) $(ALL_TOOLS) $(ALL_OBJS) $(ALL_OBJS:%.o=%.lo) $(GENH) $(GENH_INT): | $(OBJ_DIRS)
94
95$(OBJ_DIRS):
96 mkdir -p $@
97
98obj/include/bits/alltypes.h: $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in $(srcdir)/tools/mkalltypes.sed
99 sed -f $(srcdir)/tools/mkalltypes.sed $(srcdir)/arch/$(ARCH)/bits/alltypes.h.in $(srcdir)/include/alltypes.h.in > $@
100
101obj/include/bits/syscall.h: $(srcdir)/arch/$(ARCH)/bits/syscall.h.in
102 cp $< $@
103 sed -n -e s/__NR_/SYS_/p < $< >> $@
104
105obj/src/internal/version.h: $(wildcard $(srcdir)/VERSION $(srcdir)/.git)
106 printf '#define VERSION "%s"\n' "$$(cd $(srcdir); sh tools/version.sh)" > $@
107
108obj/src/internal/version.o obj/src/internal/version.lo: obj/src/internal/version.h
109
110obj/crt/rcrt1.o obj/ldso/dlstart.lo obj/ldso/dynlink.lo: $(srcdir)/src/internal/dynlink.h $(srcdir)/arch/$(ARCH)/reloc.h
111
112obj/crt/crt1.o obj/crt/scrt1.o obj/crt/rcrt1.o obj/ldso/dlstart.lo: $(srcdir)/arch/$(ARCH)/crt_arch.h
113
114obj/crt/rcrt1.o: $(srcdir)/ldso/dlstart.c
115
116obj/crt/Scrt1.o obj/crt/rcrt1.o: CFLAGS_ALL += -fPIC
117
118OPTIMIZE_SRCS = $(wildcard $(OPTIMIZE_GLOBS:%=$(srcdir)/src/%))
119$(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.o) $(OPTIMIZE_SRCS:$(srcdir)/%.c=obj/%.lo): CFLAGS += -O3
120
121MEMOPS_OBJS = $(filter %/memcpy.o %/memmove.o %/memcmp.o %/memset.o, $(LIBC_OBJS))
122$(MEMOPS_OBJS) $(MEMOPS_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_MEMOPS)
123
124NOSSP_OBJS = $(CRT_OBJS) $(LDSO_OBJS) $(filter \
125 %/__libc_start_main.o %/__init_tls.o %/__stack_chk_fail.o \
126 %/__set_thread_area.o %/memset.o %/memcpy.o \
127 , $(LIBC_OBJS))
128$(NOSSP_OBJS) $(NOSSP_OBJS:%.o=%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP)
129
130$(CRT_OBJS): CFLAGS_ALL += -DCRT
131
132$(LOBJS) $(LDSO_OBJS): CFLAGS_ALL += -fPIC
133
134CC_CMD = $(CC) $(CFLAGS_ALL) -c -o $@ $<
135
136# Choose invocation of assembler to be used
137ifeq ($(ADD_CFI),yes)
138 AS_CMD = LC_ALL=C awk -f $(srcdir)/tools/add-cfi.common.awk -f $(srcdir)/tools/add-cfi.$(ARCH).awk $< | $(CC) $(CFLAGS_ALL) -x assembler -c -o $@ -
139else
140 AS_CMD = $(CC_CMD)
141endif
142
143obj/%.o: $(srcdir)/%.s
144 $(AS_CMD)
145
146obj/%.o: $(srcdir)/%.S
147 $(CC_CMD)
148
149obj/%.o: $(srcdir)/%.c $(GENH) $(IMPH)
150 $(CC_CMD)
151
152obj/%.lo: $(srcdir)/%.s
153 $(AS_CMD)
154
155obj/%.lo: $(srcdir)/%.S
156 $(CC_CMD)
157
158obj/%.lo: $(srcdir)/%.c $(GENH) $(IMPH)
159 $(CC_CMD)
160
161lib/libc.so: $(LOBJS) $(LDSO_OBJS)
162 $(CC) $(CFLAGS_ALL) $(LDFLAGS_ALL) -nostdlib -shared \
163 -Wl,-e,_dlstart -o $@ $(LOBJS) $(LDSO_OBJS) $(LIBCC)
164
165lib/libc.a: $(AOBJS)
166 rm -f $@
167 $(AR) rc $@ $(AOBJS)
168 $(RANLIB) $@
169
170$(EMPTY_LIBS):
171 rm -f $@
172 $(AR) rc $@
173
174lib/%.o: obj/crt/$(ARCH)/%.o
175 cp $< $@
176
177lib/%.o: obj/crt/%.o
178 cp $< $@
179
180lib/musl-gcc.specs: $(srcdir)/tools/musl-gcc.specs.sh config.mak
181 sh $< "$(includedir)" "$(libdir)" "$(LDSO_PATHNAME)" > $@
182
183obj/musl-gcc: config.mak
184 printf '#!/bin/sh\nexec "$${REALGCC:-$(WRAPCC_GCC)}" "$$@" -specs "%s/musl-gcc.specs"\n' "$(libdir)" > $@
185 chmod +x $@
186
187obj/%-clang: $(srcdir)/tools/%-clang.in config.mak
188 sed -e 's!@CC@!$(WRAPCC_CLANG)!g' -e 's!@PREFIX@!$(prefix)!g' -e 's!@INCDIR@!$(includedir)!g' -e 's!@LIBDIR@!$(libdir)!g' -e 's!@LDSO@!$(LDSO_PATHNAME)!g' $< > $@
189 chmod +x $@
190
191$(DESTDIR)$(bindir)/%: obj/%
192 $(INSTALL) -D $< $@
193
194$(DESTDIR)$(libdir)/%.so: lib/%.so
195 $(INSTALL) -D -m 755 $< $@
196
197$(DESTDIR)$(libdir)/%: lib/%
198 $(INSTALL) -D -m 644 $< $@
199
200$(DESTDIR)$(includedir)/bits/%: $(srcdir)/arch/$(ARCH)/bits/%
201 $(INSTALL) -D -m 644 $< $@
202
203$(DESTDIR)$(includedir)/bits/%: $(srcdir)/arch/generic/bits/%
204 $(INSTALL) -D -m 644 $< $@
205
206$(DESTDIR)$(includedir)/bits/%: obj/include/bits/%
207 $(INSTALL) -D -m 644 $< $@
208
209$(DESTDIR)$(includedir)/%: $(srcdir)/include/%
210 $(INSTALL) -D -m 644 $< $@
211
212$(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so
213 $(INSTALL) -D -l $(libdir)/libc.so $@ || true
214
215install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),)
216
217install-headers: $(ALL_INCLUDES:include/%=$(DESTDIR)$(includedir)/%)
218
219install-tools: $(ALL_TOOLS:obj/%=$(DESTDIR)$(bindir)/%)
220
221install: install-libs install-headers install-tools
222
223musl-git-%.tar.gz: .git
224 git --git-dir=$(srcdir)/.git archive --format=tar.gz --prefix=$(patsubst %.tar.gz,%,$@)/ -o $@ $(patsubst musl-git-%.tar.gz,%,$@)
225
226musl-%.tar.gz: .git
227 git --git-dir=$(srcdir)/.git archive --format=tar.gz --prefix=$(patsubst %.tar.gz,%,$@)/ -o $@ v$(patsubst musl-%.tar.gz,%,$@)
228
229endif
230
231clean:
232 rm -rf obj lib
233
234distclean: clean
235 rm -f config.mak
236
237.PHONY: all clean install install-libs install-headers install-tools
lib/libc/wasi/libc-top-half/musl/README deleted-23
...@@ -1,23 +0,0 @@
1
2 musl libc
3
4musl, pronounced like the word "mussel", is an MIT-licensed
5implementation of the standard C library targetting the Linux syscall
6API, suitable for use in a wide range of deployment environments. musl
7offers efficient static and dynamic linking support, lightweight code
8and low runtime overhead, strong fail-safe guarantees under correct
9usage, and correctness in the sense of standards conformance and
10safety. musl is built on the principle that these goals are best
11achieved through simple code that is easy to understand and maintain.
12
13The 1.1 release series for musl features coverage for all interfaces
14defined in ISO C99 and POSIX 2008 base, along with a number of
15non-standardized interfaces for compatibility with Linux, BSD, and
16glibc functionality.
17
18For basic installation instructions, see the included INSTALL file.
19Information on full musl-targeted compiler toolchains, system
20bootstrapping, and Linux distributions built on musl can be found on
21the project website:
22
23 https://musl.libc.org/
lib/libc/wasi/libc-top-half/musl/VERSION deleted-1
...@@ -1 +0,0 @@
11.2.2
lib/libc/wasi/libc-top-half/musl/WHATSNEW deleted-2289
...@@ -1,2289 +0,0 @@
10.5.0 - initial release
2
3
4
50.5.9 - signal ABI bugfix, various cleanup and fixes:
6
7sigset_t was wrongly defined as 1024 bytes instead of 1024 bits,
8breaking the intended ABI compatibility with the LSB/glibc sigaction
9structure. users should upgrade immediately and rebuild any libraries
10or object files that might be using the incorrect definitions.
11
12improved security against DoS with tcb shadow passwords by checking
13that the file opened was really an ordinary file.
14
15fixed a bug in the implementation of atomic ops that could have
16allowed the compiler to incorrectly reorder them (in practice, gcc
17with the default settings on i386 was not reordering them).
18
19greatly improved conformance to the C and POSIX standards regarding
20what the standard header files make visible. _POSIX_C_SOURCE is now
21needed to get POSIX functions in standard C headers, and _XOPEN_SOURCE
22or _GNU_SOURCE are required to get XSI interfaces or GNU extensions,
23respectively.
24
25many internal improvements have been made to the syscall-related code
26in preparation for porting to x86_64 and other archs.
27
28
29
300.6.0 - x86_64 port, various important bugs fixed
31
32new x86_64 (amd64) architecture port, contributed by Nicholas J. Kain,
33along with PORTING guide. source tree layout and build system have
34been improved to accommodate further ports.
35
36various bugs that were introduced while making the headers respect C
37and POSIX namespace standards have been fixed. conformance to the
38standards has been improved.
39
40fixed an inefficiency in qsort that triggered a bug (occasionaly
41internal compiler error) in some versions of gcc.
42
43fixed a major bug in the printf %n specifier that prevented it from
44working and caused memory corruption.
45
46
47
480.7.0 - major improvements to posix conformance and completeness
49
50implemented posix shared memory and semaphore interfaces.
51
52implemented all remaining required pthread and clock interfaces.
53
54major fixes to signal semantics.
55
56greatly improved temporary file name generation for safety against
57denial of service due to intentional name collisions.
58
59added syscall wrappers for the linux inotify interface.
60
61malloc(0) now returns a non-null pointer.
62
63fixed printf %n specifier (again), pthread_once (it was always
64hanging), and non-default-type mutex behavior.
65
66added ucontext/sigcontext support in headers to facilitate building
67libgcc with dwarf2 unwind support, and possibly other low-level tools.
68
69improved musl-gcc compiler wrapper.
70
71implemented many small missing functions here and there, minor header
72fixes, etc.
73
74
75
760.7.1 - improvements to completeness, bug fixes
77
78implemented flockfile, wprintf, and robust mutex functions.
79
80fixed stack corruption bug in times(), minor header bugs, and some
81error return value bugs in thread interfaces.
82
83
84
850.7.5 - new features, major optimization, and robustness
86
87implemented POSIX timers.
88
89optimized and simplified many thread-related functions.
90
91eliminated resource leak races in thread cancellation. (almost all
92existing implementations, including glibc, have these leaks.)
93
94overhauled stdio implementation to take advantage of readv/writev for
95reduced syscall load, and improved stdio's handling of error status.
96
97added syscall header and interface for applications to use and
98greatly simplified internal system for making syscalls.
99
100strangthened tmpnam/tempnam/tmpfile filename generation and made the
101straight C functions not depend on POSIX symbols.
102
103fixed pthread cancellation ABI on i386 to match the LSB/glibc ABI
104
105better double-free handling in malloc
106
107various minor bug fixes
108
109
110
1110.7.6 - major bug fixes
112
113fixed rare but serious under-allocation bug in malloc.
114
115fixed signedness bug in strchr that prevented finding high bytes.
116
117fixed serious parsing bugs in strtold.
118
119fixed statvfs syscall (it was always failing with EINVAL).
120
121fixed race condition in set*id() functions with threads (possible
122deadlock). further audit still needed though.
123
124fseek no longer sets the stream error flag on failed seeks (this was
125wrong and broke some programs, notably GNU m4).
126
127nl_langinfo is no longer a dummy function. (the functionality was
128previously implemented but accidentally left unused).
129
130various small fixes have been made to the implementations and
131prototypes for nonstandard and obsolete functions
132
133
134
1350.7.7 - more bug fixes and program-compatibility improvements
136
137fixed floating point formatting and rounding bugs in printf.
138
139fixed broken %N$ positional argument specifiers in printf.
140
141fixed misaligned read/overread bug in strchr which could lead to
142crashes scanning tiny strings at the end of a page when the next page
143is not readable, or on archs (not yet supported) that forbid
144misaligned reads.
145
146fixed breakage of statvfs on x86_64
147
148fixed crash in getmntent_r
149
150fixed bug in POSIX timers created with NULL sigevent argument
151
152improved semaphore performance, and sem_wait is now interruptable by
153signals, as required by POSIX.
154
155added many compatibility and system-level interfaces, increasing the
156proportion of busybox that works with musl.
157
158
159
1600.7.8 - more bug fixes and compatibility improvements
161
162fixed problems with ipv6 dns and address printing code that made ipv6
163support practically unusable, and some other getaddrinfo bugs.
164
165fixed broken sendmsg/recvmsg functions on x86_64 (caused by incorrect
166msghdr structure).
167
168fixed broken sigsetjmp asm on x86_64.
169
170worked around a problem with input buffering on terminals reblocking
171after getting a blank line, due to a bug in the linux readv syscall.
172
173various improvements to the "rsyscall" system used to implement
174threaded setuid, setgid, etc.
175
176exiting/cancelling the a timer handler thread no longer kills the
177timer.
178
179fixed incorrect trailing zeros on some %g conversions in printf.
180
181fixed buggy byte-swapping functions and moved them to inlines in
182byteswap.h.
183
184many small improvements to header/application compatibility, support
185for nonstandard macros, etc.
186
187
188
1890.7.9 release notes
190
191new pthread cancellation implementation:
192- safe against resource-leak/side-effect-leak race conditions
193- safe against interruption by signal handlers
194- reduced bloat in all cancellable functions
195- reduced bloat for blocking cancellation
196
197new interfaces implemented:
198- realpath (limited functionality)
199- wordexp (limited functionality)
200- flock (nonstandard)
201- forkpty (nonstandard)
202- posix_fadvise
203- posix_fallocate
204
205general bug fixes:
206- syslog function failure to communicate with syslogd
207- bug in siginfo_t definition if wait.h was included before signal.h
208- incorrect struct definitions for most of sysv ipc
209- pthread_exit/cancel on timer handler wrongly destroying the timer
210- linux dup2 ebusy workaround
211- obscure issues in non-threaded programs using some pthread functions
212- getopt_long allowed mismatch in last char of option name
213- incorrect parsing of obscure ip address forms
214- initgroups not working reliably (uninitialized var)
215- shadow pass treating empty expiry field as pass-expired-in-1970
216- bogus longjmp if pthread_exit was called from cancellation handlers
217
218x86_64-specific bug fixes:
219- fcntl file locking
220- thread stack alignment
221- broken select timeouts due to incorrect timeval definition
222
223
224
2250.7.10 release notes
226
227new features:
228- ipv6 numeric string parsing
229- eventfd syscall wrappers
230
231optimizations:
232- new qsort implementation using the smoothsort algorithm
233- much smaller/faster sigset_t handling functions
234- lowered spin count before futex wait in synchronization functions
235
236general bug fixes:
237- incorrect floating point round-to-even behavior in printf
238- major bugs in pthread barrier implementation
239- off-by-one error in scanf %n results
240- scanf failure to report EOF when scanning for literal text
241- minor missing/incorrect prototype issues
242- dependency on undefined call order in fclose
243
244compiler issue workarounds:
245- incorrect inlining of variadic functions on recent gcc versions
246- pcc preprocessor bug with recursive macro expansion
247
248
249
2500.7.11 release notes
251
252new features:
253- integrated dynamic linker
254- dynamic loading (dlopen/dlsym) (for dynamic-linked programs only)
255- XSI search.h API
256- POSIX message queues
257- POSIX spawn interfaces
258- BSD pseudo-random number generator API (random/srandom/initstate/etc.)
259- floating point environment (limited usefulness due to gcc bugs)
260
261general bug fixes:
262- possible crashes with wordexp due to uninitialized variable
263- race condition in pthread_kill (also present and unfixed in glibc/nptl)
264- pthread exit destructors called too late
265- dangerous unbounded vla in glob
266- brk/sbrk legacy functions mismatching legacy semantics
267- wcsncpy dest buffer overflow
268- strncat and wcsncat possible overflows due to double-termination
269
270
271
2720.7.12 release notes
273
274new features:
275- support for textrels in shared objects
276- rpath support in dynamic linker
277- stdio_ext.h functions (for better gnu software compatibility)
278
279bug fixes:
280- some compilers miscompiling dlopen due to misuse of longjmp
281- safe handling of invalid long-double bit patterns (affects printf)
282- workaround for bugs in linux mprotect syscall
283- thread-safety for random() functions
284- various minor issues
285
286
287
2880.8.0 release notes
289
290new features:
291- chinese and japanese legacy charset support in iconv
292- zero-syscall clock_gettime support (dynamic-linked x86_64 only)
293- futex-based locking for stdio (previously used spinlocks)
294- LD_PRELOAD and RTLD_NEXT support in dynamic linker
295- strptime (mostly working but incomplete)
296- posix aio (mostly working but not entirely conformant)
297- memory streams (fmemopen, open_memstream, ...)
298- stub/dummy implementations for various useless legacy functions
299- if_nameindex
300
301security hardening:
302- setuid, etc. should not longer be able to "partially fail" with threads
303- ensure suid programs start with fd 0,1,2 open
304- improved openpty/forkpty failure checks
305
306threads/synchronization bug fixes:
307- dangerous spurious wakeup in pthread_join lead to early return
308- race condition enabling async cancellation (delayed/lost cancellation)
309- destruction/unmapping race conditions in semaphores, mutexes, rwlocks
310- recursive rwlock_rdlock deadlock when a writer is waiting
311- race condition in sigqueue with fork
312- timer expiration thread exit wasn't running dtors
313- timer threads weren't blocking signals
314- close was wrongly cancellable after succeeding on some devices
315- robust mutex list was not reset on fork
316
317general bug fixes:
318- incorrect logic in fread (spurious blocking; crash on write-only files)
319- many corner cases and overflow cases for strtol-family functions
320- various printf integer formatting issues with flags/width/precision
321- incorrect iconv return value on failure
322- broken FD_* macros on 64-bit targets
323- clock function returning wrong value (real time not cpu time)
324- siglongjmp signal mask clobbering (off-by-one pointer error)
325- dynamic linker weak symbol resolution issues
326- fdopendir failure to set errno
327- various minor header fixes
328
329
330
3310.8.1 release notes
332
333bug fixes:
334- mismatching prototypes caused build failure on 64-bit
335- other minor prototype errors in the headers have been fixed
336- various other small omissions fixed
337
338
339
3400.8.2 release notes
341
342new features:
343- ptrace syscall support
344
345bug fixes:
346- const error (only a warning with many compilers) in lio_listio
347- minor portability fixes aimed at supporting new arch targets
348
349
350
3510.8.3 release notes
352
353new features:
354- arm port (experimental)
355- better musl-gcc wrapper script for building against musl
356- added clone system call
357
358bug fixes:
359- numerous header file typos, copy/paste errors, omissions
360- statfs and statvfs ABI are now LSB-conformant (and actually work)
361
362
363
3640.8.4 release notes
365
366new features:
367- arm dynamic linker support
368- process-shared pthread barriers now work
369- efficient futex-requeue-based cond var broadcast
370- more optional cancellation points are now cancellable
371- printf accepts null pointers with %s, prints as "(null)"
372- recursive mutexes are now fully reentrant
373- __cxa_atexit support
374- real vfork
375- dynamic linker now gold-compatible
376- prlimit syscall
377- support for large limits with setrlimit/getrlimit (even on 32-bit)
378- glob now supports GLOB_PERIOD option (GNU extension)
379
380bug fixes:
381- many serious issues in condition variables
382- rwlock failure-to-wake deadlock issues
383- various small header files bugs/omissions
384- wrong failure return for pthread_create
385- path handling issues on execvp
386- lock count corruption with robust recursive mutexes on owner death
387- integer overflows in atoi, etc. reading most-negative value
388- spurious mremaps on every realloc of large memory chunks
389- pthread cancellation failure in single-threaded programs
390
391security:
392- avoid fd_set overflow in dns lookups
393
394
395
3960.8.5 release notes
397
398new features:
399- stdio operations are now cancellable (only when low-level io happens)
400- global ctor/dtor support in main program start code and shared libs
401- dynamic linker support for PIE executables (but missing startup code)
402- vfork support on x86_64
403- complete set of locale_t functions (all ignore the locale argument)
404- provide define float_t and double_t in math.h
405- lighter/faster cancellation cleanup handler register/unregister
406
407bug fixes:
408- gcc wrapper now supports -shared, -nostdlib, -nostartfiles
409- removed one wrongly-classified character from iswspace set (zwsp)
410- fixed crashes in dns lookup on some errors, e.g. resolv.conf missing
411- "make install" no longer tries to build shared libc if disabled
412- ptrace argument handling bugs fixed
413- work around visibility-hidden bugs in gcc 3.x
414- fix thread-pointer-loss issue when it's initialized in signal handlers
415- various minor typo/misc fixes in headers
416
417compatibility:
418- glob behaves more like traditional implementations w.r.t. GLOB_MARK
419- added legacy futimes, lutimes functions
420- more compatibility macros in sys/param.h (nonstandard header)
421- setfs[ug]id syscall wrappers (linux specific)
422- fgetpwent function (nonstandard)
423- utmp.h matches traditional version more closely
424- caddr_t now matches glibc type (void * instead of long)
425- dummy (always-fail) dlopen and dlsym functions for static linked programs
426- [efg]cvt functions (previously posix, removed from standard)
427- get_current_dir_name function (nonstandard)
428
429
430
4310.8.6 release notes
432
433bug fixes:
434- fix crash in dns lookups for all static-linked, non-threaded programs
435
436
437
4380.8.7 release notes
439
440new features:
441- c++ support with g++'s libstdc++
442- c99 math library (float, long double, complex, etc.)
443- numerous wchar_t functions
444- a64l, l64a functions
445- getdate function
446
447compatibility:
448- c89 compatibility in math.h
449- syscall.h alias for sys/syscall.h
450- memory.h alias for string.h
451- getcwd supports null buffer argument (auto-allocation)
452
453bug fixes:
454- major fenv (floating point environment) fixes and optimizations
455- strptime mishandling of day/month names
456- strtoull wrongly rejecting the highest 16 possible values as overflow
457- math.h constant expression fixes for INFINITY/NAN/etc.
458- scanf mishandling of "0" with "%x"
459
460
461
4620.8.8 release notes
463
464new feature:
465- major math correctness and performance improvements
466- many math functions implemented in asm for i386
467- some math functions (mostly long double) in asm for x86_64
468- new floating point parser/converter with correct rounding
469- implement wcstod, wcstof, and wcstold
470- new scanf implementation - cleaner, faster, more correct
471- minimal/incomplete strfmon implementation
472
473compatibility:
474- header fixes for c++
475- regex code resync with TRE; support common regex extensions
476- support for compiling apps with gcc's -funsigned-char
477- sysconf now returns dynamic limits for open files, processes
478- give dlerror proper error status stickiness
479- make alloca work even with -fno-builtin
480
481critical security fixes:
482- stack-based buffer overflow in fprintf on unbuffered files
483
484other bug fixes:
485- rare gcc register allocation (miscompilation) bug in syscall wrappers
486- printf was rejecting the valid (but redundant) %lf format specifier
487- fixed big data bloat (missing const) in math functions
488- many math fixes related to floating point exceptions and rounding
489- corrected DECIMAL_DIG definitions
490- tgammal was wrongly setting global signgam
491- crash in wordfree with uninitialized we_offs
492- fix wordexp not null-initializing the we_offs initial slots
493
494
495
4960.8.9 release notes
497
498bug fixes:
499- major breakage in strtol and family: failure to accept leading spaces
500- incorrect name for MATH_ERREXCEPT in math.h
501
502compatibility:
503- prototypes for a few additional nonstandard functions
504
505
506
5070.8.10 release notes
508
509new features:
510- correct over/underflow detection (ERANGE setting) for strtod
511- new musl-gcc wrapper, specfile based, faster and more robust
512- meaningful return strings for dlerror
513- new iswalpha, iswpunct, and wcwidth; sync'd to Unicode 6.1
514- towupper/towlower sync'd with Unicode 6.1
515- new futex-based libc-internal locks instead of spinlocks
516- experimental stack protector support (minimal; no random canary)
517- experimental gdb shared library tracking support
518
519compatibility:
520- getusershell family functions
521- getresuid and getresgid syscall wrappers
522- byte swapping macros in endian.h
523- getdtablesize was wrongly declared in unistd.h for _XOPEN_SOURCE
524
525bug fixes:
526- iconv_open wrongly rejecting most dest charsets (broken in 0.8.0)
527- sysconf failure when correct value is -1 (broken in 0.8.8)
528- scanf and strtod family functions overreading past NAN (4 bytes vs 3)
529- scanf and strtod wrongly treating "0.00000000001", etc. as 0
530- many bugs in towupper/towlower (never seriously tested before)
531- int8_t definition was wrong when gcc -funsigned-char was used
532
533
534
5350.9.0 release notes
536
537license change: MIT
538
539new features:
540- configure script, improved build system
541- full stack protector support
542- PIE support on x86 and x86_64
543- new O(1) space, O(nm) time implementation of fnmatch
544- improved support for sse2 floating point mode on x86
545
546compatibility:
547- added linux unshare syscall
548- exp10/pow10 function
549- sqrtl support on arm (previously missing)
550- removed minimal linux/*.h headers that could conflict with real ones
551- support for _LARGEFILE64_SOURCE (mapped to standard fcns with #define)
552- better c89 compatibility in headers
553- stub versions of sched_* functions (previously missing)
554- pthread stacks no longer executable (compat with hardened kernels)
555- new ar.h and lastlog.h (legacy junk)
556- various other header improvements
557
558optimization:
559- additional x86_64 math asm
560- better formula for acos use in i386 asm
561
562bug fixes:
563- large (up to a few %) errors in strtod for certain values due to bug
564- mbsnrtowcs and wcsnrtombs were completely broken (bad exit logic)
565- wide printf %.0s could fail due to uninitialized variable
566- missing dlerror strings for dlsym in some cases
567
568
569
5700.9.1 release notes
571
572new features:
573- dynamic linker can be used as a program to explicitly load/run executables
574- ldd command, usable by making a symlink to the dynamic linker named ldd
575
576bug fixes:
577- major bugs in POSIX BRE parsing inherited from TRE regex code
578- character matching bug in regex on ARM: WCHAR_MAX was assumed to be signed
579- various obscure fixes related to signals and pthread cancellation
580- remquot subnormal remainder bug
581- buggy macros in (nonstandard) sys/param.h
582- major bug in pthread barriers on x86_64 (out of bounds write)
583- utimes (legacy) function was making wrong syscall (utime instead of utimes)
584- avoid using "old" syscalls that don't exist on arm eabi linux
585- broken strrchr(str, 0)
586- broken mbsinit(0)
587- broken wcsncmp
588- syntax error in nextafter macro in tgmath.h
589- missing support for -pie in musl-gcc wrapper
590- abort could wrongly fail to terminate the program in some cases
591
592compatibility:
593- increase default thread stack size to 80k
594- support _BSD_SOURCE feature test macro
595- support _LARGEFILE64_SOURCE feature test macro (merely exposes alt names)
596- lots of legacy-compatibility improvements in headers
597- various minor GNU extension functions
598- sysconf reporting number of available CPUs/cores
599- various LSB/glibc ABI interfaces aimed at compatibility with some binaries
600- use fistpll asm mnemonic instead of fistpq for compat with clang
601
602
603
6040.9.2 release notes
605
606bug fixes:
607- pointer overflow in printf (crash on 32bit userspace, 64bit kernel)
608- printf %ls over-read bug
609- strtod failure to read -0x as negative zero
610- flush stdio after dtors, not before
611- wrong file position for buffered input streams on exit
612- popen was broken when stdin/out were already closed
613- broken wcwidth tables (missing many characters)
614- fwrite: wrong return value of partial/failed write
615- broken utf-16 conversions
616- bad buffer length check in getlogin_r
617- bad perror("") behavior; did not match perror(0)
618- broken sysinfo syscall/structure
619- stdint.h const macro signedness bugs
620- broken include guards in some headers
621- bogus localeconv values
622- cancellation-safety for popen and pclose
623- fma corner cases wrong on i386
624- fcntl F_GETOWN errno missing on failure.
625- char signedness bug in dynamic linker broke dlopen on arm
626- mprotect failure in dynamic linker caused crash instead of error
627
628build system:
629- configure check to work around hacked-up gcc versions
630- test for old binutils that can't support musl dynamic linker
631
632compatibility:
633- make _GNU_SOURCE imply _LARGEFILE64_SOURCE
634- syscall wrapper for lots of nonstandard and/or legacy linux syscalls
635- versionsort stub
636- timegm function (inverse of gmtime)
637- various minor header tweaks
638- make __freading/__fwriting semantics match traditional ones
639- added gnulib-compatibility stdio interfaces
640- added pthread_attr_setstack interface
641- make strerror_r return partial string when buffer is too small
642- duplocale should accept LC_GLOBAL_LOCALE
643- align ptsname_r to upcoming posix requirements
644- support invalid ld80 bit patterns as extra nans.
645
646
647
6480.9.3 release notes
649
650new features:
651- mips (32-bit, o32 abi) port, currently static-linked only
652- newly overhauled crypt implementation
653- improved library pathname info for debugger from the dynamic linker
654- getaddrinfo (and getservbyname) now support /etc/services lookups
655- pipe2 syscall wrapper
656- splice and vmsplice syscall wrappers
657- syscall wrappers for extended attribute interfaces
658- ioperm/iopl syscall wrappers on archs that support these operations
659
660bug fixes:
661- dlsym RTLD_NEXT library search order was wrong
662- multiple dlopen pathname and library name handling errors
663- potential race condition in detached thread exit
664- broken internal-lock-handling code not updated for futex-based __lock
665- sem_trywait spurious EAGAIN errors arising from CAS failures
666- workaround kernel bug in cmsghdr size_t vs socklen_t issue (64-bit)
667- getservby* crash on null protocol argument
668- logic error skipping failed interfaces in if_nameindex
669- various minor header/declaration related issues
670
671arm-specific bug fixes:
672- broken crti/crtn startup code when gcc crtbegin/end files are linked
673- sigsetjmp tail call optimization failure broke the function
674- incorrect little-endian assumptions in atomic.h functions
675- use of blx instruction in asm (not supported on pre-v5 arm)
676
677build system:
678- only use expensive -ffloat-store cflag on archs/compilers that need it
679- make musl-gcc wrapper support -lgcc (mainly for self-hosting)
680
681
682
6830.9.4 release notes
684
685new features:
686- blowfish crypt
687- dynamic linking on mips
688- arm hard float support
689- BSD fgetln function in stdio
690- minor header improvements for compatibility
691- support for CROSS_COMPILE variable to configure
692- legacy significand function
693- better support for SUSv3-targeted programs
694
695performance:
696- assembly (string ops based) memcpy for i386 and x86_64
697- reduce printf overhead
698
699bug fixes:
700- failure of strtod, etc. to process extremely long strings correctly
701- read overrun in wcsstr for short needles
702- various major mips issues that prevented most software from working
703- erroneous floating point exception behavior in i386/x86_64 exp asm
704- crashes on null arguments to legacy err.h functions
705- various header file/type issues
706- extremely rare/obscure race condition with robust mutexes
707- crypt now never returns null (most programs don't check, then crash)
708- missing xattr remove functions
709
710
711
7120.9.5 release notes
713
714compatibility and headers:
715- POSIX+XSI+BSD features enabled by default with no macros defined
716- most programs can now be built without adding -D_GNU_SOURCE
717- added C99 restrict keyword where required in all prototypes
718- greater C89 compatibility
719- cleaner, more-compatible public syscall.h
720- many other header fixes
721- support for compiling musl with clang/llvm
722
723new features:
724- sha 256/512 password hash functions in crypt
725- GNU hash support in dynamic linker
726- partial C11 coverage
727- dladdr function added
728- dynamic linker reports all errors instead of exiting on first error
729- syscall wrappers added for most remaining linux syscalls
730- provide POSIX O_SEARCH open mode using linux O_PATH
731
732bug fixes:
733- most atexit functions were being skipped when exiting
734- some BSD functions were not being exposed under _BSD_SOURCE
735- issues loading ssp-protected DSO into non-ssp program with dlopen
736
737debloating:
738- eliminate .eh_frame (10-15% loaded size bloat)
739- optimal inline syscall asm for ARM and MIPS
740- no longer force -O3 for shared libs
741
742
743
7440.9.6 release notes
745
746bug fixes:
747- serious breakage in definition of O_ACCMODE mask (missing a bit)
748
749new features:
750- O_EXEC open mode
751- md5 crypt hash function
752
753
754
7550.9.7 release notes
756
757new features:
758- thread-local storage (__thread/_Thread_local)
759- microblaze port
760- getopt option parsing reset support
761- vsyscall (sysenter, etc.) support on i386 (faster syscalls)
762- memmem function (GNU extension)
763- mips fenv support
764- accept "nan(n-char-sequence)" in strtod/scanf family functions
765- configure now supports compiling with pcc
766
767quality and correctness improvements:
768- close-on-exec flag for all library-internal file descriptors
769- cancellation-safety and corner-case overhaul in shm_open/sem_open
770- close EINTR vs EINPROGRESS issue
771- mark binaries as not requiring executable stack
772- better gdb compatibility in dynamic linker
773- support recursive dlopen (dlopen called from constructors)
774- posix_spawn/system/popen no longer momentarily double commit charge
775- all stdio functions wait for locks
776
777bug fixes:
778- broken sysvipc *ctl functions on 64-bit archs
779- broken shmdt on some archs
780- getaddrinfo failure with port "0"
781- dirname handling of trailing slash
782- vfork race in posix_spawn
783
784
785
7860.9.8 release notes
787
788new features:
789- powerpc port
790- dl_iterate_phdr interface
791- added mips-specific syscalls
792- thread priority scheduling
793- C11 CMPLX macro in complex.h
794- x86 port io functions in sys/io.h
795
796compatibility:
797- improved headers for trace/debugging/machine-access
798- stub functions for unsupported thread-related functionality
799
800bug fixes:
801- numerous math bugs (mostly exception flags and excess-precision issues)
802- register clobber error in i386 vsyscall asm (did not affect most callers)
803- various incorrect definitions in mips headers
804- broken dlsym asm on mips
805- empty prefix handling in configure script (--prefix="")
806- ldso search path logic issues
807- lock handling for stdio memory streams at exit time
808- invalid SO_REUSEPORT definition in socket.h (not supported by Linux)
809- broken redirection attempt to /dev/null in configure script
810
811
812
8130.9.9 release notes
814
815new features:
816- tgamma implementation (no longer lgamma wrapper with low precision)
817- various gnu extensions: sigandset, sigorset, etc.
818- futimesat function (obsolete)
819- various linux syscalls: arch_prctl, personality, etc.
820
821optimizations:
822- hyperbolic, inverse hyperbolic, and inverse trig, bessel functions
823- is* comparison macros in math.h now expand inline properly
824
825library bugs fixed:
826- calling getenv from shared library ctors was broken
827- invalid read in mmap-serviced aligned_alloc/memalign (possible crash)
828- wrong errno result in fallback path of pipe2
829- various math functions raising spurious exceptions
830- mmap errno value on invalid offsets
831- backwards alignment logic in strlcpy
832- integer overflows in bessel functions
833- large (up to 60ulp) error in erfcf
834- dlsym/dlclose crashing on invalid library handles
835- failure to handle arch variations for cloexec/nonblock flags
836- lio_listio wrong return value for LIO_WAIT mode
837- dladdr failure to resolve PLT addresses
838- time_t/struct tm conversion off-by-one-day in december
839- malloc corruption on nonstandard kernels with non-page-aligned brk
840
841arch-specific bugs fixed:
842- arm ctors/dtors were not working with recent gcc versions
843- arm and mips setjmp/longjmp wrongly saved/restored fenv state
844- loss of precision in i386/x86_64 expl
845
846header bugs fixed:
847- incorrect PRI/SCN macros in inttypes.h for some types
848- arm sys/user.h regressions
849- failure of offsetof() to be an integer constant expression
850- tgmath return value type problems
851
852header compatibility improvements:
853- _GNU_SOURCE now enables everything; _ALL_SOURCE also works
854- scsi/scsi.h and scsi/sg.h are now provided
855- additional MAP_* flags for mmap
856- additional F_* commands and flags for fcntl
857- additional socket option, IPPROTO_* values, and multicase macros
858- thread-related waitpid flags
859- EHWPOISON added to errno.h
860- additional macros for mount, swap, and reboot operations
861- expose additional link.h structures
862- always ensure sizeof(NULL)==sizeof(void *), even in c++
863- additional flags for poll, epoll, inotify, timerfd, timex, dlfcn
864- register names in signal.h/ucontext.h for x86
865- ipc.h ipc_perm nonstandard struct field name compatibility improve
866
867
868
8690.9.10 release notes
870
871new features:
872- getifaddrs
873- pthread_getattr_np (widely used by garbage collectors)
874- mkostemps, mkostemp, mkstemps functions (mkostemp is future-POSIX)
875- strcasestr and strverscmp (previously stubs)
876
877improvements:
878- major performance improvements in mbtowc
879- avoid filling caller-provided thread stacks with large TLS
880- debloat unnecessary static buffers
881- robust posix_spawn based on CLONE_VM instead of vfork
882- new system() and popen() based on posix_spawn
883- better strerror strings
884- further emulation of atomic close-on-exec/nonblock options for old kernels
885- provide macro constants for new-ish kernel features
886
887compatibility:
888- several nonstandard but widely-available pwd/grp/shadow functions
889- program_invocation_[short_]name
890- re-added useconds_t type used by some programs
891- some legacy arpa headers
892- dn_skipname function (legacy resolver API)
893- additional ABI aliases for supporting glibc-linked libraries/binaries
894
895general bugs fixed:
896- stale locks and bogus munmap call when pthread_create fails
897- uninitialized argument to munmap when dynlink load_library fails
898- incorrect error returns in gethostby*_r
899- memory leak in gethostbyname family
900- blank ai_canonname in getaddrinfo for non-CNAME records
901- undefined HZ macro in scsi/sg.h
902- wrong return value for wmemmove on forward-copy
903- namespace conformance in strings.h
904- various utmp.h bugs
905- unnecessary DT_SONAME in libc.so caused problems on some systems
906- multiple bugs in syslog, some possibly dangerous
907- non-functional setpriority function
908- slight mishandling of 0xf5 byte in UTF-8 decoder
909- misaligned memory accesses in mbsrtowcs
910
911arch-specific bugs fixed:
912- crash in shared library loading on arm
913- missing __aeabi_atexit needed by arm eabi
914- wrong float_t definition on x86_64
915- various low-impact type size/alignment mismatches in some headers
916- epoll struct alignment wrong on non-x86[_64] archs
917- broken pipe2 fallback code on mips with old kernels
918
919
920
9210.9.11 release notes
922
923new features:
924- %m allocation modifier for scanf
925- week number and ISO week-based-year functionality in strftime
926- per-process and per-thread cputime clocks
927- ethernet address conversion interfaces
928- legacy classful ipv4 network address interfaces
929- minimal dlinfo function (nonstandard)
930
931other improvements:
932- dynamic linker path file can now use newlines to separate paths
933- math optimizations for archs with extended precision (i386)
934- musl-gcc wrapper now exposes gcc's intrinsic headers
935- quality of rand and rand_r pseudo-random sequences
936- support for large device minor numbers (greater than 8 bits)
937- various header conformance and compatibility fixes
938
939directly user-visible bugs fixed:
940- scanf losing characters on unbuffered streams and fmemopen streams
941- failure of mbsrtowcs to record stop position when dest is full
942- failure of iconv to convert to legacy codepages
943- non-working pthread_[sg]etschedparam functions (wrong syscall arguments)
944
945other potentially-serious bugs fixed:
946- resource leaks in sem_open
947- various bugs in thread exit synchronization
948- invalid access in aio notification after aiocb free/reuse
949- synchronization in dynamic linker when new thread dlopens during ctors
950- lack of error handling for failure to read dynamic linker path file
951- creation by mmap or shmget of objects larger than PTRDIFF_MAX
952
953minor conformance bugs fixed:
954- overflow handling for the clock function
955- workaround for incorrect exceptions in fma due to compiler bugs
956- workaround wrong kernel type for sem_nsems field in struct semid_ds
957
958arch-specific bugs fixed:
959- x86_64 sigsetjmp clobbered the signal mask rather than saving it
960- misaligned stack when calling ctors/dtors (crashing on x86_64)
961
962
963
9640.9.12 release notes
965
966new features:
967- zoneinfo time zone support
968- PIE support on all supported archs
969- named sub-archs for endian and float ABI variants
970- improved support for non-root installs of the dynamic linker
971- ability to selectively build only performance-critical modules with -O3
972- simple buffer overflow detection in free/realloc
973- inet_ntop now presents v4-mapped addresses in ::ffff:a.b.c.d form
974- ldd now reports libc and the dynamic linker in its output
975
976compatibility:
977- support for new init/fini array (needed for ctors/dtors on newer gcc)
978- C++ ABI fully matches glibc/LSB, at least on x86
979- many added ABI compatibility symbols for using glibc-linked libs
980- support for STB_GNU_UNIQUE symbol bindings (found in some C++ libs)
981- macros/types for new Linux kernel features in headers
982
983bugs fixed:
984- crashes in scanf on literal mismatches (regression from adding %m)
985- dl_iterate_phdr was passing invalid phdr pointers to its callback
986- getaddrinfo with null host and AF_UNSPEC was failing to report IPv6
987- integer overflows in date/time conversion code
988- misinterpretation of pre-1930s dates as post-2038 on 32-bit archs
989- make install failed to install bits headers if make was not run first
990- shm_open was wrongly cancellable
991- low- or no-impact heap corruption in memalign
992- explicitly running the dynamic linker on PIE programs did not work
993- missing macros and sysconf for some supported POSIX option groups
994- missing close-on-exec flags for several internal fd uses
995
996arch-specific bugs:
997- wrong SIG_ATOMIC_MIN/MAX macros on x86_64
998- erfcl was missing on archs where long double is same as double
999- broken dynamic-model TLS in static-linked arm/mips/powerpc programs
1000
1001
1002
10030.9.13 release notes
1004
1005new features:
1006- iconv support for EUC-KR and Big5 (including HKSCS) encodings
1007- field widths (POSIX 2008 feature) in strftime
1008- recursive rpath and $ORIGIN support in dynamic linker
1009- cpu affinity interfaces
1010- support for armhf (hardfloat) floating point environment (fenv)
1011- support for SSE fenv on i386 (for apps using -mfpmath=sse -msse2)
1012- strftime %s format (seconds since the epoch, future POSIX requirement)
1013- configure script now saves its command line as a comment in config.mak
1014- legacy functions valloc and euidaccess
1015
1016performance:
1017- optimized asm memcpy for arm
1018- optimized asm memset for i386 and x86_64
1019- optimized C versions of memcpy and memset for all archs
1020- eliminated major spurious syscalls from posix_spawn
1021- some math asm for armhf (hardfloat)
1022
1023workarounds for:
1024- qemu-user's rt_sigaction syscall does not allow old to alias new
1025- qemu-user's madvise always succeeds (broke pthread_getattr_np)
1026- passing PT_INTERP to dlopen attempted to double-load libc
1027- gcc 4.8.x generating self-referential (infinite recursion) memcpy/memset
1028- linux's lack of support for fchdir, fchmod, fchown, fstat on O_PATH fds
1029
1030bugs fixed:
1031- failure to honor flags for fchmodat and faccessat (linux syscall api flaws)
1032- SIGEV_THREAD timer id corruption and race condition issues
1033- timer thread TLS incorrectly keeping values from previous expiry run
1034- ecvt/fcvt decimal position off-by-one
1035- in symbol-versioned libs, symbol resolved to oldest instead of newest
1036- posix_spawn not correctly reporting errno from exec failure
1037- "make install" was not atomic (overwrote files rather than replacing)
1038- integer overflows in strftime
1039- unset/empty TZ variable was mishandled
1040- strftime could crash if the struct tm did not have valid tm_zone field
1041- failure of fenv functions to handle invalid arguments (required by ISO C)
1042- failure of some math functions (C and i386 asm) to raise underflow flag
1043- broken dn_expand function (previously not used internally)
1044- race conditions with signals during fork
1045- incorrect access check in mktemp (obsolete function)
1046- unnecessary arbitrary limits on size of program headers in dynamic loader
1047- text formatting bugs in output of err.h functions
1048
1049arch-specific bugs:
1050- fesetenv(FE_DFL_ENV) crashed on i386
1051- breakage of arm crt code when libc is compiled as thumb
1052- arm/armhf (hardfloat) misidentified by configure
1053- ambiguity of wait (exit status) macros on mips with signal number 127
1054- wrong value of _NSIG and SIGRTMAX on mips
1055
1056
1057
10580.9.14 release notes
1059
1060bugs fixed:
1061- failure to properly install dynamic linker with DESTDIR set (symlink wrong)
1062- rare deadlock in libc-internal locking routines
1063- dynamic linker used fallback paths wrongly on (possibly transient) errors
1064- popen broken when stdin or stdout was already closed in parent
1065- deadlock/memory-corruption in multithreaded set*id and setrlimit functions
1066- realpath failed when file was not readable
1067- readpath mistakenly had cancellation points in it
1068- crashes in scanf with invalid %m conversion specifiers
1069- misclassificiation of some invalid ld80 float representation in fpclassify
1070- various overflow and underflow flag issues in math functions
1071- domain handling errors for acoshf and acoshl
1072- wrong values for some sysconf properties
1073- lack of proper memory barriers on arm
1074
1075mips-specific bugs:
1076- broken sysv ipc structures
1077- multiple stack-related bugs in clone, leading to crashes in parent or child
1078- overflow writing sigset_t in multithreaded set*id and setrlimit functions
1079
1080other improvements:
1081- size and performance improvements to various math functions
1082- wait.h as a compatibility alias for sys/wait.h
1083- various header improvements
1084- support for runtime-variable page size on archs that need it (mainly mips)
1085
1086
1087
10880.9.15 release notes
1089
1090new features:
1091- support for mixing IPv4 and v6 nameserver addresses in resolv.conf
1092- RFC 3678 multicast structures/macros in netinet/in.h
1093- putspent and fgetspent functions (shadow password API)
1094- timef function (obsolete, removed in POSIX 2008)
1095- fanotify syscalls (Linux-specific feature)
1096- semtimedop syscall (Linux-specific sysvipc extension)
1097- quotactl syscall and header (filesystem quotas support)
1098- drem and finite functions (obsolete BSD functions)
1099- getloadavg function (non-standard)
1100- herror function (non-standard and obsolete)
1101- libc.so now stores and prints its version information
1102- expose constants for new Linux features including O_TMPFILE
1103- implement FNM_LEADING_DIR option to fnmatch (GNU extension)
1104- posix_close function (accepted for inclusion in next POSIX issue)
1105
1106bugs fixed:
1107- buffer overflow in mbsrtowcs
1108- clobbering of gr_name in getgrnam_r and getgrgid_r
1109- execle ignoring the environment argument
1110- setenv crash on malloc failure
1111- out-of-bounds access in fnmatch with FNM_PATHNAME and certain patterns
1112- failure of malloc to set errno when failing to extend heap
1113- incorrect errno value from getcwd with zero size
1114- spurious failure in faccessat with AT_EACCESS flag with suid/sgid programs
1115- several fd leaks due to missing close-on-exec flag
1116- misspellings/typos in macro names in several headers
1117- incorrect failure return value in inet_pton
1118- various numeric ip address parsing and validation fixes
1119- namespace conformance issues in several headers
1120- minor header issues
1121- zombie processes left by faccessat with AT_EACCESS
1122- timezone file parser failing/crashing on 64-bit archs
1123- hang in localtime with near-overflowing time_t values on 64-bit archs
1124- timezone path search was only trying first path
1125- incorrect handling of excessive-length TZ environment strings
1126- timezone file loading was wrongly enforcing O_NOFOLLOW/rejecting symlinks
1127- iswspace was wrongly returning true for the null character
1128- various bugs in wordexp
1129- putgrent could write corrupt lines after write failures
1130- dn_expand misinterpreted in-packet offsets greater than 255
1131- spurious strftime/wcsftime failure on len+1==bufsize case
1132- incorrect underflow flag in fma corner cases
1133- log*(0) wrongly returned +inf in downward-rounding mode
1134- failure of fchmod, fstat, fchdir, and fchown to produce EBADF
1135
1136arch-specific bugs fixed:
1137- i386: failure of fesetround to set sse rounding mode
1138- i386: floating point limit constants misinterpreted due to excess precision
1139- powerpc: broken thread pointer access when compiled with clang
1140- microblaze: dynamic linker entry point code possibly clobbering argv
1141
1142strict conformance issues:
1143- NULL definition re-aligned with POSIX (requires (void *) cast)
1144- alignment of math.h is* comparison functions with C11 annex F requirements
1145
1146
1147
11481.0.0 release notes
1149
1150new features:
1151- support for mips softfloat ABI variant
1152- legacy setkey and encrypt API for DES
1153- support for BSD version of struct tcphdr in addition to GNU version
1154- added ipv6 and icmpv6 protocol lookups to getprotoent-family functions
1155
1156new experimental ports:
1157- sh (SuperH)
1158- x32 (ILP32 ABI for x86_64)
1159
1160compatibility:
1161- improved c89 compiler support in math.h
1162- eliminate some compiler warnings in public headers
1163- added some missing things for LFS64 APIs
1164- added fallback emulation of accept4 for older kernels
1165
1166bugs fixed:
1167- buffer overflow in printf when printing smallest denormal exactly
1168- rounding errors in printf in some just-over-halfway cases
1169- posix_spawn did not accept null pid pointer (crashed)
1170- ftello gave incorrect result for unflushed append-mode streams
1171- mishandling of n=0 case in wcsxfrm (wild buffer overrun)
1172- possible system breakage during libc upgrade due to install.sh bugs
1173- nftw FTW_MOUNT flag prevented walking any directories at all
1174- ptsname/ptsname_r returned negated error codes
1175- getprotoent function returned junk after listing valid protocols
1176- wrong error code from readdir when the directory has been deleted
1177- various prototype/argument-type fixes, mostly to legacy functions
1178- various header namespace violations
1179
1180arch-specific bugs fixed:
1181- fesetenv(FE_DFL_ENV) was broken on i386 and x86_64
1182- strerror(EDQUOT) did not work on mips
1183- recvmsg/sendmsg were broken on powerpc
1184- sysv ipc was broken on powerpc and mips
1185- statfs/statvfs were broken on mips
1186- sigaltstack was broken on mips
1187
1188
1189
11901.1.0 release notes
1191
1192new features:
1193- relro memory protection in dynamic linker
1194- malloc can now extend heap with mmap if brk fails
1195- vdso clock_gettime/gettimeofday/time acceleration on x86_64
1196- thread/library-safe versions of search.h functions (nonstandard)
1197- getauxval function (nonstandard)
1198- sysconf extensions to query physical memory size
1199
1200bugs fixed:
1201- floating point printf output corruption from carry into uninitialized slot
1202- possible runaway carry overflow in printf floating point
1203- printf %g failure to strip trailing zeros in some cases
1204- search past end of haystack in memmem
1205- off-by-one error in confstr return value
1206- crashes in some near-empty static programs that use stack protector
1207- deadlock race in pthread_once
1208- non-working clock_gettime fallback for old kernels
1209
1210arch-specific bugs fixed:
1211- crash from missing syscall asm register clobbers on real microblaze kernel
1212- crash in all nontrivial dynamic linker use on microblaze
1213- incorrect rlimit constants on mips
1214- broken, possibly dangerous, use of getrlimit syscall on x32 in sysconf
1215
1216
1217
12181.1.1 release notes
1219
1220new features:
1221- new options --preload and --library-path to dynamic linker
1222- public execvpe function (nonstandard extension)
1223- iconv support for cp437 and cp850
1224
1225bugs fixed:
1226- false negatives with some periodic needles in strstr, wcsstr, and memmem
1227- crash on invalid zoneinfo files
1228- incorrect zero-padding of some outputs for strftime %s specifier
1229- misreporting of errors in configure script when $CC does not work at all
1230- treating not-yet-implemented strptime specifiers as errors
1231
1232compatibility:
1233- configure now detects serious constant-folding bug in gcc 4.9.0
1234- removed __yield symbol (unused) that clashed with some compilers
1235- improvements to sysconf's handling of unsupported/invalid arguments
1236
1237arch-specific bugs fixed:
1238- misdetection of superh ABI variant by configure on gcc 3.x
1239- missing SO_RCVBUFFORCE and SO_SNDBUFFORCE in mips socket.h
1240- build regression on armv6 and later with -mthumb
1241
1242
1243
12441.1.2 release notes
1245
1246new features:
1247- multi-protocol matches (tcp and udp) in getaddrinfo
1248- support for AI_V4MAPPED and AI_ALL flags to getaddrinfo
1249- reverse name lookups from /etc/hosts
1250- reverse service lookups from /etc/services
1251- support for service aliases in /etc/services
1252- ipsec and tunneling protocols to getprotoent-family functions
1253- res_send, res_mkquery, res_querydomain, and dn_comp functions
1254- ipv6 scope id handling for link-local scope addresses
1255- previously-unimplemented %C and %y in strptime now work
1256- vdso clock_gettime acceleration on i386 (new kernel feature)
1257- better O_CLOEXEC/SOCK_CLOEXEC fallbacks for old kernels
1258
1259bugs fixed:
1260- buffer overflow in dns response parsing (CVE-2014-3484)
1261- possible infinite loop in dns response parsing
1262- sendfile off_t 32/64-bit size mismatch
1263- incorrect end pointer in some cases when wcsrtombs stops early
1264- incorrect if_nametoindex return value when interface does not exist
1265- dummy "ent" function aliases that possibly shadowed real ones
1266- tmpfile fd leak on memory exhaustion
1267- getaddrinfo returning EAI_NONAME for some transient failures
1268
1269arch-specific bugs fixed:
1270- broken kernel side RLIM_INFINITY on mips
1271- incorrect syscall argument 6/7 types for pselect on x32
1272
1273
1274
12751.1.3 release notes
1276
1277new features:
1278- address sorting in getaddrinfo, etc. modeled on rfc 3484/6724
1279- default timezone taken from /etc/localtime when $TZ is unset
1280- getopt double-colon extension for optional arguments
1281- support for TLSDESC-based (gnu2) TLS dialect on i386 and x86_64
1282- sendmmsg/recvmmsg (linux-specific)
1283- fmtmsg (last mandatory XSI function that was missing)
1284
1285compatibility:
1286- treat dns rcode=2 as temporary failure, not negative result
1287- working thread-pointer for pre-2.6 kernels on i386
1288- further ABI-compat symbols: __xmknod[at], __sysv_signal
1289
1290bugs fixed:
1291- memmem false positives/false negatives/crashes from invalid logic
1292- gethostby*_r not setting result pointer to null on failure
1293- aliasing violations in syscall.h SYSLOG_NAMES feature
1294- fanotify_mark syscall arguments wrong
1295
1296arch-specific bugs fixed:
1297- various subtle relocation bugs in powerpc and sh dynamic linker
1298
1299
1300
13011.1.4 release notes
1302
1303new features:
1304- experimental locale support for LC_MESSAGES and LC_TIME
1305- non-stub gettext family functions for message translation
1306- or1k (OpenRISC 1000) port
1307- syslog options LOG_CONS and LOG_PERROR
1308- issetugid function (from OpenBSD)
1309- improved if_nameindex and getifaddrs functions
1310
1311compatibility:
1312- work around bug #61144 in gcc 4.9.0 and 4.9.1
1313- support getauxval(AT_SECURE) even on kernels without AT_SECURE
1314
1315bugs fixed:
1316- empty dynamic linker error messages (regression in 1.1.3)
1317- if_nameindex omitted unconfigured and ipv6-only interfaces
1318- incorrect return value for fwide function
1319- failure of wide printf/scanf functions to set wide orientation
1320- multiple issues in legacy function getpass
1321- dynamic linker did not accept colon as a separator for LD_PRELOAD
1322- errno clobber in syslog caused wrong output for %m specifier
1323- crash in regexec for nonzero nmatch argument with REG_NOSUB
1324- minor bugs in rarely-used nl_langinfo item lookups
1325
1326arch-specific bugs fixed:
1327- broken relocations in mips dynamic linker (regression in 1.1.3)
1328- register state corruption in setjmp asm for microblaze
1329- broken struct stat st_ino field on microblaze
1330- broken struct stat st_dev field on big endian mips
1331- broken asm register constraints in atomics on powerpc
1332- missing barriers in atomics on mips, powerpc, microblaze, and sh
1333
1334
1335
13361.1.5 release notes
1337
1338new features:
1339- full C11 coverage (threads, UTF-16/32 API, timespec_get, etc.)
1340- malloc_usable_size function (nonstandard)
1341- support for new F_OFD_* fcntl operations (linux 3.15, POSIX-future)
1342- new _DEFAULT_SOURCE feature test macro to request default profile
1343
1344performance:
1345- private-futex support
1346- redesigned cond var implementation with major performance improvement
1347- tweaked spinning in userspace before performing futex waits
1348
1349bugs fixed:
1350- failure of dn_expand to null-terminate name for crafted DNS packets
1351- corruption of cond var mutex state when switching mutexes
1352- use of uninitialized memory with application-provided thread stacks
1353- false ownership of orphaned mutexes due to tid reuse
1354- possible failure-to-wake for robust mutexes on owner death
1355- subtle errors in robust mutex unrecoverable status handling
1356- missing memory/compiler barrier spinning to obtain locks
1357- wrong behavior in various zero-length stdio operations
1358- buffer overflow in swab with odd argument
1359- incorrect sequence generation in the rand48 family of prng functions
1360- missing cancellation check in non-wait paths of sem_wait, pthread_join
1361- missing barrier in pthread_once fast path
1362- memory leak in regexec when input contains illegal sequence
1363- various parser bugs in regcomp
1364- wrong return value on overflow in some strtoul-family functions
1365- broken CPU_EQUAL macro in sched.h
1366- dlerror not working in static-linked programs
1367- mishandling of negative non-whole-hour TZ offsets
1368- incorrect case mappings for U+00DF
1369- namespace pollution via accidentally-non-static function named "dummy"
1370- missing __fpclassifyl and __signbitl definitions for ld64 archs
1371
1372
1373
13741.1.6 release notes
1375
1376new features:
1377- getopt '-' flag for processing non-option arguments
1378- getopt_long argument permutation extension
1379- getopt_long abbreviated options
1380- ns_parserr and related DNS-packet-parsing functions
1381- fnmatch FNM_CASEFOLD extension
1382- support for translation of getopt error messages
1383- login_tty function (legacy)
1384
1385performance:
1386- efficient atomics on armv7+ targets
1387- pthread_once shrink-wrapping of fast path
1388
1389compatibility:
1390- baseline arm binaries now work on new cpus/kernels without kuser_helper
1391- dynamic linker now honors DT_RUNPATH without DT_RPATH (new binutils)
1392- arm asm is now compatible with clang's internal assembler
1393- suppress macro implementations of functions when headers are used in C++
1394- increased message length limit for syslog
1395
1396bugs fixed:
1397- open ignored file creation mode argument for O_TMPFILE
1398- wrong printf formatting for %#.0o with value zero
1399- missing private state for uchar.h functions (null ps pointer)
1400- sched_getaffinity left uninitialized data in output bit array
1401- wrong return values for pthread_getaffinity_np and pthread_setaffinity_np
1402- buggy handling of multibyte option chars with arguments in getopt
1403- printf failed to report or stop on write errors
1404- printf failed to honor '+' modifier when printing NANs
1405- wcsnrtombs returned the wrong value in one code path
1406- syslog failed to check for connect error
1407- multi-threaded set*id() had spurious failures from ugly workaround code
1408- various minor header conformance bugs (signedness, constant expressions, ...)
1409
1410arch-specific bugs fixed:
1411- on or1k, some syscalls with 64-bit arguments were broken (misaligned)
1412- usage of sahf instruction on x86_64 crashed on some early cpu models
1413
1414
1415
14161.1.7 release notes
1417
1418new features:
1419- alternate passwd/group backend support via nscd protocol
1420- masked cancellation mode extension (experimental)
1421- aio cancellation
1422- aarch64 port (experimental)
1423
1424performance:
1425- significant memset asm optimizations on i386 and x86_64
1426
1427compatibility:
1428- suppress EINTR in semaphores for old kernels where futex restart is broken
1429- always set optarg in getopt_long
1430- support SOCK_RAW socket type in getaddrinfo
1431- report success instead of EINPROGRESS when close is interrupted
1432
1433bugs fixed:
1434- multithreaded set*id() was not async-signal safe, had various race bugs
1435- getspnam_r returned results for partial username matches
1436- wordexp bad character checker mis-counted parentheses
1437- close on fd with pending aio could lead to file corruption
1438- old aio implementation had numerous conformance bugs
1439- malloc init code could deadlock due to race condition
1440- pthread_exit did not disable cancellation
1441- pthread_cond_wait could wrongly consume signal on cancellation
1442- execvp wrongly stopped path search on EACCESS
1443- fsync, fdatasync, and msync were not honored as cancellation points
1444- fchmodat was subject to fd leak race (missing O_CLOEXEC)
1445- fchmodat failed to report EOPNOTSUPP in race path
1446- passwd/group lookup functions had various minor error-reporting bugs
1447- isatty had false-positives/device-state-corruption for OSS sound devices
1448- configure script failed to detect gcc with translated messages
1449- FLT_ROUNDS macro failed to reflect rounding mode changes in fenv
1450
1451arch-specific bugs fixed:
1452- mips fesetenv did not handle FE_DFL_ENV
1453- mips POLLWRNORM and POLLWRBAND macros had wrong values
1454- x32 pthread synchronization object type definitions were wrong
1455- powerpc minimum signal stack size was insufficient
1456
1457
1458
14591.1.8 release notes
1460
1461bugs fixed:
1462- stack-based buffer overflow in inet_pton (CVE-2015-1817)
1463- regcomp crash/mem-corruption with illegal bytes after backslash
1464- regcomp wrongly allowed backrefs in ER
1465- regcomp miscompiled character class brace-repetitions
1466- regcomp wrongly processed \0 as an unmatchable backref
1467- new FLT_ROUNDS definition failed to work in C++ code
1468
1469arch-specific bugs fixed:
1470- aarch64 was missing max_align_t definition
1471
1472
1473
14741.1.9 release notes
1475
1476new features:
1477- ability to protect libc code itself with stack protector
1478- sigsetjmp now restores signal mask after restoring context, not before
1479- thread-local dlerror status/messages
1480- dlerror messages are no longer truncated
1481- diagnostics for constraint violations with ctype.h macros
1482
1483optimizations:
1484- reduce cost of PIC on archs where PLT calls need a fixed GOT register
1485- spin locks no longer constantly invalidate cache lines while spinning
1486- code size reduction in static-linked TLS init
1487
1488bugs fixed:
1489- failure to process robust mutexes on detached-thread exit
1490- possible memory corruption due to robust mutex list on detached-thread exit
1491- crash on memory exhaustion in getgr* internals
1492- misaligned memory accesses in static binaries with low-alignment TLS blocks
1493- multiple cases of wrongful path search continuation after transient failure
1494- small memory leak on failure of dlopen with RPATH $ORIGIN
1495- several small math bugs related to exception flags with non-finite args
1496- mmap leak in sem_open failure path for link call
1497- duplocale clobbered new locale struct with memcpy of old
1498- futimes crashed with null timeval argument
1499
1500arch-specific bugs fixed:
1501- stack protector spuriously aborted after forking on x32
1502- stack protector spuriously aborted with flockfile on powerpc
1503- theoretically-possible clobbering of syscall return value on mips
1504- random thread-pointer setup failure on sh (uninitialized return value)
1505- possible crash in dlsym on sh due to incorrectly-computed branch target
1506- broken fesetenv(FE_DFL_ENV) on mips
1507- dynamic linker name for sh ignored fpu/nofpu and endianness
1508- various minor aarch64 bugs
1509- dangling pointers in x32 syscall timespec fixup code
1510
1511
1512
15131.1.10 release notes
1514
1515new features:
1516- fail-safe (allocation-free) C locale for newlocale to return
1517- all locale categories track requested locale name
1518- rcrt1.o start file for static PIE
1519
1520optimizations:
1521- inline atomics for sh4a
1522- removed heavy atomics from locale-related code paths
1523- removed global data accesses from CURRENT_LOCALE macro & callers
1524- dynamic linker stage 1 size reduction
1525
1526compatibility:
1527- better configure detection of unsupported compiler options
1528- support for more relocation types in libc.so, not currently used
1529- iconv_open accepts "" and "CHAR" as aliases for native (UTF-8)
1530- additional LFS64 macros in sys/resource.h
1531
1532regressions fixed:
1533- dynamic linker crash on NONE-type relocations (only mips affected)
1534- inability to build as thumb2 on arm
1535- failure to run under qemu-i386 user-level emulation
1536- inability to access globals from libc on powerpc
1537- PIE link errors in Scrt1.o under unusual usage on some archs
1538
1539other bugs fixed:
1540- failure of ungetc/ungetwc to work on FILE streams in EOF state
1541- possible null pointer dereference in gettext
1542- possible initial stack misalignment on mips with PIE
1543
1544
1545
15461.1.11 release notes
1547
1548new features:
1549- byte-based C locale
1550- vdso clock_gettime on arm
1551- musl-clang wrapper
1552- sh2 nommu target support
1553
1554performance:
1555- major speed-up for dynamic linker symbol lookups with GNU hash
1556
1557compatibility:
1558- strverscmp now matches GNU behavior in corner cases
1559- empty TZ environment variable gives GMT rather than system default
1560- reconnection on syslog server socket loss (syslogd restart)
1561- mmap fallback in simple_malloc when brk fails
1562- support for %m and %s with null pointers in wide printf variants
1563- call frame information in i386 asm for improved debugger support
1564
1565bugs fixed:
1566- spurious errors from pwd/grp functions when nscd backend is absent
1567- possible invalid access on calloc with simple_malloc
1568- null pointer dereferences after calling uselocale((locale_t)0)
1569- erroneous support for cancellation in stdio caused data loss
1570- inconsistent handling of atexit called from atexit handler
1571- missing locking in error paths for ungetwc
1572- btowc mishandling of out-of-range non-EOF inputs
1573- negated return value of ns_skiprr, failure in related functions
1574- incorrect void return type for syncfs, missing error status
1575- possible failure of tempnam due to missing null termination
1576- negated tm_gmtoff field in struct tm
1577- off-by-one error in getsubopt leaving equals sign in value result
1578
1579arch-specific bugs fixed:
1580- soft deadlocks on i386/x86_64 due to missing barrier in internal locks
1581- regression in arm pre-v7 support for kernels with kuser helper removed
1582- runaway PC on mips detached thread exit (due to kernel regression)
1583- mismatched ABI for local-dynamic model TLS on mips and powerpc
1584- incorrect value of some SO_* constants on mips
1585- broken 64-bit syscall argument passing on aarch64
1586
1587
1588
15891.1.12 release notes
1590
1591new features:
1592- fdpic abi on sh2 for shareable text segment without mmu
1593- general fdpic elf support in dynamic linker
1594- CFI generation for x86_64 asm source files
1595- protection against silently building a libc.so with missing symbols
1596
1597compatibility:
1598- nl_langinfo(CODESET) now returns "ASCII" in byte-based C locale
1599- fixed build regression due to buggy .SECONDARY in some GNU make versions
1600- additional arm eabi functions needed by llvm arm backend
1601- added format argument attributes to gettext function prototypes
1602- static PIE no longer requires linking with -E/-rdynamic
1603- eliminated spurious protected-data warnings linking against libc.so
1604- avoided spurious fpu asm errors with some armhf toolchains
1605
1606bugs fixed:
1607- fclose of stdin/stdout caused deadlock at exit
1608- missing memory barrier in pthread_join
1609- open_[w]memstream produced no buffer when no writes took place
1610- uninitialized scopeid in address lookups from hosts file and ip literals
1611- ip literals for mismatching family (v4 vs v6) were queried as hostnames
1612- possible crash on OOM in regcomp
1613- incorrect contents in localeconv structure (-1 instead of CHAR_MAX)
1614- strftime mishandling of out-of-range struct tm members
1615- wrongful attribute((const)) on pthread_self and errno location function
1616
1617arch-specific bugs fixed:
1618- arm crt1 entry point failed to align stack pointer in some cases
1619- mips fesetround failed to actually set rounding mode
1620- i386 asm source CFI generation had multiple bugs
1621
1622
1623
16241.1.13 release notes
1625
1626new features:
1627- out-of-tree builds
1628- search domains in resolv.conf
1629- sh arch supports j-core (j2) cas.l atomics
1630- dynamic linker includes arch/abi in output when run as a command
1631- header support for new kernel features through linux 4.4
1632- mips vdso clock_gettime support
1633- regex BRE extensions: \|, \+, \?
1634
1635performance:
1636- improved atomics performance on all archs with ll/sc model
1637- atomic instructions are now inlined on armv6
1638- use fpu sqrt for arm softfp abi on targets with vfp
1639
1640compatibility:
1641- getnameinfo now accepts sockaddr sizes larger than needed
1642- new default CFLAGS/LDFLAGS avoid entire classes of toolchain bugs
1643- explicit use of float_t/double_t avoids compiler float spill bugs
1644- i386 max_align_t definition now works with g++ 4.7's pseudo-c++11
1645- all known protocols are added to protoent functions
1646- stub utmpname, utmpxname functions
1647- linker support for -Bsymbolic-functions is no longer mandatory
1648- regex parsing size limits increased
1649- malloc_usable_size now accepts null pointer input
1650
1651bugs fixed:
1652- potential single-byte heap overflow in getdelim
1653- mishandling of transient failure opening hosts, services, resolv.conf
1654- mremap was sometimes able to allocate objects larger than PTRDIFF_MAX
1655- nl_langinfo wrongly returned NULL instead of "" for invalid items
1656- out-of-bounds dynamic tls allocation due to pointer/index scaling error
1657- getifaddrs misreported point-to-point interface addresses
1658- tdelete left tsearch trees misbalanced
1659- tsearch crashed on allocation failure
1660- tsearch, tfind, and tdelete failed to handle null pointer input
1661- passing signal number 0 to sigaction resulted in a crash
1662- getdelim updated caller's size wrongly when realloc failed
1663- getdelim realloc strategy was wasteful
1664- if_nametoindex returned wrong value on failure
1665- missing ssp-suppression for some source files called from early-init
1666- various minor resolv.conf parsing bugs
1667- fwrite wrongly reported success on write errors in line-buffered flush
1668- fwrite and fread wrongly returned nmemb (not 0) when size was 0
1669
1670nommu-specific bugs fix:
1671- failure to zero bss in FDPIC shared library loader
1672- unsafe writes to read-only file mapping in non-FDPIC library loader
1673
1674arch-specific bugs fixed:
1675- sh[eb]-nofpu-fdpic was using fpu-dependent setjmp/longjmp variants
1676- dynamic linker path file name was wrong for arm "softfp" targets
1677- mips siginfo_t and related macros were defined incorrectly
1678- possibly misaligned pointer globals on arm (from an asm source file)
1679- mips dynamic linker failed to provide info needed by debugger
1680- mips cancellation asm wrongly assumed validity of $gp register value
1681
1682
1683
16841.1.14 release notes
1685
1686regressions fixed:
1687- treatment of empty string argument as error by puts and fputs
1688- make clean and distclean failure in unconfigured trees
1689- sh/fdpic dynamic linker entry point hang due to wrong code
1690- armhf (and arm softfp model) build failure with clang
1691
1692other bugs fixed:
1693- wrongly clamping (rather than failing) excessive rounds in crypt-sha*
1694
1695
1696
16971.1.15 release notes
1698
1699new features:
1700- mips64 (full 64-bit and n32) port
1701- mips r6 isa support (subarch for mips, mips64, and mipsn32 archs)
1702- powerpc64 port
1703- powerpc (32-bit) soft-float ABI support (subarch)
1704- pthread_tryjoin_np and pthread_timedjoin_np (nonstandard extensions)
1705- header-level support for linux 4.5 and 4.6 features
1706- sched_getcpu (nonstandard extension) support, including vdso version
1707- __STDC_ISO_10646__, __STDC_IEC_559__ macros predefined via stdc-predef.h
1708- support for new elf/arch features in elf.h
1709
1710compatibility:
1711- configure now correctly chooses cross-prefix based on build/host/target
1712- abort now successfully terminates pid 1 in a container (or top-level)
1713
1714bugs fixed:
1715- memmem read past end of haystack, possible false positives or crashes
1716- buffer underflow (reverse-overflow) in ungetwc
1717- double-free under certain usage of putenv
1718- incorrect treatment by regcomp of * at start of BRE subexpression
1719- gethostbyname[2][_r] produced ip addresses in misaligned buffers
1720- looking up some invalid hostnames caused malformed dns queries
1721- lookups from hosts file were inconsistent with non-matching family
1722- missing h_length value in gethostbyaddr results
1723- a64l function produced wrong-signed results on 64-bit archs
1724- broken padding of string formats to width in wide printf variants
1725- wrong results for expf(-NAN) and exp2f(-NAN)
1726- wrong value for RUSAGE_CHILDREN prevented it from working
1727- abort failed to provide abnormal termination with SIGABRT blocked
1728
1729arch-specific bugs fixed:
1730- broken posix_fadvise on arm and powerpc (32-bit)
1731- thread structure/dtv corruption on powerpc at thread startup
1732- various wrong mips and powerpc ioctl and termios constant values
1733
1734
1735
17361.1.16 release notes
1737
1738new features:
1739- s390x (64-bit S/390) port
1740- pthread_setname_np extension function
1741- limited pthread_setattr_default_np function to set stack size defaults
1742- header-level support for linux 4.7, 4.8, and 4.9 features
1743- confstr _CS_V6_ENV and _CS_V7_ENV items
1744
1745compatibility:
1746- public prototypes for abi-compat *_unlocked symbols, etc.
1747- fflush_unlocked(NULL) now works
1748- resolv.h __RES version macro now matches supported APIs
1749- workaround for gdb bugs backtracing across signals on x86_64
1750- anchors ^ and $ are now accepted in BRE subexpressions
1751- building for thumb2-only arm isa levels is now possible
1752
1753bugs fixed:
1754- integer overflows in regexec buffer allocation (CVE-2016-8859)
1755- failure of regexec to report matches at offsets past INT_MAX
1756- static-pie executables with initialized thread-local storage crashed
1757- printf failed to catch EOVERFLOW in some cases, wrongly produced it in others
1758- printf produced wrong output, result for float with precision near INT_MAX
1759- printf produced wrong results with alt-form octal, zero flag, & field width
1760- printf float rounding was wrong for some midpoint cases
1761- swprintf printed junk after internal (256-byte) buffer filled up
1762- strtod family rounded incorrectly in several corner cases
1763- getmntent failed to handle long records
1764- getopt_long_only wrongly treated "--" as an option
1765- asctime output wrongly varied by locale
1766- strftime %y specifier produced wrong output for negative tm_year
1767- time zone names quoted with <> were misparsed
1768- corner case integer overflow in tm_year for some date conversions
1769- failure to load shared libs whose names were prefixes of standard lib names
1770- wrong error codes for several failure cases in various functions
1771- various asymptomatic undefined behavior
1772- various minor namespace issues in headers
1773
1774arch-specific bugs fixed:
1775- tcsetattr regression on mips (completely non-working)
1776- wrong pread/pwrite syscall calling convention on sh
1777- wrong preadv2/pwritev2 syscall numbers on x32
1778- mrand48/jrand48 produced wrong-signedness results on 64-bit archs
1779
1780
17811.1.17 release notes
1782
1783new features:
1784- RTLD_LAZY deferred symbol binding, functionally equivalent to lazy binding
1785- safeguard against dlopen of multiple libc versions/instances
1786- new posix_spawn flag POSIX_SPAWN_SETSID
1787- posix_spawnattr_setflags now reports unknown flags as error
1788- ldso option --argv0 to set argv[0]
1789- added _NL_LOCALE_NAME extension to nl_langinfo
1790
1791compatibility:
1792- dlopen local-to-global promotion no longer changes existing symbols
1793- gettext now searches locale name variants for translation files
1794- increased locale name length limit from 15 to 23 bytes
1795- setlocale(LC_ALL, 0) returns single name if all categories are same
1796- realloc no longer fails when mremap doesn't work
1797- getservby* no longer treat numeric port strings as service records
1798- mmap now works around incorrect EPERM error codes from kernel
1799- impact of REG_* namespace pollution in x86[_64] signal.h is reduced
1800- arm atomic asm now assembles correctly with new binutils
1801- PAGE_SIZE on arm is no longer constant (quiet upstream ABI relaxation)
1802- lsearch/lfind now pass args to compare callback in canonical order
1803- STB_WEAK and STB_GNU_UNIQUE symbols now behave same as STB_GLOBAL
1804- better clang CFLAGS checks in configure
1805- global vis.h hack, which made lld refuse to link to libc.so, is disabled
1806
1807performance:
1808- single-instruction optimized math functions for aarch64, s390x, powerpc64
1809- fast path for ASCII in towupper/towlower
1810- new mostly-integer-math fma function
1811
1812semantic bugs fixed:
1813- POSIX-format TZ dst time transitions were wrong for southern hemisphere
1814- regex REG_NEWLINE semantics were wrong with negated brackets
1815- various bugs in strptime %j, %p, %C formats
1816- iconv mapped some characters to legacy 8bit encodings incorrectly
1817- glob failed to match "/"
1818- UTF-8 decoder accepted invalid f4 9x xx xx code sequences
1819- scanf %% conversion failed to consume whitespace
1820- glob with GLOB_PERIOD wrongly descended into . and ..
1821- nftw gave incorrect base name offset when pathname ends in "/"
1822- functional regression in resolv.conf attempts option
1823- scalbn could produce wrong result due to double rounding in subnormal range
1824- strftime %y format wrong with negative years
1825- mbsnrtowcs and wcsnrtombs mishandled input limits
1826- minor issues with error codes for various functions
1827
1828safety/consistency bugs fixed:
1829- stack-based buffer overflow in dns response processing
1830- invalid free in regexec on certain error paths
1831- invalid free in globfree after failed glob
1832- one-byte buffer overflow in legacy getpass function
1833- failed dlopen corrupted thread-local storage module list
1834- race in pthread_create with priority attributes could leave signals masked
1835- multithreaded set*id() functions could induce spurious EINTRs
1836- dl_iterate_phdr reported wrong base address in static PIE
1837- fd leak and wrong cancellation state after dns socket failure
1838- memory leaks and other issues in environment-modification functions
1839- read-after-free race in pthread_detach
1840- memmem performed single-byte over-read in short-needle code paths
1841- read via uninitialized pointer in gettext core
1842- bindtextdomain broke bindings for all other domains
1843- various silent undefined behavior
1844- getopt clobbered optopt on success
1845
1846arch-specific bugs fixed:
1847- x32 dynamic TLS accesses crashed
1848- s390x was missing dlsym entry point (needed for RTLD_NEXT)
1849- powerpc64 ldso startup could crash depending on link order
1850- powerpc64 setjmp/longjmp didn't properly save/restore TOC pointer
1851- thumb2 setjmp/longjmp silently broke at ld-time with text not aligned
1852- fchown was broken on archs without SYS_fchown syscall
1853- fstatat was broken on mips64
1854- various incorrect constants in powerpc64 and mips headers
1855
1856
18571.1.18 release notes
1858
1859regression fixes:
1860- glob failed to match literal . and .. path components
1861- build for armv4t ISA level was broken
1862
1863other bug fixes:
1864- stack overflow in posix_spawnp with large PATH variable in environment
1865
1866
18671.1.19 release notes
1868
1869new features:
1870- iconv framework for processing stateful encodings
1871- iconv support for iso-2022-jp
1872- iconv support for converting to legacy JIS-based Japanese encodings
1873- iconv support for UTF-16/32 with BOM-determined endianness
1874- iconv ibm1047 (ebcdic latin1-equivalent) support
1875- iconv cp866 (dos cyrillic) support
1876- character data tables & case mappings updated to Unicode 10.0
1877- fopencookie stdio extension
1878- strftime padding character extensions
1879- header-level support for new linux features through 4.13
1880
1881compatibility:
1882- UTC timezone is now called UTC instead of GMT
1883- _DIRENT_HAVE_D_* macros in dirent.h
1884- dladdr dli_fbase definition now matches other implementations
1885- pthread_getattr_np now reports guard size
1886- strftime '+' modifier better matches apparent intent of POSIX
1887- getopt_long handles long option names containing '='
1888- better compatibility with linux uapi headers
1889- workaround linux bug where getcwd can return non-absolute pathname
1890- configure logic for finding compiler_rt with clang
1891- execvp path search now continues after ENOTDIR components
1892
1893bugs fixed:
1894- fgetwc failed when character crossed buffer boundary
1895- memory corruption after failing to dlopen a second libc
1896- sysconf reported infinite rlimits incorrectly
1897- getopt_long --opt=arg did not work with partial matches
1898- printf was wrong for alt-form octal with value 0, no explicit precision
1899- endian errors in arpa/nameser.h and netinet/icmp6.h (missing endian.h)
1900- atfork handler could clobber fork's errno
1901- iconv could wrongly output surrogate pairs in ucs2
1902- fmemopen buffer underallocation with extreme size argument
1903- getaddrinfo AI_NUMERICSERV wrong error code
1904- data race in at_quick_exit
1905- ldd failed to honor rpath $ORIGIN for program in . without "./" prefix
1906
1907arch-specfic bugs fixed:
1908- x32 unistd.h wrongly reported LP64 instead of ILP32
1909- aarch64 signal.h had wrong type for ucontext_t uc_link member
1910
1911
19121.1.20 release notes
1913
1914new features:
1915- m68k port
1916- replacement of malloc is now allowed/supported
1917- setvbuf now accepts caller-provided buffers for stdio streams
1918- getrandom syscall wrapper, getentropy function
1919- mlock2 syscall wrapper
1920- memfd_create syscall wrapper
1921- explicit_bzero function
1922- header-level support for new linux features through 4.17
1923- wcsftime now supports padding specifier extensions
1924- dynamic linker's reclaim_gaps now works on fdpic archs
1925- getaddrinfo now honors AI_ADDRCONFIG
1926- pthread_attr_init now honors pthread_setattr_default_np defaults
1927
1928hardening:
1929- prevent bypass of guarantee that suids start with fd 0/1/2 open
1930- dlopen now rejects libraries with initial-exec refs to dynamic TLS
1931
1932compatibility:
1933- elf.h: new flags, aux vector entry types, etc.
1934- minor namespace issues in several headers
1935- intNN_t types used in bitfields now safe against -funsigned-bitfields
1936- complex arc trig/hyperbolic functions were badly broken
1937- nice function returned wrong value
1938- stdio locks no longer depend on read-after-free not faulting
1939- avoid excessive stack usage in getcwd
1940- inet_ntop no longer compresses single zeros in IPv6 (RFC 5952)
1941- resolver routability probe for sorting results works on no-IPv6 systems
1942- added missing ST_RELATIME definition to statvfs.h
1943- uchar.h now works with old C++ profiles
1944- added missing and arch-specific commands to ptrace.h
1945- musl-gcc wrapper now works with default-pie host toolchains
1946
1947bugs fixed:
1948- getopt wrongly treating colons in optstring as valid option chars
1949- nl_langinfo_l(CODESET, loc) reported wrong locale's value
1950- out-of-tree build produced broken crt files with stack protector enabled
1951- fmaf produced wrong result for some corner cases
1952- out of bounds write for zero length buffer passed to gethostname
1953- getopt_long_only wrongly prefix-matched long-options over short ones
1954- pthread_kill wrongly returned ESRCH for exited by valid pthread_t's
1955- iconv buffer overflow converting to legacy JIS-based encodings
1956- iconv conversion to "UTF-32" (no explicit endianness) failed (regression)
1957- iconv mishandled big5-hkscs characters that map to two unicode chars
1958- dynamic linker didn't map/clear bss for libraries with single LOAD segment
1959- resolver wrongly duplicated trailing dot from query into canonical name
1960- some futex waits omitted timeout arg to syscall, thereby spun on EFAULT
1961- dladdr mishandled addresses not matching symbols
1962- alignment of dirent structures from readdir was broken (regression)
1963- strftime %z output wrong sign for offsets <1 hour west of UTC
1964- limits.h, pathconf erroneously defined SYMLINK_MAX
1965- FP_ILOGB0 and FP_ILOGBNAN definitions were not valid for use in #if
1966- getopt failed to update optarg and optind correctly on missing argument
1967- EMULTIHOP error lacked strerror text
1968- mktime malfunctioned with tm_isdst>0 but no-DST POSIX-format time zone
1969- async thread self-cancellation produced a deadlock condition
1970- pthread_barrierattr_setpshared failed to produce EINVAL for bad argument
1971- fileno failed to produce EBADF for non-fd-associated FILEs
1972- fmemopen's w+ mode failed to truncate buffer at open
1973- open_[w]memstream did not bind stream orientation at open time
1974- system wrongly returned 0x7f00 instead of -1 on error
1975- wide printf functions ignored field width for %c formats
1976- fprintf failed to set stream orientation for unbuffered stream or no output
1977- psignal, psiginfo, and perror wrongly set stream orientation for stderr
1978- psignal, psiginfo potentially clobbered errno on success
1979
1980arch-specfic bugs fixed:
1981- on arm/aarch64/sh, local-exec TLS layout mismatched ABI with large align
1982- on arm/microblaze/sh, struct ipc_perm mismatched (buggy) kernel ABI
1983- SO_PEERSEC definition was wrong on mips
1984- on mips, return from start function passed to clone crashed (runaway exec)
1985- printf %a precision specifier malfunctioned except on ld80 archs
1986- async thread cancellation crashed on powerpc64 and sh-fdpic
1987
1988
19891.1.21 release notes
1990
1991new features:
1992- setting default thread stack size via PT_GNU_STACK program header
1993- arm vfork implementation
1994- arm tlsdesc/gnu2 tls dialect support
1995- name_to_handle_at and name_to_handle_at syscall wrappers
1996- header-level support for new linux features through 4.18
1997
1998optimizations:
1999- glob rewrite with much better performance and stack usage properties
2000- single-threaded and already-locked fast paths for getc/putc variants
2001- single-instruction fma implementations for arm, s390x, powerpc, & x86_64
2002- single-instruction fabs and sqrt implementations for powerpc
2003- size and performance from making all internal-only functions/data hidden
2004- made &errno and pthread_self results cachable again (attribute((const)))
2005- significant speedup in strtod with short inputs
2006- new tsearch AVL tree implementation, smaller and faster
2007- special-cased nop calls to wmemmove
2008- fixed erroneously suboptimal skip conditions in strstr and memmem
2009
2010hardening:
2011- default thread stack guard size increased from 4k to 8k
2012
2013compatibility:
2014- default thread stack size increased from 80k to 128k
2015- building for arm as thumb2 with clang internal assembler now works
2016- aio threads could overflow stack on kernels that break MINSIGSTKSZ ABI
2017- aio threads no longer call malloc (problematic with malloc replacement)
2018- pthread_sigmask/sigprocmask now ignore an invalid how when not changing mask
2019
2020bugs fixed:
2021- soft deadlock regression in stdio FILE locks with >2 threads contending
2022- deadlock and buffered data loss race in fclose
2023- race condition leading to possible crash in dcngettext plural forms
2024- glob failed to see past searchable-but-unreadable path components
2025- getdelim wrongly realloc'd buffer that was already exactly right size
2026- getdelim failed to set stream orientation on early error
2027- ttyname[_r] reported wrong error when given bad fd
2028- pthread_key_delete left old tsd values exposed if slot was reused
2029- freeaddrinfo failed to support freeing sublists
2030- access to optopt was broken by copy relocations
2031- memccpy returned wrong result if first byte past buffer end matched
2032- wordexp read past end of input string ending in backslash
2033- sem_wait and sem_timedwait were wrongly not interruptible by signals
2034- getspnam[_r] wrongly treated not-found as an error
2035
2036arch-specfic bugs fixed:
2037- soft deadlocks (missing futex wake) on powerpc locking
2038- dlsym returned wrong address for thread-local symbols on ppc/mips/m68k
2039
2040
20411.1.22 release notes
2042
2043new features:
2044- priority-inheritance mutexes
2045- membarrier syscall, pre-registration to use it, fallback emulation
2046- header-level support for new linux features in 4.19, 4.20, 5.0
2047
2048major internal changes:
2049- complete, async-safe view of all existent threads as global list
2050- robust __synccall based on new thread list
2051- new dynamic TLS is installed synchronously at dlopen
2052- TLSDESC resolver functions no longer make bad ABI assumptions to call C
2053- resolved shared library dependencies are now recorded
2054
2055compatibility & conformance:
2056- dependency-order shared library constructor execution
2057- sigaltstack no longer rejects SS_AUTODISARM, future flags
2058- FILE is now a complete (dummy) type in pre-C11 feature profiles
2059- setvbuf reports failure on invalid arguments
2060- TSVTX is exposed unconditionally in tar.h
2061- multithreaded set*id() no longer depends on /proc
2062- key slot reuse after pthread_key_delete no longer depends on /proc
2063
2064bugs fixed:
2065- failures in multithreaded set*id() with concurrent thread creation/exit
2066- interposed free was called from invalid/inconsistent contexts
2067- freeaddrinfo performed invalid free of some partial results lists
2068- dlsym dependency order search had false negatives and false positives
2069- dn_skipname gave wrong results for labels with 8-bit content
2070- dcngettext clobbered errno, often breaking printing of error messages
2071- sscanf read past end of buffer under certain conditions (1.1.21 regression)
2072- pthread_key_create spuriously failed under race condition (1.1.21 regression)
2073- fdopendir wrongly succeeded with O_PATH file descriptors
2074- gets behaved incorrectly in presence of null bytes
2075- namespace violations in c11 tsd and mutex function dependencies
2076- incorrect prototype for makecontext (unimplemented)
2077
2078arch-specfic bugs fixed:
2079- s390x had wrong values for POSIX_FADV_DONTNEED/_NOREUSE
2080
2081
2082
20831.1.23 release notes
2084
2085new features:
2086- riscv64 port
2087- configure now allows customizing AR and RANLIB vars
2088- header-level support for new linux features in 5.1
2089
2090major internal changes:
2091- removed extern __syscall; syscall header code is now fully self-contained
2092
2093performance:
2094- new math library implementation for log/exp/pow
2095- aarch64 dynamic tlsdesc function is streamlined
2096
2097compatibility & conformance:
2098- O_TTY_INIT is now defined
2099- sys/types.h no longer pollutes namespace with sys/sysmacros.h in any profile
2100- powerpc asm is now compatible with clang internal assembler
2101
2102changes for new POSIX interpretations:
2103- fgetwc now sets stream error indicator on encoding errors
2104- fmemopen no longer rejects 0 size
2105
2106bugs fixed:
2107- static TLS for shared libraries was allocated wrong on "Variant I" archs
2108- crash in dladdr reading through uninitialized pointer on non-match
2109- sigaltstack wrongly errored out on invalid ss_size when doing SS_DISABLE
2110- getdents function misbehaved with buffer length larger than INT_MAX
2111- set*id could deadlock after fork from multithreaded process
2112
2113arch-specfic bugs fixed:
2114- s390x SO_PEERSEC definition was wrong
2115- passing of 64-bit syscall arguments was broken on microblaze
2116- posix_fadvise was broken on mips due to missing 7-arg syscall support
2117- vrregset_t layout and member naming was wrong on powerpc64
2118
2119
2120
21211.1.24 release notes
2122
2123new features:
2124- GLOB_TILDE extension to glob
2125- non-stub catgets localization API, using netbsd binary catalog format
2126- posix_spawn file actions for [f]chdir (extension, pending future standard)
2127- secure_getenv function (extension)
2128- copy_file_range syscall wrapper (Linux extension)
2129- header-level support for new linux features in 5.2
2130
2131performance:
2132- new fast path for lrint (generic C version) on 32-bit archs
2133
2134major internal changes:
2135- functions involving time are overhauled to be time64-ready in 32-bit archs
2136- x32 uses the new time64 code paths to replace nasty hacks in syscall glue
2137
2138compatibility & conformance:
2139- support for powerpc[64] unaligned relocation types
2140- powerpc[64] and sh sys/user.h no longer clash with kernel asm/ptrace.h
2141- select no longer modifies timeout on failure (or at all)
2142- mips64 stat results are no longer limited to 32-bit time range
2143- optreset (BSD extension) now has a public declaration
2144- support for clang inconsistencies in wchar_t type vs some 32-bit archs
2145- mips r6 syscall asm no longer has invalid lo/hi register clobbers
2146- vestigial asm declarations of __tls_get_new are removed (broke some tooling)
2147- riscv64 mcontext_t mismatch glibc's member naming is corrected
2148
2149bugs fixed:
2150- glob failed to match broken symlinks consistently
2151- invalid use of interposed calloc to allocate initial TLS
2152- various dlsym symbol resolution logic errors
2153- semctl with SEM_STAT_ANY didn't work
2154- pthread_create with explicit scheduling was subject to priority inversion
2155- pthread_create failure path had data race for thread count
2156- timer_create with SIGEV_THREAD notification had data race getting timer id
2157- wide printf family failed to support l modifier for float formats
2158
2159arch-specific bugs fixed:
2160- x87 floating point stack imbalance in math asm (i386-only CVE-2019-14697)
2161- x32 clock_adjtime, getrusage, wait3, wait4 produced junk (struct mismatches)
2162- lseek broken on x32 and mipsn32 with large file offsets
2163- riscv64 atomics weren't compiler barriers
2164- riscv64 atomics had broken asm constraints (missing earlyclobber flag)
2165- arm clone() was broken when compiled as thumb if start function returned
2166- mipsr6 setjmp/longjmp did not preserve fpu register state correctly
2167
2168
2169
21701.2.0 release notes
2171
2172new features:
2173- time_t is now 64-bit on all archs (not just 64-bit archs)
2174- character type & case mapping data updated to Unicode 12.1.0
2175- header-level support for new linux features in 5.3 and 5.4
2176
2177performance:
2178- new O(1) wchar_t case mapping implementation
2179- i386 now uses C math code for exp, faster than old asm
2180- mips math asm
2181
2182compatibility & conformance:
2183- endian.h now aims to conform to future POSIX definition
2184- support older compilers that don't accept powerpc math asm constraints
2185- fdpic code in ldso was incompatible with valid optimizations in gcc 9+
2186- RLIMIT_RTTIME was missing from sys/resource.h
2187
2188bugs fixed:
2189- wcwidth wrongly returned 0 for most of planes 4 and up
2190- missing case mapping between U+03F3 and U+037F
2191- wrong cacosh results for arguments with negative imaginary part
2192- wrong catanf/catanl results for various classes of arguments
2193- wrong return value for ungetc with argument outside [0,UCHAR_MAX]
2194- posix_openpt with no ptys available produced wrong errno
2195
2196arch-specific bugs fixed:
2197- sigcontext/regset definition mistakes & omissions on m68k, powerpc64
2198- fesetenv(FE_DFL_ENV) crashed on riscv64
2199- sh2 dynamic linker was broken since 1.1.21 (crash in stage 2b)
2200- arm dynamic linker chose wrong tls/atomic variants since 1.1.21
2201- some math library functions returned excess precision on i386
2202- unconfirmed regression in fchmodat AT_SYMLINK_NOFOLLOW on mips*
2203
2204
2205
22061.2.1 release notes
2207
2208major changes:
2209- new malloc implementation (mallocng & overhauled bump allocator)
2210
2211new features:
2212- DNS queries via res_* now set AD flag, report zone signedness (DNSSEC)
2213- PTHREAD_NULL macro (POSIX-future)
2214
2215performance:
2216- optimized memcpy and memset for aarch64
2217- optimized memcpy for arm now supports big endian
2218- optimized x86_64 remquol
2219- improved strerror without linear search
2220
2221bugs fixed:
2222- lock-skipping for processes that returned to single-threaded was wrong
2223- AF_UNSPEC dns lookups mishandled single failure in paired A+AAAA
2224- res_send and res_query returned wrong value on errors from nameserver
2225- corrupted sysvipc timestamps on 32-bit archs with old kernels
2226- incorrect parsing of timezone offsets after overly-long zone name
2227- clock_adjtime was broken on 32-bit archs (time64)
2228- pthread_kill as not async-signal-safe
2229- pthread_cancel was not async-cancel-safe
2230- large-ulp errors in various math functions in non-default rounding modes
2231
2232arch-specific bugs fixed:
2233- arm clock_gettime was broken on some hw due to bad time64 vdso
2234- m68k sqrtl lacked long double precision
2235- mips* syscall mechanism regressions on older kernels
2236- mips* had negated error codes for some syscalls (kernel bug)
2237- mips* SIGEMT was wrongly called SIGSTKFLT
2238- sh fesetround didn't work correctly on sh
2239
2240
2241
22421.2.2 release notes
2243
2244major changes:
2245- child restrictions lifted after fork of multithreaded parent
2246
2247new features:
2248- _Fork function (POSIX-future)
2249- reallocarray function (extension from OpenBSD, now widespread)
2250- gettid function (kernel tid as supported concept)
2251- SIGEV_THREAD_ID sigevent API (Linux extension)
2252- tcgetwinsize and tcsetwinsize functions (POSIX-future)
2253
2254performance:
2255- faster software sqrt on archs without native sqrt instruction
2256
2257compatibility:
2258- realpath no longer depends on procfs availability & accuracy
2259- time zone parser now always prefers 64-bit tables if present
2260- crypt_blowfish now supports $2b$ prefix
2261- res_query now reports errors via h_errno
2262- set*id and setrlimit are now safe in vforked/cloned child
2263- setgroups now applies to all threads
2264- dlopen debugger notification is improved, should work with lldb
2265- setrlimit no longer needs __synccall broadcast on linux 2.6.36+
2266- faccessat with AT_EACCESS no longer needs child process on linux 5.8+
2267
2268bugs fixed:
2269- buffer overflow and infinite loop errors in wcsnrtombs (CVE-2020-28928)
2270- sem_close unmapped still-referenced semaphores
2271- fork of process with active aio could deadlock or crash paren
2272- pthread_cond_wait was broken with priority-inheritance mutex
2273- getgrouplist wrongly failed when nscd reported an empty list
2274- abort could leak modified SIGABRT disposition to fork or posix_spawn child
2275- regression with mallocng: malloc_usable_size(0) crashed
2276- readlink wrongly gave EINVAL on zero length dest buffer
2277- sqrtl was severely inaccurate (not correctly rounded) on ldquad archs
2278- assert failure wrongly flushed stdio (possible deadlock)
2279- MUSL_LOCPATH search was broken with multiple components
2280- missing newline in herror output
2281- possible deadlock in pthread_exit with pshared mutex or barrier usage
2282- pthread_mutexattr_getprotocol didn't read back protocol
2283- v4l2 ioctl translation for pre-time64 kernels didn't work
2284
2285arch-specific bugs fixed:
2286- x86_64 longjmp failed to handle 0 argument reliably
2287- i386 __set_thread_area fallback for pre-2.6 kernels didn't work
2288- missing O_LARGEFILE macro value on x86_64, x32, mips64
2289- unpredictable s390x breakage from failure to preserve call-saved registers
lib/libc/wasi/libc-top-half/musl/arch/aarch64/atomic_arch.h deleted-82
...@@ -1,82 +0,0 @@
1#define a_ll a_ll
2static inline int a_ll(volatile int *p)
3{
4 int v;
5 __asm__ __volatile__ ("ldaxr %w0,%1" : "=r"(v) : "Q"(*p));
6 return v;
7}
8
9#define a_sc a_sc
10static inline int a_sc(volatile int *p, int v)
11{
12 int r;
13 __asm__ __volatile__ ("stlxr %w0,%w2,%1" : "=&r"(r), "=Q"(*p) : "r"(v) : "memory");
14 return !r;
15}
16
17#define a_barrier a_barrier
18static inline void a_barrier()
19{
20 __asm__ __volatile__ ("dmb ish" : : : "memory");
21}
22
23#define a_cas a_cas
24static inline int a_cas(volatile int *p, int t, int s)
25{
26 int old;
27 do {
28 old = a_ll(p);
29 if (old != t) {
30 a_barrier();
31 break;
32 }
33 } while (!a_sc(p, s));
34 return old;
35}
36
37#define a_ll_p a_ll_p
38static inline void *a_ll_p(volatile void *p)
39{
40 void *v;
41 __asm__ __volatile__ ("ldaxr %0, %1" : "=r"(v) : "Q"(*(void *volatile *)p));
42 return v;
43}
44
45#define a_sc_p a_sc_p
46static inline int a_sc_p(volatile int *p, void *v)
47{
48 int r;
49 __asm__ __volatile__ ("stlxr %w0,%2,%1" : "=&r"(r), "=Q"(*(void *volatile *)p) : "r"(v) : "memory");
50 return !r;
51}
52
53#define a_cas_p a_cas_p
54static inline void *a_cas_p(volatile void *p, void *t, void *s)
55{
56 void *old;
57 do {
58 old = a_ll_p(p);
59 if (old != t) {
60 a_barrier();
61 break;
62 }
63 } while (!a_sc_p(p, s));
64 return old;
65}
66
67#define a_ctz_64 a_ctz_64
68static inline int a_ctz_64(uint64_t x)
69{
70 __asm__(
71 " rbit %0, %1\n"
72 " clz %0, %0\n"
73 : "=r"(x) : "r"(x));
74 return x;
75}
76
77#define a_clz_64 a_clz_64
78static inline int a_clz_64(uint64_t x)
79{
80 __asm__("clz %0, %1" : "=r"(x) : "r"(x));
81 return x;
82}
lib/libc/wasi/libc-top-half/musl/arch/aarch64/bits/alltypes.h.in deleted-24
...@@ -1,24 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#if __AARCH64EB__
6#define __BYTE_ORDER 4321
7#else
8#define __BYTE_ORDER 1234
9#endif
10
11#define __LONG_MAX 0x7fffffffffffffffL
12
13#ifndef __cplusplus
14TYPEDEF unsigned wchar_t;
15#endif
16TYPEDEF unsigned wint_t;
17
18TYPEDEF int blksize_t;
19TYPEDEF unsigned int nlink_t;
20
21TYPEDEF float float_t;
22TYPEDEF double double_t;
23
24TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/aarch64/bits/fcntl.h deleted-38
...@@ -1,38 +0,0 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0200000
16#define O_LARGEFILE 0400000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020040000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27#define F_GETLK 5
28#define F_SETLK 6
29#define F_SETLKW 7
30#define F_SETOWN 8
31#define F_GETOWN 9
32#define F_SETSIG 10
33#define F_GETSIG 11
34
35#define F_SETOWN_EX 15
36#define F_GETOWN_EX 16
37
38#define F_GETOWNER_UIDS 17
lib/libc/wasi/libc-top-half/musl/arch/aarch64/bits/fenv.h deleted-19
...@@ -1,19 +0,0 @@
1#define FE_INVALID 1
2#define FE_DIVBYZERO 2
3#define FE_OVERFLOW 4
4#define FE_UNDERFLOW 8
5#define FE_INEXACT 16
6#define FE_ALL_EXCEPT 31
7#define FE_TONEAREST 0
8#define FE_DOWNWARD 0x800000
9#define FE_UPWARD 0x400000
10#define FE_TOWARDZERO 0xc00000
11
12typedef unsigned int fexcept_t;
13
14typedef struct {
15 unsigned int __fpcr;
16 unsigned int __fpsr;
17} fenv_t;
18
19#define FE_DFL_ENV ((const fenv_t *) -1)
lib/libc/wasi/libc-top-half/musl/arch/aarch64/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
4#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
5#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
6#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
7
8#define LDBL_MANT_DIG 113
9#define LDBL_MIN_EXP (-16381)
10#define LDBL_MAX_EXP 16384
11
12#define LDBL_DIG 33
13#define LDBL_MIN_10_EXP (-4931)
14#define LDBL_MAX_10_EXP 4932
15
16#define DECIMAL_DIG 36
lib/libc/wasi/libc-top-half/musl/arch/aarch64/bits/hwcap.h deleted-50
...@@ -1,50 +0,0 @@
1#define HWCAP_FP (1 << 0)
2#define HWCAP_ASIMD (1 << 1)
3#define HWCAP_EVTSTRM (1 << 2)
4#define HWCAP_AES (1 << 3)
5#define HWCAP_PMULL (1 << 4)
6#define HWCAP_SHA1 (1 << 5)
7#define HWCAP_SHA2 (1 << 6)
8#define HWCAP_CRC32 (1 << 7)
9#define HWCAP_ATOMICS (1 << 8)
10#define HWCAP_FPHP (1 << 9)
11#define HWCAP_ASIMDHP (1 << 10)
12#define HWCAP_CPUID (1 << 11)
13#define HWCAP_ASIMDRDM (1 << 12)
14#define HWCAP_JSCVT (1 << 13)
15#define HWCAP_FCMA (1 << 14)
16#define HWCAP_LRCPC (1 << 15)
17#define HWCAP_DCPOP (1 << 16)
18#define HWCAP_SHA3 (1 << 17)
19#define HWCAP_SM3 (1 << 18)
20#define HWCAP_SM4 (1 << 19)
21#define HWCAP_ASIMDDP (1 << 20)
22#define HWCAP_SHA512 (1 << 21)
23#define HWCAP_SVE (1 << 22)
24#define HWCAP_ASIMDFHM (1 << 23)
25#define HWCAP_DIT (1 << 24)
26#define HWCAP_USCAT (1 << 25)
27#define HWCAP_ILRCPC (1 << 26)
28#define HWCAP_FLAGM (1 << 27)
29#define HWCAP_SSBS (1 << 28)
30#define HWCAP_SB (1 << 29)
31#define HWCAP_PACA (1 << 30)
32#define HWCAP_PACG (1UL << 31)
33
34#define HWCAP2_DCPODP (1 << 0)
35#define HWCAP2_SVE2 (1 << 1)
36#define HWCAP2_SVEAES (1 << 2)
37#define HWCAP2_SVEPMULL (1 << 3)
38#define HWCAP2_SVEBITPERM (1 << 4)
39#define HWCAP2_SVESHA3 (1 << 5)
40#define HWCAP2_SVESM4 (1 << 6)
41#define HWCAP2_FLAGM2 (1 << 7)
42#define HWCAP2_FRINT (1 << 8)
43#define HWCAP2_SVEI8MM (1 << 9)
44#define HWCAP2_SVEF32MM (1 << 10)
45#define HWCAP2_SVEF64MM (1 << 11)
46#define HWCAP2_SVEBF16 (1 << 12)
47#define HWCAP2_I8MM (1 << 13)
48#define HWCAP2_BF16 (1 << 14)
49#define HWCAP2_DGH (1 << 15)
50#define HWCAP2_RNG (1 << 16)
lib/libc/wasi/libc-top-half/musl/arch/aarch64/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_LP64_OFF64 1
2#define _POSIX_V7_LP64_OFF64 1
lib/libc/wasi/libc-top-half/musl/arch/aarch64/bits/reg.h deleted-2
...@@ -1,2 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
lib/libc/wasi/libc-top-half/musl/arch/aarch64/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long __jmp_buf[22];
lib/libc/wasi/libc-top-half/musl/arch/aarch64/bits/signal.h deleted-153
...@@ -1,153 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 6144
6#define SIGSTKSZ 12288
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10typedef unsigned long greg_t;
11typedef unsigned long gregset_t[34];
12
13typedef struct {
14 __uint128_t vregs[32];
15 unsigned int fpsr;
16 unsigned int fpcr;
17} fpregset_t;
18typedef struct sigcontext {
19 unsigned long fault_address;
20 unsigned long regs[31];
21 unsigned long sp, pc, pstate;
22 long double __reserved[256];
23} mcontext_t;
24
25#define FPSIMD_MAGIC 0x46508001
26#define ESR_MAGIC 0x45535201
27#define EXTRA_MAGIC 0x45585401
28#define SVE_MAGIC 0x53564501
29struct _aarch64_ctx {
30 unsigned int magic;
31 unsigned int size;
32};
33struct fpsimd_context {
34 struct _aarch64_ctx head;
35 unsigned int fpsr;
36 unsigned int fpcr;
37 __uint128_t vregs[32];
38};
39struct esr_context {
40 struct _aarch64_ctx head;
41 unsigned long esr;
42};
43struct extra_context {
44 struct _aarch64_ctx head;
45 unsigned long datap;
46 unsigned int size;
47 unsigned int __reserved[3];
48};
49struct sve_context {
50 struct _aarch64_ctx head;
51 unsigned short vl;
52 unsigned short __reserved[3];
53};
54#define SVE_VQ_BYTES 16
55#define SVE_VQ_MIN 1
56#define SVE_VQ_MAX 512
57#define SVE_VL_MIN (SVE_VQ_MIN * SVE_VQ_BYTES)
58#define SVE_VL_MAX (SVE_VQ_MAX * SVE_VQ_BYTES)
59#define SVE_NUM_ZREGS 32
60#define SVE_NUM_PREGS 16
61#define sve_vl_valid(vl) \
62 ((vl) % SVE_VQ_BYTES == 0 && (vl) >= SVE_VL_MIN && (vl) <= SVE_VL_MAX)
63#define sve_vq_from_vl(vl) ((vl) / SVE_VQ_BYTES)
64#define sve_vl_from_vq(vq) ((vq) * SVE_VQ_BYTES)
65#define SVE_SIG_ZREG_SIZE(vq) ((unsigned)(vq) * SVE_VQ_BYTES)
66#define SVE_SIG_PREG_SIZE(vq) ((unsigned)(vq) * (SVE_VQ_BYTES / 8))
67#define SVE_SIG_FFR_SIZE(vq) SVE_SIG_PREG_SIZE(vq)
68#define SVE_SIG_REGS_OFFSET \
69 ((sizeof(struct sve_context) + (SVE_VQ_BYTES - 1)) \
70 / SVE_VQ_BYTES * SVE_VQ_BYTES)
71#define SVE_SIG_ZREGS_OFFSET SVE_SIG_REGS_OFFSET
72#define SVE_SIG_ZREG_OFFSET(vq, n) \
73 (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREG_SIZE(vq) * (n))
74#define SVE_SIG_ZREGS_SIZE(vq) \
75 (SVE_SIG_ZREG_OFFSET(vq, SVE_NUM_ZREGS) - SVE_SIG_ZREGS_OFFSET)
76#define SVE_SIG_PREGS_OFFSET(vq) \
77 (SVE_SIG_ZREGS_OFFSET + SVE_SIG_ZREGS_SIZE(vq))
78#define SVE_SIG_PREG_OFFSET(vq, n) \
79 (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREG_SIZE(vq) * (n))
80#define SVE_SIG_PREGS_SIZE(vq) \
81 (SVE_SIG_PREG_OFFSET(vq, SVE_NUM_PREGS) - SVE_SIG_PREGS_OFFSET(vq))
82#define SVE_SIG_FFR_OFFSET(vq) \
83 (SVE_SIG_PREGS_OFFSET(vq) + SVE_SIG_PREGS_SIZE(vq))
84#define SVE_SIG_REGS_SIZE(vq) \
85 (SVE_SIG_FFR_OFFSET(vq) + SVE_SIG_FFR_SIZE(vq) - SVE_SIG_REGS_OFFSET)
86#define SVE_SIG_CONTEXT_SIZE(vq) (SVE_SIG_REGS_OFFSET + SVE_SIG_REGS_SIZE(vq))
87#else
88typedef struct {
89 long double __regs[18+256];
90} mcontext_t;
91#endif
92
93struct sigaltstack {
94 void *ss_sp;
95 int ss_flags;
96 size_t ss_size;
97};
98
99typedef struct __ucontext {
100 unsigned long uc_flags;
101 struct __ucontext *uc_link;
102 stack_t uc_stack;
103 sigset_t uc_sigmask;
104 mcontext_t uc_mcontext;
105} ucontext_t;
106
107#define SA_NOCLDSTOP 1
108#define SA_NOCLDWAIT 2
109#define SA_SIGINFO 4
110#define SA_ONSTACK 0x08000000
111#define SA_RESTART 0x10000000
112#define SA_NODEFER 0x40000000
113#define SA_RESETHAND 0x80000000
114#define SA_RESTORER 0x04000000
115
116#endif
117
118#define SIGHUP 1
119#define SIGINT 2
120#define SIGQUIT 3
121#define SIGILL 4
122#define SIGTRAP 5
123#define SIGABRT 6
124#define SIGIOT SIGABRT
125#define SIGBUS 7
126#define SIGFPE 8
127#define SIGKILL 9
128#define SIGUSR1 10
129#define SIGSEGV 11
130#define SIGUSR2 12
131#define SIGPIPE 13
132#define SIGALRM 14
133#define SIGTERM 15
134#define SIGSTKFLT 16
135#define SIGCHLD 17
136#define SIGCONT 18
137#define SIGSTOP 19
138#define SIGTSTP 20
139#define SIGTTIN 21
140#define SIGTTOU 22
141#define SIGURG 23
142#define SIGXCPU 24
143#define SIGXFSZ 25
144#define SIGVTALRM 26
145#define SIGPROF 27
146#define SIGWINCH 28
147#define SIGIO 29
148#define SIGPOLL 29
149#define SIGPWR 30
150#define SIGSYS 31
151#define SIGUNUSED SIGSYS
152
153#define _NSIG 65
lib/libc/wasi/libc-top-half/musl/arch/aarch64/bits/stat.h deleted-18
...@@ -1,18 +0,0 @@
1struct stat {
2 dev_t st_dev;
3 ino_t st_ino;
4 mode_t st_mode;
5 nlink_t st_nlink;
6 uid_t st_uid;
7 gid_t st_gid;
8 dev_t st_rdev;
9 unsigned long __pad;
10 off_t st_size;
11 blksize_t st_blksize;
12 int __pad2;
13 blkcnt_t st_blocks;
14 struct timespec st_atim;
15 struct timespec st_mtim;
16 struct timespec st_ctim;
17 unsigned __unused[2];
18};
lib/libc/wasi/libc-top-half/musl/arch/aarch64/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT64_MIN
16#define INTPTR_MAX INT64_MAX
17#define UINTPTR_MAX UINT64_MAX
18#define PTRDIFF_MIN INT64_MIN
19#define PTRDIFF_MAX INT64_MAX
20#define SIZE_MAX UINT64_MAX
lib/libc/wasi/libc-top-half/musl/arch/aarch64/bits/syscall.h.in deleted-296
...@@ -1,296 +0,0 @@
1#define __NR_io_setup 0
2#define __NR_io_destroy 1
3#define __NR_io_submit 2
4#define __NR_io_cancel 3
5#define __NR_io_getevents 4
6#define __NR_setxattr 5
7#define __NR_lsetxattr 6
8#define __NR_fsetxattr 7
9#define __NR_getxattr 8
10#define __NR_lgetxattr 9
11#define __NR_fgetxattr 10
12#define __NR_listxattr 11
13#define __NR_llistxattr 12
14#define __NR_flistxattr 13
15#define __NR_removexattr 14
16#define __NR_lremovexattr 15
17#define __NR_fremovexattr 16
18#define __NR_getcwd 17
19#define __NR_lookup_dcookie 18
20#define __NR_eventfd2 19
21#define __NR_epoll_create1 20
22#define __NR_epoll_ctl 21
23#define __NR_epoll_pwait 22
24#define __NR_dup 23
25#define __NR_dup3 24
26#define __NR_fcntl 25
27#define __NR_inotify_init1 26
28#define __NR_inotify_add_watch 27
29#define __NR_inotify_rm_watch 28
30#define __NR_ioctl 29
31#define __NR_ioprio_set 30
32#define __NR_ioprio_get 31
33#define __NR_flock 32
34#define __NR_mknodat 33
35#define __NR_mkdirat 34
36#define __NR_unlinkat 35
37#define __NR_symlinkat 36
38#define __NR_linkat 37
39#define __NR_renameat 38
40#define __NR_umount2 39
41#define __NR_mount 40
42#define __NR_pivot_root 41
43#define __NR_nfsservctl 42
44#define __NR_statfs 43
45#define __NR_fstatfs 44
46#define __NR_truncate 45
47#define __NR_ftruncate 46
48#define __NR_fallocate 47
49#define __NR_faccessat 48
50#define __NR_chdir 49
51#define __NR_fchdir 50
52#define __NR_chroot 51
53#define __NR_fchmod 52
54#define __NR_fchmodat 53
55#define __NR_fchownat 54
56#define __NR_fchown 55
57#define __NR_openat 56
58#define __NR_close 57
59#define __NR_vhangup 58
60#define __NR_pipe2 59
61#define __NR_quotactl 60
62#define __NR_getdents64 61
63#define __NR_lseek 62
64#define __NR_read 63
65#define __NR_write 64
66#define __NR_readv 65
67#define __NR_writev 66
68#define __NR_pread64 67
69#define __NR_pwrite64 68
70#define __NR_preadv 69
71#define __NR_pwritev 70
72#define __NR_sendfile 71
73#define __NR_pselect6 72
74#define __NR_ppoll 73
75#define __NR_signalfd4 74
76#define __NR_vmsplice 75
77#define __NR_splice 76
78#define __NR_tee 77
79#define __NR_readlinkat 78
80#define __NR_newfstatat 79
81#define __NR_fstat 80
82#define __NR_sync 81
83#define __NR_fsync 82
84#define __NR_fdatasync 83
85#define __NR_sync_file_range 84
86#define __NR_timerfd_create 85
87#define __NR_timerfd_settime 86
88#define __NR_timerfd_gettime 87
89#define __NR_utimensat 88
90#define __NR_acct 89
91#define __NR_capget 90
92#define __NR_capset 91
93#define __NR_personality 92
94#define __NR_exit 93
95#define __NR_exit_group 94
96#define __NR_waitid 95
97#define __NR_set_tid_address 96
98#define __NR_unshare 97
99#define __NR_futex 98
100#define __NR_set_robust_list 99
101#define __NR_get_robust_list 100
102#define __NR_nanosleep 101
103#define __NR_getitimer 102
104#define __NR_setitimer 103
105#define __NR_kexec_load 104
106#define __NR_init_module 105
107#define __NR_delete_module 106
108#define __NR_timer_create 107
109#define __NR_timer_gettime 108
110#define __NR_timer_getoverrun 109
111#define __NR_timer_settime 110
112#define __NR_timer_delete 111
113#define __NR_clock_settime 112
114#define __NR_clock_gettime 113
115#define __NR_clock_getres 114
116#define __NR_clock_nanosleep 115
117#define __NR_syslog 116
118#define __NR_ptrace 117
119#define __NR_sched_setparam 118
120#define __NR_sched_setscheduler 119
121#define __NR_sched_getscheduler 120
122#define __NR_sched_getparam 121
123#define __NR_sched_setaffinity 122
124#define __NR_sched_getaffinity 123
125#define __NR_sched_yield 124
126#define __NR_sched_get_priority_max 125
127#define __NR_sched_get_priority_min 126
128#define __NR_sched_rr_get_interval 127
129#define __NR_restart_syscall 128
130#define __NR_kill 129
131#define __NR_tkill 130
132#define __NR_tgkill 131
133#define __NR_sigaltstack 132
134#define __NR_rt_sigsuspend 133
135#define __NR_rt_sigaction 134
136#define __NR_rt_sigprocmask 135
137#define __NR_rt_sigpending 136
138#define __NR_rt_sigtimedwait 137
139#define __NR_rt_sigqueueinfo 138
140#define __NR_rt_sigreturn 139
141#define __NR_setpriority 140
142#define __NR_getpriority 141
143#define __NR_reboot 142
144#define __NR_setregid 143
145#define __NR_setgid 144
146#define __NR_setreuid 145
147#define __NR_setuid 146
148#define __NR_setresuid 147
149#define __NR_getresuid 148
150#define __NR_setresgid 149
151#define __NR_getresgid 150
152#define __NR_setfsuid 151
153#define __NR_setfsgid 152
154#define __NR_times 153
155#define __NR_setpgid 154
156#define __NR_getpgid 155
157#define __NR_getsid 156
158#define __NR_setsid 157
159#define __NR_getgroups 158
160#define __NR_setgroups 159
161#define __NR_uname 160
162#define __NR_sethostname 161
163#define __NR_setdomainname 162
164#define __NR_getrlimit 163
165#define __NR_setrlimit 164
166#define __NR_getrusage 165
167#define __NR_umask 166
168#define __NR_prctl 167
169#define __NR_getcpu 168
170#define __NR_gettimeofday 169
171#define __NR_settimeofday 170
172#define __NR_adjtimex 171
173#define __NR_getpid 172
174#define __NR_getppid 173
175#define __NR_getuid 174
176#define __NR_geteuid 175
177#define __NR_getgid 176
178#define __NR_getegid 177
179#define __NR_gettid 178
180#define __NR_sysinfo 179
181#define __NR_mq_open 180
182#define __NR_mq_unlink 181
183#define __NR_mq_timedsend 182
184#define __NR_mq_timedreceive 183
185#define __NR_mq_notify 184
186#define __NR_mq_getsetattr 185
187#define __NR_msgget 186
188#define __NR_msgctl 187
189#define __NR_msgrcv 188
190#define __NR_msgsnd 189
191#define __NR_semget 190
192#define __NR_semctl 191
193#define __NR_semtimedop 192
194#define __NR_semop 193
195#define __NR_shmget 194
196#define __NR_shmctl 195
197#define __NR_shmat 196
198#define __NR_shmdt 197
199#define __NR_socket 198
200#define __NR_socketpair 199
201#define __NR_bind 200
202#define __NR_listen 201
203#define __NR_accept 202
204#define __NR_connect 203
205#define __NR_getsockname 204
206#define __NR_getpeername 205
207#define __NR_sendto 206
208#define __NR_recvfrom 207
209#define __NR_setsockopt 208
210#define __NR_getsockopt 209
211#define __NR_shutdown 210
212#define __NR_sendmsg 211
213#define __NR_recvmsg 212
214#define __NR_readahead 213
215#define __NR_brk 214
216#define __NR_munmap 215
217#define __NR_mremap 216
218#define __NR_add_key 217
219#define __NR_request_key 218
220#define __NR_keyctl 219
221#define __NR_clone 220
222#define __NR_execve 221
223#define __NR_mmap 222
224#define __NR_fadvise64 223
225#define __NR_swapon 224
226#define __NR_swapoff 225
227#define __NR_mprotect 226
228#define __NR_msync 227
229#define __NR_mlock 228
230#define __NR_munlock 229
231#define __NR_mlockall 230
232#define __NR_munlockall 231
233#define __NR_mincore 232
234#define __NR_madvise 233
235#define __NR_remap_file_pages 234
236#define __NR_mbind 235
237#define __NR_get_mempolicy 236
238#define __NR_set_mempolicy 237
239#define __NR_migrate_pages 238
240#define __NR_move_pages 239
241#define __NR_rt_tgsigqueueinfo 240
242#define __NR_perf_event_open 241
243#define __NR_accept4 242
244#define __NR_recvmmsg 243
245#define __NR_wait4 260
246#define __NR_prlimit64 261
247#define __NR_fanotify_init 262
248#define __NR_fanotify_mark 263
249#define __NR_name_to_handle_at 264
250#define __NR_open_by_handle_at 265
251#define __NR_clock_adjtime 266
252#define __NR_syncfs 267
253#define __NR_setns 268
254#define __NR_sendmmsg 269
255#define __NR_process_vm_readv 270
256#define __NR_process_vm_writev 271
257#define __NR_kcmp 272
258#define __NR_finit_module 273
259#define __NR_sched_setattr 274
260#define __NR_sched_getattr 275
261#define __NR_renameat2 276
262#define __NR_seccomp 277
263#define __NR_getrandom 278
264#define __NR_memfd_create 279
265#define __NR_bpf 280
266#define __NR_execveat 281
267#define __NR_userfaultfd 282
268#define __NR_membarrier 283
269#define __NR_mlock2 284
270#define __NR_copy_file_range 285
271#define __NR_preadv2 286
272#define __NR_pwritev2 287
273#define __NR_pkey_mprotect 288
274#define __NR_pkey_alloc 289
275#define __NR_pkey_free 290
276#define __NR_statx 291
277#define __NR_io_pgetevents 292
278#define __NR_rseq 293
279#define __NR_kexec_file_load 294
280#define __NR_pidfd_send_signal 424
281#define __NR_io_uring_setup 425
282#define __NR_io_uring_enter 426
283#define __NR_io_uring_register 427
284#define __NR_open_tree 428
285#define __NR_move_mount 429
286#define __NR_fsopen 430
287#define __NR_fsconfig 431
288#define __NR_fsmount 432
289#define __NR_fspick 433
290#define __NR_pidfd_open 434
291#define __NR_clone3 435
292#define __NR_close_range 436
293#define __NR_openat2 437
294#define __NR_pidfd_getfd 438
295#define __NR_faccessat2 439
296
lib/libc/wasi/libc-top-half/musl/arch/aarch64/bits/user.h deleted-16
...@@ -1,16 +0,0 @@
1struct user_regs_struct {
2 unsigned long long regs[31];
3 unsigned long long sp;
4 unsigned long long pc;
5 unsigned long long pstate;
6};
7
8struct user_fpsimd_struct {
9 __uint128_t vregs[32];
10 unsigned int fpsr;
11 unsigned int fpcr;
12};
13
14#define ELF_NREG 34
15typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NREG];
16typedef struct user_fpsimd_struct elf_fpregset_t;
lib/libc/wasi/libc-top-half/musl/arch/aarch64/crt_arch.h deleted-15
...@@ -1,15 +0,0 @@
1__asm__(
2".text \n"
3".global " START "\n"
4".type " START ",%function\n"
5START ":\n"
6" mov x29, #0\n"
7" mov x30, #0\n"
8" mov x0, sp\n"
9".weak _DYNAMIC\n"
10".hidden _DYNAMIC\n"
11" adrp x1, _DYNAMIC\n"
12" add x1, x1, #:lo12:_DYNAMIC\n"
13" and sp, x0, #-16\n"
14" b " START "_c\n"
15);
lib/libc/wasi/libc-top-half/musl/arch/aarch64/fp_arch.h deleted-25
...@@ -1,25 +0,0 @@
1#define fp_barrierf fp_barrierf
2static inline float fp_barrierf(float x)
3{
4 __asm__ __volatile__ ("" : "+w"(x));
5 return x;
6}
7
8#define fp_barrier fp_barrier
9static inline double fp_barrier(double x)
10{
11 __asm__ __volatile__ ("" : "+w"(x));
12 return x;
13}
14
15#define fp_force_evalf fp_force_evalf
16static inline void fp_force_evalf(float x)
17{
18 __asm__ __volatile__ ("" : "+w"(x));
19}
20
21#define fp_force_eval fp_force_eval
22static inline void fp_force_eval(double x)
23{
24 __asm__ __volatile__ ("" : "+w"(x));
25}
lib/libc/wasi/libc-top-half/musl/arch/aarch64/kstat.h deleted-21
...@@ -1,21 +0,0 @@
1struct kstat {
2 dev_t st_dev;
3 ino_t st_ino;
4 mode_t st_mode;
5 nlink_t st_nlink;
6 uid_t st_uid;
7 gid_t st_gid;
8 dev_t st_rdev;
9 unsigned long __pad;
10 off_t st_size;
11 blksize_t st_blksize;
12 int __pad2;
13 blkcnt_t st_blocks;
14 long st_atime_sec;
15 long st_atime_nsec;
16 long st_mtime_sec;
17 long st_mtime_nsec;
18 long st_ctime_sec;
19 long st_ctime_nsec;
20 unsigned __unused[2];
21};
lib/libc/wasi/libc-top-half/musl/arch/aarch64/pthread_arch.h deleted-11
...@@ -1,11 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3 uintptr_t tp;
4 __asm__ ("mrs %0,tpidr_el0" : "=r"(tp));
5 return tp;
6}
7
8#define TLS_ABOVE_TP
9#define GAP_ABOVE_TP 16
10
11#define MC_PC pc
lib/libc/wasi/libc-top-half/musl/arch/aarch64/reloc.h deleted-24
...@@ -1,24 +0,0 @@
1#if __BYTE_ORDER == __BIG_ENDIAN
2#define ENDIAN_SUFFIX "_be"
3#else
4#define ENDIAN_SUFFIX ""
5#endif
6
7#define LDSO_ARCH "aarch64" ENDIAN_SUFFIX
8
9#define NO_LEGACY_INITFINI
10
11#define TPOFF_K 0
12
13#define REL_SYMBOLIC R_AARCH64_ABS64
14#define REL_GOT R_AARCH64_GLOB_DAT
15#define REL_PLT R_AARCH64_JUMP_SLOT
16#define REL_RELATIVE R_AARCH64_RELATIVE
17#define REL_COPY R_AARCH64_COPY
18#define REL_DTPMOD R_AARCH64_TLS_DTPMOD64
19#define REL_DTPOFF R_AARCH64_TLS_DTPREL64
20#define REL_TPOFF R_AARCH64_TLS_TPREL64
21#define REL_TLSDESC R_AARCH64_TLSDESC
22
23#define CRTJMP(pc,sp) __asm__ __volatile__( \
24 "mov sp,%1 ; br %0" : : "r"(pc), "r"(sp) : "memory" )
lib/libc/wasi/libc-top-half/musl/arch/aarch64/syscall_arch.h deleted-78
...@@ -1,78 +0,0 @@
1#define __SYSCALL_LL_E(x) (x)
2#define __SYSCALL_LL_O(x) (x)
3
4#define __asm_syscall(...) do { \
5 __asm__ __volatile__ ( "svc 0" \
6 : "=r"(x0) : __VA_ARGS__ : "memory", "cc"); \
7 return x0; \
8 } while (0)
9
10static inline long __syscall0(long n)
11{
12 register long x8 __asm__("x8") = n;
13 register long x0 __asm__("x0");
14 __asm_syscall("r"(x8));
15}
16
17static inline long __syscall1(long n, long a)
18{
19 register long x8 __asm__("x8") = n;
20 register long x0 __asm__("x0") = a;
21 __asm_syscall("r"(x8), "0"(x0));
22}
23
24static inline long __syscall2(long n, long a, long b)
25{
26 register long x8 __asm__("x8") = n;
27 register long x0 __asm__("x0") = a;
28 register long x1 __asm__("x1") = b;
29 __asm_syscall("r"(x8), "0"(x0), "r"(x1));
30}
31
32static inline long __syscall3(long n, long a, long b, long c)
33{
34 register long x8 __asm__("x8") = n;
35 register long x0 __asm__("x0") = a;
36 register long x1 __asm__("x1") = b;
37 register long x2 __asm__("x2") = c;
38 __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2));
39}
40
41static inline long __syscall4(long n, long a, long b, long c, long d)
42{
43 register long x8 __asm__("x8") = n;
44 register long x0 __asm__("x0") = a;
45 register long x1 __asm__("x1") = b;
46 register long x2 __asm__("x2") = c;
47 register long x3 __asm__("x3") = d;
48 __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3));
49}
50
51static inline long __syscall5(long n, long a, long b, long c, long d, long e)
52{
53 register long x8 __asm__("x8") = n;
54 register long x0 __asm__("x0") = a;
55 register long x1 __asm__("x1") = b;
56 register long x2 __asm__("x2") = c;
57 register long x3 __asm__("x3") = d;
58 register long x4 __asm__("x4") = e;
59 __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4));
60}
61
62static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
63{
64 register long x8 __asm__("x8") = n;
65 register long x0 __asm__("x0") = a;
66 register long x1 __asm__("x1") = b;
67 register long x2 __asm__("x2") = c;
68 register long x3 __asm__("x3") = d;
69 register long x4 __asm__("x4") = e;
70 register long x5 __asm__("x5") = f;
71 __asm_syscall("r"(x8), "0"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x5));
72}
73
74#define VDSO_USEFUL
75#define VDSO_CGT_SYM "__kernel_clock_gettime"
76#define VDSO_CGT_VER "LINUX_2.6.39"
77
78#define IPC_64 0
lib/libc/wasi/libc-top-half/musl/arch/arm/arch.mak deleted-1
...@@ -1 +0,0 @@
1COMPAT_SRC_DIRS = compat/time32
lib/libc/wasi/libc-top-half/musl/arch/arm/atomic_arch.h deleted-107
...@@ -1,107 +0,0 @@
1#include "libc.h"
2
3#if __ARM_ARCH_4__ || __ARM_ARCH_4T__ || __ARM_ARCH == 4
4#define BLX "mov lr,pc\n\tbx"
5#else
6#define BLX "blx"
7#endif
8
9extern hidden uintptr_t __a_cas_ptr, __a_barrier_ptr;
10
11#if ((__ARM_ARCH_6__ || __ARM_ARCH_6K__ || __ARM_ARCH_6KZ__ || __ARM_ARCH_6ZK__) && !__thumb__) \
12 || __ARM_ARCH_6T2__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
13
14#define a_ll a_ll
15static inline int a_ll(volatile int *p)
16{
17 int v;
18 __asm__ __volatile__ ("ldrex %0, %1" : "=r"(v) : "Q"(*p));
19 return v;
20}
21
22#define a_sc a_sc
23static inline int a_sc(volatile int *p, int v)
24{
25 int r;
26 __asm__ __volatile__ ("strex %0,%2,%1" : "=&r"(r), "=Q"(*p) : "r"(v) : "memory");
27 return !r;
28}
29
30#if __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
31
32#define a_barrier a_barrier
33static inline void a_barrier()
34{
35 __asm__ __volatile__ ("dmb ish" : : : "memory");
36}
37
38#endif
39
40#define a_pre_llsc a_barrier
41#define a_post_llsc a_barrier
42
43#else
44
45#define a_cas a_cas
46static inline int a_cas(volatile int *p, int t, int s)
47{
48 for (;;) {
49 register int r0 __asm__("r0") = t;
50 register int r1 __asm__("r1") = s;
51 register volatile int *r2 __asm__("r2") = p;
52 register uintptr_t r3 __asm__("r3") = __a_cas_ptr;
53 int old;
54 __asm__ __volatile__ (
55 BLX " r3"
56 : "+r"(r0), "+r"(r3) : "r"(r1), "r"(r2)
57 : "memory", "lr", "ip", "cc" );
58 if (!r0) return t;
59 if ((old=*p)!=t) return old;
60 }
61}
62
63#endif
64
65#ifndef a_barrier
66#define a_barrier a_barrier
67static inline void a_barrier()
68{
69 register uintptr_t ip __asm__("ip") = __a_barrier_ptr;
70 __asm__ __volatile__( BLX " ip" : "+r"(ip) : : "memory", "cc", "lr" );
71}
72#endif
73
74#define a_crash a_crash
75static inline void a_crash()
76{
77 __asm__ __volatile__(
78#ifndef __thumb__
79 ".word 0xe7f000f0"
80#else
81 ".short 0xdeff"
82#endif
83 : : : "memory");
84}
85
86#if __ARM_ARCH >= 5 && (!__thumb__ || __thumb2__)
87
88#define a_clz_32 a_clz_32
89static inline int a_clz_32(uint32_t x)
90{
91 __asm__ ("clz %0, %1" : "=r"(x) : "r"(x));
92 return x;
93}
94
95#if __ARM_ARCH_6T2__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
96
97#define a_ctz_32 a_ctz_32
98static inline int a_ctz_32(uint32_t x)
99{
100 uint32_t xr;
101 __asm__ ("rbit %0, %1" : "=r"(xr) : "r"(x));
102 return a_clz_32(xr);
103}
104
105#endif
106
107#endif
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/alltypes.h.in deleted-21
...@@ -1,21 +0,0 @@
1#define _REDIR_TIME64 1
2#define _Addr int
3#define _Int64 long long
4#define _Reg int
5
6#if __ARMEB__
7#define __BYTE_ORDER 4321
8#else
9#define __BYTE_ORDER 1234
10#endif
11
12#define __LONG_MAX 0x7fffffffL
13
14#ifndef __cplusplus
15TYPEDEF unsigned wchar_t;
16#endif
17
18TYPEDEF float float_t;
19TYPEDEF double double_t;
20
21TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0200000
16#define O_LARGEFILE 0400000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020040000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 8
29#define F_GETOWN 9
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 12
34#define F_SETLK 13
35#define F_SETLKW 14
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/fenv.h deleted-23
...@@ -1,23 +0,0 @@
1#ifndef __ARM_PCS_VFP
2#define FE_ALL_EXCEPT 0
3#define FE_TONEAREST 0
4#else
5#define FE_INVALID 1
6#define FE_DIVBYZERO 2
7#define FE_OVERFLOW 4
8#define FE_UNDERFLOW 8
9#define FE_INEXACT 16
10#define FE_ALL_EXCEPT 31
11#define FE_TONEAREST 0
12#define FE_DOWNWARD 0x800000
13#define FE_UPWARD 0x400000
14#define FE_TOWARDZERO 0xc00000
15#endif
16
17typedef unsigned long fexcept_t;
18
19typedef struct {
20 unsigned long __cw;
21} fenv_t;
22
23#define FE_DFL_ENV ((const fenv_t *) -1)
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
4#define LDBL_MIN 2.22507385850720138309e-308L
5#define LDBL_MAX 1.79769313486231570815e+308L
6#define LDBL_EPSILON 2.22044604925031308085e-16L
7
8#define LDBL_MANT_DIG 53
9#define LDBL_MIN_EXP (-1021)
10#define LDBL_MAX_EXP 1024
11
12#define LDBL_DIG 15
13#define LDBL_MIN_10_EXP (-307)
14#define LDBL_MAX_10_EXP 308
15
16#define DECIMAL_DIG 17
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/hwcap.h deleted-53
...@@ -1,53 +0,0 @@
1#define HWCAP_SWP (1 << 0)
2#define HWCAP_HALF (1 << 1)
3#define HWCAP_THUMB (1 << 2)
4#define HWCAP_26BIT (1 << 3)
5#define HWCAP_FAST_MULT (1 << 4)
6#define HWCAP_FPA (1 << 5)
7#define HWCAP_VFP (1 << 6)
8#define HWCAP_EDSP (1 << 7)
9#define HWCAP_JAVA (1 << 8)
10#define HWCAP_IWMMXT (1 << 9)
11#define HWCAP_CRUNCH (1 << 10)
12#define HWCAP_THUMBEE (1 << 11)
13#define HWCAP_NEON (1 << 12)
14#define HWCAP_VFPv3 (1 << 13)
15#define HWCAP_VFPv3D16 (1 << 14)
16#define HWCAP_TLS (1 << 15)
17#define HWCAP_VFPv4 (1 << 16)
18#define HWCAP_IDIVA (1 << 17)
19#define HWCAP_IDIVT (1 << 18)
20#define HWCAP_VFPD32 (1 << 19)
21#define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT)
22#define HWCAP_LPAE (1 << 20)
23#define HWCAP_EVTSTRM (1 << 21)
24
25#define HWCAP2_AES (1 << 0)
26#define HWCAP2_PMULL (1 << 1)
27#define HWCAP2_SHA1 (1 << 2)
28#define HWCAP2_SHA2 (1 << 3)
29#define HWCAP2_CRC32 (1 << 4)
30
31#define HWCAP_ARM_SWP (1 << 0)
32#define HWCAP_ARM_HALF (1 << 1)
33#define HWCAP_ARM_THUMB (1 << 2)
34#define HWCAP_ARM_26BIT (1 << 3)
35#define HWCAP_ARM_FAST_MULT (1 << 4)
36#define HWCAP_ARM_FPA (1 << 5)
37#define HWCAP_ARM_VFP (1 << 6)
38#define HWCAP_ARM_EDSP (1 << 7)
39#define HWCAP_ARM_JAVA (1 << 8)
40#define HWCAP_ARM_IWMMXT (1 << 9)
41#define HWCAP_ARM_CRUNCH (1 << 10)
42#define HWCAP_ARM_THUMBEE (1 << 11)
43#define HWCAP_ARM_NEON (1 << 12)
44#define HWCAP_ARM_VFPv3 (1 << 13)
45#define HWCAP_ARM_VFPv3D16 (1 << 14)
46#define HWCAP_ARM_TLS (1 << 15)
47#define HWCAP_ARM_VFPv4 (1 << 16)
48#define HWCAP_ARM_IDIVA (1 << 17)
49#define HWCAP_ARM_IDIVT (1 << 18)
50#define HWCAP_ARM_VFPD32 (1 << 19)
51#define HWCAP_ARM_IDIV (HWCAP_ARM_IDIVA | HWCAP_ARM_IDIVT)
52#define HWCAP_ARM_LPAE (1 << 20)
53#define HWCAP_ARM_EVTSTRM (1 << 21)
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/ioctl_fix.h deleted-2
...@@ -1,2 +0,0 @@
1#undef FIOQSIZE
2#define FIOQSIZE 0x545e
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/ipcstat.h deleted-1
...@@ -1 +0,0 @@
1#define IPC_STAT 0x102
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/msg.h deleted-18
...@@ -1,18 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 unsigned long __msg_stime_lo;
4 unsigned long __msg_stime_hi;
5 unsigned long __msg_rtime_lo;
6 unsigned long __msg_rtime_hi;
7 unsigned long __msg_ctime_lo;
8 unsigned long __msg_ctime_hi;
9 unsigned long msg_cbytes;
10 msgqnum_t msg_qnum;
11 msglen_t msg_qbytes;
12 pid_t msg_lspid;
13 pid_t msg_lrpid;
14 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
18};
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_ILP32_OFFBIG 1
2#define _POSIX_V7_ILP32_OFFBIG 1
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/ptrace.h deleted-25
...@@ -1,25 +0,0 @@
1#define PTRACE_GETWMMXREGS 18
2#define PTRACE_SETWMMXREGS 19
3#define PTRACE_GET_THREAD_AREA 22
4#define PTRACE_SET_SYSCALL 23
5#define PTRACE_GETCRUNCHREGS 25
6#define PTRACE_SETCRUNCHREGS 26
7#define PTRACE_GETVFPREGS 27
8#define PTRACE_SETVFPREGS 28
9#define PTRACE_GETHBPREGS 29
10#define PTRACE_SETHBPREGS 30
11#define PTRACE_GETFDPIC 31
12#define PTRACE_GETFDPIC_EXEC 0
13#define PTRACE_GETFDPIC_INTERP 1
14
15#define PT_GETWMMXREGS PTRACE_GETWMMXREGS
16#define PT_SETWMMXREGS PTRACE_SETWMMXREGS
17#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
18#define PT_SET_SYSCALL PTRACE_SET_SYSCALL
19#define PT_GETCRUNCHREGS PTRACE_GETCRUNCHREGS
20#define PT_SETCRUNCHREGS PTRACE_SETCRUNCHREGS
21#define PT_GETVFPREGS PTRACE_GETVFPREGS
22#define PT_SETVFPREGS PTRACE_SETVFPREGS
23#define PT_GETHBPREGS PTRACE_GETHBPREGS
24#define PT_SETHBPREGS PTRACE_SETHBPREGS
25#define PT_GETFDPIC PTRACE_GETFDPIC
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/reg.h deleted-3
...@@ -1,3 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3/* FIXME */
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/sem.h deleted-18
...@@ -1,18 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_otime_hi;
5 unsigned long __sem_ctime_lo;
6 unsigned long __sem_ctime_hi;
7#if __BYTE_ORDER == __LITTLE_ENDIAN
8 unsigned short sem_nsems;
9 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
10#else
11 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
12 unsigned short sem_nsems;
13#endif
14 long __unused3;
15 long __unused4;
16 time_t sem_otime;
17 time_t sem_ctime;
18};
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long long __jmp_buf[32];
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/shm.h deleted-31
...@@ -1,31 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_atime_hi;
8 unsigned long __shm_dtime_lo;
9 unsigned long __shm_dtime_hi;
10 unsigned long __shm_ctime_lo;
11 unsigned long __shm_ctime_hi;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17 unsigned long __pad3;
18 time_t shm_atime;
19 time_t shm_dtime;
20 time_t shm_ctime;
21};
22
23struct shminfo {
24 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
25};
26
27struct shm_info {
28 int __used_ids;
29 unsigned long shm_tot, shm_rss, shm_swp;
30 unsigned long __swap_attempts, __swap_successes;
31};
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/signal.h deleted-86
...@@ -1,86 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10typedef int greg_t, gregset_t[18];
11typedef struct sigcontext {
12 unsigned long trap_no, error_code, oldmask;
13 unsigned long arm_r0, arm_r1, arm_r2, arm_r3;
14 unsigned long arm_r4, arm_r5, arm_r6, arm_r7;
15 unsigned long arm_r8, arm_r9, arm_r10, arm_fp;
16 unsigned long arm_ip, arm_sp, arm_lr, arm_pc;
17 unsigned long arm_cpsr, fault_address;
18} mcontext_t;
19#else
20typedef struct {
21 unsigned long __regs[21];
22} mcontext_t;
23#endif
24
25struct sigaltstack {
26 void *ss_sp;
27 int ss_flags;
28 size_t ss_size;
29};
30
31typedef struct __ucontext {
32 unsigned long uc_flags;
33 struct __ucontext *uc_link;
34 stack_t uc_stack;
35 mcontext_t uc_mcontext;
36 sigset_t uc_sigmask;
37 unsigned long long uc_regspace[64];
38} ucontext_t;
39
40#define SA_NOCLDSTOP 1
41#define SA_NOCLDWAIT 2
42#define SA_SIGINFO 4
43#define SA_ONSTACK 0x08000000
44#define SA_RESTART 0x10000000
45#define SA_NODEFER 0x40000000
46#define SA_RESETHAND 0x80000000
47#define SA_RESTORER 0x04000000
48
49#endif
50
51#define SIGHUP 1
52#define SIGINT 2
53#define SIGQUIT 3
54#define SIGILL 4
55#define SIGTRAP 5
56#define SIGABRT 6
57#define SIGIOT SIGABRT
58#define SIGBUS 7
59#define SIGFPE 8
60#define SIGKILL 9
61#define SIGUSR1 10
62#define SIGSEGV 11
63#define SIGUSR2 12
64#define SIGPIPE 13
65#define SIGALRM 14
66#define SIGTERM 15
67#define SIGSTKFLT 16
68#define SIGCHLD 17
69#define SIGCONT 18
70#define SIGSTOP 19
71#define SIGTSTP 20
72#define SIGTTIN 21
73#define SIGTTOU 22
74#define SIGURG 23
75#define SIGXCPU 24
76#define SIGXFSZ 25
77#define SIGVTALRM 26
78#define SIGPROF 27
79#define SIGWINCH 28
80#define SIGIO 29
81#define SIGPOLL 29
82#define SIGPWR 30
83#define SIGSYS 31
84#define SIGUNUSED SIGSYS
85
86#define _NSIG 65
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/stat.h deleted-25
...@@ -1,25 +0,0 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3
4struct stat {
5 dev_t st_dev;
6 int __st_dev_padding;
7 long __st_ino_truncated;
8 mode_t st_mode;
9 nlink_t st_nlink;
10 uid_t st_uid;
11 gid_t st_gid;
12 dev_t st_rdev;
13 int __st_rdev_padding;
14 off_t st_size;
15 blksize_t st_blksize;
16 blkcnt_t st_blocks;
17 struct {
18 long tv_sec;
19 long tv_nsec;
20 } __st_atim32, __st_mtim32, __st_ctim32;
21 ino_t st_ino;
22 struct timespec st_atim;
23 struct timespec st_mtim;
24 struct timespec st_ctim;
25};
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT32_MIN
16#define INTPTR_MAX INT32_MAX
17#define UINTPTR_MAX UINT32_MAX
18#define PTRDIFF_MIN INT32_MIN
19#define PTRDIFF_MAX INT32_MAX
20#define SIZE_MAX UINT32_MAX
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/syscall.h.in deleted-403
...@@ -1,403 +0,0 @@
1#define __NR_restart_syscall 0
2#define __NR_exit 1
3#define __NR_fork 2
4#define __NR_read 3
5#define __NR_write 4
6#define __NR_open 5
7#define __NR_close 6
8#define __NR_creat 8
9#define __NR_link 9
10#define __NR_unlink 10
11#define __NR_execve 11
12#define __NR_chdir 12
13#define __NR_mknod 14
14#define __NR_chmod 15
15#define __NR_lchown 16
16#define __NR_lseek 19
17#define __NR_getpid 20
18#define __NR_mount 21
19#define __NR_setuid 23
20#define __NR_getuid 24
21#define __NR_ptrace 26
22#define __NR_pause 29
23#define __NR_access 33
24#define __NR_nice 34
25#define __NR_sync 36
26#define __NR_kill 37
27#define __NR_rename 38
28#define __NR_mkdir 39
29#define __NR_rmdir 40
30#define __NR_dup 41
31#define __NR_pipe 42
32#define __NR_times 43
33#define __NR_brk 45
34#define __NR_setgid 46
35#define __NR_getgid 47
36#define __NR_geteuid 49
37#define __NR_getegid 50
38#define __NR_acct 51
39#define __NR_umount2 52
40#define __NR_ioctl 54
41#define __NR_fcntl 55
42#define __NR_setpgid 57
43#define __NR_umask 60
44#define __NR_chroot 61
45#define __NR_ustat 62
46#define __NR_dup2 63
47#define __NR_getppid 64
48#define __NR_getpgrp 65
49#define __NR_setsid 66
50#define __NR_sigaction 67
51#define __NR_setreuid 70
52#define __NR_setregid 71
53#define __NR_sigsuspend 72
54#define __NR_sigpending 73
55#define __NR_sethostname 74
56#define __NR_setrlimit 75
57#define __NR_getrusage 77
58#define __NR_gettimeofday_time32 78
59#define __NR_settimeofday_time32 79
60#define __NR_getgroups 80
61#define __NR_setgroups 81
62#define __NR_symlink 83
63#define __NR_readlink 85
64#define __NR_uselib 86
65#define __NR_swapon 87
66#define __NR_reboot 88
67#define __NR_munmap 91
68#define __NR_truncate 92
69#define __NR_ftruncate 93
70#define __NR_fchmod 94
71#define __NR_fchown 95
72#define __NR_getpriority 96
73#define __NR_setpriority 97
74#define __NR_statfs 99
75#define __NR_fstatfs 100
76#define __NR_syslog 103
77#define __NR_setitimer 104
78#define __NR_getitimer 105
79#define __NR_stat 106
80#define __NR_lstat 107
81#define __NR_fstat 108
82#define __NR_vhangup 111
83#define __NR_wait4 114
84#define __NR_swapoff 115
85#define __NR_sysinfo 116
86#define __NR_fsync 118
87#define __NR_sigreturn 119
88#define __NR_clone 120
89#define __NR_setdomainname 121
90#define __NR_uname 122
91#define __NR_adjtimex 124
92#define __NR_mprotect 125
93#define __NR_sigprocmask 126
94#define __NR_init_module 128
95#define __NR_delete_module 129
96#define __NR_quotactl 131
97#define __NR_getpgid 132
98#define __NR_fchdir 133
99#define __NR_bdflush 134
100#define __NR_sysfs 135
101#define __NR_personality 136
102#define __NR_setfsuid 138
103#define __NR_setfsgid 139
104#define __NR__llseek 140
105#define __NR_getdents 141
106#define __NR__newselect 142
107#define __NR_flock 143
108#define __NR_msync 144
109#define __NR_readv 145
110#define __NR_writev 146
111#define __NR_getsid 147
112#define __NR_fdatasync 148
113#define __NR__sysctl 149
114#define __NR_mlock 150
115#define __NR_munlock 151
116#define __NR_mlockall 152
117#define __NR_munlockall 153
118#define __NR_sched_setparam 154
119#define __NR_sched_getparam 155
120#define __NR_sched_setscheduler 156
121#define __NR_sched_getscheduler 157
122#define __NR_sched_yield 158
123#define __NR_sched_get_priority_max 159
124#define __NR_sched_get_priority_min 160
125#define __NR_sched_rr_get_interval 161
126#define __NR_nanosleep 162
127#define __NR_mremap 163
128#define __NR_setresuid 164
129#define __NR_getresuid 165
130#define __NR_poll 168
131#define __NR_nfsservctl 169
132#define __NR_setresgid 170
133#define __NR_getresgid 171
134#define __NR_prctl 172
135#define __NR_rt_sigreturn 173
136#define __NR_rt_sigaction 174
137#define __NR_rt_sigprocmask 175
138#define __NR_rt_sigpending 176
139#define __NR_rt_sigtimedwait 177
140#define __NR_rt_sigqueueinfo 178
141#define __NR_rt_sigsuspend 179
142#define __NR_pread64 180
143#define __NR_pwrite64 181
144#define __NR_chown 182
145#define __NR_getcwd 183
146#define __NR_capget 184
147#define __NR_capset 185
148#define __NR_sigaltstack 186
149#define __NR_sendfile 187
150#define __NR_vfork 190
151#define __NR_ugetrlimit 191
152#define __NR_mmap2 192
153#define __NR_truncate64 193
154#define __NR_ftruncate64 194
155#define __NR_stat64 195
156#define __NR_lstat64 196
157#define __NR_fstat64 197
158#define __NR_lchown32 198
159#define __NR_getuid32 199
160#define __NR_getgid32 200
161#define __NR_geteuid32 201
162#define __NR_getegid32 202
163#define __NR_setreuid32 203
164#define __NR_setregid32 204
165#define __NR_getgroups32 205
166#define __NR_setgroups32 206
167#define __NR_fchown32 207
168#define __NR_setresuid32 208
169#define __NR_getresuid32 209
170#define __NR_setresgid32 210
171#define __NR_getresgid32 211
172#define __NR_chown32 212
173#define __NR_setuid32 213
174#define __NR_setgid32 214
175#define __NR_setfsuid32 215
176#define __NR_setfsgid32 216
177#define __NR_getdents64 217
178#define __NR_pivot_root 218
179#define __NR_mincore 219
180#define __NR_madvise 220
181#define __NR_fcntl64 221
182#define __NR_gettid 224
183#define __NR_readahead 225
184#define __NR_setxattr 226
185#define __NR_lsetxattr 227
186#define __NR_fsetxattr 228
187#define __NR_getxattr 229
188#define __NR_lgetxattr 230
189#define __NR_fgetxattr 231
190#define __NR_listxattr 232
191#define __NR_llistxattr 233
192#define __NR_flistxattr 234
193#define __NR_removexattr 235
194#define __NR_lremovexattr 236
195#define __NR_fremovexattr 237
196#define __NR_tkill 238
197#define __NR_sendfile64 239
198#define __NR_futex 240
199#define __NR_sched_setaffinity 241
200#define __NR_sched_getaffinity 242
201#define __NR_io_setup 243
202#define __NR_io_destroy 244
203#define __NR_io_getevents 245
204#define __NR_io_submit 246
205#define __NR_io_cancel 247
206#define __NR_exit_group 248
207#define __NR_lookup_dcookie 249
208#define __NR_epoll_create 250
209#define __NR_epoll_ctl 251
210#define __NR_epoll_wait 252
211#define __NR_remap_file_pages 253
212#define __NR_set_tid_address 256
213#define __NR_timer_create 257
214#define __NR_timer_settime32 258
215#define __NR_timer_gettime32 259
216#define __NR_timer_getoverrun 260
217#define __NR_timer_delete 261
218#define __NR_clock_settime32 262
219#define __NR_clock_gettime32 263
220#define __NR_clock_getres_time32 264
221#define __NR_clock_nanosleep_time32 265
222#define __NR_statfs64 266
223#define __NR_fstatfs64 267
224#define __NR_tgkill 268
225#define __NR_utimes 269
226#define __NR_fadvise64_64 270
227#define __NR_arm_fadvise64_64 270
228#define __NR_pciconfig_iobase 271
229#define __NR_pciconfig_read 272
230#define __NR_pciconfig_write 273
231#define __NR_mq_open 274
232#define __NR_mq_unlink 275
233#define __NR_mq_timedsend 276
234#define __NR_mq_timedreceive 277
235#define __NR_mq_notify 278
236#define __NR_mq_getsetattr 279
237#define __NR_waitid 280
238#define __NR_socket 281
239#define __NR_bind 282
240#define __NR_connect 283
241#define __NR_listen 284
242#define __NR_accept 285
243#define __NR_getsockname 286
244#define __NR_getpeername 287
245#define __NR_socketpair 288
246#define __NR_send 289
247#define __NR_sendto 290
248#define __NR_recv 291
249#define __NR_recvfrom 292
250#define __NR_shutdown 293
251#define __NR_setsockopt 294
252#define __NR_getsockopt 295
253#define __NR_sendmsg 296
254#define __NR_recvmsg 297
255#define __NR_semop 298
256#define __NR_semget 299
257#define __NR_semctl 300
258#define __NR_msgsnd 301
259#define __NR_msgrcv 302
260#define __NR_msgget 303
261#define __NR_msgctl 304
262#define __NR_shmat 305
263#define __NR_shmdt 306
264#define __NR_shmget 307
265#define __NR_shmctl 308
266#define __NR_add_key 309
267#define __NR_request_key 310
268#define __NR_keyctl 311
269#define __NR_semtimedop 312
270#define __NR_vserver 313
271#define __NR_ioprio_set 314
272#define __NR_ioprio_get 315
273#define __NR_inotify_init 316
274#define __NR_inotify_add_watch 317
275#define __NR_inotify_rm_watch 318
276#define __NR_mbind 319
277#define __NR_get_mempolicy 320
278#define __NR_set_mempolicy 321
279#define __NR_openat 322
280#define __NR_mkdirat 323
281#define __NR_mknodat 324
282#define __NR_fchownat 325
283#define __NR_futimesat 326
284#define __NR_fstatat64 327
285#define __NR_unlinkat 328
286#define __NR_renameat 329
287#define __NR_linkat 330
288#define __NR_symlinkat 331
289#define __NR_readlinkat 332
290#define __NR_fchmodat 333
291#define __NR_faccessat 334
292#define __NR_pselect6 335
293#define __NR_ppoll 336
294#define __NR_unshare 337
295#define __NR_set_robust_list 338
296#define __NR_get_robust_list 339
297#define __NR_splice 340
298#define __NR_sync_file_range2 341
299#define __NR_arm_sync_file_range 341
300#define __NR_tee 342
301#define __NR_vmsplice 343
302#define __NR_move_pages 344
303#define __NR_getcpu 345
304#define __NR_epoll_pwait 346
305#define __NR_kexec_load 347
306#define __NR_utimensat 348
307#define __NR_signalfd 349
308#define __NR_timerfd_create 350
309#define __NR_eventfd 351
310#define __NR_fallocate 352
311#define __NR_timerfd_settime32 353
312#define __NR_timerfd_gettime32 354
313#define __NR_signalfd4 355
314#define __NR_eventfd2 356
315#define __NR_epoll_create1 357
316#define __NR_dup3 358
317#define __NR_pipe2 359
318#define __NR_inotify_init1 360
319#define __NR_preadv 361
320#define __NR_pwritev 362
321#define __NR_rt_tgsigqueueinfo 363
322#define __NR_perf_event_open 364
323#define __NR_recvmmsg 365
324#define __NR_accept4 366
325#define __NR_fanotify_init 367
326#define __NR_fanotify_mark 368
327#define __NR_prlimit64 369
328#define __NR_name_to_handle_at 370
329#define __NR_open_by_handle_at 371
330#define __NR_clock_adjtime 372
331#define __NR_syncfs 373
332#define __NR_sendmmsg 374
333#define __NR_setns 375
334#define __NR_process_vm_readv 376
335#define __NR_process_vm_writev 377
336#define __NR_kcmp 378
337#define __NR_finit_module 379
338#define __NR_sched_setattr 380
339#define __NR_sched_getattr 381
340#define __NR_renameat2 382
341#define __NR_seccomp 383
342#define __NR_getrandom 384
343#define __NR_memfd_create 385
344#define __NR_bpf 386
345#define __NR_execveat 387
346#define __NR_userfaultfd 388
347#define __NR_membarrier 389
348#define __NR_mlock2 390
349#define __NR_copy_file_range 391
350#define __NR_preadv2 392
351#define __NR_pwritev2 393
352#define __NR_pkey_mprotect 394
353#define __NR_pkey_alloc 395
354#define __NR_pkey_free 396
355#define __NR_statx 397
356#define __NR_rseq 398
357#define __NR_io_pgetevents 399
358#define __NR_migrate_pages 400
359#define __NR_kexec_file_load 401
360#define __NR_clock_gettime64 403
361#define __NR_clock_settime64 404
362#define __NR_clock_adjtime64 405
363#define __NR_clock_getres_time64 406
364#define __NR_clock_nanosleep_time64 407
365#define __NR_timer_gettime64 408
366#define __NR_timer_settime64 409
367#define __NR_timerfd_gettime64 410
368#define __NR_timerfd_settime64 411
369#define __NR_utimensat_time64 412
370#define __NR_pselect6_time64 413
371#define __NR_ppoll_time64 414
372#define __NR_io_pgetevents_time64 416
373#define __NR_recvmmsg_time64 417
374#define __NR_mq_timedsend_time64 418
375#define __NR_mq_timedreceive_time64 419
376#define __NR_semtimedop_time64 420
377#define __NR_rt_sigtimedwait_time64 421
378#define __NR_futex_time64 422
379#define __NR_sched_rr_get_interval_time64 423
380#define __NR_pidfd_send_signal 424
381#define __NR_io_uring_setup 425
382#define __NR_io_uring_enter 426
383#define __NR_io_uring_register 427
384#define __NR_open_tree 428
385#define __NR_move_mount 429
386#define __NR_fsopen 430
387#define __NR_fsconfig 431
388#define __NR_fsmount 432
389#define __NR_fspick 433
390#define __NR_pidfd_open 434
391#define __NR_clone3 435
392#define __NR_close_range 436
393#define __NR_openat2 437
394#define __NR_pidfd_getfd 438
395#define __NR_faccessat2 439
396
397#define __ARM_NR_breakpoint 0x0f0001
398#define __ARM_NR_cacheflush 0x0f0002
399#define __ARM_NR_usr26 0x0f0003
400#define __ARM_NR_usr32 0x0f0004
401#define __ARM_NR_set_tls 0x0f0005
402#define __ARM_NR_get_tls 0x0f0006
403
lib/libc/wasi/libc-top-half/musl/arch/arm/bits/user.h deleted-36
...@@ -1,36 +0,0 @@
1typedef struct user_fpregs {
2 struct fp_reg {
3 unsigned sign1:1;
4 unsigned unused:15;
5 unsigned sign2:1;
6 unsigned exponent:14;
7 unsigned j:1;
8 unsigned mantissa1:31;
9 unsigned mantissa0:32;
10 } fpregs[8];
11 unsigned fpsr:32;
12 unsigned fpcr:32;
13 unsigned char ftype[8];
14 unsigned int init_flag;
15} elf_fpregset_t;
16
17struct user_regs {
18 unsigned long uregs[18];
19};
20#define ELF_NGREG 18
21typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
22
23struct user {
24 struct user_regs regs;
25 int u_fpvalid;
26 unsigned long u_tsize, u_dsize, u_ssize;
27 unsigned long start_code, start_stack;
28 long signal;
29 int reserved;
30 struct user_regs *u_ar0;
31 unsigned long magic;
32 char u_comm[32];
33 int u_debugreg[8];
34 struct user_fpregs u_fp;
35 struct user_fpregs *u_fp0;
36};
lib/libc/wasi/libc-top-half/musl/arch/arm/crt_arch.h deleted-18
...@@ -1,18 +0,0 @@
1__asm__(
2".text \n"
3".global " START " \n"
4".type " START ",%function \n"
5START ": \n"
6" mov fp, #0 \n"
7" mov lr, #0 \n"
8" ldr a2, 1f \n"
9" add a2, pc, a2 \n"
10" mov a1, sp \n"
11"2: and ip, a1, #-16 \n"
12" mov sp, ip \n"
13" bl " START "_c \n"
14".weak _DYNAMIC \n"
15".hidden _DYNAMIC \n"
16".align 2 \n"
17"1: .word _DYNAMIC-2b \n"
18);
lib/libc/wasi/libc-top-half/musl/arch/arm/kstat.h deleted-21
...@@ -1,21 +0,0 @@
1struct kstat {
2 dev_t st_dev;
3 int __st_dev_padding;
4 long __st_ino_truncated;
5 mode_t st_mode;
6 nlink_t st_nlink;
7 uid_t st_uid;
8 gid_t st_gid;
9 dev_t st_rdev;
10 int __st_rdev_padding;
11 off_t st_size;
12 blksize_t st_blksize;
13 blkcnt_t st_blocks;
14 long st_atime_sec;
15 long st_atime_nsec;
16 long st_mtime_sec;
17 long st_mtime_nsec;
18 long st_ctime_sec;
19 long st_ctime_nsec;
20 ino_t st_ino;
21};
lib/libc/wasi/libc-top-half/musl/arch/arm/pthread_arch.h deleted-32
...@@ -1,32 +0,0 @@
1#if ((__ARM_ARCH_6K__ || __ARM_ARCH_6KZ__ || __ARM_ARCH_6ZK__) && !__thumb__) \
2 || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH >= 7
3
4static inline uintptr_t __get_tp()
5{
6 uintptr_t tp;
7 __asm__ ( "mrc p15,0,%0,c13,c0,3" : "=r"(tp) );
8 return tp;
9}
10
11#else
12
13#if __ARM_ARCH_4__ || __ARM_ARCH_4T__ || __ARM_ARCH == 4
14#define BLX "mov lr,pc\n\tbx"
15#else
16#define BLX "blx"
17#endif
18
19static inline uintptr_t __get_tp()
20{
21 extern hidden uintptr_t __a_gettp_ptr;
22 register uintptr_t tp __asm__("r0");
23 __asm__ ( BLX " %1" : "=r"(tp) : "r"(__a_gettp_ptr) : "cc", "lr" );
24 return tp;
25}
26
27#endif
28
29#define TLS_ABOVE_TP
30#define GAP_ABOVE_TP 8
31
32#define MC_PC arm_pc
lib/libc/wasi/libc-top-half/musl/arch/arm/reloc.h deleted-32
...@@ -1,32 +0,0 @@
1#if __BYTE_ORDER == __BIG_ENDIAN
2#define ENDIAN_SUFFIX "eb"
3#else
4#define ENDIAN_SUFFIX ""
5#endif
6
7#if __ARM_PCS_VFP
8#define FP_SUFFIX "hf"
9#else
10#define FP_SUFFIX ""
11#endif
12
13#define LDSO_ARCH "arm" ENDIAN_SUFFIX FP_SUFFIX
14
15#define NO_LEGACY_INITFINI
16
17#define TPOFF_K 0
18
19#define REL_SYMBOLIC R_ARM_ABS32
20#define REL_GOT R_ARM_GLOB_DAT
21#define REL_PLT R_ARM_JUMP_SLOT
22#define REL_RELATIVE R_ARM_RELATIVE
23#define REL_COPY R_ARM_COPY
24#define REL_DTPMOD R_ARM_TLS_DTPMOD32
25#define REL_DTPOFF R_ARM_TLS_DTPOFF32
26#define REL_TPOFF R_ARM_TLS_TPOFF32
27#define REL_TLSDESC R_ARM_TLS_DESC
28
29#define TLSDESC_BACKWARDS
30
31#define CRTJMP(pc,sp) __asm__ __volatile__( \
32 "mov sp,%1 ; bx %0" : : "r"(pc), "r"(sp) : "memory" )
lib/libc/wasi/libc-top-half/musl/arch/arm/syscall_arch.h deleted-103
...@@ -1,103 +0,0 @@
1#define __SYSCALL_LL_E(x) \
2((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
3((union { long long ll; long l[2]; }){ .ll = x }).l[1]
4#define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
5
6#ifdef __thumb__
7
8/* Avoid use of r7 in asm constraints when producing thumb code,
9 * since it's reserved as frame pointer and might not be supported. */
10#define __ASM____R7__
11#define __asm_syscall(...) do { \
12 __asm__ __volatile__ ( "mov %1,r7 ; mov r7,%2 ; svc 0 ; mov r7,%1" \
13 : "=r"(r0), "=&r"((int){0}) : __VA_ARGS__ : "memory"); \
14 return r0; \
15 } while (0)
16
17#else
18
19#define __ASM____R7__ __asm__("r7")
20#define __asm_syscall(...) do { \
21 __asm__ __volatile__ ( "svc 0" \
22 : "=r"(r0) : __VA_ARGS__ : "memory"); \
23 return r0; \
24 } while (0)
25#endif
26
27/* For thumb2, we can allow 8-bit immediate syscall numbers, saving a
28 * register in the above dance around r7. Does not work for thumb1 where
29 * only movs, not mov, supports immediates, and we can't use movs because
30 * it doesn't support high regs. */
31#ifdef __thumb2__
32#define R7_OPERAND "rI"(r7)
33#else
34#define R7_OPERAND "r"(r7)
35#endif
36
37static inline long __syscall0(long n)
38{
39 register long r7 __ASM____R7__ = n;
40 register long r0 __asm__("r0");
41 __asm_syscall(R7_OPERAND);
42}
43
44static inline long __syscall1(long n, long a)
45{
46 register long r7 __ASM____R7__ = n;
47 register long r0 __asm__("r0") = a;
48 __asm_syscall(R7_OPERAND, "0"(r0));
49}
50
51static inline long __syscall2(long n, long a, long b)
52{
53 register long r7 __ASM____R7__ = n;
54 register long r0 __asm__("r0") = a;
55 register long r1 __asm__("r1") = b;
56 __asm_syscall(R7_OPERAND, "0"(r0), "r"(r1));
57}
58
59static inline long __syscall3(long n, long a, long b, long c)
60{
61 register long r7 __ASM____R7__ = n;
62 register long r0 __asm__("r0") = a;
63 register long r1 __asm__("r1") = b;
64 register long r2 __asm__("r2") = c;
65 __asm_syscall(R7_OPERAND, "0"(r0), "r"(r1), "r"(r2));
66}
67
68static inline long __syscall4(long n, long a, long b, long c, long d)
69{
70 register long r7 __ASM____R7__ = n;
71 register long r0 __asm__("r0") = a;
72 register long r1 __asm__("r1") = b;
73 register long r2 __asm__("r2") = c;
74 register long r3 __asm__("r3") = d;
75 __asm_syscall(R7_OPERAND, "0"(r0), "r"(r1), "r"(r2), "r"(r3));
76}
77
78static inline long __syscall5(long n, long a, long b, long c, long d, long e)
79{
80 register long r7 __ASM____R7__ = n;
81 register long r0 __asm__("r0") = a;
82 register long r1 __asm__("r1") = b;
83 register long r2 __asm__("r2") = c;
84 register long r3 __asm__("r3") = d;
85 register long r4 __asm__("r4") = e;
86 __asm_syscall(R7_OPERAND, "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4));
87}
88
89static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
90{
91 register long r7 __ASM____R7__ = n;
92 register long r0 __asm__("r0") = a;
93 register long r1 __asm__("r1") = b;
94 register long r2 __asm__("r2") = c;
95 register long r3 __asm__("r3") = d;
96 register long r4 __asm__("r4") = e;
97 register long r5 __asm__("r5") = f;
98 __asm_syscall(R7_OPERAND, "0"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4), "r"(r5));
99}
100
101#define SYSCALL_FADVISE_6_ARG
102
103#define SYSCALL_IPC_BROKEN_MODE
lib/libc/wasi/libc-top-half/musl/arch/i386/arch.mak deleted-1
...@@ -1 +0,0 @@
1COMPAT_SRC_DIRS = compat/time32
lib/libc/wasi/libc-top-half/musl/arch/i386/atomic_arch.h deleted-108
...@@ -1,108 +0,0 @@
1#define a_cas a_cas
2static inline int a_cas(volatile int *p, int t, int s)
3{
4 __asm__ __volatile__ (
5 "lock ; cmpxchg %3, %1"
6 : "=a"(t), "=m"(*p) : "a"(t), "r"(s) : "memory" );
7 return t;
8}
9
10#define a_swap a_swap
11static inline int a_swap(volatile int *p, int v)
12{
13 __asm__ __volatile__(
14 "xchg %0, %1"
15 : "=r"(v), "=m"(*p) : "0"(v) : "memory" );
16 return v;
17}
18
19#define a_fetch_add a_fetch_add
20static inline int a_fetch_add(volatile int *p, int v)
21{
22 __asm__ __volatile__(
23 "lock ; xadd %0, %1"
24 : "=r"(v), "=m"(*p) : "0"(v) : "memory" );
25 return v;
26}
27
28#define a_and a_and
29static inline void a_and(volatile int *p, int v)
30{
31 __asm__ __volatile__(
32 "lock ; and %1, %0"
33 : "=m"(*p) : "r"(v) : "memory" );
34}
35
36#define a_or a_or
37static inline void a_or(volatile int *p, int v)
38{
39 __asm__ __volatile__(
40 "lock ; or %1, %0"
41 : "=m"(*p) : "r"(v) : "memory" );
42}
43
44#define a_inc a_inc
45static inline void a_inc(volatile int *p)
46{
47 __asm__ __volatile__(
48 "lock ; incl %0"
49 : "=m"(*p) : "m"(*p) : "memory" );
50}
51
52#define a_dec a_dec
53static inline void a_dec(volatile int *p)
54{
55 __asm__ __volatile__(
56 "lock ; decl %0"
57 : "=m"(*p) : "m"(*p) : "memory" );
58}
59
60#define a_store a_store
61static inline void a_store(volatile int *p, int x)
62{
63 __asm__ __volatile__(
64 "mov %1, %0 ; lock ; orl $0,(%%esp)"
65 : "=m"(*p) : "r"(x) : "memory" );
66}
67
68#define a_barrier a_barrier
69static inline void a_barrier()
70{
71 __asm__ __volatile__( "" : : : "memory" );
72}
73
74#define a_spin a_spin
75static inline void a_spin()
76{
77 __asm__ __volatile__( "pause" : : : "memory" );
78}
79
80#define a_crash a_crash
81static inline void a_crash()
82{
83 __asm__ __volatile__( "hlt" : : : "memory" );
84}
85
86#define a_ctz_64 a_ctz_64
87static inline int a_ctz_64(uint64_t x)
88{
89 int r;
90 __asm__( "bsf %1,%0 ; jnz 1f ; bsf %2,%0 ; add $32,%0\n1:"
91 : "=&r"(r) : "r"((unsigned)x), "r"((unsigned)(x>>32)) );
92 return r;
93}
94
95#define a_ctz_32 a_ctz_32
96static inline int a_ctz_32(uint32_t x)
97{
98 int r;
99 __asm__( "bsf %1,%0" : "=r"(r) : "r"(x) );
100 return r;
101}
102
103#define a_clz_32 a_clz_32
104static inline int a_clz_32(uint32_t x)
105{
106 __asm__( "bsr %1,%0 ; xor $31,%0" : "=r"(x) : "r"(x) );
107 return x;
108}
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/alltypes.h.in deleted-31
...@@ -1,31 +0,0 @@
1#define _REDIR_TIME64 1
2#define _Addr int
3#define _Int64 long long
4#define _Reg int
5
6#define __BYTE_ORDER 1234
7#define __LONG_MAX 0x7fffffffL
8
9#ifndef __cplusplus
10#ifdef __WCHAR_TYPE__
11TYPEDEF __WCHAR_TYPE__ wchar_t;
12#else
13TYPEDEF long wchar_t;
14#endif
15#endif
16
17#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 0
18TYPEDEF float float_t;
19TYPEDEF double double_t;
20#else
21TYPEDEF long double float_t;
22TYPEDEF long double double_t;
23#endif
24
25#if !defined(__cplusplus)
26TYPEDEF struct { _Alignas(8) long long __ll; long double __ld; } max_align_t;
27#elif defined(__GNUC__)
28TYPEDEF struct { __attribute__((__aligned__(8))) long long __ll; long double __ld; } max_align_t;
29#else
30TYPEDEF struct { alignas(8) long long __ll; long double __ld; } max_align_t;
31#endif
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/fenv.h deleted-33
...@@ -1,33 +0,0 @@
1#define FE_INVALID 1
2#define __FE_DENORM 2
3#define FE_DIVBYZERO 4
4#define FE_OVERFLOW 8
5#define FE_UNDERFLOW 16
6#define FE_INEXACT 32
7
8#define FE_ALL_EXCEPT 63
9
10#define FE_TONEAREST 0
11#define FE_DOWNWARD 0x400
12#define FE_UPWARD 0x800
13#define FE_TOWARDZERO 0xc00
14
15typedef unsigned short fexcept_t;
16
17typedef struct {
18 unsigned short __control_word;
19 unsigned short __unused1;
20 unsigned short __status_word;
21 unsigned short __unused2;
22 unsigned short __tags;
23 unsigned short __unused3;
24 unsigned int __eip;
25 unsigned short __cs_selector;
26 unsigned int __opcode:11;
27 unsigned int __unused4:5;
28 unsigned int __data_offset;
29 unsigned short __data_selector;
30 unsigned short __unused5;
31} fenv_t;
32
33#define FE_DFL_ENV ((const fenv_t *) -1)
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/float.h deleted-20
...@@ -1,20 +0,0 @@
1#ifdef __FLT_EVAL_METHOD__
2#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
3#else
4#define FLT_EVAL_METHOD 2
5#endif
6
7#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L
8#define LDBL_MIN 3.3621031431120935063e-4932L
9#define LDBL_MAX 1.1897314953572317650e+4932L
10#define LDBL_EPSILON 1.0842021724855044340e-19L
11
12#define LDBL_MANT_DIG 64
13#define LDBL_MIN_EXP (-16381)
14#define LDBL_MAX_EXP 16384
15
16#define LDBL_DIG 18
17#define LDBL_MIN_10_EXP (-4931)
18#define LDBL_MAX_10_EXP 4932
19
20#define DECIMAL_DIG 21
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/io.h deleted-77
...@@ -1,77 +0,0 @@
1static __inline void outb(unsigned char __val, unsigned short __port)
2{
3 __asm__ volatile ("outb %0,%1" : : "a" (__val), "dN" (__port));
4}
5
6static __inline void outw(unsigned short __val, unsigned short __port)
7{
8 __asm__ volatile ("outw %0,%1" : : "a" (__val), "dN" (__port));
9}
10
11static __inline void outl(unsigned int __val, unsigned short __port)
12{
13 __asm__ volatile ("outl %0,%1" : : "a" (__val), "dN" (__port));
14}
15
16static __inline unsigned char inb(unsigned short __port)
17{
18 unsigned char __val;
19 __asm__ volatile ("inb %1,%0" : "=a" (__val) : "dN" (__port));
20 return __val;
21}
22
23static __inline unsigned short inw(unsigned short __port)
24{
25 unsigned short __val;
26 __asm__ volatile ("inw %1,%0" : "=a" (__val) : "dN" (__port));
27 return __val;
28}
29
30static __inline unsigned int inl(unsigned short __port)
31{
32 unsigned int __val;
33 __asm__ volatile ("inl %1,%0" : "=a" (__val) : "dN" (__port));
34 return __val;
35}
36
37static __inline void outsb(unsigned short __port, const void *__buf, unsigned long __n)
38{
39 __asm__ volatile ("cld; rep; outsb"
40 : "+S" (__buf), "+c" (__n)
41 : "d" (__port));
42}
43
44static __inline void outsw(unsigned short __port, const void *__buf, unsigned long __n)
45{
46 __asm__ volatile ("cld; rep; outsw"
47 : "+S" (__buf), "+c" (__n)
48 : "d" (__port));
49}
50
51static __inline void outsl(unsigned short __port, const void *__buf, unsigned long __n)
52{
53 __asm__ volatile ("cld; rep; outsl"
54 : "+S" (__buf), "+c"(__n)
55 : "d" (__port));
56}
57
58static __inline void insb(unsigned short __port, void *__buf, unsigned long __n)
59{
60 __asm__ volatile ("cld; rep; insb"
61 : "+D" (__buf), "+c" (__n)
62 : "d" (__port));
63}
64
65static __inline void insw(unsigned short __port, void *__buf, unsigned long __n)
66{
67 __asm__ volatile ("cld; rep; insw"
68 : "+D" (__buf), "+c" (__n)
69 : "d" (__port));
70}
71
72static __inline void insl(unsigned short __port, void *__buf, unsigned long __n)
73{
74 __asm__ volatile ("cld; rep; insl"
75 : "+D" (__buf), "+c" (__n)
76 : "d" (__port));
77}
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/ipcstat.h deleted-1
...@@ -1 +0,0 @@
1#define IPC_STAT 0x102
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/limits.h deleted-1
...@@ -1 +0,0 @@
1#define PAGESIZE 4096
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/mman.h deleted-1
...@@ -1 +0,0 @@
1#define MAP_32BIT 0x40
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/msg.h deleted-18
...@@ -1,18 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 unsigned long __msg_stime_lo;
4 unsigned long __msg_stime_hi;
5 unsigned long __msg_rtime_lo;
6 unsigned long __msg_rtime_hi;
7 unsigned long __msg_ctime_lo;
8 unsigned long __msg_ctime_hi;
9 unsigned long msg_cbytes;
10 msgqnum_t msg_qnum;
11 msglen_t msg_qbytes;
12 pid_t msg_lspid;
13 pid_t msg_lrpid;
14 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
18};
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_ILP32_OFFBIG 1
2#define _POSIX_V7_ILP32_OFFBIG 1
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/ptrace.h deleted-11
...@@ -1,11 +0,0 @@
1#define PTRACE_GET_THREAD_AREA 25
2#define PTRACE_SET_THREAD_AREA 26
3#define PTRACE_SYSEMU 31
4#define PTRACE_SYSEMU_SINGLESTEP 32
5#define PTRACE_SINGLEBLOCK 33
6
7#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
8#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
9#define PT_SYSEMU PTRACE_SYSEMU
10#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
11#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/reg.h deleted-19
...@@ -1,19 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3#define EBX 0
4#define ECX 1
5#define EDX 2
6#define ESI 3
7#define EDI 4
8#define EBP 5
9#define EAX 6
10#define DS 7
11#define ES 8
12#define FS 9
13#define GS 10
14#define ORIG_EAX 11
15#define EIP 12
16#define CS 13
17#define EFL 14
18#define UESP 15
19#define SS 16
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/sem.h deleted-13
...@@ -1,13 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_otime_hi;
5 unsigned long __sem_ctime_lo;
6 unsigned long __sem_ctime_hi;
7 unsigned short sem_nsems;
8 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
9 long __unused3;
10 long __unused4;
11 time_t sem_otime;
12 time_t sem_ctime;
13};
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long __jmp_buf[6];
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/shm.h deleted-31
...@@ -1,31 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_atime_hi;
8 unsigned long __shm_dtime_lo;
9 unsigned long __shm_dtime_hi;
10 unsigned long __shm_ctime_lo;
11 unsigned long __shm_ctime_hi;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17 unsigned long __pad3;
18 time_t shm_atime;
19 time_t shm_dtime;
20 time_t shm_ctime;
21};
22
23struct shminfo {
24 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
25};
26
27struct shm_info {
28 int __used_ids;
29 unsigned long shm_tot, shm_rss, shm_swp;
30 unsigned long __swap_attempts, __swap_successes;
31};
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/signal.h deleted-142
...@@ -1,142 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#ifdef _GNU_SOURCE
10enum { REG_GS = 0 };
11#define REG_GS REG_GS
12enum { REG_FS = 1 };
13#define REG_FS REG_FS
14enum { REG_ES = 2 };
15#define REG_ES REG_ES
16enum { REG_DS = 3 };
17#define REG_DS REG_DS
18enum { REG_EDI = 4 };
19#define REG_EDI REG_EDI
20enum { REG_ESI = 5 };
21#define REG_ESI REG_ESI
22enum { REG_EBP = 6 };
23#define REG_EBP REG_EBP
24enum { REG_ESP = 7 };
25#define REG_ESP REG_ESP
26enum { REG_EBX = 8 };
27#define REG_EBX REG_EBX
28enum { REG_EDX = 9 };
29#define REG_EDX REG_EDX
30enum { REG_ECX = 10 };
31#define REG_ECX REG_ECX
32enum { REG_EAX = 11 };
33#define REG_EAX REG_EAX
34enum { REG_TRAPNO = 12 };
35#define REG_TRAPNO REG_TRAPNO
36enum { REG_ERR = 13 };
37#define REG_ERR REG_ERR
38enum { REG_EIP = 14 };
39#define REG_EIP REG_EIP
40enum { REG_CS = 15 };
41#define REG_CS REG_CS
42enum { REG_EFL = 16 };
43#define REG_EFL REG_EFL
44enum { REG_UESP = 17 };
45#define REG_UESP REG_UESP
46enum { REG_SS = 18 };
47#define REG_SS REG_SS
48#endif
49
50#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
51typedef int greg_t, gregset_t[19];
52typedef struct _fpstate {
53 unsigned long cw, sw, tag, ipoff, cssel, dataoff, datasel;
54 struct {
55 unsigned short significand[4], exponent;
56 } _st[8];
57 unsigned long status;
58} *fpregset_t;
59struct sigcontext {
60 unsigned short gs, __gsh, fs, __fsh, es, __esh, ds, __dsh;
61 unsigned long edi, esi, ebp, esp, ebx, edx, ecx, eax;
62 unsigned long trapno, err, eip;
63 unsigned short cs, __csh;
64 unsigned long eflags, esp_at_signal;
65 unsigned short ss, __ssh;
66 struct _fpstate *fpstate;
67 unsigned long oldmask, cr2;
68};
69typedef struct {
70 gregset_t gregs;
71 fpregset_t fpregs;
72 unsigned long oldmask, cr2;
73} mcontext_t;
74#else
75typedef struct {
76 unsigned __space[22];
77} mcontext_t;
78#endif
79
80struct sigaltstack {
81 void *ss_sp;
82 int ss_flags;
83 size_t ss_size;
84};
85
86typedef struct __ucontext {
87 unsigned long uc_flags;
88 struct __ucontext *uc_link;
89 stack_t uc_stack;
90 mcontext_t uc_mcontext;
91 sigset_t uc_sigmask;
92 unsigned long __fpregs_mem[28];
93} ucontext_t;
94
95#define SA_NOCLDSTOP 1
96#define SA_NOCLDWAIT 2
97#define SA_SIGINFO 4
98#define SA_ONSTACK 0x08000000
99#define SA_RESTART 0x10000000
100#define SA_NODEFER 0x40000000
101#define SA_RESETHAND 0x80000000
102#define SA_RESTORER 0x04000000
103
104#endif
105
106#define SIGHUP 1
107#define SIGINT 2
108#define SIGQUIT 3
109#define SIGILL 4
110#define SIGTRAP 5
111#define SIGABRT 6
112#define SIGIOT SIGABRT
113#define SIGBUS 7
114#define SIGFPE 8
115#define SIGKILL 9
116#define SIGUSR1 10
117#define SIGSEGV 11
118#define SIGUSR2 12
119#define SIGPIPE 13
120#define SIGALRM 14
121#define SIGTERM 15
122#define SIGSTKFLT 16
123#define SIGCHLD 17
124#define SIGCONT 18
125#define SIGSTOP 19
126#define SIGTSTP 20
127#define SIGTTIN 21
128#define SIGTTOU 22
129#define SIGURG 23
130#define SIGXCPU 24
131#define SIGXFSZ 25
132#define SIGVTALRM 26
133#define SIGPROF 27
134#define SIGWINCH 28
135#define SIGIO 29
136#define SIGPOLL 29
137#define SIGPWR 30
138#define SIGSYS 31
139#define SIGUNUSED SIGSYS
140
141#define _NSIG 65
142
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/stat.h deleted-25
...@@ -1,25 +0,0 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3
4struct stat {
5 dev_t st_dev;
6 int __st_dev_padding;
7 long __st_ino_truncated;
8 mode_t st_mode;
9 nlink_t st_nlink;
10 uid_t st_uid;
11 gid_t st_gid;
12 dev_t st_rdev;
13 int __st_rdev_padding;
14 off_t st_size;
15 blksize_t st_blksize;
16 blkcnt_t st_blocks;
17 struct {
18 long tv_sec;
19 long tv_nsec;
20 } __st_atim32, __st_mtim32, __st_ctim32;
21 ino_t st_ino;
22 struct timespec st_atim;
23 struct timespec st_mtim;
24 struct timespec st_ctim;
25};
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT32_MIN
16#define INTPTR_MAX INT32_MAX
17#define UINTPTR_MAX UINT32_MAX
18#define PTRDIFF_MIN INT32_MIN
19#define PTRDIFF_MAX INT32_MAX
20#define SIZE_MAX UINT32_MAX
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/syscall.h.in deleted-433
...@@ -1,433 +0,0 @@
1#define __NR_restart_syscall 0
2#define __NR_exit 1
3#define __NR_fork 2
4#define __NR_read 3
5#define __NR_write 4
6#define __NR_open 5
7#define __NR_close 6
8#define __NR_waitpid 7
9#define __NR_creat 8
10#define __NR_link 9
11#define __NR_unlink 10
12#define __NR_execve 11
13#define __NR_chdir 12
14#define __NR_time 13
15#define __NR_mknod 14
16#define __NR_chmod 15
17#define __NR_lchown 16
18#define __NR_break 17
19#define __NR_oldstat 18
20#define __NR_lseek 19
21#define __NR_getpid 20
22#define __NR_mount 21
23#define __NR_umount 22
24#define __NR_setuid 23
25#define __NR_getuid 24
26#define __NR_stime 25
27#define __NR_ptrace 26
28#define __NR_alarm 27
29#define __NR_oldfstat 28
30#define __NR_pause 29
31#define __NR_utime 30
32#define __NR_stty 31
33#define __NR_gtty 32
34#define __NR_access 33
35#define __NR_nice 34
36#define __NR_ftime 35
37#define __NR_sync 36
38#define __NR_kill 37
39#define __NR_rename 38
40#define __NR_mkdir 39
41#define __NR_rmdir 40
42#define __NR_dup 41
43#define __NR_pipe 42
44#define __NR_times 43
45#define __NR_prof 44
46#define __NR_brk 45
47#define __NR_setgid 46
48#define __NR_getgid 47
49#define __NR_signal 48
50#define __NR_geteuid 49
51#define __NR_getegid 50
52#define __NR_acct 51
53#define __NR_umount2 52
54#define __NR_lock 53
55#define __NR_ioctl 54
56#define __NR_fcntl 55
57#define __NR_mpx 56
58#define __NR_setpgid 57
59#define __NR_ulimit 58
60#define __NR_oldolduname 59
61#define __NR_umask 60
62#define __NR_chroot 61
63#define __NR_ustat 62
64#define __NR_dup2 63
65#define __NR_getppid 64
66#define __NR_getpgrp 65
67#define __NR_setsid 66
68#define __NR_sigaction 67
69#define __NR_sgetmask 68
70#define __NR_ssetmask 69
71#define __NR_setreuid 70
72#define __NR_setregid 71
73#define __NR_sigsuspend 72
74#define __NR_sigpending 73
75#define __NR_sethostname 74
76#define __NR_setrlimit 75
77#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
78#define __NR_getrusage 77
79#define __NR_gettimeofday_time32 78
80#define __NR_settimeofday_time32 79
81#define __NR_getgroups 80
82#define __NR_setgroups 81
83#define __NR_select 82
84#define __NR_symlink 83
85#define __NR_oldlstat 84
86#define __NR_readlink 85
87#define __NR_uselib 86
88#define __NR_swapon 87
89#define __NR_reboot 88
90#define __NR_readdir 89
91#define __NR_mmap 90
92#define __NR_munmap 91
93#define __NR_truncate 92
94#define __NR_ftruncate 93
95#define __NR_fchmod 94
96#define __NR_fchown 95
97#define __NR_getpriority 96
98#define __NR_setpriority 97
99#define __NR_profil 98
100#define __NR_statfs 99
101#define __NR_fstatfs 100
102#define __NR_ioperm 101
103#define __NR_socketcall 102
104#define __NR_syslog 103
105#define __NR_setitimer 104
106#define __NR_getitimer 105
107#define __NR_stat 106
108#define __NR_lstat 107
109#define __NR_fstat 108
110#define __NR_olduname 109
111#define __NR_iopl 110
112#define __NR_vhangup 111
113#define __NR_idle 112
114#define __NR_vm86old 113
115#define __NR_wait4 114
116#define __NR_swapoff 115
117#define __NR_sysinfo 116
118#define __NR_ipc 117
119#define __NR_fsync 118
120#define __NR_sigreturn 119
121#define __NR_clone 120
122#define __NR_setdomainname 121
123#define __NR_uname 122
124#define __NR_modify_ldt 123
125#define __NR_adjtimex 124
126#define __NR_mprotect 125
127#define __NR_sigprocmask 126
128#define __NR_create_module 127
129#define __NR_init_module 128
130#define __NR_delete_module 129
131#define __NR_get_kernel_syms 130
132#define __NR_quotactl 131
133#define __NR_getpgid 132
134#define __NR_fchdir 133
135#define __NR_bdflush 134
136#define __NR_sysfs 135
137#define __NR_personality 136
138#define __NR_afs_syscall 137
139#define __NR_setfsuid 138
140#define __NR_setfsgid 139
141#define __NR__llseek 140
142#define __NR_getdents 141
143#define __NR__newselect 142
144#define __NR_flock 143
145#define __NR_msync 144
146#define __NR_readv 145
147#define __NR_writev 146
148#define __NR_getsid 147
149#define __NR_fdatasync 148
150#define __NR__sysctl 149
151#define __NR_mlock 150
152#define __NR_munlock 151
153#define __NR_mlockall 152
154#define __NR_munlockall 153
155#define __NR_sched_setparam 154
156#define __NR_sched_getparam 155
157#define __NR_sched_setscheduler 156
158#define __NR_sched_getscheduler 157
159#define __NR_sched_yield 158
160#define __NR_sched_get_priority_max 159
161#define __NR_sched_get_priority_min 160
162#define __NR_sched_rr_get_interval 161
163#define __NR_nanosleep 162
164#define __NR_mremap 163
165#define __NR_setresuid 164
166#define __NR_getresuid 165
167#define __NR_vm86 166
168#define __NR_query_module 167
169#define __NR_poll 168
170#define __NR_nfsservctl 169
171#define __NR_setresgid 170
172#define __NR_getresgid 171
173#define __NR_prctl 172
174#define __NR_rt_sigreturn 173
175#define __NR_rt_sigaction 174
176#define __NR_rt_sigprocmask 175
177#define __NR_rt_sigpending 176
178#define __NR_rt_sigtimedwait 177
179#define __NR_rt_sigqueueinfo 178
180#define __NR_rt_sigsuspend 179
181#define __NR_pread64 180
182#define __NR_pwrite64 181
183#define __NR_chown 182
184#define __NR_getcwd 183
185#define __NR_capget 184
186#define __NR_capset 185
187#define __NR_sigaltstack 186
188#define __NR_sendfile 187
189#define __NR_getpmsg 188
190#define __NR_putpmsg 189
191#define __NR_vfork 190
192#define __NR_ugetrlimit 191
193#define __NR_mmap2 192
194#define __NR_truncate64 193
195#define __NR_ftruncate64 194
196#define __NR_stat64 195
197#define __NR_lstat64 196
198#define __NR_fstat64 197
199#define __NR_lchown32 198
200#define __NR_getuid32 199
201#define __NR_getgid32 200
202#define __NR_geteuid32 201
203#define __NR_getegid32 202
204#define __NR_setreuid32 203
205#define __NR_setregid32 204
206#define __NR_getgroups32 205
207#define __NR_setgroups32 206
208#define __NR_fchown32 207
209#define __NR_setresuid32 208
210#define __NR_getresuid32 209
211#define __NR_setresgid32 210
212#define __NR_getresgid32 211
213#define __NR_chown32 212
214#define __NR_setuid32 213
215#define __NR_setgid32 214
216#define __NR_setfsuid32 215
217#define __NR_setfsgid32 216
218#define __NR_pivot_root 217
219#define __NR_mincore 218
220#define __NR_madvise 219
221#define __NR_getdents64 220
222#define __NR_fcntl64 221
223/* 223 is unused */
224#define __NR_gettid 224
225#define __NR_readahead 225
226#define __NR_setxattr 226
227#define __NR_lsetxattr 227
228#define __NR_fsetxattr 228
229#define __NR_getxattr 229
230#define __NR_lgetxattr 230
231#define __NR_fgetxattr 231
232#define __NR_listxattr 232
233#define __NR_llistxattr 233
234#define __NR_flistxattr 234
235#define __NR_removexattr 235
236#define __NR_lremovexattr 236
237#define __NR_fremovexattr 237
238#define __NR_tkill 238
239#define __NR_sendfile64 239
240#define __NR_futex 240
241#define __NR_sched_setaffinity 241
242#define __NR_sched_getaffinity 242
243#define __NR_set_thread_area 243
244#define __NR_get_thread_area 244
245#define __NR_io_setup 245
246#define __NR_io_destroy 246
247#define __NR_io_getevents 247
248#define __NR_io_submit 248
249#define __NR_io_cancel 249
250#define __NR_fadvise64 250
251/* 251 is available for reuse (was briefly sys_set_zone_reclaim) */
252#define __NR_exit_group 252
253#define __NR_lookup_dcookie 253
254#define __NR_epoll_create 254
255#define __NR_epoll_ctl 255
256#define __NR_epoll_wait 256
257#define __NR_remap_file_pages 257
258#define __NR_set_tid_address 258
259#define __NR_timer_create 259
260#define __NR_timer_settime32 (__NR_timer_create+1)
261#define __NR_timer_gettime32 (__NR_timer_create+2)
262#define __NR_timer_getoverrun (__NR_timer_create+3)
263#define __NR_timer_delete (__NR_timer_create+4)
264#define __NR_clock_settime32 (__NR_timer_create+5)
265#define __NR_clock_gettime32 (__NR_timer_create+6)
266#define __NR_clock_getres_time32 (__NR_timer_create+7)
267#define __NR_clock_nanosleep_time32 (__NR_timer_create+8)
268#define __NR_statfs64 268
269#define __NR_fstatfs64 269
270#define __NR_tgkill 270
271#define __NR_utimes 271
272#define __NR_fadvise64_64 272
273#define __NR_vserver 273
274#define __NR_mbind 274
275#define __NR_get_mempolicy 275
276#define __NR_set_mempolicy 276
277#define __NR_mq_open 277
278#define __NR_mq_unlink (__NR_mq_open+1)
279#define __NR_mq_timedsend (__NR_mq_open+2)
280#define __NR_mq_timedreceive (__NR_mq_open+3)
281#define __NR_mq_notify (__NR_mq_open+4)
282#define __NR_mq_getsetattr (__NR_mq_open+5)
283#define __NR_kexec_load 283
284#define __NR_waitid 284
285/* #define __NR_sys_setaltroot 285 */
286#define __NR_add_key 286
287#define __NR_request_key 287
288#define __NR_keyctl 288
289#define __NR_ioprio_set 289
290#define __NR_ioprio_get 290
291#define __NR_inotify_init 291
292#define __NR_inotify_add_watch 292
293#define __NR_inotify_rm_watch 293
294#define __NR_migrate_pages 294
295#define __NR_openat 295
296#define __NR_mkdirat 296
297#define __NR_mknodat 297
298#define __NR_fchownat 298
299#define __NR_futimesat 299
300#define __NR_fstatat64 300
301#define __NR_unlinkat 301
302#define __NR_renameat 302
303#define __NR_linkat 303
304#define __NR_symlinkat 304
305#define __NR_readlinkat 305
306#define __NR_fchmodat 306
307#define __NR_faccessat 307
308#define __NR_pselect6 308
309#define __NR_ppoll 309
310#define __NR_unshare 310
311#define __NR_set_robust_list 311
312#define __NR_get_robust_list 312
313#define __NR_splice 313
314#define __NR_sync_file_range 314
315#define __NR_tee 315
316#define __NR_vmsplice 316
317#define __NR_move_pages 317
318#define __NR_getcpu 318
319#define __NR_epoll_pwait 319
320#define __NR_utimensat 320
321#define __NR_signalfd 321
322#define __NR_timerfd_create 322
323#define __NR_eventfd 323
324#define __NR_fallocate 324
325#define __NR_timerfd_settime32 325
326#define __NR_timerfd_gettime32 326
327#define __NR_signalfd4 327
328#define __NR_eventfd2 328
329#define __NR_epoll_create1 329
330#define __NR_dup3 330
331#define __NR_pipe2 331
332#define __NR_inotify_init1 332
333#define __NR_preadv 333
334#define __NR_pwritev 334
335#define __NR_rt_tgsigqueueinfo 335
336#define __NR_perf_event_open 336
337#define __NR_recvmmsg 337
338#define __NR_fanotify_init 338
339#define __NR_fanotify_mark 339
340#define __NR_prlimit64 340
341#define __NR_name_to_handle_at 341
342#define __NR_open_by_handle_at 342
343#define __NR_clock_adjtime 343
344#define __NR_syncfs 344
345#define __NR_sendmmsg 345
346#define __NR_setns 346
347#define __NR_process_vm_readv 347
348#define __NR_process_vm_writev 348
349#define __NR_kcmp 349
350#define __NR_finit_module 350
351#define __NR_sched_setattr 351
352#define __NR_sched_getattr 352
353#define __NR_renameat2 353
354#define __NR_seccomp 354
355#define __NR_getrandom 355
356#define __NR_memfd_create 356
357#define __NR_bpf 357
358#define __NR_execveat 358
359#define __NR_socket 359
360#define __NR_socketpair 360
361#define __NR_bind 361
362#define __NR_connect 362
363#define __NR_listen 363
364#define __NR_accept4 364
365#define __NR_getsockopt 365
366#define __NR_setsockopt 366
367#define __NR_getsockname 367
368#define __NR_getpeername 368
369#define __NR_sendto 369
370#define __NR_sendmsg 370
371#define __NR_recvfrom 371
372#define __NR_recvmsg 372
373#define __NR_shutdown 373
374#define __NR_userfaultfd 374
375#define __NR_membarrier 375
376#define __NR_mlock2 376
377#define __NR_copy_file_range 377
378#define __NR_preadv2 378
379#define __NR_pwritev2 379
380#define __NR_pkey_mprotect 380
381#define __NR_pkey_alloc 381
382#define __NR_pkey_free 382
383#define __NR_statx 383
384#define __NR_arch_prctl 384
385#define __NR_io_pgetevents 385
386#define __NR_rseq 386
387#define __NR_semget 393
388#define __NR_semctl 394
389#define __NR_shmget 395
390#define __NR_shmctl 396
391#define __NR_shmat 397
392#define __NR_shmdt 398
393#define __NR_msgget 399
394#define __NR_msgsnd 400
395#define __NR_msgrcv 401
396#define __NR_msgctl 402
397#define __NR_clock_gettime64 403
398#define __NR_clock_settime64 404
399#define __NR_clock_adjtime64 405
400#define __NR_clock_getres_time64 406
401#define __NR_clock_nanosleep_time64 407
402#define __NR_timer_gettime64 408
403#define __NR_timer_settime64 409
404#define __NR_timerfd_gettime64 410
405#define __NR_timerfd_settime64 411
406#define __NR_utimensat_time64 412
407#define __NR_pselect6_time64 413
408#define __NR_ppoll_time64 414
409#define __NR_io_pgetevents_time64 416
410#define __NR_recvmmsg_time64 417
411#define __NR_mq_timedsend_time64 418
412#define __NR_mq_timedreceive_time64 419
413#define __NR_semtimedop_time64 420
414#define __NR_rt_sigtimedwait_time64 421
415#define __NR_futex_time64 422
416#define __NR_sched_rr_get_interval_time64 423
417#define __NR_pidfd_send_signal 424
418#define __NR_io_uring_setup 425
419#define __NR_io_uring_enter 426
420#define __NR_io_uring_register 427
421#define __NR_open_tree 428
422#define __NR_move_mount 429
423#define __NR_fsopen 430
424#define __NR_fsconfig 431
425#define __NR_fsmount 432
426#define __NR_fspick 433
427#define __NR_pidfd_open 434
428#define __NR_clone3 435
429#define __NR_close_range 436
430#define __NR_openat2 437
431#define __NR_pidfd_getfd 438
432#define __NR_faccessat2 439
433
lib/libc/wasi/libc-top-half/musl/arch/i386/bits/user.h deleted-44
...@@ -1,44 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3
4typedef struct user_fpregs_struct {
5 long cwd, swd, twd, fip, fcs, foo, fos, st_space[20];
6} elf_fpregset_t;
7
8typedef struct user_fpxregs_struct {
9 unsigned short cwd, swd, twd, fop;
10 long fip, fcs, foo, fos, mxcsr, reserved;
11 long st_space[32], xmm_space[32], padding[56];
12} elf_fpxregset_t;
13
14struct user_regs_struct {
15 long ebx, ecx, edx, esi, edi, ebp, eax, xds, xes, xfs, xgs;
16 long orig_eax, eip, xcs, eflags, esp, xss;
17};
18
19#define ELF_NGREG 17
20typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
21
22struct user {
23 struct user_regs_struct regs;
24 int u_fpvalid;
25 struct user_fpregs_struct i387;
26 unsigned long u_tsize;
27 unsigned long u_dsize;
28 unsigned long u_ssize;
29 unsigned long start_code;
30 unsigned long start_stack;
31 long signal;
32 int reserved;
33 struct user_regs_struct *u_ar0;
34 struct user_fpregs_struct *u_fpstate;
35 unsigned long magic;
36 char u_comm[32];
37 int u_debugreg[8];
38};
39
40#define PAGE_MASK (~(PAGESIZE-1))
41#define NBPG PAGESIZE
42#define UPAGES 1
43#define HOST_TEXT_START_ADDR (u.start_code)
44#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
lib/libc/wasi/libc-top-half/musl/arch/i386/crt_arch.h deleted-16
...@@ -1,16 +0,0 @@
1__asm__(
2".text\n"
3".weak _DYNAMIC \n"
4".hidden _DYNAMIC \n"
5".global " START "\n"
6START ":\n"
7" xor %ebp,%ebp \n"
8" mov %esp,%eax \n"
9" and $-16,%esp \n"
10" push %eax \n"
11" push %eax \n"
12" call 1f \n"
13"1: addl $_DYNAMIC-1b,(%esp) \n"
14" push %eax \n"
15" call " START "_c \n"
16);
lib/libc/wasi/libc-top-half/musl/arch/i386/kstat.h deleted-21
...@@ -1,21 +0,0 @@
1struct kstat {
2 dev_t st_dev;
3 int __st_dev_padding;
4 long __st_ino_truncated;
5 mode_t st_mode;
6 nlink_t st_nlink;
7 uid_t st_uid;
8 gid_t st_gid;
9 dev_t st_rdev;
10 int __st_rdev_padding;
11 off_t st_size;
12 blksize_t st_blksize;
13 blkcnt_t st_blocks;
14 long st_atime_sec;
15 long st_atime_nsec;
16 long st_mtime_sec;
17 long st_mtime_nsec;
18 long st_ctime_sec;
19 long st_ctime_nsec;
20 ino_t st_ino;
21};
lib/libc/wasi/libc-top-half/musl/arch/i386/pthread_arch.h deleted-8
...@@ -1,8 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3 uintptr_t tp;
4 __asm__ ("movl %%gs:0,%0" : "=r" (tp) );
5 return tp;
6}
7
8#define MC_PC gregs[REG_EIP]
lib/libc/wasi/libc-top-half/musl/arch/i386/reloc.h deleted-23
...@@ -1,23 +0,0 @@
1#define LDSO_ARCH "i386"
2
3#define REL_SYMBOLIC R_386_32
4#define REL_OFFSET R_386_PC32
5#define REL_GOT R_386_GLOB_DAT
6#define REL_PLT R_386_JMP_SLOT
7#define REL_RELATIVE R_386_RELATIVE
8#define REL_COPY R_386_COPY
9#define REL_DTPMOD R_386_TLS_DTPMOD32
10#define REL_DTPOFF R_386_TLS_DTPOFF32
11#define REL_TPOFF R_386_TLS_TPOFF
12#define REL_TPOFF_NEG R_386_TLS_TPOFF32
13#define REL_TLSDESC R_386_TLS_DESC
14
15#define CRTJMP(pc,sp) __asm__ __volatile__( \
16 "mov %1,%%esp ; jmp *%0" : : "r"(pc), "r"(sp) : "memory" )
17
18#define GETFUNCSYM(fp, sym, got) __asm__ ( \
19 ".hidden " #sym "\n" \
20 " call 1f\n" \
21 "1: addl $" #sym "-.,(%%esp)\n" \
22 " pop %0" \
23 : "=r"(*fp) : : "memory" )
lib/libc/wasi/libc-top-half/musl/arch/i386/syscall_arch.h deleted-89
...@@ -1,89 +0,0 @@
1#define __SYSCALL_LL_E(x) \
2((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
3((union { long long ll; long l[2]; }){ .ll = x }).l[1]
4#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
5
6#if SYSCALL_NO_TLS
7#define SYSCALL_INSNS "int $128"
8#else
9#define SYSCALL_INSNS "call *%%gs:16"
10#endif
11
12#define SYSCALL_INSNS_12 "xchg %%ebx,%%edx ; " SYSCALL_INSNS " ; xchg %%ebx,%%edx"
13#define SYSCALL_INSNS_34 "xchg %%ebx,%%edi ; " SYSCALL_INSNS " ; xchg %%ebx,%%edi"
14
15static inline long __syscall0(long n)
16{
17 unsigned long __ret;
18 __asm__ __volatile__ (SYSCALL_INSNS : "=a"(__ret) : "a"(n) : "memory");
19 return __ret;
20}
21
22static inline long __syscall1(long n, long a1)
23{
24 unsigned long __ret;
25 __asm__ __volatile__ (SYSCALL_INSNS_12 : "=a"(__ret) : "a"(n), "d"(a1) : "memory");
26 return __ret;
27}
28
29static inline long __syscall2(long n, long a1, long a2)
30{
31 unsigned long __ret;
32 __asm__ __volatile__ (SYSCALL_INSNS_12 : "=a"(__ret) : "a"(n), "d"(a1), "c"(a2) : "memory");
33 return __ret;
34}
35
36static inline long __syscall3(long n, long a1, long a2, long a3)
37{
38 unsigned long __ret;
39#if !defined(__PIC__) || !defined(BROKEN_EBX_ASM)
40 __asm__ __volatile__ (SYSCALL_INSNS : "=a"(__ret) : "a"(n), "b"(a1), "c"(a2), "d"(a3) : "memory");
41#else
42 __asm__ __volatile__ (SYSCALL_INSNS_34 : "=a"(__ret) : "a"(n), "D"(a1), "c"(a2), "d"(a3) : "memory");
43#endif
44 return __ret;
45}
46
47static inline long __syscall4(long n, long a1, long a2, long a3, long a4)
48{
49 unsigned long __ret;
50#if !defined(__PIC__) || !defined(BROKEN_EBX_ASM)
51 __asm__ __volatile__ (SYSCALL_INSNS : "=a"(__ret) : "a"(n), "b"(a1), "c"(a2), "d"(a3), "S"(a4) : "memory");
52#else
53 __asm__ __volatile__ (SYSCALL_INSNS_34 : "=a"(__ret) : "a"(n), "D"(a1), "c"(a2), "d"(a3), "S"(a4) : "memory");
54#endif
55 return __ret;
56}
57
58static inline long __syscall5(long n, long a1, long a2, long a3, long a4, long a5)
59{
60 unsigned long __ret;
61#if !defined(__PIC__) || !defined(BROKEN_EBX_ASM)
62 __asm__ __volatile__ (SYSCALL_INSNS
63 : "=a"(__ret) : "a"(n), "b"(a1), "c"(a2), "d"(a3), "S"(a4), "D"(a5) : "memory");
64#else
65 __asm__ __volatile__ ("pushl %2 ; push %%ebx ; mov 4(%%esp),%%ebx ; " SYSCALL_INSNS " ; pop %%ebx ; add $4,%%esp"
66 : "=a"(__ret) : "a"(n), "g"(a1), "c"(a2), "d"(a3), "S"(a4), "D"(a5) : "memory");
67#endif
68 return __ret;
69}
70
71static inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a5, long a6)
72{
73 unsigned long __ret;
74#if !defined(__PIC__) || !defined(BROKEN_EBX_ASM)
75 __asm__ __volatile__ ("pushl %7 ; push %%ebp ; mov 4(%%esp),%%ebp ; " SYSCALL_INSNS " ; pop %%ebp ; add $4,%%esp"
76 : "=a"(__ret) : "a"(n), "b"(a1), "c"(a2), "d"(a3), "S"(a4), "D"(a5), "g"(a6) : "memory");
77#else
78 unsigned long a1a6[2] = { a1, a6 };
79 __asm__ __volatile__ ("pushl %1 ; push %%ebx ; push %%ebp ; mov 8(%%esp),%%ebx ; mov 4(%%ebx),%%ebp ; mov (%%ebx),%%ebx ; " SYSCALL_INSNS " ; pop %%ebp ; pop %%ebx ; add $4,%%esp"
80 : "=a"(__ret) : "g"(&a1a6), "a"(n), "c"(a2), "d"(a3), "S"(a4), "D"(a5) : "memory");
81#endif
82 return __ret;
83}
84
85#define VDSO_USEFUL
86#define VDSO_CGT32_SYM "__vdso_clock_gettime"
87#define VDSO_CGT32_VER "LINUX_2.6"
88#define VDSO_CGT_SYM "__vdso_clock_gettime64"
89#define VDSO_CGT_VER "LINUX_2.6"
lib/libc/wasi/libc-top-half/musl/arch/m68k/arch.mak deleted-1
...@@ -1 +0,0 @@
1COMPAT_SRC_DIRS = compat/time32
lib/libc/wasi/libc-top-half/musl/arch/m68k/atomic_arch.h deleted-8
...@@ -1,8 +0,0 @@
1#define a_cas a_cas
2static inline int a_cas(volatile int *p, int t, int s)
3{
4 __asm__ __volatile__ (
5 "cas.l %0, %2, (%1)"
6 : "+d"(t) : "a"(p), "d"(s) : "memory", "cc");
7 return t;
8}
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/alltypes.h.in deleted-25
...@@ -1,25 +0,0 @@
1#define _REDIR_TIME64 1
2#define _Addr int
3#define _Int64 long long
4#define _Reg int
5
6#define __BYTE_ORDER 4321
7#define __LONG_MAX 0x7fffffffL
8
9#ifndef __cplusplus
10#ifdef __WCHAR_TYPE__
11TYPEDEF __WCHAR_TYPE__ wchar_t;
12#else
13TYPEDEF long wchar_t;
14#endif
15#endif
16
17#if __mcffpu__
18TYPEDEF float float_t;
19TYPEDEF double double_t;
20#else
21TYPEDEF long double float_t;
22TYPEDEF long double double_t;
23#endif
24
25TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0200000
16#define O_LARGEFILE 0400000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020200000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 8
29#define F_GETOWN 9
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 12
34#define F_SETLK 13
35#define F_SETLKW 14
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/fenv.h deleted-29
...@@ -1,29 +0,0 @@
1#if __HAVE_68881__ || __mcffpu__
2
3#define FE_INEXACT 8
4#define FE_DIVBYZERO 16
5#define FE_UNDERFLOW 32
6#define FE_OVERFLOW 64
7#define FE_INVALID 128
8
9#define FE_ALL_EXCEPT 0xf8
10
11#define FE_TONEAREST 0
12#define FE_TOWARDZERO 16
13#define FE_DOWNWARD 32
14#define FE_UPWARD 48
15
16#else
17
18#define FE_ALL_EXCEPT 0
19#define FE_TONEAREST 0
20
21#endif
22
23typedef unsigned fexcept_t;
24
25typedef struct {
26 unsigned __control_register, __status_register, __instruction_address;
27} fenv_t;
28
29#define FE_DFL_ENV ((const fenv_t *) -1)
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/float.h deleted-39
...@@ -1,39 +0,0 @@
1#if !__mcffpu__
2
3#define FLT_EVAL_METHOD 2
4
5#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L
6#define LDBL_MIN 1.68105157155604675313e-4932L
7#define LDBL_MAX 1.1897314953572317650e+4932L
8#define LDBL_EPSILON 1.0842021724855044340e-19L
9
10#define LDBL_MANT_DIG 64
11#define LDBL_MIN_EXP (-16382)
12#define LDBL_MAX_EXP 16384
13
14#define LDBL_DIG 18
15#define LDBL_MIN_10_EXP (-4931)
16#define LDBL_MAX_10_EXP 4932
17
18#define DECIMAL_DIG 21
19
20#else
21
22#define FLT_EVAL_METHOD 0
23
24#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
25#define LDBL_MIN 2.22507385850720138309e-308L
26#define LDBL_MAX 1.79769313486231570815e+308L
27#define LDBL_EPSILON 2.22044604925031308085e-16L
28
29#define LDBL_MANT_DIG 53
30#define LDBL_MIN_EXP (-1021)
31#define LDBL_MAX_EXP 1024
32
33#define LDBL_DIG 15
34#define LDBL_MIN_10_EXP (-307)
35#define LDBL_MAX_10_EXP 308
36
37#define DECIMAL_DIG 17
38
39#endif
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/ipcstat.h deleted-1
...@@ -1 +0,0 @@
1#define IPC_STAT 0x102
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/msg.h deleted-18
...@@ -1,18 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 unsigned long __msg_stime_lo;
4 unsigned long __msg_stime_hi;
5 unsigned long __msg_rtime_lo;
6 unsigned long __msg_rtime_hi;
7 unsigned long __msg_ctime_lo;
8 unsigned long __msg_ctime_hi;
9 unsigned long msg_cbytes;
10 msgqnum_t msg_qnum;
11 msglen_t msg_qbytes;
12 pid_t msg_lspid;
13 pid_t msg_lrpid;
14 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
18};
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_ILP32_OFFBIG 1
2#define _POSIX_V7_ILP32_OFFBIG 1
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/ptrace.h deleted-2
...@@ -1,2 +0,0 @@
1#define PTRACE_GET_THREAD_AREA 25
2#define PTRACE_SINGLEBLOCK 33
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/reg.h deleted-45
...@@ -1,45 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3#define PT_D1 0
4#define PT_D2 1
5#define PT_D3 2
6#define PT_D4 3
7#define PT_D5 4
8#define PT_D6 5
9#define PT_D7 6
10#define PT_A0 7
11#define PT_A1 8
12#define PT_A2 9
13#define PT_A3 10
14#define PT_A4 11
15#define PT_A5 12
16#define PT_A6 13
17#define PT_D0 14
18#define PT_USP 15
19#define PT_ORIG_D0 16
20#define PT_SR 17
21#define PT_PC 18
22
23#if __mcffpu__
24#define PT_FP0 21
25#define PT_FP1 23
26#define PT_FP2 25
27#define PT_FP3 27
28#define PT_FP4 29
29#define PT_FP5 31
30#define PT_FP6 33
31#define PT_FP7 35
32#else
33#define PT_FP0 21
34#define PT_FP1 24
35#define PT_FP2 27
36#define PT_FP3 30
37#define PT_FP4 33
38#define PT_FP5 36
39#define PT_FP6 39
40#define PT_FP7 42
41#endif
42
43#define PT_FPCR 45
44#define PT_FPSR 46
45#define PT_FPIAR 47
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/sem.h deleted-13
...@@ -1,13 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_otime_hi;
5 unsigned long __sem_ctime_lo;
6 unsigned long __sem_ctime_hi;
7 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
8 unsigned short sem_nsems;
9 long __unused3;
10 long __unused4;
11 time_t sem_otime;
12 time_t sem_ctime;
13};
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long __jmp_buf[39];
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/shm.h deleted-31
...@@ -1,31 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_atime_hi;
8 unsigned long __shm_dtime_lo;
9 unsigned long __shm_dtime_hi;
10 unsigned long __shm_ctime_lo;
11 unsigned long __shm_ctime_hi;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17 unsigned long __pad3;
18 time_t shm_atime;
19 time_t shm_dtime;
20 time_t shm_ctime;
21};
22
23struct shminfo {
24 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
25};
26
27struct shm_info {
28 int __used_ids;
29 unsigned long shm_tot, shm_rss, shm_swp;
30 unsigned long __swap_attempts, __swap_successes;
31};
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/signal.h deleted-140
...@@ -1,140 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#ifdef _GNU_SOURCE
10enum { R_D0 = 0 };
11#define R_D0 R_D0
12enum { R_D1 = 1 };
13#define R_D1 R_D1
14enum { R_D2 = 2 };
15#define R_D2 R_D2
16enum { R_D3 = 3 };
17#define R_D3 R_D3
18enum { R_D4 = 4 };
19#define R_D4 R_D4
20enum { R_D5 = 5 };
21#define R_D5 R_D5
22enum { R_D6 = 6 };
23#define R_D6 R_D6
24enum { R_D7 = 7 };
25#define R_D7 R_D7
26enum { R_A0 = 8 };
27#define R_A0 R_A0
28enum { R_A1 = 9 };
29#define R_A1 R_A1
30enum { R_A2 = 10 };
31#define R_A2 R_A2
32enum { R_A3 = 11 };
33#define R_A3 R_A3
34enum { R_A4 = 12 };
35#define R_A4 R_A4
36enum { R_A5 = 13 };
37#define R_A5 R_A5
38enum { R_A6 = 14 };
39#define R_A6 R_A6
40enum { R_A7 = 15 };
41#define R_A7 R_A7
42enum { R_SP = 15 };
43#define R_SP R_SP
44enum { R_PC = 16 };
45#define R_PC R_PC
46enum { R_PS = 17 };
47#define R_PS R_PS
48#endif
49
50#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
51
52struct sigcontext {
53 unsigned long sc_mask, sc_usp, sc_d0, sc_d1, sc_a0, sc_a1;
54 unsigned short sc_sr;
55 unsigned long sc_pc;
56 unsigned short sc_formatvec;
57 unsigned long sc_fpregs[6], sc_fpcntl[3];
58 unsigned char sc_fpstate[216];
59};
60
61typedef int greg_t, gregset_t[18];
62typedef struct {
63 int f_pcr, f_psr, f_fpiaddr, f_fpregs[8][3];
64} fpregset_t;
65
66typedef struct {
67 int version;
68 gregset_t gregs;
69 fpregset_t fpregs;
70} mcontext_t;
71#else
72typedef struct {
73 int __version;
74 int __gregs[18];
75 int __fpregs[27];
76} mcontext_t;
77#endif
78
79struct sigaltstack {
80 void *ss_sp;
81 int ss_flags;
82 size_t ss_size;
83};
84
85typedef struct __ucontext {
86 unsigned long uc_flags;
87 struct __ucontext *uc_link;
88 stack_t uc_stack;
89 mcontext_t uc_mcontext;
90 long __reserved[80];
91 sigset_t uc_sigmask;
92} ucontext_t;
93
94#define SA_NOCLDSTOP 1
95#define SA_NOCLDWAIT 2
96#define SA_SIGINFO 4
97#define SA_ONSTACK 0x08000000
98#define SA_RESTART 0x10000000
99#define SA_NODEFER 0x40000000
100#define SA_RESETHAND 0x80000000
101#define SA_RESTORER 0x04000000
102
103#endif
104
105#define SIGHUP 1
106#define SIGINT 2
107#define SIGQUIT 3
108#define SIGILL 4
109#define SIGTRAP 5
110#define SIGABRT 6
111#define SIGIOT SIGABRT
112#define SIGBUS 7
113#define SIGFPE 8
114#define SIGKILL 9
115#define SIGUSR1 10
116#define SIGSEGV 11
117#define SIGUSR2 12
118#define SIGPIPE 13
119#define SIGALRM 14
120#define SIGTERM 15
121#define SIGSTKFLT 16
122#define SIGCHLD 17
123#define SIGCONT 18
124#define SIGSTOP 19
125#define SIGTSTP 20
126#define SIGTTIN 21
127#define SIGTTOU 22
128#define SIGURG 23
129#define SIGXCPU 24
130#define SIGXFSZ 25
131#define SIGVTALRM 26
132#define SIGPROF 27
133#define SIGWINCH 28
134#define SIGIO 29
135#define SIGPOLL 29
136#define SIGPWR 30
137#define SIGSYS 31
138#define SIGUNUSED SIGSYS
139
140#define _NSIG 65
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/stat.h deleted-25
...@@ -1,25 +0,0 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3
4struct stat {
5 dev_t st_dev;
6 short __st_dev_padding;
7 long __st_ino_truncated;
8 mode_t st_mode;
9 nlink_t st_nlink;
10 uid_t st_uid;
11 gid_t st_gid;
12 dev_t st_rdev;
13 short __st_rdev_padding;
14 off_t st_size;
15 blksize_t st_blksize;
16 blkcnt_t st_blocks;
17 struct {
18 long tv_sec;
19 long tv_nsec;
20 } __st_atim32, __st_mtim32, __st_ctim32;
21 ino_t st_ino;
22 struct timespec st_atim;
23 struct timespec st_mtim;
24 struct timespec st_ctim;
25};
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT32_MIN
16#define INTPTR_MAX INT32_MAX
17#define UINTPTR_MAX UINT32_MAX
18#define PTRDIFF_MIN INT32_MIN
19#define PTRDIFF_MAX INT32_MAX
20#define SIZE_MAX UINT32_MAX
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/syscall.h.in deleted-412
...@@ -1,412 +0,0 @@
1#define __NR_restart_syscall 0
2#define __NR_exit 1
3#define __NR_fork 2
4#define __NR_read 3
5#define __NR_write 4
6#define __NR_open 5
7#define __NR_close 6
8#define __NR_waitpid 7
9#define __NR_creat 8
10#define __NR_link 9
11#define __NR_unlink 10
12#define __NR_execve 11
13#define __NR_chdir 12
14#define __NR_time 13
15#define __NR_mknod 14
16#define __NR_chmod 15
17#define __NR_chown 16
18#define __NR_oldstat 18
19#define __NR_lseek 19
20#define __NR_getpid 20
21#define __NR_mount 21
22#define __NR_umount 22
23#define __NR_setuid 23
24#define __NR_getuid 24
25#define __NR_stime 25
26#define __NR_ptrace 26
27#define __NR_alarm 27
28#define __NR_oldfstat 28
29#define __NR_pause 29
30#define __NR_utime 30
31#define __NR_access 33
32#define __NR_nice 34
33#define __NR_sync 36
34#define __NR_kill 37
35#define __NR_rename 38
36#define __NR_mkdir 39
37#define __NR_rmdir 40
38#define __NR_dup 41
39#define __NR_pipe 42
40#define __NR_times 43
41#define __NR_brk 45
42#define __NR_setgid 46
43#define __NR_getgid 47
44#define __NR_signal 48
45#define __NR_geteuid 49
46#define __NR_getegid 50
47#define __NR_acct 51
48#define __NR_umount2 52
49#define __NR_ioctl 54
50#define __NR_fcntl 55
51#define __NR_setpgid 57
52#define __NR_umask 60
53#define __NR_chroot 61
54#define __NR_ustat 62
55#define __NR_dup2 63
56#define __NR_getppid 64
57#define __NR_getpgrp 65
58#define __NR_setsid 66
59#define __NR_sigaction 67
60#define __NR_sgetmask 68
61#define __NR_ssetmask 69
62#define __NR_setreuid 70
63#define __NR_setregid 71
64#define __NR_sigsuspend 72
65#define __NR_sigpending 73
66#define __NR_sethostname 74
67#define __NR_setrlimit 75
68#define __NR_getrlimit 76
69#define __NR_getrusage 77
70#define __NR_gettimeofday_time32 78
71#define __NR_settimeofday_time32 79
72#define __NR_getgroups 80
73#define __NR_setgroups 81
74#define __NR_select 82
75#define __NR_symlink 83
76#define __NR_oldlstat 84
77#define __NR_readlink 85
78#define __NR_uselib 86
79#define __NR_swapon 87
80#define __NR_reboot 88
81#define __NR_readdir 89
82#define __NR_mmap 90
83#define __NR_munmap 91
84#define __NR_truncate 92
85#define __NR_ftruncate 93
86#define __NR_fchmod 94
87#define __NR_fchown 95
88#define __NR_getpriority 96
89#define __NR_setpriority 97
90#define __NR_statfs 99
91#define __NR_fstatfs 100
92#define __NR_socketcall 102
93#define __NR_syslog 103
94#define __NR_setitimer 104
95#define __NR_getitimer 105
96#define __NR_stat 106
97#define __NR_lstat 107
98#define __NR_fstat 108
99#define __NR_vhangup 111
100#define __NR_wait4 114
101#define __NR_swapoff 115
102#define __NR_sysinfo 116
103#define __NR_ipc 117
104#define __NR_fsync 118
105#define __NR_sigreturn 119
106#define __NR_clone 120
107#define __NR_setdomainname 121
108#define __NR_uname 122
109#define __NR_cacheflush 123
110#define __NR_adjtimex 124
111#define __NR_mprotect 125
112#define __NR_sigprocmask 126
113#define __NR_create_module 127
114#define __NR_init_module 128
115#define __NR_delete_module 129
116#define __NR_get_kernel_syms 130
117#define __NR_quotactl 131
118#define __NR_getpgid 132
119#define __NR_fchdir 133
120#define __NR_bdflush 134
121#define __NR_sysfs 135
122#define __NR_personality 136
123#define __NR_setfsuid 138
124#define __NR_setfsgid 139
125#define __NR__llseek 140
126#define __NR_getdents 141
127#define __NR__newselect 142
128#define __NR_flock 143
129#define __NR_msync 144
130#define __NR_readv 145
131#define __NR_writev 146
132#define __NR_getsid 147
133#define __NR_fdatasync 148
134#define __NR__sysctl 149
135#define __NR_mlock 150
136#define __NR_munlock 151
137#define __NR_mlockall 152
138#define __NR_munlockall 153
139#define __NR_sched_setparam 154
140#define __NR_sched_getparam 155
141#define __NR_sched_setscheduler 156
142#define __NR_sched_getscheduler 157
143#define __NR_sched_yield 158
144#define __NR_sched_get_priority_max 159
145#define __NR_sched_get_priority_min 160
146#define __NR_sched_rr_get_interval 161
147#define __NR_nanosleep 162
148#define __NR_mremap 163
149#define __NR_setresuid 164
150#define __NR_getresuid 165
151#define __NR_getpagesize 166
152#define __NR_query_module 167
153#define __NR_poll 168
154#define __NR_nfsservctl 169
155#define __NR_setresgid 170
156#define __NR_getresgid 171
157#define __NR_prctl 172
158#define __NR_rt_sigreturn 173
159#define __NR_rt_sigaction 174
160#define __NR_rt_sigprocmask 175
161#define __NR_rt_sigpending 176
162#define __NR_rt_sigtimedwait 177
163#define __NR_rt_sigqueueinfo 178
164#define __NR_rt_sigsuspend 179
165#define __NR_pread64 180
166#define __NR_pwrite64 181
167#define __NR_lchown 182
168#define __NR_getcwd 183
169#define __NR_capget 184
170#define __NR_capset 185
171#define __NR_sigaltstack 186
172#define __NR_sendfile 187
173#define __NR_getpmsg 188
174#define __NR_putpmsg 189
175#define __NR_vfork 190
176#define __NR_ugetrlimit 191
177#define __NR_mmap2 192
178#define __NR_truncate64 193
179#define __NR_ftruncate64 194
180#define __NR_stat64 195
181#define __NR_lstat64 196
182#define __NR_fstat64 197
183#define __NR_chown32 198
184#define __NR_getuid32 199
185#define __NR_getgid32 200
186#define __NR_geteuid32 201
187#define __NR_getegid32 202
188#define __NR_setreuid32 203
189#define __NR_setregid32 204
190#define __NR_getgroups32 205
191#define __NR_setgroups32 206
192#define __NR_fchown32 207
193#define __NR_setresuid32 208
194#define __NR_getresuid32 209
195#define __NR_setresgid32 210
196#define __NR_getresgid32 211
197#define __NR_lchown32 212
198#define __NR_setuid32 213
199#define __NR_setgid32 214
200#define __NR_setfsuid32 215
201#define __NR_setfsgid32 216
202#define __NR_pivot_root 217
203#define __NR_getdents64 220
204#define __NR_gettid 221
205#define __NR_tkill 222
206#define __NR_setxattr 223
207#define __NR_lsetxattr 224
208#define __NR_fsetxattr 225
209#define __NR_getxattr 226
210#define __NR_lgetxattr 227
211#define __NR_fgetxattr 228
212#define __NR_listxattr 229
213#define __NR_llistxattr 230
214#define __NR_flistxattr 231
215#define __NR_removexattr 232
216#define __NR_lremovexattr 233
217#define __NR_fremovexattr 234
218#define __NR_futex 235
219#define __NR_sendfile64 236
220#define __NR_mincore 237
221#define __NR_madvise 238
222#define __NR_fcntl64 239
223#define __NR_readahead 240
224#define __NR_io_setup 241
225#define __NR_io_destroy 242
226#define __NR_io_getevents 243
227#define __NR_io_submit 244
228#define __NR_io_cancel 245
229#define __NR_fadvise64 246
230#define __NR_exit_group 247
231#define __NR_lookup_dcookie 248
232#define __NR_epoll_create 249
233#define __NR_epoll_ctl 250
234#define __NR_epoll_wait 251
235#define __NR_remap_file_pages 252
236#define __NR_set_tid_address 253
237#define __NR_timer_create 254
238#define __NR_timer_settime32 255
239#define __NR_timer_gettime32 256
240#define __NR_timer_getoverrun 257
241#define __NR_timer_delete 258
242#define __NR_clock_settime32 259
243#define __NR_clock_gettime32 260
244#define __NR_clock_getres_time32 261
245#define __NR_clock_nanosleep_time32 262
246#define __NR_statfs64 263
247#define __NR_fstatfs64 264
248#define __NR_tgkill 265
249#define __NR_utimes 266
250#define __NR_fadvise64_64 267
251#define __NR_mbind 268
252#define __NR_get_mempolicy 269
253#define __NR_set_mempolicy 270
254#define __NR_mq_open 271
255#define __NR_mq_unlink 272
256#define __NR_mq_timedsend 273
257#define __NR_mq_timedreceive 274
258#define __NR_mq_notify 275
259#define __NR_mq_getsetattr 276
260#define __NR_waitid 277
261#define __NR_add_key 279
262#define __NR_request_key 280
263#define __NR_keyctl 281
264#define __NR_ioprio_set 282
265#define __NR_ioprio_get 283
266#define __NR_inotify_init 284
267#define __NR_inotify_add_watch 285
268#define __NR_inotify_rm_watch 286
269#define __NR_migrate_pages 287
270#define __NR_openat 288
271#define __NR_mkdirat 289
272#define __NR_mknodat 290
273#define __NR_fchownat 291
274#define __NR_futimesat 292
275#define __NR_fstatat64 293
276#define __NR_unlinkat 294
277#define __NR_renameat 295
278#define __NR_linkat 296
279#define __NR_symlinkat 297
280#define __NR_readlinkat 298
281#define __NR_fchmodat 299
282#define __NR_faccessat 300
283#define __NR_pselect6 301
284#define __NR_ppoll 302
285#define __NR_unshare 303
286#define __NR_set_robust_list 304
287#define __NR_get_robust_list 305
288#define __NR_splice 306
289#define __NR_sync_file_range 307
290#define __NR_tee 308
291#define __NR_vmsplice 309
292#define __NR_move_pages 310
293#define __NR_sched_setaffinity 311
294#define __NR_sched_getaffinity 312
295#define __NR_kexec_load 313
296#define __NR_getcpu 314
297#define __NR_epoll_pwait 315
298#define __NR_utimensat 316
299#define __NR_signalfd 317
300#define __NR_timerfd_create 318
301#define __NR_eventfd 319
302#define __NR_fallocate 320
303#define __NR_timerfd_settime32 321
304#define __NR_timerfd_gettime32 322
305#define __NR_signalfd4 323
306#define __NR_eventfd2 324
307#define __NR_epoll_create1 325
308#define __NR_dup3 326
309#define __NR_pipe2 327
310#define __NR_inotify_init1 328
311#define __NR_preadv 329
312#define __NR_pwritev 330
313#define __NR_rt_tgsigqueueinfo 331
314#define __NR_perf_event_open 332
315#define __NR_get_thread_area 333
316#define __NR_set_thread_area 334
317#define __NR_atomic_cmpxchg_32 335
318#define __NR_atomic_barrier 336
319#define __NR_fanotify_init 337
320#define __NR_fanotify_mark 338
321#define __NR_prlimit64 339
322#define __NR_name_to_handle_at 340
323#define __NR_open_by_handle_at 341
324#define __NR_clock_adjtime 342
325#define __NR_syncfs 343
326#define __NR_setns 344
327#define __NR_process_vm_readv 345
328#define __NR_process_vm_writev 346
329#define __NR_kcmp 347
330#define __NR_finit_module 348
331#define __NR_sched_setattr 349
332#define __NR_sched_getattr 350
333#define __NR_renameat2 351
334#define __NR_getrandom 352
335#define __NR_memfd_create 353
336#define __NR_bpf 354
337#define __NR_execveat 355
338#define __NR_socket 356
339#define __NR_socketpair 357
340#define __NR_bind 358
341#define __NR_connect 359
342#define __NR_listen 360
343#define __NR_accept4 361
344#define __NR_getsockopt 362
345#define __NR_setsockopt 363
346#define __NR_getsockname 364
347#define __NR_getpeername 365
348#define __NR_sendto 366
349#define __NR_sendmsg 367
350#define __NR_recvfrom 368
351#define __NR_recvmsg 369
352#define __NR_shutdown 370
353#define __NR_recvmmsg 371
354#define __NR_sendmmsg 372
355#define __NR_userfaultfd 373
356#define __NR_membarrier 374
357#define __NR_mlock2 375
358#define __NR_copy_file_range 376
359#define __NR_preadv2 377
360#define __NR_pwritev2 378
361#define __NR_statx 379
362#define __NR_seccomp 380
363#define __NR_pkey_mprotect 381
364#define __NR_pkey_alloc 382
365#define __NR_pkey_free 383
366#define __NR_rseq 384
367#define __NR_semget 393
368#define __NR_semctl 394
369#define __NR_shmget 395
370#define __NR_shmctl 396
371#define __NR_shmat 397
372#define __NR_shmdt 398
373#define __NR_msgget 399
374#define __NR_msgsnd 400
375#define __NR_msgrcv 401
376#define __NR_msgctl 402
377#define __NR_clock_gettime64 403
378#define __NR_clock_settime64 404
379#define __NR_clock_adjtime64 405
380#define __NR_clock_getres_time64 406
381#define __NR_clock_nanosleep_time64 407
382#define __NR_timer_gettime64 408
383#define __NR_timer_settime64 409
384#define __NR_timerfd_gettime64 410
385#define __NR_timerfd_settime64 411
386#define __NR_utimensat_time64 412
387#define __NR_pselect6_time64 413
388#define __NR_ppoll_time64 414
389#define __NR_io_pgetevents_time64 416
390#define __NR_recvmmsg_time64 417
391#define __NR_mq_timedsend_time64 418
392#define __NR_mq_timedreceive_time64 419
393#define __NR_semtimedop_time64 420
394#define __NR_rt_sigtimedwait_time64 421
395#define __NR_futex_time64 422
396#define __NR_sched_rr_get_interval_time64 423
397#define __NR_pidfd_send_signal 424
398#define __NR_io_uring_setup 425
399#define __NR_io_uring_enter 426
400#define __NR_io_uring_register 427
401#define __NR_open_tree 428
402#define __NR_move_mount 429
403#define __NR_fsopen 430
404#define __NR_fsconfig 431
405#define __NR_fsmount 432
406#define __NR_fspick 433
407#define __NR_pidfd_open 434
408#define __NR_clone3 435
409#define __NR_close_range 436
410#define __NR_openat2 437
411#define __NR_pidfd_getfd 438
412#define __NR_faccessat2 439
lib/libc/wasi/libc-top-half/musl/arch/m68k/bits/user.h deleted-38
...@@ -1,38 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3
4struct user_m68kfp_struct {
5 unsigned long fpregs[24], fpcntl[3];
6};
7
8struct user_regs_struct {
9 long d1, d2, d3, d4, d5, d6, d7;
10 long a0, a1, a2, a3, a4, a5, a6;
11 long d0, usp, orig_d0;
12 short stkadj, sr;
13 long pc;
14 short fmtvec, __pad;
15};
16
17struct user {
18 struct user_regs_struct regs;
19 int u_fpvalid;
20 struct user_m68kfp_struct m68kfp;
21 unsigned long u_tsize, u_dsize, u_ssize, start_code, start_stack;
22 long signal;
23 int reserved;
24 unsigned long u_ar0;
25 struct user_m68kfp_struct *u_fpstate;
26 unsigned long magic;
27 char u_comm[32];
28};
29
30#define ELF_NGREG 20
31typedef unsigned long elf_greg_t;
32typedef elf_greg_t elf_gregset_t[ELF_NGREG];
33typedef struct user_m68kfp_struct elf_fpregset_t;
34
35#define NBPG 4096
36#define UPAGES 1
37#define HOST_TEXT_START_ADDR (u.start_code)
38#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
lib/libc/wasi/libc-top-half/musl/arch/m68k/crt_arch.h deleted-14
...@@ -1,14 +0,0 @@
1__asm__(
2".text\n"
3".weak _DYNAMIC \n"
4".hidden _DYNAMIC \n"
5".global " START "\n"
6START ":\n"
7" suba.l %fp,%fp \n"
8" movea.l %sp,%a0 \n"
9" lea _DYNAMIC-.-8,%a1 \n"
10" pea (%pc,%a1) \n"
11" pea (%a0) \n"
12" lea " START "_c-.-8,%a1 \n"
13" jsr (%pc,%a1) \n"
14);
lib/libc/wasi/libc-top-half/musl/arch/m68k/kstat.h deleted-21
...@@ -1,21 +0,0 @@
1struct kstat {
2 dev_t st_dev;
3 short __st_dev_padding;
4 long __st_ino_truncated;
5 mode_t st_mode;
6 nlink_t st_nlink;
7 uid_t st_uid;
8 gid_t st_gid;
9 dev_t st_rdev;
10 short __st_rdev_padding;
11 off_t st_size;
12 blksize_t st_blksize;
13 blkcnt_t st_blocks;
14 long st_atime_sec;
15 long st_atime_nsec;
16 long st_mtime_sec;
17 long st_mtime_nsec;
18 long st_ctime_sec;
19 long st_ctime_nsec;
20 ino_t st_ino;
21};
lib/libc/wasi/libc-top-half/musl/arch/m68k/pthread_arch.h deleted-12
...@@ -1,12 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3 return __syscall(SYS_get_thread_area);
4}
5
6#define TLS_ABOVE_TP
7#define GAP_ABOVE_TP 0
8
9#define TP_OFFSET 0x7000
10#define DTP_OFFSET 0x8000
11
12#define MC_PC gregs[R_PC]
lib/libc/wasi/libc-top-half/musl/arch/m68k/reloc.h deleted-30
...@@ -1,30 +0,0 @@
1#if __HAVE_68881__
2#define FP_SUFFIX ""
3#elif __mcffpu__
4#define FP_SUFFIX "-fp64"
5#else
6#define FP_SUFFIX "-sf"
7#endif
8
9#define LDSO_ARCH "m68k" FP_SUFFIX
10
11#define TPOFF_K (-0x7000)
12
13#define REL_SYMBOLIC R_68K_32
14#define REL_OFFSET R_68K_PC32
15#define REL_GOT R_68K_GLOB_DAT
16#define REL_PLT R_68K_JMP_SLOT
17#define REL_RELATIVE R_68K_RELATIVE
18#define REL_COPY R_68K_COPY
19#define REL_DTPMOD R_68K_TLS_DTPMOD32
20#define REL_DTPOFF R_68K_TLS_DTPREL32
21#define REL_TPOFF R_68K_TLS_TPREL32
22
23#define CRTJMP(pc,sp) __asm__ __volatile__( \
24 "move.l %1,%%sp ; jmp (%0)" : : "r"(pc), "r"(sp) : "memory" )
25
26#define GETFUNCSYM(fp, sym, got) __asm__ ( \
27 ".hidden " #sym "\n" \
28 "lea " #sym "-.-8,%0 \n" \
29 "lea (%%pc,%0),%0 \n" \
30 : "=a"(*fp) : : "memory" )
lib/libc/wasi/libc-top-half/musl/arch/m68k/syscall_arch.h deleted-90
...@@ -1,90 +0,0 @@
1#define __SYSCALL_LL_E(x) \
2((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
3((union { long long ll; long l[2]; }){ .ll = x }).l[1]
4#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
5
6static __inline long __syscall0(long n)
7{
8 register unsigned long d0 __asm__("d0") = n;
9 __asm__ __volatile__ ("trap #0" : "+r"(d0)
10 :
11 : "memory");
12 return d0;
13}
14
15static inline long __syscall1(long n, long a)
16{
17 register unsigned long d0 __asm__("d0") = n;
18 register unsigned long d1 __asm__("d1") = a;
19 __asm__ __volatile__ ("trap #0" : "+r"(d0)
20 : "r"(d1)
21 : "memory");
22 return d0;
23}
24
25static inline long __syscall2(long n, long a, long b)
26{
27 register unsigned long d0 __asm__("d0") = n;
28 register unsigned long d1 __asm__("d1") = a;
29 register unsigned long d2 __asm__("d2") = b;
30 __asm__ __volatile__ ("trap #0" : "+r"(d0)
31 : "r"(d1), "r"(d2)
32 : "memory");
33 return d0;
34}
35
36static inline long __syscall3(long n, long a, long b, long c)
37{
38 register unsigned long d0 __asm__("d0") = n;
39 register unsigned long d1 __asm__("d1") = a;
40 register unsigned long d2 __asm__("d2") = b;
41 register unsigned long d3 __asm__("d3") = c;
42 __asm__ __volatile__ ("trap #0" : "+r"(d0)
43 : "r"(d1), "r"(d2), "r"(d3)
44 : "memory");
45 return d0;
46}
47
48static inline long __syscall4(long n, long a, long b, long c, long d)
49{
50 register unsigned long d0 __asm__("d0") = n;
51 register unsigned long d1 __asm__("d1") = a;
52 register unsigned long d2 __asm__("d2") = b;
53 register unsigned long d3 __asm__("d3") = c;
54 register unsigned long d4 __asm__("d4") = d;
55 __asm__ __volatile__ ("trap #0" : "+r"(d0)
56 : "r"(d1), "r"(d2), "r"(d3), "r"(d4)
57 : "memory");
58 return d0;
59}
60
61static inline long __syscall5(long n, long a, long b, long c, long d, long e)
62{
63 register unsigned long d0 __asm__("d0") = n;
64 register unsigned long d1 __asm__("d1") = a;
65 register unsigned long d2 __asm__("d2") = b;
66 register unsigned long d3 __asm__("d3") = c;
67 register unsigned long d4 __asm__("d4") = d;
68 register unsigned long d5 __asm__("d5") = e;
69 __asm__ __volatile__ ("trap #0" : "+r"(d0)
70 : "r"(d1), "r"(d2), "r"(d3), "r"(d4), "r"(d5)
71 : "memory");
72 return d0;
73}
74
75static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
76{
77 register unsigned long d0 __asm__("d0") = n;
78 register unsigned long d1 __asm__("d1") = a;
79 register unsigned long d2 __asm__("d2") = b;
80 register unsigned long d3 __asm__("d3") = c;
81 register unsigned long d4 __asm__("d4") = d;
82 register unsigned long d5 __asm__("d5") = e;
83 register unsigned long a0 __asm__("a0") = f;
84 __asm__ __volatile__ ("trap #0" : "+r"(d0)
85 : "r"(d1), "r"(d2), "r"(d3), "r"(d4), "r"(d5), "r"(a0)
86 : "memory");
87 return d0;
88}
89
90#define SYSCALL_IPC_BROKEN_MODE
lib/libc/wasi/libc-top-half/musl/arch/microblaze/arch.mak deleted-1
...@@ -1 +0,0 @@
1COMPAT_SRC_DIRS = compat/time32
lib/libc/wasi/libc-top-half/musl/arch/microblaze/atomic_arch.h deleted-53
...@@ -1,53 +0,0 @@
1#define a_cas a_cas
2static inline int a_cas(volatile int *p, int t, int s)
3{
4 register int old, tmp;
5 __asm__ __volatile__ (
6 " addi %0, r0, 0\n"
7 "1: lwx %0, %2, r0\n"
8 " rsubk %1, %0, %3\n"
9 " bnei %1, 1f\n"
10 " swx %4, %2, r0\n"
11 " addic %1, r0, 0\n"
12 " bnei %1, 1b\n"
13 "1: "
14 : "=&r"(old), "=&r"(tmp)
15 : "r"(p), "r"(t), "r"(s)
16 : "cc", "memory" );
17 return old;
18}
19
20#define a_swap a_swap
21static inline int a_swap(volatile int *x, int v)
22{
23 register int old, tmp;
24 __asm__ __volatile__ (
25 " addi %0, r0, 0\n"
26 "1: lwx %0, %2, r0\n"
27 " swx %3, %2, r0\n"
28 " addic %1, r0, 0\n"
29 " bnei %1, 1b\n"
30 "1: "
31 : "=&r"(old), "=&r"(tmp)
32 : "r"(x), "r"(v)
33 : "cc", "memory" );
34 return old;
35}
36
37#define a_fetch_add a_fetch_add
38static inline int a_fetch_add(volatile int *x, int v)
39{
40 register int new, tmp;
41 __asm__ __volatile__ (
42 " addi %0, r0, 0\n"
43 "1: lwx %0, %2, r0\n"
44 " addk %0, %0, %3\n"
45 " swx %0, %2, r0\n"
46 " addic %1, r0, 0\n"
47 " bnei %1, 1b\n"
48 "1: "
49 : "=&r"(new), "=&r"(tmp)
50 : "r"(x), "r"(v)
51 : "cc", "memory" );
52 return new-v;
53}
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/alltypes.h.in deleted-21
...@@ -1,21 +0,0 @@
1#define _REDIR_TIME64 1
2#define _Addr int
3#define _Int64 long long
4#define _Reg int
5
6#if __MICROBLAZEEL__
7#define __BYTE_ORDER 1234
8#else
9#define __BYTE_ORDER 4321
10#endif
11
12#define __LONG_MAX 0x7fffffffL
13
14#ifndef __cplusplus
15TYPEDEF int wchar_t;
16#endif
17
18TYPEDEF float float_t;
19TYPEDEF double double_t;
20
21TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
4#define LDBL_MIN 2.22507385850720138309e-308L
5#define LDBL_MAX 1.79769313486231570815e+308L
6#define LDBL_EPSILON 2.22044604925031308085e-16L
7
8#define LDBL_MANT_DIG 53
9#define LDBL_MIN_EXP (-1021)
10#define LDBL_MAX_EXP 1024
11
12#define LDBL_DIG 15
13#define LDBL_MIN_10_EXP (-307)
14#define LDBL_MAX_10_EXP 308
15
16#define DECIMAL_DIG 17
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/ipcstat.h deleted-1
...@@ -1 +0,0 @@
1#define IPC_STAT 0x102
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/msg.h deleted-18
...@@ -1,18 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 unsigned long __msg_stime_lo;
4 unsigned long __msg_stime_hi;
5 unsigned long __msg_rtime_lo;
6 unsigned long __msg_rtime_hi;
7 unsigned long __msg_ctime_lo;
8 unsigned long __msg_ctime_hi;
9 unsigned long msg_cbytes;
10 msgqnum_t msg_qnum;
11 msglen_t msg_qbytes;
12 pid_t msg_lspid;
13 pid_t msg_lrpid;
14 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
18};
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_ILP32_OFFBIG 1
2#define _POSIX_V7_ILP32_OFFBIG 1
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/reg.h deleted-3
...@@ -1,3 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3/* FIXME */
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/sem.h deleted-18
...@@ -1,18 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_otime_hi;
5 unsigned long __sem_ctime_lo;
6 unsigned long __sem_ctime_hi;
7#if __BYTE_ORDER == __LITTLE_ENDIAN
8 unsigned short sem_nsems;
9 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
10#else
11 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
12 unsigned short sem_nsems;
13#endif
14 long __unused3;
15 long __unused4;
16 time_t sem_otime;
17 time_t sem_ctime;
18};
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long __jmp_buf[18];
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/shm.h deleted-31
...@@ -1,31 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_atime_hi;
8 unsigned long __shm_dtime_lo;
9 unsigned long __shm_dtime_hi;
10 unsigned long __shm_ctime_lo;
11 unsigned long __shm_ctime_hi;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17 unsigned long __pad3;
18 time_t shm_atime;
19 time_t shm_dtime;
20 time_t shm_ctime;
21};
22
23struct shminfo {
24 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
25};
26
27struct shm_info {
28 int __used_ids;
29 unsigned long shm_tot, shm_rss, shm_swp;
30 unsigned long __swap_attempts, __swap_successes;
31};
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/signal.h deleted-88
...@@ -1,88 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10typedef unsigned long greg_t, gregset_t[38];
11typedef struct sigcontext {
12 struct {
13 unsigned long r0, r1, r2, r3, r4, r5, r6, r7;
14 unsigned long r8, r9, r10, r11, r12, r13, r14, r15;
15 unsigned long r16, r17, r18, r19, r20, r21, r22, r23;
16 unsigned long r24, r25, r26, r27, r28, r29, r30, r31;
17 unsigned long pc, msr, ear, esr, fsr;
18 int pt_mode;
19 } regs;
20 unsigned long oldmask;
21} mcontext_t;
22#else
23typedef struct {
24 unsigned long __regs[39];
25} mcontext_t;
26#endif
27
28struct sigaltstack {
29 void *ss_sp;
30 int ss_flags;
31 size_t ss_size;
32};
33
34typedef struct __ucontext {
35 unsigned long uc_flags;
36 struct __ucontext *uc_link;
37 stack_t uc_stack;
38 mcontext_t uc_mcontext;
39 sigset_t uc_sigmask;
40} ucontext_t;
41
42#define SA_NOCLDSTOP 1
43#define SA_NOCLDWAIT 2
44#define SA_SIGINFO 4
45#define SA_ONSTACK 0x08000000
46#define SA_RESTART 0x10000000
47#define SA_NODEFER 0x40000000
48#define SA_RESETHAND 0x80000000
49#define SA_RESTORER 0x04000000
50
51#endif
52
53#define SIGHUP 1
54#define SIGINT 2
55#define SIGQUIT 3
56#define SIGILL 4
57#define SIGTRAP 5
58#define SIGABRT 6
59#define SIGIOT SIGABRT
60#define SIGBUS 7
61#define SIGFPE 8
62#define SIGKILL 9
63#define SIGUSR1 10
64#define SIGSEGV 11
65#define SIGUSR2 12
66#define SIGPIPE 13
67#define SIGALRM 14
68#define SIGTERM 15
69#define SIGSTKFLT 16
70#define SIGCHLD 17
71#define SIGCONT 18
72#define SIGSTOP 19
73#define SIGTSTP 20
74#define SIGTTIN 21
75#define SIGTTOU 22
76#define SIGURG 23
77#define SIGXCPU 24
78#define SIGXFSZ 25
79#define SIGVTALRM 26
80#define SIGPROF 27
81#define SIGWINCH 28
82#define SIGIO 29
83#define SIGPOLL 29
84#define SIGPWR 30
85#define SIGSYS 31
86#define SIGUNUSED SIGSYS
87
88#define _NSIG 65
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/stat.h deleted-25
...@@ -1,25 +0,0 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3
4struct stat {
5 dev_t st_dev;
6 ino_t st_ino;
7 mode_t st_mode;
8 nlink_t st_nlink;
9 uid_t st_uid;
10 gid_t st_gid;
11 dev_t st_rdev;
12 long long __st_rdev_padding;
13 off_t st_size;
14 blksize_t st_blksize;
15 int __st_blksize_padding;
16 blkcnt_t st_blocks;
17 struct {
18 long tv_sec;
19 long tv_nsec;
20 } __st_atim32, __st_mtim32, __st_ctim32;
21 unsigned __unused[2];
22 struct timespec st_atim;
23 struct timespec st_mtim;
24 struct timespec st_ctim;
25};
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT32_MIN
16#define INTPTR_MAX INT32_MAX
17#define UINTPTR_MAX UINT32_MAX
18#define PTRDIFF_MIN INT32_MIN
19#define PTRDIFF_MAX INT32_MAX
20#define SIZE_MAX UINT32_MAX
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/syscall.h.in deleted-434
...@@ -1,434 +0,0 @@
1#define __NR_restart_syscall 0
2#define __NR_exit 1
3#define __NR_fork 2
4#define __NR_read 3
5#define __NR_write 4
6#define __NR_open 5
7#define __NR_close 6
8#define __NR_waitpid 7
9#define __NR_creat 8
10#define __NR_link 9
11#define __NR_unlink 10
12#define __NR_execve 11
13#define __NR_chdir 12
14#define __NR_time 13
15#define __NR_mknod 14
16#define __NR_chmod 15
17#define __NR_lchown 16
18#define __NR_break 17
19#define __NR_oldstat 18
20#define __NR_lseek 19
21#define __NR_getpid 20
22#define __NR_mount 21
23#define __NR_umount 22
24#define __NR_setuid 23
25#define __NR_getuid 24
26#define __NR_stime 25
27#define __NR_ptrace 26
28#define __NR_alarm 27
29#define __NR_oldfstat 28
30#define __NR_pause 29
31#define __NR_utime 30
32#define __NR_stty 31
33#define __NR_gtty 32
34#define __NR_access 33
35#define __NR_nice 34
36#define __NR_ftime 35
37#define __NR_sync 36
38#define __NR_kill 37
39#define __NR_rename 38
40#define __NR_mkdir 39
41#define __NR_rmdir 40
42#define __NR_dup 41
43#define __NR_pipe 42
44#define __NR_times 43
45#define __NR_prof 44
46#define __NR_brk 45
47#define __NR_setgid 46
48#define __NR_getgid 47
49#define __NR_signal 48
50#define __NR_geteuid 49
51#define __NR_getegid 50
52#define __NR_acct 51
53#define __NR_umount2 52
54#define __NR_lock 53
55#define __NR_ioctl 54
56#define __NR_fcntl 55
57#define __NR_mpx 56
58#define __NR_setpgid 57
59#define __NR_ulimit 58
60#define __NR_oldolduname 59
61#define __NR_umask 60
62#define __NR_chroot 61
63#define __NR_ustat 62
64#define __NR_dup2 63
65#define __NR_getppid 64
66#define __NR_getpgrp 65
67#define __NR_setsid 66
68#define __NR_sigaction 67
69#define __NR_sgetmask 68
70#define __NR_ssetmask 69
71#define __NR_setreuid 70
72#define __NR_setregid 71
73#define __NR_sigsuspend 72
74#define __NR_sigpending 73
75#define __NR_sethostname 74
76#define __NR_setrlimit 75
77#define __NR_getrlimit 76
78#define __NR_getrusage 77
79#define __NR_gettimeofday_time32 78
80#define __NR_settimeofday_time32 79
81#define __NR_getgroups 80
82#define __NR_setgroups 81
83#define __NR_select 82
84#define __NR_symlink 83
85#define __NR_oldlstat 84
86#define __NR_readlink 85
87#define __NR_uselib 86
88#define __NR_swapon 87
89#define __NR_reboot 88
90#define __NR_readdir 89
91#define __NR_mmap 90
92#define __NR_munmap 91
93#define __NR_truncate 92
94#define __NR_ftruncate 93
95#define __NR_fchmod 94
96#define __NR_fchown 95
97#define __NR_getpriority 96
98#define __NR_setpriority 97
99#define __NR_profil 98
100#define __NR_statfs 99
101#define __NR_fstatfs 100
102#define __NR_ioperm 101
103#define __NR_socketcall 102
104#define __NR_syslog 103
105#define __NR_setitimer 104
106#define __NR_getitimer 105
107#define __NR_stat 106
108#define __NR_lstat 107
109#define __NR_fstat 108
110#define __NR_olduname 109
111#define __NR_iopl 110
112#define __NR_vhangup 111
113#define __NR_idle 112
114#define __NR_vm86old 113
115#define __NR_wait4 114
116#define __NR_swapoff 115
117#define __NR_sysinfo 116
118#define __NR_ipc 117
119#define __NR_fsync 118
120#define __NR_sigreturn 119
121#define __NR_clone 120
122#define __NR_setdomainname 121
123#define __NR_uname 122
124#define __NR_modify_ldt 123
125#define __NR_adjtimex 124
126#define __NR_mprotect 125
127#define __NR_sigprocmask 126
128#define __NR_create_module 127
129#define __NR_init_module 128
130#define __NR_delete_module 129
131#define __NR_get_kernel_syms 130
132#define __NR_quotactl 131
133#define __NR_getpgid 132
134#define __NR_fchdir 133
135#define __NR_bdflush 134
136#define __NR_sysfs 135
137#define __NR_personality 136
138#define __NR_afs_syscall 137
139#define __NR_setfsuid 138
140#define __NR_setfsgid 139
141#define __NR__llseek 140
142#define __NR_getdents 141
143#define __NR__newselect 142
144#define __NR_flock 143
145#define __NR_msync 144
146#define __NR_readv 145
147#define __NR_writev 146
148#define __NR_getsid 147
149#define __NR_fdatasync 148
150#define __NR__sysctl 149
151#define __NR_mlock 150
152#define __NR_munlock 151
153#define __NR_mlockall 152
154#define __NR_munlockall 153
155#define __NR_sched_setparam 154
156#define __NR_sched_getparam 155
157#define __NR_sched_setscheduler 156
158#define __NR_sched_getscheduler 157
159#define __NR_sched_yield 158
160#define __NR_sched_get_priority_max 159
161#define __NR_sched_get_priority_min 160
162#define __NR_sched_rr_get_interval 161
163#define __NR_nanosleep 162
164#define __NR_mremap 163
165#define __NR_setresuid 164
166#define __NR_getresuid 165
167#define __NR_vm86 166
168#define __NR_query_module 167
169#define __NR_poll 168
170#define __NR_nfsservctl 169
171#define __NR_setresgid 170
172#define __NR_getresgid 171
173#define __NR_prctl 172
174#define __NR_rt_sigreturn 173
175#define __NR_rt_sigaction 174
176#define __NR_rt_sigprocmask 175
177#define __NR_rt_sigpending 176
178#define __NR_rt_sigtimedwait 177
179#define __NR_rt_sigqueueinfo 178
180#define __NR_rt_sigsuspend 179
181#define __NR_pread64 180
182#define __NR_pwrite64 181
183#define __NR_chown 182
184#define __NR_getcwd 183
185#define __NR_capget 184
186#define __NR_capset 185
187#define __NR_sigaltstack 186
188#define __NR_sendfile 187
189#define __NR_getpmsg 188
190#define __NR_putpmsg 189
191#define __NR_vfork 190
192#define __NR_ugetrlimit 191
193#define __NR_mmap2 192
194#define __NR_truncate64 193
195#define __NR_ftruncate64 194
196#define __NR_stat64 195
197#define __NR_lstat64 196
198#define __NR_fstat64 197
199#define __NR_lchown32 198
200#define __NR_getuid32 199
201#define __NR_getgid32 200
202#define __NR_geteuid32 201
203#define __NR_getegid32 202
204#define __NR_setreuid32 203
205#define __NR_setregid32 204
206#define __NR_getgroups32 205
207#define __NR_setgroups32 206
208#define __NR_fchown32 207
209#define __NR_setresuid32 208
210#define __NR_getresuid32 209
211#define __NR_setresgid32 210
212#define __NR_getresgid32 211
213#define __NR_chown32 212
214#define __NR_setuid32 213
215#define __NR_setgid32 214
216#define __NR_setfsuid32 215
217#define __NR_setfsgid32 216
218#define __NR_pivot_root 217
219#define __NR_mincore 218
220#define __NR_madvise 219
221#define __NR_getdents64 220
222#define __NR_fcntl64 221
223#define __NR_gettid 224
224#define __NR_readahead 225
225#define __NR_setxattr 226
226#define __NR_lsetxattr 227
227#define __NR_fsetxattr 228
228#define __NR_getxattr 229
229#define __NR_lgetxattr 230
230#define __NR_fgetxattr 231
231#define __NR_listxattr 232
232#define __NR_llistxattr 233
233#define __NR_flistxattr 234
234#define __NR_removexattr 235
235#define __NR_lremovexattr 236
236#define __NR_fremovexattr 237
237#define __NR_tkill 238
238#define __NR_sendfile64 239
239#define __NR_futex 240
240#define __NR_sched_setaffinity 241
241#define __NR_sched_getaffinity 242
242#define __NR_set_thread_area 243
243#define __NR_get_thread_area 244
244#define __NR_io_setup 245
245#define __NR_io_destroy 246
246#define __NR_io_getevents 247
247#define __NR_io_submit 248
248#define __NR_io_cancel 249
249#define __NR_fadvise64 250
250#define __NR_exit_group 252
251#define __NR_lookup_dcookie 253
252#define __NR_epoll_create 254
253#define __NR_epoll_ctl 255
254#define __NR_epoll_wait 256
255#define __NR_remap_file_pages 257
256#define __NR_set_tid_address 258
257#define __NR_timer_create 259
258#define __NR_timer_settime32 260
259#define __NR_timer_gettime32 261
260#define __NR_timer_getoverrun 262
261#define __NR_timer_delete 263
262#define __NR_clock_settime32 264
263#define __NR_clock_gettime32 265
264#define __NR_clock_getres_time32 266
265#define __NR_clock_nanosleep_time32 267
266#define __NR_statfs64 268
267#define __NR_fstatfs64 269
268#define __NR_tgkill 270
269#define __NR_utimes 271
270#define __NR_fadvise64_64 272
271#define __NR_vserver 273
272#define __NR_mbind 274
273#define __NR_get_mempolicy 275
274#define __NR_set_mempolicy 276
275#define __NR_mq_open 277
276#define __NR_mq_unlink 278
277#define __NR_mq_timedsend 279
278#define __NR_mq_timedreceive 280
279#define __NR_mq_notify 281
280#define __NR_mq_getsetattr 282
281#define __NR_kexec_load 283
282#define __NR_waitid 284
283#define __NR_add_key 286
284#define __NR_request_key 287
285#define __NR_keyctl 288
286#define __NR_ioprio_set 289
287#define __NR_ioprio_get 290
288#define __NR_inotify_init 291
289#define __NR_inotify_add_watch 292
290#define __NR_inotify_rm_watch 293
291#define __NR_migrate_pages 294
292#define __NR_openat 295
293#define __NR_mkdirat 296
294#define __NR_mknodat 297
295#define __NR_fchownat 298
296#define __NR_futimesat 299
297#define __NR_fstatat64 300
298#define __NR_unlinkat 301
299#define __NR_renameat 302
300#define __NR_linkat 303
301#define __NR_symlinkat 304
302#define __NR_readlinkat 305
303#define __NR_fchmodat 306
304#define __NR_faccessat 307
305#define __NR_pselect6 308
306#define __NR_ppoll 309
307#define __NR_unshare 310
308#define __NR_set_robust_list 311
309#define __NR_get_robust_list 312
310#define __NR_splice 313
311#define __NR_sync_file_range 314
312#define __NR_tee 315
313#define __NR_vmsplice 316
314#define __NR_move_pages 317
315#define __NR_getcpu 318
316#define __NR_epoll_pwait 319
317#define __NR_utimensat 320
318#define __NR_signalfd 321
319#define __NR_timerfd_create 322
320#define __NR_eventfd 323
321#define __NR_fallocate 324
322#define __NR_semtimedop 325
323#define __NR_timerfd_settime32 326
324#define __NR_timerfd_gettime32 327
325#define __NR_semctl 328
326#define __NR_semget 329
327#define __NR_semop 330
328#define __NR_msgctl 331
329#define __NR_msgget 332
330#define __NR_msgrcv 333
331#define __NR_msgsnd 334
332#define __NR_shmat 335
333#define __NR_shmctl 336
334#define __NR_shmdt 337
335#define __NR_shmget 338
336#define __NR_signalfd4 339
337#define __NR_eventfd2 340
338#define __NR_epoll_create1 341
339#define __NR_dup3 342
340#define __NR_pipe2 343
341#define __NR_inotify_init1 344
342#define __NR_socket 345
343#define __NR_socketpair 346
344#define __NR_bind 347
345#define __NR_listen 348
346#define __NR_accept 349
347#define __NR_connect 350
348#define __NR_getsockname 351
349#define __NR_getpeername 352
350#define __NR_sendto 353
351#define __NR_send 354
352#define __NR_recvfrom 355
353#define __NR_recv 356
354#define __NR_setsockopt 357
355#define __NR_getsockopt 358
356#define __NR_shutdown 359
357#define __NR_sendmsg 360
358#define __NR_recvmsg 361
359#define __NR_accept4 362
360#define __NR_preadv 363
361#define __NR_pwritev 364
362#define __NR_rt_tgsigqueueinfo 365
363#define __NR_perf_event_open 366
364#define __NR_recvmmsg 367
365#define __NR_fanotify_init 368
366#define __NR_fanotify_mark 369
367#define __NR_prlimit64 370
368#define __NR_name_to_handle_at 371
369#define __NR_open_by_handle_at 372
370#define __NR_clock_adjtime 373
371#define __NR_syncfs 374
372#define __NR_setns 375
373#define __NR_sendmmsg 376
374#define __NR_process_vm_readv 377
375#define __NR_process_vm_writev 378
376#define __NR_kcmp 379
377#define __NR_finit_module 380
378#define __NR_sched_setattr 381
379#define __NR_sched_getattr 382
380#define __NR_renameat2 383
381#define __NR_seccomp 384
382#define __NR_getrandom 385
383#define __NR_memfd_create 386
384#define __NR_bpf 387
385#define __NR_execveat 388
386#define __NR_userfaultfd 389
387#define __NR_membarrier 390
388#define __NR_mlock2 391
389#define __NR_copy_file_range 392
390#define __NR_preadv2 393
391#define __NR_pwritev2 394
392#define __NR_pkey_mprotect 395
393#define __NR_pkey_alloc 396
394#define __NR_pkey_free 397
395#define __NR_statx 398
396#define __NR_io_pgetevents 399
397#define __NR_rseq 400
398#define __NR_clock_gettime64 403
399#define __NR_clock_settime64 404
400#define __NR_clock_adjtime64 405
401#define __NR_clock_getres_time64 406
402#define __NR_clock_nanosleep_time64 407
403#define __NR_timer_gettime64 408
404#define __NR_timer_settime64 409
405#define __NR_timerfd_gettime64 410
406#define __NR_timerfd_settime64 411
407#define __NR_utimensat_time64 412
408#define __NR_pselect6_time64 413
409#define __NR_ppoll_time64 414
410#define __NR_io_pgetevents_time64 416
411#define __NR_recvmmsg_time64 417
412#define __NR_mq_timedsend_time64 418
413#define __NR_mq_timedreceive_time64 419
414#define __NR_semtimedop_time64 420
415#define __NR_rt_sigtimedwait_time64 421
416#define __NR_futex_time64 422
417#define __NR_sched_rr_get_interval_time64 423
418#define __NR_pidfd_send_signal 424
419#define __NR_io_uring_setup 425
420#define __NR_io_uring_enter 426
421#define __NR_io_uring_register 427
422#define __NR_open_tree 428
423#define __NR_move_mount 429
424#define __NR_fsopen 430
425#define __NR_fsconfig 431
426#define __NR_fsmount 432
427#define __NR_fspick 433
428#define __NR_pidfd_open 434
429#define __NR_clone3 435
430#define __NR_close_range 436
431#define __NR_openat2 437
432#define __NR_pidfd_getfd 438
433#define __NR_faccessat2 439
434
lib/libc/wasi/libc-top-half/musl/arch/microblaze/bits/user.h deleted-25
...@@ -1,25 +0,0 @@
1struct user_fpregs_struct {
2 long cwd, swd, twd, fip, fcs, foo, fos, st_space[20];
3};
4
5struct user_regs_struct {
6 unsigned grp[32], pc, msr, ear, esr, fsr, btr, pvr[12];
7};
8
9struct user {
10 struct user_regs_struct regs;
11 int u_fpvalid;
12 struct user_fpregs_struct elf_fpregset_t;
13 unsigned long u_tsize, u_dsize, u_ssize, start_code, start_stack;
14 long signal;
15 int reserved;
16 struct user_regs_struct *u_ar0;
17 struct user_fpregs_struct *u_fpstate;
18 unsigned long magic;
19 char u_comm[32];
20 int u_debugreg[8];
21};
22
23#define ELF_NGREG 50
24typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
25typedef struct user_fpregs_struct elf_fpregset_t;
lib/libc/wasi/libc-top-half/musl/arch/microblaze/crt_arch.h deleted-17
...@@ -1,17 +0,0 @@
1__asm__(
2".text \n"
3".global " START " \n"
4".align 2 \n"
5START ": \n"
6" add r19, r0, r0 \n"
7" ori r5, r1, 0 \n"
8"1: mfs r6, rpc \n"
9".weak _DYNAMIC \n"
10".hidden _DYNAMIC \n"
11" addik r6, r6, _GLOBAL_OFFSET_TABLE_+8 \n"
12" addik r6, r6, _DYNAMIC@GOTOFF \n"
13" andi r1, r1, -8 \n"
14" addik r1, r1, -8 \n"
15" bri " START "_c \n"
16" nop \n"
17);
lib/libc/wasi/libc-top-half/musl/arch/microblaze/kstat.h deleted-21
...@@ -1,21 +0,0 @@
1struct kstat {
2 dev_t st_dev;
3 ino_t st_ino;
4 mode_t st_mode;
5 nlink_t st_nlink;
6 uid_t st_uid;
7 gid_t st_gid;
8 dev_t st_rdev;
9 long long __st_rdev_padding;
10 off_t st_size;
11 blksize_t st_blksize;
12 int __st_blksize_padding;
13 blkcnt_t st_blocks;
14 long st_atime_sec;
15 long st_atime_nsec;
16 long st_mtime_sec;
17 long st_mtime_nsec;
18 long st_ctime_sec;
19 long st_ctime_nsec;
20 unsigned __unused[2];
21};
lib/libc/wasi/libc-top-half/musl/arch/microblaze/pthread_arch.h deleted-8
...@@ -1,8 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3 uintptr_t tp;
4 __asm__ ("ori %0, r21, 0" : "=r" (tp) );
5 return tp;
6}
7
8#define MC_PC regs.pc
lib/libc/wasi/libc-top-half/musl/arch/microblaze/reloc.h deleted-27
...@@ -1,27 +0,0 @@
1#if __BYTE_ORDER == __LITTLE_ENDIAN
2#define ENDIAN_SUFFIX "el"
3#else
4#define ENDIAN_SUFFIX ""
5#endif
6
7#define LDSO_ARCH "microblaze" ENDIAN_SUFFIX
8
9#define TPOFF_K 0
10
11#define REL_SYMBOLIC R_MICROBLAZE_32
12#define REL_GOT R_MICROBLAZE_GLOB_DAT
13#define REL_PLT R_MICROBLAZE_JUMP_SLOT
14#define REL_RELATIVE R_MICROBLAZE_REL
15#define REL_COPY R_MICROBLAZE_COPY
16#define REL_DTPMOD R_MICROBLAZE_TLSDTPMOD32
17#define REL_DTPOFF R_MICROBLAZE_TLSDTPREL32
18
19#define CRTJMP(pc,sp) __asm__ __volatile__( \
20 "addik r1,%1,0 ; bra %0" : : "r"(pc), "r"(sp) : "memory" )
21
22#define GETFUNCSYM(fp, sym, got) __asm__ ( \
23 ".hidden " #sym " \n" \
24 " mfs %0, rpc \n" \
25 " addik %0, %0, _GLOBAL_OFFSET_TABLE_+8 \n" \
26 " addik %0, %0, " #sym "@GOTOFF \n" \
27 : "=r"(*(fp)) : : "memory" )
lib/libc/wasi/libc-top-half/musl/arch/microblaze/syscall_arch.h deleted-99
...@@ -1,99 +0,0 @@
1#define __SYSCALL_LL_E(x) \
2((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
3((union { long long ll; long l[2]; }){ .ll = x }).l[1]
4#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
5
6static __inline long __syscall0(long n)
7{
8 register unsigned long r12 __asm__("r12") = n;
9 register unsigned long r3 __asm__("r3");
10 __asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
11 : "r"(r12)
12 : "memory", "r4");
13 return r3;
14}
15
16static inline long __syscall1(long n, long a)
17{
18 register unsigned long r12 __asm__("r12") = n;
19 register unsigned long r3 __asm__("r3");
20 register unsigned long r5 __asm__("r5") = a;
21 __asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
22 : "r"(r12), "r"(r5)
23 : "memory", "r4");
24 return r3;
25}
26
27static inline long __syscall2(long n, long a, long b)
28{
29 register unsigned long r12 __asm__("r12") = n;
30 register unsigned long r3 __asm__("r3");
31 register unsigned long r5 __asm__("r5") = a;
32 register unsigned long r6 __asm__("r6") = b;
33 __asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
34 : "r"(r12), "r"(r5), "r"(r6)
35 : "memory", "r4");
36 return r3;
37}
38
39static inline long __syscall3(long n, long a, long b, long c)
40{
41 register unsigned long r12 __asm__("r12") = n;
42 register unsigned long r3 __asm__("r3");
43 register unsigned long r5 __asm__("r5") = a;
44 register unsigned long r6 __asm__("r6") = b;
45 register unsigned long r7 __asm__("r7") = c;
46 __asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
47 : "r"(r12), "r"(r5), "r"(r6), "r"(r7)
48 : "memory", "r4");
49 return r3;
50}
51
52static inline long __syscall4(long n, long a, long b, long c, long d)
53{
54 register unsigned long r12 __asm__("r12") = n;
55 register unsigned long r3 __asm__("r3");
56 register unsigned long r5 __asm__("r5") = a;
57 register unsigned long r6 __asm__("r6") = b;
58 register unsigned long r7 __asm__("r7") = c;
59 register unsigned long r8 __asm__("r8") = d;
60 __asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
61 : "r"(r12), "r"(r5), "r"(r6), "r"(r7), "r"(r8)
62 : "memory", "r4");
63 return r3;
64}
65
66static inline long __syscall5(long n, long a, long b, long c, long d, long e)
67{
68 register unsigned long r12 __asm__("r12") = n;
69 register unsigned long r3 __asm__("r3");
70 register unsigned long r5 __asm__("r5") = a;
71 register unsigned long r6 __asm__("r6") = b;
72 register unsigned long r7 __asm__("r7") = c;
73 register unsigned long r8 __asm__("r8") = d;
74 register unsigned long r9 __asm__("r9") = e;
75 __asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
76 : "r"(r12), "r"(r5), "r"(r6), "r"(r7), "r"(r8), "r"(r9)
77 : "memory", "r4");
78 return r3;
79}
80
81static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
82{
83 register unsigned long r12 __asm__("r12") = n;
84 register unsigned long r3 __asm__("r3");
85 register unsigned long r5 __asm__("r5") = a;
86 register unsigned long r6 __asm__("r6") = b;
87 register unsigned long r7 __asm__("r7") = c;
88 register unsigned long r8 __asm__("r8") = d;
89 register unsigned long r9 __asm__("r9") = e;
90 register unsigned long r10 __asm__("r10") = f;
91 __asm__ __volatile__ ("brki r14, 0x8" : "=r"(r3)
92 : "r"(r12), "r"(r5), "r"(r6), "r"(r7), "r"(r8), "r"(r9), "r"(r10)
93 : "memory", "r4");
94 return r3;
95}
96
97#define SYSCALL_IPC_BROKEN_MODE
98
99#undef SYS_socketcall
lib/libc/wasi/libc-top-half/musl/arch/mips/arch.mak deleted-1
...@@ -1 +0,0 @@
1COMPAT_SRC_DIRS = compat/time32
lib/libc/wasi/libc-top-half/musl/arch/mips/atomic_arch.h deleted-58
...@@ -1,58 +0,0 @@
1#if __mips_isa_rev < 6
2#define LLSC_M "m"
3#else
4#define LLSC_M "ZC"
5#endif
6
7#define a_ll a_ll
8static inline int a_ll(volatile int *p)
9{
10 int v;
11#if __mips < 2
12 __asm__ __volatile__ (
13 ".set push ; .set mips2\n\t"
14 "ll %0, %1"
15 "\n\t.set pop"
16 : "=r"(v) : "m"(*p));
17#else
18 __asm__ __volatile__ (
19 "ll %0, %1"
20 : "=r"(v) : LLSC_M(*p));
21#endif
22 return v;
23}
24
25#define a_sc a_sc
26static inline int a_sc(volatile int *p, int v)
27{
28 int r;
29#if __mips < 2
30 __asm__ __volatile__ (
31 ".set push ; .set mips2\n\t"
32 "sc %0, %1"
33 "\n\t.set pop"
34 : "=r"(r), "=m"(*p) : "0"(v) : "memory");
35#else
36 __asm__ __volatile__ (
37 "sc %0, %1"
38 : "=r"(r), "="LLSC_M(*p) : "0"(v) : "memory");
39#endif
40 return r;
41}
42
43#define a_barrier a_barrier
44static inline void a_barrier()
45{
46#if __mips < 2
47 /* mips2 sync, but using too many directives causes
48 * gcc not to inline it, so encode with .long instead. */
49 __asm__ __volatile__ (".long 0xf" : : : "memory");
50#else
51 __asm__ __volatile__ ("sync" : : : "memory");
52#endif
53}
54
55#define a_pre_llsc a_barrier
56#define a_post_llsc a_barrier
57
58#undef LLSC_M
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/alltypes.h.in deleted-21
...@@ -1,21 +0,0 @@
1#define _REDIR_TIME64 1
2#define _Addr int
3#define _Int64 long long
4#define _Reg int
5
6#if _MIPSEL || __MIPSEL || __MIPSEL__
7#define __BYTE_ORDER 1234
8#else
9#define __BYTE_ORDER 4321
10#endif
11
12#define __LONG_MAX 0x7fffffffL
13
14#ifndef __cplusplus
15TYPEDEF int wchar_t;
16#endif
17
18TYPEDEF float float_t;
19TYPEDEF double double_t;
20
21TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/errno.h deleted-134
...@@ -1,134 +0,0 @@
1#define EPERM 1
2#define ENOENT 2
3#define ESRCH 3
4#define EINTR 4
5#define EIO 5
6#define ENXIO 6
7#define E2BIG 7
8#define ENOEXEC 8
9#define EBADF 9
10#define ECHILD 10
11#define EAGAIN 11
12#define ENOMEM 12
13#define EACCES 13
14#define EFAULT 14
15#define ENOTBLK 15
16#define EBUSY 16
17#define EEXIST 17
18#define EXDEV 18
19#define ENODEV 19
20#define ENOTDIR 20
21#define EISDIR 21
22#define EINVAL 22
23#define ENFILE 23
24#define EMFILE 24
25#define ENOTTY 25
26#define ETXTBSY 26
27#define EFBIG 27
28#define ENOSPC 28
29#define ESPIPE 29
30#define EROFS 30
31#define EMLINK 31
32#define EPIPE 32
33#define EDOM 33
34#define ERANGE 34
35#define ENOMSG 35
36#define EIDRM 36
37#define ECHRNG 37
38#define EL2NSYNC 38
39#define EL3HLT 39
40#define EL3RST 40
41#define ELNRNG 41
42#define EUNATCH 42
43#define ENOCSI 43
44#define EL2HLT 44
45#define EDEADLK 45
46#define ENOLCK 46
47#define EBADE 50
48#define EBADR 51
49#define EXFULL 52
50#define ENOANO 53
51#define EBADRQC 54
52#define EBADSLT 55
53#define EDEADLOCK 56
54#define EBFONT 59
55#define ENOSTR 60
56#define ENODATA 61
57#define ETIME 62
58#define ENOSR 63
59#define ENONET 64
60#define ENOPKG 65
61#define EREMOTE 66
62#define ENOLINK 67
63#define EADV 68
64#define ESRMNT 69
65#define ECOMM 70
66#define EPROTO 71
67#define EDOTDOT 73
68#define EMULTIHOP 74
69#define EBADMSG 77
70#define ENAMETOOLONG 78
71#define EOVERFLOW 79
72#define ENOTUNIQ 80
73#define EBADFD 81
74#define EREMCHG 82
75#define ELIBACC 83
76#define ELIBBAD 84
77#define ELIBSCN 85
78#define ELIBMAX 86
79#define ELIBEXEC 87
80#define EILSEQ 88
81#define ENOSYS 89
82#define ELOOP 90
83#define ERESTART 91
84#define ESTRPIPE 92
85#define ENOTEMPTY 93
86#define EUSERS 94
87#define ENOTSOCK 95
88#define EDESTADDRREQ 96
89#define EMSGSIZE 97
90#define EPROTOTYPE 98
91#define ENOPROTOOPT 99
92#define EPROTONOSUPPORT 120
93#define ESOCKTNOSUPPORT 121
94#define EOPNOTSUPP 122
95#define ENOTSUP EOPNOTSUPP
96#define EPFNOSUPPORT 123
97#define EAFNOSUPPORT 124
98#define EADDRINUSE 125
99#define EADDRNOTAVAIL 126
100#define ENETDOWN 127
101#define ENETUNREACH 128
102#define ENETRESET 129
103#define ECONNABORTED 130
104#define ECONNRESET 131
105#define ENOBUFS 132
106#define EISCONN 133
107#define ENOTCONN 134
108#define EUCLEAN 135
109#define ENOTNAM 137
110#define ENAVAIL 138
111#define EISNAM 139
112#define EREMOTEIO 140
113#define ESHUTDOWN 143
114#define ETOOMANYREFS 144
115#define ETIMEDOUT 145
116#define ECONNREFUSED 146
117#define EHOSTDOWN 147
118#define EHOSTUNREACH 148
119#define EWOULDBLOCK EAGAIN
120#define EALREADY 149
121#define EINPROGRESS 150
122#define ESTALE 151
123#define ECANCELED 158
124#define ENOMEDIUM 159
125#define EMEDIUMTYPE 160
126#define ENOKEY 161
127#define EKEYEXPIRED 162
128#define EKEYREVOKED 163
129#define EKEYREJECTED 164
130#define EOWNERDEAD 165
131#define ENOTRECOVERABLE 166
132#define ERFKILL 167
133#define EHWPOISON 168
134#define EDQUOT 1133
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0400
2#define O_EXCL 02000
3#define O_NOCTTY 04000
4#define O_TRUNC 01000
5#define O_APPEND 0010
6#define O_NONBLOCK 0200
7#define O_DSYNC 0020
8#define O_SYNC 040020
9#define O_RSYNC 040020
10#define O_DIRECTORY 0200000
11#define O_NOFOLLOW 0400000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 010000
15#define O_DIRECT 0100000
16#define O_LARGEFILE 020000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020200000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 24
29#define F_GETOWN 23
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 33
34#define F_SETLK 34
35#define F_SETLKW 35
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/fenv.h deleted-25
...@@ -1,25 +0,0 @@
1#ifdef __mips_soft_float
2#define FE_ALL_EXCEPT 0
3#define FE_TONEAREST 0
4#else
5#define FE_INEXACT 4
6#define FE_UNDERFLOW 8
7#define FE_OVERFLOW 16
8#define FE_DIVBYZERO 32
9#define FE_INVALID 64
10
11#define FE_ALL_EXCEPT 124
12
13#define FE_TONEAREST 0
14#define FE_TOWARDZERO 1
15#define FE_UPWARD 2
16#define FE_DOWNWARD 3
17#endif
18
19typedef unsigned short fexcept_t;
20
21typedef struct {
22 unsigned __cw;
23} fenv_t;
24
25#define FE_DFL_ENV ((const fenv_t *) -1)
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
4#define LDBL_MIN 2.22507385850720138309e-308L
5#define LDBL_MAX 1.79769313486231570815e+308L
6#define LDBL_EPSILON 2.22044604925031308085e-16L
7
8#define LDBL_MANT_DIG 53
9#define LDBL_MIN_EXP (-1021)
10#define LDBL_MAX_EXP 1024
11
12#define LDBL_DIG 15
13#define LDBL_MIN_10_EXP (-307)
14#define LDBL_MAX_10_EXP 308
15
16#define DECIMAL_DIG 17
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/hwcap.h deleted-14
...@@ -1,14 +0,0 @@
1#define HWCAP_MIPS_R6 (1 << 0)
2#define HWCAP_MIPS_MSA (1 << 1)
3#define HWCAP_MIPS_CRC32 (1 << 2)
4#define HWCAP_MIPS_MIPS16 (1 << 3)
5#define HWCAP_MIPS_MDMX (1 << 4)
6#define HWCAP_MIPS_MIPS3D (1 << 5)
7#define HWCAP_MIPS_SMARTMIPS (1 << 6)
8#define HWCAP_MIPS_DSP (1 << 7)
9#define HWCAP_MIPS_DSP2 (1 << 8)
10#define HWCAP_MIPS_DSP3 (1 << 9)
11#define HWCAP_MIPS_MIPS16E2 (1 << 10)
12#define HWCAP_LOONGSON_MMI (1 << 11)
13#define HWCAP_LOONGSON_EXT (1 << 12)
14#define HWCAP_LOONGSON_EXT2 (1 << 13)
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/ioctl.h deleted-114
...@@ -1,114 +0,0 @@
1#define _IOC(a,b,c,d) ( ((a)<<29) | ((b)<<8) | (c) | ((d)<<16) )
2#define _IOC_NONE 1U
3#define _IOC_READ 2U
4#define _IOC_WRITE 4U
5
6#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
7#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
8#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
9#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
10
11#define TCGETA 0x5401
12#define TCSETA 0x5402
13#define TCSETAW 0x5403
14#define TCSETAF 0x5404
15#define TCSBRK 0x5405
16#define TCXONC 0x5406
17#define TCFLSH 0x5407
18#define TCGETS 0x540D
19#define TCSETS 0x540E
20#define TCSETSW 0x540F
21#define TCSETSF 0x5410
22
23#define TIOCEXCL 0x740D
24#define TIOCNXCL 0x740E
25#define TIOCOUTQ 0x7472
26#define TIOCSTI 0x5472
27#define TIOCMGET 0x741D
28#define TIOCMBIS 0x741B
29#define TIOCMBIC 0x741C
30#define TIOCMSET 0x741A
31
32#define TIOCPKT 0x5470
33#define TIOCSWINSZ _IOW('t', 103, struct winsize)
34#define TIOCGWINSZ _IOR('t', 104, struct winsize)
35#define TIOCNOTTY 0x5471
36#define TIOCSETD 0x7401
37#define TIOCGETD 0x7400
38
39#define FIOCLEX 0x6601
40#define FIONCLEX 0x6602
41#define FIOASYNC 0x667D
42#define FIONBIO 0x667E
43#define FIOQSIZE 0x667F
44
45#define TIOCGLTC 0x7474
46#define TIOCSLTC 0x7475
47#define TIOCSPGRP _IOW('t', 118, int)
48#define TIOCGPGRP _IOR('t', 119, int)
49#define TIOCCONS _IOW('t', 120, int)
50
51#define FIONREAD 0x467F
52#define TIOCINQ FIONREAD
53
54#define TIOCGETP 0x7408
55#define TIOCSETP 0x7409
56#define TIOCSETN 0x740A
57
58#define TIOCSBRK 0x5427
59#define TIOCCBRK 0x5428
60#define TIOCGSID 0x7416
61#define TIOCGRS485 _IOR('T', 0x2E, char[32])
62#define TIOCSRS485 _IOWR('T', 0x2F, char[32])
63#define TIOCGPTN _IOR('T', 0x30, unsigned int)
64#define TIOCSPTLCK _IOW('T', 0x31, int)
65#define TIOCGDEV _IOR('T', 0x32, unsigned int)
66#define TIOCSIG _IOW('T', 0x36, int)
67#define TIOCVHANGUP 0x5437
68#define TIOCGPKT _IOR('T', 0x38, int)
69#define TIOCGPTLCK _IOR('T', 0x39, int)
70#define TIOCGEXCL _IOR('T', 0x40, int)
71#define TIOCGPTPEER _IO('T', 0x41)
72
73#define TIOCSCTTY 0x5480
74#define TIOCGSOFTCAR 0x5481
75#define TIOCSSOFTCAR 0x5482
76#define TIOCLINUX 0x5483
77#define TIOCGSERIAL 0x5484
78#define TIOCSSERIAL 0x5485
79#define TCSBRKP 0x5486
80
81#define TIOCSERCONFIG 0x5488
82#define TIOCSERGWILD 0x5489
83#define TIOCSERSWILD 0x548A
84#define TIOCGLCKTRMIOS 0x548B
85#define TIOCSLCKTRMIOS 0x548C
86#define TIOCSERGSTRUCT 0x548D
87#define TIOCSERGETLSR 0x548E
88#define TIOCSERGETMULTI 0x548F
89#define TIOCSERSETMULTI 0x5490
90#define TIOCMIWAIT 0x5491
91#define TIOCGICOUNT 0x5492
92
93#define TIOCM_LE 0x001
94#define TIOCM_DTR 0x002
95#define TIOCM_RTS 0x004
96#define TIOCM_ST 0x010
97#define TIOCM_SR 0x020
98#define TIOCM_CTS 0x040
99#define TIOCM_CAR 0x100
100#define TIOCM_CD TIOCM_CAR
101#define TIOCM_RNG 0x200
102#define TIOCM_RI TIOCM_RNG
103#define TIOCM_DSR 0x400
104#define TIOCM_OUT1 0x2000
105#define TIOCM_OUT2 0x4000
106#define TIOCM_LOOP 0x8000
107
108#define FIOGETOWN _IOR('f', 123, int)
109#define FIOSETOWN _IOW('f', 124, int)
110#define SIOCATMARK _IOR('s', 7, int)
111#define SIOCSPGRP _IOW('s', 8, pid_t)
112#define SIOCGPGRP _IOR('s', 9, pid_t)
113#define SIOCGSTAMP _IOR(0x89, 6, char[16])
114#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/ipcstat.h deleted-1
...@@ -1 +0,0 @@
1#define IPC_STAT 0x102
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/mman.h deleted-25
...@@ -1,25 +0,0 @@
1#undef MAP_ANON
2#define MAP_ANON 0x800
3#undef MAP_NORESERVE
4#define MAP_NORESERVE 0x0400
5#undef MAP_GROWSDOWN
6#define MAP_GROWSDOWN 0x1000
7#undef MAP_DENYWRITE
8#define MAP_DENYWRITE 0x2000
9#undef MAP_EXECUTABLE
10#define MAP_EXECUTABLE 0x4000
11#undef MAP_LOCKED
12#define MAP_LOCKED 0x8000
13#undef MAP_POPULATE
14#define MAP_POPULATE 0x10000
15#undef MAP_NONBLOCK
16#define MAP_NONBLOCK 0x20000
17#undef MAP_STACK
18#define MAP_STACK 0x40000
19#undef MAP_HUGETLB
20#define MAP_HUGETLB 0x80000
21#undef MAP_SYNC
22
23#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
24#undef MADV_SOFT_OFFLINE
25#endif
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/msg.h deleted-27
...@@ -1,27 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3#if _MIPSEL || __MIPSEL || __MIPSEL__
4 unsigned long __msg_stime_lo;
5 unsigned long __msg_stime_hi;
6 unsigned long __msg_rtime_lo;
7 unsigned long __msg_rtime_hi;
8 unsigned long __msg_ctime_lo;
9 unsigned long __msg_ctime_hi;
10#else
11 unsigned long __msg_stime_hi;
12 unsigned long __msg_stime_lo;
13 unsigned long __msg_rtime_hi;
14 unsigned long __msg_rtime_lo;
15 unsigned long __msg_ctime_hi;
16 unsigned long __msg_ctime_lo;
17#endif
18 unsigned long msg_cbytes;
19 msgqnum_t msg_qnum;
20 msglen_t msg_qbytes;
21 pid_t msg_lspid;
22 pid_t msg_lrpid;
23 unsigned long __unused[2];
24 time_t msg_stime;
25 time_t msg_rtime;
26 time_t msg_ctime;
27};
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/poll.h deleted-2
...@@ -1,2 +0,0 @@
1#define POLLWRNORM POLLOUT
2#define POLLWRBAND 0x100
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_ILP32_OFFBIG 1
2#define _POSIX_V7_ILP32_OFFBIG 1
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/ptrace.h deleted-9
...@@ -1,9 +0,0 @@
1#define PTRACE_GET_THREAD_AREA 25
2#define PTRACE_SET_THREAD_AREA 26
3#define PTRACE_PEEKTEXT_3264 0xc0
4#define PTRACE_PEEKDATA_3264 0xc1
5#define PTRACE_POKETEXT_3264 0xc2
6#define PTRACE_POKEDATA_3264 0xc3
7#define PTRACE_GET_THREAD_AREA_3264 0xc4
8#define PTRACE_GET_WATCH_REGS 0xd0
9#define PTRACE_SET_WATCH_REGS 0xd1
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/reg.h deleted-47
...@@ -1,47 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3
4#define EF_R0 6
5#define EF_R1 7
6#define EF_R2 8
7#define EF_R3 9
8#define EF_R4 10
9#define EF_R5 11
10#define EF_R6 12
11#define EF_R7 13
12#define EF_R8 14
13#define EF_R9 15
14#define EF_R10 16
15#define EF_R11 17
16#define EF_R12 18
17#define EF_R13 19
18#define EF_R14 20
19#define EF_R15 21
20#define EF_R16 22
21#define EF_R17 23
22#define EF_R18 24
23#define EF_R19 25
24#define EF_R20 26
25#define EF_R21 27
26#define EF_R22 28
27#define EF_R23 29
28#define EF_R24 30
29#define EF_R25 31
30
31#define EF_R26 32
32#define EF_R27 33
33#define EF_R28 34
34#define EF_R29 35
35#define EF_R30 36
36#define EF_R31 37
37
38#define EF_LO 38
39#define EF_HI 39
40
41#define EF_CP0_EPC 40
42#define EF_CP0_BADVADDR 41
43#define EF_CP0_STATUS 42
44#define EF_CP0_CAUSE 43
45#define EF_UNUSED0 44
46
47#define EF_SIZE 180
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/resource.h deleted-5
...@@ -1,5 +0,0 @@
1#define RLIMIT_NOFILE 5
2#define RLIMIT_AS 6
3#define RLIMIT_RSS 7
4#define RLIMIT_NPROC 8
5#define RLIMIT_MEMLOCK 9
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/sem.h deleted-16
...@@ -1,16 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_ctime_lo;
5#if __BYTE_ORDER == __LITTLE_ENDIAN
6 unsigned short sem_nsems;
7 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
8#else
9 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
10 unsigned short sem_nsems;
11#endif
12 unsigned long __sem_otime_hi;
13 unsigned long __sem_ctime_hi;
14 time_t sem_otime;
15 time_t sem_ctime;
16};
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long long __jmp_buf[13];
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/shm.h deleted-29
...@@ -1,29 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_dtime_lo;
8 unsigned long __shm_ctime_lo;
9 pid_t shm_cpid;
10 pid_t shm_lpid;
11 unsigned long shm_nattch;
12 unsigned short __shm_atime_hi;
13 unsigned short __shm_dtime_hi;
14 unsigned short __shm_ctime_hi;
15 unsigned short __pad1;
16 time_t shm_atime;
17 time_t shm_dtime;
18 time_t shm_ctime;
19};
20
21struct shminfo {
22 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
23};
24
25struct shm_info {
26 int __used_ids;
27 unsigned long shm_tot, shm_rss, shm_swp;
28 unsigned long __swap_attempts, __swap_successes;
29};
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/signal.h deleted-124
...@@ -1,124 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10typedef unsigned long long greg_t, gregset_t[32];
11typedef struct {
12 union {
13 double fp_dregs[32];
14 struct {
15 float _fp_fregs;
16 unsigned _fp_pad;
17 } fp_fregs[32];
18 } fp_r;
19} fpregset_t;
20struct sigcontext {
21 unsigned sc_regmask, sc_status;
22 unsigned long long sc_pc;
23 gregset_t sc_regs;
24 fpregset_t sc_fpregs;
25 unsigned sc_ownedfp, sc_fpc_csr, sc_fpc_eir, sc_used_math, sc_dsp;
26 unsigned long long sc_mdhi, sc_mdlo;
27 unsigned long sc_hi1, sc_lo1, sc_hi2, sc_lo2, sc_hi3, sc_lo3;
28};
29typedef struct {
30 unsigned regmask, status;
31 unsigned long long pc;
32 gregset_t gregs;
33 fpregset_t fpregs;
34 unsigned ownedfp, fpc_csr, fpc_eir, used_math, dsp;
35 unsigned long long mdhi, mdlo;
36 unsigned long hi1, lo1, hi2, lo2, hi3, lo3;
37} mcontext_t;
38#else
39typedef struct {
40 unsigned __mc1[2];
41 unsigned long long __mc2[65];
42 unsigned __mc3[5];
43 unsigned long long __mc4[2];
44 unsigned __mc5[6];
45} mcontext_t;
46#endif
47
48struct sigaltstack {
49 void *ss_sp;
50 size_t ss_size;
51 int ss_flags;
52};
53
54typedef struct __ucontext {
55 unsigned long uc_flags;
56 struct __ucontext *uc_link;
57 stack_t uc_stack;
58 mcontext_t uc_mcontext;
59 sigset_t uc_sigmask;
60} ucontext_t;
61
62#define SA_NOCLDSTOP 1
63#define SA_NOCLDWAIT 0x10000
64#define SA_SIGINFO 8
65#define SA_ONSTACK 0x08000000
66#define SA_RESTART 0x10000000
67#define SA_NODEFER 0x40000000
68#define SA_RESETHAND 0x80000000
69#define SA_RESTORER 0x04000000
70
71#undef SIG_BLOCK
72#undef SIG_UNBLOCK
73#undef SIG_SETMASK
74#define SIG_BLOCK 1
75#define SIG_UNBLOCK 2
76#define SIG_SETMASK 3
77
78#undef SI_ASYNCIO
79#undef SI_MESGQ
80#undef SI_TIMER
81#define SI_ASYNCIO (-2)
82#define SI_MESGQ (-4)
83#define SI_TIMER (-3)
84
85#define __SI_SWAP_ERRNO_CODE
86
87#endif
88
89#define SIGHUP 1
90#define SIGINT 2
91#define SIGQUIT 3
92#define SIGILL 4
93#define SIGTRAP 5
94#define SIGABRT 6
95#define SIGIOT SIGABRT
96#define SIGEMT 7
97#define SIGFPE 8
98#define SIGKILL 9
99#define SIGBUS 10
100#define SIGSEGV 11
101#define SIGSYS 12
102#define SIGPIPE 13
103#define SIGALRM 14
104#define SIGTERM 15
105#define SIGUSR1 16
106#define SIGUSR2 17
107#define SIGCHLD 18
108#define SIGPWR 19
109#define SIGWINCH 20
110#define SIGURG 21
111#define SIGIO 22
112#define SIGPOLL SIGIO
113#define SIGSTOP 23
114#define SIGTSTP 24
115#define SIGCONT 25
116#define SIGTTIN 26
117#define SIGTTOU 27
118#define SIGVTALRM 28
119#define SIGPROF 29
120#define SIGXCPU 30
121#define SIGXFSZ 31
122#define SIGUNUSED SIGSYS
123
124#define _NSIG 128
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/socket.h deleted-35
...@@ -1,35 +0,0 @@
1#define SOCK_STREAM 2
2#define SOCK_DGRAM 1
3
4#define SOL_SOCKET 65535
5
6#define SO_DEBUG 1
7
8#define SO_REUSEADDR 0x0004
9#define SO_KEEPALIVE 0x0008
10#define SO_DONTROUTE 0x0010
11#define SO_BROADCAST 0x0020
12#define SO_LINGER 0x0080
13#define SO_OOBINLINE 0x0100
14#define SO_REUSEPORT 0x0200
15#define SO_SNDBUF 0x1001
16#define SO_RCVBUF 0x1002
17#define SO_SNDLOWAT 0x1003
18#define SO_RCVLOWAT 0x1004
19#define SO_ERROR 0x1007
20#define SO_TYPE 0x1008
21#define SO_ACCEPTCONN 0x1009
22#define SO_PROTOCOL 0x1028
23#define SO_DOMAIN 0x1029
24
25#define SO_NO_CHECK 11
26#define SO_PRIORITY 12
27#define SO_BSDCOMPAT 14
28#define SO_PASSCRED 17
29#define SO_PEERCRED 18
30#define SO_PEERSEC 30
31#define SO_SNDBUFFORCE 31
32#define SO_RCVBUFFORCE 33
33
34#define SOCK_NONBLOCK 0200
35#define SOCK_CLOEXEC 02000000
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/stat.h deleted-26
...@@ -1,26 +0,0 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3
4struct stat {
5 dev_t st_dev;
6 long __st_padding1[2];
7 ino_t st_ino;
8 mode_t st_mode;
9 nlink_t st_nlink;
10 uid_t st_uid;
11 gid_t st_gid;
12 dev_t st_rdev;
13 long __st_padding2[2];
14 off_t st_size;
15 struct {
16 long tv_sec;
17 long tv_nsec;
18 } __st_atim32, __st_mtim32, __st_ctim32;
19 blksize_t st_blksize;
20 long __st_padding3;
21 blkcnt_t st_blocks;
22 struct timespec st_atim;
23 struct timespec st_mtim;
24 struct timespec st_ctim;
25 long __st_padding4[2];
26};
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/statfs.h deleted-8
...@@ -1,8 +0,0 @@
1struct statfs {
2 unsigned long f_type, f_bsize, f_frsize;
3 fsblkcnt_t f_blocks, f_bfree;
4 fsfilcnt_t f_files, f_ffree;
5 fsblkcnt_t f_bavail;
6 fsid_t f_fsid;
7 unsigned long f_namelen, f_flags, f_spare[5];
8};
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT32_MIN
16#define INTPTR_MAX INT32_MAX
17#define UINTPTR_MAX UINT32_MAX
18#define PTRDIFF_MIN INT32_MIN
19#define PTRDIFF_MAX INT32_MAX
20#define SIZE_MAX UINT32_MAX
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/syscall.h.in deleted-415
...@@ -1,415 +0,0 @@
1#define __NR_syscall 4000
2#define __NR_exit 4001
3#define __NR_fork 4002
4#define __NR_read 4003
5#define __NR_write 4004
6#define __NR_open 4005
7#define __NR_close 4006
8#define __NR_waitpid 4007
9#define __NR_creat 4008
10#define __NR_link 4009
11#define __NR_unlink 4010
12#define __NR_execve 4011
13#define __NR_chdir 4012
14#define __NR_time 4013
15#define __NR_mknod 4014
16#define __NR_chmod 4015
17#define __NR_lchown 4016
18#define __NR_break 4017
19#define __NR_unused18 4018
20#define __NR_lseek 4019
21#define __NR_getpid 4020
22#define __NR_mount 4021
23#define __NR_umount 4022
24#define __NR_setuid 4023
25#define __NR_getuid 4024
26#define __NR_stime 4025
27#define __NR_ptrace 4026
28#define __NR_alarm 4027
29#define __NR_unused28 4028
30#define __NR_pause 4029
31#define __NR_utime 4030
32#define __NR_stty 4031
33#define __NR_gtty 4032
34#define __NR_access 4033
35#define __NR_nice 4034
36#define __NR_ftime 4035
37#define __NR_sync 4036
38#define __NR_kill 4037
39#define __NR_rename 4038
40#define __NR_mkdir 4039
41#define __NR_rmdir 4040
42#define __NR_dup 4041
43#define __NR_pipe 4042
44#define __NR_times 4043
45#define __NR_prof 4044
46#define __NR_brk 4045
47#define __NR_setgid 4046
48#define __NR_getgid 4047
49#define __NR_signal 4048
50#define __NR_geteuid 4049
51#define __NR_getegid 4050
52#define __NR_acct 4051
53#define __NR_umount2 4052
54#define __NR_lock 4053
55#define __NR_ioctl 4054
56#define __NR_fcntl 4055
57#define __NR_mpx 4056
58#define __NR_setpgid 4057
59#define __NR_ulimit 4058
60#define __NR_unused59 4059
61#define __NR_umask 4060
62#define __NR_chroot 4061
63#define __NR_ustat 4062
64#define __NR_dup2 4063
65#define __NR_getppid 4064
66#define __NR_getpgrp 4065
67#define __NR_setsid 4066
68#define __NR_sigaction 4067
69#define __NR_sgetmask 4068
70#define __NR_ssetmask 4069
71#define __NR_setreuid 4070
72#define __NR_setregid 4071
73#define __NR_sigsuspend 4072
74#define __NR_sigpending 4073
75#define __NR_sethostname 4074
76#define __NR_setrlimit 4075
77#define __NR_getrlimit 4076
78#define __NR_getrusage 4077
79#define __NR_gettimeofday_time32 4078
80#define __NR_settimeofday_time32 4079
81#define __NR_getgroups 4080
82#define __NR_setgroups 4081
83#define __NR_reserved82 4082
84#define __NR_symlink 4083
85#define __NR_unused84 4084
86#define __NR_readlink 4085
87#define __NR_uselib 4086
88#define __NR_swapon 4087
89#define __NR_reboot 4088
90#define __NR_readdir 4089
91#define __NR_mmap 4090
92#define __NR_munmap 4091
93#define __NR_truncate 4092
94#define __NR_ftruncate 4093
95#define __NR_fchmod 4094
96#define __NR_fchown 4095
97#define __NR_getpriority 4096
98#define __NR_setpriority 4097
99#define __NR_profil 4098
100#define __NR_statfs 4099
101#define __NR_fstatfs 4100
102#define __NR_ioperm 4101
103#define __NR_socketcall 4102
104#define __NR_syslog 4103
105#define __NR_setitimer 4104
106#define __NR_getitimer 4105
107#define __NR_stat 4106
108#define __NR_lstat 4107
109#define __NR_fstat 4108
110#define __NR_unused109 4109
111#define __NR_iopl 4110
112#define __NR_vhangup 4111
113#define __NR_idle 4112
114#define __NR_vm86 4113
115#define __NR_wait4 4114
116#define __NR_swapoff 4115
117#define __NR_sysinfo 4116
118#define __NR_ipc 4117
119#define __NR_fsync 4118
120#define __NR_sigreturn 4119
121#define __NR_clone 4120
122#define __NR_setdomainname 4121
123#define __NR_uname 4122
124#define __NR_modify_ldt 4123
125#define __NR_adjtimex 4124
126#define __NR_mprotect 4125
127#define __NR_sigprocmask 4126
128#define __NR_create_module 4127
129#define __NR_init_module 4128
130#define __NR_delete_module 4129
131#define __NR_get_kernel_syms 4130
132#define __NR_quotactl 4131
133#define __NR_getpgid 4132
134#define __NR_fchdir 4133
135#define __NR_bdflush 4134
136#define __NR_sysfs 4135
137#define __NR_personality 4136
138#define __NR_afs_syscall 4137
139#define __NR_setfsuid 4138
140#define __NR_setfsgid 4139
141#define __NR__llseek 4140
142#define __NR_getdents 4141
143#define __NR__newselect 4142
144#define __NR_flock 4143
145#define __NR_msync 4144
146#define __NR_readv 4145
147#define __NR_writev 4146
148#define __NR_cacheflush 4147
149#define __NR_cachectl 4148
150#define __NR_sysmips 4149
151#define __NR_unused150 4150
152#define __NR_getsid 4151
153#define __NR_fdatasync 4152
154#define __NR__sysctl 4153
155#define __NR_mlock 4154
156#define __NR_munlock 4155
157#define __NR_mlockall 4156
158#define __NR_munlockall 4157
159#define __NR_sched_setparam 4158
160#define __NR_sched_getparam 4159
161#define __NR_sched_setscheduler 4160
162#define __NR_sched_getscheduler 4161
163#define __NR_sched_yield 4162
164#define __NR_sched_get_priority_max 4163
165#define __NR_sched_get_priority_min 4164
166#define __NR_sched_rr_get_interval 4165
167#define __NR_nanosleep 4166
168#define __NR_mremap 4167
169#define __NR_accept 4168
170#define __NR_bind 4169
171#define __NR_connect 4170
172#define __NR_getpeername 4171
173#define __NR_getsockname 4172
174#define __NR_getsockopt 4173
175#define __NR_listen 4174
176#define __NR_recv 4175
177#define __NR_recvfrom 4176
178#define __NR_recvmsg 4177
179#define __NR_send 4178
180#define __NR_sendmsg 4179
181#define __NR_sendto 4180
182#define __NR_setsockopt 4181
183#define __NR_shutdown 4182
184#define __NR_socket 4183
185#define __NR_socketpair 4184
186#define __NR_setresuid 4185
187#define __NR_getresuid 4186
188#define __NR_query_module 4187
189#define __NR_poll 4188
190#define __NR_nfsservctl 4189
191#define __NR_setresgid 4190
192#define __NR_getresgid 4191
193#define __NR_prctl 4192
194#define __NR_rt_sigreturn 4193
195#define __NR_rt_sigaction 4194
196#define __NR_rt_sigprocmask 4195
197#define __NR_rt_sigpending 4196
198#define __NR_rt_sigtimedwait 4197
199#define __NR_rt_sigqueueinfo 4198
200#define __NR_rt_sigsuspend 4199
201#define __NR_pread64 4200
202#define __NR_pwrite64 4201
203#define __NR_chown 4202
204#define __NR_getcwd 4203
205#define __NR_capget 4204
206#define __NR_capset 4205
207#define __NR_sigaltstack 4206
208#define __NR_sendfile 4207
209#define __NR_getpmsg 4208
210#define __NR_putpmsg 4209
211#define __NR_mmap2 4210
212#define __NR_truncate64 4211
213#define __NR_ftruncate64 4212
214#define __NR_stat64 4213
215#define __NR_lstat64 4214
216#define __NR_fstat64 4215
217#define __NR_pivot_root 4216
218#define __NR_mincore 4217
219#define __NR_madvise 4218
220#define __NR_getdents64 4219
221#define __NR_fcntl64 4220
222#define __NR_reserved221 4221
223#define __NR_gettid 4222
224#define __NR_readahead 4223
225#define __NR_setxattr 4224
226#define __NR_lsetxattr 4225
227#define __NR_fsetxattr 4226
228#define __NR_getxattr 4227
229#define __NR_lgetxattr 4228
230#define __NR_fgetxattr 4229
231#define __NR_listxattr 4230
232#define __NR_llistxattr 4231
233#define __NR_flistxattr 4232
234#define __NR_removexattr 4233
235#define __NR_lremovexattr 4234
236#define __NR_fremovexattr 4235
237#define __NR_tkill 4236
238#define __NR_sendfile64 4237
239#define __NR_futex 4238
240#define __NR_sched_setaffinity 4239
241#define __NR_sched_getaffinity 4240
242#define __NR_io_setup 4241
243#define __NR_io_destroy 4242
244#define __NR_io_getevents 4243
245#define __NR_io_submit 4244
246#define __NR_io_cancel 4245
247#define __NR_exit_group 4246
248#define __NR_lookup_dcookie 4247
249#define __NR_epoll_create 4248
250#define __NR_epoll_ctl 4249
251#define __NR_epoll_wait 4250
252#define __NR_remap_file_pages 4251
253#define __NR_set_tid_address 4252
254#define __NR_restart_syscall 4253
255#define __NR_fadvise64 4254
256#define __NR_statfs64 4255
257#define __NR_fstatfs64 4256
258#define __NR_timer_create 4257
259#define __NR_timer_settime32 4258
260#define __NR_timer_gettime32 4259
261#define __NR_timer_getoverrun 4260
262#define __NR_timer_delete 4261
263#define __NR_clock_settime32 4262
264#define __NR_clock_gettime32 4263
265#define __NR_clock_getres_time32 4264
266#define __NR_clock_nanosleep_time32 4265
267#define __NR_tgkill 4266
268#define __NR_utimes 4267
269#define __NR_mbind 4268
270#define __NR_get_mempolicy 4269
271#define __NR_set_mempolicy 4270
272#define __NR_mq_open 4271
273#define __NR_mq_unlink 4272
274#define __NR_mq_timedsend 4273
275#define __NR_mq_timedreceive 4274
276#define __NR_mq_notify 4275
277#define __NR_mq_getsetattr 4276
278#define __NR_vserver 4277
279#define __NR_waitid 4278
280#define __NR_add_key 4280
281#define __NR_request_key 4281
282#define __NR_keyctl 4282
283#define __NR_set_thread_area 4283
284#define __NR_inotify_init 4284
285#define __NR_inotify_add_watch 4285
286#define __NR_inotify_rm_watch 4286
287#define __NR_migrate_pages 4287
288#define __NR_openat 4288
289#define __NR_mkdirat 4289
290#define __NR_mknodat 4290
291#define __NR_fchownat 4291
292#define __NR_futimesat 4292
293#define __NR_fstatat64 4293
294#define __NR_unlinkat 4294
295#define __NR_renameat 4295
296#define __NR_linkat 4296
297#define __NR_symlinkat 4297
298#define __NR_readlinkat 4298
299#define __NR_fchmodat 4299
300#define __NR_faccessat 4300
301#define __NR_pselect6 4301
302#define __NR_ppoll 4302
303#define __NR_unshare 4303
304#define __NR_splice 4304
305#define __NR_sync_file_range 4305
306#define __NR_tee 4306
307#define __NR_vmsplice 4307
308#define __NR_move_pages 4308
309#define __NR_set_robust_list 4309
310#define __NR_get_robust_list 4310
311#define __NR_kexec_load 4311
312#define __NR_getcpu 4312
313#define __NR_epoll_pwait 4313
314#define __NR_ioprio_set 4314
315#define __NR_ioprio_get 4315
316#define __NR_utimensat 4316
317#define __NR_signalfd 4317
318#define __NR_timerfd 4318
319#define __NR_eventfd 4319
320#define __NR_fallocate 4320
321#define __NR_timerfd_create 4321
322#define __NR_timerfd_gettime32 4322
323#define __NR_timerfd_settime32 4323
324#define __NR_signalfd4 4324
325#define __NR_eventfd2 4325
326#define __NR_epoll_create1 4326
327#define __NR_dup3 4327
328#define __NR_pipe2 4328
329#define __NR_inotify_init1 4329
330#define __NR_preadv 4330
331#define __NR_pwritev 4331
332#define __NR_rt_tgsigqueueinfo 4332
333#define __NR_perf_event_open 4333
334#define __NR_accept4 4334
335#define __NR_recvmmsg 4335
336#define __NR_fanotify_init 4336
337#define __NR_fanotify_mark 4337
338#define __NR_prlimit64 4338
339#define __NR_name_to_handle_at 4339
340#define __NR_open_by_handle_at 4340
341#define __NR_clock_adjtime 4341
342#define __NR_syncfs 4342
343#define __NR_sendmmsg 4343
344#define __NR_setns 4344
345#define __NR_process_vm_readv 4345
346#define __NR_process_vm_writev 4346
347#define __NR_kcmp 4347
348#define __NR_finit_module 4348
349#define __NR_sched_setattr 4349
350#define __NR_sched_getattr 4350
351#define __NR_renameat2 4351
352#define __NR_seccomp 4352
353#define __NR_getrandom 4353
354#define __NR_memfd_create 4354
355#define __NR_bpf 4355
356#define __NR_execveat 4356
357#define __NR_userfaultfd 4357
358#define __NR_membarrier 4358
359#define __NR_mlock2 4359
360#define __NR_copy_file_range 4360
361#define __NR_preadv2 4361
362#define __NR_pwritev2 4362
363#define __NR_pkey_mprotect 4363
364#define __NR_pkey_alloc 4364
365#define __NR_pkey_free 4365
366#define __NR_statx 4366
367#define __NR_rseq 4367
368#define __NR_io_pgetevents 4368
369#define __NR_semget 4393
370#define __NR_semctl 4394
371#define __NR_shmget 4395
372#define __NR_shmctl 4396
373#define __NR_shmat 4397
374#define __NR_shmdt 4398
375#define __NR_msgget 4399
376#define __NR_msgsnd 4400
377#define __NR_msgrcv 4401
378#define __NR_msgctl 4402
379#define __NR_clock_gettime64 4403
380#define __NR_clock_settime64 4404
381#define __NR_clock_adjtime64 4405
382#define __NR_clock_getres_time64 4406
383#define __NR_clock_nanosleep_time64 4407
384#define __NR_timer_gettime64 4408
385#define __NR_timer_settime64 4409
386#define __NR_timerfd_gettime64 4410
387#define __NR_timerfd_settime64 4411
388#define __NR_utimensat_time64 4412
389#define __NR_pselect6_time64 4413
390#define __NR_ppoll_time64 4414
391#define __NR_io_pgetevents_time64 4416
392#define __NR_recvmmsg_time64 4417
393#define __NR_mq_timedsend_time64 4418
394#define __NR_mq_timedreceive_time64 4419
395#define __NR_semtimedop_time64 4420
396#define __NR_rt_sigtimedwait_time64 4421
397#define __NR_futex_time64 4422
398#define __NR_sched_rr_get_interval_time64 4423
399#define __NR_pidfd_send_signal 4424
400#define __NR_io_uring_setup 4425
401#define __NR_io_uring_enter 4426
402#define __NR_io_uring_register 4427
403#define __NR_open_tree 4428
404#define __NR_move_mount 4429
405#define __NR_fsopen 4430
406#define __NR_fsconfig 4431
407#define __NR_fsmount 4432
408#define __NR_fspick 4433
409#define __NR_pidfd_open 4434
410#define __NR_clone3 4435
411#define __NR_close_range 4436
412#define __NR_openat2 4437
413#define __NR_pidfd_getfd 4438
414#define __NR_faccessat2 4439
415
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/termios.h deleted-169
...@@ -1,169 +0,0 @@
1struct termios {
2 tcflag_t c_iflag;
3 tcflag_t c_oflag;
4 tcflag_t c_cflag;
5 tcflag_t c_lflag;
6 cc_t c_line;
7 cc_t c_cc[NCCS];
8 speed_t __c_ispeed;
9 speed_t __c_ospeed;
10};
11
12#define VINTR 0
13#define VQUIT 1
14#define VERASE 2
15#define VKILL 3
16#define VMIN 4
17#define VTIME 5
18#define VEOL2 6
19#define VSWTC 7
20#define VSWTCH 7
21#define VSTART 8
22#define VSTOP 9
23#define VSUSP 10
24#define VREPRINT 12
25#define VDISCARD 13
26#define VWERASE 14
27#define VLNEXT 15
28#define VEOF 16
29#define VEOL 17
30
31#define IGNBRK 0000001
32#define BRKINT 0000002
33#define IGNPAR 0000004
34#define PARMRK 0000010
35#define INPCK 0000020
36#define ISTRIP 0000040
37#define INLCR 0000100
38#define IGNCR 0000200
39#define ICRNL 0000400
40#define IUCLC 0001000
41#define IXON 0002000
42#define IXANY 0004000
43#define IXOFF 0010000
44#define IMAXBEL 0020000
45#define IUTF8 0040000
46
47#define OPOST 0000001
48#define OLCUC 0000002
49#define ONLCR 0000004
50#define OCRNL 0000010
51#define ONOCR 0000020
52#define ONLRET 0000040
53#define OFILL 0000100
54#define OFDEL 0000200
55#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
56#define NLDLY 0000400
57#define NL0 0000000
58#define NL1 0000400
59#define CRDLY 0003000
60#define CR0 0000000
61#define CR1 0001000
62#define CR2 0002000
63#define CR3 0003000
64#define TABDLY 0014000
65#define TAB0 0000000
66#define TAB1 0004000
67#define TAB2 0010000
68#define TAB3 0014000
69#define BSDLY 0020000
70#define BS0 0000000
71#define BS1 0020000
72#define FFDLY 0100000
73#define FF0 0000000
74#define FF1 0100000
75#endif
76
77#define VTDLY 0040000
78#define VT0 0000000
79#define VT1 0040000
80
81#define B0 0000000
82#define B50 0000001
83#define B75 0000002
84#define B110 0000003
85#define B134 0000004
86#define B150 0000005
87#define B200 0000006
88#define B300 0000007
89#define B600 0000010
90#define B1200 0000011
91#define B1800 0000012
92#define B2400 0000013
93#define B4800 0000014
94#define B9600 0000015
95#define B19200 0000016
96#define B38400 0000017
97
98#define B57600 0010001
99#define B115200 0010002
100#define B230400 0010003
101#define B460800 0010004
102#define B500000 0010005
103#define B576000 0010006
104#define B921600 0010007
105#define B1000000 0010010
106#define B1152000 0010011
107#define B1500000 0010012
108#define B2000000 0010013
109#define B2500000 0010014
110#define B3000000 0010015
111#define B3500000 0010016
112#define B4000000 0010017
113
114#define CSIZE 0000060
115#define CS5 0000000
116#define CS6 0000020
117#define CS7 0000040
118#define CS8 0000060
119#define CSTOPB 0000100
120#define CREAD 0000200
121#define PARENB 0000400
122#define PARODD 0001000
123#define HUPCL 0002000
124#define CLOCAL 0004000
125
126#define ISIG 0000001
127#define ICANON 0000002
128#define ECHO 0000010
129#define ECHOE 0000020
130#define ECHOK 0000040
131#define ECHONL 0000100
132#define NOFLSH 0000200
133#define IEXTEN 0000400
134#define TOSTOP 0100000
135#define ITOSTOP 0100000
136
137#define TCOOFF 0
138#define TCOON 1
139#define TCIOFF 2
140#define TCION 3
141
142#define TCIFLUSH 0
143#define TCOFLUSH 1
144#define TCIOFLUSH 2
145
146#define TCSANOW 0
147#define TCSADRAIN 1
148#define TCSAFLUSH 2
149
150#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
151#define EXTA 0000016
152#define EXTB 0000017
153#define CBAUD 0010017
154#define CBAUDEX 0010000
155#define CIBAUD 002003600000
156#define CMSPAR 010000000000
157#define CRTSCTS 020000000000
158
159#define XCASE 0000004
160#define ECHOCTL 0001000
161#define ECHOPRT 0002000
162#define ECHOKE 0004000
163#define FLUSHO 0020000
164#define PENDIN 0040000
165#define EXTPROC 0200000
166
167#define XTABS 0014000
168#define TIOCSER_TEMT 1
169#endif
lib/libc/wasi/libc-top-half/musl/arch/mips/bits/user.h deleted-13
...@@ -1,13 +0,0 @@
1struct user {
2 unsigned long regs[45+64];
3 unsigned long u_tsize, u_dsize, u_ssize;
4 unsigned long start_code, start_data, start_stack;
5 long signal;
6 void *u_ar0;
7 unsigned long magic;
8 char u_comm[32];
9};
10#define ELF_NGREG 45
11#define ELF_NFPREG 33
12typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
13typedef double elf_fpreg_t, elf_fpregset_t[ELF_NFPREG];
lib/libc/wasi/libc-top-half/musl/arch/mips/crt_arch.h deleted-29
...@@ -1,29 +0,0 @@
1__asm__(
2".set push\n"
3".set noreorder\n"
4".text \n"
5".global _" START "\n"
6".global " START "\n"
7".type _" START ", @function\n"
8".type " START ", @function\n"
9"_" START ":\n"
10"" START ":\n"
11" bal 1f \n"
12" move $fp, $0 \n"
13" .gpword . \n"
14" .gpword " START "_c \n"
15".weak _DYNAMIC \n"
16".hidden _DYNAMIC \n"
17" .gpword _DYNAMIC \n"
18"1: lw $gp, 0($ra) \n"
19" subu $gp, $ra, $gp \n"
20" move $4, $sp \n"
21" lw $5, 8($ra) \n"
22" addu $5, $5, $gp \n"
23" lw $25, 4($ra) \n"
24" addu $25, $25, $gp \n"
25" and $sp, $sp, -8 \n"
26" jalr $25 \n"
27" subu $sp, $sp, 16 \n"
28".set pop \n"
29);
lib/libc/wasi/libc-top-half/musl/arch/mips/ksigaction.h deleted-13
...@@ -1,13 +0,0 @@
1#include <features.h>
2
3struct k_sigaction {
4 unsigned flags;
5 void (*handler)(int);
6 unsigned long mask[4];
7 /* The following field is past the end of the structure the
8 * kernel will read or write, and exists only to avoid having
9 * mips-specific preprocessor conditionals in sigaction.c. */
10 void (*restorer)();
11};
12
13hidden void __restore(), __restore_rt();
lib/libc/wasi/libc-top-half/musl/arch/mips/kstat.h deleted-22
...@@ -1,22 +0,0 @@
1struct kstat {
2 unsigned st_dev;
3 long __st_padding1[3];
4 ino_t st_ino;
5 mode_t st_mode;
6 nlink_t st_nlink;
7 uid_t st_uid;
8 gid_t st_gid;
9 unsigned st_rdev;
10 long __st_padding2[3];
11 off_t st_size;
12 long st_atime_sec;
13 long st_atime_nsec;
14 long st_mtime_sec;
15 long st_mtime_nsec;
16 long st_ctime_sec;
17 long st_ctime_nsec;
18 blksize_t st_blksize;
19 long __st_padding3;
20 blkcnt_t st_blocks;
21 long __st_padding4[14];
22};
lib/libc/wasi/libc-top-half/musl/arch/mips/pthread_arch.h deleted-19
...@@ -1,19 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3#if __mips_isa_rev < 2
4 register uintptr_t tp __asm__("$3");
5 __asm__ (".word 0x7c03e83b" : "=r" (tp) );
6#else
7 uintptr_t tp;
8 __asm__ ("rdhwr %0, $29" : "=r" (tp) );
9#endif
10 return tp;
11}
12
13#define TLS_ABOVE_TP
14#define GAP_ABOVE_TP 0
15
16#define TP_OFFSET 0x7000
17#define DTP_OFFSET 0x8000
18
19#define MC_PC pc
lib/libc/wasi/libc-top-half/musl/arch/mips/reloc.h deleted-50
...@@ -1,50 +0,0 @@
1#if __mips_isa_rev >= 6
2#define ISA_SUFFIX "r6"
3#else
4#define ISA_SUFFIX ""
5#endif
6
7#if __BYTE_ORDER == __LITTLE_ENDIAN
8#define ENDIAN_SUFFIX "el"
9#else
10#define ENDIAN_SUFFIX ""
11#endif
12
13#ifdef __mips_soft_float
14#define FP_SUFFIX "-sf"
15#else
16#define FP_SUFFIX ""
17#endif
18
19#define LDSO_ARCH "mips" ISA_SUFFIX ENDIAN_SUFFIX FP_SUFFIX
20
21#define TPOFF_K (-0x7000)
22
23#define REL_SYM_OR_REL R_MIPS_REL32
24#define REL_PLT R_MIPS_JUMP_SLOT
25#define REL_COPY R_MIPS_COPY
26#define REL_DTPMOD R_MIPS_TLS_DTPMOD32
27#define REL_DTPOFF R_MIPS_TLS_DTPREL32
28#define REL_TPOFF R_MIPS_TLS_TPREL32
29
30#define NEED_MIPS_GOT_RELOCS 1
31#define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP
32#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT))
33
34#define CRTJMP(pc,sp) __asm__ __volatile__( \
35 "move $sp,%1 ; jr %0" : : "r"(pc), "r"(sp) : "memory" )
36
37#define GETFUNCSYM(fp, sym, got) __asm__ ( \
38 ".hidden " #sym "\n" \
39 ".set push \n" \
40 ".set noreorder \n" \
41 " bal 1f \n" \
42 " nop \n" \
43 " .gpword . \n" \
44 " .gpword " #sym " \n" \
45 "1: lw %0, ($ra) \n" \
46 " subu %0, $ra, %0 \n" \
47 " lw $ra, 4($ra) \n" \
48 " addu %0, %0, $ra \n" \
49 ".set pop \n" \
50 : "=r"(*(fp)) : : "memory", "ra" )
lib/libc/wasi/libc-top-half/musl/arch/mips/syscall_arch.h deleted-153
...@@ -1,153 +0,0 @@
1#define __SYSCALL_LL_E(x) \
2((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
3((union { long long ll; long l[2]; }){ .ll = x }).l[1]
4#define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
5
6#define SYSCALL_RLIM_INFINITY (-1UL/2)
7
8#if __mips_isa_rev >= 6
9#define SYSCALL_CLOBBERLIST \
10 "$1", "$3", "$11", "$12", "$13", \
11 "$14", "$15", "$24", "$25", "memory"
12#else
13#define SYSCALL_CLOBBERLIST \
14 "$1", "$3", "$11", "$12", "$13", \
15 "$14", "$15", "$24", "$25", "hi", "lo", "memory"
16#endif
17
18static inline long __syscall0(long n)
19{
20 register long r7 __asm__("$7");
21 register long r2 __asm__("$2");
22 __asm__ __volatile__ (
23 "addu $2,$0,%2 ; syscall"
24 : "=&r"(r2), "=r"(r7)
25 : "ir"(n), "0"(r2)
26 : SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
27 return r7 && r2>0 ? -r2 : r2;
28}
29
30static inline long __syscall1(long n, long a)
31{
32 register long r4 __asm__("$4") = a;
33 register long r7 __asm__("$7");
34 register long r2 __asm__("$2");
35 __asm__ __volatile__ (
36 "addu $2,$0,%2 ; syscall"
37 : "=&r"(r2), "=r"(r7)
38 : "ir"(n), "0"(r2), "r"(r4)
39 : SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
40 return r7 && r2>0 ? -r2 : r2;
41}
42
43static inline long __syscall2(long n, long a, long b)
44{
45 register long r4 __asm__("$4") = a;
46 register long r5 __asm__("$5") = b;
47 register long r7 __asm__("$7");
48 register long r2 __asm__("$2");
49 __asm__ __volatile__ (
50 "addu $2,$0,%2 ; syscall"
51 : "=&r"(r2), "=r"(r7)
52 : "ir"(n), "0"(r2), "r"(r4), "r"(r5)
53 : SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
54 return r7 && r2>0 ? -r2 : r2;
55}
56
57static inline long __syscall3(long n, long a, long b, long c)
58{
59 register long r4 __asm__("$4") = a;
60 register long r5 __asm__("$5") = b;
61 register long r6 __asm__("$6") = c;
62 register long r7 __asm__("$7");
63 register long r2 __asm__("$2");
64 __asm__ __volatile__ (
65 "addu $2,$0,%2 ; syscall"
66 : "=&r"(r2), "=r"(r7)
67 : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
68 : SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
69 return r7 && r2>0 ? -r2 : r2;
70}
71
72static inline long __syscall4(long n, long a, long b, long c, long d)
73{
74 register long r4 __asm__("$4") = a;
75 register long r5 __asm__("$5") = b;
76 register long r6 __asm__("$6") = c;
77 register long r7 __asm__("$7") = d;
78 register long r2 __asm__("$2");
79 __asm__ __volatile__ (
80 "addu $2,$0,%2 ; syscall"
81 : "=&r"(r2), "+r"(r7)
82 : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
83 : SYSCALL_CLOBBERLIST, "$8", "$9", "$10");
84 return r7 && r2>0 ? -r2 : r2;
85}
86
87static inline long __syscall5(long n, long a, long b, long c, long d, long e)
88{
89 register long r4 __asm__("$4") = a;
90 register long r5 __asm__("$5") = b;
91 register long r6 __asm__("$6") = c;
92 register long r7 __asm__("$7") = d;
93 register long r8 __asm__("$8") = e;
94 register long r2 __asm__("$2");
95 __asm__ __volatile__ (
96 "subu $sp,$sp,32 ; sw $8,16($sp) ; "
97 "addu $2,$0,%3 ; syscall ;"
98 "addu $sp,$sp,32"
99 : "=&r"(r2), "+r"(r7), "+r"(r8)
100 : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
101 : SYSCALL_CLOBBERLIST, "$9", "$10");
102 return r7 && r2>0 ? -r2 : r2;
103}
104
105static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
106{
107 register long r4 __asm__("$4") = a;
108 register long r5 __asm__("$5") = b;
109 register long r6 __asm__("$6") = c;
110 register long r7 __asm__("$7") = d;
111 register long r8 __asm__("$8") = e;
112 register long r9 __asm__("$9") = f;
113 register long r2 __asm__("$2");
114 __asm__ __volatile__ (
115 "subu $sp,$sp,32 ; sw $8,16($sp) ; sw $9,20($sp) ; "
116 "addu $2,$0,%4 ; syscall ;"
117 "addu $sp,$sp,32"
118 : "=&r"(r2), "+r"(r7), "+r"(r8), "+r"(r9)
119 : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
120 : SYSCALL_CLOBBERLIST, "$10");
121 return r7 && r2>0 ? -r2 : r2;
122}
123
124static inline long __syscall7(long n, long a, long b, long c, long d, long e, long f, long g)
125{
126 register long r4 __asm__("$4") = a;
127 register long r5 __asm__("$5") = b;
128 register long r6 __asm__("$6") = c;
129 register long r7 __asm__("$7") = d;
130 register long r8 __asm__("$8") = e;
131 register long r9 __asm__("$9") = f;
132 register long r10 __asm__("$10") = g;
133 register long r2 __asm__("$2");
134 __asm__ __volatile__ (
135 "subu $sp,$sp,32 ; sw $8,16($sp) ; sw $9,20($sp) ; sw $10,24($sp) ; "
136 "addu $2,$0,%5 ; syscall ;"
137 "addu $sp,$sp,32"
138 : "=&r"(r2), "+r"(r7), "+r"(r8), "+r"(r9), "+r"(r10)
139 : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
140 : SYSCALL_CLOBBERLIST);
141 return r7 && r2>0 ? -r2 : r2;
142}
143
144#define VDSO_USEFUL
145#define VDSO_CGT32_SYM "__vdso_clock_gettime"
146#define VDSO_CGT32_VER "LINUX_2.6"
147#define VDSO_CGT_SYM "__vdso_clock_gettime64"
148#define VDSO_CGT_VER "LINUX_2.6"
149
150#define SO_SNDTIMEO_OLD 0x1005
151#define SO_RCVTIMEO_OLD 0x1006
152
153#undef SYS_socketcall
lib/libc/wasi/libc-top-half/musl/arch/mips64/atomic_arch.h deleted-56
...@@ -1,56 +0,0 @@
1#if __mips_isa_rev < 6
2#define LLSC_M "m"
3#else
4#define LLSC_M "ZC"
5#endif
6
7#define a_ll a_ll
8static inline int a_ll(volatile int *p)
9{
10 int v;
11 __asm__ __volatile__ (
12 "ll %0, %1"
13 : "=r"(v) : LLSC_M(*p));
14 return v;
15}
16
17#define a_sc a_sc
18static inline int a_sc(volatile int *p, int v)
19{
20 int r;
21 __asm__ __volatile__ (
22 "sc %0, %1"
23 : "=r"(r), "="LLSC_M(*p) : "0"(v) : "memory");
24 return r;
25}
26
27#define a_ll_p a_ll_p
28static inline void *a_ll_p(volatile void *p)
29{
30 void *v;
31 __asm__ __volatile__ (
32 "lld %0, %1"
33 : "=r"(v) : LLSC_M(*(void *volatile *)p));
34 return v;
35}
36
37#define a_sc_p a_sc_p
38static inline int a_sc_p(volatile void *p, void *v)
39{
40 long r;
41 __asm__ __volatile__ (
42 "scd %0, %1"
43 : "=r"(r), "="LLSC_M(*(void *volatile *)p) : "0"(v) : "memory");
44 return r;
45}
46
47#define a_barrier a_barrier
48static inline void a_barrier()
49{
50 __asm__ __volatile__ ("sync" : : : "memory");
51}
52
53#define a_pre_llsc a_barrier
54#define a_post_llsc a_barrier
55
56#undef LLSC_M
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/alltypes.h.in deleted-22
...@@ -1,22 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#if _MIPSEL || __MIPSEL || __MIPSEL__
6#define __BYTE_ORDER 1234
7#else
8#define __BYTE_ORDER 4321
9#endif
10
11#define __LONG_MAX 0x7fffffffffffffffL
12
13#ifndef __cplusplus
14TYPEDEF int wchar_t;
15#endif
16
17TYPEDEF float float_t;
18TYPEDEF double double_t;
19
20TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
21
22TYPEDEF unsigned nlink_t;
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/errno.h deleted-134
...@@ -1,134 +0,0 @@
1#define EPERM 1
2#define ENOENT 2
3#define ESRCH 3
4#define EINTR 4
5#define EIO 5
6#define ENXIO 6
7#define E2BIG 7
8#define ENOEXEC 8
9#define EBADF 9
10#define ECHILD 10
11#define EAGAIN 11
12#define ENOMEM 12
13#define EACCES 13
14#define EFAULT 14
15#define ENOTBLK 15
16#define EBUSY 16
17#define EEXIST 17
18#define EXDEV 18
19#define ENODEV 19
20#define ENOTDIR 20
21#define EISDIR 21
22#define EINVAL 22
23#define ENFILE 23
24#define EMFILE 24
25#define ENOTTY 25
26#define ETXTBSY 26
27#define EFBIG 27
28#define ENOSPC 28
29#define ESPIPE 29
30#define EROFS 30
31#define EMLINK 31
32#define EPIPE 32
33#define EDOM 33
34#define ERANGE 34
35#define ENOMSG 35
36#define EIDRM 36
37#define ECHRNG 37
38#define EL2NSYNC 38
39#define EL3HLT 39
40#define EL3RST 40
41#define ELNRNG 41
42#define EUNATCH 42
43#define ENOCSI 43
44#define EL2HLT 44
45#define EDEADLK 45
46#define ENOLCK 46
47#define EBADE 50
48#define EBADR 51
49#define EXFULL 52
50#define ENOANO 53
51#define EBADRQC 54
52#define EBADSLT 55
53#define EDEADLOCK 56
54#define EBFONT 59
55#define ENOSTR 60
56#define ENODATA 61
57#define ETIME 62
58#define ENOSR 63
59#define ENONET 64
60#define ENOPKG 65
61#define EREMOTE 66
62#define ENOLINK 67
63#define EADV 68
64#define ESRMNT 69
65#define ECOMM 70
66#define EPROTO 71
67#define EDOTDOT 73
68#define EMULTIHOP 74
69#define EBADMSG 77
70#define ENAMETOOLONG 78
71#define EOVERFLOW 79
72#define ENOTUNIQ 80
73#define EBADFD 81
74#define EREMCHG 82
75#define ELIBACC 83
76#define ELIBBAD 84
77#define ELIBSCN 85
78#define ELIBMAX 86
79#define ELIBEXEC 87
80#define EILSEQ 88
81#define ENOSYS 89
82#define ELOOP 90
83#define ERESTART 91
84#define ESTRPIPE 92
85#define ENOTEMPTY 93
86#define EUSERS 94
87#define ENOTSOCK 95
88#define EDESTADDRREQ 96
89#define EMSGSIZE 97
90#define EPROTOTYPE 98
91#define ENOPROTOOPT 99
92#define EPROTONOSUPPORT 120
93#define ESOCKTNOSUPPORT 121
94#define EOPNOTSUPP 122
95#define ENOTSUP EOPNOTSUPP
96#define EPFNOSUPPORT 123
97#define EAFNOSUPPORT 124
98#define EADDRINUSE 125
99#define EADDRNOTAVAIL 126
100#define ENETDOWN 127
101#define ENETUNREACH 128
102#define ENETRESET 129
103#define ECONNABORTED 130
104#define ECONNRESET 131
105#define ENOBUFS 132
106#define EISCONN 133
107#define ENOTCONN 134
108#define EUCLEAN 135
109#define ENOTNAM 137
110#define ENAVAIL 138
111#define EISNAM 139
112#define EREMOTEIO 140
113#define ESHUTDOWN 143
114#define ETOOMANYREFS 144
115#define ETIMEDOUT 145
116#define ECONNREFUSED 146
117#define EHOSTDOWN 147
118#define EHOSTUNREACH 148
119#define EWOULDBLOCK EAGAIN
120#define EALREADY 149
121#define EINPROGRESS 150
122#define ESTALE 151
123#define ECANCELED 158
124#define ENOMEDIUM 159
125#define EMEDIUMTYPE 160
126#define ENOKEY 161
127#define EKEYEXPIRED 162
128#define EKEYREVOKED 163
129#define EKEYREJECTED 164
130#define EOWNERDEAD 165
131#define ENOTRECOVERABLE 166
132#define ERFKILL 167
133#define EHWPOISON 168
134#define EDQUOT 1133
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0400
2#define O_EXCL 02000
3#define O_NOCTTY 04000
4#define O_TRUNC 01000
5#define O_APPEND 0010
6#define O_NONBLOCK 0200
7#define O_DSYNC 0020
8#define O_SYNC 040020
9#define O_RSYNC 040020
10#define O_DIRECTORY 0200000
11#define O_NOFOLLOW 0400000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 010000
15#define O_DIRECT 0100000
16#define O_LARGEFILE 020000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020200000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 24
29#define F_GETOWN 23
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 14
34#define F_SETLK 6
35#define F_SETLKW 7
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/fenv.h deleted-25
...@@ -1,25 +0,0 @@
1#ifdef __mips_soft_float
2#define FE_ALL_EXCEPT 0
3#define FE_TONEAREST 0
4#else
5#define FE_INEXACT 4
6#define FE_UNDERFLOW 8
7#define FE_OVERFLOW 16
8#define FE_DIVBYZERO 32
9#define FE_INVALID 64
10
11#define FE_ALL_EXCEPT 124
12
13#define FE_TONEAREST 0
14#define FE_TOWARDZERO 1
15#define FE_UPWARD 2
16#define FE_DOWNWARD 3
17#endif
18
19typedef unsigned short fexcept_t;
20
21typedef struct {
22 unsigned __cw;
23} fenv_t;
24
25#define FE_DFL_ENV ((const fenv_t *) -1)
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
4#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
5#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
6#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
7
8#define LDBL_MANT_DIG 113
9#define LDBL_MIN_EXP (-16381)
10#define LDBL_MAX_EXP 16384
11
12#define LDBL_DIG 33
13#define LDBL_MIN_10_EXP (-4931)
14#define LDBL_MAX_10_EXP 4932
15
16#define DECIMAL_DIG 36
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/hwcap.h deleted-3
...@@ -1,3 +0,0 @@
1#define HWCAP_MIPS_R6 (1 << 0)
2#define HWCAP_MIPS_MSA (1 << 1)
3#define HWCAP_MIPS_CRC32 (1 << 2)
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/ioctl.h deleted-114
...@@ -1,114 +0,0 @@
1#define _IOC(a,b,c,d) ( ((a)<<29) | ((b)<<8) | (c) | ((d)<<16) )
2#define _IOC_NONE 1U
3#define _IOC_READ 2U
4#define _IOC_WRITE 4U
5
6#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
7#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
8#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
9#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
10
11#define TCGETA 0x5401
12#define TCSETA 0x5402
13#define TCSETAW 0x5403
14#define TCSETAF 0x5404
15#define TCSBRK 0x5405
16#define TCXONC 0x5406
17#define TCFLSH 0x5407
18#define TCGETS 0x540D
19#define TCSETS 0x540E
20#define TCSETSW 0x540F
21#define TCSETSF 0x5410
22
23#define TIOCEXCL 0x740D
24#define TIOCNXCL 0x740E
25#define TIOCOUTQ 0x7472
26#define TIOCSTI 0x5472
27#define TIOCMGET 0x741D
28#define TIOCMBIS 0x741B
29#define TIOCMBIC 0x741C
30#define TIOCMSET 0x741A
31
32#define TIOCPKT 0x5470
33#define TIOCSWINSZ _IOW('t', 103, struct winsize)
34#define TIOCGWINSZ _IOR('t', 104, struct winsize)
35#define TIOCNOTTY 0x5471
36#define TIOCSETD 0x7401
37#define TIOCGETD 0x7400
38
39#define FIOCLEX 0x6601
40#define FIONCLEX 0x6602
41#define FIOASYNC 0x667D
42#define FIONBIO 0x667E
43#define FIOQSIZE 0x667F
44
45#define TIOCGLTC 0x7474
46#define TIOCSLTC 0x7475
47#define TIOCSPGRP _IOW('t', 118, int)
48#define TIOCGPGRP _IOR('t', 119, int)
49#define TIOCCONS _IOW('t', 120, int)
50
51#define FIONREAD 0x467F
52#define TIOCINQ FIONREAD
53
54#define TIOCGETP 0x7408
55#define TIOCSETP 0x7409
56#define TIOCSETN 0x740A
57
58#define TIOCSBRK 0x5427
59#define TIOCCBRK 0x5428
60#define TIOCGSID 0x7416
61#define TIOCGRS485 _IOR('T', 0x2E, char[32])
62#define TIOCSRS485 _IOWR('T', 0x2F, char[32])
63#define TIOCGPTN _IOR('T', 0x30, unsigned int)
64#define TIOCSPTLCK _IOW('T', 0x31, int)
65#define TIOCGDEV _IOR('T', 0x32, unsigned int)
66#define TIOCSIG _IOW('T', 0x36, int)
67#define TIOCVHANGUP 0x5437
68#define TIOCGPKT _IOR('T', 0x38, int)
69#define TIOCGPTLCK _IOR('T', 0x39, int)
70#define TIOCGEXCL _IOR('T', 0x40, int)
71#define TIOCGPTPEER _IO('T', 0x41)
72
73#define TIOCSCTTY 0x5480
74#define TIOCGSOFTCAR 0x5481
75#define TIOCSSOFTCAR 0x5482
76#define TIOCLINUX 0x5483
77#define TIOCGSERIAL 0x5484
78#define TIOCSSERIAL 0x5485
79#define TCSBRKP 0x5486
80
81#define TIOCSERCONFIG 0x5488
82#define TIOCSERGWILD 0x5489
83#define TIOCSERSWILD 0x548A
84#define TIOCGLCKTRMIOS 0x548B
85#define TIOCSLCKTRMIOS 0x548C
86#define TIOCSERGSTRUCT 0x548D
87#define TIOCSERGETLSR 0x548E
88#define TIOCSERGETMULTI 0x548F
89#define TIOCSERSETMULTI 0x5490
90#define TIOCMIWAIT 0x5491
91#define TIOCGICOUNT 0x5492
92
93#define TIOCM_LE 0x001
94#define TIOCM_DTR 0x002
95#define TIOCM_RTS 0x004
96#define TIOCM_ST 0x010
97#define TIOCM_SR 0x020
98#define TIOCM_CTS 0x040
99#define TIOCM_CAR 0x100
100#define TIOCM_CD TIOCM_CAR
101#define TIOCM_RNG 0x200
102#define TIOCM_RI TIOCM_RNG
103#define TIOCM_DSR 0x400
104#define TIOCM_OUT1 0x2000
105#define TIOCM_OUT2 0x4000
106#define TIOCM_LOOP 0x8000
107
108#define FIOGETOWN _IOR('f', 123, int)
109#define FIOSETOWN _IOW('f', 124, int)
110#define SIOCATMARK _IOR('s', 7, int)
111#define SIOCSPGRP _IOW('s', 8, pid_t)
112#define SIOCGPGRP _IOR('s', 9, pid_t)
113#define SIOCGSTAMP 0x8906
114#define SIOCGSTAMPNS 0x8907
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/ipc.h deleted-12
...@@ -1,12 +0,0 @@
1struct ipc_perm {
2 key_t __ipc_perm_key;
3 uid_t uid;
4 gid_t gid;
5 uid_t cuid;
6 gid_t cgid;
7 mode_t mode;
8 int __ipc_perm_seq;
9 int __pad1;
10 unsigned long __unused1;
11 unsigned long __unused2;
12};
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/mman.h deleted-25
...@@ -1,25 +0,0 @@
1#undef MAP_ANON
2#define MAP_ANON 0x800
3#undef MAP_NORESERVE
4#define MAP_NORESERVE 0x0400
5#undef MAP_GROWSDOWN
6#define MAP_GROWSDOWN 0x1000
7#undef MAP_DENYWRITE
8#define MAP_DENYWRITE 0x2000
9#undef MAP_EXECUTABLE
10#define MAP_EXECUTABLE 0x4000
11#undef MAP_LOCKED
12#define MAP_LOCKED 0x8000
13#undef MAP_POPULATE
14#define MAP_POPULATE 0x10000
15#undef MAP_NONBLOCK
16#define MAP_NONBLOCK 0x20000
17#undef MAP_STACK
18#define MAP_STACK 0x40000
19#undef MAP_HUGETLB
20#define MAP_HUGETLB 0x80000
21#undef MAP_SYNC
22
23#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
24#undef MADV_SOFT_OFFLINE
25#endif
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/poll.h deleted-2
...@@ -1,2 +0,0 @@
1#define POLLWRNORM POLLOUT
2#define POLLWRBAND 0x100
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_LP64_OFFBIG 1
2#define _POSIX_V7_LP64_OFFBIG 1
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/ptrace.h deleted-9
...@@ -1,9 +0,0 @@
1#define PTRACE_GET_THREAD_AREA 25
2#define PTRACE_SET_THREAD_AREA 26
3#define PTRACE_PEEKTEXT_3264 0xc0
4#define PTRACE_PEEKDATA_3264 0xc1
5#define PTRACE_POKETEXT_3264 0xc2
6#define PTRACE_POKEDATA_3264 0xc3
7#define PTRACE_GET_THREAD_AREA_3264 0xc4
8#define PTRACE_GET_WATCH_REGS 0xd0
9#define PTRACE_SET_WATCH_REGS 0xd1
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/reg.h deleted-47
...@@ -1,47 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
3
4#define EF_R0 0
5#define EF_R1 1
6#define EF_R2 2
7#define EF_R3 3
8#define EF_R4 4
9#define EF_R5 5
10#define EF_R6 6
11#define EF_R7 7
12#define EF_R8 8
13#define EF_R9 9
14#define EF_R10 10
15#define EF_R11 11
16#define EF_R12 12
17#define EF_R13 13
18#define EF_R14 14
19#define EF_R15 15
20#define EF_R16 16
21#define EF_R17 17
22#define EF_R18 18
23#define EF_R19 19
24#define EF_R20 20
25#define EF_R21 21
26#define EF_R22 22
27#define EF_R23 23
28#define EF_R24 24
29#define EF_R25 25
30
31#define EF_R26 26
32#define EF_R27 27
33#define EF_R28 28
34#define EF_R29 29
35#define EF_R30 30
36#define EF_R31 31
37
38#define EF_LO 32
39#define EF_HI 33
40
41#define EF_CP0_EPC 34
42#define EF_CP0_BADVADDR 35
43#define EF_CP0_STATUS 36
44#define EF_CP0_CAUSE 37
45#define EF_UNUSED0 38
46
47#define EF_SIZE 304
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/resource.h deleted-5
...@@ -1,5 +0,0 @@
1#define RLIMIT_NOFILE 5
2#define RLIMIT_AS 6
3#define RLIMIT_RSS 7
4#define RLIMIT_NPROC 8
5#define RLIMIT_MEMLOCK 9
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long long __jmp_buf[23];
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/signal.h deleted-143
...@@ -1,143 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10typedef unsigned long long greg_t, gregset_t[32];
11
12typedef struct {
13 union {
14 double fp_dregs[32];
15 struct {
16 float _fp_fregs;
17 unsigned _fp_pad;
18 } fp_fregs[32];
19 } fp_r;
20} fpregset_t;
21
22struct sigcontext {
23 unsigned long long sc_regs[32];
24 unsigned long long sc_fpregs[32];
25 unsigned long long sc_mdhi;
26 unsigned long long sc_hi1;
27 unsigned long long sc_hi2;
28 unsigned long long sc_hi3;
29 unsigned long long sc_mdlo;
30 unsigned long long sc_lo1;
31 unsigned long long sc_lo2;
32 unsigned long long sc_lo3;
33 unsigned long long sc_pc;
34 unsigned int sc_fpc_csr;
35 unsigned int sc_used_math;
36 unsigned int sc_dsp;
37 unsigned int sc_reserved;
38};
39
40typedef struct {
41 gregset_t gregs;
42 fpregset_t fpregs;
43 greg_t mdhi;
44 greg_t hi1;
45 greg_t hi2;
46 greg_t hi3;
47 greg_t mdlo;
48 greg_t lo1;
49 greg_t lo2;
50 greg_t lo3;
51 greg_t pc;
52 unsigned int fpc_csr;
53 unsigned int used_math;
54 unsigned int dsp;
55 unsigned int reserved;
56} mcontext_t;
57
58#else
59typedef struct {
60 unsigned long long __mc1[32];
61 double __mc2[32];
62 unsigned long long __mc3[9];
63 unsigned __mc4[4];
64} mcontext_t;
65#endif
66
67struct sigaltstack {
68 void *ss_sp;
69 size_t ss_size;
70 int ss_flags;
71};
72
73typedef struct __ucontext {
74 unsigned long uc_flags;
75 struct __ucontext *uc_link;
76 stack_t uc_stack;
77 mcontext_t uc_mcontext;
78 sigset_t uc_sigmask;
79} ucontext_t;
80
81#define SA_NOCLDSTOP 1
82#define SA_NOCLDWAIT 0x10000
83#define SA_SIGINFO 8
84#define SA_ONSTACK 0x08000000
85#define SA_RESTART 0x10000000
86#define SA_NODEFER 0x40000000
87#define SA_RESETHAND 0x80000000
88#define SA_RESTORER 0x04000000
89
90#undef SIG_BLOCK
91#undef SIG_UNBLOCK
92#undef SIG_SETMASK
93#define SIG_BLOCK 1
94#define SIG_UNBLOCK 2
95#define SIG_SETMASK 3
96
97#undef SI_ASYNCIO
98#undef SI_MESGQ
99#undef SI_TIMER
100#define SI_ASYNCIO (-2)
101#define SI_MESGQ (-4)
102#define SI_TIMER (-3)
103
104#define __SI_SWAP_ERRNO_CODE
105
106#endif
107
108#define SIGHUP 1
109#define SIGINT 2
110#define SIGQUIT 3
111#define SIGILL 4
112#define SIGTRAP 5
113#define SIGABRT 6
114#define SIGIOT SIGABRT
115#define SIGEMT 7
116#define SIGFPE 8
117#define SIGKILL 9
118#define SIGBUS 10
119#define SIGSEGV 11
120#define SIGSYS 12
121#define SIGPIPE 13
122#define SIGALRM 14
123#define SIGTERM 15
124#define SIGUSR1 16
125#define SIGUSR2 17
126#define SIGCHLD 18
127#define SIGPWR 19
128#define SIGWINCH 20
129#define SIGURG 21
130#define SIGIO 22
131#define SIGPOLL SIGIO
132#define SIGSTOP 23
133#define SIGTSTP 24
134#define SIGCONT 25
135#define SIGTTIN 26
136#define SIGTTOU 27
137#define SIGVTALRM 28
138#define SIGPROF 29
139#define SIGXCPU 30
140#define SIGXFSZ 31
141#define SIGUNUSED SIGSYS
142
143#define _NSIG 128
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/socket.h deleted-35
...@@ -1,35 +0,0 @@
1#define SOCK_STREAM 2
2#define SOCK_DGRAM 1
3#define SOL_SOCKET 65535
4#define SO_DEBUG 1
5
6#define SO_REUSEADDR 0x0004
7#define SO_KEEPALIVE 0x0008
8#define SO_DONTROUTE 0x0010
9#define SO_BROADCAST 0x0020
10#define SO_LINGER 0x0080
11#define SO_OOBINLINE 0x0100
12#define SO_REUSEPORT 0x0200
13#define SO_SNDBUF 0x1001
14#define SO_RCVBUF 0x1002
15#define SO_SNDLOWAT 0x1003
16#define SO_RCVLOWAT 0x1004
17#define SO_RCVTIMEO 0x1006
18#define SO_SNDTIMEO 0x1005
19#define SO_ERROR 0x1007
20#define SO_TYPE 0x1008
21#define SO_ACCEPTCONN 0x1009
22#define SO_PROTOCOL 0x1028
23#define SO_DOMAIN 0x1029
24
25#define SO_NO_CHECK 11
26#define SO_PRIORITY 12
27#define SO_BSDCOMPAT 14
28#define SO_PASSCRED 17
29#define SO_PEERCRED 18
30#define SO_PEERSEC 30
31#define SO_SNDBUFFORCE 31
32#define SO_RCVBUFFORCE 33
33
34#define SOCK_NONBLOCK 0200
35#define SOCK_CLOEXEC 02000000
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/stat.h deleted-20
...@@ -1,20 +0,0 @@
1struct stat {
2 dev_t st_dev;
3 int __pad1[3];
4 ino_t st_ino;
5 mode_t st_mode;
6 nlink_t st_nlink;
7 uid_t st_uid;
8 gid_t st_gid;
9 dev_t st_rdev;
10 unsigned int __pad2[2];
11 off_t st_size;
12 int __pad3;
13 struct timespec st_atim;
14 struct timespec st_mtim;
15 struct timespec st_ctim;
16 blksize_t st_blksize;
17 unsigned int __pad4;
18 blkcnt_t st_blocks;
19 int __pad5[14];
20};
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/statfs.h deleted-8
...@@ -1,8 +0,0 @@
1struct statfs {
2 unsigned long f_type, f_bsize, f_frsize;
3 fsblkcnt_t f_blocks, f_bfree;
4 fsfilcnt_t f_files, f_ffree;
5 fsblkcnt_t f_bavail;
6 fsid_t f_fsid;
7 unsigned long f_namelen, f_flags, f_spare[5];
8};
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT64_MIN
16#define INTPTR_MAX INT64_MAX
17#define UINTPTR_MAX UINT64_MAX
18#define PTRDIFF_MIN INT64_MIN
19#define PTRDIFF_MAX INT64_MAX
20#define SIZE_MAX UINT64_MAX
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/syscall.h.in deleted-345
...@@ -1,345 +0,0 @@
1#define __NR_read 5000
2#define __NR_write 5001
3#define __NR_open 5002
4#define __NR_close 5003
5#define __NR_stat 5004
6#define __NR_fstat 5005
7#define __NR_lstat 5006
8#define __NR_poll 5007
9#define __NR_lseek 5008
10#define __NR_mmap 5009
11#define __NR_mprotect 5010
12#define __NR_munmap 5011
13#define __NR_brk 5012
14#define __NR_rt_sigaction 5013
15#define __NR_rt_sigprocmask 5014
16#define __NR_ioctl 5015
17#define __NR_pread64 5016
18#define __NR_pwrite64 5017
19#define __NR_readv 5018
20#define __NR_writev 5019
21#define __NR_access 5020
22#define __NR_pipe 5021
23#define __NR__newselect 5022
24#define __NR_sched_yield 5023
25#define __NR_mremap 5024
26#define __NR_msync 5025
27#define __NR_mincore 5026
28#define __NR_madvise 5027
29#define __NR_shmget 5028
30#define __NR_shmat 5029
31#define __NR_shmctl 5030
32#define __NR_dup 5031
33#define __NR_dup2 5032
34#define __NR_pause 5033
35#define __NR_nanosleep 5034
36#define __NR_getitimer 5035
37#define __NR_setitimer 5036
38#define __NR_alarm 5037
39#define __NR_getpid 5038
40#define __NR_sendfile 5039
41#define __NR_socket 5040
42#define __NR_connect 5041
43#define __NR_accept 5042
44#define __NR_sendto 5043
45#define __NR_recvfrom 5044
46#define __NR_sendmsg 5045
47#define __NR_recvmsg 5046
48#define __NR_shutdown 5047
49#define __NR_bind 5048
50#define __NR_listen 5049
51#define __NR_getsockname 5050
52#define __NR_getpeername 5051
53#define __NR_socketpair 5052
54#define __NR_setsockopt 5053
55#define __NR_getsockopt 5054
56#define __NR_clone 5055
57#define __NR_fork 5056
58#define __NR_execve 5057
59#define __NR_exit 5058
60#define __NR_wait4 5059
61#define __NR_kill 5060
62#define __NR_uname 5061
63#define __NR_semget 5062
64#define __NR_semop 5063
65#define __NR_semctl 5064
66#define __NR_shmdt 5065
67#define __NR_msgget 5066
68#define __NR_msgsnd 5067
69#define __NR_msgrcv 5068
70#define __NR_msgctl 5069
71#define __NR_fcntl 5070
72#define __NR_flock 5071
73#define __NR_fsync 5072
74#define __NR_fdatasync 5073
75#define __NR_truncate 5074
76#define __NR_ftruncate 5075
77#define __NR_getdents 5076
78#define __NR_getcwd 5077
79#define __NR_chdir 5078
80#define __NR_fchdir 5079
81#define __NR_rename 5080
82#define __NR_mkdir 5081
83#define __NR_rmdir 5082
84#define __NR_creat 5083
85#define __NR_link 5084
86#define __NR_unlink 5085
87#define __NR_symlink 5086
88#define __NR_readlink 5087
89#define __NR_chmod 5088
90#define __NR_fchmod 5089
91#define __NR_chown 5090
92#define __NR_fchown 5091
93#define __NR_lchown 5092
94#define __NR_umask 5093
95#define __NR_gettimeofday 5094
96#define __NR_getrlimit 5095
97#define __NR_getrusage 5096
98#define __NR_sysinfo 5097
99#define __NR_times 5098
100#define __NR_ptrace 5099
101#define __NR_getuid 5100
102#define __NR_syslog 5101
103#define __NR_getgid 5102
104#define __NR_setuid 5103
105#define __NR_setgid 5104
106#define __NR_geteuid 5105
107#define __NR_getegid 5106
108#define __NR_setpgid 5107
109#define __NR_getppid 5108
110#define __NR_getpgrp 5109
111#define __NR_setsid 5110
112#define __NR_setreuid 5111
113#define __NR_setregid 5112
114#define __NR_getgroups 5113
115#define __NR_setgroups 5114
116#define __NR_setresuid 5115
117#define __NR_getresuid 5116
118#define __NR_setresgid 5117
119#define __NR_getresgid 5118
120#define __NR_getpgid 5119
121#define __NR_setfsuid 5120
122#define __NR_setfsgid 5121
123#define __NR_getsid 5122
124#define __NR_capget 5123
125#define __NR_capset 5124
126#define __NR_rt_sigpending 5125
127#define __NR_rt_sigtimedwait 5126
128#define __NR_rt_sigqueueinfo 5127
129#define __NR_rt_sigsuspend 5128
130#define __NR_sigaltstack 5129
131#define __NR_utime 5130
132#define __NR_mknod 5131
133#define __NR_personality 5132
134#define __NR_ustat 5133
135#define __NR_statfs 5134
136#define __NR_fstatfs 5135
137#define __NR_sysfs 5136
138#define __NR_getpriority 5137
139#define __NR_setpriority 5138
140#define __NR_sched_setparam 5139
141#define __NR_sched_getparam 5140
142#define __NR_sched_setscheduler 5141
143#define __NR_sched_getscheduler 5142
144#define __NR_sched_get_priority_max 5143
145#define __NR_sched_get_priority_min 5144
146#define __NR_sched_rr_get_interval 5145
147#define __NR_mlock 5146
148#define __NR_munlock 5147
149#define __NR_mlockall 5148
150#define __NR_munlockall 5149
151#define __NR_vhangup 5150
152#define __NR_pivot_root 5151
153#define __NR__sysctl 5152
154#define __NR_prctl 5153
155#define __NR_adjtimex 5154
156#define __NR_setrlimit 5155
157#define __NR_chroot 5156
158#define __NR_sync 5157
159#define __NR_acct 5158
160#define __NR_settimeofday 5159
161#define __NR_mount 5160
162#define __NR_umount2 5161
163#define __NR_swapon 5162
164#define __NR_swapoff 5163
165#define __NR_reboot 5164
166#define __NR_sethostname 5165
167#define __NR_setdomainname 5166
168#define __NR_create_module 5167
169#define __NR_init_module 5168
170#define __NR_delete_module 5169
171#define __NR_get_kernel_syms 5170
172#define __NR_query_module 5171
173#define __NR_quotactl 5172
174#define __NR_nfsservctl 5173
175#define __NR_getpmsg 5174
176#define __NR_putpmsg 5175
177#define __NR_afs_syscall 5176
178#define __NR_reserved177 5177
179#define __NR_gettid 5178
180#define __NR_readahead 5179
181#define __NR_setxattr 5180
182#define __NR_lsetxattr 5181
183#define __NR_fsetxattr 5182
184#define __NR_getxattr 5183
185#define __NR_lgetxattr 5184
186#define __NR_fgetxattr 5185
187#define __NR_listxattr 5186
188#define __NR_llistxattr 5187
189#define __NR_flistxattr 5188
190#define __NR_removexattr 5189
191#define __NR_lremovexattr 5190
192#define __NR_fremovexattr 5191
193#define __NR_tkill 5192
194#define __NR_reserved193 5193
195#define __NR_futex 5194
196#define __NR_sched_setaffinity 5195
197#define __NR_sched_getaffinity 5196
198#define __NR_cacheflush 5197
199#define __NR_cachectl 5198
200#define __NR_sysmips 5199
201#define __NR_io_setup 5200
202#define __NR_io_destroy 5201
203#define __NR_io_getevents 5202
204#define __NR_io_submit 5203
205#define __NR_io_cancel 5204
206#define __NR_exit_group 5205
207#define __NR_lookup_dcookie 5206
208#define __NR_epoll_create 5207
209#define __NR_epoll_ctl 5208
210#define __NR_epoll_wait 5209
211#define __NR_remap_file_pages 5210
212#define __NR_rt_sigreturn 5211
213#define __NR_set_tid_address 5212
214#define __NR_restart_syscall 5213
215#define __NR_semtimedop 5214
216#define __NR_fadvise64 5215
217#define __NR_timer_create 5216
218#define __NR_timer_settime 5217
219#define __NR_timer_gettime 5218
220#define __NR_timer_getoverrun 5219
221#define __NR_timer_delete 5220
222#define __NR_clock_settime 5221
223#define __NR_clock_gettime 5222
224#define __NR_clock_getres 5223
225#define __NR_clock_nanosleep 5224
226#define __NR_tgkill 5225
227#define __NR_utimes 5226
228#define __NR_mbind 5227
229#define __NR_get_mempolicy 5228
230#define __NR_set_mempolicy 5229
231#define __NR_mq_open 5230
232#define __NR_mq_unlink 5231
233#define __NR_mq_timedsend 5232
234#define __NR_mq_timedreceive 5233
235#define __NR_mq_notify 5234
236#define __NR_mq_getsetattr 5235
237#define __NR_vserver 5236
238#define __NR_waitid 5237
239#define __NR_add_key 5239
240#define __NR_request_key 5240
241#define __NR_keyctl 5241
242#define __NR_set_thread_area 5242
243#define __NR_inotify_init 5243
244#define __NR_inotify_add_watch 5244
245#define __NR_inotify_rm_watch 5245
246#define __NR_migrate_pages 5246
247#define __NR_openat 5247
248#define __NR_mkdirat 5248
249#define __NR_mknodat 5249
250#define __NR_fchownat 5250
251#define __NR_futimesat 5251
252#define __NR_newfstatat 5252
253#define __NR_unlinkat 5253
254#define __NR_renameat 5254
255#define __NR_linkat 5255
256#define __NR_symlinkat 5256
257#define __NR_readlinkat 5257
258#define __NR_fchmodat 5258
259#define __NR_faccessat 5259
260#define __NR_pselect6 5260
261#define __NR_ppoll 5261
262#define __NR_unshare 5262
263#define __NR_splice 5263
264#define __NR_sync_file_range 5264
265#define __NR_tee 5265
266#define __NR_vmsplice 5266
267#define __NR_move_pages 5267
268#define __NR_set_robust_list 5268
269#define __NR_get_robust_list 5269
270#define __NR_kexec_load 5270
271#define __NR_getcpu 5271
272#define __NR_epoll_pwait 5272
273#define __NR_ioprio_set 5273
274#define __NR_ioprio_get 5274
275#define __NR_utimensat 5275
276#define __NR_signalfd 5276
277#define __NR_timerfd 5277
278#define __NR_eventfd 5278
279#define __NR_fallocate 5279
280#define __NR_timerfd_create 5280
281#define __NR_timerfd_gettime 5281
282#define __NR_timerfd_settime 5282
283#define __NR_signalfd4 5283
284#define __NR_eventfd2 5284
285#define __NR_epoll_create1 5285
286#define __NR_dup3 5286
287#define __NR_pipe2 5287
288#define __NR_inotify_init1 5288
289#define __NR_preadv 5289
290#define __NR_pwritev 5290
291#define __NR_rt_tgsigqueueinfo 5291
292#define __NR_perf_event_open 5292
293#define __NR_accept4 5293
294#define __NR_recvmmsg 5294
295#define __NR_fanotify_init 5295
296#define __NR_fanotify_mark 5296
297#define __NR_prlimit64 5297
298#define __NR_name_to_handle_at 5298
299#define __NR_open_by_handle_at 5299
300#define __NR_clock_adjtime 5300
301#define __NR_syncfs 5301
302#define __NR_sendmmsg 5302
303#define __NR_setns 5303
304#define __NR_process_vm_readv 5304
305#define __NR_process_vm_writev 5305
306#define __NR_kcmp 5306
307#define __NR_finit_module 5307
308#define __NR_getdents64 5308
309#define __NR_sched_setattr 5309
310#define __NR_sched_getattr 5310
311#define __NR_renameat2 5311
312#define __NR_seccomp 5312
313#define __NR_getrandom 5313
314#define __NR_memfd_create 5314
315#define __NR_bpf 5315
316#define __NR_execveat 5316
317#define __NR_userfaultfd 5317
318#define __NR_membarrier 5318
319#define __NR_mlock2 5319
320#define __NR_copy_file_range 5320
321#define __NR_preadv2 5321
322#define __NR_pwritev2 5322
323#define __NR_pkey_mprotect 5323
324#define __NR_pkey_alloc 5324
325#define __NR_pkey_free 5325
326#define __NR_statx 5326
327#define __NR_rseq 5327
328#define __NR_io_pgetevents 5328
329#define __NR_pidfd_send_signal 5424
330#define __NR_io_uring_setup 5425
331#define __NR_io_uring_enter 5426
332#define __NR_io_uring_register 5427
333#define __NR_open_tree 5428
334#define __NR_move_mount 5429
335#define __NR_fsopen 5430
336#define __NR_fsconfig 5431
337#define __NR_fsmount 5432
338#define __NR_fspick 5433
339#define __NR_pidfd_open 5434
340#define __NR_clone3 5435
341#define __NR_close_range 5436
342#define __NR_openat2 5437
343#define __NR_pidfd_getfd 5438
344#define __NR_faccessat2 5439
345
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/termios.h deleted-169
...@@ -1,169 +0,0 @@
1struct termios {
2 tcflag_t c_iflag;
3 tcflag_t c_oflag;
4 tcflag_t c_cflag;
5 tcflag_t c_lflag;
6 cc_t c_line;
7 cc_t c_cc[NCCS];
8 speed_t __c_ispeed;
9 speed_t __c_ospeed;
10};
11
12#define VINTR 0
13#define VQUIT 1
14#define VERASE 2
15#define VKILL 3
16#define VMIN 4
17#define VTIME 5
18#define VEOL2 6
19#define VSWTC 7
20#define VSWTCH 7
21#define VSTART 8
22#define VSTOP 9
23#define VSUSP 10
24#define VREPRINT 12
25#define VDISCARD 13
26#define VWERASE 14
27#define VLNEXT 15
28#define VEOF 16
29#define VEOL 17
30
31#define IGNBRK 0000001
32#define BRKINT 0000002
33#define IGNPAR 0000004
34#define PARMRK 0000010
35#define INPCK 0000020
36#define ISTRIP 0000040
37#define INLCR 0000100
38#define IGNCR 0000200
39#define ICRNL 0000400
40#define IUCLC 0001000
41#define IXON 0002000
42#define IXANY 0004000
43#define IXOFF 0010000
44#define IMAXBEL 0020000
45#define IUTF8 0040000
46
47#define OPOST 0000001
48#define OLCUC 0000002
49#define ONLCR 0000004
50#define OCRNL 0000010
51#define ONOCR 0000020
52#define ONLRET 0000040
53#define OFILL 0000100
54#define OFDEL 0000200
55#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
56#define NLDLY 0000400
57#define NL0 0000000
58#define NL1 0000400
59#define CRDLY 0003000
60#define CR0 0000000
61#define CR1 0001000
62#define CR2 0002000
63#define CR3 0003000
64#define TABDLY 0014000
65#define TAB0 0000000
66#define TAB1 0004000
67#define TAB2 0010000
68#define TAB3 0014000
69#define BSDLY 0020000
70#define BS0 0000000
71#define BS1 0020000
72#define FFDLY 0100000
73#define FF0 0000000
74#define FF1 0100000
75#endif
76
77#define VTDLY 0040000
78#define VT0 0000000
79#define VT1 0040000
80
81#define B0 0000000
82#define B50 0000001
83#define B75 0000002
84#define B110 0000003
85#define B134 0000004
86#define B150 0000005
87#define B200 0000006
88#define B300 0000007
89#define B600 0000010
90#define B1200 0000011
91#define B1800 0000012
92#define B2400 0000013
93#define B4800 0000014
94#define B9600 0000015
95#define B19200 0000016
96#define B38400 0000017
97
98#define B57600 0010001
99#define B115200 0010002
100#define B230400 0010003
101#define B460800 0010004
102#define B500000 0010005
103#define B576000 0010006
104#define B921600 0010007
105#define B1000000 0010010
106#define B1152000 0010011
107#define B1500000 0010012
108#define B2000000 0010013
109#define B2500000 0010014
110#define B3000000 0010015
111#define B3500000 0010016
112#define B4000000 0010017
113
114#define CSIZE 0000060
115#define CS5 0000000
116#define CS6 0000020
117#define CS7 0000040
118#define CS8 0000060
119#define CSTOPB 0000100
120#define CREAD 0000200
121#define PARENB 0000400
122#define PARODD 0001000
123#define HUPCL 0002000
124#define CLOCAL 0004000
125
126#define ISIG 0000001
127#define ICANON 0000002
128#define ECHO 0000010
129#define ECHOE 0000020
130#define ECHOK 0000040
131#define ECHONL 0000100
132#define NOFLSH 0000200
133#define IEXTEN 0000400
134#define TOSTOP 0100000
135#define ITOSTOP 0100000
136
137#define TCOOFF 0
138#define TCOON 1
139#define TCIOFF 2
140#define TCION 3
141
142#define TCIFLUSH 0
143#define TCOFLUSH 1
144#define TCIOFLUSH 2
145
146#define TCSANOW 0
147#define TCSADRAIN 1
148#define TCSAFLUSH 2
149
150#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
151#define EXTA 0000016
152#define EXTB 0000017
153#define CBAUD 0010017
154#define CBAUDEX 0010000
155#define CIBAUD 002003600000
156#define CMSPAR 010000000000
157#define CRTSCTS 020000000000
158
159#define XCASE 0000004
160#define ECHOCTL 0001000
161#define ECHOPRT 0002000
162#define ECHOKE 0004000
163#define FLUSHO 0020000
164#define PENDIN 0040000
165#define EXTPROC 0200000
166
167#define XTABS 0014000
168#define TIOCSER_TEMT 1
169#endif
lib/libc/wasi/libc-top-half/musl/arch/mips64/bits/user.h deleted-15
...@@ -1,15 +0,0 @@
1struct user {
2 unsigned long regs[102];
3 unsigned long u_tsize, u_dsize, u_ssize;
4 unsigned long long start_code, start_data, start_stack;
5 long long signal;
6 unsigned long long *u_ar0;
7 unsigned long long magic;
8 char u_comm[32];
9};
10
11#define ELF_NGREG 45
12#define ELF_NFPREG 33
13
14typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
15typedef double elf_fpreg_t, elf_fpregset_t[ELF_NFPREG];
lib/libc/wasi/libc-top-half/musl/arch/mips64/crt_arch.h deleted-33
...@@ -1,33 +0,0 @@
1__asm__(
2".set push\n"
3".set noreorder\n"
4".text \n"
5".global _" START "\n"
6".global " START "\n"
7".global " START "_data\n"
8".type _" START ", @function\n"
9".type " START ", @function\n"
10".type " START "_data, @function\n"
11"_" START ":\n"
12"" START ":\n"
13".align 8 \n"
14" bal 1f \n"
15" move $fp, $0 \n"
16"" START "_data: \n"
17" .gpdword " START "_data \n"
18" .gpdword " START "_c \n"
19".weak _DYNAMIC \n"
20".hidden _DYNAMIC \n"
21" .gpdword _DYNAMIC \n"
22"1: ld $gp, 0($ra) \n"
23" dsubu $gp, $ra, $gp \n"
24" move $4, $sp \n"
25" ld $5, 16($ra) \n"
26" daddu $5, $5, $gp \n"
27" ld $25, 8($ra) \n"
28" daddu $25, $25, $gp \n"
29" and $sp, $sp, -16 \n"
30" jalr $25 \n"
31" nop \n"
32".set pop \n"
33);
lib/libc/wasi/libc-top-half/musl/arch/mips64/ksigaction.h deleted-10
...@@ -1,10 +0,0 @@
1#include <features.h>
2
3struct k_sigaction {
4 unsigned flags;
5 void (*handler)(int);
6 unsigned long mask[2];
7 void (*restorer)();
8};
9
10hidden void __restore(), __restore_rt();
lib/libc/wasi/libc-top-half/musl/arch/mips64/kstat.h deleted-21
...@@ -1,21 +0,0 @@
1struct kstat {
2 unsigned st_dev;
3 int __pad1[3];
4 ino_t st_ino;
5 mode_t st_mode;
6 unsigned st_nlink;
7 uid_t st_uid;
8 gid_t st_gid;
9 unsigned st_rdev;
10 int __pad2[3];
11 off_t st_size;
12 int st_atime_sec;
13 int st_atime_nsec;
14 int st_mtime_sec;
15 int st_mtime_nsec;
16 int st_ctime_sec;
17 int st_ctime_nsec;
18 unsigned st_blksize;
19 unsigned __pad3;
20 blkcnt_t st_blocks;
21};
lib/libc/wasi/libc-top-half/musl/arch/mips64/pthread_arch.h deleted-19
...@@ -1,19 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3#if __mips_isa_rev < 2
4 register uintptr_t tp __asm__("$3");
5 __asm__ (".word 0x7c03e83b" : "=r" (tp) );
6#else
7 uintptr_t tp;
8 __asm__ ("rdhwr %0, $29" : "=r" (tp) );
9#endif
10 return tp;
11}
12
13#define TLS_ABOVE_TP
14#define GAP_ABOVE_TP 0
15
16#define TP_OFFSET 0x7000
17#define DTP_OFFSET 0x8000
18
19#define MC_PC pc
lib/libc/wasi/libc-top-half/musl/arch/mips64/reloc.h deleted-60
...@@ -1,60 +0,0 @@
1#if __mips_isa_rev >= 6
2#define ISA_SUFFIX "r6"
3#else
4#define ISA_SUFFIX ""
5#endif
6
7#if __BYTE_ORDER == __LITTLE_ENDIAN
8#define ENDIAN_SUFFIX "el"
9#else
10#define ENDIAN_SUFFIX ""
11#endif
12
13#ifdef __mips_soft_float
14#define FP_SUFFIX "-sf"
15#else
16#define FP_SUFFIX ""
17#endif
18
19#define LDSO_ARCH "mips64" ISA_SUFFIX ENDIAN_SUFFIX FP_SUFFIX
20
21#define TPOFF_K (-0x7000)
22
23#define REL_SYM_OR_REL 4611
24#define REL_PLT R_MIPS_JUMP_SLOT
25#define REL_COPY R_MIPS_COPY
26#define REL_DTPMOD R_MIPS_TLS_DTPMOD64
27#define REL_DTPOFF R_MIPS_TLS_DTPREL64
28#define REL_TPOFF R_MIPS_TLS_TPREL64
29
30#include <endian.h>
31
32#undef R_TYPE
33#undef R_SYM
34#undef R_INFO
35#define R_TYPE(x) (be64toh(x)&0x7fffffff)
36#define R_SYM(x) (be32toh(be64toh(x)>>32))
37#define R_INFO(s,t) (htobe64((uint64_t)htobe32(s)<<32 | (uint64_t)t))
38
39#define NEED_MIPS_GOT_RELOCS 1
40#define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP
41#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT))
42
43#define CRTJMP(pc,sp) __asm__ __volatile__( \
44 "move $sp,%1 ; jr %0" : : "r"(pc), "r"(sp) : "memory" )
45
46#define GETFUNCSYM(fp, sym, got) __asm__ ( \
47 ".hidden " #sym "\n" \
48 ".set push \n" \
49 ".set noreorder \n" \
50 ".align 8 \n" \
51 " bal 1f \n" \
52 " nop \n" \
53 " .gpdword . \n" \
54 " .gpdword " #sym " \n" \
55 "1: ld %0, ($ra) \n" \
56 " dsubu %0, $ra, %0 \n" \
57 " ld $ra, 8($ra) \n" \
58 " daddu %0, %0, $ra \n" \
59 ".set pop \n" \
60 : "=r"(*(fp)) : : "memory", "ra" )
lib/libc/wasi/libc-top-half/musl/arch/mips64/syscall_arch.h deleted-128
...@@ -1,128 +0,0 @@
1#define __SYSCALL_LL_E(x) (x)
2#define __SYSCALL_LL_O(x) (x)
3
4#define SYSCALL_RLIM_INFINITY (-1UL/2)
5
6#if __mips_isa_rev >= 6
7#define SYSCALL_CLOBBERLIST \
8 "$1", "$3", "$10", "$11", "$12", "$13", \
9 "$14", "$15", "$24", "$25", "memory"
10#else
11#define SYSCALL_CLOBBERLIST \
12 "$1", "$3", "$10", "$11", "$12", "$13", \
13 "$14", "$15", "$24", "$25", "hi", "lo", "memory"
14#endif
15
16static inline long __syscall0(long n)
17{
18 register long r7 __asm__("$7");
19 register long r2 __asm__("$2");
20 __asm__ __volatile__ (
21 "daddu $2,$0,%2 ; syscall"
22 : "=&r"(r2), "=r"(r7)
23 : "ir"(n), "0"(r2)
24 : SYSCALL_CLOBBERLIST);
25 return r7 && r2>0 ? -r2 : r2;
26}
27
28static inline long __syscall1(long n, long a)
29{
30 register long r4 __asm__("$4") = a;
31 register long r7 __asm__("$7");
32 register long r2 __asm__("$2");
33 __asm__ __volatile__ (
34 "daddu $2,$0,%2 ; syscall"
35 : "=&r"(r2), "=r"(r7)
36 : "ir"(n), "0"(r2), "r"(r4)
37 : SYSCALL_CLOBBERLIST);
38 return r7 && r2>0 ? -r2 : r2;
39}
40
41static inline long __syscall2(long n, long a, long b)
42{
43 register long r4 __asm__("$4") = a;
44 register long r5 __asm__("$5") = b;
45 register long r7 __asm__("$7");
46 register long r2 __asm__("$2");
47
48 __asm__ __volatile__ (
49 "daddu $2,$0,%2 ; syscall"
50 : "=&r"(r2), "=r"(r7)
51 : "ir"(n), "0"(r2), "r"(r4), "r"(r5)
52 : SYSCALL_CLOBBERLIST);
53 return r7 && r2>0 ? -r2 : r2;
54}
55
56static inline long __syscall3(long n, long a, long b, long c)
57{
58 register long r4 __asm__("$4") = a;
59 register long r5 __asm__("$5") = b;
60 register long r6 __asm__("$6") = c;
61 register long r7 __asm__("$7");
62 register long r2 __asm__("$2");
63
64 __asm__ __volatile__ (
65 "daddu $2,$0,%2 ; syscall"
66 : "=&r"(r2), "=r"(r7)
67 : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
68 : SYSCALL_CLOBBERLIST);
69 return r7 && r2>0 ? -r2 : r2;
70}
71
72static inline long __syscall4(long n, long a, long b, long c, long d)
73{
74 register long r4 __asm__("$4") = a;
75 register long r5 __asm__("$5") = b;
76 register long r6 __asm__("$6") = c;
77 register long r7 __asm__("$7") = d;
78 register long r2 __asm__("$2");
79
80 __asm__ __volatile__ (
81 "daddu $2,$0,%2 ; syscall"
82 : "=&r"(r2), "+r"(r7)
83 : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
84 : SYSCALL_CLOBBERLIST);
85 return r7 && r2>0 ? -r2 : r2;
86}
87
88static inline long __syscall5(long n, long a, long b, long c, long d, long e)
89{
90 register long r4 __asm__("$4") = a;
91 register long r5 __asm__("$5") = b;
92 register long r6 __asm__("$6") = c;
93 register long r7 __asm__("$7") = d;
94 register long r8 __asm__("$8") = e;
95 register long r2 __asm__("$2");
96
97 __asm__ __volatile__ (
98 "daddu $2,$0,%2 ; syscall"
99 : "=&r"(r2), "+r"(r7)
100 : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6), "r"(r8)
101 : SYSCALL_CLOBBERLIST);
102 return r7 && r2>0 ? -r2 : r2;
103}
104
105static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
106{
107 register long r4 __asm__("$4") = a;
108 register long r5 __asm__("$5") = b;
109 register long r6 __asm__("$6") = c;
110 register long r7 __asm__("$7") = d;
111 register long r8 __asm__("$8") = e;
112 register long r9 __asm__("$9") = f;
113 register long r2 __asm__("$2");
114
115 __asm__ __volatile__ (
116 "daddu $2,$0,%2 ; syscall"
117 : "=&r"(r2), "+r"(r7)
118 : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6), "r"(r8), "r"(r9)
119 : SYSCALL_CLOBBERLIST);
120 return r7 && r2>0 ? -r2 : r2;
121}
122
123#define VDSO_USEFUL
124#define VDSO_CGT_SYM "__vdso_clock_gettime"
125#define VDSO_CGT_VER "LINUX_2.6"
126
127#define SO_SNDTIMEO_OLD 0x1005
128#define SO_RCVTIMEO_OLD 0x1006
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/arch.mak deleted-1
...@@ -1 +0,0 @@
1COMPAT_SRC_DIRS = compat/time32
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/atomic_arch.h deleted-52
...@@ -1,52 +0,0 @@
1#if __mips_isa_rev < 6
2#define LLSC_M "m"
3#else
4#define LLSC_M "ZC"
5#endif
6
7#define a_ll a_ll
8static inline int a_ll(volatile int *p)
9{
10 int v;
11#if __mips < 2
12 __asm__ __volatile__ (
13 ".set push ; .set mips2\n\t"
14 "ll %0, %1"
15 "\n\t.set pop"
16 : "=r"(v) : "m"(*p));
17#else
18 __asm__ __volatile__ (
19 "ll %0, %1"
20 : "=r"(v) : LLSC_M(*p));
21#endif
22 return v;
23}
24
25#define a_sc a_sc
26static inline int a_sc(volatile int *p, int v)
27{
28 int r;
29#if __mips < 2
30 __asm__ __volatile__ (
31 ".set push ; .set mips2\n\t"
32 "sc %0, %1"
33 "\n\t.set pop"
34 : "=r"(r), "=m"(*p) : "0"(v) : "memory");
35#else
36 __asm__ __volatile__ (
37 "sc %0, %1"
38 : "=r"(r), "="LLSC_M(*p) : "0"(v) : "memory");
39#endif
40 return r;
41}
42
43#define a_barrier a_barrier
44static inline void a_barrier()
45{
46 __asm__ __volatile__ ("sync" : : : "memory");
47}
48
49#define a_pre_llsc a_barrier
50#define a_post_llsc a_barrier
51
52#undef LLSC_M
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/alltypes.h.in deleted-21
...@@ -1,21 +0,0 @@
1#define _REDIR_TIME64 1
2#define _Addr int
3#define _Int64 long long
4#define _Reg int
5
6#if _MIPSEL || __MIPSEL || __MIPSEL__
7#define __BYTE_ORDER 1234
8#else
9#define __BYTE_ORDER 4321
10#endif
11
12#define __LONG_MAX 0x7fffffffL
13
14#ifndef __cplusplus
15TYPEDEF int wchar_t;
16#endif
17
18TYPEDEF float float_t;
19TYPEDEF double double_t;
20
21TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/errno.h deleted-134
...@@ -1,134 +0,0 @@
1#define EPERM 1
2#define ENOENT 2
3#define ESRCH 3
4#define EINTR 4
5#define EIO 5
6#define ENXIO 6
7#define E2BIG 7
8#define ENOEXEC 8
9#define EBADF 9
10#define ECHILD 10
11#define EAGAIN 11
12#define ENOMEM 12
13#define EACCES 13
14#define EFAULT 14
15#define ENOTBLK 15
16#define EBUSY 16
17#define EEXIST 17
18#define EXDEV 18
19#define ENODEV 19
20#define ENOTDIR 20
21#define EISDIR 21
22#define EINVAL 22
23#define ENFILE 23
24#define EMFILE 24
25#define ENOTTY 25
26#define ETXTBSY 26
27#define EFBIG 27
28#define ENOSPC 28
29#define ESPIPE 29
30#define EROFS 30
31#define EMLINK 31
32#define EPIPE 32
33#define EDOM 33
34#define ERANGE 34
35#define ENOMSG 35
36#define EIDRM 36
37#define ECHRNG 37
38#define EL2NSYNC 38
39#define EL3HLT 39
40#define EL3RST 40
41#define ELNRNG 41
42#define EUNATCH 42
43#define ENOCSI 43
44#define EL2HLT 44
45#define EDEADLK 45
46#define ENOLCK 46
47#define EBADE 50
48#define EBADR 51
49#define EXFULL 52
50#define ENOANO 53
51#define EBADRQC 54
52#define EBADSLT 55
53#define EDEADLOCK 56
54#define EBFONT 59
55#define ENOSTR 60
56#define ENODATA 61
57#define ETIME 62
58#define ENOSR 63
59#define ENONET 64
60#define ENOPKG 65
61#define EREMOTE 66
62#define ENOLINK 67
63#define EADV 68
64#define ESRMNT 69
65#define ECOMM 70
66#define EPROTO 71
67#define EDOTDOT 73
68#define EMULTIHOP 74
69#define EBADMSG 77
70#define ENAMETOOLONG 78
71#define EOVERFLOW 79
72#define ENOTUNIQ 80
73#define EBADFD 81
74#define EREMCHG 82
75#define ELIBACC 83
76#define ELIBBAD 84
77#define ELIBSCN 85
78#define ELIBMAX 86
79#define ELIBEXEC 87
80#define EILSEQ 88
81#define ENOSYS 89
82#define ELOOP 90
83#define ERESTART 91
84#define ESTRPIPE 92
85#define ENOTEMPTY 93
86#define EUSERS 94
87#define ENOTSOCK 95
88#define EDESTADDRREQ 96
89#define EMSGSIZE 97
90#define EPROTOTYPE 98
91#define ENOPROTOOPT 99
92#define EPROTONOSUPPORT 120
93#define ESOCKTNOSUPPORT 121
94#define EOPNOTSUPP 122
95#define ENOTSUP EOPNOTSUPP
96#define EPFNOSUPPORT 123
97#define EAFNOSUPPORT 124
98#define EADDRINUSE 125
99#define EADDRNOTAVAIL 126
100#define ENETDOWN 127
101#define ENETUNREACH 128
102#define ENETRESET 129
103#define ECONNABORTED 130
104#define ECONNRESET 131
105#define ENOBUFS 132
106#define EISCONN 133
107#define ENOTCONN 134
108#define EUCLEAN 135
109#define ENOTNAM 137
110#define ENAVAIL 138
111#define EISNAM 139
112#define EREMOTEIO 140
113#define ESHUTDOWN 143
114#define ETOOMANYREFS 144
115#define ETIMEDOUT 145
116#define ECONNREFUSED 146
117#define EHOSTDOWN 147
118#define EHOSTUNREACH 148
119#define EWOULDBLOCK EAGAIN
120#define EALREADY 149
121#define EINPROGRESS 150
122#define ESTALE 151
123#define ECANCELED 158
124#define ENOMEDIUM 159
125#define EMEDIUMTYPE 160
126#define ENOKEY 161
127#define EKEYEXPIRED 162
128#define EKEYREVOKED 163
129#define EKEYREJECTED 164
130#define EOWNERDEAD 165
131#define ENOTRECOVERABLE 166
132#define ERFKILL 167
133#define EHWPOISON 168
134#define EDQUOT 1133
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0400
2#define O_EXCL 02000
3#define O_NOCTTY 04000
4#define O_TRUNC 01000
5#define O_APPEND 0010
6#define O_NONBLOCK 0200
7#define O_DSYNC 0020
8#define O_SYNC 040020
9#define O_RSYNC 040020
10#define O_DIRECTORY 0200000
11#define O_NOFOLLOW 0400000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 010000
15#define O_DIRECT 0100000
16#define O_LARGEFILE 020000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020200000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 24
29#define F_GETOWN 23
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 33
34#define F_SETLK 34
35#define F_SETLKW 35
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/fenv.h deleted-25
...@@ -1,25 +0,0 @@
1#ifdef __mips_soft_float
2#define FE_ALL_EXCEPT 0
3#define FE_TONEAREST 0
4#else
5#define FE_INEXACT 4
6#define FE_UNDERFLOW 8
7#define FE_OVERFLOW 16
8#define FE_DIVBYZERO 32
9#define FE_INVALID 64
10
11#define FE_ALL_EXCEPT 124
12
13#define FE_TONEAREST 0
14#define FE_TOWARDZERO 1
15#define FE_UPWARD 2
16#define FE_DOWNWARD 3
17#endif
18
19typedef unsigned short fexcept_t;
20
21typedef struct {
22 unsigned __cw;
23} fenv_t;
24
25#define FE_DFL_ENV ((const fenv_t *) -1)
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
4#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
5#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
6#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
7
8#define LDBL_MANT_DIG 113
9#define LDBL_MIN_EXP (-16381)
10#define LDBL_MAX_EXP 16384
11
12#define LDBL_DIG 33
13#define LDBL_MIN_10_EXP (-4931)
14#define LDBL_MAX_10_EXP 4932
15
16#define DECIMAL_DIG 36
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/hwcap.h deleted-3
...@@ -1,3 +0,0 @@
1#define HWCAP_MIPS_R6 (1 << 0)
2#define HWCAP_MIPS_MSA (1 << 1)
3#define HWCAP_MIPS_CRC32 (1 << 2)
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/ioctl.h deleted-114
...@@ -1,114 +0,0 @@
1#define _IOC(a,b,c,d) ( ((a)<<29) | ((b)<<8) | (c) | ((d)<<16) )
2#define _IOC_NONE 1U
3#define _IOC_READ 2U
4#define _IOC_WRITE 4U
5
6#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
7#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
8#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
9#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
10
11#define TCGETA 0x5401
12#define TCSETA 0x5402
13#define TCSETAW 0x5403
14#define TCSETAF 0x5404
15#define TCSBRK 0x5405
16#define TCXONC 0x5406
17#define TCFLSH 0x5407
18#define TCGETS 0x540D
19#define TCSETS 0x540E
20#define TCSETSW 0x540F
21#define TCSETSF 0x5410
22
23#define TIOCEXCL 0x740D
24#define TIOCNXCL 0x740E
25#define TIOCOUTQ 0x7472
26#define TIOCSTI 0x5472
27#define TIOCMGET 0x741D
28#define TIOCMBIS 0x741B
29#define TIOCMBIC 0x741C
30#define TIOCMSET 0x741A
31
32#define TIOCPKT 0x5470
33#define TIOCSWINSZ _IOW('t', 103, struct winsize)
34#define TIOCGWINSZ _IOR('t', 104, struct winsize)
35#define TIOCNOTTY 0x5471
36#define TIOCSETD 0x7401
37#define TIOCGETD 0x7400
38
39#define FIOCLEX 0x6601
40#define FIONCLEX 0x6602
41#define FIOASYNC 0x667D
42#define FIONBIO 0x667E
43#define FIOQSIZE 0x667F
44
45#define TIOCGLTC 0x7474
46#define TIOCSLTC 0x7475
47#define TIOCSPGRP _IOW('t', 118, int)
48#define TIOCGPGRP _IOR('t', 119, int)
49#define TIOCCONS _IOW('t', 120, int)
50
51#define FIONREAD 0x467F
52#define TIOCINQ FIONREAD
53
54#define TIOCGETP 0x7408
55#define TIOCSETP 0x7409
56#define TIOCSETN 0x740A
57
58#define TIOCSBRK 0x5427
59#define TIOCCBRK 0x5428
60#define TIOCGSID 0x7416
61#define TIOCGRS485 _IOR('T', 0x2E, char[32])
62#define TIOCSRS485 _IOWR('T', 0x2F, char[32])
63#define TIOCGPTN _IOR('T', 0x30, unsigned int)
64#define TIOCSPTLCK _IOW('T', 0x31, int)
65#define TIOCGDEV _IOR('T', 0x32, unsigned int)
66#define TIOCSIG _IOW('T', 0x36, int)
67#define TIOCVHANGUP 0x5437
68#define TIOCGPKT _IOR('T', 0x38, int)
69#define TIOCGPTLCK _IOR('T', 0x39, int)
70#define TIOCGEXCL _IOR('T', 0x40, int)
71#define TIOCGPTPEER _IO('T', 0x41)
72
73#define TIOCSCTTY 0x5480
74#define TIOCGSOFTCAR 0x5481
75#define TIOCSSOFTCAR 0x5482
76#define TIOCLINUX 0x5483
77#define TIOCGSERIAL 0x5484
78#define TIOCSSERIAL 0x5485
79#define TCSBRKP 0x5486
80
81#define TIOCSERCONFIG 0x5488
82#define TIOCSERGWILD 0x5489
83#define TIOCSERSWILD 0x548A
84#define TIOCGLCKTRMIOS 0x548B
85#define TIOCSLCKTRMIOS 0x548C
86#define TIOCSERGSTRUCT 0x548D
87#define TIOCSERGETLSR 0x548E
88#define TIOCSERGETMULTI 0x548F
89#define TIOCSERSETMULTI 0x5490
90#define TIOCMIWAIT 0x5491
91#define TIOCGICOUNT 0x5492
92
93#define TIOCM_LE 0x001
94#define TIOCM_DTR 0x002
95#define TIOCM_RTS 0x004
96#define TIOCM_ST 0x010
97#define TIOCM_SR 0x020
98#define TIOCM_CTS 0x040
99#define TIOCM_CAR 0x100
100#define TIOCM_CD TIOCM_CAR
101#define TIOCM_RNG 0x200
102#define TIOCM_RI TIOCM_RNG
103#define TIOCM_DSR 0x400
104#define TIOCM_OUT1 0x2000
105#define TIOCM_OUT2 0x4000
106#define TIOCM_LOOP 0x8000
107
108#define FIOGETOWN _IOR('f', 123, int)
109#define FIOSETOWN _IOW('f', 124, int)
110#define SIOCATMARK _IOR('s', 7, int)
111#define SIOCSPGRP _IOW('s', 8, pid_t)
112#define SIOCGPGRP _IOR('s', 9, pid_t)
113#define SIOCGSTAMP _IOR(0x89, 6, char[16])
114#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/ipcstat.h deleted-1
...@@ -1 +0,0 @@
1#define IPC_STAT 0x102
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/mman.h deleted-25
...@@ -1,25 +0,0 @@
1#undef MAP_ANON
2#define MAP_ANON 0x800
3#undef MAP_NORESERVE
4#define MAP_NORESERVE 0x0400
5#undef MAP_GROWSDOWN
6#define MAP_GROWSDOWN 0x1000
7#undef MAP_DENYWRITE
8#define MAP_DENYWRITE 0x2000
9#undef MAP_EXECUTABLE
10#define MAP_EXECUTABLE 0x4000
11#undef MAP_LOCKED
12#define MAP_LOCKED 0x8000
13#undef MAP_POPULATE
14#define MAP_POPULATE 0x10000
15#undef MAP_NONBLOCK
16#define MAP_NONBLOCK 0x20000
17#undef MAP_STACK
18#define MAP_STACK 0x40000
19#undef MAP_HUGETLB
20#define MAP_HUGETLB 0x80000
21#undef MAP_SYNC
22
23#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
24#undef MADV_SOFT_OFFLINE
25#endif
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/msg.h deleted-27
...@@ -1,27 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3#if _MIPSEL || __MIPSEL || __MIPSEL__
4 unsigned long __msg_stime_lo;
5 unsigned long __msg_stime_hi;
6 unsigned long __msg_rtime_lo;
7 unsigned long __msg_rtime_hi;
8 unsigned long __msg_ctime_lo;
9 unsigned long __msg_ctime_hi;
10#else
11 unsigned long __msg_stime_hi;
12 unsigned long __msg_stime_lo;
13 unsigned long __msg_rtime_hi;
14 unsigned long __msg_rtime_lo;
15 unsigned long __msg_ctime_hi;
16 unsigned long __msg_ctime_lo;
17#endif
18 unsigned long msg_cbytes;
19 msgqnum_t msg_qnum;
20 msglen_t msg_qbytes;
21 pid_t msg_lspid;
22 pid_t msg_lrpid;
23 unsigned long __unused[2];
24 time_t msg_stime;
25 time_t msg_rtime;
26 time_t msg_ctime;
27};
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/poll.h deleted-2
...@@ -1,2 +0,0 @@
1#define POLLWRNORM POLLOUT
2#define POLLWRBAND 0x100
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_ILP32_OFFBIG 1
2#define _POSIX_V7_ILP32_OFFBIG 1
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/ptrace.h deleted-9
...@@ -1,9 +0,0 @@
1#define PTRACE_GET_THREAD_AREA 25
2#define PTRACE_SET_THREAD_AREA 26
3#define PTRACE_PEEKTEXT_3264 0xc0
4#define PTRACE_PEEKDATA_3264 0xc1
5#define PTRACE_POKETEXT_3264 0xc2
6#define PTRACE_POKEDATA_3264 0xc3
7#define PTRACE_GET_THREAD_AREA_3264 0xc4
8#define PTRACE_GET_WATCH_REGS 0xd0
9#define PTRACE_SET_WATCH_REGS 0xd1
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/reg.h deleted-47
...@@ -1,47 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
3
4#define EF_R0 0
5#define EF_R1 1
6#define EF_R2 2
7#define EF_R3 3
8#define EF_R4 4
9#define EF_R5 5
10#define EF_R6 6
11#define EF_R7 7
12#define EF_R8 8
13#define EF_R9 9
14#define EF_R10 10
15#define EF_R11 11
16#define EF_R12 12
17#define EF_R13 13
18#define EF_R14 14
19#define EF_R15 15
20#define EF_R16 16
21#define EF_R17 17
22#define EF_R18 18
23#define EF_R19 19
24#define EF_R20 20
25#define EF_R21 21
26#define EF_R22 22
27#define EF_R23 23
28#define EF_R24 24
29#define EF_R25 25
30
31#define EF_R26 26
32#define EF_R27 27
33#define EF_R28 28
34#define EF_R29 29
35#define EF_R30 30
36#define EF_R31 31
37
38#define EF_LO 32
39#define EF_HI 33
40
41#define EF_CP0_EPC 34
42#define EF_CP0_BADVADDR 35
43#define EF_CP0_STATUS 36
44#define EF_CP0_CAUSE 37
45#define EF_UNUSED0 38
46
47#define EF_SIZE 304
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/resource.h deleted-5
...@@ -1,5 +0,0 @@
1#define RLIMIT_NOFILE 5
2#define RLIMIT_AS 6
3#define RLIMIT_RSS 7
4#define RLIMIT_NPROC 8
5#define RLIMIT_MEMLOCK 9
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/sem.h deleted-16
...@@ -1,16 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_ctime_lo;
5#if __BYTE_ORDER == __LITTLE_ENDIAN
6 unsigned short sem_nsems;
7 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
8#else
9 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
10 unsigned short sem_nsems;
11#endif
12 unsigned long __sem_otime_hi;
13 unsigned long __sem_ctime_hi;
14 time_t sem_otime;
15 time_t sem_ctime;
16};
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long long __jmp_buf[23];
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/shm.h deleted-29
...@@ -1,29 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_dtime_lo;
8 unsigned long __shm_ctime_lo;
9 pid_t shm_cpid;
10 pid_t shm_lpid;
11 unsigned long shm_nattch;
12 unsigned short __shm_atime_hi;
13 unsigned short __shm_dtime_hi;
14 unsigned short __shm_ctime_hi;
15 unsigned short __pad1;
16 time_t shm_atime;
17 time_t shm_dtime;
18 time_t shm_ctime;
19};
20
21struct shminfo {
22 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
23};
24
25struct shm_info {
26 int __used_ids;
27 unsigned long shm_tot, shm_rss, shm_swp;
28 unsigned long __swap_attempts, __swap_successes;
29};
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/signal.h deleted-143
...@@ -1,143 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10typedef unsigned long long greg_t, gregset_t[32];
11
12typedef struct {
13 union {
14 double fp_dregs[32];
15 struct {
16 float _fp_fregs;
17 unsigned _fp_pad;
18 } fp_fregs[32];
19 } fp_r;
20} fpregset_t;
21
22struct sigcontext {
23 unsigned long long sc_regs[32];
24 unsigned long long sc_fpregs[32];
25 unsigned long long sc_mdhi;
26 unsigned long long sc_hi1;
27 unsigned long long sc_hi2;
28 unsigned long long sc_hi3;
29 unsigned long long sc_mdlo;
30 unsigned long long sc_lo1;
31 unsigned long long sc_lo2;
32 unsigned long long sc_lo3;
33 unsigned long long sc_pc;
34 unsigned int sc_fpc_csr;
35 unsigned int sc_used_math;
36 unsigned int sc_dsp;
37 unsigned int sc_reserved;
38};
39
40typedef struct {
41 gregset_t gregs;
42 fpregset_t fpregs;
43 greg_t mdhi;
44 greg_t hi1;
45 greg_t hi2;
46 greg_t hi3;
47 greg_t mdlo;
48 greg_t lo1;
49 greg_t lo2;
50 greg_t lo3;
51 greg_t pc;
52 unsigned int fpc_csr;
53 unsigned int used_math;
54 unsigned int dsp;
55 unsigned int reserved;
56} mcontext_t;
57
58#else
59typedef struct {
60 unsigned long long __mc1[32];
61 double __mc2[32];
62 unsigned long long __mc3[9];
63 unsigned __mc4[4];
64} mcontext_t;
65#endif
66
67struct sigaltstack {
68 void *ss_sp;
69 size_t ss_size;
70 int ss_flags;
71};
72
73typedef struct __ucontext {
74 unsigned long uc_flags;
75 struct __ucontext *uc_link;
76 stack_t uc_stack;
77 mcontext_t uc_mcontext;
78 sigset_t uc_sigmask;
79} ucontext_t;
80
81#define SA_NOCLDSTOP 1
82#define SA_NOCLDWAIT 0x10000
83#define SA_SIGINFO 8
84#define SA_ONSTACK 0x08000000
85#define SA_RESTART 0x10000000
86#define SA_NODEFER 0x40000000
87#define SA_RESETHAND 0x80000000
88#define SA_RESTORER 0x04000000
89
90#undef SIG_BLOCK
91#undef SIG_UNBLOCK
92#undef SIG_SETMASK
93#define SIG_BLOCK 1
94#define SIG_UNBLOCK 2
95#define SIG_SETMASK 3
96
97#undef SI_ASYNCIO
98#undef SI_MESGQ
99#undef SI_TIMER
100#define SI_ASYNCIO (-2)
101#define SI_MESGQ (-4)
102#define SI_TIMER (-3)
103
104#define __SI_SWAP_ERRNO_CODE
105
106#endif
107
108#define SIGHUP 1
109#define SIGINT 2
110#define SIGQUIT 3
111#define SIGILL 4
112#define SIGTRAP 5
113#define SIGABRT 6
114#define SIGIOT SIGABRT
115#define SIGEMT 7
116#define SIGFPE 8
117#define SIGKILL 9
118#define SIGBUS 10
119#define SIGSEGV 11
120#define SIGSYS 12
121#define SIGPIPE 13
122#define SIGALRM 14
123#define SIGTERM 15
124#define SIGUSR1 16
125#define SIGUSR2 17
126#define SIGCHLD 18
127#define SIGPWR 19
128#define SIGWINCH 20
129#define SIGURG 21
130#define SIGIO 22
131#define SIGPOLL SIGIO
132#define SIGSTOP 23
133#define SIGTSTP 24
134#define SIGCONT 25
135#define SIGTTIN 26
136#define SIGTTOU 27
137#define SIGVTALRM 28
138#define SIGPROF 29
139#define SIGXCPU 30
140#define SIGXFSZ 31
141#define SIGUNUSED SIGSYS
142
143#define _NSIG 128
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/socket.h deleted-35
...@@ -1,35 +0,0 @@
1#define SOCK_STREAM 2
2#define SOCK_DGRAM 1
3
4#define SOL_SOCKET 65535
5
6#define SO_DEBUG 1
7
8#define SO_REUSEADDR 0x0004
9#define SO_KEEPALIVE 0x0008
10#define SO_DONTROUTE 0x0010
11#define SO_BROADCAST 0x0020
12#define SO_LINGER 0x0080
13#define SO_OOBINLINE 0x0100
14#define SO_REUSEPORT 0x0200
15#define SO_SNDBUF 0x1001
16#define SO_RCVBUF 0x1002
17#define SO_SNDLOWAT 0x1003
18#define SO_RCVLOWAT 0x1004
19#define SO_ERROR 0x1007
20#define SO_TYPE 0x1008
21#define SO_ACCEPTCONN 0x1009
22#define SO_PROTOCOL 0x1028
23#define SO_DOMAIN 0x1029
24
25#define SO_NO_CHECK 11
26#define SO_PRIORITY 12
27#define SO_BSDCOMPAT 14
28#define SO_PASSCRED 17
29#define SO_PEERCRED 18
30#define SO_PEERSEC 30
31#define SO_SNDBUFFORCE 31
32#define SO_RCVBUFFORCE 33
33
34#define SOCK_NONBLOCK 0200
35#define SOCK_CLOEXEC 02000000
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/stat.h deleted-23
...@@ -1,23 +0,0 @@
1struct stat {
2 dev_t st_dev;
3 long __pad1[2];
4 ino_t st_ino;
5 mode_t st_mode;
6 nlink_t st_nlink;
7 uid_t st_uid;
8 gid_t st_gid;
9 dev_t st_rdev;
10 long __pad2[2];
11 off_t st_size;
12 struct {
13 long tv_sec;
14 long tv_nsec;
15 } __st_atim32, __st_mtim32, __st_ctim32;
16 blksize_t st_blksize;
17 long __pad3;
18 blkcnt_t st_blocks;
19 struct timespec st_atim;
20 struct timespec st_mtim;
21 struct timespec st_ctim;
22 long __pad4[2];
23};
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/statfs.h deleted-8
...@@ -1,8 +0,0 @@
1struct statfs {
2 unsigned long f_type, f_bsize, f_frsize;
3 fsblkcnt_t f_blocks, f_bfree;
4 fsfilcnt_t f_files, f_ffree;
5 fsblkcnt_t f_bavail;
6 fsid_t f_fsid;
7 unsigned long f_namelen, f_flags, f_spare[5];
8};
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT32_MIN
16#define INTPTR_MAX INT32_MAX
17#define UINTPTR_MAX UINT32_MAX
18#define PTRDIFF_MIN INT32_MIN
19#define PTRDIFF_MAX INT32_MAX
20#define SIZE_MAX UINT32_MAX
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/syscall.h.in deleted-369
...@@ -1,369 +0,0 @@
1#define __NR_read 6000
2#define __NR_write 6001
3#define __NR_open 6002
4#define __NR_close 6003
5#define __NR_stat 6004
6#define __NR_fstat 6005
7#define __NR_lstat 6006
8#define __NR_poll 6007
9#define __NR_lseek 6008
10#define __NR_mmap 6009
11#define __NR_mprotect 6010
12#define __NR_munmap 6011
13#define __NR_brk 6012
14#define __NR_rt_sigaction 6013
15#define __NR_rt_sigprocmask 6014
16#define __NR_ioctl 6015
17#define __NR_pread64 6016
18#define __NR_pwrite64 6017
19#define __NR_readv 6018
20#define __NR_writev 6019
21#define __NR_access 6020
22#define __NR_pipe 6021
23#define __NR__newselect 6022
24#define __NR_sched_yield 6023
25#define __NR_mremap 6024
26#define __NR_msync 6025
27#define __NR_mincore 6026
28#define __NR_madvise 6027
29#define __NR_shmget 6028
30#define __NR_shmat 6029
31#define __NR_shmctl 6030
32#define __NR_dup 6031
33#define __NR_dup2 6032
34#define __NR_pause 6033
35#define __NR_nanosleep 6034
36#define __NR_getitimer 6035
37#define __NR_setitimer 6036
38#define __NR_alarm 6037
39#define __NR_getpid 6038
40#define __NR_sendfile 6039
41#define __NR_socket 6040
42#define __NR_connect 6041
43#define __NR_accept 6042
44#define __NR_sendto 6043
45#define __NR_recvfrom 6044
46#define __NR_sendmsg 6045
47#define __NR_recvmsg 6046
48#define __NR_shutdown 6047
49#define __NR_bind 6048
50#define __NR_listen 6049
51#define __NR_getsockname 6050
52#define __NR_getpeername 6051
53#define __NR_socketpair 6052
54#define __NR_setsockopt 6053
55#define __NR_getsockopt 6054
56#define __NR_clone 6055
57#define __NR_fork 6056
58#define __NR_execve 6057
59#define __NR_exit 6058
60#define __NR_wait4 6059
61#define __NR_kill 6060
62#define __NR_uname 6061
63#define __NR_semget 6062
64#define __NR_semop 6063
65#define __NR_semctl 6064
66#define __NR_shmdt 6065
67#define __NR_msgget 6066
68#define __NR_msgsnd 6067
69#define __NR_msgrcv 6068
70#define __NR_msgctl 6069
71#define __NR_fcntl 6070
72#define __NR_flock 6071
73#define __NR_fsync 6072
74#define __NR_fdatasync 6073
75#define __NR_truncate 6074
76#define __NR_ftruncate 6075
77#define __NR_getdents 6076
78#define __NR_getcwd 6077
79#define __NR_chdir 6078
80#define __NR_fchdir 6079
81#define __NR_rename 6080
82#define __NR_mkdir 6081
83#define __NR_rmdir 6082
84#define __NR_creat 6083
85#define __NR_link 6084
86#define __NR_unlink 6085
87#define __NR_symlink 6086
88#define __NR_readlink 6087
89#define __NR_chmod 6088
90#define __NR_fchmod 6089
91#define __NR_chown 6090
92#define __NR_fchown 6091
93#define __NR_lchown 6092
94#define __NR_umask 6093
95#define __NR_gettimeofday_time32 6094
96#define __NR_getrlimit 6095
97#define __NR_getrusage 6096
98#define __NR_sysinfo 6097
99#define __NR_times 6098
100#define __NR_ptrace 6099
101#define __NR_getuid 6100
102#define __NR_syslog 6101
103#define __NR_getgid 6102
104#define __NR_setuid 6103
105#define __NR_setgid 6104
106#define __NR_geteuid 6105
107#define __NR_getegid 6106
108#define __NR_setpgid 6107
109#define __NR_getppid 6108
110#define __NR_getpgrp 6109
111#define __NR_setsid 6110
112#define __NR_setreuid 6111
113#define __NR_setregid 6112
114#define __NR_getgroups 6113
115#define __NR_setgroups 6114
116#define __NR_setresuid 6115
117#define __NR_getresuid 6116
118#define __NR_setresgid 6117
119#define __NR_getresgid 6118
120#define __NR_getpgid 6119
121#define __NR_setfsuid 6120
122#define __NR_setfsgid 6121
123#define __NR_getsid 6122
124#define __NR_capget 6123
125#define __NR_capset 6124
126#define __NR_rt_sigpending 6125
127#define __NR_rt_sigtimedwait 6126
128#define __NR_rt_sigqueueinfo 6127
129#define __NR_rt_sigsuspend 6128
130#define __NR_sigaltstack 6129
131#define __NR_utime 6130
132#define __NR_mknod 6131
133#define __NR_personality 6132
134#define __NR_ustat 6133
135#define __NR_statfs 6134
136#define __NR_fstatfs 6135
137#define __NR_sysfs 6136
138#define __NR_getpriority 6137
139#define __NR_setpriority 6138
140#define __NR_sched_setparam 6139
141#define __NR_sched_getparam 6140
142#define __NR_sched_setscheduler 6141
143#define __NR_sched_getscheduler 6142
144#define __NR_sched_get_priority_max 6143
145#define __NR_sched_get_priority_min 6144
146#define __NR_sched_rr_get_interval 6145
147#define __NR_mlock 6146
148#define __NR_munlock 6147
149#define __NR_mlockall 6148
150#define __NR_munlockall 6149
151#define __NR_vhangup 6150
152#define __NR_pivot_root 6151
153#define __NR__sysctl 6152
154#define __NR_prctl 6153
155#define __NR_adjtimex 6154
156#define __NR_setrlimit 6155
157#define __NR_chroot 6156
158#define __NR_sync 6157
159#define __NR_acct 6158
160#define __NR_settimeofday_time32 6159
161#define __NR_mount 6160
162#define __NR_umount2 6161
163#define __NR_swapon 6162
164#define __NR_swapoff 6163
165#define __NR_reboot 6164
166#define __NR_sethostname 6165
167#define __NR_setdomainname 6166
168#define __NR_create_module 6167
169#define __NR_init_module 6168
170#define __NR_delete_module 6169
171#define __NR_get_kernel_syms 6170
172#define __NR_query_module 6171
173#define __NR_quotactl 6172
174#define __NR_nfsservctl 6173
175#define __NR_getpmsg 6174
176#define __NR_putpmsg 6175
177#define __NR_afs_syscall 6176
178#define __NR_reserved177 6177
179#define __NR_gettid 6178
180#define __NR_readahead 6179
181#define __NR_setxattr 6180
182#define __NR_lsetxattr 6181
183#define __NR_fsetxattr 6182
184#define __NR_getxattr 6183
185#define __NR_lgetxattr 6184
186#define __NR_fgetxattr 6185
187#define __NR_listxattr 6186
188#define __NR_llistxattr 6187
189#define __NR_flistxattr 6188
190#define __NR_removexattr 6189
191#define __NR_lremovexattr 6190
192#define __NR_fremovexattr 6191
193#define __NR_tkill 6192
194#define __NR_reserved193 6193
195#define __NR_futex 6194
196#define __NR_sched_setaffinity 6195
197#define __NR_sched_getaffinity 6196
198#define __NR_cacheflush 6197
199#define __NR_cachectl 6198
200#define __NR_sysmips 6199
201#define __NR_io_setup 6200
202#define __NR_io_destroy 6201
203#define __NR_io_getevents 6202
204#define __NR_io_submit 6203
205#define __NR_io_cancel 6204
206#define __NR_exit_group 6205
207#define __NR_lookup_dcookie 6206
208#define __NR_epoll_create 6207
209#define __NR_epoll_ctl 6208
210#define __NR_epoll_wait 6209
211#define __NR_remap_file_pages 6210
212#define __NR_rt_sigreturn 6211
213#define __NR_fcntl64 6212
214#define __NR_set_tid_address 6213
215#define __NR_restart_syscall 6214
216#define __NR_semtimedop 6215
217#define __NR_fadvise64 6216
218#define __NR_statfs64 6217
219#define __NR_fstatfs64 6218
220#define __NR_sendfile64 6219
221#define __NR_timer_create 6220
222#define __NR_timer_settime32 6221
223#define __NR_timer_gettime32 6222
224#define __NR_timer_getoverrun 6223
225#define __NR_timer_delete 6224
226#define __NR_clock_settime32 6225
227#define __NR_clock_gettime32 6226
228#define __NR_clock_getres_time32 6227
229#define __NR_clock_nanosleep_time32 6228
230#define __NR_tgkill 6229
231#define __NR_utimes 6230
232#define __NR_mbind 6231
233#define __NR_get_mempolicy 6232
234#define __NR_set_mempolicy 6233
235#define __NR_mq_open 6234
236#define __NR_mq_unlink 6235
237#define __NR_mq_timedsend 6236
238#define __NR_mq_timedreceive 6237
239#define __NR_mq_notify 6238
240#define __NR_mq_getsetattr 6239
241#define __NR_vserver 6240
242#define __NR_waitid 6241
243#define __NR_add_key 6243
244#define __NR_request_key 6244
245#define __NR_keyctl 6245
246#define __NR_set_thread_area 6246
247#define __NR_inotify_init 6247
248#define __NR_inotify_add_watch 6248
249#define __NR_inotify_rm_watch 6249
250#define __NR_migrate_pages 6250
251#define __NR_openat 6251
252#define __NR_mkdirat 6252
253#define __NR_mknodat 6253
254#define __NR_fchownat 6254
255#define __NR_futimesat 6255
256#define __NR_newfstatat 6256
257#define __NR_unlinkat 6257
258#define __NR_renameat 6258
259#define __NR_linkat 6259
260#define __NR_symlinkat 6260
261#define __NR_readlinkat 6261
262#define __NR_fchmodat 6262
263#define __NR_faccessat 6263
264#define __NR_pselect6 6264
265#define __NR_ppoll 6265
266#define __NR_unshare 6266
267#define __NR_splice 6267
268#define __NR_sync_file_range 6268
269#define __NR_tee 6269
270#define __NR_vmsplice 6270
271#define __NR_move_pages 6271
272#define __NR_set_robust_list 6272
273#define __NR_get_robust_list 6273
274#define __NR_kexec_load 6274
275#define __NR_getcpu 6275
276#define __NR_epoll_pwait 6276
277#define __NR_ioprio_set 6277
278#define __NR_ioprio_get 6278
279#define __NR_utimensat 6279
280#define __NR_signalfd 6280
281#define __NR_timerfd 6281
282#define __NR_eventfd 6282
283#define __NR_fallocate 6283
284#define __NR_timerfd_create 6284
285#define __NR_timerfd_gettime32 6285
286#define __NR_timerfd_settime32 6286
287#define __NR_signalfd4 6287
288#define __NR_eventfd2 6288
289#define __NR_epoll_create1 6289
290#define __NR_dup3 6290
291#define __NR_pipe2 6291
292#define __NR_inotify_init1 6292
293#define __NR_preadv 6293
294#define __NR_pwritev 6294
295#define __NR_rt_tgsigqueueinfo 6295
296#define __NR_perf_event_open 6296
297#define __NR_accept4 6297
298#define __NR_recvmmsg 6298
299#define __NR_getdents64 6299
300#define __NR_fanotify_init 6300
301#define __NR_fanotify_mark 6301
302#define __NR_prlimit64 6302
303#define __NR_name_to_handle_at 6303
304#define __NR_open_by_handle_at 6304
305#define __NR_clock_adjtime 6305
306#define __NR_syncfs 6306
307#define __NR_sendmmsg 6307
308#define __NR_setns 6308
309#define __NR_process_vm_readv 6309
310#define __NR_process_vm_writev 6310
311#define __NR_kcmp 6311
312#define __NR_finit_module 6312
313#define __NR_sched_setattr 6313
314#define __NR_sched_getattr 6314
315#define __NR_renameat2 6315
316#define __NR_seccomp 6316
317#define __NR_getrandom 6317
318#define __NR_memfd_create 6318
319#define __NR_bpf 6319
320#define __NR_execveat 6320
321#define __NR_userfaultfd 6321
322#define __NR_membarrier 6322
323#define __NR_mlock2 6323
324#define __NR_copy_file_range 6324
325#define __NR_preadv2 6325
326#define __NR_pwritev2 6326
327#define __NR_pkey_mprotect 6327
328#define __NR_pkey_alloc 6328
329#define __NR_pkey_free 6329
330#define __NR_statx 6330
331#define __NR_rseq 6331
332#define __NR_io_pgetevents 6332
333#define __NR_clock_gettime64 6403
334#define __NR_clock_settime64 6404
335#define __NR_clock_adjtime64 6405
336#define __NR_clock_getres_time64 6406
337#define __NR_clock_nanosleep_time64 6407
338#define __NR_timer_gettime64 6408
339#define __NR_timer_settime64 6409
340#define __NR_timerfd_gettime64 6410
341#define __NR_timerfd_settime64 6411
342#define __NR_utimensat_time64 6412
343#define __NR_pselect6_time64 6413
344#define __NR_ppoll_time64 6414
345#define __NR_io_pgetevents_time64 6416
346#define __NR_recvmmsg_time64 6417
347#define __NR_mq_timedsend_time64 6418
348#define __NR_mq_timedreceive_time64 6419
349#define __NR_semtimedop_time64 6420
350#define __NR_rt_sigtimedwait_time64 6421
351#define __NR_futex_time64 6422
352#define __NR_sched_rr_get_interval_time64 6423
353#define __NR_pidfd_send_signal 6424
354#define __NR_io_uring_setup 6425
355#define __NR_io_uring_enter 6426
356#define __NR_io_uring_register 6427
357#define __NR_open_tree 6428
358#define __NR_move_mount 6429
359#define __NR_fsopen 6430
360#define __NR_fsconfig 6431
361#define __NR_fsmount 6432
362#define __NR_fspick 6433
363#define __NR_pidfd_open 6434
364#define __NR_clone3 6435
365#define __NR_close_range 6436
366#define __NR_openat2 6437
367#define __NR_pidfd_getfd 6438
368#define __NR_faccessat2 6439
369
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/termios.h deleted-169
...@@ -1,169 +0,0 @@
1struct termios {
2 tcflag_t c_iflag;
3 tcflag_t c_oflag;
4 tcflag_t c_cflag;
5 tcflag_t c_lflag;
6 cc_t c_line;
7 cc_t c_cc[NCCS];
8 speed_t __c_ispeed;
9 speed_t __c_ospeed;
10};
11
12#define VINTR 0
13#define VQUIT 1
14#define VERASE 2
15#define VKILL 3
16#define VMIN 4
17#define VTIME 5
18#define VEOL2 6
19#define VSWTC 7
20#define VSWTCH 7
21#define VSTART 8
22#define VSTOP 9
23#define VSUSP 10
24#define VREPRINT 12
25#define VDISCARD 13
26#define VWERASE 14
27#define VLNEXT 15
28#define VEOF 16
29#define VEOL 17
30
31#define IGNBRK 0000001
32#define BRKINT 0000002
33#define IGNPAR 0000004
34#define PARMRK 0000010
35#define INPCK 0000020
36#define ISTRIP 0000040
37#define INLCR 0000100
38#define IGNCR 0000200
39#define ICRNL 0000400
40#define IUCLC 0001000
41#define IXON 0002000
42#define IXANY 0004000
43#define IXOFF 0010000
44#define IMAXBEL 0020000
45#define IUTF8 0040000
46
47#define OPOST 0000001
48#define OLCUC 0000002
49#define ONLCR 0000004
50#define OCRNL 0000010
51#define ONOCR 0000020
52#define ONLRET 0000040
53#define OFILL 0000100
54#define OFDEL 0000200
55#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
56#define NLDLY 0000400
57#define NL0 0000000
58#define NL1 0000400
59#define CRDLY 0003000
60#define CR0 0000000
61#define CR1 0001000
62#define CR2 0002000
63#define CR3 0003000
64#define TABDLY 0014000
65#define TAB0 0000000
66#define TAB1 0004000
67#define TAB2 0010000
68#define TAB3 0014000
69#define BSDLY 0020000
70#define BS0 0000000
71#define BS1 0020000
72#define FFDLY 0100000
73#define FF0 0000000
74#define FF1 0100000
75#endif
76
77#define VTDLY 0040000
78#define VT0 0000000
79#define VT1 0040000
80
81#define B0 0000000
82#define B50 0000001
83#define B75 0000002
84#define B110 0000003
85#define B134 0000004
86#define B150 0000005
87#define B200 0000006
88#define B300 0000007
89#define B600 0000010
90#define B1200 0000011
91#define B1800 0000012
92#define B2400 0000013
93#define B4800 0000014
94#define B9600 0000015
95#define B19200 0000016
96#define B38400 0000017
97
98#define B57600 0010001
99#define B115200 0010002
100#define B230400 0010003
101#define B460800 0010004
102#define B500000 0010005
103#define B576000 0010006
104#define B921600 0010007
105#define B1000000 0010010
106#define B1152000 0010011
107#define B1500000 0010012
108#define B2000000 0010013
109#define B2500000 0010014
110#define B3000000 0010015
111#define B3500000 0010016
112#define B4000000 0010017
113
114#define CSIZE 0000060
115#define CS5 0000000
116#define CS6 0000020
117#define CS7 0000040
118#define CS8 0000060
119#define CSTOPB 0000100
120#define CREAD 0000200
121#define PARENB 0000400
122#define PARODD 0001000
123#define HUPCL 0002000
124#define CLOCAL 0004000
125
126#define ISIG 0000001
127#define ICANON 0000002
128#define ECHO 0000010
129#define ECHOE 0000020
130#define ECHOK 0000040
131#define ECHONL 0000100
132#define NOFLSH 0000200
133#define IEXTEN 0000400
134#define TOSTOP 0100000
135#define ITOSTOP 0100000
136
137#define TCOOFF 0
138#define TCOON 1
139#define TCIOFF 2
140#define TCION 3
141
142#define TCIFLUSH 0
143#define TCOFLUSH 1
144#define TCIOFLUSH 2
145
146#define TCSANOW 0
147#define TCSADRAIN 1
148#define TCSAFLUSH 2
149
150#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
151#define EXTA 0000016
152#define EXTB 0000017
153#define CBAUD 0010017
154#define CBAUDEX 0010000
155#define CIBAUD 002003600000
156#define CMSPAR 010000000000
157#define CRTSCTS 020000000000
158
159#define XCASE 0000004
160#define ECHOCTL 0001000
161#define ECHOPRT 0002000
162#define ECHOKE 0004000
163#define FLUSHO 0020000
164#define PENDIN 0040000
165#define EXTPROC 0200000
166
167#define XTABS 0014000
168#define TIOCSER_TEMT 1
169#endif
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/bits/user.h deleted-15
...@@ -1,15 +0,0 @@
1struct user {
2 unsigned long regs[102];
3 unsigned long u_tsize, u_dsize, u_ssize;
4 unsigned long long start_code, start_data, start_stack;
5 long long signal;
6 unsigned long long *u_ar0;
7 unsigned long long magic;
8 char u_comm[32];
9};
10
11#define ELF_NGREG 45
12#define ELF_NFPREG 33
13
14typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
15typedef double elf_fpreg_t, elf_fpregset_t[ELF_NFPREG];
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/crt_arch.h deleted-32
...@@ -1,32 +0,0 @@
1__asm__(
2".set push\n"
3".set noreorder\n"
4".text \n"
5".global _" START "\n"
6".global " START "\n"
7".global " START "_data\n"
8".type _" START ", @function\n"
9".type " START ", @function\n"
10".type " START "_data, @function\n"
11"_" START ":\n"
12"" START ":\n"
13" bal 1f \n"
14" move $fp, $0 \n"
15"" START "_data: \n"
16" .gpword " START "_data \n"
17" .gpword " START "_c \n"
18".weak _DYNAMIC \n"
19".hidden _DYNAMIC \n"
20" .gpword _DYNAMIC \n"
21"1: lw $gp, 0($ra) \n"
22" subu $gp, $ra, $gp \n"
23" move $4, $sp \n"
24" lw $5, 8($ra) \n"
25" addu $5, $5, $gp \n"
26" lw $25, 4($ra) \n"
27" addu $25, $25, $gp \n"
28" and $sp, $sp, -8 \n"
29" jalr $25 \n"
30" subu $sp, $sp, 16 \n"
31".set pop \n"
32);
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/ksigaction.h deleted-10
...@@ -1,10 +0,0 @@
1#include <features.h>
2
3struct k_sigaction {
4 unsigned flags;
5 void (*handler)(int);
6 unsigned long mask[4];
7 void (*restorer)();
8};
9
10hidden void __restore(), __restore_rt();
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/kstat.h deleted-22
...@@ -1,22 +0,0 @@
1struct kstat {
2 unsigned st_dev;
3 long __pad1[3];
4 ino_t st_ino;
5 mode_t st_mode;
6 nlink_t st_nlink;
7 uid_t st_uid;
8 gid_t st_gid;
9 unsigned st_rdev;
10 long __pad2[3];
11 off_t st_size;
12 long st_atime_sec;
13 long st_atime_nsec;
14 long st_mtime_sec;
15 long st_mtime_nsec;
16 long st_ctime_sec;
17 long st_ctime_nsec;
18 blksize_t st_blksize;
19 long __pad3;
20 blkcnt_t st_blocks;
21 long __pad4[14];
22};
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/pthread_arch.h deleted-19
...@@ -1,19 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3#if __mips_isa_rev < 2
4 register uintptr_t tp __asm__("$3");
5 __asm__ (".word 0x7c03e83b" : "=r" (tp) );
6#else
7 uintptr_t tp;
8 __asm__ ("rdhwr %0, $29" : "=r" (tp) );
9#endif
10 return tp;
11}
12
13#define TLS_ABOVE_TP
14#define GAP_ABOVE_TP 0
15
16#define TP_OFFSET 0x7000
17#define DTP_OFFSET 0x8000
18
19#define MC_PC pc
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/reloc.h deleted-50
...@@ -1,50 +0,0 @@
1#if __mips_isa_rev >= 6
2#define ISA_SUFFIX "r6"
3#else
4#define ISA_SUFFIX ""
5#endif
6
7#if __BYTE_ORDER == __LITTLE_ENDIAN
8#define ENDIAN_SUFFIX "el"
9#else
10#define ENDIAN_SUFFIX ""
11#endif
12
13#ifdef __mips_soft_float
14#define FP_SUFFIX "-sf"
15#else
16#define FP_SUFFIX ""
17#endif
18
19#define LDSO_ARCH "mipsn32" ISA_SUFFIX ENDIAN_SUFFIX FP_SUFFIX
20
21#define TPOFF_K (-0x7000)
22
23#define REL_SYM_OR_REL R_MIPS_REL32
24#define REL_PLT R_MIPS_JUMP_SLOT
25#define REL_COPY R_MIPS_COPY
26#define REL_DTPMOD R_MIPS_TLS_DTPMOD32
27#define REL_DTPOFF R_MIPS_TLS_DTPREL32
28#define REL_TPOFF R_MIPS_TLS_TPREL32
29
30#define NEED_MIPS_GOT_RELOCS 1
31#define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP
32#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT))
33
34#define CRTJMP(pc,sp) __asm__ __volatile__( \
35 "move $sp,%1 ; jr %0" : : "r"(pc), "r"(sp) : "memory" )
36
37#define GETFUNCSYM(fp, sym, got) __asm__ ( \
38 ".hidden " #sym "\n" \
39 ".set push \n" \
40 ".set noreorder \n" \
41 " bal 1f \n" \
42 " nop \n" \
43 " .gpword . \n" \
44 " .gpword " #sym " \n" \
45 "1: lw %0, ($ra) \n" \
46 " subu %0, $ra, %0 \n" \
47 " lw $ra, 4($ra) \n" \
48 " addu %0, %0, $ra \n" \
49 ".set pop \n" \
50 : "=r"(*(fp)) : : "memory", "ra" )
lib/libc/wasi/libc-top-half/musl/arch/mipsn32/syscall_arch.h deleted-130
...@@ -1,130 +0,0 @@
1#define __SYSCALL_LL_E(x) (x)
2#define __SYSCALL_LL_O(x) (x)
3
4#define SYSCALL_RLIM_INFINITY (-1UL/2)
5
6#if __mips_isa_rev >= 6
7#define SYSCALL_CLOBBERLIST \
8 "$1", "$3", "$10", "$11", "$12", "$13", \
9 "$14", "$15", "$24", "$25", "memory"
10#else
11#define SYSCALL_CLOBBERLIST \
12 "$1", "$3", "$10", "$11", "$12", "$13", \
13 "$14", "$15", "$24", "$25", "hi", "lo", "memory"
14#endif
15
16static inline long __syscall0(long n)
17{
18 register long r7 __asm__("$7");
19 register long r2 __asm__("$2");
20 __asm__ __volatile__ (
21 "daddu $2,$0,%2 ; syscall"
22 : "=&r"(r2), "=r"(r7)
23 : "ir"(n), "0"(r2)
24 : SYSCALL_CLOBBERLIST);
25 return r7 && r2>0 ? -r2 : r2;
26}
27
28static inline long __syscall1(long n, long a)
29{
30 register long r4 __asm__("$4") = a;
31 register long r7 __asm__("$7");
32 register long r2 __asm__("$2");
33 __asm__ __volatile__ (
34 "daddu $2,$0,%2 ; syscall"
35 : "=&r"(r2), "=r"(r7)
36 : "ir"(n), "0"(r2), "r"(r4)
37 : SYSCALL_CLOBBERLIST);
38 return r7 && r2>0 ? -r2 : r2;
39}
40
41static inline long __syscall2(long n, long a, long b)
42{
43 register long r4 __asm__("$4") = a;
44 register long r5 __asm__("$5") = b;
45 register long r7 __asm__("$7");
46 register long r2 __asm__("$2");
47
48 __asm__ __volatile__ (
49 "daddu $2,$0,%2 ; syscall"
50 : "=&r"(r2), "=r"(r7)
51 : "ir"(n), "0"(r2), "r"(r4), "r"(r5)
52 : SYSCALL_CLOBBERLIST);
53 return r7 && r2>0 ? -r2 : r2;
54}
55
56static inline long __syscall3(long n, long a, long b, long c)
57{
58 register long r4 __asm__("$4") = a;
59 register long r5 __asm__("$5") = b;
60 register long r6 __asm__("$6") = c;
61 register long r7 __asm__("$7");
62 register long r2 __asm__("$2");
63
64 __asm__ __volatile__ (
65 "daddu $2,$0,%2 ; syscall"
66 : "=&r"(r2), "=r"(r7)
67 : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
68 : SYSCALL_CLOBBERLIST);
69 return r7 && r2>0 ? -r2 : r2;
70}
71
72static inline long __syscall4(long n, long a, long b, long c, long d)
73{
74 register long r4 __asm__("$4") = a;
75 register long r5 __asm__("$5") = b;
76 register long r6 __asm__("$6") = c;
77 register long r7 __asm__("$7") = d;
78 register long r2 __asm__("$2");
79
80 __asm__ __volatile__ (
81 "daddu $2,$0,%2 ; syscall"
82 : "=&r"(r2), "+r"(r7)
83 : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6)
84 : SYSCALL_CLOBBERLIST);
85 return r7 && r2>0 ? -r2 : r2;
86}
87
88static inline long __syscall5(long n, long a, long b, long c, long d, long e)
89{
90 register long r4 __asm__("$4") = a;
91 register long r5 __asm__("$5") = b;
92 register long r6 __asm__("$6") = c;
93 register long r7 __asm__("$7") = d;
94 register long r8 __asm__("$8") = e;
95 register long r2 __asm__("$2");
96
97 __asm__ __volatile__ (
98 "daddu $2,$0,%2 ; syscall"
99 : "=&r"(r2), "+r"(r7)
100 : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6), "r"(r8)
101 : SYSCALL_CLOBBERLIST);
102 return r7 && r2>0 ? -r2 : r2;
103}
104
105static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
106{
107 register long r4 __asm__("$4") = a;
108 register long r5 __asm__("$5") = b;
109 register long r6 __asm__("$6") = c;
110 register long r7 __asm__("$7") = d;
111 register long r8 __asm__("$8") = e;
112 register long r9 __asm__("$9") = f;
113 register long r2 __asm__("$2");
114
115 __asm__ __volatile__ (
116 "daddu $2,$0,%2 ; syscall"
117 : "=&r"(r2), "+r"(r7)
118 : "ir"(n), "0"(r2), "r"(r4), "r"(r5), "r"(r6), "r"(r8), "r"(r9)
119 : SYSCALL_CLOBBERLIST);
120 return r7 && r2>0 ? -r2 : r2;
121}
122
123#define VDSO_USEFUL
124#define VDSO_CGT32_SYM "__vdso_clock_gettime"
125#define VDSO_CGT32_VER "LINUX_2.6"
126#define VDSO_CGT_SYM "__vdso_clock_gettime64"
127#define VDSO_CGT_VER "LINUX_2.6"
128
129#define SO_SNDTIMEO_OLD 0x1005
130#define SO_RCVTIMEO_OLD 0x1006
lib/libc/wasi/libc-top-half/musl/arch/or1k/arch.mak deleted-1
...@@ -1 +0,0 @@
1COMPAT_SRC_DIRS = compat/time32
lib/libc/wasi/libc-top-half/musl/arch/or1k/atomic_arch.h deleted-14
...@@ -1,14 +0,0 @@
1#define a_cas a_cas
2static inline int a_cas(volatile int *p, int t, int s)
3{
4 __asm__("1: l.lwa %0, %1\n"
5 " l.sfeq %0, %2\n"
6 " l.bnf 1f\n"
7 " l.nop\n"
8 " l.swa %1, %3\n"
9 " l.bnf 1b\n"
10 " l.nop\n"
11 "1: \n"
12 : "=&r"(t), "+m"(*p) : "r"(t), "r"(s) : "cc", "memory" );
13 return t;
14}
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/alltypes.h.in deleted-16
...@@ -1,16 +0,0 @@
1#define _REDIR_TIME64 1
2#define _Addr int
3#define _Int64 long long
4#define _Reg int
5
6#define __BYTE_ORDER 4321
7#define __LONG_MAX 0x7fffffffL
8
9#ifndef __cplusplus
10TYPEDEF unsigned wchar_t;
11#endif
12
13TYPEDEF float float_t;
14TYPEDEF double double_t;
15
16TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
4#define LDBL_MIN 2.22507385850720138309e-308L
5#define LDBL_MAX 1.79769313486231570815e+308L
6#define LDBL_EPSILON 2.22044604925031308085e-16L
7
8#define LDBL_MANT_DIG 53
9#define LDBL_MIN_EXP (-1021)
10#define LDBL_MAX_EXP 1024
11
12#define LDBL_DIG 15
13#define LDBL_MIN_10_EXP (-307)
14#define LDBL_MAX_10_EXP 308
15
16#define DECIMAL_DIG 17
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/ipcstat.h deleted-1
...@@ -1 +0,0 @@
1#define IPC_STAT 0x102
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/limits.h deleted-1
...@@ -1 +0,0 @@
1#define PAGESIZE 8192
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/msg.h deleted-18
...@@ -1,18 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 unsigned long __msg_stime_lo;
4 unsigned long __msg_stime_hi;
5 unsigned long __msg_rtime_lo;
6 unsigned long __msg_rtime_hi;
7 unsigned long __msg_ctime_lo;
8 unsigned long __msg_ctime_hi;
9 unsigned long msg_cbytes;
10 msgqnum_t msg_qnum;
11 msglen_t msg_qbytes;
12 pid_t msg_lspid;
13 pid_t msg_lrpid;
14 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
18};
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_ILP32_OFFBIG 1
2#define _POSIX_V7_ILP32_OFFBIG 1
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/reg.h deleted-3
...@@ -1,3 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3/* FIXME */
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/sem.h deleted-13
...@@ -1,13 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_otime_hi;
5 unsigned long __sem_ctime_lo;
6 unsigned long __sem_ctime_hi;
7 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
8 unsigned short sem_nsems;
9 long __unused3;
10 long __unused4;
11 time_t sem_otime;
12 time_t sem_ctime;
13};
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long __jmp_buf[13];
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/shm.h deleted-31
...@@ -1,31 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_atime_hi;
8 unsigned long __shm_dtime_lo;
9 unsigned long __shm_dtime_hi;
10 unsigned long __shm_ctime_lo;
11 unsigned long __shm_ctime_hi;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17 unsigned long __pad3;
18 time_t shm_atime;
19 time_t shm_dtime;
20 time_t shm_ctime;
21};
22
23struct shminfo {
24 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
25};
26
27struct shm_info {
28 int __used_ids;
29 unsigned long shm_tot, shm_rss, shm_swp;
30 unsigned long __swap_attempts, __swap_successes;
31};
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/signal.h deleted-85
...@@ -1,85 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10typedef unsigned long greg_t, gregset_t[34];
11typedef struct sigcontext {
12 struct {
13 unsigned long gpr[32];
14 unsigned long pc;
15 unsigned long sr;
16 } regs;
17 unsigned long oldmask;
18} mcontext_t;
19#else
20typedef struct {
21 unsigned long __regs[35];
22} mcontext_t;
23#endif
24
25struct sigaltstack {
26 void *ss_sp;
27 int ss_flags;
28 size_t ss_size;
29};
30
31typedef struct __ucontext {
32 unsigned long uc_flags;
33 struct __ucontext *uc_link;
34 stack_t uc_stack;
35 mcontext_t uc_mcontext;
36 sigset_t uc_sigmask;
37} ucontext_t;
38
39#define SA_NOCLDSTOP 1
40#define SA_NOCLDWAIT 2
41#define SA_SIGINFO 4
42#define SA_ONSTACK 0x08000000
43#define SA_RESTART 0x10000000
44#define SA_NODEFER 0x40000000
45#define SA_RESETHAND 0x80000000
46#define SA_RESTORER 0x04000000
47
48#endif
49
50#define SIGHUP 1
51#define SIGINT 2
52#define SIGQUIT 3
53#define SIGILL 4
54#define SIGTRAP 5
55#define SIGABRT 6
56#define SIGIOT SIGABRT
57#define SIGBUS 7
58#define SIGFPE 8
59#define SIGKILL 9
60#define SIGUSR1 10
61#define SIGSEGV 11
62#define SIGUSR2 12
63#define SIGPIPE 13
64#define SIGALRM 14
65#define SIGTERM 15
66#define SIGSTKFLT 16
67#define SIGCHLD 17
68#define SIGCONT 18
69#define SIGSTOP 19
70#define SIGTSTP 20
71#define SIGTTIN 21
72#define SIGTTOU 22
73#define SIGURG 23
74#define SIGXCPU 24
75#define SIGXFSZ 25
76#define SIGVTALRM 26
77#define SIGPROF 27
78#define SIGWINCH 28
79#define SIGIO 29
80#define SIGPOLL 29
81#define SIGPWR 30
82#define SIGSYS 31
83#define SIGUNUSED SIGSYS
84
85#define _NSIG 65
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/stat.h deleted-25
...@@ -1,25 +0,0 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3
4struct stat {
5 dev_t st_dev;
6 ino_t st_ino;
7 mode_t st_mode;
8 nlink_t st_nlink;
9 uid_t st_uid;
10 gid_t st_gid;
11 dev_t st_rdev;
12 long long __st_rdev_padding;
13 off_t st_size;
14 blksize_t st_blksize;
15 int __st_blksize_padding;
16 blkcnt_t st_blocks;
17 struct {
18 long tv_sec;
19 long tv_nsec;
20 } __st_atim32, __st_mtim32, __st_ctim32;
21 unsigned __unused[2];
22 struct timespec st_atim;
23 struct timespec st_mtim;
24 struct timespec st_ctim;
25};
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT32_MIN
16#define INTPTR_MAX INT32_MAX
17#define UINTPTR_MAX UINT32_MAX
18#define PTRDIFF_MIN INT32_MIN
19#define PTRDIFF_MAX INT32_MAX
20#define SIZE_MAX UINT32_MAX
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/syscall.h.in deleted-318
...@@ -1,318 +0,0 @@
1#define __NR_io_setup 0
2#define __NR_io_destroy 1
3#define __NR_io_submit 2
4#define __NR_io_cancel 3
5#define __NR_io_getevents 4
6#define __NR_setxattr 5
7#define __NR_lsetxattr 6
8#define __NR_fsetxattr 7
9#define __NR_getxattr 8
10#define __NR_lgetxattr 9
11#define __NR_fgetxattr 10
12#define __NR_listxattr 11
13#define __NR_llistxattr 12
14#define __NR_flistxattr 13
15#define __NR_removexattr 14
16#define __NR_lremovexattr 15
17#define __NR_fremovexattr 16
18#define __NR_getcwd 17
19#define __NR_lookup_dcookie 18
20#define __NR_eventfd2 19
21#define __NR_epoll_create1 20
22#define __NR_epoll_ctl 21
23#define __NR_epoll_pwait 22
24#define __NR_dup 23
25#define __NR_dup3 24
26#define __NR_fcntl64 25
27#define __NR_inotify_init1 26
28#define __NR_inotify_add_watch 27
29#define __NR_inotify_rm_watch 28
30#define __NR_ioctl 29
31#define __NR_ioprio_set 30
32#define __NR_ioprio_get 31
33#define __NR_flock 32
34#define __NR_mknodat 33
35#define __NR_mkdirat 34
36#define __NR_unlinkat 35
37#define __NR_symlinkat 36
38#define __NR_linkat 37
39#define __NR_renameat 38
40#define __NR_umount2 39
41#define __NR_mount 40
42#define __NR_pivot_root 41
43#define __NR_nfsservctl 42
44#define __NR_statfs64 43
45#define __NR_fstatfs64 44
46#define __NR_truncate64 45
47#define __NR_ftruncate64 46
48#define __NR_fallocate 47
49#define __NR_faccessat 48
50#define __NR_chdir 49
51#define __NR_fchdir 50
52#define __NR_chroot 51
53#define __NR_fchmod 52
54#define __NR_fchmodat 53
55#define __NR_fchownat 54
56#define __NR_fchown 55
57#define __NR_openat 56
58#define __NR_close 57
59#define __NR_vhangup 58
60#define __NR_pipe2 59
61#define __NR_quotactl 60
62#define __NR_getdents64 61
63#define __NR__llseek 62
64#define __NR_llseek 62
65#define __NR_read 63
66#define __NR_write 64
67#define __NR_readv 65
68#define __NR_writev 66
69#define __NR_pread64 67
70#define __NR_pwrite64 68
71#define __NR_preadv 69
72#define __NR_pwritev 70
73#define __NR_sendfile64 71
74#define __NR_pselect6 72
75#define __NR_ppoll 73
76#define __NR_signalfd4 74
77#define __NR_vmsplice 75
78#define __NR_splice 76
79#define __NR_tee 77
80#define __NR_readlinkat 78
81#define __NR_fstatat64 79
82#define __NR_fstat64 80
83#define __NR_sync 81
84#define __NR_fsync 82
85#define __NR_fdatasync 83
86#define __NR_sync_file_range 84
87#define __NR_timerfd_create 85
88#define __NR_timerfd_settime32 86
89#define __NR_timerfd_gettime32 87
90#define __NR_utimensat 88
91#define __NR_acct 89
92#define __NR_capget 90
93#define __NR_capset 91
94#define __NR_personality 92
95#define __NR_exit 93
96#define __NR_exit_group 94
97#define __NR_waitid 95
98#define __NR_set_tid_address 96
99#define __NR_unshare 97
100#define __NR_futex 98
101#define __NR_set_robust_list 99
102#define __NR_get_robust_list 100
103#define __NR_nanosleep 101
104#define __NR_getitimer 102
105#define __NR_setitimer 103
106#define __NR_kexec_load 104
107#define __NR_init_module 105
108#define __NR_delete_module 106
109#define __NR_timer_create 107
110#define __NR_timer_gettime32 108
111#define __NR_timer_getoverrun 109
112#define __NR_timer_settime32 110
113#define __NR_timer_delete 111
114#define __NR_clock_settime32 112
115#define __NR_clock_gettime32 113
116#define __NR_clock_getres_time32 114
117#define __NR_clock_nanosleep_time32 115
118#define __NR_syslog 116
119#define __NR_ptrace 117
120#define __NR_sched_setparam 118
121#define __NR_sched_setscheduler 119
122#define __NR_sched_getscheduler 120
123#define __NR_sched_getparam 121
124#define __NR_sched_setaffinity 122
125#define __NR_sched_getaffinity 123
126#define __NR_sched_yield 124
127#define __NR_sched_get_priority_max 125
128#define __NR_sched_get_priority_min 126
129#define __NR_sched_rr_get_interval 127
130#define __NR_restart_syscall 128
131#define __NR_kill 129
132#define __NR_tkill 130
133#define __NR_tgkill 131
134#define __NR_sigaltstack 132
135#define __NR_rt_sigsuspend 133
136#define __NR_rt_sigaction 134
137#define __NR_rt_sigprocmask 135
138#define __NR_rt_sigpending 136
139#define __NR_rt_sigtimedwait 137
140#define __NR_rt_sigqueueinfo 138
141#define __NR_rt_sigreturn 139
142#define __NR_setpriority 140
143#define __NR_getpriority 141
144#define __NR_reboot 142
145#define __NR_setregid 143
146#define __NR_setgid 144
147#define __NR_setreuid 145
148#define __NR_setuid 146
149#define __NR_setresuid 147
150#define __NR_getresuid 148
151#define __NR_setresgid 149
152#define __NR_getresgid 150
153#define __NR_setfsuid 151
154#define __NR_setfsgid 152
155#define __NR_times 153
156#define __NR_setpgid 154
157#define __NR_getpgid 155
158#define __NR_getsid 156
159#define __NR_setsid 157
160#define __NR_getgroups 158
161#define __NR_setgroups 159
162#define __NR_uname 160
163#define __NR_sethostname 161
164#define __NR_setdomainname 162
165#define __NR_getrlimit 163
166#define __NR_setrlimit 164
167#define __NR_getrusage 165
168#define __NR_umask 166
169#define __NR_prctl 167
170#define __NR_getcpu 168
171#define __NR_gettimeofday_time32 169
172#define __NR_settimeofday_time32 170
173#define __NR_adjtimex 171
174#define __NR_getpid 172
175#define __NR_getppid 173
176#define __NR_getuid 174
177#define __NR_geteuid 175
178#define __NR_getgid 176
179#define __NR_getegid 177
180#define __NR_gettid 178
181#define __NR_sysinfo 179
182#define __NR_mq_open 180
183#define __NR_mq_unlink 181
184#define __NR_mq_timedsend 182
185#define __NR_mq_timedreceive 183
186#define __NR_mq_notify 184
187#define __NR_mq_getsetattr 185
188#define __NR_msgget 186
189#define __NR_msgctl 187
190#define __NR_msgrcv 188
191#define __NR_msgsnd 189
192#define __NR_semget 190
193#define __NR_semctl 191
194#define __NR_semtimedop 192
195#define __NR_semop 193
196#define __NR_shmget 194
197#define __NR_shmctl 195
198#define __NR_shmat 196
199#define __NR_shmdt 197
200#define __NR_socket 198
201#define __NR_socketpair 199
202#define __NR_bind 200
203#define __NR_listen 201
204#define __NR_accept 202
205#define __NR_connect 203
206#define __NR_getsockname 204
207#define __NR_getpeername 205
208#define __NR_sendto 206
209#define __NR_recvfrom 207
210#define __NR_setsockopt 208
211#define __NR_getsockopt 209
212#define __NR_shutdown 210
213#define __NR_sendmsg 211
214#define __NR_recvmsg 212
215#define __NR_readahead 213
216#define __NR_brk 214
217#define __NR_munmap 215
218#define __NR_mremap 216
219#define __NR_add_key 217
220#define __NR_request_key 218
221#define __NR_keyctl 219
222#define __NR_clone 220
223#define __NR_execve 221
224#define __NR_mmap2 222
225#define __NR_fadvise64_64 223
226#define __NR_swapon 224
227#define __NR_swapoff 225
228#define __NR_mprotect 226
229#define __NR_msync 227
230#define __NR_mlock 228
231#define __NR_munlock 229
232#define __NR_mlockall 230
233#define __NR_munlockall 231
234#define __NR_mincore 232
235#define __NR_madvise 233
236#define __NR_remap_file_pages 234
237#define __NR_mbind 235
238#define __NR_get_mempolicy 236
239#define __NR_set_mempolicy 237
240#define __NR_migrate_pages 238
241#define __NR_move_pages 239
242#define __NR_rt_tgsigqueueinfo 240
243#define __NR_perf_event_open 241
244#define __NR_accept4 242
245#define __NR_recvmmsg 243
246#define __NR_or1k_atomic 244
247#define __NR_wait4 260
248#define __NR_prlimit64 261
249#define __NR_fanotify_init 262
250#define __NR_fanotify_mark 263
251#define __NR_name_to_handle_at 264
252#define __NR_open_by_handle_at 265
253#define __NR_clock_adjtime 266
254#define __NR_syncfs 267
255#define __NR_setns 268
256#define __NR_sendmmsg 269
257#define __NR_process_vm_readv 270
258#define __NR_process_vm_writev 271
259#define __NR_kcmp 272
260#define __NR_finit_module 273
261#define __NR_sched_setattr 274
262#define __NR_sched_getattr 275
263#define __NR_renameat2 276
264#define __NR_seccomp 277
265#define __NR_getrandom 278
266#define __NR_memfd_create 279
267#define __NR_bpf 280
268#define __NR_execveat 281
269#define __NR_userfaultfd 282
270#define __NR_membarrier 283
271#define __NR_mlock2 284
272#define __NR_copy_file_range 285
273#define __NR_preadv2 286
274#define __NR_pwritev2 287
275#define __NR_pkey_mprotect 288
276#define __NR_pkey_alloc 289
277#define __NR_pkey_free 290
278#define __NR_statx 291
279#define __NR_io_pgetevents 292
280#define __NR_rseq 293
281#define __NR_kexec_file_load 294
282#define __NR_clock_gettime64 403
283#define __NR_clock_settime64 404
284#define __NR_clock_adjtime64 405
285#define __NR_clock_getres_time64 406
286#define __NR_clock_nanosleep_time64 407
287#define __NR_timer_gettime64 408
288#define __NR_timer_settime64 409
289#define __NR_timerfd_gettime64 410
290#define __NR_timerfd_settime64 411
291#define __NR_utimensat_time64 412
292#define __NR_pselect6_time64 413
293#define __NR_ppoll_time64 414
294#define __NR_io_pgetevents_time64 416
295#define __NR_recvmmsg_time64 417
296#define __NR_mq_timedsend_time64 418
297#define __NR_mq_timedreceive_time64 419
298#define __NR_semtimedop_time64 420
299#define __NR_rt_sigtimedwait_time64 421
300#define __NR_futex_time64 422
301#define __NR_sched_rr_get_interval_time64 423
302#define __NR_pidfd_send_signal 424
303#define __NR_io_uring_setup 425
304#define __NR_io_uring_enter 426
305#define __NR_io_uring_register 427
306#define __NR_open_tree 428
307#define __NR_move_mount 429
308#define __NR_fsopen 430
309#define __NR_fsconfig 431
310#define __NR_fsmount 432
311#define __NR_fspick 433
312#define __NR_pidfd_open 434
313#define __NR_clone3 435
314#define __NR_close_range 436
315#define __NR_openat2 437
316#define __NR_pidfd_getfd 438
317#define __NR_faccessat2 439
318
lib/libc/wasi/libc-top-half/musl/arch/or1k/bits/user.h deleted
lib/libc/wasi/libc-top-half/musl/arch/or1k/crt_arch.h deleted-18
...@@ -1,18 +0,0 @@
1__asm__(
2".text \n"
3".global " START " \n"
4".align 4 \n"
5START ": \n"
6" l.jal 1f \n"
7" l.ori r3, r1, 0 \n"
8".weak _DYNAMIC \n"
9".hidden _DYNAMIC \n"
10" .word _DYNAMIC-. \n"
11"1: l.lwz r4, 0(r9) \n"
12" l.add r4, r4, r9 \n"
13" l.addi r2, r0, -8 \n"
14" l.and r1, r1, r2 \n"
15" l.addi r1, r1, -16 \n"
16" l.jal " START "_c \n"
17" l.ori r2, r0, 0 \n"
18);
lib/libc/wasi/libc-top-half/musl/arch/or1k/kstat.h deleted-21
...@@ -1,21 +0,0 @@
1struct kstat {
2 dev_t st_dev;
3 ino_t st_ino;
4 mode_t st_mode;
5 nlink_t st_nlink;
6 uid_t st_uid;
7 gid_t st_gid;
8 dev_t st_rdev;
9 long long __st_rdev_padding;
10 off_t st_size;
11 blksize_t st_blksize;
12 int __st_blksize_padding;
13 blkcnt_t st_blocks;
14 long st_atime_sec;
15 long st_atime_nsec;
16 long st_mtime_sec;
17 long st_mtime_nsec;
18 long st_ctime_sec;
19 long st_ctime_nsec;
20 unsigned __unused[2];
21};
lib/libc/wasi/libc-top-half/musl/arch/or1k/pthread_arch.h deleted-16
...@@ -1,16 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3#ifdef __clang__
4 uintptr_t tp;
5 __asm__ ("l.ori %0, r10, 0" : "=r" (tp) );
6#else
7 register uintptr_t tp __asm__("r10");
8 __asm__ ("" : "=r" (tp) );
9#endif
10 return tp;
11}
12
13#define TLS_ABOVE_TP
14#define GAP_ABOVE_TP 0
15
16#define MC_PC regs.pc
lib/libc/wasi/libc-top-half/musl/arch/or1k/reloc.h deleted-24
...@@ -1,24 +0,0 @@
1#define LDSO_ARCH "or1k"
2
3#define TPOFF_K 0
4
5#define REL_SYMBOLIC R_OR1K_32
6#define REL_GOT R_OR1K_GLOB_DAT
7#define REL_PLT R_OR1K_JMP_SLOT
8#define REL_RELATIVE R_OR1K_RELATIVE
9#define REL_COPY R_OR1K_COPY
10#define REL_DTPMOD R_OR1K_TLS_DTPMOD
11#define REL_DTPOFF R_OR1K_TLS_DTPOFF
12#define REL_TPOFF R_OR1K_TLS_TPOFF
13
14#define CRTJMP(pc,sp) __asm__ __volatile__( \
15 "l.jr %0 ; l.ori r1,%1,0" : : "r"(pc), "r"(sp) : "memory" )
16
17#define GETFUNCSYM(fp, sym, got) __asm__ ( \
18 ".hidden " #sym " \n" \
19 " l.jal 1f \n" \
20 " l.nop \n" \
21 " .word " #sym "-. \n" \
22 "1: l.lwz %0, 0(r9) \n" \
23 " l.add %0, %0, r9 \n" \
24 : "=r"(*(fp)) : : "memory", "r9" )
lib/libc/wasi/libc-top-half/musl/arch/or1k/syscall_arch.h deleted-115
...@@ -1,115 +0,0 @@
1#define __SYSCALL_LL_E(x) \
2((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
3((union { long long ll; long l[2]; }){ .ll = x }).l[1]
4#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
5
6#define SYSCALL_MMAP2_UNIT 8192ULL
7
8static __inline long __syscall0(long n)
9{
10 register unsigned long r11 __asm__("r11") = n;
11 __asm__ __volatile__ ("l.sys 1"
12 : "=r"(r11)
13 : "r"(r11)
14 : "memory", "r3", "r4", "r5", "r6", "r7", "r8",
15 "r12", "r13", "r15", "r17", "r19", "r21",
16 "r23", "r25", "r27", "r29", "r31");
17 return r11;
18}
19
20static inline long __syscall1(long n, long a)
21{
22 register unsigned long r11 __asm__("r11") = n;
23 register unsigned long r3 __asm__("r3") = a;
24 __asm__ __volatile__ ("l.sys 1"
25 : "=r"(r11)
26 : "r"(r11), "r"(r3)
27 : "memory", "r4", "r5", "r6", "r7", "r8",
28 "r12", "r13", "r15", "r17", "r19", "r21",
29 "r23", "r25", "r27", "r29", "r31");
30 return r11;
31}
32
33static inline long __syscall2(long n, long a, long b)
34{
35 register unsigned long r11 __asm__("r11") = n;
36 register unsigned long r3 __asm__("r3") = a;
37 register unsigned long r4 __asm__("r4") = b;
38 __asm__ __volatile__ ("l.sys 1"
39 : "=r"(r11)
40 : "r"(r11), "r"(r3), "r"(r4)
41 : "memory", "r5", "r6", "r7", "r8",
42 "r12", "r13", "r15", "r17", "r19", "r21",
43 "r23", "r25", "r27", "r29", "r31");
44 return r11;
45}
46
47static inline long __syscall3(long n, long a, long b, long c)
48{
49 register unsigned long r11 __asm__("r11") = n;
50 register unsigned long r3 __asm__("r3") = a;
51 register unsigned long r4 __asm__("r4") = b;
52 register unsigned long r5 __asm__("r5") = c;
53 __asm__ __volatile__ ("l.sys 1"
54 : "=r"(r11)
55 : "r"(r11), "r"(r3), "r"(r4), "r"(r5)
56 : "memory", "r6", "r7", "r8",
57 "r12", "r13", "r15", "r17", "r19", "r21",
58 "r23", "r25", "r27", "r29", "r31");
59 return r11;
60}
61
62static inline long __syscall4(long n, long a, long b, long c, long d)
63{
64 register unsigned long r11 __asm__("r11") = n;
65 register unsigned long r3 __asm__("r3") = a;
66 register unsigned long r4 __asm__("r4") = b;
67 register unsigned long r5 __asm__("r5") = c;
68 register unsigned long r6 __asm__("r6") = d;
69 __asm__ __volatile__ ("l.sys 1"
70 : "=r"(r11)
71 : "r"(r11), "r"(r3), "r"(r4), "r"(r5), "r"(r6)
72 : "memory", "r7", "r8",
73 "r12", "r13", "r15", "r17", "r19", "r21",
74 "r23", "r25", "r27", "r29", "r31");
75 return r11;
76}
77
78static inline long __syscall5(long n, long a, long b, long c, long d, long e)
79{
80 register unsigned long r11 __asm__("r11") = n;
81 register unsigned long r3 __asm__("r3") = a;
82 register unsigned long r4 __asm__("r4") = b;
83 register unsigned long r5 __asm__("r5") = c;
84 register unsigned long r6 __asm__("r6") = d;
85 register unsigned long r7 __asm__("r7") = e;
86 __asm__ __volatile__ ("l.sys 1"
87 : "=r"(r11)
88 : "r"(r11), "r"(r3), "r"(r4), "r"(r5), "r"(r6),
89 "r"(r7)
90 : "memory", "r8",
91 "r12", "r13", "r15", "r17", "r19", "r21",
92 "r23", "r25", "r27", "r29", "r31");
93 return r11;
94}
95
96static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
97{
98 register unsigned long r11 __asm__("r11") = n;
99 register unsigned long r3 __asm__("r3") = a;
100 register unsigned long r4 __asm__("r4") = b;
101 register unsigned long r5 __asm__("r5") = c;
102 register unsigned long r6 __asm__("r6") = d;
103 register unsigned long r7 __asm__("r7") = e;
104 register unsigned long r8 __asm__("r8") = f;
105 __asm__ __volatile__ ("l.sys 1"
106 : "=r"(r11)
107 : "r"(r11), "r"(r3), "r"(r4), "r"(r5), "r"(r6),
108 "r"(r7), "r"(r8)
109 : "memory",
110 "r12", "r13", "r15", "r17", "r19", "r21",
111 "r23", "r25", "r27", "r29", "r31");
112 return r11;
113}
114
115#define IPC_64 0
lib/libc/wasi/libc-top-half/musl/arch/powerpc/arch.mak deleted-1
...@@ -1 +0,0 @@
1COMPAT_SRC_DIRS = compat/time32
lib/libc/wasi/libc-top-half/musl/arch/powerpc/atomic_arch.h deleted-38
...@@ -1,38 +0,0 @@
1#define a_ll a_ll
2static inline int a_ll(volatile int *p)
3{
4 int v;
5 __asm__ __volatile__ ("lwarx %0, 0, %2" : "=r"(v) : "m"(*p), "r"(p));
6 return v;
7}
8
9#define a_sc a_sc
10static inline int a_sc(volatile int *p, int v)
11{
12 int r;
13 __asm__ __volatile__ (
14 "stwcx. %2, 0, %3 ; mfcr %0"
15 : "=r"(r), "=m"(*p) : "r"(v), "r"(p) : "memory", "cc");
16 return r & 0x20000000; /* "bit 2" of "cr0" (backwards bit order) */
17}
18
19#define a_barrier a_barrier
20static inline void a_barrier()
21{
22 __asm__ __volatile__ ("sync" : : : "memory");
23}
24
25#define a_pre_llsc a_barrier
26
27#define a_post_llsc a_post_llsc
28static inline void a_post_llsc()
29{
30 __asm__ __volatile__ ("isync" : : : "memory");
31}
32
33#define a_clz_32 a_clz_32
34static inline int a_clz_32(uint32_t x)
35{
36 __asm__ ("cntlzw %0, %1" : "=r"(x) : "r"(x));
37 return x;
38}
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/alltypes.h.in deleted-20
...@@ -1,20 +0,0 @@
1#define _REDIR_TIME64 1
2#define _Addr int
3#define _Int64 long long
4#define _Reg int
5
6#define __BYTE_ORDER 4321
7#define __LONG_MAX 0x7fffffffL
8
9#ifndef __cplusplus
10#ifdef __WCHAR_TYPE__
11TYPEDEF __WCHAR_TYPE__ wchar_t;
12#else
13TYPEDEF long wchar_t;
14#endif
15#endif
16
17TYPEDEF float float_t;
18TYPEDEF double double_t;
19
20TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/errno.h deleted-134
...@@ -1,134 +0,0 @@
1#define EPERM 1
2#define ENOENT 2
3#define ESRCH 3
4#define EINTR 4
5#define EIO 5
6#define ENXIO 6
7#define E2BIG 7
8#define ENOEXEC 8
9#define EBADF 9
10#define ECHILD 10
11#define EAGAIN 11
12#define ENOMEM 12
13#define EACCES 13
14#define EFAULT 14
15#define ENOTBLK 15
16#define EBUSY 16
17#define EEXIST 17
18#define EXDEV 18
19#define ENODEV 19
20#define ENOTDIR 20
21#define EISDIR 21
22#define EINVAL 22
23#define ENFILE 23
24#define EMFILE 24
25#define ENOTTY 25
26#define ETXTBSY 26
27#define EFBIG 27
28#define ENOSPC 28
29#define ESPIPE 29
30#define EROFS 30
31#define EMLINK 31
32#define EPIPE 32
33#define EDOM 33
34#define ERANGE 34
35#define EDEADLK 35
36#define ENAMETOOLONG 36
37#define ENOLCK 37
38#define ENOSYS 38
39#define ENOTEMPTY 39
40#define ELOOP 40
41#define EWOULDBLOCK EAGAIN
42#define ENOMSG 42
43#define EIDRM 43
44#define ECHRNG 44
45#define EL2NSYNC 45
46#define EL3HLT 46
47#define EL3RST 47
48#define ELNRNG 48
49#define EUNATCH 49
50#define ENOCSI 50
51#define EL2HLT 51
52#define EBADE 52
53#define EBADR 53
54#define EXFULL 54
55#define ENOANO 55
56#define EBADRQC 56
57#define EBADSLT 57
58#define EDEADLOCK 58
59#define EBFONT 59
60#define ENOSTR 60
61#define ENODATA 61
62#define ETIME 62
63#define ENOSR 63
64#define ENONET 64
65#define ENOPKG 65
66#define EREMOTE 66
67#define ENOLINK 67
68#define EADV 68
69#define ESRMNT 69
70#define ECOMM 70
71#define EPROTO 71
72#define EMULTIHOP 72
73#define EDOTDOT 73
74#define EBADMSG 74
75#define EOVERFLOW 75
76#define ENOTUNIQ 76
77#define EBADFD 77
78#define EREMCHG 78
79#define ELIBACC 79
80#define ELIBBAD 80
81#define ELIBSCN 81
82#define ELIBMAX 82
83#define ELIBEXEC 83
84#define EILSEQ 84
85#define ERESTART 85
86#define ESTRPIPE 86
87#define EUSERS 87
88#define ENOTSOCK 88
89#define EDESTADDRREQ 89
90#define EMSGSIZE 90
91#define EPROTOTYPE 91
92#define ENOPROTOOPT 92
93#define EPROTONOSUPPORT 93
94#define ESOCKTNOSUPPORT 94
95#define EOPNOTSUPP 95
96#define ENOTSUP EOPNOTSUPP
97#define EPFNOSUPPORT 96
98#define EAFNOSUPPORT 97
99#define EADDRINUSE 98
100#define EADDRNOTAVAIL 99
101#define ENETDOWN 100
102#define ENETUNREACH 101
103#define ENETRESET 102
104#define ECONNABORTED 103
105#define ECONNRESET 104
106#define ENOBUFS 105
107#define EISCONN 106
108#define ENOTCONN 107
109#define ESHUTDOWN 108
110#define ETOOMANYREFS 109
111#define ETIMEDOUT 110
112#define ECONNREFUSED 111
113#define EHOSTDOWN 112
114#define EHOSTUNREACH 113
115#define EALREADY 114
116#define EINPROGRESS 115
117#define ESTALE 116
118#define EUCLEAN 117
119#define ENOTNAM 118
120#define ENAVAIL 119
121#define EISNAM 120
122#define EREMOTEIO 121
123#define EDQUOT 122
124#define ENOMEDIUM 123
125#define EMEDIUMTYPE 124
126#define ECANCELED 125
127#define ENOKEY 126
128#define EKEYEXPIRED 127
129#define EKEYREVOKED 128
130#define EKEYREJECTED 129
131#define EOWNERDEAD 130
132#define ENOTRECOVERABLE 131
133#define ERFKILL 132
134#define EHWPOISON 133
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0400000
16#define O_LARGEFILE 0200000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020040000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 8
29#define F_GETOWN 9
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 12
34#define F_SETLK 13
35#define F_SETLKW 14
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/fenv.h deleted-36
...@@ -1,36 +0,0 @@
1#ifdef _SOFT_FLOAT
2#define FE_ALL_EXCEPT 0
3#define FE_TONEAREST 0
4#else
5#define FE_TONEAREST 0
6#define FE_TOWARDZERO 1
7#define FE_UPWARD 2
8#define FE_DOWNWARD 3
9
10#define FE_INEXACT 0x02000000
11#define FE_DIVBYZERO 0x04000000
12#define FE_UNDERFLOW 0x08000000
13#define FE_OVERFLOW 0x10000000
14#define FE_INVALID 0x20000000
15
16#define FE_ALL_EXCEPT 0x3e000000
17
18#ifdef _GNU_SOURCE
19#define FE_INVALID_SNAN 0x01000000
20#define FE_INVALID_ISI 0x00800000
21#define FE_INVALID_IDI 0x00400000
22#define FE_INVALID_ZDZ 0x00200000
23#define FE_INVALID_IMZ 0x00100000
24#define FE_INVALID_COMPARE 0x00080000
25#define FE_INVALID_SOFTWARE 0x00000400
26#define FE_INVALID_SQRT 0x00000200
27#define FE_INVALID_INTEGER_CONVERSION 0x00000100
28
29#define FE_ALL_INVALID 0x01f80700
30#endif
31#endif
32
33typedef unsigned fexcept_t;
34typedef double fenv_t;
35
36#define FE_DFL_ENV ((const fenv_t *)-1)
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
4#define LDBL_MIN 2.22507385850720138309e-308L
5#define LDBL_MAX 1.79769313486231570815e+308L
6#define LDBL_EPSILON 2.22044604925031308085e-16L
7
8#define LDBL_MANT_DIG 53
9#define LDBL_MIN_EXP (-1021)
10#define LDBL_MAX_EXP 1024
11
12#define LDBL_DIG 15
13#define LDBL_MIN_10_EXP (-307)
14#define LDBL_MAX_10_EXP 308
15
16#define DECIMAL_DIG 17
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/hwcap.h deleted-43
...@@ -1,43 +0,0 @@
1#define PPC_FEATURE_32 0x80000000
2#define PPC_FEATURE_64 0x40000000
3#define PPC_FEATURE_601_INSTR 0x20000000
4#define PPC_FEATURE_HAS_ALTIVEC 0x10000000
5#define PPC_FEATURE_HAS_FPU 0x08000000
6#define PPC_FEATURE_HAS_MMU 0x04000000
7#define PPC_FEATURE_HAS_4xxMAC 0x02000000
8#define PPC_FEATURE_UNIFIED_CACHE 0x01000000
9#define PPC_FEATURE_HAS_SPE 0x00800000
10#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000
11#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000
12#define PPC_FEATURE_NO_TB 0x00100000
13#define PPC_FEATURE_POWER4 0x00080000
14#define PPC_FEATURE_POWER5 0x00040000
15#define PPC_FEATURE_POWER5_PLUS 0x00020000
16#define PPC_FEATURE_CELL 0x00010000
17#define PPC_FEATURE_BOOKE 0x00008000
18#define PPC_FEATURE_SMT 0x00004000
19#define PPC_FEATURE_ICACHE_SNOOP 0x00002000
20#define PPC_FEATURE_ARCH_2_05 0x00001000
21#define PPC_FEATURE_PA6T 0x00000800
22#define PPC_FEATURE_HAS_DFP 0x00000400
23#define PPC_FEATURE_POWER6_EXT 0x00000200
24#define PPC_FEATURE_ARCH_2_06 0x00000100
25#define PPC_FEATURE_HAS_VSX 0x00000080
26#define PPC_FEATURE_PSERIES_PERFMON_COMPAT 0x00000040
27
28#define PPC_FEATURE_TRUE_LE 0x00000002
29#define PPC_FEATURE_PPC_LE 0x00000001
30
31#define PPC_FEATURE2_ARCH_2_07 0x80000000
32#define PPC_FEATURE2_HTM 0x40000000
33#define PPC_FEATURE2_DSCR 0x20000000
34#define PPC_FEATURE2_EBB 0x10000000
35#define PPC_FEATURE2_ISEL 0x08000000
36#define PPC_FEATURE2_TAR 0x04000000
37#define PPC_FEATURE2_VEC_CRYPTO 0x02000000
38#define PPC_FEATURE2_HTM_NOSC 0x01000000
39#define PPC_FEATURE2_ARCH_3_00 0x00800000
40#define PPC_FEATURE2_HAS_IEEE128 0x00400000
41#define PPC_FEATURE2_DARN 0x00200000
42#define PPC_FEATURE2_SCV 0x00100000
43#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/ioctl.h deleted-120
...@@ -1,120 +0,0 @@
1#define _IOC(a,b,c,d) ( ((a)<<29) | ((b)<<8) | (c) | ((d)<<16) )
2#define _IOC_NONE 1U
3#define _IOC_WRITE 4U
4#define _IOC_READ 2U
5
6#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
7#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
8#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
9#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
10
11#define FIONCLEX _IO('f', 2)
12#define FIOCLEX _IO('f', 1)
13#define FIOASYNC _IOW('f', 125, int)
14#define FIONBIO _IOW('f', 126, int)
15#define FIONREAD _IOR('f', 127, int)
16#define TIOCINQ FIONREAD
17#define FIOQSIZE _IOR('f', 128, char[8])
18#define TIOCGETP _IOR('t', 8, char[6])
19#define TIOCSETP _IOW('t', 9, char[6])
20#define TIOCSETN _IOW('t', 10, char[6])
21
22#define TIOCSETC _IOW('t', 17, char[6])
23#define TIOCGETC _IOR('t', 18, char[6])
24#define TCGETS _IOR('t', 19, char[44])
25#define TCSETS _IOW('t', 20, char[44])
26#define TCSETSW _IOW('t', 21, char[44])
27#define TCSETSF _IOW('t', 22, char[44])
28
29#define TCGETA _IOR('t', 23, char[20])
30#define TCSETA _IOW('t', 24, char[20])
31#define TCSETAW _IOW('t', 25, char[20])
32#define TCSETAF _IOW('t', 28, char[20])
33
34#define TCSBRK _IO('t', 29)
35#define TCXONC _IO('t', 30)
36#define TCFLSH _IO('t', 31)
37
38#define TIOCSWINSZ _IOW('t', 103, char[8])
39#define TIOCGWINSZ _IOR('t', 104, char[8])
40#define TIOCSTART _IO('t', 110)
41#define TIOCSTOP _IO('t', 111)
42
43#define TIOCOUTQ _IOR('t', 115, int)
44
45#define TIOCGLTC _IOR('t', 116, char[6])
46#define TIOCSLTC _IOW('t', 117, char[6])
47#define TIOCSPGRP _IOW('t', 118, int)
48#define TIOCGPGRP _IOR('t', 119, int)
49
50#define TIOCEXCL 0x540C
51#define TIOCNXCL 0x540D
52#define TIOCSCTTY 0x540E
53
54#define TIOCSTI 0x5412
55#define TIOCMGET 0x5415
56#define TIOCMBIS 0x5416
57#define TIOCMBIC 0x5417
58#define TIOCMSET 0x5418
59#define TIOCM_LE 0x001
60#define TIOCM_DTR 0x002
61#define TIOCM_RTS 0x004
62#define TIOCM_ST 0x008
63#define TIOCM_SR 0x010
64#define TIOCM_CTS 0x020
65#define TIOCM_CAR 0x040
66#define TIOCM_RNG 0x080
67#define TIOCM_DSR 0x100
68#define TIOCM_CD TIOCM_CAR
69#define TIOCM_RI TIOCM_RNG
70#define TIOCM_OUT1 0x2000
71#define TIOCM_OUT2 0x4000
72#define TIOCM_LOOP 0x8000
73
74#define TIOCGSOFTCAR 0x5419
75#define TIOCSSOFTCAR 0x541A
76#define TIOCLINUX 0x541C
77#define TIOCCONS 0x541D
78#define TIOCGSERIAL 0x541E
79#define TIOCSSERIAL 0x541F
80#define TIOCPKT 0x5420
81
82#define TIOCNOTTY 0x5422
83#define TIOCSETD 0x5423
84#define TIOCGETD 0x5424
85#define TCSBRKP 0x5425
86#define TIOCSBRK 0x5427
87#define TIOCCBRK 0x5428
88#define TIOCGSID 0x5429
89#define TIOCGRS485 0x542e
90#define TIOCSRS485 0x542f
91#define TIOCGPTN _IOR('T',0x30, unsigned int)
92#define TIOCSPTLCK _IOW('T',0x31, int)
93#define TIOCGDEV _IOR('T',0x32, unsigned int)
94#define TIOCSIG _IOW('T',0x36, int)
95#define TIOCVHANGUP 0x5437
96#define TIOCGPKT _IOR('T', 0x38, int)
97#define TIOCGPTLCK _IOR('T', 0x39, int)
98#define TIOCGEXCL _IOR('T', 0x40, int)
99#define TIOCGPTPEER _IO('T', 0x41)
100
101#define TIOCSERCONFIG 0x5453
102#define TIOCSERGWILD 0x5454
103#define TIOCSERSWILD 0x5455
104#define TIOCGLCKTRMIOS 0x5456
105#define TIOCSLCKTRMIOS 0x5457
106#define TIOCSERGSTRUCT 0x5458
107#define TIOCSERGETLSR 0x5459
108#define TIOCSERGETMULTI 0x545A
109#define TIOCSERSETMULTI 0x545B
110
111#define TIOCMIWAIT 0x545C
112#define TIOCGICOUNT 0x545D
113
114#define FIOSETOWN 0x8901
115#define SIOCSPGRP 0x8902
116#define FIOGETOWN 0x8903
117#define SIOCGPGRP 0x8904
118#define SIOCATMARK 0x8905
119#define SIOCGSTAMP _IOR(0x89, 6, char[16])
120#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/ipc.h deleted-12
...@@ -1,12 +0,0 @@
1struct ipc_perm {
2 key_t __ipc_perm_key;
3 uid_t uid;
4 gid_t gid;
5 uid_t cuid;
6 gid_t cgid;
7 mode_t mode;
8 int __ipc_perm_seq;
9 int __pad1;
10 long long __pad2;
11 long long __pad3;
12};
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/ipcstat.h deleted-1
...@@ -1 +0,0 @@
1#define IPC_STAT 0x102
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/mman.h deleted-13
...@@ -1,13 +0,0 @@
1#define PROT_SAO 0x10
2
3#undef MAP_NORESERVE
4#define MAP_NORESERVE 0x40
5#undef MAP_LOCKED
6#define MAP_LOCKED 0x80
7
8#undef MCL_CURRENT
9#define MCL_CURRENT 0x2000
10#undef MCL_FUTURE
11#define MCL_FUTURE 0x4000
12#undef MCL_ONFAULT
13#define MCL_ONFAULT 0x8000
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/msg.h deleted-18
...@@ -1,18 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 unsigned long __msg_stime_hi;
4 unsigned long __msg_stime_lo;
5 unsigned long __msg_rtime_hi;
6 unsigned long __msg_rtime_lo;
7 unsigned long __msg_ctime_hi;
8 unsigned long __msg_ctime_lo;
9 unsigned long msg_cbytes;
10 msgqnum_t msg_qnum;
11 msglen_t msg_qbytes;
12 pid_t msg_lspid;
13 pid_t msg_lrpid;
14 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
18};
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_ILP32_OFFBIG 1
2#define _POSIX_V7_ILP32_OFFBIG 1
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/ptrace.h deleted-25
...@@ -1,25 +0,0 @@
1#define PTRACE_GETVRREGS 0x12
2#define PTRACE_SETVRREGS 0x13
3#define PTRACE_GETEVRREGS 0x14
4#define PTRACE_SETEVRREGS 0x15
5#define PTRACE_GETREGS64 0x16
6#define PTRACE_SETREGS64 0x17
7#define PTRACE_GET_DEBUGREG 0x19
8#define PTRACE_SET_DEBUGREG 0x1a
9#define PTRACE_GETVSRREGS 0x1b
10#define PTRACE_SETVSRREGS 0x1c
11#define PTRACE_SYSEMU 0x1d
12#define PTRACE_SYSEMU_SINGLESTEP 0x1e
13#define PTRACE_SINGLEBLOCK 0x100
14
15#define PT_GETVRREGS PTRACE_GETVRREGS
16#define PT_SETVRREGS PTRACE_SETVRREGS
17#define PT_GETEVRREGS PTRACE_GETEVRREGS
18#define PT_SETEVRREGS PTRACE_SETEVRREGS
19#define PT_GETREGS64 PTRACE_GETREGS64
20#define PT_SETREGS64 PTRACE_SETREGS64
21#define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG
22#define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG
23#define PT_GETVSRREGS PTRACE_GETVSRREGS
24#define PT_SETVSRREGS PTRACE_SETVSRREGS
25#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/reg.h deleted-3
...@@ -1,3 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3/* FIXME */
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/sem.h deleted-12
...@@ -1,12 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 unsigned long __sem_otime_hi;
4 unsigned long __sem_otime_lo;
5 unsigned long __sem_ctime_hi;
6 unsigned long __sem_ctime_lo;
7 unsigned short __sem_nsems_pad, sem_nsems;
8 long __unused3;
9 long __unused4;
10 time_t sem_otime;
11 time_t sem_ctime;
12};
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long long __jmp_buf[56];
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/shm.h deleted-30
...@@ -1,30 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 unsigned long __shm_atime_hi;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_dtime_hi;
8 unsigned long __shm_dtime_lo;
9 unsigned long __shm_ctime_hi;
10 unsigned long __shm_ctime_lo;
11 size_t shm_segsz;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17 time_t shm_atime;
18 time_t shm_dtime;
19 time_t shm_ctime;
20};
21
22struct shminfo {
23 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
24};
25
26struct shm_info {
27 int __used_ids;
28 unsigned long shm_tot, shm_rss, shm_swp;
29 unsigned long __swap_attempts, __swap_successes;
30};
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/signal.h deleted-119
...@@ -1,119 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 4096
6#define SIGSTKSZ 10240
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10
11typedef unsigned long greg_t, gregset_t[48];
12
13typedef struct {
14 double fpregs[32];
15 double fpscr;
16 unsigned _pad[2];
17} fpregset_t;
18
19typedef struct {
20 unsigned vrregs[32][4];
21 unsigned vrsave;
22 unsigned _pad[2];
23 unsigned vscr;
24} vrregset_t;
25
26struct sigcontext {
27 unsigned long _unused[4];
28 int signal;
29 unsigned long handler;
30 unsigned long oldmask;
31 struct pt_regs *regs;
32};
33
34typedef struct {
35 gregset_t gregs;
36 fpregset_t fpregs;
37 vrregset_t vrregs
38#ifdef __GNUC__
39 __attribute__((__aligned__(16)))
40#endif
41 ;
42} mcontext_t;
43
44#else
45
46typedef struct {
47 long __regs[48+68+4*32+4]
48#ifdef __GNUC__
49 __attribute__((__aligned__(16)))
50#endif
51 ;
52} mcontext_t;
53
54#endif
55
56struct sigaltstack {
57 void *ss_sp;
58 int ss_flags;
59 size_t ss_size;
60};
61
62typedef struct __ucontext {
63 unsigned long uc_flags;
64 struct __ucontext *uc_link;
65 stack_t uc_stack;
66 int uc_pad[7];
67 mcontext_t *uc_regs;
68 sigset_t uc_sigmask;
69 int uc_pad2[3];
70 mcontext_t uc_mcontext;
71} ucontext_t;
72
73#define SA_NOCLDSTOP 1U
74#define SA_NOCLDWAIT 2U
75#define SA_SIGINFO 4U
76#define SA_ONSTACK 0x08000000U
77#define SA_RESTART 0x10000000U
78#define SA_NODEFER 0x40000000U
79#define SA_RESETHAND 0x80000000U
80#define SA_RESTORER 0x04000000U
81
82#endif
83
84#define SIGHUP 1
85#define SIGINT 2
86#define SIGQUIT 3
87#define SIGILL 4
88#define SIGTRAP 5
89#define SIGABRT 6
90#define SIGIOT SIGABRT
91#define SIGBUS 7
92#define SIGFPE 8
93#define SIGKILL 9
94#define SIGUSR1 10
95#define SIGSEGV 11
96#define SIGUSR2 12
97#define SIGPIPE 13
98#define SIGALRM 14
99#define SIGTERM 15
100#define SIGSTKFLT 16
101#define SIGCHLD 17
102#define SIGCONT 18
103#define SIGSTOP 19
104#define SIGTSTP 20
105#define SIGTTIN 21
106#define SIGTTOU 22
107#define SIGURG 23
108#define SIGXCPU 24
109#define SIGXFSZ 25
110#define SIGVTALRM 26
111#define SIGPROF 27
112#define SIGWINCH 28
113#define SIGIO 29
114#define SIGPOLL 29
115#define SIGPWR 30
116#define SIGSYS 31
117#define SIGUNUSED SIGSYS
118
119#define _NSIG 65
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/socket.h deleted-25
...@@ -1,25 +0,0 @@
1#define SO_DEBUG 1
2#define SO_REUSEADDR 2
3#define SO_TYPE 3
4#define SO_ERROR 4
5#define SO_DONTROUTE 5
6#define SO_BROADCAST 6
7#define SO_SNDBUF 7
8#define SO_RCVBUF 8
9#define SO_KEEPALIVE 9
10#define SO_OOBINLINE 10
11#define SO_NO_CHECK 11
12#define SO_PRIORITY 12
13#define SO_LINGER 13
14#define SO_BSDCOMPAT 14
15#define SO_REUSEPORT 15
16#define SO_RCVLOWAT 16
17#define SO_SNDLOWAT 17
18#define SO_PASSCRED 20
19#define SO_PEERCRED 21
20#define SO_ACCEPTCONN 30
21#define SO_PEERSEC 31
22#define SO_SNDBUFFORCE 32
23#define SO_RCVBUFFORCE 33
24#define SO_PROTOCOL 38
25#define SO_DOMAIN 39
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/stat.h deleted-24
...@@ -1,24 +0,0 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3
4struct stat {
5 dev_t st_dev;
6 ino_t st_ino;
7 mode_t st_mode;
8 nlink_t st_nlink;
9 uid_t st_uid;
10 gid_t st_gid;
11 dev_t st_rdev;
12 short __st_rdev_padding;
13 off_t st_size;
14 blksize_t st_blksize;
15 blkcnt_t st_blocks;
16 struct {
17 long tv_sec;
18 long tv_nsec;
19 } __st_atim32, __st_mtim32, __st_ctim32;
20 unsigned __unused[2];
21 struct timespec st_atim;
22 struct timespec st_mtim;
23 struct timespec st_ctim;
24};
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT32_MIN
16#define INTPTR_MAX INT32_MAX
17#define UINTPTR_MAX UINT32_MAX
18#define PTRDIFF_MIN INT32_MIN
19#define PTRDIFF_MAX INT32_MAX
20#define SIZE_MAX UINT32_MAX
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/syscall.h.in deleted-422
...@@ -1,422 +0,0 @@
1#define __NR_restart_syscall 0
2#define __NR_exit 1
3#define __NR_fork 2
4#define __NR_read 3
5#define __NR_write 4
6#define __NR_open 5
7#define __NR_close 6
8#define __NR_waitpid 7
9#define __NR_creat 8
10#define __NR_link 9
11#define __NR_unlink 10
12#define __NR_execve 11
13#define __NR_chdir 12
14#define __NR_time 13
15#define __NR_mknod 14
16#define __NR_chmod 15
17#define __NR_lchown 16
18#define __NR_break 17
19#define __NR_oldstat 18
20#define __NR_lseek 19
21#define __NR_getpid 20
22#define __NR_mount 21
23#define __NR_umount 22
24#define __NR_setuid 23
25#define __NR_getuid 24
26#define __NR_stime 25
27#define __NR_ptrace 26
28#define __NR_alarm 27
29#define __NR_oldfstat 28
30#define __NR_pause 29
31#define __NR_utime 30
32#define __NR_stty 31
33#define __NR_gtty 32
34#define __NR_access 33
35#define __NR_nice 34
36#define __NR_ftime 35
37#define __NR_sync 36
38#define __NR_kill 37
39#define __NR_rename 38
40#define __NR_mkdir 39
41#define __NR_rmdir 40
42#define __NR_dup 41
43#define __NR_pipe 42
44#define __NR_times 43
45#define __NR_prof 44
46#define __NR_brk 45
47#define __NR_setgid 46
48#define __NR_getgid 47
49#define __NR_signal 48
50#define __NR_geteuid 49
51#define __NR_getegid 50
52#define __NR_acct 51
53#define __NR_umount2 52
54#define __NR_lock 53
55#define __NR_ioctl 54
56#define __NR_fcntl 55
57#define __NR_mpx 56
58#define __NR_setpgid 57
59#define __NR_ulimit 58
60#define __NR_oldolduname 59
61#define __NR_umask 60
62#define __NR_chroot 61
63#define __NR_ustat 62
64#define __NR_dup2 63
65#define __NR_getppid 64
66#define __NR_getpgrp 65
67#define __NR_setsid 66
68#define __NR_sigaction 67
69#define __NR_sgetmask 68
70#define __NR_ssetmask 69
71#define __NR_setreuid 70
72#define __NR_setregid 71
73#define __NR_sigsuspend 72
74#define __NR_sigpending 73
75#define __NR_sethostname 74
76#define __NR_setrlimit 75
77#define __NR_getrlimit 76
78#define __NR_getrusage 77
79#define __NR_gettimeofday_time32 78
80#define __NR_settimeofday_time32 79
81#define __NR_getgroups 80
82#define __NR_setgroups 81
83#define __NR_select 82
84#define __NR_symlink 83
85#define __NR_oldlstat 84
86#define __NR_readlink 85
87#define __NR_uselib 86
88#define __NR_swapon 87
89#define __NR_reboot 88
90#define __NR_readdir 89
91#define __NR_mmap 90
92#define __NR_munmap 91
93#define __NR_truncate 92
94#define __NR_ftruncate 93
95#define __NR_fchmod 94
96#define __NR_fchown 95
97#define __NR_getpriority 96
98#define __NR_setpriority 97
99#define __NR_profil 98
100#define __NR_statfs 99
101#define __NR_fstatfs 100
102#define __NR_ioperm 101
103#define __NR_socketcall 102
104#define __NR_syslog 103
105#define __NR_setitimer 104
106#define __NR_getitimer 105
107#define __NR_stat 106
108#define __NR_lstat 107
109#define __NR_fstat 108
110#define __NR_olduname 109
111#define __NR_iopl 110
112#define __NR_vhangup 111
113#define __NR_idle 112
114#define __NR_vm86 113
115#define __NR_wait4 114
116#define __NR_swapoff 115
117#define __NR_sysinfo 116
118#define __NR_ipc 117
119#define __NR_fsync 118
120#define __NR_sigreturn 119
121#define __NR_clone 120
122#define __NR_setdomainname 121
123#define __NR_uname 122
124#define __NR_modify_ldt 123
125#define __NR_adjtimex 124
126#define __NR_mprotect 125
127#define __NR_sigprocmask 126
128#define __NR_create_module 127
129#define __NR_init_module 128
130#define __NR_delete_module 129
131#define __NR_get_kernel_syms 130
132#define __NR_quotactl 131
133#define __NR_getpgid 132
134#define __NR_fchdir 133
135#define __NR_bdflush 134
136#define __NR_sysfs 135
137#define __NR_personality 136
138#define __NR_afs_syscall 137
139#define __NR_setfsuid 138
140#define __NR_setfsgid 139
141#define __NR__llseek 140
142#define __NR_getdents 141
143#define __NR__newselect 142
144#define __NR_flock 143
145#define __NR_msync 144
146#define __NR_readv 145
147#define __NR_writev 146
148#define __NR_getsid 147
149#define __NR_fdatasync 148
150#define __NR__sysctl 149
151#define __NR_mlock 150
152#define __NR_munlock 151
153#define __NR_mlockall 152
154#define __NR_munlockall 153
155#define __NR_sched_setparam 154
156#define __NR_sched_getparam 155
157#define __NR_sched_setscheduler 156
158#define __NR_sched_getscheduler 157
159#define __NR_sched_yield 158
160#define __NR_sched_get_priority_max 159
161#define __NR_sched_get_priority_min 160
162#define __NR_sched_rr_get_interval 161
163#define __NR_nanosleep 162
164#define __NR_mremap 163
165#define __NR_setresuid 164
166#define __NR_getresuid 165
167#define __NR_query_module 166
168#define __NR_poll 167
169#define __NR_nfsservctl 168
170#define __NR_setresgid 169
171#define __NR_getresgid 170
172#define __NR_prctl 171
173#define __NR_rt_sigreturn 172
174#define __NR_rt_sigaction 173
175#define __NR_rt_sigprocmask 174
176#define __NR_rt_sigpending 175
177#define __NR_rt_sigtimedwait 176
178#define __NR_rt_sigqueueinfo 177
179#define __NR_rt_sigsuspend 178
180#define __NR_pread64 179
181#define __NR_pwrite64 180
182#define __NR_chown 181
183#define __NR_getcwd 182
184#define __NR_capget 183
185#define __NR_capset 184
186#define __NR_sigaltstack 185
187#define __NR_sendfile 186
188#define __NR_getpmsg 187
189#define __NR_putpmsg 188
190#define __NR_vfork 189
191#define __NR_ugetrlimit 190
192#define __NR_readahead 191
193#define __NR_mmap2 192
194#define __NR_truncate64 193
195#define __NR_ftruncate64 194
196#define __NR_stat64 195
197#define __NR_lstat64 196
198#define __NR_fstat64 197
199#define __NR_pciconfig_read 198
200#define __NR_pciconfig_write 199
201#define __NR_pciconfig_iobase 200
202#define __NR_multiplexer 201
203#define __NR_getdents64 202
204#define __NR_pivot_root 203
205#define __NR_fcntl64 204
206#define __NR_madvise 205
207#define __NR_mincore 206
208#define __NR_gettid 207
209#define __NR_tkill 208
210#define __NR_setxattr 209
211#define __NR_lsetxattr 210
212#define __NR_fsetxattr 211
213#define __NR_getxattr 212
214#define __NR_lgetxattr 213
215#define __NR_fgetxattr 214
216#define __NR_listxattr 215
217#define __NR_llistxattr 216
218#define __NR_flistxattr 217
219#define __NR_removexattr 218
220#define __NR_lremovexattr 219
221#define __NR_fremovexattr 220
222#define __NR_futex 221
223#define __NR_sched_setaffinity 222
224#define __NR_sched_getaffinity 223
225#define __NR_tuxcall 225
226#define __NR_sendfile64 226
227#define __NR_io_setup 227
228#define __NR_io_destroy 228
229#define __NR_io_getevents 229
230#define __NR_io_submit 230
231#define __NR_io_cancel 231
232#define __NR_set_tid_address 232
233#define __NR_fadvise64 233
234#define __NR_exit_group 234
235#define __NR_lookup_dcookie 235
236#define __NR_epoll_create 236
237#define __NR_epoll_ctl 237
238#define __NR_epoll_wait 238
239#define __NR_remap_file_pages 239
240#define __NR_timer_create 240
241#define __NR_timer_settime32 241
242#define __NR_timer_gettime32 242
243#define __NR_timer_getoverrun 243
244#define __NR_timer_delete 244
245#define __NR_clock_settime32 245
246#define __NR_clock_gettime32 246
247#define __NR_clock_getres_time32 247
248#define __NR_clock_nanosleep_time32 248
249#define __NR_swapcontext 249
250#define __NR_tgkill 250
251#define __NR_utimes 251
252#define __NR_statfs64 252
253#define __NR_fstatfs64 253
254#define __NR_fadvise64_64 254
255#define __NR_rtas 255
256#define __NR_sys_debug_setcontext 256
257#define __NR_migrate_pages 258
258#define __NR_mbind 259
259#define __NR_get_mempolicy 260
260#define __NR_set_mempolicy 261
261#define __NR_mq_open 262
262#define __NR_mq_unlink 263
263#define __NR_mq_timedsend 264
264#define __NR_mq_timedreceive 265
265#define __NR_mq_notify 266
266#define __NR_mq_getsetattr 267
267#define __NR_kexec_load 268
268#define __NR_add_key 269
269#define __NR_request_key 270
270#define __NR_keyctl 271
271#define __NR_waitid 272
272#define __NR_ioprio_set 273
273#define __NR_ioprio_get 274
274#define __NR_inotify_init 275
275#define __NR_inotify_add_watch 276
276#define __NR_inotify_rm_watch 277
277#define __NR_spu_run 278
278#define __NR_spu_create 279
279#define __NR_pselect6 280
280#define __NR_ppoll 281
281#define __NR_unshare 282
282#define __NR_splice 283
283#define __NR_tee 284
284#define __NR_vmsplice 285
285#define __NR_openat 286
286#define __NR_mkdirat 287
287#define __NR_mknodat 288
288#define __NR_fchownat 289
289#define __NR_futimesat 290
290#define __NR_fstatat64 291
291#define __NR_unlinkat 292
292#define __NR_renameat 293
293#define __NR_linkat 294
294#define __NR_symlinkat 295
295#define __NR_readlinkat 296
296#define __NR_fchmodat 297
297#define __NR_faccessat 298
298#define __NR_get_robust_list 299
299#define __NR_set_robust_list 300
300#define __NR_move_pages 301
301#define __NR_getcpu 302
302#define __NR_epoll_pwait 303
303#define __NR_utimensat 304
304#define __NR_signalfd 305
305#define __NR_timerfd_create 306
306#define __NR_eventfd 307
307#define __NR_sync_file_range2 308
308#define __NR_fallocate 309
309#define __NR_subpage_prot 310
310#define __NR_timerfd_settime32 311
311#define __NR_timerfd_gettime32 312
312#define __NR_signalfd4 313
313#define __NR_eventfd2 314
314#define __NR_epoll_create1 315
315#define __NR_dup3 316
316#define __NR_pipe2 317
317#define __NR_inotify_init1 318
318#define __NR_perf_event_open 319
319#define __NR_preadv 320
320#define __NR_pwritev 321
321#define __NR_rt_tgsigqueueinfo 322
322#define __NR_fanotify_init 323
323#define __NR_fanotify_mark 324
324#define __NR_prlimit64 325
325#define __NR_socket 326
326#define __NR_bind 327
327#define __NR_connect 328
328#define __NR_listen 329
329#define __NR_accept 330
330#define __NR_getsockname 331
331#define __NR_getpeername 332
332#define __NR_socketpair 333
333#define __NR_send 334
334#define __NR_sendto 335
335#define __NR_recv 336
336#define __NR_recvfrom 337
337#define __NR_shutdown 338
338#define __NR_setsockopt 339
339#define __NR_getsockopt 340
340#define __NR_sendmsg 341
341#define __NR_recvmsg 342
342#define __NR_recvmmsg 343
343#define __NR_accept4 344
344#define __NR_name_to_handle_at 345
345#define __NR_open_by_handle_at 346
346#define __NR_clock_adjtime 347
347#define __NR_syncfs 348
348#define __NR_sendmmsg 349
349#define __NR_setns 350
350#define __NR_process_vm_readv 351
351#define __NR_process_vm_writev 352
352#define __NR_finit_module 353
353#define __NR_kcmp 354
354#define __NR_sched_setattr 355
355#define __NR_sched_getattr 356
356#define __NR_renameat2 357
357#define __NR_seccomp 358
358#define __NR_getrandom 359
359#define __NR_memfd_create 360
360#define __NR_bpf 361
361#define __NR_execveat 362
362#define __NR_switch_endian 363
363#define __NR_userfaultfd 364
364#define __NR_membarrier 365
365#define __NR_mlock2 378
366#define __NR_copy_file_range 379
367#define __NR_preadv2 380
368#define __NR_pwritev2 381
369#define __NR_kexec_file_load 382
370#define __NR_statx 383
371#define __NR_pkey_alloc 384
372#define __NR_pkey_free 385
373#define __NR_pkey_mprotect 386
374#define __NR_rseq 387
375#define __NR_io_pgetevents 388
376#define __NR_semget 393
377#define __NR_semctl 394
378#define __NR_shmget 395
379#define __NR_shmctl 396
380#define __NR_shmat 397
381#define __NR_shmdt 398
382#define __NR_msgget 399
383#define __NR_msgsnd 400
384#define __NR_msgrcv 401
385#define __NR_msgctl 402
386#define __NR_clock_gettime64 403
387#define __NR_clock_settime64 404
388#define __NR_clock_adjtime64 405
389#define __NR_clock_getres_time64 406
390#define __NR_clock_nanosleep_time64 407
391#define __NR_timer_gettime64 408
392#define __NR_timer_settime64 409
393#define __NR_timerfd_gettime64 410
394#define __NR_timerfd_settime64 411
395#define __NR_utimensat_time64 412
396#define __NR_pselect6_time64 413
397#define __NR_ppoll_time64 414
398#define __NR_io_pgetevents_time64 416
399#define __NR_recvmmsg_time64 417
400#define __NR_mq_timedsend_time64 418
401#define __NR_mq_timedreceive_time64 419
402#define __NR_semtimedop_time64 420
403#define __NR_rt_sigtimedwait_time64 421
404#define __NR_futex_time64 422
405#define __NR_sched_rr_get_interval_time64 423
406#define __NR_pidfd_send_signal 424
407#define __NR_io_uring_setup 425
408#define __NR_io_uring_enter 426
409#define __NR_io_uring_register 427
410#define __NR_open_tree 428
411#define __NR_move_mount 429
412#define __NR_fsopen 430
413#define __NR_fsconfig 431
414#define __NR_fsmount 432
415#define __NR_fspick 433
416#define __NR_pidfd_open 434
417#define __NR_clone3 435
418#define __NR_close_range 436
419#define __NR_openat2 437
420#define __NR_pidfd_getfd 438
421#define __NR_faccessat2 439
422
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/termios.h deleted-171
...@@ -1,171 +0,0 @@
1#undef NCCS
2#define NCCS 19
3struct termios {
4 tcflag_t c_iflag;
5 tcflag_t c_oflag;
6 tcflag_t c_cflag;
7 tcflag_t c_lflag;
8 cc_t c_cc[NCCS];
9 cc_t c_line;
10 speed_t __c_ispeed;
11 speed_t __c_ospeed;
12};
13
14#define VINTR 0
15#define VQUIT 1
16#define VERASE 2
17#define VKILL 3
18#define VEOF 4
19#define VMIN 5
20#define VEOL 6
21#define VTIME 7
22#define VEOL2 8
23#define VSWTC 9
24#define VWERASE 10
25#define VREPRINT 11
26#define VSUSP 12
27#define VSTART 13
28#define VSTOP 14
29#define VLNEXT 15
30#define VDISCARD 16
31
32#define IGNBRK 0000001
33#define BRKINT 0000002
34#define IGNPAR 0000004
35#define PARMRK 0000010
36#define INPCK 0000020
37#define ISTRIP 0000040
38#define INLCR 0000100
39#define IGNCR 0000200
40#define ICRNL 0000400
41#define IXON 0001000
42#define IXOFF 0002000
43#define IXANY 0004000
44#define IUCLC 0010000
45#define IMAXBEL 0020000
46#define IUTF8 0040000
47
48#define OPOST 0000001
49#define ONLCR 0000002
50#define OLCUC 0000004
51#define OCRNL 0000010
52#define ONOCR 0000020
53#define ONLRET 0000040
54#define OFILL 0000100
55#define OFDEL 0000200
56#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
57#define NLDLY 0001400
58#define NL0 0000000
59#define NL1 0000400
60#define NL2 0001000
61#define NL3 0001400
62#define TABDLY 0006000
63#define TAB0 0000000
64#define TAB1 0002000
65#define TAB2 0004000
66#define TAB3 0006000
67#define CRDLY 0030000
68#define CR0 0000000
69#define CR1 0010000
70#define CR2 0020000
71#define CR3 0030000
72#define FFDLY 0040000
73#define FF0 0000000
74#define FF1 0040000
75#define BSDLY 0100000
76#define BS0 0000000
77#define BS1 0100000
78#endif
79
80#define VTDLY 0200000
81#define VT0 0000000
82#define VT1 0200000
83
84#define B0 0000000
85#define B50 0000001
86#define B75 0000002
87#define B110 0000003
88#define B134 0000004
89#define B150 0000005
90#define B200 0000006
91#define B300 0000007
92#define B600 0000010
93#define B1200 0000011
94#define B1800 0000012
95#define B2400 0000013
96#define B4800 0000014
97#define B9600 0000015
98#define B19200 0000016
99#define B38400 0000017
100
101#define B57600 00020
102#define B115200 00021
103#define B230400 00022
104#define B460800 00023
105#define B500000 00024
106#define B576000 00025
107#define B921600 00026
108#define B1000000 00027
109#define B1152000 00030
110#define B1500000 00031
111#define B2000000 00032
112#define B2500000 00033
113#define B3000000 00034
114#define B3500000 00035
115#define B4000000 00036
116
117#define CSIZE 00001400
118#define CS5 00000000
119#define CS6 00000400
120#define CS7 00001000
121#define CS8 00001400
122#define CSTOPB 00002000
123#define CREAD 00004000
124#define PARENB 00010000
125#define PARODD 00020000
126#define HUPCL 00040000
127#define CLOCAL 00100000
128
129#define ECHOE 0x00000002
130#define ECHOK 0x00000004
131#define ECHO 0x00000008
132#define ECHONL 0x00000010
133#define ISIG 0x00000080
134#define ICANON 0x00000100
135#define IEXTEN 0x00000400
136#define TOSTOP 0x00400000
137#define NOFLSH 0x80000000
138
139#define TCOOFF 0
140#define TCOON 1
141#define TCIOFF 2
142#define TCION 3
143
144#define TCIFLUSH 0
145#define TCOFLUSH 1
146#define TCIOFLUSH 2
147
148#define TCSANOW 0
149#define TCSADRAIN 1
150#define TCSAFLUSH 2
151
152#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
153#define EXTA 0000016
154#define EXTB 0000017
155#define CBAUD 00377
156#define CBAUDEX 0000020
157#define CIBAUD 077600000
158#define CMSPAR 010000000000
159#define CRTSCTS 020000000000
160
161#define XCASE 0x00004000
162#define ECHOCTL 0x00000040
163#define ECHOPRT 0x00000020
164#define ECHOKE 0x00000001
165#define FLUSHO 0x00800000
166#define PENDIN 0x20000000
167#define EXTPROC 0x10000000
168
169#define XTABS 00006000
170#define TIOCSER_TEMT 1
171#endif
lib/libc/wasi/libc-top-half/musl/arch/powerpc/bits/user.h deleted-23
...@@ -1,23 +0,0 @@
1struct user {
2 struct {
3 unsigned long gpr[32], nip, msr, orig_gpr3, ctr, link, xer, ccr, mq;
4 unsigned long trap, dar, dsisr, result;
5 } regs;
6 unsigned long u_tsize, u_dsize, u_ssize;
7 unsigned long start_code, start_data, start_stack;
8 long signal;
9 void *u_ar0;
10 unsigned long magic;
11 char u_comm[32];
12};
13
14#define ELF_NGREG 48
15#define ELF_NFPREG 33
16#define ELF_NVRREG 33
17typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
18typedef double elf_fpreg_t, elf_fpregset_t[ELF_NFPREG];
19typedef struct { unsigned u[4]; }
20#ifdef __GNUC__
21__attribute__((__aligned__(16)))
22#endif
23 elf_vrreg_t, elf_vrregset_t[ELF_NVRREG];
lib/libc/wasi/libc-top-half/musl/arch/powerpc/crt_arch.h deleted-20
...@@ -1,20 +0,0 @@
1__asm__(
2".text \n"
3".global " START " \n"
4".type " START ", %function \n"
5START ": \n"
6" bl 1f \n"
7".weak _DYNAMIC \n"
8".hidden _DYNAMIC \n"
9" .long _DYNAMIC-. \n"
10"1: mflr 4 \n"
11" lwz 3, 0(4) \n"
12" add 4, 3, 4 \n"
13" mr 3, 1 \n"
14" clrrwi 1, 1, 4 \n"
15" li 0, 0 \n"
16" stwu 1, -16(1) \n"
17" mtlr 0 \n"
18" stw 0, 0(1) \n"
19" bl " START "_c \n"
20);
lib/libc/wasi/libc-top-half/musl/arch/powerpc/kstat.h deleted-20
...@@ -1,20 +0,0 @@
1struct kstat {
2 dev_t st_dev;
3 ino_t st_ino;
4 mode_t st_mode;
5 nlink_t st_nlink;
6 uid_t st_uid;
7 gid_t st_gid;
8 dev_t st_rdev;
9 short __st_rdev_padding;
10 off_t st_size;
11 blksize_t st_blksize;
12 blkcnt_t st_blocks;
13 long st_atime_sec;
14 long st_atime_nsec;
15 long st_mtime_sec;
16 long st_mtime_nsec;
17 long st_ctime_sec;
18 long st_ctime_nsec;
19 unsigned __unused[2];
20};
lib/libc/wasi/libc-top-half/musl/arch/powerpc/pthread_arch.h deleted-16
...@@ -1,16 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3 register uintptr_t tp __asm__("r2");
4 __asm__ ("" : "=r" (tp) );
5 return tp;
6}
7
8#define TLS_ABOVE_TP
9#define GAP_ABOVE_TP 0
10
11#define TP_OFFSET 0x7000
12#define DTP_OFFSET 0x8000
13
14// the kernel calls the ip "nip", it's the first saved value after the 32
15// GPRs.
16#define MC_PC gregs[32]
lib/libc/wasi/libc-top-half/musl/arch/powerpc/reloc.h deleted-31
...@@ -1,31 +0,0 @@
1#ifdef _SOFT_FLOAT
2#define FP_SUFFIX "-sf"
3#else
4#define FP_SUFFIX ""
5#endif
6
7#define LDSO_ARCH "powerpc" FP_SUFFIX
8
9#define TPOFF_K (-0x7000)
10
11#define REL_SYMBOLIC R_PPC_ADDR32
12#define REL_USYMBOLIC R_PPC_UADDR32
13#define REL_GOT R_PPC_GLOB_DAT
14#define REL_PLT R_PPC_JMP_SLOT
15#define REL_RELATIVE R_PPC_RELATIVE
16#define REL_COPY R_PPC_COPY
17#define REL_DTPMOD R_PPC_DTPMOD32
18#define REL_DTPOFF R_PPC_DTPREL32
19#define REL_TPOFF R_PPC_TPREL32
20
21#define CRTJMP(pc,sp) __asm__ __volatile__( \
22 "mr 1,%1 ; mtlr %0 ; blr" : : "r"(pc), "r"(sp) : "memory" )
23
24#define GETFUNCSYM(fp, sym, got) __asm__ ( \
25 ".hidden " #sym " \n" \
26 " bl 1f \n" \
27 " .long " #sym "-. \n" \
28 "1: mflr %1 \n" \
29 " lwz %0, 0(%1) \n" \
30 " add %0, %0, %1 \n" \
31 : "=r"(*(fp)), "=r"((int){0}) : : "memory", "lr" )
lib/libc/wasi/libc-top-half/musl/arch/powerpc/syscall_arch.h deleted-94
...@@ -1,94 +0,0 @@
1#define __SYSCALL_LL_E(x) \
2((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
3((union { long long ll; long l[2]; }){ .ll = x }).l[1]
4#define __SYSCALL_LL_O(x) 0, __SYSCALL_LL_E((x))
5
6static inline long __syscall0(long n)
7{
8 register long r0 __asm__("r0") = n;
9 register long r3 __asm__("r3");
10 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
11 : "+r"(r0), "=r"(r3)
12 :: "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
13 return r3;
14}
15
16static inline long __syscall1(long n, long a)
17{
18 register long r0 __asm__("r0") = n;
19 register long r3 __asm__("r3") = a;
20 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
21 : "+r"(r0), "+r"(r3)
22 :: "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
23 return r3;
24}
25
26static inline long __syscall2(long n, long a, long b)
27{
28 register long r0 __asm__("r0") = n;
29 register long r3 __asm__("r3") = a;
30 register long r4 __asm__("r4") = b;
31 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
32 : "+r"(r0), "+r"(r3), "+r"(r4)
33 :: "memory", "cr0", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
34 return r3;
35}
36
37static inline long __syscall3(long n, long a, long b, long c)
38{
39 register long r0 __asm__("r0") = n;
40 register long r3 __asm__("r3") = a;
41 register long r4 __asm__("r4") = b;
42 register long r5 __asm__("r5") = c;
43 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
44 : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5)
45 :: "memory", "cr0", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
46 return r3;
47}
48
49static inline long __syscall4(long n, long a, long b, long c, long d)
50{
51 register long r0 __asm__("r0") = n;
52 register long r3 __asm__("r3") = a;
53 register long r4 __asm__("r4") = b;
54 register long r5 __asm__("r5") = c;
55 register long r6 __asm__("r6") = d;
56 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
57 : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6)
58 :: "memory", "cr0", "r7", "r8", "r9", "r10", "r11", "r12");
59 return r3;
60}
61
62static inline long __syscall5(long n, long a, long b, long c, long d, long e)
63{
64 register long r0 __asm__("r0") = n;
65 register long r3 __asm__("r3") = a;
66 register long r4 __asm__("r4") = b;
67 register long r5 __asm__("r5") = c;
68 register long r6 __asm__("r6") = d;
69 register long r7 __asm__("r7") = e;
70 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
71 : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6), "+r"(r7)
72 :: "memory", "cr0", "r8", "r9", "r10", "r11", "r12");
73 return r3;
74}
75
76static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
77{
78 register long r0 __asm__("r0") = n;
79 register long r3 __asm__("r3") = a;
80 register long r4 __asm__("r4") = b;
81 register long r5 __asm__("r5") = c;
82 register long r6 __asm__("r6") = d;
83 register long r7 __asm__("r7") = e;
84 register long r8 __asm__("r8") = f;
85 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
86 : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6), "+r"(r7), "+r"(r8)
87 :: "memory", "cr0", "r9", "r10", "r11", "r12");
88 return r3;
89}
90
91#define SYSCALL_FADVISE_6_ARG
92
93#define SO_RCVTIMEO_OLD 18
94#define SO_SNDTIMEO_OLD 19
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/atomic_arch.h deleted-62
...@@ -1,62 +0,0 @@
1#define a_ll a_ll
2static inline int a_ll(volatile int *p)
3{
4 int v;
5 __asm__ __volatile__ ("lwarx %0, 0, %2" : "=r"(v) : "m"(*p), "r"(p));
6 return v;
7}
8
9#define a_sc a_sc
10static inline int a_sc(volatile int *p, int v)
11{
12 int r;
13 __asm__ __volatile__ (
14 "stwcx. %2, 0, %3 ; mfcr %0"
15 : "=r"(r), "=m"(*p) : "r"(v), "r"(p) : "memory", "cc");
16 return r & 0x20000000; /* "bit 2" of "cr0" (backwards bit order) */
17}
18
19#define a_ll_p a_ll_p
20static inline void *a_ll_p(volatile void *p)
21{
22 void *v;
23 __asm__ __volatile__ ("ldarx %0, 0, %2" : "=r"(v) : "m"(*(void *volatile *)p), "r"(p));
24 return v;
25}
26
27#define a_sc_p a_sc_p
28static inline int a_sc_p(volatile void *p, void *v)
29{
30 int r;
31 __asm__ __volatile__ (
32 "stdcx. %2, 0, %3 ; mfcr %0"
33 : "=r"(r), "=m"(*(void *volatile *)p) : "r"(v), "r"(p) : "memory", "cc");
34 return r & 0x20000000; /* "bit 2" of "cr0" (backwards bit order) */
35}
36
37#define a_barrier a_barrier
38static inline void a_barrier()
39{
40 __asm__ __volatile__ ("sync" : : : "memory");
41}
42
43#define a_pre_llsc a_barrier
44
45#define a_post_llsc a_post_llsc
46static inline void a_post_llsc()
47{
48 __asm__ __volatile__ ("isync" : : : "memory");
49}
50
51#define a_crash a_crash
52static inline void a_crash()
53{
54 __asm__ __volatile__ (".long 0");
55}
56
57#define a_clz_64 a_clz_64
58static inline int a_clz_64(uint64_t x)
59{
60 __asm__ ("cntlzd %0, %1" : "=r"(x) : "r"(x));
61 return x;
62}
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/alltypes.h.in deleted-20
...@@ -1,20 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#if __BIG_ENDIAN__
6#define __BYTE_ORDER 4321
7#else
8#define __BYTE_ORDER 1234
9#endif
10
11#define __LONG_MAX 0x7fffffffffffffffL
12
13#ifndef __cplusplus
14TYPEDEF int wchar_t;
15#endif
16
17TYPEDEF float float_t;
18TYPEDEF double double_t;
19
20TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/errno.h deleted-134
...@@ -1,134 +0,0 @@
1#define EPERM 1
2#define ENOENT 2
3#define ESRCH 3
4#define EINTR 4
5#define EIO 5
6#define ENXIO 6
7#define E2BIG 7
8#define ENOEXEC 8
9#define EBADF 9
10#define ECHILD 10
11#define EAGAIN 11
12#define ENOMEM 12
13#define EACCES 13
14#define EFAULT 14
15#define ENOTBLK 15
16#define EBUSY 16
17#define EEXIST 17
18#define EXDEV 18
19#define ENODEV 19
20#define ENOTDIR 20
21#define EISDIR 21
22#define EINVAL 22
23#define ENFILE 23
24#define EMFILE 24
25#define ENOTTY 25
26#define ETXTBSY 26
27#define EFBIG 27
28#define ENOSPC 28
29#define ESPIPE 29
30#define EROFS 30
31#define EMLINK 31
32#define EPIPE 32
33#define EDOM 33
34#define ERANGE 34
35#define EDEADLK 35
36#define ENAMETOOLONG 36
37#define ENOLCK 37
38#define ENOSYS 38
39#define ENOTEMPTY 39
40#define ELOOP 40
41#define EWOULDBLOCK EAGAIN
42#define ENOMSG 42
43#define EIDRM 43
44#define ECHRNG 44
45#define EL2NSYNC 45
46#define EL3HLT 46
47#define EL3RST 47
48#define ELNRNG 48
49#define EUNATCH 49
50#define ENOCSI 50
51#define EL2HLT 51
52#define EBADE 52
53#define EBADR 53
54#define EXFULL 54
55#define ENOANO 55
56#define EBADRQC 56
57#define EBADSLT 57
58#define EDEADLOCK 58
59#define EBFONT 59
60#define ENOSTR 60
61#define ENODATA 61
62#define ETIME 62
63#define ENOSR 63
64#define ENONET 64
65#define ENOPKG 65
66#define EREMOTE 66
67#define ENOLINK 67
68#define EADV 68
69#define ESRMNT 69
70#define ECOMM 70
71#define EPROTO 71
72#define EMULTIHOP 72
73#define EDOTDOT 73
74#define EBADMSG 74
75#define EOVERFLOW 75
76#define ENOTUNIQ 76
77#define EBADFD 77
78#define EREMCHG 78
79#define ELIBACC 79
80#define ELIBBAD 80
81#define ELIBSCN 81
82#define ELIBMAX 82
83#define ELIBEXEC 83
84#define EILSEQ 84
85#define ERESTART 85
86#define ESTRPIPE 86
87#define EUSERS 87
88#define ENOTSOCK 88
89#define EDESTADDRREQ 89
90#define EMSGSIZE 90
91#define EPROTOTYPE 91
92#define ENOPROTOOPT 92
93#define EPROTONOSUPPORT 93
94#define ESOCKTNOSUPPORT 94
95#define EOPNOTSUPP 95
96#define ENOTSUP EOPNOTSUPP
97#define EPFNOSUPPORT 96
98#define EAFNOSUPPORT 97
99#define EADDRINUSE 98
100#define EADDRNOTAVAIL 99
101#define ENETDOWN 100
102#define ENETUNREACH 101
103#define ENETRESET 102
104#define ECONNABORTED 103
105#define ECONNRESET 104
106#define ENOBUFS 105
107#define EISCONN 106
108#define ENOTCONN 107
109#define ESHUTDOWN 108
110#define ETOOMANYREFS 109
111#define ETIMEDOUT 110
112#define ECONNREFUSED 111
113#define EHOSTDOWN 112
114#define EHOSTUNREACH 113
115#define EALREADY 114
116#define EINPROGRESS 115
117#define ESTALE 116
118#define EUCLEAN 117
119#define ENOTNAM 118
120#define ENAVAIL 119
121#define EISNAM 120
122#define EREMOTEIO 121
123#define EDQUOT 122
124#define ENOMEDIUM 123
125#define EMEDIUMTYPE 124
126#define ECANCELED 125
127#define ENOKEY 126
128#define EKEYEXPIRED 127
129#define EKEYREVOKED 128
130#define EKEYREJECTED 129
131#define EOWNERDEAD 130
132#define ENOTRECOVERABLE 131
133#define ERFKILL 132
134#define EHWPOISON 133
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 040000
11#define O_NOFOLLOW 0100000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 0400000
16#define O_LARGEFILE 0200000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020040000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_GETLK 5
29#define F_SETLK 6
30#define F_SETLKW 7
31
32#define F_SETOWN 8
33#define F_GETOWN 9
34#define F_SETSIG 10
35#define F_GETSIG 11
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/fenv.h deleted-31
...@@ -1,31 +0,0 @@
1#define FE_TONEAREST 0
2#define FE_TOWARDZERO 1
3#define FE_UPWARD 2
4#define FE_DOWNWARD 3
5
6#define FE_INEXACT 0x02000000
7#define FE_DIVBYZERO 0x04000000
8#define FE_UNDERFLOW 0x08000000
9#define FE_OVERFLOW 0x10000000
10#define FE_INVALID 0x20000000
11
12#define FE_ALL_EXCEPT 0x3e000000
13
14#ifdef _GNU_SOURCE
15#define FE_INVALID_SNAN 0x01000000
16#define FE_INVALID_ISI 0x00800000
17#define FE_INVALID_IDI 0x00400000
18#define FE_INVALID_ZDZ 0x00200000
19#define FE_INVALID_IMZ 0x00100000
20#define FE_INVALID_COMPARE 0x00080000
21#define FE_INVALID_SOFTWARE 0x00000400
22#define FE_INVALID_SQRT 0x00000200
23#define FE_INVALID_INTEGER_CONVERSION 0x00000100
24
25#define FE_ALL_INVALID 0x01f80700
26#endif
27
28typedef unsigned fexcept_t;
29typedef double fenv_t;
30
31#define FE_DFL_ENV ((const fenv_t *)-1)
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
4#define LDBL_MIN 2.22507385850720138309e-308L
5#define LDBL_MAX 1.79769313486231570815e+308L
6#define LDBL_EPSILON 2.22044604925031308085e-16L
7
8#define LDBL_MANT_DIG 53
9#define LDBL_MIN_EXP (-1021)
10#define LDBL_MAX_EXP 1024
11
12#define LDBL_DIG 15
13#define LDBL_MIN_10_EXP (-307)
14#define LDBL_MAX_10_EXP 308
15
16#define DECIMAL_DIG 17
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/hwcap.h deleted-43
...@@ -1,43 +0,0 @@
1#define PPC_FEATURE_32 0x80000000
2#define PPC_FEATURE_64 0x40000000
3#define PPC_FEATURE_601_INSTR 0x20000000
4#define PPC_FEATURE_HAS_ALTIVEC 0x10000000
5#define PPC_FEATURE_HAS_FPU 0x08000000
6#define PPC_FEATURE_HAS_MMU 0x04000000
7#define PPC_FEATURE_HAS_4xxMAC 0x02000000
8#define PPC_FEATURE_UNIFIED_CACHE 0x01000000
9#define PPC_FEATURE_HAS_SPE 0x00800000
10#define PPC_FEATURE_HAS_EFP_SINGLE 0x00400000
11#define PPC_FEATURE_HAS_EFP_DOUBLE 0x00200000
12#define PPC_FEATURE_NO_TB 0x00100000
13#define PPC_FEATURE_POWER4 0x00080000
14#define PPC_FEATURE_POWER5 0x00040000
15#define PPC_FEATURE_POWER5_PLUS 0x00020000
16#define PPC_FEATURE_CELL 0x00010000
17#define PPC_FEATURE_BOOKE 0x00008000
18#define PPC_FEATURE_SMT 0x00004000
19#define PPC_FEATURE_ICACHE_SNOOP 0x00002000
20#define PPC_FEATURE_ARCH_2_05 0x00001000
21#define PPC_FEATURE_PA6T 0x00000800
22#define PPC_FEATURE_HAS_DFP 0x00000400
23#define PPC_FEATURE_POWER6_EXT 0x00000200
24#define PPC_FEATURE_ARCH_2_06 0x00000100
25#define PPC_FEATURE_HAS_VSX 0x00000080
26#define PPC_FEATURE_PSERIES_PERFMON_COMPAT 0x00000040
27
28#define PPC_FEATURE_TRUE_LE 0x00000002
29#define PPC_FEATURE_PPC_LE 0x00000001
30
31#define PPC_FEATURE2_ARCH_2_07 0x80000000
32#define PPC_FEATURE2_HTM 0x40000000
33#define PPC_FEATURE2_DSCR 0x20000000
34#define PPC_FEATURE2_EBB 0x10000000
35#define PPC_FEATURE2_ISEL 0x08000000
36#define PPC_FEATURE2_TAR 0x04000000
37#define PPC_FEATURE2_VEC_CRYPTO 0x02000000
38#define PPC_FEATURE2_HTM_NOSC 0x01000000
39#define PPC_FEATURE2_ARCH_3_00 0x00800000
40#define PPC_FEATURE2_HAS_IEEE128 0x00400000
41#define PPC_FEATURE2_DARN 0x00200000
42#define PPC_FEATURE2_SCV 0x00100000
43#define PPC_FEATURE2_HTM_NO_SUSPEND 0x00080000
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/ioctl.h deleted-120
...@@ -1,120 +0,0 @@
1#define _IOC(a,b,c,d) ( ((a)<<29) | ((b)<<8) | (c) | ((d)<<16) )
2#define _IOC_NONE 1U
3#define _IOC_WRITE 4U
4#define _IOC_READ 2U
5
6#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
7#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
8#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
9#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
10
11#define FIONCLEX _IO('f', 2)
12#define FIOCLEX _IO('f', 1)
13#define FIOASYNC _IOW('f', 125, int)
14#define FIONBIO _IOW('f', 126, int)
15#define FIONREAD _IOR('f', 127, int)
16#define TIOCINQ FIONREAD
17#define FIOQSIZE _IOR('f', 128, char[8])
18#define TIOCGETP _IOR('t', 8, char[6])
19#define TIOCSETP _IOW('t', 9, char[6])
20#define TIOCSETN _IOW('t', 10, char[6])
21
22#define TIOCSETC _IOW('t', 17, char[6])
23#define TIOCGETC _IOR('t', 18, char[6])
24#define TCGETS _IOR('t', 19, char[44])
25#define TCSETS _IOW('t', 20, char[44])
26#define TCSETSW _IOW('t', 21, char[44])
27#define TCSETSF _IOW('t', 22, char[44])
28
29#define TCGETA _IOR('t', 23, char[20])
30#define TCSETA _IOW('t', 24, char[20])
31#define TCSETAW _IOW('t', 25, char[20])
32#define TCSETAF _IOW('t', 28, char[20])
33
34#define TCSBRK _IO('t', 29)
35#define TCXONC _IO('t', 30)
36#define TCFLSH _IO('t', 31)
37
38#define TIOCSWINSZ _IOW('t', 103, char[8])
39#define TIOCGWINSZ _IOR('t', 104, char[8])
40#define TIOCSTART _IO('t', 110)
41#define TIOCSTOP _IO('t', 111)
42
43#define TIOCOUTQ _IOR('t', 115, int)
44
45#define TIOCGLTC _IOR('t', 116, char[6])
46#define TIOCSLTC _IOW('t', 117, char[6])
47#define TIOCSPGRP _IOW('t', 118, int)
48#define TIOCGPGRP _IOR('t', 119, int)
49
50#define TIOCEXCL 0x540C
51#define TIOCNXCL 0x540D
52#define TIOCSCTTY 0x540E
53
54#define TIOCSTI 0x5412
55#define TIOCMGET 0x5415
56#define TIOCMBIS 0x5416
57#define TIOCMBIC 0x5417
58#define TIOCMSET 0x5418
59#define TIOCM_LE 0x001
60#define TIOCM_DTR 0x002
61#define TIOCM_RTS 0x004
62#define TIOCM_ST 0x008
63#define TIOCM_SR 0x010
64#define TIOCM_CTS 0x020
65#define TIOCM_CAR 0x040
66#define TIOCM_RNG 0x080
67#define TIOCM_DSR 0x100
68#define TIOCM_CD TIOCM_CAR
69#define TIOCM_RI TIOCM_RNG
70#define TIOCM_OUT1 0x2000
71#define TIOCM_OUT2 0x4000
72#define TIOCM_LOOP 0x8000
73
74#define TIOCGSOFTCAR 0x5419
75#define TIOCSSOFTCAR 0x541A
76#define TIOCLINUX 0x541C
77#define TIOCCONS 0x541D
78#define TIOCGSERIAL 0x541E
79#define TIOCSSERIAL 0x541F
80#define TIOCPKT 0x5420
81
82#define TIOCNOTTY 0x5422
83#define TIOCSETD 0x5423
84#define TIOCGETD 0x5424
85#define TCSBRKP 0x5425
86#define TIOCSBRK 0x5427
87#define TIOCCBRK 0x5428
88#define TIOCGSID 0x5429
89#define TIOCGRS485 0x542e
90#define TIOCSRS485 0x542f
91#define TIOCGPTN _IOR('T',0x30, unsigned int)
92#define TIOCSPTLCK _IOW('T',0x31, int)
93#define TIOCGDEV _IOR('T',0x32, unsigned int)
94#define TIOCSIG _IOW('T',0x36, int)
95#define TIOCVHANGUP 0x5437
96#define TIOCGPKT _IOR('T', 0x38, int)
97#define TIOCGPTLCK _IOR('T', 0x39, int)
98#define TIOCGEXCL _IOR('T', 0x40, int)
99#define TIOCGPTPEER _IO('T', 0x41)
100
101#define TIOCSERCONFIG 0x5453
102#define TIOCSERGWILD 0x5454
103#define TIOCSERSWILD 0x5455
104#define TIOCGLCKTRMIOS 0x5456
105#define TIOCSLCKTRMIOS 0x5457
106#define TIOCSERGSTRUCT 0x5458
107#define TIOCSERGETLSR 0x5459
108#define TIOCSERGETMULTI 0x545A
109#define TIOCSERSETMULTI 0x545B
110
111#define TIOCMIWAIT 0x545C
112#define TIOCGICOUNT 0x545D
113
114#define FIOSETOWN 0x8901
115#define SIOCSPGRP 0x8902
116#define FIOGETOWN 0x8903
117#define SIOCGPGRP 0x8904
118#define SIOCATMARK 0x8905
119#define SIOCGSTAMP 0x8906
120#define SIOCGSTAMPNS 0x8907
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/ipc.h deleted-12
...@@ -1,12 +0,0 @@
1struct ipc_perm {
2 key_t __ipc_perm_key;
3 uid_t uid;
4 gid_t gid;
5 uid_t cuid;
6 gid_t cgid;
7 mode_t mode;
8 int __ipc_perm_seq;
9 int __pad1;
10 long long __pad2;
11 long long __pad3;
12};
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/mman.h deleted-13
...@@ -1,13 +0,0 @@
1#define PROT_SAO 0x10
2
3#undef MAP_NORESERVE
4#define MAP_NORESERVE 0x40
5#undef MAP_LOCKED
6#define MAP_LOCKED 0x80
7
8#undef MCL_CURRENT
9#define MCL_CURRENT 0x2000
10#undef MCL_FUTURE
11#define MCL_FUTURE 0x4000
12#undef MCL_ONFAULT
13#define MCL_ONFAULT 0x8000
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_LP64_OFF64 1
2#define _POSIX_V7_LP64_OFF64 1
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/ptrace.h deleted-25
...@@ -1,25 +0,0 @@
1#define PTRACE_GETVRREGS 0x12
2#define PTRACE_SETVRREGS 0x13
3#define PTRACE_GETEVRREGS 0x14
4#define PTRACE_SETEVRREGS 0x15
5#define PTRACE_GETREGS64 0x16
6#define PTRACE_SETREGS64 0x17
7#define PTRACE_GET_DEBUGREG 0x19
8#define PTRACE_SET_DEBUGREG 0x1a
9#define PTRACE_GETVSRREGS 0x1b
10#define PTRACE_SETVSRREGS 0x1c
11#define PTRACE_SYSEMU 0x1d
12#define PTRACE_SYSEMU_SINGLESTEP 0x1e
13#define PTRACE_SINGLEBLOCK 0x100
14
15#define PT_GETVRREGS PTRACE_GETVRREGS
16#define PT_SETVRREGS PTRACE_SETVRREGS
17#define PT_GETEVRREGS PTRACE_GETEVRREGS
18#define PT_SETEVRREGS PTRACE_SETEVRREGS
19#define PT_GETREGS64 PTRACE_GETREGS64
20#define PT_SETREGS64 PTRACE_SETREGS64
21#define PT_GET_DEBUGREG PTRACE_GET_DEBUGREG
22#define PT_SET_DEBUGREG PTRACE_SET_DEBUGREG
23#define PT_GETVSRREGS PTRACE_GETVSRREGS
24#define PT_SETVSRREGS PTRACE_SETVSRREGS
25#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/reg.h deleted-3
...@@ -1,3 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
3/* FIXME */
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned __int128 __jmp_buf[32];
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/shm.h deleted-23
...@@ -1,23 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 time_t shm_atime;
6 time_t shm_dtime;
7 time_t shm_ctime;
8 size_t shm_segsz;
9 pid_t shm_cpid;
10 pid_t shm_lpid;
11 unsigned long shm_nattch;
12 unsigned long __unused[2];
13};
14
15struct shminfo {
16 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
17};
18
19struct shm_info {
20 int __used_ids;
21 unsigned long shm_tot, shm_rss, shm_swp;
22 unsigned long __swap_attempts, __swap_successes;
23};
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/signal.h deleted-110
...@@ -1,110 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 4096
6#define SIGSTKSZ 10240
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10
11typedef unsigned long greg_t, gregset_t[48];
12typedef double fpregset_t[33];
13
14typedef struct {
15#ifdef __GNUC__
16 __attribute__((__aligned__(16)))
17#endif
18 unsigned vrregs[32][4];
19 struct {
20#if __BIG_ENDIAN__
21 unsigned _pad[3], vscr_word;
22#else
23 unsigned vscr_word, _pad[3];
24#endif
25 } vscr;
26 unsigned vrsave, _pad[3];
27} vrregset_t;
28
29typedef struct sigcontext {
30 unsigned long _unused[4];
31 int signal;
32 int _pad0;
33 unsigned long handler;
34 unsigned long oldmask;
35 struct pt_regs *regs;
36 gregset_t gp_regs;
37 fpregset_t fp_regs;
38 vrregset_t *v_regs;
39 long vmx_reserve[34+34+32+1];
40} mcontext_t;
41
42#else
43
44typedef struct {
45 long __regs[4+4+48+33+1+34+34+32+1];
46} mcontext_t;
47
48#endif
49
50struct sigaltstack {
51 void *ss_sp;
52 int ss_flags;
53 size_t ss_size;
54};
55
56typedef struct __ucontext {
57 unsigned long uc_flags;
58 struct __ucontext *uc_link;
59 stack_t uc_stack;
60 sigset_t uc_sigmask;
61 mcontext_t uc_mcontext;
62} ucontext_t;
63
64#define SA_NOCLDSTOP 1U
65#define SA_NOCLDWAIT 2U
66#define SA_SIGINFO 4U
67#define SA_ONSTACK 0x08000000U
68#define SA_RESTART 0x10000000U
69#define SA_NODEFER 0x40000000U
70#define SA_RESETHAND 0x80000000U
71#define SA_RESTORER 0x04000000U
72
73#endif
74
75#define SIGHUP 1
76#define SIGINT 2
77#define SIGQUIT 3
78#define SIGILL 4
79#define SIGTRAP 5
80#define SIGABRT 6
81#define SIGIOT SIGABRT
82#define SIGBUS 7
83#define SIGFPE 8
84#define SIGKILL 9
85#define SIGUSR1 10
86#define SIGSEGV 11
87#define SIGUSR2 12
88#define SIGPIPE 13
89#define SIGALRM 14
90#define SIGTERM 15
91#define SIGSTKFLT 16
92#define SIGCHLD 17
93#define SIGCONT 18
94#define SIGSTOP 19
95#define SIGTSTP 20
96#define SIGTTIN 21
97#define SIGTTOU 22
98#define SIGURG 23
99#define SIGXCPU 24
100#define SIGXFSZ 25
101#define SIGVTALRM 26
102#define SIGPROF 27
103#define SIGWINCH 28
104#define SIGIO 29
105#define SIGPOLL SIGIO
106#define SIGPWR 30
107#define SIGSYS 31
108#define SIGUNUSED SIGSYS
109
110#define _NSIG 65
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/socket.h deleted-27
...@@ -1,27 +0,0 @@
1#define SO_DEBUG 1
2#define SO_REUSEADDR 2
3#define SO_TYPE 3
4#define SO_ERROR 4
5#define SO_DONTROUTE 5
6#define SO_BROADCAST 6
7#define SO_SNDBUF 7
8#define SO_RCVBUF 8
9#define SO_KEEPALIVE 9
10#define SO_OOBINLINE 10
11#define SO_NO_CHECK 11
12#define SO_PRIORITY 12
13#define SO_LINGER 13
14#define SO_BSDCOMPAT 14
15#define SO_REUSEPORT 15
16#define SO_RCVLOWAT 16
17#define SO_SNDLOWAT 17
18#define SO_RCVTIMEO 18
19#define SO_SNDTIMEO 19
20#define SO_PASSCRED 20
21#define SO_PEERCRED 21
22#define SO_ACCEPTCONN 30
23#define SO_PEERSEC 31
24#define SO_SNDBUFFORCE 32
25#define SO_RCVBUFFORCE 33
26#define SO_PROTOCOL 38
27#define SO_DOMAIN 39
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/stat.h deleted-16
...@@ -1,16 +0,0 @@
1struct stat {
2 dev_t st_dev;
3 ino_t st_ino;
4 nlink_t st_nlink;
5 mode_t st_mode;
6 uid_t st_uid;
7 gid_t st_gid;
8 dev_t st_rdev;
9 off_t st_size;
10 blksize_t st_blksize;
11 blkcnt_t st_blocks;
12 struct timespec st_atim;
13 struct timespec st_mtim;
14 struct timespec st_ctim;
15 unsigned long __unused[3];
16};
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT64_MIN
16#define INTPTR_MAX INT64_MAX
17#define UINTPTR_MAX UINT64_MAX
18#define PTRDIFF_MIN INT64_MIN
19#define PTRDIFF_MAX INT64_MAX
20#define SIZE_MAX UINT64_MAX
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/syscall.h.in deleted-394
...@@ -1,394 +0,0 @@
1#define __NR_restart_syscall 0
2#define __NR_exit 1
3#define __NR_fork 2
4#define __NR_read 3
5#define __NR_write 4
6#define __NR_open 5
7#define __NR_close 6
8#define __NR_waitpid 7
9#define __NR_creat 8
10#define __NR_link 9
11#define __NR_unlink 10
12#define __NR_execve 11
13#define __NR_chdir 12
14#define __NR_time 13
15#define __NR_mknod 14
16#define __NR_chmod 15
17#define __NR_lchown 16
18#define __NR_break 17
19#define __NR_oldstat 18
20#define __NR_lseek 19
21#define __NR_getpid 20
22#define __NR_mount 21
23#define __NR_umount 22
24#define __NR_setuid 23
25#define __NR_getuid 24
26#define __NR_stime 25
27#define __NR_ptrace 26
28#define __NR_alarm 27
29#define __NR_oldfstat 28
30#define __NR_pause 29
31#define __NR_utime 30
32#define __NR_stty 31
33#define __NR_gtty 32
34#define __NR_access 33
35#define __NR_nice 34
36#define __NR_ftime 35
37#define __NR_sync 36
38#define __NR_kill 37
39#define __NR_rename 38
40#define __NR_mkdir 39
41#define __NR_rmdir 40
42#define __NR_dup 41
43#define __NR_pipe 42
44#define __NR_times 43
45#define __NR_prof 44
46#define __NR_brk 45
47#define __NR_setgid 46
48#define __NR_getgid 47
49#define __NR_signal 48
50#define __NR_geteuid 49
51#define __NR_getegid 50
52#define __NR_acct 51
53#define __NR_umount2 52
54#define __NR_lock 53
55#define __NR_ioctl 54
56#define __NR_fcntl 55
57#define __NR_mpx 56
58#define __NR_setpgid 57
59#define __NR_ulimit 58
60#define __NR_oldolduname 59
61#define __NR_umask 60
62#define __NR_chroot 61
63#define __NR_ustat 62
64#define __NR_dup2 63
65#define __NR_getppid 64
66#define __NR_getpgrp 65
67#define __NR_setsid 66
68#define __NR_sigaction 67
69#define __NR_sgetmask 68
70#define __NR_ssetmask 69
71#define __NR_setreuid 70
72#define __NR_setregid 71
73#define __NR_sigsuspend 72
74#define __NR_sigpending 73
75#define __NR_sethostname 74
76#define __NR_setrlimit 75
77#define __NR_getrlimit 76
78#define __NR_getrusage 77
79#define __NR_gettimeofday 78
80#define __NR_settimeofday 79
81#define __NR_getgroups 80
82#define __NR_setgroups 81
83#define __NR_select 82
84#define __NR_symlink 83
85#define __NR_oldlstat 84
86#define __NR_readlink 85
87#define __NR_uselib 86
88#define __NR_swapon 87
89#define __NR_reboot 88
90#define __NR_readdir 89
91#define __NR_mmap 90
92#define __NR_munmap 91
93#define __NR_truncate 92
94#define __NR_ftruncate 93
95#define __NR_fchmod 94
96#define __NR_fchown 95
97#define __NR_getpriority 96
98#define __NR_setpriority 97
99#define __NR_profil 98
100#define __NR_statfs 99
101#define __NR_fstatfs 100
102#define __NR_ioperm 101
103#define __NR_socketcall 102
104#define __NR_syslog 103
105#define __NR_setitimer 104
106#define __NR_getitimer 105
107#define __NR_stat 106
108#define __NR_lstat 107
109#define __NR_fstat 108
110#define __NR_olduname 109
111#define __NR_iopl 110
112#define __NR_vhangup 111
113#define __NR_idle 112
114#define __NR_vm86 113
115#define __NR_wait4 114
116#define __NR_swapoff 115
117#define __NR_sysinfo 116
118#define __NR_ipc 117
119#define __NR_fsync 118
120#define __NR_sigreturn 119
121#define __NR_clone 120
122#define __NR_setdomainname 121
123#define __NR_uname 122
124#define __NR_modify_ldt 123
125#define __NR_adjtimex 124
126#define __NR_mprotect 125
127#define __NR_sigprocmask 126
128#define __NR_create_module 127
129#define __NR_init_module 128
130#define __NR_delete_module 129
131#define __NR_get_kernel_syms 130
132#define __NR_quotactl 131
133#define __NR_getpgid 132
134#define __NR_fchdir 133
135#define __NR_bdflush 134
136#define __NR_sysfs 135
137#define __NR_personality 136
138#define __NR_afs_syscall 137
139#define __NR_setfsuid 138
140#define __NR_setfsgid 139
141#define __NR__llseek 140
142#define __NR_getdents 141
143#define __NR__newselect 142
144#define __NR_flock 143
145#define __NR_msync 144
146#define __NR_readv 145
147#define __NR_writev 146
148#define __NR_getsid 147
149#define __NR_fdatasync 148
150#define __NR__sysctl 149
151#define __NR_mlock 150
152#define __NR_munlock 151
153#define __NR_mlockall 152
154#define __NR_munlockall 153
155#define __NR_sched_setparam 154
156#define __NR_sched_getparam 155
157#define __NR_sched_setscheduler 156
158#define __NR_sched_getscheduler 157
159#define __NR_sched_yield 158
160#define __NR_sched_get_priority_max 159
161#define __NR_sched_get_priority_min 160
162#define __NR_sched_rr_get_interval 161
163#define __NR_nanosleep 162
164#define __NR_mremap 163
165#define __NR_setresuid 164
166#define __NR_getresuid 165
167#define __NR_query_module 166
168#define __NR_poll 167
169#define __NR_nfsservctl 168
170#define __NR_setresgid 169
171#define __NR_getresgid 170
172#define __NR_prctl 171
173#define __NR_rt_sigreturn 172
174#define __NR_rt_sigaction 173
175#define __NR_rt_sigprocmask 174
176#define __NR_rt_sigpending 175
177#define __NR_rt_sigtimedwait 176
178#define __NR_rt_sigqueueinfo 177
179#define __NR_rt_sigsuspend 178
180#define __NR_pread64 179
181#define __NR_pwrite64 180
182#define __NR_chown 181
183#define __NR_getcwd 182
184#define __NR_capget 183
185#define __NR_capset 184
186#define __NR_sigaltstack 185
187#define __NR_sendfile 186
188#define __NR_getpmsg 187
189#define __NR_putpmsg 188
190#define __NR_vfork 189
191#define __NR_ugetrlimit 190
192#define __NR_readahead 191
193#define __NR_pciconfig_read 198
194#define __NR_pciconfig_write 199
195#define __NR_pciconfig_iobase 200
196#define __NR_multiplexer 201
197#define __NR_getdents64 202
198#define __NR_pivot_root 203
199#define __NR_madvise 205
200#define __NR_mincore 206
201#define __NR_gettid 207
202#define __NR_tkill 208
203#define __NR_setxattr 209
204#define __NR_lsetxattr 210
205#define __NR_fsetxattr 211
206#define __NR_getxattr 212
207#define __NR_lgetxattr 213
208#define __NR_fgetxattr 214
209#define __NR_listxattr 215
210#define __NR_llistxattr 216
211#define __NR_flistxattr 217
212#define __NR_removexattr 218
213#define __NR_lremovexattr 219
214#define __NR_fremovexattr 220
215#define __NR_futex 221
216#define __NR_sched_setaffinity 222
217#define __NR_sched_getaffinity 223
218#define __NR_tuxcall 225
219#define __NR_io_setup 227
220#define __NR_io_destroy 228
221#define __NR_io_getevents 229
222#define __NR_io_submit 230
223#define __NR_io_cancel 231
224#define __NR_set_tid_address 232
225#define __NR_fadvise64 233
226#define __NR_exit_group 234
227#define __NR_lookup_dcookie 235
228#define __NR_epoll_create 236
229#define __NR_epoll_ctl 237
230#define __NR_epoll_wait 238
231#define __NR_remap_file_pages 239
232#define __NR_timer_create 240
233#define __NR_timer_settime 241
234#define __NR_timer_gettime 242
235#define __NR_timer_getoverrun 243
236#define __NR_timer_delete 244
237#define __NR_clock_settime 245
238#define __NR_clock_gettime 246
239#define __NR_clock_getres 247
240#define __NR_clock_nanosleep 248
241#define __NR_swapcontext 249
242#define __NR_tgkill 250
243#define __NR_utimes 251
244#define __NR_statfs64 252
245#define __NR_fstatfs64 253
246#define __NR_rtas 255
247#define __NR_sys_debug_setcontext 256
248#define __NR_migrate_pages 258
249#define __NR_mbind 259
250#define __NR_get_mempolicy 260
251#define __NR_set_mempolicy 261
252#define __NR_mq_open 262
253#define __NR_mq_unlink 263
254#define __NR_mq_timedsend 264
255#define __NR_mq_timedreceive 265
256#define __NR_mq_notify 266
257#define __NR_mq_getsetattr 267
258#define __NR_kexec_load 268
259#define __NR_add_key 269
260#define __NR_request_key 270
261#define __NR_keyctl 271
262#define __NR_waitid 272
263#define __NR_ioprio_set 273
264#define __NR_ioprio_get 274
265#define __NR_inotify_init 275
266#define __NR_inotify_add_watch 276
267#define __NR_inotify_rm_watch 277
268#define __NR_spu_run 278
269#define __NR_spu_create 279
270#define __NR_pselect6 280
271#define __NR_ppoll 281
272#define __NR_unshare 282
273#define __NR_splice 283
274#define __NR_tee 284
275#define __NR_vmsplice 285
276#define __NR_openat 286
277#define __NR_mkdirat 287
278#define __NR_mknodat 288
279#define __NR_fchownat 289
280#define __NR_futimesat 290
281#define __NR_newfstatat 291
282#define __NR_unlinkat 292
283#define __NR_renameat 293
284#define __NR_linkat 294
285#define __NR_symlinkat 295
286#define __NR_readlinkat 296
287#define __NR_fchmodat 297
288#define __NR_faccessat 298
289#define __NR_get_robust_list 299
290#define __NR_set_robust_list 300
291#define __NR_move_pages 301
292#define __NR_getcpu 302
293#define __NR_epoll_pwait 303
294#define __NR_utimensat 304
295#define __NR_signalfd 305
296#define __NR_timerfd_create 306
297#define __NR_eventfd 307
298#define __NR_sync_file_range2 308
299#define __NR_fallocate 309
300#define __NR_subpage_prot 310
301#define __NR_timerfd_settime 311
302#define __NR_timerfd_gettime 312
303#define __NR_signalfd4 313
304#define __NR_eventfd2 314
305#define __NR_epoll_create1 315
306#define __NR_dup3 316
307#define __NR_pipe2 317
308#define __NR_inotify_init1 318
309#define __NR_perf_event_open 319
310#define __NR_preadv 320
311#define __NR_pwritev 321
312#define __NR_rt_tgsigqueueinfo 322
313#define __NR_fanotify_init 323
314#define __NR_fanotify_mark 324
315#define __NR_prlimit64 325
316#define __NR_socket 326
317#define __NR_bind 327
318#define __NR_connect 328
319#define __NR_listen 329
320#define __NR_accept 330
321#define __NR_getsockname 331
322#define __NR_getpeername 332
323#define __NR_socketpair 333
324#define __NR_send 334
325#define __NR_sendto 335
326#define __NR_recv 336
327#define __NR_recvfrom 337
328#define __NR_shutdown 338
329#define __NR_setsockopt 339
330#define __NR_getsockopt 340
331#define __NR_sendmsg 341
332#define __NR_recvmsg 342
333#define __NR_recvmmsg 343
334#define __NR_accept4 344
335#define __NR_name_to_handle_at 345
336#define __NR_open_by_handle_at 346
337#define __NR_clock_adjtime 347
338#define __NR_syncfs 348
339#define __NR_sendmmsg 349
340#define __NR_setns 350
341#define __NR_process_vm_readv 351
342#define __NR_process_vm_writev 352
343#define __NR_finit_module 353
344#define __NR_kcmp 354
345#define __NR_sched_setattr 355
346#define __NR_sched_getattr 356
347#define __NR_renameat2 357
348#define __NR_seccomp 358
349#define __NR_getrandom 359
350#define __NR_memfd_create 360
351#define __NR_bpf 361
352#define __NR_execveat 362
353#define __NR_switch_endian 363
354#define __NR_userfaultfd 364
355#define __NR_membarrier 365
356#define __NR_mlock2 378
357#define __NR_copy_file_range 379
358#define __NR_preadv2 380
359#define __NR_pwritev2 381
360#define __NR_kexec_file_load 382
361#define __NR_statx 383
362#define __NR_pkey_alloc 384
363#define __NR_pkey_free 385
364#define __NR_pkey_mprotect 386
365#define __NR_rseq 387
366#define __NR_io_pgetevents 388
367#define __NR_semtimedop 392
368#define __NR_semget 393
369#define __NR_semctl 394
370#define __NR_shmget 395
371#define __NR_shmctl 396
372#define __NR_shmat 397
373#define __NR_shmdt 398
374#define __NR_msgget 399
375#define __NR_msgsnd 400
376#define __NR_msgrcv 401
377#define __NR_msgctl 402
378#define __NR_pidfd_send_signal 424
379#define __NR_io_uring_setup 425
380#define __NR_io_uring_enter 426
381#define __NR_io_uring_register 427
382#define __NR_open_tree 428
383#define __NR_move_mount 429
384#define __NR_fsopen 430
385#define __NR_fsconfig 431
386#define __NR_fsmount 432
387#define __NR_fspick 433
388#define __NR_pidfd_open 434
389#define __NR_clone3 435
390#define __NR_close_range 436
391#define __NR_openat2 437
392#define __NR_pidfd_getfd 438
393#define __NR_faccessat2 439
394
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/termios.h deleted-171
...@@ -1,171 +0,0 @@
1#undef NCCS
2#define NCCS 19
3struct termios {
4 tcflag_t c_iflag;
5 tcflag_t c_oflag;
6 tcflag_t c_cflag;
7 tcflag_t c_lflag;
8 cc_t c_cc[NCCS];
9 cc_t c_line;
10 speed_t __c_ispeed;
11 speed_t __c_ospeed;
12};
13
14#define VINTR 0
15#define VQUIT 1
16#define VERASE 2
17#define VKILL 3
18#define VEOF 4
19#define VMIN 5
20#define VEOL 6
21#define VTIME 7
22#define VEOL2 8
23#define VSWTC 9
24#define VWERASE 10
25#define VREPRINT 11
26#define VSUSP 12
27#define VSTART 13
28#define VSTOP 14
29#define VLNEXT 15
30#define VDISCARD 16
31
32#define IGNBRK 0000001
33#define BRKINT 0000002
34#define IGNPAR 0000004
35#define PARMRK 0000010
36#define INPCK 0000020
37#define ISTRIP 0000040
38#define INLCR 0000100
39#define IGNCR 0000200
40#define ICRNL 0000400
41#define IXON 0001000
42#define IXOFF 0002000
43#define IXANY 0004000
44#define IUCLC 0010000
45#define IMAXBEL 0020000
46#define IUTF8 0040000
47
48#define OPOST 0000001
49#define ONLCR 0000002
50#define OLCUC 0000004
51#define OCRNL 0000010
52#define ONOCR 0000020
53#define ONLRET 0000040
54#define OFILL 0000100
55#define OFDEL 0000200
56#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_XOPEN_SOURCE)
57#define NLDLY 0001400
58#define NL0 0000000
59#define NL1 0000400
60#define NL2 0001000
61#define NL3 0001400
62#define TABDLY 0006000
63#define TAB0 0000000
64#define TAB1 0002000
65#define TAB2 0004000
66#define TAB3 0006000
67#define CRDLY 0030000
68#define CR0 0000000
69#define CR1 0010000
70#define CR2 0020000
71#define CR3 0030000
72#define FFDLY 0040000
73#define FF0 0000000
74#define FF1 0040000
75#define BSDLY 0100000
76#define BS0 0000000
77#define BS1 0100000
78#endif
79
80#define VTDLY 0200000
81#define VT0 0000000
82#define VT1 0200000
83
84#define B0 0000000
85#define B50 0000001
86#define B75 0000002
87#define B110 0000003
88#define B134 0000004
89#define B150 0000005
90#define B200 0000006
91#define B300 0000007
92#define B600 0000010
93#define B1200 0000011
94#define B1800 0000012
95#define B2400 0000013
96#define B4800 0000014
97#define B9600 0000015
98#define B19200 0000016
99#define B38400 0000017
100
101#define B57600 00020
102#define B115200 00021
103#define B230400 00022
104#define B460800 00023
105#define B500000 00024
106#define B576000 00025
107#define B921600 00026
108#define B1000000 00027
109#define B1152000 00030
110#define B1500000 00031
111#define B2000000 00032
112#define B2500000 00033
113#define B3000000 00034
114#define B3500000 00035
115#define B4000000 00036
116
117#define CSIZE 00001400
118#define CS5 00000000
119#define CS6 00000400
120#define CS7 00001000
121#define CS8 00001400
122#define CSTOPB 00002000
123#define CREAD 00004000
124#define PARENB 00010000
125#define PARODD 00020000
126#define HUPCL 00040000
127#define CLOCAL 00100000
128
129#define ECHOE 0x00000002
130#define ECHOK 0x00000004
131#define ECHO 0x00000008
132#define ECHONL 0x00000010
133#define ISIG 0x00000080
134#define ICANON 0x00000100
135#define IEXTEN 0x00000400
136#define TOSTOP 0x00400000
137#define NOFLSH 0x80000000
138
139#define TCOOFF 0
140#define TCOON 1
141#define TCIOFF 2
142#define TCION 3
143
144#define TCIFLUSH 0
145#define TCOFLUSH 1
146#define TCIOFLUSH 2
147
148#define TCSANOW 0
149#define TCSADRAIN 1
150#define TCSAFLUSH 2
151
152#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
153#define EXTA 0000016
154#define EXTB 0000017
155#define CBAUD 00377
156#define CBAUDEX 0000020
157#define CIBAUD 077600000
158#define CMSPAR 010000000000
159#define CRTSCTS 020000000000
160
161#define XCASE 0x00004000
162#define ECHOCTL 0x00000040
163#define ECHOPRT 0x00000020
164#define ECHOKE 0x00000001
165#define FLUSHO 0x00800000
166#define PENDIN 0x20000000
167#define EXTPROC 0x10000000
168
169#define XTABS 00006000
170#define TIOCSER_TEMT 1
171#endif
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/bits/user.h deleted-23
...@@ -1,23 +0,0 @@
1struct user {
2 struct {
3 unsigned long gpr[32], nip, msr, orig_gpr3, ctr, link, xer, ccr, softe;
4 unsigned long trap, dar, dsisr, result;
5 } regs;
6 unsigned long u_tsize, u_dsize, u_ssize;
7 unsigned long start_code, start_data, start_stack;
8 long signal;
9 void *u_ar0;
10 unsigned long magic;
11 char u_comm[32];
12};
13
14#define ELF_NGREG 48
15#define ELF_NFPREG 33
16#define ELF_NVRREG 34
17typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
18typedef double elf_fpreg_t, elf_fpregset_t[ELF_NFPREG];
19typedef struct { unsigned u[4]; }
20#ifdef __GNUC__
21__attribute__((__aligned__(16)))
22#endif
23 elf_vrreg_t, elf_vrregset_t[ELF_NVRREG];
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/crt_arch.h deleted-19
...@@ -1,19 +0,0 @@
1__asm__(
2".text \n"
3".global " START " \n"
4".type " START ", %function \n"
5START ": \n"
6" addis 2, 12, .TOC.-" START "@ha \n"
7" addi 2, 2, .TOC.-" START "@l \n"
8" lwz 4, 1f-" START "(12)\n"
9" add 4, 4, 12 \n"
10" mr 3, 1 \n"
11" clrrdi 1, 1, 4 \n"
12" li 0, 0 \n"
13" stdu 0, -32(1) \n"
14" mtlr 0 \n"
15" bl " START "_c \n"
16".weak _DYNAMIC \n"
17".hidden _DYNAMIC \n"
18"1: .long _DYNAMIC-" START "\n"
19);
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/kstat.h deleted-19
...@@ -1,19 +0,0 @@
1struct kstat {
2 dev_t st_dev;
3 ino_t st_ino;
4 nlink_t st_nlink;
5 mode_t st_mode;
6 uid_t st_uid;
7 gid_t st_gid;
8 dev_t st_rdev;
9 off_t st_size;
10 blksize_t st_blksize;
11 blkcnt_t st_blocks;
12 long st_atime_sec;
13 long st_atime_nsec;
14 long st_mtime_sec;
15 long st_mtime_nsec;
16 long st_ctime_sec;
17 long st_ctime_nsec;
18 unsigned long __unused[3];
19};
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/pthread_arch.h deleted-16
...@@ -1,16 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3 register uintptr_t tp __asm__("r13");
4 __asm__ ("" : "=r" (tp) );
5 return tp;
6}
7
8#define TLS_ABOVE_TP
9#define GAP_ABOVE_TP 0
10
11#define TP_OFFSET 0x7000
12#define DTP_OFFSET 0x8000
13
14// the kernel calls the ip "nip", it's the first saved value after the 32
15// GPRs.
16#define MC_PC gp_regs[32]
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/reloc.h deleted-31
...@@ -1,31 +0,0 @@
1#if __BYTE_ORDER == __LITTLE_ENDIAN
2#define ENDIAN_SUFFIX "le"
3#else
4#define ENDIAN_SUFFIX ""
5#endif
6
7#define LDSO_ARCH "powerpc64" ENDIAN_SUFFIX
8
9#define TPOFF_K (-0x7000)
10
11#define REL_SYMBOLIC R_PPC64_ADDR64
12#define REL_USYMBOLIC R_PPC64_UADDR64
13#define REL_GOT R_PPC64_GLOB_DAT
14#define REL_PLT R_PPC64_JMP_SLOT
15#define REL_RELATIVE R_PPC64_RELATIVE
16#define REL_COPY R_PPC64_COPY
17#define REL_DTPMOD R_PPC64_DTPMOD64
18#define REL_DTPOFF R_PPC64_DTPREL64
19#define REL_TPOFF R_PPC64_TPREL64
20
21#define CRTJMP(pc,sp) __asm__ __volatile__( \
22 "mr 1,%1; mr 12,%0; mtctr 12; bctrl" : : "r"(pc), "r"(sp) : "memory" )
23
24#define GETFUNCSYM(fp, sym, got) __asm__ ( \
25 ".hidden " #sym " \n" \
26 " bl 1f \n" \
27 " .long " #sym "-. \n" \
28 "1: mflr %1 \n" \
29 " lwa %0, 0(%1) \n" \
30 " add %0, %0, %1 \n" \
31 : "=r"(*(fp)), "=r"((long){0}) : : "memory", "lr" )
lib/libc/wasi/libc-top-half/musl/arch/powerpc64/syscall_arch.h deleted-90
...@@ -1,90 +0,0 @@
1#define __SYSCALL_LL_E(x) (x)
2#define __SYSCALL_LL_O(x) (x)
3
4static inline long __syscall0(long n)
5{
6 register long r0 __asm__("r0") = n;
7 register long r3 __asm__("r3");
8 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
9 : "+r"(r0), "=r"(r3)
10 :: "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
11 return r3;
12}
13
14static inline long __syscall1(long n, long a)
15{
16 register long r0 __asm__("r0") = n;
17 register long r3 __asm__("r3") = a;
18 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
19 : "+r"(r0), "+r"(r3)
20 :: "memory", "cr0", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
21 return r3;
22}
23
24static inline long __syscall2(long n, long a, long b)
25{
26 register long r0 __asm__("r0") = n;
27 register long r3 __asm__("r3") = a;
28 register long r4 __asm__("r4") = b;
29 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
30 : "+r"(r0), "+r"(r3), "+r"(r4)
31 :: "memory", "cr0", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
32 return r3;
33}
34
35static inline long __syscall3(long n, long a, long b, long c)
36{
37 register long r0 __asm__("r0") = n;
38 register long r3 __asm__("r3") = a;
39 register long r4 __asm__("r4") = b;
40 register long r5 __asm__("r5") = c;
41 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
42 : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5)
43 :: "memory", "cr0", "r6", "r7", "r8", "r9", "r10", "r11", "r12");
44 return r3;
45}
46
47static inline long __syscall4(long n, long a, long b, long c, long d)
48{
49 register long r0 __asm__("r0") = n;
50 register long r3 __asm__("r3") = a;
51 register long r4 __asm__("r4") = b;
52 register long r5 __asm__("r5") = c;
53 register long r6 __asm__("r6") = d;
54 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
55 : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6)
56 :: "memory", "cr0", "r7", "r8", "r9", "r10", "r11", "r12");
57 return r3;
58}
59
60static inline long __syscall5(long n, long a, long b, long c, long d, long e)
61{
62 register long r0 __asm__("r0") = n;
63 register long r3 __asm__("r3") = a;
64 register long r4 __asm__("r4") = b;
65 register long r5 __asm__("r5") = c;
66 register long r6 __asm__("r6") = d;
67 register long r7 __asm__("r7") = e;
68 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
69 : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6), "+r"(r7)
70 :: "memory", "cr0", "r8", "r9", "r10", "r11", "r12");
71 return r3;
72}
73
74static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
75{
76 register long r0 __asm__("r0") = n;
77 register long r3 __asm__("r3") = a;
78 register long r4 __asm__("r4") = b;
79 register long r5 __asm__("r5") = c;
80 register long r6 __asm__("r6") = d;
81 register long r7 __asm__("r7") = e;
82 register long r8 __asm__("r8") = f;
83 __asm__ __volatile__("sc ; bns+ 1f ; neg %1, %1 ; 1:"
84 : "+r"(r0), "+r"(r3), "+r"(r4), "+r"(r5), "+r"(r6), "+r"(r7), "+r"(r8)
85 :: "memory", "cr0", "r9", "r10", "r11", "r12");
86 return r3;
87}
88
89#define SO_RCVTIMEO_OLD 18
90#define SO_SNDTIMEO_OLD 19
lib/libc/wasi/libc-top-half/musl/arch/riscv64/atomic_arch.h deleted-38
...@@ -1,38 +0,0 @@
1#define a_barrier a_barrier
2static inline void a_barrier()
3{
4 __asm__ __volatile__ ("fence rw,rw" : : : "memory");
5}
6
7#define a_cas a_cas
8static inline int a_cas(volatile int *p, int t, int s)
9{
10 int old, tmp;
11 __asm__ __volatile__ (
12 "\n1: lr.w.aqrl %0, (%2)\n"
13 " bne %0, %3, 1f\n"
14 " sc.w.aqrl %1, %4, (%2)\n"
15 " bnez %1, 1b\n"
16 "1:"
17 : "=&r"(old), "=&r"(tmp)
18 : "r"(p), "r"((long)t), "r"((long)s)
19 : "memory");
20 return old;
21}
22
23#define a_cas_p a_cas_p
24static inline void *a_cas_p(volatile void *p, void *t, void *s)
25{
26 void *old;
27 int tmp;
28 __asm__ __volatile__ (
29 "\n1: lr.d.aqrl %0, (%2)\n"
30 " bne %0, %3, 1f\n"
31 " sc.d.aqrl %1, %4, (%2)\n"
32 " bnez %1, 1b\n"
33 "1:"
34 : "=&r"(old), "=&r"(tmp)
35 : "r"(p), "r"(t), "r"(s)
36 : "memory");
37 return old;
38}
lib/libc/wasi/libc-top-half/musl/arch/riscv64/bits/alltypes.h.in deleted-18
...@@ -1,18 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#define __BYTE_ORDER 1234
6#define __LONG_MAX 0x7fffffffffffffffL
7
8#ifndef __cplusplus
9TYPEDEF int wchar_t;
10#endif
11
12TYPEDEF int blksize_t;
13TYPEDEF unsigned int nlink_t;
14
15TYPEDEF float float_t;
16TYPEDEF double double_t;
17
18TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/riscv64/bits/fenv.h deleted-17
...@@ -1,17 +0,0 @@
1#define FE_INVALID 16
2#define FE_DIVBYZERO 8
3#define FE_OVERFLOW 4
4#define FE_UNDERFLOW 2
5#define FE_INEXACT 1
6
7#define FE_ALL_EXCEPT 31
8
9#define FE_TONEAREST 0
10#define FE_DOWNWARD 2
11#define FE_UPWARD 3
12#define FE_TOWARDZERO 1
13
14typedef unsigned int fexcept_t;
15typedef unsigned int fenv_t;
16
17#define FE_DFL_ENV ((const fenv_t *) -1)
lib/libc/wasi/libc-top-half/musl/arch/riscv64/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
4#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
5#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
6#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
7
8#define LDBL_MANT_DIG 113
9#define LDBL_MIN_EXP (-16381)
10#define LDBL_MAX_EXP 16384
11
12#define LDBL_DIG 33
13#define LDBL_MIN_10_EXP (-4931)
14#define LDBL_MAX_10_EXP 4932
15
16#define DECIMAL_DIG 36
lib/libc/wasi/libc-top-half/musl/arch/riscv64/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_LP64_OFF64 1
2#define _POSIX_V7_LP64_OFF64 1
lib/libc/wasi/libc-top-half/musl/arch/riscv64/bits/reg.h deleted-2
...@@ -1,2 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
lib/libc/wasi/libc-top-half/musl/arch/riscv64/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long __jmp_buf[26];
lib/libc/wasi/libc-top-half/musl/arch/riscv64/bits/signal.h deleted-118
...@@ -1,118 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5# define MINSIGSTKSZ 2048
6# define SIGSTKSZ 8192
7#endif
8
9typedef unsigned long __riscv_mc_gp_state[32];
10
11struct __riscv_mc_f_ext_state {
12 unsigned int __f[32];
13 unsigned int __fcsr;
14};
15
16struct __riscv_mc_d_ext_state {
17 unsigned long long __f[32];
18 unsigned int __fcsr;
19};
20
21struct __riscv_mc_q_ext_state {
22 unsigned long long __f[64] __attribute__((aligned(16)));
23 unsigned int __fcsr;
24 unsigned int __reserved[3];
25};
26
27union __riscv_mc_fp_state {
28 struct __riscv_mc_f_ext_state __f;
29 struct __riscv_mc_d_ext_state __d;
30 struct __riscv_mc_q_ext_state __q;
31};
32
33typedef struct mcontext_t {
34 __riscv_mc_gp_state __gregs;
35 union __riscv_mc_fp_state __fpregs;
36} mcontext_t;
37
38#if defined(_GNU_SOURCE)
39#define REG_PC 0
40#define REG_RA 1
41#define REG_SP 2
42#define REG_TP 4
43#define REG_S0 8
44#define REG_A0 10
45#endif
46
47#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
48typedef unsigned long greg_t;
49typedef unsigned long gregset_t[32];
50typedef union __riscv_mc_fp_state fpregset_t;
51struct sigcontext {
52 gregset_t gregs;
53 fpregset_t fpregs;
54};
55#endif
56
57struct sigaltstack {
58 void *ss_sp;
59 int ss_flags;
60 size_t ss_size;
61};
62
63typedef struct __ucontext
64{
65 unsigned long uc_flags;
66 struct __ucontext *uc_link;
67 stack_t uc_stack;
68 sigset_t uc_sigmask;
69 mcontext_t uc_mcontext;
70} ucontext_t;
71
72#define SA_NOCLDSTOP 1
73#define SA_NOCLDWAIT 2
74#define SA_SIGINFO 4
75#define SA_ONSTACK 0x08000000
76#define SA_RESTART 0x10000000
77#define SA_NODEFER 0x40000000
78#define SA_RESETHAND 0x80000000
79#define SA_RESTORER 0x04000000
80
81#endif
82
83#define SIGHUP 1
84#define SIGINT 2
85#define SIGQUIT 3
86#define SIGILL 4
87#define SIGTRAP 5
88#define SIGABRT 6
89#define SIGIOT SIGABRT
90#define SIGBUS 7
91#define SIGFPE 8
92#define SIGKILL 9
93#define SIGUSR1 10
94#define SIGSEGV 11
95#define SIGUSR2 12
96#define SIGPIPE 13
97#define SIGALRM 14
98#define SIGTERM 15
99#define SIGSTKFLT 16
100#define SIGCHLD 17
101#define SIGCONT 18
102#define SIGSTOP 19
103#define SIGTSTP 20
104#define SIGTTIN 21
105#define SIGTTOU 22
106#define SIGURG 23
107#define SIGXCPU 24
108#define SIGXFSZ 25
109#define SIGVTALRM 26
110#define SIGPROF 27
111#define SIGWINCH 28
112#define SIGIO 29
113#define SIGPOLL SIGIO
114#define SIGPWR 30
115#define SIGSYS 31
116#define SIGUNUSED SIGSYS
117
118#define _NSIG 65
lib/libc/wasi/libc-top-half/musl/arch/riscv64/bits/stat.h deleted-18
...@@ -1,18 +0,0 @@
1struct stat {
2 dev_t st_dev;
3 ino_t st_ino;
4 mode_t st_mode;
5 nlink_t st_nlink;
6 uid_t st_uid;
7 gid_t st_gid;
8 dev_t st_rdev;
9 unsigned long __pad;
10 off_t st_size;
11 blksize_t st_blksize;
12 int __pad2;
13 blkcnt_t st_blocks;
14 struct timespec st_atim;
15 struct timespec st_mtim;
16 struct timespec st_ctim;
17 unsigned __unused[2];
18};
lib/libc/wasi/libc-top-half/musl/arch/riscv64/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT64_MIN
16#define INTPTR_MAX INT64_MAX
17#define UINTPTR_MAX UINT64_MAX
18#define PTRDIFF_MIN INT64_MIN
19#define PTRDIFF_MAX INT64_MAX
20#define SIZE_MAX UINT64_MAX
lib/libc/wasi/libc-top-half/musl/arch/riscv64/bits/syscall.h.in deleted-298
...@@ -1,298 +0,0 @@
1#define __NR_io_setup 0
2#define __NR_io_destroy 1
3#define __NR_io_submit 2
4#define __NR_io_cancel 3
5#define __NR_io_getevents 4
6#define __NR_setxattr 5
7#define __NR_lsetxattr 6
8#define __NR_fsetxattr 7
9#define __NR_getxattr 8
10#define __NR_lgetxattr 9
11#define __NR_fgetxattr 10
12#define __NR_listxattr 11
13#define __NR_llistxattr 12
14#define __NR_flistxattr 13
15#define __NR_removexattr 14
16#define __NR_lremovexattr 15
17#define __NR_fremovexattr 16
18#define __NR_getcwd 17
19#define __NR_lookup_dcookie 18
20#define __NR_eventfd2 19
21#define __NR_epoll_create1 20
22#define __NR_epoll_ctl 21
23#define __NR_epoll_pwait 22
24#define __NR_dup 23
25#define __NR_dup3 24
26#define __NR_fcntl 25
27#define __NR_inotify_init1 26
28#define __NR_inotify_add_watch 27
29#define __NR_inotify_rm_watch 28
30#define __NR_ioctl 29
31#define __NR_ioprio_set 30
32#define __NR_ioprio_get 31
33#define __NR_flock 32
34#define __NR_mknodat 33
35#define __NR_mkdirat 34
36#define __NR_unlinkat 35
37#define __NR_symlinkat 36
38#define __NR_linkat 37
39#define __NR_umount2 39
40#define __NR_mount 40
41#define __NR_pivot_root 41
42#define __NR_nfsservctl 42
43#define __NR_statfs 43
44#define __NR_fstatfs 44
45#define __NR_truncate 45
46#define __NR_ftruncate 46
47#define __NR_fallocate 47
48#define __NR_faccessat 48
49#define __NR_chdir 49
50#define __NR_fchdir 50
51#define __NR_chroot 51
52#define __NR_fchmod 52
53#define __NR_fchmodat 53
54#define __NR_fchownat 54
55#define __NR_fchown 55
56#define __NR_openat 56
57#define __NR_close 57
58#define __NR_vhangup 58
59#define __NR_pipe2 59
60#define __NR_quotactl 60
61#define __NR_getdents64 61
62#define __NR_lseek 62
63#define __NR_read 63
64#define __NR_write 64
65#define __NR_readv 65
66#define __NR_writev 66
67#define __NR_pread64 67
68#define __NR_pwrite64 68
69#define __NR_preadv 69
70#define __NR_pwritev 70
71#define __NR_sendfile 71
72#define __NR_pselect6 72
73#define __NR_ppoll 73
74#define __NR_signalfd4 74
75#define __NR_vmsplice 75
76#define __NR_splice 76
77#define __NR_tee 77
78#define __NR_readlinkat 78
79#define __NR_fstatat 79
80#define __NR_fstat 80
81#define __NR_sync 81
82#define __NR_fsync 82
83#define __NR_fdatasync 83
84#define __NR_sync_file_range 84
85#define __NR_timerfd_create 85
86#define __NR_timerfd_settime 86
87#define __NR_timerfd_gettime 87
88#define __NR_utimensat 88
89#define __NR_acct 89
90#define __NR_capget 90
91#define __NR_capset 91
92#define __NR_personality 92
93#define __NR_exit 93
94#define __NR_exit_group 94
95#define __NR_waitid 95
96#define __NR_set_tid_address 96
97#define __NR_unshare 97
98#define __NR_futex 98
99#define __NR_set_robust_list 99
100#define __NR_get_robust_list 100
101#define __NR_nanosleep 101
102#define __NR_getitimer 102
103#define __NR_setitimer 103
104#define __NR_kexec_load 104
105#define __NR_init_module 105
106#define __NR_delete_module 106
107#define __NR_timer_create 107
108#define __NR_timer_gettime 108
109#define __NR_timer_getoverrun 109
110#define __NR_timer_settime 110
111#define __NR_timer_delete 111
112#define __NR_clock_settime 112
113#define __NR_clock_gettime 113
114#define __NR_clock_getres 114
115#define __NR_clock_nanosleep 115
116#define __NR_syslog 116
117#define __NR_ptrace 117
118#define __NR_sched_setparam 118
119#define __NR_sched_setscheduler 119
120#define __NR_sched_getscheduler 120
121#define __NR_sched_getparam 121
122#define __NR_sched_setaffinity 122
123#define __NR_sched_getaffinity 123
124#define __NR_sched_yield 124
125#define __NR_sched_get_priority_max 125
126#define __NR_sched_get_priority_min 126
127#define __NR_sched_rr_get_interval 127
128#define __NR_restart_syscall 128
129#define __NR_kill 129
130#define __NR_tkill 130
131#define __NR_tgkill 131
132#define __NR_sigaltstack 132
133#define __NR_rt_sigsuspend 133
134#define __NR_rt_sigaction 134
135#define __NR_rt_sigprocmask 135
136#define __NR_rt_sigpending 136
137#define __NR_rt_sigtimedwait 137
138#define __NR_rt_sigqueueinfo 138
139#define __NR_rt_sigreturn 139
140#define __NR_setpriority 140
141#define __NR_getpriority 141
142#define __NR_reboot 142
143#define __NR_setregid 143
144#define __NR_setgid 144
145#define __NR_setreuid 145
146#define __NR_setuid 146
147#define __NR_setresuid 147
148#define __NR_getresuid 148
149#define __NR_setresgid 149
150#define __NR_getresgid 150
151#define __NR_setfsuid 151
152#define __NR_setfsgid 152
153#define __NR_times 153
154#define __NR_setpgid 154
155#define __NR_getpgid 155
156#define __NR_getsid 156
157#define __NR_setsid 157
158#define __NR_getgroups 158
159#define __NR_setgroups 159
160#define __NR_uname 160
161#define __NR_sethostname 161
162#define __NR_setdomainname 162
163#define __NR_getrlimit 163
164#define __NR_setrlimit 164
165#define __NR_getrusage 165
166#define __NR_umask 166
167#define __NR_prctl 167
168#define __NR_getcpu 168
169#define __NR_gettimeofday 169
170#define __NR_settimeofday 170
171#define __NR_adjtimex 171
172#define __NR_getpid 172
173#define __NR_getppid 173
174#define __NR_getuid 174
175#define __NR_geteuid 175
176#define __NR_getgid 176
177#define __NR_getegid 177
178#define __NR_gettid 178
179#define __NR_sysinfo 179
180#define __NR_mq_open 180
181#define __NR_mq_unlink 181
182#define __NR_mq_timedsend 182
183#define __NR_mq_timedreceive 183
184#define __NR_mq_notify 184
185#define __NR_mq_getsetattr 185
186#define __NR_msgget 186
187#define __NR_msgctl 187
188#define __NR_msgrcv 188
189#define __NR_msgsnd 189
190#define __NR_semget 190
191#define __NR_semctl 191
192#define __NR_semtimedop 192
193#define __NR_semop 193
194#define __NR_shmget 194
195#define __NR_shmctl 195
196#define __NR_shmat 196
197#define __NR_shmdt 197
198#define __NR_socket 198
199#define __NR_socketpair 199
200#define __NR_bind 200
201#define __NR_listen 201
202#define __NR_accept 202
203#define __NR_connect 203
204#define __NR_getsockname 204
205#define __NR_getpeername 205
206#define __NR_sendto 206
207#define __NR_recvfrom 207
208#define __NR_setsockopt 208
209#define __NR_getsockopt 209
210#define __NR_shutdown 210
211#define __NR_sendmsg 211
212#define __NR_recvmsg 212
213#define __NR_readahead 213
214#define __NR_brk 214
215#define __NR_munmap 215
216#define __NR_mremap 216
217#define __NR_add_key 217
218#define __NR_request_key 218
219#define __NR_keyctl 219
220#define __NR_clone 220
221#define __NR_execve 221
222#define __NR_mmap 222
223#define __NR_fadvise64 223
224#define __NR_swapon 224
225#define __NR_swapoff 225
226#define __NR_mprotect 226
227#define __NR_msync 227
228#define __NR_mlock 228
229#define __NR_munlock 229
230#define __NR_mlockall 230
231#define __NR_munlockall 231
232#define __NR_mincore 232
233#define __NR_madvise 233
234#define __NR_remap_file_pages 234
235#define __NR_mbind 235
236#define __NR_get_mempolicy 236
237#define __NR_set_mempolicy 237
238#define __NR_migrate_pages 238
239#define __NR_move_pages 239
240#define __NR_rt_tgsigqueueinfo 240
241#define __NR_perf_event_open 241
242#define __NR_accept4 242
243#define __NR_recvmmsg 243
244#define __NR_arch_specific_syscall 244
245#define __NR_wait4 260
246#define __NR_prlimit64 261
247#define __NR_fanotify_init 262
248#define __NR_fanotify_mark 263
249#define __NR_name_to_handle_at 264
250#define __NR_open_by_handle_at 265
251#define __NR_clock_adjtime 266
252#define __NR_syncfs 267
253#define __NR_setns 268
254#define __NR_sendmmsg 269
255#define __NR_process_vm_readv 270
256#define __NR_process_vm_writev 271
257#define __NR_kcmp 272
258#define __NR_finit_module 273
259#define __NR_sched_setattr 274
260#define __NR_sched_getattr 275
261#define __NR_renameat2 276
262#define __NR_seccomp 277
263#define __NR_getrandom 278
264#define __NR_memfd_create 279
265#define __NR_bpf 280
266#define __NR_execveat 281
267#define __NR_userfaultfd 282
268#define __NR_membarrier 283
269#define __NR_mlock2 284
270#define __NR_copy_file_range 285
271#define __NR_preadv2 286
272#define __NR_pwritev2 287
273#define __NR_pkey_mprotect 288
274#define __NR_pkey_alloc 289
275#define __NR_pkey_free 290
276#define __NR_statx 291
277#define __NR_io_pgetevents 292
278#define __NR_rseq 293
279#define __NR_kexec_file_load 294
280#define __NR_pidfd_send_signal 424
281#define __NR_io_uring_setup 425
282#define __NR_io_uring_enter 426
283#define __NR_io_uring_register 427
284#define __NR_open_tree 428
285#define __NR_move_mount 429
286#define __NR_fsopen 430
287#define __NR_fsconfig 431
288#define __NR_fsmount 432
289#define __NR_fspick 433
290#define __NR_pidfd_open 434
291#define __NR_clone3 435
292#define __NR_close_range 436
293#define __NR_openat2 437
294#define __NR_pidfd_getfd 438
295#define __NR_faccessat2 439
296
297#define __NR_sysriscv __NR_arch_specific_syscall
298#define __NR_riscv_flush_icache (__NR_sysriscv + 15)
lib/libc/wasi/libc-top-half/musl/arch/riscv64/bits/user.h deleted-5
...@@ -1,5 +0,0 @@
1#include <signal.h>
2
3#define ELF_NGREG 32
4typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
5typedef union __riscv_mc_fp_state elf_fpregset_t;
lib/libc/wasi/libc-top-half/musl/arch/riscv64/crt_arch.h deleted-19
...@@ -1,19 +0,0 @@
1__asm__(
2".section .sdata,\"aw\"\n"
3".text\n"
4".global " START "\n"
5".type " START ",%function\n"
6START ":\n"
7".weak __global_pointer$\n"
8".hidden __global_pointer$\n"
9".option push\n"
10".option norelax\n\t"
11"lla gp, __global_pointer$\n"
12".option pop\n\t"
13"mv a0, sp\n"
14".weak _DYNAMIC\n"
15".hidden _DYNAMIC\n\t"
16"lla a1, _DYNAMIC\n\t"
17"andi sp, sp, -16\n\t"
18"tail " START "_c"
19);
lib/libc/wasi/libc-top-half/musl/arch/riscv64/kstat.h deleted-21
...@@ -1,21 +0,0 @@
1struct kstat {
2 dev_t st_dev;
3 ino_t st_ino;
4 mode_t st_mode;
5 nlink_t st_nlink;
6 uid_t st_uid;
7 gid_t st_gid;
8 dev_t st_rdev;
9 unsigned long __pad;
10 off_t st_size;
11 blksize_t st_blksize;
12 int __pad2;
13 blkcnt_t st_blocks;
14 long st_atime_sec;
15 long st_atime_nsec;
16 long st_mtime_sec;
17 long st_mtime_nsec;
18 long st_ctime_sec;
19 long st_ctime_nsec;
20 unsigned __unused[2];
21};
lib/libc/wasi/libc-top-half/musl/arch/riscv64/pthread_arch.h deleted-13
...@@ -1,13 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3 uintptr_t tp;
4 __asm__ __volatile__("mv %0, tp" : "=r"(tp));
5 return tp;
6}
7
8#define TLS_ABOVE_TP
9#define GAP_ABOVE_TP 0
10
11#define DTP_OFFSET 0x800
12
13#define MC_PC __gregs[0]
lib/libc/wasi/libc-top-half/musl/arch/riscv64/reloc.h deleted-22
...@@ -1,22 +0,0 @@
1#if defined __riscv_float_abi_soft
2#define RISCV_FP_SUFFIX "-sf"
3#elif defined __riscv_float_abi_single
4#define RISCV_FP_SUFFIX "-sp"
5#elif defined __riscv_float_abi_double
6#define RISCV_FP_SUFFIX ""
7#endif
8
9#define LDSO_ARCH "riscv64" RISCV_FP_SUFFIX
10
11#define TPOFF_K 0
12
13#define REL_SYMBOLIC R_RISCV_64
14#define REL_PLT R_RISCV_JUMP_SLOT
15#define REL_RELATIVE R_RISCV_RELATIVE
16#define REL_COPY R_RISCV_COPY
17#define REL_DTPMOD R_RISCV_TLS_DTPMOD64
18#define REL_DTPOFF R_RISCV_TLS_DTPREL64
19#define REL_TPOFF R_RISCV_TLS_TPREL64
20
21#define CRTJMP(pc,sp) __asm__ __volatile__( \
22 "mv sp, %1 ; jr %0" : : "r"(pc), "r"(sp) : "memory" )
lib/libc/wasi/libc-top-half/musl/arch/riscv64/syscall_arch.h deleted-78
...@@ -1,78 +0,0 @@
1#define __SYSCALL_LL_E(x) (x)
2#define __SYSCALL_LL_O(x) (x)
3
4#define __asm_syscall(...) \
5 __asm__ __volatile__ ("ecall\n\t" \
6 : "=r"(a0) : __VA_ARGS__ : "memory"); \
7 return a0; \
8
9static inline long __syscall0(long n)
10{
11 register long a7 __asm__("a7") = n;
12 register long a0 __asm__("a0");
13 __asm_syscall("r"(a7))
14}
15
16static inline long __syscall1(long n, long a)
17{
18 register long a7 __asm__("a7") = n;
19 register long a0 __asm__("a0") = a;
20 __asm_syscall("r"(a7), "0"(a0))
21}
22
23static inline long __syscall2(long n, long a, long b)
24{
25 register long a7 __asm__("a7") = n;
26 register long a0 __asm__("a0") = a;
27 register long a1 __asm__("a1") = b;
28 __asm_syscall("r"(a7), "0"(a0), "r"(a1))
29}
30
31static inline long __syscall3(long n, long a, long b, long c)
32{
33 register long a7 __asm__("a7") = n;
34 register long a0 __asm__("a0") = a;
35 register long a1 __asm__("a1") = b;
36 register long a2 __asm__("a2") = c;
37 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2))
38}
39
40static inline long __syscall4(long n, long a, long b, long c, long d)
41{
42 register long a7 __asm__("a7") = n;
43 register long a0 __asm__("a0") = a;
44 register long a1 __asm__("a1") = b;
45 register long a2 __asm__("a2") = c;
46 register long a3 __asm__("a3") = d;
47 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3))
48}
49
50static inline long __syscall5(long n, long a, long b, long c, long d, long e)
51{
52 register long a7 __asm__("a7") = n;
53 register long a0 __asm__("a0") = a;
54 register long a1 __asm__("a1") = b;
55 register long a2 __asm__("a2") = c;
56 register long a3 __asm__("a3") = d;
57 register long a4 __asm__("a4") = e;
58 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a4))
59}
60
61static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
62{
63 register long a7 __asm__("a7") = n;
64 register long a0 __asm__("a0") = a;
65 register long a1 __asm__("a1") = b;
66 register long a2 __asm__("a2") = c;
67 register long a3 __asm__("a3") = d;
68 register long a4 __asm__("a4") = e;
69 register long a5 __asm__("a5") = f;
70 __asm_syscall("r"(a7), "0"(a0), "r"(a1), "r"(a2), "r"(a3), "r"(a4), "r"(a5))
71}
72
73#define VDSO_USEFUL
74/* We don't have a clock_gettime function.
75#define VDSO_CGT_SYM "__vdso_clock_gettime"
76#define VDSO_CGT_VER "LINUX_2.6" */
77
78#define IPC_64 0
lib/libc/wasi/libc-top-half/musl/arch/s390x/atomic_arch.h deleted-30
...@@ -1,30 +0,0 @@
1#define a_cas a_cas
2static inline int a_cas(volatile int *p, int t, int s)
3{
4 __asm__ __volatile__ (
5 "cs %0, %2, %1"
6 : "+d"(t), "+Q"(*p) : "d"(s) : "memory", "cc");
7 return t;
8}
9
10#define a_cas_p a_cas_p
11static inline void *a_cas_p(volatile void *p, void *t, void *s)
12{
13 __asm__ __volatile__ (
14 "csg %0, %2, %1"
15 : "+d"(t), "+Q"(*(void *volatile *)p) : "d"(s)
16 : "memory", "cc");
17 return t;
18}
19
20#define a_barrier a_barrier
21static inline void a_barrier()
22{
23 __asm__ __volatile__ ("bcr 15,0" : : : "memory");
24}
25
26#define a_crash a_crash
27static inline void a_crash()
28{
29 __asm__ __volatile__ (".insn e,0");
30}
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/alltypes.h.in deleted-19
...@@ -1,19 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#define __BYTE_ORDER 4321
6#define __LONG_MAX 0x7fffffffffffffffL
7
8#ifndef __cplusplus
9TYPEDEF int wchar_t;
10#endif
11
12#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 1
13TYPEDEF double float_t;
14#else
15TYPEDEF float float_t;
16#endif
17TYPEDEF double double_t;
18
19TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/fcntl.h deleted-43
...@@ -1,43 +0,0 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 0200000
11#define O_NOFOLLOW 0400000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 040000
16#define O_LARGEFILE 0100000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020200000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_GETLK 5
29#define F_SETLK 6
30#define F_SETLKW 7
31
32#define F_SETOWN 8
33#define F_GETOWN 9
34#define F_SETSIG 10
35#define F_GETSIG 11
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
41
42#define POSIX_FADV_DONTNEED 6
43#define POSIX_FADV_NOREUSE 7
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/fenv.h deleted-17
...@@ -1,17 +0,0 @@
1#define FE_TONEAREST 0
2#define FE_TOWARDZERO 1
3#define FE_UPWARD 2
4#define FE_DOWNWARD 3
5
6#define FE_INEXACT 0x00080000
7#define FE_UNDERFLOW 0x00100000
8#define FE_OVERFLOW 0x00200000
9#define FE_DIVBYZERO 0x00400000
10#define FE_INVALID 0x00800000
11
12#define FE_ALL_EXCEPT 0x00f80000
13
14typedef unsigned fexcept_t;
15typedef unsigned fenv_t;
16
17#define FE_DFL_ENV ((const fenv_t *)-1)
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/float.h deleted-20
...@@ -1,20 +0,0 @@
1#ifdef __FLT_EVAL_METHOD__
2#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
3#else
4#define FLT_EVAL_METHOD 0
5#endif
6
7#define LDBL_TRUE_MIN 6.47517511943802511092443895822764655e-4966L
8#define LDBL_MIN 3.36210314311209350626267781732175260e-4932L
9#define LDBL_MAX 1.18973149535723176508575932662800702e+4932L
10#define LDBL_EPSILON 1.92592994438723585305597794258492732e-34L
11
12#define LDBL_MANT_DIG 113
13#define LDBL_MIN_EXP (-16381)
14#define LDBL_MAX_EXP 16384
15
16#define LDBL_DIG 33
17#define LDBL_MIN_10_EXP (-4931)
18#define LDBL_MAX_10_EXP 4932
19
20#define DECIMAL_DIG 36
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/hwcap.h deleted-15
...@@ -1,15 +0,0 @@
1#define HWCAP_S390_ESAN3 1
2#define HWCAP_S390_ZARCH 2
3#define HWCAP_S390_STFLE 4
4#define HWCAP_S390_MSA 8
5#define HWCAP_S390_LDISP 16
6#define HWCAP_S390_EIMM 32
7#define HWCAP_S390_DFP 64
8#define HWCAP_S390_HPAGE 128
9#define HWCAP_S390_ETF3EH 256
10#define HWCAP_S390_HIGH_GPRS 512
11#define HWCAP_S390_TE 1024
12#define HWCAP_S390_VXRS 2048
13#define HWCAP_S390_VXRS_BCD 4096
14#define HWCAP_S390_VXRS_EXT 8192
15#define HWCAP_S390_GS 16384
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/ioctl_fix.h deleted-2
...@@ -1,2 +0,0 @@
1#undef FIOQSIZE
2#define FIOQSIZE 0x545e
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/limits.h deleted-1
...@@ -1 +0,0 @@
1#define PAGESIZE 4096
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/link.h deleted-1
...@@ -1 +0,0 @@
1typedef uint64_t Elf_Symndx;
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_LP64_OFF64 1
2#define _POSIX_V7_LP64_OFF64 1
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/ptrace.h deleted-9
...@@ -1,9 +0,0 @@
1#define PTRACE_SINGLEBLOCK 12
2#define PTRACE_PEEKUSR_AREA 0x5000
3#define PTRACE_POKEUSR_AREA 0x5001
4#define PTRACE_GET_LAST_BREAK 0x5006
5#define PTRACE_ENABLE_TE 0x5009
6#define PTRACE_DISABLE_TE 0x5010
7#define PTRACE_TE_ABORT_RAND 0x5011
8
9#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/reg.h deleted-2
...@@ -1,2 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long __jmp_buf[18];
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/signal.h deleted-121
...@@ -1,121 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 4096
6#define SIGSTKSZ 10240
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10
11typedef unsigned long greg_t, gregset_t[27];
12
13typedef struct {
14 unsigned long mask;
15 unsigned long addr;
16} __psw_t;
17
18typedef union {
19 double d;
20 float f;
21} fpreg_t;
22
23typedef struct {
24 unsigned fpc;
25 fpreg_t fprs[16];
26} fpregset_t;
27
28typedef struct
29{
30 __psw_t psw;
31 unsigned long gregs[16];
32 unsigned aregs[16];
33 fpregset_t fpregs;
34} mcontext_t;
35
36struct sigcontext {
37 unsigned long oldmask[1];
38 struct {
39 struct {
40 __psw_t psw;
41 unsigned long gprs[16];
42 unsigned acrs[16];
43 } regs;
44 struct {
45 unsigned fpc;
46 double fprs[16];
47 } fpregs;
48 } *sregs;
49};
50
51#else
52
53typedef struct {
54 unsigned long __regs1[18];
55 unsigned __regs2[18];
56 double __regs3[16];
57} mcontext_t;
58
59#endif
60
61struct sigaltstack {
62 void *ss_sp;
63 int ss_flags;
64 size_t ss_size;
65};
66
67typedef struct __ucontext {
68 unsigned long uc_flags;
69 struct __ucontext *uc_link;
70 stack_t uc_stack;
71 mcontext_t uc_mcontext;
72 sigset_t uc_sigmask;
73} ucontext_t;
74
75#define SA_NOCLDSTOP 1U
76#define SA_NOCLDWAIT 2U
77#define SA_SIGINFO 4U
78#define SA_ONSTACK 0x08000000U
79#define SA_RESTART 0x10000000U
80#define SA_NODEFER 0x40000000U
81#define SA_RESETHAND 0x80000000U
82#define SA_RESTORER 0x04000000U
83
84#endif
85
86#define SIGHUP 1
87#define SIGINT 2
88#define SIGQUIT 3
89#define SIGILL 4
90#define SIGTRAP 5
91#define SIGABRT 6
92#define SIGIOT SIGABRT
93#define SIGBUS 7
94#define SIGFPE 8
95#define SIGKILL 9
96#define SIGUSR1 10
97#define SIGSEGV 11
98#define SIGUSR2 12
99#define SIGPIPE 13
100#define SIGALRM 14
101#define SIGTERM 15
102#define SIGSTKFLT 16
103#define SIGCHLD 17
104#define SIGCONT 18
105#define SIGSTOP 19
106#define SIGTSTP 20
107#define SIGTTIN 21
108#define SIGTTOU 22
109#define SIGURG 23
110#define SIGXCPU 24
111#define SIGXFSZ 25
112#define SIGVTALRM 26
113#define SIGPROF 27
114#define SIGWINCH 28
115#define SIGIO 29
116#define SIGPOLL SIGIO
117#define SIGPWR 30
118#define SIGSYS 31
119#define SIGUNUSED SIGSYS
120
121#define _NSIG 65
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/stat.h deleted-16
...@@ -1,16 +0,0 @@
1struct stat {
2 dev_t st_dev;
3 ino_t st_ino;
4 nlink_t st_nlink;
5 mode_t st_mode;
6 uid_t st_uid;
7 gid_t st_gid;
8 dev_t st_rdev;
9 off_t st_size;
10 struct timespec st_atim;
11 struct timespec st_mtim;
12 struct timespec st_ctim;
13 blksize_t st_blksize;
14 blkcnt_t st_blocks;
15 unsigned long __unused[3];
16};
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/statfs.h deleted-7
...@@ -1,7 +0,0 @@
1struct statfs {
2 unsigned f_type, f_bsize;
3 fsblkcnt_t f_blocks, f_bfree, f_bavail;
4 fsfilcnt_t f_files, f_ffree;
5 fsid_t f_fsid;
6 unsigned f_namelen, f_frsize, f_flags, f_spare[4];
7};
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT64_MIN
16#define INTPTR_MAX INT64_MAX
17#define UINTPTR_MAX UINT64_MAX
18#define PTRDIFF_MIN INT64_MIN
19#define PTRDIFF_MAX INT64_MAX
20#define SIZE_MAX UINT64_MAX
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/syscall.h.in deleted-359
...@@ -1,359 +0,0 @@
1#define __NR_exit 1
2#define __NR_fork 2
3#define __NR_read 3
4#define __NR_write 4
5#define __NR_open 5
6#define __NR_close 6
7#define __NR_restart_syscall 7
8#define __NR_creat 8
9#define __NR_link 9
10#define __NR_unlink 10
11#define __NR_execve 11
12#define __NR_chdir 12
13#define __NR_mknod 14
14#define __NR_chmod 15
15#define __NR_lseek 19
16#define __NR_getpid 20
17#define __NR_mount 21
18#define __NR_umount 22
19#define __NR_ptrace 26
20#define __NR_alarm 27
21#define __NR_pause 29
22#define __NR_utime 30
23#define __NR_access 33
24#define __NR_nice 34
25#define __NR_sync 36
26#define __NR_kill 37
27#define __NR_rename 38
28#define __NR_mkdir 39
29#define __NR_rmdir 40
30#define __NR_dup 41
31#define __NR_pipe 42
32#define __NR_times 43
33#define __NR_brk 45
34#define __NR_signal 48
35#define __NR_acct 51
36#define __NR_umount2 52
37#define __NR_ioctl 54
38#define __NR_fcntl 55
39#define __NR_setpgid 57
40#define __NR_umask 60
41#define __NR_chroot 61
42#define __NR_ustat 62
43#define __NR_dup2 63
44#define __NR_getppid 64
45#define __NR_getpgrp 65
46#define __NR_setsid 66
47#define __NR_sigaction 67
48#define __NR_sigsuspend 72
49#define __NR_sigpending 73
50#define __NR_sethostname 74
51#define __NR_setrlimit 75
52#define __NR_getrusage 77
53#define __NR_gettimeofday 78
54#define __NR_settimeofday 79
55#define __NR_symlink 83
56#define __NR_readlink 85
57#define __NR_uselib 86
58#define __NR_swapon 87
59#define __NR_reboot 88
60#define __NR_readdir 89
61#define __NR_mmap 90
62#define __NR_munmap 91
63#define __NR_truncate 92
64#define __NR_ftruncate 93
65#define __NR_fchmod 94
66#define __NR_getpriority 96
67#define __NR_setpriority 97
68#define __NR_statfs 99
69#define __NR_fstatfs 100
70#define __NR_socketcall 102
71#define __NR_syslog 103
72#define __NR_setitimer 104
73#define __NR_getitimer 105
74#define __NR_stat 106
75#define __NR_lstat 107
76#define __NR_fstat 108
77#define __NR_lookup_dcookie 110
78#define __NR_vhangup 111
79#define __NR_idle 112
80#define __NR_wait4 114
81#define __NR_swapoff 115
82#define __NR_sysinfo 116
83#define __NR_ipc 117
84#define __NR_fsync 118
85#define __NR_sigreturn 119
86#define __NR_clone 120
87#define __NR_setdomainname 121
88#define __NR_uname 122
89#define __NR_adjtimex 124
90#define __NR_mprotect 125
91#define __NR_sigprocmask 126
92#define __NR_create_module 127
93#define __NR_init_module 128
94#define __NR_delete_module 129
95#define __NR_get_kernel_syms 130
96#define __NR_quotactl 131
97#define __NR_getpgid 132
98#define __NR_fchdir 133
99#define __NR_bdflush 134
100#define __NR_sysfs 135
101#define __NR_personality 136
102#define __NR_afs_syscall 137
103#define __NR_getdents 141
104#define __NR_select 142
105#define __NR_flock 143
106#define __NR_msync 144
107#define __NR_readv 145
108#define __NR_writev 146
109#define __NR_getsid 147
110#define __NR_fdatasync 148
111#define __NR__sysctl 149
112#define __NR_mlock 150
113#define __NR_munlock 151
114#define __NR_mlockall 152
115#define __NR_munlockall 153
116#define __NR_sched_setparam 154
117#define __NR_sched_getparam 155
118#define __NR_sched_setscheduler 156
119#define __NR_sched_getscheduler 157
120#define __NR_sched_yield 158
121#define __NR_sched_get_priority_max 159
122#define __NR_sched_get_priority_min 160
123#define __NR_sched_rr_get_interval 161
124#define __NR_nanosleep 162
125#define __NR_mremap 163
126#define __NR_query_module 167
127#define __NR_poll 168
128#define __NR_nfsservctl 169
129#define __NR_prctl 172
130#define __NR_rt_sigreturn 173
131#define __NR_rt_sigaction 174
132#define __NR_rt_sigprocmask 175
133#define __NR_rt_sigpending 176
134#define __NR_rt_sigtimedwait 177
135#define __NR_rt_sigqueueinfo 178
136#define __NR_rt_sigsuspend 179
137#define __NR_pread64 180
138#define __NR_pwrite64 181
139#define __NR_getcwd 183
140#define __NR_capget 184
141#define __NR_capset 185
142#define __NR_sigaltstack 186
143#define __NR_sendfile 187
144#define __NR_getpmsg 188
145#define __NR_putpmsg 189
146#define __NR_vfork 190
147#define __NR_getrlimit 191
148#define __NR_lchown 198
149#define __NR_getuid 199
150#define __NR_getgid 200
151#define __NR_geteuid 201
152#define __NR_getegid 202
153#define __NR_setreuid 203
154#define __NR_setregid 204
155#define __NR_getgroups 205
156#define __NR_setgroups 206
157#define __NR_fchown 207
158#define __NR_setresuid 208
159#define __NR_getresuid 209
160#define __NR_setresgid 210
161#define __NR_getresgid 211
162#define __NR_chown 212
163#define __NR_setuid 213
164#define __NR_setgid 214
165#define __NR_setfsuid 215
166#define __NR_setfsgid 216
167#define __NR_pivot_root 217
168#define __NR_mincore 218
169#define __NR_madvise 219
170#define __NR_getdents64 220
171#define __NR_readahead 222
172#define __NR_setxattr 224
173#define __NR_lsetxattr 225
174#define __NR_fsetxattr 226
175#define __NR_getxattr 227
176#define __NR_lgetxattr 228
177#define __NR_fgetxattr 229
178#define __NR_listxattr 230
179#define __NR_llistxattr 231
180#define __NR_flistxattr 232
181#define __NR_removexattr 233
182#define __NR_lremovexattr 234
183#define __NR_fremovexattr 235
184#define __NR_gettid 236
185#define __NR_tkill 237
186#define __NR_futex 238
187#define __NR_sched_setaffinity 239
188#define __NR_sched_getaffinity 240
189#define __NR_tgkill 241
190#define __NR_io_setup 243
191#define __NR_io_destroy 244
192#define __NR_io_getevents 245
193#define __NR_io_submit 246
194#define __NR_io_cancel 247
195#define __NR_exit_group 248
196#define __NR_epoll_create 249
197#define __NR_epoll_ctl 250
198#define __NR_epoll_wait 251
199#define __NR_set_tid_address 252
200#define __NR_fadvise64 253
201#define __NR_timer_create 254
202#define __NR_timer_settime 255
203#define __NR_timer_gettime 256
204#define __NR_timer_getoverrun 257
205#define __NR_timer_delete 258
206#define __NR_clock_settime 259
207#define __NR_clock_gettime 260
208#define __NR_clock_getres 261
209#define __NR_clock_nanosleep 262
210#define __NR_statfs64 265
211#define __NR_fstatfs64 266
212#define __NR_remap_file_pages 267
213#define __NR_mbind 268
214#define __NR_get_mempolicy 269
215#define __NR_set_mempolicy 270
216#define __NR_mq_open 271
217#define __NR_mq_unlink 272
218#define __NR_mq_timedsend 273
219#define __NR_mq_timedreceive 274
220#define __NR_mq_notify 275
221#define __NR_mq_getsetattr 276
222#define __NR_kexec_load 277
223#define __NR_add_key 278
224#define __NR_request_key 279
225#define __NR_keyctl 280
226#define __NR_waitid 281
227#define __NR_ioprio_set 282
228#define __NR_ioprio_get 283
229#define __NR_inotify_init 284
230#define __NR_inotify_add_watch 285
231#define __NR_inotify_rm_watch 286
232#define __NR_migrate_pages 287
233#define __NR_openat 288
234#define __NR_mkdirat 289
235#define __NR_mknodat 290
236#define __NR_fchownat 291
237#define __NR_futimesat 292
238#define __NR_newfstatat 293
239#define __NR_unlinkat 294
240#define __NR_renameat 295
241#define __NR_linkat 296
242#define __NR_symlinkat 297
243#define __NR_readlinkat 298
244#define __NR_fchmodat 299
245#define __NR_faccessat 300
246#define __NR_pselect6 301
247#define __NR_ppoll 302
248#define __NR_unshare 303
249#define __NR_set_robust_list 304
250#define __NR_get_robust_list 305
251#define __NR_splice 306
252#define __NR_sync_file_range 307
253#define __NR_tee 308
254#define __NR_vmsplice 309
255#define __NR_move_pages 310
256#define __NR_getcpu 311
257#define __NR_epoll_pwait 312
258#define __NR_utimes 313
259#define __NR_fallocate 314
260#define __NR_utimensat 315
261#define __NR_signalfd 316
262#define __NR_timerfd 317
263#define __NR_eventfd 318
264#define __NR_timerfd_create 319
265#define __NR_timerfd_settime 320
266#define __NR_timerfd_gettime 321
267#define __NR_signalfd4 322
268#define __NR_eventfd2 323
269#define __NR_inotify_init1 324
270#define __NR_pipe2 325
271#define __NR_dup3 326
272#define __NR_epoll_create1 327
273#define __NR_preadv 328
274#define __NR_pwritev 329
275#define __NR_rt_tgsigqueueinfo 330
276#define __NR_perf_event_open 331
277#define __NR_fanotify_init 332
278#define __NR_fanotify_mark 333
279#define __NR_prlimit64 334
280#define __NR_name_to_handle_at 335
281#define __NR_open_by_handle_at 336
282#define __NR_clock_adjtime 337
283#define __NR_syncfs 338
284#define __NR_setns 339
285#define __NR_process_vm_readv 340
286#define __NR_process_vm_writev 341
287#define __NR_s390_runtime_instr 342
288#define __NR_kcmp 343
289#define __NR_finit_module 344
290#define __NR_sched_setattr 345
291#define __NR_sched_getattr 346
292#define __NR_renameat2 347
293#define __NR_seccomp 348
294#define __NR_getrandom 349
295#define __NR_memfd_create 350
296#define __NR_bpf 351
297#define __NR_s390_pci_mmio_write 352
298#define __NR_s390_pci_mmio_read 353
299#define __NR_execveat 354
300#define __NR_userfaultfd 355
301#define __NR_membarrier 356
302#define __NR_recvmmsg 357
303#define __NR_sendmmsg 358
304#define __NR_socket 359
305#define __NR_socketpair 360
306#define __NR_bind 361
307#define __NR_connect 362
308#define __NR_listen 363
309#define __NR_accept4 364
310#define __NR_getsockopt 365
311#define __NR_setsockopt 366
312#define __NR_getsockname 367
313#define __NR_getpeername 368
314#define __NR_sendto 369
315#define __NR_sendmsg 370
316#define __NR_recvfrom 371
317#define __NR_recvmsg 372
318#define __NR_shutdown 373
319#define __NR_mlock2 374
320#define __NR_copy_file_range 375
321#define __NR_preadv2 376
322#define __NR_pwritev2 377
323#define __NR_s390_guarded_storage 378
324#define __NR_statx 379
325#define __NR_s390_sthyi 380
326#define __NR_kexec_file_load 381
327#define __NR_io_pgetevents 382
328#define __NR_rseq 383
329#define __NR_pkey_mprotect 384
330#define __NR_pkey_alloc 385
331#define __NR_pkey_free 386
332#define __NR_semtimedop 392
333#define __NR_semget 393
334#define __NR_semctl 394
335#define __NR_shmget 395
336#define __NR_shmctl 396
337#define __NR_shmat 397
338#define __NR_shmdt 398
339#define __NR_msgget 399
340#define __NR_msgsnd 400
341#define __NR_msgrcv 401
342#define __NR_msgctl 402
343#define __NR_pidfd_send_signal 424
344#define __NR_io_uring_setup 425
345#define __NR_io_uring_enter 426
346#define __NR_io_uring_register 427
347#define __NR_open_tree 428
348#define __NR_move_mount 429
349#define __NR_fsopen 430
350#define __NR_fsconfig 431
351#define __NR_fsmount 432
352#define __NR_fspick 433
353#define __NR_pidfd_open 434
354#define __NR_clone3 435
355#define __NR_close_range 436
356#define __NR_openat2 437
357#define __NR_pidfd_getfd 438
358#define __NR_faccessat2 439
359
lib/libc/wasi/libc-top-half/musl/arch/s390x/bits/user.h deleted-62
...@@ -1,62 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
3
4typedef union {
5 double d;
6 float f;
7} elf_fpreg_t;
8
9typedef struct {
10 unsigned fpc;
11 elf_fpreg_t fprs[16];
12} elf_fpregset_t;
13
14#define ELF_NGREG 27
15typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG];
16
17struct _user_psw_struct {
18 unsigned long mask, addr;
19};
20
21struct _user_fpregs_struct {
22 unsigned fpc;
23 double fprs[16];
24};
25
26struct _user_per_struct {
27 unsigned long control_regs[3];
28 unsigned single_step : 1;
29 unsigned instruction_fetch : 1;
30 unsigned : 30;
31 unsigned long starting_addr, ending_addr;
32 unsigned short perc_atmid;
33 unsigned long address;
34 unsigned char access_id;
35};
36
37struct _user_regs_struct {
38 struct _user_psw_struct psw;
39 unsigned long gprs[16];
40 unsigned acrs[16];
41 unsigned long orig_gpr2;
42 struct _user_fpregs_struct fp_regs;
43 struct _user_per_struct per_info;
44 unsigned long ieee_instruction_pointer;
45};
46
47struct user {
48 struct _user_regs_struct regs;
49 unsigned long u_tsize, u_dsize, u_ssize;
50 unsigned long start_code, start_stack;
51 long signal;
52 struct _user_regs_struct *u_ar0;
53 unsigned long magic;
54 char u_comm[32];
55};
56
57#define PAGE_MASK (~(PAGESIZE-1))
58#define NBPG PAGESIZE
59#define UPAGES 1
60#define HOST_TEXT_START_ADDR (u.start_code)
61#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
62
lib/libc/wasi/libc-top-half/musl/arch/s390x/crt_arch.h deleted-17
...@@ -1,17 +0,0 @@
1__asm__(
2".text\n"
3".global " START "\n"
4".type " START ", %function\n"
5START ":\n"
6" lgr %r2, %r15\n"
7" larl %r3, 1f\n"
8" agf %r3, 0(%r3)\n"
9" aghi %r15, -160\n"
10" lghi %r0, 0\n"
11" stg %r0, 0(%r15)\n"
12" jg " START "_c\n"
13" .align 8\n"
14".weak _DYNAMIC\n"
15".hidden _DYNAMIC\n"
16"1: .long _DYNAMIC-.\n"
17);
lib/libc/wasi/libc-top-half/musl/arch/s390x/kstat.h deleted-19
...@@ -1,19 +0,0 @@
1struct kstat {
2 dev_t st_dev;
3 ino_t st_ino;
4 nlink_t st_nlink;
5 mode_t st_mode;
6 uid_t st_uid;
7 gid_t st_gid;
8 dev_t st_rdev;
9 off_t st_size;
10 long st_atime_sec;
11 long st_atime_nsec;
12 long st_mtime_sec;
13 long st_mtime_nsec;
14 long st_ctime_sec;
15 long st_ctime_nsec;
16 blksize_t st_blksize;
17 blkcnt_t st_blocks;
18 unsigned long __unused[3];
19};
lib/libc/wasi/libc-top-half/musl/arch/s390x/pthread_arch.h deleted-12
...@@ -1,12 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3 uintptr_t tp;
4 __asm__ (
5 "ear %0, %%a0\n"
6 "sllg %0, %0, 32\n"
7 "ear %0, %%a1\n"
8 : "=r"(tp));
9 return tp;
10}
11
12#define MC_PC psw.addr
lib/libc/wasi/libc-top-half/musl/arch/s390x/reloc.h deleted-13
...@@ -1,13 +0,0 @@
1#define LDSO_ARCH "s390x"
2
3#define REL_SYMBOLIC R_390_64
4#define REL_GOT R_390_GLOB_DAT
5#define REL_PLT R_390_JMP_SLOT
6#define REL_RELATIVE R_390_RELATIVE
7#define REL_COPY R_390_COPY
8#define REL_DTPMOD R_390_TLS_DTPMOD
9#define REL_DTPOFF R_390_TLS_DTPOFF
10#define REL_TPOFF R_390_TLS_TPOFF
11
12#define CRTJMP(pc,sp) __asm__ __volatile__( \
13 "lgr %%r15,%1; br %0" : : "r"(pc), "r"(sp) : "memory" )
lib/libc/wasi/libc-top-half/musl/arch/s390x/syscall_arch.h deleted-74
...@@ -1,74 +0,0 @@
1#define __SYSCALL_LL_E(x) (x)
2#define __SYSCALL_LL_O(x) (x)
3
4#define __asm_syscall(ret, ...) do { \
5 __asm__ __volatile__ ("svc 0\n" \
6 : ret : __VA_ARGS__ : "memory"); \
7 return r2; \
8 } while (0)
9
10static inline long __syscall0(long n)
11{
12 register long r1 __asm__("r1") = n;
13 register long r2 __asm__("r2");
14 __asm_syscall("=r"(r2), "r"(r1));
15}
16
17static inline long __syscall1(long n, long a)
18{
19 register long r1 __asm__("r1") = n;
20 register long r2 __asm__("r2") = a;
21 __asm_syscall("+r"(r2), "r"(r1));
22}
23
24static inline long __syscall2(long n, long a, long b)
25{
26 register long r1 __asm__("r1") = n;
27 register long r2 __asm__("r2") = a;
28 register long r3 __asm__("r3") = b;
29 __asm_syscall("+r"(r2), "r"(r1), "r"(r3));
30}
31
32static inline long __syscall3(long n, long a, long b, long c)
33{
34 register long r1 __asm__("r1") = n;
35 register long r2 __asm__("r2") = a;
36 register long r3 __asm__("r3") = b;
37 register long r4 __asm__("r4") = c;
38 __asm_syscall("+r"(r2), "r"(r1), "r"(r3), "r"(r4));
39}
40
41static inline long __syscall4(long n, long a, long b, long c, long d)
42{
43 register long r1 __asm__("r1") = n;
44 register long r2 __asm__("r2") = a;
45 register long r3 __asm__("r3") = b;
46 register long r4 __asm__("r4") = c;
47 register long r5 __asm__("r5") = d;
48 __asm_syscall("+r"(r2), "r"(r1), "r"(r3), "r"(r4), "r"(r5));
49}
50
51static inline long __syscall5(long n, long a, long b, long c, long d, long e)
52{
53 register long r1 __asm__("r1") = n;
54 register long r2 __asm__("r2") = a;
55 register long r3 __asm__("r3") = b;
56 register long r4 __asm__("r4") = c;
57 register long r5 __asm__("r5") = d;
58 register long r6 __asm__("r6") = e;
59 __asm_syscall("+r"(r2), "r"(r1), "r"(r3), "r"(r4), "r"(r5), "r"(r6));
60}
61
62static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
63{
64 if (n == SYS_mmap) return __syscall1(n, (long)(long[]){a,b,c,d,e,f});
65
66 register long r1 __asm__("r1") = n;
67 register long r2 __asm__("r2") = a;
68 register long r3 __asm__("r3") = b;
69 register long r4 __asm__("r4") = c;
70 register long r5 __asm__("r5") = d;
71 register long r6 __asm__("r6") = e;
72 register long r7 __asm__("r7") = f;
73 __asm_syscall("+r"(r2), "r"(r1), "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7));
74}
lib/libc/wasi/libc-top-half/musl/arch/sh/arch.mak deleted-1
...@@ -1 +0,0 @@
1COMPAT_SRC_DIRS = compat/time32
lib/libc/wasi/libc-top-half/musl/arch/sh/atomic_arch.h deleted-48
...@@ -1,48 +0,0 @@
1#include "libc.h"
2
3#if defined(__SH4A__)
4
5#define a_ll a_ll
6static inline int a_ll(volatile int *p)
7{
8 int v;
9 __asm__ __volatile__ ("movli.l @%1, %0" : "=z"(v) : "r"(p), "m"(*p));
10 return v;
11}
12
13#define a_sc a_sc
14static inline int a_sc(volatile int *p, int v)
15{
16 int r;
17 __asm__ __volatile__ (
18 "movco.l %2, @%3 ; movt %0"
19 : "=r"(r), "=m"(*p) : "z"(v), "r"(p) : "memory", "cc");
20 return r;
21}
22
23#define a_barrier a_barrier
24static inline void a_barrier()
25{
26 __asm__ __volatile__ ("synco" ::: "memory");
27}
28
29#define a_pre_llsc a_barrier
30#define a_post_llsc a_barrier
31
32#else
33
34#define a_cas a_cas
35extern hidden const void *__sh_cas_ptr;
36static inline int a_cas(volatile int *p, int t, int s)
37{
38 register int r1 __asm__("r1");
39 register int r2 __asm__("r2") = t;
40 register int r3 __asm__("r3") = s;
41 __asm__ __volatile__ (
42 "jsr @%4 ; nop"
43 : "=r"(r1), "+r"(r3) : "z"(p), "r"(r2), "r"(__sh_cas_ptr)
44 : "memory", "pr", "cc");
45 return r3;
46}
47
48#endif
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/alltypes.h.in deleted-25
...@@ -1,25 +0,0 @@
1#define _REDIR_TIME64 1
2#define _Addr int
3#define _Int64 long long
4#define _Reg int
5
6#if __BIG_ENDIAN__
7#define __BYTE_ORDER 4321
8#else
9#define __BYTE_ORDER 1234
10#endif
11
12#define __LONG_MAX 0x7fffffffL
13
14#ifndef __cplusplus
15#ifdef __WCHAR_TYPE__
16TYPEDEF __WCHAR_TYPE__ wchar_t;
17#else
18TYPEDEF long wchar_t;
19#endif
20#endif
21
22TYPEDEF float float_t;
23TYPEDEF double double_t;
24
25TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/fenv.h deleted-26
...@@ -1,26 +0,0 @@
1#ifndef __SH_FPU_ANY__
2
3#define FE_ALL_EXCEPT 0
4#define FE_TONEAREST 0
5
6#else
7
8#define FE_TONEAREST 0
9#define FE_TOWARDZERO 1
10
11#define FE_INEXACT 0x04
12#define FE_UNDERFLOW 0x08
13#define FE_OVERFLOW 0x10
14#define FE_DIVBYZERO 0x20
15#define FE_INVALID 0x40
16#define FE_ALL_EXCEPT 0x7c
17
18#endif
19
20typedef unsigned long fexcept_t;
21
22typedef struct {
23 unsigned long __cw;
24} fenv_t;
25
26#define FE_DFL_ENV ((const fenv_t *) -1)
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/float.h deleted-16
...@@ -1,16 +0,0 @@
1#define FLT_EVAL_METHOD 0
2
3#define LDBL_TRUE_MIN 4.94065645841246544177e-324L
4#define LDBL_MIN 2.22507385850720138309e-308L
5#define LDBL_MAX 1.79769313486231570815e+308L
6#define LDBL_EPSILON 2.22044604925031308085e-16L
7
8#define LDBL_MANT_DIG 53
9#define LDBL_MIN_EXP (-1021)
10#define LDBL_MAX_EXP 1024
11
12#define LDBL_DIG 15
13#define LDBL_MIN_10_EXP (-307)
14#define LDBL_MAX_10_EXP 308
15
16#define DECIMAL_DIG 17
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/hwcap.h deleted-11
...@@ -1,11 +0,0 @@
1#define CPU_HAS_FPU 0x0001
2#define CPU_HAS_P2_FLUSH_BUG 0x0002
3#define CPU_HAS_MMU_PAGE_ASSOC 0x0004
4#define CPU_HAS_DSP 0x0008
5#define CPU_HAS_PERF_COUNTER 0x0010
6#define CPU_HAS_PTEA 0x0020
7#define CPU_HAS_LLSC 0x0040
8#define CPU_HAS_L2_CACHE 0x0080
9#define CPU_HAS_OP32 0x0100
10#define CPU_HAS_PTEAEX 0x0200
11#define CPU_HAS_CAS_L 0x0400
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/ioctl.h deleted-112
...@@ -1,112 +0,0 @@
1#define _IOC(a,b,c,d) ( ((a)<<30) | ((b)<<8) | (c) | ((d)<<16) )
2#define _IOC_NONE 0U
3#define _IOC_WRITE 1U
4#define _IOC_READ 2U
5
6#define _IO(a,b) _IOC(_IOC_NONE,(a),(b),0)
7#define _IOW(a,b,c) _IOC(_IOC_WRITE,(a),(b),sizeof(c))
8#define _IOR(a,b,c) _IOC(_IOC_READ,(a),(b),sizeof(c))
9#define _IOWR(a,b,c) _IOC(_IOC_READ|_IOC_WRITE,(a),(b),sizeof(c))
10
11#define FIOCLEX _IO('f', 1)
12#define FIONCLEX _IO('f', 2)
13#define FIOASYNC _IOW('f', 125, int)
14#define FIONBIO _IOW('f', 126, int)
15#define FIONREAD _IOR('f', 127, int)
16#define TIOCINQ FIONREAD
17#define FIOQSIZE _IOR('f', 128, char[8])
18
19#define TCGETA _IOR('t', 23, char[18])
20#define TCSETA _IOW('t', 24, char[18])
21#define TCSETAW _IOW('t', 25, char[18])
22#define TCSETAF _IOW('t', 28, char[18])
23
24#define TCSBRK _IO('t', 29)
25#define TCXONC _IO('t', 30)
26#define TCFLSH _IO('t', 31)
27
28#define TIOCSWINSZ _IOW('t', 103, char[8])
29#define TIOCGWINSZ _IOR('t', 104, char[8])
30#define TIOCSTART _IO('t', 110)
31#define TIOCSTOP _IO('t', 111)
32#define TIOCOUTQ _IOR('t', 115, int)
33
34#define TIOCSPGRP _IOW('t', 118, int)
35#define TIOCGPGRP _IOR('t', 119, int)
36
37#define TIOCEXCL _IO('T', 12)
38#define TIOCNXCL _IO('T', 13)
39#define TIOCSCTTY _IO('T', 14)
40
41#define TIOCSTI _IOW('T', 18, char)
42#define TIOCMGET _IOR('T', 21, unsigned int)
43#define TIOCMBIS _IOW('T', 22, unsigned int)
44#define TIOCMBIC _IOW('T', 23, unsigned int)
45#define TIOCMSET _IOW('T', 24, unsigned int)
46#define TIOCM_LE 0x001
47#define TIOCM_DTR 0x002
48#define TIOCM_RTS 0x004
49#define TIOCM_ST 0x008
50#define TIOCM_SR 0x010
51#define TIOCM_CTS 0x020
52#define TIOCM_CAR 0x040
53#define TIOCM_RNG 0x080
54#define TIOCM_DSR 0x100
55#define TIOCM_CD TIOCM_CAR
56#define TIOCM_RI TIOCM_RNG
57#define TIOCM_OUT1 0x2000
58#define TIOCM_OUT2 0x4000
59#define TIOCM_LOOP 0x8000
60
61#define TIOCGSOFTCAR _IOR('T', 25, unsigned int)
62#define TIOCSSOFTCAR _IOW('T', 26, unsigned int)
63#define TIOCLINUX _IOW('T', 28, char)
64#define TIOCCONS _IO('T', 29)
65#define TIOCGSERIAL _IOR('T', 30, char[60])
66#define TIOCSSERIAL _IOW('T', 31, char[60])
67#define TIOCPKT _IOW('T', 32, int)
68
69#define TIOCNOTTY _IO('T', 34)
70#define TIOCSETD _IOW('T', 35, int)
71#define TIOCGETD _IOR('T', 36, int)
72#define TCSBRKP _IOW('T', 37, int)
73#define TIOCSBRK _IO('T', 39)
74#define TIOCCBRK _IO('T', 40)
75#define TIOCGSID _IOR('T', 41, int)
76#define TCGETS _IO('T', 1)
77#define TCSETS _IO('T', 2)
78#define TCSETSW _IO('T', 3)
79#define TCSETSF _IO('T', 4)
80#define TIOCGRS485 _IOR('T', 46, char[32])
81#define TIOCSRS485 _IOWR('T', 47, char[32])
82#define TIOCGPTN _IOR('T', 48, unsigned int)
83#define TIOCSPTLCK _IOW('T', 49, int)
84#define TIOCGDEV _IOR('T', 50, unsigned int)
85#define TIOCSIG _IOW('T', 54, int)
86#define TIOCVHANGUP _IO('T', 55)
87#define TIOCGPKT _IOR('T', 56, int)
88#define TIOCGPTLCK _IOR('T', 57, int)
89#define TIOCGEXCL _IOR('T', 64, int)
90#define TIOCGPTPEER _IO('T', 0x41)
91
92#define TIOCSERCONFIG _IO('T', 83)
93#define TIOCSERGWILD _IOR('T', 84, int)
94#define TIOCSERSWILD _IOW('T', 85, int)
95#define TIOCGLCKTRMIOS _IO('T', 86)
96#define TIOCSLCKTRMIOS _IO('T', 87)
97#define TIOCSERGSTRUCT _IOR('T', 88, char[216])
98#define TIOCSERGETLSR _IOR('T', 89, unsigned int)
99#define TIOCSERGETMULTI _IOR('T', 90, char[168])
100#define TIOCSERSETMULTI _IOW('T', 91, char[168])
101
102#define TIOCMIWAIT _IO('T', 92)
103#define TIOCGICOUNT _IO('T', 93)
104
105#define FIOGETOWN _IOR('f', 123, int)
106#define FIOSETOWN _IOW('f', 124, int)
107
108#define SIOCATMARK _IOR('s', 7, int)
109#define SIOCSPGRP _IOW('s', 8, int)
110#define SIOCGPGRP _IOW('s', 9, int)
111#define SIOCGSTAMP _IOR(0x89, 6, char[16])
112#define SIOCGSTAMPNS _IOR(0x89, 7, char[16])
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/ipcstat.h deleted-1
...@@ -1 +0,0 @@
1#define IPC_STAT 0x102
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/limits.h deleted-1
...@@ -1 +0,0 @@
1#define PAGESIZE 4096
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/msg.h deleted-18
...@@ -1,18 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 unsigned long __msg_stime_lo;
4 unsigned long __msg_stime_hi;
5 unsigned long __msg_rtime_lo;
6 unsigned long __msg_rtime_hi;
7 unsigned long __msg_ctime_lo;
8 unsigned long __msg_ctime_hi;
9 unsigned long msg_cbytes;
10 msgqnum_t msg_qnum;
11 msglen_t msg_qbytes;
12 pid_t msg_lspid;
13 pid_t msg_lrpid;
14 unsigned long __unused[2];
15 time_t msg_stime;
16 time_t msg_rtime;
17 time_t msg_ctime;
18};
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_ILP32_OFFBIG 1
2#define _POSIX_V7_ILP32_OFFBIG 1
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/ptrace.h deleted-5
...@@ -1,5 +0,0 @@
1#define PTRACE_GETFDPIC 31
2#define PTRACE_GETFDPIC_EXEC 0
3#define PTRACE_GETFDPIC_INTERP 1
4#define PTRACE_GETDSPREGS 55
5#define PTRACE_SETDSPREGS 56
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/sem.h deleted-18
...@@ -1,18 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 unsigned long __sem_otime_lo;
4 unsigned long __sem_otime_hi;
5 unsigned long __sem_ctime_lo;
6 unsigned long __sem_ctime_hi;
7#if __BYTE_ORDER == __LITTLE_ENDIAN
8 unsigned short sem_nsems;
9 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
10#else
11 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
12 unsigned short sem_nsems;
13#endif
14 long __unused3;
15 long __unused4;
16 time_t sem_otime;
17 time_t sem_ctime;
18};
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long __jmp_buf[15];
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/shm.h deleted-31
...@@ -1,31 +0,0 @@
1#define SHMLBA 16384
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 unsigned long __shm_atime_lo;
7 unsigned long __shm_atime_hi;
8 unsigned long __shm_dtime_lo;
9 unsigned long __shm_dtime_hi;
10 unsigned long __shm_ctime_lo;
11 unsigned long __shm_ctime_hi;
12 pid_t shm_cpid;
13 pid_t shm_lpid;
14 unsigned long shm_nattch;
15 unsigned long __pad1;
16 unsigned long __pad2;
17 unsigned long __pad3;
18 time_t shm_atime;
19 time_t shm_dtime;
20 time_t shm_ctime;
21};
22
23struct shminfo {
24 unsigned long shmmax, shmmin, shmmni, shmseg, shmall, __unused[4];
25};
26
27struct shm_info {
28 int __used_ids;
29 unsigned long shm_tot, shm_rss, shm_swp;
30 unsigned long __swap_attempts, __swap_successes;
31};
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/signal.h deleted-96
...@@ -1,96 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
10typedef int greg_t, gregset_t[16];
11typedef int freg_t, fpregset_t[16];
12typedef struct {
13 unsigned long oldmask;
14 unsigned long gregs[16];
15 unsigned long pc, pr, sr;
16 unsigned long gbr, mach, macl;
17 unsigned long fpregs[16];
18 unsigned long xfpregs[16];
19 unsigned int fpscr, fpul, ownedfp;
20} mcontext_t;
21struct sigcontext {
22 unsigned long oldmask;
23 unsigned long sc_regs[16];
24 unsigned long sc_pc, sc_pr, sc_sr;
25 unsigned long sc_gbr, sc_mach, sc_macl;
26 unsigned long sc_fpregs[16];
27 unsigned long sc_xfpregs[16];
28 unsigned int sc_fpscr, sc_fpul, sc_ownedfp;
29};
30#else
31typedef struct {
32 unsigned long __regs[58];
33} mcontext_t;
34#endif
35
36struct sigaltstack {
37 void *ss_sp;
38 int ss_flags;
39 size_t ss_size;
40};
41
42typedef struct __ucontext {
43 unsigned long uc_flags;
44 struct __ucontext *uc_link;
45 stack_t uc_stack;
46 mcontext_t uc_mcontext;
47 sigset_t uc_sigmask;
48} ucontext_t;
49
50#define SA_NOCLDSTOP 1
51#define SA_NOCLDWAIT 2
52#define SA_SIGINFO 4
53#define SA_ONSTACK 0x08000000
54#define SA_RESTART 0x10000000
55#define SA_NODEFER 0x40000000
56#define SA_RESETHAND 0x80000000
57#define SA_RESTORER 0x04000000
58
59#endif
60
61#define SIGHUP 1
62#define SIGINT 2
63#define SIGQUIT 3
64#define SIGILL 4
65#define SIGTRAP 5
66#define SIGABRT 6
67#define SIGIOT SIGABRT
68#define SIGBUS 7
69#define SIGFPE 8
70#define SIGKILL 9
71#define SIGUSR1 10
72#define SIGSEGV 11
73#define SIGUSR2 12
74#define SIGPIPE 13
75#define SIGALRM 14
76#define SIGTERM 15
77#define SIGSTKFLT 16
78#define SIGCHLD 17
79#define SIGCONT 18
80#define SIGSTOP 19
81#define SIGTSTP 20
82#define SIGTTIN 21
83#define SIGTTOU 22
84#define SIGURG 23
85#define SIGXCPU 24
86#define SIGXFSZ 25
87#define SIGVTALRM 26
88#define SIGPROF 27
89#define SIGWINCH 28
90#define SIGIO 29
91#define SIGPOLL 29
92#define SIGPWR 30
93#define SIGSYS 31
94#define SIGUNUSED SIGSYS
95
96#define _NSIG 65
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/stat.h deleted-25
...@@ -1,25 +0,0 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3
4struct stat {
5 dev_t st_dev;
6 int __st_dev_padding;
7 long __st_ino_truncated;
8 mode_t st_mode;
9 nlink_t st_nlink;
10 uid_t st_uid;
11 gid_t st_gid;
12 dev_t st_rdev;
13 int __st_rdev_padding;
14 off_t st_size;
15 blksize_t st_blksize;
16 blkcnt_t st_blocks;
17 struct {
18 long tv_sec;
19 long tv_nsec;
20 } __st_atim32, __st_mtim32, __st_ctim32;
21 ino_t st_ino;
22 struct timespec st_atim;
23 struct timespec st_mtim;
24 struct timespec st_ctim;
25};
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT32_MIN
16#define INTPTR_MAX INT32_MAX
17#define UINTPTR_MAX UINT32_MAX
18#define PTRDIFF_MIN INT32_MIN
19#define PTRDIFF_MAX INT32_MAX
20#define SIZE_MAX UINT32_MAX
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/syscall.h.in deleted-406
...@@ -1,406 +0,0 @@
1#define __NR_restart_syscall 0
2#define __NR_exit 1
3#define __NR_fork 2
4#define __NR_read 3
5#define __NR_write 4
6#define __NR_open 5
7#define __NR_close 6
8#define __NR_waitpid 7
9#define __NR_creat 8
10#define __NR_link 9
11#define __NR_unlink 10
12#define __NR_execve 11
13#define __NR_chdir 12
14#define __NR_time 13
15#define __NR_mknod 14
16#define __NR_chmod 15
17#define __NR_lchown 16
18#define __NR_oldstat 18
19#define __NR_lseek 19
20#define __NR_getpid 20
21#define __NR_mount 21
22#define __NR_umount 22
23#define __NR_setuid 23
24#define __NR_getuid 24
25#define __NR_stime 25
26#define __NR_ptrace 26
27#define __NR_alarm 27
28#define __NR_oldfstat 28
29#define __NR_pause 29
30#define __NR_utime 30
31#define __NR_access 33
32#define __NR_nice 34
33#define __NR_sync 36
34#define __NR_kill 37
35#define __NR_rename 38
36#define __NR_mkdir 39
37#define __NR_rmdir 40
38#define __NR_dup 41
39#define __NR_pipe 42
40#define __NR_times 43
41#define __NR_brk 45
42#define __NR_setgid 46
43#define __NR_getgid 47
44#define __NR_signal 48
45#define __NR_geteuid 49
46#define __NR_getegid 50
47#define __NR_acct 51
48#define __NR_umount2 52
49#define __NR_ioctl 54
50#define __NR_fcntl 55
51#define __NR_setpgid 57
52#define __NR_umask 60
53#define __NR_chroot 61
54#define __NR_ustat 62
55#define __NR_dup2 63
56#define __NR_getppid 64
57#define __NR_getpgrp 65
58#define __NR_setsid 66
59#define __NR_sigaction 67
60#define __NR_sgetmask 68
61#define __NR_ssetmask 69
62#define __NR_setreuid 70
63#define __NR_setregid 71
64#define __NR_sigsuspend 72
65#define __NR_sigpending 73
66#define __NR_sethostname 74
67#define __NR_setrlimit 75
68#define __NR_getrlimit 76
69#define __NR_getrusage 77
70#define __NR_gettimeofday_time32 78
71#define __NR_settimeofday_time32 79
72#define __NR_getgroups 80
73#define __NR_setgroups 81
74#define __NR_symlink 83
75#define __NR_oldlstat 84
76#define __NR_readlink 85
77#define __NR_uselib 86
78#define __NR_swapon 87
79#define __NR_reboot 88
80#define __NR_readdir 89
81#define __NR_mmap 90
82#define __NR_munmap 91
83#define __NR_truncate 92
84#define __NR_ftruncate 93
85#define __NR_fchmod 94
86#define __NR_fchown 95
87#define __NR_getpriority 96
88#define __NR_setpriority 97
89#define __NR_statfs 99
90#define __NR_fstatfs 100
91#define __NR_socketcall 102
92#define __NR_syslog 103
93#define __NR_setitimer 104
94#define __NR_getitimer 105
95#define __NR_stat 106
96#define __NR_lstat 107
97#define __NR_fstat 108
98#define __NR_olduname 109
99#define __NR_vhangup 111
100#define __NR_wait4 114
101#define __NR_swapoff 115
102#define __NR_sysinfo 116
103#define __NR_ipc 117
104#define __NR_fsync 118
105#define __NR_sigreturn 119
106#define __NR_clone 120
107#define __NR_setdomainname 121
108#define __NR_uname 122
109#define __NR_cacheflush 123
110#define __NR_adjtimex 124
111#define __NR_mprotect 125
112#define __NR_sigprocmask 126
113#define __NR_init_module 128
114#define __NR_delete_module 129
115#define __NR_quotactl 131
116#define __NR_getpgid 132
117#define __NR_fchdir 133
118#define __NR_bdflush 134
119#define __NR_sysfs 135
120#define __NR_personality 136
121#define __NR_setfsuid 138
122#define __NR_setfsgid 139
123#define __NR__llseek 140
124#define __NR_getdents 141
125#define __NR__newselect 142
126#define __NR_flock 143
127#define __NR_msync 144
128#define __NR_readv 145
129#define __NR_writev 146
130#define __NR_getsid 147
131#define __NR_fdatasync 148
132#define __NR__sysctl 149
133#define __NR_mlock 150
134#define __NR_munlock 151
135#define __NR_mlockall 152
136#define __NR_munlockall 153
137#define __NR_sched_setparam 154
138#define __NR_sched_getparam 155
139#define __NR_sched_setscheduler 156
140#define __NR_sched_getscheduler 157
141#define __NR_sched_yield 158
142#define __NR_sched_get_priority_max 159
143#define __NR_sched_get_priority_min 160
144#define __NR_sched_rr_get_interval 161
145#define __NR_nanosleep 162
146#define __NR_mremap 163
147#define __NR_setresuid 164
148#define __NR_getresuid 165
149#define __NR_poll 168
150#define __NR_nfsservctl 169
151#define __NR_setresgid 170
152#define __NR_getresgid 171
153#define __NR_prctl 172
154#define __NR_rt_sigreturn 173
155#define __NR_rt_sigaction 174
156#define __NR_rt_sigprocmask 175
157#define __NR_rt_sigpending 176
158#define __NR_rt_sigtimedwait 177
159#define __NR_rt_sigqueueinfo 178
160#define __NR_rt_sigsuspend 179
161#define __NR_pread64 180
162#define __NR_pwrite64 181
163#define __NR_chown 182
164#define __NR_getcwd 183
165#define __NR_capget 184
166#define __NR_capset 185
167#define __NR_sigaltstack 186
168#define __NR_sendfile 187
169#define __NR_vfork 190
170#define __NR_ugetrlimit 191
171#define __NR_mmap2 192
172#define __NR_truncate64 193
173#define __NR_ftruncate64 194
174#define __NR_stat64 195
175#define __NR_lstat64 196
176#define __NR_fstat64 197
177#define __NR_lchown32 198
178#define __NR_getuid32 199
179#define __NR_getgid32 200
180#define __NR_geteuid32 201
181#define __NR_getegid32 202
182#define __NR_setreuid32 203
183#define __NR_setregid32 204
184#define __NR_getgroups32 205
185#define __NR_setgroups32 206
186#define __NR_fchown32 207
187#define __NR_setresuid32 208
188#define __NR_getresuid32 209
189#define __NR_setresgid32 210
190#define __NR_getresgid32 211
191#define __NR_chown32 212
192#define __NR_setuid32 213
193#define __NR_setgid32 214
194#define __NR_setfsuid32 215
195#define __NR_setfsgid32 216
196#define __NR_pivot_root 217
197#define __NR_mincore 218
198#define __NR_madvise 219
199#define __NR_getdents64 220
200#define __NR_fcntl64 221
201#define __NR_gettid 224
202#define __NR_readahead 225
203#define __NR_setxattr 226
204#define __NR_lsetxattr 227
205#define __NR_fsetxattr 228
206#define __NR_getxattr 229
207#define __NR_lgetxattr 230
208#define __NR_fgetxattr 231
209#define __NR_listxattr 232
210#define __NR_llistxattr 233
211#define __NR_flistxattr 234
212#define __NR_removexattr 235
213#define __NR_lremovexattr 236
214#define __NR_fremovexattr 237
215#define __NR_tkill 238
216#define __NR_sendfile64 239
217#define __NR_futex 240
218#define __NR_sched_setaffinity 241
219#define __NR_sched_getaffinity 242
220#define __NR_io_setup 245
221#define __NR_io_destroy 246
222#define __NR_io_getevents 247
223#define __NR_io_submit 248
224#define __NR_io_cancel 249
225#define __NR_fadvise64 250
226#define __NR_exit_group 252
227#define __NR_lookup_dcookie 253
228#define __NR_epoll_create 254
229#define __NR_epoll_ctl 255
230#define __NR_epoll_wait 256
231#define __NR_remap_file_pages 257
232#define __NR_set_tid_address 258
233#define __NR_timer_create 259
234#define __NR_timer_settime32 260
235#define __NR_timer_gettime32 261
236#define __NR_timer_getoverrun 262
237#define __NR_timer_delete 263
238#define __NR_clock_settime32 264
239#define __NR_clock_gettime32 265
240#define __NR_clock_getres_time32 266
241#define __NR_clock_nanosleep_time32 267
242#define __NR_statfs64 268
243#define __NR_fstatfs64 269
244#define __NR_tgkill 270
245#define __NR_utimes 271
246#define __NR_fadvise64_64 272
247#define __NR_mbind 274
248#define __NR_get_mempolicy 275
249#define __NR_set_mempolicy 276
250#define __NR_mq_open 277
251#define __NR_mq_unlink 278
252#define __NR_mq_timedsend 279
253#define __NR_mq_timedreceive 280
254#define __NR_mq_notify 281
255#define __NR_mq_getsetattr 282
256#define __NR_kexec_load 283
257#define __NR_waitid 284
258#define __NR_add_key 285
259#define __NR_request_key 286
260#define __NR_keyctl 287
261#define __NR_ioprio_set 288
262#define __NR_ioprio_get 289
263#define __NR_inotify_init 290
264#define __NR_inotify_add_watch 291
265#define __NR_inotify_rm_watch 292
266#define __NR_migrate_pages 294
267#define __NR_openat 295
268#define __NR_mkdirat 296
269#define __NR_mknodat 297
270#define __NR_fchownat 298
271#define __NR_futimesat 299
272#define __NR_fstatat64 300
273#define __NR_unlinkat 301
274#define __NR_renameat 302
275#define __NR_linkat 303
276#define __NR_symlinkat 304
277#define __NR_readlinkat 305
278#define __NR_fchmodat 306
279#define __NR_faccessat 307
280#define __NR_pselect6 308
281#define __NR_ppoll 309
282#define __NR_unshare 310
283#define __NR_set_robust_list 311
284#define __NR_get_robust_list 312
285#define __NR_splice 313
286#define __NR_sync_file_range 314
287#define __NR_tee 315
288#define __NR_vmsplice 316
289#define __NR_move_pages 317
290#define __NR_getcpu 318
291#define __NR_epoll_pwait 319
292#define __NR_utimensat 320
293#define __NR_signalfd 321
294#define __NR_timerfd_create 322
295#define __NR_eventfd 323
296#define __NR_fallocate 324
297#define __NR_timerfd_settime32 325
298#define __NR_timerfd_gettime32 326
299#define __NR_signalfd4 327
300#define __NR_eventfd2 328
301#define __NR_epoll_create1 329
302#define __NR_dup3 330
303#define __NR_pipe2 331
304#define __NR_inotify_init1 332
305#define __NR_preadv 333
306#define __NR_pwritev 334
307#define __NR_rt_tgsigqueueinfo 335
308#define __NR_perf_event_open 336
309#define __NR_fanotify_init 337
310#define __NR_fanotify_mark 338
311#define __NR_prlimit64 339
312#define __NR_socket 340
313#define __NR_bind 341
314#define __NR_connect 342
315#define __NR_listen 343
316#define __NR_accept 344
317#define __NR_getsockname 345
318#define __NR_getpeername 346
319#define __NR_socketpair 347
320#define __NR_send 348
321#define __NR_sendto 349
322#define __NR_recv 350
323#define __NR_recvfrom 351
324#define __NR_shutdown 352
325#define __NR_setsockopt 353
326#define __NR_getsockopt 354
327#define __NR_sendmsg 355
328#define __NR_recvmsg 356
329#define __NR_recvmmsg 357
330#define __NR_accept4 358
331#define __NR_name_to_handle_at 359
332#define __NR_open_by_handle_at 360
333#define __NR_clock_adjtime 361
334#define __NR_syncfs 362
335#define __NR_sendmmsg 363
336#define __NR_setns 364
337#define __NR_process_vm_readv 365
338#define __NR_process_vm_writev 366
339#define __NR_kcmp 367
340#define __NR_finit_module 368
341#define __NR_sched_getattr 369
342#define __NR_sched_setattr 370
343#define __NR_renameat2 371
344#define __NR_seccomp 372
345#define __NR_getrandom 373
346#define __NR_memfd_create 374
347#define __NR_bpf 375
348#define __NR_execveat 376
349#define __NR_userfaultfd 377
350#define __NR_membarrier 378
351#define __NR_mlock2 379
352#define __NR_copy_file_range 380
353#define __NR_preadv2 381
354#define __NR_pwritev2 382
355#define __NR_statx 383
356#define __NR_pkey_mprotect 384
357#define __NR_pkey_alloc 385
358#define __NR_pkey_free 386
359#define __NR_rseq 387
360#define __NR_semget 393
361#define __NR_semctl 394
362#define __NR_shmget 395
363#define __NR_shmctl 396
364#define __NR_shmat 397
365#define __NR_shmdt 398
366#define __NR_msgget 399
367#define __NR_msgsnd 400
368#define __NR_msgrcv 401
369#define __NR_msgctl 402
370#define __NR_clock_gettime64 403
371#define __NR_clock_settime64 404
372#define __NR_clock_adjtime64 405
373#define __NR_clock_getres_time64 406
374#define __NR_clock_nanosleep_time64 407
375#define __NR_timer_gettime64 408
376#define __NR_timer_settime64 409
377#define __NR_timerfd_gettime64 410
378#define __NR_timerfd_settime64 411
379#define __NR_utimensat_time64 412
380#define __NR_pselect6_time64 413
381#define __NR_ppoll_time64 414
382#define __NR_io_pgetevents_time64 416
383#define __NR_recvmmsg_time64 417
384#define __NR_mq_timedsend_time64 418
385#define __NR_mq_timedreceive_time64 419
386#define __NR_semtimedop_time64 420
387#define __NR_rt_sigtimedwait_time64 421
388#define __NR_futex_time64 422
389#define __NR_sched_rr_get_interval_time64 423
390#define __NR_pidfd_send_signal 424
391#define __NR_io_uring_setup 425
392#define __NR_io_uring_enter 426
393#define __NR_io_uring_register 427
394#define __NR_open_tree 428
395#define __NR_move_mount 429
396#define __NR_fsopen 430
397#define __NR_fsconfig 431
398#define __NR_fsmount 432
399#define __NR_fspick 433
400#define __NR_pidfd_open 434
401#define __NR_clone3 435
402#define __NR_close_range 436
403#define __NR_openat2 437
404#define __NR_pidfd_getfd 438
405#define __NR_faccessat2 439
406
lib/libc/wasi/libc-top-half/musl/arch/sh/bits/user.h deleted-51
...@@ -1,51 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3
4#define REG_REG0 0
5#define REG_REG15 15
6#define REG_PC 16
7#define REG_PR 17
8#define REG_SR 18
9#define REG_GBR 19
10#define REG_MACH 20
11#define REG_MACL 21
12#define REG_SYSCALL 22
13#define REG_FPREG0 23
14#define REG_FPREG15 38
15#define REG_XFREG0 39
16#define REG_XFREG15 54
17#define REG_FPSCR 55
18#define REG_FPUL 56
19
20struct user_fpu_struct {
21 unsigned long fp_regs[16];
22 unsigned long xfp_regs[16];
23 unsigned long fpscr;
24 unsigned long fpul;
25};
26
27#define ELF_NGREG 23
28typedef unsigned long elf_greg_t;
29typedef elf_greg_t elf_gregset_t[ELF_NGREG];
30typedef struct user_fpu_struct elf_fpregset_t;
31
32struct user {
33 struct {
34 unsigned long regs[16];
35 unsigned long pc, pr, sr, gbr, mach, macl;
36 long tra;
37 } regs;
38 struct user_fpu_struct fpu;
39 int u_fpvalid;
40 unsigned long u_tsize;
41 unsigned long u_dsize;
42 unsigned long u_ssize;
43 unsigned long start_code;
44 unsigned long start_data;
45 unsigned long start_stack;
46 long int signal;
47 unsigned long u_ar0;
48 struct user_fpu_struct *u_fpstate;
49 unsigned long magic;
50 char u_comm[32];
51};
lib/libc/wasi/libc-top-half/musl/arch/sh/crt_arch.h deleted-78
...@@ -1,78 +0,0 @@
1#ifdef __SH_FDPIC__
2
3__asm__(
4".text \n"
5".global " START " \n"
6START ": \n"
7" tst r8, r8 \n"
8" bf 1f \n"
9" mov #68, r3 \n"
10" add r3, r3 \n"
11" mov #8, r4 \n"
12" swap.w r4, r4 \n"
13" trapa #31 \n"
14" nop \n"
15" nop \n"
16" nop \n"
17" nop \n"
18"1: nop \n"
19#ifndef SHARED
20" mov r8, r4 \n"
21" mova 1f, r0 \n"
22" mov.l 1f, r5 \n"
23" mov.l 1f+4, r6 \n"
24" add r0, r5 \n"
25" mov.l 4f, r1 \n"
26"5: bsrf r1 \n"
27" add r0, r6 \n"
28" mov r0, r12 \n"
29#endif
30" mov r10, r5 \n"
31" mov r15, r4 \n"
32" mov.l r9, @-r15 \n"
33" mov.l r8, @-r15 \n"
34" mov #-16, r0 \n"
35" mov.l 2f, r1 \n"
36"3: bsrf r1 \n"
37" and r0, r15 \n"
38".align 2 \n"
39"1: .long __ROFIXUP_LIST__@PCREL \n"
40" .long __ROFIXUP_END__@PCREL + 4 \n"
41"2: .long " START "_c@PCREL - (3b+4-.) \n"
42#ifndef SHARED
43"4: .long __fdpic_fixup@PCREL - (5b+4-.) \n"
44#endif
45);
46
47#ifndef SHARED
48#include "fdpic_crt.h"
49#endif
50
51#else
52
53__asm__(
54".text \n"
55".global " START " \n"
56START ": \n"
57" mova 1f, r0 \n"
58" mov.l 1f, r5 \n"
59" add r0, r5 \n"
60" mov r15, r4 \n"
61" mov #-16, r0 \n"
62" mov.l 2f, r1 \n"
63"3: bsrf r1 \n"
64" and r0, r15 \n"
65".align 2 \n"
66".weak _DYNAMIC \n"
67".hidden _DYNAMIC \n"
68"1: .long _DYNAMIC-. \n"
69"2: .long " START "_c@PCREL - (3b+4-.) \n"
70);
71
72#endif
73
74/* used by gcc for switching the FPU between single and double precision */
75#ifdef SHARED
76__attribute__((__visibility__("hidden")))
77#endif
78const unsigned long __fpscr_values[2] = { 0, 0x80000 };
lib/libc/wasi/libc-top-half/musl/arch/sh/ksigaction.h deleted-10
...@@ -1,10 +0,0 @@
1#include <features.h>
2
3struct k_sigaction {
4 void (*handler)(int);
5 unsigned long flags;
6 void *restorer;
7 unsigned mask[2];
8};
9
10extern hidden unsigned char __restore[], __restore_rt[];
lib/libc/wasi/libc-top-half/musl/arch/sh/kstat.h deleted-21
...@@ -1,21 +0,0 @@
1struct kstat {
2 dev_t st_dev;
3 int __st_dev_padding;
4 long __st_ino_truncated;
5 mode_t st_mode;
6 nlink_t st_nlink;
7 uid_t st_uid;
8 gid_t st_gid;
9 dev_t st_rdev;
10 int __st_rdev_padding;
11 off_t st_size;
12 blksize_t st_blksize;
13 blkcnt_t st_blocks;
14 long st_atime_sec;
15 long st_atime_nsec;
16 long st_mtime_sec;
17 long st_mtime_nsec;
18 long st_ctime_sec;
19 long st_ctime_nsec;
20 ino_t st_ino;
21};
lib/libc/wasi/libc-top-half/musl/arch/sh/pthread_arch.h deleted-16
...@@ -1,16 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3 uintptr_t tp;
4 __asm__ ("stc gbr,%0" : "=r" (tp) );
5 return tp;
6}
7
8#define TLS_ABOVE_TP
9#define GAP_ABOVE_TP 8
10
11#define MC_PC pc
12
13#ifdef __FDPIC__
14#define MC_GOT gregs[12]
15#define CANCEL_GOT (*(uintptr_t *)((char *)__syscall_cp_asm+sizeof(uintptr_t)))
16#endif
lib/libc/wasi/libc-top-half/musl/arch/sh/reloc.h deleted-52
...@@ -1,52 +0,0 @@
1#if __BYTE_ORDER == __BIG_ENDIAN
2#define ENDIAN_SUFFIX "eb"
3#else
4#define ENDIAN_SUFFIX ""
5#endif
6
7#if __SH_FPU_ANY__ || __SH4__
8#define FP_SUFFIX ""
9#else
10#define FP_SUFFIX "-nofpu"
11#endif
12
13#if __SH_FDPIC__
14#define ABI_SUFFIX "-fdpic"
15#else
16#define ABI_SUFFIX ""
17#endif
18
19#define LDSO_ARCH "sh" ENDIAN_SUFFIX FP_SUFFIX ABI_SUFFIX
20
21#define TPOFF_K 0
22
23#define REL_SYMBOLIC R_SH_DIR32
24#define REL_OFFSET R_SH_REL32
25#define REL_GOT R_SH_GLOB_DAT
26#define REL_PLT R_SH_JMP_SLOT
27#define REL_RELATIVE R_SH_RELATIVE
28#define REL_COPY R_SH_COPY
29#define REL_DTPMOD R_SH_TLS_DTPMOD32
30#define REL_DTPOFF R_SH_TLS_DTPOFF32
31#define REL_TPOFF R_SH_TLS_TPOFF32
32
33#define DL_NOMMU_SUPPORT 1
34
35#if __SH_FDPIC__
36#define REL_FUNCDESC R_SH_FUNCDESC
37#define REL_FUNCDESC_VAL R_SH_FUNCDESC_VALUE
38#undef REL_RELATIVE
39#define DL_FDPIC 1
40#define FDPIC_CONSTDISP_FLAG 0x100
41#define CRTJMP(pc,sp) do { \
42 register size_t r8 __asm__("r8") = ((size_t *)(sp))[-2]; \
43 __asm__ __volatile__( "jmp @%0 ; mov %1,r15" \
44 : : "r"(pc), "r"(sp), "r"(r8) : "memory" ); } while(0)
45#define GETFUNCSYM(fp, sym, got) __asm__ ( \
46 "mov.l 1f,%0 ; add %1,%0 ; bra 2f ; nop ; .align 2 \n" \
47 "1: .long " #sym "@GOTOFFFUNCDESC \n2:" \
48 : "=&r"(*fp) : "r"(got) : "memory" )
49#else
50#define CRTJMP(pc,sp) __asm__ __volatile__( \
51 "jmp @%0 ; mov %1,r15" : : "r"(pc), "r"(sp) : "memory" )
52#endif
lib/libc/wasi/libc-top-half/musl/arch/sh/syscall_arch.h deleted-93
...@@ -1,93 +0,0 @@
1#define __SYSCALL_LL_E(x) \
2((union { long long ll; long l[2]; }){ .ll = x }).l[0], \
3((union { long long ll; long l[2]; }){ .ll = x }).l[1]
4#define __SYSCALL_LL_O(x) __SYSCALL_LL_E((x))
5#define __SYSCALL_LL_PRW(x) 0, __SYSCALL_LL_E((x))
6
7/* The extra OR instructions are to work around a hardware bug:
8 * http://documentation.renesas.com/doc/products/mpumcu/tu/tnsh7456ae.pdf
9 */
10#define __asm_syscall(trapno, ...) do { \
11 __asm__ __volatile__ ( \
12 "trapa #31\n" \
13 "or r0, r0\n" \
14 "or r0, r0\n" \
15 "or r0, r0\n" \
16 "or r0, r0\n" \
17 "or r0, r0\n" \
18 : "=r"(r0) : __VA_ARGS__ : "memory"); \
19 return r0; \
20 } while (0)
21
22static inline long __syscall0(long n)
23{
24 register long r3 __asm__("r3") = n;
25 register long r0 __asm__("r0");
26 __asm_syscall(16, "r"(r3));
27}
28
29static inline long __syscall1(long n, long a)
30{
31 register long r3 __asm__("r3") = n;
32 register long r4 __asm__("r4") = a;
33 register long r0 __asm__("r0");
34 __asm_syscall(17, "r"(r3), "r"(r4));
35}
36
37static inline long __syscall2(long n, long a, long b)
38{
39 register long r3 __asm__("r3") = n;
40 register long r4 __asm__("r4") = a;
41 register long r5 __asm__("r5") = b;
42 register long r0 __asm__("r0");
43 __asm_syscall(18, "r"(r3), "r"(r4), "r"(r5));
44}
45
46static inline long __syscall3(long n, long a, long b, long c)
47{
48 register long r3 __asm__("r3") = n;
49 register long r4 __asm__("r4") = a;
50 register long r5 __asm__("r5") = b;
51 register long r6 __asm__("r6") = c;
52 register long r0 __asm__("r0");
53 __asm_syscall(19, "r"(r3), "r"(r4), "r"(r5), "r"(r6));
54}
55
56static inline long __syscall4(long n, long a, long b, long c, long d)
57{
58 register long r3 __asm__("r3") = n;
59 register long r4 __asm__("r4") = a;
60 register long r5 __asm__("r5") = b;
61 register long r6 __asm__("r6") = c;
62 register long r7 __asm__("r7") = d;
63 register long r0 __asm__("r0");
64 __asm_syscall(20, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7));
65}
66
67static inline long __syscall5(long n, long a, long b, long c, long d, long e)
68{
69 register long r3 __asm__("r3") = n;
70 register long r4 __asm__("r4") = a;
71 register long r5 __asm__("r5") = b;
72 register long r6 __asm__("r6") = c;
73 register long r7 __asm__("r7") = d;
74 register long r0 __asm__("r0") = e;
75 __asm_syscall(21, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "0"(r0));
76}
77
78static inline long __syscall6(long n, long a, long b, long c, long d, long e, long f)
79{
80 register long r3 __asm__("r3") = n;
81 register long r4 __asm__("r4") = a;
82 register long r5 __asm__("r5") = b;
83 register long r6 __asm__("r6") = c;
84 register long r7 __asm__("r7") = d;
85 register long r0 __asm__("r0") = e;
86 register long r1 __asm__("r1") = f;
87 __asm_syscall(22, "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "0"(r0), "r"(r1));
88}
89
90#define SYSCALL_IPC_BROKEN_MODE
91
92#define SIOCGSTAMP_OLD (2U<<30 | 's'<<8 | 100 | 8<<16)
93#define SIOCGSTAMPNS_OLD (2U<<30 | 's'<<8 | 101 | 8<<16)
lib/libc/wasi/libc-top-half/musl/arch/x32/atomic_arch.h deleted-121
...@@ -1,121 +0,0 @@
1#define a_cas a_cas
2static inline int a_cas(volatile int *p, int t, int s)
3{
4 __asm__ __volatile__ (
5 "lock ; cmpxchg %3, %1"
6 : "=a"(t), "=m"(*p) : "a"(t), "r"(s) : "memory" );
7 return t;
8}
9
10#define a_swap a_swap
11static inline int a_swap(volatile int *p, int v)
12{
13 __asm__ __volatile__(
14 "xchg %0, %1"
15 : "=r"(v), "=m"(*p) : "0"(v) : "memory" );
16 return v;
17}
18
19#define a_fetch_add a_fetch_add
20static inline int a_fetch_add(volatile int *p, int v)
21{
22 __asm__ __volatile__(
23 "lock ; xadd %0, %1"
24 : "=r"(v), "=m"(*p) : "0"(v) : "memory" );
25 return v;
26}
27
28#define a_and a_and
29static inline void a_and(volatile int *p, int v)
30{
31 __asm__ __volatile__(
32 "lock ; and %1, %0"
33 : "=m"(*p) : "r"(v) : "memory" );
34}
35
36#define a_or a_or
37static inline void a_or(volatile int *p, int v)
38{
39 __asm__ __volatile__(
40 "lock ; or %1, %0"
41 : "=m"(*p) : "r"(v) : "memory" );
42}
43
44#define a_and_64 a_and_64
45static inline void a_and_64(volatile uint64_t *p, uint64_t v)
46{
47 __asm__ __volatile(
48 "lock ; and %1, %0"
49 : "=m"(*p) : "r"(v) : "memory" );
50}
51
52#define a_or_64 a_or_64
53static inline void a_or_64(volatile uint64_t *p, uint64_t v)
54{
55 __asm__ __volatile__(
56 "lock ; or %1, %0"
57 : "=m"(*p) : "r"(v) : "memory" );
58}
59
60#define a_inc a_inc
61static inline void a_inc(volatile int *p)
62{
63 __asm__ __volatile__(
64 "lock ; incl %0"
65 : "=m"(*p) : "m"(*p) : "memory" );
66}
67
68#define a_dec a_dec
69static inline void a_dec(volatile int *p)
70{
71 __asm__ __volatile__(
72 "lock ; decl %0"
73 : "=m"(*p) : "m"(*p) : "memory" );
74}
75
76#define a_store a_store
77static inline void a_store(volatile int *p, int x)
78{
79 __asm__ __volatile__(
80 "mov %1, %0 ; lock ; orl $0,(%%rsp)"
81 : "=m"(*p) : "r"(x) : "memory" );
82}
83
84#define a_barrier a_barrier
85static inline void a_barrier()
86{
87 __asm__ __volatile__( "" : : : "memory" );
88}
89
90#define a_spin a_spin
91static inline void a_spin()
92{
93 __asm__ __volatile__( "pause" : : : "memory" );
94}
95
96#define a_crash a_crash
97static inline void a_crash()
98{
99 __asm__ __volatile__( "hlt" : : : "memory" );
100}
101
102#define a_ctz_64 a_ctz_64
103static inline int a_ctz_64(uint64_t x)
104{
105 __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
106 return x;
107}
108
109#define a_ctz_32 a_ctz_32
110static inline int a_ctz_32(uint32_t x)
111{
112 __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
113 return x;
114}
115
116#define a_clz_64 a_clz_64
117static inline int a_clz_64(uint64_t x)
118{
119 __asm__( "bsr %1,%0 ; xor $63,%0" : "=r"(x) : "r"(x) );
120 return x;
121}
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/alltypes.h.in deleted-24
...@@ -1,24 +0,0 @@
1#define _Addr int
2#define _Int64 long long
3#define _Reg long long
4
5#define __BYTE_ORDER 1234
6#define __LONG_MAX 0x7fffffffL
7
8#ifndef __cplusplus
9#ifdef __WCHAR_TYPE__
10TYPEDEF __WCHAR_TYPE__ wchar_t;
11#else
12TYPEDEF long wchar_t;
13#endif
14#endif
15
16#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 2
17TYPEDEF long double float_t;
18TYPEDEF long double double_t;
19#else
20TYPEDEF float float_t;
21TYPEDEF double double_t;
22#endif
23
24TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/fcntl.h deleted-40
...@@ -1,40 +0,0 @@
1#define O_CREAT 0100
2#define O_EXCL 0200
3#define O_NOCTTY 0400
4#define O_TRUNC 01000
5#define O_APPEND 02000
6#define O_NONBLOCK 04000
7#define O_DSYNC 010000
8#define O_SYNC 04010000
9#define O_RSYNC 04010000
10#define O_DIRECTORY 0200000
11#define O_NOFOLLOW 0400000
12#define O_CLOEXEC 02000000
13
14#define O_ASYNC 020000
15#define O_DIRECT 040000
16#define O_LARGEFILE 0100000
17#define O_NOATIME 01000000
18#define O_PATH 010000000
19#define O_TMPFILE 020200000
20#define O_NDELAY O_NONBLOCK
21
22#define F_DUPFD 0
23#define F_GETFD 1
24#define F_SETFD 2
25#define F_GETFL 3
26#define F_SETFL 4
27
28#define F_SETOWN 8
29#define F_GETOWN 9
30#define F_SETSIG 10
31#define F_GETSIG 11
32
33#define F_GETLK 5
34#define F_SETLK 6
35#define F_SETLKW 7
36
37#define F_SETOWN_EX 15
38#define F_GETOWN_EX 16
39
40#define F_GETOWNER_UIDS 17
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/fenv.h deleted-34
...@@ -1,34 +0,0 @@
1#define FE_INVALID 1
2#define __FE_DENORM 2
3#define FE_DIVBYZERO 4
4#define FE_OVERFLOW 8
5#define FE_UNDERFLOW 16
6#define FE_INEXACT 32
7
8#define FE_ALL_EXCEPT 63
9
10#define FE_TONEAREST 0
11#define FE_DOWNWARD 0x400
12#define FE_UPWARD 0x800
13#define FE_TOWARDZERO 0xc00
14
15typedef unsigned short fexcept_t;
16
17typedef struct {
18 unsigned short __control_word;
19 unsigned short __unused1;
20 unsigned short __status_word;
21 unsigned short __unused2;
22 unsigned short __tags;
23 unsigned short __unused3;
24 unsigned int __eip;
25 unsigned short __cs_selector;
26 unsigned int __opcode:11;
27 unsigned int __unused4:5;
28 unsigned int __data_offset;
29 unsigned short __data_selector;
30 unsigned short __unused5;
31 unsigned int __mxcsr;
32} fenv_t;
33
34#define FE_DFL_ENV ((const fenv_t *) -1)
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/float.h deleted-20
...@@ -1,20 +0,0 @@
1#ifdef __FLT_EVAL_METHOD__
2#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
3#else
4#define FLT_EVAL_METHOD 0
5#endif
6
7#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L
8#define LDBL_MIN 3.3621031431120935063e-4932L
9#define LDBL_MAX 1.1897314953572317650e+4932L
10#define LDBL_EPSILON 1.0842021724855044340e-19L
11
12#define LDBL_MANT_DIG 64
13#define LDBL_MIN_EXP (-16381)
14#define LDBL_MAX_EXP 16384
15
16#define LDBL_DIG 18
17#define LDBL_MIN_10_EXP (-4931)
18#define LDBL_MAX_10_EXP 4932
19
20#define DECIMAL_DIG 21
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/io.h deleted-77
...@@ -1,77 +0,0 @@
1static __inline void outb(unsigned char __val, unsigned short __port)
2{
3 __asm__ volatile ("outb %0,%1" : : "a" (__val), "dN" (__port));
4}
5
6static __inline void outw(unsigned short __val, unsigned short __port)
7{
8 __asm__ volatile ("outw %0,%1" : : "a" (__val), "dN" (__port));
9}
10
11static __inline void outl(unsigned int __val, unsigned short __port)
12{
13 __asm__ volatile ("outl %0,%1" : : "a" (__val), "dN" (__port));
14}
15
16static __inline unsigned char inb(unsigned short __port)
17{
18 unsigned char __val;
19 __asm__ volatile ("inb %1,%0" : "=a" (__val) : "dN" (__port));
20 return __val;
21}
22
23static __inline unsigned short inw(unsigned short __port)
24{
25 unsigned short __val;
26 __asm__ volatile ("inw %1,%0" : "=a" (__val) : "dN" (__port));
27 return __val;
28}
29
30static __inline unsigned int inl(unsigned short __port)
31{
32 unsigned int __val;
33 __asm__ volatile ("inl %1,%0" : "=a" (__val) : "dN" (__port));
34 return __val;
35}
36
37static __inline void outsb(unsigned short __port, const void *__buf, unsigned long __n)
38{
39 __asm__ volatile ("cld; rep; outsb"
40 : "+S" (__buf), "+c" (__n)
41 : "d" (__port));
42}
43
44static __inline void outsw(unsigned short __port, const void *__buf, unsigned long __n)
45{
46 __asm__ volatile ("cld; rep; outsw"
47 : "+S" (__buf), "+c" (__n)
48 : "d" (__port));
49}
50
51static __inline void outsl(unsigned short __port, const void *__buf, unsigned long __n)
52{
53 __asm__ volatile ("cld; rep; outsl"
54 : "+S" (__buf), "+c"(__n)
55 : "d" (__port));
56}
57
58static __inline void insb(unsigned short __port, void *__buf, unsigned long __n)
59{
60 __asm__ volatile ("cld; rep; insb"
61 : "+D" (__buf), "+c" (__n)
62 : "d" (__port));
63}
64
65static __inline void insw(unsigned short __port, void *__buf, unsigned long __n)
66{
67 __asm__ volatile ("cld; rep; insw"
68 : "+D" (__buf), "+c" (__n)
69 : "d" (__port));
70}
71
72static __inline void insl(unsigned short __port, void *__buf, unsigned long __n)
73{
74 __asm__ volatile ("cld; rep; insl"
75 : "+D" (__buf), "+c" (__n)
76 : "d" (__port));
77}
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/ioctl_fix.h deleted-4
...@@ -1,4 +0,0 @@
1#undef SIOCGSTAMP
2#undef SIOCGSTAMPNS
3#define SIOCGSTAMP 0x8906
4#define SIOCGSTAMPNS 0x8907
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/ipc.h deleted-11
...@@ -1,11 +0,0 @@
1struct ipc_perm {
2 key_t __ipc_perm_key;
3 uid_t uid;
4 gid_t gid;
5 uid_t cuid;
6 gid_t cgid;
7 mode_t mode;
8 int __ipc_perm_seq;
9 long long __pad1;
10 long long __pad2;
11};
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/limits.h deleted-1
...@@ -1 +0,0 @@
1#define PAGESIZE 4096
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/mman.h deleted-1
...@@ -1 +0,0 @@
1#define MAP_32BIT 0x40
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/msg.h deleted-15
...@@ -1,15 +0,0 @@
1struct msqid_ds {
2 struct ipc_perm msg_perm;
3 time_t msg_stime;
4 time_t msg_rtime;
5 time_t msg_ctime;
6 unsigned long msg_cbytes;
7 long __unused1;
8 msgqnum_t msg_qnum;
9 long __unused2;
10 msglen_t msg_qbytes;
11 long __unused3;
12 pid_t msg_lspid;
13 pid_t msg_lrpid;
14 unsigned long long __unused[2];
15};
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_ILP32_OFFBIG 1
2#define _POSIX_V7_ILP32_OFFBIG 1
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/ptrace.h deleted-13
...@@ -1,13 +0,0 @@
1#define PTRACE_GET_THREAD_AREA 25
2#define PTRACE_SET_THREAD_AREA 26
3#define PTRACE_ARCH_PRCTL 30
4#define PTRACE_SYSEMU 31
5#define PTRACE_SYSEMU_SINGLESTEP 32
6#define PTRACE_SINGLEBLOCK 33
7
8#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
9#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
10#define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL
11#define PT_SYSEMU PTRACE_SYSEMU
12#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
13#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/reg.h deleted-29
...@@ -1,29 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 32
3#define R15 0
4#define R14 1
5#define R13 2
6#define R12 3
7#define RBP 4
8#define RBX 5
9#define R11 6
10#define R10 7
11#define R9 8
12#define R8 9
13#define RAX 10
14#define RCX 11
15#define RDX 12
16#define RSI 13
17#define RDI 14
18#define ORIG_RAX 15
19#define RIP 16
20#define CS 17
21#define EFLAGS 18
22#define RSP 19
23#define SS 20
24#define FS_BASE 21
25#define GS_BASE 22
26#define DS 23
27#define ES 24
28#define FS 25
29#define GS 26
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/sem.h deleted-11
...@@ -1,11 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 time_t sem_otime;
4 long long __unused1;
5 time_t sem_ctime;
6 long long __unused2;
7 unsigned short sem_nsems;
8 char __sem_nsems_pad[sizeof(long long)-sizeof(short)];
9 long long __unused3;
10 long long __unused4;
11};
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long long __jmp_buf[8];
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/shm.h deleted-32
...@@ -1,32 +0,0 @@
1#define SHMLBA 4096
2
3struct shmid_ds {
4 struct ipc_perm shm_perm;
5 size_t shm_segsz;
6 time_t shm_atime;
7 time_t shm_dtime;
8 time_t shm_ctime;
9 pid_t shm_cpid;
10 pid_t shm_lpid;
11 unsigned long shm_nattch;
12 unsigned long __pad0;
13 unsigned long long __pad1;
14 unsigned long long __pad2;
15};
16
17struct shminfo {
18 unsigned long shmmax, __pad0, shmmin, __pad1, shmmni, __pad2,
19 shmseg, __pad3, shmall, __pad4;
20 unsigned long long __unused[4];
21};
22
23struct shm_info {
24 int __used_ids;
25 int __pad_ids;
26 unsigned long shm_tot, __pad0, shm_rss, __pad1, shm_swp, __pad2;
27 unsigned long __swap_attempts, __pad3, __swap_successes, __pad4;
28}
29#ifdef __GNUC__
30__attribute__((__aligned__(8)))
31#endif
32;
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/signal.h deleted-153
...@@ -1,153 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#ifdef _GNU_SOURCE
10enum { REG_R8 = 0 };
11#define REG_R8 REG_R8
12enum { REG_R9 = 1 };
13#define REG_R9 REG_R9
14enum { REG_R10 = 2 };
15#define REG_R10 REG_R10
16enum { REG_R11 = 3 };
17#define REG_R11 REG_R11
18enum { REG_R12 = 4 };
19#define REG_R12 REG_R12
20enum { REG_R13 = 5 };
21#define REG_R13 REG_R13
22enum { REG_R14 = 6 };
23#define REG_R14 REG_R14
24enum { REG_R15 = 7 };
25#define REG_R15 REG_R15
26enum { REG_RDI = 8 };
27#define REG_RDI REG_RDI
28enum { REG_RSI = 9 };
29#define REG_RSI REG_RSI
30enum { REG_RBP = 10 };
31#define REG_RBP REG_RBP
32enum { REG_RBX = 11 };
33#define REG_RBX REG_RBX
34enum { REG_RDX = 12 };
35#define REG_RDX REG_RDX
36enum { REG_RAX = 13 };
37#define REG_RAX REG_RAX
38enum { REG_RCX = 14 };
39#define REG_RCX REG_RCX
40enum { REG_RSP = 15 };
41#define REG_RSP REG_RSP
42enum { REG_RIP = 16 };
43#define REG_RIP REG_RIP
44enum { REG_EFL = 17 };
45#define REG_EFL REG_EFL
46enum { REG_CSGSFS = 18 };
47#define REG_CSGSFS REG_CSGSFS
48enum { REG_ERR = 19 };
49#define REG_ERR REG_ERR
50enum { REG_TRAPNO = 20 };
51#define REG_TRAPNO REG_TRAPNO
52enum { REG_OLDMASK = 21 };
53#define REG_OLDMASK REG_OLDMASK
54enum { REG_CR2 = 22 };
55#define REG_CR2 REG_CR2
56#endif
57
58#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
59typedef long long greg_t, gregset_t[23];
60typedef struct _fpstate {
61 unsigned short cwd, swd, ftw, fop;
62 unsigned long long rip, rdp;
63 unsigned mxcsr, mxcr_mask;
64 struct {
65 unsigned short significand[4], exponent, padding[3];
66 } _st[8];
67 struct {
68 unsigned element[4];
69 } _xmm[16];
70 unsigned padding[24];
71} *fpregset_t;
72struct sigcontext {
73 unsigned long long r8, r9, r10, r11, r12, r13, r14, r15;
74 unsigned long long rdi, rsi, rbp, rbx, rdx, rax, rcx, rsp, rip, eflags;
75 unsigned short cs, gs, fs, __pad0;
76 unsigned long long err, trapno, oldmask, cr2;
77 struct _fpstate *fpstate;
78 unsigned long long __reserved1[8];
79};
80typedef struct {
81 gregset_t gregs;
82 fpregset_t fpregs;
83 unsigned long long __reserved1[8];
84} mcontext_t;
85#else
86typedef struct {
87 unsigned long long __space[32];
88} mcontext_t;
89#endif
90
91struct sigaltstack {
92 void *ss_sp;
93 int ss_flags;
94 size_t ss_size;
95};
96
97typedef struct __ucontext {
98 unsigned long uc_flags;
99 struct __ucontext *uc_link;
100 stack_t uc_stack;
101 mcontext_t uc_mcontext;
102 sigset_t uc_sigmask;
103 unsigned long long __fpregs_mem[64];
104} ucontext_t;
105
106#define SA_NOCLDSTOP 1
107#define SA_NOCLDWAIT 2
108#define SA_SIGINFO 4
109#define SA_ONSTACK 0x08000000
110#define SA_RESTART 0x10000000
111#define SA_NODEFER 0x40000000
112#define SA_RESETHAND 0x80000000
113#define SA_RESTORER 0x04000000
114
115#endif
116
117#define SIGHUP 1
118#define SIGINT 2
119#define SIGQUIT 3
120#define SIGILL 4
121#define SIGTRAP 5
122#define SIGABRT 6
123#define SIGIOT SIGABRT
124#define SIGBUS 7
125#define SIGFPE 8
126#define SIGKILL 9
127#define SIGUSR1 10
128#define SIGSEGV 11
129#define SIGUSR2 12
130#define SIGPIPE 13
131#define SIGALRM 14
132#define SIGTERM 15
133#define SIGSTKFLT 16
134#define SIGCHLD 17
135#define SIGCONT 18
136#define SIGSTOP 19
137#define SIGTSTP 20
138#define SIGTTIN 21
139#define SIGTTOU 22
140#define SIGURG 23
141#define SIGXCPU 24
142#define SIGXFSZ 25
143#define SIGVTALRM 26
144#define SIGPROF 27
145#define SIGWINCH 28
146#define SIGIO 29
147#define SIGPOLL 29
148#define SIGPWR 30
149#define SIGSYS 31
150#define SIGUNUSED SIGSYS
151
152#define _NSIG 65
153
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/socket.h deleted-5
...@@ -1,5 +0,0 @@
1#define SO_RCVTIMEO 20
2#define SO_SNDTIMEO 21
3#define SO_TIMESTAMP 29
4#define SO_TIMESTAMPNS 35
5#define SO_TIMESTAMPING 37
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/stat.h deleted-22
...@@ -1,22 +0,0 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3
4struct stat {
5 dev_t st_dev;
6 ino_t st_ino;
7 nlink_t st_nlink;
8
9 mode_t st_mode;
10 uid_t st_uid;
11 gid_t st_gid;
12 unsigned int __pad0;
13 dev_t st_rdev;
14 off_t st_size;
15 blksize_t st_blksize;
16 blkcnt_t st_blocks;
17
18 struct timespec st_atim;
19 struct timespec st_mtim;
20 struct timespec st_ctim;
21 long long __unused[3];
22};
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/statfs.h deleted-9
...@@ -1,9 +0,0 @@
1struct statfs {
2 unsigned long f_type, __pad0, f_bsize, __pad1;
3 fsblkcnt_t f_blocks, f_bfree, f_bavail;
4 fsfilcnt_t f_files, f_ffree;
5 fsid_t f_fsid;
6 unsigned long f_namelen, __pad2, f_frsize, __pad3;
7 unsigned long f_flags, __pad4;
8 unsigned long long f_spare[4];
9};
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT32_MIN
16#define INTPTR_MAX INT32_MAX
17#define UINTPTR_MAX UINT32_MAX
18#define PTRDIFF_MIN INT32_MIN
19#define PTRDIFF_MAX INT32_MAX
20#define SIZE_MAX UINT32_MAX
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/syscall.h.in deleted-343
...@@ -1,343 +0,0 @@
1#define __NR_read (0x40000000 + 0)
2#define __NR_write (0x40000000 + 1)
3#define __NR_open (0x40000000 + 2)
4#define __NR_close (0x40000000 + 3)
5#define __NR_stat (0x40000000 + 4)
6#define __NR_fstat (0x40000000 + 5)
7#define __NR_lstat (0x40000000 + 6)
8#define __NR_poll (0x40000000 + 7)
9#define __NR_lseek (0x40000000 + 8)
10#define __NR_mmap (0x40000000 + 9)
11#define __NR_mprotect (0x40000000 + 10)
12#define __NR_munmap (0x40000000 + 11)
13#define __NR_brk (0x40000000 + 12)
14#define __NR_rt_sigprocmask (0x40000000 + 14)
15#define __NR_pread64 (0x40000000 + 17)
16#define __NR_pwrite64 (0x40000000 + 18)
17#define __NR_access (0x40000000 + 21)
18#define __NR_pipe (0x40000000 + 22)
19#define __NR_select (0x40000000 + 23)
20#define __NR_sched_yield (0x40000000 + 24)
21#define __NR_mremap (0x40000000 + 25)
22#define __NR_msync (0x40000000 + 26)
23#define __NR_mincore (0x40000000 + 27)
24#define __NR_madvise (0x40000000 + 28)
25#define __NR_shmget (0x40000000 + 29)
26#define __NR_shmat (0x40000000 + 30)
27#define __NR_shmctl (0x40000000 + 31)
28#define __NR_dup (0x40000000 + 32)
29#define __NR_dup2 (0x40000000 + 33)
30#define __NR_pause (0x40000000 + 34)
31#define __NR_nanosleep (0x40000000 + 35)
32#define __NR_getitimer (0x40000000 + 36)
33#define __NR_alarm (0x40000000 + 37)
34#define __NR_setitimer (0x40000000 + 38)
35#define __NR_getpid (0x40000000 + 39)
36#define __NR_sendfile (0x40000000 + 40)
37#define __NR_socket (0x40000000 + 41)
38#define __NR_connect (0x40000000 + 42)
39#define __NR_accept (0x40000000 + 43)
40#define __NR_sendto (0x40000000 + 44)
41#define __NR_shutdown (0x40000000 + 48)
42#define __NR_bind (0x40000000 + 49)
43#define __NR_listen (0x40000000 + 50)
44#define __NR_getsockname (0x40000000 + 51)
45#define __NR_getpeername (0x40000000 + 52)
46#define __NR_socketpair (0x40000000 + 53)
47#define __NR_clone (0x40000000 + 56)
48#define __NR_fork (0x40000000 + 57)
49#define __NR_vfork (0x40000000 + 58)
50#define __NR_exit (0x40000000 + 60)
51#define __NR_wait4 (0x40000000 + 61)
52#define __NR_kill (0x40000000 + 62)
53#define __NR_uname (0x40000000 + 63)
54#define __NR_semget (0x40000000 + 64)
55#define __NR_semop (0x40000000 + 65)
56#define __NR_semctl (0x40000000 + 66)
57#define __NR_shmdt (0x40000000 + 67)
58#define __NR_msgget (0x40000000 + 68)
59#define __NR_msgsnd (0x40000000 + 69)
60#define __NR_msgrcv (0x40000000 + 70)
61#define __NR_msgctl (0x40000000 + 71)
62#define __NR_fcntl (0x40000000 + 72)
63#define __NR_flock (0x40000000 + 73)
64#define __NR_fsync (0x40000000 + 74)
65#define __NR_fdatasync (0x40000000 + 75)
66#define __NR_truncate (0x40000000 + 76)
67#define __NR_ftruncate (0x40000000 + 77)
68#define __NR_getdents (0x40000000 + 78)
69#define __NR_getcwd (0x40000000 + 79)
70#define __NR_chdir (0x40000000 + 80)
71#define __NR_fchdir (0x40000000 + 81)
72#define __NR_rename (0x40000000 + 82)
73#define __NR_mkdir (0x40000000 + 83)
74#define __NR_rmdir (0x40000000 + 84)
75#define __NR_creat (0x40000000 + 85)
76#define __NR_link (0x40000000 + 86)
77#define __NR_unlink (0x40000000 + 87)
78#define __NR_symlink (0x40000000 + 88)
79#define __NR_readlink (0x40000000 + 89)
80#define __NR_chmod (0x40000000 + 90)
81#define __NR_fchmod (0x40000000 + 91)
82#define __NR_chown (0x40000000 + 92)
83#define __NR_fchown (0x40000000 + 93)
84#define __NR_lchown (0x40000000 + 94)
85#define __NR_umask (0x40000000 + 95)
86#define __NR_gettimeofday (0x40000000 + 96)
87#define __NR_getrlimit (0x40000000 + 97)
88#define __NR_getrusage (0x40000000 + 98)
89#define __NR_sysinfo (0x40000000 + 99)
90#define __NR_times (0x40000000 + 100)
91#define __NR_getuid (0x40000000 + 102)
92#define __NR_syslog (0x40000000 + 103)
93#define __NR_getgid (0x40000000 + 104)
94#define __NR_setuid (0x40000000 + 105)
95#define __NR_setgid (0x40000000 + 106)
96#define __NR_geteuid (0x40000000 + 107)
97#define __NR_getegid (0x40000000 + 108)
98#define __NR_setpgid (0x40000000 + 109)
99#define __NR_getppid (0x40000000 + 110)
100#define __NR_getpgrp (0x40000000 + 111)
101#define __NR_setsid (0x40000000 + 112)
102#define __NR_setreuid (0x40000000 + 113)
103#define __NR_setregid (0x40000000 + 114)
104#define __NR_getgroups (0x40000000 + 115)
105#define __NR_setgroups (0x40000000 + 116)
106#define __NR_setresuid (0x40000000 + 117)
107#define __NR_getresuid (0x40000000 + 118)
108#define __NR_setresgid (0x40000000 + 119)
109#define __NR_getresgid (0x40000000 + 120)
110#define __NR_getpgid (0x40000000 + 121)
111#define __NR_setfsuid (0x40000000 + 122)
112#define __NR_setfsgid (0x40000000 + 123)
113#define __NR_getsid (0x40000000 + 124)
114#define __NR_capget (0x40000000 + 125)
115#define __NR_capset (0x40000000 + 126)
116#define __NR_rt_sigsuspend (0x40000000 + 130)
117#define __NR_utime (0x40000000 + 132)
118#define __NR_mknod (0x40000000 + 133)
119#define __NR_personality (0x40000000 + 135)
120#define __NR_ustat (0x40000000 + 136)
121#define __NR_statfs (0x40000000 + 137)
122#define __NR_fstatfs (0x40000000 + 138)
123#define __NR_sysfs (0x40000000 + 139)
124#define __NR_getpriority (0x40000000 + 140)
125#define __NR_setpriority (0x40000000 + 141)
126#define __NR_sched_setparam (0x40000000 + 142)
127#define __NR_sched_getparam (0x40000000 + 143)
128#define __NR_sched_setscheduler (0x40000000 + 144)
129#define __NR_sched_getscheduler (0x40000000 + 145)
130#define __NR_sched_get_priority_max (0x40000000 + 146)
131#define __NR_sched_get_priority_min (0x40000000 + 147)
132#define __NR_sched_rr_get_interval (0x40000000 + 148)
133#define __NR_mlock (0x40000000 + 149)
134#define __NR_munlock (0x40000000 + 150)
135#define __NR_mlockall (0x40000000 + 151)
136#define __NR_munlockall (0x40000000 + 152)
137#define __NR_vhangup (0x40000000 + 153)
138#define __NR_modify_ldt (0x40000000 + 154)
139#define __NR_pivot_root (0x40000000 + 155)
140#define __NR_prctl (0x40000000 + 157)
141#define __NR_arch_prctl (0x40000000 + 158)
142#define __NR_adjtimex (0x40000000 + 159)
143#define __NR_setrlimit (0x40000000 + 160)
144#define __NR_chroot (0x40000000 + 161)
145#define __NR_sync (0x40000000 + 162)
146#define __NR_acct (0x40000000 + 163)
147#define __NR_settimeofday (0x40000000 + 164)
148#define __NR_mount (0x40000000 + 165)
149#define __NR_umount2 (0x40000000 + 166)
150#define __NR_swapon (0x40000000 + 167)
151#define __NR_swapoff (0x40000000 + 168)
152#define __NR_reboot (0x40000000 + 169)
153#define __NR_sethostname (0x40000000 + 170)
154#define __NR_setdomainname (0x40000000 + 171)
155#define __NR_iopl (0x40000000 + 172)
156#define __NR_ioperm (0x40000000 + 173)
157#define __NR_init_module (0x40000000 + 175)
158#define __NR_delete_module (0x40000000 + 176)
159#define __NR_quotactl (0x40000000 + 179)
160#define __NR_getpmsg (0x40000000 + 181)
161#define __NR_putpmsg (0x40000000 + 182)
162#define __NR_afs_syscall (0x40000000 + 183)
163#define __NR_tuxcall (0x40000000 + 184)
164#define __NR_security (0x40000000 + 185)
165#define __NR_gettid (0x40000000 + 186)
166#define __NR_readahead (0x40000000 + 187)
167#define __NR_setxattr (0x40000000 + 188)
168#define __NR_lsetxattr (0x40000000 + 189)
169#define __NR_fsetxattr (0x40000000 + 190)
170#define __NR_getxattr (0x40000000 + 191)
171#define __NR_lgetxattr (0x40000000 + 192)
172#define __NR_fgetxattr (0x40000000 + 193)
173#define __NR_listxattr (0x40000000 + 194)
174#define __NR_llistxattr (0x40000000 + 195)
175#define __NR_flistxattr (0x40000000 + 196)
176#define __NR_removexattr (0x40000000 + 197)
177#define __NR_lremovexattr (0x40000000 + 198)
178#define __NR_fremovexattr (0x40000000 + 199)
179#define __NR_tkill (0x40000000 + 200)
180#define __NR_time (0x40000000 + 201)
181#define __NR_futex (0x40000000 + 202)
182#define __NR_sched_setaffinity (0x40000000 + 203)
183#define __NR_sched_getaffinity (0x40000000 + 204)
184#define __NR_io_destroy (0x40000000 + 207)
185#define __NR_io_getevents (0x40000000 + 208)
186#define __NR_io_cancel (0x40000000 + 210)
187#define __NR_lookup_dcookie (0x40000000 + 212)
188#define __NR_epoll_create (0x40000000 + 213)
189#define __NR_remap_file_pages (0x40000000 + 216)
190#define __NR_getdents64 (0x40000000 + 217)
191#define __NR_set_tid_address (0x40000000 + 218)
192#define __NR_restart_syscall (0x40000000 + 219)
193#define __NR_semtimedop (0x40000000 + 220)
194#define __NR_fadvise64 (0x40000000 + 221)
195#define __NR_timer_settime (0x40000000 + 223)
196#define __NR_timer_gettime (0x40000000 + 224)
197#define __NR_timer_getoverrun (0x40000000 + 225)
198#define __NR_timer_delete (0x40000000 + 226)
199#define __NR_clock_settime (0x40000000 + 227)
200#define __NR_clock_gettime (0x40000000 + 228)
201#define __NR_clock_getres (0x40000000 + 229)
202#define __NR_clock_nanosleep (0x40000000 + 230)
203#define __NR_exit_group (0x40000000 + 231)
204#define __NR_epoll_wait (0x40000000 + 232)
205#define __NR_epoll_ctl (0x40000000 + 233)
206#define __NR_tgkill (0x40000000 + 234)
207#define __NR_utimes (0x40000000 + 235)
208#define __NR_mbind (0x40000000 + 237)
209#define __NR_set_mempolicy (0x40000000 + 238)
210#define __NR_get_mempolicy (0x40000000 + 239)
211#define __NR_mq_open (0x40000000 + 240)
212#define __NR_mq_unlink (0x40000000 + 241)
213#define __NR_mq_timedsend (0x40000000 + 242)
214#define __NR_mq_timedreceive (0x40000000 + 243)
215#define __NR_mq_getsetattr (0x40000000 + 245)
216#define __NR_add_key (0x40000000 + 248)
217#define __NR_request_key (0x40000000 + 249)
218#define __NR_keyctl (0x40000000 + 250)
219#define __NR_ioprio_set (0x40000000 + 251)
220#define __NR_ioprio_get (0x40000000 + 252)
221#define __NR_inotify_init (0x40000000 + 253)
222#define __NR_inotify_add_watch (0x40000000 + 254)
223#define __NR_inotify_rm_watch (0x40000000 + 255)
224#define __NR_migrate_pages (0x40000000 + 256)
225#define __NR_openat (0x40000000 + 257)
226#define __NR_mkdirat (0x40000000 + 258)
227#define __NR_mknodat (0x40000000 + 259)
228#define __NR_fchownat (0x40000000 + 260)
229#define __NR_futimesat (0x40000000 + 261)
230#define __NR_newfstatat (0x40000000 + 262)
231#define __NR_unlinkat (0x40000000 + 263)
232#define __NR_renameat (0x40000000 + 264)
233#define __NR_linkat (0x40000000 + 265)
234#define __NR_symlinkat (0x40000000 + 266)
235#define __NR_readlinkat (0x40000000 + 267)
236#define __NR_fchmodat (0x40000000 + 268)
237#define __NR_faccessat (0x40000000 + 269)
238#define __NR_pselect6 (0x40000000 + 270)
239#define __NR_ppoll (0x40000000 + 271)
240#define __NR_unshare (0x40000000 + 272)
241#define __NR_splice (0x40000000 + 275)
242#define __NR_tee (0x40000000 + 276)
243#define __NR_sync_file_range (0x40000000 + 277)
244#define __NR_utimensat (0x40000000 + 280)
245#define __NR_epoll_pwait (0x40000000 + 281)
246#define __NR_signalfd (0x40000000 + 282)
247#define __NR_timerfd_create (0x40000000 + 283)
248#define __NR_eventfd (0x40000000 + 284)
249#define __NR_fallocate (0x40000000 + 285)
250#define __NR_timerfd_settime (0x40000000 + 286)
251#define __NR_timerfd_gettime (0x40000000 + 287)
252#define __NR_accept4 (0x40000000 + 288)
253#define __NR_signalfd4 (0x40000000 + 289)
254#define __NR_eventfd2 (0x40000000 + 290)
255#define __NR_epoll_create1 (0x40000000 + 291)
256#define __NR_dup3 (0x40000000 + 292)
257#define __NR_pipe2 (0x40000000 + 293)
258#define __NR_inotify_init1 (0x40000000 + 294)
259#define __NR_perf_event_open (0x40000000 + 298)
260#define __NR_fanotify_init (0x40000000 + 300)
261#define __NR_fanotify_mark (0x40000000 + 301)
262#define __NR_prlimit64 (0x40000000 + 302)
263#define __NR_name_to_handle_at (0x40000000 + 303)
264#define __NR_open_by_handle_at (0x40000000 + 304)
265#define __NR_clock_adjtime (0x40000000 + 305)
266#define __NR_syncfs (0x40000000 + 306)
267#define __NR_setns (0x40000000 + 308)
268#define __NR_getcpu (0x40000000 + 309)
269#define __NR_kcmp (0x40000000 + 312)
270#define __NR_finit_module (0x40000000 + 313)
271#define __NR_sched_setattr (0x40000000 + 314)
272#define __NR_sched_getattr (0x40000000 + 315)
273#define __NR_renameat2 (0x40000000 + 316)
274#define __NR_seccomp (0x40000000 + 317)
275#define __NR_getrandom (0x40000000 + 318)
276#define __NR_memfd_create (0x40000000 + 319)
277#define __NR_kexec_file_load (0x40000000 + 320)
278#define __NR_bpf (0x40000000 + 321)
279#define __NR_userfaultfd (0x40000000 + 323)
280#define __NR_membarrier (0x40000000 + 324)
281#define __NR_mlock2 (0x40000000 + 325)
282#define __NR_copy_file_range (0x40000000 + 326)
283#define __NR_pkey_mprotect (0x40000000 + 329)
284#define __NR_pkey_alloc (0x40000000 + 330)
285#define __NR_pkey_free (0x40000000 + 331)
286#define __NR_statx (0x40000000 + 332)
287#define __NR_io_pgetevents (0x40000000 + 333)
288#define __NR_rseq (0x40000000 + 334)
289#define __NR_pidfd_send_signal (0x40000000 + 424)
290#define __NR_io_uring_setup (0x40000000 + 425)
291#define __NR_io_uring_enter (0x40000000 + 426)
292#define __NR_io_uring_register (0x40000000 + 427)
293#define __NR_open_tree (0x40000000 + 428)
294#define __NR_move_mount (0x40000000 + 429)
295#define __NR_fsopen (0x40000000 + 430)
296#define __NR_fsconfig (0x40000000 + 431)
297#define __NR_fsmount (0x40000000 + 432)
298#define __NR_fspick (0x40000000 + 433)
299#define __NR_pidfd_open (0x40000000 + 434)
300#define __NR_clone3 (0x40000000 + 435)
301#define __NR_close_range (0x40000000 + 436)
302#define __NR_openat2 (0x40000000 + 437)
303#define __NR_pidfd_getfd (0x40000000 + 438)
304#define __NR_faccessat2 (0x40000000 + 439)
305
306
307#define __NR_rt_sigaction (0x40000000 + 512)
308#define __NR_rt_sigreturn (0x40000000 + 513)
309#define __NR_ioctl (0x40000000 + 514)
310#define __NR_readv (0x40000000 + 515)
311#define __NR_writev (0x40000000 + 516)
312#define __NR_recvfrom (0x40000000 + 517)
313#define __NR_sendmsg (0x40000000 + 518)
314#define __NR_recvmsg (0x40000000 + 519)
315#define __NR_execve (0x40000000 + 520)
316#define __NR_ptrace (0x40000000 + 521)
317#define __NR_rt_sigpending (0x40000000 + 522)
318#define __NR_rt_sigtimedwait (0x40000000 + 523)
319#define __NR_rt_sigqueueinfo (0x40000000 + 524)
320#define __NR_sigaltstack (0x40000000 + 525)
321#define __NR_timer_create (0x40000000 + 526)
322#define __NR_mq_notify (0x40000000 + 527)
323#define __NR_kexec_load (0x40000000 + 528)
324#define __NR_waitid (0x40000000 + 529)
325#define __NR_set_robust_list (0x40000000 + 530)
326#define __NR_get_robust_list (0x40000000 + 531)
327#define __NR_vmsplice (0x40000000 + 532)
328#define __NR_move_pages (0x40000000 + 533)
329#define __NR_preadv (0x40000000 + 534)
330#define __NR_pwritev (0x40000000 + 535)
331#define __NR_rt_tgsigqueueinfo (0x40000000 + 536)
332#define __NR_recvmmsg (0x40000000 + 537)
333#define __NR_sendmmsg (0x40000000 + 538)
334#define __NR_process_vm_readv (0x40000000 + 539)
335#define __NR_process_vm_writev (0x40000000 + 540)
336#define __NR_setsockopt (0x40000000 + 541)
337#define __NR_getsockopt (0x40000000 + 542)
338#define __NR_io_setup (0x40000000 + 543)
339#define __NR_io_submit (0x40000000 + 544)
340#define __NR_execveat (0x40000000 + 545)
341#define __NR_preadv2 (0x40000000 + 546)
342#define __NR_pwritev2 (0x40000000 + 547)
343
lib/libc/wasi/libc-top-half/musl/arch/x32/bits/user.h deleted-41
...@@ -1,41 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
3
4typedef struct user_fpregs_struct {
5 uint16_t cwd, swd, ftw, fop;
6 uint64_t rip, rdp;
7 uint32_t mxcsr, mxcr_mask;
8 uint32_t st_space[32], xmm_space[64], padding[24];
9} elf_fpregset_t;
10
11struct user_regs_struct {
12 unsigned long r15, r14, r13, r12, rbp, rbx, r11, r10, r9, r8;
13 unsigned long rax, rcx, rdx, rsi, rdi, orig_rax, rip;
14 unsigned long cs, eflags, rsp, ss, fs_base, gs_base, ds, es, fs, gs;
15};
16#define ELF_NGREG 27
17typedef unsigned long long elf_greg_t, elf_gregset_t[ELF_NGREG];
18
19struct user {
20 struct user_regs_struct regs;
21 int u_fpvalid;
22 struct user_fpregs_struct i387;
23 unsigned long u_tsize;
24 unsigned long u_dsize;
25 unsigned long u_ssize;
26 unsigned long start_code;
27 unsigned long start_stack;
28 long signal;
29 int reserved;
30 struct user_regs_struct *u_ar0;
31 struct user_fpregs_struct *u_fpstate;
32 unsigned long magic;
33 char u_comm[32];
34 unsigned long u_debugreg[8];
35};
36
37#define PAGE_MASK (~(PAGESIZE-1))
38#define NBPG PAGESIZE
39#define UPAGES 1
40#define HOST_TEXT_START_ADDR (u.start_code)
41#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
lib/libc/wasi/libc-top-half/musl/arch/x32/crt_arch.h deleted-12
...@@ -1,12 +0,0 @@
1__asm__(
2".text \n"
3".global " START " \n"
4START ": \n"
5" xor %rbp,%rbp \n"
6" mov %rsp,%rdi \n"
7".weak _DYNAMIC \n"
8".hidden _DYNAMIC \n"
9" lea _DYNAMIC(%rip),%rsi \n"
10" andq $-16,%rsp \n"
11" call " START "_c \n"
12);
lib/libc/wasi/libc-top-half/musl/arch/x32/ksigaction.h deleted-11
...@@ -1,11 +0,0 @@
1#include <features.h>
2
3struct k_sigaction {
4 void (*handler)(int);
5 unsigned long flags;
6 void (*restorer)(void);
7 unsigned mask[2];
8};
9
10hidden void __restore_rt();
11#define __restore __restore_rt
lib/libc/wasi/libc-top-half/musl/arch/x32/kstat.h deleted-22
...@@ -1,22 +0,0 @@
1struct kstat {
2 dev_t st_dev;
3 ino_t st_ino;
4 nlink_t st_nlink;
5
6 mode_t st_mode;
7 uid_t st_uid;
8 gid_t st_gid;
9 unsigned int __pad0;
10 dev_t st_rdev;
11 off_t st_size;
12 blksize_t st_blksize;
13 blkcnt_t st_blocks;
14
15 long long st_atime_sec;
16 long st_atime_nsec;
17 long long st_mtime_sec;
18 long st_mtime_nsec;
19 long long st_ctime_sec;
20 long st_ctime_nsec;
21 long long __unused[3];
22};
lib/libc/wasi/libc-top-half/musl/arch/x32/pthread_arch.h deleted-12
...@@ -1,12 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3 uintptr_t tp;
4 __asm__ ("mov %%fs:0,%0" : "=r" (tp) );
5 return tp;
6}
7
8#define MC_PC gregs[REG_RIP]
9
10#define CANARY_PAD
11
12#define tls_mod_off_t unsigned long long
lib/libc/wasi/libc-top-half/musl/arch/x32/reloc.h deleted-31
...@@ -1,31 +0,0 @@
1#define LDSO_ARCH "x32"
2
3/* FIXME: x32 is very strange in its use of 64-bit relocation types in
4 * a 32-bit environment. As long as the memory at reloc_addr is
5 * zero-filled prior to relocations, just treating 64-bit relocations
6 * as operating on 32-bit slots should be fine, but this should be
7 * checked. In particular, R_X86_64_64, R_X86_64_DTPOFF64, and
8 * R_X86_64_TPOFF64 may need checking. */
9
10/* The R_X86_64_64, R_X86_64_DTPOFF32, and R_X86_64_TPOFF32 reloc types
11 * were previously mapped in the switch table form of this file; however,
12 * they do not seem to be used/usable for anything. If needed, new
13 * mappings will have to be added. */
14
15#define REL_SYMBOLIC R_X86_64_32
16#define REL_OFFSET R_X86_64_PC32
17#define REL_GOT R_X86_64_GLOB_DAT
18#define REL_PLT R_X86_64_JUMP_SLOT
19#define REL_RELATIVE R_X86_64_RELATIVE
20#define REL_COPY R_X86_64_COPY
21#define REL_DTPMOD R_X86_64_DTPMOD64
22#define REL_DTPOFF R_X86_64_DTPOFF64
23#define REL_TPOFF R_X86_64_TPOFF64
24
25#define CRTJMP(pc,sp) __asm__ __volatile__( \
26 "mov %1,%%esp ; jmp *%0" : : "r"((uint64_t)(uintptr_t)pc), "r"(sp) : "memory" )
27
28#define GETFUNCSYM(fp, sym, got) __asm__ ( \
29 ".hidden " #sym "\n" \
30 " lea " #sym "(%%rip),%0\n" \
31 : "=r"(*fp) : : "memory" )
lib/libc/wasi/libc-top-half/musl/arch/x32/syscall_arch.h deleted-93
...@@ -1,93 +0,0 @@
1#define __SYSCALL_LL_E(x) (x)
2#define __SYSCALL_LL_O(x) (x)
3
4#define __scc(X) sizeof(1?(X):0ULL) < 8 ? (unsigned long) (X) : (long long) (X)
5typedef long long syscall_arg_t;
6
7static __inline long __syscall0(long long n)
8{
9 unsigned long ret;
10 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n) : "rcx", "r11", "memory");
11 return ret;
12}
13
14static __inline long __syscall1(long long n, long long a1)
15{
16 unsigned long ret;
17 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1) : "rcx", "r11", "memory");
18 return ret;
19}
20
21static __inline long __syscall2(long long n, long long a1, long long a2)
22{
23 unsigned long ret;
24 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2)
25 : "rcx", "r11", "memory");
26 return ret;
27}
28
29static __inline long __syscall3(long long n, long long a1, long long a2, long long a3)
30{
31 unsigned long ret;
32 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
33 "d"(a3) : "rcx", "r11", "memory");
34 return ret;
35}
36
37static __inline long __syscall4(long long n, long long a1, long long a2, long long a3,
38 long long a4_)
39{
40 unsigned long ret;
41 register long long a4 __asm__("r10") = a4_;
42 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
43 "d"(a3), "r"(a4): "rcx", "r11", "memory");
44 return ret;
45}
46
47static __inline long __syscall5(long long n, long long a1, long long a2, long long a3,
48 long long a4_, long long a5_)
49{
50 unsigned long ret;
51 register long long a4 __asm__("r10") = a4_;
52 register long long a5 __asm__("r8") = a5_;
53 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
54 "d"(a3), "r"(a4), "r"(a5) : "rcx", "r11", "memory");
55 return ret;
56}
57
58static __inline long __syscall6(long long n, long long a1, long long a2, long long a3,
59 long long a4_, long long a5_, long long a6_)
60{
61 unsigned long ret;
62 register long long a4 __asm__("r10") = a4_;
63 register long long a5 __asm__("r8") = a5_;
64 register long long a6 __asm__("r9") = a6_;
65 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
66 "d"(a3), "r"(a4), "r"(a5), "r"(a6) : "rcx", "r11", "memory");
67 return ret;
68}
69
70#undef SYS_futimesat
71
72#define SYS_clock_gettime64 SYS_clock_gettime
73#define SYS_clock_settime64 SYS_clock_settime
74#define SYS_clock_adjtime64 SYS_clock_adjtime
75#define SYS_clock_nanosleep_time64 SYS_clock_nanosleep
76#define SYS_timer_gettime64 SYS_timer_gettime
77#define SYS_timer_settime64 SYS_timer_settime
78#define SYS_timerfd_gettime64 SYS_timerfd_gettime
79#define SYS_timerfd_settime64 SYS_timerfd_settime
80#define SYS_utimensat_time64 SYS_utimensat
81#define SYS_pselect6_time64 SYS_pselect6
82#define SYS_ppoll_time64 SYS_ppoll
83#define SYS_recvmmsg_time64 SYS_recvmmsg
84#define SYS_mq_timedsend_time64 SYS_mq_timedsend
85#define SYS_mq_timedreceive_time64 SYS_mq_timedreceive
86#define SYS_semtimedop_time64 SYS_semtimedop
87#define SYS_rt_sigtimedwait_time64 SYS_rt_sigtimedwait
88#define SYS_futex_time64 SYS_futex
89#define SYS_sched_rr_get_interval_time64 SYS_sched_rr_get_interval
90#define SYS_getrusage_time64 SYS_getrusage
91#define SYS_wait4_time64 SYS_wait4
92
93#define IPC_64 0
lib/libc/wasi/libc-top-half/musl/arch/x86_64/atomic_arch.h deleted-123
...@@ -1,123 +0,0 @@
1#define a_cas a_cas
2static inline int a_cas(volatile int *p, int t, int s)
3{
4 __asm__ __volatile__ (
5 "lock ; cmpxchg %3, %1"
6 : "=a"(t), "=m"(*p) : "a"(t), "r"(s) : "memory" );
7 return t;
8}
9
10#define a_cas_p a_cas_p
11static inline void *a_cas_p(volatile void *p, void *t, void *s)
12{
13 __asm__( "lock ; cmpxchg %3, %1"
14 : "=a"(t), "=m"(*(void *volatile *)p)
15 : "a"(t), "r"(s) : "memory" );
16 return t;
17}
18
19#define a_swap a_swap
20static inline int a_swap(volatile int *p, int v)
21{
22 __asm__ __volatile__(
23 "xchg %0, %1"
24 : "=r"(v), "=m"(*p) : "0"(v) : "memory" );
25 return v;
26}
27
28#define a_fetch_add a_fetch_add
29static inline int a_fetch_add(volatile int *p, int v)
30{
31 __asm__ __volatile__(
32 "lock ; xadd %0, %1"
33 : "=r"(v), "=m"(*p) : "0"(v) : "memory" );
34 return v;
35}
36
37#define a_and a_and
38static inline void a_and(volatile int *p, int v)
39{
40 __asm__ __volatile__(
41 "lock ; and %1, %0"
42 : "=m"(*p) : "r"(v) : "memory" );
43}
44
45#define a_or a_or
46static inline void a_or(volatile int *p, int v)
47{
48 __asm__ __volatile__(
49 "lock ; or %1, %0"
50 : "=m"(*p) : "r"(v) : "memory" );
51}
52
53#define a_and_64 a_and_64
54static inline void a_and_64(volatile uint64_t *p, uint64_t v)
55{
56 __asm__ __volatile(
57 "lock ; and %1, %0"
58 : "=m"(*p) : "r"(v) : "memory" );
59}
60
61#define a_or_64 a_or_64
62static inline void a_or_64(volatile uint64_t *p, uint64_t v)
63{
64 __asm__ __volatile__(
65 "lock ; or %1, %0"
66 : "=m"(*p) : "r"(v) : "memory" );
67}
68
69#define a_inc a_inc
70static inline void a_inc(volatile int *p)
71{
72 __asm__ __volatile__(
73 "lock ; incl %0"
74 : "=m"(*p) : "m"(*p) : "memory" );
75}
76
77#define a_dec a_dec
78static inline void a_dec(volatile int *p)
79{
80 __asm__ __volatile__(
81 "lock ; decl %0"
82 : "=m"(*p) : "m"(*p) : "memory" );
83}
84
85#define a_store a_store
86static inline void a_store(volatile int *p, int x)
87{
88 __asm__ __volatile__(
89 "mov %1, %0 ; lock ; orl $0,(%%rsp)"
90 : "=m"(*p) : "r"(x) : "memory" );
91}
92
93#define a_barrier a_barrier
94static inline void a_barrier()
95{
96 __asm__ __volatile__( "" : : : "memory" );
97}
98
99#define a_spin a_spin
100static inline void a_spin()
101{
102 __asm__ __volatile__( "pause" : : : "memory" );
103}
104
105#define a_crash a_crash
106static inline void a_crash()
107{
108 __asm__ __volatile__( "hlt" : : : "memory" );
109}
110
111#define a_ctz_64 a_ctz_64
112static inline int a_ctz_64(uint64_t x)
113{
114 __asm__( "bsf %1,%0" : "=r"(x) : "r"(x) );
115 return x;
116}
117
118#define a_clz_64 a_clz_64
119static inline int a_clz_64(uint64_t x)
120{
121 __asm__( "bsr %1,%0 ; xor $63,%0" : "=r"(x) : "r"(x) );
122 return x;
123}
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/alltypes.h.in deleted-20
...@@ -1,20 +0,0 @@
1#define _Addr long
2#define _Int64 long
3#define _Reg long
4
5#define __BYTE_ORDER 1234
6#define __LONG_MAX 0x7fffffffffffffffL
7
8#ifndef __cplusplus
9TYPEDEF int wchar_t;
10#endif
11
12#if defined(__FLT_EVAL_METHOD__) && __FLT_EVAL_METHOD__ == 2
13TYPEDEF long double float_t;
14TYPEDEF long double double_t;
15#else
16TYPEDEF float float_t;
17TYPEDEF double double_t;
18#endif
19
20TYPEDEF struct { long long __ll; long double __ld; } max_align_t;
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/fenv.h deleted-34
...@@ -1,34 +0,0 @@
1#define FE_INVALID 1
2#define __FE_DENORM 2
3#define FE_DIVBYZERO 4
4#define FE_OVERFLOW 8
5#define FE_UNDERFLOW 16
6#define FE_INEXACT 32
7
8#define FE_ALL_EXCEPT 63
9
10#define FE_TONEAREST 0
11#define FE_DOWNWARD 0x400
12#define FE_UPWARD 0x800
13#define FE_TOWARDZERO 0xc00
14
15typedef unsigned short fexcept_t;
16
17typedef struct {
18 unsigned short __control_word;
19 unsigned short __unused1;
20 unsigned short __status_word;
21 unsigned short __unused2;
22 unsigned short __tags;
23 unsigned short __unused3;
24 unsigned int __eip;
25 unsigned short __cs_selector;
26 unsigned int __opcode:11;
27 unsigned int __unused4:5;
28 unsigned int __data_offset;
29 unsigned short __data_selector;
30 unsigned short __unused5;
31 unsigned int __mxcsr;
32} fenv_t;
33
34#define FE_DFL_ENV ((const fenv_t *) -1)
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/float.h deleted-20
...@@ -1,20 +0,0 @@
1#ifdef __FLT_EVAL_METHOD__
2#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
3#else
4#define FLT_EVAL_METHOD 0
5#endif
6
7#define LDBL_TRUE_MIN 3.6451995318824746025e-4951L
8#define LDBL_MIN 3.3621031431120935063e-4932L
9#define LDBL_MAX 1.1897314953572317650e+4932L
10#define LDBL_EPSILON 1.0842021724855044340e-19L
11
12#define LDBL_MANT_DIG 64
13#define LDBL_MIN_EXP (-16381)
14#define LDBL_MAX_EXP 16384
15
16#define LDBL_DIG 18
17#define LDBL_MIN_10_EXP (-4931)
18#define LDBL_MAX_10_EXP 4932
19
20#define DECIMAL_DIG 21
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/io.h deleted-77
...@@ -1,77 +0,0 @@
1static __inline void outb(unsigned char __val, unsigned short __port)
2{
3 __asm__ volatile ("outb %0,%1" : : "a" (__val), "dN" (__port));
4}
5
6static __inline void outw(unsigned short __val, unsigned short __port)
7{
8 __asm__ volatile ("outw %0,%1" : : "a" (__val), "dN" (__port));
9}
10
11static __inline void outl(unsigned int __val, unsigned short __port)
12{
13 __asm__ volatile ("outl %0,%1" : : "a" (__val), "dN" (__port));
14}
15
16static __inline unsigned char inb(unsigned short __port)
17{
18 unsigned char __val;
19 __asm__ volatile ("inb %1,%0" : "=a" (__val) : "dN" (__port));
20 return __val;
21}
22
23static __inline unsigned short inw(unsigned short __port)
24{
25 unsigned short __val;
26 __asm__ volatile ("inw %1,%0" : "=a" (__val) : "dN" (__port));
27 return __val;
28}
29
30static __inline unsigned int inl(unsigned short __port)
31{
32 unsigned int __val;
33 __asm__ volatile ("inl %1,%0" : "=a" (__val) : "dN" (__port));
34 return __val;
35}
36
37static __inline void outsb(unsigned short __port, const void *__buf, unsigned long __n)
38{
39 __asm__ volatile ("cld; rep; outsb"
40 : "+S" (__buf), "+c" (__n)
41 : "d" (__port));
42}
43
44static __inline void outsw(unsigned short __port, const void *__buf, unsigned long __n)
45{
46 __asm__ volatile ("cld; rep; outsw"
47 : "+S" (__buf), "+c" (__n)
48 : "d" (__port));
49}
50
51static __inline void outsl(unsigned short __port, const void *__buf, unsigned long __n)
52{
53 __asm__ volatile ("cld; rep; outsl"
54 : "+S" (__buf), "+c"(__n)
55 : "d" (__port));
56}
57
58static __inline void insb(unsigned short __port, void *__buf, unsigned long __n)
59{
60 __asm__ volatile ("cld; rep; insb"
61 : "+D" (__buf), "+c" (__n)
62 : "d" (__port));
63}
64
65static __inline void insw(unsigned short __port, void *__buf, unsigned long __n)
66{
67 __asm__ volatile ("cld; rep; insw"
68 : "+D" (__buf), "+c" (__n)
69 : "d" (__port));
70}
71
72static __inline void insl(unsigned short __port, void *__buf, unsigned long __n)
73{
74 __asm__ volatile ("cld; rep; insl"
75 : "+D" (__buf), "+c" (__n)
76 : "d" (__port));
77}
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/limits.h deleted-1
...@@ -1 +0,0 @@
1#define PAGESIZE 4096
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/mman.h deleted-1
...@@ -1 +0,0 @@
1#define MAP_32BIT 0x40
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/posix.h deleted-2
...@@ -1,2 +0,0 @@
1#define _POSIX_V6_LP64_OFF64 1
2#define _POSIX_V7_LP64_OFF64 1
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/ptrace.h deleted-13
...@@ -1,13 +0,0 @@
1#define PTRACE_GET_THREAD_AREA 25
2#define PTRACE_SET_THREAD_AREA 26
3#define PTRACE_ARCH_PRCTL 30
4#define PTRACE_SYSEMU 31
5#define PTRACE_SYSEMU_SINGLESTEP 32
6#define PTRACE_SINGLEBLOCK 33
7
8#define PT_GET_THREAD_AREA PTRACE_GET_THREAD_AREA
9#define PT_SET_THREAD_AREA PTRACE_SET_THREAD_AREA
10#define PT_ARCH_PRCTL PTRACE_ARCH_PRCTL
11#define PT_SYSEMU PTRACE_SYSEMU
12#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP
13#define PT_STEPBLOCK PTRACE_SINGLEBLOCK
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/reg.h deleted-29
...@@ -1,29 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
3#define R15 0
4#define R14 1
5#define R13 2
6#define R12 3
7#define RBP 4
8#define RBX 5
9#define R11 6
10#define R10 7
11#define R9 8
12#define R8 9
13#define RAX 10
14#define RCX 11
15#define RDX 12
16#define RSI 13
17#define RDI 14
18#define ORIG_RAX 15
19#define RIP 16
20#define CS 17
21#define EFLAGS 18
22#define RSP 19
23#define SS 20
24#define FS_BASE 21
25#define GS_BASE 22
26#define DS 23
27#define ES 24
28#define FS 25
29#define GS 26
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/sem.h deleted-11
...@@ -1,11 +0,0 @@
1struct semid_ds {
2 struct ipc_perm sem_perm;
3 time_t sem_otime;
4 long __unused1;
5 time_t sem_ctime;
6 long __unused2;
7 unsigned short sem_nsems;
8 char __sem_nsems_pad[sizeof(long)-sizeof(short)];
9 long __unused3;
10 long __unused4;
11};
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/setjmp.h deleted-1
...@@ -1 +0,0 @@
1typedef unsigned long __jmp_buf[8];
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/signal.h deleted-153
...@@ -1,153 +0,0 @@
1#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
2 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
3
4#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
5#define MINSIGSTKSZ 2048
6#define SIGSTKSZ 8192
7#endif
8
9#ifdef _GNU_SOURCE
10enum { REG_R8 = 0 };
11#define REG_R8 REG_R8
12enum { REG_R9 = 1 };
13#define REG_R9 REG_R9
14enum { REG_R10 = 2 };
15#define REG_R10 REG_R10
16enum { REG_R11 = 3 };
17#define REG_R11 REG_R11
18enum { REG_R12 = 4 };
19#define REG_R12 REG_R12
20enum { REG_R13 = 5 };
21#define REG_R13 REG_R13
22enum { REG_R14 = 6 };
23#define REG_R14 REG_R14
24enum { REG_R15 = 7 };
25#define REG_R15 REG_R15
26enum { REG_RDI = 8 };
27#define REG_RDI REG_RDI
28enum { REG_RSI = 9 };
29#define REG_RSI REG_RSI
30enum { REG_RBP = 10 };
31#define REG_RBP REG_RBP
32enum { REG_RBX = 11 };
33#define REG_RBX REG_RBX
34enum { REG_RDX = 12 };
35#define REG_RDX REG_RDX
36enum { REG_RAX = 13 };
37#define REG_RAX REG_RAX
38enum { REG_RCX = 14 };
39#define REG_RCX REG_RCX
40enum { REG_RSP = 15 };
41#define REG_RSP REG_RSP
42enum { REG_RIP = 16 };
43#define REG_RIP REG_RIP
44enum { REG_EFL = 17 };
45#define REG_EFL REG_EFL
46enum { REG_CSGSFS = 18 };
47#define REG_CSGSFS REG_CSGSFS
48enum { REG_ERR = 19 };
49#define REG_ERR REG_ERR
50enum { REG_TRAPNO = 20 };
51#define REG_TRAPNO REG_TRAPNO
52enum { REG_OLDMASK = 21 };
53#define REG_OLDMASK REG_OLDMASK
54enum { REG_CR2 = 22 };
55#define REG_CR2 REG_CR2
56#endif
57
58#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
59typedef long long greg_t, gregset_t[23];
60typedef struct _fpstate {
61 unsigned short cwd, swd, ftw, fop;
62 unsigned long long rip, rdp;
63 unsigned mxcsr, mxcr_mask;
64 struct {
65 unsigned short significand[4], exponent, padding[3];
66 } _st[8];
67 struct {
68 unsigned element[4];
69 } _xmm[16];
70 unsigned padding[24];
71} *fpregset_t;
72struct sigcontext {
73 unsigned long r8, r9, r10, r11, r12, r13, r14, r15;
74 unsigned long rdi, rsi, rbp, rbx, rdx, rax, rcx, rsp, rip, eflags;
75 unsigned short cs, gs, fs, __pad0;
76 unsigned long err, trapno, oldmask, cr2;
77 struct _fpstate *fpstate;
78 unsigned long __reserved1[8];
79};
80typedef struct {
81 gregset_t gregs;
82 fpregset_t fpregs;
83 unsigned long long __reserved1[8];
84} mcontext_t;
85#else
86typedef struct {
87 unsigned long __space[32];
88} mcontext_t;
89#endif
90
91struct sigaltstack {
92 void *ss_sp;
93 int ss_flags;
94 size_t ss_size;
95};
96
97typedef struct __ucontext {
98 unsigned long uc_flags;
99 struct __ucontext *uc_link;
100 stack_t uc_stack;
101 mcontext_t uc_mcontext;
102 sigset_t uc_sigmask;
103 unsigned long __fpregs_mem[64];
104} ucontext_t;
105
106#define SA_NOCLDSTOP 1
107#define SA_NOCLDWAIT 2
108#define SA_SIGINFO 4
109#define SA_ONSTACK 0x08000000
110#define SA_RESTART 0x10000000
111#define SA_NODEFER 0x40000000
112#define SA_RESETHAND 0x80000000
113#define SA_RESTORER 0x04000000
114
115#endif
116
117#define SIGHUP 1
118#define SIGINT 2
119#define SIGQUIT 3
120#define SIGILL 4
121#define SIGTRAP 5
122#define SIGABRT 6
123#define SIGIOT SIGABRT
124#define SIGBUS 7
125#define SIGFPE 8
126#define SIGKILL 9
127#define SIGUSR1 10
128#define SIGSEGV 11
129#define SIGUSR2 12
130#define SIGPIPE 13
131#define SIGALRM 14
132#define SIGTERM 15
133#define SIGSTKFLT 16
134#define SIGCHLD 17
135#define SIGCONT 18
136#define SIGSTOP 19
137#define SIGTSTP 20
138#define SIGTTIN 21
139#define SIGTTOU 22
140#define SIGURG 23
141#define SIGXCPU 24
142#define SIGXFSZ 25
143#define SIGVTALRM 26
144#define SIGPROF 27
145#define SIGWINCH 28
146#define SIGIO 29
147#define SIGPOLL 29
148#define SIGPWR 30
149#define SIGSYS 31
150#define SIGUNUSED SIGSYS
151
152#define _NSIG 65
153
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/stat.h deleted-22
...@@ -1,22 +0,0 @@
1/* copied from kernel definition, but with padding replaced
2 * by the corresponding correctly-sized userspace types. */
3
4struct stat {
5 dev_t st_dev;
6 ino_t st_ino;
7 nlink_t st_nlink;
8
9 mode_t st_mode;
10 uid_t st_uid;
11 gid_t st_gid;
12 unsigned int __pad0;
13 dev_t st_rdev;
14 off_t st_size;
15 blksize_t st_blksize;
16 blkcnt_t st_blocks;
17
18 struct timespec st_atim;
19 struct timespec st_mtim;
20 struct timespec st_ctim;
21 long __unused[3];
22};
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/stdint.h deleted-20
...@@ -1,20 +0,0 @@
1typedef int32_t int_fast16_t;
2typedef int32_t int_fast32_t;
3typedef uint32_t uint_fast16_t;
4typedef uint32_t uint_fast32_t;
5
6#define INT_FAST16_MIN INT32_MIN
7#define INT_FAST32_MIN INT32_MIN
8
9#define INT_FAST16_MAX INT32_MAX
10#define INT_FAST32_MAX INT32_MAX
11
12#define UINT_FAST16_MAX UINT32_MAX
13#define UINT_FAST32_MAX UINT32_MAX
14
15#define INTPTR_MIN INT64_MIN
16#define INTPTR_MAX INT64_MAX
17#define UINTPTR_MAX UINT64_MAX
18#define PTRDIFF_MIN INT64_MIN
19#define PTRDIFF_MAX INT64_MAX
20#define SIZE_MAX UINT64_MAX
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/syscall.h.in deleted-352
...@@ -1,352 +0,0 @@
1#define __NR_read 0
2#define __NR_write 1
3#define __NR_open 2
4#define __NR_close 3
5#define __NR_stat 4
6#define __NR_fstat 5
7#define __NR_lstat 6
8#define __NR_poll 7
9#define __NR_lseek 8
10#define __NR_mmap 9
11#define __NR_mprotect 10
12#define __NR_munmap 11
13#define __NR_brk 12
14#define __NR_rt_sigaction 13
15#define __NR_rt_sigprocmask 14
16#define __NR_rt_sigreturn 15
17#define __NR_ioctl 16
18#define __NR_pread64 17
19#define __NR_pwrite64 18
20#define __NR_readv 19
21#define __NR_writev 20
22#define __NR_access 21
23#define __NR_pipe 22
24#define __NR_select 23
25#define __NR_sched_yield 24
26#define __NR_mremap 25
27#define __NR_msync 26
28#define __NR_mincore 27
29#define __NR_madvise 28
30#define __NR_shmget 29
31#define __NR_shmat 30
32#define __NR_shmctl 31
33#define __NR_dup 32
34#define __NR_dup2 33
35#define __NR_pause 34
36#define __NR_nanosleep 35
37#define __NR_getitimer 36
38#define __NR_alarm 37
39#define __NR_setitimer 38
40#define __NR_getpid 39
41#define __NR_sendfile 40
42#define __NR_socket 41
43#define __NR_connect 42
44#define __NR_accept 43
45#define __NR_sendto 44
46#define __NR_recvfrom 45
47#define __NR_sendmsg 46
48#define __NR_recvmsg 47
49#define __NR_shutdown 48
50#define __NR_bind 49
51#define __NR_listen 50
52#define __NR_getsockname 51
53#define __NR_getpeername 52
54#define __NR_socketpair 53
55#define __NR_setsockopt 54
56#define __NR_getsockopt 55
57#define __NR_clone 56
58#define __NR_fork 57
59#define __NR_vfork 58
60#define __NR_execve 59
61#define __NR_exit 60
62#define __NR_wait4 61
63#define __NR_kill 62
64#define __NR_uname 63
65#define __NR_semget 64
66#define __NR_semop 65
67#define __NR_semctl 66
68#define __NR_shmdt 67
69#define __NR_msgget 68
70#define __NR_msgsnd 69
71#define __NR_msgrcv 70
72#define __NR_msgctl 71
73#define __NR_fcntl 72
74#define __NR_flock 73
75#define __NR_fsync 74
76#define __NR_fdatasync 75
77#define __NR_truncate 76
78#define __NR_ftruncate 77
79#define __NR_getdents 78
80#define __NR_getcwd 79
81#define __NR_chdir 80
82#define __NR_fchdir 81
83#define __NR_rename 82
84#define __NR_mkdir 83
85#define __NR_rmdir 84
86#define __NR_creat 85
87#define __NR_link 86
88#define __NR_unlink 87
89#define __NR_symlink 88
90#define __NR_readlink 89
91#define __NR_chmod 90
92#define __NR_fchmod 91
93#define __NR_chown 92
94#define __NR_fchown 93
95#define __NR_lchown 94
96#define __NR_umask 95
97#define __NR_gettimeofday 96
98#define __NR_getrlimit 97
99#define __NR_getrusage 98
100#define __NR_sysinfo 99
101#define __NR_times 100
102#define __NR_ptrace 101
103#define __NR_getuid 102
104#define __NR_syslog 103
105#define __NR_getgid 104
106#define __NR_setuid 105
107#define __NR_setgid 106
108#define __NR_geteuid 107
109#define __NR_getegid 108
110#define __NR_setpgid 109
111#define __NR_getppid 110
112#define __NR_getpgrp 111
113#define __NR_setsid 112
114#define __NR_setreuid 113
115#define __NR_setregid 114
116#define __NR_getgroups 115
117#define __NR_setgroups 116
118#define __NR_setresuid 117
119#define __NR_getresuid 118
120#define __NR_setresgid 119
121#define __NR_getresgid 120
122#define __NR_getpgid 121
123#define __NR_setfsuid 122
124#define __NR_setfsgid 123
125#define __NR_getsid 124
126#define __NR_capget 125
127#define __NR_capset 126
128#define __NR_rt_sigpending 127
129#define __NR_rt_sigtimedwait 128
130#define __NR_rt_sigqueueinfo 129
131#define __NR_rt_sigsuspend 130
132#define __NR_sigaltstack 131
133#define __NR_utime 132
134#define __NR_mknod 133
135#define __NR_uselib 134
136#define __NR_personality 135
137#define __NR_ustat 136
138#define __NR_statfs 137
139#define __NR_fstatfs 138
140#define __NR_sysfs 139
141#define __NR_getpriority 140
142#define __NR_setpriority 141
143#define __NR_sched_setparam 142
144#define __NR_sched_getparam 143
145#define __NR_sched_setscheduler 144
146#define __NR_sched_getscheduler 145
147#define __NR_sched_get_priority_max 146
148#define __NR_sched_get_priority_min 147
149#define __NR_sched_rr_get_interval 148
150#define __NR_mlock 149
151#define __NR_munlock 150
152#define __NR_mlockall 151
153#define __NR_munlockall 152
154#define __NR_vhangup 153
155#define __NR_modify_ldt 154
156#define __NR_pivot_root 155
157#define __NR__sysctl 156
158#define __NR_prctl 157
159#define __NR_arch_prctl 158
160#define __NR_adjtimex 159
161#define __NR_setrlimit 160
162#define __NR_chroot 161
163#define __NR_sync 162
164#define __NR_acct 163
165#define __NR_settimeofday 164
166#define __NR_mount 165
167#define __NR_umount2 166
168#define __NR_swapon 167
169#define __NR_swapoff 168
170#define __NR_reboot 169
171#define __NR_sethostname 170
172#define __NR_setdomainname 171
173#define __NR_iopl 172
174#define __NR_ioperm 173
175#define __NR_create_module 174
176#define __NR_init_module 175
177#define __NR_delete_module 176
178#define __NR_get_kernel_syms 177
179#define __NR_query_module 178
180#define __NR_quotactl 179
181#define __NR_nfsservctl 180
182#define __NR_getpmsg 181
183#define __NR_putpmsg 182
184#define __NR_afs_syscall 183
185#define __NR_tuxcall 184
186#define __NR_security 185
187#define __NR_gettid 186
188#define __NR_readahead 187
189#define __NR_setxattr 188
190#define __NR_lsetxattr 189
191#define __NR_fsetxattr 190
192#define __NR_getxattr 191
193#define __NR_lgetxattr 192
194#define __NR_fgetxattr 193
195#define __NR_listxattr 194
196#define __NR_llistxattr 195
197#define __NR_flistxattr 196
198#define __NR_removexattr 197
199#define __NR_lremovexattr 198
200#define __NR_fremovexattr 199
201#define __NR_tkill 200
202#define __NR_time 201
203#define __NR_futex 202
204#define __NR_sched_setaffinity 203
205#define __NR_sched_getaffinity 204
206#define __NR_set_thread_area 205
207#define __NR_io_setup 206
208#define __NR_io_destroy 207
209#define __NR_io_getevents 208
210#define __NR_io_submit 209
211#define __NR_io_cancel 210
212#define __NR_get_thread_area 211
213#define __NR_lookup_dcookie 212
214#define __NR_epoll_create 213
215#define __NR_epoll_ctl_old 214
216#define __NR_epoll_wait_old 215
217#define __NR_remap_file_pages 216
218#define __NR_getdents64 217
219#define __NR_set_tid_address 218
220#define __NR_restart_syscall 219
221#define __NR_semtimedop 220
222#define __NR_fadvise64 221
223#define __NR_timer_create 222
224#define __NR_timer_settime 223
225#define __NR_timer_gettime 224
226#define __NR_timer_getoverrun 225
227#define __NR_timer_delete 226
228#define __NR_clock_settime 227
229#define __NR_clock_gettime 228
230#define __NR_clock_getres 229
231#define __NR_clock_nanosleep 230
232#define __NR_exit_group 231
233#define __NR_epoll_wait 232
234#define __NR_epoll_ctl 233
235#define __NR_tgkill 234
236#define __NR_utimes 235
237#define __NR_vserver 236
238#define __NR_mbind 237
239#define __NR_set_mempolicy 238
240#define __NR_get_mempolicy 239
241#define __NR_mq_open 240
242#define __NR_mq_unlink 241
243#define __NR_mq_timedsend 242
244#define __NR_mq_timedreceive 243
245#define __NR_mq_notify 244
246#define __NR_mq_getsetattr 245
247#define __NR_kexec_load 246
248#define __NR_waitid 247
249#define __NR_add_key 248
250#define __NR_request_key 249
251#define __NR_keyctl 250
252#define __NR_ioprio_set 251
253#define __NR_ioprio_get 252
254#define __NR_inotify_init 253
255#define __NR_inotify_add_watch 254
256#define __NR_inotify_rm_watch 255
257#define __NR_migrate_pages 256
258#define __NR_openat 257
259#define __NR_mkdirat 258
260#define __NR_mknodat 259
261#define __NR_fchownat 260
262#define __NR_futimesat 261
263#define __NR_newfstatat 262
264#define __NR_unlinkat 263
265#define __NR_renameat 264
266#define __NR_linkat 265
267#define __NR_symlinkat 266
268#define __NR_readlinkat 267
269#define __NR_fchmodat 268
270#define __NR_faccessat 269
271#define __NR_pselect6 270
272#define __NR_ppoll 271
273#define __NR_unshare 272
274#define __NR_set_robust_list 273
275#define __NR_get_robust_list 274
276#define __NR_splice 275
277#define __NR_tee 276
278#define __NR_sync_file_range 277
279#define __NR_vmsplice 278
280#define __NR_move_pages 279
281#define __NR_utimensat 280
282#define __NR_epoll_pwait 281
283#define __NR_signalfd 282
284#define __NR_timerfd_create 283
285#define __NR_eventfd 284
286#define __NR_fallocate 285
287#define __NR_timerfd_settime 286
288#define __NR_timerfd_gettime 287
289#define __NR_accept4 288
290#define __NR_signalfd4 289
291#define __NR_eventfd2 290
292#define __NR_epoll_create1 291
293#define __NR_dup3 292
294#define __NR_pipe2 293
295#define __NR_inotify_init1 294
296#define __NR_preadv 295
297#define __NR_pwritev 296
298#define __NR_rt_tgsigqueueinfo 297
299#define __NR_perf_event_open 298
300#define __NR_recvmmsg 299
301#define __NR_fanotify_init 300
302#define __NR_fanotify_mark 301
303#define __NR_prlimit64 302
304#define __NR_name_to_handle_at 303
305#define __NR_open_by_handle_at 304
306#define __NR_clock_adjtime 305
307#define __NR_syncfs 306
308#define __NR_sendmmsg 307
309#define __NR_setns 308
310#define __NR_getcpu 309
311#define __NR_process_vm_readv 310
312#define __NR_process_vm_writev 311
313#define __NR_kcmp 312
314#define __NR_finit_module 313
315#define __NR_sched_setattr 314
316#define __NR_sched_getattr 315
317#define __NR_renameat2 316
318#define __NR_seccomp 317
319#define __NR_getrandom 318
320#define __NR_memfd_create 319
321#define __NR_kexec_file_load 320
322#define __NR_bpf 321
323#define __NR_execveat 322
324#define __NR_userfaultfd 323
325#define __NR_membarrier 324
326#define __NR_mlock2 325
327#define __NR_copy_file_range 326
328#define __NR_preadv2 327
329#define __NR_pwritev2 328
330#define __NR_pkey_mprotect 329
331#define __NR_pkey_alloc 330
332#define __NR_pkey_free 331
333#define __NR_statx 332
334#define __NR_io_pgetevents 333
335#define __NR_rseq 334
336#define __NR_pidfd_send_signal 424
337#define __NR_io_uring_setup 425
338#define __NR_io_uring_enter 426
339#define __NR_io_uring_register 427
340#define __NR_open_tree 428
341#define __NR_move_mount 429
342#define __NR_fsopen 430
343#define __NR_fsconfig 431
344#define __NR_fsmount 432
345#define __NR_fspick 433
346#define __NR_pidfd_open 434
347#define __NR_clone3 435
348#define __NR_close_range 436
349#define __NR_openat2 437
350#define __NR_pidfd_getfd 438
351#define __NR_faccessat2 439
352
lib/libc/wasi/libc-top-half/musl/arch/x86_64/bits/user.h deleted-41
...@@ -1,41 +0,0 @@
1#undef __WORDSIZE
2#define __WORDSIZE 64
3
4typedef struct user_fpregs_struct {
5 uint16_t cwd, swd, ftw, fop;
6 uint64_t rip, rdp;
7 uint32_t mxcsr, mxcr_mask;
8 uint32_t st_space[32], xmm_space[64], padding[24];
9} elf_fpregset_t;
10
11struct user_regs_struct {
12 unsigned long r15, r14, r13, r12, rbp, rbx, r11, r10, r9, r8;
13 unsigned long rax, rcx, rdx, rsi, rdi, orig_rax, rip;
14 unsigned long cs, eflags, rsp, ss, fs_base, gs_base, ds, es, fs, gs;
15};
16#define ELF_NGREG 27
17typedef unsigned long long elf_greg_t, elf_gregset_t[ELF_NGREG];
18
19struct user {
20 struct user_regs_struct regs;
21 int u_fpvalid;
22 struct user_fpregs_struct i387;
23 unsigned long u_tsize;
24 unsigned long u_dsize;
25 unsigned long u_ssize;
26 unsigned long start_code;
27 unsigned long start_stack;
28 long signal;
29 int reserved;
30 struct user_regs_struct *u_ar0;
31 struct user_fpregs_struct *u_fpstate;
32 unsigned long magic;
33 char u_comm[32];
34 unsigned long u_debugreg[8];
35};
36
37#define PAGE_MASK (~(PAGESIZE-1))
38#define NBPG PAGESIZE
39#define UPAGES 1
40#define HOST_TEXT_START_ADDR (u.start_code)
41#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
lib/libc/wasi/libc-top-half/musl/arch/x86_64/crt_arch.h deleted-12
...@@ -1,12 +0,0 @@
1__asm__(
2".text \n"
3".global " START " \n"
4START ": \n"
5" xor %rbp,%rbp \n"
6" mov %rsp,%rdi \n"
7".weak _DYNAMIC \n"
8".hidden _DYNAMIC \n"
9" lea _DYNAMIC(%rip),%rsi \n"
10" andq $-16,%rsp \n"
11" call " START "_c \n"
12);
lib/libc/wasi/libc-top-half/musl/arch/x86_64/ksigaction.h deleted-11
...@@ -1,11 +0,0 @@
1#include <features.h>
2
3struct k_sigaction {
4 void (*handler)(int);
5 unsigned long flags;
6 void (*restorer)(void);
7 unsigned mask[2];
8};
9
10hidden void __restore_rt();
11#define __restore __restore_rt
lib/libc/wasi/libc-top-half/musl/arch/x86_64/kstat.h deleted-22
...@@ -1,22 +0,0 @@
1struct kstat {
2 dev_t st_dev;
3 ino_t st_ino;
4 nlink_t st_nlink;
5
6 mode_t st_mode;
7 uid_t st_uid;
8 gid_t st_gid;
9 unsigned int __pad0;
10 dev_t st_rdev;
11 off_t st_size;
12 blksize_t st_blksize;
13 blkcnt_t st_blocks;
14
15 long st_atime_sec;
16 long st_atime_nsec;
17 long st_mtime_sec;
18 long st_mtime_nsec;
19 long st_ctime_sec;
20 long st_ctime_nsec;
21 long __unused[3];
22};
lib/libc/wasi/libc-top-half/musl/arch/x86_64/pthread_arch.h deleted-8
...@@ -1,8 +0,0 @@
1static inline uintptr_t __get_tp()
2{
3 uintptr_t tp;
4 __asm__ ("mov %%fs:0,%0" : "=r" (tp) );
5 return tp;
6}
7
8#define MC_PC gregs[REG_RIP]
lib/libc/wasi/libc-top-half/musl/arch/x86_64/reloc.h deleted-20
...@@ -1,20 +0,0 @@
1#define LDSO_ARCH "x86_64"
2
3#define REL_SYMBOLIC R_X86_64_64
4#define REL_OFFSET32 R_X86_64_PC32
5#define REL_GOT R_X86_64_GLOB_DAT
6#define REL_PLT R_X86_64_JUMP_SLOT
7#define REL_RELATIVE R_X86_64_RELATIVE
8#define REL_COPY R_X86_64_COPY
9#define REL_DTPMOD R_X86_64_DTPMOD64
10#define REL_DTPOFF R_X86_64_DTPOFF64
11#define REL_TPOFF R_X86_64_TPOFF64
12#define REL_TLSDESC R_X86_64_TLSDESC
13
14#define CRTJMP(pc,sp) __asm__ __volatile__( \
15 "mov %1,%%rsp ; jmp *%0" : : "r"(pc), "r"(sp) : "memory" )
16
17#define GETFUNCSYM(fp, sym, got) __asm__ ( \
18 ".hidden " #sym "\n" \
19 " lea " #sym "(%%rip),%0\n" \
20 : "=r"(*fp) : : "memory" )
lib/libc/wasi/libc-top-half/musl/arch/x86_64/syscall_arch.h deleted-70
...@@ -1,70 +0,0 @@
1#define __SYSCALL_LL_E(x) (x)
2#define __SYSCALL_LL_O(x) (x)
3
4static __inline long __syscall0(long n)
5{
6 unsigned long ret;
7 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n) : "rcx", "r11", "memory");
8 return ret;
9}
10
11static __inline long __syscall1(long n, long a1)
12{
13 unsigned long ret;
14 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1) : "rcx", "r11", "memory");
15 return ret;
16}
17
18static __inline long __syscall2(long n, long a1, long a2)
19{
20 unsigned long ret;
21 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2)
22 : "rcx", "r11", "memory");
23 return ret;
24}
25
26static __inline long __syscall3(long n, long a1, long a2, long a3)
27{
28 unsigned long ret;
29 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
30 "d"(a3) : "rcx", "r11", "memory");
31 return ret;
32}
33
34static __inline long __syscall4(long n, long a1, long a2, long a3, long a4)
35{
36 unsigned long ret;
37 register long r10 __asm__("r10") = a4;
38 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
39 "d"(a3), "r"(r10): "rcx", "r11", "memory");
40 return ret;
41}
42
43static __inline long __syscall5(long n, long a1, long a2, long a3, long a4, long a5)
44{
45 unsigned long ret;
46 register long r10 __asm__("r10") = a4;
47 register long r8 __asm__("r8") = a5;
48 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
49 "d"(a3), "r"(r10), "r"(r8) : "rcx", "r11", "memory");
50 return ret;
51}
52
53static __inline long __syscall6(long n, long a1, long a2, long a3, long a4, long a5, long a6)
54{
55 unsigned long ret;
56 register long r10 __asm__("r10") = a4;
57 register long r8 __asm__("r8") = a5;
58 register long r9 __asm__("r9") = a6;
59 __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1), "S"(a2),
60 "d"(a3), "r"(r10), "r"(r8), "r"(r9) : "rcx", "r11", "memory");
61 return ret;
62}
63
64#define VDSO_USEFUL
65#define VDSO_CGT_SYM "__vdso_clock_gettime"
66#define VDSO_CGT_VER "LINUX_2.6"
67#define VDSO_GETCPU_SYM "__vdso_getcpu"
68#define VDSO_GETCPU_VER "LINUX_2.6"
69
70#define IPC_64 0
lib/libc/wasi/libc-top-half/musl/compat/time32/__xstat.c deleted-24
...@@ -1,24 +0,0 @@
1#include "time32.h"
2#include <sys/stat.h>
3
4struct stat32;
5
6int __fxstat64(int ver, int fd, struct stat32 *buf)
7{
8 return __fstat_time32(fd, buf);
9}
10
11int __fxstatat64(int ver, int fd, const char *path, struct stat32 *buf, int flag)
12{
13 return __fstatat_time32(fd, path, buf, flag);
14}
15
16int __lxstat64(int ver, const char *path, struct stat32 *buf)
17{
18 return __lstat_time32(path, buf);
19}
20
21int __xstat64(int ver, const char *path, struct stat32 *buf)
22{
23 return __stat_time32(path, buf);
24}
lib/libc/wasi/libc-top-half/musl/compat/time32/adjtime32.c deleted-21
...@@ -1,21 +0,0 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4#include <sys/time.h>
5#include <sys/timex.h>
6
7int __adjtime32(const struct timeval32 *in32, struct timeval32 *out32)
8{
9 struct timeval out;
10 int r = adjtime((&(struct timeval){
11 .tv_sec = in32->tv_sec,
12 .tv_usec = in32->tv_usec}), &out);
13 if (r) return r;
14 /* We can't range-check the result because success was already
15 * committed by the above call. */
16 if (out32) {
17 out32->tv_sec = out.tv_sec;
18 out32->tv_usec = out.tv_usec;
19 }
20 return r;
21}
lib/libc/wasi/libc-top-half/musl/compat/time32/adjtimex_time32.c deleted-10
...@@ -1,10 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/timex.h>
4
5struct timex32;
6
7int __adjtimex_time32(struct timex32 *tx32)
8{
9 return __clock_adjtime32(CLOCK_REALTIME, tx32);
10}
lib/libc/wasi/libc-top-half/musl/compat/time32/aio_suspend_time32.c deleted-11
...@@ -1,11 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <aio.h>
4
5int __aio_suspend_time32(const struct aiocb *const cbs[], int cnt, const struct timespec32 *ts32)
6{
7 return aio_suspend(cbs, cnt, ts32 ? (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
9}
10
11weak_alias(aio_suspend, aio_suspend64);
lib/libc/wasi/libc-top-half/musl/compat/time32/clock_adjtime32.c deleted-70
...@@ -1,70 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/time.h>
4#include <sys/timex.h>
5#include <string.h>
6#include <stddef.h>
7
8struct timex32 {
9 unsigned modes;
10 long offset, freq, maxerror, esterror;
11 int status;
12 long constant, precision, tolerance;
13 struct timeval32 time;
14 long tick, ppsfreq, jitter;
15 int shift;
16 long stabil, jitcnt, calcnt, errcnt, stbcnt;
17 int tai;
18 int __padding[11];
19};
20
21int __clock_adjtime32(clockid_t clock_id, struct timex32 *tx32)
22{
23 struct timex utx = {
24 .modes = tx32->modes,
25 .offset = tx32->offset,
26 .freq = tx32->freq,
27 .maxerror = tx32->maxerror,
28 .esterror = tx32->esterror,
29 .status = tx32->status,
30 .constant = tx32->constant,
31 .precision = tx32->precision,
32 .tolerance = tx32->tolerance,
33 .time.tv_sec = tx32->time.tv_sec,
34 .time.tv_usec = tx32->time.tv_usec,
35 .tick = tx32->tick,
36 .ppsfreq = tx32->ppsfreq,
37 .jitter = tx32->jitter,
38 .shift = tx32->shift,
39 .stabil = tx32->stabil,
40 .jitcnt = tx32->jitcnt,
41 .calcnt = tx32->calcnt,
42 .errcnt = tx32->errcnt,
43 .stbcnt = tx32->stbcnt,
44 .tai = tx32->tai,
45 };
46 int r = clock_adjtime(clock_id, &utx);
47 if (r<0) return r;
48 tx32->modes = utx.modes;
49 tx32->offset = utx.offset;
50 tx32->freq = utx.freq;
51 tx32->maxerror = utx.maxerror;
52 tx32->esterror = utx.esterror;
53 tx32->status = utx.status;
54 tx32->constant = utx.constant;
55 tx32->precision = utx.precision;
56 tx32->tolerance = utx.tolerance;
57 tx32->time.tv_sec = utx.time.tv_sec;
58 tx32->time.tv_usec = utx.time.tv_usec;
59 tx32->tick = utx.tick;
60 tx32->ppsfreq = utx.ppsfreq;
61 tx32->jitter = utx.jitter;
62 tx32->shift = utx.shift;
63 tx32->stabil = utx.stabil;
64 tx32->jitcnt = utx.jitcnt;
65 tx32->calcnt = utx.calcnt;
66 tx32->errcnt = utx.errcnt;
67 tx32->stbcnt = utx.stbcnt;
68 tx32->tai = utx.tai;
69 return r;
70}
lib/libc/wasi/libc-top-half/musl/compat/time32/clock_getres_time32.c deleted-13
...@@ -1,13 +0,0 @@
1#include "time32.h"
2#include <time.h>
3
4int __clock_getres_time32(clockid_t clk, struct timespec32 *ts32)
5{
6 struct timespec ts;
7 int r = clock_getres(clk, &ts);
8 if (!r && ts32) {
9 ts32->tv_sec = ts.tv_sec;
10 ts32->tv_nsec = ts.tv_nsec;
11 }
12 return r;
13}
lib/libc/wasi/libc-top-half/musl/compat/time32/clock_gettime32.c deleted-18
...@@ -1,18 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <errno.h>
4#include <stdint.h>
5
6int __clock_gettime32(clockid_t clk, struct timespec32 *ts32)
7{
8 struct timespec ts;
9 int r = clock_gettime(clk, &ts);
10 if (r) return r;
11 if (ts.tv_sec < INT32_MIN || ts.tv_sec > INT32_MAX) {
12 errno = EOVERFLOW;
13 return -1;
14 }
15 ts32->tv_sec = ts.tv_sec;
16 ts32->tv_nsec = ts.tv_nsec;
17 return 0;
18}
lib/libc/wasi/libc-top-half/musl/compat/time32/clock_nanosleep_time32.c deleted-15
...@@ -1,15 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <errno.h>
4
5int __clock_nanosleep_time32(clockid_t clk, int flags, const struct timespec32 *req32, struct timespec32 *rem32)
6{
7 struct timespec rem;
8 int ret = clock_nanosleep(clk, flags, (&(struct timespec){
9 .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem);
10 if (ret==EINTR && rem32 && !(flags & TIMER_ABSTIME)) {
11 rem32->tv_sec = rem.tv_sec;
12 rem32->tv_nsec = rem.tv_nsec;
13 }
14 return ret;
15}
lib/libc/wasi/libc-top-half/musl/compat/time32/clock_settime32.c deleted-9
...@@ -1,9 +0,0 @@
1#include "time32.h"
2#include <time.h>
3
4int __clock_settime32(clockid_t clk, const struct timespec32 *ts32)
5{
6 return clock_settime(clk, (&(struct timespec){
7 .tv_sec = ts32->tv_sec,
8 .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/wasi/libc-top-half/musl/compat/time32/cnd_timedwait_time32.c deleted-9
...@@ -1,9 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <threads.h>
4
5int __cnd_timedwait_time32(cnd_t *restrict c, mtx_t *restrict m, const struct timespec32 *restrict ts32)
6{
7 return cnd_timedwait(c, m, ts32 ? (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
9}
lib/libc/wasi/libc-top-half/musl/compat/time32/ctime32.c deleted-7
...@@ -1,7 +0,0 @@
1#include "time32.h"
2#include <time.h>
3
4char *__ctime32(time32_t *t)
5{
6 return ctime(&(time_t){*t});
7}
lib/libc/wasi/libc-top-half/musl/compat/time32/ctime32_r.c deleted-7
...@@ -1,7 +0,0 @@
1#include "time32.h"
2#include <time.h>
3
4char *__ctime32_r(time32_t *t, char *buf)
5{
6 return ctime_r(&(time_t){*t}, buf);
7}
lib/libc/wasi/libc-top-half/musl/compat/time32/difftime32.c deleted-7
...@@ -1,7 +0,0 @@
1#include "time32.h"
2#include <time.h>
3
4double __difftime32(time32_t t1, time32_t t2)
5{
6 return difftime(t1, t2);
7}
lib/libc/wasi/libc-top-half/musl/compat/time32/fstat_time32.c deleted-17
...@@ -1,17 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <string.h>
4#include <sys/stat.h>
5#include <stddef.h>
6
7struct stat32;
8
9int __fstat_time32(int fd, struct stat32 *restrict st32)
10{
11 struct stat st;
12 int r = fstat(fd, &st);
13 if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
14 return r;
15}
16
17weak_alias(fstat, fstat64);
lib/libc/wasi/libc-top-half/musl/compat/time32/fstatat_time32.c deleted-17
...@@ -1,17 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <string.h>
4#include <sys/stat.h>
5#include <stddef.h>
6
7struct stat32;
8
9int __fstatat_time32(int fd, const char *restrict path, struct stat32 *restrict st32, int flag)
10{
11 struct stat st;
12 int r = fstatat(fd, path, &st, flag);
13 if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
14 return r;
15}
16
17weak_alias(fstatat, fstatat64);
lib/libc/wasi/libc-top-half/musl/compat/time32/ftime32.c deleted-25
...@@ -1,25 +0,0 @@
1#include "time32.h"
2#include <sys/timeb.h>
3#include <errno.h>
4#include <stdint.h>
5
6struct timeb32 {
7 int32_t time;
8 unsigned short millitm;
9 short timezone, dstflag;
10};
11
12int __ftime32(struct timeb32 *tp)
13{
14 struct timeb tb;
15 if (ftime(&tb) < 0) return -1;
16 if (tb.time < INT32_MIN || tb.time > INT32_MAX) {
17 errno = EOVERFLOW;
18 return -1;
19 }
20 tp->time = tb.time;
21 tp->millitm = tb.millitm;
22 tp->timezone = tb.timezone;
23 tp->dstflag = tb.dstflag;
24 return 0;
25}
lib/libc/wasi/libc-top-half/musl/compat/time32/futimens_time32.c deleted-10
...@@ -1,10 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/stat.h>
4
5int __futimens_time32(int fd, const struct timespec32 *times32)
6{
7 return futimens(fd, !times32 ? 0 : ((struct timespec[2]){
8 {.tv_sec = times32[0].tv_sec,.tv_nsec = times32[0].tv_nsec},
9 {.tv_sec = times32[1].tv_sec,.tv_nsec = times32[1].tv_nsec}}));
10}
lib/libc/wasi/libc-top-half/musl/compat/time32/futimes_time32.c deleted-12
...@@ -1,12 +0,0 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4#include <sys/time.h>
5#include <sys/stat.h>
6
7int __futimes_time32(int fd, const struct timeval32 times32[2])
8{
9 return futimes(fd, !times32 ? 0 : ((struct timeval[2]){
10 {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec},
11 {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}}));
12}
lib/libc/wasi/libc-top-half/musl/compat/time32/futimesat_time32.c deleted-12
...@@ -1,12 +0,0 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4#include <sys/time.h>
5#include <sys/stat.h>
6
7int __futimesat_time32(int dirfd, const char *pathname, const struct timeval32 times32[2])
8{
9 return futimesat(dirfd, pathname, !times32 ? 0 : ((struct timeval[2]){
10 {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec},
11 {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}}));
12}
lib/libc/wasi/libc-top-half/musl/compat/time32/getitimer_time32.c deleted-15
...@@ -1,15 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/time.h>
4
5int __getitimer_time32(int which, struct itimerval32 *old32)
6{
7 struct itimerval old;
8 int r = getitimer(which, &old);
9 if (r) return r;
10 old32->it_interval.tv_sec = old.it_interval.tv_sec;
11 old32->it_interval.tv_usec = old.it_interval.tv_usec;
12 old32->it_value.tv_sec = old.it_value.tv_sec;
13 old32->it_value.tv_usec = old.it_value.tv_usec;
14 return 0;
15}
lib/libc/wasi/libc-top-half/musl/compat/time32/getrusage_time32.c deleted-39
...@@ -1,39 +0,0 @@
1#include "time32.h"
2#include <string.h>
3#include <stddef.h>
4#include <sys/resource.h>
5
6struct compat_rusage {
7 struct timeval32 ru_utime;
8 struct timeval32 ru_stime;
9 long ru_maxrss;
10 long ru_ixrss;
11 long ru_idrss;
12 long ru_isrss;
13 long ru_minflt;
14 long ru_majflt;
15 long ru_nswap;
16 long ru_inblock;
17 long ru_oublock;
18 long ru_msgsnd;
19 long ru_msgrcv;
20 long ru_nsignals;
21 long ru_nvcsw;
22 long ru_nivcsw;
23};
24
25int __getrusage_time32(int who, struct compat_rusage *usage)
26{
27 struct rusage ru;
28 int r = getrusage(who, &ru);
29 if (!r) {
30 usage->ru_utime.tv_sec = ru.ru_utime.tv_sec;
31 usage->ru_utime.tv_usec = ru.ru_utime.tv_usec;
32 usage->ru_stime.tv_sec = ru.ru_stime.tv_sec;
33 usage->ru_stime.tv_usec = ru.ru_stime.tv_usec;
34 memcpy(&usage->ru_maxrss, &ru.ru_maxrss,
35 sizeof(struct compat_rusage) -
36 offsetof(struct compat_rusage, ru_maxrss));
37 }
38 return r;
39}
lib/libc/wasi/libc-top-half/musl/compat/time32/gettimeofday_time32.c deleted-19
...@@ -1,19 +0,0 @@
1#include "time32.h"
2#include <sys/time.h>
3#include <errno.h>
4#include <stdint.h>
5
6int __gettimeofday_time32(struct timeval32 *tv32, void *tz)
7{
8 struct timeval tv;
9 if (!tv32) return 0;
10 int r = gettimeofday(&tv, 0);
11 if (r) return r;
12 if (tv.tv_sec < INT32_MIN || tv.tv_sec > INT32_MAX) {
13 errno = EOVERFLOW;
14 return -1;
15 }
16 tv32->tv_sec = tv.tv_sec;
17 tv32->tv_usec = tv.tv_usec;
18 return 0;
19}
lib/libc/wasi/libc-top-half/musl/compat/time32/gmtime32.c deleted-7
...@@ -1,7 +0,0 @@
1#include "time32.h"
2#include <time.h>
3
4struct tm *__gmtime32(time32_t *t)
5{
6 return gmtime(&(time_t){*t});
7}
lib/libc/wasi/libc-top-half/musl/compat/time32/gmtime32_r.c deleted-7
...@@ -1,7 +0,0 @@
1#include "time32.h"
2#include <time.h>
3
4struct tm *__gmtime32_r(time32_t *t, struct tm *tm)
5{
6 return gmtime_r(&(time_t){*t}, tm);
7}
lib/libc/wasi/libc-top-half/musl/compat/time32/localtime32.c deleted-7
...@@ -1,7 +0,0 @@
1#include "time32.h"
2#include <time.h>
3
4struct tm *__localtime32(time32_t *t)
5{
6 return localtime(&(time_t){*t});
7}
lib/libc/wasi/libc-top-half/musl/compat/time32/localtime32_r.c deleted-7
...@@ -1,7 +0,0 @@
1#include "time32.h"
2#include <time.h>
3
4struct tm *__localtime32_r(time32_t *t, struct tm *tm)
5{
6 return localtime_r(&(time_t){*t}, tm);
7}
lib/libc/wasi/libc-top-half/musl/compat/time32/lstat_time32.c deleted-17
...@@ -1,17 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <string.h>
4#include <sys/stat.h>
5#include <stddef.h>
6
7struct stat32;
8
9int __lstat_time32(const char *restrict path, struct stat32 *restrict st32)
10{
11 struct stat st;
12 int r = lstat(path, &st);
13 if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
14 return r;
15}
16
17weak_alias(lstat, lstat64);
lib/libc/wasi/libc-top-half/musl/compat/time32/lutimes_time32.c deleted-12
...@@ -1,12 +0,0 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4#include <sys/time.h>
5#include <sys/stat.h>
6
7int __lutimes_time32(const char *path, const struct timeval32 times32[2])
8{
9 return lutimes(path, !times32 ? 0 : ((struct timeval[2]){
10 {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec},
11 {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}}));
12}
lib/libc/wasi/libc-top-half/musl/compat/time32/mktime32.c deleted-16
...@@ -1,16 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <errno.h>
4#include <stdint.h>
5
6time32_t __mktime32(struct tm *tm)
7{
8 struct tm tmp = *tm;
9 time_t t = mktime(&tmp);
10 if (t < INT32_MIN || t > INT32_MAX) {
11 errno = EOVERFLOW;
12 return -1;
13 }
14 *tm = tmp;
15 return t;
16}
lib/libc/wasi/libc-top-half/musl/compat/time32/mq_timedreceive_time32.c deleted-9
...@@ -1,9 +0,0 @@
1#include "time32.h"
2#include <mqueue.h>
3#include <time.h>
4
5ssize_t __mq_timedreceive_time32(mqd_t mqd, char *restrict msg, size_t len, unsigned *restrict prio, const struct timespec32 *restrict ts32)
6{
7 return mq_timedreceive(mqd, msg, len, prio, ts32 ? (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
9}
lib/libc/wasi/libc-top-half/musl/compat/time32/mq_timedsend_time32.c deleted-9
...@@ -1,9 +0,0 @@
1#include "time32.h"
2#include <mqueue.h>
3#include <time.h>
4
5int __mq_timedsend_time32(mqd_t mqd, const char *msg, size_t len, unsigned prio, const struct timespec32 *ts32)
6{
7 return mq_timedsend(mqd, msg, len, prio, ts32 ? (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
9}
lib/libc/wasi/libc-top-half/musl/compat/time32/mtx_timedlock_time32.c deleted-9
...@@ -1,9 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <threads.h>
4
5int __mtx_timedlock_time32(mtx_t *restrict m, const struct timespec32 *restrict ts32)
6{
7 return mtx_timedlock(m, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/wasi/libc-top-half/musl/compat/time32/nanosleep_time32.c deleted-15
...@@ -1,15 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <errno.h>
4
5int __nanosleep_time32(const struct timespec32 *req32, struct timespec32 *rem32)
6{
7 struct timespec rem;
8 int ret = nanosleep((&(struct timespec){
9 .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem);
10 if (ret<0 && errno==EINTR && rem32) {
11 rem32->tv_sec = rem.tv_sec;
12 rem32->tv_nsec = rem.tv_nsec;
13 }
14 return ret;
15}
lib/libc/wasi/libc-top-half/musl/compat/time32/ppoll_time32.c deleted-10
...@@ -1,10 +0,0 @@
1#include "time32.h"
2#define _GNU_SOURCE
3#include <time.h>
4#include <poll.h>
5
6int __ppoll_time32(struct pollfd *fds, nfds_t n, const struct timespec32 *ts32, const sigset_t *mask)
7{
8 return ppoll(fds, n, !ts32 ? 0 : (&(struct timespec){
9 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}), mask);
10}
lib/libc/wasi/libc-top-half/musl/compat/time32/pselect_time32.c deleted-9
...@@ -1,9 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/select.h>
4
5int __pselect_time32(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict efds, const struct timespec32 *restrict ts32, const sigset_t *restrict mask)
6{
7 return pselect(n, rfds, wfds, efds, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}), mask);
9}
lib/libc/wasi/libc-top-half/musl/compat/time32/pthread_cond_timedwait_time32.c deleted-9
...@@ -1,9 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <pthread.h>
4
5int __pthread_cond_timedwait_time32(pthread_cond_t *restrict c, pthread_mutex_t *restrict m, const struct timespec32 *restrict ts32)
6{
7 return pthread_cond_timedwait(c, m, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/wasi/libc-top-half/musl/compat/time32/pthread_mutex_timedlock_time32.c deleted-9
...@@ -1,9 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <pthread.h>
4
5int __pthread_mutex_timedlock_time32(pthread_mutex_t *restrict m, const struct timespec32 *restrict ts32)
6{
7 return pthread_mutex_timedlock(m, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/wasi/libc-top-half/musl/compat/time32/pthread_rwlock_timedrdlock_time32.c deleted-9
...@@ -1,9 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <pthread.h>
4
5int __pthread_rwlock_timedrdlock_time32(pthread_rwlock_t *restrict rw, const struct timespec32 *restrict ts32)
6{
7 return pthread_rwlock_timedrdlock(rw, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/wasi/libc-top-half/musl/compat/time32/pthread_rwlock_timedwrlock_time32.c deleted-9
...@@ -1,9 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <pthread.h>
4
5int __pthread_rwlock_timedwrlock_time32(pthread_rwlock_t *restrict rw, const struct timespec32 *restrict ts32)
6{
7 return pthread_rwlock_timedwrlock(rw, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/wasi/libc-top-half/musl/compat/time32/pthread_timedjoin_np_time32.c deleted-10
...@@ -1,10 +0,0 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4#include <pthread.h>
5
6int __pthread_timedjoin_np_time32(pthread_t t, void **res, const struct timespec32 *at32)
7{
8 return pthread_timedjoin_np(t, res, !at32 ? 0 : (&(struct timespec){
9 .tv_sec = at32->tv_sec, .tv_nsec = at32->tv_nsec}));
10}
lib/libc/wasi/libc-top-half/musl/compat/time32/recvmmsg_time32.c deleted-10
...@@ -1,10 +0,0 @@
1#include "time32.h"
2#define _GNU_SOURCE
3#include <time.h>
4#include <sys/socket.h>
5
6int __recvmmsg_time32(int fd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int flags, struct timespec32 *ts32)
7{
8 return recvmmsg(fd, msgvec, vlen, flags, ts32 ? (&(struct timespec){
9 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}) : 0);
10}
lib/libc/wasi/libc-top-half/musl/compat/time32/sched_rr_get_interval_time32.c deleted-13
...@@ -1,13 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <sched.h>
4
5int __sched_rr_get_interval_time32(pid_t pid, struct timespec32 *ts32)
6{
7 struct timespec ts;
8 int r = sched_rr_get_interval(pid, &ts);
9 if (r) return r;
10 ts32->tv_sec = ts.tv_sec;
11 ts32->tv_nsec = ts.tv_nsec;
12 return r;
13}
lib/libc/wasi/libc-top-half/musl/compat/time32/select_time32.c deleted-10
...@@ -1,10 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/time.h>
4#include <sys/select.h>
5
6int __select_time32(int n, fd_set *restrict rfds, fd_set *restrict wfds, fd_set *restrict efds, struct timeval32 *restrict tv32)
7{
8 return select(n, rfds, wfds, efds, !tv32 ? 0 : (&(struct timeval){
9 .tv_sec = tv32->tv_sec, .tv_usec = tv32->tv_usec}));
10}
lib/libc/wasi/libc-top-half/musl/compat/time32/sem_timedwait_time32.c deleted-9
...@@ -1,9 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <semaphore.h>
4
5int __sem_timedwait_time32(sem_t *sem, const struct timespec32 *restrict ts32)
6{
7 return sem_timedwait(sem, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/wasi/libc-top-half/musl/compat/time32/semtimedop_time32.c deleted-10
...@@ -1,10 +0,0 @@
1#include "time32.h"
2#define _GNU_SOURCE
3#include <sys/sem.h>
4#include <time.h>
5
6int __semtimedop_time32(int id, struct sembuf *buf, size_t n, const struct timespec32 *ts32)
7{
8 return semtimedop(id, buf, n, !ts32 ? 0 : (&(struct timespec){
9 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
10}
lib/libc/wasi/libc-top-half/musl/compat/time32/setitimer_time32.c deleted-25
...@@ -1,25 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/time.h>
4
5int __setitimer_time32(int which, const struct itimerval32 *restrict new32, struct itimerval32 *restrict old32)
6{
7 struct itimerval old;
8 int r = setitimer(which, (&(struct itimerval){
9 .it_interval.tv_sec = new32->it_interval.tv_sec,
10 .it_interval.tv_usec = new32->it_interval.tv_usec,
11 .it_value.tv_sec = new32->it_value.tv_sec,
12 .it_value.tv_usec = new32->it_value.tv_usec}), &old);
13 if (r) return r;
14 /* The above call has already committed to success by changing the
15 * timer setting, so we can't fail on out-of-range old value.
16 * Since these are relative times, values large enough to overflow
17 * don't make sense anyway. */
18 if (old32) {
19 old32->it_interval.tv_sec = old.it_interval.tv_sec;
20 old32->it_interval.tv_usec = old.it_interval.tv_usec;
21 old32->it_value.tv_sec = old.it_value.tv_sec;
22 old32->it_value.tv_usec = old.it_value.tv_usec;
23 }
24 return 0;
25}
lib/libc/wasi/libc-top-half/musl/compat/time32/settimeofday_time32.c deleted-10
...@@ -1,10 +0,0 @@
1#define _BSD_SOURCE
2#include "time32.h"
3#include <sys/time.h>
4
5int __settimeofday_time32(const struct timeval32 *tv32, const void *tz)
6{
7 return settimeofday(!tv32 ? 0 : (&(struct timeval){
8 .tv_sec = tv32->tv_sec,
9 .tv_usec = tv32->tv_usec}), 0);
10}
lib/libc/wasi/libc-top-half/musl/compat/time32/sigtimedwait_time32.c deleted-9
...@@ -1,9 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <signal.h>
4
5int __sigtimedwait_time32(const sigset_t *restrict set, siginfo_t *restrict si, const struct timespec32 *restrict ts32)
6{
7 return sigtimedwait(set, si, !ts32 ? 0 : (&(struct timespec){
8 .tv_sec = ts32->tv_sec, .tv_nsec = ts32->tv_nsec}));
9}
lib/libc/wasi/libc-top-half/musl/compat/time32/stat_time32.c deleted-17
...@@ -1,17 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <string.h>
4#include <sys/stat.h>
5#include <stddef.h>
6
7struct stat32;
8
9int __stat_time32(const char *restrict path, struct stat32 *restrict st32)
10{
11 struct stat st;
12 int r = stat(path, &st);
13 if (!r) memcpy(st32, &st, offsetof(struct stat, st_atim));
14 return r;
15}
16
17weak_alias(stat, stat64);
lib/libc/wasi/libc-top-half/musl/compat/time32/stime32.c deleted-8
...@@ -1,8 +0,0 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4
5int __stime32(const time32_t *t)
6{
7 return stime(&(time_t){*t});
8}
lib/libc/wasi/libc-top-half/musl/compat/time32/thrd_sleep_time32.c deleted-16
...@@ -1,16 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <threads.h>
4#include <errno.h>
5
6int __thrd_sleep_time32(const struct timespec32 *req32, struct timespec32 *rem32)
7{
8 struct timespec rem;
9 int ret = thrd_sleep((&(struct timespec){
10 .tv_sec = req32->tv_sec, .tv_nsec = req32->tv_nsec}), &rem);
11 if (ret<0 && errno==EINTR && rem32) {
12 rem32->tv_sec = rem.tv_sec;
13 rem32->tv_nsec = rem.tv_nsec;
14 }
15 return ret;
16}
lib/libc/wasi/libc-top-half/musl/compat/time32/time32.c deleted-15
...@@ -1,15 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <errno.h>
4#include <stdint.h>
5
6time32_t __time32(time32_t *p)
7{
8 time_t t = time(0);
9 if (t < INT32_MIN || t > INT32_MAX) {
10 errno = EOVERFLOW;
11 return -1;
12 }
13 if (p) *p = t;
14 return t;
15}
lib/libc/wasi/libc-top-half/musl/compat/time32/time32.h deleted-91
...@@ -1,91 +0,0 @@
1#ifndef TIME32_H
2#define TIME32_H
3
4#include <sys/types.h>
5
6typedef long time32_t;
7
8struct timeval32 {
9 long tv_sec;
10 long tv_usec;
11};
12
13struct itimerval32 {
14 struct timeval32 it_interval;
15 struct timeval32 it_value;
16};
17
18struct timespec32 {
19 long tv_sec;
20 long tv_nsec;
21};
22
23struct itimerspec32 {
24 struct timespec32 it_interval;
25 struct timespec32 it_value;
26};
27
28int __adjtime32() __asm__("adjtime");
29int __adjtimex_time32() __asm__("adjtimex");
30int __aio_suspend_time32() __asm__("aio_suspend");
31int __clock_adjtime32() __asm__("clock_adjtime");
32int __clock_getres_time32() __asm__("clock_getres");
33int __clock_gettime32() __asm__("clock_gettime");
34int __clock_nanosleep_time32() __asm__("clock_nanosleep");
35int __clock_settime32() __asm__("clock_settime");
36int __cnd_timedwait_time32() __asm__("cnd_timedwait");
37char *__ctime32() __asm__("ctime");
38char *__ctime32_r() __asm__("ctime_r");
39double __difftime32() __asm__("difftime");
40int __fstat_time32() __asm__("fstat");
41int __fstatat_time32() __asm__("fstatat");
42int __ftime32() __asm__("ftime");
43int __futimens_time32() __asm__("futimens");
44int __futimes_time32() __asm__("futimes");
45int __futimesat_time32() __asm__("futimesat");
46int __getitimer_time32() __asm__("getitimer");
47int __getrusage_time32() __asm__("getrusage");
48int __gettimeofday_time32() __asm__("gettimeofday");
49struct tm *__gmtime32() __asm__("gmtime");
50struct tm *__gmtime32_r() __asm__("gmtime_r");
51struct tm *__localtime32() __asm__("localtime");
52struct tm *__localtime32_r() __asm__("localtime_r");
53int __lstat_time32() __asm__("lstat");
54int __lutimes_time32() __asm__("lutimes");
55time32_t __mktime32() __asm__("mktime");
56ssize_t __mq_timedreceive_time32() __asm__("mq_timedreceive");
57int __mq_timedsend_time32() __asm__("mq_timedsend");
58int __mtx_timedlock_time32() __asm__("mtx_timedlock");
59int __nanosleep_time32() __asm__("nanosleep");
60int __ppoll_time32() __asm__("ppoll");
61int __pselect_time32() __asm__("pselect");
62int __pthread_cond_timedwait_time32() __asm__("pthread_cond_timedwait");
63int __pthread_mutex_timedlock_time32() __asm__("pthread_mutex_timedlock");
64int __pthread_rwlock_timedrdlock_time32() __asm__("pthread_rwlock_timedrdlock");
65int __pthread_rwlock_timedwrlock_time32() __asm__("pthread_rwlock_timedwrlock");
66int __pthread_timedjoin_np_time32() __asm__("pthread_timedjoin_np");
67int __recvmmsg_time32() __asm__("recvmmsg");
68int __sched_rr_get_interval_time32() __asm__("sched_rr_get_interval");
69int __select_time32() __asm__("select");
70int __sem_timedwait_time32() __asm__("sem_timedwait");
71int __semtimedop_time32() __asm__("semtimedop");
72int __setitimer_time32() __asm__("setitimer");
73int __settimeofday_time32() __asm__("settimeofday");
74int __sigtimedwait_time32() __asm__("sigtimedwait");
75int __stat_time32() __asm__("stat");
76int __stime32() __asm__("stime");
77int __thrd_sleep_time32() __asm__("thrd_sleep");
78time32_t __time32() __asm__("time");
79time32_t __time32gm() __asm__("timegm");
80int __timer_gettime32() __asm__("timer_gettime");
81int __timer_settime32() __asm__("timer_settime");
82int __timerfd_gettime32() __asm__("timerfd_gettime");
83int __timerfd_settime32() __asm__("timerfd_settime");
84int __timespec_get_time32() __asm__("timespec_get");
85int __utime_time32() __asm__("utime");
86int __utimensat_time32() __asm__("utimensat");
87int __utimes_time32() __asm__("utimes");
88pid_t __wait3_time32() __asm__("wait3");
89pid_t __wait4_time32() __asm__("wait4");
90
91#endif
lib/libc/wasi/libc-top-half/musl/compat/time32/time32gm.c deleted-15
...@@ -1,15 +0,0 @@
1#define _GNU_SOURCE
2#include "time32.h"
3#include <time.h>
4#include <errno.h>
5#include <stdint.h>
6
7time32_t __time32gm(struct tm *tm)
8{
9 time_t t = timegm(tm);
10 if (t < INT32_MIN || t > INT32_MAX) {
11 errno = EOVERFLOW;
12 return -1;
13 }
14 return t;
15}
lib/libc/wasi/libc-top-half/musl/compat/time32/timer_gettime32.c deleted-15
...@@ -1,15 +0,0 @@
1#include "time32.h"
2#include <time.h>
3
4int __timer_gettime32(timer_t t, struct itimerspec32 *val32)
5{
6 struct itimerspec old;
7 int r = timer_gettime(t, &old);
8 if (r) return r;
9 /* No range checking for consistency with settime */
10 val32->it_interval.tv_sec = old.it_interval.tv_sec;
11 val32->it_interval.tv_nsec = old.it_interval.tv_nsec;
12 val32->it_value.tv_sec = old.it_value.tv_sec;
13 val32->it_value.tv_nsec = old.it_value.tv_nsec;
14 return 0;
15}
lib/libc/wasi/libc-top-half/musl/compat/time32/timer_settime32.c deleted-25
...@@ -1,25 +0,0 @@
1#include "time32.h"
2#include <time.h>
3
4int __timer_settime32(timer_t t, int flags, const struct itimerspec32 *restrict val32, struct itimerspec32 *restrict old32)
5{
6 struct itimerspec old;
7 int r = timer_settime(t, flags, (&(struct itimerspec){
8 .it_interval.tv_sec = val32->it_interval.tv_sec,
9 .it_interval.tv_nsec = val32->it_interval.tv_nsec,
10 .it_value.tv_sec = val32->it_value.tv_sec,
11 .it_value.tv_nsec = val32->it_value.tv_nsec}),
12 old32 ? &old : 0);
13 if (r) return r;
14 /* The above call has already committed to success by changing the
15 * timer setting, so we can't fail on out-of-range old value.
16 * Since these are relative times, values large enough to overflow
17 * don't make sense anyway. */
18 if (old32) {
19 old32->it_interval.tv_sec = old.it_interval.tv_sec;
20 old32->it_interval.tv_nsec = old.it_interval.tv_nsec;
21 old32->it_value.tv_sec = old.it_value.tv_sec;
22 old32->it_value.tv_nsec = old.it_value.tv_nsec;
23 }
24 return 0;
25}
lib/libc/wasi/libc-top-half/musl/compat/time32/timerfd_gettime32.c deleted-16
...@@ -1,16 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/timerfd.h>
4
5int __timerfd_gettime32(int t, struct itimerspec32 *val32)
6{
7 struct itimerspec old;
8 int r = timerfd_gettime(t, &old);
9 if (r) return r;
10 /* No range checking for consistency with settime */
11 val32->it_interval.tv_sec = old.it_interval.tv_sec;
12 val32->it_interval.tv_nsec = old.it_interval.tv_nsec;
13 val32->it_value.tv_sec = old.it_value.tv_sec;
14 val32->it_value.tv_nsec = old.it_value.tv_nsec;
15 return 0;
16}
lib/libc/wasi/libc-top-half/musl/compat/time32/timerfd_settime32.c deleted-26
...@@ -1,26 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/timerfd.h>
4
5int __timerfd_settime32(int t, int flags, const struct itimerspec32 *restrict val32, struct itimerspec32 *restrict old32)
6{
7 struct itimerspec old;
8 int r = timerfd_settime(t, flags, (&(struct itimerspec){
9 .it_interval.tv_sec = val32->it_interval.tv_sec,
10 .it_interval.tv_nsec = val32->it_interval.tv_nsec,
11 .it_value.tv_sec = val32->it_value.tv_sec,
12 .it_value.tv_nsec = val32->it_value.tv_nsec}),
13 old32 ? &old : 0);
14 if (r) return r;
15 /* The above call has already committed to success by changing the
16 * timer setting, so we can't fail on out-of-range old value.
17 * Since these are relative times, values large enough to overflow
18 * don't make sense anyway. */
19 if (old32) {
20 old32->it_interval.tv_sec = old.it_interval.tv_sec;
21 old32->it_interval.tv_nsec = old.it_interval.tv_nsec;
22 old32->it_value.tv_sec = old.it_value.tv_sec;
23 old32->it_value.tv_nsec = old.it_value.tv_nsec;
24 }
25 return 0;
26}
lib/libc/wasi/libc-top-half/musl/compat/time32/timespec_get_time32.c deleted-18
...@@ -1,18 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <errno.h>
4#include <stdint.h>
5
6int __timespec_get_time32(struct timespec32 *ts32, int base)
7{
8 struct timespec ts;
9 int r = timespec_get(&ts, base);
10 if (!r) return r;
11 if (ts.tv_sec < INT32_MIN || ts.tv_sec > INT32_MAX) {
12 errno = EOVERFLOW;
13 return 0;
14 }
15 ts32->tv_sec = ts.tv_sec;
16 ts32->tv_nsec = ts.tv_nsec;
17 return r;
18}
lib/libc/wasi/libc-top-half/musl/compat/time32/utime_time32.c deleted-14
...@@ -1,14 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <utime.h>
4
5struct utimbuf32 {
6 time32_t actime;
7 time32_t modtime;
8};
9
10int __utime_time32(const char *path, const struct utimbuf32 *times32)
11{
12 return utime(path, !times32 ? 0 : (&(struct utimbuf){
13 .actime = times32->actime, .modtime = times32->modtime}));
14}
lib/libc/wasi/libc-top-half/musl/compat/time32/utimensat_time32.c deleted-11
...@@ -1,11 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/stat.h>
4
5int __utimensat_time32(int fd, const char *path, const struct timespec32 times32[2], int flags)
6{
7 return utimensat(fd, path, !times32 ? 0 : ((struct timespec[2]){
8 {.tv_sec = times32[0].tv_sec,.tv_nsec = times32[0].tv_nsec},
9 {.tv_sec = times32[1].tv_sec,.tv_nsec = times32[1].tv_nsec}}),
10 flags);
11}
lib/libc/wasi/libc-top-half/musl/compat/time32/utimes_time32.c deleted-11
...@@ -1,11 +0,0 @@
1#include "time32.h"
2#include <time.h>
3#include <sys/time.h>
4#include <sys/stat.h>
5
6int __utimes_time32(const char *path, const struct timeval32 times32[2])
7{
8 return utimes(path, !times32 ? 0 : ((struct timeval[2]){
9 {.tv_sec = times32[0].tv_sec,.tv_usec = times32[0].tv_usec},
10 {.tv_sec = times32[1].tv_sec,.tv_usec = times32[1].tv_usec}}));
11}
lib/libc/wasi/libc-top-half/musl/compat/time32/wait3_time32.c deleted-40
...@@ -1,40 +0,0 @@
1#define _BSD_SOURCE
2#include "time32.h"
3#include <string.h>
4#include <stddef.h>
5#include <sys/wait.h>
6
7struct compat_rusage {
8 struct timeval32 ru_utime;
9 struct timeval32 ru_stime;
10 long ru_maxrss;
11 long ru_ixrss;
12 long ru_idrss;
13 long ru_isrss;
14 long ru_minflt;
15 long ru_majflt;
16 long ru_nswap;
17 long ru_inblock;
18 long ru_oublock;
19 long ru_msgsnd;
20 long ru_msgrcv;
21 long ru_nsignals;
22 long ru_nvcsw;
23 long ru_nivcsw;
24};
25
26pid_t __wait3_time32(int *status, int options, struct compat_rusage *usage)
27{
28 struct rusage ru;
29 int r = wait3(status, options, usage ? &ru : 0);
30 if (!r && usage) {
31 usage->ru_utime.tv_sec = ru.ru_utime.tv_sec;
32 usage->ru_utime.tv_usec = ru.ru_utime.tv_usec;
33 usage->ru_stime.tv_sec = ru.ru_stime.tv_sec;
34 usage->ru_stime.tv_usec = ru.ru_stime.tv_usec;
35 memcpy(&usage->ru_maxrss, &ru.ru_maxrss,
36 sizeof(struct compat_rusage) -
37 offsetof(struct compat_rusage, ru_maxrss));
38 }
39 return r;
40}
lib/libc/wasi/libc-top-half/musl/compat/time32/wait4_time32.c deleted-40
...@@ -1,40 +0,0 @@
1#define _BSD_SOURCE
2#include "time32.h"
3#include <string.h>
4#include <stddef.h>
5#include <sys/wait.h>
6
7struct compat_rusage {
8 struct timeval32 ru_utime;
9 struct timeval32 ru_stime;
10 long ru_maxrss;
11 long ru_ixrss;
12 long ru_idrss;
13 long ru_isrss;
14 long ru_minflt;
15 long ru_majflt;
16 long ru_nswap;
17 long ru_inblock;
18 long ru_oublock;
19 long ru_msgsnd;
20 long ru_msgrcv;
21 long ru_nsignals;
22 long ru_nvcsw;
23 long ru_nivcsw;
24};
25
26pid_t __wait4_time32(pid_t pid, int *status, int options, struct compat_rusage *usage)
27{
28 struct rusage ru;
29 int r = wait4(pid, status, options, usage ? &ru : 0);
30 if (!r && usage) {
31 usage->ru_utime.tv_sec = ru.ru_utime.tv_sec;
32 usage->ru_utime.tv_usec = ru.ru_utime.tv_usec;
33 usage->ru_stime.tv_sec = ru.ru_stime.tv_sec;
34 usage->ru_stime.tv_usec = ru.ru_stime.tv_usec;
35 memcpy(&usage->ru_maxrss, &ru.ru_maxrss,
36 sizeof(struct compat_rusage) -
37 offsetof(struct compat_rusage, ru_maxrss));
38 }
39 return r;
40}
lib/libc/wasi/libc-top-half/musl/configure deleted-816
...@@ -1,816 +0,0 @@
1#!/bin/sh
2
3usage () {
4cat <<EOF
5Usage: $0 [OPTION]... [VAR=VALUE]... [TARGET]
6
7To assign environment variables (e.g., CC, CFLAGS...), specify them as
8VAR=VALUE. See below for descriptions of some of the useful variables.
9
10Defaults for the options are specified in brackets.
11
12Configuration:
13 --srcdir=DIR source directory [detected]
14
15Installation directories:
16 --prefix=PREFIX main installation prefix [/usr/local/musl]
17 --exec-prefix=EPREFIX installation prefix for executable files [PREFIX]
18
19Fine tuning of the installation directories:
20 --bindir=DIR user executables [EPREFIX/bin]
21 --libdir=DIR library files for the linker [PREFIX/lib]
22 --includedir=DIR include files for the C compiler [PREFIX/include]
23 --syslibdir=DIR location for the dynamic linker [/lib]
24
25System types:
26 --target=TARGET configure to run on target TARGET [detected]
27 --host=HOST same as --target
28 --build=BUILD build system type; used only to infer cross-compiling
29
30Optional features:
31 --enable-optimize=... optimize listed components for speed over size [auto]
32 --enable-debug build with debugging information [disabled]
33 --disable-warnings build with recommended warnings flags [enabled]
34 --enable-wrapper=... build given musl toolchain wrapper [auto]
35 --disable-shared inhibit building shared library [enabled]
36 --disable-static inhibit building static library [enabled]
37
38Optional packages:
39 --with-malloc=... choose malloc implementation [mallocng]
40
41Some influential environment variables:
42 CC C compiler command [detected]
43 CFLAGS C compiler flags [-Os -pipe ...]
44 CROSS_COMPILE prefix for cross compiler and tools [none]
45 LIBCC compiler runtime library [detected]
46
47Use these variables to override the choices made by configure.
48
49EOF
50exit 0
51}
52
53# Helper functions
54
55quote () {
56tr '\n' ' ' <<EOF | grep '^[-[:alnum:]_=,./:]* $' >/dev/null 2>&1 && { echo "$1" ; return 0 ; }
57$1
58EOF
59printf %s\\n "$1" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/'/" -e "s#^'\([-[:alnum:]_,./:]*\)=\(.*\)\$#\1='\2#"
60}
61echo () { printf "%s\n" "$*" ; }
62fail () { echo "$*" ; exit 1 ; }
63fnmatch () { eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac" ; }
64cmdexists () { type "$1" >/dev/null 2>&1 ; }
65trycc () { test -z "$CC" && cmdexists "$1" && CC=$1 ; }
66
67stripdir () {
68while eval "fnmatch '*/' \"\${$1}\"" ; do eval "$1=\${$1%/}" ; done
69}
70
71trycppif () {
72printf "checking preprocessor condition %s... " "$1"
73echo "typedef int x;" > "$tmpc"
74echo "#if $1" >> "$tmpc"
75echo "#error yes" >> "$tmpc"
76echo "#endif" >> "$tmpc"
77if $CC $2 -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
78printf "false\n"
79return 1
80else
81printf "true\n"
82return 0
83fi
84}
85
86tryflag () {
87printf "checking whether compiler accepts %s... " "$2"
88echo "typedef int x;" > "$tmpc"
89if $CC $CFLAGS_TRY $2 -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
90printf "yes\n"
91eval "$1=\"\${$1} \$2\""
92eval "$1=\${$1# }"
93return 0
94else
95printf "no\n"
96return 1
97fi
98}
99
100tryldflag () {
101printf "checking whether linker accepts %s... " "$2"
102echo "typedef int x;" > "$tmpc"
103if $CC $LDFLAGS_TRY -nostdlib -shared "$2" -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
104printf "yes\n"
105eval "$1=\"\${$1} \$2\""
106eval "$1=\${$1# }"
107return 0
108else
109printf "no\n"
110return 1
111fi
112}
113
114
115
116# Beginning of actual script
117
118CFLAGS_C99FSE=
119CFLAGS_AUTO=
120CFLAGS_MEMOPS=
121CFLAGS_NOSSP=
122CFLAGS_TRY=
123LDFLAGS_AUTO=
124LDFLAGS_TRY=
125OPTIMIZE_GLOBS=
126srcdir=
127prefix=/usr/local/musl
128exec_prefix='$(prefix)'
129bindir='$(exec_prefix)/bin'
130libdir='$(prefix)/lib'
131includedir='$(prefix)/include'
132syslibdir='/lib'
133tools=
134tool_libs=
135build=
136target=
137optimize=auto
138debug=no
139warnings=yes
140shared=auto
141static=yes
142wrapper=auto
143gcc_wrapper=no
144clang_wrapper=no
145malloc_dir=mallocng
146
147for arg ; do
148case "$arg" in
149--help|-h) usage ;;
150--srcdir=*) srcdir=${arg#*=} ;;
151--prefix=*) prefix=${arg#*=} ;;
152--exec-prefix=*) exec_prefix=${arg#*=} ;;
153--bindir=*) bindir=${arg#*=} ;;
154--libdir=*) libdir=${arg#*=} ;;
155--includedir=*) includedir=${arg#*=} ;;
156--syslibdir=*) syslibdir=${arg#*=} ;;
157--enable-shared|--enable-shared=yes) shared=yes ;;
158--disable-shared|--enable-shared=no) shared=no ;;
159--enable-static|--enable-static=yes) static=yes ;;
160--disable-static|--enable-static=no) static=no ;;
161--enable-optimize) optimize=yes ;;
162--enable-optimize=*) optimize=${arg#*=} ;;
163--disable-optimize) optimize=no ;;
164--enable-debug|--enable-debug=yes) debug=yes ;;
165--disable-debug|--enable-debug=no) debug=no ;;
166--enable-warnings|--enable-warnings=yes) warnings=yes ;;
167--disable-warnings|--enable-warnings=no) warnings=no ;;
168--enable-wrapper|--enable-wrapper=yes) wrapper=detect ;;
169--enable-wrapper=all) wrapper=yes ; gcc_wrapper=yes ; clang_wrapper=yes ;;
170--enable-wrapper=gcc) wrapper=yes ; gcc_wrapper=yes ;;
171--enable-wrapper=clang) wrapper=yes ; clang_wrapper=yes ;;
172--disable-wrapper|--enable-wrapper=no) wrapper=no ;;
173--enable-gcc-wrapper|--enable-gcc-wrapper=yes) wrapper=yes ; gcc_wrapper=yes ;;
174--disable-gcc-wrapper|--enable-gcc-wrapper=no) wrapper=no ;;
175--with-malloc=*) malloc_dir=${arg#*=} ;;
176--enable-*|--disable-*|--with-*|--without-*|--*dir=*) ;;
177--host=*|--target=*) target=${arg#*=} ;;
178--build=*) build=${arg#*=} ;;
179-* ) echo "$0: unknown option $arg" ;;
180AR=*) AR=${arg#*=} ;;
181RANLIB=*) RANLIB=${arg#*=} ;;
182CC=*) CC=${arg#*=} ;;
183CFLAGS=*) CFLAGS=${arg#*=} ;;
184CPPFLAGS=*) CPPFLAGS=${arg#*=} ;;
185LDFLAGS=*) LDFLAGS=${arg#*=} ;;
186CROSS_COMPILE=*) CROSS_COMPILE=${arg#*=} ;;
187LIBCC=*) LIBCC=${arg#*=} ;;
188*=*) ;;
189*) build=$arg ; target=$arg ;;
190esac
191done
192
193for i in srcdir prefix exec_prefix bindir libdir includedir syslibdir ; do
194stripdir $i
195done
196
197#
198# Get the source dir for out-of-tree builds
199#
200if test -z "$srcdir" ; then
201srcdir="${0%/configure}"
202stripdir srcdir
203fi
204abs_builddir="$(pwd)" || fail "$0: cannot determine working directory"
205abs_srcdir="$(cd $srcdir && pwd)" || fail "$0: invalid source directory $srcdir"
206test "$abs_srcdir" = "$abs_builddir" && srcdir=.
207test "$srcdir" != "." && test -f Makefile && test ! -h Makefile && fail "$0: Makefile already exists in the working directory"
208
209#
210# Get a temp filename we can use
211#
212i=0
213set -C
214while : ; do i=$(($i+1))
215tmpc="./conf$$-$PPID-$i.c"
2162>|/dev/null > "$tmpc" && break
217test "$i" -gt 50 && fail "$0: cannot create temporary file $tmpc"
218done
219set +C
220trap 'rm "$tmpc"' EXIT INT QUIT TERM HUP
221
222#
223# Check that the requested malloc implementation exists
224#
225test -d "$srcdir/src/malloc/$malloc_dir" \
226|| fail "$0: error: chosen malloc implementation '$malloc_dir' does not exist"
227
228#
229# Check whether we are cross-compiling, and set a default
230# CROSS_COMPILE prefix if none was provided.
231#
232test "$target" && \
233test "$target" != "$build" && \
234test -z "$CROSS_COMPILE" && \
235CROSS_COMPILE="$target-"
236
237#
238# Find a C compiler to use
239#
240printf "checking for C compiler... "
241trycc ${CROSS_COMPILE}gcc
242trycc ${CROSS_COMPILE}c99
243trycc ${CROSS_COMPILE}cc
244printf "%s\n" "$CC"
245test -n "$CC" || { echo "$0: cannot find a C compiler" ; exit 1 ; }
246
247printf "checking whether C compiler works... "
248echo "typedef int x;" > "$tmpc"
249if output=$($CC $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" 2>&1) ; then
250printf "yes\n"
251else
252printf "no; compiler output follows:\n%s\n" "$output"
253exit 1
254fi
255
256#
257# Figure out options to force errors on unknown flags.
258#
259tryflag CFLAGS_TRY -Werror=unknown-warning-option
260tryflag CFLAGS_TRY -Werror=unused-command-line-argument
261tryflag CFLAGS_TRY -Werror=ignored-optimization-argument
262tryldflag LDFLAGS_TRY -Werror=unknown-warning-option
263tryldflag LDFLAGS_TRY -Werror=unused-command-line-argument
264
265#
266# Need to know if the compiler is gcc or clang to decide which toolchain
267# wrappers to build.
268#
269printf "checking for C compiler family... "
270cc_ver="$(LC_ALL=C $CC -v 2>&1)"
271cc_family=unknown
272if fnmatch '*gcc\ version*' "$cc_ver" ; then
273cc_family=gcc
274elif fnmatch '*clang\ version*' "$cc_ver" ; then
275cc_family=clang
276fi
277echo "$cc_family"
278
279#
280# Figure out toolchain wrapper to build
281#
282if test "$wrapper" = auto || test "$wrapper" = detect ; then
283echo "#include <stdlib.h>" > "$tmpc"
284echo "#if ! __GLIBC__" >> "$tmpc"
285echo "#error no" >> "$tmpc"
286echo "#endif" >> "$tmpc"
287printf "checking for toolchain wrapper to build... "
288if test "$wrapper" = auto && ! $CC -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
289echo "none"
290elif test "$cc_family" = gcc ; then
291gcc_wrapper=yes
292echo "gcc"
293elif test "$cc_family" = clang ; then
294clang_wrapper=yes
295echo "clang"
296else
297echo "none"
298if test "$wrapper" = detect ; then
299fail "$0: could not find an appropriate toolchain wrapper"
300fi
301fi
302fi
303
304if test "$gcc_wrapper" = yes ; then
305tools="$tools obj/musl-gcc"
306tool_libs="$tool_libs lib/musl-gcc.specs"
307fi
308if test "$clang_wrapper" = yes ; then
309tools="$tools obj/musl-clang obj/ld.musl-clang"
310fi
311
312#
313# Find the target architecture
314#
315printf "checking target system type... "
316test -n "$target" || target=$($CC -dumpmachine 2>/dev/null) || target=unknown
317printf "%s\n" "$target"
318
319#
320# Convert to just ARCH
321#
322case "$target" in
323# Catch these early to simplify matching for 32-bit archs
324arm*) ARCH=arm ;;
325aarch64*) ARCH=aarch64 ;;
326i?86-nt32*) ARCH=nt32 ;;
327i?86*) ARCH=i386 ;;
328x86_64-x32*|x32*|x86_64*x32) ARCH=x32 ;;
329x86_64-nt64*) ARCH=nt64 ;;
330x86_64*) ARCH=x86_64 ;;
331m68k*) ARCH=m68k ;;
332mips64*|mipsisa64*) ARCH=mips64 ;;
333mips*) ARCH=mips ;;
334microblaze*) ARCH=microblaze ;;
335or1k*) ARCH=or1k ;;
336powerpc64*|ppc64*) ARCH=powerpc64 ;;
337powerpc*|ppc*) ARCH=powerpc ;;
338riscv64*) ARCH=riscv64 ;;
339sh[1-9bel-]*|sh|superh*) ARCH=sh ;;
340s390x*) ARCH=s390x ;;
341wasm32) ARCH=wasm32 ;;
342wasm64) ARCH=wasm64 ;;
343unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;;
344*) fail "$0: unknown or unsupported target \"$target\"" ;;
345esac
346
347#
348# Try to get a conforming C99 freestanding environment
349#
350tryflag CFLAGS_C99FSE -std=c99
351tryflag CFLAGS_C99FSE -nostdinc
352tryflag CFLAGS_C99FSE -ffreestanding \
353|| tryflag CFLAGS_C99FSE -fno-builtin
354tryflag CFLAGS_C99FSE -fexcess-precision=standard \
355|| { test "$ARCH" = i386 && tryflag CFLAGS_C99FSE -ffloat-store ; }
356tryflag CFLAGS_C99FSE -frounding-math
357
358#
359# We may use the may_alias attribute if __GNUC__ is defined, so
360# if the compiler defines __GNUC__ but does not provide it,
361# it must be defined away as part of the CFLAGS.
362#
363printf "checking whether compiler needs attribute((may_alias)) suppression... "
364cat > "$tmpc" <<EOF
365typedef int
366#ifdef __GNUC__
367__attribute__((__may_alias__))
368#endif
369x;
370EOF
371if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS \
372 -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
373printf "no\n"
374else
375printf "yes\n"
376CFLAGS_C99FSE="$CFLAGS_C99FSE -D__may_alias__="
377fi
378
379#
380# The GNU toolchain defaults to assuming unmarked files need an
381# executable stack, potentially exposing vulnerabilities in programs
382# linked with such object files. Fix this.
383#
384tryflag CFLAGS_C99FSE -Wa,--noexecstack
385
386#
387# Check for options to disable stack protector, which needs to be
388# disabled for a few early-bootstrap translation units. If not found,
389# this is not an error; we assume the toolchain does not do ssp.
390#
391tryflag CFLAGS_NOSSP -fno-stack-protector
392
393#
394# Check for options that may be needed to prevent the compiler from
395# generating self-referential versions of memcpy,, memmove, memcmp,
396# and memset. Really, we should add a check to determine if this
397# option is sufficient, and if not, add a macro to cripple these
398# functions with volatile...
399#
400tryflag CFLAGS_MEMOPS -fno-tree-loop-distribute-patterns
401
402#
403# Enable debugging if requessted.
404#
405test "$debug" = yes && CFLAGS_AUTO=-g
406
407#
408# Preprocess asm files to add extra debugging information if debug is
409# enabled, our assembler supports the needed directives, and the
410# preprocessing script has been written for our architecture.
411#
412printf "checking whether we should preprocess assembly to add debugging information... "
413if fnmatch '-g*|*\ -g*' "$CFLAGS_AUTO $CFLAGS" &&
414 test -f "tools/add-cfi.$ARCH.awk" &&
415 printf ".file 1 \"srcfile.s\"\n.line 1\n.cfi_startproc\n.cfi_endproc" | $CC -g -x assembler -c -o /dev/null 2>/dev/null -
416then
417 ADD_CFI=yes
418else
419 ADD_CFI=no
420fi
421printf "%s\n" "$ADD_CFI"
422
423#
424# Possibly add a -O option to CFLAGS and select modules to optimize with
425# -O3 based on the status of --enable-optimize and provided CFLAGS.
426#
427printf "checking for optimization settings... "
428case "x$optimize" in
429xauto)
430if fnmatch '-O*|*\ -O*' "$CFLAGS_AUTO $CFLAGS" ; then
431printf "using provided CFLAGS\n" ;optimize=no
432else
433printf "using defaults\n" ; optimize=yes
434fi
435;;
436xsize|xnone) printf "minimize size\n" ; optimize=size ;;
437xno|x) printf "disabled\n" ; optimize=no ;;
438*) printf "custom\n" ;;
439esac
440
441test "$optimize" = no || tryflag CFLAGS_AUTO -Os || tryflag CFLAGS_AUTO -O2
442test "$optimize" = yes && optimize="internal,malloc,string"
443
444if fnmatch 'no|size' "$optimize" ; then :
445else
446printf "components to be optimized for speed:"
447while test "$optimize" ; do
448case "$optimize" in
449*,*) this=${optimize%%,*} optimize=${optimize#*,} ;;
450*) this=$optimize optimize=
451esac
452printf " $this"
453case "$this" in
454*/*.c) ;;
455*/*) this=$this*.c ;;
456*) this=$this/*.c ;;
457esac
458OPTIMIZE_GLOBS="$OPTIMIZE_GLOBS $this"
459done
460OPTIMIZE_GLOBS=${OPTIMIZE_GLOBS# }
461printf "\n"
462fi
463
464# Always try -pipe
465tryflag CFLAGS_AUTO -pipe
466
467#
468# If debugging is disabled, omit frame pointer. Modern GCC does this
469# anyway on most archs even when debugging is enabled since the frame
470# pointer is no longer needed for debugging.
471#
472if fnmatch '-g*|*\ -g*' "$CFLAGS_AUTO $CFLAGS" ; then :
473else
474tryflag CFLAGS_AUTO -fomit-frame-pointer
475fi
476
477#
478# Modern GCC wants to put DWARF tables (used for debugging and
479# unwinding) in the loaded part of the program where they are
480# unstrippable. These options force them back to debug sections (and
481# cause them not to get generated at all if debugging is off).
482#
483tryflag CFLAGS_AUTO -fno-unwind-tables
484tryflag CFLAGS_AUTO -fno-asynchronous-unwind-tables
485
486#
487# Attempt to put each function and each data object in its own
488# section. This both allows additional size optimizations at link
489# time and works around a dangerous class of compiler/assembler bugs
490# whereby relative address expressions are constant-folded by the
491# assembler even when one or more of the symbols involved is
492# replaceable. See gas pr 18561 and gcc pr 66609, 68178, etc.
493#
494tryflag CFLAGS_AUTO -ffunction-sections
495tryflag CFLAGS_AUTO -fdata-sections
496
497#
498# On x86, make sure we don't have incompatible instruction set
499# extensions enabled by default. This is bad for making static binaries.
500# We cheat and use i486 rather than i386 because i386 really does not
501# work anyway (issues with atomic ops).
502# Some build environments pass -march and -mtune options via CC, so
503# check both CC and CFLAGS.
504#
505if test "$ARCH" = "i386" ; then
506fnmatch '-march=*|*\ -march=*' "$CC $CFLAGS" || tryldflag CFLAGS_AUTO -march=i486
507fnmatch '-mtune=*|*\ -mtune=*' "$CC $CFLAGS" || tryldflag CFLAGS_AUTO -mtune=generic
508fi
509
510#
511# GCC defines -w as overriding any -W options, regardless of order, but
512# clang has a bunch of annoying warnings enabled by default and needs -w
513# to start from a clean slate. So use -w if building with clang. Also
514# turn off a common on-by-default cast warning regardless of compiler.
515#
516test "$cc_family" = clang && tryflag CFLAGS_AUTO -w
517
518tryflag CFLAGS_AUTO -Wno-pointer-to-int-cast
519
520#
521# Even with -std=c99, gcc accepts some constructs which are constraint
522# violations. We want to treat these as errors regardless of whether
523# other purely stylistic warnings are enabled -- especially implicit
524# function declarations, which are a dangerous programming error.
525#
526tryflag CFLAGS_AUTO -Werror=implicit-function-declaration
527tryflag CFLAGS_AUTO -Werror=implicit-int
528tryflag CFLAGS_AUTO -Werror=pointer-sign
529tryflag CFLAGS_AUTO -Werror=pointer-arith
530tryflag CFLAGS_AUTO -Werror=int-conversion
531tryflag CFLAGS_AUTO -Werror=incompatible-pointer-types
532tryflag CFLAGS_AUTO -Werror=discarded-qualifiers
533tryflag CFLAGS_AUTO -Werror=discarded-array-qualifiers
534
535#
536# GCC ignores unused arguements by default, but Clang needs this extra
537# parameter to stop printing warnings about LDFLAGS passed during
538# compiling stage and CFLAGS passed during linking stage.
539#
540test "$cc_family" = clang && tryflag CFLAGS_AUTO -Qunused-arguments
541
542if test "x$warnings" = xyes ; then
543tryflag CFLAGS_AUTO -Waddress
544tryflag CFLAGS_AUTO -Warray-bounds
545tryflag CFLAGS_AUTO -Wchar-subscripts
546tryflag CFLAGS_AUTO -Wduplicate-decl-specifier
547tryflag CFLAGS_AUTO -Winit-self
548tryflag CFLAGS_AUTO -Wreturn-type
549tryflag CFLAGS_AUTO -Wsequence-point
550tryflag CFLAGS_AUTO -Wstrict-aliasing
551tryflag CFLAGS_AUTO -Wunused-function
552tryflag CFLAGS_AUTO -Wunused-label
553tryflag CFLAGS_AUTO -Wunused-variable
554fi
555
556# Determine if the compiler produces position-independent code (PIC)
557# by default. If so, we don't need to compile separate object files
558# for libc.a and libc.so.
559if trycppif __PIC__ "$CFLAGS_C99FSE $CPPFLAGS $CFLAGS" ; then
560pic_default=yes
561else
562pic_default=no
563fi
564
565# Reduce space lost to padding for alignment purposes by sorting data
566# objects according to their alignment reqirements. This approximates
567# optimal packing.
568tryldflag LDFLAGS_AUTO -Wl,--sort-section,alignment
569tryldflag LDFLAGS_AUTO -Wl,--sort-common
570
571# When linking shared library, drop dummy weak definitions that were
572# replaced by strong definitions from other translation units.
573tryldflag LDFLAGS_AUTO -Wl,--gc-sections
574
575# Some patched GCC builds have these defaults messed up...
576tryldflag LDFLAGS_AUTO -Wl,--hash-style=both
577
578# Prevent linking if there are undefined symbols; if any exist,
579# libc.so will crash at runtime during relocation processing.
580# The common way this can happen is failure to link the compiler
581# runtime library; implementation error is also a possibility.
582tryldflag LDFLAGS_AUTO -Wl,--no-undefined
583
584# Avoid exporting symbols from compiler runtime libraries. They
585# should be hidden anyway, but some toolchains including old gcc
586# versions built without shared library support and pcc are broken.
587tryldflag LDFLAGS_AUTO -Wl,--exclude-libs=ALL
588
589# Public data symbols must be interposable to allow for copy
590# relocations, but otherwise we want to bind symbols at libc link
591# time to eliminate startup relocations and PLT overhead. Use
592# --dynamic-list rather than -Bsymbolic-functions for greater
593# control over what symbols are left unbound.
594tryldflag LDFLAGS_AUTO -Wl,--dynamic-list="$srcdir/dynamic.list"
595
596# Find compiler runtime library
597test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
598test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt
599test -z "$LIBCC" && try_libcc=`$CC -print-libgcc-file-name 2>/dev/null` \
600 && tryldflag LIBCC "$try_libcc"
601test -z "$LIBCC" && try_libcc=`$CC -print-file-name=libpcc.a 2>/dev/null` \
602 && tryldflag LIBCC "$try_libcc"
603printf "using compiler runtime libraries: %s\n" "$LIBCC"
604
605# Figure out arch variants for archs with variants
606SUBARCH=
607t="$CFLAGS_C99FSE $CPPFLAGS $CFLAGS"
608
609if test "$ARCH" = "i386" ; then
610printf "checking whether compiler can use ebx in PIC asm constraints... "
611cat > "$tmpc" <<EOF
612int foo(int x) { __asm__ ( "" : "+b"(x) ); return x; }
613EOF
614if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -fPIC \
615 -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
616printf "yes\n"
617else
618printf "no\n"
619CFLAGS_AUTO="$CFLAGS_AUTO -DBROKEN_EBX_ASM"
620fi
621fi
622
623if test "$ARCH" = "x86_64" ; then
624trycppif __ILP32__ "$t" && ARCH=x32
625fi
626
627if test "$ARCH" = "arm" ; then
628if trycppif __thumb2__ "$t" ; then
629tryflag CFLAGS_AUTO -mimplicit-it=always
630tryflag CFLAGS_AUTO -Wa,-mimplicit-it=always
631tryflag CFLAGS_AUTO -Wa,-mthumb
632fi
633trycppif __ARMEB__ "$t" && SUBARCH=${SUBARCH}eb
634trycppif __ARM_PCS_VFP "$t" && SUBARCH=${SUBARCH}hf
635# Versions of clang up until at least 3.8 have the wrong constraint codes
636# for floating point operands to inline asm. Detect this so the affected
637# source files can just disable the asm.
638if test "$cc_family" = clang ; then
639printf "checking whether clang's vfp asm constraints work... "
640echo 'float f(float x) { __asm__("":"+t"(x)); return x; }' > "$tmpc"
641if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
642printf "yes\n"
643else
644printf "no\n"
645CFLAGS_AUTO="$CFLAGS_AUTO -DBROKEN_VFP_ASM"
646CFLAGS_AUTO="${CFLAGS_AUTO# }"
647fi
648fi
649fi
650
651if test "$ARCH" = "aarch64" ; then
652trycppif __AARCH64EB__ "$t" && SUBARCH=${SUBARCH}_be
653fi
654
655if test "$ARCH" = "m68k" ; then
656if trycppif "__HAVE_68881__" ; then : ;
657elif trycppif "__mcffpu__" ; then SUBARCH="-fp64"
658else SUBARCH="-sf"
659fi
660fi
661
662if test "$ARCH" = "mips" ; then
663trycppif "__mips_isa_rev >= 6" "$t" && SUBARCH=${SUBARCH}r6
664trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el
665trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf
666fi
667
668if test "$ARCH" = "mips64" ; then
669trycppif "_MIPS_SIM != _ABI64" "$t" && ARCH=mipsn32
670trycppif "__mips_isa_rev >= 6" "$t" && SUBARCH=${SUBARCH}r6
671trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el
672trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf
673fi
674
675if test "$ARCH" = "powerpc" ; then
676trycppif "__NO_FPRS__ && !_SOFT_FLOAT" "$t" && fail \
677 "$0: error: compiler's floating point configuration is unsupported"
678trycppif _SOFT_FLOAT "$t" && SUBARCH=${SUBARCH}-sf
679printf "checking whether compiler can use 'd' constraint in asm... "
680echo 'double f(double x) { __asm__ ("fabs %0, %1" : "=d"(x) : "d"(x)); return x; }' > "$tmpc"
681if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
682printf "yes\n"
683else
684printf "no\n"
685CFLAGS_AUTO="$CFLAGS_AUTO -DBROKEN_PPC_D_ASM"
686CFLAGS_AUTO="${CFLAGS_AUTO# }"
687fi
688fi
689
690test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \
691&& SUBARCH=${SUBARCH}el
692
693if test "$ARCH" = "powerpc64" ; then
694trycppif "_CALL_ELF == 2" "$t" || fail "$0: error: unsupported powerpc64 ABI"
695trycppif __LITTLE_ENDIAN__ "$t" && SUBARCH=${SUBARCH}le
696trycppif _SOFT_FLOAT "$t" && fail "$0: error: soft-float not supported on powerpc64"
697fi
698
699if test "$ARCH" = "riscv64" ; then
700trycppif __riscv_float_abi_soft "$t" && SUBARCH=${SUBARCH}-sf
701trycppif __riscv_float_abi_single "$t" && SUBARCH=${SUBARCH}-sp
702fi
703
704if test "$ARCH" = "sh" ; then
705tryflag CFLAGS_AUTO -Wa,--isa=any
706trycppif __BIG_ENDIAN__ "$t" && SUBARCH=${SUBARCH}eb
707if trycppif "__SH_FPU_ANY__ || __SH4__" "$t" ; then
708# Some sh configurations are broken and replace double with float
709# rather than using softfloat when the fpu is present but only
710# supports single precision. Reject them.
711printf "checking whether compiler's double type is IEEE double... "
712echo 'typedef char dblcheck[(int)sizeof(double)-5];' > "$tmpc"
713if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
714printf "yes\n"
715else
716printf "no\n"
717fail "$0: error: compiler's floating point configuration is unsupported"
718fi
719else
720SUBARCH=${SUBARCH}-nofpu
721fi
722if trycppif __SH_FDPIC__ "$t" ; then
723SUBARCH=${SUBARCH}-fdpic
724fi
725fi
726
727test "$SUBARCH" \
728&& printf "configured for %s variant: %s\n" "$ARCH" "$ARCH$SUBARCH"
729
730case "$ARCH$SUBARCH" in
731arm) ASMSUBARCH=el ;;
732*) ASMSUBARCH=$SUBARCH ;;
733esac
734
735#
736# Some archs (powerpc) have different possible long double formats
737# that the compiler can be configured for. The logic for whether this
738# is supported is in bits/float.h; in general, it is not. We need to
739# check for mismatches here or code in printf, strotd, and scanf will
740# be dangerously incorrect because it depends on (1) the macros being
741# correct, and (2) IEEE semantics.
742#
743printf "checking whether compiler's long double definition matches float.h... "
744echo '#include <float.h>' > "$tmpc"
745echo '#define C(m,s) (m==LDBL_MANT_DIG && s==sizeof(long double))' >> "$tmpc"
746echo 'typedef char ldcheck[(C(53,8)||C(64,12)||C(64,16)||C(113,16))*2-1];' >> "$tmpc"
747if $CC $CFLAGS_C99FSE \
748 -I$srcdir/arch/$ARCH -I$srcdir/arch/generic -I$srcdir/include \
749 $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
750printf "yes\n"
751else
752printf "no\n"
753fail "$0: error: unsupported long double type"
754fi
755
756#
757# Some build systems globally pass in broken CFLAGS like -ffast-math
758# for all packages. On recent GCC we can detect this and error out
759# early rather than producing a seriously-broken math library.
760#
761if trycppif "__FAST_MATH__" \
762 "$CFLAGS_C99FSE $CPPFLAGS $CFLAGS" ; then
763fail "$0: error: compiler has broken floating point; check CFLAGS"
764fi
765
766printf "creating config.mak... "
767
768cmdline=$(quote "$0")
769for i ; do cmdline="$cmdline $(quote "$i")" ; done
770
771exec 3>&1 1>config.mak
772
773
774cat << EOF
775# This version of config.mak was generated by:
776# $cmdline
777# Any changes made here will be lost if configure is re-run
778AR = ${AR:-\$(CROSS_COMPILE)ar}
779RANLIB = ${RANLIB:-\$(CROSS_COMPILE)ranlib}
780ARCH = $ARCH
781SUBARCH = $SUBARCH
782ASMSUBARCH = $ASMSUBARCH
783srcdir = $srcdir
784prefix = $prefix
785exec_prefix = $exec_prefix
786bindir = $bindir
787libdir = $libdir
788includedir = $includedir
789syslibdir = $syslibdir
790CC = $CC
791CFLAGS = $CFLAGS
792CFLAGS_AUTO = $CFLAGS_AUTO
793CFLAGS_C99FSE = $CFLAGS_C99FSE
794CFLAGS_MEMOPS = $CFLAGS_MEMOPS
795CFLAGS_NOSSP = $CFLAGS_NOSSP
796CPPFLAGS = $CPPFLAGS
797LDFLAGS = $LDFLAGS
798LDFLAGS_AUTO = $LDFLAGS_AUTO
799CROSS_COMPILE = $CROSS_COMPILE
800LIBCC = $LIBCC
801OPTIMIZE_GLOBS = $OPTIMIZE_GLOBS
802ALL_TOOLS = $tools
803TOOL_LIBS = $tool_libs
804ADD_CFI = $ADD_CFI
805MALLOC_DIR = $malloc_dir
806EOF
807test "x$static" = xno && echo "STATIC_LIBS ="
808test "x$shared" = xno && echo "SHARED_LIBS ="
809test "x$cc_family" = xgcc && echo 'WRAPCC_GCC = $(CC)'
810test "x$cc_family" = xclang && echo 'WRAPCC_CLANG = $(CC)'
811test "x$pic_default" = xyes && echo 'AOBJS = $(LOBJS)'
812exec 1>&3 3>&-
813
814test "$srcdir" = "." || ln -sf $srcdir/Makefile .
815
816printf "done\n"
lib/libc/wasi/libc-top-half/musl/crt/Scrt1.c deleted-1
...@@ -1 +0,0 @@
1#include "crt1.c"
lib/libc/wasi/libc-top-half/musl/crt/aarch64/crti.s deleted-13
...@@ -1,13 +0,0 @@
1.section .init
2.global _init
3.type _init,%function
4_init:
5 stp x29,x30,[sp,-16]!
6 mov x29,sp
7
8.section .fini
9.global _fini
10.type _fini,%function
11_fini:
12 stp x29,x30,[sp,-16]!
13 mov x29,sp
lib/libc/wasi/libc-top-half/musl/crt/aarch64/crtn.s deleted-7
...@@ -1,7 +0,0 @@
1.section .init
2 ldp x29,x30,[sp],#16
3 ret
4
5.section .fini
6 ldp x29,x30,[sp],#16
7 ret
lib/libc/wasi/libc-top-half/musl/crt/arm/crti.s deleted-13
...@@ -1,13 +0,0 @@
1.syntax unified
2
3.section .init
4.global _init
5.type _init,%function
6_init:
7 push {r0,lr}
8
9.section .fini
10.global _fini
11.type _fini,%function
12_fini:
13 push {r0,lr}
lib/libc/wasi/libc-top-half/musl/crt/arm/crtn.s deleted-9
...@@ -1,9 +0,0 @@
1.syntax unified
2
3.section .init
4 pop {r0,lr}
5 bx lr
6
7.section .fini
8 pop {r0,lr}
9 bx lr
lib/libc/wasi/libc-top-half/musl/crt/crt1.c deleted-19
...@@ -1,19 +0,0 @@
1#include <features.h>
2#include "libc.h"
3
4#define START "_start"
5
6#include "crt_arch.h"
7
8int main();
9weak void _init();
10weak void _fini();
11int __libc_start_main(int (*)(), int, char **,
12 void (*)(), void(*)(), void(*)());
13
14void _start_c(long *p)
15{
16 int argc = p[0];
17 char **argv = (void *)(p+1);
18 __libc_start_main(main, argc, argv, _init, _fini, 0);
19}
lib/libc/wasi/libc-top-half/musl/crt/crti.c deleted
lib/libc/wasi/libc-top-half/musl/crt/crtn.c deleted
lib/libc/wasi/libc-top-half/musl/crt/i386/crti.s deleted-9
...@@ -1,9 +0,0 @@
1.section .init
2.global _init
3_init:
4 sub $12,%esp
5
6.section .fini
7.global _fini
8_fini:
9 sub $12,%esp
lib/libc/wasi/libc-top-half/musl/crt/i386/crtn.s deleted-7
...@@ -1,7 +0,0 @@
1.section .init
2 add $12,%esp
3 ret
4
5.section .fini
6 add $12,%esp
7 ret
lib/libc/wasi/libc-top-half/musl/crt/microblaze/crti.s deleted-13
...@@ -1,13 +0,0 @@
1.section .init
2.global _init
3.align 2
4_init:
5 addi r1, r1, -32
6 swi r15, r1, 0
7
8.section .fini
9.global _fini
10.align 2
11_fini:
12 addi r1, r1, -32
13 swi r15, r1, 0
lib/libc/wasi/libc-top-half/musl/crt/microblaze/crtn.s deleted-9
...@@ -1,9 +0,0 @@
1.section .init
2 lwi r15, r1, 0
3 rtsd r15, 8
4 addi r1, r1, 32
5
6.section .fini
7 lwi r15, r1, 0
8 rtsd r15, 8
9 addi r1, r1, 32
lib/libc/wasi/libc-top-half/musl/crt/mips/crti.s deleted-19
...@@ -1,19 +0,0 @@
1.set noreorder
2
3.section .init
4.global _init
5.type _init,@function
6.align 2
7_init:
8 subu $sp,$sp,32
9 sw $gp,24($sp)
10 sw $ra,28($sp)
11
12.section .fini
13.global _fini
14.type _fini,@function
15.align 2
16_fini:
17 subu $sp,$sp,32
18 sw $gp,24($sp)
19 sw $ra,28($sp)
lib/libc/wasi/libc-top-half/musl/crt/mips/crtn.s deleted-13
...@@ -1,13 +0,0 @@
1.set noreorder
2
3.section .init
4 lw $gp,24($sp)
5 lw $ra,28($sp)
6 j $ra
7 addu $sp,$sp,32
8
9.section .fini
10 lw $gp,24($sp)
11 lw $ra,28($sp)
12 j $ra
13 addu $sp,$sp,32
lib/libc/wasi/libc-top-half/musl/crt/mips64/crti.s deleted-17
...@@ -1,17 +0,0 @@
1.set noreorder
2
3.section .init
4.global _init
5.align 3
6_init:
7 dsubu $sp, $sp, 32
8 sd $gp, 16($sp)
9 sd $ra, 24($sp)
10
11.section .fini
12.global _fini
13.align 3
14_fini:
15 dsubu $sp, $sp, 32
16 sd $gp, 16($sp)
17 sd $ra, 24($sp)
lib/libc/wasi/libc-top-half/musl/crt/mips64/crtn.s deleted-13
...@@ -1,13 +0,0 @@
1.set noreorder
2
3.section .init
4 ld $gp,16($sp)
5 ld $ra,24($sp)
6 j $ra
7 daddu $sp,$sp,32
8
9.section .fini
10 ld $gp,16($sp)
11 ld $ra,24($sp)
12 j $ra
13 daddu $sp,$sp,32
lib/libc/wasi/libc-top-half/musl/crt/mipsn32/crti.s deleted-18
...@@ -1,18 +0,0 @@
1.set noreorder
2.section .init
3.global _init
4.type _init,@function
5.align 2
6_init:
7 subu $sp, $sp, 32
8 sd $gp, 16($sp)
9 sd $ra, 24($sp)
10
11.section .fini
12.global _fini
13.type _fini,@function
14.align 2
15_fini:
16 subu $sp, $sp, 32
17 sd $gp, 16($sp)
18 sd $ra, 24($sp)
lib/libc/wasi/libc-top-half/musl/crt/mipsn32/crtn.s deleted-12
...@@ -1,12 +0,0 @@
1.set noreorder
2.section .init
3 ld $gp, 16($sp)
4 ld $ra, 24($sp)
5 j $ra
6 addu $sp, $sp, 32
7
8.section .fini
9 ld $gp, 16($sp)
10 ld $ra, 24($sp)
11 j $ra
12 addu $sp, $sp, 32
lib/libc/wasi/libc-top-half/musl/crt/or1k/crti.s deleted-11
...@@ -1,11 +0,0 @@
1.section .init
2.global _init
3_init:
4 l.addi r1,r1,-4
5 l.sw 0(r1),r9
6
7.section .fini
8.global _fini
9_fini:
10 l.addi r1,r1,-4
11 l.sw 0(r1),r9
lib/libc/wasi/libc-top-half/musl/crt/or1k/crtn.s deleted-9
...@@ -1,9 +0,0 @@
1.section .init
2 l.lwz r9,0(r1)
3 l.jr r9
4 l.addi r1,r1,4
5
6.section .fini
7 l.lwz r9,0(r1)
8 l.jr r9
9 l.addi r1,r1,4
lib/libc/wasi/libc-top-half/musl/crt/powerpc/crti.s deleted-15
...@@ -1,15 +0,0 @@
1.section .init
2.align 2
3.global _init
4_init:
5 stwu 1,-32(1)
6 mflr 0
7 stw 0,36(1)
8
9.section .fini
10.align 2
11.global _fini
12_fini:
13 stwu 1,-32(1)
14 mflr 0
15 stw 0,36(1)
lib/libc/wasi/libc-top-half/musl/crt/powerpc/crtn.s deleted-13
...@@ -1,13 +0,0 @@
1.section .init
2.align 2
3 lwz 0,36(1)
4 addi 1,1,32
5 mtlr 0
6 blr
7
8.section .fini
9.align 2
10 lwz 0,36(1)
11 addi 1,1,32
12 mtlr 0
13 blr
lib/libc/wasi/libc-top-half/musl/crt/powerpc64/crti.s deleted-21
...@@ -1,21 +0,0 @@
1.section .init
2.align 2
3.global _init
4_init:
5 addis 2, 12, .TOC.-_init@ha
6 addi 2, 2, .TOC.-_init@l
7 .localentry _init,.-_init
8 mflr 0
9 std 0, 16(1)
10 stdu 1,-32(1)
11
12.section .fini
13.align 2
14.global _fini
15_fini:
16 addis 2, 12, .TOC.-_fini@ha
17 addi 2, 2, .TOC.-_fini@l
18 .localentry _fini,.-_fini
19 mflr 0
20 std 0, 16(1)
21 stdu 1,-32(1)
lib/libc/wasi/libc-top-half/musl/crt/powerpc64/crtn.s deleted-13
...@@ -1,13 +0,0 @@
1.section .init
2.align 2
3 addi 1, 1, 32
4 ld 0, 16(1)
5 mtlr 0
6 blr
7
8.section .fini
9.align 2
10 addi 1, 1, 32
11 ld 0, 16(1)
12 mtlr 0
13 blr
lib/libc/wasi/libc-top-half/musl/crt/rcrt1.c deleted-14
...@@ -1,14 +0,0 @@
1#define START "_start"
2#define _dlstart_c _start_c
3#include "../ldso/dlstart.c"
4
5int main();
6weak void _init();
7weak void _fini();
8int __libc_start_main(int (*)(), int, char **,
9 void (*)(), void(*)(), void(*)());
10
11hidden void __dls2(unsigned char *base, size_t *sp)
12{
13 __libc_start_main(main, *sp, (void *)(sp+1), _init, _fini, 0);
14}
lib/libc/wasi/libc-top-half/musl/crt/s390x/crti.s deleted-17
...@@ -1,17 +0,0 @@
1.section .init
2.align 2
3.global _init
4_init:
5 stmg %r14, %r15, 112(%r15)
6 lgr %r0, %r15
7 aghi %r15, -160
8 stg %r0, 0(%r15)
9
10.section .fini
11.align 2
12.global _fini
13_fini:
14 stmg %r14, %r15, 112(%r15)
15 lgr %r0, %r15
16 aghi %r15, -160
17 stg %r0, 0(%r15)
lib/libc/wasi/libc-top-half/musl/crt/s390x/crtn.s deleted-9
...@@ -1,9 +0,0 @@
1.section .init
2.align 2
3 lmg %r14, %r15, 272(%r15)
4 br %r14
5
6.section .fini
7.align 2
8 lmg %r14, %r15, 272(%r15)
9 br %r14
lib/libc/wasi/libc-top-half/musl/crt/sh/crti.s deleted-21
...@@ -1,21 +0,0 @@
1.section .init
2.global _init
3.type _init, @function
4_init:
5 add #-4, r15
6 mov.l r12, @-r15
7 mov.l r14, @-r15
8 sts.l pr, @-r15
9 mov r15, r14
10 nop
11
12.section .fini
13.global _fini
14.type _fini, @function
15_fini:
16 add #-4, r15
17 mov.l r12, @-r15
18 mov.l r14, @-r15
19 sts.l pr, @-r15
20 mov r15, r14
21 nop
lib/libc/wasi/libc-top-half/musl/crt/sh/crtn.s deleted-13
...@@ -1,13 +0,0 @@
1.section .init
2 lds.l @r15+, pr
3 mov.l @r15+, r14
4 mov.l @r15+, r12
5 rts
6 add #4, r15
7
8.section .fini
9 lds.l @r15+, pr
10 mov.l @r15+, r14
11 mov.l @r15+, r12
12 rts
13 add #4, r15
lib/libc/wasi/libc-top-half/musl/crt/x32/crti.s deleted-9
...@@ -1,9 +0,0 @@
1.section .init
2.global _init
3_init:
4 push %rax
5
6.section .fini
7.global _fini
8_fini:
9 push %rax
lib/libc/wasi/libc-top-half/musl/crt/x32/crtn.s deleted-7
...@@ -1,7 +0,0 @@
1.section .init
2 pop %rax
3 ret
4
5.section .fini
6 pop %rax
7 ret
lib/libc/wasi/libc-top-half/musl/crt/x86_64/crti.s deleted-9
...@@ -1,9 +0,0 @@
1.section .init
2.global _init
3_init:
4 push %rax
5
6.section .fini
7.global _fini
8_fini:
9 push %rax
lib/libc/wasi/libc-top-half/musl/crt/x86_64/crtn.s deleted-7
...@@ -1,7 +0,0 @@
1.section .init
2 pop %rax
3 ret
4
5.section .fini
6 pop %rax
7 ret
lib/libc/wasi/libc-top-half/musl/dist/config.mak deleted-36
...@@ -1,36 +0,0 @@
1#
2# musl config.mak template (original in dist/config.mak)
3#
4
5# Target CPU architecture. Supported values: i386, x86_64
6ARCH = i386
7
8# Installation prefix. DO NOT use /, /usr, or /usr/local !
9prefix = /usr/local/musl
10
11# Installation prefix for musl-gcc compiler wrapper.
12exec_prefix = /usr/local
13
14# Location for the dynamic linker ld-musl-$(ARCH).so.1
15syslibdir = /lib
16
17# Uncomment if you want to build i386 musl on a 64-bit host
18#CFLAGS += -m32
19
20# Uncomment to fix broken distro-patched toolchains where hash-style=gnu(only)
21#LDFLAGS += -Wl,--hash-style,both
22
23# Uncomment to fix broken distro-patched toolchains where stack-protector=on
24#CFLAGS += -fno-stack-protector
25
26# Uncomment for smaller code size.
27#CFLAGS += -fomit-frame-pointer -mno-accumulate-outgoing-args
28
29# Uncomment to omit massive GCC4 DWARF2 bloat (only useful for debugging)
30#CFLAGS += -fno-asynchronous-unwind-tables
31
32# Uncomment for warnings (as errors). Might need tuning to your gcc version.
33#CFLAGS += -Werror -Wall -Wpointer-arith -Wcast-align -Wno-parentheses -Wno-char-subscripts -Wno-uninitialized -Wno-sequence-point -Wno-missing-braces -Wno-unused-value -Wno-overflow -Wno-int-to-pointer-cast
34
35# Uncomment if you want to disable building the shared library.
36#SHARED_LIBS =
lib/libc/wasi/libc-top-half/musl/dynamic.list deleted-45
...@@ -1,45 +0,0 @@
1{
2environ;
3__environ;
4
5stdin;
6stdout;
7stderr;
8
9malloc;
10calloc;
11realloc;
12free;
13memalign;
14posix_memalign;
15aligned_alloc;
16malloc_usable_size;
17
18timezone;
19daylight;
20tzname;
21__timezone;
22__daylight;
23__tzname;
24
25signgam;
26__signgam;
27
28optarg;
29optind;
30opterr;
31optopt;
32optreset;
33__optreset;
34
35getdate_err;
36
37h_errno;
38
39program_invocation_name;
40program_invocation_short_name;
41__progname;
42__progname_full;
43
44__stack_chk_guard;
45};
lib/libc/wasi/libc-top-half/musl/ldso/dlstart.c deleted-148
...@@ -1,148 +0,0 @@
1#include <stddef.h>
2#include "dynlink.h"
3#include "libc.h"
4
5#ifndef START
6#define START "_dlstart"
7#endif
8
9#define SHARED
10
11#include "crt_arch.h"
12
13#ifndef GETFUNCSYM
14#define GETFUNCSYM(fp, sym, got) do { \
15 hidden void sym(); \
16 static void (*static_func_ptr)() = sym; \
17 __asm__ __volatile__ ( "" : "+m"(static_func_ptr) : : "memory"); \
18 *(fp) = static_func_ptr; } while(0)
19#endif
20
21hidden void _dlstart_c(size_t *sp, size_t *dynv)
22{
23 size_t i, aux[AUX_CNT], dyn[DYN_CNT];
24 size_t *rel, rel_size, base;
25
26 int argc = *sp;
27 char **argv = (void *)(sp+1);
28
29 for (i=argc+1; argv[i]; i++);
30 size_t *auxv = (void *)(argv+i+1);
31
32 for (i=0; i<AUX_CNT; i++) aux[i] = 0;
33 for (i=0; auxv[i]; i+=2) if (auxv[i]<AUX_CNT)
34 aux[auxv[i]] = auxv[i+1];
35
36#if DL_FDPIC
37 struct fdpic_loadseg *segs, fakeseg;
38 size_t j;
39 if (dynv) {
40 /* crt_arch.h entry point asm is responsible for reserving
41 * space and moving the extra fdpic arguments to the stack
42 * vector where they are easily accessible from C. */
43 segs = ((struct fdpic_loadmap *)(sp[-1] ? sp[-1] : sp[-2]))->segs;
44 } else {
45 /* If dynv is null, the entry point was started from loader
46 * that is not fdpic-aware. We can assume normal fixed-
47 * displacement ELF loading was performed, but when ldso was
48 * run as a command, finding the Ehdr is a heursitic: we
49 * have to assume Phdrs start in the first 4k of the file. */
50 base = aux[AT_BASE];
51 if (!base) base = aux[AT_PHDR] & -4096;
52 segs = &fakeseg;
53 segs[0].addr = base;
54 segs[0].p_vaddr = 0;
55 segs[0].p_memsz = -1;
56 Ehdr *eh = (void *)base;
57 Phdr *ph = (void *)(base + eh->e_phoff);
58 size_t phnum = eh->e_phnum;
59 size_t phent = eh->e_phentsize;
60 while (phnum-- && ph->p_type != PT_DYNAMIC)
61 ph = (void *)((size_t)ph + phent);
62 dynv = (void *)(base + ph->p_vaddr);
63 }
64#endif
65
66 for (i=0; i<DYN_CNT; i++) dyn[i] = 0;
67 for (i=0; dynv[i]; i+=2) if (dynv[i]<DYN_CNT)
68 dyn[dynv[i]] = dynv[i+1];
69
70#if DL_FDPIC
71 for (i=0; i<DYN_CNT; i++) {
72 if (i==DT_RELASZ || i==DT_RELSZ) continue;
73 if (!dyn[i]) continue;
74 for (j=0; dyn[i]-segs[j].p_vaddr >= segs[j].p_memsz; j++);
75 dyn[i] += segs[j].addr - segs[j].p_vaddr;
76 }
77 base = 0;
78
79 const Sym *syms = (void *)dyn[DT_SYMTAB];
80
81 rel = (void *)dyn[DT_RELA];
82 rel_size = dyn[DT_RELASZ];
83 for (; rel_size; rel+=3, rel_size-=3*sizeof(size_t)) {
84 if (!IS_RELATIVE(rel[1], syms)) continue;
85 for (j=0; rel[0]-segs[j].p_vaddr >= segs[j].p_memsz; j++);
86 size_t *rel_addr = (void *)
87 (rel[0] + segs[j].addr - segs[j].p_vaddr);
88 if (R_TYPE(rel[1]) == REL_FUNCDESC_VAL) {
89 *rel_addr += segs[rel_addr[1]].addr
90 - segs[rel_addr[1]].p_vaddr
91 + syms[R_SYM(rel[1])].st_value;
92 rel_addr[1] = dyn[DT_PLTGOT];
93 } else {
94 size_t val = syms[R_SYM(rel[1])].st_value;
95 for (j=0; val-segs[j].p_vaddr >= segs[j].p_memsz; j++);
96 *rel_addr = rel[2] + segs[j].addr - segs[j].p_vaddr + val;
97 }
98 }
99#else
100 /* If the dynamic linker is invoked as a command, its load
101 * address is not available in the aux vector. Instead, compute
102 * the load address as the difference between &_DYNAMIC and the
103 * virtual address in the PT_DYNAMIC program header. */
104 base = aux[AT_BASE];
105 if (!base) {
106 size_t phnum = aux[AT_PHNUM];
107 size_t phentsize = aux[AT_PHENT];
108 Phdr *ph = (void *)aux[AT_PHDR];
109 for (i=phnum; i--; ph = (void *)((char *)ph + phentsize)) {
110 if (ph->p_type == PT_DYNAMIC) {
111 base = (size_t)dynv - ph->p_vaddr;
112 break;
113 }
114 }
115 }
116
117 /* MIPS uses an ugly packed form for GOT relocations. Since we
118 * can't make function calls yet and the code is tiny anyway,
119 * it's simply inlined here. */
120 if (NEED_MIPS_GOT_RELOCS) {
121 size_t local_cnt = 0;
122 size_t *got = (void *)(base + dyn[DT_PLTGOT]);
123 for (i=0; dynv[i]; i+=2) if (dynv[i]==DT_MIPS_LOCAL_GOTNO)
124 local_cnt = dynv[i+1];
125 for (i=0; i<local_cnt; i++) got[i] += base;
126 }
127
128 rel = (void *)(base+dyn[DT_REL]);
129 rel_size = dyn[DT_RELSZ];
130 for (; rel_size; rel+=2, rel_size-=2*sizeof(size_t)) {
131 if (!IS_RELATIVE(rel[1], 0)) continue;
132 size_t *rel_addr = (void *)(base + rel[0]);
133 *rel_addr += base;
134 }
135
136 rel = (void *)(base+dyn[DT_RELA]);
137 rel_size = dyn[DT_RELASZ];
138 for (; rel_size; rel+=3, rel_size-=3*sizeof(size_t)) {
139 if (!IS_RELATIVE(rel[1], 0)) continue;
140 size_t *rel_addr = (void *)(base + rel[0]);
141 *rel_addr = base + rel[2];
142 }
143#endif
144
145 stage2_func dls2;
146 GETFUNCSYM(&dls2, __dls2, base+dyn[DT_PLTGOT]);
147 dls2((void *)base, sp);
148}
lib/libc/wasi/libc-top-half/musl/ldso/dynlink.c deleted-2359
...@@ -1,2359 +0,0 @@
1#define _GNU_SOURCE
2#define SYSCALL_NO_TLS 1
3#include <stdlib.h>
4#include <stdarg.h>
5#include <stddef.h>
6#include <string.h>
7#include <unistd.h>
8#include <stdint.h>
9#include <elf.h>
10#include <sys/mman.h>
11#include <limits.h>
12#include <fcntl.h>
13#include <sys/stat.h>
14#include <errno.h>
15#include <link.h>
16#include <setjmp.h>
17#include <pthread.h>
18#include <ctype.h>
19#include <dlfcn.h>
20#include <semaphore.h>
21#include <sys/membarrier.h>
22#include "pthread_impl.h"
23#include "fork_impl.h"
24#include "libc.h"
25#include "dynlink.h"
26
27#define malloc __libc_malloc
28#define calloc __libc_calloc
29#define realloc __libc_realloc
30#define free __libc_free
31
32static void error(const char *, ...);
33
34#define MAXP2(a,b) (-(-(a)&-(b)))
35#define ALIGN(x,y) ((x)+(y)-1 & -(y))
36
37#define container_of(p,t,m) ((t*)((char *)(p)-offsetof(t,m)))
38#define countof(a) ((sizeof (a))/(sizeof (a)[0]))
39
40struct debug {
41 int ver;
42 void *head;
43 void (*bp)(void);
44 int state;
45 void *base;
46};
47
48struct td_index {
49 size_t args[2];
50 struct td_index *next;
51};
52
53struct dso {
54#if DL_FDPIC
55 struct fdpic_loadmap *loadmap;
56#else
57 unsigned char *base;
58#endif
59 char *name;
60 size_t *dynv;
61 struct dso *next, *prev;
62
63 Phdr *phdr;
64 int phnum;
65 size_t phentsize;
66 Sym *syms;
67 Elf_Symndx *hashtab;
68 uint32_t *ghashtab;
69 int16_t *versym;
70 char *strings;
71 struct dso *syms_next, *lazy_next;
72 size_t *lazy, lazy_cnt;
73 unsigned char *map;
74 size_t map_len;
75 dev_t dev;
76 ino_t ino;
77 char relocated;
78 char constructed;
79 char kernel_mapped;
80 char mark;
81 char bfs_built;
82 char runtime_loaded;
83 struct dso **deps, *needed_by;
84 size_t ndeps_direct;
85 size_t next_dep;
86 pthread_t ctor_visitor;
87 char *rpath_orig, *rpath;
88 struct tls_module tls;
89 size_t tls_id;
90 size_t relro_start, relro_end;
91 uintptr_t *new_dtv;
92 unsigned char *new_tls;
93 struct td_index *td_index;
94 struct dso *fini_next;
95 char *shortname;
96#if DL_FDPIC
97 unsigned char *base;
98#else
99 struct fdpic_loadmap *loadmap;
100#endif
101 struct funcdesc {
102 void *addr;
103 size_t *got;
104 } *funcdescs;
105 size_t *got;
106 char buf[];
107};
108
109struct symdef {
110 Sym *sym;
111 struct dso *dso;
112};
113
114typedef void (*stage3_func)(size_t *, size_t *);
115
116static struct builtin_tls {
117 char c;
118 struct pthread pt;
119 void *space[16];
120} builtin_tls[1];
121#define MIN_TLS_ALIGN offsetof(struct builtin_tls, pt)
122
123#define ADDEND_LIMIT 4096
124static size_t *saved_addends, *apply_addends_to;
125
126static struct dso ldso;
127static struct dso *head, *tail, *fini_head, *syms_tail, *lazy_head;
128static char *env_path, *sys_path;
129static unsigned long long gencnt;
130static int runtime;
131static int ldd_mode;
132static int ldso_fail;
133static int noload;
134static int shutting_down;
135static jmp_buf *rtld_fail;
136static pthread_rwlock_t lock;
137static struct debug debug;
138static struct tls_module *tls_tail;
139static size_t tls_cnt, tls_offset, tls_align = MIN_TLS_ALIGN;
140static size_t static_tls_cnt;
141static pthread_mutex_t init_fini_lock;
142static pthread_cond_t ctor_cond;
143static struct dso *builtin_deps[2];
144static struct dso *const no_deps[1];
145static struct dso *builtin_ctor_queue[4];
146static struct dso **main_ctor_queue;
147static struct fdpic_loadmap *app_loadmap;
148static struct fdpic_dummy_loadmap app_dummy_loadmap;
149
150struct debug *_dl_debug_addr = &debug;
151
152extern hidden int __malloc_replaced;
153
154hidden void (*const __init_array_start)(void)=0, (*const __fini_array_start)(void)=0;
155
156extern hidden void (*const __init_array_end)(void), (*const __fini_array_end)(void);
157
158weak_alias(__init_array_start, __init_array_end);
159weak_alias(__fini_array_start, __fini_array_end);
160
161static int dl_strcmp(const char *l, const char *r)
162{
163 for (; *l==*r && *l; l++, r++);
164 return *(unsigned char *)l - *(unsigned char *)r;
165}
166#define strcmp(l,r) dl_strcmp(l,r)
167
168/* Compute load address for a virtual address in a given dso. */
169#if DL_FDPIC
170static void *laddr(const struct dso *p, size_t v)
171{
172 size_t j=0;
173 if (!p->loadmap) return p->base + v;
174 for (j=0; v-p->loadmap->segs[j].p_vaddr >= p->loadmap->segs[j].p_memsz; j++);
175 return (void *)(v - p->loadmap->segs[j].p_vaddr + p->loadmap->segs[j].addr);
176}
177static void *laddr_pg(const struct dso *p, size_t v)
178{
179 size_t j=0;
180 size_t pgsz = PAGE_SIZE;
181 if (!p->loadmap) return p->base + v;
182 for (j=0; ; j++) {
183 size_t a = p->loadmap->segs[j].p_vaddr;
184 size_t b = a + p->loadmap->segs[j].p_memsz;
185 a &= -pgsz;
186 b += pgsz-1;
187 b &= -pgsz;
188 if (v-a<b-a) break;
189 }
190 return (void *)(v - p->loadmap->segs[j].p_vaddr + p->loadmap->segs[j].addr);
191}
192static void (*fdbarrier(void *p))()
193{
194 void (*fd)();
195 __asm__("" : "=r"(fd) : "0"(p));
196 return fd;
197}
198#define fpaddr(p, v) fdbarrier((&(struct funcdesc){ \
199 laddr(p, v), (p)->got }))
200#else
201#define laddr(p, v) (void *)((p)->base + (v))
202#define laddr_pg(p, v) laddr(p, v)
203#define fpaddr(p, v) ((void (*)())laddr(p, v))
204#endif
205
206static void decode_vec(size_t *v, size_t *a, size_t cnt)
207{
208 size_t i;
209 for (i=0; i<cnt; i++) a[i] = 0;
210 for (; v[0]; v+=2) if (v[0]-1<cnt-1) {
211 a[0] |= 1UL<<v[0];
212 a[v[0]] = v[1];
213 }
214}
215
216static int search_vec(size_t *v, size_t *r, size_t key)
217{
218 for (; v[0]!=key; v+=2)
219 if (!v[0]) return 0;
220 *r = v[1];
221 return 1;
222}
223
224static uint32_t sysv_hash(const char *s0)
225{
226 const unsigned char *s = (void *)s0;
227 uint_fast32_t h = 0;
228 while (*s) {
229 h = 16*h + *s++;
230 h ^= h>>24 & 0xf0;
231 }
232 return h & 0xfffffff;
233}
234
235static uint32_t gnu_hash(const char *s0)
236{
237 const unsigned char *s = (void *)s0;
238 uint_fast32_t h = 5381;
239 for (; *s; s++)
240 h += h*32 + *s;
241 return h;
242}
243
244static Sym *sysv_lookup(const char *s, uint32_t h, struct dso *dso)
245{
246 size_t i;
247 Sym *syms = dso->syms;
248 Elf_Symndx *hashtab = dso->hashtab;
249 char *strings = dso->strings;
250 for (i=hashtab[2+h%hashtab[0]]; i; i=hashtab[2+hashtab[0]+i]) {
251 if ((!dso->versym || dso->versym[i] >= 0)
252 && (!strcmp(s, strings+syms[i].st_name)))
253 return syms+i;
254 }
255 return 0;
256}
257
258static Sym *gnu_lookup(uint32_t h1, uint32_t *hashtab, struct dso *dso, const char *s)
259{
260 uint32_t nbuckets = hashtab[0];
261 uint32_t *buckets = hashtab + 4 + hashtab[2]*(sizeof(size_t)/4);
262 uint32_t i = buckets[h1 % nbuckets];
263
264 if (!i) return 0;
265
266 uint32_t *hashval = buckets + nbuckets + (i - hashtab[1]);
267
268 for (h1 |= 1; ; i++) {
269 uint32_t h2 = *hashval++;
270 if ((h1 == (h2|1)) && (!dso->versym || dso->versym[i] >= 0)
271 && !strcmp(s, dso->strings + dso->syms[i].st_name))
272 return dso->syms+i;
273 if (h2 & 1) break;
274 }
275
276 return 0;
277}
278
279static Sym *gnu_lookup_filtered(uint32_t h1, uint32_t *hashtab, struct dso *dso, const char *s, uint32_t fofs, size_t fmask)
280{
281 const size_t *bloomwords = (const void *)(hashtab+4);
282 size_t f = bloomwords[fofs & (hashtab[2]-1)];
283 if (!(f & fmask)) return 0;
284
285 f >>= (h1 >> hashtab[3]) % (8 * sizeof f);
286 if (!(f & 1)) return 0;
287
288 return gnu_lookup(h1, hashtab, dso, s);
289}
290
291#define OK_TYPES (1<<STT_NOTYPE | 1<<STT_OBJECT | 1<<STT_FUNC | 1<<STT_COMMON | 1<<STT_TLS)
292#define OK_BINDS (1<<STB_GLOBAL | 1<<STB_WEAK | 1<<STB_GNU_UNIQUE)
293
294#ifndef ARCH_SYM_REJECT_UND
295#define ARCH_SYM_REJECT_UND(s) 0
296#endif
297
298#if defined(__GNUC__)
299__attribute__((always_inline))
300#endif
301static inline struct symdef find_sym2(struct dso *dso, const char *s, int need_def, int use_deps)
302{
303 uint32_t h = 0, gh = gnu_hash(s), gho = gh / (8*sizeof(size_t)), *ght;
304 size_t ghm = 1ul << gh % (8*sizeof(size_t));
305 struct symdef def = {0};
306 struct dso **deps = use_deps ? dso->deps : 0;
307 for (; dso; dso=use_deps ? *deps++ : dso->syms_next) {
308 Sym *sym;
309 if ((ght = dso->ghashtab)) {
310 sym = gnu_lookup_filtered(gh, ght, dso, s, gho, ghm);
311 } else {
312 if (!h) h = sysv_hash(s);
313 sym = sysv_lookup(s, h, dso);
314 }
315 if (!sym) continue;
316 if (!sym->st_shndx)
317 if (need_def || (sym->st_info&0xf) == STT_TLS
318 || ARCH_SYM_REJECT_UND(sym))
319 continue;
320 if (!sym->st_value)
321 if ((sym->st_info&0xf) != STT_TLS)
322 continue;
323 if (!(1<<(sym->st_info&0xf) & OK_TYPES)) continue;
324 if (!(1<<(sym->st_info>>4) & OK_BINDS)) continue;
325 def.sym = sym;
326 def.dso = dso;
327 break;
328 }
329 return def;
330}
331
332static struct symdef find_sym(struct dso *dso, const char *s, int need_def)
333{
334 return find_sym2(dso, s, need_def, 0);
335}
336
337static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stride)
338{
339 unsigned char *base = dso->base;
340 Sym *syms = dso->syms;
341 char *strings = dso->strings;
342 Sym *sym;
343 const char *name;
344 void *ctx;
345 int type;
346 int sym_index;
347 struct symdef def;
348 size_t *reloc_addr;
349 size_t sym_val;
350 size_t tls_val;
351 size_t addend;
352 int skip_relative = 0, reuse_addends = 0, save_slot = 0;
353
354 if (dso == &ldso) {
355 /* Only ldso's REL table needs addend saving/reuse. */
356 if (rel == apply_addends_to)
357 reuse_addends = 1;
358 skip_relative = 1;
359 }
360
361 for (; rel_size; rel+=stride, rel_size-=stride*sizeof(size_t)) {
362 if (skip_relative && IS_RELATIVE(rel[1], dso->syms)) continue;
363 type = R_TYPE(rel[1]);
364 if (type == REL_NONE) continue;
365 reloc_addr = laddr(dso, rel[0]);
366
367 if (stride > 2) {
368 addend = rel[2];
369 } else if (type==REL_GOT || type==REL_PLT|| type==REL_COPY) {
370 addend = 0;
371 } else if (reuse_addends) {
372 /* Save original addend in stage 2 where the dso
373 * chain consists of just ldso; otherwise read back
374 * saved addend since the inline one was clobbered. */
375 if (head==&ldso)
376 saved_addends[save_slot] = *reloc_addr;
377 addend = saved_addends[save_slot++];
378 } else {
379 addend = *reloc_addr;
380 }
381
382 sym_index = R_SYM(rel[1]);
383 if (sym_index) {
384 sym = syms + sym_index;
385 name = strings + sym->st_name;
386 ctx = type==REL_COPY ? head->syms_next : head;
387 def = (sym->st_info>>4) == STB_LOCAL
388 ? (struct symdef){ .dso = dso, .sym = sym }
389 : find_sym(ctx, name, type==REL_PLT);
390 if (!def.sym && (sym->st_shndx != SHN_UNDEF
391 || sym->st_info>>4 != STB_WEAK)) {
392 if (dso->lazy && (type==REL_PLT || type==REL_GOT)) {
393 dso->lazy[3*dso->lazy_cnt+0] = rel[0];
394 dso->lazy[3*dso->lazy_cnt+1] = rel[1];
395 dso->lazy[3*dso->lazy_cnt+2] = addend;
396 dso->lazy_cnt++;
397 continue;
398 }
399 error("Error relocating %s: %s: symbol not found",
400 dso->name, name);
401 if (runtime) longjmp(*rtld_fail, 1);
402 continue;
403 }
404 } else {
405 sym = 0;
406 def.sym = 0;
407 def.dso = dso;
408 }
409
410 sym_val = def.sym ? (size_t)laddr(def.dso, def.sym->st_value) : 0;
411 tls_val = def.sym ? def.sym->st_value : 0;
412
413 if ((type == REL_TPOFF || type == REL_TPOFF_NEG)
414 && def.dso->tls_id > static_tls_cnt) {
415 error("Error relocating %s: %s: initial-exec TLS "
416 "resolves to dynamic definition in %s",
417 dso->name, name, def.dso->name);
418 longjmp(*rtld_fail, 1);
419 }
420
421 switch(type) {
422 case REL_OFFSET:
423 addend -= (size_t)reloc_addr;
424 case REL_SYMBOLIC:
425 case REL_GOT:
426 case REL_PLT:
427 *reloc_addr = sym_val + addend;
428 break;
429 case REL_USYMBOLIC:
430 memcpy(reloc_addr, &(size_t){sym_val + addend}, sizeof(size_t));
431 break;
432 case REL_RELATIVE:
433 *reloc_addr = (size_t)base + addend;
434 break;
435 case REL_SYM_OR_REL:
436 if (sym) *reloc_addr = sym_val + addend;
437 else *reloc_addr = (size_t)base + addend;
438 break;
439 case REL_COPY:
440 memcpy(reloc_addr, (void *)sym_val, sym->st_size);
441 break;
442 case REL_OFFSET32:
443 *(uint32_t *)reloc_addr = sym_val + addend
444 - (size_t)reloc_addr;
445 break;
446 case REL_FUNCDESC:
447 *reloc_addr = def.sym ? (size_t)(def.dso->funcdescs
448 + (def.sym - def.dso->syms)) : 0;
449 break;
450 case REL_FUNCDESC_VAL:
451 if ((sym->st_info&0xf) == STT_SECTION) *reloc_addr += sym_val;
452 else *reloc_addr = sym_val;
453 reloc_addr[1] = def.sym ? (size_t)def.dso->got : 0;
454 break;
455 case REL_DTPMOD:
456 *reloc_addr = def.dso->tls_id;
457 break;
458 case REL_DTPOFF:
459 *reloc_addr = tls_val + addend - DTP_OFFSET;
460 break;
461#ifdef TLS_ABOVE_TP
462 case REL_TPOFF:
463 *reloc_addr = tls_val + def.dso->tls.offset + TPOFF_K + addend;
464 break;
465#else
466 case REL_TPOFF:
467 *reloc_addr = tls_val - def.dso->tls.offset + addend;
468 break;
469 case REL_TPOFF_NEG:
470 *reloc_addr = def.dso->tls.offset - tls_val + addend;
471 break;
472#endif
473 case REL_TLSDESC:
474 if (stride<3) addend = reloc_addr[1];
475 if (def.dso->tls_id > static_tls_cnt) {
476 struct td_index *new = malloc(sizeof *new);
477 if (!new) {
478 error(
479 "Error relocating %s: cannot allocate TLSDESC for %s",
480 dso->name, sym ? name : "(local)" );
481 longjmp(*rtld_fail, 1);
482 }
483 new->next = dso->td_index;
484 dso->td_index = new;
485 new->args[0] = def.dso->tls_id;
486 new->args[1] = tls_val + addend - DTP_OFFSET;
487 reloc_addr[0] = (size_t)__tlsdesc_dynamic;
488 reloc_addr[1] = (size_t)new;
489 } else {
490 reloc_addr[0] = (size_t)__tlsdesc_static;
491#ifdef TLS_ABOVE_TP
492 reloc_addr[1] = tls_val + def.dso->tls.offset
493 + TPOFF_K + addend;
494#else
495 reloc_addr[1] = tls_val - def.dso->tls.offset
496 + addend;
497#endif
498 }
499#ifdef TLSDESC_BACKWARDS
500 /* Some archs (32-bit ARM at least) invert the order of
501 * the descriptor members. Fix them up here. */
502 size_t tmp = reloc_addr[0];
503 reloc_addr[0] = reloc_addr[1];
504 reloc_addr[1] = tmp;
505#endif
506 break;
507 default:
508 error("Error relocating %s: unsupported relocation type %d",
509 dso->name, type);
510 if (runtime) longjmp(*rtld_fail, 1);
511 continue;
512 }
513 }
514}
515
516static void redo_lazy_relocs()
517{
518 struct dso *p = lazy_head, *next;
519 lazy_head = 0;
520 for (; p; p=next) {
521 next = p->lazy_next;
522 size_t size = p->lazy_cnt*3*sizeof(size_t);
523 p->lazy_cnt = 0;
524 do_relocs(p, p->lazy, size, 3);
525 if (p->lazy_cnt) {
526 p->lazy_next = lazy_head;
527 lazy_head = p;
528 } else {
529 free(p->lazy);
530 p->lazy = 0;
531 p->lazy_next = 0;
532 }
533 }
534}
535
536/* A huge hack: to make up for the wastefulness of shared libraries
537 * needing at least a page of dirty memory even if they have no global
538 * data, we reclaim the gaps at the beginning and end of writable maps
539 * and "donate" them to the heap. */
540
541static void reclaim(struct dso *dso, size_t start, size_t end)
542{
543 if (start >= dso->relro_start && start < dso->relro_end) start = dso->relro_end;
544 if (end >= dso->relro_start && end < dso->relro_end) end = dso->relro_start;
545 if (start >= end) return;
546 char *base = laddr_pg(dso, start);
547 __malloc_donate(base, base+(end-start));
548}
549
550static void reclaim_gaps(struct dso *dso)
551{
552 Phdr *ph = dso->phdr;
553 size_t phcnt = dso->phnum;
554
555 for (; phcnt--; ph=(void *)((char *)ph+dso->phentsize)) {
556 if (ph->p_type!=PT_LOAD) continue;
557 if ((ph->p_flags&(PF_R|PF_W))!=(PF_R|PF_W)) continue;
558 reclaim(dso, ph->p_vaddr & -PAGE_SIZE, ph->p_vaddr);
559 reclaim(dso, ph->p_vaddr+ph->p_memsz,
560 ph->p_vaddr+ph->p_memsz+PAGE_SIZE-1 & -PAGE_SIZE);
561 }
562}
563
564static ssize_t read_loop(int fd, void *p, size_t n)
565{
566 for (size_t i=0; i<n; ) {
567 ssize_t l = read(fd, (char *)p+i, n-i);
568 if (l<0) {
569 if (errno==EINTR) continue;
570 else return -1;
571 }
572 if (l==0) return i;
573 i += l;
574 }
575 return n;
576}
577
578static void *mmap_fixed(void *p, size_t n, int prot, int flags, int fd, off_t off)
579{
580 static int no_map_fixed;
581 char *q;
582 if (!no_map_fixed) {
583 q = mmap(p, n, prot, flags|MAP_FIXED, fd, off);
584 if (!DL_NOMMU_SUPPORT || q != MAP_FAILED || errno != EINVAL)
585 return q;
586 no_map_fixed = 1;
587 }
588 /* Fallbacks for MAP_FIXED failure on NOMMU kernels. */
589 if (flags & MAP_ANONYMOUS) {
590 memset(p, 0, n);
591 return p;
592 }
593 ssize_t r;
594 if (lseek(fd, off, SEEK_SET) < 0) return MAP_FAILED;
595 for (q=p; n; q+=r, off+=r, n-=r) {
596 r = read(fd, q, n);
597 if (r < 0 && errno != EINTR) return MAP_FAILED;
598 if (!r) {
599 memset(q, 0, n);
600 break;
601 }
602 }
603 return p;
604}
605
606static void unmap_library(struct dso *dso)
607{
608 if (dso->loadmap) {
609 size_t i;
610 for (i=0; i<dso->loadmap->nsegs; i++) {
611 if (!dso->loadmap->segs[i].p_memsz)
612 continue;
613 munmap((void *)dso->loadmap->segs[i].addr,
614 dso->loadmap->segs[i].p_memsz);
615 }
616 free(dso->loadmap);
617 } else if (dso->map && dso->map_len) {
618 munmap(dso->map, dso->map_len);
619 }
620}
621
622static void *map_library(int fd, struct dso *dso)
623{
624 Ehdr buf[(896+sizeof(Ehdr))/sizeof(Ehdr)];
625 void *allocated_buf=0;
626 size_t phsize;
627 size_t addr_min=SIZE_MAX, addr_max=0, map_len;
628 size_t this_min, this_max;
629 size_t nsegs = 0;
630 off_t off_start;
631 Ehdr *eh;
632 Phdr *ph, *ph0;
633 unsigned prot;
634 unsigned char *map=MAP_FAILED, *base;
635 size_t dyn=0;
636 size_t tls_image=0;
637 size_t i;
638
639 ssize_t l = read(fd, buf, sizeof buf);
640 eh = buf;
641 if (l<0) return 0;
642 if (l<sizeof *eh || (eh->e_type != ET_DYN && eh->e_type != ET_EXEC))
643 goto noexec;
644 phsize = eh->e_phentsize * eh->e_phnum;
645 if (phsize > sizeof buf - sizeof *eh) {
646 allocated_buf = malloc(phsize);
647 if (!allocated_buf) return 0;
648 l = pread(fd, allocated_buf, phsize, eh->e_phoff);
649 if (l < 0) goto error;
650 if (l != phsize) goto noexec;
651 ph = ph0 = allocated_buf;
652 } else if (eh->e_phoff + phsize > l) {
653 l = pread(fd, buf+1, phsize, eh->e_phoff);
654 if (l < 0) goto error;
655 if (l != phsize) goto noexec;
656 ph = ph0 = (void *)(buf + 1);
657 } else {
658 ph = ph0 = (void *)((char *)buf + eh->e_phoff);
659 }
660 for (i=eh->e_phnum; i; i--, ph=(void *)((char *)ph+eh->e_phentsize)) {
661 if (ph->p_type == PT_DYNAMIC) {
662 dyn = ph->p_vaddr;
663 } else if (ph->p_type == PT_TLS) {
664 tls_image = ph->p_vaddr;
665 dso->tls.align = ph->p_align;
666 dso->tls.len = ph->p_filesz;
667 dso->tls.size = ph->p_memsz;
668 } else if (ph->p_type == PT_GNU_RELRO) {
669 dso->relro_start = ph->p_vaddr & -PAGE_SIZE;
670 dso->relro_end = (ph->p_vaddr + ph->p_memsz) & -PAGE_SIZE;
671 } else if (ph->p_type == PT_GNU_STACK) {
672 if (!runtime && ph->p_memsz > __default_stacksize) {
673 __default_stacksize =
674 ph->p_memsz < DEFAULT_STACK_MAX ?
675 ph->p_memsz : DEFAULT_STACK_MAX;
676 }
677 }
678 if (ph->p_type != PT_LOAD) continue;
679 nsegs++;
680 if (ph->p_vaddr < addr_min) {
681 addr_min = ph->p_vaddr;
682 off_start = ph->p_offset;
683 prot = (((ph->p_flags&PF_R) ? PROT_READ : 0) |
684 ((ph->p_flags&PF_W) ? PROT_WRITE: 0) |
685 ((ph->p_flags&PF_X) ? PROT_EXEC : 0));
686 }
687 if (ph->p_vaddr+ph->p_memsz > addr_max) {
688 addr_max = ph->p_vaddr+ph->p_memsz;
689 }
690 }
691 if (!dyn) goto noexec;
692 if (DL_FDPIC && !(eh->e_flags & FDPIC_CONSTDISP_FLAG)) {
693 dso->loadmap = calloc(1, sizeof *dso->loadmap
694 + nsegs * sizeof *dso->loadmap->segs);
695 if (!dso->loadmap) goto error;
696 dso->loadmap->nsegs = nsegs;
697 for (ph=ph0, i=0; i<nsegs; ph=(void *)((char *)ph+eh->e_phentsize)) {
698 if (ph->p_type != PT_LOAD) continue;
699 prot = (((ph->p_flags&PF_R) ? PROT_READ : 0) |
700 ((ph->p_flags&PF_W) ? PROT_WRITE: 0) |
701 ((ph->p_flags&PF_X) ? PROT_EXEC : 0));
702 map = mmap(0, ph->p_memsz + (ph->p_vaddr & PAGE_SIZE-1),
703 prot, MAP_PRIVATE,
704 fd, ph->p_offset & -PAGE_SIZE);
705 if (map == MAP_FAILED) {
706 unmap_library(dso);
707 goto error;
708 }
709 dso->loadmap->segs[i].addr = (size_t)map +
710 (ph->p_vaddr & PAGE_SIZE-1);
711 dso->loadmap->segs[i].p_vaddr = ph->p_vaddr;
712 dso->loadmap->segs[i].p_memsz = ph->p_memsz;
713 i++;
714 if (prot & PROT_WRITE) {
715 size_t brk = (ph->p_vaddr & PAGE_SIZE-1)
716 + ph->p_filesz;
717 size_t pgbrk = brk + PAGE_SIZE-1 & -PAGE_SIZE;
718 size_t pgend = brk + ph->p_memsz - ph->p_filesz
719 + PAGE_SIZE-1 & -PAGE_SIZE;
720 if (pgend > pgbrk && mmap_fixed(map+pgbrk,
721 pgend-pgbrk, prot,
722 MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS,
723 -1, off_start) == MAP_FAILED)
724 goto error;
725 memset(map + brk, 0, pgbrk-brk);
726 }
727 }
728 map = (void *)dso->loadmap->segs[0].addr;
729 map_len = 0;
730 goto done_mapping;
731 }
732 addr_max += PAGE_SIZE-1;
733 addr_max &= -PAGE_SIZE;
734 addr_min &= -PAGE_SIZE;
735 off_start &= -PAGE_SIZE;
736 map_len = addr_max - addr_min + off_start;
737 /* The first time, we map too much, possibly even more than
738 * the length of the file. This is okay because we will not
739 * use the invalid part; we just need to reserve the right
740 * amount of virtual address space to map over later. */
741 map = DL_NOMMU_SUPPORT
742 ? mmap((void *)addr_min, map_len, PROT_READ|PROT_WRITE|PROT_EXEC,
743 MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
744 : mmap((void *)addr_min, map_len, prot,
745 MAP_PRIVATE, fd, off_start);
746 if (map==MAP_FAILED) goto error;
747 dso->map = map;
748 dso->map_len = map_len;
749 /* If the loaded file is not relocatable and the requested address is
750 * not available, then the load operation must fail. */
751 if (eh->e_type != ET_DYN && addr_min && map!=(void *)addr_min) {
752 errno = EBUSY;
753 goto error;
754 }
755 base = map - addr_min;
756 dso->phdr = 0;
757 dso->phnum = 0;
758 for (ph=ph0, i=eh->e_phnum; i; i--, ph=(void *)((char *)ph+eh->e_phentsize)) {
759 if (ph->p_type != PT_LOAD) continue;
760 /* Check if the programs headers are in this load segment, and
761 * if so, record the address for use by dl_iterate_phdr. */
762 if (!dso->phdr && eh->e_phoff >= ph->p_offset
763 && eh->e_phoff+phsize <= ph->p_offset+ph->p_filesz) {
764 dso->phdr = (void *)(base + ph->p_vaddr
765 + (eh->e_phoff-ph->p_offset));
766 dso->phnum = eh->e_phnum;
767 dso->phentsize = eh->e_phentsize;
768 }
769 this_min = ph->p_vaddr & -PAGE_SIZE;
770 this_max = ph->p_vaddr+ph->p_memsz+PAGE_SIZE-1 & -PAGE_SIZE;
771 off_start = ph->p_offset & -PAGE_SIZE;
772 prot = (((ph->p_flags&PF_R) ? PROT_READ : 0) |
773 ((ph->p_flags&PF_W) ? PROT_WRITE: 0) |
774 ((ph->p_flags&PF_X) ? PROT_EXEC : 0));
775 /* Reuse the existing mapping for the lowest-address LOAD */
776 if ((ph->p_vaddr & -PAGE_SIZE) != addr_min || DL_NOMMU_SUPPORT)
777 if (mmap_fixed(base+this_min, this_max-this_min, prot, MAP_PRIVATE|MAP_FIXED, fd, off_start) == MAP_FAILED)
778 goto error;
779 if (ph->p_memsz > ph->p_filesz && (ph->p_flags&PF_W)) {
780 size_t brk = (size_t)base+ph->p_vaddr+ph->p_filesz;
781 size_t pgbrk = brk+PAGE_SIZE-1 & -PAGE_SIZE;
782 memset((void *)brk, 0, pgbrk-brk & PAGE_SIZE-1);
783 if (pgbrk-(size_t)base < this_max && mmap_fixed((void *)pgbrk, (size_t)base+this_max-pgbrk, prot, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) == MAP_FAILED)
784 goto error;
785 }
786 }
787 for (i=0; ((size_t *)(base+dyn))[i]; i+=2)
788 if (((size_t *)(base+dyn))[i]==DT_TEXTREL) {
789 if (mprotect(map, map_len, PROT_READ|PROT_WRITE|PROT_EXEC)
790 && errno != ENOSYS)
791 goto error;
792 break;
793 }
794done_mapping:
795 dso->base = base;
796 dso->dynv = laddr(dso, dyn);
797 if (dso->tls.size) dso->tls.image = laddr(dso, tls_image);
798 free(allocated_buf);
799 return map;
800noexec:
801 errno = ENOEXEC;
802error:
803 if (map!=MAP_FAILED) unmap_library(dso);
804 free(allocated_buf);
805 return 0;
806}
807
808static int path_open(const char *name, const char *s, char *buf, size_t buf_size)
809{
810 size_t l;
811 int fd;
812 for (;;) {
813 s += strspn(s, ":\n");
814 l = strcspn(s, ":\n");
815 if (l-1 >= INT_MAX) return -1;
816 if (snprintf(buf, buf_size, "%.*s/%s", (int)l, s, name) < buf_size) {
817 if ((fd = open(buf, O_RDONLY|O_CLOEXEC))>=0) return fd;
818 switch (errno) {
819 case ENOENT:
820 case ENOTDIR:
821 case EACCES:
822 case ENAMETOOLONG:
823 break;
824 default:
825 /* Any negative value but -1 will inhibit
826 * futher path search. */
827 return -2;
828 }
829 }
830 s += l;
831 }
832}
833
834static int fixup_rpath(struct dso *p, char *buf, size_t buf_size)
835{
836 size_t n, l;
837 const char *s, *t, *origin;
838 char *d;
839 if (p->rpath || !p->rpath_orig) return 0;
840 if (!strchr(p->rpath_orig, '$')) {
841 p->rpath = p->rpath_orig;
842 return 0;
843 }
844 n = 0;
845 s = p->rpath_orig;
846 while ((t=strchr(s, '$'))) {
847 if (strncmp(t, "$ORIGIN", 7) && strncmp(t, "${ORIGIN}", 9))
848 return 0;
849 s = t+1;
850 n++;
851 }
852 if (n > SSIZE_MAX/PATH_MAX) return 0;
853
854 if (p->kernel_mapped) {
855 /* $ORIGIN searches cannot be performed for the main program
856 * when it is suid/sgid/AT_SECURE. This is because the
857 * pathname is under the control of the caller of execve.
858 * For libraries, however, $ORIGIN can be processed safely
859 * since the library's pathname came from a trusted source
860 * (either system paths or a call to dlopen). */
861 if (libc.secure)
862 return 0;
863 l = readlink("/proc/self/exe", buf, buf_size);
864 if (l == -1) switch (errno) {
865 case ENOENT:
866 case ENOTDIR:
867 case EACCES:
868 break;
869 default:
870 return -1;
871 }
872 if (l >= buf_size)
873 return 0;
874 buf[l] = 0;
875 origin = buf;
876 } else {
877 origin = p->name;
878 }
879 t = strrchr(origin, '/');
880 if (t) {
881 l = t-origin;
882 } else {
883 /* Normally p->name will always be an absolute or relative
884 * pathname containing at least one '/' character, but in the
885 * case where ldso was invoked as a command to execute a
886 * program in the working directory, app.name may not. Fix. */
887 origin = ".";
888 l = 1;
889 }
890 /* Disallow non-absolute origins for suid/sgid/AT_SECURE. */
891 if (libc.secure && *origin != '/')
892 return 0;
893 p->rpath = malloc(strlen(p->rpath_orig) + n*l + 1);
894 if (!p->rpath) return -1;
895
896 d = p->rpath;
897 s = p->rpath_orig;
898 while ((t=strchr(s, '$'))) {
899 memcpy(d, s, t-s);
900 d += t-s;
901 memcpy(d, origin, l);
902 d += l;
903 /* It was determined previously that the '$' is followed
904 * either by "ORIGIN" or "{ORIGIN}". */
905 s = t + 7 + 2*(t[1]=='{');
906 }
907 strcpy(d, s);
908 return 0;
909}
910
911static void decode_dyn(struct dso *p)
912{
913 size_t dyn[DYN_CNT];
914 decode_vec(p->dynv, dyn, DYN_CNT);
915 p->syms = laddr(p, dyn[DT_SYMTAB]);
916 p->strings = laddr(p, dyn[DT_STRTAB]);
917 if (dyn[0]&(1<<DT_HASH))
918 p->hashtab = laddr(p, dyn[DT_HASH]);
919 if (dyn[0]&(1<<DT_RPATH))
920 p->rpath_orig = p->strings + dyn[DT_RPATH];
921 if (dyn[0]&(1<<DT_RUNPATH))
922 p->rpath_orig = p->strings + dyn[DT_RUNPATH];
923 if (dyn[0]&(1<<DT_PLTGOT))
924 p->got = laddr(p, dyn[DT_PLTGOT]);
925 if (search_vec(p->dynv, dyn, DT_GNU_HASH))
926 p->ghashtab = laddr(p, *dyn);
927 if (search_vec(p->dynv, dyn, DT_VERSYM))
928 p->versym = laddr(p, *dyn);
929}
930
931static size_t count_syms(struct dso *p)
932{
933 if (p->hashtab) return p->hashtab[1];
934
935 size_t nsym, i;
936 uint32_t *buckets = p->ghashtab + 4 + (p->ghashtab[2]*sizeof(size_t)/4);
937 uint32_t *hashval;
938 for (i = nsym = 0; i < p->ghashtab[0]; i++) {
939 if (buckets[i] > nsym)
940 nsym = buckets[i];
941 }
942 if (nsym) {
943 hashval = buckets + p->ghashtab[0] + (nsym - p->ghashtab[1]);
944 do nsym++;
945 while (!(*hashval++ & 1));
946 }
947 return nsym;
948}
949
950static void *dl_mmap(size_t n)
951{
952 void *p;
953 int prot = PROT_READ|PROT_WRITE, flags = MAP_ANONYMOUS|MAP_PRIVATE;
954#ifdef SYS_mmap2
955 p = (void *)__syscall(SYS_mmap2, 0, n, prot, flags, -1, 0);
956#else
957 p = (void *)__syscall(SYS_mmap, 0, n, prot, flags, -1, 0);
958#endif
959 return (unsigned long)p > -4096UL ? 0 : p;
960}
961
962static void makefuncdescs(struct dso *p)
963{
964 static int self_done;
965 size_t nsym = count_syms(p);
966 size_t i, size = nsym * sizeof(*p->funcdescs);
967
968 if (!self_done) {
969 p->funcdescs = dl_mmap(size);
970 self_done = 1;
971 } else {
972 p->funcdescs = malloc(size);
973 }
974 if (!p->funcdescs) {
975 if (!runtime) a_crash();
976 error("Error allocating function descriptors for %s", p->name);
977 longjmp(*rtld_fail, 1);
978 }
979 for (i=0; i<nsym; i++) {
980 if ((p->syms[i].st_info&0xf)==STT_FUNC && p->syms[i].st_shndx) {
981 p->funcdescs[i].addr = laddr(p, p->syms[i].st_value);
982 p->funcdescs[i].got = p->got;
983 } else {
984 p->funcdescs[i].addr = 0;
985 p->funcdescs[i].got = 0;
986 }
987 }
988}
989
990static struct dso *load_library(const char *name, struct dso *needed_by)
991{
992 char buf[2*NAME_MAX+2];
993 const char *pathname;
994 unsigned char *map;
995 struct dso *p, temp_dso = {0};
996 int fd;
997 struct stat st;
998 size_t alloc_size;
999 int n_th = 0;
1000 int is_self = 0;
1001
1002 if (!*name) {
1003 errno = EINVAL;
1004 return 0;
1005 }
1006
1007 /* Catch and block attempts to reload the implementation itself */
1008 if (name[0]=='l' && name[1]=='i' && name[2]=='b') {
1009 static const char reserved[] =
1010 "c.pthread.rt.m.dl.util.xnet.";
1011 const char *rp, *next;
1012 for (rp=reserved; *rp; rp=next) {
1013 next = strchr(rp, '.') + 1;
1014 if (strncmp(name+3, rp, next-rp) == 0)
1015 break;
1016 }
1017 if (*rp) {
1018 if (ldd_mode) {
1019 /* Track which names have been resolved
1020 * and only report each one once. */
1021 static unsigned reported;
1022 unsigned mask = 1U<<(rp-reserved);
1023 if (!(reported & mask)) {
1024 reported |= mask;
1025 dprintf(1, "\t%s => %s (%p)\n",
1026 name, ldso.name,
1027 ldso.base);
1028 }
1029 }
1030 is_self = 1;
1031 }
1032 }
1033 if (!strcmp(name, ldso.name)) is_self = 1;
1034 if (is_self) {
1035 if (!ldso.prev) {
1036 tail->next = &ldso;
1037 ldso.prev = tail;
1038 tail = &ldso;
1039 }
1040 return &ldso;
1041 }
1042 if (strchr(name, '/')) {
1043 pathname = name;
1044 fd = open(name, O_RDONLY|O_CLOEXEC);
1045 } else {
1046 /* Search for the name to see if it's already loaded */
1047 for (p=head->next; p; p=p->next) {
1048 if (p->shortname && !strcmp(p->shortname, name)) {
1049 return p;
1050 }
1051 }
1052 if (strlen(name) > NAME_MAX) return 0;
1053 fd = -1;
1054 if (env_path) fd = path_open(name, env_path, buf, sizeof buf);
1055 for (p=needed_by; fd == -1 && p; p=p->needed_by) {
1056 if (fixup_rpath(p, buf, sizeof buf) < 0)
1057 fd = -2; /* Inhibit further search. */
1058 if (p->rpath)
1059 fd = path_open(name, p->rpath, buf, sizeof buf);
1060 }
1061 if (fd == -1) {
1062 if (!sys_path) {
1063 char *prefix = 0;
1064 size_t prefix_len;
1065 if (ldso.name[0]=='/') {
1066 char *s, *t, *z;
1067 for (s=t=z=ldso.name; *s; s++)
1068 if (*s=='/') z=t, t=s;
1069 prefix_len = z-ldso.name;
1070 if (prefix_len < PATH_MAX)
1071 prefix = ldso.name;
1072 }
1073 if (!prefix) {
1074 prefix = "";
1075 prefix_len = 0;
1076 }
1077 char etc_ldso_path[prefix_len + 1
1078 + sizeof "/etc/ld-musl-" LDSO_ARCH ".path"];
1079 snprintf(etc_ldso_path, sizeof etc_ldso_path,
1080 "%.*s/etc/ld-musl-" LDSO_ARCH ".path",
1081 (int)prefix_len, prefix);
1082 fd = open(etc_ldso_path, O_RDONLY|O_CLOEXEC);
1083 if (fd>=0) {
1084 size_t n = 0;
1085 if (!fstat(fd, &st)) n = st.st_size;
1086 if ((sys_path = malloc(n+1)))
1087 sys_path[n] = 0;
1088 if (!sys_path || read_loop(fd, sys_path, n)<0) {
1089 free(sys_path);
1090 sys_path = "";
1091 }
1092 close(fd);
1093 } else if (errno != ENOENT) {
1094 sys_path = "";
1095 }
1096 }
1097 if (!sys_path) sys_path = "/lib:/usr/local/lib:/usr/lib";
1098 fd = path_open(name, sys_path, buf, sizeof buf);
1099 }
1100 pathname = buf;
1101 }
1102 if (fd < 0) return 0;
1103 if (fstat(fd, &st) < 0) {
1104 close(fd);
1105 return 0;
1106 }
1107 for (p=head->next; p; p=p->next) {
1108 if (p->dev == st.st_dev && p->ino == st.st_ino) {
1109 /* If this library was previously loaded with a
1110 * pathname but a search found the same inode,
1111 * setup its shortname so it can be found by name. */
1112 if (!p->shortname && pathname != name)
1113 p->shortname = strrchr(p->name, '/')+1;
1114 close(fd);
1115 return p;
1116 }
1117 }
1118 map = noload ? 0 : map_library(fd, &temp_dso);
1119 close(fd);
1120 if (!map) return 0;
1121
1122 /* Avoid the danger of getting two versions of libc mapped into the
1123 * same process when an absolute pathname was used. The symbols
1124 * checked are chosen to catch both musl and glibc, and to avoid
1125 * false positives from interposition-hack libraries. */
1126 decode_dyn(&temp_dso);
1127 if (find_sym(&temp_dso, "__libc_start_main", 1).sym &&
1128 find_sym(&temp_dso, "stdin", 1).sym) {
1129 unmap_library(&temp_dso);
1130 return load_library("libc.so", needed_by);
1131 }
1132 /* Past this point, if we haven't reached runtime yet, ldso has
1133 * committed either to use the mapped library or to abort execution.
1134 * Unmapping is not possible, so we can safely reclaim gaps. */
1135 if (!runtime) reclaim_gaps(&temp_dso);
1136
1137 /* Allocate storage for the new DSO. When there is TLS, this
1138 * storage must include a reservation for all pre-existing
1139 * threads to obtain copies of both the new TLS, and an
1140 * extended DTV capable of storing an additional slot for
1141 * the newly-loaded DSO. */
1142 alloc_size = sizeof *p + strlen(pathname) + 1;
1143 if (runtime && temp_dso.tls.image) {
1144 size_t per_th = temp_dso.tls.size + temp_dso.tls.align
1145 + sizeof(void *) * (tls_cnt+3);
1146 n_th = libc.threads_minus_1 + 1;
1147 if (n_th > SSIZE_MAX / per_th) alloc_size = SIZE_MAX;
1148 else alloc_size += n_th * per_th;
1149 }
1150 p = calloc(1, alloc_size);
1151 if (!p) {
1152 unmap_library(&temp_dso);
1153 return 0;
1154 }
1155 memcpy(p, &temp_dso, sizeof temp_dso);
1156 p->dev = st.st_dev;
1157 p->ino = st.st_ino;
1158 p->needed_by = needed_by;
1159 p->name = p->buf;
1160 p->runtime_loaded = runtime;
1161 strcpy(p->name, pathname);
1162 /* Add a shortname only if name arg was not an explicit pathname. */
1163 if (pathname != name) p->shortname = strrchr(p->name, '/')+1;
1164 if (p->tls.image) {
1165 p->tls_id = ++tls_cnt;
1166 tls_align = MAXP2(tls_align, p->tls.align);
1167#ifdef TLS_ABOVE_TP
1168 p->tls.offset = tls_offset + ( (p->tls.align-1) &
1169 (-tls_offset + (uintptr_t)p->tls.image) );
1170 tls_offset = p->tls.offset + p->tls.size;
1171#else
1172 tls_offset += p->tls.size + p->tls.align - 1;
1173 tls_offset -= (tls_offset + (uintptr_t)p->tls.image)
1174 & (p->tls.align-1);
1175 p->tls.offset = tls_offset;
1176#endif
1177 p->new_dtv = (void *)(-sizeof(size_t) &
1178 (uintptr_t)(p->name+strlen(p->name)+sizeof(size_t)));
1179 p->new_tls = (void *)(p->new_dtv + n_th*(tls_cnt+1));
1180 if (tls_tail) tls_tail->next = &p->tls;
1181 else libc.tls_head = &p->tls;
1182 tls_tail = &p->tls;
1183 }
1184
1185 tail->next = p;
1186 p->prev = tail;
1187 tail = p;
1188
1189 if (DL_FDPIC) makefuncdescs(p);
1190
1191 if (ldd_mode) dprintf(1, "\t%s => %s (%p)\n", name, pathname, p->base);
1192
1193 return p;
1194}
1195
1196static void load_direct_deps(struct dso *p)
1197{
1198 size_t i, cnt=0;
1199
1200 if (p->deps) return;
1201 /* For head, all preloads are direct pseudo-dependencies.
1202 * Count and include them now to avoid realloc later. */
1203 if (p==head) for (struct dso *q=p->next; q; q=q->next)
1204 cnt++;
1205 for (i=0; p->dynv[i]; i+=2)
1206 if (p->dynv[i] == DT_NEEDED) cnt++;
1207 /* Use builtin buffer for apps with no external deps, to
1208 * preserve property of no runtime failure paths. */
1209 p->deps = (p==head && cnt<2) ? builtin_deps :
1210 calloc(cnt+1, sizeof *p->deps);
1211 if (!p->deps) {
1212 error("Error loading dependencies for %s", p->name);
1213 if (runtime) longjmp(*rtld_fail, 1);
1214 }
1215 cnt=0;
1216 if (p==head) for (struct dso *q=p->next; q; q=q->next)
1217 p->deps[cnt++] = q;
1218 for (i=0; p->dynv[i]; i+=2) {
1219 if (p->dynv[i] != DT_NEEDED) continue;
1220 struct dso *dep = load_library(p->strings + p->dynv[i+1], p);
1221 if (!dep) {
1222 error("Error loading shared library %s: %m (needed by %s)",
1223 p->strings + p->dynv[i+1], p->name);
1224 if (runtime) longjmp(*rtld_fail, 1);
1225 continue;
1226 }
1227 p->deps[cnt++] = dep;
1228 }
1229 p->deps[cnt] = 0;
1230 p->ndeps_direct = cnt;
1231}
1232
1233static void load_deps(struct dso *p)
1234{
1235 if (p->deps) return;
1236 for (; p; p=p->next)
1237 load_direct_deps(p);
1238}
1239
1240static void extend_bfs_deps(struct dso *p)
1241{
1242 size_t i, j, cnt, ndeps_all;
1243 struct dso **tmp;
1244
1245 /* Can't use realloc if the original p->deps was allocated at
1246 * program entry and malloc has been replaced, or if it's
1247 * the builtin non-allocated trivial main program deps array. */
1248 int no_realloc = (__malloc_replaced && !p->runtime_loaded)
1249 || p->deps == builtin_deps;
1250
1251 if (p->bfs_built) return;
1252 ndeps_all = p->ndeps_direct;
1253
1254 /* Mark existing (direct) deps so they won't be duplicated. */
1255 for (i=0; p->deps[i]; i++)
1256 p->deps[i]->mark = 1;
1257
1258 /* For each dependency already in the list, copy its list of direct
1259 * dependencies to the list, excluding any items already in the
1260 * list. Note that the list this loop iterates over will grow during
1261 * the loop, but since duplicates are excluded, growth is bounded. */
1262 for (i=0; p->deps[i]; i++) {
1263 struct dso *dep = p->deps[i];
1264 for (j=cnt=0; j<dep->ndeps_direct; j++)
1265 if (!dep->deps[j]->mark) cnt++;
1266 tmp = no_realloc ?
1267 malloc(sizeof(*tmp) * (ndeps_all+cnt+1)) :
1268 realloc(p->deps, sizeof(*tmp) * (ndeps_all+cnt+1));
1269 if (!tmp) {
1270 error("Error recording dependencies for %s", p->name);
1271 if (runtime) longjmp(*rtld_fail, 1);
1272 continue;
1273 }
1274 if (no_realloc) {
1275 memcpy(tmp, p->deps, sizeof(*tmp) * (ndeps_all+1));
1276 no_realloc = 0;
1277 }
1278 p->deps = tmp;
1279 for (j=0; j<dep->ndeps_direct; j++) {
1280 if (dep->deps[j]->mark) continue;
1281 dep->deps[j]->mark = 1;
1282 p->deps[ndeps_all++] = dep->deps[j];
1283 }
1284 p->deps[ndeps_all] = 0;
1285 }
1286 p->bfs_built = 1;
1287 for (p=head; p; p=p->next)
1288 p->mark = 0;
1289}
1290
1291static void load_preload(char *s)
1292{
1293 int tmp;
1294 char *z;
1295 for (z=s; *z; s=z) {
1296 for ( ; *s && (isspace(*s) || *s==':'); s++);
1297 for (z=s; *z && !isspace(*z) && *z!=':'; z++);
1298 tmp = *z;
1299 *z = 0;
1300 load_library(s, 0);
1301 *z = tmp;
1302 }
1303}
1304
1305static void add_syms(struct dso *p)
1306{
1307 if (!p->syms_next && syms_tail != p) {
1308 syms_tail->syms_next = p;
1309 syms_tail = p;
1310 }
1311}
1312
1313static void revert_syms(struct dso *old_tail)
1314{
1315 struct dso *p, *next;
1316 /* Chop off the tail of the list of dsos that participate in
1317 * the global symbol table, reverting them to RTLD_LOCAL. */
1318 for (p=old_tail; p; p=next) {
1319 next = p->syms_next;
1320 p->syms_next = 0;
1321 }
1322 syms_tail = old_tail;
1323}
1324
1325static void do_mips_relocs(struct dso *p, size_t *got)
1326{
1327 size_t i, j, rel[2];
1328 unsigned char *base = p->base;
1329 i=0; search_vec(p->dynv, &i, DT_MIPS_LOCAL_GOTNO);
1330 if (p==&ldso) {
1331 got += i;
1332 } else {
1333 while (i--) *got++ += (size_t)base;
1334 }
1335 j=0; search_vec(p->dynv, &j, DT_MIPS_GOTSYM);
1336 i=0; search_vec(p->dynv, &i, DT_MIPS_SYMTABNO);
1337 Sym *sym = p->syms + j;
1338 rel[0] = (unsigned char *)got - base;
1339 for (i-=j; i; i--, sym++, rel[0]+=sizeof(size_t)) {
1340 rel[1] = R_INFO(sym-p->syms, R_MIPS_JUMP_SLOT);
1341 do_relocs(p, rel, sizeof rel, 2);
1342 }
1343}
1344
1345static void reloc_all(struct dso *p)
1346{
1347 size_t dyn[DYN_CNT];
1348 for (; p; p=p->next) {
1349 if (p->relocated) continue;
1350 decode_vec(p->dynv, dyn, DYN_CNT);
1351 if (NEED_MIPS_GOT_RELOCS)
1352 do_mips_relocs(p, laddr(p, dyn[DT_PLTGOT]));
1353 do_relocs(p, laddr(p, dyn[DT_JMPREL]), dyn[DT_PLTRELSZ],
1354 2+(dyn[DT_PLTREL]==DT_RELA));
1355 do_relocs(p, laddr(p, dyn[DT_REL]), dyn[DT_RELSZ], 2);
1356 do_relocs(p, laddr(p, dyn[DT_RELA]), dyn[DT_RELASZ], 3);
1357
1358 if (head != &ldso && p->relro_start != p->relro_end &&
1359 mprotect(laddr(p, p->relro_start), p->relro_end-p->relro_start, PROT_READ)
1360 && errno != ENOSYS) {
1361 error("Error relocating %s: RELRO protection failed: %m",
1362 p->name);
1363 if (runtime) longjmp(*rtld_fail, 1);
1364 }
1365
1366 p->relocated = 1;
1367 }
1368}
1369
1370static void kernel_mapped_dso(struct dso *p)
1371{
1372 size_t min_addr = -1, max_addr = 0, cnt;
1373 Phdr *ph = p->phdr;
1374 for (cnt = p->phnum; cnt--; ph = (void *)((char *)ph + p->phentsize)) {
1375 if (ph->p_type == PT_DYNAMIC) {
1376 p->dynv = laddr(p, ph->p_vaddr);
1377 } else if (ph->p_type == PT_GNU_RELRO) {
1378 p->relro_start = ph->p_vaddr & -PAGE_SIZE;
1379 p->relro_end = (ph->p_vaddr + ph->p_memsz) & -PAGE_SIZE;
1380 } else if (ph->p_type == PT_GNU_STACK) {
1381 if (!runtime && ph->p_memsz > __default_stacksize) {
1382 __default_stacksize =
1383 ph->p_memsz < DEFAULT_STACK_MAX ?
1384 ph->p_memsz : DEFAULT_STACK_MAX;
1385 }
1386 }
1387 if (ph->p_type != PT_LOAD) continue;
1388 if (ph->p_vaddr < min_addr)
1389 min_addr = ph->p_vaddr;
1390 if (ph->p_vaddr+ph->p_memsz > max_addr)
1391 max_addr = ph->p_vaddr+ph->p_memsz;
1392 }
1393 min_addr &= -PAGE_SIZE;
1394 max_addr = (max_addr + PAGE_SIZE-1) & -PAGE_SIZE;
1395 p->map = p->base + min_addr;
1396 p->map_len = max_addr - min_addr;
1397 p->kernel_mapped = 1;
1398}
1399
1400void __libc_exit_fini()
1401{
1402 struct dso *p;
1403 size_t dyn[DYN_CNT];
1404 pthread_t self = __pthread_self();
1405
1406 /* Take both locks before setting shutting_down, so that
1407 * either lock is sufficient to read its value. The lock
1408 * order matches that in dlopen to avoid deadlock. */
1409 pthread_rwlock_wrlock(&lock);
1410 pthread_mutex_lock(&init_fini_lock);
1411 shutting_down = 1;
1412 pthread_rwlock_unlock(&lock);
1413 for (p=fini_head; p; p=p->fini_next) {
1414 while (p->ctor_visitor && p->ctor_visitor!=self)
1415 pthread_cond_wait(&ctor_cond, &init_fini_lock);
1416 if (!p->constructed) continue;
1417 decode_vec(p->dynv, dyn, DYN_CNT);
1418 if (dyn[0] & (1<<DT_FINI_ARRAY)) {
1419 size_t n = dyn[DT_FINI_ARRAYSZ]/sizeof(size_t);
1420 size_t *fn = (size_t *)laddr(p, dyn[DT_FINI_ARRAY])+n;
1421 while (n--) ((void (*)(void))*--fn)();
1422 }
1423#ifndef NO_LEGACY_INITFINI
1424 if ((dyn[0] & (1<<DT_FINI)) && dyn[DT_FINI])
1425 fpaddr(p, dyn[DT_FINI])();
1426#endif
1427 }
1428}
1429
1430void __ldso_atfork(int who)
1431{
1432 if (who<0) {
1433 pthread_rwlock_wrlock(&lock);
1434 pthread_mutex_lock(&init_fini_lock);
1435 } else {
1436 pthread_mutex_unlock(&init_fini_lock);
1437 pthread_rwlock_unlock(&lock);
1438 }
1439}
1440
1441static struct dso **queue_ctors(struct dso *dso)
1442{
1443 size_t cnt, qpos, spos, i;
1444 struct dso *p, **queue, **stack;
1445
1446 if (ldd_mode) return 0;
1447
1448 /* Bound on queue size is the total number of indirect deps.
1449 * If a bfs deps list was built, we can use it. Otherwise,
1450 * bound by the total number of DSOs, which is always safe and
1451 * is reasonable we use it (for main app at startup). */
1452 if (dso->bfs_built) {
1453 for (cnt=0; dso->deps[cnt]; cnt++)
1454 dso->deps[cnt]->mark = 0;
1455 cnt++; /* self, not included in deps */
1456 } else {
1457 for (cnt=0, p=head; p; cnt++, p=p->next)
1458 p->mark = 0;
1459 }
1460 cnt++; /* termination slot */
1461 if (dso==head && cnt <= countof(builtin_ctor_queue))
1462 queue = builtin_ctor_queue;
1463 else
1464 queue = calloc(cnt, sizeof *queue);
1465
1466 if (!queue) {
1467 error("Error allocating constructor queue: %m\n");
1468 if (runtime) longjmp(*rtld_fail, 1);
1469 return 0;
1470 }
1471
1472 /* Opposite ends of the allocated buffer serve as an output queue
1473 * and a working stack. Setup initial stack with just the argument
1474 * dso and initial queue empty... */
1475 stack = queue;
1476 qpos = 0;
1477 spos = cnt;
1478 stack[--spos] = dso;
1479 dso->next_dep = 0;
1480 dso->mark = 1;
1481
1482 /* Then perform pseudo-DFS sort, but ignoring circular deps. */
1483 while (spos<cnt) {
1484 p = stack[spos++];
1485 while (p->next_dep < p->ndeps_direct) {
1486 if (p->deps[p->next_dep]->mark) {
1487 p->next_dep++;
1488 } else {
1489 stack[--spos] = p;
1490 p = p->deps[p->next_dep];
1491 p->next_dep = 0;
1492 p->mark = 1;
1493 }
1494 }
1495 queue[qpos++] = p;
1496 }
1497 queue[qpos] = 0;
1498 for (i=0; i<qpos; i++) queue[i]->mark = 0;
1499 for (i=0; i<qpos; i++)
1500 if (queue[i]->ctor_visitor && queue[i]->ctor_visitor->tid < 0) {
1501 error("State of %s is inconsistent due to multithreaded fork\n",
1502 queue[i]->name);
1503 free(queue);
1504 if (runtime) longjmp(*rtld_fail, 1);
1505 }
1506
1507 return queue;
1508}
1509
1510static void do_init_fini(struct dso **queue)
1511{
1512 struct dso *p;
1513 size_t dyn[DYN_CNT], i;
1514 pthread_t self = __pthread_self();
1515
1516 pthread_mutex_lock(&init_fini_lock);
1517 for (i=0; (p=queue[i]); i++) {
1518 while ((p->ctor_visitor && p->ctor_visitor!=self) || shutting_down)
1519 pthread_cond_wait(&ctor_cond, &init_fini_lock);
1520 if (p->ctor_visitor || p->constructed)
1521 continue;
1522 p->ctor_visitor = self;
1523
1524 decode_vec(p->dynv, dyn, DYN_CNT);
1525 if (dyn[0] & ((1<<DT_FINI) | (1<<DT_FINI_ARRAY))) {
1526 p->fini_next = fini_head;
1527 fini_head = p;
1528 }
1529
1530 pthread_mutex_unlock(&init_fini_lock);
1531
1532#ifndef NO_LEGACY_INITFINI
1533 if ((dyn[0] & (1<<DT_INIT)) && dyn[DT_INIT])
1534 fpaddr(p, dyn[DT_INIT])();
1535#endif
1536 if (dyn[0] & (1<<DT_INIT_ARRAY)) {
1537 size_t n = dyn[DT_INIT_ARRAYSZ]/sizeof(size_t);
1538 size_t *fn = laddr(p, dyn[DT_INIT_ARRAY]);
1539 while (n--) ((void (*)(void))*fn++)();
1540 }
1541
1542 pthread_mutex_lock(&init_fini_lock);
1543 p->ctor_visitor = 0;
1544 p->constructed = 1;
1545 pthread_cond_broadcast(&ctor_cond);
1546 }
1547 pthread_mutex_unlock(&init_fini_lock);
1548}
1549
1550void __libc_start_init(void)
1551{
1552 do_init_fini(main_ctor_queue);
1553 if (!__malloc_replaced && main_ctor_queue != builtin_ctor_queue)
1554 free(main_ctor_queue);
1555 main_ctor_queue = 0;
1556}
1557
1558static void dl_debug_state(void)
1559{
1560}
1561
1562weak_alias(dl_debug_state, _dl_debug_state);
1563
1564void __init_tls(size_t *auxv)
1565{
1566}
1567
1568static void update_tls_size()
1569{
1570 libc.tls_cnt = tls_cnt;
1571 libc.tls_align = tls_align;
1572 libc.tls_size = ALIGN(
1573 (1+tls_cnt) * sizeof(void *) +
1574 tls_offset +
1575 sizeof(struct pthread) +
1576 tls_align * 2,
1577 tls_align);
1578}
1579
1580static void install_new_tls(void)
1581{
1582 sigset_t set;
1583 pthread_t self = __pthread_self(), td;
1584 struct dso *dtv_provider = container_of(tls_tail, struct dso, tls);
1585 uintptr_t (*newdtv)[tls_cnt+1] = (void *)dtv_provider->new_dtv;
1586 struct dso *p;
1587 size_t i, j;
1588 size_t old_cnt = self->dtv[0];
1589
1590 __block_app_sigs(&set);
1591 __tl_lock();
1592 /* Copy existing dtv contents from all existing threads. */
1593 for (i=0, td=self; !i || td!=self; i++, td=td->next) {
1594 memcpy(newdtv+i, td->dtv,
1595 (old_cnt+1)*sizeof(uintptr_t));
1596 newdtv[i][0] = tls_cnt;
1597 }
1598 /* Install new dtls into the enlarged, uninstalled dtv copies. */
1599 for (p=head; ; p=p->next) {
1600 if (p->tls_id <= old_cnt) continue;
1601 unsigned char *mem = p->new_tls;
1602 for (j=0; j<i; j++) {
1603 unsigned char *new = mem;
1604 new += ((uintptr_t)p->tls.image - (uintptr_t)mem)
1605 & (p->tls.align-1);
1606 memcpy(new, p->tls.image, p->tls.len);
1607 newdtv[j][p->tls_id] =
1608 (uintptr_t)new + DTP_OFFSET;
1609 mem += p->tls.size + p->tls.align;
1610 }
1611 if (p->tls_id == tls_cnt) break;
1612 }
1613
1614 /* Broadcast barrier to ensure contents of new dtv is visible
1615 * if the new dtv pointer is. The __membarrier function has a
1616 * fallback emulation using signals for kernels that lack the
1617 * feature at the syscall level. */
1618
1619 __membarrier(MEMBARRIER_CMD_PRIVATE_EXPEDITED, 0);
1620
1621 /* Install new dtv for each thread. */
1622 for (j=0, td=self; !j || td!=self; j++, td=td->next) {
1623 td->dtv = newdtv[j];
1624 }
1625
1626 __tl_unlock();
1627 __restore_sigs(&set);
1628}
1629
1630/* Stage 1 of the dynamic linker is defined in dlstart.c. It calls the
1631 * following stage 2 and stage 3 functions via primitive symbolic lookup
1632 * since it does not have access to their addresses to begin with. */
1633
1634/* Stage 2 of the dynamic linker is called after relative relocations
1635 * have been processed. It can make function calls to static functions
1636 * and access string literals and static data, but cannot use extern
1637 * symbols. Its job is to perform symbolic relocations on the dynamic
1638 * linker itself, but some of the relocations performed may need to be
1639 * replaced later due to copy relocations in the main program. */
1640
1641hidden void __dls2(unsigned char *base, size_t *sp)
1642{
1643 size_t *auxv;
1644 for (auxv=sp+1+*sp+1; *auxv; auxv++);
1645 auxv++;
1646 if (DL_FDPIC) {
1647 void *p1 = (void *)sp[-2];
1648 void *p2 = (void *)sp[-1];
1649 if (!p1) {
1650 size_t aux[AUX_CNT];
1651 decode_vec(auxv, aux, AUX_CNT);
1652 if (aux[AT_BASE]) ldso.base = (void *)aux[AT_BASE];
1653 else ldso.base = (void *)(aux[AT_PHDR] & -4096);
1654 }
1655 app_loadmap = p2 ? p1 : 0;
1656 ldso.loadmap = p2 ? p2 : p1;
1657 ldso.base = laddr(&ldso, 0);
1658 } else {
1659 ldso.base = base;
1660 }
1661 Ehdr *ehdr = (void *)ldso.base;
1662 ldso.name = ldso.shortname = "libc.so";
1663 ldso.phnum = ehdr->e_phnum;
1664 ldso.phdr = laddr(&ldso, ehdr->e_phoff);
1665 ldso.phentsize = ehdr->e_phentsize;
1666 kernel_mapped_dso(&ldso);
1667 decode_dyn(&ldso);
1668
1669 if (DL_FDPIC) makefuncdescs(&ldso);
1670
1671 /* Prepare storage for to save clobbered REL addends so they
1672 * can be reused in stage 3. There should be very few. If
1673 * something goes wrong and there are a huge number, abort
1674 * instead of risking stack overflow. */
1675 size_t dyn[DYN_CNT];
1676 decode_vec(ldso.dynv, dyn, DYN_CNT);
1677 size_t *rel = laddr(&ldso, dyn[DT_REL]);
1678 size_t rel_size = dyn[DT_RELSZ];
1679 size_t symbolic_rel_cnt = 0;
1680 apply_addends_to = rel;
1681 for (; rel_size; rel+=2, rel_size-=2*sizeof(size_t))
1682 if (!IS_RELATIVE(rel[1], ldso.syms)) symbolic_rel_cnt++;
1683 if (symbolic_rel_cnt >= ADDEND_LIMIT) a_crash();
1684 size_t addends[symbolic_rel_cnt+1];
1685 saved_addends = addends;
1686
1687 head = &ldso;
1688 reloc_all(&ldso);
1689
1690 ldso.relocated = 0;
1691
1692 /* Call dynamic linker stage-2b, __dls2b, looking it up
1693 * symbolically as a barrier against moving the address
1694 * load across the above relocation processing. */
1695 struct symdef dls2b_def = find_sym(&ldso, "__dls2b", 0);
1696 if (DL_FDPIC) ((stage3_func)&ldso.funcdescs[dls2b_def.sym-ldso.syms])(sp, auxv);
1697 else ((stage3_func)laddr(&ldso, dls2b_def.sym->st_value))(sp, auxv);
1698}
1699
1700/* Stage 2b sets up a valid thread pointer, which requires relocations
1701 * completed in stage 2, and on which stage 3 is permitted to depend.
1702 * This is done as a separate stage, with symbolic lookup as a barrier,
1703 * so that loads of the thread pointer and &errno can be pure/const and
1704 * thereby hoistable. */
1705
1706void __dls2b(size_t *sp, size_t *auxv)
1707{
1708 /* Setup early thread pointer in builtin_tls for ldso/libc itself to
1709 * use during dynamic linking. If possible it will also serve as the
1710 * thread pointer at runtime. */
1711 search_vec(auxv, &__hwcap, AT_HWCAP);
1712 libc.auxv = auxv;
1713 libc.tls_size = sizeof builtin_tls;
1714 libc.tls_align = tls_align;
1715 if (__init_tp(__copy_tls((void *)builtin_tls)) < 0) {
1716 a_crash();
1717 }
1718
1719 struct symdef dls3_def = find_sym(&ldso, "__dls3", 0);
1720 if (DL_FDPIC) ((stage3_func)&ldso.funcdescs[dls3_def.sym-ldso.syms])(sp, auxv);
1721 else ((stage3_func)laddr(&ldso, dls3_def.sym->st_value))(sp, auxv);
1722}
1723
1724/* Stage 3 of the dynamic linker is called with the dynamic linker/libc
1725 * fully functional. Its job is to load (if not already loaded) and
1726 * process dependencies and relocations for the main application and
1727 * transfer control to its entry point. */
1728
1729void __dls3(size_t *sp, size_t *auxv)
1730{
1731 static struct dso app, vdso;
1732 size_t aux[AUX_CNT];
1733 size_t i;
1734 char *env_preload=0;
1735 char *replace_argv0=0;
1736 size_t vdso_base;
1737 int argc = *sp;
1738 char **argv = (void *)(sp+1);
1739 char **argv_orig = argv;
1740 char **envp = argv+argc+1;
1741
1742 /* Find aux vector just past environ[] and use it to initialize
1743 * global data that may be needed before we can make syscalls. */
1744 __environ = envp;
1745 decode_vec(auxv, aux, AUX_CNT);
1746 search_vec(auxv, &__sysinfo, AT_SYSINFO);
1747 __pthread_self()->sysinfo = __sysinfo;
1748 libc.page_size = aux[AT_PAGESZ];
1749 libc.secure = ((aux[0]&0x7800)!=0x7800 || aux[AT_UID]!=aux[AT_EUID]
1750 || aux[AT_GID]!=aux[AT_EGID] || aux[AT_SECURE]);
1751
1752 /* Only trust user/env if kernel says we're not suid/sgid */
1753 if (!libc.secure) {
1754 env_path = getenv("LD_LIBRARY_PATH");
1755 env_preload = getenv("LD_PRELOAD");
1756 }
1757
1758 /* If the main program was already loaded by the kernel,
1759 * AT_PHDR will point to some location other than the dynamic
1760 * linker's program headers. */
1761 if (aux[AT_PHDR] != (size_t)ldso.phdr) {
1762 size_t interp_off = 0;
1763 size_t tls_image = 0;
1764 /* Find load address of the main program, via AT_PHDR vs PT_PHDR. */
1765 Phdr *phdr = app.phdr = (void *)aux[AT_PHDR];
1766 app.phnum = aux[AT_PHNUM];
1767 app.phentsize = aux[AT_PHENT];
1768 for (i=aux[AT_PHNUM]; i; i--, phdr=(void *)((char *)phdr + aux[AT_PHENT])) {
1769 if (phdr->p_type == PT_PHDR)
1770 app.base = (void *)(aux[AT_PHDR] - phdr->p_vaddr);
1771 else if (phdr->p_type == PT_INTERP)
1772 interp_off = (size_t)phdr->p_vaddr;
1773 else if (phdr->p_type == PT_TLS) {
1774 tls_image = phdr->p_vaddr;
1775 app.tls.len = phdr->p_filesz;
1776 app.tls.size = phdr->p_memsz;
1777 app.tls.align = phdr->p_align;
1778 }
1779 }
1780 if (DL_FDPIC) app.loadmap = app_loadmap;
1781 if (app.tls.size) app.tls.image = laddr(&app, tls_image);
1782 if (interp_off) ldso.name = laddr(&app, interp_off);
1783 if ((aux[0] & (1UL<<AT_EXECFN))
1784 && strncmp((char *)aux[AT_EXECFN], "/proc/", 6))
1785 app.name = (char *)aux[AT_EXECFN];
1786 else
1787 app.name = argv[0];
1788 kernel_mapped_dso(&app);
1789 } else {
1790 int fd;
1791 char *ldname = argv[0];
1792 size_t l = strlen(ldname);
1793 if (l >= 3 && !strcmp(ldname+l-3, "ldd")) ldd_mode = 1;
1794 argv++;
1795 while (argv[0] && argv[0][0]=='-' && argv[0][1]=='-') {
1796 char *opt = argv[0]+2;
1797 *argv++ = (void *)-1;
1798 if (!*opt) {
1799 break;
1800 } else if (!memcmp(opt, "list", 5)) {
1801 ldd_mode = 1;
1802 } else if (!memcmp(opt, "library-path", 12)) {
1803 if (opt[12]=='=') env_path = opt+13;
1804 else if (opt[12]) *argv = 0;
1805 else if (*argv) env_path = *argv++;
1806 } else if (!memcmp(opt, "preload", 7)) {
1807 if (opt[7]=='=') env_preload = opt+8;
1808 else if (opt[7]) *argv = 0;
1809 else if (*argv) env_preload = *argv++;
1810 } else if (!memcmp(opt, "argv0", 5)) {
1811 if (opt[5]=='=') replace_argv0 = opt+6;
1812 else if (opt[5]) *argv = 0;
1813 else if (*argv) replace_argv0 = *argv++;
1814 } else {
1815 argv[0] = 0;
1816 }
1817 }
1818 argv[-1] = (void *)(argc - (argv-argv_orig));
1819 if (!argv[0]) {
1820 dprintf(2, "musl libc (" LDSO_ARCH ")\n"
1821 "Version %s\n"
1822 "Dynamic Program Loader\n"
1823 "Usage: %s [options] [--] pathname%s\n",
1824 __libc_version, ldname,
1825 ldd_mode ? "" : " [args]");
1826 _exit(1);
1827 }
1828 fd = open(argv[0], O_RDONLY);
1829 if (fd < 0) {
1830 dprintf(2, "%s: cannot load %s: %s\n", ldname, argv[0], strerror(errno));
1831 _exit(1);
1832 }
1833 Ehdr *ehdr = (void *)map_library(fd, &app);
1834 if (!ehdr) {
1835 dprintf(2, "%s: %s: Not a valid dynamic program\n", ldname, argv[0]);
1836 _exit(1);
1837 }
1838 close(fd);
1839 ldso.name = ldname;
1840 app.name = argv[0];
1841 aux[AT_ENTRY] = (size_t)laddr(&app, ehdr->e_entry);
1842 /* Find the name that would have been used for the dynamic
1843 * linker had ldd not taken its place. */
1844 if (ldd_mode) {
1845 for (i=0; i<app.phnum; i++) {
1846 if (app.phdr[i].p_type == PT_INTERP)
1847 ldso.name = laddr(&app, app.phdr[i].p_vaddr);
1848 }
1849 dprintf(1, "\t%s (%p)\n", ldso.name, ldso.base);
1850 }
1851 }
1852 if (app.tls.size) {
1853 libc.tls_head = tls_tail = &app.tls;
1854 app.tls_id = tls_cnt = 1;
1855#ifdef TLS_ABOVE_TP
1856 app.tls.offset = GAP_ABOVE_TP;
1857 app.tls.offset += (-GAP_ABOVE_TP + (uintptr_t)app.tls.image)
1858 & (app.tls.align-1);
1859 tls_offset = app.tls.offset + app.tls.size;
1860#else
1861 tls_offset = app.tls.offset = app.tls.size
1862 + ( -((uintptr_t)app.tls.image + app.tls.size)
1863 & (app.tls.align-1) );
1864#endif
1865 tls_align = MAXP2(tls_align, app.tls.align);
1866 }
1867 decode_dyn(&app);
1868 if (DL_FDPIC) {
1869 makefuncdescs(&app);
1870 if (!app.loadmap) {
1871 app.loadmap = (void *)&app_dummy_loadmap;
1872 app.loadmap->nsegs = 1;
1873 app.loadmap->segs[0].addr = (size_t)app.map;
1874 app.loadmap->segs[0].p_vaddr = (size_t)app.map
1875 - (size_t)app.base;
1876 app.loadmap->segs[0].p_memsz = app.map_len;
1877 }
1878 argv[-3] = (void *)app.loadmap;
1879 }
1880
1881 /* Initial dso chain consists only of the app. */
1882 head = tail = syms_tail = &app;
1883
1884 /* Donate unused parts of app and library mapping to malloc */
1885 reclaim_gaps(&app);
1886 reclaim_gaps(&ldso);
1887
1888 /* Load preload/needed libraries, add symbols to global namespace. */
1889 ldso.deps = (struct dso **)no_deps;
1890 if (env_preload) load_preload(env_preload);
1891 load_deps(&app);
1892 for (struct dso *p=head; p; p=p->next)
1893 add_syms(p);
1894
1895 /* Attach to vdso, if provided by the kernel, last so that it does
1896 * not become part of the global namespace. */
1897 if (search_vec(auxv, &vdso_base, AT_SYSINFO_EHDR) && vdso_base) {
1898 Ehdr *ehdr = (void *)vdso_base;
1899 Phdr *phdr = vdso.phdr = (void *)(vdso_base + ehdr->e_phoff);
1900 vdso.phnum = ehdr->e_phnum;
1901 vdso.phentsize = ehdr->e_phentsize;
1902 for (i=ehdr->e_phnum; i; i--, phdr=(void *)((char *)phdr + ehdr->e_phentsize)) {
1903 if (phdr->p_type == PT_DYNAMIC)
1904 vdso.dynv = (void *)(vdso_base + phdr->p_offset);
1905 if (phdr->p_type == PT_LOAD)
1906 vdso.base = (void *)(vdso_base - phdr->p_vaddr + phdr->p_offset);
1907 }
1908 vdso.name = "";
1909 vdso.shortname = "linux-gate.so.1";
1910 vdso.relocated = 1;
1911 vdso.deps = (struct dso **)no_deps;
1912 decode_dyn(&vdso);
1913 vdso.prev = tail;
1914 tail->next = &vdso;
1915 tail = &vdso;
1916 }
1917
1918 for (i=0; app.dynv[i]; i+=2) {
1919 if (!DT_DEBUG_INDIRECT && app.dynv[i]==DT_DEBUG)
1920 app.dynv[i+1] = (size_t)&debug;
1921 if (DT_DEBUG_INDIRECT && app.dynv[i]==DT_DEBUG_INDIRECT) {
1922 size_t *ptr = (size_t *) app.dynv[i+1];
1923 *ptr = (size_t)&debug;
1924 }
1925 }
1926
1927 /* This must be done before final relocations, since it calls
1928 * malloc, which may be provided by the application. Calling any
1929 * application code prior to the jump to its entry point is not
1930 * valid in our model and does not work with FDPIC, where there
1931 * are additional relocation-like fixups that only the entry point
1932 * code can see to perform. */
1933 main_ctor_queue = queue_ctors(&app);
1934
1935 /* Initial TLS must also be allocated before final relocations
1936 * might result in calloc being a call to application code. */
1937 update_tls_size();
1938 void *initial_tls = builtin_tls;
1939 if (libc.tls_size > sizeof builtin_tls || tls_align > MIN_TLS_ALIGN) {
1940 initial_tls = calloc(libc.tls_size, 1);
1941 if (!initial_tls) {
1942 dprintf(2, "%s: Error getting %zu bytes thread-local storage: %m\n",
1943 argv[0], libc.tls_size);
1944 _exit(127);
1945 }
1946 }
1947 static_tls_cnt = tls_cnt;
1948
1949 /* The main program must be relocated LAST since it may contain
1950 * copy relocations which depend on libraries' relocations. */
1951 reloc_all(app.next);
1952 reloc_all(&app);
1953
1954 /* Actual copying to new TLS needs to happen after relocations,
1955 * since the TLS images might have contained relocated addresses. */
1956 if (initial_tls != builtin_tls) {
1957 if (__init_tp(__copy_tls(initial_tls)) < 0) {
1958 a_crash();
1959 }
1960 } else {
1961 size_t tmp_tls_size = libc.tls_size;
1962 pthread_t self = __pthread_self();
1963 /* Temporarily set the tls size to the full size of
1964 * builtin_tls so that __copy_tls will use the same layout
1965 * as it did for before. Then check, just to be safe. */
1966 libc.tls_size = sizeof builtin_tls;
1967 if (__copy_tls((void*)builtin_tls) != self) a_crash();
1968 libc.tls_size = tmp_tls_size;
1969 }
1970
1971 if (ldso_fail) _exit(127);
1972 if (ldd_mode) _exit(0);
1973
1974 /* Determine if malloc was interposed by a replacement implementation
1975 * so that calloc and the memalign family can harden against the
1976 * possibility of incomplete replacement. */
1977 if (find_sym(head, "malloc", 1).dso != &ldso)
1978 __malloc_replaced = 1;
1979 if (find_sym(head, "aligned_alloc", 1).dso != &ldso)
1980 __aligned_alloc_replaced = 1;
1981
1982 /* Switch to runtime mode: any further failures in the dynamic
1983 * linker are a reportable failure rather than a fatal startup
1984 * error. */
1985 runtime = 1;
1986
1987 debug.ver = 1;
1988 debug.bp = dl_debug_state;
1989 debug.head = head;
1990 debug.base = ldso.base;
1991 debug.state = RT_CONSISTENT;
1992 _dl_debug_state();
1993
1994 if (replace_argv0) argv[0] = replace_argv0;
1995
1996 errno = 0;
1997
1998 CRTJMP((void *)aux[AT_ENTRY], argv-1);
1999 for(;;);
2000}
2001
2002static void prepare_lazy(struct dso *p)
2003{
2004 size_t dyn[DYN_CNT], n, flags1=0;
2005 decode_vec(p->dynv, dyn, DYN_CNT);
2006 search_vec(p->dynv, &flags1, DT_FLAGS_1);
2007 if (dyn[DT_BIND_NOW] || (dyn[DT_FLAGS] & DF_BIND_NOW) || (flags1 & DF_1_NOW))
2008 return;
2009 n = dyn[DT_RELSZ]/2 + dyn[DT_RELASZ]/3 + dyn[DT_PLTRELSZ]/2 + 1;
2010 if (NEED_MIPS_GOT_RELOCS) {
2011 size_t j=0; search_vec(p->dynv, &j, DT_MIPS_GOTSYM);
2012 size_t i=0; search_vec(p->dynv, &i, DT_MIPS_SYMTABNO);
2013 n += i-j;
2014 }
2015 p->lazy = calloc(n, 3*sizeof(size_t));
2016 if (!p->lazy) {
2017 error("Error preparing lazy relocation for %s: %m", p->name);
2018 longjmp(*rtld_fail, 1);
2019 }
2020 p->lazy_next = lazy_head;
2021 lazy_head = p;
2022}
2023
2024void *dlopen(const char *file, int mode)
2025{
2026 struct dso *volatile p, *orig_tail, *orig_syms_tail, *orig_lazy_head, *next;
2027 struct tls_module *orig_tls_tail;
2028 size_t orig_tls_cnt, orig_tls_offset, orig_tls_align;
2029 size_t i;
2030 int cs;
2031 jmp_buf jb;
2032 struct dso **volatile ctor_queue = 0;
2033
2034 if (!file) return head;
2035
2036 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);
2037 pthread_rwlock_wrlock(&lock);
2038 __inhibit_ptc();
2039
2040 debug.state = RT_ADD;
2041 _dl_debug_state();
2042
2043 p = 0;
2044 if (shutting_down) {
2045 error("Cannot dlopen while program is exiting.");
2046 goto end;
2047 }
2048 orig_tls_tail = tls_tail;
2049 orig_tls_cnt = tls_cnt;
2050 orig_tls_offset = tls_offset;
2051 orig_tls_align = tls_align;
2052 orig_lazy_head = lazy_head;
2053 orig_syms_tail = syms_tail;
2054 orig_tail = tail;
2055 noload = mode & RTLD_NOLOAD;
2056
2057 rtld_fail = &jb;
2058 if (setjmp(*rtld_fail)) {
2059 /* Clean up anything new that was (partially) loaded */
2060 revert_syms(orig_syms_tail);
2061 for (p=orig_tail->next; p; p=next) {
2062 next = p->next;
2063 while (p->td_index) {
2064 void *tmp = p->td_index->next;
2065 free(p->td_index);
2066 p->td_index = tmp;
2067 }
2068 free(p->funcdescs);
2069 if (p->rpath != p->rpath_orig)
2070 free(p->rpath);
2071 free(p->deps);
2072 unmap_library(p);
2073 free(p);
2074 }
2075 free(ctor_queue);
2076 ctor_queue = 0;
2077 if (!orig_tls_tail) libc.tls_head = 0;
2078 tls_tail = orig_tls_tail;
2079 if (tls_tail) tls_tail->next = 0;
2080 tls_cnt = orig_tls_cnt;
2081 tls_offset = orig_tls_offset;
2082 tls_align = orig_tls_align;
2083 lazy_head = orig_lazy_head;
2084 tail = orig_tail;
2085 tail->next = 0;
2086 p = 0;
2087 goto end;
2088 } else p = load_library(file, head);
2089
2090 if (!p) {
2091 error(noload ?
2092 "Library %s is not already loaded" :
2093 "Error loading shared library %s: %m",
2094 file);
2095 goto end;
2096 }
2097
2098 /* First load handling */
2099 load_deps(p);
2100 extend_bfs_deps(p);
2101 pthread_mutex_lock(&init_fini_lock);
2102 int constructed = p->constructed;
2103 pthread_mutex_unlock(&init_fini_lock);
2104 if (!constructed) ctor_queue = queue_ctors(p);
2105 if (!p->relocated && (mode & RTLD_LAZY)) {
2106 prepare_lazy(p);
2107 for (i=0; p->deps[i]; i++)
2108 if (!p->deps[i]->relocated)
2109 prepare_lazy(p->deps[i]);
2110 }
2111 if (!p->relocated || (mode & RTLD_GLOBAL)) {
2112 /* Make new symbols global, at least temporarily, so we can do
2113 * relocations. If not RTLD_GLOBAL, this is reverted below. */
2114 add_syms(p);
2115 for (i=0; p->deps[i]; i++)
2116 add_syms(p->deps[i]);
2117 }
2118 if (!p->relocated) {
2119 reloc_all(p);
2120 }
2121
2122 /* If RTLD_GLOBAL was not specified, undo any new additions
2123 * to the global symbol table. This is a nop if the library was
2124 * previously loaded and already global. */
2125 if (!(mode & RTLD_GLOBAL))
2126 revert_syms(orig_syms_tail);
2127
2128 /* Processing of deferred lazy relocations must not happen until
2129 * the new libraries are committed; otherwise we could end up with
2130 * relocations resolved to symbol definitions that get removed. */
2131 redo_lazy_relocs();
2132
2133 update_tls_size();
2134 if (tls_cnt != orig_tls_cnt)
2135 install_new_tls();
2136 orig_tail = tail;
2137end:
2138 debug.state = RT_CONSISTENT;
2139 _dl_debug_state();
2140 __release_ptc();
2141 if (p) gencnt++;
2142 pthread_rwlock_unlock(&lock);
2143 if (ctor_queue) {
2144 do_init_fini(ctor_queue);
2145 free(ctor_queue);
2146 }
2147 pthread_setcancelstate(cs, 0);
2148 return p;
2149}
2150
2151hidden int __dl_invalid_handle(void *h)
2152{
2153 struct dso *p;
2154 for (p=head; p; p=p->next) if (h==p) return 0;
2155 error("Invalid library handle %p", (void *)h);
2156 return 1;
2157}
2158
2159static void *addr2dso(size_t a)
2160{
2161 struct dso *p;
2162 size_t i;
2163 if (DL_FDPIC) for (p=head; p; p=p->next) {
2164 i = count_syms(p);
2165 if (a-(size_t)p->funcdescs < i*sizeof(*p->funcdescs))
2166 return p;
2167 }
2168 for (p=head; p; p=p->next) {
2169 if (DL_FDPIC && p->loadmap) {
2170 for (i=0; i<p->loadmap->nsegs; i++) {
2171 if (a-p->loadmap->segs[i].p_vaddr
2172 < p->loadmap->segs[i].p_memsz)
2173 return p;
2174 }
2175 } else {
2176 Phdr *ph = p->phdr;
2177 size_t phcnt = p->phnum;
2178 size_t entsz = p->phentsize;
2179 size_t base = (size_t)p->base;
2180 for (; phcnt--; ph=(void *)((char *)ph+entsz)) {
2181 if (ph->p_type != PT_LOAD) continue;
2182 if (a-base-ph->p_vaddr < ph->p_memsz)
2183 return p;
2184 }
2185 if (a-(size_t)p->map < p->map_len)
2186 return 0;
2187 }
2188 }
2189 return 0;
2190}
2191
2192static void *do_dlsym(struct dso *p, const char *s, void *ra)
2193{
2194 int use_deps = 0;
2195 if (p == head || p == RTLD_DEFAULT) {
2196 p = head;
2197 } else if (p == RTLD_NEXT) {
2198 p = addr2dso((size_t)ra);
2199 if (!p) p=head;
2200 p = p->next;
2201 } else if (__dl_invalid_handle(p)) {
2202 return 0;
2203 } else
2204 use_deps = 1;
2205 struct symdef def = find_sym2(p, s, 0, use_deps);
2206 if (!def.sym) {
2207 error("Symbol not found: %s", s);
2208 return 0;
2209 }
2210 if ((def.sym->st_info&0xf) == STT_TLS)
2211 return __tls_get_addr((tls_mod_off_t []){def.dso->tls_id, def.sym->st_value-DTP_OFFSET});
2212 if (DL_FDPIC && (def.sym->st_info&0xf) == STT_FUNC)
2213 return def.dso->funcdescs + (def.sym - def.dso->syms);
2214 return laddr(def.dso, def.sym->st_value);
2215}
2216
2217int dladdr(const void *addr_arg, Dl_info *info)
2218{
2219 size_t addr = (size_t)addr_arg;
2220 struct dso *p;
2221 Sym *sym, *bestsym;
2222 uint32_t nsym;
2223 char *strings;
2224 size_t best = 0;
2225 size_t besterr = -1;
2226
2227 pthread_rwlock_rdlock(&lock);
2228 p = addr2dso(addr);
2229 pthread_rwlock_unlock(&lock);
2230
2231 if (!p) return 0;
2232
2233 sym = p->syms;
2234 strings = p->strings;
2235 nsym = count_syms(p);
2236
2237 if (DL_FDPIC) {
2238 size_t idx = (addr-(size_t)p->funcdescs)
2239 / sizeof(*p->funcdescs);
2240 if (idx < nsym && (sym[idx].st_info&0xf) == STT_FUNC) {
2241 best = (size_t)(p->funcdescs + idx);
2242 bestsym = sym + idx;
2243 besterr = 0;
2244 }
2245 }
2246
2247 if (!best) for (; nsym; nsym--, sym++) {
2248 if (sym->st_value
2249 && (1<<(sym->st_info&0xf) & OK_TYPES)
2250 && (1<<(sym->st_info>>4) & OK_BINDS)) {
2251 size_t symaddr = (size_t)laddr(p, sym->st_value);
2252 if (symaddr > addr || symaddr <= best)
2253 continue;
2254 best = symaddr;
2255 bestsym = sym;
2256 besterr = addr - symaddr;
2257 if (addr == symaddr)
2258 break;
2259 }
2260 }
2261
2262 if (best && besterr > bestsym->st_size-1) {
2263 best = 0;
2264 bestsym = 0;
2265 }
2266
2267 info->dli_fname = p->name;
2268 info->dli_fbase = p->map;
2269
2270 if (!best) {
2271 info->dli_sname = 0;
2272 info->dli_saddr = 0;
2273 return 1;
2274 }
2275
2276 if (DL_FDPIC && (bestsym->st_info&0xf) == STT_FUNC)
2277 best = (size_t)(p->funcdescs + (bestsym - p->syms));
2278 info->dli_sname = strings + bestsym->st_name;
2279 info->dli_saddr = (void *)best;
2280
2281 return 1;
2282}
2283
2284hidden void *__dlsym(void *restrict p, const char *restrict s, void *restrict ra)
2285{
2286 void *res;
2287 pthread_rwlock_rdlock(&lock);
2288 res = do_dlsym(p, s, ra);
2289 pthread_rwlock_unlock(&lock);
2290 return res;
2291}
2292
2293hidden void *__dlsym_redir_time64(void *restrict p, const char *restrict s, void *restrict ra)
2294{
2295#if _REDIR_TIME64
2296 const char *suffix, *suffix2 = "";
2297 char redir[36];
2298
2299 /* Map the symbol name to a time64 version of itself according to the
2300 * pattern used for naming the redirected time64 symbols. */
2301 size_t l = strnlen(s, sizeof redir);
2302 if (l<4 || l==sizeof redir) goto no_redir;
2303 if (s[l-2]=='_' && s[l-1]=='r') {
2304 l -= 2;
2305 suffix2 = s+l;
2306 }
2307 if (l<4) goto no_redir;
2308 if (!strcmp(s+l-4, "time")) suffix = "64";
2309 else suffix = "_time64";
2310
2311 /* Use the presence of the remapped symbol name in libc to determine
2312 * whether it's one that requires time64 redirection; replace if so. */
2313 snprintf(redir, sizeof redir, "__%.*s%s%s", (int)l, s, suffix, suffix2);
2314 if (find_sym(&ldso, redir, 1).sym) s = redir;
2315no_redir:
2316#endif
2317 return __dlsym(p, s, ra);
2318}
2319
2320int dl_iterate_phdr(int(*callback)(struct dl_phdr_info *info, size_t size, void *data), void *data)
2321{
2322 struct dso *current;
2323 struct dl_phdr_info info;
2324 int ret = 0;
2325 for(current = head; current;) {
2326 info.dlpi_addr = (uintptr_t)current->base;
2327 info.dlpi_name = current->name;
2328 info.dlpi_phdr = current->phdr;
2329 info.dlpi_phnum = current->phnum;
2330 info.dlpi_adds = gencnt;
2331 info.dlpi_subs = 0;
2332 info.dlpi_tls_modid = current->tls_id;
2333 info.dlpi_tls_data = current->tls.image;
2334
2335 ret = (callback)(&info, sizeof (info), data);
2336
2337 if (ret != 0) break;
2338
2339 pthread_rwlock_rdlock(&lock);
2340 current = current->next;
2341 pthread_rwlock_unlock(&lock);
2342 }
2343 return ret;
2344}
2345
2346static void error(const char *fmt, ...)
2347{
2348 va_list ap;
2349 va_start(ap, fmt);
2350 if (!runtime) {
2351 vdprintf(2, fmt, ap);
2352 dprintf(2, "\n");
2353 ldso_fail = 1;
2354 va_end(ap);
2355 return;
2356 }
2357 __dl_vseterr(fmt, ap);
2358 va_end(ap);
2359}
lib/libc/wasi/libc-top-half/musl/tools/add-cfi.common.awk deleted-26
...@@ -1,26 +0,0 @@
1function hex2int(str, i) {
2 str = tolower(str)
3
4 for (i = 1; i <= 16; i++) {
5 char = substr("0123456789abcdef", i, 1)
6 lookup[char] = i-1
7 }
8
9 result = 0
10 for (i = 1; i <= length(str); i++) {
11 result = result * 16
12 char = substr(str, i, 1)
13 result = result + lookup[char]
14 }
15 return result
16}
17
18function parse_const(str) {
19 sign = sub(/^-/, "", str)
20 hex = sub(/^0x/, "", str)
21 if (hex)
22 n = hex2int(str)
23 else
24 n = str+0
25 return sign ? -n : n
26}
lib/libc/wasi/libc-top-half/musl/tools/add-cfi.i386.awk deleted-209
...@@ -1,209 +0,0 @@
1# Insert GAS CFI directives ("control frame information") into x86-32 asm input
2#
3# CFI directives tell the assembler how to generate "stack frame" debug info
4# This information can tell a debugger (like gdb) how to find the current stack
5# frame at any point in the program code, and how to find the values which
6# various registers had at higher points in the call stack
7# With this information, the debugger can show a backtrace, and you can move up
8# and down the call stack and examine the values of local variables
9
10BEGIN {
11 # don't put CFI data in the .eh_frame ELF section (which we don't keep)
12 print ".cfi_sections .debug_frame"
13
14 # only emit CFI directives inside a function
15 in_function = 0
16
17 # emit .loc directives with line numbers from original source
18 printf ".file 1 \"%s\"\n", ARGV[1]
19 line_number = 0
20
21 # used to detect "call label; label:" trick
22 called = ""
23}
24
25function get_const1() {
26 # for instructions with 2 operands, get 1st operand (assuming it is constant)
27 match($0, /-?(0x[0-9a-fA-F]+|[0-9]+),/)
28 return parse_const(substr($0, RSTART, RLENGTH-1))
29}
30
31function canonicalize_reg(register) {
32 if (match(register, /^e/))
33 return register
34 else if (match(register, /[hl]$/)) # AH, AL, BH, BL, etc
35 return "e" substr(register, 1, 1) "x"
36 else # AX, BX, CX, etc
37 return "e" register
38}
39function get_reg() {
40 # only use if you already know there is 1 and only 1 register
41 match($0, /%e?([abcd][hlx]|si|di|bp)/)
42 return canonicalize_reg(substr($0, RSTART+1, RLENGTH-1))
43}
44function get_reg1() {
45 # for instructions with 2 operands, get 1st operand (assuming it is register)
46 match($0, /%e?([abcd][hlx]|si|di|bp),/)
47 return canonicalize_reg(substr($0, RSTART+1, RLENGTH-2))
48}
49function get_reg2() {
50 # for instructions with 2 operands, get 2nd operand (assuming it is register)
51 match($0, /,%e?([abcd][hlx]|si|di|bp)/)
52 return canonicalize_reg(substr($0, RSTART+2, RLENGTH-2))
53}
54
55function adjust_sp_offset(delta) {
56 if (in_function)
57 printf ".cfi_adjust_cfa_offset %d\n", delta
58}
59
60{
61 line_number = line_number + 1
62
63 # clean the input up before doing anything else
64 # delete comments
65 gsub(/(#|\/\/).*/, "")
66
67 # canonicalize whitespace
68 gsub(/[ \t]+/, " ") # mawk doesn't understand \s
69 gsub(/ *, */, ",")
70 gsub(/ *: */, ": ")
71 gsub(/ $/, "")
72 gsub(/^ /, "")
73}
74
75# check for assembler directives which we care about
76/^\.(section|data|text)/ {
77 # a .cfi_startproc/.cfi_endproc pair should be within the same section
78 # otherwise, clang will choke when generating ELF output
79 if (in_function) {
80 print ".cfi_endproc"
81 in_function = 0
82 }
83}
84/^\.type [a-zA-Z0-9_]+,@function/ {
85 functions[substr($2, 1, length($2)-10)] = 1
86}
87# not interested in assembler directives beyond this, just pass them through
88/^\./ {
89 print
90 next
91}
92
93/^[a-zA-Z0-9_]+:/ {
94 label = substr($1, 1, length($1)-1) # drop trailing :
95
96 if (called == label) {
97 # note adjustment of stack pointer from "call label; label:"
98 adjust_sp_offset(4)
99 }
100
101 if (functions[label]) {
102 if (in_function)
103 print ".cfi_endproc"
104
105 in_function = 1
106 print ".cfi_startproc"
107
108 for (register in saved)
109 delete saved[register]
110 for (register in dirty)
111 delete dirty[register]
112 }
113
114 # an instruction may follow on the same line, so continue processing
115}
116
117/^$/ { next }
118
119{
120 called = ""
121 printf ".loc 1 %d\n", line_number
122 print
123}
124
125# KEEPING UP WITH THE STACK POINTER
126# We do NOT attempt to understand foolish and ridiculous tricks like stashing
127# the stack pointer and then using %esp as a scratch register, or bitshifting
128# it or taking its square root or anything stupid like that.
129# %esp should only be adjusted by pushing/popping or adding/subtracting constants
130#
131/pushl?/ {
132 if (match($0, / %(ax|bx|cx|dx|di|si|bp|sp)/))
133 adjust_sp_offset(2)
134 else
135 adjust_sp_offset(4)
136}
137/popl?/ {
138 if (match($0, / %(ax|bx|cx|dx|di|si|bp|sp)/))
139 adjust_sp_offset(-2)
140 else
141 adjust_sp_offset(-4)
142}
143/addl? \$-?(0x[0-9a-fA-F]+|[0-9]+),%esp/ { adjust_sp_offset(-get_const1()) }
144/subl? \$-?(0x[0-9a-fA-F]+|[0-9]+),%esp/ { adjust_sp_offset(get_const1()) }
145
146/call/ {
147 if (match($0, /call [0-9]+f/)) # "forward" label
148 called = substr($0, RSTART+5, RLENGTH-6)
149 else if (match($0, /call [0-9a-zA-Z_]+/))
150 called = substr($0, RSTART+5, RLENGTH-5)
151}
152
153# TRACKING REGISTER VALUES FROM THE PREVIOUS STACK FRAME
154#
155/pushl? %e(ax|bx|cx|dx|si|di|bp)/ { # don't match "push (%reg)"
156 # if a register is being pushed, and its value has not changed since the
157 # beginning of this function, the pushed value can be used when printing
158 # local variables at the next level up the stack
159 # emit '.cfi_rel_offset' for that
160
161 if (in_function) {
162 register = get_reg()
163 if (!saved[register] && !dirty[register]) {
164 printf ".cfi_rel_offset %s,0\n", register
165 saved[register] = 1
166 }
167 }
168}
169
170/movl? %e(ax|bx|cx|dx|si|di|bp),-?(0x[0-9a-fA-F]+|[0-9]+)?\(%esp\)/ {
171 if (in_function) {
172 register = get_reg()
173 if (match($0, /-?(0x[0-9a-fA-F]+|[0-9]+)\(%esp\)/)) {
174 offset = parse_const(substr($0, RSTART, RLENGTH-6))
175 } else {
176 offset = 0
177 }
178 if (!saved[register] && !dirty[register]) {
179 printf ".cfi_rel_offset %s,%d\n", register, offset
180 saved[register] = 1
181 }
182 }
183}
184
185# IF REGISTER VALUES ARE UNCEREMONIOUSLY TRASHED
186# ...then we want to know about it.
187#
188function trashed(register) {
189 if (in_function && !saved[register] && !dirty[register]) {
190 printf ".cfi_undefined %s\n", register
191 }
192 dirty[register] = 1
193}
194# this does NOT exhaustively check for all possible instructions which could
195# overwrite a register value inherited from the caller (just the common ones)
196/mov.*,%e?([abcd][hlx]|si|di|bp)$/ { trashed(get_reg2()) }
197/(add|addl|sub|subl|and|or|xor|lea|sal|sar|shl|shr).*,%e?([abcd][hlx]|si|di|bp)$/ {
198 trashed(get_reg2())
199}
200/^i?mul [^,]*$/ { trashed("eax"); trashed("edx") }
201/^i?mul.*,%e?([abcd][hlx]|si|di|bp)$/ { trashed(get_reg2()) }
202/^i?div/ { trashed("eax"); trashed("edx") }
203/(dec|inc|not|neg|pop) %e?([abcd][hlx]|si|di|bp)/ { trashed(get_reg()) }
204/cpuid/ { trashed("eax"); trashed("ebx"); trashed("ecx"); trashed("edx") }
205
206END {
207 if (in_function)
208 print ".cfi_endproc"
209}
lib/libc/wasi/libc-top-half/musl/tools/add-cfi.x86_64.awk deleted-196
...@@ -1,196 +0,0 @@
1# Insert GAS CFI directives ("control frame information") into x86-64 asm input
2
3BEGIN {
4 # don't put CFI data in the .eh_frame ELF section (which we don't keep)
5 print ".cfi_sections .debug_frame"
6
7 # only emit CFI directives inside a function
8 in_function = 0
9
10 # emit .loc directives with line numbers from original source
11 printf ".file 1 \"%s\"\n", ARGV[1]
12 line_number = 0
13
14 # used to detect "call label; label:" trick
15 called = ""
16}
17
18function get_const1() {
19 # for instructions with 2 operands, get 1st operand (assuming it is constant)
20 match($0, /-?(0x[0-9a-fA-F]+|[0-9]+),/)
21 return parse_const(substr($0, RSTART, RLENGTH-1))
22}
23
24function canonicalize_reg(register) {
25 if (match(register, /^r/))
26 return register
27 else if (match(register, /^e/))
28 return "r" substr(register, 2, length(register)-1)
29 else if (match(register, /[hl]$/)) # AH, AL, BH, BL, etc
30 return "r" substr(register, 1, 1) "x"
31 else # AX, BX, CX, etc
32 return "r" register
33}
34function get_reg() {
35 # only use if you already know there is 1 and only 1 register
36 match($0, /%[er]?([abcd][xlh]|si|di|bp|8|9|10|11|12|13|14|15)/)
37 return canonicalize_reg(substr($0, RSTART+1, RLENGTH-1))
38}
39function get_reg1() {
40 # for instructions with 2 operands, get 1st operand (assuming it is register)
41 match($0, /%[er]?([abcd][xlh]|si|di|bp|8|9|10|11|12|13|14|15),/)
42 return canonicalize_reg(substr($0, RSTART+1, RLENGTH-2))
43}
44function get_reg2() {
45 # for instructions with 2 operands, get 2nd operand (assuming it is register)
46 match($0, /,%[er]?([abcd][xlh]|si|di|bp|8|9|10|11|12|13|14|15)/)
47 return canonicalize_reg(substr($0, RSTART+2, RLENGTH-2))
48}
49
50function adjust_sp_offset(delta) {
51 if (in_function)
52 printf ".cfi_adjust_cfa_offset %d\n", delta
53}
54
55{
56 line_number = line_number + 1
57
58 # clean the input up before doing anything else
59 # delete comments
60 gsub(/(#|\/\/).*/, "")
61
62 # canonicalize whitespace
63 gsub(/[ \t]+/, " ") # mawk doesn't understand \s
64 gsub(/ *, */, ",")
65 gsub(/ *: */, ": ")
66 gsub(/ $/, "")
67 gsub(/^ /, "")
68}
69
70# check for assembler directives which we care about
71/^\.(section|data|text)/ {
72 # a .cfi_startproc/.cfi_endproc pair should be within the same section
73 # otherwise, clang will choke when generating ELF output
74 if (in_function) {
75 print ".cfi_endproc"
76 in_function = 0
77 }
78}
79/^\.type [a-zA-Z0-9_]+,@function/ {
80 functions[substr($2, 1, length($2)-10)] = 1
81}
82# not interested in assembler directives beyond this, just pass them through
83/^\./ {
84 print
85 next
86}
87
88/^[a-zA-Z0-9_]+:/ {
89 label = substr($1, 1, length($1)-1) # drop trailing :
90
91 if (called == label) {
92 # note adjustment of stack pointer from "call label; label:"
93 adjust_sp_offset(8)
94 }
95
96 if (functions[label]) {
97 if (in_function)
98 print ".cfi_endproc"
99
100 in_function = 1
101 print ".cfi_startproc"
102
103 for (register in saved)
104 delete saved[register]
105 for (register in dirty)
106 delete dirty[register]
107 }
108
109 # an instruction may follow on the same line, so continue processing
110}
111
112/^$/ { next }
113
114{
115 called = ""
116 printf ".loc 1 %d\n", line_number
117 print
118}
119
120# KEEPING UP WITH THE STACK POINTER
121# %rsp should only be adjusted by pushing/popping or adding/subtracting constants
122#
123/pushl?/ {
124 adjust_sp_offset(8)
125}
126/popl?/ {
127 adjust_sp_offset(-8)
128}
129/addl? \$-?(0x[0-9a-fA-F]+|[0-9]+),%rsp/ { adjust_sp_offset(-get_const1()) }
130/subl? \$-?(0x[0-9a-fA-F]+|[0-9]+),%rsp/ { adjust_sp_offset(get_const1()) }
131
132/call/ {
133 if (match($0, /call [0-9]+f/)) # "forward" label
134 called = substr($0, RSTART+5, RLENGTH-6)
135 else if (match($0, /call [0-9a-zA-Z_]+/))
136 called = substr($0, RSTART+5, RLENGTH-5)
137}
138
139# TRACKING REGISTER VALUES FROM THE PREVIOUS STACK FRAME
140#
141/pushl? %r(ax|bx|cx|dx|si|di|bp|8|9|10|11|12|13|14|15)/ { # don't match "push (%reg)"
142 # if a register is being pushed, and its value has not changed since the
143 # beginning of this function, the pushed value can be used when printing
144 # local variables at the next level up the stack
145 # emit '.cfi_rel_offset' for that
146
147 if (in_function) {
148 register = get_reg()
149 if (!saved[register] && !dirty[register]) {
150 printf ".cfi_rel_offset %s,0\n", register
151 saved[register] = 1
152 }
153 }
154}
155
156/movl? %r(ax|bx|cx|dx|si|di|bp|8|9|10|11|12|13|14|15),-?(0x[0-9a-fA-F]+|[0-9]+)?\(%rsp\)/ {
157 if (in_function) {
158 register = get_reg()
159 if (match($0, /-?(0x[0-9a-fA-F]+|[0-9]+)\(%rsp\)/)) {
160 offset = parse_const(substr($0, RSTART, RLENGTH-6))
161 } else {
162 offset = 0
163 }
164 if (!saved[register] && !dirty[register]) {
165 printf ".cfi_rel_offset %s,%d\n", register, offset
166 saved[register] = 1
167 }
168 }
169}
170
171# IF REGISTER VALUES ARE UNCEREMONIOUSLY TRASHED
172# ...then we want to know about it.
173#
174function trashed(register) {
175 if (in_function && !saved[register] && !dirty[register]) {
176 printf ".cfi_undefined %s\n", register
177 }
178 dirty[register] = 1
179}
180# this does NOT exhaustively check for all possible instructions which could
181# overwrite a register value inherited from the caller (just the common ones)
182/mov.*,%[er]?([abcd][xlh]|si|di|bp|8|9|10|11|12|13|14|15)$/ { trashed(get_reg2()) }
183/(add|addl|sub|subl|and|or|xor|lea|sal|sar|shl|shr).*,%[er]?([abcd][xlh]|si|di|bp|8|9|10|11|12|13|14|15)$/ {
184 trashed(get_reg2())
185}
186/^i?mul [^,]*$/ { trashed("rax"); trashed("rdx") }
187/^i?mul.*,%[er]?([abcd][xlh]|si|di|bp|8|9|10|11|12|13|14|15)$/ { trashed(get_reg2()) }
188/^i?div/ { trashed("rax"); trashed("rdx") }
189
190/(dec|inc|not|neg|pop) %[er]?([abcd][xlh]|si|di|bp|8|9|10|11|12|13|14|15)/ { trashed(get_reg()) }
191/cpuid/ { trashed("rax"); trashed("rbx"); trashed("rcx"); trashed("rdx") }
192
193END {
194 if (in_function)
195 print ".cfi_endproc"
196}
lib/libc/wasi/libc-top-half/musl/tools/install.sh deleted-64
...@@ -1,64 +0,0 @@
1#!/bin/sh
2#
3# This is an actually-safe install command which installs the new
4# file atomically in the new location, rather than overwriting
5# existing files.
6#
7
8usage() {
9printf "usage: %s [-D] [-l] [-m mode] src dest\n" "$0" 1>&2
10exit 1
11}
12
13mkdirp=
14symlink=
15mode=755
16
17while getopts Dlm: name ; do
18case "$name" in
19D) mkdirp=yes ;;
20l) symlink=yes ;;
21m) mode=$OPTARG ;;
22?) usage ;;
23esac
24done
25shift $(($OPTIND - 1))
26
27test "$#" -eq 2 || usage
28src=$1
29dst=$2
30tmp="$dst.tmp.$$"
31
32case "$dst" in
33*/) printf "%s: %s ends in /\n", "$0" "$dst" 1>&2 ; exit 1 ;;
34esac
35
36set -C
37set -e
38
39if test "$mkdirp" ; then
40umask 022
41case "$2" in
42*/*) mkdir -p "${dst%/*}" ;;
43esac
44fi
45
46trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP
47
48umask 077
49
50if test "$symlink" ; then
51ln -s "$1" "$tmp"
52else
53cat < "$1" > "$tmp"
54chmod "$mode" "$tmp"
55fi
56
57mv -f "$tmp" "$2"
58test -d "$2" && {
59rm -f "$2/$tmp"
60printf "%s: %s is a directory\n" "$0" "$dst" 1>&2
61exit 1
62}
63
64exit 0
lib/libc/wasi/libc-top-half/musl/tools/ld.musl-clang.in deleted-51
...@@ -1,51 +0,0 @@
1#!/bin/sh
2cc="@CC@"
3libc_lib="@LIBDIR@"
4ldso="@LDSO@"
5cleared=
6shared=
7userlinkdir=
8userlink=
9
10for x ; do
11 test "$cleared" || set -- ; cleared=1
12
13 case "$x" in
14 -L-user-start)
15 userlinkdir=1
16 ;;
17 -L-user-end)
18 userlinkdir=
19 ;;
20 -L*)
21 test "$userlinkdir" && set -- "$@" "$x"
22 ;;
23 -l-user-start)
24 userlink=1
25 ;;
26 -l-user-end)
27 userlink=
28 ;;
29 crtbegin*.o|crtend*.o)
30 set -- "$@" $($cc -print-file-name=$x)
31 ;;
32 -lgcc|-lgcc_eh)
33 file=lib${x#-l}.a
34 set -- "$@" $($cc -print-file-name=$file)
35 ;;
36 -l*)
37 test "$userlink" && set -- "$@" "$x"
38 ;;
39 -shared)
40 shared=1
41 set -- "$@" -shared
42 ;;
43 -sysroot=*|--sysroot=*)
44 ;;
45 *)
46 set -- "$@" "$x"
47 ;;
48 esac
49done
50
51exec $($cc -print-prog-name=ld) -nostdlib "$@" -lc -dynamic-linker "$ldso"
lib/libc/wasi/libc-top-half/musl/tools/mkalltypes.sed deleted-15
...@@ -1,15 +0,0 @@
1/^TYPEDEF/s/TYPEDEF \(.*\) \([^ ]*\);$/#if defined(__NEED_\2) \&\& !defined(__DEFINED_\2)\
2typedef \1 \2;\
3#define __DEFINED_\2\
4#endif\
5/
6/^STRUCT/s/STRUCT * \([^ ]*\) \(.*\);$/#if defined(__NEED_struct_\1) \&\& !defined(__DEFINED_struct_\1)\
7struct \1 \2;\
8#define __DEFINED_struct_\1\
9#endif\
10/
11/^UNION/s/UNION * \([^ ]*\) \(.*\);$/#if defined(__NEED_union_\1) \&\& !defined(__DEFINED_union_\1)\
12union \1 \2;\
13#define __DEFINED_union_\1\
14#endif\
15/
lib/libc/wasi/libc-top-half/musl/tools/musl-clang.in deleted-35
...@@ -1,35 +0,0 @@
1#!/bin/sh
2cc="@CC@"
3libc="@PREFIX@"
4libc_inc="@INCDIR@"
5libc_lib="@LIBDIR@"
6thisdir="`cd "$(dirname "$0")"; pwd`"
7
8# prevent clang from running the linker (and erroring) on no input.
9sflags=
10eflags=
11for x ; do
12 case "$x" in
13 -l*) input=1 ;;
14 *) input= ;;
15 esac
16 if test "$input" ; then
17 sflags="-l-user-start"
18 eflags="-l-user-end"
19 break
20 fi
21done
22
23exec $cc \
24 -B"$thisdir" \
25 -fuse-ld=musl-clang \
26 -static-libgcc \
27 -nostdinc \
28 --sysroot "$libc" \
29 -isystem "$libc_inc" \
30 -L-user-start \
31 $sflags \
32 "$@" \
33 $eflags \
34 -L"$libc_lib" \
35 -L-user-end
lib/libc/wasi/libc-top-half/musl/tools/musl-gcc.specs.sh deleted-37
...@@ -1,37 +0,0 @@
1incdir=$1
2libdir=$2
3ldso=$3
4cat <<EOF
5%rename cpp_options old_cpp_options
6
7*cpp_options:
8-nostdinc -isystem $incdir -isystem include%s %(old_cpp_options)
9
10*cc1:
11%(cc1_cpu) -nostdinc -isystem $incdir -isystem include%s
12
13*link_libgcc:
14-L$libdir -L .%s
15
16*libgcc:
17libgcc.a%s %:if-exists(libgcc_eh.a%s)
18
19*startfile:
20%{!shared: $libdir/Scrt1.o} $libdir/crti.o crtbeginS.o%s
21
22*endfile:
23crtendS.o%s $libdir/crtn.o
24
25*link:
26-dynamic-linker $ldso -nostdlib %{shared:-shared} %{static:-static} %{rdynamic:-export-dynamic}
27
28*esp_link:
29
30
31*esp_options:
32
33
34*esp_cpp_options:
35
36
37EOF
lib/libc/wasi/libc-top-half/musl/tools/version.sh deleted-12
...@@ -1,12 +0,0 @@
1#!/bin/sh
2
3if test -d .git ; then
4if type git >/dev/null 2>&1 ; then
5git describe --tags --match 'v[0-9]*' 2>/dev/null \
6| sed -e 's/^v//' -e 's/-/-git-/'
7else
8sed 's/$/-git/' < VERSION
9fi
10else
11cat VERSION
12fi