From owner-p4-projects@FreeBSD.ORG Tue Jan 16 23:46:29 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CD98A16A417; Tue, 16 Jan 2007 23:46:28 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89D7E16A40F for ; Tue, 16 Jan 2007 23:46:28 +0000 (UTC) (envelope-from jkim@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 7A05713C442 for ; Tue, 16 Jan 2007 23:46:28 +0000 (UTC) (envelope-from jkim@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l0GNkSic063605 for ; Tue, 16 Jan 2007 23:46:28 GMT (envelope-from jkim@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l0GNkSOi063600 for perforce@freebsd.org; Tue, 16 Jan 2007 23:46:28 GMT (envelope-from jkim@freebsd.org) Date: Tue, 16 Jan 2007 23:46:28 GMT Message-Id: <200701162346.l0GNkSOi063600@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jkim@freebsd.org using -f From: Jung-uk Kim To: Perforce Change Reviews Cc: Subject: PERFORCE change 113033 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2007 23:46:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=113033 Change 113033 by jkim@jkim_hammer on 2007/01/16 23:45:49 MFi386: iopl(2) This fixes LTP iopl01 and iopl02 on amd64. Affected files ... .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#22 edit .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_proto.h#18 edit .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_syscall.h#18 edit .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysent.c#17 edit .. //depot/projects/linuxolator/src/sys/amd64/linux32/syscalls.master#17 edit Differences ... ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_machdep.c#22 (text+ko) ==== @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,7 @@ #include #include +#include #include #include #include @@ -934,6 +936,23 @@ } int +linux_iopl(struct thread *td, struct linux_iopl_args *args) +{ + int error; + + if (args->level < 0 || args->level > 3) + return (EINVAL); + if ((error = priv_check(td, PRIV_IO)) != 0) + return (error); + if ((error = securelevel_gt(td->td_ucred, 0)) != 0) + return (error); + td->td_frame->tf_rflags = (td->td_frame->tf_rflags & ~PSL_IOPL) | + (args->level * (PSL_IOPL / 3)); + + return (0); +} + +int linux_pipe(struct thread *td, struct linux_pipe_args *args) { int pip[2]; @@ -1271,4 +1290,3 @@ return (0); } - ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_proto.h#18 (text+ko) ==== @@ -344,6 +344,9 @@ struct linux_uname_args { register_t dummy; }; +struct linux_iopl_args { + char level_l_[PADL_(l_ulong)]; l_ulong level; char level_r_[PADR_(l_ulong)]; +}; struct linux_vhangup_args { register_t dummy; }; @@ -1032,6 +1035,7 @@ int linux_newlstat(struct thread *, struct linux_newlstat_args *); int linux_newfstat(struct thread *, struct linux_newfstat_args *); int linux_uname(struct thread *, struct linux_uname_args *); +int linux_iopl(struct thread *, struct linux_iopl_args *); int linux_vhangup(struct thread *, struct linux_vhangup_args *); int linux_wait4(struct thread *, struct linux_wait4_args *); int linux_swapoff(struct thread *, struct linux_swapoff_args *); @@ -1284,6 +1288,7 @@ #define LINUX_SYS_AUE_linux_newlstat AUE_LSTAT #define LINUX_SYS_AUE_linux_newfstat AUE_FSTAT #define LINUX_SYS_AUE_linux_uname AUE_NULL +#define LINUX_SYS_AUE_linux_iopl AUE_NULL #define LINUX_SYS_AUE_linux_vhangup AUE_NULL #define LINUX_SYS_AUE_linux_wait4 AUE_WAIT4 #define LINUX_SYS_AUE_linux_swapoff AUE_SWAPOFF ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_syscall.h#18 (text+ko) ==== @@ -103,6 +103,7 @@ #define LINUX_SYS_linux_newlstat 107 #define LINUX_SYS_linux_newfstat 108 #define LINUX_SYS_linux_uname 109 +#define LINUX_SYS_linux_iopl 110 #define LINUX_SYS_linux_vhangup 111 #define LINUX_SYS_linux_wait4 114 #define LINUX_SYS_linux_swapoff 115 ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux32_sysent.c#17 (text+ko) ==== ==== //depot/projects/linuxolator/src/sys/amd64/linux32/syscalls.master#17 (text+ko) ==== @@ -198,7 +198,7 @@ 108 AUE_FSTAT STD { int linux_newfstat(l_uint fd, \ struct l_newstat *buf); } 109 AUE_NULL STD { int linux_uname(void); } -110 AUE_NULL UNIMPL iopl +110 AUE_NULL STD { int linux_iopl(l_ulong level); } 111 AUE_NULL STD { int linux_vhangup(void); } 112 AUE_NULL UNIMPL idle 113 AUE_NULL UNIMPL vm86old