From: "Christoph Egger" Subject: [PATCH] Cleanup physdev Date: Tue, 14 Aug 2007 16:52:14 +0200 Message-ID: <200708141652.14630.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Boundary-00=_eGcwGkYifCNWWLj" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --Boundary-00=_eGcwGkYifCNWWLj Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Use 'vcpu' instead of 'current'. Signed-off-by: Christoph Egger =2D-=20 AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Gesch=E4ftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplement=E4r: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Gesch=E4ftsf=FChrer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy --Boundary-00=_eGcwGkYifCNWWLj Content-Type: text/x-diff; charset=us-ascii; name=physdev.diff Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=physdev.diff diff -r 7953164cebb6 xen/arch/x86/physdev.c --- a/xen/arch/x86/physdev.c Tue Aug 07 09:07:29 2007 +0100 +++ b/xen/arch/x86/physdev.c Tue Aug 14 14:31:50 2007 +0200 @@ -28,6 +28,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H { int irq; ret_t ret; + struct vcpu *v = current; switch ( cmd ) { @@ -36,13 +37,13 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H ret = -EFAULT; if ( copy_from_guest(&eoi, arg, 1) != 0 ) break; - ret = pirq_guest_eoi(current->domain, eoi.irq); + ret = pirq_guest_eoi(v->domain, eoi.irq); break; } /* Legacy since 0x00030202. */ case PHYSDEVOP_IRQ_UNMASK_NOTIFY: { - ret = pirq_guest_unmask(current->domain); + ret = pirq_guest_unmask(v->domain); break; } @@ -70,7 +71,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H if ( copy_from_guest(&apic, arg, 1) != 0 ) break; ret = -EPERM; - if ( !IS_PRIV(current->domain) ) + if ( !IS_PRIV(v->domain) ) break; ret = ioapic_guest_read(apic.apic_physbase, apic.reg, &apic.value); if ( copy_to_guest(arg, &apic, 1) != 0 ) @@ -84,7 +85,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H if ( copy_from_guest(&apic, arg, 1) != 0 ) break; ret = -EPERM; - if ( !IS_PRIV(current->domain) ) + if ( !IS_PRIV(v->domain) ) break; ret = ioapic_guest_write(apic.apic_physbase, apic.reg, apic.value); break; @@ -98,7 +99,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H break; ret = -EPERM; - if ( !IS_PRIV(current->domain) ) + if ( !IS_PRIV(v->domain) ) break; irq = irq_op.irq; @@ -120,7 +121,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H if ( set_iopl.iopl > 3 ) break; ret = 0; - current->arch.iopl = set_iopl.iopl; + v->arch.iopl = set_iopl.iopl; break; } @@ -135,11 +136,11 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H break; ret = 0; #ifndef COMPAT - current->arch.iobmp = set_iobitmap.bitmap; + v->arch.iobmp = set_iobitmap.bitmap; #else - guest_from_compat_handle(current->arch.iobmp, set_iobitmap.bitmap); + guest_from_compat_handle(v->arch.iobmp, set_iobitmap.bitmap); #endif - current->arch.iobmp_limit = set_iobitmap.nr_ports; + v->arch.iobmp_limit = set_iobitmap.nr_ports; break; } --Boundary-00=_eGcwGkYifCNWWLj Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_eGcwGkYifCNWWLj--