lkml.org 
[lkml]   [2009]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] x86: Add getter/setter static inlines for x86 descriptors
Date
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@gmail.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


\
 
 \ /
  Last update: 2009-03-29 23:27    [W:0.079 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site