summaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-11-17 12:56:24 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-11-17 12:57:29 +0100
commit86c2a249355508cfa7150e00baa42d902e4c6ff8 (patch)
tree46ba95c8944e2e9cdab6426899afeed6b85b1bca /i386
parent941f24160164d9cc07699d63b7435eedd348b8ad (diff)
Remove dead code
Thanks Marin Ramesa for the report. * i386/i386/user_ldt.c (selector_check): Remove function. * i386/i386/user_ldt.h (S_CODE, S_STACK, S_DATA): Remove macros. (selector_check): Remove declaration.
Diffstat (limited to 'i386')
-rw-r--r--i386/i386/user_ldt.c38
-rw-r--r--i386/i386/user_ldt.h11
2 files changed, 0 insertions, 49 deletions
diff --git a/i386/i386/user_ldt.c b/i386/i386/user_ldt.c
index 74c10a4..5c3d323 100644
--- a/i386/i386/user_ldt.c
+++ b/i386/i386/user_ldt.c
@@ -55,44 +55,6 @@ char acc_type[8][3] = {
{ 1, 0, 1 }, /* code, readable, conforming */
};
-boolean_t selector_check(thread, sel, type)
- thread_t thread;
- int sel;
- int type; /* code, stack, data */
-{
- struct user_ldt *ldt;
- int access;
-
- ldt = thread->pcb->ims.ldt;
- if (ldt == 0) {
- switch (type) {
- case S_CODE:
- return sel == USER_CS;
- case S_STACK:
- return sel == USER_DS;
- case S_DATA:
- return sel == 0 ||
- sel == USER_CS ||
- sel == USER_DS;
- }
- }
-
- if (type != S_DATA && sel == 0)
- return FALSE;
- if ((sel & (SEL_LDT|SEL_PL)) != (SEL_LDT|SEL_PL_U)
- || sel > ldt->desc.limit_low)
- return FALSE;
-
- access = ldt->ldt[sel_idx(sel)].access;
-
- if ((access & (ACC_P|ACC_PL|ACC_TYPE_USER|SZ_64))
- != (ACC_P|ACC_PL_U|ACC_TYPE_USER))
- return FALSE;
- /* present, pl == pl.user, not system, not 64bits */
-
- return acc_type[(access & 0xe)>>1][type];
-}
-
/*
* Add the descriptors to the LDT, starting with
* the descriptor for 'first_selector'.
diff --git a/i386/i386/user_ldt.h b/i386/i386/user_ldt.h
index 6c6c858..c90273f 100644
--- a/i386/i386/user_ldt.h
+++ b/i386/i386/user_ldt.h
@@ -44,15 +44,4 @@ struct user_ldt {
};
typedef struct user_ldt * user_ldt_t;
-/*
- * Check code/stack/data selector values against LDT if present.
- */
-#define S_CODE 0 /* code segment */
-#define S_STACK 1 /* stack segment */
-#define S_DATA 2 /* data segment */
-
-extern boolean_t selector_check(thread_t thread,
- int sel,
- int type);
-
#endif /* _I386_USER_LDT_H_ */