[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <76c37743d20e5737eadc747cbdddbc2beb11f074.1238361501.git.ice799@gmail.com>
Date: Sun, 29 Mar 2009 14:21:41 -0700
From: Joe Damato <ice799@...il.com>
To: linux-x86_64@...r.kernel.org, w@....eu, mingo@...e.hu,
hpa@...or.com, jeremy@...p.org, linux-newbie@...r.kernel.org,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Joe Damato <ice799@...il.com>
Subject: [PATCH 1/2] x86: Add getter/setter static inlines for x86 descriptors
Static inline getters/setters have been provided to encourage consumers not to touch the internals of 32bit x86 descriptors directly.
Signed-off-by: Joe Damato <ice799@...il.com>
---
arch/x86/include/asm/desc.h | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h
index dc27705..c62cf93 100644
--- a/arch/x86/include/asm/desc.h
+++ b/arch/x86/include/asm/desc.h
@@ -44,6 +44,26 @@ static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu)
return per_cpu(gdt_page, cpu).gdt;
}
+static inline void desc_set_lo(struct desc_struct *d, unsigned int lo)
+{
+ d->a = lo;
+}
+
+static inline void desc_set_hi(struct desc_struct *d, unsigned int hi)
+{
+ d->b = hi;
+}
+
+static inline unsigned int desc_get_lo(const struct desc_struct *d)
+{
+ return d->a;
+}
+
+static inline unsigned int desc_get_hi(const struct desc_struct *d)
+{
+ return d->b;
+}
+
#ifdef CONFIG_X86_64
static inline void pack_gate(gate_desc *gate, unsigned type, unsigned long func,
--
1.6.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists