-
Notifications
You must be signed in to change notification settings - Fork 305
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
Include support for Windows on Arm on BUILD.bazel along with proper Volterra detection #220
Conversation
@Maratyszcza Sorry to ping here, is there something I need to do to get this reviewed? Like creating a Issue or something? |
f816abd
to
756899e
Compare
I no longer maintain this project, defer to @malfet |
756899e
to
7691807
Compare
Include detection for Volterra, Windows Dev Kit.
@malfet Any chance you could take a look at this please? |
@everton1984 please fix clang-formatting, otherwise LGTM |
@malfet Done. Hopefully it worked. Thanks a lot for reviewing! |
@malfet , @everton1984 ; First of all, thanks for the contribution. However, we are considering that this PR is causing an issue for detection Thus, we created an issue with the details and a possible solution with PR. |
**Summary:** Resolves #236 Also related to [PR 220](#220) change. ``` "Unknown chip model name 'Ampere(R) Altra(R) Processor'. Please add new Windows on Arm SoC/chip support to arm/windows/init.c!" ``` --- **Previous error details:** The error's reason was: `woa_chip_name` (`windows-arm-init.h`) enum had only 4 elements (stored in `woa_chip_name_last`) ```c enum woa_chip_name { woa_chip_name_microsoft_sq_1 = 0, woa_chip_name_microsoft_sq_2 = 1, woa_chip_name_microsoft_sq_3 = 2, woa_chip_name_ampere_altra = 3, woa_chip_name_unknown = 4, woa_chip_name_last = woa_chip_name_unknown }; ``` However, `woa_chips[]` (`init.c`) has a duplicated value for `woa_chip_name_microsoft_sq_3` due to different strings for same target after the [PR 220](#220) > Strings are `Snapdragon (TM) 8cx Gen 3` and `Snapdragon Compute Platform` And this was causing following `for loop` (`init.c`) is not checking for all elements in `woa_chips[]`. ```c for (uint32_t i = 0; i < (uint32_t)woa_chip_name_last; i++) { size_t compare_length = wcsnlen(woa_chips[i].chip_name_string, CPUINFO_PACKAGE_NAME_MAX); int compare_result = wcsncmp(text_buffer, woa_chips[i].chip_name_string, compare_length); if (compare_result == 0) { chip_info = woa_chips + i; break; } } ``` --- **Fix Details:** We added `woa_chip_name_microsoft_sq_3_devkit` to maintain **one to one** relationship between `woa_chip_name` (`windows-arm-init.h`) and `woa_chips[]` (`init.c`). Also, we especially specified indexes with `enums` to prevent future duplications and increase readability of the code and relationship.
This MR includes support for building with Bazel on cpu
arm64_windows
, I also tried this on my Volterra Windows Dev Kit and noticed that the core string seems different from what the current source code defines. I don't know if this is because my hardware is a bit different or not.I ran the tests with the following results
with
cpu-info.exe
returningand
isa-info.exe
returning