lkml.org 
[lkml]   [2008]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 05/12] x86: Refactor pack_gate for gate_desc
Date
Rewrite pack_gate to use the newly add struct fields instead of bitmasks.

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

diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
index f06adac..6b4f3e6 100644
--- a/include/asm-x86/desc.h
+++ b/include/asm-x86/desc.h
@@ -66,9 +66,14 @@ static inline void pack_gate(gate_desc *gate, unsigned char type,
unsigned long base, unsigned dpl, unsigned flags,
unsigned short seg)
{
- gate->a = (seg << 16) | (base & 0xffff);
- gate->b = (base & 0xffff0000) |
- (((0x80 | type | (dpl << 5)) & 0xff) << 8);
+ gate->base0 = base & 0xffff;
+ gate->seg_sel = seg;
+ gate->reserved = 0;
+ gate->type = type;
+ gate->zero = 0;
+ gate->dpl = dpl;
+ gate->p = 1;
+ gate->base1 = (base >> 16) & 0xffff;
}

#endif
--
1.5.4.3


\
 
 \ /
  Last update: 2008-10-25 05:37    [W:0.114 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site