Skip to content

Commit 0d55519

Browse files
committed
remove failures by cherry-picking
1 parent c74b67f commit 0d55519

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/arch/x86_64/kernel/start.rs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,25 @@ extern "C" {
1212
pub fn main();
1313
}
1414

15+
#[cfg(not(test))]
16+
#[no_mangle]
17+
pub unsafe extern "C" fn pre_main() -> ! {
18+
main();
19+
20+
loop {}
21+
}
22+
1523
#[cfg(not(test))]
1624
#[no_mangle]
1725
#[naked]
1826
pub unsafe extern "C" fn _start() -> ! {
19-
// be sure that rsp is a valid stack pointer
20-
asm!("lea rax, {1}",
21-
"add rax, {offset}",
22-
"mov rsp, rax",
23-
"call {0}",
24-
"L0: jmp L0",
25-
sym main,
26-
sym BOOT_STACK,
27-
offset = const STACK_SIZE - 16,
27+
asm!(
28+
// initialize stack pointer
29+
"lea rsp, [{stack}+{size}]",
30+
"call {pre_main}",
31+
stack = sym BOOT_STACK,
32+
size = const STACK_SIZE - 16,
33+
pre_main = sym pre_main,
2834
options(noreturn)
2935
);
30-
}
36+
}

src/arch/x86_64/mm/paging.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,7 @@ impl<S: PageSize> Page<S> {
238238
#[inline(always)]
239239
fn flush_from_tlb(&self) {
240240
unsafe {
241-
<<<<<<< HEAD
242-
asm!("invlpg [{0}]", in(reg) self.virtual_address, options(nostack));
243-
=======
244241
asm!("invlpg [{}]", in(reg) self.virtual_address, options(preserves_flags, nostack));
245-
>>>>>>> 7d66029... convert inline assmebly to the new assembly format
246242
}
247243
}
248244

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_fn, asm, lang_items)]
1+
#![feature(asm, lang_items)]
22
#![feature(allocator_api)]
33
#![feature(global_asm)]
44
#![feature(panic_info_message)]

src/scheduler/scheduler.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,7 @@ impl Scheduler {
250250

251251
self.current_task = new_task;
252252

253-
unsafe {
254-
switch(current_stack_pointer, new_stack_pointer);
255-
}
253+
switch(current_stack_pointer, new_stack_pointer);
256254
}
257255
_ => {}
258256
}

0 commit comments

Comments
 (0)