-
Notifications
You must be signed in to change notification settings - Fork 1.5k
pollnotify: we should send poll events before semaphore incrementes. #2071
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
Merged
Conversation
This file contains hidden or 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
There is a good case on sim platform: When we input some cmd and click enter key to start application in terminal, this context will change to application from IDLE loop. Althrough entey key '\r' has been received to recv buffer and complete post semaphore of reader, but pollnotify may not be called because context change. So when application run poll function, because no events happend and poll enter wait, context will again change to IDLE loop, this pollnotify of IDLE loop will run to send poll events, poll function of applicaton will wake up. It's wrong! Change-Id: I812a889f2e90781a9c3cb4b0251cccc4d32bebd1 Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
extinguish
pushed a commit
to extinguish/nuttx
that referenced
this pull request
Aug 6, 2024
common/gnu/fork.S 29: unknown instruction .syntax unified --^ [asarm] (error apache#2230) common/gnu/fork.S 81: bad directive .type up_fork , function ------------------^ [asarm] (error apache#2067) armv7-m/arm_saveusercontext.S 31: unknown instruction .syntax unified --^ [asarm] (error apache#2230) armv7-m/arm_saveusercontext.S 55: bad directive .type up_saveusercontext , % function --^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 65: not within valid register range str r12 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 4 ) ) ] ------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 66: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 5 ) ) ] ------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 67: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 6 ) ) ] ------^ [asarm] (error apache#2014) armv7-m/arm_saveusercontext.S 72: expected a register str r1 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 7 ) ) ] ------------------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 75: not within valid register range add r1 , r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 8 ) ) -----------^ [asarm] (error apache#2071) armv7-m/arm_saveusercontext.S 89: bad parameter stmia r0 ! , { r2 - r11 } --------^ [asarm] (error apache#2014) armv7-m/arm_saveusercontext.S 93: expected a register mov r1 , - 1 -----------^ Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
extinguish
pushed a commit
to extinguish/nuttx
that referenced
this pull request
Aug 6, 2024
common/gnu/fork.S 29: unknown instruction .syntax unified --^ [asarm] (error apache#2230) common/gnu/fork.S 81: bad directive .type up_fork , function ------------------^ [asarm] (error apache#2067) armv7-m/arm_saveusercontext.S 31: unknown instruction .syntax unified --^ [asarm] (error apache#2230) armv7-m/arm_saveusercontext.S 55: bad directive .type up_saveusercontext , % function --^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 65: not within valid register range str r12 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 4 ) ) ] ------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 66: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 5 ) ) ] ------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 67: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 6 ) ) ] ------^ [asarm] (error apache#2014) armv7-m/arm_saveusercontext.S 72: expected a register str r1 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 7 ) ) ] ------------------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 75: not within valid register range add r1 , r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 8 ) ) -----------^ [asarm] (error apache#2071) armv7-m/arm_saveusercontext.S 89: bad parameter stmia r0 ! , { r2 - r11 } --------^ [asarm] (error apache#2014) armv7-m/arm_saveusercontext.S 93: expected a register mov r1 , - 1 -----------^ Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
extinguish
pushed a commit
to extinguish/nuttx
that referenced
this pull request
Aug 10, 2024
common/gnu/fork.S 29: unknown instruction .syntax unified --^ [asarm] (error apache#2230) common/gnu/fork.S 81: bad directive .type up_fork , function ------------------^ [asarm] (error apache#2067) armv7-m/arm_saveusercontext.S 31: unknown instruction .syntax unified --^ [asarm] (error apache#2230) armv7-m/arm_saveusercontext.S 55: bad directive .type up_saveusercontext , % function --^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 65: not within valid register range str r12 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 4 ) ) ] ------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 66: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 5 ) ) ] ------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 67: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 6 ) ) ] ------^ [asarm] (error apache#2014) armv7-m/arm_saveusercontext.S 72: expected a register str r1 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 7 ) ) ] ------------------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 75: not within valid register range add r1 , r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 8 ) ) -----------^ [asarm] (error apache#2071) armv7-m/arm_saveusercontext.S 89: bad parameter stmia r0 ! , { r2 - r11 } --------^ [asarm] (error apache#2014) armv7-m/arm_saveusercontext.S 93: expected a register mov r1 , - 1 -----------^ Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
extinguish
added a commit
to extinguish/nuttx
that referenced
this pull request
Aug 10, 2024
according to armv6-m/armv7-m arch reference manual:
the three ISB {<opt>}, DSB {<opt>}, DMB {<opt>} instructions <opt>
field are defined as:
Specifies an optional limitation on the ISB/DSB/DMB operation. Allowered
values are:
Full system ISB/DSB/DMB operation, encoded as option=='1111'. Can be
omitted.
All other encodings of the options are RESERVED.
the "#opt" field of "isb #opt"
So we could remove the options field in Armv7-m platform.
The following are the build error with greenhills compiler:
CC: common/arm_exit.c [asarm] (error apache#2071) /tmp/gh_001h70j1.si 92: bad parameter
isb 15
------^
[asarm] (error apache#2071) /tmp/gh_001h70j1.si 112: bad parameter
isb 15
------^
[asarm] (error) errors during processing
According to armv8-m arch reference manual:
the ISB/DMB instruction's "opt" encoding rule is same as
armv6-m/armv7-m, but the "DSB" instruction is different, in armv8-m, the
"DSB {<opt>}" field has two valid encoding options: 0b0000, 0b0100.
and all other encoding options are reserved.
In Armv7-a/Armv8-a, the dsb/dmb option field has 8 valid state value.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
extinguish
pushed a commit
to extinguish/nuttx
that referenced
this pull request
Aug 11, 2024
common/gnu/fork.S 29: unknown instruction .syntax unified --^ [asarm] (error apache#2230) common/gnu/fork.S 81: bad directive .type up_fork , function ------------------^ [asarm] (error apache#2067) armv7-m/arm_saveusercontext.S 31: unknown instruction .syntax unified --^ [asarm] (error apache#2230) armv7-m/arm_saveusercontext.S 55: bad directive .type up_saveusercontext , % function --^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 65: not within valid register range str r12 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 4 ) ) ] ------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 66: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 5 ) ) ] ------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 67: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 6 ) ) ] ------^ [asarm] (error apache#2014) armv7-m/arm_saveusercontext.S 72: expected a register str r1 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 7 ) ) ] ------------------^ [asarm] (error apache#2004) armv7-m/arm_saveusercontext.S 75: not within valid register range add r1 , r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 8 ) ) -----------^ [asarm] (error apache#2071) armv7-m/arm_saveusercontext.S 89: bad parameter stmia r0 ! , { r2 - r11 } --------^ [asarm] (error apache#2014) armv7-m/arm_saveusercontext.S 93: expected a register mov r1 , - 1 -----------^ Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
extinguish
added a commit
to extinguish/nuttx
that referenced
this pull request
Aug 11, 2024
according to armv6-m/armv7-m arch reference manual:
the three ISB {<opt>}, DSB {<opt>}, DMB {<opt>} instructions <opt>
field are defined as:
Specifies an optional limitation on the ISB/DSB/DMB operation. Allowered
values are:
Full system ISB/DSB/DMB operation, encoded as option=='1111'. Can be
omitted.
All other encodings of the options are RESERVED.
the "#opt" field of "isb #opt"
So we could remove the options field in Armv7-m platform.
The following are the build error with greenhills compiler:
CC: common/arm_exit.c [asarm] (error apache#2071) /tmp/gh_001h70j1.si 92: bad parameter
isb 15
------^
[asarm] (error apache#2071) /tmp/gh_001h70j1.si 112: bad parameter
isb 15
------^
[asarm] (error) errors during processing
According to armv8-m arch reference manual:
the ISB/DMB instruction's "opt" encoding rule is same as
armv6-m/armv7-m, but the "DSB" instruction is different, in armv8-m, the
"DSB {<opt>}" field has two valid encoding options: 0b0000, 0b0100.
and all other encoding options are reserved.
In Armv7-a/Armv8-a, the dsb/dmb option field has 8 valid state value.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
acassis
pushed a commit
that referenced
this pull request
Aug 11, 2024
common/gnu/fork.S 29: unknown instruction .syntax unified --^ [asarm] (error #2230) common/gnu/fork.S 81: bad directive .type up_fork , function ------------------^ [asarm] (error #2067) armv7-m/arm_saveusercontext.S 31: unknown instruction .syntax unified --^ [asarm] (error #2230) armv7-m/arm_saveusercontext.S 55: bad directive .type up_saveusercontext , % function --^ [asarm] (error #2004) armv7-m/arm_saveusercontext.S 65: not within valid register range str r12 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 4 ) ) ] ------^ [asarm] (error #2004) armv7-m/arm_saveusercontext.S 66: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 5 ) ) ] ------^ [asarm] (error #2004) armv7-m/arm_saveusercontext.S 67: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 6 ) ) ] ------^ [asarm] (error #2014) armv7-m/arm_saveusercontext.S 72: expected a register str r1 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 7 ) ) ] ------------------^ [asarm] (error #2004) armv7-m/arm_saveusercontext.S 75: not within valid register range add r1 , r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 8 ) ) -----------^ [asarm] (error #2071) armv7-m/arm_saveusercontext.S 89: bad parameter stmia r0 ! , { r2 - r11 } --------^ [asarm] (error #2014) armv7-m/arm_saveusercontext.S 93: expected a register mov r1 , - 1 -----------^ Signed-off-by: yanghuatao <yanghuatao@xiaomi.com>
acassis
pushed a commit
that referenced
this pull request
Aug 11, 2024
according to armv6-m/armv7-m arch reference manual:
the three ISB {<opt>}, DSB {<opt>}, DMB {<opt>} instructions <opt>
field are defined as:
Specifies an optional limitation on the ISB/DSB/DMB operation. Allowered
values are:
Full system ISB/DSB/DMB operation, encoded as option=='1111'. Can be
omitted.
All other encodings of the options are RESERVED.
the "#opt" field of "isb #opt"
So we could remove the options field in Armv7-m platform.
The following are the build error with greenhills compiler:
CC: common/arm_exit.c [asarm] (error #2071) /tmp/gh_001h70j1.si 92: bad parameter
isb 15
------^
[asarm] (error #2071) /tmp/gh_001h70j1.si 112: bad parameter
isb 15
------^
[asarm] (error) errors during processing
According to armv8-m arch reference manual:
the ISB/DMB instruction's "opt" encoding rule is same as
armv6-m/armv7-m, but the "DSB" instruction is different, in armv8-m, the
"DSB {<opt>}" field has two valid encoding options: 0b0000, 0b0100.
and all other encoding options are reserved.
In Armv7-a/Armv8-a, the dsb/dmb option field has 8 valid state value.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
we should send poll events before semaphore incrementes.
There is a good case on sim platform:
When we input some cmd and click enter key to start application in terminal,
this context will change to application from IDLE loop. Althrough entey key '\r'
has been received to recv buffer and complete post semaphore of reader, but
pollnotify may not be called because context change. So when application run
poll function, because no events happend and poll enter wait, context will
again change to IDLE loop, this pollnotify of IDLE loop will run to send poll
events, poll function of applicaton will wake up. It's wrong!
Impact
Testing
daily test