Compare commits
2 Commits
f0d5b60b83
...
9cdf9aa71b
Author | SHA1 | Date | |
---|---|---|---|
9cdf9aa71b | |||
c455e8ea0b |
@ -1,11 +1,11 @@
|
|||||||
pub fn inb(port: u16) u8 {
|
pub inline fn inb(port: u16) u8 {
|
||||||
return asm volatile ("inb %[port], %[result]"
|
return asm volatile ("inb %[port], %[result]"
|
||||||
: [result] "={al}" (-> u8),
|
: [result] "={al}" (-> u8),
|
||||||
: [port] "N{dx}" (port),
|
: [port] "N{dx}" (port),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn outb(port: u16, value: u8) void {
|
pub inline fn outb(port: u16, value: u8) void {
|
||||||
return asm volatile ("outb %[data], %[port]"
|
return asm volatile ("outb %[data], %[port]"
|
||||||
:
|
:
|
||||||
: [port] "{dx}" (port),
|
: [port] "{dx}" (port),
|
||||||
@ -13,14 +13,14 @@ pub fn outb(port: u16, value: u8) void {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn inw(port: u16) u16 {
|
pub inline fn inw(port: u16) u16 {
|
||||||
return asm volatile ("inw %[port], %[result]"
|
return asm volatile ("inw %[port], %[result]"
|
||||||
: [result] "={ax}" (-> u16),
|
: [result] "={ax}" (-> u16),
|
||||||
: [port] "N{dx}" (port),
|
: [port] "N{dx}" (port),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn outw(port: u16, value: u16) void {
|
pub inline fn outw(port: u16, value: u16) void {
|
||||||
return asm volatile ("outw %[data], %[port]"
|
return asm volatile ("outw %[data], %[port]"
|
||||||
:
|
:
|
||||||
: [port] "{dx}" (port),
|
: [port] "{dx}" (port),
|
||||||
@ -28,14 +28,14 @@ pub fn outw(port: u16, value: u16) void {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn inl(port: u16) u32 {
|
pub inline fn inl(port: u16) u32 {
|
||||||
return asm volatile ("inl %[port], %[result]"
|
return asm volatile ("inl %[port], %[result]"
|
||||||
: [result] "={eax}" (-> u16),
|
: [result] "={eax}" (-> u16),
|
||||||
: [port] "N{dx}" (port),
|
: [port] "N{dx}" (port),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn outl(port: u16, value: u32) void {
|
pub inline fn outl(port: u16, value: u32) void {
|
||||||
return asm volatile ("outw %[data], %[port]"
|
return asm volatile ("outw %[data], %[port]"
|
||||||
:
|
:
|
||||||
: [port] "{dx}" (port),
|
: [port] "{dx}" (port),
|
||||||
|
@ -59,7 +59,7 @@ pub fn switchTask(regs: *interrupts.InterruptStackFrame, new_task: *ThreadContro
|
|||||||
pub fn fetchNewTask(core: *cpu.arch.Core, should_idle_if_not_found: bool) ?*ThreadControlBlock {
|
pub fn fetchNewTask(core: *cpu.arch.Core, should_idle_if_not_found: bool) ?*ThreadControlBlock {
|
||||||
const last = core.thread_list.last orelse {
|
const last = core.thread_list.last orelse {
|
||||||
if (should_idle_if_not_found) {
|
if (should_idle_if_not_found) {
|
||||||
return &core.idle_thread;
|
return &core.idle_thread.data;
|
||||||
} else return null;
|
} else return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user