Commit Graph

36792 Commits

Author SHA1 Message Date
Gregory Nutt
621151a523 Fix some macOS sim warnings.
These warnings fix a class of warnings that I saw during CI checks for macOS sim builds.  For example:

    devif/devif_callback.c:111:49: warning: for loop has empty body [-Wempty-body]
                   prev = curr, curr = curr->nxtdev);
                                                    ^
    devif/devif_callback.c:111:49: note: put the semicolon on a separate line to silence this warning

I did not put the semi-colon on a separate line, but used braces.
2020-04-11 22:27:42 +01:00
Gregory Nutt
8b87baa714 Update README.txt files for boards using SDCC
Modified boards/z80/z180/p112/README.txt and boards/z80/z80/z80sim/README.txt:

IMPORTANT NOTE as of 2020-4-11:  Support for CONFIG_CAN_PASS_STRUCTS was removed in NuttX-9.1.  This was necessary to enforce some POSIX interface compliance but also means that ALL older SDCC versions will no long build with NuttX.  I have been told that the newest SDCC compilers can indeed pass structure and union parameters and return values.  If that is correct, then perhaps the newer SDCC compilers will be used.  Otherwise, it will be necessary to use some other, more compliant compiler.
2020-04-11 21:19:47 +01: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
Şükrü Bahadır Arslan
554d56b875 sched/sched_setpriority.c: DEBUGVERIFY, not DEBUGASSERT.
Hello,
I am testing priority inversion feauture of Nuttx scheduler. I encounter with problem in tests.
Here is problem:
nxsched_readytorun_setpriority() function not works as expected when DEBUG_ASSERTION not enabled. Because sched_removereadytorun() and sched_addreadytorun()  is not called in this case. These functions wrapped with DEBUGASSERT macro and with the effect of DEBUGASSERT macro, sched_removereadytorun() and sched_addreadytorun() not called when DEBUG_ASSERTION not enabled. Therefore priority inversion not works as expected.

Could you check this problem ? Is this a bug, if not what is the purpose of this code ?
Thanks,
Şükrü Bahadır Arslan
2020-04-11 17:30:17 +01:00
liuhaitao
2427febba9 tools/testbuild.sh: add -e option to append extra c/c++ flags build support
Call 'tools/testbuild.sh -e -Wno-cpp testlist' would pass "EXTRAFLAGS=-Wno-cpp"
to make command line. Then it could suppress the warnings with pre-processor
directive #warning in GCC.

Change-Id: I61e5f9b3774149f64bdd625677cc9aabaa2fea90
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-11 08:31:08 -06:00
liuhaitao
459ad99373 Use EXTRAFLAGS instead of EXTRADEFINES to be used by make via command line
So call 'make EXTRAFLAGS=-Wno-cpp' could suppress the warnings with pre-processor
directive #warning in GCC.

Change-Id: Iaa618238924c9969bf91db22117b39e6d2fc9bb6
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-11 08:31:08 -06:00
John Rippetoe
2f54204035 Fixed some nxstyle errors 2020-04-11 13:53:20 +08:00
John Rippetoe
acb16e087a Fixes build issues associated with ARMv7-m mpu support files.
- inline functions within mpu.h converted to macros or moved to up_mpu.c
- mpu.h and up_mpu.c are now conditionally included in build via CONFIG_ARM_MPU

Chips affected by these changes
- imxrt
- kinetis
- lpc17xx
- lpc43xx
- lpc54xx
- sam34
- stm32
- stm32f7
- stm32h7
- stm32l4
- tiva
- xmc4
2020-04-11 13:53:20 +08: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
369a0fa4fb netlink: all request to NETLINK_ROUTE should use rtgenmsg
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib7a05dbf08277f56882e19a886a12a153889ca38
2020-04-10 08:18:07 -06:00
Xiang Xiao
70012bc4a2 netlink: Remove netlink_route_recvfrom
The same functionality could be implemented in the common place(netlink_recvfrom)

Change-Id: I8aedb29c4f0572f020ca5c0775f06c5e1e17ae4a
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-10 08:18:07 -06:00
Xiang Xiao
16dbe373c0 netlink: Implement netlink_connect and netlink_getpeername
and refine netlink_bind and netlink_send implmentation

