Commit Graph

4394 Commits

Author SHA1 Message Date
Xiang Xiao
bd4e8e19d3 Run codespell -w against all files
and fix the wrong correction
2020-02-22 14:45:07 -06:00
YAMAMOTO Takashi
3923a8401f Remove bare greek letters in comments 2020-02-21 06:39:23 -06:00
chao.an
c06adf06b8 binfmt/exec: Make the spawn attribute take effect 2020-02-20 08:55:14 -06:00
chao.an
d07afc934e fcntl: add O_CLOEXEC/FD_CLOEXEC support 2020-02-20 08:20:38 -06:00
chao.an
58599e8e2e fs/vfs/fs_ioctl.c: Add FIONBIO support 2020-02-19 12:08:08 -06:00
Nicholas Chin
0f284c3025 driver/ioexpander: adds driver for the PCA9538 I2C ioexpander 2020-02-19 11:53:08 -06:00
chao.an
5b750fdda0 inclue/sys/file.h: Dummy header for POSIX compliance 2020-02-19 11:48:49 -06:00
Nicholas Chin
85caee63b4 drivers/analog: Adds driver for the ADS7828 I2C analog to digital converter 2020-02-18 14:19:40 -06:00
Xiang Xiao
51a2171c71 ramlog: Remove g_ramlog_syslog_channel since it's same as g_default_channel
And remove syslog_init_e because all initialization is later now and we don't
distinguish the initialition phase anymore after ramlog don't need special
initialize.
2020-02-18 13:04:45 -06:00
Xiang Xiao
dcaaf2d912 ramlog: Remove all ramlog_consoleinit related code
Because we can get the same function by CONSOLE_SYSLOG/syslog_console_init.
BTW, it isn't a good choice to use g_ramlogfops as /dev/console since nsh
will read back what it send out which will surprise most people.
2020-02-18 12:57:43 -06:00
Xiang Xiao
e7d9260014 arch: Customize the typedef of size_t instead of intptr_t
To ensure size_t same as toolchain definition in the first place and rename CXX_NEWLONG to ARCH_SIZET_LONG.  The change also check whether __SIZE_TYPE__ exist before CONFIG_ARCH_SIZET_LONG so our definition can align with toolchain(gcc/clang) definition automatically.
2020-02-18 07:15:19 -06:00
Gregory Nutt
f5e0bb2d30 Run all files modified by PR274 through nxstyle. 2020-02-15 07:17:22 -06:00
Xiang Xiao
20a9a62fdf Make compare_timespec public so timer driver could reuse it 2020-02-15 07:17:07 -06:00
Juha Niskanen
15b78abccf Fix typos in comments 2020-02-14 08:50:45 -06:00
YAMAMOTO Takashi
c1a32fb9dd compiler.h: clang actually has long long 2020-02-13 08:21:18 -06:00
YAMAMOTO Takashi
710da6022d Fix comment typos 2020-02-12 20:39:47 -06:00
Gregory Nutt
3c0b49448a Network Loopback Driver: A configuration option to control packet size.
Historically, the loopback driver used the largest packet size of all enabled link layer protocols.  This permitted packets to be forward via the loopbak device with no major loss of performance.  However, in experimenting with configurations where no other link layer protocols were enabled, this means the loopback packet size was set to the smallest possible size, to the SLIP minimum of 296 bytes.  This resulted in terrible loopback performance.

    This commit adds an option to increase the loopback packet size with the option CONFIG_NET_LOOPBACK_PACKETSIZE.

    The loopback driver packet buffer should be quite large.  The larger the loopback packet buffer, the better will be TCP performance of the loopback transfers.  The Linux loopback device historically used packet buffers of size 16Kb, but that was increased in recent Linux versions to 64Kb.  Those sizes may be excessive for resource constrained MCUs, however.

    The network still enforces the lower limit that is the maximum packet size of all enabled link layer protocols.  But this new option permits the loopback packet size to be increased from that.

    * net/Kconfig:  Adds CONFIG_NET_LOOPBACK_PKTSIZE option
    * include/nuttx/net/netconfig.h:  Assures that the packet size that is used is at least as large as the largest packet size of other link layer protocols.
    * drivers/net/loopback.c:  Use that larger packet size.
    * boards/sim/sim/sim/configs/tcploop/defconfig:  Set the loopback packet size to 1500
