Commit Graph

36952 Commits

Author SHA1 Message Date
Gregory Nutt
ae401cecdd Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for those files under fs/driver, fs/aio, fs/nfs, crypto/, and boards/.

Please note:  The modified file under fs/nfs generates several " Mixed case identifier found" errors.  Please ignore these.  These cannot be fixed without changes to numerous other files.  They also follow a non-standard convention that is used many files:  Using lower case structure names in custom SIZEOF_ definitions.
2020-03-30 17:09:45 +01:00
Xiang Xiao
15fac7743c libc/netdb: Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-03-30 09:47:28 -06:00
Xiang Xiao
d8b5362380 libc/netdb: Fix typo error in the implementation of gethostbyname_r
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I6675e800ad5627881ca904e80317df94f5973eb7
2020-03-30 09:47:28 -06:00
Xiang Xiao
dd0aca6822 libc/netdb: Make host and serv optional for getnameinfo
and fix other minor style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I107ee5b141f39e1e08967373b1ead4495bc55aa7
2020-03-30 09:47:28 -06:00
Xiang Xiao
a709c83b2e libc/netdb: Make gethostbyaddr_r callable even without CONFIG_NETDB_HOSTFILE
and fix other minor issue

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I1c12440cfb7aef4394539e02a12aeb10088f236b
2020-03-30 09:47:28 -06:00
Xiang Xiao
c85fe67ebc net/loopback: Move g_lo_* global variable to libc/net/
so netdb could reuse these global variable directly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iaa26ddbdaf416f64d43c6e8888a14bbe0c3405eb
2020-03-30 09:47:28 -06:00
Xiang Xiao
eaab17b66a libc/netdb: Change the default max number of host IP to 2 if both IPv4 and Ipv6 enable
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I02614cb34647eaa03b476a6755d0667dc8392036
2020-03-30 09:47:28 -06:00
Xiang Xiao
bd9fbade05 libc/netdb: Fix the buffer overwrite in lib_parse_hostfile
and other minor issue

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I732f63a312ac5c2ddf61ab8084c404bde1b114d4
2020-03-30 09:47:28 -06:00
Xiang Xiao
9e277c6c50 libc/netdb: Return null alias for getservbyport_r/getservbyname_r
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I82728a8ea9a5136e0154cd67ec8de70a4e0ac6ed
2020-03-30 09:47:28 -06:00
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
Ouss4
910ebbf5b0 fs/fat/fs_fat32util.c: return was missing from the last PR. 2020-03-30 17:13:13 +02:00
YAMAMOTO Takashi
a25ad63582 esp32: Bump idle stack size
This fixes crashes in ostest with the smp config.
The value was taken from ostest config.
Note that this board doesn't implement interrupt stack.
2020-03-30 11:46:25 -03:00
Ouss4
ba8bc4c80c fs/: Check return of nxsem_wait_uninterruptible. 2020-03-30 08:08:07 -06:00
YAMAMOTO Takashi
3d78be81d2 esp32: README: Add FT232HL jumper settings and pin outs 2020-03-30 09:59:05 +01:00
YAMAMOTO Takashi
23e2c17a0f sim: Remove CONFIG_SIM_M32 and CONFIG_ELF where unnecessary
Namely these defconfig files:

    boards/sim/sim/sim/configs/mtdpart/defconfig
    boards/sim/sim/sim/configs/mtdrwb/defconfig
    boards/sim/sim/sim/configs/rpproxy/defconfig
    boards/sim/sim/sim/configs/rpserver/defconfig
    boards/sim/sim/sim/configs/tcpblaster/defconfig

Because the recent versions of macOS is 64-bit only and thus
incompatible with CONFIG_SIM_M32=y.

The following defconfig files are left intact as these configs
are important for them:

    boards/sim/sim/sim/configs/loadable/defconfig
    boards/sim/sim/sim/configs/module32/defconfig
2020-03-30 02:26:01 -05:00
YAMAMOTO Takashi
34de90e632 esp32: Another OpenOCD example config 2020-03-29 23:55:45 -05:00
Gregory Nutt
a4d6af8343 Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for those files under fs/inode.  Utility functions under fs/incode were modified so the changes do extend to other fs/ sub-directories as well.
2020-03-30 01:33:31 +01:00
Gregory Nutt
156963a903 Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for those files under fs/tmpfs and fs/spiffs.  Still do do:  The rest of fs/ and all of drivers/ and arch/.
2020-03-29 22:11:13 +01:00
Gregory Nutt
97339e47f1 Check return from nxsem_wait_initialize()
Resolution of Issue 619 will require multiple steps, this part of the first step in that resolution:  Every call to nxsem_wait_uninterruptible() must handle the return value from nxsem_wait_uninterruptible properly.  This commit is only for those files under graphics/, mm/, net/, sched/, wireless/bluetooth.

