mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-27 13:58:20 +00:00
fix(amd64): do sti at another point
This commit is contained in:
@@ -77,12 +77,11 @@ fn early_cpu_init() linksection(r.init) void {
|
|||||||
|
|
||||||
// Enable syscall if supported.
|
// Enable syscall if supported.
|
||||||
efer.sce = f.syscall;
|
efer.sce = f.syscall;
|
||||||
|
|
||||||
// Enable NX.
|
// Enable NX.
|
||||||
efer.nxe = true;
|
efer.nxe = true;
|
||||||
|
|
||||||
amd64.write_msr(.Efer, @bitCast(efer));
|
amd64.write_msr(.Efer, @bitCast(efer));
|
||||||
|
|
||||||
amd64.sti();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ap_entry(cpu_id: u32, booted: *std.atomic.Value(usize)) noreturn {
|
pub fn ap_entry(cpu_id: u32, booted: *std.atomic.Value(usize)) noreturn {
|
||||||
@@ -94,6 +93,8 @@ pub fn ap_entry(cpu_id: u32, booted: *std.atomic.Value(usize)) noreturn {
|
|||||||
|
|
||||||
ki.sched.percpu.local().current_thread = pl.impl.smp.start_thread.local().*;
|
ki.sched.percpu.local().current_thread = pl.impl.smp.start_thread.local().*;
|
||||||
|
|
||||||
|
amd64.sti();
|
||||||
|
|
||||||
_ = booted.fetchAdd(1, .monotonic);
|
_ = booted.fetchAdd(1, .monotonic);
|
||||||
ke.ipl.lower(.Passive);
|
ke.ipl.lower(.Passive);
|
||||||
|
|
||||||
@@ -115,4 +116,5 @@ pub fn early_init() linksection(r.init) void {
|
|||||||
amd64.write_msr(.GsBase, 0);
|
amd64.write_msr(.GsBase, 0);
|
||||||
|
|
||||||
int.init();
|
int.init();
|
||||||
|
amd64.sti();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user