//
// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
//
// The contents of this file are covered under the licence agreement in the
// file "LICENCE" distributed with Cforall.
//
// preemption.h --
//
// Author           : Thierry Delisle
// Created On       : Mon Jun 5 14:20:42 2017
// Last Modified By : Peter A. Buhr
// Last Modified On : Fri Jul 21 22:34:25 2017
// Update Count     : 1
//

#pragma once

#include "alarm.h"
#include "kernel_private.h"

__attribute__((weak)) unsigned int default_preemption();
void kernel_start_preemption();
void kernel_stop_preemption();
void update_preemption( processor * this, __cfa_time_t duration );
void tick_preemption();

struct preemption_scope {
	alarm_node_t alarm;
	processor * proc;
};

void ?{}( preemption_scope * this, processor * proc );
void ^?{}( preemption_scope * this );

// Local Variables: //
// mode: c //
// tab-width: 4 //
// End: //
