forked from vsrinivas/fuchsia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingleton.cc
45 lines (34 loc) · 1.23 KB
/
singleton.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2016 The Fuchsia Authors
//
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT
// This file defines:
// * Initialization code for kernel/object module
// * Singleton instances
#include <inttypes.h>
#include <lib/cmdline.h>
#include <lib/crashlog.h>
#include <zircon/boot/crash-reason.h>
#include <zircon/syscalls/object.h>
#include <zircon/types.h>
#include <lk/init.h>
#include <object/diagnostics.h>
#include <object/event_dispatcher.h>
#include <object/executor.h>
#include <object/job_dispatcher.h>
#include <object/memory_watchdog.h>
#include <platform/crashlog.h>
#include <platform/halt_helper.h>
static Executor gExecutor;
fbl::RefPtr<JobDispatcher> GetRootJobDispatcher() { return gExecutor.GetRootJobDispatcher(); }
Handle* GetRootJobHandle() { return gExecutor.GetRootJobHandle(); }
fbl::RefPtr<EventDispatcher> GetMemPressureEvent(uint32_t kind) {
return gExecutor.GetMemPressureEvent(kind);
}
void StartRootJobObserver() { gExecutor.StartRootJobObserver(); }
static void object_init(uint level) TA_NO_THREAD_SAFETY_ANALYSIS {
Handle::Init();
gExecutor.Init();
}
LK_INIT_HOOK(libobject, object_init, LK_INIT_LEVEL_THREADING)