Commit Graph

6618 Commits

Author SHA1 Message Date
ligd cb94f825af kasan: add builtin_return_address(0) to kasan
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-09-24 03:48:39 +08:00
guohao15 2bce0f404c fs:add syncfs api for sync whole fs data
Signed-off-by: guohao15 <guohao15@xiaomi.com>
2023-09-23 15:58:00 +08:00
Shanmin Zhang 582e0ab51f goldfish: add goldfish sensors driver
Implemented Goldfish Sensors:
Accelerometer
Gyroscope
MagneticField
AmbientTemperature
Proximity
Light
Pressure
RelativeHumidity
MagneticFieldUncalibrated
GyroscopeFieldUncalibrated
HeartRate

Unimplemented Goldfish Sensors:
(sensor type is not defined nuttx)
Orientation
HingeAngle0
HingeAngle1
HingeAngle2
WristTilt

Verification:
uorb_listener -r 1 sensor_accel
uorb_listener -r 1 sensor_mag
uorb_listener -r 1 sensor_gyro
uorb_listener -r 1 sensor_prox
uorb_listener -r 1 sensor_light
uorb_listener -r 1 sensor_humi
uorb_listener -r 1 sensor_baro
uorb_listener -r 1 sensor_temp
uorb_listener -r 1 sensor_hrate

Signed-off-by: Shanmin Zhang <zhangshanmin@xiaomi.com>
2023-09-23 15:20:25 +08:00
guoshichao 5bd8e56cbe libs/libc/wchar: add fputws implementation
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-09-22 08:51:07 +08:00
guoshichao d67090c47e libs/libc/wchar: add putwc implementation
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-09-22 08:51:07 +08:00
guoshichao f8b5f613e2 libs/libc/wchar: add fputwc implementation
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-09-22 08:51:07 +08:00
dulibo1 b57e43b4d0 clk:fix some issues when use rpmsg clk
1.check the rpmsg name when clk_register.
2.clk_get rpmsg clk print error:
clk/clk.c:1231:3: runtime error: null pointer passed as argument 2, which is declared to never be null
3.fix some function miss keyword FAR.
4.clk_disable_unused may disable rpmsg clk which disable the clk that maybe used by others

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-09-22 08:47:23 +08:00
raiden00pl 4c9c0c8be2 debug: add support for IPC (interprocessor communication) debug messages 2023-09-22 00:02:51 +08:00
simbit18 34bb0b6544 Fix nuttx coding style
Remove TABs
Remove spaces
Fix indentation
2023-09-21 10:03:13 -04:00
SPRESENSE a1f26ab24b include: nuttx: Re-allocate SIOCDENYINETSOCK
The SIOCDENYINETSOCK definition is duplicate with SIOCSIFMTU.
So, re-allocate SIOCDENYINETSOCK command number.
2023-09-21 01:08:11 +08:00
Shanmin Zhang 9b68971853 goldfish: add goldfish gps driver
Verification:

uorb_listener -r 1 sensor_gps

[   18.240000] [13] [  INFO] [ap]
Mointor objects num:2
[   18.240000] [13] [  INFO] [ap] object_name:sensor_gps, object_instance:0
[   18.240000] [13] [  INFO] [ap] object_name:sensor_gps, object_instance:1
[   18.240000] [13] [ ALERT] [ap] period_us = 1000000
[   19.010000] [13] [  INFO] [ap] sensor_gps:	timestamp: 19010000 (0 us ago) time_utc: 1689601925 latitude: 37.4210 longitude: -121.9150
[   19.010000] [13] [  INFO] [ap] sensor_gps:	altitude: 0.0000 altitude_ellipsoid: 0.0000 ground_speed: 145.3254 course: 166.2700
[   19.010000] [13] [  INFO] [ap] sensor_gps:	eph: nan epv: nan hdop: nan vdop: nan
[   20.020000] [13] [  INFO] [ap] sensor_gps:	timestamp: 20020000 (0 us ago) time_utc: 1689601926 latitude: 37.4210 longitude: -121.9150
[   20.020000] [13] [  INFO] [ap] sensor_gps:	altitude: 0.0000 altitude_ellipsoid: 0.0000 ground_speed: 145.3254 course: 166.2700
[   20.020000] [13] [  INFO] [ap] sensor_gps:	eph: nan epv: nan hdop: nan vdop: nan
[   21.010000] [13] [  INFO] [ap] sensor_gps:	timestamp: 21010000 (0 us ago) time_utc: 1689601927 latitude: 37.4210 longitude: -121.9150
[   21.010000] [13] [  INFO] [ap] sensor_gps:	altitude: 0.0000 altitude_ellipsoid: 0.0000 ground_speed: 145.3254 course: 166.2700
[   21.010000] [13] [  INFO] [ap] sensor_gps:	eph: nan epv: nan hdop: nan vdop: nan
[   22.020000] [13] [  INFO] [ap] sensor_gps:	timestamp: 22020000 (0 us ago) time_utc: 1689601928 latitude: 37.4210 longitude: -121.9150
[   22.020000] [13] [  INFO] [ap] sensor_gps:	altitude: 0.0000 altitude_ellipsoid: 0.0000 ground_speed: 145.3254 course: 166.2700
[   22.020000] [13] [  INFO] [ap] sensor_gps:	eph: nan epv: nan hdop: nan vdop: nan
[   23.010000] [13] [  INFO] [ap] sensor_gps:	timestamp: 23010000 (0 us ago) time_utc: 1689601929 latitude: 37.4210 longitude: -121.9150
[   23.010000] [13] [  INFO] [ap] sensor_gps:	altitude: 0.0000 altitude_ellipsoid: 0.0000 ground_speed: 145.3254 course: 166.2700
[   23.010000] [13] [  INFO] [ap] sensor_gps:	eph: nan epv: nan hdop: nan vdop: nan
...