Change-Id: I2b3e7980eac01dc42927cfaa0a64874df52d6bf5
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
Xiang Xiao
e6c30629a1 netlink: Return -EBUSY if some notifier was setup in netlink_notifier_setup
Change-Id: I62d036bb43420934efbf0e9b990ca2cf3dd0b2e5
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-10 08:18:07 -06:00
Xiang Xiao
3421ec90b4 netlink: Shouldn't call netlink_notify_response in netlink_poll
to avoid sleep inside netlink_poll

Change-Id: Id801c2dae805455a9b91f2e091d001679f0b3d4b
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-04-10 08:18:07 -06:00
Xiang Xiao
9fb6eee5fe netlink: Remove the unused netlink_active
Change-Id: I976b3fbab033baa4eaec35f8f443d4eb971db142
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
ligd
78eb9f73dd mm/mm_heap/mm_sem.c: add getpid() return check in mm_trysemaphore()
Change-Id: Ifd56e3ccc22cf0a50f52e643b7a87aab0d0dca06
Signed-off-by: ligd <liguiding@fishsemi.com>
2020-04-09 10:29:28 -06:00
NicoMayer
afe08b666c
boards/arm/stm32/nucleo-f429zi: Port Nuttx to Nucleo-F429zi (#752)
* boards/arm/stm32/nucleo-f429zi: Initial port to nucleo-f429zi board.

* boards/arm/stm32/nucleo-f429zi: Add two demo configs.

* Add the nucleo-f429zi to boards/Kconfig

boards/Kcondig: Fixed line alignment issue.

* boards/arm/stm32/nucleo-f429zi: Change the license header of all new files to an Apache 2.0 license.

* boards/arm/stm32/nucleo-f429zi: nxstyle fixed
2020-04-09 03:59:57 -07:00
YAMAMOTO Takashi
9c14b9c6e0 CI: Add macOS builds
This is a sync from testing repo.
2020-04-09 14:59:58 +08:00
Brennan Ashton
ce3a23712c Add missing entries into LICENSE and NOTICE files
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-04-09 14:59:36 +08:00
YAMAMOTO Takashi
dfe11b58d7 CI: sync with testing repo
Namely the following commit:

    commit 29f2116356451ee3430332df28b953f76da2d284
    Author: YAMAMOTO Takashi <yamamoto@midokura.com>
    Date:   Fri Apr 3 13:56:42 2020 +0900

        Use testbuild -G ("git clean" instead of "make distclean")
2020-04-08 22:10:19 -07:00
Abdelatif Guettouche
398175b2ae
tools/zipme.sh: Add the possibility to PGP sign the final tarballs. (#756)
* tools/zipme.sh: Add the possibility to PGP sign the final tarballs.
* tools/README.txt: Update the file to add zipme.sh's new commands.
2020-04-08 17:31:22 -06:00
Alin Jerpelea
425e6c28dc
arch: xtensa: esp32: nxstyle fixes (#753)
esp32 nxstyle fixes

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-04-08 08:28:17 -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
9c7841aff1 boards/sim/sim/sim/configs/ostest: Enable cancellation tests. 2020-04-07 19:59:13 +01:00
Ouss4
13f0442b63 tools/zipme.sh: Improve the tool to make it usuable from a development repo
and for future Apache releases.

 - Rename the final tarball to add incubating and apache to their names

 - Make the tool usuable from a development repo.

 - Add a list of patterns(files and folders) to exclude and
a command line argument to pass aditional patterns.

 - Add a command to run silently.

 - If the build number was not provided let version.sh figure it out.
2020-04-07 11:14:18 -06:00
Gregory Nutt
f2e6e131d4 include/nuttx/wdog.h: Add some additional comments. 2020-04-07 17:40:46 +01:00
Alin Jerpelea
402fb16a77 arch: arm: cxd56xx: nxstyle fixes
nxstyle fixes for cxd56xx

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-04-07 07:27:41 -06:00
Nakamura, Yuuichi
9029e4daee Fix nxstyle issues 2020-04-07 06:23:15 -06:00
Nakamura, Yuuichi
e264484c16 Remove type casting to wdentry_t (arch/) 2020-04-07 06:23:15 -06:00
Nakamura, Yuuichi
2ca9681b00 Remove type casting to wdentry_t (boards/) 2020-04-07 06:23:15 -06:00
Nakamura, Yuuichi
776e469b02 Remove type casting to wdentry_t (drivers/) 2020-04-07 06:23:15 -06:00
Nakamura, Yuuichi
3cc336dddd Remove type casting to wdentry_t (sched/) 2020-04-07 06:23:15 -06:00
Gregory Nutt
81b286d375 Fix some long single line comments.
This commit fixes some long single line comments.  This effort was primarily intended to verify the change to tools/nxstyle of PR #743 further.  This took the files changed with 1501d284c3 and ran them through nxstyle again.  The files in the commit previously passed the old nxstyle test with no complaints.  The current nxstyle, on the other hand, reported 49 long single line comments.  Each of those were verified and the file was updated.  The nxstyle change appears completely reliable.
2020-04-06 22:04:38 +01:00
Gregory Nutt
58589db931 tools/nxstyle.c: Fix detection of long single line comments.
This resolves issue 718:  nxstyle line width check was ignoring the line width check for single line comments.

This turned out to be an artifact in parsing.  Usually when parsing character by character, the file character to be parsed was '/n'.  Howefver, in the case of parsing single line comments, the final character was the NUL terminator.  This means that the lenth check was not being performed in the case of single line comments.

NOTE:  Currently, I have suppressed error reports for single line right-hand comments.  My fear is that this will unmask more standard violations than we can cope with.  It is easy to re-enable and perhaps we should do that in the future:

          /* Check for long lines
           *
           * REVISIT:  Long line checks suppressed on right hand comments
           * for now.  This just prevents a large number of difficult-to-
           * fix complaints that we would have otherwise.
           */

          if (m > g_maxline && !rhcomment)  <-- remote the second condition
2020-04-06 19:47:57 +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
Alin Jerpelea
c78bd930b5 arch: arm: sxd56xx: nxstyle fixes
Fix nxstyle complains

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2020-04-06 20:49:54 +08:00
YAMAMOTO Takashi
70b1b51ac9 modlib.h: Improve comments 2020-04-06 12:35:02 +08:00
Gregory Nutt
a48c784cc4 sched/pthread_cond[timed]wait.c: return special mutex state.
A mutex may be configured with rather exotic options such as recursive, unsafe, etc.  The availability of these mutex options is controlled by configuation settings.  When each option is enabled, additional fields are managed inside of the mutex structure.

pthread_cond_wait() and pthread_timed_wait() do the following atomically:  (1) unlock the mutex, (2) wait for the condition, and (3) restore the mutex lock.  When that lock is restored, pthread_cond_[timed]wait() must also restore the exact configuration of the mutex data structure if these "exotic" features are enabled.
2020-04-06 00:13:05 +01:00
Gregory Nutt
64b398f4c6 sched/pthread/pthread_condwait.c: Fix cancellation bug.
Now that nxsem_wait_uninterruptible() returns an error when the thread is canceled, new logic is being executed.  This revealed an existing error in pthread_cond_wait().  The nature of the error is as follows:

* pthread_cond_wait() must atomically (1) release the mutex, (2) wait on the condition, and (3) re-establish the mutex.  Errors can occur on any of these steps.  In this case the ECANCELED error was (very correctly) reported by nxsem_wait_uninterruptible().

* However, logic in step (3) had a bug; it re-acquired the mutex, but then a bug in existing logic cause the mutex to be improperly initialized.  Essentially, the wrong error status value was being testing.  This resulted in a nonsequitar and errors reported by the OS test.

This problem was found by apps/testing/ostest/pthread_cleanup.c
2020-04-05 22:37:24 +01:00
Nathan Hartman
679b4fbee2 arch: Fix included directed -> included directly
This typo had been copied and pasted into numerous irq and syscall
headers.
2020-04-05 22:31:15 +01:00
Ouss4
a5c619c207 arch/arm/src/cxd56xx/cxd56_emmc.c: Don't wait for the semaphore if the
task was canceled.
2020-04-05 15:02:23 -06:00
Ouss4
dda47dd4a9 Check return from nxsem_wait_uninterruptible()
This commits is for the remaining files in arch/arm/src/cxd56xx
  arch/arm/src/imxrt and arch/arm/src/stm32l4
2020-04-05 12:26:45 -06:00
Gregory Nutt
5d123098b8 Check return from nxsem_wait_uninterruptible()
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 for all remaining drivers in the LC823450 architectures.
2020-04-05 18:18:25 +01:00