Commit Graph

704 Commits

Author SHA1 Message Date
liuhaitao
a21d6b884e libc: correct zoneinfo genromfs source directory
Or genromfs failed to generate the right romfs.img

Change-Id: Icbcc2e89da1ede644b994d33e70f1a48662c412b
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2021-04-06 08:12:00 -03:00
Xiang Xiao
39fc9325cf arch/arm: Replace "b lr" or "mov pc, lr" with "bx lr"
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-04-05 05:50:14 -07:00
Xiang Xiao
dd1d980c3a arch/sim: Move setjmp/longjmp to libc/machine/sim
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-04-05 09:00:42 -03:00
Alin Jerpelea
7c8c6785ca NuttX: NX Engineering, S.A: update licenses to Apache
NX Engineering, S.A has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-05 06:07:48 -05:00
Xiang Xiao
d62ae03bf8 arch: Move setjmp/longjmp to libc/machine
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-04-04 16:30:37 -07:00
Gregory Nutt
a0f9da20a2 getopt(): Update comments about missing functionality
Per the Linux man page, "By default, getopt() permutes the contents of argv as it scans, so that eventually all the nonoptions are at the end."  This behavior, however, is not implemented in the NuttX getopt() logic.
2021-04-04 22:31:47 +01:00
Gregory Nutt
7de43596da getopt_long(): Add support for required argument format
The Linux man page requires that the getopt_long() and getopt_long_only() functions accept arguments to options in a form like:

    --option=argument

This PR adds that missing functionality.

This change effects only getopt_long() and getopt_long_only()

Tested on a simulator NSH configuration with a modified version of the getopt() test in apps/testing/ostest.
2021-04-04 14:13:42 -05:00
Gregory Nutt
1b4af6e90d getopt_commont(): Add some comments
Add a trivial comment about handling in certain corner cases where I am not certain what the correct behavior should be.
2021-04-04 10:55:00 -05:00
Gregory Nutt
7e1ae24c3c getopt_common(): Correct handling of unsupported long options.
If an unrecognized long option is encountered, we must skip over that argv[] entry or getopt_long() will seriously misbehave.

Affects getopt_long() and getopt_long_only()

Problem found and fix verified with an updated version of the OS test.
2021-04-04 07:15:10 -05:00
Gregory Nutt
6c507730bd Fix Use of Variable before NULL check
Found a place in getopt_common() where the option string is used before it is checked if it is NULL.  This can happen because the short option string is optional for getopt_long() and getopt_long_only()

If optstring is NULL, that would be an ERROR for getopt(), but not for the getopt_long() versions.

Should effect only the getopt() APIs

Tested on the simulator using apps/testing/ostest.
2021-04-03 18:23:35 +01:00
Alin Jerpelea
26fef3f6a1 NuttX: Fix nxtyle errors
Fix errors reported by nxstyle

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-03 04:20:31 -07:00
Alin Jerpelea
08e5378b11 NuttX: Gregory Nutt: update licenses to Apache
Several licenses were missed in the initial work

David Sidrane has submitted the ICLA and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-03 04:20:31 -07:00
Gregory Nutt
af3c76bb53 Correct some getopt() logic
1. Null pointer dereference:

-  for (ndx = 0; longopts[ndx].name[0] != '\0'; ndx++)
+  for (ndx = 0; longopts[ndx].name != NULL; ndx++)

2. Handle single character long options.  An option like -x could be either a short option or a long option (under getopt_long_only()).  This case was not being handled correctly.

