From: David Vrabel <david.vrabel@citrix.com>
Date: Mon, 9 Jul 2012 10:39:07 +0000 (+0100)
Subject: xen/x86: add desc_equal() to compare GDT descriptors
X-Git-Tag: firefly_0821_release~3680^2~2038^2~19
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=59290362da587ce2e6d2f4a7f85e362fa2d7fd39;p=firefly-linux-kernel-4.4.55.git

xen/x86: add desc_equal() to compare GDT descriptors

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
[v1: Moving it to the Xen file]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 0c1ab43f6672..225ffdc3c4ca 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -539,6 +539,12 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr)
 		BUG();
 }
 
+static inline bool desc_equal(const struct desc_struct *d1,
+			      const struct desc_struct *d2)
+{
+	return d1->a == d2->a && d1->b == d2->b;
+}
+
 static void load_TLS_descriptor(struct thread_struct *t,
 				unsigned int cpu, unsigned int i)
 {