File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11use axerrno:: { AxError , AxResult } ;
2+ use axhal:: uspace:: UserContext ;
23use axtask:: current;
34use num_enum:: TryFromPrimitive ;
45use starry_core:: task:: AsThread ;
@@ -54,13 +55,13 @@ pub fn sys_set_tid_address(clear_child_tid: usize) -> AxResult<isize> {
5455
5556#[ cfg( target_arch = "x86_64" ) ]
5657pub fn sys_arch_prctl (
57- tf : & mut axhal :: context :: TrapFrame ,
58+ tf : & mut UserContext ,
5859 code : i32 ,
5960 addr : usize ,
6061) -> AxResult < isize > {
6162 use starry_vm:: VmMutPtr ;
6263
63- let code = ArchPrctlCode :: try_from ( code) . map_err ( |_| axerrno:: AxError :: EINVAL ) ?;
64+ let code = ArchPrctlCode :: try_from ( code) . map_err ( |_| axerrno:: AxError :: InvalidInput ) ?;
6465 debug ! ( "sys_arch_prctl: code = {:?}, addr = {:#x}" , code, addr) ;
6566
6667 match code {
@@ -76,7 +77,7 @@ pub fn sys_arch_prctl(
7677 }
7778 ArchPrctlCode :: GetGs => {
7879 ( addr as * mut usize )
79- . vm_write ( unsafe { x86:: msr:: rdmsr ( x86:: msr:: IA32_KERNEL_GSBASE ) } ) ?;
80+ . vm_write ( unsafe { x86:: msr:: rdmsr ( x86:: msr:: IA32_KERNEL_GSBASE ) as _ } ) ?;
8081 Ok ( 0 )
8182 }
8283 ArchPrctlCode :: SetGs => {
@@ -86,6 +87,6 @@ pub fn sys_arch_prctl(
8687 Ok ( 0 )
8788 }
8889 ArchPrctlCode :: GetCpuid => Ok ( 0 ) ,
89- ArchPrctlCode :: SetCpuid => Err ( axerrno:: AxError :: ENODEV ) ,
90+ ArchPrctlCode :: SetCpuid => Err ( axerrno:: AxError :: NoSuchDevice ) ,
9091 }
9192}
You can’t perform that action at this time.
0 commit comments