Execute
(&self)
| 169 | |
| 170 | // Execute |
| 171 | pub fn exec(&self) |
| 172 | { |
| 173 | setid(self.id); |
| 174 | unsafe |
| 175 | { |
| 176 | asm!( |
| 177 | "cli", |
| 178 | "push rax", |
| 179 | "push rsi", |
| 180 | "push 0x200", |
| 181 | "push rdx", |
| 182 | "push rdi", |
| 183 | "iretq", |
| 184 | in("rax") GDT.1.userdata.0, |
| 185 | in("rsi") self.code_address + self.code_size, |
| 186 | in("rdx") GDT.1.usercode.0, |
| 187 | in("rdi") self.code_address + self.entrypt, |
| 188 | ); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | // New |
| 193 | pub fn new(id: usize) -> Self |