Signed-off-by: Shanmin Zhang <zhangshanmin@xiaomi.com>
2023-09-21 00:38:14 +08:00
Neale Ferguson 5d7f2fdf16 Fix loading of ET_DYN type of shared objects
* build-globals.sh
  - Only look in the nuttx for external symbols used when loading
    dynamic shared objects

* include/elf64.h
  - Correct the type of fields in the Elf64_Phdr structure

* libs/libc/dlfcn/lib_dlclose.c
  - Distinguish between ET_DYN and other objects as the former
    has both text and data in a single allocation to reserve
    GOT offsets

* libs/libc/dlfcn/lib_dlopen.c
  - Code formatting

* libs/libc/modlib/modlib_bind.c
  - Distinguish between relocation entry sizes by section type
  - Handle RELA style relocations

* libs/libc/modlib/modlib_globals.S
  - Formatting fixes
  - Symbols should not be weak - they exist or they don't

* include/nuttx/lib/modlib.h
  - Add an inidcator to module_s to distinguish between ET_DYN and other

* libs/libc/modlib/modlib_load.c
  - ET_DYN objects need to keep the relative displacement between the text
    and data sections due to GOT references from the former to the latter.
    This also implies that linking may require modification from the default
    for the shared objects being produced. For example, default alignment may
    mean nearly 64K of wasted space.

* libs/libc/modlib/modlib_unload.c
  sched/module/mod_rmmod.c
  - Distingusih between freeing of ET_DYN storage and other as the former
    is a single allocation.

* libs/libc/modlib/mod_insmod.c
  - Cater for ET_DYN objects having init and preinit sections
2023-09-20 09:35:28 -04:00
Xiang Xiao 9bd6c70339 input/touchscreen: Bring up TSIOC_[SET|GET]CALIB macro
which is removed accidently in:
https://github.com/apache/nuttx/pull/9398

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-20 20:51:38 +08:00
yangyalei 3017cc4402 Exec: Support run exec in current task
There is a problem when vfork() calls execv() (or execl()) to start a new application:
When the parent thread calls vfork() it receives and gets the pid of the vforked task,
and not the pid of the desired execv'ed application.
see issue #3334

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-09-20 16:53:30 +08:00
chao an 6b070b2b00 libs/libc: currect usage of getpid/gettid in library
Signed-off-by: chao an <anchao@xiaomi.com>
2023-09-20 10:08:24 +08:00
yintao f3c9a8643b nuttx: change RPTUNIOC_START and RPTUNIOC_STOP to synchronous
Support quit remote when server poweroff

Signed-off-by: yintao <yintao@xiaomi.com>
2023-09-20 00:42:02 +08:00
Xu Xingliang 3cd5e20f74 sched: return 0 from clock_systime_ticks if failed
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2023-09-19 16:17:08 +08:00
ligd 61ef7eb3dc wqueue: add work_cancel_sync() support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-09-19 15:52:48 +08:00
zhengshaobo1 6e6ba062fd clock flags add CLK_OPS_PARENT_ENABLE, parents need enable during gate/ungate, set rate and re-parent
Signed-off-by: zhengshaobo1 <zhengshaobo1@xiaomi.com>
2023-09-19 10:34:48 +08:00
yinshengkai 1d8e69700f drivers/serial: add ram uart driver
It uses the memory block as the serial communication medium, which can communicate between different processes or different CPUs

