FreeRTOS / FreeRTOS-Kernel

FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
https://www.FreeRTOS.org
MIT License
2.51k stars 1.05k forks source link

Improvement for 64bit Windows port #1011

Closed watsk closed 3 months ago

watsk commented 4 months ago

Improvement for 64bit Windows port

Description

  1. 64bit TickType_t is supported. (MSVC and MinGW) The case configTICK_TYPE_WIDTH_IN_BITS == TICK_TYPE_WIDTH_64_BITS is added in portmacro.h. It is straightforward extension from 16bit and 32bit. This change is based on the following discussion on the FreeRTOS forum. https://forums.freertos.org/t/64bit-application-on-freertos-windows-port/19110

  2. Unnecessary compiler warning is disabled locally. (MinGW-w64 only)

    pragma for ignoring the warning cast-function-type is added in port.c.

    MinGW-w64 reports this warning for the for the cast operation from TaskFunction_t to LPTHREAD_START_ROUTINE. This warning should be ignored because it is unavoidable. TaskFunction_t is an essential type in FreeRTOS and LPTHREAD_START_ROUTINE is an essential type in win32api. This pragma option affects only one line. Other part is not affected.

Test Steps

Define configTICK_TYPE_WIDTH_IN_BITS as TICK_TYPE_WIDTH_64_BITS in FreeRTOSConfig.h and build FreeRTOS by MinGW-w64 or x64 platform on MSVC(Visual Studio).

Regression tests are performed. All combinations of tick type width and compiler type have been tested.

  1. TICK_TYPE_WIDTH_32_BITS on MinGW(32bit) and Win32 on MSVC
  2. TICK_TYPE_WIDTH_64_BITS on MinGW(32bit) and Win32 on MSVC
  3. TICK_TYPE_WIDTH_32_BITS on MinGW-w64 and x64 on MSVC
  4. TICK_TYPE_WIDTH_64_BITS on MinGW-w64 and x64 on MSVC

MingW Demo: CodeCoverage configuration runs successfully in all cases. No error is reported in the console. No regression is found on coverage score. MSVC Demo: Demo application runs successfully. No error is reported in the console.

Checklist:

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.00%. Comparing base (4732b96) to head (cb85579).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1011 +/- ## ======================================= Coverage 93.00% 93.00% ======================================= Files 6 6 Lines 3200 3200 Branches 879 879 ======================================= Hits 2976 2976 Misses 111 111 Partials 113 113 ``` | [Flag](https://app.codecov.io/gh/FreeRTOS/FreeRTOS-Kernel/pull/1011/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FreeRTOS) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/FreeRTOS/FreeRTOS-Kernel/pull/1011/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FreeRTOS) | `93.00% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=FreeRTOS#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

chinglee-iot commented 3 months ago

@watsk Thank you for creating this PR. I will look into it and discuss with you.

watsk commented 3 months ago

@chinglee-iot Thank you for reviewing this PR. If you have any question, please let me know.

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud