OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013-2015 Travis Geiselbrecht | 2 * Copyright (c) 2013-2015 Travis Geiselbrecht |
3 * | 3 * |
4 * Permission is hereby granted, free of charge, to any person obtaining | 4 * Permission is hereby granted, free of charge, to any person obtaining |
5 * a copy of this software and associated documentation files | 5 * a copy of this software and associated documentation files |
6 * (the "Software"), to deal in the Software without restriction, | 6 * (the "Software"), to deal in the Software without restriction, |
7 * including without limitation the rights to use, copy, modify, merge, | 7 * including without limitation the rights to use, copy, modify, merge, |
8 * publish, distribute, sublicense, and/or sell copies of the Software, | 8 * publish, distribute, sublicense, and/or sell copies of the Software, |
9 * and to permit persons to whom the Software is furnished to do so, | 9 * and to permit persons to whom the Software is furnished to do so, |
10 * subject to the following conditions: | 10 * subject to the following conditions: |
(...skipping 18 matching lines...) Expand all Loading... | |
29 #include <debug.h> | 29 #include <debug.h> |
30 #include <string.h> | 30 #include <string.h> |
31 #include <app.h> | 31 #include <app.h> |
32 #include <arch.h> | 32 #include <arch.h> |
33 #include <platform.h> | 33 #include <platform.h> |
34 #include <target.h> | 34 #include <target.h> |
35 #include <lib/heap.h> | 35 #include <lib/heap.h> |
36 #include <kernel/mutex.h> | 36 #include <kernel/mutex.h> |
37 #include <kernel/novm.h> | 37 #include <kernel/novm.h> |
38 #include <kernel/thread.h> | 38 #include <kernel/thread.h> |
39 #include <kernel/port.h> | |
39 #include <lk/init.h> | 40 #include <lk/init.h> |
40 #include <lk/main.h> | 41 #include <lk/main.h> |
41 | 42 |
42 /* saved boot arguments from whoever loaded the system */ | 43 /* saved boot arguments from whoever loaded the system */ |
43 ulong lk_boot_args[4]; | 44 ulong lk_boot_args[4]; |
44 | 45 |
45 extern void *__ctor_list; | 46 extern void *__ctor_list; |
46 extern void *__ctor_end; | 47 extern void *__ctor_end; |
47 extern int __bss_start; | 48 extern int __bss_start; |
48 extern int _end; | 49 extern int _end; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 heap_init(); | 110 heap_init(); |
110 | 111 |
111 // deal with any static constructors | 112 // deal with any static constructors |
112 dprintf(SPEW, "calling constructors\n"); | 113 dprintf(SPEW, "calling constructors\n"); |
113 call_constructors(); | 114 call_constructors(); |
114 | 115 |
115 // initialize the kernel | 116 // initialize the kernel |
116 lk_primary_cpu_init_level(LK_INIT_LEVEL_HEAP, LK_INIT_LEVEL_KERNEL - 1); | 117 lk_primary_cpu_init_level(LK_INIT_LEVEL_HEAP, LK_INIT_LEVEL_KERNEL - 1); |
117 kernel_init(); | 118 kernel_init(); |
118 | 119 |
120 // initialize the named ports. | |
121 port_init(); | |
travisg
2015/11/19 21:26:10
Should probably just move this inside kernel_init(
cpu_(ooo_6.6-7.5)
2015/11/20 22:18:46
Done.
| |
122 | |
119 lk_primary_cpu_init_level(LK_INIT_LEVEL_KERNEL, LK_INIT_LEVEL_THREADING - 1) ; | 123 lk_primary_cpu_init_level(LK_INIT_LEVEL_KERNEL, LK_INIT_LEVEL_THREADING - 1) ; |
120 | 124 |
121 // create a thread to complete system initialization | 125 // create a thread to complete system initialization |
122 dprintf(SPEW, "creating bootstrap completion thread\n"); | 126 dprintf(SPEW, "creating bootstrap completion thread\n"); |
123 thread_t *t = thread_create("bootstrap2", &bootstrap2, NULL, DEFAULT_PRIORIT Y, DEFAULT_STACK_SIZE); | 127 thread_t *t = thread_create("bootstrap2", &bootstrap2, NULL, DEFAULT_PRIORIT Y, DEFAULT_STACK_SIZE); |
124 t->pinned_cpu = 0; | 128 t->pinned_cpu = 0; |
125 thread_detach(t); | 129 thread_detach(t); |
126 thread_resume(t); | 130 thread_resume(t); |
127 | 131 |
128 // become the idle thread and enable interrupts to start the scheduler | 132 // become the idle thread and enable interrupts to start the scheduler |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
193 thread_t *t = thread_create("secondarybootstrap2", | 197 thread_t *t = thread_create("secondarybootstrap2", |
194 &secondary_cpu_bootstrap2, NULL, | 198 &secondary_cpu_bootstrap2, NULL, |
195 DEFAULT_PRIORITY, DEFAULT_STACK_SIZE); | 199 DEFAULT_PRIORITY, DEFAULT_STACK_SIZE); |
196 t->pinned_cpu = i + 1; | 200 t->pinned_cpu = i + 1; |
197 thread_detach(t); | 201 thread_detach(t); |
198 secondary_bootstrap_threads[i] = t; | 202 secondary_bootstrap_threads[i] = t; |
199 } | 203 } |
200 secondary_bootstrap_thread_count = secondary_cpu_count; | 204 secondary_bootstrap_thread_count = secondary_cpu_count; |
201 } | 205 } |
202 #endif | 206 #endif |
OLD | NEW |