Still to do:  Files under fs/, drivers/, and arch.  The last is 116 files and will take some effort.
2020-03-29 20:11:10 +01:00
Gregory Nutt
0558aa0a78 "Uninterruptible" semaphore waits must return when canceled.
nxsem_timedwait_uninterruptible() must return -ECANCELED if the thread is canceled:

        include/nuttx/semaphore.h:  Return if nxsem_wait() returns ECANCELED meaning that the thread waiting for the semaphore has been canceled.
        sched/semaphore/sem_timedwait.c:  Same change (the inline version is in semaphore.h, the non-inlined version is in sem_tickwait.c).
        drivers/sensors/lps25h.c and drivers/wireless/bluetooth/bt_uart_bcm4343x.c:  Make sure that the caller deals correctly with the -ECANCELED return value.

    Refer to issue 619.
2020-03-29 11:58:28 -03:00
YAMAMOTO Takashi
2b139625bb sim: Add a config to test examples/{module,sotest} with -m32 2020-03-29 14:16:14 +01:00
YAMAMOTO Takashi
4ae8e435d1 sim: Add a config to test examples/{module,sotest} 2020-03-29 14:16:14 +01:00
YAMAMOTO Takashi
4c0783353a tools/testbuild.sh: Make blacklist work on macOS
I couldn't find where "\b" was documented.
I guess it's a zero-width word boundary or something like that.
Anyway, it doesn't seem to work on macOS.
2020-03-29 09:39:11 +01:00
YAMAMOTO Takashi
35e1aa82cb tools/testbuild.sh: Allow spaces in comments 2020-03-28 11:23:42 -05:00
YAMAMOTO Takashi
01c91e8af8 sim: Remove CONFIG_RAW_BINARY=y from configs
Because:

* A raw binary doesn't make sense for sim, where ./nuttx is
  a host OS executable.

* It breaks test builds on macOS, where native objcopy
  is not available.
2020-03-28 10:47:43 -05:00
Brennan Ashton
f787df1d38 Pull the ESP32 binary blobs from a configurable path 2020-03-28 06:58:35 -05:00
Brennan Ashton
47dc68aa45 Use new images 2020-03-28 06:58:35 -05:00
YAMAMOTO Takashi
40d7f83e31 sim: Appease a few prototype warnings 2020-03-28 12:08:57 +01:00
raiden00pl
d217b3a889 arch/arm/src/nrf52: fix coding standard issues 2020-03-27 12:51:54 -06:00
raiden00pl
fef7abb598 arch/arm/src/nrf52/nrf52_i2c.c: protect the I2C transfer with a semaphore 2020-03-27 12:51:54 -06:00
YAMAMOTO Takashi
4f130d4274 README.txt: Mention a few tools for macOS 2020-03-27 02:42:11 -05:00
YAMAMOTO Takashi
f1a68ab444 Revert "Revert "README.txt: add MacOS section for flock installation""
This reverts commit 884fcb605d.
2020-03-27 02:42:11 -05:00
YAMAMOTO Takashi
2f6d458bcf sim/README: Mention macOS 2020-03-27 02:42:11 -05:00
YAMAMOTO Takashi
ebc6627b77 Bump DEFAULT_TASK_STACKSIZE for the sim
The sim demands more stack because:
 * It's often 64-bit
 * It calls host OS libraries
2020-03-27 01:14:10 -05:00
YAMAMOTO Takashi
a493c92826 sim: Use executable memory for the heap
On modern environments, bss is not executable.

Alternatively we can use the ARCH_HAVE_MODULE_TEXT mechanism.
But it's considered overkill for the sim, which is mainly
for development.
2020-03-27 00:04:36 -05:00
YAMAMOTO Takashi
748777e3f5 sim: MODULE definitions for macOS 2020-03-27 00:04:36 -05:00
YAMAMOTO Takashi
18c574d66a Config.mk: Provide the default MODULECC/MODULELD
In some cases, a separate toolchain is necessary to
build modules.
E.g. the sim on macOS, where the native format is Mach-O.

By default, just use CC/LD, which is appropriate for
the most of platforms.
2020-03-27 00:04:36 -05: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
24c9fa3cd9 Kconfig: Move ELF_64BIT out of !BINFMT_DISABLE
Because it's also used by LIBC_MODLIB.
2020-03-27 00:04:36 -05:00
YAMAMOTO Takashi
bb09d564db libelf: Don't truncate 64-bit values 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
44b8f3e467 include/nuttx/sched.h: Move prototype for sched_releasetcb()
Move the prototype for the internal OS from from sched/sched/sched.h to include/nuttx/sched.h.  This was done because binfmt/binfmt/excecmodule.c requires the prototype for sched_releasetcb() and was illegally including sched/sched/sched.h.  That is a blatant violation of the OS modular design and the person that did this should be hung up by their thumbs.  Oh... I did that back in a bad moment in 2014.  Now that is made right.
2020-03-26 14:12:34 -03: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
8ad9d1e0b4 libelf: Appease nxstyle complaints
Also, fix a minor typo.
2020-03-26 02:51:34 -05:00