forked from cloudius-systems/osv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.cc
56 lines (43 loc) · 1.14 KB
/
init.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
46
47
48
49
50
51
52
53
54
55
56
/*
* Copyright (C) 2014 Cloudius Systems, Ltd.
*
* This work is open source software, licensed under the terms of the
* BSD license as described in the LICENSE file in the top-level directory.
*/
#include <osv/debug.hh>
#include <sys/time.h>
#include <osv/mempool.hh>
#include <bsd/porting/callout.h>
#include <bsd/sys/sys/libkern.h>
#include <bsd/sys/sys/eventhandler.h>
extern "C" {
extern void system_taskq_init(void *arg);
extern void opensolaris_load(void *arg);
extern void callb_init(void *arg);
// taskqueue
#include <bsd/sys/sys/taskqueue.h>
#include <bsd/sys/sys/priority.h>
TASKQUEUE_DEFINE_THREAD(thread);
}
static void physmem_init()
{
physmem = memory::phys_mem_size / memory::page_size;
}
void bsd_init(void)
{
debug("bsd: initializing");
physmem_init();
// main taskqueue
taskqueue_define_thread(NULL);
// Initialize callouts
init_callouts();
/* Random */
struct timeval tv;
bsd_srandom(tv.tv_sec ^ tv.tv_usec);
arc4_init();
eventhandler_init(NULL);
opensolaris_load(NULL);
callb_init(NULL);
system_taskq_init(NULL);
debug(" - done\n");
}