source: src/libcfa/concurrency/kernel_private.h@ 405c592

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since 405c592 was ec35498, checked in by Thierry Delisle <tdelisle@…>, 8 years ago

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

  • Property mode set to 100644
File size: 2.2 KB
Line 
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//
8// kernel_private.h --
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
20#include "kernel"
21#include "thread"
22
23#include "alarm.h"
24
25#include "libhdr.h"
26
27//-----------------------------------------------------------------------------
28// Scheduler
29void ScheduleThread( thread_desc * );
30thread_desc * nextThread(cluster * this);
31
32void BlockInternal(void);
33void BlockInternal(spinlock * lock);
34void BlockInternal(thread_desc * thrd);
35void BlockInternal(spinlock * lock, thread_desc * thrd);
36void BlockInternal(spinlock ** locks, unsigned short count);
37void BlockInternal(spinlock ** locks, unsigned short count, thread_desc ** thrds, unsigned short thrd_count);
38
39//-----------------------------------------------------------------------------
40// Processor
41coroutine processorCtx_t {
42 processor * proc;
43};
44
45void main(processorCtx_t *);
46void start(processor * this);
47void runThread(processor * this, thread_desc * dst);
48void finishRunning(processor * this);
49void spin(processor * this, unsigned int * spin_count);
50
51struct system_proc_t {
52 processor proc;
53
54 alarm_list_t alarms;
55 spinlock alarm_lock;
56
57 bool pending_alarm;
58};
59
60extern cluster * systemCluster;
61extern system_proc_t * systemProcessor;
62extern volatile thread_local processor * this_processor;
63extern volatile thread_local unsigned short disable_preempt_count;
64
65extern "C" {
66 void disable_interrupts();
67 void enable_interrupts_noRF();
68 void enable_interrupts( const char * );
69}
70
71//-----------------------------------------------------------------------------
72// Threads
73extern "C" {
74 forall(dtype T | is_thread(T))
75 void CtxInvokeThread(T * this);
76}
77
78extern void ThreadCtxSwitch(coroutine_desc * src, coroutine_desc * dst);
79
80#endif //KERNEL_PRIVATE_H
81
82// Local Variables: //
83// mode: c //
84// tab-width: 4 //
85// End: //
Note: See TracBrowser for help on using the repository browser.