-
Notifications
You must be signed in to change notification settings - Fork 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
native: *long* overdue fixes #2071
Changes from all commits
535eda8
3b6d059
83886d6
237340b
0b72be7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,13 @@ __native_sig_leave_tramp: | |
popfl | ||
|
||
ret | ||
|
||
.globl __native_sig_leave_handler | ||
__native_sig_leave_handler: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why double underscores on MACH and single underscores on the others? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Apple - think different. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. haha, nice one! |
||
pushl __native_saved_eip | ||
movl $0x0, __native_in_isr | ||
ret | ||
|
||
#elif __arm__ | ||
|
||
.globl _native_sig_leave_tramp | ||
|
@@ -65,6 +72,26 @@ _native_sig_leave_tramp: | |
ldmia sp!, {r0-r12} | ||
ldmia sp!, {pc} | ||
|
||
.globl _native_sig_leave_handler | ||
_native_sig_leave_handler: | ||
stmdb sp!, {r0} | ||
ldr r0, =_native_saved_eip | ||
ldr r0, [r0] | ||
stmdb sp!, {r0-r12} | ||
stmdb sp!, {lr} | ||
/* exchange r0 and _native_saved_eip */ | ||
ldr r0, [sp,#56] | ||
ldr r1, [sp,#4 ] | ||
str r0, [sp,#4 ] | ||
str r1, [sp,#56] | ||
/* _native_in_isr = 0 */ | ||
eor r0, r0, r0 | ||
ldr r1, =_native_in_isr | ||
str r0, [r1] | ||
ldmia sp!, {lr} | ||
ldmia sp!, {r0-r12} | ||
ldmia sp!, {pc} | ||
|
||
#else | ||
.globl _native_sig_leave_tramp | ||
|
||
|
@@ -85,4 +112,10 @@ _native_sig_leave_tramp: | |
popfl | ||
|
||
ret | ||
|
||
.globl _native_sig_leave_handler | ||
_native_sig_leave_handler: | ||
pushl _native_saved_eip | ||
movl $0x0, _native_in_isr | ||
ret | ||
#endif |
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.
This may lead to running the wrong thread. After
isr_cpu_switch_context_exit()
is called, the previous thread is restored beforesched_run()
is getting called.