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

Function handler_changes_regs

kernel/tests/interrupt_wrap.rs:70–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68
69#[test_case]
70fn handler_changes_regs() {
71 unsafe {
72 asm!("mov r11, 0x4242",
73 "mov rcx, 0x93",
74 "mov rdi, 0x22"
75 );
76 }
77
78 // Wait for an interrupt
79 unsafe {asm!("hlt");}
80
81 // Get the register values
82 let (r11, rdi, rcx): (i64, i64, i64);
83 unsafe {asm!("nop",
84 lateout("r11") r11,
85 lateout("rcx") rcx,
86 lateout("rdi") rdi);}
87
88 assert_eq!(rdi, 0x22);
89 assert_eq!(r11, rdi + 0x5321);
90 assert_eq!(rcx, 0xdeadbeef);
91}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected