[PATCH 16/19] modify get_desc_base
- From: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>
- Date: Wed, 12 Dec 2007 10:54:01 -0200
This patch makes get_desc_base() receive a struct desc_struct,
and then uses its internal fields to compute the base address.
Signed-off-by: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>
---
arch/x86/kernel/tls.c | 2 +-
arch/x86/mm/fault_32.c | 2 +-
include/asm-x86/desc.h | 8 ++------
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/x86/kernel/tls.c b/arch/x86/kernel/tls.c
index 74d2b65..98f428b 100644
--- a/arch/x86/kernel/tls.c
+++ b/arch/x86/kernel/tls.c
@@ -112,7 +112,7 @@ int do_get_thread_area(struct task_struct *p, int idx,
memset(&info, 0, sizeof(struct user_desc));
info.entry_number = idx;
- info.base_addr = get_desc_base((void *)desc);
+ info.base_addr = get_desc_base((struct desc_struct *)desc);
info.limit = GET_LIMIT(desc);
info.seg_32bit = GET_32BIT(desc);
info.contents = GET_CONTENTS(desc);
diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c
index 6056c6d..ef5ab2b 100644
--- a/arch/x86/mm/fault_32.c
+++ b/arch/x86/mm/fault_32.c
@@ -115,7 +115,7 @@ static inline unsigned long get_segment_eip(struct pt_regs *regs,
}
/* Decode the code segment base from the descriptor */
- base = get_desc_base((unsigned long *)desc);
+ base = get_desc_base((struct desc_struct *)desc);
if (seg & (1<<2)) {
mutex_unlock(¤t->mm->context.lock);
diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h
index 926d6f8..3480cb1 100644
--- a/include/asm-x86/desc.h
+++ b/include/asm-x86/desc.h
@@ -55,13 +55,9 @@ static inline void load_LDT(mm_context_t *pc)
preempt_enable();
}
-static inline unsigned long get_desc_base(unsigned long *desc)
+static inline unsigned long get_desc_base(struct desc_struct *desc)
{
- unsigned long base;
- base = ((desc[0] >> 16) & 0x0000ffff) |
- ((desc[1] << 16) & 0x00ff0000) |
- (desc[1] & 0xff000000);
- return base;
+ return desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24);
}
#else
--
1.5.0.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- [PATCH 17/19] unify paravirt pieces of descriptor handling
- From: Glauber de Oliveira Costa
- [PATCH 17/19] unify paravirt pieces of descriptor handling
- References:
- [PATCH 0/19] desc_struct integration
- From: Glauber de Oliveira Costa
- [PATCH 0/19] desc_struct integration
- From: Glauber de Oliveira Costa
- [PATCH 01/19] unify desc_struct
- From: Glauber de Oliveira Costa
- [PATCH 02/19] unify struct desc_ptr
- From: Glauber de Oliveira Costa
- [PATCH 03/19] change gdt acessor macro name
- From: Glauber de Oliveira Costa
- [PATCH 04/19] removed unused variable
- From: Glauber de Oliveira Costa
- [PATCH 05/19] introduce gate_desc type.
- From: Glauber de Oliveira Costa
- [PATCH 06/19] change write_idt_entry signature
- From: Glauber de Oliveira Costa
- [PATCH 07/19] introduce ldt_desc type.
- From: Glauber de Oliveira Costa
- [PATCH 08/19] modify write_ldt function
- From: Glauber de Oliveira Costa
- [PATCH 09/19] introduce fill_ldt
- From: Glauber de Oliveira Costa
- [PATCH 10/19] provide tss_desc
- From: Glauber de Oliveira Costa
- [PATCH 11/19] change write_gdt_entry signature.
- From: Glauber de Oliveira Costa
- [PATCH 12/19] change write_ldt_entry signature
- From: Glauber de Oliveira Costa
- [PATCH 13/19] move constants to desc_defs.h
- From: Glauber de Oliveira Costa
- [PATCH 14/19] unify non-paravirt parts of desc.h
- From: Glauber de Oliveira Costa
- [PATCH 15/19] use the same data type for tls_array.
- From: Glauber de Oliveira Costa
- [PATCH 0/19] desc_struct integration
- Prev by Date: [PATCH 17/19] unify paravirt pieces of descriptor handling
- Next by Date: [PATCH 19/19] unify set_tss_desc
- Previous by thread: [PATCH 15/19] use the same data type for tls_array.
- Next by thread: [PATCH 17/19] unify paravirt pieces of descriptor handling
- Index(es):
Relevant Pages
|
|