This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Modify style checker for PKCS #11 types #117
Merged
Merged
Conversation
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
PKCS #11 types may follow the format CK_TYPE_PTR or CK_TYPE_PTR_PTR. This change updates the style checker to recognize _PTR and _PTR_PTR line endings as pointer types. This change also allows variables to start with a number.
tgsong
suggested changes
Nov 28, 2018
@@ -224,7 +235,7 @@ def get_identifier_prefix(identifier): | |||
indirection = "p" * (len(identifier) - len(direct_identifier)) | |||
for key in TYPE_PREFIXES: |
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.
Though this line didn't change, looks like we can just do for prefix in TYPE_PREFIXES.values():
, key
is only used to get values from this dictionary.
@@ -247,4 +258,4 @@ def main(): # pragma: no cover | |||
|
|||
|
|||
if __name__ == "__main__": # pragma: no cover | |||
main() | |||
main() |
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.
Minor thing, missing newline here.
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.
good catch. I got confused by the whitespace checker output.
tgsong
approved these changes
Nov 28, 2018
aggarg
approved these changes
Nov 29, 2018
jcmvbkbc
pushed a commit
to foss-xtensa/amazon-freertos
that referenced
this pull request
Jan 27, 2022
* Xtensa: fix the coproc_area incorrect issue #2 mentioned a issue: 1. In function pxPortInitialiseStack(StackType_t *pxTopOfStack....) p = (uint32_t *)(((uint32_t) pxTopOfStack - XT_CP_SIZE) & ~0xf); In function prvInitialiseNewTask (file: task.c) pxTopOfStack = (pxStack + (ulStackDepth - 1)) & (~portBYTE_ALIGNMENT_MASK) So the co-processor area is at p = (uint32_t *)(((uint32_t)((pxStack + (ulStackDepth - 1)) & (~portBYTE_ALIGNMENT_MASK)) - XT_CP_SIZE) & ~0xf); 2. In function vPortStoreTaskMPUSettings( .... , StackType_t pxBottomOfStack ...) xMPUSettings->coproc_area = (StackType_t)((((uint32_t)(pxBottomOfStack + usStackDepth - 1)) - XT_CP_SIZE) & ~0xf); pxBottomOfStack = pxStack => xMPUSettings->coproc_area = (StackType_t*)((((uint32_t)(pxStack+ ulStackDepth - 1)) - XT_CP_SIZE ) & ~0xf); The p is coproc_area that should be equal to xMPUSettings->coproc_area. For example, assume pxStack is 0xa0000000, ulStackDepth is 0x2000, portBYTE_ALIGNMENT_MASK is 0x7f, XT_CP_SIZE is 0x100. The p = (uint32_t)(((uint32_t)((pxStack + (ulStackDepth - 1)) & (~portBYTE_ALIGNMENT_MASK)) - XT_CP_SIZE) & ~0xf) = 0xa0001e80 The xMPUSettings->coproc_area = (StackType_t)((((uint32_t)(pxStack+ usStackDepth - 1)) - XT_CP_SIZE ) & ~0xf) = 0xa0001ef0 Obviously, the p is not equal to the xMPUSettings->coproc_area, which will cause context switching error. Signed-off-by: magicse7en <magicse7en@outlook.com> * Update port.c Co-authored-by: Carl Lundin <53273776+lundinc2@users.noreply.github.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
PKCS #11 types may follow the format CK_TYPE_PTR or CK_TYPE_PTR_PTR.
This change updates the style checker to recognize _PTR and _PTR_PTR
line endings as pointer types.
This change also allows variables to start with a number.
Checklist:
I have tested my changes. No regression in existing tests.My code is Linted.