Commit Graph

4462 Commits

Author SHA1 Message Date
Xiang Xiao
bd39813883 netlink: Add netlink_add_broadcast function
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I1bee7933dca1bdd118d0034a564b4306e1ae5684
2020-04-16 17:40:03 +08:00
chao.an
bd4bccbe27 netlink: add netlink multicast group define
Change-Id: I0cedbee311f83320ba396a1004e12075e835cccf
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-04-16 17:39:06 +08:00
zhongan
987472d3bb syslog/rpmsg: remove unused local variable 'g_syslog_rpmsg_channel' which would cause build break.
Change-Id: Ie02ef9202ec2a9ecade62c47e4f8956adb96673f
Signed-off-by: zhongan <zhongan@xiaomi.com>
2020-04-15 12:30:50 -03:00
Nakamura, Yuuichi
bdf871a214 Fix syscall number definition 2020-04-15 13:10:27 +08:00
Gregory Nutt
d893d78d90 Fix typo.
Fix a typo noted in the comments to PR 777
2020-04-13 19:03:22 +01:00
Xiang Xiao
d3c4879113 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-13 12:01:39 -06:00
YAMAMOTO Takashi
716f529bae Fix nxstyle complaints 2020-04-13 09:50:32 -06:00
YAMAMOTO Takashi
87f2e578ac Fix typos in comments 2020-04-13 09:50:32 -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
72104c182c nxstyle fixes
Run all files modified by PR 766 through nxstyle and fix any resulting complaints.

NOTE:  Numerous "Mixed case identifier" errors in arch/arm/src/cxd56xx/cxd56_gnss.c were not fixed because this problem is of much larger scope than this file.
2020-04-11 21:19:47 +01:00
Gregory Nutt
67ec3d7926 Remove CONFIG_CAN_PASS_STRUCT
This commit resolves issue #620:

Remove CONFIG_CAN_PASS_STRUCTS #620

The configuration option CONFIG_CAN_PASS_STRUCTS was added many years ago to support an old version of the SDCC compiler. That compiler is currently used only with the Z80 and Z180 targets. The limitation of that old compiler was that it could not pass structures or unions as either inputs or outputs. For example:

    #ifdef CONFIG_CAN_PASS_STRUCTS
    struct mallinfo mallinfo(void);
    #else
    int      mallinfo(FAR struct mallinfo *info);
    #endif

And even leads to violation of a few POSIX interfaces like:

    #ifdef CONFIG_CAN_PASS_STRUCTS
    int  sigqueue(int pid, int signo, union sigval value);
    #else
    int  sigqueue(int pid, int signo, FAR void *sival_ptr);
    #endif

This breaks the 1st INVIOLABLES rule:

Strict POSIX compliance
-----------------------

  o Strict conformance to the portable standard OS interface as defined at
    OpenGroup.org.
  o A deeply embedded system requires some special support.  Special
    support must be minimized.
  o The portable interface must never be compromised only for the sake of
    expediency.
  o Expediency or even improved performance are not justifications for
   violation of the strict POSIX interface

Also, it appears that the current SDCC compilers have resolve this issue and so, perhaps, this is no longer a problem: z88dk/z88dk#1132

NOTE:  This commit cannot pass the PR checks because it depends on matching changes to the apps/ directory.
2020-04-11 21:19:47 +01:00
Xiang Xiao
581dbb22fe netlink: Fix nxstyle issue
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-10 08:18:07 -06:00
Xiang Xiao
5708015674 netlink: Sync the macro with Linux definition
Change-Id: I0c0895fa17e167c67fb12acfdfc6dc3a7fb63b3b
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-10 08:18:07 -06:00
ligd
ef360394c7 mm/mm_heap: fix mm_heap not support BUILD_FLAT
1. change ifdef __KERNEL__ to:
   if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)

2. change mm_delaylist to *mm_delaylist

3. change FAR struct mm_delaynode_s *new to:
   FAR struct mm_delaynode_s *tmp

4. should check mm_trysemaphore() return values

Change-Id: I57ba991f13c3eaf56dc2d71ac946c11669e32dfa
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-10 07:49:32 -06:00
ligd
cbf31bca5c global change: fix tools/checkpatch.sh warnnings
Change-Id: I88cfa979c44bcaf3a8f6e036c6bfccd3402ca85a
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
ligd
231ad202ee global change: repace sched_xfree() to kxmm_free()
Changes:
sched_xfree() => kxmm_free()
remove garbage related APIs
remove ARCH_HAVE_GARBAGE

Cause garbage feature move to mm_heap, then don't need
garbage anymore.

