-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add memory protection support to RISC-V port #1175
Conversation
Related to FreeRTOS#908 Add memory protection support to the RISC-V port. * **Memory Protection Configurations and Settings** - Add memory protection-related configurations and settings in `portable/GCC/RISC-V/portmacro.h` and `portable/IAR/RISC-V/portmacro.h`. - Define macros for enabling and disabling memory protection in both files. * **Critical Section Handling** - Update the `portENTER_CRITICAL` and `portEXIT_CRITICAL` macros in `portable/GCC/RISC-V/portmacro.h` and `portable/IAR/RISC-V/portmacro.h` to handle memory protection. * **Chip-Specific Extensions** - Add memory protection-related definitions and macros in `portable/GCC/RISC-V/chip_specific_extensions/RISCV_MTIME_CLINT_no_extensions/freertos_risc_v_chip_specific_extensions.h` and `portable/IAR/RISC-V/chip_specific_extensions/RV32I_CLINT_no_extensions/freertos_risc_v_chip_specific_extensions.h`. - Define macros for saving and restoring memory protection context in both files. * **Port Functions** - Add functions for enabling and disabling memory protection in `portable/GCC/RISC-V/port.c` and `portable/IAR/RISC-V/port.c`. Working on still: portASM.s planning to implement ASAP
* Add `portcontextSAVE_CONTEXT_INTERNAL` macro to save memory protection context * Add `portcontextRESTORE_CONTEXT` macro to restore memory protection context
* Add `portcontextSAVE_CONTEXT_INTERNAL` macro to save memory protection context * Add `portcontextRESTORE_CONTEXT` macro to restore memory protection context
Quality Gate passedIssues Measures |
Hi @vishwamartur, Thank you for your time and effort. |
I have changed this PR to draft. Please mark it ready when you are done with the changes. Please also include the details about how are you testing these changes. |
Thank you for the feedback and support! I haven’t conducted testing yet, as I don’t currently have access to a compatible platform for this setup. If there are any suggestions for a testing approach or available emulators that support memory protection configurations for RISC-V, please let me know, and I’ll be glad to proceed accordingly. Thanks again for your guidance! |
For RISC-V, you can try using this QEmu demo - https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS/Demo/RISC-V-Qemu-virt_GCC. If you do not have a platform to test, how are you developing these changes? |
@vishwamartur Please share the testing details. Would you also share the details about how you developed these changes. |
As I have not heard back, I am closing this PR. Please feel free to create a new one when you are ready with the changes. |
Related to #908
Add memory protection support to the RISC-V port.
Memory Protection Configurations and Settings
portable/GCC/RISC-V/portmacro.h
andportable/IAR/RISC-V/portmacro.h
.Critical Section Handling
portENTER_CRITICAL
andportEXIT_CRITICAL
macros inportable/GCC/RISC-V/portmacro.h
andportable/IAR/RISC-V/portmacro.h
to handle memory protection.Chip-Specific Extensions
portable/GCC/RISC-V/chip_specific_extensions/RISCV_MTIME_CLINT_no_extensions/freertos_risc_v_chip_specific_extensions.h
andportable/IAR/RISC-V/chip_specific_extensions/RV32I_CLINT_no_extensions/freertos_risc_v_chip_specific_extensions.h
.Port Functions
portable/GCC/RISC-V/port.c
andportable/IAR/RISC-V/port.c
.Working on still: portASM.s planning to implement ASAP