3. Add missing support for optional arguments to short options (indicated with two "::"

This effects all members of the getopt() family of APIs.

Tested on the simulator using extensions to apps/testing/ostest.
2021-04-02 21:31:02 +01:00
Alin Jerpelea
b7c451c5a4 libs: Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-02 11:12:25 -05:00
Alin Jerpelea
d3313eeae9 libs: libc: lib_vikmemcpy.c: Mixed case identifier fix
fix Mixed case identifier reported by nxstyle

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-02 11:12:25 -05:00
Alin Jerpelea
ed8e5e971b libs: fix nxstyle errors
fix erros reported by nxstyle

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-02 11:12:25 -05:00
wangshuo
84d4458a8a libc/uio: fix typos 2021-04-02 08:49:53 -05:00
Gregory Nutt
a930b05d22 Implement getopt_long() and getopt_long_only()
Add implementations of getopt_long() and getopt_long_only()

There could be impacts to getop() since that implementation is shared withe new getopts_long() and getops_long_only() implementation.

Tested using a modified version of sim:nsh
2021-04-01 23:06:23 -05:00
Nathan Hartman
c869bc5348 docs and comments: Update stale references to COPYING
Since 7a046358d9 the top-level COPYING
file has been deleted and replaced by DISCLAIMER, LICENSE, and NOTICE
files. However, some references to the old COPYING file remained in
Kconfig help text and documentation.

Documentation/contributing/coding_style.rst:
Documentation/introduction/about.rst:
boards/arm/lpc17xx_40xx/olimex-lpc1766stk/README.txt:
boards/arm/sam34/arduino-due/README.txt:
boards/arm/sam34/sam4l-xplained/README.txt:
boards/arm/sama5/giant-board/README.md:
boards/arm/sama5/sama5d2-xult/README.txt:
boards/arm/sama5/sama5d4-ek/README.txt:
boards/arm/samd2l2/samd20-xplained/README.txt:
boards/arm/samd2l2/samd21-xplained/README.txt:
boards/arm/samd2l2/saml21-xplained/README.txt:
boards/arm/stm32/hymini-stm32v/README.txt:
boards/arm/stm32/stm3210e-eval/README.txt:
fs/fat/Kconfig:
libs/libc/string/Kconfig:

    * Updates stale references to the old top-level COPYING file to
      either LICENSE or NOTICE (or both), as appropriate in each
      instance.
2021-04-01 21:10:56 -05:00
raiden00pl
55517a51e0 libdsp/fixed16: add openloop handler 2021-04-01 14:54:33 -03:00
Alin Jerpelea
e8f3c9441e libs: Mark Schulte: update licenses to Apache
Mark Schulte has submitted the ICLA and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-01 12:13:12 -05:00
Alin Jerpelea
0f41c3c555 NuttX: Pierre-Noel Bouteville: update licenses to Apache
Pierre-Noel Bouteville has submitted the ICLA and we can migrate the licenses
 to Apache.

David Sidrane has submitted the ICLA and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-01 12:13:12 -05:00
Alin Jerpelea
b4a33b5ec0 NuttX: Uros Platise: update licenses to Apache
Uros Platise has submitted the ICLA and we can migrate the licenses
 to Apache.

David Sidrane has submitted the ICLA and we can migrate the licenses
 to Apache.

Bob Feretich has submitted the ICLA and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-01 12:13:12 -05:00
Alin Jerpelea
ce66f7b081 NuttX: Johannes Schock: update licenses to Apache
Johannes Schock has submitted the ICLA and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-04-01 12:13:12 -05:00
Alan C. Assis
72bc595afb pthread: Fix pthread_rwlock_init return error
The return should be positive like in other parts of pthread code
2021-04-01 03:26:02 -05:00
raiden00pl
61389ad616 libdsp: update some comments 2021-04-01 01:24:12 -05:00
raiden00pl
f05edf1a5b libdsp: fix nxstyle errors 2021-04-01 01:24:12 -05:00
raiden00pl
255ffcf852 libdsp: add support for fixed16 libdsp 2021-04-01 01:24:12 -05:00
raiden00pl
f248207717 libdsp/Kconfig: move configuration to menuconfig, add option to include vabc in FOC data 2021-04-01 01:24:12 -05:00
raiden00pl
a2afb2daa9 libdsp: add Permanent Magnet Synchronous Motor (PMSM) model 2021-04-01 01:24:12 -05:00
raiden00pl
eeab79bd52 libdsp/lib_motor.c: remove reference to some unused data 2021-04-01 01:24:12 -05:00
raiden00pl
eadc7ebb1a libdsp/lib_observer.c: optimize and add some comments 2021-04-01 01:24:12 -05:00
raiden00pl
ee97eab4e7 libdsp/lib_foc.c: use better PI wind-up protection; add interface to run voltage controller without current controller; add separate interfaces to update base voltage and phase angle 2021-04-01 01:24:12 -05:00
raiden00pl
b34dd2d96a libdsp/lib_pid.c: add anti-windup protection with decay coefficient and add interface to select anti-windup mechanism 2021-04-01 01:24:12 -05:00
raiden00pl
15b0ae716c libs/libdsp/lib_motor.c: refactor 2021-04-01 01:24:12 -05:00
raiden00pl
c43ec4283f libdsp/lib_motor.c: remove maximum openloop speed limiter 2021-04-01 01:24:12 -05:00
raiden00pl
eea371093c libdsp/lib_svm.c: return not saturated output from modulator, the current corection now takes float as an arguments 2021-04-01 01:24:12 -05:00
raiden00pl
e0bab18b07 libs/libdsp/lib_transform.c: update descriptions 2021-04-01 01:24:12 -05:00
raiden00pl
5034e4d8ba libdsp: introduce libdsp-specific debug assertion (LIBDSP_DEBUGASSERT) 2021-04-01 01:24:12 -05:00
raiden00pl
66972d947e libdsp: add _f32_ suffix to all libdsp data structures tht use float as a numerical type.
This is an initial step to support fixed16 calculations for libdsp
2021-04-01 01:24:12 -05:00
Gregory Nutt
2ccc0da0c7 Move getopt() variables into TLS
getopt() in the FLAT build environment is not thread safe.  This is because global variables that are process-specific in Unix are truly global in the FLAT build.  Moving the getopt() variables into TLS resolves this issue.

No side-effects are expected other than to getopt()

Tested with sim:nsh
2021-03-31 21:13:01 -05:00
Gustavo Henrique Nihei
0109bcad8c libs/libc: Update pthread_once according to the specification
OpenGroup specification was updated regarding the return value for
pthread_once, which after Issue 7 states that "the [EINVAL] error for an
uninitialized pthread_once_t object is removed; this condition results
in undefined behavior".
2021-03-31 21:11:22 -05:00
Alin Jerpelea
e699b6f85f misc: : Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Several files were missed in the past

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-28 13:34:50 -07:00
Alin Jerpelea
e8606942eb libs: libc: nxstyle fixes
nxstyle fixes to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
3d6185709f libs: Author David Sidrane: update licenses to Apache
David Sidrane has submitted the ICL and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
Alin Jerpelea
8dd660ecd4 nuttx: Author David S. Alessio: update licenses to Apache
David S. Alessio has submitted the ICL and we can migrate the licenses
 to Apache.

Gregory Nutt has submitted the SGA and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-22 19:28:38 -07:00
chao.an
6a6ad96066 libs/libc/time/localtime: fix race condition
fix race condition on create the instance of lcl/gmt

Signed-off-by: chao.an <anchao@xiaomi.com>
2021-03-22 01:31:10 -07:00
Alin Jerpelea
648beb355d libs: nxstyle fixes
nxstyle fixes to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-20 19:22:58 -07:00
Alin Jerpelea
ba9865bfc8 libs: Author Sebastien Lorquet: update licenses to Apache
Sebastien Lorquet has submitted the ICL and we can migrate the licenses
 to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-03-20 19:22:58 -07:00
Jiuzhu Dong
e96c8b9283 fs: allocate file/socket dynamically
Change-Id: I8aea63eaf0275f47f21fc8d5482b51ffecd5c906
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-03-17 06:46:42 -07:00