[−][src]Function sunrise_kernel::i386::instructions::segmentation::set_cs
pub unsafe fn set_cs(sel: SegmentSelector)
Reload code segment register. Note this is special since we can not directly move to %cs. Instead we push the new segment selector and return value on the stack and use lretq to reload cs and continue at 1:.
Safety
Sel must point to a present, valid segment in the GDT or LDT. Changing a segment will cause pointers to become invalidated. The only sound way to use this function is if the target segment has the same layout as the original segment.