Commit Graph

288 Commits

Author SHA1 Message Date
Xiang Xiao
d05de762bc libc/netdb: Don't need call dns_initialize in dns_find_answer
so let remove it

Change-Id: I6b09673caf8cb16d90cbda8b791f1ef0ba59e2a2
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-30 09:47:28 -06:00
Xiang Xiao
673a43d5fa libc/netdb: Need skip ':' to get port in dns_foreach_nameserver
Change-Id: Ic9555832c4404a59e1117dce06a5de13f0cc4141
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-30 09:47:28 -06:00
Xiang Xiao
35b98f2361 libc/netdb: Change the fopen mode from "rt" to "r"
since the text mode is the default

Change-Id: If4df0c69d998a36df541a968d14fc4d6e159db57
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-30 09:47:28 -06:00
Xiang Xiao
64a230df7a libc/netdb: Should use ntohs not htons for the receiving data
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I36e508c1ba952d9229790abdb47f4f9dc654d326
2020-03-30 09:47:28 -06:00
Xiang Xiao
07c3b16462 libc/netdb: Replace get_errno with errno
and fix the typo error

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I51e2e4dbdb46fea89f4e18a41d99b943b03cedab
2020-03-30 09:47:28 -06:00
YAMAMOTO Takashi
c62f806581 sim: modlib: Implement some x86_64 relocations
The boilerplate part of the code was copied from:

    libs/libc/machine/risc-v/rv64/arch_elf.c
2020-03-27 00:04:36 -05:00
YAMAMOTO Takashi
bd7829a44d modlib: Don't truncate 64-bit values 2020-03-27 00:04:36 -05:00
YAMAMOTO Takashi
f8077022bd Introduce CONFIG_DEFAULT_TASK_STACKSIZE
* The appropriate size of stack varies among archs.
  E.g. for 64-bit sim, 2048 is way too small, especially when the task
  happens to use host OS functionalities.
  I plan to allow an arch provide its own default.

* I plan to use this to replace hardcoded "STACKSIZE = 2048" in APPDIR.
2020-03-26 22:30:13 -05:00
Gregory Nutt
5c0e8e88b1 Revert "Makefile: move INCDIROPT to common place (#625)"
This reverts commit b9ace36fcc.

This change was added by PR 625 but has a serious logic flaw.  It removes all occurrences of INCDIROPT and replaces it with a definition in tools/Config.mk:

    else ifeq ($(WINTOOL),y)
      DEFINE = "$(TOPDIR)/tools/define.sh"
      INCDIR = "$(TOPDIR)/tools/incdir.sh" -w

