Skip to content

Commit

Permalink
Back out and replace recent kludges for errno and clock_systimer. The…
Browse files Browse the repository at this point in the history
…re is a cleaner way
  • Loading branch information
gregory-nutt committed Aug 30, 2014
1 parent 4864b4c commit 2029236
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 130 deletions.
4 changes: 3 additions & 1 deletion Makefile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,10 @@ audio/libaudio$(LIBEXT): context
lib/libaudio$(LIBEXT): audio/libaudio$(LIBEXT)
$(Q) install audio/libaudio$(LIBEXT) lib/libaudio$(LIBEXT)

# Special case

syscall/libstubs$(LIBEXT): context
$(Q) $(MAKE) -C syscall TOPDIR="$(TOPDIR)" libstubs$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(Q) $(MAKE) -C syscall TOPDIR="$(TOPDIR)" libstubs$(LIBEXT) # EXTRADEFINES=$(KDEFINE)

lib/libstubs$(LIBEXT): syscall/libstubs$(LIBEXT)
$(Q) install syscall/libstubs$(LIBEXT) lib/libstubs$(LIBEXT)
Expand Down
4 changes: 3 additions & 1 deletion Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,10 @@ audio\libaudio$(LIBEXT): context
lib\libaudio$(LIBEXT): audio\libaudio$(LIBEXT)
$(Q) install audio\libaudio$(LIBEXT) lib\libaudio$(LIBEXT)

# Special case

syscall\libstubs$(LIBEXT): context
$(Q) $(MAKE) -C syscall TOPDIR="$(TOPDIR)" libstubs$(LIBEXT) EXTRADEFINES=$(KDEFINE)
$(Q) $(MAKE) -C syscall TOPDIR="$(TOPDIR)" libstubs$(LIBEXT) # EXTRADEFINES=$(KDEFINE)

lib\libstubs$(LIBEXT): syscall\libstubs$(LIBEXT)
$(Q) install syscall\libstubs$(LIBEXT) lib\libstubs$(LIBEXT)
Expand Down
2 changes: 1 addition & 1 deletion include/errno.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

# define __DIRECT_ERRNO_ACCESS 1

#elif defined(CONFIG_BUILD_KERNEL)
#elif defined(CONFIG_BUILD_KERNEL) && defined(__KERNEL__)
/* Kernel only build. The kernel has access */

# define __DIRECT_ERRNO_ACCESS 1
Expand Down
10 changes: 2 additions & 8 deletions include/nuttx/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,12 @@

# define __HAVE_KERNEL_GLOBALS 0

#elif defined(CONFIG_BUILD_PROTECTED)
# if defined(__KERNEL__)
#elif defined(CONFIG_BUILD_PROTECTED) && defined(__KERNEL__)
/* Case 3: Kernel mode of protected kernel build */

# define __HAVE_KERNEL_GLOBALS 1
# else
/* User mode of protected kernel build */

# define __HAVE_KERNEL_GLOBALS 0
# endif

#elif defined(CONFIG_BUILD_KERNEL)
#elif defined(CONFIG_BUILD_KERNEL) && defined(__KERNEL__)
/* Case 3: Kernel only build */

# define __HAVE_KERNEL_GLOBALS 1
Expand Down
110 changes: 0 additions & 110 deletions include/nuttx/syscall.h

This file was deleted.

7 changes: 3 additions & 4 deletions sched/clock/clock_systimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* See nuttx/clock.h */

#undef clock_systimer

/****************************************************************************
* Private Data
****************************************************************************/
Expand All @@ -74,7 +77,6 @@
*
****************************************************************************/

#if !defined(clock_systimer) /* See nuttx/clock.h */
uint32_t clock_systimer(void)
{
#ifdef CONFIG_SCHED_TICKLESS
Expand Down Expand Up @@ -104,7 +106,6 @@ uint32_t clock_systimer(void)

#endif
}
#endif

/****************************************************************************
* Name: clock_systimer64
Expand All @@ -122,7 +123,6 @@ uint32_t clock_systimer(void)
*
****************************************************************************/

#if !defined(clock_systimer) /* See nuttx/clock.h */
#ifdef CONFIG_SYSTEM_TIME64
uint64_t clock_systimer64(void)
{
Expand All @@ -144,4 +144,3 @@ uint64_t clock_systimer64(void)
#endif
}
#endif
#endif
6 changes: 3 additions & 3 deletions syscall/syscall.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"clock_getres","time.h","","int","clockid_t","struct timespec*"
"clock_gettime","time.h","","int","clockid_t","struct timespec*"
"clock_settime","time.h","","int","clockid_t","const struct timespec*"
"clock_systimer","nuttx/syscall.h","","uint32_t"
"clock_systimer","nuttx/clock.h","","uint32_t"
"close","unistd.h","CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0","int","int"
"closedir","dirent.h","CONFIG_NFILE_DESCRIPTORS > 0","int","FAR DIR*"
"connect","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","FAR const struct sockaddr*","socklen_t"
Expand All @@ -18,7 +18,7 @@
"fcntl","fcntl.h","CONFIG_NFILE_DESCRIPTORS > 0","int","int","int","..."
"fs_fdopen","nuttx/fs/fs.h","CONFIG_NFILE_DESCRIPTORS > 0 && CONFIG_NFILE_STREAMS > 0","FAR struct file_struct*","int","int","FAR struct tcb_s*"
"fsync","unistd.h","CONFIG_NFILE_DESCRIPTORS > 0 && !defined(CONFIG_DISABLE_MOUNTPOINT)","int","int"
"get_errno","nuttx/syscall.h","","int"
"get_errno","errno.h","","int"
"getenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","FAR char*","FAR const char*"
"getpid","unistd.h","","pid_t"
"getsockopt","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","int","int","FAR void*","FAR socklen_t*"
Expand Down Expand Up @@ -110,7 +110,7 @@
"send","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR const void*","size_t","int"
"sendfile","sys/sendfile.h","CONFIG_NFILE_DESCRIPTORS > 0 && defined(CONFIG_NET_SENDFILE)","ssize_t","int","int","FAR off_t*","size_t"
"sendto","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","ssize_t","int","FAR const void*","size_t","int","FAR const struct sockaddr*","socklen_t"
"set_errno","nuttx/syscall.h","","void","int"
"set_errno","errno.h","","void","int"
"setenv","stdlib.h","!defined(CONFIG_DISABLE_ENVIRON)","int","const char*","const char*","int"
"setsockopt","sys/socket.h","CONFIG_NSOCKET_DESCRIPTORS > 0 && defined(CONFIG_NET)","int","int","int","int","FAR const void*","socklen_t"
"sigaction","signal.h","!defined(CONFIG_DISABLE_SIGNALS)","int","int","FAR const struct sigaction*","FAR struct sigaction*"
Expand Down
4 changes: 2 additions & 2 deletions syscall/syscall_stublookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* a kernel build.
*/

#if defined(CONFIG_LIB_SYSCALL) && defined(__KERNEL__)
#if defined(CONFIG_LIB_SYSCALL)

/****************************************************************************
* Pre-processor definitions
Expand Down Expand Up @@ -341,4 +341,4 @@ const uintptr_t g_stublookup[SYS_nsyscalls] =
* Public Functions
****************************************************************************/

#endif /* CONFIG_LIB_SYSCALL && __KERNEL__ */
#endif /* CONFIG_LIB_SYSCALL */

0 comments on commit 2029236

Please sign in to comment.