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

Method fmt

kernel/src/process.rs:291–307  ·  view source on GitHub ↗
(&self, f: &mut fmt::Formatter)

Source from the content-addressed store, hash-verified

289/// Enable Thread structs to be printed
290impl fmt::Display for Thread {
291 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
292 // Cast context address to Context struct
293 let context = unsafe {&mut *(self.context as *mut Context)};
294
295 let kernel_stack_start = self.kernel_stack_end - (KERNEL_STACK_SIZE as u64);
296 let user_stack_start = self.user_stack_end - (USER_STACK_SIZE as u64);
297
298 write!(f, "\
299TID: {}, rip: {:#016X}
300 Kernel stack: {:#016X} - {:#016X} Context: {:#016X}
301 Thread stack: {:#016X} - {:#016X} RSP: {:#016X}",
302 self.tid, context.rip,
303 // Second line
304 kernel_stack_start, self.kernel_stack_end, self.context,
305 // Third line
306 user_stack_start, self.user_stack_end, context.rsp)
307 }
308}
309
310impl Drop for Thread {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected