Commit Graph

418 Commits

Author SHA1 Message Date
Xiang Xiao 1a95cce1a3 build: Move .config check to the top Makefile
remove the workaround to handle the inexistence of .config/Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-20 17:57:34 +01:00
Xiang Xiao 7faf3c0254 build: replace ${TOPDIR} with $(TOPDIR) in Makefile
make the usage consistence

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-19 19:23:18 +01:00
Xiang Xiao 5eae32577e build: Move INCDIROPT to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Xiang Xiao bd656888f2 build: Replace WINTOOL with CYGWIN_WINTOOL Kconfig
so the correct value can be determinated by Kconfig system automatically

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00
Gregory Nutt a569006fd8 sched/: Make more naming consistent
Rename various functions per the quidelines of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions

    nxsem_setprotocol -> nxsem_set_protocol
    nxsem_getprotocol -> nxsem_get_protocol
    nxsem_getvalue -> nxsem_get_value
2020-05-17 14:01:00 -03:00
YAMAMOTO Takashi 76add63598 Bump the default of CONFIG_NETDB_DNSCLIENT_MAXRESPONSE
It's better to have a default working for many cases.
Usually DNS servers are not optimized for embedded clients.
Users can fine tune for their environment anyway.
2020-05-15 14:23:48 +08:00
YAMAMOTO Takashi e783a59f9d netdb: Truncate the list of ips instead of bailing out with ERANGE
In many cases, users only care the first address anyway.
2020-05-15 14:23:48 +08:00
YAMAMOTO Takashi b36420ef32 Bump the default of CONFIG_NETDB_BUFSIZE
The old default didn't work even for moderate cases.
(eg. strlen(name) == 17, two ipv4 addresses, on 64-bit sim)
2020-05-15 14:23:48 +08:00
liuhaitao 78c8b43b9c libs/libxx: add .cpp files build support
libcxx project has .cpp files inside, so add .cpp files build support
here.

Change-Id: Icd3bcb42f4ceafa5e07a9977149cb08d555a9ade
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-05-13 09:15:37 +02:00
Gregory Nutt 2b5ff17a85 setlogmask(): Add comments
In include/syslog.h and libs/libc/syslog/lib_setlogmask.c, add comments indicating tht setlogmask() is not thread-safe.
2020-05-11 11:32:55 -04:00
Nakamura, Yuuichi 46baccb521 Remove unnecessary enter/leave_critical_section() in setlogmask() because it is MT-unsafe. 2020-05-11 08:06:29 -06:00
Gregory Nutt a4218e2144 include/nuttx/sched.h: Make naming of all internal names consistent:
1. Add internal scheduler functions should begin with nxsched_, not sched_
2. Follow the consistent naming patter of https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+OS+Internal+Functions
2020-05-09 14:19:08 -03:00
Gregory Nutt 9ce03b1660 Move pthread-specific data into TLS
1. Move pthread-specific data files from sched/pthread/ to libs/libc/pthread.
2. Remove pthread-specific data functions from syscalls.
3. Implement tls_alloc() and tls_free() with system calls.
4. Reimplement pthread_key_create() and pthread_key_free() using tls_alloc() and tls_free().
5. Reimplement pthread_set_specific() and pthread_get_specicif() using tls_set_value() and tls_get_value()
2020-05-08 18:05:04 +01:00
Gregory Nutt 3dca5eba15 Completes the Implementation of the TLS-based errno
- Remove per-thread errno from the TCB structure (pterrno)
- Remove get_errno() and set_errno() as functions.  The macros are still available as stubs and will be needed in the future if we need to access the errno from a different address environment (KERNEL mode).
- Add errno value to the tls_info_s structure definitions
- Move sched/errno to libs/libc/errno.  Replace old TCB access to the errno with TLS access to the errno.
2020-05-07 23:11:34 +01:00
Gregory Nutt c2244a2382 Remove CONFIG_TLS
A first step in implementing the user-space error is force TLS to be enabled at all times.  It is no longer optional
2020-05-07 12:04:16 -06:00
Xiang Xiao a2d924eea4 syscall: Fix typo error in cvs and header file
and reoder the entry in cvs file

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-07 10:31:05 -06:00
Gregory Nutt 5c7a0bd9f0 Fix nxstyle complaints from files changed by this PR 2020-05-05 18:56:33 +01:00
Gregory Nutt bda24f09c2 libs/libc/tls/tls_getinfo.c: Add tls_get_info()
Move the logic to get TLS information from an inline function to a normal function.  For the unaligned case, it is probably too large to be inlined.

