summaryrefslogtreecommitdiff
path: root/libcpu
AgeCommit message (Collapse)Author
2024-12-13feat: arm64: mmu: auto-sensing of best paging strideShell
Improves the memory mapping process by dynamically selecting the optimal paging stride (4K or 2M) based on virtual address alignment and mapping size. This eliminates the need for upfront stride determination, enhancing flexibility and maintainability in memory management. Changes: - Replaced fixed stride selection logic with a dynamic decision loop. - Removed `npages` calculation and replaced with `remaining_sz` to track unprocessed memory size. - Added assertions to ensure `size` is properly aligned to the smallest page size. - Adjusted loop to dynamically determine and apply the appropriate stride (4K or 2M) for each mapping iteration. - Updated virtual and physical address increments to use the dynamically selected stride. Signed-off-by: Shell <[email protected]>
2024-12-13[FIXUP] __rt_clz loss in aarch64GuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2024-12-04rzn2l-rsk support studiokurisaw
2024-12-04[libcpu][drivers] cortex-r52 abnormal takeover and software rtc naming changekurisaw
2024-11-29[libcpu/riscv]解决smp下cpuport.h中的编译问题 (#9714)heyuanjie87
2024-11-27给vector模块添加构建脚本heyuanjie87
2024-11-27[libcpu][riscv]virt64使用通用vector支持代码heyuanjie87
2024-11-24feat: Kconfig: moving the arm64 specified configs to sub-menuShell
Just for better readability. Signed-off-by: Shell <[email protected]>
2024-11-24feat: arm64 ASID supportShell
Support for ARM64 ASID to enhance virtual memory management efficiency by reducing the need for TLB flushes during address space switches. These changes improve performance especially for multi-process systems. Changes: - Added `ARCH_USING_ASID` configuration in `libcpu/aarch64/Kconfig`. - Defined ASID-related constants in `mmu.h`. - Updated `TLBI_ARG` macro to include ASID manipulation. - Implemented ASID allocation mechanism with spinlock synchronization. - Enhanced TLB invalidation to support ASID-specific operations. - Modified `rt_hw_aspace_switch` to use ASIDs when switching address spaces. - Adjusted debug logging and function documentation to reflect ASID usage. - Refactored AArch64 MMU and TLB handling for ASID integration. Signed-off-by: Shell <[email protected]>
2024-11-21[libcpu][riscv]纠正pv_offset的对齐检查heyuanjie87
2024-11-20[DM/FIXUP] add cortex-m23's cpuport.hGuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2024-11-18[DM/FIXUP] remove some redundant INIT_EXPORTGuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2024-11-17[libcpu] fix No memory higher than 1 GB is mappedzhujiale
2024-11-17[libcpu] fix No memory higher than 1 GB is mappedzhujiale
2024-11-15[libcpu]riscv使用call指令解决长跳转问题heyuanjie87
2024-11-06[libcpu][component] fixed the r52 kernel gcc context switch assemblykurisaw
2024-11-03:truck: renaming: move `smp` to `smp_call`Shell
2024-11-03feat: smp_call: added signaling call_reqShell
This patch introduces `rt_smp_call_request` API to handle queued requests across cores with user provided data buffer, which provides a way to request IPI through a non-blocking pattern. It also resolved several issues in the old implementation: - Multiple requests from different cores can not be queued in the work object of the target core. - Data racing on `rt_smp_work` of same core. If multiple requests came in turns, or if the call is used by the target cpu, while a new request is coming, the value will be overwrite. - Memory vulnerability. The rt_smp_event is allocated on stack, though the caller may not wait until the call is done. - API naming problem. Actually we don't provide a way to issue an IPI to ANY core in mask. What the API do is aligned to MANY pattern. - FUNC_IPI registering to PIC. Changes: - Declared and configured the new `RT_SMP_CALL_IPI` to support functional IPIs for task requests across cores. - Replaced the single `rt_smp_work` array with `call_req_cores` to manage per-core call requests safely. - Added `_call_req_take` and `_call_req_release` functions for atomic handling of request lifetimes, preventing data race conditions. - Replaced single event handling with a queue-based approach (`call_queue`) for efficient multi-request processing per core. - Introduced `rt_smp_call_ipi_handler` to process queued requests, reducing IPI contention by only sending new requests when needed. - Implemented `_smp_call_remote_request` to handle remote requests with specific flags, enabling more flexible core-to-core task signaling. - Refined `rt_smp_call_req_init` to initialize and track requests with atomic usage flags, mitigating potential memory vulnerabilities. Signed-off-by: Shell <[email protected]>
2024-11-03feat: Added rt_interrupt_context* family for nested interrupt handlingShell
These changes introduce the rt_interrupt_context family, providing a mechanism for managing nested interrupts. The context management ensures proper storage and retrieval of interrupt states, improving reliability in nested interrupt scenarios by enabling context tracking across different interrupt levels. This enhancement is essential for platforms where nested interrupt handling is crucial, such as in real- time or multi-threaded applications. Changes: - Defined rt_interrupt_context structure with context and node fields in `rtdef.h` to support nested interrupts. - Added rt_slist_pop function in `rtservice.h` for simplified node removal in singly linked lists. - Declared rt_interrupt_context_push, rt_interrupt_context_pop, and rt_interrupt_context_get functions in `rtthread.h` to manage the interrupt/exception stack. - Modified AArch64 CPU support in `cpuport.h` to include rt_hw_show_register for debugging registers. - Refactored `_rt_hw_trap_irq` in `trap.c` for context-aware IRQ handling, with stack push/pop logic to handle nested contexts. - Implemented interrupt context push, pop, and retrieval logic in `irq.c` to manage context at the CPU level. Signed-off-by: Shell <[email protected]>
2024-11-01[libcpu][cortex-m7] use hw atomicKai
2024-10-23[kernel] Specification interrupt nested level variable declaration type (#9568)Yuqiang Wang
2024-10-16[libcpu]添加对riscv vector的支持 (#9531)heyuanjie87
[libcpu]添加对riscv vector的支持
2024-10-11[libcpu][risc-v] fix the bug when using ASID in the RV64 MMUzhangjing0303
* (fix) mmu: satp value should be 64-bit Corrected the SATP register to ensure it uses the correct 64-bit format as required by the system architecture. * use __asm__ instead of asm for the GNU C compiler Co-authored-by: Shell <[email protected]> --------- Co-authored-by: Shell <[email protected]>
2024-10-11feat: arm64: update thread self on sp-switchShell
This patch improves the atomicity of context switching by ensuring that the stack pointer (sp) and thread self updates occur simultaneously. This enhancement is crucial for maintaining thread safety and preventing potential inconsistencies during context switches. Changes: - Modified `cpuport.h` to use `ARM64_THREAD_REG` for thread self access. - Added an `update_tidr` macro in `context_gcc.S` to streamline thread ID updates. - Adjusted `rt_hw_context_switch_to` and `rt_hw_context_switch` to call `update_tidr`, ensuring atomic updates during context switches. - Cleaned up `scheduler_mp.c` by removing redundant thread self assignments. Signed-off-by: Shell <[email protected]>
2024-10-09[libcpu][risc-v]remove the redundant "0x" from the printed information when ↵zhangjing0303
cpu is in exception (#9516) Remove redundant '0x' from printed output
2024-10-08[libcpu][risc-v]add README for RV64zhangjing0303
2024-09-24smpzhujiale
2024-09-24SMPzhujiale
2024-09-24smp_ipizhujiale
2024-09-23删除多余空格heyuanjie87
2024-09-23[libcpu]rv添加c908 cpuheyuanjie87
2024-09-19feat: smart: user space context optimizationShell
This patch optimizes the user-space context handling in the ARM64 architecture, specifically improving how the context is saved and restored during system calls and interrupts. The changes make the code more efficient and easier to maintain, while ensuring proper preservation of user context during system transitions. Changes: - Introduced a parameter for context saving to improve flexibility. - Replaced hardcoded stack pointer operations with frame-relative references for better readability and code reuse. - Simplified context restoration, removing redundant operations like loading/storing floating-point registers. Signed-off-by: Shell <[email protected]>
2024-09-18[libcpu]优化rv构建脚本中选择vendor目录的判断条件heyuanjie87
2024-09-13feat: remove redundant codes under virt64, c906Shell
Changes: - create new folder name `common64` and save all common codes of rv64 inside Signed-off-by: Shell <[email protected]>
2024-09-11feat: libcpu/risc-v: unify low-level bringupsShell
This patch consolidates the separated architecture-specific code for rv64 (virt64 and c906) under a more unified approach. The changes aim to enhance maintainability and code reuse, reducing duplication between these two architectures while adding small improvements in porting compatibility. Changes: - Modified build scripts (SConscript) for both virt64 and c906 to remove ASID and vector dependencies when not required. - Updated c906's sbi.c and sbi.h to use standard integer types (uint32_t) and include the missing <stdint.h> header. - Unified inline function declaration for `sbi_call` across both c906 and virt64 using `rt_inline`. - Disabled FPU and vector in c906's startup assembly file, aligning it with the virt64 handling. - Corrected syscall handler type definitions in c906 for consistency. Signed-off-by: Shell <[email protected]>
2024-09-11feat: libcpu/risc-v: unify interrupt & IO on rv64Shell
This patch aims to unify the two currently separated RISC-V 64-bit architecture ports, 'virt64' and 'c906', into a single generic 'common64' port. The changes include renaming files and updating includes to use a unified 'interrupt.h' header, as well as making adjustments to IO and trap handling to be more consistent between the two architectures. Changes: - Renamed 'rt_interrupt.h' to 'interrupt.h' and updated includes accordingly. - Unified IO register access functions in 'riscv_io.h'. - Added 'opcode.h' for portable assembly support. - Updated 'plic.c' and 'plic.h' to handle interrupts in a unified manner. - Modified 'trap.c' to handle exceptions and interrupts consistently for 'rv64'. Signed-off-by: Shell <[email protected]>
2024-09-11feat: libcpu/risc-v: unify mmu related worksShell
These changes are designed to standardize the memory management across 'virt64' and 'c906', ensuring efficient handling of address spaces and page tables. Changes: - Creation of ASID management files (`asid.c`) for both 'c906' and 'virt64' architectures, which is essential for maintaining stability. - Extensive updates to the MMU configuration and handling in `mmu.c` and `mmu.h` files. - Addition of functions to manage ASID allocation and switching of page tables. - For c906, accommodated the early memory setup to the one from virt64. Signed-off-by: Shell <[email protected]>
2024-09-11feat: libcpu/risc-v: unify context on c906, virt64Shell
Changes: - added config for NEW_CTX_SWITCH - used new context on c906 sched switch routine - update _rt_hw_stack_init to fit into NEW_CTX_SWITCH - separated vector ctx from the generic Signed-off-by: Shell <[email protected]>
2024-09-06[DM] Extended drivers MISC interfaceGuEe-GUI
1. RT_FIELD_PREP: prepare a bitfield element. 2. RT_FIELD_GET: extract a bitfield element. 3. rt_offsetof: member offset of a struct 4. rt_upper_32_bits: high 32 bits of value. 5. rt_lower_32_bits: lower 32 bits of value. 6. rt_upper_16_bits: high 16 bits of value. 7. rt_lower_16_bits: lower 16 bits of value. 8. rt_max_t: fix type of max(...). 9. rt_ilog2: integer logarithm base 2. Signed-off-by: GuEe-GUI <[email protected]>
2024-09-03[libcpu/aarch64]修改atomic实现zhangyan
2024-09-01feat: kernel/libcpu: fit into ilp32dShell
2024-08-29add readme filesEvlers
2024-08-29[libcpu][arm][cortex-m4] allows rewrite to interrupt enable/disable api to ↵Evlers
support independent interrupts management
2024-08-27[BSP][Phytium] add support for mainbranch cherryusb (xhci host + pusb2 ↵zhugengyu
device/host)
2024-08-27rename c906 FPU macro (#9290)flyingcys
1. 修改 ENABLE_FPU 为 ARCH_RISCV_FPU,与libcpu/common 保持统一 2. 对 bsp/cvitek/cv18xx_risc-v 中增加使能 ARCH_RISCV_FPU 的动作。解决了 issue #9075
2024-08-27feat: arm64: generic implementation of vector irq (#9336)Shell
feat: overall implementation of vector irq This patch generalize the irq handling on up/mp system by adding the `rt_hw_irq_exit()` & `rt_hw_vector_irq_sched()` API. Changes: - Added `rt_hw_irq_exit()` and `rt_hw_vector_irq_sched()` APIs for unified IRQ management. - Refactored assembly code for both UP and MP systems to use the new IRQ handling flow. - Removed redundant code and optimized exception handling paths. Signed-off-by: Shell <[email protected]>
2024-08-01[bsp][ch32] add eth driverYaochenger
2024-07-25Merge pull request #9228 from messigogogo/masterBernard Xiong
[BSP/Phytium]适配最新驱动
2024-07-25Merge pull request #9236 from polarvid/shell/arm64-headerBernard Xiong
quality: include the essential only to avoid recursion
2024-07-24Merge pull request #9212 from polarvid/shell/opt-gctxBernard Xiong
[libcpu] trimming ARM64 general context