2020-02-10 22:17:32 -03:00
Gregory Nutt
934f468e4a Run all .c and .h files in PR235 through tools/nxstyle. 2020-02-09 07:34:24 -06:00
Xiang Xiao
ac53600e44 sched: Rename sched_cpu_count to sched_cpucount 2020-02-09 07:33:59 -06:00
Xiang Xiao
c34a73e780 syscall: Expose sched_getaffinity and sched_setaffinity 2020-02-09 07:33:38 -06:00
Xiang Xiao
6d69439f58 Call xxx_timer_initialize from clock subsystem
Call xxx_timer_initialize from clock subsystem to make timer ready for use as soon as possiblei and revert the workaround:

commit 0863e771a9
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Apr 26 07:24:57 2019 -0600

    Revert "sched/clock/clock_initialize.c:  clock_inittime() needs to be done with CONFIG_SCHED_TICKLESS and clock_initialize should skip clock_inittime() for external RTC case since the RTC isn't ready yet."

    This reverts commit 2bc709d4b9.

    Commit 2bc709d4b9 was intended to handle the case where up_timer_gettime may not start from zero case.  However, this change has the side-effect of breaking every implementation of tickless mode:  After this change the tickless timer structures are used before they are initialized in clock_inittime().  Initialization happens later when up_initialize is called() when arm_timer_initialize().

    Since the tickless mode timer is very special, one solution might be to

    1. Rename xxx_timer_initialize to up_timer_initialize
    2  Move up_timer_initialize to include/nuttx/arch.h
    3.  Call it from clock subsystem instead up_initialize

    Basically, this change make timer initialization almost same as rtc initialization(up_rtc_initialize).

    For now, however, we just need to revert the change.