Also fixes some minor things from review of previous commits.
2020-05-05 18:56:33 +01:00
Abdelatif Guettouche b7e7fba732 TLS_UNALIGNED (#2)
* Implement the TLS_UNALIGNED
2020-05-05 18:56:33 +01:00
Gregory Nutt b1071cca00 libs/libc/tls/Kconfig: Add CONFIG_TLS_ALIGNED
CONFIG_TLS_ALIGNED will select the (legacy) aligned stack implementation of TLS.  If CONFIG_TLS_ALIGNED is not defined, then the new, implementation of TLS using an unaligned stack will be enabled.
2020-05-05 18:56:33 +01:00
Xiang Xiao d9d2fc0d0a debug: Reduce CONFIG_CPP_HAVE_VARARGS usage
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-05 08:27:58 -06:00
Xiang Xiao 6604cdb3f2 fs: Remove all LIBC_IOCTL_VARIADIC related stuff
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-05 08:27:58 -06:00
Brennan Ashton 8110ea6a7a x86_64: Make sure to clone ap list in vasprintf
VA_LIST is getting clobbered because it is a pointer to a structure
on the stack and we must traverse it twice.  Clone it like we do
for x86_32
2020-05-04 08:37:22 -06:00
Xiang Xiao 32b79b22ec Rename pipe2/mkfifo2 to nx_pipe/nx_mkfifo
and don't modify errno anymore

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-04 07:20:02 -06:00
Gregory Nutt 00933cfece sched/sched: Add sched_get_stackinfo()
The new OS interface, sched_get_stackinfo() combines two pthread-specific interfaces into a single generic interface.  The existing pthread_get_stackaddr_np() and pthread_get_stacksize_np() are moved from sched/pthread to libs/libc/pthread.

There are two motivations for this change:  First, it reduces the number of system calls.  Secondly, it adds a common hook that is going to used for a future implementation of TLS.
2020-05-03 23:33:44 +01:00
Xiang Xiao a2f6dc9b7c errno: Rename get_errno_ptr to __errno
Inrease the compatiblity with the third party library(e.g. newlib)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-03 12:15:54 -06:00
patacongo f09e58fe73 Update libs/libc/misc/lib_ioctl.c 2020-05-03 08:17:38 -06:00
Brennan Ashton 4e7d59f6bc Fix debug assert in ioctl to check if int will fit in
unsigned long not be unsigned long

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-05-03 08:17:38 -06:00
Xiang Xiao 31c60c3b0e syscall: nx_task_spawn should exist in the flat build just like the protected build
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-02 09:56:23 -06:00
Alan Carvalho de Assis 8c0fc09853 Vik memcpy() is already defined on string/Kconfig 2020-05-02 08:41:45 -06:00
Xiang Xiao a2f657e4cb build: Move KDEFINE to a common place(tools/Config.mk)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 15:56:55 -06:00
Xiang Xiao f2aba8d9b7 build: Remove 'u' prefix from userspace library
so user needn't link the different library because the build type change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 15:56:55 -06:00
Xiang Xiao f8a809eb5b Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 10:43:47 -03:00
Xiang Xiao eca7059785 Refine __KERNEL__ and CONFIG_BUILD_xxx usage in the code base
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 10:43:47 -03:00
Xiang Xiao fe5cb9529d builtin: Remove HAVE_BUILTIN_CONTEXT macro
it's enough to decide which code should be compiled with CONFIG_BUILTIN and CONFIG_FS_BINFS

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 10:43:47 -03:00
liuhaitao 6b4cc3011c Remove the residual files in distclean
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-05-01 04:43:15 +01:00
Ouss4 d0bb7c137a Use NuttX's signal set functions inside the OS. 2020-04-29 16:40:27 -06:00
Xiang Xiao ddda00ea65 Kconfig: Refine BUILD_FLAT, BUILD_PROTECTED and BUILD_KERNEL usage
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-29 12:16:18 -06:00
liuhaitao 23389215bb libnx/nxfonts: change the generated file nxfonts_tom-thumb-4x6.c to nxfonts_bitmap_tom-thumb-4x6.c
Align the generated files name, so make distclean could also remove all nxfonts_bitmaps_*.c files, no
need to add one more extra DELFILE for nxfonts_tom-thumb-4x6.c.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-28 21:28:15 -07:00
Juha Niskanen b34d7bf56d libc/netdb: support multiple DNS nameservers when not using resolv.conf
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-04-27 19:52:24 +08:00
Juha Niskanen ba0a17ca8c libc/netdb: make getaddrinfo re-entrant also when querying with service name
Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
2020-04-27 19:52:24 +08:00
Alin Jerpelea 76c47f6b21 libc: audio: nxstyle fixes
This change is needed to be able to fix the warnings on the audio core
and includes the propagation of the fix in the audio.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-04-21 17:19:52 -06:00
YAMAMOTO Takashi 33aaefa2d1 modlib: Replace Gregory Nutt's copyright notice with Apache 2.0
While I'm here adding a new file. (modlib_loadshdrs.c)

The licence text was copied from:
    sched/sched/sched_getcpu.c
    tools/zds/Makefile
2020-04-13 09:49:22 -06:00
YAMAMOTO Takashi 7cfcea2938 Move modlib_loadshdrs to a separate file
To avoid pulling otherwise unused modlib_findsection when linking.
2020-04-13 09:49:22 -06:00
YAMAMOTO Takashi 1adc44e059 Enable modlib_findsection
This fixes unused warning on modlib_findsection
2020-04-13 09:49:22 -06:00
YAMAMOTO Takashi 6f3e127094 Appease nxstyle complaints 2020-04-13 09:49:22 -06:00
Gregory Nutt 759d8c1bfa Run nxstyle against files modified in previous commit. 2020-04-13 02:09:34 +08:00
Gregory Nutt ca2b0a3657 Fix more warnings noted in PR checks
arp/arp_notify.c:132:43: warning: for loop has empty body [-Wempty-body]
           prev = curr, curr = curr->nt_flink);
                                              ^

    sixlowpan/sixlowpan_tcpsend.c:806:31: warning: implicit conversion from 'unsigned int' to 'uint16_t' (aka 'unsigned short') changes value from 4294967295 to 65535 [-Wconstant-conversion]
                                  _SO_TIMEOUT(psock->s_sndtimeo));
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Numerous warnings like:

    ieee802154_getreq.c:93:3: warning: implicit declaration of function 'memcpy' is invalid in C99 [-Wimplicit-function-declaration]
      IEEE802154_EADDRCOPY(eaddr, req.attrval.mac.eaddr);
      ^

    nxfonts/nxfonts_cache.c:839:35: warning: for loop has empty body [-Wempty-body]
               fcache = fcache->flink);

    bluetooth/bluetooth_finddev.c💯11: warning: implicit declaration of function 'memcmp' is invalid in C99 [-Wimplicit-function-declaration]
          if (BLUETOOTH_ADDRCMP(dev->d_mac.radio.nv_addr, match->bf_addr))
              ^

    rwbuffer.c:559:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
      if (rwb->rhmaxblocks > 0 && rwb->rhnblocks > 0)
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-04-13 02:09:34 +08:00
Gregory Nutt 2aabf76815 Run nxstyle against modified files in PR 2020-04-13 02:09:34 +08:00
Gregory Nutt 62c1389825 Fix warnings noted in PR build checks:
net/telnet.c:1317:40: warning: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always true [-Wtautological-constant-out-of-range-compare]
                      if (priv->td_pending < CONFIG_TELNET_RXBUFFER_SIZE)
                          ~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    time/lib_localtime.c:569:32: warning: sizeof on pointer operation will return size of 'char *' instead of 'char [33]' [-Wsizeof-array-decay]
              sizeof(lsp->fullname - 1) <= strlen(p) + strlen(name))
                     ~~~~~~~~~~~~~ ^
2020-04-13 02:09:34 +08:00