source: icGREP/icgrep-devel/icgrep/kernels/callback.cpp

Last change on this file was 6207, checked in by cameron, 8 months ago

Generic callback signals

File size: 703 bytes
Line 
1/*
2 *  Copyright (c) 2018 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6#include <kernels/callback.h>
7#include <llvm/Support/ErrorHandling.h>
8using namespace kernel;
9
10
11extern "C" void signal_dispatcher(intptr_t callback_object_addr, unsigned signal) {
12    reinterpret_cast<SignallingObject *>(callback_object_addr)->handle_signal(signal);
13}
14
15void SignallingObject::handle_signal(unsigned s) {
16    mSignalCount++;
17    mLastSignal = s;
18}
19
20unsigned SignallingObject::getSignalCount() {
21    return mSignalCount;
22}
23
24unsigned SignallingObject::getLastSignal() {
25    return mLastSignal;
26}
27
Note: See TracBrowser for help on using the repository browser.