// vi:set ft=cpp: -*- Mode: C++ -*- /** * \file * Exception C++ interface. */ /* * (c) 2014 Alexander Warg * * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. * Please see the COPYING-GPL-2 file for details. * * As a special exception, you may use this file as part of a free software * library without restriction. Specifically, if other files instantiate * templates or use macros or inline functions from this file, or you compile * this file and link it with other files to produce an executable, this * file does not by itself cause the resulting executable to be covered by * the GNU General Public License. This exception does not however * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. */ #pragma once #include #include #include #include namespace L4 { /** * Exception interface. * * This class defines the interface for handling exception IPC. When an * exception occurs during program execution, for example due to a division by * zero, the kernel will synthesise an exception IPC and send it to the * thread's exception handler, who can then handle it. * * The exception handler is set with the L4::Thread::control interface. */ class L4_EXPORT Exception : public Kobject_0t { public: // TODO: pass a reference/pointer to the UTCB not copy the regs /** * Exception call * * \param regs Register state of the faulting thread. * \param rwin Receive window in the address space. * \param[out] fp Optional flex-page to resolve the exception. * * \return Message tag containing error code. * */ L4_INLINE_RPC( l4_msgtag_t, exception, (L4::Ipc::In_out regs, L4::Ipc::Rcv_fpage rwin, L4::Ipc::Opt fp)); typedef L4::Typeid::Rpc_nocode Rpcs; }; }