Commit Graph

700 Commits

Author SHA1 Message Date
chao.an c709ed2464 tools/Makefile.unix and Makefile.won: In distclean target, unlink the dir after subdir clean
Ensure the linked dir can be clean complete in multi-job case
2020-01-21 08:37:59 -06:00
Xiang Xiao e59f242f88 remove the dup kconfig tweak in configure.sh, testbuild.sh and sethost.sh
Change-Id: I2027b6be55609d8828ff39b568d1f8ddcf333e9a
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-20 08:04:21 -06:00
Xiang Xiao f316c15769 Remove the size related option from sehost.sh and testbuild.sh
to aglin with configure.sh

Change-Id: I42f2621dff72b22ee6c51bd44cc4a1c3d81d128e
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-20 08:04:21 -06:00
Xiang Xiao d0b34dec97 Fix the minor issue found in configure.sh, sethost.sh and testbuild.sh
1.The unused variable
2.The duplicated setting
3.The typo error

Change-Id: I8c129cce78d3e88856f1edcbc2c702c433daa61f
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-20 08:04:21 -06:00
Xiang Xiao bb6c70bdcc Fix the comment header style in tools folder
Change-Id: I189a0e8b86f3af682111668ccdad64a52b48dcb4
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-20 08:04:21 -06:00
liuguo09 bcfb45dfa0 tools/testbuild.sh: kconfig-tweak disable CONFIG_TOOLCHAIN_WINDOWS under linux host (#130)
Make sure kconfig-tweak disables CONFIG_TOOLCHAIN_WINDOWS under linux host, or it would  break the build when using testbuild.sh for some configs.

Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-01-19 14:29:21 +01:00
Gregory Nutt 8b884a027f tools/Makefile.host: Fix several errors for native build
1. Can't pipe uname stderr output to /dev/null.  /dev/null does not exist in the Windows native enviornment.
2. Don't test if CONFIG_WINDOWS_NATIVE is defined.  Tht leads to a "chicken'n'egg" problem:  We need to build configure.c in order to configure the system, but we can't get the CONFIG_WINDOWS_NATIVE until after the system is configured.
3. The default name of the MinGW GCC compiler is mingw32-gcc.exe, not mingw-gcc.exe
2020-01-17 15:56:01 -03:00
patacongo c600f6d6cf tools/Makefile.win and link.bat: Fix for 'make menuconfig' (#117) 2020-01-16 23:12:31 +01:00
patacongo b3fd644f1b tools/configure.bat: Update configure.bat so that it works like configure.sh and integrates properly with configure.c. Also update the README.txt file with a few native build clarifications. 2020-01-16 18:22:36 +01:00
Xiang Xiao bc8edaf6c2 tools/: Remove the hardcode arch/chip list from all tool scripts 2020-01-16 11:11:24 -06:00
Gregory Nutt 177c037aa9 tools/configure.c: Add missing k210 support.
Fix a minor but necessary addition to configure.c for the K210 port that was missed in commit e33fc3dc89
2020-01-16 06:38:59 -03:00
patacongo 0e77e3373e tools/nxstyle.c: Correct false alarm detection (#106)
Commit cf5d17f795 added logic to detect #define pre-processor definitions outside of the "Pre-processor Definitions" file section.  That commit was verified against numerous .c source files.  But not against any .h header files.

When run against a header file, that change causes a false alarm warning like:

  file:line:pos: warning: #define outside of 'Pre-processor Definitions' section

That is caused the idempotence, guard definition that must appear in the header file BEFORE the first file section.

This commit adds logic to nxstyle to ignore pre-processor definitions in header files that occur before the first file section is encountered.
2020-01-15 20:22:37 +00:00
patacongo f00569816f Fix a few errors concerning use of section block comments in .c files: (#95)
1. No .c file should include a "Public Types" section.  Only a header file can define a public type.  A .c file can only define a private type.  Several files contained private type definitions.  The section that they were defined in, however, was incorrectly named "Public Types."  Those were easilty changed to "Private Types" which is what they are.

2. No .c file should include a "Public Function Prototypes" section.  All global function prototypes should be provided via a header file and never declared with a .c file.

For No. 2, I corrected as many cases as was reasonable for the time that I had available.  But there are still a dozen or so .c files that declare "Public Function Prototypes" within a .c file.  This is bad programming style.  These declarations should all be moved to the proper header files.
2020-01-14 00:37:54 +01:00
Gregory Nutt cf5d17f795 tools/nxstyle: Added logic to parse section headers (#90)
* tools/nxstyle:  Added logic to parse section headers (like Included files, Pre-processor Definitions, etc.) and to assure that the section headers are correct for the file type.  Also (1) verify that #include appears only in the 'Included Files' section and that (2) #define only occurs in the Pre-processor definition section.

    Right now, there are several places where that rule is not followed.  I think most of these are acceptable so these failures only generate warnings, not errors.  The warning means that we need to go look at the offending #define or #include and decide if it is a acceptable usage or not.
2020-01-13 18:08:45 +00:00
Xiang Xiao cd544b81b3 checkpatch remove -m 86 option since nxstyle can determine the max line length smart now
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-12 12:54:13 -06:00
Gregory Nutt beae24c8c0 tools/nxstyle.c: Correct indexing error noted by Xaio Xaing in commit comments. 2020-01-12 14:52:48 -03:00
Gregory Nutt 6309165fe0 tools/nxstyle.c: Add automatic detection of line width based on examining
the width of all block comments. Includes a check to assure that all block
comments use the same line width.

Verified against all .c files under /sched.  There were a few cosmetic changes to the coding style under /sched to account to new, correctly detected problems in the /sched files.
2020-01-12 13:07:54 -03:00
liuguo09 1c53d2b616 Nxstyle checkpatch support (#47)
* tools/nxstyle.c: Donot check unknown file extension files

nxstyle only support c soure file and header file check, donot check
other unknown file extension files.

* tools/checkpatch.sh: Add checkpatch.sh script based on nxstyle tool

Usage:
checkpatch.sh patch-list // default as patch list
checkpatch.sh -p patch-list
checkpatch.sh -c commit-list
checkpatch.sh -f file-list
checkpatch.sh - // read from stdin, which used by git pre-commit hook

And git pre-commit hook could use checkpatch.sh as below:
git diff --cached | ./tools/checkpatch.sh -
2020-01-07 08:14:01 -06:00
Xiang Xiao 3b9efc95a2 Format all shell scripts in tools folder
Change-Id: Ieef2eb93d56c03972b4dc63a1c55aabf1fb0d169
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-01-06 00:51:49 +08:00
liuhaitao 7da409f3b5 tools/nxstyle.c: Add -r option to check specified range lines
Usage: ./nxstyle -r start,count filename

nxstyle with -r option used to parse the range lines rather than the whole file.

Change-Id: I58ec56511fde14d6ec914400a7849e69960a3711
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-01-04 07:58:00 -06:00
Xiang Xiao 6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
Xiang Xiao 443255f348 Unify the c++ standard library name to libxx (#19)
libs/libxx/Makefile, and tools/*.mk:  Use common library name libxx.a, regardless of which libc++ library is selected.
2019-12-31 10:28:48 -06:00
Masayuki Ishikawa e33fc3dc89 Squashed commit of the following:
Author: Gregory Nutt <gnutt@nuttx.org>

    Run all .c and .h modified in PR through nxstyle.

Author: Masayuki Ishikawa <masayuki.ishikawa@gmail.com>

    feature k210 (#16)

    * arch: risc-v: Add support for __LP64__ to types.h
    * arch: risc-v: Add support for RV64GC to common files
    * arch: risc-v: Add support for Kendryte K210 processor (RV64GC)
    * boards: risk-v: Add support for Sipeed Maix Bit with K210
    * tools: Add support for Kendryte K210 processor
2019-12-31 09:06:20 -06:00
David Sidrane 002772c81e nxstyle improvements with No tooling (#12)
tools/nxstyle.c:  Output compiler like error format.  Added features

   Uses getops to pars command line.
   Supports
      -s silence all output
      -g provide a PASS fail message

* tools/README.txt:  Update with new nxstyle options
2019-12-30 21:01:41 -06:00
Xinhe Zhou 25b788a9ed fs/vfs/fs_open.c: Fix error in nx_vopen() function. 'va_start' is used in function with fixed args. 'va_start'/'va_end' should not be used in nx_vopen function, because it has fixed arguments. 2019-12-14 07:38:36 -06:00
Gregory Nutt 10b8c01abf tools/Makefile.unix: Fix a logic error in 3e4450e237. 2019-12-13 12:43:44 -06:00
Gregory Nutt 3e4450e237 tools/Makefile.unix and .win: Back out part of 1c91aec6ae (tools/ and fs/procfs: Simplify .version file generation). That change breaks the build if not in a git clone. noted by Nathan Hartman. 2019-12-13 12:34:17 -06:00
anchao 1c91aec6ae tools/ and fs/procfs: Simplify .version file generation
1.merge CONFIG_GIT_REVISION_STR into CONFIG_VERSION_BUILD
2.merge gen_getrev.sh into version.sh
3.generate version number if needed

Here is a sample output:
nsh> uname -a
NuttX  8.2 59fd8e12d3-dirty Dec 12 2019 15:48:00 sim sim
nsh> cat /proc/version
NuttX version 8.2 59fd8e12d3-dirty Dec 12 2019 15:48:01
2019-12-12 11:17:11 -06:00
Nathan Hartman 9655730ef8 Fix various typos and spelling errors. 2019-12-12 07:41:51 -06:00
Gregory Nutt 897378bc29 Remove support for generation of RRLOAD binary files. The RRLOAD binary format was used with Linux BSPs from www.ridgerun.com circa 2000-2001. It is still need by the the c5471 board if that bootloader is used. Removes the CONFIG_RRLOAD_BINARY option and tools/mkimage.sh
This change was motivated by the presence of the mkimage.sh file under tools.  That is the tool that created the RRLOAD binary format.  That bash script has a GPL license and, hence, may not be included in an Apache-licensed project.
2019-12-09 11:29:12 -06:00
Gregory Nutt 504b0e8b5b drivers/wireless: Run all wireless drivers through tools/nxstyle, correcting as many complaints as possible. 2019-12-05 11:49:12 -06:00
Gregory Nutt f109c5b99c Numerous changes to last PR to conform to the NuttX coding standard. 2019-12-03 16:46:12 -06:00
Alin Jerpelea 338bc46f5e Merged in alinjerpelea/nuttx (pull request #1088)
add mkspk tool for cxd56 devices

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-12-03 22:17:31 +00:00
Gregory Nutt d87295f328 tools/Directories.mk, Makefile.*: Extend the clean_context target so that it will remove the autogenerated files created during the context phase of the initial build. 2019-12-03 06:38:53 -06:00
Gregory Nutt d2af57169b tools/nxstyle.c: Fix a rare false alarm that could occur if a variable or function name begins with the sub-string 'union' or 'struct'. misc fixes under fs/ and sched/ from application of current version of nxstyle. 2019-12-01 13:01:16 -06:00
Gregory Nutt 91d04837e9 tools/nxstyle.c: Eliminate some false alarms related to comments to the right of code about alignment and spacing. 2019-12-01 11:37:30 -06:00
Gregory Nutt 6b66ac0e04 Some minor changes from review of last PR. 2019-11-28 14:45:16 -06:00
Masayuki Ishikawa 7a8e9581ca Merged in masayuki2009/nuttx.nuttx/hifive1-qemu (pull request #1078)
HiFive1 with qemu

* arch: risc-v: Add include/.gitignore

* arch: risc-v: Add src/.gitignore

* arch: risc-v: Remove uncommon function prototypes in include/irq.h

* arch: risc-v: Add missing symbols and function prototypes in src/common/up_internal.h

* arch: risc-v: Add src/common/up_modifyreg32.c

* arch: risc-v: Enable include Make.dep in src/Makefile

* arch: risc-v: Fix stack coloration in common/up_createstack.c

* arch: risc-v: Add common/up_puts.c

* arch: risc-v: Add common/up_checkstack.c

* arch: rv32im: Move all logics from up_dumpstate.c to up_assert.c

    This change is same as other architectures like arm/src/armv7-m

* arch: Select ARCH_HAVE_STACKCHECK for RISC-V in Kconfig

* arch: risc-v: Add SiFive fe310 processor

    NOTE: Currently only tested with qemu

* boards: hifive1-revb: Add SiFive hifive1-revb board

    NOTE: Currently only tested with qemu

* tools: Add fe310 processor to configure.sh

Approved-by: Alan Carvalho de Assis <acassis@gmail.com>
Approved-by: Gregory Nutt <gnutt@nuttx.org>
2019-11-28 20:37:24 +00:00
Matias N 1a56fefb9f tools/configure.sh and configure.c: Debug option now also shows make olddefconfig output. 2019-11-23 14:47:59 -06:00
Gregory Nutt 8bc55d4396 tools/nxstyle.c: Trivial improvement to preceding change to allow white space separation. 2019-11-19 11:43:20 -06:00
Gregory Nutt f3c2022b4e tools/nxstyle: Fix false alarm 'Garbage follows right bracket' on named structures that are fields of other structures or unions. 2019-11-19 11:32:57 -06:00
Gregory Nutt a9ef2b4208 tools/nxstyle.c: Eliminate false positive 'Invalid character after asterisk in comment block'. 2019-11-09 12:10:43 -06:00
Matias Nitsche e118d99bf5 drivers/power/pm: Historically, the NuttX PM subsystem has consisted of two functional components: (1) an "Upper" part that detects state changes based on a random walk driven by activity levels, and (2) and "lower" part that implementst the state changes.
This change decouples that upper activity-based logic from the lower random walk logic and allows use of other upper state detection logic (such as a custom, application-specific state machine).
2019-11-09 09:09:33 -06:00
Gregory Nutt 2ab4d635b4 tools/nxstyle.c: Correct detection of missing blank line following a block comment. 2019-11-09 08:15:12 -06:00
Guiding Li 8b92305265 This commit brings in the drivers needed to support OpenAMP. These changes were ported from https://github.com/FishsemiCode/nuttx. The current state: Most drivers do now compile but are not yet verfied.
This port was effort of a number of people, I rather arbitrarily gave authorship to Guiding Li because he has the largest number of fundamental quashed commits from the Xiamoi repository.

Squashed commit of the following:

Author: Xiang Xiao <xiaoxiang@pinecone.net>
    include/nuttx/b2c.h and libx/libc/string:  Add non-standard string functions to deal with cases where there are more than 8-bits in a type char.

Author: Gregory Nutt <gnutt@nuttx.org>
    Fix several build issues/missing definitiona needed for OpenAMP build in drivers/.
    Add OpenAMP code has been reviewed and ran through tools/nxstyle (with all reports accounted for).

Author: Xiang Xiao <xiaoxiang@xiaomi.com>
    tools/:  Fix the minor issue in Makefile

Author: Gregory Nutt <gnutt@nuttx.org>
    drivers/rptun/rptun.c:  Review for coding standard.  Run against tools/nxstyle.
    tools/LibTargets.mk:  Fix some TABs that were turned into spaces by a copy-paste.
    fs/hostfs:  Add configure and build support for hostfs RPC.
    drivers/timer:  Add configure and build support for syslog RTC.
    drivers/syslog:  Add configure and build support for syslog RPC.
    drivers/serial:  Add configure and build support for serial RPC.
    Kconfig, tools/*.mk. openamp/:  Add basic OpenAMP build support.
    drivers/rptun:  Add configure and build support for OpenAMP tunnel drivers.
    drivers/net:  Update Make.defs and Kconfig for OpenSDA support.
    Remove drivers/clk/clk-rpmsg.c drivers/power/rpmsg_regulator.c.  These depend on upstreaming support for a new subsystem based on the clk/regulator is model from Linux.  Removed because we want to separate the activities.  We will just try to get the basic OpenAMP support in place for now.
    Remove drivers/misc/misc_rpmsg.c and include/nuttx/misc/misc_rpmsg.h.  These are specific to the Xiaomi application.

Author: zhuyanlin <zhuyanlin@pinecone.net>
    This commit brings in the OpenAMP OS driver/RPC components from https://github.com/FishsemiCode/nuttx.  Initial commit is source files only.  Additional changes to Kconfig and Make.defs files still needed.

Author: Jianli Dong <dongjianli@pinecone.net>
    This commit brings in the OpenAMP OS driver/RPC components from https://github.com/FishsemiCode/nuttx.  Initial commit is source files only.  Additional changes to Kconfig and Make.defs files still needed.

Author: Guiding Li <liguiding@pinecone.net>
    This commit brings in the OpenAMP OS driver/RPC components from https://github.com/FishsemiCode/nuttx.  Initial commit is source files only.  Additional changes to Kconfig and Make.defs files still needed.
2019-11-02 11:30:33 -06:00
Gregory Nutt ad9dc2b608 tools/nxstyle.c: Eliminate false alarms when checking for alignment of comments to the right of code. Fix check for C++ style comments so that strings like http:// and https:// do not generate false alarms. 2019-10-27 11:45:33 -06:00
Gregory Nutt a4997d6a2c tools/nxstyle.c: Eliminate false alarm errors on comments that are to the right of code when the comment terminator is on the same line as the last of the comment. 2019-10-25 12:34:42 -06:00
Gregory Nutt b5111d2c38 tools/nxstyle.c: Add logic to detect if there is a blank line following the final right brace. sched/: Applied the modified nxstyle to all C file as a test. 2019-10-24 11:02:42 -06:00
Gregory Nutt 005a8a606f tools/nxstyle.c: Add detection of carriage returns. Improve reporting of TABs. 2019-10-23 12:49:27 -06:00
Gregory Nutt d6b4e90d70 arch/arm/src/s32k1xx: Support configuration and initialization of the flash configuration bytes. boards/arm/s32k1xx/s32k1**evb/scripts/flash.ld: Create a special FLASH section to hold the FLASH configuration bytes. 2019-10-19 13:14:02 -06:00