[PATCH 09/12] x86: Add static initiazlier for descriptors

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Joe Damato
Date: Friday, October 24, 2008 - 8:15 pm

Add static initializer for LDT/GDT/TSS descriptors.

Signed-off-by: Joe Damato <ice799@gmail.com>
---
 include/asm-x86/desc_defs.h |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/desc_defs.h b/include/asm-x86/desc_defs.h
index a1c6516..5119051 100644
--- a/include/asm-x86/desc_defs.h
+++ b/include/asm-x86/desc_defs.h
@@ -91,6 +91,20 @@ typedef struct desc_struct tss_desc;
                 , .dpl = (hi >> 13) & 3 \
                 , .p   = (hi >> 15) & 1 \
                 , .base1 = (hi >> 16) & 0xffff }
+#define __DESC_INITIALIZER(lo,hi) \
+                { .limit0 = lo & 0xffff \
+                , .base0  = (lo >> 16) & 0xffff \
+                , .base1  = hi & 0xff \
+                , .type   = (hi >> 8) & 0xf \
+                , .s      = (hi >> 12) & 1 \
+                , .dpl    = (hi >> 13) & 3 \
+                , .p      = (hi >> 15) & 1 \
+                , .limit  = (hi >> 16) & 0xf \
+                , .avl    = (hi >> 20) & 1 \
+                , .l      = (hi >> 21) & 1 \
+                , .d      = (hi >> 22) & 1 \
+                , .g      = (hi >> 23) & 1 \
+                ,.base2   = (hi >> 24) & 0xf }
 #endif
 
 struct desc_ptr {
-- 
1.5.4.3

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs , Joe Damato, (Fri Oct 24, 8:15 pm)
[PATCH 02/12] x86: Use new gate_struct for gate_desc, Joe Damato, (Fri Oct 24, 8:15 pm)
[PATCH 04/12] x86: Add macros for gate_desc, Joe Damato, (Fri Oct 24, 8:15 pm)
[PATCH 05/12] x86: Refactor pack_gate for gate_desc, Joe Damato, (Fri Oct 24, 8:15 pm)
[PATCH 06/12] x86: Refactor pack_descriptor, Joe Damato, (Fri Oct 24, 8:15 pm)
[PATCH 07/12] x86: Add a static initializer for IDTs, Joe Damato, (Fri Oct 24, 8:15 pm)
[PATCH 09/12] x86: Add static initiazlier for descriptors, Joe Damato, (Fri Oct 24, 8:15 pm)
Re: [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs, Willy Tarreau, (Fri Oct 24, 10:40 pm)
Re: [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs, walter harms, (Sat Oct 25, 2:39 am)
Re: [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs, H. Peter Anvin, (Mon Oct 27, 7:34 am)
Re: [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs, Jeremy Fitzhardinge, (Mon Oct 27, 4:02 pm)
Re: [PATCH 03/12] x86: Cleanup usage of struct desc_struct, Jeremy Fitzhardinge, (Wed Oct 29, 5:52 am)
Re: [PATCH 02/12] x86: Use new gate_struct for gate_desc, Jeremy Fitzhardinge, (Wed Oct 29, 5:53 am)
Re: [PATCH 04/12] x86: Add macros for gate_desc, Jeremy Fitzhardinge, (Wed Oct 29, 5:54 am)
Re: [PATCH 12/12] x86: Use struct fields instead of bitmasks, Jeremy Fitzhardinge, (Wed Oct 29, 5:56 am)
Re: [PATCH 09/12] x86: Add static initiazlier for descriptors, Jeremy Fitzhardinge, (Wed Oct 29, 5:58 am)