source: src/libcfa/concurrency/kernel_private.h @ 0322865c

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 0322865c was 2ac095d, checked in by Thierry Delisle <tdelisle@…>, 7 years ago

Added macros for parameters only present in debug

  • Property mode set to 100644
File size: 2.4 KB
RevLine 
[75f3522]1//                              -*- Mode: CFA -*-
2//
3// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
4//
5// The contents of this file are covered under the licence agreement in the
6// file "LICENCE" distributed with Cforall.
7//
[75a17f1]8// kernel_private.h --
[75f3522]9//
10// Author           : Thierry Delisle
11// Created On       : Mon Feb 13 12:27:26 2017
12// Last Modified By : Thierry Delisle
13// Last Modified On : --
14// Update Count     : 0
15//
16
17#ifndef KERNEL_PRIVATE_H
18#define KERNEL_PRIVATE_H
19
[2ac095d]20#include "libhdr.h"
21
[75f3522]22#include "kernel"
[75a17f1]23#include "thread"
[75f3522]24
[fa21ac9]25#include "alarm.h"
26
[4aa2fb2]27
[75f3522]28//-----------------------------------------------------------------------------
29// Scheduler
[1c273d0]30
31extern "C" {
32        void disable_interrupts();
33        void enable_interrupts_noRF();
[2ac095d]34        void enable_interrupts( DEBUG_CTX_PARAM );
[1c273d0]35}
36
[348006f]37void ScheduleThread( thread_desc * );
[1c273d0]38static inline void WakeThread( thread_desc * thrd ) {
39        if( !thrd ) return;
40
41        disable_interrupts();
42        ScheduleThread( thrd );
[2ac095d]43        enable_interrupts( DEBUG_CTX );
[1c273d0]44}
[348006f]45thread_desc * nextThread(cluster * this);
[75f3522]46
[82ff5845]47void BlockInternal(void);
48void BlockInternal(spinlock * lock);
49void BlockInternal(thread_desc * thrd);
50void BlockInternal(spinlock * lock, thread_desc * thrd);
51void BlockInternal(spinlock ** locks, unsigned short count);
52void BlockInternal(spinlock ** locks, unsigned short count, thread_desc ** thrds, unsigned short thrd_count);
[db6f06a]53
[75f3522]54//-----------------------------------------------------------------------------
55// Processor
[fa21ac9]56coroutine processorCtx_t {
[75f3522]57        processor * proc;
58};
59
60void main(processorCtx_t *);
[db6f06a]61void start(processor * this);
[348006f]62void runThread(processor * this, thread_desc * dst);
[db6f06a]63void finishRunning(processor * this);
[75f3522]64void spin(processor * this, unsigned int * spin_count);
65
[fa21ac9]66struct system_proc_t {
67        processor proc;
68
69        alarm_list_t alarms;
70        spinlock alarm_lock;
[c81ebf9]71
72        bool pending_alarm;
[fa21ac9]73};
74
75extern cluster * systemCluster;
76extern system_proc_t * systemProcessor;
[4e6fb8e]77extern volatile thread_local processor * this_processor;
[1c273d0]78extern volatile thread_local coroutine_desc * this_coroutine;
79extern volatile thread_local thread_desc * this_thread;
[4e6fb8e]80extern volatile thread_local unsigned short disable_preempt_count;
[c81ebf9]81
[75f3522]82//-----------------------------------------------------------------------------
83// Threads
84extern "C" {
85      forall(dtype T | is_thread(T))
86      void CtxInvokeThread(T * this);
87}
88
[c3acb841]89extern void ThreadCtxSwitch(coroutine_desc * src, coroutine_desc * dst);
[75f3522]90
91#endif //KERNEL_PRIVATE_H
92
93// Local Variables: //
94// mode: c //
95// tab-width: 4 //
[4aa2fb2]96// End: //
Note: See TracBrowser for help on using the repository browser.