[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <a9cabc5cabdb5a10631e2a6dc330c54826f2b210.1224903712.git.ice799@gmail.com>
Date: Fri, 24 Oct 2008 20:15:24 -0700
From: Joe Damato <ice799@...il.com>
To: linux-x86_64@...r.kernel.org, linux-newbie@...r.kernel.org,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Joe Damato <ice799@...il.com>
Subject: [PATCH 04/12] x86: Add macros for gate_desc
Add useful macros which can be used to access the lo and hi 32bit words, get the offset of the handler, and get the segment for gate_descs.
Signed-off-by: Joe Damato <ice799@...il.com>
---
include/asm-x86/desc_defs.h | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/include/asm-x86/desc_defs.h b/include/asm-x86/desc_defs.h
index 012df1f..d6a5310 100644
--- a/include/asm-x86/desc_defs.h
+++ b/include/asm-x86/desc_defs.h
@@ -75,8 +75,13 @@ typedef struct ldttss_desc64 tss_desc;
typedef struct gate_struct gate_desc;
typedef struct desc_struct ldt_desc;
typedef struct desc_struct tss_desc;
-#define gate_offset(g) (((g).b & 0xffff0000) | ((g).a & 0x0000ffff))
-#define gate_segment(g) ((g).a >> 16)
+#define desc_lo(d) (((u32 *)&d)[0])
+#define desc_hi(d) (((u32 *)&d)[1])
+#define gate_offset(g) (((g).base1 << 16) | ((g).base0 & 0x0000ffff))
+#define gate_segment(g) ((g).seg_sel >> 16)
+#define ldttss_offset(d) (((d).base2 << 24 ) | ((d).base1 << 16) |\
+ ((d).base0 & 0x0000ffff))
+#define ldttss_limit(d) ((d).limit0)
#endif
struct desc_ptr {
--
1.5.4.3
--
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