-
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
openamp: Fix void pointer arithmetic in openamp to remove compilation… #11686
Merged
jerpelea
merged 1 commit into
apache:master
from
tiiuae:fix_openamp_libmetal_voidptr_arithmetics
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
openamp/0003-libmetal-nuttx-io.c-Fix-void-pointer-arithmetic-in-a.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
From 59e2764f9d0598ad0135286d4a0ee1ac95893bba Mon Sep 17 00:00:00 2001 | ||
From: Jukka Laitinen <jukkax@ssrc.tii.ae> | ||
Date: Mon, 12 Feb 2024 13:27:13 +0200 | ||
Subject: [PATCH] libmetal/nuttx/io.c: Fix void pointer arithmetic in access | ||
alignment | ||
|
||
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae> | ||
--- | ||
libmetal/lib/system/nuttx/io.c | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/lib/system/nuttx/io.c libmetal/lib/system/nuttx/io.c | ||
index 3ce9cbe..ab9bc6a 100644 | ||
--- a/lib/system/nuttx/io.c | ||
+++ libmetal/lib/system/nuttx/io.c | ||
@@ -45,7 +45,7 @@ static int metal_io_block_read_(struct metal_io_region *io, | ||
*(uint32_t *)dst = *(uint32_t *)va; | ||
else if (len == 8) { | ||
*(uint32_t *)dst = *(uint32_t *)va; | ||
- *(uint32_t *)(dst + 4) = *(uint32_t *)(va + 4); | ||
+ *((uint32_t *)dst + 1) = *((uint32_t *)va + 1); | ||
} else | ||
memcpy(dst, va, len); | ||
|
||
@@ -68,7 +68,7 @@ static int metal_io_block_write_(struct metal_io_region *io, | ||
*(uint32_t *)va = *(uint32_t *)src; | ||
else if (len == 8) { | ||
*(uint32_t *)va = *(uint32_t *)src; | ||
- *(uint32_t *)(va + 4) = *(uint32_t *)(src + 4); | ||
+ *((uint32_t *)va + 1) = *((uint32_t *)src + 1); | ||
} else | ||
memcpy(va, src, len); | ||
|
||
-- | ||
2.34.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jlaitine @CV-Bowen let's send the patch to OpenAMP community too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, the original patch is in this PR: OpenAMP/libmetal#279 ; this is not merged in the openamp libmetal yet. So obviously I can't provide the fix for that patch either :)
@CV-Bowen feel free to add my patch to the same PR, or squash the fix into your original patch. I am not sure what is the plan forward with that PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xiaoxiang781216 @jlaitine Thanks, I will update OpenAMP/libmetal#279 later today.