aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/processor_64.h
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-30 07:31:27 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:31:27 -0500
commit683e0253dbd12554b2ee969b15e68105252bff57 (patch)
treeb1b2df43f7fcdf48bc69789d81c437be0cdd639b /include/asm-x86/processor_64.h
parent62d7d7ed11760a0fea40e4fc6f0553e721d00443 (diff)
x86: unify common parts of processor.h
This patch moves the pieces of processor_32.h and processor_64 that are equal to processor.h. Only what's exactly the same is moved around, the rest not being touched. 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>
Diffstat (limited to 'include/asm-x86/processor_64.h')
-rw-r--r--include/asm-x86/processor_64.h116
1 files changed, 0 insertions, 116 deletions
diff --git a/include/asm-x86/processor_64.h b/include/asm-x86/processor_64.h
index 6abe1ba30fe0..5f5c7fc63797 100644
--- a/include/asm-x86/processor_64.h
+++ b/include/asm-x86/processor_64.h
@@ -83,11 +83,6 @@ DECLARE_PER_CPU(struct cpuinfo_x86, cpu_info);
83extern char ignore_irq13; 83extern char ignore_irq13;
84 84
85extern void identify_cpu(struct cpuinfo_x86 *); 85extern void identify_cpu(struct cpuinfo_x86 *);
86extern void print_cpu_info(struct cpuinfo_x86 *);
87extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c);
88extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c);
89extern unsigned short num_cache_leaves;
90
91 86
92/* 87/*
93 * User space process size. 47bits minus one guard page. 88 * User space process size. 47bits minus one guard page.
@@ -102,8 +97,6 @@ extern unsigned short num_cache_leaves;
102#define TASK_SIZE (test_thread_flag(TIF_IA32) ? IA32_PAGE_OFFSET : TASK_SIZE64) 97#define TASK_SIZE (test_thread_flag(TIF_IA32) ? IA32_PAGE_OFFSET : TASK_SIZE64)
103#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? IA32_PAGE_OFFSET : TASK_SIZE64) 98#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? IA32_PAGE_OFFSET : TASK_SIZE64)
104 99
105#define TASK_UNMAPPED_BASE PAGE_ALIGN(TASK_SIZE/3)
106
107/* 100/*
108 * Size of io_bitmap. 101 * Size of io_bitmap.
109 */ 102 */
@@ -226,68 +219,16 @@ struct thread_struct {
226 set_fs(USER_DS); \ 219 set_fs(USER_DS); \
227} while(0) 220} while(0)
228 221
229struct task_struct;
230struct mm_struct;
231
232/* Free all resources held by a thread. */
233extern void release_thread(struct task_struct *);
234
235/* Prepare to copy thread state - unlazy all lazy status */
236extern void prepare_to_copy(struct task_struct *tsk);
237
238/*
239 * create a kernel thread without removing it from tasklists
240 */
241extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
242
243/* 222/*
244 * Return saved PC of a blocked thread. 223 * Return saved PC of a blocked thread.
245 * What is this good for? it will be always the scheduler or ret_from_fork. 224 * What is this good for? it will be always the scheduler or ret_from_fork.
246 */ 225 */
247#define thread_saved_pc(t) (*(unsigned long *)((t)->thread.sp - 8)) 226#define thread_saved_pc(t) (*(unsigned long *)((t)->thread.sp - 8))
248 227
249extern unsigned long get_wchan(struct task_struct *p);
250#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.sp0 - 1) 228#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.sp0 - 1)
251#define KSTK_EIP(tsk) (task_pt_regs(tsk)->ip)
252#define KSTK_ESP(tsk) -1 /* sorry. doesn't work for syscall. */ 229#define KSTK_ESP(tsk) -1 /* sorry. doesn't work for syscall. */
253 230
254 231
255struct microcode_header {
256 unsigned int hdrver;
257 unsigned int rev;
258 unsigned int date;
259 unsigned int sig;
260 unsigned int cksum;
261 unsigned int ldrver;
262 unsigned int pf;
263 unsigned int datasize;
264 unsigned int totalsize;
265 unsigned int reserved[3];
266};
267
268struct microcode {
269 struct microcode_header hdr;
270 unsigned int bits[0];
271};
272
273typedef struct microcode microcode_t;
274typedef struct microcode_header microcode_header_t;
275
276/* microcode format is extended from prescott processors */
277struct extended_signature {
278 unsigned int sig;
279 unsigned int pf;
280 unsigned int cksum;
281};
282
283struct extended_sigtable {
284 unsigned int count;
285 unsigned int cksum;
286 unsigned int reserved[3];
287 struct extended_signature sigs[0];
288};
289
290
291#if defined(CONFIG_MPSC) || defined(CONFIG_MCORE2) 232#if defined(CONFIG_MPSC) || defined(CONFIG_MCORE2)
292#define ASM_NOP1 P6_NOP1 233#define ASM_NOP1 P6_NOP1
293#define ASM_NOP2 P6_NOP2 234#define ASM_NOP2 P6_NOP2
@@ -331,20 +272,6 @@ struct extended_sigtable {
331 272
332#define ASM_NOP_MAX 8 273#define ASM_NOP_MAX 8
333 274
334/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
335static inline void rep_nop(void)
336{
337 __asm__ __volatile__("rep;nop": : :"memory");
338}
339
340/* Stop speculative execution */
341static inline void sync_core(void)
342{
343 int tmp;
344 asm volatile("cpuid" : "=a" (tmp) : "0" (1) : "ebx","ecx","edx","memory");
345}
346
347#define ARCH_HAS_PREFETCHW 1
348static inline void prefetchw(void *x) 275static inline void prefetchw(void *x)
349{ 276{
350 alternative_input("prefetcht0 (%1)", 277 alternative_input("prefetcht0 (%1)",
@@ -353,42 +280,6 @@ static inline void prefetchw(void *x)
353 "r" (x)); 280 "r" (x));
354} 281}
355 282
356#define ARCH_HAS_SPINLOCK_PREFETCH 1
357
358#define spin_lock_prefetch(x) prefetchw(x)
359
360#define cpu_relax() rep_nop()
361
362static inline void __monitor(const void *eax, unsigned long ecx,
363 unsigned long edx)
364{
365 /* "monitor %eax,%ecx,%edx;" */
366 asm volatile(
367 ".byte 0x0f,0x01,0xc8;"
368 : :"a" (eax), "c" (ecx), "d"(edx));
369}
370
371static inline void __mwait(unsigned long eax, unsigned long ecx)
372{
373 /* "mwait %eax,%ecx;" */
374 asm volatile(
375 ".byte 0x0f,0x01,0xc9;"
376 : :"a" (eax), "c" (ecx));
377}
378
379static inline void __sti_mwait(unsigned long eax, unsigned long ecx)
380{
381 /* "mwait %eax,%ecx;" */
382 asm volatile(
383 "sti; .byte 0x0f,0x01,0xc9;"
384 : :"a" (eax), "c" (ecx));
385}
386
387extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx);
388
389extern int force_mwait;
390
391extern void select_idle_routine(const struct cpuinfo_x86 *c);
392 283
393#define stack_current() \ 284#define stack_current() \
394({ \ 285({ \
@@ -397,12 +288,5 @@ extern void select_idle_routine(const struct cpuinfo_x86 *c);
397 ti->task; \ 288 ti->task; \
398}) 289})
399 290
400#define cache_line_size() (boot_cpu_data.x86_cache_alignment)
401
402extern unsigned long boot_option_idle_override;
403/* Boot loader type from the setup header */
404extern int bootloader_type;
405
406#define HAVE_ARCH_PICK_MMAP_LAYOUT 1
407 291
408#endif /* __ASM_X86_64_PROCESSOR_H */ 292#endif /* __ASM_X86_64_PROCESSOR_H */