Commit Graph

6628 Commits

Author SHA1 Message Date
Ville Juven
51f8611fc0 mm/kmap: Change kmm_user_map to kmm_map_user
Naming consistency wrt kmm_map_user_page
2023-09-29 21:06:16 +08:00
Xiang Xiao
a37759a6a9 drivers/ioexpander: Add const to the value array of multiwritepin
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-28 10:09:51 +08:00
anjiahao
a2c5cb729a fs:support zipfs,can mount zipfile
we can mount a zipfile in nuttx use mount command like this:

mount -t zipfs -o /data/test.zip /zip

The zipfs is a read only file system,The advantage is that it
does not occupy additional space when reading the decompressed file.

When used, reading and decompression operations are simultaneous.
The known disadvantage is that when using seek to read forward,
it will reopen and cause slow speed problems.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-09-27 01:06:04 +08:00
xucheng5
366628bf5a dma: support source/destination address auto step
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-09-27 00:47:02 +08:00
likun17
f99b1a41a3 nuttx/drivers: add regmap subsystems support.
regmap: add i2c and spi bus support.

Signed-off-by: likun17 <likun17@xiaomi.com>
2023-09-27 00:46:51 +08:00
hujun5
b6693065e7 pthread_once: g_lock may lead deadlock
For programs with the dependencies logic in pthread_once callback , using global locks may cause deadlock:

task A
pthread_once()
|
|-> nxrmutex_lock(&g_lock);
 -> init_routine(); // callback to wait task B
                                                  task B
                                                  pthread_once()
                                                  |
                                                   ->nxrmutex_lock(&g_lock); // Deadlock
                                                   ->init_routine(); // hold resource to wake up task A

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-09-26 10:13:00 +08:00
ligd
dc096f951e list: update list.h
The function name comes from list.h inside Linux,
but rewrite from scratch to avoid the copyright issue.
Since many developers are familiar with Linux list API.

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-09-26 00:15:21 +08:00
Jiuzhu Dong
032a5c75a4 drivers/sensors/: Add coordinate conversion function
convert from body coordinate system to right-hand
coordinate system.

Example:
Compared to the standard coordinate system,
the x-axis and y-axis are interchanged and have opposite directions,
the z-axis remains normal.

  body coordinate   ---->     right-hand coordinate
              +x               +y
               |                |
               |                |
               |                |
               |                |
     -y<-------.                .------>+x
              /                /
             /                /
            /                /
           /                /
         +z                +z

So for the above conversion, using "P3" to represent transformation relationships
The front is 1 0 2, which represents the y x z axis.
The standard order is 0 1 2, so y and x are interchanged.

The following -1 1 1 indicates the direction of the axis.
The standard is 1 1 1. Because the current y-axis is opposite to
the standard x-axis, it is -1.

static const struct sensor_axis_map_s g_remap_tbl[] =
{
  { 0, 1, 2,  1,  1,  1 }, /* P0 */
  { 1, 0, 2,  1, -1,  1 }, /* P1 */
  { 0, 1, 2, -1, -1,  1 }, /* P2 */
  { 1, 0, 2, -1,  1,  1 }, /* P3 */
  { 0, 1, 2, -1,  1, -1 }, /* P4 */
  { 1, 0, 2, -1, -1, -1 }, /* P5 */
  { 0, 1, 2,  1, -1, -1 }, /* P6 */
  { 1, 0, 2,  1,  1, -1 }, /* P7 */
};

you can call the function sensor_remap_vector_raw16 and pass P3 parameters
to perform the conversion.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2023-09-24 11:01:08 +08:00
ligd
13f0051747 mm: rewrite the memdump code for more readable
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-09-24 10:39:18 +08:00
makejian
cb3abc48d7 crypto/cryptodev: expansion hash operation
(1) remove size restriction for single hash operation
(2) support hash operation to update uint32_t data
Signed-off-by: makejian <makejian@xiaomi.com>
2023-09-24 03:49:33 +08:00
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