-
Notifications
You must be signed in to change notification settings - Fork 20
Bug/syscall return #276
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
Bug/syscall return #276
Changes from all commits
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 |
|---|---|---|
|
|
@@ -49,8 +49,13 @@ static inline void syscall_restore(void) { | |
| } | ||
|
|
||
| static inline long syscall_return(long return_code) { | ||
| register long ret asm(STR(_ASM_AX)) = return_code; | ||
| return ret; | ||
| /* clang-format off */ | ||
| asm volatile( | ||
| "mov %[ret], %%" STR(_ASM_AX) "\n" | ||
| ::[ret] "r"(return_code) | ||
| ); | ||
| /* clang-format on */ | ||
| return return_code; | ||
| } | ||
|
Contributor
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. WTF is this?! Why isn't this a simple
Contributor
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. You are right of course, the current implementation of syscall handling is indeed quite fragile. I plan to improve it all at some point. |
||
|
|
||
| static inline void stack_switch(void) { | ||
|
|
||
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.
mtoolsis needed for creating the ISO viagrub-mkrescue? If so, you should mention that in the commit log, at least. However, it should already had been installed via thegrub2-commonpackage, as that depends ongrub-commonwhich "suggests"mtools. But yeah, it's not a strong dependency, so we may want to make it explicit.