Messages in this thread Patch in this message | | | From | Joe Damato <> | Subject | [PATCH 06/12] x86: Refactor pack_descriptor | Date | Fri, 24 Oct 2008 20:15:26 -0700 |
| |
Refactor pack_descriptor to use fields in the struct instead of bitmasks
Signed-off-by: Joe Damato <ice799@gmail.com> --- include/asm-x86/desc.h | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h index 6b4f3e6..ac9aad5 100644 --- a/include/asm-x86/desc.h +++ b/include/asm-x86/desc.h @@ -151,11 +151,19 @@ static inline void pack_descriptor(struct desc_struct *desc, unsigned long base, unsigned long limit, unsigned char type, unsigned char flags) { - desc->a = ((base & 0xffff) << 16) | (limit & 0xffff); - desc->b = (base & 0xff000000) | ((base & 0xff0000) >> 16) | - (limit & 0x000f0000) | ((type & 0xff) << 8) | - ((flags & 0xf) << 20); - desc->p = 1; + desc->limit0 = limit & 0xffff; + desc->base0 = base & 0xffff; + desc->base1 = (base >> 16) & 0xff; + desc->base2 = (base >> 24) & 0xff; + desc->type = type; + desc->s = 0; + desc->dpl = 0; + desc->p = 1; + desc->limit = (limit >> 16) & 0xf; + desc->avl = flags & 0x1; + desc->l = (flags & 0x2) >> 1; + desc->d = (flags & 0x4) >> 2; + desc->g = (flags & 0x8) >> 3; } -- 1.5.4.3
| |