does gcc support any function type like "interrupt", like the one found in the borland/turbo compilers? or is there any __attribute__ to manage it somehow like omit the entry and exit instructions for a function?
i have coded the wrapper functions, but those are in asm and i want the functionality in C.
GCC
Re:GCC
For this reasons I use something like this :
Code: Select all
[section .text]
extern _handle_trap
%macro define_trap 2
global _trap%1
_trap%1:
%if %2 == 0 ; if this trap does'nt produce error code
push 0
%endif
push %1h ; push trap number
jmp _main_handler
%endm
_main_handler:
pushad
...
push esp
call _handle_trap
add esp, 4
...
popad
add esp, 8
iretd
Code: Select all
void handle_trap( trap_ctx *ctx )
{
...
}