@@ -31,12 +31,14 @@ mod user;
31
31
32
32
use core:: sync:: atomic:: { AtomicBool , Ordering } ;
33
33
34
- use devices:: { self , get_int_device} ;
34
+ use devices:: { self , get_int_device, VIRT_ADDR_START } ;
35
35
use executor:: current_task;
36
36
use frame_allocator:: { self , frame_alloc_persist, frame_unalloc} ;
37
37
use polyhal:: addr:: { PhysPage , VirtPage } ;
38
+ use polyhal:: common:: { get_fdt, get_mem_areas, PageAlloc } ;
38
39
use polyhal:: irq:: IRQ ;
39
- use polyhal:: { get_mem_areas, PageAlloc , TrapFrame , TrapFrameArgs , TrapType , VIRT_ADDR_START } ;
40
+ use polyhal:: trap:: TrapType ;
41
+ use polyhal:: trapframe:: { TrapFrame , TrapFrameArgs } ;
40
42
use tasks:: UserTask ;
41
43
use user:: user_cow_int;
42
44
use vfscore:: OpenFlags ;
@@ -155,7 +157,7 @@ fn main(hart_id: usize) {
155
157
// initialize logging module
156
158
logging:: init ( option_env ! ( "LOG" ) ) ;
157
159
158
- polyhal:: init ( & PageAllocImpl ) ;
160
+ polyhal:: common :: init ( & PageAllocImpl ) ;
159
161
get_mem_areas ( ) . into_iter ( ) . for_each ( |( start, size) | {
160
162
info ! ( "memory area: {:#x} - {:#x}" , start, start + size) ;
161
163
frame_allocator:: add_frame_map ( start, start + size) ;
@@ -170,7 +172,7 @@ fn main(hart_id: usize) {
170
172
171
173
devices:: prepare_drivers ( ) ;
172
174
173
- if let Some ( fdt) = polyhal :: get_fdt ( ) {
175
+ if let Some ( fdt) = get_fdt ( ) {
174
176
for node in fdt. all_nodes ( ) {
175
177
devices:: try_to_add_device ( & node) ;
176
178
}
@@ -179,7 +181,8 @@ fn main(hart_id: usize) {
179
181
// get devices and init
180
182
devices:: regist_devices_irq ( ) ;
181
183
182
- polyhal:: instruction:: Instruction :: ebreak ( ) ;
184
+ // TODO: test ebreak
185
+ // Instruction::ebreak();
183
186
184
187
// initialize filesystem
185
188
fs:: init ( ) ;
@@ -221,6 +224,7 @@ fn main(hart_id: usize) {
221
224
222
225
// init kernel threads and async executor
223
226
tasks:: init ( ) ;
227
+ log:: info!( "run tasks" ) ;
224
228
// loop { arch::wfi() }
225
229
tasks:: run_tasks ( ) ;
226
230
0 commit comments