Handout
This commit is contained in:
50
interrupt/epilogues.h
Normal file
50
interrupt/epilogues.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*! \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 g
|
||||
*/
|
||||
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 g
|
||||
*/
|
||||
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)
|
||||
*/
|
||||
void assassin(Vault& g);
|
||||
}; // namespace Epilogues
|
||||
Reference in New Issue
Block a user