diff options
Diffstat (limited to 'newlib/libc/include')
-rw-r--r-- | newlib/libc/include/machine/ieeefp.h | 6 | ||||
-rw-r--r-- | newlib/libc/include/machine/setjmp.h | 11 | ||||
-rw-r--r-- | newlib/libc/include/pthread.h | 12 | ||||
-rw-r--r-- | newlib/libc/include/search.h | 10 | ||||
-rw-r--r-- | newlib/libc/include/stdlib.h | 5 | ||||
-rw-r--r-- | newlib/libc/include/sys/_default_fcntl.h | 27 | ||||
-rw-r--r-- | newlib/libc/include/sys/cdefs.h | 2 | ||||
-rw-r--r-- | newlib/libc/include/sys/config.h | 7 | ||||
-rw-r--r-- | newlib/libc/include/sys/reent.h | 3 | ||||
-rw-r--r-- | newlib/libc/include/sys/stat.h | 17 | ||||
-rw-r--r-- | newlib/libc/include/sys/unistd.h | 2 | ||||
-rw-r--r-- | newlib/libc/include/time.h | 11 |
12 files changed, 85 insertions, 28 deletions
diff --git a/newlib/libc/include/machine/ieeefp.h b/newlib/libc/include/machine/ieeefp.h index f99577b..c5fafcf 100644 --- a/newlib/libc/include/machine/ieeefp.h +++ b/newlib/libc/include/machine/ieeefp.h @@ -263,9 +263,15 @@ #ifdef __MIPSEL__ #define __IEEE_LITTLE_ENDIAN +#if __SIZEOF_DOUBLE__ == 4 +#define _DOUBLE_IS_32BITS +#endif #endif #ifdef __MIPSEB__ #define __IEEE_BIG_ENDIAN +#if __SIZEOF_DOUBLE__ == 4 +#define _DOUBLE_IS_32BITS +#endif #endif #ifdef __MMIX__ diff --git a/newlib/libc/include/machine/setjmp.h b/newlib/libc/include/machine/setjmp.h index 102582c..ab820ed 100644 --- a/newlib/libc/include/machine/setjmp.h +++ b/newlib/libc/include/machine/setjmp.h @@ -22,7 +22,16 @@ _BEGIN_STD_C #endif #if defined(__aarch64__) -#define _JBLEN 22 +# if defined(__CYGWIN__) +/* + * Windows Arm64 ABI requires saving x19-x28, FP, LR, SP, FPCR, FPSR, d8-d15 + * and jump address to jmp_buf. On top of that, Cygwin requires saving + * TLS stack pointer. + */ +# define _JBLEN 25 +# else +# define _JBLEN 22 +# endif #define _JBTYPE long long #endif diff --git a/newlib/libc/include/pthread.h b/newlib/libc/include/pthread.h index c99ad39..05ff315 100644 --- a/newlib/libc/include/pthread.h +++ b/newlib/libc/include/pthread.h @@ -87,11 +87,11 @@ int pthread_mutex_timedlock (pthread_mutex_t *__mutex, #endif /* _POSIX_TIMEOUTS */ -#if __GNU_VISIBLE +#if (__GNU_VISIBLE || __POSIX_VISIBLE >= 202405) /* The Issue 8 standard adds pthread_mutex_clocklock() */ int pthread_mutex_clocklock(pthread_mutex_t *__restrict, clockid_t, const struct timespec *__restrict); -#endif /* __GNU_VISIBLE */ +#endif /* __GNU_VISIBLE || __POSIX_VISIBLE >= 202405 */ /* Condition Variable Initialization Attributes, P1003.1c/Draft 10, p. 96 */ @@ -133,12 +133,12 @@ int pthread_cond_timedwait (pthread_cond_t *__cond, pthread_mutex_t *__mutex, const struct timespec *__abstime); -#if __GNU_VISIBLE +#if (__GNU_VISIBLE || __POSIX_VISIBLE >= 202405) /* The Issue 8 standard adds pthread_cond_clockwait() */ int pthread_cond_clockwait(pthread_cond_t *__restrict, pthread_mutex_t *__restrict, clockid_t, const struct timespec *__restrict); -#endif /* __GNU_VISIBLE */ +#endif /* __GNU_VISIBLE || __POSIX_VISIBLE >= 202405 */ #if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) @@ -436,14 +436,14 @@ int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock); int pthread_rwlock_timedwrlock (pthread_rwlock_t *__rwlock, const struct timespec *__abstime); -#if __GNU_VISIBLE +#if (__GNU_VISIBLE || __POSIX_VISIBLE >= 202405) /* The Issue 8 standard adds pthread_rwlock_clockrdlock() * and pthread_rwlock_clockwrlock()*/ int pthread_rwlock_clockrdlock(pthread_rwlock_t *__restrict, clockid_t, const struct timespec *__restrict); int pthread_rwlock_clockwrlock(pthread_rwlock_t *__restrict, clockid_t, const struct timespec *__restrict); -#endif /* __GNU_VISIBLE */ +#endif /* __GNU_VISIBLE || __POSIX_VISIBLE >= 202405 */ #endif /* defined(_POSIX_READER_WRITER_LOCKS) */ diff --git a/newlib/libc/include/search.h b/newlib/libc/include/search.h index ed321b0..70a1a20 100644 --- a/newlib/libc/include/search.h +++ b/newlib/libc/include/search.h @@ -36,6 +36,8 @@ typedef struct node { } node_t; #endif +typedef void posix_tnode; + struct hsearch_data { struct internal_head *htable; @@ -54,11 +56,11 @@ ENTRY *hsearch(ENTRY, ACTION); int hcreate_r(size_t, struct hsearch_data *); void hdestroy_r(struct hsearch_data *); int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *); -void *tdelete(const void *__restrict, void **__restrict, __compar_fn_t); +void *tdelete(const void *__restrict, posix_tnode **__restrict, __compar_fn_t); void tdestroy (void *, void (*)(void *)); -void *tfind(const void *, void **, __compar_fn_t); -void *tsearch(const void *, void **, __compar_fn_t); -void twalk(const void *, void (*)(const void *, VISIT, int)); +posix_tnode *tfind(const void *, posix_tnode *const *, __compar_fn_t); +posix_tnode *tsearch(const void *, posix_tnode **, __compar_fn_t); +void twalk(const posix_tnode *, void (*)(const posix_tnode *, VISIT, int)); __END_DECLS #endif /* !_SEARCH_H_ */ diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h index 0690a03..55b20fa 100644 --- a/newlib/libc/include/stdlib.h +++ b/newlib/libc/include/stdlib.h @@ -333,10 +333,13 @@ extern long double strtold (const char *__restrict, char **__restrict); #if __ISO_C_VISIBLE >= 2011 void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1) __alloc_size(2) __result_use_check; +#endif /* __ISO_C_VISIBLE >= 2011 */ + +#if (__ISO_C_VISIBLE >= 2011 || __POSIX_VISIBLE >= 202405) int at_quick_exit(void (*)(void)); _Noreturn void quick_exit(int); -#endif /* __ISO_C_VISIBLE >= 2011 */ +#endif /* __ISO_C_VISIBLE >= 2011 || __POSIX_VISIBLE >= 202405 */ _END_STD_C diff --git a/newlib/libc/include/sys/_default_fcntl.h b/newlib/libc/include/sys/_default_fcntl.h index 148e97d..b3222d4 100644 --- a/newlib/libc/include/sys/_default_fcntl.h +++ b/newlib/libc/include/sys/_default_fcntl.h @@ -53,8 +53,8 @@ extern "C" { #define O_TRUNC _FTRUNC #define O_EXCL _FEXCL #define O_SYNC _FSYNC -/* O_NDELAY _FNDELAY set in include/fcntl.h */ -/* O_NDELAY _FNBIO set in include/fcntl.h */ +/* O_NDELAY _FNDELAY set in include/fcntl.h */ +/* O_NDELAY _FNBIO set in include/fcntl.h */ #define O_NONBLOCK _FNONBLOCK #define O_NOCTTY _FNOCTTY @@ -134,21 +134,26 @@ extern "C" { #define F_GETFL 3 /* Get file flags */ #define F_SETFL 4 /* Set file flags */ #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 -#define F_GETOWN 5 /* Get owner - for ASYNC */ -#define F_SETOWN 6 /* Set owner - for ASYNC */ +#define F_GETOWN 5 /* Get owner - for ASYNC */ +#define F_SETOWN 6 /* Set owner - for ASYNC */ #endif /* __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 */ -#define F_GETLK 7 /* Get record-locking information */ -#define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */ -#define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */ +#define F_GETLK 7 /* Get record-locking information */ +#define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */ +#define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */ #if __MISC_VISIBLE -#define F_RGETLK 10 /* Test a remote lock to see if it is blocked */ -#define F_RSETLK 11 /* Set or unlock a remote lock */ -#define F_CNVT 12 /* Convert a fhandle to an open fd */ -#define F_RSETLKW 13 /* Set or Clear remote record-lock(Blocking) */ +#define F_RGETLK 10 /* Test a remote lock to see if it is blocked */ +#define F_RSETLK 11 /* Set or unlock a remote lock */ +#define F_CNVT 12 /* Convert a fhandle to an open fd */ +#define F_RSETLKW 13 /* Set or Clear remote record-lock (Blocking) */ #endif /* __MISC_VISIBLE */ #if __POSIX_VISIBLE >= 200809 #define F_DUPFD_CLOEXEC 14 /* As F_DUPFD, but set close-on-exec flag */ #endif +#if __GNU_VISIBLE || __POSIX_VISIBLE >= 202405 +#define F_OFD_GETLK 15 /* Get OFD record-locking information */ +#define F_OFD_SETLK 16 /* Set or Clear OFD lock (Non-Blocking) */ +#define F_OFD_SETLKW 17 /* Set or Clear OFD lock (Blocking) */ +#endif /* fcntl(2) flags (l_type field of flock structure) */ #define F_RDLCK 1 /* read lock */ diff --git a/newlib/libc/include/sys/cdefs.h b/newlib/libc/include/sys/cdefs.h index d13a92a..20b3553 100644 --- a/newlib/libc/include/sys/cdefs.h +++ b/newlib/libc/include/sys/cdefs.h @@ -736,7 +736,7 @@ /* Provide fallback versions for other compilers (GCC/Clang < 10): */ #if !__has_builtin(__builtin_is_aligned) #define __builtin_is_aligned(x, align) \ - (((__uintptr_t)x & ((align) - 1)) == 0) + (((__uintptr_t)(x) & ((align) - 1)) == 0) #endif #if !__has_builtin(__builtin_align_up) #define __builtin_align_up(x, align) \ diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h index 5dcc77a..c3cd51e 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -4,7 +4,7 @@ #include <machine/ieeefp.h> /* floating point macros */ #include <sys/features.h> /* POSIX defs */ -#ifdef __aarch64__ +#if defined(__aarch64__) || defined(__mips__) #define MALLOC_ALIGNMENT 16 #endif @@ -12,6 +12,11 @@ #define __DYNAMIC_REENT__ #endif +#ifdef __nvptx__ +#define _READ_WRITE_RETURN_TYPE _ssize_t +#define _READ_WRITE_BUFSIZE_TYPE __size_t +#endif + /* exceptions first */ #if defined(__H8500__) || defined(__W65__) #define __SMALL_BITFIELDS diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h index 5ce5387..eafac96 100644 --- a/newlib/libc/include/sys/reent.h +++ b/newlib/libc/include/sys/reent.h @@ -709,7 +709,8 @@ struct _reent {0, {0}}, \ {0, {0}}, \ {0, {0}}, \ - {0, {0}} \ + {0, {0}}, \ + 0 \ } \ }, \ _REENT_INIT_RESERVED_6_7 \ diff --git a/newlib/libc/include/sys/stat.h b/newlib/libc/include/sys/stat.h index b4e27f2..7409979 100644 --- a/newlib/libc/include/sys/stat.h +++ b/newlib/libc/include/sys/stat.h @@ -38,6 +38,16 @@ struct stat time_t st_atime; time_t st_mtime; time_t st_ctime; +#elif defined(__mips__) && !defined(__rtems__) + time_t st_atime; + long st_spare1; + time_t st_mtime; + long st_spare2; + time_t st_ctime; + long st_spare3; + blksize_t st_blksize; + blkcnt_t st_blocks; + long st_spare4[2]; #else struct timespec st_atim; struct timespec st_mtim; @@ -50,7 +60,8 @@ struct stat #endif }; -#if !(defined(__svr4__) && !defined(__PPC__) && !defined(__sun__)) +#if !((defined(__svr4__) && !defined(__PPC__) && !defined(__sun__)) || \ + (defined(__mips__) && !defined(__rtems__))) #define st_atime st_atim.tv_sec #define st_ctime st_ctim.tv_sec #define st_mtime st_mtim.tv_sec @@ -136,7 +147,11 @@ struct stat int chmod (const char *__path, mode_t __mode ); int fchmod (int __fd, mode_t __mode); +#if defined(__mips__) && defined(__mips16) +int __attribute__((nomips16)) fstat (int __fd, struct stat *__sbuf ); +#else int fstat (int __fd, struct stat *__sbuf ); +#endif // __mips__ int mkdir (const char *_path, mode_t __mode ); int mkfifo (const char *__path, mode_t __mode ); int stat (const char *__restrict __path, struct stat *__restrict __sbuf ); diff --git a/newlib/libc/include/sys/unistd.h b/newlib/libc/include/sys/unistd.h index 771a4bd..4cf9f06 100644 --- a/newlib/libc/include/sys/unistd.h +++ b/newlib/libc/include/sys/unistd.h @@ -215,7 +215,7 @@ int setpgrp (void); #if defined(__CYGWIN__) && __BSD_VISIBLE /* Stub for Linux libbsd compatibility. */ #define initsetproctitle(c, a, e) setproctitle_init((c), (a), (e)) -static inline void setproctitle_init (int _c, char *_a[], char *_e[]) {} +static __inline void setproctitle_init (int _c, char *_a[], char *_e[]) {} void setproctitle (const char *, ...) _ATTRIBUTE ((__format__ (__printf__, 1, 2))); diff --git a/newlib/libc/include/time.h b/newlib/libc/include/time.h index ab34913..58c5066 100644 --- a/newlib/libc/include/time.h +++ b/newlib/libc/include/time.h @@ -57,6 +57,11 @@ clock_t clock (void); double difftime (time_t _time2, time_t _time1); time_t mktime (struct tm *_timeptr); time_t time (time_t *_timer); +#if (__ISO_C_VISIBLE >= 2011 || __POSIX_VISIBLE >= 202405) +#define TIME_UTC 1 + +int timespec_get(struct timespec *ts, int base); +#endif #ifndef _REENT_ONLY char *asctime (const struct tm *_tblock); char *ctime (const time_t *_time); @@ -288,6 +293,12 @@ extern "C" { #endif +#if _BSD_VISIBLE || __GNU_VISIBLE + +#define CLOCK_TAI (11) + +#endif + #if defined(_POSIX_CPUTIME) /* Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55 */ |