Using the following configuration, the cross-core communication rate of 200MHz cortex-M55 is about 461KB/s
RAM_UART_BUFSIZE=1024
RAM_UART_POLLING_INTERVAL=100

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-09-19 09:41:07 +08:00
guoshichao 6683699c70 unistd: add _POSIX_SEMAPHORES definition
add _POSIX_SEMAPHORES definition can make the ltp testcase:
ltp_functional_semaphores_sem_conpro,
ltp_functional_semaphores_sem_philosopher,
ltp_functional_semaphores_sem_lock,
ltp_stress_semaphores_multi_con_pro,
ltp_functional_semaphores_sem_readerwriter,
ltp_functional_semaphores_sem_sleepingbarber
passed

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2023-09-19 09:37:49 +08:00
ligd f41383d998 notifier: add BLOCKING_INIT_NOTIFIER_HEAD support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-09-19 09:32:17 +08:00
Daniel Appiagyei 5bfda12634 c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
dulibo1 ac62a08ac9 support pm runtime base function
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-09-16 14:44:08 +08:00
SPRESENSE 3c96621e1e libs:netdb: Restrict DNS query types
Corresponds to the problem of name resolution with different IP
address types in networks where only one of IPv4 or IPv6 can be
used due to physical layer reasons (e.g., LTE networks).
2023-09-16 14:43:12 +08:00
dongjiuzhu1 8ababfc310 usbdev/mtp: support mtp class driver
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-09-16 14:40:08 +08:00
Petro Karashchenko 588a7241a8 nuttx/lib/builtin: use FAR specifier properly
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-16 14:17:47 +08:00
Petro Karashchenko 7314faaba4 nuttx/net/ip: fix nxstyle issues in macro
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-16 14:17:47 +08:00
Petro Karashchenko 7d1ac73eea include/nuttx/fs: add missing 'CODE'
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-16 14:17:47 +08:00
Petro Karashchenko 816cb3cfaf style: fix multiple style issues and remove unused
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-09-16 14:17:47 +08:00
Masayuki Ishikawa 1b97c05ab5 Revert "Exec: Support run exec in current task"
This reverts commit 670c245ff2.
2023-09-16 07:22:32 +03:00
shipei 0beba027e7 audio:add 24K sample rate support
Signed-off-by: shipei <shipei@xiaomi.com>
2023-09-15 02:26:03 +08:00
yangyalei 670c245ff2 Exec: Support run exec in current task
Fix the problem when vfork() calls execv() (or execl()) to start a new application:
When the parent thread calls vfork() it receives and gets the pid of the vforked task,
and not the pid of the desired execv'ed application.

issue #3334

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-09-14 22:37:44 +08:00
haopengxiang 5439275293 nuttx/sensors/sensor.h: remove non-standard message from bream private data
These values are only provided by bream private message, should not include in
NMEA 0183 standard struct.

Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2023-09-14 18:16:34 +08:00
pengyiqiang e578f3b20d video/fb: add vsync queue
refact vsync queue to support multi fb poll and overlay poll.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-09-12 22:10:10 +08:00
pengyiqiang 7485816d6f video/fb: use counter record the num of poll ready
add a count to record the number of pollready.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-09-12 22:10:10 +08:00
Stanley 4d13ac0a87 queue.h: Implement double link list queue split 2023-09-12 22:09:00 +08:00
Xiang Xiao 745dc4299f mmcsd: Rename mmc_rpmb_frame_s to rpmb_frame
align with mmc-utils definition:
https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git/tree/mmc_cmds.c#n2085

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-10 23:10:42 +08:00
Stanley 56286a72c6 PAGESIZE and PAGEMASK seems as common macro 2023-09-10 18:18:15 +08:00
wanggang26 83ac6c7c43 mmc: change rpmb operation type define style
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-09 18:16:23 +03:00
Andre Heinemans 329e050c30 Added NXP SE05x support (secure element) 2023-09-09 15:54:08 +08:00
zhangyuan21 1f6d9bbd17 usbdev: add usbdev fs device for usb char device
Add usb_fs driver so that userspace can directly transfer USB packets
through the EP node. ADB, Fastboot, MTP will use usb_fs, these class
driver only need to provide the descriptors and register the usb_fs device.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-09-09 15:52:08 +08:00
wanggang26 eaff76284b drivers/mmcsd: Add RPMB ioctl
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-09 00:13:42 +08:00
wanggang26 5be2c5d91c mmc: add timeout fields for mmc_ioc_cmd
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-08 22:36:57 +08:00
Jukka Laitinen b343f5c0e7 drivers/net: Add a management driver for ksz9477 ethernet switch
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-09-08 22:34:27 +08:00
fangxinyong 79004411b4 aio: change aio_fildes int type
if fdcheck enabled, protected fd used to aio_fildes will overflow.
Change to int and also follow posix spec:
https://pubs.opengroup.org/onlinepubs/7908799/xsh/aio.h.html

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-09-08 00:59:31 +03:00
yangyalei fd776e8cee fix wait after vfork return error
vfork use waitpid hang father process,
but waitpid release child processs information by default.
So when user call wait, it return errno 10.

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-09-08 00:53:56 +03:00
yangyalei eba2f163ed Revert "fix wait after vfork return error"
This reverts commit 50428979d0.
2023-09-08 00:53:56 +03:00
makejian f4f2c9ed49 crypto: fix multiple definition of `poly1305_init'
apps/crypto/libtomcrypt/libtomcrypt/src/mac/poly1305/poly1305.c:90: multiple definition of `poly1305_init';
nuttx/crypto/poly1305.c:51: first defined here
Signed-off-by: makejian <makejian@xiaomi.com>
2023-09-07 17:02:08 -03:00
dongjiuzhu1 ee598b3e21 libc/mallopt: implement dummy mallopt
refs:
https://man.freebsd.org/cgi/man.cgi?query=malloc&apropos=0&sektion=3&manpath=SunOS+4.1.3&format=html

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-09-07 23:11:10 +08:00