Commit Graph

4642 Commits

Author SHA1 Message Date
David Sidrane
5a76767cd7 tioctl:Define SINGLEWIRE PUSHPULL option 2020-08-06 01:03:34 -05:00
Xiang Xiao
5c67eac27f libc: Change index/rindex from macro to function
to avoid the confliction with the same name variable

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-05 04:39:03 -07:00
David Sidrane
ed5d00edd8 board_crashdump:use consistent type from outer function for file name 2020-08-04 21:20:05 -05:00
spiriou
a4a9eb2f5a fs/vfs: Add file descriptor based events support 2020-07-31 15:09:35 -06:00
SPRESENSE
45e9c2c8f5 drivers/video: Add 3A parameter control
Provide functions which get and set the 3A (Auto white balance/Auto
exposure/Auto
focus) parameters.
These are achieved by the ioctl request codes VIDIOC_G_EXT_CTRLS and
VIDIOC_S_EXT_CTRLS which have the following settings:

 1. ctrl_class = V4L2_CTRL_CLASS_CAMERA
 2. id         = V4L2_CID_3A_PARAMETER

Also, provide function which get the 3A adjustment status.
This is achieved by the ioctl request codes VIDIOC_G_EXT_CTRLS which has the
following settings:

 1. ctrl_class = V4L2_CTRL_CLASS_CAMERA
 2. id         = V4L2_CID_3A_STATUS
2020-07-31 09:37:20 +02:00
SPRESENSE
28ba7f4a1e boards: cxd56xx: Fix bugs about ON/OFF control of AWB and AE
Fix the following three bugs about ON/OFF control of auto white balance and auto
exposure:

 - The returned value of VIDIOC_G_CTRL with id = V4L2_CID_AUTO_WHITE_BALANCE is
different from V4L2 specification.
 - Auto exposure is locked if auto white balance lock is requested.
 - Auto exposure and auto white balance are locked if auto exposure lock is
requested.
2020-07-31 09:37:20 +02:00
Xiang Xiao
3cff139b85 libc: Make gethostname as syscall instead of uname
simplify and symmetry the implementation in KERNEL/PROTECTED build

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iefdeea5f6ef6348c774b2ca9f7e45fe89c0c22dd
2020-07-30 10:33:08 +09:00
SPRESENSE
d2f75467b5 net/usrsock: Add flags to sendto/recvfrom in usrsock
Add flags argument into sendto() and recvfrom() APIs for MSG_* flags can
handling in the daemon.

However, MSG_DONTWAIT should process in usrsock, so it unnecessary to pass to
the daemon like O_NONBLOCK.
2020-07-29 09:40:51 +02:00
SPRESENSE
500ead8101 drivers/modem/altair: Update altair modem driver
- Add board specific logic to altair modem dirver
- Fix issue that SPI4 RX frequency violated AC Spec
- Remove dummy buffer in altair driver
- Fix priority of SPI transfer task is too low
- Remove unnecessary configuration
- Modify timeout value for RX ready
- Fix minor bugs
2020-07-28 09:09:18 +02:00
Masayuki Ishikawa
41e6ce2beb include: audio: Replace license header with Apache License 2.0
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2020-07-28 00:47:39 -05:00
Xiang Xiao
33ec242caf Implement proposed POSIX _clockwait variants of existing _timedwait functions
Here is the related glibc patchset:
https://patchwork.ozlabs.org/project/glibc/cover/cover.b0c66849a87ca79889a49f2f1f2563b1a8a15d8b.1551291557.git-series.mac@mcrowe.com/

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I0095cb34cef3d0d88a100255053da79266b73ff2
2020-07-27 20:39:59 -03:00
Nakamura, Yuuichi
ac34ac9f5c Add g_funcnames declaration in syscall.h 2020-07-22 12:01:40 -05:00
Nakamura, Yuuichi
2b4d2cd4a3 Fix note structure members types 2020-07-22 11:55:21 -05:00
Xiang Xiao
6c03a4e4d5 libc: Add uuid implemenation
specified by OpenGroup here:
https://pubs.opengroup.org/onlinepubs/009629399/toc.htm

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3bc585e7f4d41f6c2ea70e170276ab0d0399b088
2020-07-21 21:48:18 -07:00
Xiang Xiao
e1ecb3e27c libc: Don't define localtime[_r] to macro when CONFIG_LIBC_LOCALTIME not define
since libc++ declare these function in ctime by:
using ::localtime[_r];

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic0bb68b44c0cab838ab7cc34baee2aaa3ca8a9b5
2020-07-19 19:35:21 -07:00
Xiang Xiao
aa57174eb9 rwbuffer: Optimize the buffer algorithm
avoid the buffer flush as much as possible

