-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch introduces fill_ldt(), which populates a ldt descriptor from a user_desc in once, instead of relying in the LDT_entry_a and LDT_entry_b macros Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
- Loading branch information
Glauber de Oliveira Costa
authored and
Ingo Molnar
committed
Jan 30, 2008
1 parent
5af7250
commit 80fbb69
Showing
6 changed files
with
34 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,34 @@ | ||
#ifndef _ASM_DESC_H_ | ||
#define _ASM_DESC_H_ | ||
|
||
#ifndef __ASSEMBLY__ | ||
#include <asm/desc_defs.h> | ||
#include <asm/ldt.h> | ||
|
||
static inline void fill_ldt(struct desc_struct *desc, struct user_desc *info) | ||
{ | ||
desc->limit0 = info->limit & 0x0ffff; | ||
desc->base0 = info->base_addr & 0x0000ffff; | ||
|
||
desc->base1 = (info->base_addr & 0x00ff0000) >> 16; | ||
desc->type = (info->read_exec_only ^ 1) << 1; | ||
desc->type |= info->contents << 2; | ||
desc->s = 1; | ||
desc->dpl = 0x3; | ||
desc->p = info->seg_not_present ^ 1; | ||
desc->limit = (info->limit & 0xf0000) >> 16; | ||
desc->avl = info->useable; | ||
desc->d = info->seg_32bit; | ||
desc->g = info->limit_in_pages; | ||
desc->base2 = (info->base_addr & 0xff000000) >> 24; | ||
} | ||
|
||
#endif | ||
|
||
#ifdef CONFIG_X86_32 | ||
# include "desc_32.h" | ||
#else | ||
# include "desc_64.h" | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters