diff options
Diffstat (limited to 'include/asm-x86_64/desc.h')
-rw-r--r-- | include/asm-x86_64/desc.h | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/include/asm-x86_64/desc.h b/include/asm-x86_64/desc.h index 913d6ac00033..ac991b5ca0fd 100644 --- a/include/asm-x86_64/desc.h +++ b/include/asm-x86_64/desc.h | |||
@@ -107,16 +107,6 @@ static inline void set_ldt_desc(unsigned cpu, void *addr, int size) | |||
107 | DESC_LDT, size * 8 - 1); | 107 | DESC_LDT, size * 8 - 1); |
108 | } | 108 | } |
109 | 109 | ||
110 | static inline void set_seg_base(unsigned cpu, int entry, void *base) | ||
111 | { | ||
112 | struct desc_struct *d = &cpu_gdt(cpu)[entry]; | ||
113 | u32 addr = (u32)(u64)base; | ||
114 | BUG_ON((u64)base >> 32); | ||
115 | d->base0 = addr & 0xffff; | ||
116 | d->base1 = (addr >> 16) & 0xff; | ||
117 | d->base2 = (addr >> 24) & 0xff; | ||
118 | } | ||
119 | |||
120 | #define LDT_entry_a(info) \ | 110 | #define LDT_entry_a(info) \ |
121 | ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff)) | 111 | ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff)) |
122 | /* Don't allow setting of the lm bit. It is useless anyways because | 112 | /* Don't allow setting of the lm bit. It is useless anyways because |
@@ -145,16 +135,13 @@ static inline void set_seg_base(unsigned cpu, int entry, void *base) | |||
145 | (info)->useable == 0 && \ | 135 | (info)->useable == 0 && \ |
146 | (info)->lm == 0) | 136 | (info)->lm == 0) |
147 | 137 | ||
148 | #if TLS_SIZE != 24 | ||
149 | # error update this code. | ||
150 | #endif | ||
151 | |||
152 | static inline void load_TLS(struct thread_struct *t, unsigned int cpu) | 138 | static inline void load_TLS(struct thread_struct *t, unsigned int cpu) |
153 | { | 139 | { |
140 | unsigned int i; | ||
154 | u64 *gdt = (u64 *)(cpu_gdt(cpu) + GDT_ENTRY_TLS_MIN); | 141 | u64 *gdt = (u64 *)(cpu_gdt(cpu) + GDT_ENTRY_TLS_MIN); |
155 | gdt[0] = t->tls_array[0]; | 142 | |
156 | gdt[1] = t->tls_array[1]; | 143 | for (i = 0; i < GDT_ENTRY_TLS_ENTRIES; i++) |
157 | gdt[2] = t->tls_array[2]; | 144 | gdt[i] = t->tls_array[i]; |
158 | } | 145 | } |
159 | 146 | ||
160 | /* | 147 | /* |