From fc094e921103f9a37fa1c4cbf1301900419d2801 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 21 Jul 2021 01:43:48 +0800 Subject: [rtlibc] remove libc_signal.h and libc_fdset.h --- include/libc/libc_fdset.h | 60 --------------- include/libc/libc_signal.h | 184 --------------------------------------------- include/rtdef.h | 2 +- include/rtlibc.h | 3 - 4 files changed, 1 insertion(+), 248 deletions(-) delete mode 100644 include/libc/libc_fdset.h delete mode 100644 include/libc/libc_signal.h (limited to 'include') diff --git a/include/libc/libc_fdset.h b/include/libc/libc_fdset.h deleted file mode 100644 index c542e6855c..0000000000 --- a/include/libc/libc_fdset.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2017-10-30 Bernard The first version - */ - -#ifndef LIBC_FDSET_H__ -#define LIBC_FDSET_H__ - -#include - -#if defined(RT_USING_NEWLIB) || defined(_WIN32) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION)) -#include -#if defined(HAVE_SYS_SELECT_H) -#include -#endif - -#else - -#ifdef SAL_USING_POSIX - -#ifdef FD_SETSIZE -#undef FD_SETSIZE -#endif - -#define FD_SETSIZE DFS_FD_MAX -#endif - -# ifndef FD_SETSIZE -# define FD_SETSIZE 32 -# endif - -# define NBBY 8 /* number of bits in a byte */ - -typedef long fd_mask; -# define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ -# ifndef howmany -# define howmany(x,y) (((x)+((y)-1))/(y)) -# endif - -/* We use a macro for fd_set so that including Sockets.h afterwards - can work. */ -typedef struct _types_fd_set { - fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; -} _types_fd_set; - -#define fd_set _types_fd_set - -# define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS))) -# define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS))) -# define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS))) -# define FD_ZERO(p) memset((void*)(p), 0, sizeof(*(p))) - -#endif - -#endif diff --git a/include/libc/libc_signal.h b/include/libc/libc_signal.h deleted file mode 100644 index 1fb8194643..0000000000 --- a/include/libc/libc_signal.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (c) 2006-2021, RT-Thread Development Team - * - * SPDX-License-Identifier: Apache-2.0 - * - * Change Logs: - * Date Author Notes - * 2017-09-12 Bernard The first version - */ - -#ifndef LIBC_SIGNAL_H__ -#define LIBC_SIGNAL_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#ifdef HAVE_CCONFIG_H -#include -#endif - -#ifndef HAVE_SIGVAL -/* Signal Generation and Delivery, P1003.1b-1993, p. 63 - NOTE: P1003.1c/D10, p. 34 adds sigev_notify_function and - sigev_notify_attributes to the sigevent structure. */ - -union sigval -{ - int sival_int; /* Integer signal value */ - void *sival_ptr; /* Pointer signal value */ -}; -#endif - -#ifndef HAVE_SIGEVENT -struct sigevent -{ - int sigev_notify; /* Notification type */ - int sigev_signo; /* Signal number */ - union sigval sigev_value; /* Signal value */ - void (*sigev_notify_function)( union sigval ); - /* Notification function */ - void *sigev_notify_attributes; /* Notification Attributes, really pthread_attr_t */ -}; -#endif - -#ifndef HAVE_SIGINFO -struct siginfo -{ - uint16_t si_signo; - uint16_t si_code; - - union sigval si_value; -}; -typedef struct siginfo siginfo_t; -#endif - -#define SI_USER 0x01 /* Signal sent by kill(). */ -#define SI_QUEUE 0x02 /* Signal sent by sigqueue(). */ -#define SI_TIMER 0x03 /* Signal generated by expiration of a - timer set by timer_settime(). */ -#define SI_ASYNCIO 0x04 /* Signal generated by completion of an - asynchronous I/O request. */ -#define SI_MESGQ 0x05 /* Signal generated by arrival of a - message on an empty message queue. */ - -#if !defined(RT_USING_NEWLIB) -typedef void (*_sig_func_ptr)(int); -typedef unsigned long sigset_t; -#endif - -#include - -#ifdef __ARMCC_VERSION - -#define SIGHUP 1 -/* #define SIGINT 2 */ -#define SIGQUIT 3 -/* #define SIGILL 4 */ -#define SIGTRAP 5 -/* #define SIGABRT 6 */ -#define SIGEMT 7 -/* #define SIGFPE 8 */ -#define SIGKILL 9 -#define SIGBUS 10 -/* #define SIGSEGV 11 */ -#define SIGSYS 12 -#define SIGPIPE 13 -#define SIGALRM 14 -/* #define SIGTERM 15 */ -#define SIGURG 16 -#define SIGSTOP 17 -#define SIGTSTP 18 -#define SIGCONT 19 -#define SIGCHLD 20 -#define SIGTTIN 21 -#define SIGTTOU 22 -#define SIGPOLL 23 -#define SIGWINCH 24 -/* #define SIGUSR1 25 */ -/* #define SIGUSR2 26 */ -#define SIGRTMIN 27 -#define SIGRTMAX 31 -#define NSIG 32 - -#define SIG_SETMASK 0 /* set mask with sigprocmask() */ -#define SIG_BLOCK 1 /* set of signals to block */ -#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ - -struct sigaction -{ - _sig_func_ptr sa_handler; - sigset_t sa_mask; - int sa_flags; -}; - -#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0) -#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0) -#define sigemptyset(what) (*(what) = 0, 0) -#define sigfillset(what) (*(what) = ~(0), 0) -#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0) - -int sigprocmask (int how, const sigset_t *set, sigset_t *oset); -int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); - -#elif defined(__IAR_SYSTEMS_ICC__) - -#define SIGHUP 1 -#define SIGINT 2 -#define SIGQUIT 3 -#define SIGILL 4 -#define SIGTRAP 5 -/* #define SIGABRT 6 */ -#define SIGEMT 7 -#define SIGFPE 8 -#define SIGKILL 9 -#define SIGBUS 10 -#define SIGSEGV 11 -#define SIGSYS 12 -#define SIGPIPE 13 -#define SIGALRM 14 -#define SIGTERM 15 -#define SIGURG 16 -#define SIGSTOP 17 -#define SIGTSTP 18 -#define SIGCONT 19 -#define SIGCHLD 20 -#define SIGTTIN 21 -#define SIGTTOU 22 -#define SIGPOLL 23 -#define SIGWINCH 24 -#define SIGUSR1 25 -#define SIGUSR2 26 -#define SIGRTMIN 27 -#define SIGRTMAX 31 -#define NSIG 32 - -#define SIG_SETMASK 0 /* set mask with sigprocmask() */ -#define SIG_BLOCK 1 /* set of signals to block */ -#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ - -struct sigaction -{ - _sig_func_ptr sa_handler; - sigset_t sa_mask; - int sa_flags; -}; - -#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0) -#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0) -#define sigemptyset(what) (*(what) = 0, 0) -#define sigfillset(what) (*(what) = ~(0), 0) -#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0) - -int sigprocmask (int how, const sigset_t *set, sigset_t *oset); -int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); -#endif - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/include/rtdef.h b/include/rtdef.h index 394bbca5d2..62d0a53685 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -510,7 +510,7 @@ typedef struct rt_timer *rt_timer_t; * @addtogroup Signal */ #ifdef RT_USING_SIGNALS -#include +#include typedef unsigned long rt_sigset_t; typedef void (*rt_sighandler_t)(int signo); typedef siginfo_t rt_siginfo_t; diff --git a/include/rtlibc.h b/include/rtlibc.h index ac44a97831..4b145b1b1b 100644 --- a/include/rtlibc.h +++ b/include/rtlibc.h @@ -13,11 +13,8 @@ /* definitions for libc if toolchain has no these definitions */ #include "libc/libc_stat.h" - #include "libc/libc_fcntl.h" #include "libc/libc_dirent.h" -#include "libc/libc_signal.h" -#include "libc/libc_fdset.h" #ifndef RT_USING_LIBC #if defined(__ARMCC_VERSION) || defined(__IAR_SYSTEMS_ICC__) -- cgit v1.3.1