syscall/ and include/sys/syscall.h: Fix an inconsistency. In someplaces, getitimer() and setitimer() depend on CONFIG_DISABLE_POSIX_TIMERS=n and in other places they depend on nothing. As a result, there are link failures when CONFIG_DISABLE_POSIX_TIMERS=y. Which is correct? On one hand, these interfaces are not POSIX timers, so conditioning them on on CONFIG_DISABLE_POSIX_TIMERS. I opted to keep the dependence and just apply it consistently. I did this because setitimer() and getitimer() are seldom used so it is really best if a system call is no generated for them in all cases.

This commit is contained in:
Gregory Nutt
2019-11-14 15:10:04 -06:00
parent 8f726181ed
commit e5812beaf9
4 changed files with 13 additions and 13 deletions
+6 -6
View File
@@ -255,13 +255,11 @@
#define SYS_clock_getres (__SYS_clock + 1) #define SYS_clock_getres (__SYS_clock + 1)
#define SYS_clock_gettime (__SYS_clock + 2) #define SYS_clock_gettime (__SYS_clock + 2)
#define SYS_clock_settime (__SYS_clock + 3) #define SYS_clock_settime (__SYS_clock + 3)
#define SYS_getitimer (__SYS_clock + 4)
#define SYS_setitimer (__SYS_clock + 5)
#ifdef CONFIG_CLOCK_TIMEKEEPING #ifdef CONFIG_CLOCK_TIMEKEEPING
# define SYS_adjtime (__SYS_clock + 6) # define SYS_adjtime (__SYS_clock + 4)
# define __SYS_timers (__SYS_clock + 7) # define __SYS_timers (__SYS_clock + 5)
#else #else
# define __SYS_timers (__SYS_clock + 6) # define __SYS_timers (__SYS_clock + 4)
#endif #endif
/* The following are defined only if POSIX timers are supported */ /* The following are defined only if POSIX timers are supported */
@@ -272,7 +270,9 @@
# define SYS_timer_getoverrun (__SYS_timers + 2) # define SYS_timer_getoverrun (__SYS_timers + 2)
# define SYS_timer_gettime (__SYS_timers + 3) # define SYS_timer_gettime (__SYS_timers + 3)
# define SYS_timer_settime (__SYS_timers + 4) # define SYS_timer_settime (__SYS_timers + 4)
# define __SYS_syslog (__SYS_timers + 5) # define SYS_getitimer (__SYS_timers + 5)
# define SYS_setitimer (__SYS_timers + 6)
# define __SYS_syslog (__SYS_timers + 7)
#else #else
# define __SYS_syslog __SYS_timers # define __SYS_syslog __SYS_timers
#endif #endif
+2 -2
View File
@@ -178,8 +178,6 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
SYSCALL_LOOKUP(clock_getres, 2, STUB_clock_getres) SYSCALL_LOOKUP(clock_getres, 2, STUB_clock_getres)
SYSCALL_LOOKUP(clock_gettime, 2, STUB_clock_gettime) SYSCALL_LOOKUP(clock_gettime, 2, STUB_clock_gettime)
SYSCALL_LOOKUP(clock_settime, 2, STUB_clock_settime) SYSCALL_LOOKUP(clock_settime, 2, STUB_clock_settime)
SYSCALL_LOOKUP(getitimer, 2, STUB_getitimer)
SYSCALL_LOOKUP(setitimer, 3, STUB_setitimer)
#ifdef CONFIG_CLOCK_TIMEKEEPING #ifdef CONFIG_CLOCK_TIMEKEEPING
SYSCALL_LOOKUP(adjtime, 2, STUB_adjtime) SYSCALL_LOOKUP(adjtime, 2, STUB_adjtime)
#endif #endif
@@ -192,6 +190,8 @@ SYSCALL_LOOKUP(up_assert, 2, STUB_up_assert)
SYSCALL_LOOKUP(timer_getoverrun, 1, STUB_timer_getoverrun) SYSCALL_LOOKUP(timer_getoverrun, 1, STUB_timer_getoverrun)
SYSCALL_LOOKUP(timer_gettime, 2, STUB_timer_gettime) SYSCALL_LOOKUP(timer_gettime, 2, STUB_timer_gettime)
SYSCALL_LOOKUP(timer_settime, 4, STUB_timer_settime) SYSCALL_LOOKUP(timer_settime, 4, STUB_timer_settime)
SYSCALL_LOOKUP(getitimer, 2, STUB_getitimer)
SYSCALL_LOOKUP(setitimer, 3, STUB_setitimer)
#endif #endif
/* System logging */ /* System logging */
+3 -3
View File
@@ -173,9 +173,6 @@ uintptr_t STUB_clock(int nbr);
uintptr_t STUB_clock_getres(int nbr, uintptr_t parm1, uintptr_t parm2); uintptr_t STUB_clock_getres(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_clock_gettime(int nbr, uintptr_t parm1, uintptr_t parm2); uintptr_t STUB_clock_gettime(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_clock_settime(int nbr, uintptr_t parm1, uintptr_t parm2); uintptr_t STUB_clock_settime(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_getitimer(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_setitimer(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3);
uintptr_t STUB_adjtime(int nbr, uintptr_t parm1, uintptr_t parm2); uintptr_t STUB_adjtime(int nbr, uintptr_t parm1, uintptr_t parm2);
/* The following are defined only if POSIX timers are supported */ /* The following are defined only if POSIX timers are supported */
@@ -187,6 +184,9 @@ uintptr_t STUB_timer_getoverrun(int nbr, uintptr_t parm1);
uintptr_t STUB_timer_gettime(int nbr, uintptr_t parm1, uintptr_t parm2); uintptr_t STUB_timer_gettime(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_timer_settime(int nbr, uintptr_t parm1, uintptr_t parm2, uintptr_t STUB_timer_settime(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3, uintptr_t parm4); uintptr_t parm3, uintptr_t parm4);
uintptr_t STUB_getitimer(int nbr, uintptr_t parm1, uintptr_t parm2);
uintptr_t STUB_setitimer(int nbr, uintptr_t parm1, uintptr_t parm2,
uintptr_t parm3);
/* System logging */ /* System logging */