2020-02-08 07:40:06 -06:00
Xiang Xiao
76bbed07a4 Call up_irqinitialize from irq subsystem
Call up_irqinitialize from irq subsystem to make the irq ready for use as soon as possible
2020-02-08 07:39:22 -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
Peter van der Perk
513475c11c Kinetis renamed TJA1100 to TJA110X registers 2020-02-07 10:04:48 +01:00
Xiang Xiao
1321c34022 drivers/net/phy_notify.c: Use IFNAMSIZ for interface name size
Replace CONFIG_PHY_NOTIFICATION_MAXINTFLEN with IFNAMSIZ
2020-02-02 11:02:39 -06:00
Xiang Xiao
c5b1554d84 Remove NETDEV_LOOPBACK option, NET_LOOPBACK is enough 2020-02-02 08:25:06 -06:00
Xiang Xiao
2d7c072723 Remove duplicated NET_SLIP option from drivers/net/Kconfig 2020-02-02 08:24:50 -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
liuguo09
67ae5b3e7f include/nuttx/net/igmp.h: fix build break by previous network changes (#196) 2020-02-01 11:31:23 +00:00
patacongo
e86b516f9d
include/netinet/arp.h: Previous network changes broke the build test (#193) 2020-01-31 21:23:15 +01:00
Xiang Xiao
4a238f2e7b Fix the wrong IPv6 TCP MSS calculation
1280(MTU) - 40(IPv6_HDRLEN) - 20(TCP_HDRLEN) = 1220
2020-01-31 13:45:15 -06:00
Xiang Xiao
3ae5f52757 Add FAR for pointer type for socket header files 2020-01-31 13:45:15 -06:00
Xiang Xiao
c1b0aa118c Remove psock_send and sockfd_socket from net/socket/socket.h
Since both is already declared in include/nuttx/net/net.h and fix other minor issue in network socket layer.
2020-01-31 13:45:15 -06:00
Xiang Xiao
9f9566c0eb Rename net_clone/net_dupsd[2] to psock_dup2/net_dup[2] like vfs 2020-01-31 13:45:14 -06:00
Gregory Nutt
2def8035db sched/sched/sched_getcpu.c: Implement non-standard interface.
If SMP is enabled this function will return the number of the CPU that the thread is running on.  This is non-standard but follows GLIBC if __GNU_SOURCE is enabled.  The returned CPU number is, however, worthless since it returns the CPU number of the CPU that was executing the task when the function was called.  The application can never know the true CPU number of the CPU tht it is running on since that value is volatile and change change at any time.
2020-01-31 20:25:15 +00: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
Xiang Xiao
affc32c9d1 net/: Fix net checksum related issue
1. Remove the unused and unimplemented ipv6_chksum declaration
2. Update NET_ARCH_CHKSUM description to align with the implementation
3. Declare all checksum function prototype regardless CONFIG_NET_ARCH_CHKSUM
4. Remove the CONFIG_NET_ARCH_CHKSUM guard for tcp_ipv[4|6]_chksum
2020-01-30 07:44:36 -06:00
Gregory Nutt
f27152a1af Fix several coding standard issues in the generic SPI LCD driver. 2020-01-28 12:00:02 -03:00
Dave Marples
e99a8d192d Generic SPI interface for controlling an LCD display 2020-01-28 11:32:35 -03:00
YAMAMOTO Takashi
83354983c3 Fix "with with" typos
In many cases, remove one of them.
In a few places, it looks like a typo of "width" actually.
2020-01-27 08:46:46 +01:00
patacongo
ecb2f99dfb drivers/rwbuffer.c: Fix coding style issues. (#164)
Run .c and .h files affected by PR163 through nxstyle and fix all coding style complaints.

Co-authored-by: Gregory Nutt <gnutt@nuttx.org>
2020-01-25 15:26:42 +01:00
Xiang Xiao
1e3f457c9e Remove TIME_EXTENDED option to more conform C standard
Gregory Nutt <gnutt@nuttx.org>

    Run all .c and .h files modified in this PR through nxstyle and correct all coding standard problems.

Xiang Xiao <xiaoxiang@xiaomi.com>

    Remove TIME_EXTENDED option to more conform C standard

    Note: the code/data size increment is small
2020-01-23 08:17:22 -06:00
Juha Niskanen
a762c06ed9 Fix typos and some incorrect comments
Author: Alan Carvalho de Assis <acassis@gmail.com>

    Run nxstyle against .c and .h files and fix it

Author: Juha Niskanen <juha.niskanen@haltian.com>

    Fix typos and some incorrect comments
2020-01-20 09:32:36 -03:00
cuichaochao
e7b3635a2a include/nuttx/list.h: fix typos 2020-01-18 21:44:07 -06:00
Gregory Nutt
7f888534e3 include/sys/un.h: Remove an incorrect comment and fix some types. Bad comment reported by Junmin Kim <trimind0210@gmail.com> via email. 2020-01-18 15:23:42 -03:00
Oleg
41efa2ae72 drivers/can/can.c: Fix errors with pointers when using internal OS interface (#118)
Author: Gregory Nutt <gnutt@nuttx.org>

    Run all .c and .h files in last PR through tools/nxstyle and correct all coding standard complaints.

Author: Oleg <ev.mipt@gmail.com>

    * Fix CAN driver to work with internal OS interfaces.  Store internal file pointer in f_priv and use it then to distinct readers (See issue #111)
    * Store reader pointer in f_priv instead of filep
    * Don't need in filep in can_reader_s
2020-01-17 09:46:39 -06:00
raiden00pl
e23d58e86d drivers/sensors/lsm303agr: fix compilation warnings and run through nxstyle; drivers/sensors/lsm6dsl: run through nxstyle 2020-01-16 12:27:18 -03:00
Xiang Xiao
5c5c08efcd network: simplify the timeout process logic
1.Consolidate absolute to relative timeout conversion into one place(_net_timedwait)
2.Drive the wait timeout logic by net_timedwait instead of devif_timer
This patch help us remove devif_timer(period tick) to save the power in the future.

Change-Id: I534748a5d767ca6da8a7843c3c2f993ed9ea77d4
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-11 08:24:49 -06:00