MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / tss_reference

Function tss_reference

kernel/src/gdt.rs:71–74  ·  view source on GitHub ↗

Function to extract a reference with static lifetime Mutex lock returns a MutexGuard, which dereferences to a reference with a lifetime tied to the mutex lock. This function casts the reference to have 'static lifetime which Descriptor::tss_segment expects. Note: Should not be used except in setting the TSS in the GDT

()

Source from the content-addressed store, hash-verified

69/// Note: Should not be used except in setting the TSS in the GDT
70///
71unsafe fn tss_reference() -> &'static TaskStateSegment {
72 let tss_ptr = &*TSS.lock() as *const TaskStateSegment;
73 & *tss_ptr
74}
75
76pub fn tss_address() -> u64 {
77 let tss_ptr = &*TSS.lock() as *const TaskStateSegment;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected