Commit Graph

54954 Commits

Author SHA1 Message Date
Tomasz 'CeDeROM' CEDRO 736e0ac34f DOC: STM32F3 add example flash/reset/debug information.
* Information on how to flash NuttX firmware to STM32F3 target was missing
  in the documentation and asked by new users on the dev@ list.
* Example on how to Flash, Reset, Debug with OpenOCD is now added to docs.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2024-09-28 10:04:08 +08:00
zhuanglin 07507669ba libc.csv: Add more missing interface
libc.csv adds the strlcpy, getrandom, task_tls_alloc, and fork interfaces

Signed-off-by: zhuanglin <zhuanglin@xiaomi.com>
2024-09-28 09:11:10 +08:00
yanghuatao 8d776ffbe0 nuttx/sched: Disable RW_SPINLOCK by default
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-09-27 23:46:46 +08:00
yanghuatao ae4865cf54 nuttx/timers: Fix green hills build timer.h error
"/mnt/yang/qixinwei_commit/nuttx/include/nuttx/timers/timer.h", line 257: error #223-D:
          function DEBUGASSERT declared implicitly
    DEBUGASSERT(lower->ops->tick_getstatus);

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-09-27 23:45:27 +08:00
hujun5 e98dd37534 xtensa: g_current_regs is only used to determine if we are in irq,
with other functionalities removed.

reason:
by doing this we can reduce context switch time,
When we exit from an interrupt handler, we directly use tcb->xcp.regs

before
text    data     bss     dec     hex filename
178368     876  130604  309848   4ba58 nuttx
after
text    data     bss     dec     hex filename
178120     876  130212  309208   4b7d8 nuttx