Change-Id: I902f374e9540b36bd0b0c77a34cab5014a2c24fc
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-07-19 13:13:50 -07:00
Xiang Xiao
4f22f746f8 syscall: Remove g_funclookup and g_funcnparms
since nobody use them

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-19 13:07:31 -07:00
Xiang Xiao
d6827cab60 arch: up_assert shouldn't call exit directly
since exit will be only callable from userspace and change
the 1st argument from "const uint8_t *" to "const char *"

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I86487d57210ab63109148232da71dbc4d60a563b
2020-07-19 01:21:36 +01:00
Xiang Xiao
6f6d61eec4 fs/vfs: Implement statvfs and fstatvfs
specified here:
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/statvfs.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-13 20:25:03 +01:00
Nakamura, Yuuichi
1f7e91d217 Move note_register() declaration into the separate header 2020-07-13 00:46:55 -05:00
Oleg Evseev
b6ed3392a4 drivers/can: base readers checks on cd_readers list itself
Get rid of several useless dev vars
2020-07-11 15:06:56 -03:00
Xiang Xiao
9dff16e0e4 fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ieaf325c899d1c349d64dfa15bddcc32afd1fce42
2020-07-10 21:30:02 +01:00
Xiang Xiao
c3e256e018 libxx: Make __dso_handle weak
since sim arch has to use other instance provided by host glibc
also initialize __dso_handle to self as glibc:
https://github.com/bminor/glibc/blob/master/csu/dso_handle.c#L21

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I7531ae58fc4dbe4600bcb2c2c3a6cac021378bc1
2020-07-10 13:51:26 +09:00
Ouss4
81d814b86e include/nuttx/arch.h: Trivial typo fixes. 2020-07-09 11:17:41 -03:00
Xiang Xiao
1bca457b28 libc: Always declare getenv, link/symlink and atexit/on_exit
since many c++ library implementation reference these symbols by using ::xxx but never
really use them, the declaration avoid the unused code is pulled into the final binary

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Idd7bf9a1e09b77a6b21f900cd3ede08a1cc82d86
2020-07-08 12:07:22 +01:00
Beat Küng
a349595316 gpio: extend gpio_pintype_e for pulldown/up and opendrain
- fix code style
- fix bool conversion when calling go_read()
2020-07-07 08:34:25 -05:00
Xiang Xiao
67ef70d460 vfs/dirread: Should return the same file type as lstat
by extend the possible value of d_type for the special file

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-07 13:41:10 +01:00
Xiang Xiao
91ed14c631 vfs/stat: Make the flag defintion more confirm POSIX standard
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-07 13:41:10 +01:00
Xiang Xiao
3472de3500 Revert "sched/sched/sched_releasetcb.c: Handle custom stack allocations."
Since up_release_stack auto detect whether the memory come from builtin heap
if (ttype == TCB_FLAG_TTYPE_KERNEL)
  {
    if (kmm_heapmember(dtcb->stack_alloc_ptr))
      {
        kmm_free(dtcb->stack_alloc_ptr);
      }
  }
else
  {
    /* Use the user-space allocator if this is a task or pthread */
    if (umm_heapmember(dtcb->stack_alloc_ptr))
      {
        kumm_free(dtcb->stack_alloc_ptr);
      }
  }

This reverts commit 124e6ee53d.
2020-07-07 00:21:46 +01:00
Xiang Xiao
60fe0a0f96 libc: Refine the inline handling
1.Remove CONFIG_HAVE_INLINE macro
2.Change the ANSI C function to normal function
3.Other simple non ANSI function to macro

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-04 11:10:29 +09:00
Xiang Xiao
b984534255 lib/math: Remove float32 and float64 definition
since they aren't defined by standard and never supported by other POSIX OS

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-07-02 10:53:34 -03:00
chao.an
d938e2cd46 CI check: fix nxstyle warning
nxstyle fixes to reduce the CI warnings

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-07-02 01:53:23 -05:00
chao.an
3fbdc213b7 syscall/prctl: fix PR_SET_NAME failure if without <pid> arg
add PR_SET_NAME_EXT/PR_GET_NAME_EXT extension to avoid semantic
conflicts, use extened version for pthread_setname_np/pthread_getname_np

