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

Investigate Rewriting Interrupt/Exception Handlers Purely in C/C++ #344

Open
Kfeavel opened this issue Dec 18, 2021 · 1 comment
Open

Investigate Rewriting Interrupt/Exception Handlers Purely in C/C++ #344

Kfeavel opened this issue Dec 18, 2021 · 1 comment
Labels
enhancement An improvement on a pre-existing code

Comments

@Kfeavel
Copy link
Member

Kfeavel commented Dec 18, 2021

struct interrupt_frame;

__attribute__ ((interrupt))
void
f (struct interrupt_frame *frame)
{
}
#ifdef __x86_64__
typedef unsigned long long int uword_t;
#else
typedef unsigned int uword_t;
#endif

struct interrupt_frame;

__attribute__ ((interrupt))
void
f (struct interrupt_frame *frame, uword_t error_code)
{
  ...
}

https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html

@Kfeavel Kfeavel added the enhancement An improvement on a pre-existing code label Dec 18, 2021
@Kfeavel
Copy link
Member Author

Kfeavel commented Jan 8, 2022

As much as I would like to use this, unfortunately there's no way to differentiate interrupts from one another using this method, unless we want to do something similar to what we're already doing in assembly where we have a separate function for each interrupt/exception.

That might be worth doing, but it wouldn't really gain us anything (other than removing more assembly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement on a pre-existing code
Projects
None yet
Development

No branches or pull requests

1 participant