szie change -248

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-27 23:44:04 +08:00
guoshichao c7d801fd9c greenhills: fix the arch_interface archive error
: && cxarm cr arch/libarch_interface.a  arch/CMakeFiles/arch_interface.dir/arm/src/common/gnu/arm_signal_handler.S.obj  && echo arch/libarch_interface.a && :
[elxr] (error #16) cannot find file cr

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-09-27 23:39:56 +08:00
dulibo1 3107822c08 smp:fix sim build error under config CONFIG_SMP
CC:  sim/sim_smpsignal.c init/nx_smpstart.c: In function ‘nx_idle_trampoline’:
init/nx_smpstart.c:68:21: warning: unused variable ‘tcb’ [-Wunused-variable]
   68 |   FAR struct tcb_s *tcb = this_task_inirq();
      |                     ^~~
sim/sim_smpsignal.c: In function ‘host_cpu_started’:
sim/sim_smpsignal.c:271:17: warning: unused variable ‘tcb’ [-Wunused-variable]
  271 |   struct tcb_s *tcb = this_task();

sim/sim_smpsignal.c:249:33: error: ‘cpu’ undeclared (first use in this function)
  249 |   restore_critical_section(tcb, cpu);
      |                                 ^~~

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-09-27 23:30:40 +08:00
dulibo1 f8053f5484 sched_smp:adjust the critical section to protect refcount from multi cores access
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-09-27 23:30:40 +08:00
dulibo1 d10c1563f7 sched_smp:sync refcount before enqueue smp call queue
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>

1.call_data->refcount is not remote_cpus;
2.nxsched_smp_call_add enqueue  the call_data;
3.maybe nxsched_smp_call_handler is just doing;
4.dequeue the call_data but call_data->refcount is not corret;
5.unpredictability case will occur;
2024-09-27 23:30:40 +08:00
yanghuatao 375178b42a nuttx/libm: Move define __BSD_VISIBLE to openlibm_math.h
Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-09-27 23:21:01 +08:00
dulibo1 3c866e8cfd procfs:fix cat dir cause crash
ap> cat pm
=================================================================
==30235==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf436edd9 at pc 0x03338a48 bp 0x9d1b6ca8 sp 0x9d1b6c98
READ of size 1 at 0xf436edd9 thread T0
    #0 0x3338a47 in strncmp string/lib_strncmp.c:42
    #1 0x371af87 in pm_get_file_index power/pm/pm_procfs.c:174
    #2 0x371b066 in pm_open power/pm/pm_procfs.c:207
    #3 0x3640d20 in procfs_open procfs/fs_procfs.c:419
    #4 0x359bce2 in file_vopen vfs/fs_open.c:240
    #5 0x359c431 in nx_vopen vfs/fs_open.c:312
    #6 0x359cb53 in open vfs/fs_open.c:465
    #7 0x33bccc9 in nsh_catfile /apps/nshlib/nsh_fsutils.c:140
    #8 0x33b28cc in cmd_cat /apps/nshlib/nsh_fscmds.c:556
    #9 0x33a434f in nsh_command /apps/nshlib/nsh_command.c:1164
    #10 0x3381b8f in nsh_execute /apps/nshlib/nsh_parse.c:845
    #11 0x338dc17 in nsh_parse_command /apps/nshlib/nsh_parse.c:2744
    #12 0x338e273 in nsh_parse /apps/nshlib/nsh_parse.c:2828
    #13 0x3390b47 in nsh_session /apps/nshlib/nsh_session.c:245
    #14 0x337e90a in nsh_consolemain /apps/nshlib/nsh_consolemain.c:75
    #15 0x337e7f7 in nsh_main /apps/system/nsh/nsh_main.c:74
    #16 0x332b6e6 in nxtask_startup sched/task_startup.c:70
    #17 0x323ec3f in nxtask_start task/task_start.c:134
    #18 0x33636ea in pre_start sim/sim_initialstate.c:52

ap> cat net
=================================================================
==30303==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf4479a5a at pc 0x03338a48 bp 0x9d2b6ce8 sp 0x9d2b6cd8
READ of size 1 at 0xf4479a5a thread T0
    #0 0x3338a47 in strncmp string/lib_strncmp.c:42
    #1 0x5395d62 in netprocfs_open procfs/net_procfs.c:215
    #2 0x3640d20 in procfs_open procfs/fs_procfs.c:419
    #3 0x359bce2 in file_vopen vfs/fs_open.c:240
    #4 0x359c431 in nx_vopen vfs/fs_open.c:312
    #5 0x359cb53 in open vfs/fs_open.c:465
    #6 0x33bccc9 in nsh_catfile /apps/nshlib/nsh_fsutils.c:140
    #7 0x33b28cc in cmd_cat /apps/nshlib/nsh_fscmds.c:556
    #8 0x33a434f in nsh_command /apps/nshlib/nsh_command.c:1164
    #9 0x3381b8f in nsh_execute /apps/nshlib/nsh_parse.c:845
    #10 0x338dc17 in nsh_parse_command /apps/nshlib/nsh_parse.c:2744
    #11 0x338e273 in nsh_parse /apps/nshlib/nsh_parse.c:2828
    #12 0x3390b47 in nsh_session /apps/nshlib/nsh_session.c:245
    #13 0x337e90a in nsh_consolemain /apps/nshlib/nsh_consolemain.c:75
    #14 0x337e7f7 in nsh_main /apps/system/nsh/nsh_main.c:74
    #15 0x332b6e6 in nxtask_startup sched/task_startup.c:70
    #16 0x323ec3f in nxtask_start task/task_start.c:134
    #17 0x33636ea in pre_start sim/sim_initialstate.c:52

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-09-27 23:19:57 +08:00
Jani Paalijarvi 21f9fc2b28 mpfs_serial.c: Add RX flowcontrol
Disable RX interrupts and clear the fifo in case of full RX buffer.
Enable RX interrupts in case of empty buffer.
2024-09-27 10:53:12 -03:00
chenrun1 0d46c68731 libxx:fix build error when enable LIBCXXTOOLCHAIN
Summary:
  P:➜  nuttx git:(4cec713dbf) LC_ALL=C make
CC:  chip/stm32_gpio.c chip/stm32_gpio.c:41:11: note: '#pragma message: CONFIG_STM32_USE_LEGACY_PINMAP will be deprecated migrate board.h see tools/stm32_pinmap_tool.py'
   41 | #  pragma message "CONFIG_STM32_USE_LEGACY_PINMAP will be deprecated migrate board.h see tools/stm32_pinmap_tool.py"
      |           ^~~~~~~
CXX:  libcxxmini/libxx_new.cxx libcxxmini/libxx_new.cxx:72:11: error: redefinition of 'void* operator new(std::size_t, void*)'
   72 | FAR void *operator new(std::size_t nbytes, FAR void *ptr)
      |           ^~~~~~~~
In file included from /usr/include/newlib/c++/13.2.1/bits/atomic_base.h:36,
                 from /usr/include/newlib/c++/13.2.1/atomic:41,
                 from /home/leduc/wdc_workspace/src/autre/nuttx_dev/nuttx/include/nuttx/atomic.h:32,
                 from /home/leduc/wdc_workspace/src/autre/nuttx_dev/nuttx/include/nuttx/fs/fs.h:38,
                 from /home/leduc/wdc_workspace/src/autre/nuttx_dev/nuttx/include/nuttx/lib/lib.h:30,
                 from libcxxmini/libxx_new.cxx:29:
/usr/include/newlib/c++/13.2.1/new:174:33: note: 'void* operator new(std::size_t, void*)' previously defined here
  174 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
      |                                 ^~~~~~~~
make[1]: *** [Makefile:69: libxx_new.o] Error 1
make: *** [tools/LibTargets.mk:216: libs/libxx/libxx.a] Error 2

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-27 21:43:04 +08:00
liaobin1 0e8cf3837a tools/nxstyle: Add RuntimeInitArgs to the white content list
`RuntimeInitArgs` is used by WAMR, a popular WebAssembly runtime,
it used in nuttx-apps side.

Signed-off-by: liaobin1 <liaobin1@xiaomi.com>
2024-09-27 21:42:06 +08:00
guoshichao 03cabdb102 armv7-m/irq: fix the greenhills compiler compile error
CXX:  libcxxmini/libxx_new.cxx "/home/guoshichao/work_profile/vela_os/vela_qemu_1/nuttx/include/arch/armv7-m/irq.h", line 594: error #3422:
          use of the "register" storage class specifier is not allowed
    register uint32_t sp;
    ^

"/home/guoshichao/work_profile/vela_os/vela_qemu_1/nuttx/include/arch/armv7-m/irq.h", line 594: error #3422:
          use of the "register" storage class specifier is not allowed
    register uint32_t sp;
    ^

"/home/guoshichao/work_profile/vela_os/vela_qemu_1/nuttx/include/arch/armv7-m/irq.h", line 594: error #3422:
          use of the "register" storage class specifier is not allowed
    register uint32_t sp;
    ^

make[1]: *** [Makefile:69: libxx_delete_sized.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:69: libxx_deletea_sized.o] Error 1
make[1]: *** [Makefile:69: libxx_new.o] Error 1
"/home/guoshichao/work_profile/vela_os/vela_qemu_1/nuttx/include/arch/armv7-m/irq.h", line 594: error #3422:
          use of the "register" storage class specifier is not allowed
    register uint32_t sp;
    ^

"/home/guoshichao/work_profile/vela_os/vela_qemu_1/nuttx/include/arch/armv7-m/irq.h", line 594: error #3422:
          use of the "register" storage class specifier is not allowed
    register uint32_t sp;
    ^

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
2024-09-27 19:37:24 +08:00
hujun5 3e459c0477 riscv: use g_running_task store current regs
This commit fixes the regression from https://github.com/apache/nuttx/pull/13561

In order to determine whether a context switch has occurred,
we can use g_running_task to store the current regs.
This allows us to compare the current register state with the previously
stored state to identify if a context switch has taken place.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-09-27 18:07:31 +08:00
Bowen Wang e706805c8b drivers/pci: one pci device should only associate with one driver
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-27 17:12:09 +08:00
Bowen Wang d6f4d0a20a drivers/pci: change all devfn type to unsigned int
Now all the type of devfn in pci framework are unsigned int

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-27 17:12:09 +08:00
Yongrong Wang 2756045b07 pci.c: fix compile warning
pci/pci.c:1128:15: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
 1128 |       pciinfo("Limit MME to %x, num to %d\n", mmc, num);
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~
      |                                               |
      |                                               uint32_t {aka long unsigned int}
pci/pci.c:1128:30: note: format string is defined here
 1128 |       pciinfo("Limit MME to %x, num to %d\n", mmc, num);
      |                             ~^
      |                              |
      |                              unsigned int
      |                             %lx

Signed-off-by: Yongrong Wang <wangyongrong@xiaomi.com>
2024-09-27 17:12:09 +08:00
p-szafonimateusz 860bd3ad6f drivers/pci_qemu_test.c: fix compiler warning
pci/pci_qemu_test.c:218:6: warning: ‘ops’ may be used uninitialized [-Wmaybe-uninitialized]
  218 |   ops->write(dev->bus, &hdr->test, num, sizeof(num));
      |   ~~~^~~~~~~
pci/pci_qemu_test.c: In function ‘pci_qemu_test_probe’:
pci/pci_qemu_test.c:286:41: note: ‘ops’ was declared here
  286 |   FAR const struct pci_qemu_test_ops_s *ops;
      |

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2024-09-27 17:12:09 +08:00
yanghuatao 41d0eaa892 toolchain/ghs: Fix ?? "trigraphs not allowed" warnings
"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/pci/pci_regs.h", line 263: warning #1695-D:
          trigraphs not allowed
  #define  PCI_PM_CTRL_DATA_SEL_MASK        0x1e00  /* Data select (??) */
                                                                    ^

"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/pci/pci_regs.h", line 264: warning #1695-D:
          trigraphs not allowed
  #define  PCI_PM_CTRL_DATA_SCALE_MASK      0x6000  /* Data scale (??) */
                                                                   ^

"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/pci/pci_regs.h", line 266: warning #1695-D:
          trigraphs not allowed
  #define PCI_PM_PPB_EXTENSIONS             6       /* PPB support extensions (??) */
                                                                               ^

"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/pci/pci_regs.h", line 267: warning #1695-D:
          trigraphs not allowed
  #define  PCI_PM_PPB_B2_B3                 0x40    /* Stop clock when in D3hot (??) */
                                                                                 ^

"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/pci/pci_regs.h", line 268: warning #1695-D:
          trigraphs not allowed
  #define  PCI_PM_BPCC_ENABLE               0x80    /* Bus power/clock control enable (??) */
                                                                                       ^

"/mnt/yang/qixinwei_vela_warnings_04_23/nuttx/include/nuttx/pci/pci_regs.h", line 269: warning #1695-D:
          trigraphs not allowed
  #define PCI_PM_DATA_REGISTER              7       /* (??) */

Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
2024-09-27 17:12:09 +08:00
wangyongrong e4be747cf5 pci.c: fix pci 32bit warning
pci/pci.c:863:66: warning: right shift count >= width of type [-Wshift-count-overflow]
  863 |       pci_write_config_dword(dev, msi + PCI_MSI_ADDRESS_HI, (mar >> 32));

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-27 17:12:09 +08:00
Bowen Wang 97740fca2c include/pci_regs: add PCI_STD_NUM_BARS macro
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-27 17:12:09 +08:00
Bowen Wang 0f3feefa85 drivers/pci/pci.c: fix warning when CONFIG_PCI_ASSIGN_ALL_BUSES=n
pci/pci.c:415:34: warning: variable ‘res’ set but not used [-Wunused-but-set-variable]
  415 |       FAR struct pci_resource_s *res;
      |                                  ^~~
pci/pci.c: In function ‘pci_scan_bus’:
pci/pci.c:663:32: warning: unused variable ‘ctrl’ [-Wunused-variable]
  663 |   FAR struct pci_controller_s *ctrl = bus->ctrl;

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-27 17:12:09 +08:00
SPRESENSE 53bbf797da libcxx: Apply 0001_fix_stdatomic_h_miss_typedef.patch to libcxx.defs
0001_fix_stdatomic_h_miss_typedef.patch is only applied to cmake,
so apply it to Makefile as well.
2024-09-27 17:10:17 +08:00
ligd 981fd0cf53 xtesa: fix lost save & restore states caused by merge code
this is caused by:
35c8c80a00

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-09-27 16:18:36 +08:00
zhangkai25 8829f38bee Initialize af_channel to ensure no out-of-bounds situations occur
Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2024-09-27 14:42:45 +08:00
zhangkai25 63249f71d1 memcpy data directly without channel at msglen is 4
Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2024-09-27 14:42:45 +08:00
zhangkai25 bfd6185f4a add adc_receive_all just for adc_dma
Description: No longer transmitting data to fifo in a loop, complete transmission in one go

Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2024-09-27 14:42:45 +08:00
zhangkai25 b584b38983 add adc_fifo_size when it over 300
Signed-off-by: zhangkai25 <zhangkai25@xiaomi.com>
2024-09-27 14:42:45 +08:00
Bowen Wang fd182dad64 drivers/pci: add error handle for pci_alloc_bus/device()
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2024-09-27 14:12:11 +08:00
wangyongrong e8f6b1e695 pci.c: fix judge err in pci_connect_irq
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-27 14:12:11 +08:00
wangyongrong 6cec175c9d pci.c:fix ops not implement after calling panic err
Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2024-09-27 14:12:11 +08:00
likun17 329d121d50 sensor: Added 6dof motion and gesture related types.
For details, see: https://developer.android.com/reference/android/hardware/SensorEvent#values

Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-27 13:59:41 +08:00
likun17 709cbe26f5 inlclude/uorb.h:Update data types to be sorted by macro definition.
Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-27 13:59:41 +08:00
likun17 e7e2474614 sensor:sensor info power max_range and resolution are unified with Android type.
0e67aa0cae:include_all/hardware/sensors.h

Nuttx    <-------------------------------> Android
int32_t  <-- version                   --> int
float    <-- power                     --> float
float    <-- max_range                 --> float
float    <-- resolution                --> float
int32_t  <-- min_delay                 --> int32_t
int32_t  <-- max_delay                 --> int32/64_t
uint32_t <-- fifo_reserved_event_count --> uint32_t
uint32_t <-- fifo_max_event_count      --> uint32_t
char[]   <-- name                      --> char*
char[]   <-- vendor                    --> char*

Signed-off-by: likun17 <likun17@xiaomi.com>
2024-09-27 13:59:41 +08:00
dongjiuzhu1 899eeb3c35 nuttx/uorb.h: align sensor_type value with aosp
refs:0e67aa0cae:include_all/hardware/sensors-base.h

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-27 13:59:41 +08:00
Huang Qi 2cf92a75d3 boards/qemu-rv: Correct tmpfs mount path to use CONFIG_LIBC_TMPDIR
Follow other boards, use CONFIG_LIBC_TMPDIR from Kconfig instead
of hardcode it here.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-27 13:35:00 +08:00
Jinliang Li 19230e3a2b arm/armv8-r: fix armv8 build error without neon
Fix the build error:
armv8-r/arm_vectors.S:205:Error: VFP single precision
register expected -- `vstmdb.64 sp!,{d16-d31}'
armv8-r/arm_vectors.S:242:Error: VFP single precision
register expected -- `vldmia.64 r0!,{d16-d31}'

Signed-off-by: Jinliang Li <lijinliang1@lixiang.com>
2024-09-27 11:23:05 +08:00
lipengfei28 0bf2c9c514 pci_epf_driver_s use FAR const struct pci_epf_ops_s *ops
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-27 10:37:31 +08:00
lipengfei28 8e3c024bdb msi_set:Message Control Register for MSI:bit3:bit1 used for
Multiple Message Capable

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-27 10:37:31 +08:00
lipengfei28 9d425eb521 pci epc mem use virtual mem
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-27 10:37:31 +08:00
lipengfei28 aa3568f353 pci epf use epc_node link to epc
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-27 10:37:31 +08:00
lipengfei28 06a5103838 pci_epf_device_s and pci_epc_ctrl_s add priv data
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2024-09-27 10:37:31 +08:00
chenrun1 4581cbdb7e libc.h:Fixed the problem of multiple define appearing in arch_xxx.S after opening kasan
The reason is that libc.h needs to check whether CONFIG is enabled before the corresponding macro is enabled

Error scene:
arm-none-eabi-ld: /home/crafcat7/SSD/xxx/xxx-dev/nuttx/staging/libc.a(arch_libc.o): in function `memmove':
/home/crafcat7/SSD/xxx/xxx-dev/nuttx/libs/libc/machine/arch_libc.c:146: multiple definition of `memmove'; /home/crafcat7/SSD/xxx/xxx-dev/nuttx/staging/libc.a(arch_memmove.o):/home/crafcat7/SSD/xxx/xxx-dev/nuttx/libs/libc/machine/arm/armv8-m/gnu/arch_memmove.S:56: first defined here

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2024-09-27 10:32:09 +08:00
likun17 65264051aa stdio/va_format: move non-standard structure va_format to nuttx/streams.h
Signed-off-by: likun17 <likun17@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2024-09-27 10:29:22 +08:00
Michal Lenc 8639b1ca66 smartfs: add support for FIOC_FILEPATH ioctl
The FIOC_FILEPATH ioctl call is required if smartfs is to be used
together with inotify monitoring system. This implements the
call support to smartfs file system. The path to the file has to
be stored in smartfs_ofile_s structure during file open (and is freed
during close) as smartfs currently is not able to obtain the path
knowing only the file node. The full path is concatenated with the file
name and creates the full path needed for inotify to detect whether
the file is on the watchlist.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2024-09-27 10:28:37 +08:00
wanggang26 ce1d047845 mmcsd: fix cmd6 timeout error when repeat calling
If CMD6 is sent again before last transmission is complete, a timeout
error will be encountered.

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2024-09-27 10:25:51 +08:00
Ville Juven 9ef76e3735 riscv_fork.c: Fix race condition when handling parent integer registers
We need to record the parent's integer register context upon exception
entry to a separate non-volatile area. Why?

Because xcp.regs can move due to a context switch within the fork() system
call, be it either via interrupt or a synchronization point.

Fix this by adding a "sregs" area where the saved user context is placed.
The critical section within fork() is also unnecessary.
2024-09-27 10:22:43 +08:00
Ville Juven 172d2a8491 riscv_fork.c: Fix vfork() for kernel mode + SMP
There was an error in the fork() routine when system calls are in use:
the child context is saved on the child's user stack, which is incorrect,
the context must be saved on the kernel stack instead.

The result is a full system crash if (when) the child executes on a
different CPU which does not have the same MMU mappings active.
2024-09-27 10:22:43 +08:00