Skip to content
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

Amend prototypes for exception handlers and interrupt handlers/callbacks #24

Merged
merged 3 commits into from
Apr 17, 2018
Merged

Conversation

lioncash
Copy link
Contributor

@lioncash lioncash commented Apr 17, 2018

__exception_sethandler() expects handler functions taking a frame_context*, and IRQ_Request expects functions taking a u32 signifying an IRQ and a void* for passing along any extra contextual data.

_exceptionhandlertable expected functions that take a frame_context*.
IRQ_Request expects a function taking a u32 followed by a void* context pointer.
The only reason this didn't cause warnings previously is because an old-style prototype
was used.
libogc/system.c Outdated
@@ -437,7 +437,7 @@ static void __STMEventHandler(u32 event)
if(ret) {
_CPU_ISR_Disable(level);
__sys_resetdown = 1;
__RSWCallback();
__RSWCallback(IRQ_PI_RSW, NULL);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also have the "if(__RSWCallback)" check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Good catch, I'll update that.

…callback in __STMEventHandler()

__RSWHandler() checks if the callback is valid before calling it, so we should do the same here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants