Skip to content
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

Closed

Conversation

vishwamartur
Copy link
Contributor

Related to #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

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
@vishwamartur vishwamartur requested a review from a team as a code owner November 1, 2024 06:56
* 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
Copy link

sonarqubecloud bot commented Nov 1, 2024

@ActoryOu
Copy link
Member

ActoryOu commented Nov 1, 2024

Hi @vishwamartur,
We greatly appreciate your submission. Would you kindly share the verification results for this change? We're interested in learning more about the specifics of your contribution.

Thank you for your time and effort.

@aggarg aggarg marked this pull request as draft November 4, 2024 09:36
@aggarg
Copy link
Member

aggarg commented Nov 4, 2024

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.

@vishwamartur
Copy link
Contributor Author

Hi @ActoryOu and @aggarg,

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!

@aggarg
Copy link
Member

aggarg commented Nov 4, 2024

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?

@aggarg
Copy link
Member

aggarg commented Nov 7, 2024

@vishwamartur Please share the testing details. Would you also share the details about how you developed these changes.

@aggarg
Copy link
Member

aggarg commented Nov 12, 2024

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.

@aggarg aggarg closed this Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants