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

arch: add armv8m #342

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

arch: add armv8m #342

wants to merge 2 commits into from

Conversation

damianloew
Copy link
Contributor

@damianloew damianloew commented Feb 9, 2024

Description

arch: add armv8m

Motivation and Context

Finalizing the nrf9160 basic port

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (nrf9160 devkit).

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

arch/armv8m/reboot.c Outdated Show resolved Hide resolved
arch/armv8m/string.c Show resolved Hide resolved
arch/armv8m/string.c Show resolved Hide resolved
arch/armv8m/string.c Show resolved Hide resolved
arch/armv8m/string.c Show resolved Hide resolved
arch/armv8m/string.c Show resolved Hide resolved
arch/armv8m/string.c Show resolved Hide resolved
arch/armv8m/string.c Show resolved Hide resolved
arch/armv8m/string.c Show resolved Hide resolved
arch/armv8m/string.c Show resolved Hide resolved
@damianloew damianloew marked this pull request as ready for review February 9, 2024 17:00
Copy link

github-actions bot commented Feb 9, 2024

Unit Test Results

7 155 tests  ±0   6 448 ✅ ±0   33m 43s ⏱️ -27s
  397 suites ±0     707 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 0faa598. ± Comparison against base commit 8e7daf8.

♻️ This comment has been updated with latest results.

@kemonats
Copy link
Contributor

I have a small comment. I suggest adding a .cpu directive to each *.S file at its begining.

@damianloew
Copy link
Contributor Author

I have a small comment. I suggest adding a .cpu directive to each *.S file at its begining.

Hmm, but those files are intended for various armv8 cpus, like Cortex-M23 and so on (I know that now they are not provided, but maybe they will be available in the future)

@agkaminski
Copy link
Member

General remark - modify copyright headers. You are an author of all these files, of some (like Makefile) you are the only author

.syntax unified

.text
.align 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alignment might cause some performance penalty. IMHO better to set it to 4, to make it predictable

Copy link
Contributor Author

@damianloew damianloew Mar 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to leave 2 for other arm architectures?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other arm archs aren't in the scope of this PR. Imho it's best to change alignment to 4 everywhere eventually, as @lukileczo found out it's faster indeed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see that it has been changed recently


.globl sigsetjmp
.type sigsetjmp, %function
.align 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant

Suggested change
.align 2

arch/armv8m/reboot.c Outdated Show resolved Hide resolved

void __attribute__((naked)) __aeabi_read_tp(void)
{
__asm__ volatile(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
__asm__ volatile(
__asm__ volatile (

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we leave it without a space to be compliant with clang-format? Like for other architectures

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not, clang-format is confused in this case, as it thinks it's a function - it's not. It would be best to use clang-format off on every inline asm instead

@damianloew damianloew marked this pull request as draft February 13, 2024 09:53
arch/armv8m/tls.c Outdated Show resolved Hide resolved
include/arch/armv8m/arch.h Outdated Show resolved Hide resolved
@lukileczo
Copy link
Member

lukileczo commented Mar 8, 2024

With the merge of #347, I've created conflicts for your port again. I've made a good chunk of code previously split into armv7a and armv7m common - in arm directory, which has v7a and v7m subdirectories, so you can remove a fair amount of previously copied code from this PR.

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.

4 participants