Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79979
b: refs/heads/master
c: cc69785
h: refs/heads/master
i:
  79977: 9551f65
  79975: 88699d7
v: v3
  • Loading branch information
Glauber de Oliveira Costa authored and Ingo Molnar committed Jan 30, 2008
1 parent 8f3e605 commit 78b6834
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 26048d75e8d6c840742468667f4a7ab8c2df74c9
refs/heads/master: cc6978528cbd475d952e0eb5073375839dfb600e
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/mm/fault_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(&current->mm->context.lock);
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/asm-x86/desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ static inline void load_LDT(mm_context_t *pc)
preempt_enable();
}

static inline unsigned long get_desc_base(struct desc_struct *desc)
{
return desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24);
}

#else
/*
* GET_DESC_BASE reads the descriptor base of the specified segment.
Expand Down
8 changes: 0 additions & 8 deletions trunk/include/asm-x86/desc_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,6 @@ static inline void __set_tss_desc(unsigned int cpu, unsigned int entry, const vo

#define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr)

static inline unsigned long get_desc_base(unsigned long *desc)
{
unsigned long base;
base = ((desc[0] >> 16) & 0x0000ffff) |
((desc[1] << 16) & 0x00ff0000) |
(desc[1] & 0xff000000);
return base;
}
#endif /* !__ASSEMBLY__ */

#endif
9 changes: 0 additions & 9 deletions trunk/include/asm-x86/desc_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,6 @@ static inline void load_TLS(struct thread_struct *t, unsigned int cpu)
gdt[i] = t->tls_array[i];
}

static inline unsigned long get_desc_base(const void *ptr)
{
const u32 *desc = ptr;
unsigned long base;
base = ((desc[0] >> 16) & 0x0000ffff) |
((desc[1] << 16) & 0x00ff0000) |
(desc[1] & 0xff000000);
return base;
}
#endif /* !__ASSEMBLY__ */

#endif

0 comments on commit 78b6834

Please sign in to comment.