-
-
Notifications
You must be signed in to change notification settings - Fork 669
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
Fix of red screen #1676
Fix of red screen #1676
Conversation
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.
PR looks good, left one suggestion to consider
void shutdown(void) { | ||
#ifdef USE_SVC_SHUTDOWN | ||
svc_shutdown(); | ||
#else | ||
// It won't work properly unless called from the privileged mode | ||
shutdown_privileged(); | ||
#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.
Maybe we can use define instead of a function here.
But maybe that's over-optimizing stuff and compiler does this anyway ...
void shutdown(void) { | |
#ifdef USE_SVC_SHUTDOWN | |
svc_shutdown(); | |
#else | |
// It won't work properly unless called from the privileged mode | |
shutdown_privileged(); | |
#endif | |
} | |
#ifdef USE_SVC_SHUTDOWN | |
#define shutdown svc_shutdown | |
#else | |
// It won't work properly unless called from the privileged mode | |
#define shutdown shutdown_privileged | |
#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.
But maybe that's over-optimizing stuff and compiler does this anyway ...
Yes, compiler inlines it. I'd leave it as it is.
f1c6cdc
to
2c61e65
Compare
This PR fixes #1658.
From my point of view, the cause of the issue is that
shutdown()
is called from the unprivileged mode (see this comment). To solve that, I implemented a SVC handler that callsshutdown()
from the privileged mode.