2 * Copyright 2012, Alex Smith, alex@alex-smith.me.uk.
3 * Distributed under the terms of the MIT License.
7 #include "x86_signals.h"
11 #include <KernelExport.h>
19 extern "C" void x86_64_user_signal_handler(void);
20 extern int x86_64_user_signal_handler_end
;
24 x86_initialize_commpage_signal_handler()
26 void* handlerCode
= (void*)&x86_64_user_signal_handler
;
27 void* handlerCodeEnd
= &x86_64_user_signal_handler_end
;
29 // Copy the signal handler code to the commpage.
30 size_t len
= (size_t)((addr_t
)handlerCodeEnd
- (addr_t
)handlerCode
);
31 addr_t position
= fill_commpage_entry(COMMPAGE_ENTRY_X86_SIGNAL_HANDLER
,
34 // Add symbol to the commpage image.
35 image_id image
= get_commpage_image();
36 elf_add_memory_image_symbol(image
, "commpage_signal_handler", position
,
37 len
, B_SYMBOL_TYPE_TEXT
);