Change-Id: I40404c737977a623130dcd37feb4061b5526e466
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-07-01 21:52:18 -05:00
Xiang Xiao
8153e31753 sched: Call c++ global variables constructor inside nxtask_startup
to avoid the similar code spread around each application

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I8967d647eaf2ecae47f29f83e7fa322ef1b42a02
2020-07-01 07:55:33 -06:00
Xiang Xiao
e9c7df4769 sched: Rename task_startup to nxtask_startup
to follow the naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3594d12a65e8cacea99bc295d622628304c3f9f8
2020-07-01 07:55:33 -06:00
Xiang Xiao
651eefc8f7 fs: Rename link to symlink
since the current implementation is really a symoblic link not hard link

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I59d30d0a620b0b5714fe91bbe90d4405cf53d187
2020-07-01 11:58:12 +02:00
Xiang Xiao
a102922e12 libc: Implement realpath
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie52dcd1c5c5faa4b033901eedd7182bbb9473f7a
2020-06-30 13:09:58 -06:00
Xiang Xiao
0b891d60f9 vfs: Define symlink as link
specified here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/symlink.html
yes, symlink is different from link:
1.symlink create the soft(symbolic) link
2.link create the hard link
but it is suitable to make them same now since vfs doesn't support the
hard link and the soft link in file system level yet.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3b6e311cc1c826542165c9d93cbe5e078f113684
2020-06-30 13:09:58 -06:00
Xiang Xiao
b598ab43d7 fs: Implement lstat function
specified here:
https://pubs.opengroup.org/onlinepubs/009695399/functions/lstat.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iefc23a02d425ff84fa4027aea7da1181b01eced7
2020-06-30 13:09:58 -06:00
Xiang Xiao
14ecb8723a sched: Change tcb_s to task_tcb_s for nxtask_[un]init
since these functions can just work with task not thread

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-30 10:54:42 -06:00
Xiang Xiao
a81a260490 vfs: Add chmod/fchmod/utimes function prototype
but skip the implemenation because VFS layer doesn't support the time/mode change yet:
https://pubs.opengroup.org/onlinepubs/009695399/functions/chmod.html
https://pubs.opengroup.org/onlinepubs/009696699/functions/fchmod.html
https://pubs.opengroup.org/onlinepubs/009695399/functions/utimes.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie4a2d3bb4eb5f5aaa0aeb794a4012b096aa94e4f
2020-06-30 09:20:33 +01:00
chao.an
2fc02ec4a4 sched/task_init: change the stack pointer type to (void *)
change the stack pointer type from (uint32_t *) to (void *)

Change-Id: I90bb7d6a9cb0184c133578a1a2ae9a19c233ad30
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-30 08:26:38 +02:00
chao.an
b296adc3bb socket/SOL: sync the SOL index with linux
Change-Id: I32b9eb7cc3bc1428f0ff7bf5e60d7fff52621db2
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-29 11:34:43 -05:00
Xiang Xiao
d17b963bca libc: Move double_t typedef from sys/types.h to math.h
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/math.h.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I3497a73908301d999cf1cfc4a66552a7ca4868c6
2020-06-29 13:37:41 +01:00
Xiang Xiao
771f532dcb cxx: Remove CONFIG_NET guard from [get|set]hostname
since these two functions is always implemented now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Iae46fa4d38b680a5d1ce5c314ffcb71af4a3dc95
2020-06-29 09:06:36 -03:00
Beat Küng
f6039bbfa7 stm32f7: add CANIOC_SET_NART and CANIOC_SET_ABOM ioctl's to can driver 2020-06-29 09:05:44 -03:00
Xiang Xiao
676a2b77f8 stdio.h: Implement fseeko and ftello function
specified here:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/fseek.html
https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftell.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-06-29 14:26:19 +09:00
Xiang Xiao
977f04a2b1 libc: sysconf support _SC_NPROCESSORS_CONF/_SC_NPROCESSORS_ONLN
specified here:
https://www.man7.org/linux/man-pages/man3/sysconf.3.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I87fba8476221797e59c69c1953974bebc8d0d7b3
2020-06-27 22:43:13 +01:00
chao.an
b83b83bf51 pthread/mutex: add PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP support
Note: the _NP suffix indicates a non-portable extension to the POSIX specification.

Library Functions Manual

PTHREAD_MUTEX(3)
...
SYNOPSIS
...
       pthread_mutex_t recmutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
...
DESCRIPTION
       PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP (for recursive mutexes).

Change-Id: I58320421ee8dc9a90dca4f593b5d3908be3932db
Signed-off-by: chao.an <anchao@xiaomi.com>
2020-06-26 09:52:56 -03:00
Ouss4
701100f6f9 drivers/sensors/mpu60x0: Add I2C support. 2020-06-24 23:30:34 -03:00