Change-Id: If310790a3208155ca8ab319e8d038cb6ff92c518
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
ligd
cec53bb133 include/nuttx/mm/mm.h: fix MM_IS_ALLOCATED(n) define error
Change-Id: Iceba05c2114813f34bdd6a8a2c59c372c9889f10
2020-04-09 10:29:28 -06:00
ligd
1d2396353e mm/mm_heap: add mm_delaylist to mm_heap_s struct
Change-Id: I2ffaec5557bf2dd2021baa6cda84bb5318425caa
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
hartmannathan
bfc153ca27
Fix typos in comments and documentation (#750)
* Fix typos in comments and documentation
2020-04-08 06:45:35 -06:00
Gregory Nutt
f2e6e131d4 include/nuttx/wdog.h: Add some additional comments. 2020-04-07 17:40:46 +01:00
Gregory Nutt
f9a7417be4 include/nuttx/semaphore.h: Add a NOTE to the uninterruptible wait functions. 2020-04-06 17:08:46 +01:00
YAMAMOTO Takashi
70b1b51ac9 modlib.h: Improve comments 2020-04-06 12:35:02 +08:00
Gregory Nutt
89578b3a89 nxsem_wait_uninterruptble: Now returns if the task is canceled.
See Issue 619.

Also removed inline functions from include/nuttx/semaphore.h.  They just cause too many problems.
2020-04-05 18:10:32 +01:00
Gregory Nutt
a6e69a82ad SDIO: Make interface field names conform to standard.
The SDIO interface structure includes fields with names like recvR1 and others.  These cause "Mixed case identifier" errors from nxstyle in all places they are uses.
This change performs a mass substition of recvR with recv_r to correct this coding standard violation.
2020-04-04 18:15:25 +01:00
raiden00pl
abfb074110 libs/libdsp: fix nxstyle issues 2020-04-03 22:51:39 +01:00
chao.an
55907b0062 netlink: fix nxstyle warning
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-04-03 10:33:31 +02:00
chao.an
9a9d76744b netlink: add NLMSG_OK definition
Change-Id: I4ab4cabd1e6950802eda360d972d2ef5cea30da2
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-04-03 10:33:31 +02:00
chao.an
80c90399e6 netlink: fix typo
Change-Id: Ic4e44374945c925b880ba4058f795317f2816107
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-04-03 10:33:31 +02:00
Nakamura, Yuuichi
d7352eb855 fix long line comment 2020-04-02 22:08:41 +08:00
Nakamura, Yuuichi
9aee1407f1 fix INTPTR_MAX define 2020-04-02 22:08:41 +08:00
Xiang Xiao
0b662d60fc libc/netdb: Add hostent_s to avoid the change of hostent
and let other function call the new internal function gethostentbyname_r

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic6137d6cf03f75d6ed33e23bf04ae74b7264e682
2020-04-01 16:09:28 -06:00
Xiang Xiao
8d66a316da libc/netdb: Support save the mix of IPv4/IPv6 address into hostent
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I704d38afde14b6d90a7726096fd1f483f96ba237
2020-04-01 16:09:28 -06:00
Alan Carvalho de Assis
c6b01c321c
Check return from nxsem_wait_initialize() (#661)
* 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 drivers/eeprom.
2020-03-30 20:59:47 -06: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
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
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
YAMAMOTO Takashi
27aa16111c sim: hostfs: Stop assuming CONFIG_NAME_MAX=32 2020-03-25 20:31:32 -06:00
YAMAMOTO Takashi
c65bdde5ac include/nuttx/fs/hostfs.h: Appease nxstyle errors 2020-03-25 20:31:32 -06: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
d22b22a23f syscall/: Remove support for CONFIG_FS_READABLE 2020-03-22 08:24:07 -05:00
Gregory Nutt
74ce4ab0ee include/: Remove support for CONFIG_FS_WRITABLE 2020-03-22 08:24:07 -05:00
Andrey Zabolotnyi
73b655f3b2
stm32h7_qspi: support for custom clock (not just HCLK) and support for DUAL/QUAD commands (#582)
* stm32h7_qspi: Board.h now may define the BOARD_QSPI_CLK macro to select one of
RCC_D1CCIPR_QSPISEL_{HCLK,PLL1,PLL2,PER} clocks to use with QUADSPI peripherial.
Defaults to HCLK for backward compatibility.
New macros in qspi.h: QSPICMD_IDUAL and QSPICMD_IQUAD for selecting the bit
width for instruction code (1,2 or 4 bits) of a qspi_cmdinfo_s, and
QSPIMEM_IDUAL and QSPIMEM_IQUAD for selecting the bit width of a qspi_meminfo_s.

* NX style fixes
2020-03-19 05:59:18 -07:00
Nathan Hartman
a5e643b0cd Fix typos in comments and documentation. 2020-03-16 20:01:11 -06:00
YAMAMOTO Takashi
061b796d47 Adapt dlfcn/modlib to use the instruction memory allocator 2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
855751b534 Introduce instruction memory allocator
Necessary for dlfcn etc on ESP32, which has separate memory regions
for instruction and data.

known issues/todo
 * consider something similar to dual heaps for PROTOECTED
 * consider to adapt binfmt as well
2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
d624434282 include/elf.h: Add EM_XTENSA 2020-03-16 07:54:49 -06:00
YAMAMOTO Takashi
39725109fa include/nuttx/compiler.h: Fix a C99 check
The lack of __STDC_VERSION__ means we don't have C99.
2020-03-11 03:56:39 -05:00
YAMAMOTO Takashi
14d037b8d5 include/nuttx/compiler.h: Appease nxstyle errors 2020-03-11 01:14:15 -05:00
Pelle Windestam
1d3afe943a include/nuttx/analog/ads1242.h: fix nxstyle warnings 2020-03-10 07:20:38 -06:00