-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fixes from n64 branch #7
base: embedded
Are you sure you want to change the base?
Conversation
This mainly prevented to print panics before the systimer was set up. See the usleep() calls in freezetheworld(). This comes with the possibility to have a non-monotonic jump in time when the systimer is finally set. Systimer implementations must respect the dummyNanoseconds if there is a risk.
@@ -75,7 +75,9 @@ import ( | |||
// Tasker code does not use FPU so the architecture specific context switch | |||
// code can avoid saving/restoring FPU context if not need. | |||
|
|||
func dummyNanotime() int64 { return 1 } | |||
var dummyNanoseconds int64 |
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.
Should be an atomic to do this properly
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.
Nice and simple solution.
Yes, use internal/atomic.Xadd64. It should work on a 64-bit CPU without any problem but I don't know what about 32-bit ARM.
Try test it on your Teensy if you can. Or apply to the the wip and try to use GOTARGET=noostest GOARCH=thumb emgo test
. You must set the system timer back to this implementation because the ARMv7-M SYSTICK is used by default. Don't forgot to set the start value of dummyNanoseconds to something bigger that the last rtos.Nanotime().
For now I plan to collect such new noos tests here: https://github.com/embeddedgo/noostest/tree/master/tests
If you are unsure how to do all this please ask me. I can also try to invent a proper test myself if yow want.
I cherry-picked 4b8a81f into master-embedded. According
I think we can try to implement both As I see, the func usleep(us uint32) {
for i := range (1 + us/16) {
osyield()
// or maybe yield_m()
}
} |
It seems that sysmon uses func usleep(us uint32) {
if thetasker.nanotime != dummyNanotime && tasker.newnanotime == nil {
nanosleep(uint64(us) * 1000)
return
}
for i := range (1 + us/32) {
osyield()
}
} The |
Here are some changes from #6 that are unrelated to mips64 support. I created a separate PR to get your opinion on this. Please have a look at the commits.