You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
C++
52 lines
1.2 KiB
C++
/*! \file
|
|
* \brief XXX: Write summary
|
|
*/
|
|
#pragma once
|
|
#include "../types.h"
|
|
|
|
struct Vault;
|
|
|
|
/*! \brief A handler function for an epilogue.
|
|
* \ingroup interrupts
|
|
*
|
|
* It receives the vault directly, because it is executed on level 1/2 (by the
|
|
* \ref Guard) .
|
|
*
|
|
* \note Since it does only receive one parameter, other data must be passed
|
|
* in a different way.
|
|
*/
|
|
using Epilogue = void (*)(Vault&);
|
|
|
|
namespace Epilogues {
|
|
|
|
/*!
|
|
* @brief The keyboard epilogue.
|
|
*
|
|
* Handle the keyboard Key that has been fetched during the prologue.
|
|
*
|
|
* \todo(13) print the stored character
|
|
* \todo(15) Store the key to the keyboard buffer for user threads. Wake user
|
|
* threads waiting for a key using the key semaphore.
|
|
*
|
|
* @param v The vault.
|
|
*/
|
|
void keyboard(Vault& g);
|
|
|
|
/*!
|
|
* @brief Timer epilogue
|
|
* \todo(15) Preemptively reschedule threads
|
|
* \todo(16) Check the bellringer
|
|
* \todo(17) Refresh screen with fixed FPS rate
|
|
* @param v The vault.
|
|
*/
|
|
void timer(Vault& g);
|
|
|
|
/*! \brief Examine the `dying flag` of the current thread and reschedule if
|
|
* it is set.
|
|
*
|
|
* \todo(15) Implement the rescheduling (in \MPStuBS only)
|
|
* @param v The vault.
|
|
*/
|
|
void assassin(Vault& g);
|
|
}; // namespace Epilogues
|