This logic flaw is the Config.mk is included in all Make.defs files BEFORE WINTOOL is defined.  As a result, the definition is wrong in many places when building under Cygwin with a Windows native toolchain.
2020-03-26 08:50:29 -07:00
Xiang Xiao
b9ace36fcc
Makefile: move INCDIROPT to common place (#625) 2020-03-26 08:09:59 -06:00
YAMAMOTO Takashi
1ffa009c8b Revert "Don't generate .depend anymore"
This reverts commit 79af7fbf4e.

Because:

* btashton reported some issues in local builds:

  https://github.com/apache/incubator-nuttx/pull/603#issuecomment-602264860

* this might be related to the current CI breakage:

  > /bin/sh: 1: /__w/incubator-nuttx/incubator-nuttx/nuttx/tools/mkdeps: not found
2020-03-22 23:07:29 -05:00
Xiang Xiao
79af7fbf4e
Don't generate .depend anymore 2020-03-22 18:15:29 +00:00
Gregory Nutt
547a3cb3d9 Run all .c and .h files in previous commits through nxstyle. 2020-03-22 08:24:07 -05:00
Gregory Nutt
533528af01 libs/libc: Remove support CONFIG_FS_READABLE 2020-03-22 08:24:07 -05:00
Gregory Nutt
382513e997 libs/libc: Remove support for CONFIG_FS_WRITABLE
The mktemp family of functions are built unconditionally now (but not necessarily included in any  build).
2020-03-22 08:24:07 -05:00
Nathan Hartman
a5e643b0cd Fix typos in comments and documentation. 2020-03-16 20:01:11 -06:00
YAMAMOTO Takashi
df44909b30 xtensa/arch_elf.c: Ignore R_XTENSA_NONE
Now examples/sotest passes on qemu.
2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
061b796d47 Adapt dlfcn/modlib to use the instruction memory allocator 2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
e135c938d2 xtensa: Implement a few relocations 2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
2776a5bbea Replace a few Gregory Nutt's copyright notices with Apache 2.0
The text was copied from sched/sched/sched_getcpu.c.
2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
b2627225bd Update file paths of copy-and-paste'ed files 2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
c7526e551e arch_elf.c: Appease nxstyle errors 2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
5e1b24f012 xtensa: Add modlib boilerplate
This is a modified copy of armv6-m/armv7-m version.
2020-03-16 07:54:49 -06:00
Gregory Nutt
266849549a libs/libc/netdb/lib_dnsaddserver.c: Fix wrong fopen() mode.
dns_add_nameserver(): As reported by Surya Prakash Verma, call to
fopen() used nonexistent file open mode "at"; changed this to "r"
per Surya's analysis. See Surya's email to dev@ on 12 Mar 2020,
archived here: https://lists.apache.org/thread.html/rbbbee93f79dd8f4224969bb03bf093d8c96421380a1d955167a2f661%40%3Cdev.nuttx.apache.org%3E
2020-03-14 01:19:11 +01:00
Andrey Zabolotnyi
6697603162
inetaddr() more compliant with standards (especially error handling). (#524)
* inetaddr() more compliant with standards (especially error handling).

Co-authored-by: Андрей Заболотный <zapparello@ya.ru>
2020-03-10 08:17:17 -06:00
YAMAMOTO Takashi
b39ce514ea dlfcn, modlib: Appease nxstyle complaints 2020-03-10 01:53:49 -05:00
Gregory Nutt
199b4d6852 z20x: Changes to reduce serial Rx data overrun
boards/z80/ez80/z20x:  Increase RX buffer size to 4Kb, reduce BAUD to 2400 in w25boot configuration
arch/z80/src/ez80/ez80_serial.c:  Reduce Rx FIFO trigger level for eZ80F92 to 1 so that will respond more quickly to incoming data.
2020-03-09 22:51:54 +01:00
Gregory Nutt
82df8b3eba libs/libc/stdio: Names of files do not match content
Rename lib_rawinstream.c to lib_rawsistream.c and lib_rawsistream.c to lib_rawinstream.c so that the content of the files match the name of the files.  While we are at it, update the file license to Apache 2.0
2020-03-08 20:59:46 -05:00
Masayuki Ishikawa
c365e0a88f libs: risc-v: Fix typo in comment 2020-03-06 09:41:34 +01:00
Gregory Nutt
2eff5a6c63 z20X: Continued development of the W25 Bootloader.
Kconfig files.  Repartition some functionality.  Bootloader support will need to be provided in logic under arch/z80/src/ez80 so the critical configuration selections were moved the Kconfig file there.

arch/z80/src/ez80/ez80_i2c.h:  Rename arch/z80/src/ez80/ez80f91_i2c.h.  It is sharable by both ez80f91 and ez80f92.

arch/z80/src/ez80/:  Add logic to perform an additional level of interrupt redirection.  This is necessary because the the interrupt handling is part of the loader FLASH-based logic.  In order to share interrupts with the program loaded into RAM by the loader, another layer or redirection is required to get control to the interrupt handlers in the loaded program.  See ez809f2_loader.asm and ez80f92_program.asm

boards/z80/ez80/z20x/scripts:  Reduce size of the interrupt re-direction buffer from 1Kb to 512b.
2020-03-03 19:39:57 -03:00
macman88
43dfbdb348 Battery monitor support (#404)
* Adding support for BQ769x0 Battery Monitor IC (Work In Progress)
* Additional changes to support BQ769x0
* Store cell count and chip type when setting up
* Added shutdown, limits, charge/discharge switch, and clear faults operations
* Added support for current measurement; some cleanup
* Updated temperature reporting.  Fixed negative current reporting.
* When setting safety limits, update limit structure with actual values used.
* Added note on battery limit structure
* Updates to BQ769x0.  Re-ordered fault reporting, added fault cache, added ordered fault clearing
2020-02-28 18:18:50 -06:00
Gregory Nutt
d1a8a803e4 Build system: Get rid of the MOVEOBJ definition
Eliminate the MOVEOBJ definition from tools/Config.mk, Makefiles, and other locations.  The MOVEOBJ definition was used to work around the case where the object output of a compile or assemble is in a different directory than the source file.  The ZDS-II tools have no command line option to perform this move; MOVEOBJ handled the move as a post-compiler operation.

MOVEOBJ is no longer needed because this the ez80 COMPILE and ASSEMBLE definitions now handle all of the object file movement cases.
2020-02-24 22:37:28 +01:00
Xiang Xiao
bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
Ouss4
f8801e1bd8 libs/libc/unistd/lib_alarm.c,sched/timer/timer_getitimer.c: Silence a
warning with struct initialization.
2020-02-19 18:02:25 -06:00
Gregory Nutt
d202e2ef61 libs/libc/time/lib_gmtimer.c: Fix compile problem from PR317
PR317 removed definitions for SEC_PER_MIN, SEC_PER_HOUR, and SEC_PER_DAY because these were duplicates of definitions in include/nuttx/clock.h.  However, the PR did not include nuttx/clock.h so the removal of these definitions resulted in compilation failures.

Noted by Ouss4
2020-02-19 23:09:45 +01:00
Gregory Nutt
2ec59121fb Fix non C89 noncompliant code that was causing the ZDS-II compile to fail. 2020-02-19 23:09:10 +01:00
chao.an
4d6e275fc4 libs/libc/time/lib_gmtimer.c: Remove duplicate definition
time/lib_gmtimer.c:54: warning: "SEC_PER_MIN" redefined
   54 | #define SEC_PER_MIN  ((time_t)60)
      |
In file included from nuttx/include/nuttx/semaphore.h:48,
                 from nuttx/include/pthread.h:56,
                 from nuttx/include/signal.h:50,
                 from nuttx/include/sys/select.h:46,
                 from nuttx/include/sys/types.h:305,
                 from nuttx/include/time.h:46,
                 from time/lib_gmtimer.c:44:
nuttx/include/nuttx/clock.h:125: note: this is the location of the previous definition
  125 | #define SEC_PER_MIN                   60L
      |
time/lib_gmtimer.c:55: warning: "SEC_PER_HOUR" redefined
   55 | #define SEC_PER_HOUR ((time_t)60 * SEC_PER_MIN)
      |
In file included from nuttx/include/nuttx/semaphore.h:48,
                 from nuttx/include/pthread.h:56,
                 from nuttx/include/signal.h:50,
                 from nuttx/include/sys/select.h:46,
                 from nuttx/include/sys/types.h:305,
                 from nuttx/include/time.h:46,
                 from time/lib_gmtimer.c:44:
nuttx/include/nuttx/clock.h:138: note: this is the location of the previous definition
  138 | #define SEC_PER_HOUR           (SEC_PER_MIN  * MIN_PER_HOUR)
      |
time/lib_gmtimer.c:56: warning: "SEC_PER_DAY" redefined
   56 | #define SEC_PER_DAY  ((time_t)24 * SEC_PER_HOUR)
      |
In file included from nuttx/include/nuttx/semaphore.h:48,
                 from nuttx/include/pthread.h:56,
                 from nuttx/include/signal.h:50,
                 from nuttx/include/sys/select.h:46,
                 from nuttx/include/sys/types.h:305,
                 from nuttx/include/time.h:46,
                 from time/lib_gmtimer.c:44:
nuttx/include/nuttx/clock.h:141: note: this is the location of the previous definition
  141 | #define SEC_PER_DAY            (HOURS_PER_DAY * SEC_PER_HOUR)
      |
2020-02-19 12:51:08 -06:00
chao.an
b438d529f1 libs/libc/stdio/lib_getdelim.c: Correct the character slash 2020-02-19 12:47:25 -06:00
Juha Niskanen
15b78abccf Fix typos in comments 2020-02-14 08:50:45 -06:00
YAMAMOTO Takashi
3df686e10f sim: berr() unknown relocation type 2020-02-14 14:40:15 +08:00
YAMAMOTO Takashi
882c82a038 Fix typos in comments 2020-02-12 14:07:56 +01:00
Xiang Xiao
ac53600e44 sched: Rename sched_cpu_count to sched_cpucount 2020-02-09 07:33:59 -06:00
Xiang Xiao
a8de37fbec Ensure all source code end with one and only one newline
by this command:
git ls-files -z | while IFS= read -rd '' f; do tail -c1 < "$f" | read -r _ || echo >> "$f"; done
2020-02-08 07:25:56 -06:00
Masayuki Ishikawa
81f1133174 ELF64 support (#220)
* include: Introduce elf64.h and elf.h

    Added elf64.h for 64bit ELF support and moved common definitions
    from elf32.h to elf.h. Also introduced Elf_xxx to be used in
    common libraries such as binfmt.

  * binfmt, include, modlib, module: Add support for ELF64

    Elf_xxx must be used instead of Elf32_xxx to support ELF64.
    To use ELF64, CONFIG_ELF_64BIT must be enabled.

  * binfmt, modlib: Add support for relocate address

  * arch: risc-v: Add include/elf.h

  * libs: machine: Add risc-v related files.

    NOTE: Currently only supports ELF64

  * boards: maix-bit: Add elf and posix_spawn configurations

  * boards: maix-bit: Add support for module configuration
2020-02-07 17:10:23 -06:00
YAMAMOTO Takashi
486a05ed70 getopt: Fix a typo in a comment 2020-02-07 10:23:44 +08:00
Xiang Xiao
adbff7de81 tools/Config.mk: add DEFINE macro like INCDIR 2020-02-03 15:06:11 -06:00
Xiang Xiao
5c80b94820 Replace #include <semaphore.h> to #include <nuttx/semaphore.h>
Since the kernel side should call nxsem_xxx instead and remove the unused inclusion
2020-02-01 08:27:30 -06:00
Xiang Xiao
80277d1630
Refine the preprocessor conditional guard style (#190) 2020-01-31 19:07:39 +01:00
Xiang Xiao
68951e8d72 Remove exra whitespace from files (#189)
* Remove multiple newlines at the end of files
* Remove the whitespace from the end of lines
2020-01-31 09:24:49 -06:00
YAMAMOTO Takashi
ba1a150dd2 snprintf: Fix a comment typo 2020-01-29 09:04:25 +01:00