2026-06-28 17:58:58 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
.code32
|
2026-06-26 20:05:01 -05:00
|
|
|
.global yield
|
2026-06-28 17:58:58 -05:00
|
|
|
.extern schedule_next_task
|
|
|
|
|
yield: # void yield()
|
|
|
|
|
cli
|
|
|
|
|
|
2026-07-06 22:13:57 -05:00
|
|
|
popl %ecx
|
|
|
|
|
|
|
|
|
|
pushfl // EFLAGS
|
|
|
|
|
pushl %cs // CS
|
|
|
|
|
pushl %ecx // EIP
|
|
|
|
|
|
|
|
|
|
pushal
|
|
|
|
|
call send_eoi_master
|
2026-06-28 17:58:58 -05:00
|
|
|
|
2026-07-06 22:13:57 -05:00
|
|
|
xor %eax, %eax
|
|
|
|
|
mov %ds, %ax
|
2026-06-28 17:58:58 -05:00
|
|
|
pushl %eax
|
|
|
|
|
|
2026-07-06 22:13:57 -05:00
|
|
|
mov $0x10, %ax
|
|
|
|
|
mov %ax, %ds
|
|
|
|
|
mov %ax, %es
|
2026-06-28 17:58:58 -05:00
|
|
|
|
|
|
|
|
pushl %esp
|
|
|
|
|
call switch_context
|
|
|
|
|
movl %eax, %esp
|
|
|
|
|
|
2026-07-06 22:13:57 -05:00
|
|
|
popl %eax
|
|
|
|
|
mov %ax, %ds
|
|
|
|
|
mov %ax, %es
|
|
|
|
|
|
2026-06-28 17:58:58 -05:00
|
|
|
popal
|
|
|
|
|
sti
|
|
|
|
|
iret
|