File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ pub struct Test<'a> {
34
34
static TEST_FUNCTIONS : & [ & ' static Test < ' static > ] = & [
35
35
// TODO: Why does clone process fail?
36
36
// &clone_process,
37
+ & sysenter_test,
37
38
& rpc_test,
38
39
& forked_pipe,
39
40
& signal_handler,
@@ -313,3 +314,29 @@ fn rpc_test() -> Result<(), AeroSyscallError> {
313
314
314
315
Ok ( ( ) )
315
316
}
317
+
318
+ #[ utest_proc:: test]
319
+ fn sysenter_test ( ) -> Result < ( ) , AeroSyscallError > {
320
+ let msg = "sysenter works!\n " ;
321
+ let ptr = msg. as_ptr ( ) ;
322
+ let len = msg. len ( ) ;
323
+
324
+ unsafe {
325
+ core:: arch:: asm! {
326
+ "
327
+ mov r11, rsp
328
+ lea rcx, [rip + 1f]
329
+ sysenter
330
+ 1:
331
+ " ,
332
+ in( "rax" ) consts:: SYS_WRITE ,
333
+ in( "rdi" ) 1 ,
334
+ in( "rsi" ) ptr,
335
+ inout( "rdx" ) len => _,
336
+ out( "r11" ) _,
337
+ out( "rcx" ) _,
338
+ }
339
+ }
340
+
341
+ Ok ( ( ) )
342
+ }
You can’t perform that action at this time.
0 commit comments