From afc54659b1023a5232a55b7b8919294c693ff8ab Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 17 Oct 2007 18:04:32 +0200 Subject: x86: clean up apicid_to_node declaration Use the correct #define in the declaration of apicid_to_node[], to match the definition. [ tglx: arch/x86 adaptation ] Cc: Andi Kleen Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/numa_64.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/numa_64.h b/include/asm-x86/numa_64.h index 933ff11ece15..0cc5c97a7fc9 100644 --- a/include/asm-x86/numa_64.h +++ b/include/asm-x86/numa_64.h @@ -2,6 +2,7 @@ #define _ASM_X8664_NUMA_H 1 #include +#include struct bootnode { u64 start,end; @@ -19,7 +20,7 @@ extern void numa_set_node(int cpu, int node); extern void srat_reserve_add_area(int nodeid); extern int hotadd_percent; -extern unsigned char apicid_to_node[256]; +extern unsigned char apicid_to_node[MAX_LOCAL_APIC]; #ifdef CONFIG_NUMA extern void __init init_cpu_to_node(void); -- cgit v1.2.3 From 6442eea937ef797d4b66733f49c82e2fdc2aca6f Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Wed, 17 Oct 2007 18:04:33 +0200 Subject: i386: export i386 smp_call_function_mask() to modules This patch export i386 smp_call_function_mask() with EXPORT_SYMBOL(). This function is needed by KVM to call a function on a set of CPUs. [ tglx: arch/x86 adaptation ] Signed-off-by: Laurent Vivier Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/smp_32.c | 7 +++++++ include/asm-x86/smp_32.h | 9 +++------ 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'include/asm-x86') diff --git a/arch/x86/kernel/smp_32.c b/arch/x86/kernel/smp_32.c index 2d35d8502029..eebc6e82576c 100644 --- a/arch/x86/kernel/smp_32.c +++ b/arch/x86/kernel/smp_32.c @@ -705,3 +705,10 @@ struct smp_ops smp_ops = { .smp_send_reschedule = native_smp_send_reschedule, .smp_call_function_mask = native_smp_call_function_mask, }; + +int smp_call_function_mask(cpumask_t mask, void (*func) (void *info), + void *info, int wait) +{ + return smp_ops.smp_call_function_mask(mask, func, info, wait); +} +EXPORT_SYMBOL(smp_call_function_mask); diff --git a/include/asm-x86/smp_32.h b/include/asm-x86/smp_32.h index 955dd7c8538f..ee46038d126c 100644 --- a/include/asm-x86/smp_32.h +++ b/include/asm-x86/smp_32.h @@ -92,12 +92,9 @@ static inline void smp_send_reschedule(int cpu) { smp_ops.smp_send_reschedule(cpu); } -static inline int smp_call_function_mask(cpumask_t mask, - void (*func) (void *info), void *info, - int wait) -{ - return smp_ops.smp_call_function_mask(mask, func, info, wait); -} +extern int smp_call_function_mask(cpumask_t mask, + void (*func) (void *info), void *info, + int wait); void native_smp_prepare_boot_cpu(void); void native_smp_prepare_cpus(unsigned int max_cpus); -- cgit v1.2.3 From 58d5fa7a6a6fc4754d295d0999b284edd67c8620 Mon Sep 17 00:00:00 2001 From: "Siddha, Suresh B" Date: Wed, 17 Oct 2007 18:04:33 +0200 Subject: i386: fix 4 bit apicid assumption of mach-default Fix get_apic_id() in mach-default, so that it uses 8 bits incase of xAPIC case and 4 bits for legacy APIC case. This fixes the i386 kernel assumption that apic id is less than 16 for xAPIC platforms with 8 cpus or less and makes the kernel boot on such platforms. [ tglx: arch/x86 adaptation ] Signed-off-by: Suresh Siddha Signed-off-by: Andi Kleen Cc: Andi Kleen Cc: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/mach-default/mach_apicdef.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/mach-default/mach_apicdef.h b/include/asm-x86/mach-default/mach_apicdef.h index 7bcb350c3ee8..ae9841319094 100644 --- a/include/asm-x86/mach-default/mach_apicdef.h +++ b/include/asm-x86/mach-default/mach_apicdef.h @@ -1,11 +1,17 @@ #ifndef __ASM_MACH_APICDEF_H #define __ASM_MACH_APICDEF_H +#include + #define APIC_ID_MASK (0xF<<24) static inline unsigned get_apic_id(unsigned long x) { - return (((x)>>24)&0xF); + unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR)); + if (APIC_XAPIC(ver)) + return (((x)>>24)&0xFF); + else + return (((x)>>24)&0xF); } #define GET_APIC_ID(x) get_apic_id(x) -- cgit v1.2.3 From c1217a75ea102d4e69321f210fab60bc47b9a48e Mon Sep 17 00:00:00 2001 From: Kirill Korotaev Date: Wed, 17 Oct 2007 18:04:33 +0200 Subject: x86: mark read_crX() asm code as volatile Some gcc versions (I checked at least 4.1.1 from RHEL5 & 4.1.2 from gentoo) can generate incorrect code with read_crX()/write_crX() functions mix up, due to cached results of read_crX(). The small app for x8664 below compiled with -O2 demonstrates this (i686 does the same thing): --- include/asm-x86/system_32.h | 2 +- include/asm-x86/system_64.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/system_32.h b/include/asm-x86/system_32.h index d84e593b7dfc..1d6fb3afa533 100644 --- a/include/asm-x86/system_32.h +++ b/include/asm-x86/system_32.h @@ -142,7 +142,7 @@ static inline unsigned long native_read_cr4_safe(void) { unsigned long val; /* This could fault if %cr4 does not exist */ - asm("1: movl %%cr4, %0 \n" + asm volatile("1: movl %%cr4, %0 \n" "2: \n" ".section __ex_table,\"a\" \n" ".long 1b,2b \n" diff --git a/include/asm-x86/system_64.h b/include/asm-x86/system_64.h index 5022aecc333d..fb4bcf99e665 100644 --- a/include/asm-x86/system_64.h +++ b/include/asm-x86/system_64.h @@ -85,7 +85,7 @@ static inline void write_cr0(unsigned long val) static inline unsigned long read_cr2(void) { unsigned long cr2; - asm("movq %%cr2,%0" : "=r" (cr2)); + asm volatile("movq %%cr2,%0" : "=r" (cr2)); return cr2; } @@ -97,7 +97,7 @@ static inline void write_cr2(unsigned long val) static inline unsigned long read_cr3(void) { unsigned long cr3; - asm("movq %%cr3,%0" : "=r" (cr3)); + asm volatile("movq %%cr3,%0" : "=r" (cr3)); return cr3; } @@ -109,7 +109,7 @@ static inline void write_cr3(unsigned long val) static inline unsigned long read_cr4(void) { unsigned long cr4; - asm("movq %%cr4,%0" : "=r" (cr4)); + asm volatile("movq %%cr4,%0" : "=r" (cr4)); return cr4; } @@ -121,7 +121,7 @@ static inline void write_cr4(unsigned long val) static inline unsigned long read_cr8(void) { unsigned long cr8; - asm("movq %%cr8,%0" : "=r" (cr8)); + asm volatile("movq %%cr8,%0" : "=r" (cr8)); return cr8; } -- cgit v1.2.3 From 6704ab1cd42269e536a6735db740e57e2c04c3b4 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 17 Oct 2007 18:04:36 +0200 Subject: x86: hide cond_syscall behind __KERNEL__ This brings x86_64 into line with all other architectures by only defining cond_syscall() when __KERNEL__ is defined. [ tglx: arch/x86 adaptation ] Signed-off-by: Mike Frysinger Signed-off-by: Andrew Morton Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/unistd_64.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/asm-x86') diff --git a/include/asm-x86/unistd_64.h b/include/asm-x86/unistd_64.h index fc4e73f5f1fa..4f769598abaf 100644 --- a/include/asm-x86/unistd_64.h +++ b/include/asm-x86/unistd_64.h @@ -676,6 +676,7 @@ asmlinkage long sys_rt_sigaction(int sig, #endif /* __KERNEL__ */ #endif /* __NO_STUBS */ +#ifdef __KERNEL__ /* * "Conditional" syscalls * @@ -683,5 +684,6 @@ asmlinkage long sys_rt_sigaction(int sig, * but it doesn't work on all toolchains, so we just do it by hand */ #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") +#endif /* __KERNEL__ */ #endif /* _ASM_X86_64_UNISTD_H_ */ -- cgit v1.2.3 From e295f75410eb19d2a9733508f7f5c093767592cd Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Wed, 17 Oct 2007 18:04:36 +0200 Subject: x86_64: Remove serialize_cpu() inline - It was redundant with sync_core() - It was unused - It was broken: no input arguments to cpuid; could fault randomly depending on eax contents. Now it's gone. [ tglx: arch/x86 adaptation ] Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/processor_64.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/processor_64.h b/include/asm-x86/processor_64.h index 31f579b828f2..2f12eb6e46b0 100644 --- a/include/asm-x86/processor_64.h +++ b/include/asm-x86/processor_64.h @@ -389,11 +389,6 @@ static inline void prefetchw(void *x) #define cpu_relax() rep_nop() -static inline void serialize_cpu(void) -{ - __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx"); -} - static inline void __monitor(const void *eax, unsigned long ecx, unsigned long edx) { -- cgit v1.2.3 From 6d43be8ea8c92a41557dacde94ae73565cbc01f0 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 17 Oct 2007 18:04:36 +0200 Subject: x86: remove reminder of i386 irqstat per cpu conversion The i386 irqstat per cpu conversion left an bogus export of the old irqstat array in the header file. Remove it. [ tglx: arch/x86 adaptation ] Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- include/asm-x86/hardirq_32.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/hardirq_32.h b/include/asm-x86/hardirq_32.h index 34649585bb59..918863530b92 100644 --- a/include/asm-x86/hardirq_32.h +++ b/include/asm-x86/hardirq_32.h @@ -13,7 +13,6 @@ typedef struct { } ____cacheline_aligned irq_cpustat_t; DECLARE_PER_CPU(irq_cpustat_t, irq_stat); -extern irq_cpustat_t irq_stat[]; #define __ARCH_IRQ_STAT #define __IRQ_STAT(cpu, member) (per_cpu(irq_stat, cpu).member) -- cgit v1.2.3 From 9689ba8ad0dc27c0a2ce40eb4c0f8fb66551119c Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 17 Oct 2007 18:04:37 +0200 Subject: x86: constify stacktrace_ops .. as they're never written to. [ tglx: arch/x86 adaptation ] Signed-off-by: Jan Beulich Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/stacktrace.c | 2 +- arch/x86/kernel/traps_32.c | 6 +++--- arch/x86/kernel/traps_64.c | 4 ++-- include/asm-x86/stacktrace.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'include/asm-x86') diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c index 413e527cdeb9..6fa6cf036c70 100644 --- a/arch/x86/kernel/stacktrace.c +++ b/arch/x86/kernel/stacktrace.c @@ -33,7 +33,7 @@ static void save_stack_address(void *data, unsigned long addr) trace->entries[trace->nr_entries++] = addr; } -static struct stacktrace_ops save_stack_ops = { +static const struct stacktrace_ops save_stack_ops = { .warning = save_stack_warning, .warning_symbol = save_stack_warning_symbol, .stack = save_stack_stack, diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index 0fce34226b7d..83a9bbbbe38f 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c @@ -112,7 +112,7 @@ struct stack_frame { static inline unsigned long print_context_stack(struct thread_info *tinfo, unsigned long *stack, unsigned long ebp, - struct stacktrace_ops *ops, void *data) + const struct stacktrace_ops *ops, void *data) { #ifdef CONFIG_FRAME_POINTER struct stack_frame *frame = (struct stack_frame *)ebp; @@ -149,7 +149,7 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo, void dump_trace(struct task_struct *task, struct pt_regs *regs, unsigned long *stack, - struct stacktrace_ops *ops, void *data) + const struct stacktrace_ops *ops, void *data) { unsigned long ebp = 0; @@ -221,7 +221,7 @@ static void print_trace_address(void *data, unsigned long addr) touch_nmi_watchdog(); } -static struct stacktrace_ops print_trace_ops = { +static const struct stacktrace_ops print_trace_ops = { .warning = print_trace_warning, .warning_symbol = print_trace_warning_symbol, .stack = print_trace_stack, diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c index bc7116acf8ff..b4a9b3db1994 100644 --- a/arch/x86/kernel/traps_64.c +++ b/arch/x86/kernel/traps_64.c @@ -215,7 +215,7 @@ static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long *stack, - struct stacktrace_ops *ops, void *data) + const struct stacktrace_ops *ops, void *data) { const unsigned cpu = get_cpu(); unsigned long *irqstack_end = (unsigned long*)cpu_pda(cpu)->irqstackptr; @@ -336,7 +336,7 @@ static void print_trace_address(void *data, unsigned long addr) printk_address(addr); } -static struct stacktrace_ops print_trace_ops = { +static const struct stacktrace_ops print_trace_ops = { .warning = print_trace_warning, .warning_symbol = print_trace_warning_symbol, .stack = print_trace_stack, diff --git a/include/asm-x86/stacktrace.h b/include/asm-x86/stacktrace.h index 6f0b54594307..70dd5bae3235 100644 --- a/include/asm-x86/stacktrace.h +++ b/include/asm-x86/stacktrace.h @@ -15,6 +15,6 @@ struct stacktrace_ops { }; void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long *stack, - struct stacktrace_ops *ops, void *data); + const struct stacktrace_ops *ops, void *data); #endif -- cgit v1.2.3 From 6619a8fb594486363783cc4a8372e4d4ee4b913e Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 17 Oct 2007 18:04:37 +0200 Subject: x86: Create clflush() inline, remove hardcoded wbinvd Create an inline function for clflush(), with the proper arguments, and use it instead of hard-coding the instruction. This also removes one instance of hard-coded wbinvd, based on a patch by Bauder de Oliveira Costa. [ tglx: arch/x86 adaptation ] Cc: Andi Kleen Cc: Glauber de Oliveira Costa Signed-off-by: H. Peter Anvin Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/tce_64.c | 4 ++-- arch/x86/mm/pageattr_32.c | 4 ++-- arch/x86/mm/pageattr_64.c | 2 +- drivers/char/agp/efficeon-agp.c | 11 ++++++----- include/asm-x86/system_32.h | 4 ++++ include/asm-x86/system_64.h | 5 +++++ 6 files changed, 20 insertions(+), 10 deletions(-) (limited to 'include/asm-x86') diff --git a/arch/x86/kernel/tce_64.c b/arch/x86/kernel/tce_64.c index e3f2569b2c44..9e540fee7009 100644 --- a/arch/x86/kernel/tce_64.c +++ b/arch/x86/kernel/tce_64.c @@ -40,9 +40,9 @@ static inline void flush_tce(void* tceaddr) { /* a single tce can't cross a cache line */ if (cpu_has_clflush) - asm volatile("clflush (%0)" :: "r" (tceaddr)); + clflush(tceaddr); else - asm volatile("wbinvd":::"memory"); + wbinvd(); } void tce_build(struct iommu_table *tbl, unsigned long index, diff --git a/arch/x86/mm/pageattr_32.c b/arch/x86/mm/pageattr_32.c index 4241a74d16c8..260073c07600 100644 --- a/arch/x86/mm/pageattr_32.c +++ b/arch/x86/mm/pageattr_32.c @@ -70,10 +70,10 @@ static struct page *split_large_page(unsigned long address, pgprot_t prot, static void cache_flush_page(struct page *p) { - unsigned long adr = (unsigned long)page_address(p); + void *adr = page_address(p); int i; for (i = 0; i < PAGE_SIZE; i += boot_cpu_data.x86_clflush_size) - asm volatile("clflush (%0)" :: "r" (adr + i)); + clflush(adr+i); } static void flush_kernel_map(void *arg) diff --git a/arch/x86/mm/pageattr_64.c b/arch/x86/mm/pageattr_64.c index 93d795d7c2ae..8a4f65bf956e 100644 --- a/arch/x86/mm/pageattr_64.c +++ b/arch/x86/mm/pageattr_64.c @@ -65,7 +65,7 @@ static void cache_flush_page(void *adr) { int i; for (i = 0; i < PAGE_SIZE; i += boot_cpu_data.x86_clflush_size) - asm volatile("clflush (%0)" :: "r" (adr + i)); + clflush(adr+i); } static void flush_kernel_map(void *arg) diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c index d78cd09186aa..cac0009cebc1 100644 --- a/drivers/char/agp/efficeon-agp.c +++ b/drivers/char/agp/efficeon-agp.c @@ -221,7 +221,7 @@ static int efficeon_create_gatt_table(struct agp_bridge_data *bridge) SetPageReserved(virt_to_page((char *)page)); for (offset = 0; offset < PAGE_SIZE; offset += clflush_chunk) - asm volatile("clflush %0" : : "m" (*(char *)(page+offset))); + clflush((char *)page+offset); efficeon_private.l1_table[index] = page; @@ -268,15 +268,16 @@ static int efficeon_insert_memory(struct agp_memory * mem, off_t pg_start, int t *page = insert; /* clflush is slow, so don't clflush until we have to */ - if ( last_page && - ((unsigned long)page^(unsigned long)last_page) & clflush_mask ) - asm volatile("clflush %0" : : "m" (*last_page)); + if (last_page && + (((unsigned long)page^(unsigned long)last_page) & + clflush_mask)) + clflush(last_page); last_page = page; } if ( last_page ) - asm volatile("clflush %0" : : "m" (*last_page)); + clflush(last_page); agp_bridge->driver->tlb_flush(mem); return 0; diff --git a/include/asm-x86/system_32.h b/include/asm-x86/system_32.h index 1d6fb3afa533..db6283eb5e46 100644 --- a/include/asm-x86/system_32.h +++ b/include/asm-x86/system_32.h @@ -161,6 +161,10 @@ static inline void native_wbinvd(void) asm volatile("wbinvd": : :"memory"); } +static inline void clflush(volatile void *__p) +{ + asm volatile("clflush %0" : "+m" (*(char __force *)__p)); +} #ifdef CONFIG_PARAVIRT #include diff --git a/include/asm-x86/system_64.h b/include/asm-x86/system_64.h index fb4bcf99e665..ec4c29bcfcb0 100644 --- a/include/asm-x86/system_64.h +++ b/include/asm-x86/system_64.h @@ -137,6 +137,11 @@ static inline void write_cr8(unsigned long val) #endif /* __KERNEL__ */ +static inline void clflush(volatile void *__p) +{ + asm volatile("clflush %0" : "+m" (*(char __force *)__p)); +} + #define nop() __asm__ __volatile__ ("nop") #ifdef CONFIG_SMP -- cgit v1.2.3 From a850cef77f148c2e305022a1ed86ca6cff5ee300 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Wed, 17 Oct 2007 18:04:38 +0200 Subject: i386: no need to make enable_cpu_hotplug a variable As long as there's no write access to this variable there's no reason to let gcc check it at runtime. [ tglx: arch/x86 adaptation ] Signed-off-by: Adrian Bunk Signed-off-by: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/topology.c | 6 +++--- include/asm-x86/cpu.h | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'include/asm-x86') diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c index c25f23eb397c..8caa0b777466 100644 --- a/arch/x86/kernel/topology.c +++ b/arch/x86/kernel/topology.c @@ -44,15 +44,15 @@ int arch_register_cpu(int num) * Also certain PCI quirks require not to enable hotplug control * for all CPU's. */ - if (num && enable_cpu_hotplug) +#ifdef CONFIG_HOTPLUG_CPU + if (num) cpu_devices[num].cpu.hotpluggable = 1; +#endif return register_cpu(&cpu_devices[num].cpu, num); } #ifdef CONFIG_HOTPLUG_CPU -int enable_cpu_hotplug = 1; - void arch_unregister_cpu(int num) { return unregister_cpu(&cpu_devices[num].cpu); } diff --git a/include/asm-x86/cpu.h b/include/asm-x86/cpu.h index 9d914e1e4aad..b1bc7b1b64b0 100644 --- a/include/asm-x86/cpu.h +++ b/include/asm-x86/cpu.h @@ -13,9 +13,6 @@ struct i386_cpu { extern int arch_register_cpu(int num); #ifdef CONFIG_HOTPLUG_CPU extern void arch_unregister_cpu(int); -extern int enable_cpu_hotplug; -#else -#define enable_cpu_hotplug 0 #endif DECLARE_PER_CPU(int, cpu_state); -- cgit v1.2.3 From 883001f98290ca40b32e2c1872f22600f8dfc968 Mon Sep 17 00:00:00 2001 From: Chris Snook Date: Wed, 17 Oct 2007 18:04:38 +0200 Subject: x86: make atomic64_t work like atomic_t The volatile keyword has already been removed from the declaration of atomic_t on x86_64. For consistency, remove it from atomic64_t as well. [ tglx: arch/x86 adaptation ] Signed-off-by: Chris Snook Signed-off-by: Andi Kleen CC: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/atomic_64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/atomic_64.h b/include/asm-x86/atomic_64.h index f2e64634fa48..2d20a7a19f62 100644 --- a/include/asm-x86/atomic_64.h +++ b/include/asm-x86/atomic_64.h @@ -206,7 +206,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t *v) /* An 64bit atomic type */ -typedef struct { volatile long counter; } atomic64_t; +typedef struct { long counter; } atomic64_t; #define ATOMIC64_INIT(i) { (i) } -- cgit v1.2.3 From 61d08a9ea3d5fd680213aa7a15fcda69ce11987d Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Wed, 17 Oct 2007 18:04:38 +0200 Subject: i386: Remove strrchr assembler implementation The constraints in the inline assembler implementation of i386 strrchr() were incorrect and break the build with recent gcc 4.3. Since there are only very few callers of strrchr() and none of them are performance relevant just remove the assembler implementation and use the C fallback instead. [ tglx: arch/x86 adaptation ] Cc: rguenther@suse.de Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/lib/string_32.c | 20 -------------------- include/asm-x86/string_32.h | 3 --- 2 files changed, 23 deletions(-) (limited to 'include/asm-x86') diff --git a/arch/x86/lib/string_32.c b/arch/x86/lib/string_32.c index 2c773fefa3dd..c2c0504a3071 100644 --- a/arch/x86/lib/string_32.c +++ b/arch/x86/lib/string_32.c @@ -160,26 +160,6 @@ char *strchr(const char * s, int c) EXPORT_SYMBOL(strchr); #endif -#ifdef __HAVE_ARCH_STRRCHR -char *strrchr(const char * s, int c) -{ - int d0, d1; - char * res; - asm volatile( "movb %%al,%%ah\n" - "1:\tlodsb\n\t" - "cmpb %%ah,%%al\n\t" - "jne 2f\n\t" - "leal -1(%%esi),%0\n" - "2:\ttestb %%al,%%al\n\t" - "jne 1b" - :"=g" (res), "=&S" (d0), "=&a" (d1) - :"0" (0),"1" (s),"2" (c) - :"memory"); - return res; -} -EXPORT_SYMBOL(strrchr); -#endif - #ifdef __HAVE_ARCH_STRLEN size_t strlen(const char * s) { diff --git a/include/asm-x86/string_32.h b/include/asm-x86/string_32.h index a9b64453bdf5..55bfa308f900 100644 --- a/include/asm-x86/string_32.h +++ b/include/asm-x86/string_32.h @@ -26,9 +26,6 @@ extern int strncmp(const char *cs, const char *ct, size_t count); #define __HAVE_ARCH_STRCHR extern char *strchr(const char *s, int c); -#define __HAVE_ARCH_STRRCHR -extern char *strrchr(const char *s, int c); - #define __HAVE_ARCH_STRLEN extern size_t strlen(const char *s); -- cgit v1.2.3 From 9efa98159c8b4fd7373d03af9fc06d43f47de0f5 Mon Sep 17 00:00:00 2001 From: Mike Travis Date: Wed, 17 Oct 2007 18:04:38 +0200 Subject: x86: remove x86_cpu_to_log_apicid Remove the x86_cpu_to_log_apicid array. It is set in arch/x86_64/kernel/genapic_flat.c:flat_init_apic_ldr() and arch/x86_64/kernel/smpboot.c:do_boot_cpu() but it is never referenced. [ tglx: arch/x86 adaptation ] Signed-off-by: Mike Travis Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/genapic_64.c | 2 -- arch/x86/kernel/genapic_flat_64.c | 1 - arch/x86/kernel/smpboot_64.c | 1 - include/asm-x86/smp_64.h | 1 - 4 files changed, 5 deletions(-) (limited to 'include/asm-x86') diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c index 47496a40e84f..4ae03e3e8294 100644 --- a/arch/x86/kernel/genapic_64.c +++ b/arch/x86/kernel/genapic_64.c @@ -29,8 +29,6 @@ u8 x86_cpu_to_apicid[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID }; EXPORT_SYMBOL(x86_cpu_to_apicid); -u8 x86_cpu_to_log_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; - struct genapic __read_mostly *genapic = &apic_flat; /* diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c index ecb01eefdd27..91c7526768ee 100644 --- a/arch/x86/kernel/genapic_flat_64.c +++ b/arch/x86/kernel/genapic_flat_64.c @@ -52,7 +52,6 @@ static void flat_init_apic_ldr(void) num = smp_processor_id(); id = 1UL << num; - x86_cpu_to_log_apicid[num] = id; apic_write(APIC_DFR, APIC_DFR_FLAT); val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; val |= SET_APIC_LOGICAL_ID(id); diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c index e5f08de9db88..e351ac4ab5b1 100644 --- a/arch/x86/kernel/smpboot_64.c +++ b/arch/x86/kernel/smpboot_64.c @@ -695,7 +695,6 @@ do_rest: cpu_clear(cpu, cpu_present_map); cpu_clear(cpu, cpu_possible_map); x86_cpu_to_apicid[cpu] = BAD_APICID; - x86_cpu_to_log_apicid[cpu] = BAD_APICID; return -EIO; } diff --git a/include/asm-x86/smp_64.h b/include/asm-x86/smp_64.h index f5bcee1c0927..d30e9b684fdd 100644 --- a/include/asm-x86/smp_64.h +++ b/include/asm-x86/smp_64.h @@ -85,7 +85,6 @@ static inline int hard_smp_processor_id(void) * the real APIC ID <-> CPU # mapping. */ extern u8 x86_cpu_to_apicid[NR_CPUS]; /* physical ID */ -extern u8 x86_cpu_to_log_apicid[NR_CPUS]; extern u8 bios_cpu_apicid[]; static inline int cpu_present_to_apicid(int mps_cpu) -- cgit v1.2.3 From 92b2dc79c3bb3f08afae6c0feaeea593b9c83a76 Mon Sep 17 00:00:00 2001 From: Glauber de Oliveira Costa Date: Wed, 17 Oct 2007 18:04:38 +0200 Subject: x86: remove STR() macros This patch removes the __STR() and STR() macros from x86_64 header files. They seem to be legacy, and has no more users. Even if there were users, they should use __stringify() instead. In fact, there were one third place in which this macro was defined (ia32_binfmt.c), and used just below. In this file, usage was properly converted to __stringify() [ tglx: arch/x86 adaptation ] Signed-off-by: Glauber de Oliveira Costa Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/ia32/ia32_binfmt.c | 5 +---- include/asm-x86/hw_irq_64.h | 3 --- include/asm-x86/system_64.h | 3 --- 3 files changed, 1 insertion(+), 10 deletions(-) (limited to 'include/asm-x86') diff --git a/arch/x86/ia32/ia32_binfmt.c b/arch/x86/ia32/ia32_binfmt.c index d3c53e8b05c0..118b9f9ff499 100644 --- a/arch/x86/ia32/ia32_binfmt.c +++ b/arch/x86/ia32/ia32_binfmt.c @@ -112,11 +112,8 @@ struct elf_prpsinfo char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */ }; -#define __STR(x) #x -#define STR(x) __STR(x) - #define _GET_SEG(x) \ - ({ __u32 seg; asm("movl %%" STR(x) ",%0" : "=r"(seg)); seg; }) + ({ __u32 seg; asm("movl %%" __stringify(x) ",%0" : "=r"(seg)); seg; }) /* Assumes current==process to be dumped */ #define ELF_CORE_COPY_REGS(pr_reg, regs) \ diff --git a/include/asm-x86/hw_irq_64.h b/include/asm-x86/hw_irq_64.h index 09dfc18a6dd0..dc0a953da6a6 100644 --- a/include/asm-x86/hw_irq_64.h +++ b/include/asm-x86/hw_irq_64.h @@ -148,9 +148,6 @@ extern atomic_t irq_mis_count; #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs)) -#define __STR(x) #x -#define STR(x) __STR(x) - #include #define IRQ_NAME2(nr) nr##_interrupt(void) diff --git a/include/asm-x86/system_64.h b/include/asm-x86/system_64.h index ec4c29bcfcb0..4cb23848d460 100644 --- a/include/asm-x86/system_64.h +++ b/include/asm-x86/system_64.h @@ -7,9 +7,6 @@ #ifdef __KERNEL__ -#define __STR(x) #x -#define STR(x) __STR(x) - #define __SAVE(reg,offset) "movq %%" #reg ",(14-" #offset ")*8(%%rsp)\n\t" #define __RESTORE(reg,offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t" -- cgit v1.2.3 From d2ccc3fdde1a860b970109ad78865b7e44d3fc0c Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Wed, 17 Oct 2007 18:04:38 +0200 Subject: x86: Eliminate result signage problem in asm-x86_64/bitops.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The return type of __scanbit() doesn't match the return type of find_{first,next}_bit(). Thus when you construct something like this: boolean ? __scanbit() : find_first_bit() you get an unsigned long result if "boolean" is true, and a signed long result if "boolean" is false. In file included from /home/cel/src/linux/include/linux/mmzone.h:15, from /home/cel/src/linux/include/linux/gfp.h:4, from /home/cel/src/linux/include/linux/slab.h:14, from /home/cel/src/linux/include/linux/percpu.h:5, from /home/cel/src/linux/include/linux/rcupdate.h:41, from /home/cel/src/linux/include/linux/dcache.h:10, from /home/cel/src/linux/include/linux/fs.h:275, from /home/cel/src/linux/fs/nfs/sysctl.c:9: /home/cel/src/linux/include/linux/nodemask.h: In function ‘__first_node’: /home/cel/src/linux/include/linux/nodemask.h:229: warning: signed and unsigned type in conditional expression /home/cel/src/linux/include/linux/nodemask.h: In function ‘__next_node’: /home/cel/src/linux/include/linux/nodemask.h:235: warning: signed and unsigned type in conditional expression /home/cel/src/linux/include/linux/nodemask.h: In function ‘__first_unset_node’: /home/cel/src/linux/include/linux/nodemask.h:253: warning: signed and unsigned type in conditional expression [ tglx: arch/x86 adaptation ] Signed-off-by: Chuck Lever Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/bitops_64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/bitops_64.h b/include/asm-x86/bitops_64.h index d4dbbe5f7bd9..1d7d9b4bcacb 100644 --- a/include/asm-x86/bitops_64.h +++ b/include/asm-x86/bitops_64.h @@ -260,7 +260,7 @@ extern long find_first_bit(const unsigned long * addr, unsigned long size); extern long find_next_bit(const unsigned long * addr, long size, long offset); /* return index of first bet set in val or max when no bit is set */ -static inline unsigned long __scanbit(unsigned long val, unsigned long max) +static inline long __scanbit(unsigned long val, unsigned long max) { asm("bsfq %1,%0 ; cmovz %2,%0" : "=&r" (val) : "r" (val), "r" (max)); return val; -- cgit v1.2.3 From 3f4ed1511dc8c71073bb7d220ee62eedd8e8aeec Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Wed, 17 Oct 2007 18:04:38 +0200 Subject: x86: Add parenthesis to IRQ vector macros It is not good taste to have macros with additions that do not have parenthesises around them. This patch parethesizes the IRQ vector macros for x86_64 arch. Note, this caused me a bit of heart-ache debugging lguest64. [ tglx: arch/x86 adaptation ] Signed-off-by: Steven Rostedt Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/hw_irq_64.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/hw_irq_64.h b/include/asm-x86/hw_irq_64.h index dc0a953da6a6..a470d59da678 100644 --- a/include/asm-x86/hw_irq_64.h +++ b/include/asm-x86/hw_irq_64.h @@ -40,22 +40,22 @@ /* * Vectors 0x30-0x3f are used for ISA interrupts. */ -#define IRQ0_VECTOR FIRST_EXTERNAL_VECTOR + 0x10 -#define IRQ1_VECTOR IRQ0_VECTOR + 1 -#define IRQ2_VECTOR IRQ0_VECTOR + 2 -#define IRQ3_VECTOR IRQ0_VECTOR + 3 -#define IRQ4_VECTOR IRQ0_VECTOR + 4 -#define IRQ5_VECTOR IRQ0_VECTOR + 5 -#define IRQ6_VECTOR IRQ0_VECTOR + 6 -#define IRQ7_VECTOR IRQ0_VECTOR + 7 -#define IRQ8_VECTOR IRQ0_VECTOR + 8 -#define IRQ9_VECTOR IRQ0_VECTOR + 9 -#define IRQ10_VECTOR IRQ0_VECTOR + 10 -#define IRQ11_VECTOR IRQ0_VECTOR + 11 -#define IRQ12_VECTOR IRQ0_VECTOR + 12 -#define IRQ13_VECTOR IRQ0_VECTOR + 13 -#define IRQ14_VECTOR IRQ0_VECTOR + 14 -#define IRQ15_VECTOR IRQ0_VECTOR + 15 +#define IRQ0_VECTOR (FIRST_EXTERNAL_VECTOR + 0x10) +#define IRQ1_VECTOR (IRQ0_VECTOR + 1) +#define IRQ2_VECTOR (IRQ0_VECTOR + 2) +#define IRQ3_VECTOR (IRQ0_VECTOR + 3) +#define IRQ4_VECTOR (IRQ0_VECTOR + 4) +#define IRQ5_VECTOR (IRQ0_VECTOR + 5) +#define IRQ6_VECTOR (IRQ0_VECTOR + 6) +#define IRQ7_VECTOR (IRQ0_VECTOR + 7) +#define IRQ8_VECTOR (IRQ0_VECTOR + 8) +#define IRQ9_VECTOR (IRQ0_VECTOR + 9) +#define IRQ10_VECTOR (IRQ0_VECTOR + 10) +#define IRQ11_VECTOR (IRQ0_VECTOR + 11) +#define IRQ12_VECTOR (IRQ0_VECTOR + 12) +#define IRQ13_VECTOR (IRQ0_VECTOR + 13) +#define IRQ14_VECTOR (IRQ0_VECTOR + 14) +#define IRQ15_VECTOR (IRQ0_VECTOR + 15) /* * Special IRQ vectors used by the SMP architecture, 0xf0-0xff -- cgit v1.2.3 From 7e02cb941ddc129158c276648c10a69dca7d36d3 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Wed, 17 Oct 2007 18:04:38 +0200 Subject: x86: rename .i assembler includes to .h .i is an ending used for preprocessed stuff. This patch therefore renames assembler include files to .h and guards the contents with an #ifdef __ASSEMBLY__. [ tglx: arch/x86 adaptation ] Signed-off-by: Adrian Bunk Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/lib/rwlock_64.S | 2 +- arch/x86/lib/semaphore_32.S | 4 ++-- include/asm-um/alternative-asm.h | 6 ++++++ include/asm-um/alternative-asm.i | 6 ------ include/asm-um/frame.h | 6 ++++++ include/asm-um/frame.i | 6 ------ include/asm-x86/alternative-asm.h | 22 ++++++++++++++++++++++ include/asm-x86/alternative-asm.i | 5 ----- include/asm-x86/alternative-asm_32.i | 12 ------------ include/asm-x86/alternative-asm_64.i | 12 ------------ include/asm-x86/frame.h | 27 +++++++++++++++++++++++++++ include/asm-x86/frame.i | 23 ----------------------- 12 files changed, 64 insertions(+), 67 deletions(-) create mode 100644 include/asm-um/alternative-asm.h delete mode 100644 include/asm-um/alternative-asm.i create mode 100644 include/asm-um/frame.h delete mode 100644 include/asm-um/frame.i create mode 100644 include/asm-x86/alternative-asm.h delete mode 100644 include/asm-x86/alternative-asm.i delete mode 100644 include/asm-x86/alternative-asm_32.i delete mode 100644 include/asm-x86/alternative-asm_64.i create mode 100644 include/asm-x86/frame.h delete mode 100644 include/asm-x86/frame.i (limited to 'include/asm-x86') diff --git a/arch/x86/lib/rwlock_64.S b/arch/x86/lib/rwlock_64.S index 0cde1f807314..05ea55f71405 100644 --- a/arch/x86/lib/rwlock_64.S +++ b/arch/x86/lib/rwlock_64.S @@ -2,7 +2,7 @@ #include #include -#include +#include #include /* rdi: pointer to rwlock_t */ diff --git a/arch/x86/lib/semaphore_32.S b/arch/x86/lib/semaphore_32.S index c01eb39c0b43..444fba400983 100644 --- a/arch/x86/lib/semaphore_32.S +++ b/arch/x86/lib/semaphore_32.S @@ -15,8 +15,8 @@ #include #include -#include -#include +#include +#include #include /* diff --git a/include/asm-um/alternative-asm.h b/include/asm-um/alternative-asm.h new file mode 100644 index 000000000000..9aa9fa2402a4 --- /dev/null +++ b/include/asm-um/alternative-asm.h @@ -0,0 +1,6 @@ +#ifndef __UM_ALTERNATIVE_ASM_I +#define __UM_ALTERNATIVE_ASM_I + +#include "asm/arch/alternative-asm.h" + +#endif diff --git a/include/asm-um/alternative-asm.i b/include/asm-um/alternative-asm.i deleted file mode 100644 index cae9faca132f..000000000000 --- a/include/asm-um/alternative-asm.i +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __UM_ALTERNATIVE_ASM_I -#define __UM_ALTERNATIVE_ASM_I - -#include "asm/arch/alternative-asm.i" - -#endif diff --git a/include/asm-um/frame.h b/include/asm-um/frame.h new file mode 100644 index 000000000000..8a8c1cb415b4 --- /dev/null +++ b/include/asm-um/frame.h @@ -0,0 +1,6 @@ +#ifndef __UM_FRAME_I +#define __UM_FRAME_I + +#include "asm/arch/frame.h" + +#endif diff --git a/include/asm-um/frame.i b/include/asm-um/frame.i deleted file mode 100644 index 09d5dca5d928..000000000000 --- a/include/asm-um/frame.i +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __UM_FRAME_I -#define __UM_FRAME_I - -#include "asm/arch/frame.i" - -#endif diff --git a/include/asm-x86/alternative-asm.h b/include/asm-x86/alternative-asm.h new file mode 100644 index 000000000000..e2077d343c33 --- /dev/null +++ b/include/asm-x86/alternative-asm.h @@ -0,0 +1,22 @@ +#ifdef __ASSEMBLY__ + +#ifdef CONFIG_X86_32 +# define X86_ALIGN .long +#else +# define X86_ALIGN .quad +#endif + +#ifdef CONFIG_SMP + .macro LOCK_PREFIX +1: lock + .section .smp_locks,"a" + .align 4 + X86_ALIGN 1b + .previous + .endm +#else + .macro LOCK_PREFIX + .endm +#endif + +#endif /* __ASSEMBLY__ */ diff --git a/include/asm-x86/alternative-asm.i b/include/asm-x86/alternative-asm.i deleted file mode 100644 index 4f360cd3c888..000000000000 --- a/include/asm-x86/alternative-asm.i +++ /dev/null @@ -1,5 +0,0 @@ -#ifdef CONFIG_X86_32 -# include "alternative-asm_32.i" -#else -# include "alternative-asm_64.i" -#endif diff --git a/include/asm-x86/alternative-asm_32.i b/include/asm-x86/alternative-asm_32.i deleted file mode 100644 index f0510209ccbe..000000000000 --- a/include/asm-x86/alternative-asm_32.i +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef CONFIG_SMP - .macro LOCK_PREFIX -1: lock - .section .smp_locks,"a" - .align 4 - .long 1b - .previous - .endm -#else - .macro LOCK_PREFIX - .endm -#endif diff --git a/include/asm-x86/alternative-asm_64.i b/include/asm-x86/alternative-asm_64.i deleted file mode 100644 index 0b3f1a2bb2cb..000000000000 --- a/include/asm-x86/alternative-asm_64.i +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef CONFIG_SMP - .macro LOCK_PREFIX -1: lock - .section .smp_locks,"a" - .align 8 - .quad 1b - .previous - .endm -#else - .macro LOCK_PREFIX - .endm -#endif diff --git a/include/asm-x86/frame.h b/include/asm-x86/frame.h new file mode 100644 index 000000000000..06850a7194e1 --- /dev/null +++ b/include/asm-x86/frame.h @@ -0,0 +1,27 @@ +#ifdef __ASSEMBLY__ + +#include + +/* The annotation hides the frame from the unwinder and makes it look + like a ordinary ebp save/restore. This avoids some special cases for + frame pointer later */ +#ifdef CONFIG_FRAME_POINTER + .macro FRAME + pushl %ebp + CFI_ADJUST_CFA_OFFSET 4 + CFI_REL_OFFSET ebp,0 + movl %esp,%ebp + .endm + .macro ENDFRAME + popl %ebp + CFI_ADJUST_CFA_OFFSET -4 + CFI_RESTORE ebp + .endm +#else + .macro FRAME + .endm + .macro ENDFRAME + .endm +#endif + +#endif /* __ASSEMBLY__ */ diff --git a/include/asm-x86/frame.i b/include/asm-x86/frame.i deleted file mode 100644 index 03620251ae17..000000000000 --- a/include/asm-x86/frame.i +++ /dev/null @@ -1,23 +0,0 @@ -#include - -/* The annotation hides the frame from the unwinder and makes it look - like a ordinary ebp save/restore. This avoids some special cases for - frame pointer later */ -#ifdef CONFIG_FRAME_POINTER - .macro FRAME - pushl %ebp - CFI_ADJUST_CFA_OFFSET 4 - CFI_REL_OFFSET ebp,0 - movl %esp,%ebp - .endm - .macro ENDFRAME - popl %ebp - CFI_ADJUST_CFA_OFFSET -4 - CFI_RESTORE ebp - .endm -#else - .macro FRAME - .endm - .macro ENDFRAME - .endm -#endif -- cgit v1.2.3 From ffecad95eed621a82e8131b929cfcc3bb2a10d46 Mon Sep 17 00:00:00 2001 From: Satyam Sharma Date: Wed, 17 Oct 2007 18:04:38 +0200 Subject: i386: fix argument signedness warnings These build warnings: In file included from include/asm/thread_info.h:16, from include/linux/thread_info.h:21, from include/linux/preempt.h:9, from include/linux/spinlock.h:49, from include/linux/vmalloc.h:4, from arch/i386/boot/compressed/misc.c:14: include/asm/processor.h: In function cpuid_count include/asm/processor.h:615: warning: pointer targets in passing argument 1 of native_cpuid differ in signedness include/asm/processor.h:615: warning: pointer targets in passing argument 2 of native_cpuid differ in signedness include/asm/processor.h:615: warning: pointer targets in passing argument 3 of native_cpuid differ in signedness include/asm/processor.h:615: warning: pointer targets in passing argument 4 of native_cpuid differ in signedness come because the arguments have been specified as pointers to (signed) int types, not unsigned. So let's specify those as unsigned. Do some codingstyle here and there while at it. [ tglx: arch/x86 adaptation ] Signed-off-by: Satyam Sharma Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/processor_32.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/processor_32.h b/include/asm-x86/processor_32.h index 3845fe72383e..38cc1061487e 100644 --- a/include/asm-x86/processor_32.h +++ b/include/asm-x86/processor_32.h @@ -595,7 +595,9 @@ static inline void load_esp0(struct tss_struct *tss, struct thread_struct *threa * clear %ecx since some cpus (Cyrix MII) do not set or clear %ecx * resulting in stale register contents being returned. */ -static inline void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) +static inline void cpuid(unsigned int op, + unsigned int *eax, unsigned int *ebx, + unsigned int *ecx, unsigned int *edx) { *eax = op; *ecx = 0; @@ -603,8 +605,9 @@ static inline void cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx, } /* Some CPUID calls want 'count' to be placed in ecx */ -static inline void cpuid_count(int op, int count, int *eax, int *ebx, int *ecx, - int *edx) +static inline void cpuid_count(unsigned int op, int count, + unsigned int *eax, unsigned int *ebx, + unsigned int *ecx, unsigned int *edx) { *eax = op; *ecx = count; -- cgit v1.2.3 From 6b556ffc4b8fc71445156bcdd02a16a364a36356 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 17 Oct 2007 18:04:39 +0200 Subject: x86: cleanup 64bit unistd.h sys_iopl is long gone and there is no reason to declare sys_rt_sigaction here. Remove it all together and fix the whitespace mess as well. It's worth the trouble: 25897 -> 21337 bytes, the win is larger than the memory of my first computer :) Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- include/asm-x86/unistd_64.h | 617 +++++++++++++++++++++----------------------- 1 file changed, 301 insertions(+), 316 deletions(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/unistd_64.h b/include/asm-x86/unistd_64.h index 4f769598abaf..5ff4d3e24c34 100644 --- a/include/asm-x86/unistd_64.h +++ b/include/asm-x86/unistd_64.h @@ -2,635 +2,638 @@ #define _ASM_X86_64_UNISTD_H_ #ifndef __SYSCALL -#define __SYSCALL(a,b) +#define __SYSCALL(a,b) #endif /* * This file contains the system call numbers. - * + * * Note: holes are not allowed. */ /* at least 8 syscall per cacheline */ -#define __NR_read 0 +#define __NR_read 0 __SYSCALL(__NR_read, sys_read) -#define __NR_write 1 +#define __NR_write 1 __SYSCALL(__NR_write, sys_write) -#define __NR_open 2 +#define __NR_open 2 __SYSCALL(__NR_open, sys_open) -#define __NR_close 3 +#define __NR_close 3 __SYSCALL(__NR_close, sys_close) -#define __NR_stat 4 +#define __NR_stat 4 __SYSCALL(__NR_stat, sys_newstat) -#define __NR_fstat 5 +#define __NR_fstat 5 __SYSCALL(__NR_fstat, sys_newfstat) -#define __NR_lstat 6 +#define __NR_lstat 6 __SYSCALL(__NR_lstat, sys_newlstat) -#define __NR_poll 7 +#define __NR_poll 7 __SYSCALL(__NR_poll, sys_poll) -#define __NR_lseek 8 +#define __NR_lseek 8 __SYSCALL(__NR_lseek, sys_lseek) -#define __NR_mmap 9 +#define __NR_mmap 9 __SYSCALL(__NR_mmap, sys_mmap) -#define __NR_mprotect 10 +#define __NR_mprotect 10 __SYSCALL(__NR_mprotect, sys_mprotect) -#define __NR_munmap 11 +#define __NR_munmap 11 __SYSCALL(__NR_munmap, sys_munmap) -#define __NR_brk 12 +#define __NR_brk 12 __SYSCALL(__NR_brk, sys_brk) -#define __NR_rt_sigaction 13 +#define __NR_rt_sigaction 13 __SYSCALL(__NR_rt_sigaction, sys_rt_sigaction) -#define __NR_rt_sigprocmask 14 +#define __NR_rt_sigprocmask 14 __SYSCALL(__NR_rt_sigprocmask, sys_rt_sigprocmask) -#define __NR_rt_sigreturn 15 +#define __NR_rt_sigreturn 15 __SYSCALL(__NR_rt_sigreturn, stub_rt_sigreturn) -#define __NR_ioctl 16 +#define __NR_ioctl 16 __SYSCALL(__NR_ioctl, sys_ioctl) -#define __NR_pread64 17 +#define __NR_pread64 17 __SYSCALL(__NR_pread64, sys_pread64) -#define __NR_pwrite64 18 +#define __NR_pwrite64 18 __SYSCALL(__NR_pwrite64, sys_pwrite64) -#define __NR_readv 19 +#define __NR_readv 19 __SYSCALL(__NR_readv, sys_readv) -#define __NR_writev 20 +#define __NR_writev 20 __SYSCALL(__NR_writev, sys_writev) -#define __NR_access 21 +#define __NR_access 21 __SYSCALL(__NR_access, sys_access) -#define __NR_pipe 22 +#define __NR_pipe 22 __SYSCALL(__NR_pipe, sys_pipe) -#define __NR_select 23 +#define __NR_select 23 __SYSCALL(__NR_select, sys_select) -#define __NR_sched_yield 24 +#define __NR_sched_yield 24 __SYSCALL(__NR_sched_yield, sys_sched_yield) -#define __NR_mremap 25 +#define __NR_mremap 25 __SYSCALL(__NR_mremap, sys_mremap) -#define __NR_msync 26 +#define __NR_msync 26 __SYSCALL(__NR_msync, sys_msync) -#define __NR_mincore 27 +#define __NR_mincore 27 __SYSCALL(__NR_mincore, sys_mincore) -#define __NR_madvise 28 +#define __NR_madvise 28 __SYSCALL(__NR_madvise, sys_madvise) -#define __NR_shmget 29 +#define __NR_shmget 29 __SYSCALL(__NR_shmget, sys_shmget) -#define __NR_shmat 30 +#define __NR_shmat 30 __SYSCALL(__NR_shmat, sys_shmat) -#define __NR_shmctl 31 +#define __NR_shmctl 31 __SYSCALL(__NR_shmctl, sys_shmctl) -#define __NR_dup 32 +#define __NR_dup 32 __SYSCALL(__NR_dup, sys_dup) -#define __NR_dup2 33 +#define __NR_dup2 33 __SYSCALL(__NR_dup2, sys_dup2) -#define __NR_pause 34 +#define __NR_pause 34 __SYSCALL(__NR_pause, sys_pause) -#define __NR_nanosleep 35 +#define __NR_nanosleep 35 __SYSCALL(__NR_nanosleep, sys_nanosleep) -#define __NR_getitimer 36 +#define __NR_getitimer 36 __SYSCALL(__NR_getitimer, sys_getitimer) -#define __NR_alarm 37 +#define __NR_alarm 37 __SYSCALL(__NR_alarm, sys_alarm) -#define __NR_setitimer 38 +#define __NR_setitimer 38 __SYSCALL(__NR_setitimer, sys_setitimer) -#define __NR_getpid 39 +#define __NR_getpid 39 __SYSCALL(__NR_getpid, sys_getpid) -#define __NR_sendfile 40 +#define __NR_sendfile 40 __SYSCALL(__NR_sendfile, sys_sendfile64) -#define __NR_socket 41 +#define __NR_socket 41 __SYSCALL(__NR_socket, sys_socket) -#define __NR_connect 42 +#define __NR_connect 42 __SYSCALL(__NR_connect, sys_connect) -#define __NR_accept 43 +#define __NR_accept 43 __SYSCALL(__NR_accept, sys_accept) -#define __NR_sendto 44 +#define __NR_sendto 44 __SYSCALL(__NR_sendto, sys_sendto) -#define __NR_recvfrom 45 +#define __NR_recvfrom 45 __SYSCALL(__NR_recvfrom, sys_recvfrom) -#define __NR_sendmsg 46 +#define __NR_sendmsg 46 __SYSCALL(__NR_sendmsg, sys_sendmsg) -#define __NR_recvmsg 47 +#define __NR_recvmsg 47 __SYSCALL(__NR_recvmsg, sys_recvmsg) -#define __NR_shutdown 48 +#define __NR_shutdown 48 __SYSCALL(__NR_shutdown, sys_shutdown) -#define __NR_bind 49 +#define __NR_bind 49 __SYSCALL(__NR_bind, sys_bind) -#define __NR_listen 50 +#define __NR_listen 50 __SYSCALL(__NR_listen, sys_listen) -#define __NR_getsockname 51 +#define __NR_getsockname 51 __SYSCALL(__NR_getsockname, sys_getsockname) -#define __NR_getpeername 52 +#define __NR_getpeername 52 __SYSCALL(__NR_getpeername, sys_getpeername) -#define __NR_socketpair 53 +#define __NR_socketpair 53 __SYSCALL(__NR_socketpair, sys_socketpair) -#define __NR_setsockopt 54 +#define __NR_setsockopt 54 __SYSCALL(__NR_setsockopt, sys_setsockopt) -#define __NR_getsockopt 55 +#define __NR_getsockopt 55 __SYSCALL(__NR_getsockopt, sys_getsockopt) -#define __NR_clone 56 +#define __NR_clone 56 __SYSCALL(__NR_clone, stub_clone) -#define __NR_fork 57 -__SYSCALL(__NR_fork, stub_fork) -#define __NR_vfork 58 +#define __NR_fork 57 +__SYSCALL(__NR_fork, stub_fork) +#define __NR_vfork 58 __SYSCALL(__NR_vfork, stub_vfork) -#define __NR_execve 59 +#define __NR_execve 59 __SYSCALL(__NR_execve, stub_execve) -#define __NR_exit 60 +#define __NR_exit 60 __SYSCALL(__NR_exit, sys_exit) -#define __NR_wait4 61 +#define __NR_wait4 61 __SYSCALL(__NR_wait4, sys_wait4) -#define __NR_kill 62 +#define __NR_kill 62 __SYSCALL(__NR_kill, sys_kill) -#define __NR_uname 63 +#define __NR_uname 63 __SYSCALL(__NR_uname, sys_uname) -#define __NR_semget 64 +#define __NR_semget 64 __SYSCALL(__NR_semget, sys_semget) -#define __NR_semop 65 +#define __NR_semop 65 __SYSCALL(__NR_semop, sys_semop) -#define __NR_semctl 66 +#define __NR_semctl 66 __SYSCALL(__NR_semctl, sys_semctl) -#define __NR_shmdt 67 +#define __NR_shmdt 67 __SYSCALL(__NR_shmdt, sys_shmdt) -#define __NR_msgget 68 +#define __NR_msgget 68 __SYSCALL(__NR_msgget, sys_msgget) -#define __NR_msgsnd 69 +#define __NR_msgsnd 69 __SYSCALL(__NR_msgsnd, sys_msgsnd) -#define __NR_msgrcv 70 +#define __NR_msgrcv 70 __SYSCALL(__NR_msgrcv, sys_msgrcv) -#define __NR_msgctl 71 +#define __NR_msgctl 71 __SYSCALL(__NR_msgctl, sys_msgctl) -#define __NR_fcntl 72 +#define __NR_fcntl 72 __SYSCALL(__NR_fcntl, sys_fcntl) -#define __NR_flock 73 +#define __NR_flock 73 __SYSCALL(__NR_flock, sys_flock) -#define __NR_fsync 74 +#define __NR_fsync 74 __SYSCALL(__NR_fsync, sys_fsync) -#define __NR_fdatasync 75 +#define __NR_fdatasync 75 __SYSCALL(__NR_fdatasync, sys_fdatasync) -#define __NR_truncate 76 +#define __NR_truncate 76 __SYSCALL(__NR_truncate, sys_truncate) -#define __NR_ftruncate 77 +#define __NR_ftruncate 77 __SYSCALL(__NR_ftruncate, sys_ftruncate) -#define __NR_getdents 78 +#define __NR_getdents 78 __SYSCALL(__NR_getdents, sys_getdents) -#define __NR_getcwd 79 +#define __NR_getcwd 79 __SYSCALL(__NR_getcwd, sys_getcwd) -#define __NR_chdir 80 +#define __NR_chdir 80 __SYSCALL(__NR_chdir, sys_chdir) -#define __NR_fchdir 81 +#define __NR_fchdir 81 __SYSCALL(__NR_fchdir, sys_fchdir) -#define __NR_rename 82 +#define __NR_rename 82 __SYSCALL(__NR_rename, sys_rename) -#define __NR_mkdir 83 +#define __NR_mkdir 83 __SYSCALL(__NR_mkdir, sys_mkdir) -#define __NR_rmdir 84 +#define __NR_rmdir 84 __SYSCALL(__NR_rmdir, sys_rmdir) -#define __NR_creat 85 +#define __NR_creat 85 __SYSCALL(__NR_creat, sys_creat) -#define __NR_link 86 +#define __NR_link 86 __SYSCALL(__NR_link, sys_link) -#define __NR_unlink 87 +#define __NR_unlink 87 __SYSCALL(__NR_unlink, sys_unlink) -#define __NR_symlink 88 +#define __NR_symlink 88 __SYSCALL(__NR_symlink, sys_symlink) -#define __NR_readlink 89 +#define __NR_readlink 89 __SYSCALL(__NR_readlink, sys_readlink) -#define __NR_chmod 90 +#define __NR_chmod 90 __SYSCALL(__NR_chmod, sys_chmod) -#define __NR_fchmod 91 +#define __NR_fchmod 91 __SYSCALL(__NR_fchmod, sys_fchmod) -#define __NR_chown 92 +#define __NR_chown 92 __SYSCALL(__NR_chown, sys_chown) -#define __NR_fchown 93 +#define __NR_fchown 93 __SYSCALL(__NR_fchown, sys_fchown) -#define __NR_lchown 94 +#define __NR_lchown 94 __SYSCALL(__NR_lchown, sys_lchown) -#define __NR_umask 95 +#define __NR_umask 95 __SYSCALL(__NR_umask, sys_umask) -#define __NR_gettimeofday 96 +#define __NR_gettimeofday 96 __SYSCALL(__NR_gettimeofday, sys_gettimeofday) -#define __NR_getrlimit 97 +#define __NR_getrlimit 97 __SYSCALL(__NR_getrlimit, sys_getrlimit) -#define __NR_getrusage 98 +#define __NR_getrusage 98 __SYSCALL(__NR_getrusage, sys_getrusage) -#define __NR_sysinfo 99 +#define __NR_sysinfo 99 __SYSCALL(__NR_sysinfo, sys_sysinfo) -#define __NR_times 100 +#define __NR_times 100 __SYSCALL(__NR_times, sys_times) -#define __NR_ptrace 101 +#define __NR_ptrace 101 __SYSCALL(__NR_ptrace, sys_ptrace) -#define __NR_getuid 102 +#define __NR_getuid 102 __SYSCALL(__NR_getuid, sys_getuid) -#define __NR_syslog 103 +#define __NR_syslog 103 __SYSCALL(__NR_syslog, sys_syslog) /* at the very end the stuff that never runs during the benchmarks */ -#define __NR_getgid 104 +#define __NR_getgid 104 __SYSCALL(__NR_getgid, sys_getgid) -#define __NR_setuid 105 +#define __NR_setuid 105 __SYSCALL(__NR_setuid, sys_setuid) -#define __NR_setgid 106 +#define __NR_setgid 106 __SYSCALL(__NR_setgid, sys_setgid) -#define __NR_geteuid 107 +#define __NR_geteuid 107 __SYSCALL(__NR_geteuid, sys_geteuid) -#define __NR_getegid 108 +#define __NR_getegid 108 __SYSCALL(__NR_getegid, sys_getegid) -#define __NR_setpgid 109 +#define __NR_setpgid 109 __SYSCALL(__NR_setpgid, sys_setpgid) -#define __NR_getppid 110 +#define __NR_getppid 110 __SYSCALL(__NR_getppid, sys_getppid) -#define __NR_getpgrp 111 +#define __NR_getpgrp 111 __SYSCALL(__NR_getpgrp, sys_getpgrp) -#define __NR_setsid 112 +#define __NR_setsid 112 __SYSCALL(__NR_setsid, sys_setsid) -#define __NR_setreuid 113 +#define __NR_setreuid 113 __SYSCALL(__NR_setreuid, sys_setreuid) -#define __NR_setregid 114 +#define __NR_setregid 114 __SYSCALL(__NR_setregid, sys_setregid) -#define __NR_getgroups 115 +#define __NR_getgroups 115 __SYSCALL(__NR_getgroups, sys_getgroups) -#define __NR_setgroups 116 +#define __NR_setgroups 116 __SYSCALL(__NR_setgroups, sys_setgroups) -#define __NR_setresuid 117 +#define __NR_setresuid 117 __SYSCALL(__NR_setresuid, sys_setresuid) -#define __NR_getresuid 118 +#define __NR_getresuid 118 __SYSCALL(__NR_getresuid, sys_getresuid) -#define __NR_setresgid 119 +#define __NR_setresgid 119 __SYSCALL(__NR_setresgid, sys_setresgid) -#define __NR_getresgid 120 +#define __NR_getresgid 120 __SYSCALL(__NR_getresgid, sys_getresgid) -#define __NR_getpgid 121 +#define __NR_getpgid 121 __SYSCALL(__NR_getpgid, sys_getpgid) -#define __NR_setfsuid 122 +#define __NR_setfsuid 122 __SYSCALL(__NR_setfsuid, sys_setfsuid) -#define __NR_setfsgid 123 +#define __NR_setfsgid 123 __SYSCALL(__NR_setfsgid, sys_setfsgid) -#define __NR_getsid 124 +#define __NR_getsid 124 __SYSCALL(__NR_getsid, sys_getsid) -#define __NR_capget 125 +#define __NR_capget 125 __SYSCALL(__NR_capget, sys_capget) -#define __NR_capset 126 +#define __NR_capset 126 __SYSCALL(__NR_capset, sys_capset) -#define __NR_rt_sigpending 127 +#define __NR_rt_sigpending 127 __SYSCALL(__NR_rt_sigpending, sys_rt_sigpending) -#define __NR_rt_sigtimedwait 128 +#define __NR_rt_sigtimedwait 128 __SYSCALL(__NR_rt_sigtimedwait, sys_rt_sigtimedwait) -#define __NR_rt_sigqueueinfo 129 +#define __NR_rt_sigqueueinfo 129 __SYSCALL(__NR_rt_sigqueueinfo, sys_rt_sigqueueinfo) -#define __NR_rt_sigsuspend 130 +#define __NR_rt_sigsuspend 130 __SYSCALL(__NR_rt_sigsuspend, stub_rt_sigsuspend) -#define __NR_sigaltstack 131 +#define __NR_sigaltstack 131 __SYSCALL(__NR_sigaltstack, stub_sigaltstack) -#define __NR_utime 132 +#define __NR_utime 132 __SYSCALL(__NR_utime, sys_utime) -#define __NR_mknod 133 +#define __NR_mknod 133 __SYSCALL(__NR_mknod, sys_mknod) /* Only needed for a.out */ -#define __NR_uselib 134 +#define __NR_uselib 134 __SYSCALL(__NR_uselib, sys_ni_syscall) -#define __NR_personality 135 +#define __NR_personality 135 __SYSCALL(__NR_personality, sys_personality) -#define __NR_ustat 136 +#define __NR_ustat 136 __SYSCALL(__NR_ustat, sys_ustat) -#define __NR_statfs 137 +#define __NR_statfs 137 __SYSCALL(__NR_statfs, sys_statfs) -#define __NR_fstatfs 138 +#define __NR_fstatfs 138 __SYSCALL(__NR_fstatfs, sys_fstatfs) -#define __NR_sysfs 139 +#define __NR_sysfs 139 __SYSCALL(__NR_sysfs, sys_sysfs) -#define __NR_getpriority 140 +#define __NR_getpriority 140 __SYSCALL(__NR_getpriority, sys_getpriority) -#define __NR_setpriority 141 +#define __NR_setpriority 141 __SYSCALL(__NR_setpriority, sys_setpriority) -#define __NR_sched_setparam 142 +#define __NR_sched_setparam 142 __SYSCALL(__NR_sched_setparam, sys_sched_setparam) -#define __NR_sched_getparam 143 +#define __NR_sched_getparam 143 __SYSCALL(__NR_sched_getparam, sys_sched_getparam) -#define __NR_sched_setscheduler 144 +#define __NR_sched_setscheduler 144 __SYSCALL(__NR_sched_setscheduler, sys_sched_setscheduler) -#define __NR_sched_getscheduler 145 +#define __NR_sched_getscheduler 145 __SYSCALL(__NR_sched_getscheduler, sys_sched_getscheduler) -#define __NR_sched_get_priority_max 146 +#define __NR_sched_get_priority_max 146 __SYSCALL(__NR_sched_get_priority_max, sys_sched_get_priority_max) -#define __NR_sched_get_priority_min 147 +#define __NR_sched_get_priority_min 147 __SYSCALL(__NR_sched_get_priority_min, sys_sched_get_priority_min) -#define __NR_sched_rr_get_interval 148 +#define __NR_sched_rr_get_interval 148 __SYSCALL(__NR_sched_rr_get_interval, sys_sched_rr_get_interval) -#define __NR_mlock 149 +#define __NR_mlock 149 __SYSCALL(__NR_mlock, sys_mlock) -#define __NR_munlock 150 +#define __NR_munlock 150 __SYSCALL(__NR_munlock, sys_munlock) -#define __NR_mlockall 151 +#define __NR_mlockall 151 __SYSCALL(__NR_mlockall, sys_mlockall) -#define __NR_munlockall 152 +#define __NR_munlockall 152 __SYSCALL(__NR_munlockall, sys_munlockall) -#define __NR_vhangup 153 +#define __NR_vhangup 153 __SYSCALL(__NR_vhangup, sys_vhangup) -#define __NR_modify_ldt 154 +#define __NR_modify_ldt 154 __SYSCALL(__NR_modify_ldt, sys_modify_ldt) -#define __NR_pivot_root 155 +#define __NR_pivot_root 155 __SYSCALL(__NR_pivot_root, sys_pivot_root) -#define __NR__sysctl 156 +#define __NR__sysctl 156 __SYSCALL(__NR__sysctl, sys_sysctl) -#define __NR_prctl 157 +#define __NR_prctl 157 __SYSCALL(__NR_prctl, sys_prctl) -#define __NR_arch_prctl 158 -__SYSCALL(__NR_arch_prctl, sys_arch_prctl) +#define __NR_arch_prctl 158 +__SYSCALL(__NR_arch_prctl, sys_arch_prctl) -#define __NR_adjtimex 159 +#define __NR_adjtimex 159 __SYSCALL(__NR_adjtimex, sys_adjtimex) -#define __NR_setrlimit 160 +#define __NR_setrlimit 160 __SYSCALL(__NR_setrlimit, sys_setrlimit) -#define __NR_chroot 161 +#define __NR_chroot 161 __SYSCALL(__NR_chroot, sys_chroot) -#define __NR_sync 162 +#define __NR_sync 162 __SYSCALL(__NR_sync, sys_sync) -#define __NR_acct 163 +#define __NR_acct 163 __SYSCALL(__NR_acct, sys_acct) -#define __NR_settimeofday 164 +#define __NR_settimeofday 164 __SYSCALL(__NR_settimeofday, sys_settimeofday) -#define __NR_mount 165 +#define __NR_mount 165 __SYSCALL(__NR_mount, sys_mount) -#define __NR_umount2 166 +#define __NR_umount2 166 __SYSCALL(__NR_umount2, sys_umount) -#define __NR_swapon 167 +#define __NR_swapon 167 __SYSCALL(__NR_swapon, sys_swapon) -#define __NR_swapoff 168 +#define __NR_swapoff 168 __SYSCALL(__NR_swapoff, sys_swapoff) -#define __NR_reboot 169 +#define __NR_reboot 169 __SYSCALL(__NR_reboot, sys_reboot) -#define __NR_sethostname 170 +#define __NR_sethostname 170 __SYSCALL(__NR_sethostname, sys_sethostname) -#define __NR_setdomainname 171 +#define __NR_setdomainname 171 __SYSCALL(__NR_setdomainname, sys_setdomainname) -#define __NR_iopl 172 +#define __NR_iopl 172 __SYSCALL(__NR_iopl, stub_iopl) -#define __NR_ioperm 173 +#define __NR_ioperm 173 __SYSCALL(__NR_ioperm, sys_ioperm) -#define __NR_create_module 174 +#define __NR_create_module 174 __SYSCALL(__NR_create_module, sys_ni_syscall) -#define __NR_init_module 175 +#define __NR_init_module 175 __SYSCALL(__NR_init_module, sys_init_module) -#define __NR_delete_module 176 +#define __NR_delete_module 176 __SYSCALL(__NR_delete_module, sys_delete_module) -#define __NR_get_kernel_syms 177 +#define __NR_get_kernel_syms 177 __SYSCALL(__NR_get_kernel_syms, sys_ni_syscall) -#define __NR_query_module 178 +#define __NR_query_module 178 __SYSCALL(__NR_query_module, sys_ni_syscall) -#define __NR_quotactl 179 +#define __NR_quotactl 179 __SYSCALL(__NR_quotactl, sys_quotactl) -#define __NR_nfsservctl 180 +#define __NR_nfsservctl 180 __SYSCALL(__NR_nfsservctl, sys_nfsservctl) -#define __NR_getpmsg 181 /* reserved for LiS/STREAMS */ +/* reserved for LiS/STREAMS */ +#define __NR_getpmsg 181 __SYSCALL(__NR_getpmsg, sys_ni_syscall) -#define __NR_putpmsg 182 /* reserved for LiS/STREAMS */ +#define __NR_putpmsg 182 __SYSCALL(__NR_putpmsg, sys_ni_syscall) -#define __NR_afs_syscall 183 /* reserved for AFS */ +/* reserved for AFS */ +#define __NR_afs_syscall 183 __SYSCALL(__NR_afs_syscall, sys_ni_syscall) -#define __NR_tuxcall 184 /* reserved for tux */ +/* reserved for tux */ +#define __NR_tuxcall 184 __SYSCALL(__NR_tuxcall, sys_ni_syscall) -#define __NR_security 185 +#define __NR_security 185 __SYSCALL(__NR_security, sys_ni_syscall) -#define __NR_gettid 186 +#define __NR_gettid 186 __SYSCALL(__NR_gettid, sys_gettid) -#define __NR_readahead 187 +#define __NR_readahead 187 __SYSCALL(__NR_readahead, sys_readahead) -#define __NR_setxattr 188 +#define __NR_setxattr 188 __SYSCALL(__NR_setxattr, sys_setxattr) -#define __NR_lsetxattr 189 +#define __NR_lsetxattr 189 __SYSCALL(__NR_lsetxattr, sys_lsetxattr) -#define __NR_fsetxattr 190 +#define __NR_fsetxattr 190 __SYSCALL(__NR_fsetxattr, sys_fsetxattr) -#define __NR_getxattr 191 +#define __NR_getxattr 191 __SYSCALL(__NR_getxattr, sys_getxattr) -#define __NR_lgetxattr 192 +#define __NR_lgetxattr 192 __SYSCALL(__NR_lgetxattr, sys_lgetxattr) -#define __NR_fgetxattr 193 -__SYSCALL(__NR_fgetxattr, sys_fgetxattr) -#define __NR_listxattr 194 -__SYSCALL(__NR_listxattr, sys_listxattr) -#define __NR_llistxattr 195 -__SYSCALL(__NR_llistxattr, sys_llistxattr) -#define __NR_flistxattr 196 -__SYSCALL(__NR_flistxattr, sys_flistxattr) -#define __NR_removexattr 197 -__SYSCALL(__NR_removexattr, sys_removexattr) -#define __NR_lremovexattr 198 -__SYSCALL(__NR_lremovexattr, sys_lremovexattr) -#define __NR_fremovexattr 199 -__SYSCALL(__NR_fremovexattr, sys_fremovexattr) -#define __NR_tkill 200 -__SYSCALL(__NR_tkill, sys_tkill) -#define __NR_time 201 +#define __NR_fgetxattr 193 +__SYSCALL(__NR_fgetxattr, sys_fgetxattr) +#define __NR_listxattr 194 +__SYSCALL(__NR_listxattr, sys_listxattr) +#define __NR_llistxattr 195 +__SYSCALL(__NR_llistxattr, sys_llistxattr) +#define __NR_flistxattr 196 +__SYSCALL(__NR_flistxattr, sys_flistxattr) +#define __NR_removexattr 197 +__SYSCALL(__NR_removexattr, sys_removexattr) +#define __NR_lremovexattr 198 +__SYSCALL(__NR_lremovexattr, sys_lremovexattr) +#define __NR_fremovexattr 199 +__SYSCALL(__NR_fremovexattr, sys_fremovexattr) +#define __NR_tkill 200 +__SYSCALL(__NR_tkill, sys_tkill) +#define __NR_time 201 __SYSCALL(__NR_time, sys_time) -#define __NR_futex 202 +#define __NR_futex 202 __SYSCALL(__NR_futex, sys_futex) -#define __NR_sched_setaffinity 203 +#define __NR_sched_setaffinity 203 __SYSCALL(__NR_sched_setaffinity, sys_sched_setaffinity) -#define __NR_sched_getaffinity 204 +#define __NR_sched_getaffinity 204 __SYSCALL(__NR_sched_getaffinity, sys_sched_getaffinity) -#define __NR_set_thread_area 205 +#define __NR_set_thread_area 205 __SYSCALL(__NR_set_thread_area, sys_ni_syscall) /* use arch_prctl */ -#define __NR_io_setup 206 +#define __NR_io_setup 206 __SYSCALL(__NR_io_setup, sys_io_setup) -#define __NR_io_destroy 207 +#define __NR_io_destroy 207 __SYSCALL(__NR_io_destroy, sys_io_destroy) -#define __NR_io_getevents 208 +#define __NR_io_getevents 208 __SYSCALL(__NR_io_getevents, sys_io_getevents) -#define __NR_io_submit 209 +#define __NR_io_submit 209 __SYSCALL(__NR_io_submit, sys_io_submit) -#define __NR_io_cancel 210 +#define __NR_io_cancel 210 __SYSCALL(__NR_io_cancel, sys_io_cancel) -#define __NR_get_thread_area 211 +#define __NR_get_thread_area 211 __SYSCALL(__NR_get_thread_area, sys_ni_syscall) /* use arch_prctl */ -#define __NR_lookup_dcookie 212 +#define __NR_lookup_dcookie 212 __SYSCALL(__NR_lookup_dcookie, sys_lookup_dcookie) -#define __NR_epoll_create 213 +#define __NR_epoll_create 213 __SYSCALL(__NR_epoll_create, sys_epoll_create) -#define __NR_epoll_ctl_old 214 +#define __NR_epoll_ctl_old 214 __SYSCALL(__NR_epoll_ctl_old, sys_ni_syscall) -#define __NR_epoll_wait_old 215 +#define __NR_epoll_wait_old 215 __SYSCALL(__NR_epoll_wait_old, sys_ni_syscall) -#define __NR_remap_file_pages 216 +#define __NR_remap_file_pages 216 __SYSCALL(__NR_remap_file_pages, sys_remap_file_pages) -#define __NR_getdents64 217 +#define __NR_getdents64 217 __SYSCALL(__NR_getdents64, sys_getdents64) -#define __NR_set_tid_address 218 +#define __NR_set_tid_address 218 __SYSCALL(__NR_set_tid_address, sys_set_tid_address) -#define __NR_restart_syscall 219 +#define __NR_restart_syscall 219 __SYSCALL(__NR_restart_syscall, sys_restart_syscall) -#define __NR_semtimedop 220 +#define __NR_semtimedop 220 __SYSCALL(__NR_semtimedop, sys_semtimedop) -#define __NR_fadvise64 221 +#define __NR_fadvise64 221 __SYSCALL(__NR_fadvise64, sys_fadvise64) -#define __NR_timer_create 222 +#define __NR_timer_create 222 __SYSCALL(__NR_timer_create, sys_timer_create) -#define __NR_timer_settime 223 +#define __NR_timer_settime 223 __SYSCALL(__NR_timer_settime, sys_timer_settime) -#define __NR_timer_gettime 224 +#define __NR_timer_gettime 224 __SYSCALL(__NR_timer_gettime, sys_timer_gettime) -#define __NR_timer_getoverrun 225 +#define __NR_timer_getoverrun 225 __SYSCALL(__NR_timer_getoverrun, sys_timer_getoverrun) -#define __NR_timer_delete 226 +#define __NR_timer_delete 226 __SYSCALL(__NR_timer_delete, sys_timer_delete) -#define __NR_clock_settime 227 +#define __NR_clock_settime 227 __SYSCALL(__NR_clock_settime, sys_clock_settime) -#define __NR_clock_gettime 228 +#define __NR_clock_gettime 228 __SYSCALL(__NR_clock_gettime, sys_clock_gettime) -#define __NR_clock_getres 229 +#define __NR_clock_getres 229 __SYSCALL(__NR_clock_getres, sys_clock_getres) -#define __NR_clock_nanosleep 230 +#define __NR_clock_nanosleep 230 __SYSCALL(__NR_clock_nanosleep, sys_clock_nanosleep) -#define __NR_exit_group 231 +#define __NR_exit_group 231 __SYSCALL(__NR_exit_group, sys_exit_group) -#define __NR_epoll_wait 232 +#define __NR_epoll_wait 232 __SYSCALL(__NR_epoll_wait, sys_epoll_wait) -#define __NR_epoll_ctl 233 +#define __NR_epoll_ctl 233 __SYSCALL(__NR_epoll_ctl, sys_epoll_ctl) -#define __NR_tgkill 234 +#define __NR_tgkill 234 __SYSCALL(__NR_tgkill, sys_tgkill) -#define __NR_utimes 235 +#define __NR_utimes 235 __SYSCALL(__NR_utimes, sys_utimes) -#define __NR_vserver 236 +#define __NR_vserver 236 __SYSCALL(__NR_vserver, sys_ni_syscall) -#define __NR_mbind 237 +#define __NR_mbind 237 __SYSCALL(__NR_mbind, sys_mbind) -#define __NR_set_mempolicy 238 +#define __NR_set_mempolicy 238 __SYSCALL(__NR_set_mempolicy, sys_set_mempolicy) -#define __NR_get_mempolicy 239 +#define __NR_get_mempolicy 239 __SYSCALL(__NR_get_mempolicy, sys_get_mempolicy) -#define __NR_mq_open 240 +#define __NR_mq_open 240 __SYSCALL(__NR_mq_open, sys_mq_open) -#define __NR_mq_unlink 241 +#define __NR_mq_unlink 241 __SYSCALL(__NR_mq_unlink, sys_mq_unlink) -#define __NR_mq_timedsend 242 +#define __NR_mq_timedsend 242 __SYSCALL(__NR_mq_timedsend, sys_mq_timedsend) -#define __NR_mq_timedreceive 243 +#define __NR_mq_timedreceive 243 __SYSCALL(__NR_mq_timedreceive, sys_mq_timedreceive) -#define __NR_mq_notify 244 +#define __NR_mq_notify 244 __SYSCALL(__NR_mq_notify, sys_mq_notify) -#define __NR_mq_getsetattr 245 +#define __NR_mq_getsetattr 245 __SYSCALL(__NR_mq_getsetattr, sys_mq_getsetattr) -#define __NR_kexec_load 246 +#define __NR_kexec_load 246 __SYSCALL(__NR_kexec_load, sys_kexec_load) -#define __NR_waitid 247 +#define __NR_waitid 247 __SYSCALL(__NR_waitid, sys_waitid) -#define __NR_add_key 248 +#define __NR_add_key 248 __SYSCALL(__NR_add_key, sys_add_key) -#define __NR_request_key 249 +#define __NR_request_key 249 __SYSCALL(__NR_request_key, sys_request_key) -#define __NR_keyctl 250 +#define __NR_keyctl 250 __SYSCALL(__NR_keyctl, sys_keyctl) -#define __NR_ioprio_set 251 +#define __NR_ioprio_set 251 __SYSCALL(__NR_ioprio_set, sys_ioprio_set) -#define __NR_ioprio_get 252 +#define __NR_ioprio_get 252 __SYSCALL(__NR_ioprio_get, sys_ioprio_get) -#define __NR_inotify_init 253 +#define __NR_inotify_init 253 __SYSCALL(__NR_inotify_init, sys_inotify_init) -#define __NR_inotify_add_watch 254 +#define __NR_inotify_add_watch 254 __SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch) -#define __NR_inotify_rm_watch 255 +#define __NR_inotify_rm_watch 255 __SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch) -#define __NR_migrate_pages 256 +#define __NR_migrate_pages 256 __SYSCALL(__NR_migrate_pages, sys_migrate_pages) -#define __NR_openat 257 +#define __NR_openat 257 __SYSCALL(__NR_openat, sys_openat) -#define __NR_mkdirat 258 +#define __NR_mkdirat 258 __SYSCALL(__NR_mkdirat, sys_mkdirat) -#define __NR_mknodat 259 +#define __NR_mknodat 259 __SYSCALL(__NR_mknodat, sys_mknodat) -#define __NR_fchownat 260 +#define __NR_fchownat 260 __SYSCALL(__NR_fchownat, sys_fchownat) -#define __NR_futimesat 261 +#define __NR_futimesat 261 __SYSCALL(__NR_futimesat, sys_futimesat) -#define __NR_newfstatat 262 +#define __NR_newfstatat 262 __SYSCALL(__NR_newfstatat, sys_newfstatat) -#define __NR_unlinkat 263 +#define __NR_unlinkat 263 __SYSCALL(__NR_unlinkat, sys_unlinkat) -#define __NR_renameat 264 +#define __NR_renameat 264 __SYSCALL(__NR_renameat, sys_renameat) -#define __NR_linkat 265 +#define __NR_linkat 265 __SYSCALL(__NR_linkat, sys_linkat) -#define __NR_symlinkat 266 +#define __NR_symlinkat 266 __SYSCALL(__NR_symlinkat, sys_symlinkat) -#define __NR_readlinkat 267 +#define __NR_readlinkat 267 __SYSCALL(__NR_readlinkat, sys_readlinkat) -#define __NR_fchmodat 268 +#define __NR_fchmodat 268 __SYSCALL(__NR_fchmodat, sys_fchmodat) -#define __NR_faccessat 269 +#define __NR_faccessat 269 __SYSCALL(__NR_faccessat, sys_faccessat) -#define __NR_pselect6 270 +#define __NR_pselect6 270 __SYSCALL(__NR_pselect6, sys_pselect6) -#define __NR_ppoll 271 +#define __NR_ppoll 271 __SYSCALL(__NR_ppoll, sys_ppoll) -#define __NR_unshare 272 +#define __NR_unshare 272 __SYSCALL(__NR_unshare, sys_unshare) -#define __NR_set_robust_list 273 +#define __NR_set_robust_list 273 __SYSCALL(__NR_set_robust_list, sys_set_robust_list) -#define __NR_get_robust_list 274 +#define __NR_get_robust_list 274 __SYSCALL(__NR_get_robust_list, sys_get_robust_list) -#define __NR_splice 275 +#define __NR_splice 275 __SYSCALL(__NR_splice, sys_splice) -#define __NR_tee 276 +#define __NR_tee 276 __SYSCALL(__NR_tee, sys_tee) -#define __NR_sync_file_range 277 +#define __NR_sync_file_range 277 __SYSCALL(__NR_sync_file_range, sys_sync_file_range) -#define __NR_vmsplice 278 +#define __NR_vmsplice 278 __SYSCALL(__NR_vmsplice, sys_vmsplice) -#define __NR_move_pages 279 +#define __NR_move_pages 279 __SYSCALL(__NR_move_pages, sys_move_pages) -#define __NR_utimensat 280 +#define __NR_utimensat 280 __SYSCALL(__NR_utimensat, sys_utimensat) #define __IGNORE_getcpu /* implemented as a vsyscall */ -#define __NR_epoll_pwait 281 +#define __NR_epoll_pwait 281 __SYSCALL(__NR_epoll_pwait, sys_epoll_pwait) -#define __NR_signalfd 282 +#define __NR_signalfd 282 __SYSCALL(__NR_signalfd, sys_signalfd) -#define __NR_timerfd 283 +#define __NR_timerfd 283 __SYSCALL(__NR_timerfd, sys_timerfd) -#define __NR_eventfd 284 +#define __NR_eventfd 284 __SYSCALL(__NR_eventfd, sys_eventfd) -#define __NR_fallocate 285 +#define __NR_fallocate 285 __SYSCALL(__NR_fallocate, sys_fallocate) #ifndef __NO_STUBS @@ -656,24 +659,6 @@ __SYSCALL(__NR_fallocate, sys_fallocate) #define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_TIME #define __ARCH_WANT_COMPAT_SYS_TIME - -#ifdef __KERNEL__ -#ifndef __ASSEMBLY__ - -#include -#include -#include -#include - -asmlinkage long sys_iopl(unsigned int level, struct pt_regs *regs); -struct sigaction; -asmlinkage long sys_rt_sigaction(int sig, - const struct sigaction __user *act, - struct sigaction __user *oact, - size_t sigsetsize); - -#endif /* __ASSEMBLY__ */ -#endif /* __KERNEL__ */ #endif /* __NO_STUBS */ #ifdef __KERNEL__ -- cgit v1.2.3 From 95c1e9aefa5d3a2dd61304797cad96e8fdcd95ce Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Wed, 17 Oct 2007 18:04:39 +0200 Subject: x86: visws extern inline to static inline "extern inline" will have different semantics with gcc 4.3. Signed-off-by: Adrian Bunk Acked-by: Andrey Panin Signed-off-by: Andrew Morton Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/mach-visws/cobalt.h | 8 ++++---- include/asm-x86/mach-visws/lithium.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/mach-visws/cobalt.h b/include/asm-x86/mach-visws/cobalt.h index 33c36225a042..995258831b7f 100644 --- a/include/asm-x86/mach-visws/cobalt.h +++ b/include/asm-x86/mach-visws/cobalt.h @@ -94,22 +94,22 @@ #define CO_IRQ_8259 CO_IRQ(CO_APIC_8259) #ifdef CONFIG_X86_VISWS_APIC -extern __inline void co_cpu_write(unsigned long reg, unsigned long v) +static inline void co_cpu_write(unsigned long reg, unsigned long v) { *((volatile unsigned long *)(CO_CPU_VADDR+reg))=v; } -extern __inline unsigned long co_cpu_read(unsigned long reg) +static inline unsigned long co_cpu_read(unsigned long reg) { return *((volatile unsigned long *)(CO_CPU_VADDR+reg)); } -extern __inline void co_apic_write(unsigned long reg, unsigned long v) +static inline void co_apic_write(unsigned long reg, unsigned long v) { *((volatile unsigned long *)(CO_APIC_VADDR+reg))=v; } -extern __inline unsigned long co_apic_read(unsigned long reg) +static inline unsigned long co_apic_read(unsigned long reg) { return *((volatile unsigned long *)(CO_APIC_VADDR+reg)); } diff --git a/include/asm-x86/mach-visws/lithium.h b/include/asm-x86/mach-visws/lithium.h index d443e68d0066..dfcd4f07ab85 100644 --- a/include/asm-x86/mach-visws/lithium.h +++ b/include/asm-x86/mach-visws/lithium.h @@ -29,22 +29,22 @@ #define LI_INTD 0x0080 /* More special purpose macros... */ -extern __inline void li_pcia_write16(unsigned long reg, unsigned short v) +static inline void li_pcia_write16(unsigned long reg, unsigned short v) { *((volatile unsigned short *)(LI_PCIA_VADDR+reg))=v; } -extern __inline unsigned short li_pcia_read16(unsigned long reg) +static inline unsigned short li_pcia_read16(unsigned long reg) { return *((volatile unsigned short *)(LI_PCIA_VADDR+reg)); } -extern __inline void li_pcib_write16(unsigned long reg, unsigned short v) +static inline void li_pcib_write16(unsigned long reg, unsigned short v) { *((volatile unsigned short *)(LI_PCIB_VADDR+reg))=v; } -extern __inline unsigned short li_pcib_read16(unsigned long reg) +static inline unsigned short li_pcib_read16(unsigned long reg) { return *((volatile unsigned short *)(LI_PCIB_VADDR+reg)); } -- cgit v1.2.3 From 3c215b6680b347593705e010688e80400d772763 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 17 Oct 2007 18:04:39 +0200 Subject: x86: asm-i386/io.h fix constness - Fix this: include/asm/io.h: In function `memcpy_fromio': include/asm/io.h:208: warning: passing argument 2 of `__memcpy' discards qualifiers from pointer target type - Clean up code a bit Reported-by: Uwe Bugla Cc: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/io_32.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/io_32.h b/include/asm-x86/io_32.h index 4ea7b1ad3c1d..fe881cd1e6f4 100644 --- a/include/asm-x86/io_32.h +++ b/include/asm-x86/io_32.h @@ -199,17 +199,22 @@ static inline void writel(unsigned int b, volatile void __iomem *addr) #define mmiowb() -static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) +static inline void +memset_io(volatile void __iomem *addr, unsigned char val, int count) { - memset((void __force *) addr, val, count); + memset((void __force *)addr, val, count); } -static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, int count) + +static inline void +memcpy_fromio(void *dst, const volatile void __iomem *src, int count) { - __memcpy(dst, (void __force *) src, count); + __memcpy(dst, (const void __force *)src, count); } -static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count) + +static inline void +memcpy_toio(volatile void __iomem *dst, const void *src, int count) { - __memcpy((void __force *) dst, src, count); + __memcpy((void __force *)dst, src, count); } /* -- cgit v1.2.3 From e2f430291fe23a4f78da078142e8fe9e94e9e043 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 17 Oct 2007 18:04:40 +0200 Subject: x86: unify include/asm/mce_32/64.h Merge the files together. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- include/asm-x86/mce.h | 128 ++++++++++++++++++++++++++++++++++++++++++++++- include/asm-x86/mce_32.h | 11 ---- include/asm-x86/mce_64.h | 115 ------------------------------------------ 3 files changed, 126 insertions(+), 128 deletions(-) delete mode 100644 include/asm-x86/mce_32.h delete mode 100644 include/asm-x86/mce_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/mce.h b/include/asm-x86/mce.h index cc8ca389912e..df304fd89c27 100644 --- a/include/asm-x86/mce.h +++ b/include/asm-x86/mce.h @@ -1,5 +1,129 @@ +#ifndef _ASM_X86_MCE_H +#define _ASM_X86_MCE_H + +#ifdef __x86_64__ + +#include +#include + +/* + * Machine Check support for x86 + */ + +#define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */ + +#define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */ +#define MCG_STATUS_EIPV (1UL<<1) /* eip points to correct instruction */ +#define MCG_STATUS_MCIP (1UL<<2) /* machine check in progress */ + +#define MCI_STATUS_VAL (1UL<<63) /* valid error */ +#define MCI_STATUS_OVER (1UL<<62) /* previous errors lost */ +#define MCI_STATUS_UC (1UL<<61) /* uncorrected error */ +#define MCI_STATUS_EN (1UL<<60) /* error enabled */ +#define MCI_STATUS_MISCV (1UL<<59) /* misc error reg. valid */ +#define MCI_STATUS_ADDRV (1UL<<58) /* addr reg. valid */ +#define MCI_STATUS_PCC (1UL<<57) /* processor context corrupt */ + +/* Fields are zero when not available */ +struct mce { + __u64 status; + __u64 misc; + __u64 addr; + __u64 mcgstatus; + __u64 rip; + __u64 tsc; /* cpu time stamp counter */ + __u64 res1; /* for future extension */ + __u64 res2; /* dito. */ + __u8 cs; /* code segment */ + __u8 bank; /* machine check bank */ + __u8 cpu; /* cpu that raised the error */ + __u8 finished; /* entry is valid */ + __u32 pad; +}; + +/* + * This structure contains all data related to the MCE log. Also + * carries a signature to make it easier to find from external + * debugging tools. Each entry is only valid when its finished flag + * is set. + */ + +#define MCE_LOG_LEN 32 + +struct mce_log { + char signature[12]; /* "MACHINECHECK" */ + unsigned len; /* = MCE_LOG_LEN */ + unsigned next; + unsigned flags; + unsigned pad0; + struct mce entry[MCE_LOG_LEN]; +}; + +#define MCE_OVERFLOW 0 /* bit 0 in flags means overflow */ + +#define MCE_LOG_SIGNATURE "MACHINECHECK" + +#define MCE_GET_RECORD_LEN _IOR('M', 1, int) +#define MCE_GET_LOG_LEN _IOR('M', 2, int) +#define MCE_GETCLEAR_FLAGS _IOR('M', 3, int) + +/* Software defined banks */ +#define MCE_EXTENDED_BANK 128 +#define MCE_THERMAL_BANK MCE_EXTENDED_BANK + 0 + +#define K8_MCE_THRESHOLD_BASE (MCE_EXTENDED_BANK + 1) /* MCE_AMD */ +#define K8_MCE_THRESHOLD_BANK_0 (MCE_THRESHOLD_BASE + 0 * 9) +#define K8_MCE_THRESHOLD_BANK_1 (MCE_THRESHOLD_BASE + 1 * 9) +#define K8_MCE_THRESHOLD_BANK_2 (MCE_THRESHOLD_BASE + 2 * 9) +#define K8_MCE_THRESHOLD_BANK_3 (MCE_THRESHOLD_BASE + 3 * 9) +#define K8_MCE_THRESHOLD_BANK_4 (MCE_THRESHOLD_BASE + 4 * 9) +#define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9) +#define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0) + +#endif /* __x86_64__ */ + +#ifdef __KERNEL__ + #ifdef CONFIG_X86_32 -# include "mce_32.h" +#ifdef CONFIG_X86_MCE +extern void mcheck_init(struct cpuinfo_x86 *c); #else -# include "mce_64.h" +#define mcheck_init(c) do {} while(0) +#endif + +extern int mce_disabled; + +#else /* CONFIG_X86_32 */ + +#include + +void mce_log(struct mce *m); +DECLARE_PER_CPU(struct sys_device, device_mce); + +#ifdef CONFIG_X86_MCE_INTEL +void mce_intel_feature_init(struct cpuinfo_x86 *c); +#else +static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) { } +#endif + +#ifdef CONFIG_X86_MCE_AMD +void mce_amd_feature_init(struct cpuinfo_x86 *c); +#else +static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) { } +#endif + +void mce_log_therm_throt_event(unsigned int cpu, __u64 status); + +extern atomic_t mce_entry; + +extern void do_machine_check(struct pt_regs *, long); +extern int mce_notify_user(void); + +#endif /* !CONFIG_X86_32 */ + +extern void stop_mce(void); +extern void restart_mce(void); + +#endif /* __KERNEL__ */ + #endif diff --git a/include/asm-x86/mce_32.h b/include/asm-x86/mce_32.h deleted file mode 100644 index d56d89742e8f..000000000000 --- a/include/asm-x86/mce_32.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifdef CONFIG_X86_MCE -extern void mcheck_init(struct cpuinfo_x86 *c); -#else -#define mcheck_init(c) do {} while(0) -#endif - -extern int mce_disabled; - -extern void stop_mce(void); -extern void restart_mce(void); - diff --git a/include/asm-x86/mce_64.h b/include/asm-x86/mce_64.h deleted file mode 100644 index 7bc030a1996d..000000000000 --- a/include/asm-x86/mce_64.h +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef _ASM_MCE_H -#define _ASM_MCE_H 1 - -#include -#include - -/* - * Machine Check support for x86 - */ - -#define MCG_CTL_P (1UL<<8) /* MCG_CAP register available */ - -#define MCG_STATUS_RIPV (1UL<<0) /* restart ip valid */ -#define MCG_STATUS_EIPV (1UL<<1) /* eip points to correct instruction */ -#define MCG_STATUS_MCIP (1UL<<2) /* machine check in progress */ - -#define MCI_STATUS_VAL (1UL<<63) /* valid error */ -#define MCI_STATUS_OVER (1UL<<62) /* previous errors lost */ -#define MCI_STATUS_UC (1UL<<61) /* uncorrected error */ -#define MCI_STATUS_EN (1UL<<60) /* error enabled */ -#define MCI_STATUS_MISCV (1UL<<59) /* misc error reg. valid */ -#define MCI_STATUS_ADDRV (1UL<<58) /* addr reg. valid */ -#define MCI_STATUS_PCC (1UL<<57) /* processor context corrupt */ - -/* Fields are zero when not available */ -struct mce { - __u64 status; - __u64 misc; - __u64 addr; - __u64 mcgstatus; - __u64 rip; - __u64 tsc; /* cpu time stamp counter */ - __u64 res1; /* for future extension */ - __u64 res2; /* dito. */ - __u8 cs; /* code segment */ - __u8 bank; /* machine check bank */ - __u8 cpu; /* cpu that raised the error */ - __u8 finished; /* entry is valid */ - __u32 pad; -}; - -/* - * This structure contains all data related to the MCE log. - * Also carries a signature to make it easier to find from external debugging tools. - * Each entry is only valid when its finished flag is set. - */ - -#define MCE_LOG_LEN 32 - -struct mce_log { - char signature[12]; /* "MACHINECHECK" */ - unsigned len; /* = MCE_LOG_LEN */ - unsigned next; - unsigned flags; - unsigned pad0; - struct mce entry[MCE_LOG_LEN]; -}; - -#define MCE_OVERFLOW 0 /* bit 0 in flags means overflow */ - -#define MCE_LOG_SIGNATURE "MACHINECHECK" - -#define MCE_GET_RECORD_LEN _IOR('M', 1, int) -#define MCE_GET_LOG_LEN _IOR('M', 2, int) -#define MCE_GETCLEAR_FLAGS _IOR('M', 3, int) - -/* Software defined banks */ -#define MCE_EXTENDED_BANK 128 -#define MCE_THERMAL_BANK MCE_EXTENDED_BANK + 0 - -#define K8_MCE_THRESHOLD_BASE (MCE_EXTENDED_BANK + 1) /* MCE_AMD */ -#define K8_MCE_THRESHOLD_BANK_0 (MCE_THRESHOLD_BASE + 0 * 9) -#define K8_MCE_THRESHOLD_BANK_1 (MCE_THRESHOLD_BASE + 1 * 9) -#define K8_MCE_THRESHOLD_BANK_2 (MCE_THRESHOLD_BASE + 2 * 9) -#define K8_MCE_THRESHOLD_BANK_3 (MCE_THRESHOLD_BASE + 3 * 9) -#define K8_MCE_THRESHOLD_BANK_4 (MCE_THRESHOLD_BASE + 4 * 9) -#define K8_MCE_THRESHOLD_BANK_5 (MCE_THRESHOLD_BASE + 5 * 9) -#define K8_MCE_THRESHOLD_DRAM_ECC (MCE_THRESHOLD_BANK_4 + 0) - -#ifdef __KERNEL__ -#include - -void mce_log(struct mce *m); -DECLARE_PER_CPU(struct sys_device, device_mce); - -#ifdef CONFIG_X86_MCE_INTEL -void mce_intel_feature_init(struct cpuinfo_x86 *c); -#else -static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) -{ -} -#endif - -#ifdef CONFIG_X86_MCE_AMD -void mce_amd_feature_init(struct cpuinfo_x86 *c); -#else -static inline void mce_amd_feature_init(struct cpuinfo_x86 *c) -{ -} -#endif - -void mce_log_therm_throt_event(unsigned int cpu, __u64 status); - -extern atomic_t mce_entry; - -extern void do_machine_check(struct pt_regs *, long); - -extern int mce_notify_user(void); - -extern void stop_mce(void); -extern void restart_mce(void); - -#endif - -#endif -- cgit v1.2.3 From 686d8c63d530a5cfdbab2523825e37b904be56f9 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 17 Oct 2007 18:04:40 +0200 Subject: x86: unify include/asm/ptrace-abi_32/64.h Aside of the register defines the content can be shared. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- include/asm-x86/Kbuild | 2 - include/asm-x86/ptrace-abi.h | 90 ++++++++++++++++++++++++++++++++++++----- include/asm-x86/ptrace-abi_32.h | 39 ------------------ include/asm-x86/ptrace-abi_64.h | 51 ----------------------- 4 files changed, 79 insertions(+), 103 deletions(-) delete mode 100644 include/asm-x86/ptrace-abi_32.h delete mode 100644 include/asm-x86/ptrace-abi_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild index 80744dbcfafd..30f224428724 100644 --- a/include/asm-x86/Kbuild +++ b/include/asm-x86/Kbuild @@ -9,8 +9,6 @@ header-y += ldt_64.h header-y += ldt.h header-y += msr-index.h header-y += prctl.h -header-y += ptrace-abi_32.h -header-y += ptrace-abi_64.h header-y += ptrace-abi.h header-y += sigcontext32.h header-y += ucontext_32.h diff --git a/include/asm-x86/ptrace-abi.h b/include/asm-x86/ptrace-abi.h index 6824c49def1c..7524e1233833 100644 --- a/include/asm-x86/ptrace-abi.h +++ b/include/asm-x86/ptrace-abi.h @@ -1,13 +1,81 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "ptrace-abi_32.h" -# else -# include "ptrace-abi_64.h" -# endif +#ifndef _ASM_X86_PTRACE_ABI_H +#define _ASM_X86_PTRACE_ABI_H + +#ifdef __i386__ + +#define EBX 0 +#define ECX 1 +#define EDX 2 +#define ESI 3 +#define EDI 4 +#define EBP 5 +#define EAX 6 +#define DS 7 +#define ES 8 +#define FS 9 +#define GS 10 +#define ORIG_EAX 11 +#define EIP 12 +#define CS 13 +#define EFL 14 +#define UESP 15 +#define SS 16 +#define FRAME_SIZE 17 + +#else /* __i386__ */ + +#if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS) +#define R15 0 +#define R14 8 +#define R13 16 +#define R12 24 +#define RBP 32 +#define RBX 40 +/* arguments: interrupts/non tracing syscalls only save upto here*/ +#define R11 48 +#define R10 56 +#define R9 64 +#define R8 72 +#define RAX 80 +#define RCX 88 +#define RDX 96 +#define RSI 104 +#define RDI 112 +#define ORIG_RAX 120 /* = ERROR */ +/* end of arguments */ +/* cpu exception frame or undefined in case of fast syscall. */ +#define RIP 128 +#define CS 136 +#define EFLAGS 144 +#define RSP 152 +#define SS 160 +#define ARGOFFSET R11 +#endif /* __ASSEMBLY__ */ + +/* top of stack page */ +#define FRAME_SIZE 168 + +#endif /* !__i386__ */ + +/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ +#define PTRACE_GETREGS 12 +#define PTRACE_SETREGS 13 +#define PTRACE_GETFPREGS 14 +#define PTRACE_SETFPREGS 15 +#define PTRACE_GETFPXREGS 18 +#define PTRACE_SETFPXREGS 19 + +#define PTRACE_OLDSETOPTIONS 21 + +/* only useful for access 32bit programs / kernels */ +#define PTRACE_GET_THREAD_AREA 25 +#define PTRACE_SET_THREAD_AREA 26 + +#ifdef __x86_64__ +# define PTRACE_ARCH_PRCTL 30 #else -# ifdef __i386__ -# include "ptrace-abi_32.h" -# else -# include "ptrace-abi_64.h" -# endif +# define PTRACE_SYSEMU 31 +# define PTRACE_SYSEMU_SINGLESTEP 32 +#endif + #endif diff --git a/include/asm-x86/ptrace-abi_32.h b/include/asm-x86/ptrace-abi_32.h deleted file mode 100644 index a44901817a26..000000000000 --- a/include/asm-x86/ptrace-abi_32.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef I386_PTRACE_ABI_H -#define I386_PTRACE_ABI_H - -#define EBX 0 -#define ECX 1 -#define EDX 2 -#define ESI 3 -#define EDI 4 -#define EBP 5 -#define EAX 6 -#define DS 7 -#define ES 8 -#define FS 9 -#define GS 10 -#define ORIG_EAX 11 -#define EIP 12 -#define CS 13 -#define EFL 14 -#define UESP 15 -#define SS 16 -#define FRAME_SIZE 17 - -/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ -#define PTRACE_GETREGS 12 -#define PTRACE_SETREGS 13 -#define PTRACE_GETFPREGS 14 -#define PTRACE_SETFPREGS 15 -#define PTRACE_GETFPXREGS 18 -#define PTRACE_SETFPXREGS 19 - -#define PTRACE_OLDSETOPTIONS 21 - -#define PTRACE_GET_THREAD_AREA 25 -#define PTRACE_SET_THREAD_AREA 26 - -#define PTRACE_SYSEMU 31 -#define PTRACE_SYSEMU_SINGLESTEP 32 - -#endif diff --git a/include/asm-x86/ptrace-abi_64.h b/include/asm-x86/ptrace-abi_64.h deleted file mode 100644 index 19184b0806b1..000000000000 --- a/include/asm-x86/ptrace-abi_64.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef _X86_64_PTRACE_ABI_H -#define _X86_64_PTRACE_ABI_H - -#if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS) -#define R15 0 -#define R14 8 -#define R13 16 -#define R12 24 -#define RBP 32 -#define RBX 40 -/* arguments: interrupts/non tracing syscalls only save upto here*/ -#define R11 48 -#define R10 56 -#define R9 64 -#define R8 72 -#define RAX 80 -#define RCX 88 -#define RDX 96 -#define RSI 104 -#define RDI 112 -#define ORIG_RAX 120 /* = ERROR */ -/* end of arguments */ -/* cpu exception frame or undefined in case of fast syscall. */ -#define RIP 128 -#define CS 136 -#define EFLAGS 144 -#define RSP 152 -#define SS 160 -#define ARGOFFSET R11 -#endif /* __ASSEMBLY__ */ - -/* top of stack page */ -#define FRAME_SIZE 168 - -#define PTRACE_OLDSETOPTIONS 21 - -/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ -#define PTRACE_GETREGS 12 -#define PTRACE_SETREGS 13 -#define PTRACE_GETFPREGS 14 -#define PTRACE_SETFPREGS 15 -#define PTRACE_GETFPXREGS 18 -#define PTRACE_SETFPXREGS 19 - -/* only useful for access 32bit programs */ -#define PTRACE_GET_THREAD_AREA 25 -#define PTRACE_SET_THREAD_AREA 26 - -#define PTRACE_ARCH_PRCTL 30 /* arch_prctl for child */ - -#endif -- cgit v1.2.3 From f6a2e7f2012eeced1dbf093bb98a1c38fee91f78 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 17 Oct 2007 18:04:40 +0200 Subject: x86: unify include/asm/ldt_32/64.h The additional struct member of user_desc can be made conditional for 64 bit compiles. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar --- include/asm-x86/Kbuild | 2 -- include/asm-x86/ldt.h | 51 ++++++++++++++++++++++++++++++++++++------------ include/asm-x86/ldt_32.h | 32 ------------------------------ include/asm-x86/ldt_64.h | 36 ---------------------------------- 4 files changed, 39 insertions(+), 82 deletions(-) delete mode 100644 include/asm-x86/ldt_32.h delete mode 100644 include/asm-x86/ldt_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild index 30f224428724..a0c0b80c7f2d 100644 --- a/include/asm-x86/Kbuild +++ b/include/asm-x86/Kbuild @@ -4,8 +4,6 @@ header-y += boot.h header-y += debugreg_32.h header-y += debugreg_64.h header-y += debugreg.h -header-y += ldt_32.h -header-y += ldt_64.h header-y += ldt.h header-y += msr-index.h header-y += prctl.h diff --git a/include/asm-x86/ldt.h b/include/asm-x86/ldt.h index 3d9cc20d2ba4..20c597242b53 100644 --- a/include/asm-x86/ldt.h +++ b/include/asm-x86/ldt.h @@ -1,13 +1,40 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "ldt_32.h" -# else -# include "ldt_64.h" -# endif -#else -# ifdef __i386__ -# include "ldt_32.h" -# else -# include "ldt_64.h" -# endif +/* + * ldt.h + * + * Definitions of structures used with the modify_ldt system call. + */ +#ifndef _ASM_X86_LDT_H +#define _ASM_X86_LDT_H + +/* Maximum number of LDT entries supported. */ +#define LDT_ENTRIES 8192 +/* The size of each LDT entry. */ +#define LDT_ENTRY_SIZE 8 + +#ifndef __ASSEMBLY__ +/* + * Note on 64bit base and limit is ignored and you cannot set DS/ES/CS + * not to the default values if you still want to do syscalls. This + * call is more for 32bit mode therefore. + */ +struct user_desc { + unsigned int entry_number; + unsigned int base_addr; + unsigned int limit; + unsigned int seg_32bit:1; + unsigned int contents:2; + unsigned int read_exec_only:1; + unsigned int limit_in_pages:1; + unsigned int seg_not_present:1; + unsigned int useable:1; +#ifdef __x86_64__ + unsigned int lm:1; +#endif +}; + +#define MODIFY_LDT_CONTENTS_DATA 0 +#define MODIFY_LDT_CONTENTS_STACK 1 +#define MODIFY_LDT_CONTENTS_CODE 2 + +#endif /* !__ASSEMBLY__ */ #endif diff --git a/include/asm-x86/ldt_32.h b/include/asm-x86/ldt_32.h deleted file mode 100644 index e9d3de1dee6c..000000000000 --- a/include/asm-x86/ldt_32.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * ldt.h - * - * Definitions of structures used with the modify_ldt system call. - */ -#ifndef _LINUX_LDT_H -#define _LINUX_LDT_H - -/* Maximum number of LDT entries supported. */ -#define LDT_ENTRIES 8192 -/* The size of each LDT entry. */ -#define LDT_ENTRY_SIZE 8 - -#ifndef __ASSEMBLY__ -struct user_desc { - unsigned int entry_number; - unsigned long base_addr; - unsigned int limit; - unsigned int seg_32bit:1; - unsigned int contents:2; - unsigned int read_exec_only:1; - unsigned int limit_in_pages:1; - unsigned int seg_not_present:1; - unsigned int useable:1; -}; - -#define MODIFY_LDT_CONTENTS_DATA 0 -#define MODIFY_LDT_CONTENTS_STACK 1 -#define MODIFY_LDT_CONTENTS_CODE 2 - -#endif /* !__ASSEMBLY__ */ -#endif diff --git a/include/asm-x86/ldt_64.h b/include/asm-x86/ldt_64.h deleted file mode 100644 index 9ef647b890d2..000000000000 --- a/include/asm-x86/ldt_64.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * ldt.h - * - * Definitions of structures used with the modify_ldt system call. - */ -#ifndef _LINUX_LDT_H -#define _LINUX_LDT_H - -/* Maximum number of LDT entries supported. */ -#define LDT_ENTRIES 8192 -/* The size of each LDT entry. */ -#define LDT_ENTRY_SIZE 8 - -#ifndef __ASSEMBLY__ -/* Note on 64bit base and limit is ignored and you cannot set - DS/ES/CS not to the default values if you still want to do syscalls. This - call is more for 32bit mode therefore. */ -struct user_desc { - unsigned int entry_number; - unsigned int base_addr; - unsigned int limit; - unsigned int seg_32bit:1; - unsigned int contents:2; - unsigned int read_exec_only:1; - unsigned int limit_in_pages:1; - unsigned int seg_not_present:1; - unsigned int useable:1; - unsigned int lm:1; -}; - -#define MODIFY_LDT_CONTENTS_DATA 0 -#define MODIFY_LDT_CONTENTS_STACK 1 -#define MODIFY_LDT_CONTENTS_CODE 2 - -#endif /* !__ASSEMBLY__ */ -#endif -- cgit v1.2.3 From 38e760a1335ffaca5a08624a9aed6fe2055c2c98 Mon Sep 17 00:00:00 2001 From: Joe Korty Date: Wed, 17 Oct 2007 18:04:40 +0200 Subject: x86: expand /proc/interrupts to include missing vectors, v2 Add missing IRQs and IRQ descriptions to /proc/interrupts. /proc/interrupts is most useful when it displays every IRQ vector in use by the system, not just those somebody thought would be interesting. This patch inserts the following vector displays to the i386 and x86_64 platforms, as appropriate: rescheduling interrupts TLB flush interrupts function call interrupts thermal event interrupts threshold interrupts spurious interrupts A threshold interrupt occurs when ECC memory correction is occuring at too high a frequency. Thresholds are used by the ECC hardware as occasional ECC failures are part of normal operation, but long sequences of ECC failures usually indicate a memory chip that is about to fail. Thermal event interrupts occur when a temperature threshold has been exceeded for some CPU chip. IIRC, a thermal interrupt is also generated when the temperature drops back to a normal level. A spurious interrupt is an interrupt that was raised then lowered by the device before it could be fully processed by the APIC. Hence the apic sees the interrupt but does not know what device it came from. For this case the APIC hardware will assume a vector of 0xff. Rescheduling, call, and TLB flush interrupts are sent from one CPU to another per the needs of the OS. Typically, their statistics would be used to discover if an interrupt flood of the given type has been occuring. AK: merged v2 and v4 which had some more tweaks AK: replace Local interrupts with Local timer interrupts AK: Fixed description of interrupt types. [ tglx: arch/x86 adaptation ] [ mingo: small cleanup ] Signed-off-by: Joe Korty Signed-off-by: Andi Kleen Cc: Tim Hockin Cc: Andi Kleen Cc: Ingo Molnar Cc: "H. Peter Anvin" Signed-off-by: Andrew Morton Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- Documentation/filesystems/proc.txt | 30 +++++++++++++++++++++++++++++- arch/x86/kernel/apic_32.c | 1 + arch/x86/kernel/apic_64.c | 1 + arch/x86/kernel/cpu/mcheck/p4.c | 1 + arch/x86/kernel/irq_32.c | 31 +++++++++++++++++++++++++++++-- arch/x86/kernel/irq_64.c | 30 ++++++++++++++++++++++++++++-- arch/x86/kernel/mce_amd_64.c | 1 + arch/x86/kernel/mce_intel_64.c | 1 + arch/x86/kernel/smp_32.c | 3 +++ arch/x86/kernel/smp_64.c | 3 +++ arch/x86/mach-voyager/voyager_smp.c | 1 + arch/x86/xen/smp.c | 1 + include/asm-x86/hardirq_32.h | 5 +++++ include/asm-x86/pda.h | 6 ++++++ 14 files changed, 110 insertions(+), 5 deletions(-) (limited to 'include/asm-x86') diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 4a37e25e694c..e5c1df52a876 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt @@ -347,7 +347,35 @@ connects the CPUs in a SMP system. This means that an error has been detected, the IO-APIC automatically retry the transmission, so it should not be a big problem, but you should read the SMP-FAQ. -In this context it could be interesting to note the new irq directory in 2.4. +In 2.6.2* /proc/interrupts was expanded again. This time the goal was for +/proc/interrupts to display every IRQ vector in use by the system, not +just those considered 'most important'. The new vectors are: + + THR -- interrupt raised when a machine check threshold counter + (typically counting ECC corrected errors of memory or cache) exceeds + a configurable threshold. Only available on some systems. + + TRM -- a thermal event interrupt occurs when a temperature threshold + has been exceeded for the CPU. This interrupt may also be generated + when the temperature drops back to normal. + + SPU -- a spurious interrupt is some interrupt that was raised then lowered + by some IO device before it could be fully processed by the APIC. Hence + the APIC sees the interrupt but does not know what device it came from. + For this case the APIC will generate the interrupt with a IRQ vector + of 0xff. This might also be generated by chipset bugs. + + RES, CAL, TLB -- rescheduling, call and TLB flush interrupts are + sent from one CPU to another per the needs of the OS. Typically, + their statistics are used by kernel developers and interested users to + determine the occurance of interrupt of the given type. + +The above IRQ vectors are displayed only when relevent. For example, +the threshold vector does not exist on x86_64 platforms. Others are +suppressed when the system is a uniprocessor. As of this writing, only +i386 and x86_64 platforms support the new IRQ vector displays. + +Of some interest is the introduction of the /proc/irq directory to 2.4. It could be used to set IRQ to CPU affinity, this means that you can "hook" an IRQ to only one CPU, or to exclude a CPU of handling IRQs. The contents of the irq subdir is one subdir for each IRQ, and one file; prof_cpu_mask diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index 3d67ae18d762..793341fffc81 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c @@ -1277,6 +1277,7 @@ void smp_spurious_interrupt(struct pt_regs *regs) /* see sw-dev-man vol 3, chapter 7.4.13.5 */ printk(KERN_INFO "spurious APIC interrupt on CPU#%d, " "should never happen.\n", smp_processor_id()); + __get_cpu_var(irq_stat).irq_spurious_count++; irq_exit(); } diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 2250c654eacc..f47bc493dba9 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c @@ -1140,6 +1140,7 @@ asmlinkage void smp_spurious_interrupt(void) if (v & (1 << (SPURIOUS_APIC_VECTOR & 0x1f))) ack_APIC_irq(); + add_pda(irq_spurious_count, 1); irq_exit(); } diff --git a/arch/x86/kernel/cpu/mcheck/p4.c b/arch/x86/kernel/cpu/mcheck/p4.c index 1509edfb2313..be4dabfee1f5 100644 --- a/arch/x86/kernel/cpu/mcheck/p4.c +++ b/arch/x86/kernel/cpu/mcheck/p4.c @@ -61,6 +61,7 @@ fastcall void smp_thermal_interrupt(struct pt_regs *regs) { irq_enter(); vendor_thermal_interrupt(regs); + __get_cpu_var(irq_stat).irq_thermal_count++; irq_exit(); } diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c index e173b763f148..10f359021aae 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c @@ -280,14 +280,41 @@ skip: seq_printf(p, "NMI: "); for_each_online_cpu(j) seq_printf(p, "%10u ", nmi_count(j)); - seq_putc(p, '\n'); + seq_printf(p, " Non-maskable interrupts\n"); #ifdef CONFIG_X86_LOCAL_APIC seq_printf(p, "LOC: "); for_each_online_cpu(j) seq_printf(p, "%10u ", per_cpu(irq_stat,j).apic_timer_irqs); - seq_putc(p, '\n'); + seq_printf(p, " Local timer interrupts\n"); #endif +#ifdef CONFIG_SMP + seq_printf(p, "RES: "); + for_each_online_cpu(j) + seq_printf(p, "%10u ", + per_cpu(irq_stat,j).irq_resched_count); + seq_printf(p, " Rescheduling interrupts\n"); + seq_printf(p, "CAL: "); + for_each_online_cpu(j) + seq_printf(p, "%10u ", + per_cpu(irq_stat,j).irq_call_count); + seq_printf(p, " function call interrupts\n"); + seq_printf(p, "TLB: "); + for_each_online_cpu(j) + seq_printf(p, "%10u ", + per_cpu(irq_stat,j).irq_tlb_count); + seq_printf(p, " TLB shootdowns\n"); +#endif + seq_printf(p, "TRM: "); + for_each_online_cpu(j) + seq_printf(p, "%10u ", + per_cpu(irq_stat,j).irq_thermal_count); + seq_printf(p, " Thermal event interrupts\n"); + seq_printf(p, "SPU: "); + for_each_online_cpu(j) + seq_printf(p, "%10u ", + per_cpu(irq_stat,j).irq_spurious_count); + seq_printf(p, " Spurious interrupts\n"); seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); #if defined(CONFIG_X86_IO_APIC) seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count)); diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c index 865669efc540..3881189df8ee 100644 --- a/arch/x86/kernel/irq_64.c +++ b/arch/x86/kernel/irq_64.c @@ -86,11 +86,37 @@ skip: seq_printf(p, "NMI: "); for_each_online_cpu(j) seq_printf(p, "%10u ", cpu_pda(j)->__nmi_count); - seq_putc(p, '\n'); + seq_printf(p, " Non-maskable interrupts\n"); seq_printf(p, "LOC: "); for_each_online_cpu(j) seq_printf(p, "%10u ", cpu_pda(j)->apic_timer_irqs); - seq_putc(p, '\n'); + seq_printf(p, " Local timer interrupts\n"); +#ifdef CONFIG_SMP + seq_printf(p, "RES: "); + for_each_online_cpu(j) + seq_printf(p, "%10u ", cpu_pda(j)->irq_resched_count); + seq_printf(p, " Rescheduling interrupts\n"); + seq_printf(p, "CAL: "); + for_each_online_cpu(j) + seq_printf(p, "%10u ", cpu_pda(j)->irq_call_count); + seq_printf(p, " function call interrupts\n"); + seq_printf(p, "TLB: "); + for_each_online_cpu(j) + seq_printf(p, "%10u ", cpu_pda(j)->irq_tlb_count); + seq_printf(p, " TLB shootdowns\n"); +#endif + seq_printf(p, "TRM: "); + for_each_online_cpu(j) + seq_printf(p, "%10u ", cpu_pda(j)->irq_thermal_count); + seq_printf(p, " Thermal event interrupts\n"); + seq_printf(p, "THR: "); + for_each_online_cpu(j) + seq_printf(p, "%10u ", cpu_pda(j)->irq_threshold_count); + seq_printf(p, " Threshold APIC interrupts\n"); + seq_printf(p, "SPU: "); + for_each_online_cpu(j) + seq_printf(p, "%10u ", cpu_pda(j)->irq_spurious_count); + seq_printf(p, " Spurious interrupts\n"); seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); } return 0; diff --git a/arch/x86/kernel/mce_amd_64.c b/arch/x86/kernel/mce_amd_64.c index 805b62b1e0df..0d2afd96aca4 100644 --- a/arch/x86/kernel/mce_amd_64.c +++ b/arch/x86/kernel/mce_amd_64.c @@ -237,6 +237,7 @@ asmlinkage void mce_threshold_interrupt(void) } } out: + add_pda(irq_threshold_count, 1); irq_exit(); } diff --git a/arch/x86/kernel/mce_intel_64.c b/arch/x86/kernel/mce_intel_64.c index 6551505d8a2c..c17eaf5dd6dd 100644 --- a/arch/x86/kernel/mce_intel_64.c +++ b/arch/x86/kernel/mce_intel_64.c @@ -26,6 +26,7 @@ asmlinkage void smp_thermal_interrupt(void) if (therm_throt_process(msr_val & 1)) mce_log_therm_throt_event(smp_processor_id(), msr_val); + add_pda(irq_thermal_count, 1); irq_exit(); } diff --git a/arch/x86/kernel/smp_32.c b/arch/x86/kernel/smp_32.c index eebc6e82576c..791d9f8036ae 100644 --- a/arch/x86/kernel/smp_32.c +++ b/arch/x86/kernel/smp_32.c @@ -342,6 +342,7 @@ fastcall void smp_invalidate_interrupt(struct pt_regs *regs) smp_mb__after_clear_bit(); out: put_cpu_no_resched(); + __get_cpu_var(irq_stat).irq_tlb_count++; } void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm, @@ -640,6 +641,7 @@ static void native_smp_send_stop(void) fastcall void smp_reschedule_interrupt(struct pt_regs *regs) { ack_APIC_irq(); + __get_cpu_var(irq_stat).irq_resched_count++; } fastcall void smp_call_function_interrupt(struct pt_regs *regs) @@ -660,6 +662,7 @@ fastcall void smp_call_function_interrupt(struct pt_regs *regs) */ irq_enter(); (*func)(info); + __get_cpu_var(irq_stat).irq_call_count++; irq_exit(); if (wait) { diff --git a/arch/x86/kernel/smp_64.c b/arch/x86/kernel/smp_64.c index df4a82812adb..5c2964727d19 100644 --- a/arch/x86/kernel/smp_64.c +++ b/arch/x86/kernel/smp_64.c @@ -163,6 +163,7 @@ asmlinkage void smp_invalidate_interrupt(struct pt_regs *regs) out: ack_APIC_irq(); cpu_clear(cpu, f->flush_cpumask); + add_pda(irq_tlb_count, 1); } static void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm, @@ -493,6 +494,7 @@ void smp_send_stop(void) asmlinkage void smp_reschedule_interrupt(void) { ack_APIC_irq(); + add_pda(irq_resched_count, 1); } asmlinkage void smp_call_function_interrupt(void) @@ -514,6 +516,7 @@ asmlinkage void smp_call_function_interrupt(void) exit_idle(); irq_enter(); (*func)(info); + add_pda(irq_call_count, 1); irq_exit(); if (wait) { mb(); diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c index 1f86b529dbbb..e4928aa6bdfb 100644 --- a/arch/x86/mach-voyager/voyager_smp.c +++ b/arch/x86/mach-voyager/voyager_smp.c @@ -1037,6 +1037,7 @@ smp_call_function_interrupt(void) */ irq_enter(); (*func)(info); + __get_cpu_var(irq_stat).irq_call_count++; irq_exit(); if (wait) { mb(); diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 4fa33c27ccb6..6c058585459c 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c @@ -356,6 +356,7 @@ static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id) */ irq_enter(); (*func)(info); + __get_cpu_var(irq_stat).irq_call_count++; irq_exit(); if (wait) { diff --git a/include/asm-x86/hardirq_32.h b/include/asm-x86/hardirq_32.h index 918863530b92..4f85f0f4b563 100644 --- a/include/asm-x86/hardirq_32.h +++ b/include/asm-x86/hardirq_32.h @@ -10,6 +10,11 @@ typedef struct { unsigned int __nmi_count; /* arch dependent */ unsigned int apic_timer_irqs; /* arch dependent */ unsigned int irq0_irqs; + unsigned int irq_resched_count; + unsigned int irq_call_count; + unsigned int irq_tlb_count; + unsigned int irq_thermal_count; + unsigned int irq_spurious_count; } ____cacheline_aligned irq_cpustat_t; DECLARE_PER_CPU(irq_cpustat_t, irq_stat); diff --git a/include/asm-x86/pda.h b/include/asm-x86/pda.h index fb49f80eb94f..35962bbe5e72 100644 --- a/include/asm-x86/pda.h +++ b/include/asm-x86/pda.h @@ -30,6 +30,12 @@ struct x8664_pda { struct mm_struct *active_mm; unsigned apic_timer_irqs; unsigned irq0_irqs; + unsigned irq_resched_count; + unsigned irq_call_count; + unsigned irq_tlb_count; + unsigned irq_thermal_count; + unsigned irq_threshold_count; + unsigned irq_spurious_count; } ____cacheline_aligned_in_smp; extern struct x8664_pda *_cpu_pda[]; -- cgit v1.2.3 From c7537ab234bc629e0a3b0d725dd08e6f24768037 Mon Sep 17 00:00:00 2001 From: "Luiz Fernando N. Capitulino" Date: Wed, 17 Oct 2007 18:04:41 +0200 Subject: x86: convert mm_context_t semaphore to a mutex [ tglx: arch/x86 adaptation ] Signed-off-by: Luiz Fernando N. Capitulino Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/ldt_64.c | 14 +++++++------- arch/x86/kernel/ptrace_64.c | 4 ++-- include/asm-x86/mmu_64.h | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'include/asm-x86') diff --git a/arch/x86/kernel/ldt_64.c b/arch/x86/kernel/ldt_64.c index 3796523d616a..60e57abb8e90 100644 --- a/arch/x86/kernel/ldt_64.c +++ b/arch/x86/kernel/ldt_64.c @@ -96,13 +96,13 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm) struct mm_struct * old_mm; int retval = 0; - init_MUTEX(&mm->context.sem); + mutex_init(&mm->context.lock); mm->context.size = 0; old_mm = current->mm; if (old_mm && old_mm->context.size > 0) { - down(&old_mm->context.sem); + mutex_lock(&old_mm->context.lock); retval = copy_ldt(&mm->context, &old_mm->context); - up(&old_mm->context.sem); + mutex_unlock(&old_mm->context.lock); } return retval; } @@ -133,7 +133,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount) if (bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES) bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES; - down(&mm->context.sem); + mutex_lock(&mm->context.lock); size = mm->context.size*LDT_ENTRY_SIZE; if (size > bytecount) size = bytecount; @@ -141,7 +141,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount) err = 0; if (copy_to_user(ptr, mm->context.ldt, size)) err = -EFAULT; - up(&mm->context.sem); + mutex_unlock(&mm->context.lock); if (err < 0) goto error_return; if (size != bytecount) { @@ -193,7 +193,7 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode) goto out; } - down(&mm->context.sem); + mutex_lock(&mm->context.lock); if (ldt_info.entry_number >= (unsigned)mm->context.size) { error = alloc_ldt(¤t->mm->context, ldt_info.entry_number+1, 1); if (error < 0) @@ -223,7 +223,7 @@ install: error = 0; out_unlock: - up(&mm->context.sem); + mutex_unlock(&mm->context.lock); out: return error; } diff --git a/arch/x86/kernel/ptrace_64.c b/arch/x86/kernel/ptrace_64.c index 86321ee6da93..607085f3f08a 100644 --- a/arch/x86/kernel/ptrace_64.c +++ b/arch/x86/kernel/ptrace_64.c @@ -103,7 +103,7 @@ unsigned long convert_rip_to_linear(struct task_struct *child, struct pt_regs *r seg &= ~7UL; - down(&child->mm->context.sem); + mutex_lock(&child->mm->context.lock); if (unlikely((seg >> 3) >= child->mm->context.size)) addr = -1L; /* bogus selector, access would fault */ else { @@ -117,7 +117,7 @@ unsigned long convert_rip_to_linear(struct task_struct *child, struct pt_regs *r addr &= 0xffff; addr += base; } - up(&child->mm->context.sem); + mutex_unlock(&child->mm->context.lock); } return addr; diff --git a/include/asm-x86/mmu_64.h b/include/asm-x86/mmu_64.h index d2cd4a9d984d..024357c27222 100644 --- a/include/asm-x86/mmu_64.h +++ b/include/asm-x86/mmu_64.h @@ -2,7 +2,7 @@ #define __x86_64_MMU_H #include -#include +#include /* * The x86_64 doesn't have a mmu context, but @@ -14,7 +14,7 @@ typedef struct { void *ldt; rwlock_t ldtlock; int size; - struct semaphore sem; + struct mutex lock; void *vdso; } mm_context_t; -- cgit v1.2.3 From 32c464f5d9701db45bc1673288594e664065388e Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Wed, 17 Oct 2007 18:04:41 +0200 Subject: x86: multi-byte single instruction NOPs Add support for and use the multi-byte NOPs recently documented to be available on all PentiumPro and later processors. This patch only applies cleanly on top of the "x86: misc. constifications" patch sent earlier. [ tglx: arch/x86 adaptation ] Signed-off-by: Jan Beulich Signed-off-by: Andi Kleen Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner arch/x86/kernel/alternative.c | 23 ++++++++++++++++++++++- include/asm-x86/processor_32.h | 22 ++++++++++++++++++++++ include/asm-x86/processor_64.h | 22 ++++++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) --- arch/x86/kernel/alternative.c | 23 ++++++++++++++++++++++- include/asm-x86/processor_32.h | 22 ++++++++++++++++++++++ include/asm-x86/processor_64.h | 22 ++++++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) (limited to 'include/asm-x86') diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 8cb5dbbd9c2e..a3ae8e6c8b3b 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -116,12 +116,31 @@ static const unsigned char *const k7_nops[ASM_NOP_MAX+1] = { }; #endif +#ifdef P6_NOP1 +asm("\t.section .rodata, \"a\"\np6nops: " + P6_NOP1 P6_NOP2 P6_NOP3 P6_NOP4 P6_NOP5 P6_NOP6 + P6_NOP7 P6_NOP8); +extern const unsigned char p6nops[]; +static const unsigned char *const p6_nops[ASM_NOP_MAX+1] = { + NULL, + p6nops, + p6nops + 1, + p6nops + 1 + 2, + p6nops + 1 + 2 + 3, + p6nops + 1 + 2 + 3 + 4, + p6nops + 1 + 2 + 3 + 4 + 5, + p6nops + 1 + 2 + 3 + 4 + 5 + 6, + p6nops + 1 + 2 + 3 + 4 + 5 + 6 + 7, +}; +#endif + #ifdef CONFIG_X86_64 extern char __vsyscall_0; static inline const unsigned char*const * find_nop_table(void) { - return k8_nops; + return boot_cpu_data.x86_vendor != X86_VENDOR_INTEL || + boot_cpu_data.x86 < 6 ? k8_nops : p6_nops; } #else /* CONFIG_X86_64 */ @@ -132,6 +151,8 @@ static const struct nop { } noptypes[] = { { X86_FEATURE_K8, k8_nops }, { X86_FEATURE_K7, k7_nops }, + { X86_FEATURE_P4, p6_nops }, + { X86_FEATURE_P3, p6_nops }, { -1, NULL } }; diff --git a/include/asm-x86/processor_32.h b/include/asm-x86/processor_32.h index 38cc1061487e..83800e7496ee 100644 --- a/include/asm-x86/processor_32.h +++ b/include/asm-x86/processor_32.h @@ -677,6 +677,17 @@ static inline unsigned int cpuid_edx(unsigned int op) #define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n" #define K7_NOP8 K7_NOP7 ASM_NOP1 +/* P6 nops */ +/* uses eax dependencies (Intel-recommended choice) */ +#define P6_NOP1 GENERIC_NOP1 +#define P6_NOP2 ".byte 0x66,0x90\n" +#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n" +#define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n" +#define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n" +#define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n" +#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n" +#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n" + #ifdef CONFIG_MK8 #define ASM_NOP1 K8_NOP1 #define ASM_NOP2 K8_NOP2 @@ -695,6 +706,17 @@ static inline unsigned int cpuid_edx(unsigned int op) #define ASM_NOP6 K7_NOP6 #define ASM_NOP7 K7_NOP7 #define ASM_NOP8 K7_NOP8 +#elif defined(CONFIG_M686) || defined(CONFIG_MPENTIUMII) || \ + defined(CONFIG_MPENTIUMIII) || defined(CONFIG_MPENTIUMM) || \ + defined(CONFIG_MCORE2) || defined(CONFIG_PENTIUM4) +#define ASM_NOP1 P6_NOP1 +#define ASM_NOP2 P6_NOP2 +#define ASM_NOP3 P6_NOP3 +#define ASM_NOP4 P6_NOP4 +#define ASM_NOP5 P6_NOP5 +#define ASM_NOP6 P6_NOP6 +#define ASM_NOP7 P6_NOP7 +#define ASM_NOP8 P6_NOP8 #else #define ASM_NOP1 GENERIC_NOP1 #define ASM_NOP2 GENERIC_NOP2 diff --git a/include/asm-x86/processor_64.h b/include/asm-x86/processor_64.h index 2f12eb6e46b0..f422becbddd9 100644 --- a/include/asm-x86/processor_64.h +++ b/include/asm-x86/processor_64.h @@ -334,6 +334,16 @@ struct extended_sigtable { }; +#if defined(CONFIG_MPSC) || defined(CONFIG_MCORE2) +#define ASM_NOP1 P6_NOP1 +#define ASM_NOP2 P6_NOP2 +#define ASM_NOP3 P6_NOP3 +#define ASM_NOP4 P6_NOP4 +#define ASM_NOP5 P6_NOP5 +#define ASM_NOP6 P6_NOP6 +#define ASM_NOP7 P6_NOP7 +#define ASM_NOP8 P6_NOP8 +#else #define ASM_NOP1 K8_NOP1 #define ASM_NOP2 K8_NOP2 #define ASM_NOP3 K8_NOP3 @@ -342,6 +352,7 @@ struct extended_sigtable { #define ASM_NOP6 K8_NOP6 #define ASM_NOP7 K8_NOP7 #define ASM_NOP8 K8_NOP8 +#endif /* Opteron nops */ #define K8_NOP1 ".byte 0x90\n" @@ -353,6 +364,17 @@ struct extended_sigtable { #define K8_NOP7 K8_NOP4 K8_NOP3 #define K8_NOP8 K8_NOP4 K8_NOP4 +/* P6 nops */ +/* uses eax dependencies (Intel-recommended choice) */ +#define P6_NOP1 ".byte 0x90\n" +#define P6_NOP2 ".byte 0x66,0x90\n" +#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n" +#define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n" +#define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n" +#define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n" +#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n" +#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n" + #define ASM_NOP_MAX 8 /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ -- cgit v1.2.3 From de8aacbe6a3f3dd7104da09a5535232cd385fdd6 Mon Sep 17 00:00:00 2001 From: "Luiz Fernando N. Capitulino" Date: Wed, 17 Oct 2007 18:04:41 +0200 Subject: x86: convert mm_context_t semaphore to a mutex convert mm_context_t semaphore to a mutex. Signed-off-by: Luiz Fernando N. Capitulino Cc: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- arch/x86/kernel/i386_ksyms_32.c | 1 + arch/x86/kernel/ldt_32.c | 14 +++++++------- arch/x86/kernel/ptrace_32.c | 4 ++-- arch/x86/mm/fault_32.c | 4 ++-- include/asm-x86/mmu_32.h | 4 ++-- 5 files changed, 14 insertions(+), 13 deletions(-) (limited to 'include/asm-x86') diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c index e3d4b73bfdb0..edd39ccf139e 100644 --- a/arch/x86/kernel/i386_ksyms_32.c +++ b/arch/x86/kernel/i386_ksyms_32.c @@ -1,4 +1,5 @@ #include +#include #include #include diff --git a/arch/x86/kernel/ldt_32.c b/arch/x86/kernel/ldt_32.c index a8b18421863a..9ff90a27c45f 100644 --- a/arch/x86/kernel/ldt_32.c +++ b/arch/x86/kernel/ldt_32.c @@ -92,13 +92,13 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm) struct mm_struct * old_mm; int retval = 0; - init_MUTEX(&mm->context.sem); + mutex_init(&mm->context.lock); mm->context.size = 0; old_mm = current->mm; if (old_mm && old_mm->context.size > 0) { - down(&old_mm->context.sem); + mutex_lock(&old_mm->context.lock); retval = copy_ldt(&mm->context, &old_mm->context); - up(&old_mm->context.sem); + mutex_unlock(&old_mm->context.lock); } return retval; } @@ -130,7 +130,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount) if (bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES) bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES; - down(&mm->context.sem); + mutex_lock(&mm->context.lock); size = mm->context.size*LDT_ENTRY_SIZE; if (size > bytecount) size = bytecount; @@ -138,7 +138,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount) err = 0; if (copy_to_user(ptr, mm->context.ldt, size)) err = -EFAULT; - up(&mm->context.sem); + mutex_unlock(&mm->context.lock); if (err < 0) goto error_return; if (size != bytecount) { @@ -194,7 +194,7 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode) goto out; } - down(&mm->context.sem); + mutex_lock(&mm->context.lock); if (ldt_info.entry_number >= mm->context.size) { error = alloc_ldt(¤t->mm->context, ldt_info.entry_number+1, 1); if (error < 0) @@ -221,7 +221,7 @@ install: error = 0; out_unlock: - up(&mm->context.sem); + mutex_unlock(&mm->context.lock); out: return error; } diff --git a/arch/x86/kernel/ptrace_32.c b/arch/x86/kernel/ptrace_32.c index 8622b9cd3e38..99102ec5fade 100644 --- a/arch/x86/kernel/ptrace_32.c +++ b/arch/x86/kernel/ptrace_32.c @@ -165,7 +165,7 @@ static unsigned long convert_eip_to_linear(struct task_struct *child, struct pt_ seg &= ~7UL; - down(&child->mm->context.sem); + mutex_lock(&child->mm->context.lock); if (unlikely((seg >> 3) >= child->mm->context.size)) addr = -1L; /* bogus selector, access would fault */ else { @@ -179,7 +179,7 @@ static unsigned long convert_eip_to_linear(struct task_struct *child, struct pt_ addr &= 0xffff; addr += base; } - up(&child->mm->context.sem); + mutex_unlock(&child->mm->context.lock); } return addr; } diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c index d84314ce22bb..6555c3d14371 100644 --- a/arch/x86/mm/fault_32.c +++ b/arch/x86/mm/fault_32.c @@ -105,7 +105,7 @@ static inline unsigned long get_segment_eip(struct pt_regs *regs, LDT and other horrors are only used in user space. */ if (seg & (1<<2)) { /* Must lock the LDT while reading it. */ - down(¤t->mm->context.sem); + mutex_lock(¤t->mm->context.lock); desc = current->mm->context.ldt; desc = (void *)desc + (seg & ~7); } else { @@ -118,7 +118,7 @@ static inline unsigned long get_segment_eip(struct pt_regs *regs, base = get_desc_base((unsigned long *)desc); if (seg & (1<<2)) { - up(¤t->mm->context.sem); + mutex_unlock(¤t->mm->context.lock); } else put_cpu(); diff --git a/include/asm-x86/mmu_32.h b/include/asm-x86/mmu_32.h index 8358dd3df7aa..5e249c51ef56 100644 --- a/include/asm-x86/mmu_32.h +++ b/include/asm-x86/mmu_32.h @@ -1,7 +1,7 @@ #ifndef __i386_MMU_H #define __i386_MMU_H -#include +#include /* * The i386 doesn't have a mmu context, but * we put the segment information here. @@ -10,7 +10,7 @@ */ typedef struct { int size; - struct semaphore sem; + struct mutex lock; void *ldt; void *vdso; } mm_context_t; -- cgit v1.2.3 From 020bd9f1c766ca743556461a70a5b5d559b7e60c Mon Sep 17 00:00:00 2001 From: Brian Gerst Date: Mon, 15 Oct 2007 13:57:46 +0200 Subject: x86: trivial header merges Merge 32/64-bit headers that simply redirect to asm-generic [tglx: fixup Kbuild as well] Signed-off-by: Brian Gerst Signed-off-by: Thomas Gleixner --- include/asm-x86/Kbuild | 4 ---- include/asm-x86/cputime.h | 6 +----- include/asm-x86/cputime_32.h | 6 ------ include/asm-x86/cputime_64.h | 6 ------ include/asm-x86/errno.h | 14 +------------- include/asm-x86/errno_32.h | 6 ------ include/asm-x86/errno_64.h | 6 ------ include/asm-x86/resource.h | 14 +------------- include/asm-x86/resource_32.h | 6 ------ include/asm-x86/resource_64.h | 6 ------ include/asm-x86/rtc.h | 6 +----- include/asm-x86/rtc_32.h | 10 ---------- include/asm-x86/rtc_64.h | 10 ---------- include/asm-x86/sections.h | 6 +----- include/asm-x86/sections_32.h | 7 ------- include/asm-x86/sections_64.h | 7 ------- 16 files changed, 5 insertions(+), 115 deletions(-) delete mode 100644 include/asm-x86/cputime_32.h delete mode 100644 include/asm-x86/cputime_64.h delete mode 100644 include/asm-x86/errno_32.h delete mode 100644 include/asm-x86/errno_64.h delete mode 100644 include/asm-x86/resource_32.h delete mode 100644 include/asm-x86/resource_64.h delete mode 100644 include/asm-x86/rtc_32.h delete mode 100644 include/asm-x86/rtc_64.h delete mode 100644 include/asm-x86/sections_32.h delete mode 100644 include/asm-x86/sections_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild index a0c0b80c7f2d..0618ca386ab1 100644 --- a/include/asm-x86/Kbuild +++ b/include/asm-x86/Kbuild @@ -22,8 +22,6 @@ unifdef-y += byteorder_32.h unifdef-y += byteorder_64.h unifdef-y += elf_32.h unifdef-y += elf_64.h -unifdef-y += errno_32.h -unifdef-y += errno_64.h unifdef-y += ioctls_32.h unifdef-y += ioctls_64.h unifdef-y += ipcbuf_32.h @@ -47,8 +45,6 @@ unifdef-y += posix_types_32.h unifdef-y += posix_types_64.h unifdef-y += ptrace_32.h unifdef-y += ptrace_64.h -unifdef-y += resource_32.h -unifdef-y += resource_64.h unifdef-y += sembuf_32.h unifdef-y += sembuf_64.h unifdef-y += setup_32.h diff --git a/include/asm-x86/cputime.h b/include/asm-x86/cputime.h index 87c37cf6b707..6d68ad7e0ea3 100644 --- a/include/asm-x86/cputime.h +++ b/include/asm-x86/cputime.h @@ -1,5 +1 @@ -#ifdef CONFIG_X86_32 -# include "cputime_32.h" -#else -# include "cputime_64.h" -#endif +#include diff --git a/include/asm-x86/cputime_32.h b/include/asm-x86/cputime_32.h deleted file mode 100644 index 398ed7cd171d..000000000000 --- a/include/asm-x86/cputime_32.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __I386_CPUTIME_H -#define __I386_CPUTIME_H - -#include - -#endif /* __I386_CPUTIME_H */ diff --git a/include/asm-x86/cputime_64.h b/include/asm-x86/cputime_64.h deleted file mode 100644 index a07012dc5a3c..000000000000 --- a/include/asm-x86/cputime_64.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __X86_64_CPUTIME_H -#define __X86_64_CPUTIME_H - -#include - -#endif /* __X86_64_CPUTIME_H */ diff --git a/include/asm-x86/errno.h b/include/asm-x86/errno.h index 9d511be8e573..4c82b503d92f 100644 --- a/include/asm-x86/errno.h +++ b/include/asm-x86/errno.h @@ -1,13 +1 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "errno_32.h" -# else -# include "errno_64.h" -# endif -#else -# ifdef __i386__ -# include "errno_32.h" -# else -# include "errno_64.h" -# endif -#endif +#include diff --git a/include/asm-x86/errno_32.h b/include/asm-x86/errno_32.h deleted file mode 100644 index 969b34374728..000000000000 --- a/include/asm-x86/errno_32.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _I386_ERRNO_H -#define _I386_ERRNO_H - -#include - -#endif diff --git a/include/asm-x86/errno_64.h b/include/asm-x86/errno_64.h deleted file mode 100644 index 311182129e32..000000000000 --- a/include/asm-x86/errno_64.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _X8664_ERRNO_H -#define _X8664_ERRNO_H - -#include - -#endif diff --git a/include/asm-x86/resource.h b/include/asm-x86/resource.h index 732410a8c02a..04bc4db8921b 100644 --- a/include/asm-x86/resource.h +++ b/include/asm-x86/resource.h @@ -1,13 +1 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "resource_32.h" -# else -# include "resource_64.h" -# endif -#else -# ifdef __i386__ -# include "resource_32.h" -# else -# include "resource_64.h" -# endif -#endif +#include diff --git a/include/asm-x86/resource_32.h b/include/asm-x86/resource_32.h deleted file mode 100644 index 6c1ea37c7718..000000000000 --- a/include/asm-x86/resource_32.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _I386_RESOURCE_H -#define _I386_RESOURCE_H - -#include - -#endif diff --git a/include/asm-x86/resource_64.h b/include/asm-x86/resource_64.h deleted file mode 100644 index f40b40623234..000000000000 --- a/include/asm-x86/resource_64.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _X8664_RESOURCE_H -#define _X8664_RESOURCE_H - -#include - -#endif diff --git a/include/asm-x86/rtc.h b/include/asm-x86/rtc.h index 1f0c98eb2e38..f71c3b0ed360 100644 --- a/include/asm-x86/rtc.h +++ b/include/asm-x86/rtc.h @@ -1,5 +1 @@ -#ifdef CONFIG_X86_32 -# include "rtc_32.h" -#else -# include "rtc_64.h" -#endif +#include diff --git a/include/asm-x86/rtc_32.h b/include/asm-x86/rtc_32.h deleted file mode 100644 index ffd02109a0e5..000000000000 --- a/include/asm-x86/rtc_32.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _I386_RTC_H -#define _I386_RTC_H - -/* - * x86 uses the default access methods for the RTC. - */ - -#include - -#endif diff --git a/include/asm-x86/rtc_64.h b/include/asm-x86/rtc_64.h deleted file mode 100644 index 18ed713ac7de..000000000000 --- a/include/asm-x86/rtc_64.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _X86_64_RTC_H -#define _X86_64_RTC_H - -/* - * x86 uses the default access methods for the RTC. - */ - -#include - -#endif diff --git a/include/asm-x86/sections.h b/include/asm-x86/sections.h index ae6c69d9be3f..2b8c5160388f 100644 --- a/include/asm-x86/sections.h +++ b/include/asm-x86/sections.h @@ -1,5 +1 @@ -#ifdef CONFIG_X86_32 -# include "sections_32.h" -#else -# include "sections_64.h" -#endif +#include diff --git a/include/asm-x86/sections_32.h b/include/asm-x86/sections_32.h deleted file mode 100644 index 2dcbb92918b2..000000000000 --- a/include/asm-x86/sections_32.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _I386_SECTIONS_H -#define _I386_SECTIONS_H - -/* nothing to see, move along */ -#include - -#endif diff --git a/include/asm-x86/sections_64.h b/include/asm-x86/sections_64.h deleted file mode 100644 index c746d9f1e70c..000000000000 --- a/include/asm-x86/sections_64.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _X8664_SECTIONS_H -#define _X8664_SECTIONS_H - -/* nothing to see, move along */ -#include - -#endif -- cgit v1.2.3 From 217d115cd5d7d2bef7db7839b93ce5dc2867c392 Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Mon, 15 Oct 2007 13:57:46 +0200 Subject: x86: merge some trivially mergeable headers Merge errno.h, resource.h, rtc.h, sections.h, serial.h and sockios.h, where i386 and x86_64 have no or only trivial comment/include guard differences. Build tested on both 32-bit and 64-bit, and booted on 64-bit. [tglx: fixup Kbuild as well] Signed-off-by: Roland Dreier Signed-off-by: Thomas Gleixner --- include/asm-x86/Kbuild | 2 -- include/asm-x86/serial.h | 30 +++++++++++++++++++++++++++--- include/asm-x86/serial_32.h | 29 ----------------------------- include/asm-x86/serial_64.h | 29 ----------------------------- include/asm-x86/sockios.h | 26 +++++++++++++------------- include/asm-x86/sockios_32.h | 13 ------------- include/asm-x86/sockios_64.h | 13 ------------- 7 files changed, 40 insertions(+), 102 deletions(-) delete mode 100644 include/asm-x86/serial_32.h delete mode 100644 include/asm-x86/serial_64.h delete mode 100644 include/asm-x86/sockios_32.h delete mode 100644 include/asm-x86/sockios_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild index 0618ca386ab1..158deea39a54 100644 --- a/include/asm-x86/Kbuild +++ b/include/asm-x86/Kbuild @@ -59,8 +59,6 @@ unifdef-y += siginfo_32.h unifdef-y += siginfo_64.h unifdef-y += signal_32.h unifdef-y += signal_64.h -unifdef-y += sockios_32.h -unifdef-y += sockios_64.h unifdef-y += stat_32.h unifdef-y += stat_64.h unifdef-y += statfs_32.h diff --git a/include/asm-x86/serial.h b/include/asm-x86/serial.h index cf1b05227b29..628c801535ea 100644 --- a/include/asm-x86/serial.h +++ b/include/asm-x86/serial.h @@ -1,5 +1,29 @@ -#ifdef CONFIG_X86_32 -# include "serial_32.h" +#ifndef _ASM_X86_SERIAL_H +#define _ASM_X86_SERIAL_H + +/* + * This assumes you have a 1.8432 MHz clock for your UART. + * + * It'd be nice if someone built a serial card with a 24.576 MHz + * clock, since the 16550A is capable of handling a top speed of 1.5 + * megabits/second; but this requires the faster clock. + */ +#define BASE_BAUD ( 1843200 / 16 ) + +/* Standard COM flags (except for COM4, because of the 8514 problem) */ +#ifdef CONFIG_SERIAL_DETECT_IRQ +#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ) +#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ) #else -# include "serial_64.h" +#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) +#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF #endif + +#define SERIAL_PORT_DFNS \ + /* UART CLK PORT IRQ FLAGS */ \ + { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ + { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ + { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ + { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ + +#endif /* _ASM_X86_SERIAL_H */ diff --git a/include/asm-x86/serial_32.h b/include/asm-x86/serial_32.h deleted file mode 100644 index bd67480ca109..000000000000 --- a/include/asm-x86/serial_32.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * include/asm-i386/serial.h - */ - - -/* - * This assumes you have a 1.8432 MHz clock for your UART. - * - * It'd be nice if someone built a serial card with a 24.576 MHz - * clock, since the 16550A is capable of handling a top speed of 1.5 - * megabits/second; but this requires the faster clock. - */ -#define BASE_BAUD ( 1843200 / 16 ) - -/* Standard COM flags (except for COM4, because of the 8514 problem) */ -#ifdef CONFIG_SERIAL_DETECT_IRQ -#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ) -#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ) -#else -#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) -#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF -#endif - -#define SERIAL_PORT_DFNS \ - /* UART CLK PORT IRQ FLAGS */ \ - { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ - { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ - { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ - { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ diff --git a/include/asm-x86/serial_64.h b/include/asm-x86/serial_64.h deleted file mode 100644 index b0496e0d72a6..000000000000 --- a/include/asm-x86/serial_64.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * include/asm-x86_64/serial.h - */ - - -/* - * This assumes you have a 1.8432 MHz clock for your UART. - * - * It'd be nice if someone built a serial card with a 24.576 MHz - * clock, since the 16550A is capable of handling a top speed of 1.5 - * megabits/second; but this requires the faster clock. - */ -#define BASE_BAUD ( 1843200 / 16 ) - -/* Standard COM flags (except for COM4, because of the 8514 problem) */ -#ifdef CONFIG_SERIAL_DETECT_IRQ -#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ) -#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ) -#else -#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) -#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF -#endif - -#define SERIAL_PORT_DFNS \ - /* UART CLK PORT IRQ FLAGS */ \ - { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ - { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ - { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ - { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ diff --git a/include/asm-x86/sockios.h b/include/asm-x86/sockios.h index 5a134fc70b9c..49cc72b5d3c9 100644 --- a/include/asm-x86/sockios.h +++ b/include/asm-x86/sockios.h @@ -1,13 +1,13 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "sockios_32.h" -# else -# include "sockios_64.h" -# endif -#else -# ifdef __i386__ -# include "sockios_32.h" -# else -# include "sockios_64.h" -# endif -#endif +#ifndef _ASM_X86_SOCKIOS_H +#define _ASM_X86_SOCKIOS_H + +/* Socket-level I/O control calls. */ +#define FIOSETOWN 0x8901 +#define SIOCSPGRP 0x8902 +#define FIOGETOWN 0x8903 +#define SIOCGPGRP 0x8904 +#define SIOCATMARK 0x8905 +#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ +#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ + +#endif /* _ASM_X86_SOCKIOS_H */ diff --git a/include/asm-x86/sockios_32.h b/include/asm-x86/sockios_32.h deleted file mode 100644 index ff528c7d255c..000000000000 --- a/include/asm-x86/sockios_32.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __ARCH_I386_SOCKIOS__ -#define __ARCH_I386_SOCKIOS__ - -/* Socket-level I/O control calls. */ -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ -#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ - -#endif diff --git a/include/asm-x86/sockios_64.h b/include/asm-x86/sockios_64.h deleted file mode 100644 index d726ba2513e3..000000000000 --- a/include/asm-x86/sockios_64.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __ARCH_X8664_SOCKIOS__ -#define __ARCH_X8664_SOCKIOS__ - -/* Socket-level I/O control calls. */ -#define FIOSETOWN 0x8901 -#define SIOCSPGRP 0x8902 -#define FIOGETOWN 0x8903 -#define SIOCGPGRP 0x8904 -#define SIOCATMARK 0x8905 -#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ -#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ - -#endif -- cgit v1.2.3 From 003a46cfff308ee0d879dfa89b9a7c65b2a481bf Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 13:57:47 +0200 Subject: x86: unify some more trivial include/asm-x86/ 32/64 variants Scripted unification. Signed-off-by: Thomas Gleixner --- include/asm-x86/Kbuild | 14 --- include/asm-x86/bugs.h | 11 +- include/asm-x86/bugs_32.h | 12 -- include/asm-x86/bugs_64.h | 6 - include/asm-x86/device.h | 13 +- include/asm-x86/device_32.h | 15 --- include/asm-x86/device_64.h | 15 --- include/asm-x86/intel_arch_perfmon.h | 36 +++++- include/asm-x86/intel_arch_perfmon_32.h | 31 ----- include/asm-x86/intel_arch_perfmon_64.h | 31 ----- include/asm-x86/ipcbuf.h | 42 +++++-- include/asm-x86/ipcbuf_32.h | 29 ----- include/asm-x86/ipcbuf_64.h | 29 ----- include/asm-x86/namei.h | 16 ++- include/asm-x86/namei_32.h | 17 --- include/asm-x86/namei_64.h | 11 -- include/asm-x86/param.h | 31 +++-- include/asm-x86/param_32.h | 22 ---- include/asm-x86/param_64.h | 22 ---- include/asm-x86/parport.h | 15 ++- include/asm-x86/parport_32.h | 18 --- include/asm-x86/parport_64.h | 18 --- include/asm-x86/rwlock.h | 14 ++- include/asm-x86/rwlock_32.h | 25 ---- include/asm-x86/rwlock_64.h | 26 ---- include/asm-x86/sembuf.h | 37 ++++-- include/asm-x86/sembuf_32.h | 25 ---- include/asm-x86/sembuf_64.h | 25 ---- include/asm-x86/shmparam.h | 19 +-- include/asm-x86/shmparam_32.h | 6 - include/asm-x86/shmparam_64.h | 6 - include/asm-x86/termbits.h | 211 ++++++++++++++++++++++++++++++-- include/asm-x86/termbits_32.h | 198 ------------------------------ include/asm-x86/termbits_64.h | 198 ------------------------------ include/asm-x86/termios.h | 108 ++++++++++++++-- include/asm-x86/termios_32.h | 90 -------------- include/asm-x86/termios_64.h | 90 -------------- include/asm-x86/ucontext.h | 25 ++-- include/asm-x86/ucontext_32.h | 12 -- include/asm-x86/ucontext_64.h | 12 -- include/asm-x86/unaligned.h | 42 ++++++- include/asm-x86/unaligned_32.h | 37 ------ include/asm-x86/unaligned_64.h | 37 ------ 43 files changed, 498 insertions(+), 1199 deletions(-) delete mode 100644 include/asm-x86/bugs_32.h delete mode 100644 include/asm-x86/bugs_64.h delete mode 100644 include/asm-x86/device_32.h delete mode 100644 include/asm-x86/device_64.h delete mode 100644 include/asm-x86/intel_arch_perfmon_32.h delete mode 100644 include/asm-x86/intel_arch_perfmon_64.h delete mode 100644 include/asm-x86/ipcbuf_32.h delete mode 100644 include/asm-x86/ipcbuf_64.h delete mode 100644 include/asm-x86/namei_32.h delete mode 100644 include/asm-x86/namei_64.h delete mode 100644 include/asm-x86/param_32.h delete mode 100644 include/asm-x86/param_64.h delete mode 100644 include/asm-x86/parport_32.h delete mode 100644 include/asm-x86/parport_64.h delete mode 100644 include/asm-x86/rwlock_32.h delete mode 100644 include/asm-x86/rwlock_64.h delete mode 100644 include/asm-x86/sembuf_32.h delete mode 100644 include/asm-x86/sembuf_64.h delete mode 100644 include/asm-x86/shmparam_32.h delete mode 100644 include/asm-x86/shmparam_64.h delete mode 100644 include/asm-x86/termbits_32.h delete mode 100644 include/asm-x86/termbits_64.h delete mode 100644 include/asm-x86/termios_32.h delete mode 100644 include/asm-x86/termios_64.h delete mode 100644 include/asm-x86/ucontext_32.h delete mode 100644 include/asm-x86/ucontext_64.h delete mode 100644 include/asm-x86/unaligned_32.h delete mode 100644 include/asm-x86/unaligned_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild index 158deea39a54..bf98b67d3822 100644 --- a/include/asm-x86/Kbuild +++ b/include/asm-x86/Kbuild @@ -9,8 +9,6 @@ header-y += msr-index.h header-y += prctl.h header-y += ptrace-abi.h header-y += sigcontext32.h -header-y += ucontext_32.h -header-y += ucontext_64.h header-y += ucontext.h header-y += vsyscall32.h @@ -24,8 +22,6 @@ unifdef-y += elf_32.h unifdef-y += elf_64.h unifdef-y += ioctls_32.h unifdef-y += ioctls_64.h -unifdef-y += ipcbuf_32.h -unifdef-y += ipcbuf_64.h unifdef-y += mce.h unifdef-y += mman_32.h unifdef-y += mman_64.h @@ -39,20 +35,14 @@ unifdef-y += mtrr_64.h unifdef-y += mtrr.h unifdef-y += page_32.h unifdef-y += page_64.h -unifdef-y += param_32.h -unifdef-y += param_64.h unifdef-y += posix_types_32.h unifdef-y += posix_types_64.h unifdef-y += ptrace_32.h unifdef-y += ptrace_64.h -unifdef-y += sembuf_32.h -unifdef-y += sembuf_64.h unifdef-y += setup_32.h unifdef-y += setup_64.h unifdef-y += shmbuf_32.h unifdef-y += shmbuf_64.h -unifdef-y += shmparam_32.h -unifdef-y += shmparam_64.h unifdef-y += sigcontext_32.h unifdef-y += sigcontext_64.h unifdef-y += siginfo_32.h @@ -63,10 +53,6 @@ unifdef-y += stat_32.h unifdef-y += stat_64.h unifdef-y += statfs_32.h unifdef-y += statfs_64.h -unifdef-y += termbits_32.h -unifdef-y += termbits_64.h -unifdef-y += termios_32.h -unifdef-y += termios_64.h unifdef-y += types_32.h unifdef-y += types_64.h unifdef-y += unistd_32.h diff --git a/include/asm-x86/bugs.h b/include/asm-x86/bugs.h index ddf42d36dd50..aac8317420af 100644 --- a/include/asm-x86/bugs.h +++ b/include/asm-x86/bugs.h @@ -1,5 +1,6 @@ -#ifdef CONFIG_X86_32 -# include "bugs_32.h" -#else -# include "bugs_64.h" -#endif +#ifndef _ASM_X86_BUGS_H +#define _ASM_X86_BUGS_H + +void check_bugs(void); + +#endif /* _ASM_X86_BUGS_H */ diff --git a/include/asm-x86/bugs_32.h b/include/asm-x86/bugs_32.h deleted file mode 100644 index d28979ff73be..000000000000 --- a/include/asm-x86/bugs_32.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * This is included by init/main.c to check for architecture-dependent bugs. - * - * Needs: - * void check_bugs(void); - */ -#ifndef _ASM_I386_BUG_H -#define _ASM_I386_BUG_H - -void check_bugs(void); - -#endif /* _ASM_I386_BUG_H */ diff --git a/include/asm-x86/bugs_64.h b/include/asm-x86/bugs_64.h deleted file mode 100644 index b33dc04d8f42..000000000000 --- a/include/asm-x86/bugs_64.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASM_X86_64_BUGS_H -#define _ASM_X86_64_BUGS_H - -void check_bugs(void); - -#endif /* _ASM_X86_64_BUGS_H */ diff --git a/include/asm-x86/device.h b/include/asm-x86/device.h index e2bcf7c7dcee..d9ee5e52e91b 100644 --- a/include/asm-x86/device.h +++ b/include/asm-x86/device.h @@ -1,5 +1,10 @@ -#ifdef CONFIG_X86_32 -# include "device_32.h" -#else -# include "device_64.h" +#ifndef _ASM_X86_DEVICE_H +#define _ASM_X86_DEVICE_H + +struct dev_archdata { +#ifdef CONFIG_ACPI + void *acpi_handle; #endif +}; + +#endif /* _ASM_X86_DEVICE_H */ diff --git a/include/asm-x86/device_32.h b/include/asm-x86/device_32.h deleted file mode 100644 index 849604c70e6b..000000000000 --- a/include/asm-x86/device_32.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Arch specific extensions to struct device - * - * This file is released under the GPLv2 - */ -#ifndef _ASM_I386_DEVICE_H -#define _ASM_I386_DEVICE_H - -struct dev_archdata { -#ifdef CONFIG_ACPI - void *acpi_handle; -#endif -}; - -#endif /* _ASM_I386_DEVICE_H */ diff --git a/include/asm-x86/device_64.h b/include/asm-x86/device_64.h deleted file mode 100644 index 3afa03f33a36..000000000000 --- a/include/asm-x86/device_64.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Arch specific extensions to struct device - * - * This file is released under the GPLv2 - */ -#ifndef _ASM_X86_64_DEVICE_H -#define _ASM_X86_64_DEVICE_H - -struct dev_archdata { -#ifdef CONFIG_ACPI - void *acpi_handle; -#endif -}; - -#endif /* _ASM_X86_64_DEVICE_H */ diff --git a/include/asm-x86/intel_arch_perfmon.h b/include/asm-x86/intel_arch_perfmon.h index 4f6d4e6bf57e..fa0fd068bc2e 100644 --- a/include/asm-x86/intel_arch_perfmon.h +++ b/include/asm-x86/intel_arch_perfmon.h @@ -1,5 +1,31 @@ -#ifdef CONFIG_X86_32 -# include "intel_arch_perfmon_32.h" -#else -# include "intel_arch_perfmon_64.h" -#endif +#ifndef _ASM_X86_INTEL_ARCH_PERFMON_H +#define _ASM_X86_INTEL_ARCH_PERFMON_H + +#define MSR_ARCH_PERFMON_PERFCTR0 0xc1 +#define MSR_ARCH_PERFMON_PERFCTR1 0xc2 + +#define MSR_ARCH_PERFMON_EVENTSEL0 0x186 +#define MSR_ARCH_PERFMON_EVENTSEL1 0x187 + +#define ARCH_PERFMON_EVENTSEL0_ENABLE (1 << 22) +#define ARCH_PERFMON_EVENTSEL_INT (1 << 20) +#define ARCH_PERFMON_EVENTSEL_OS (1 << 17) +#define ARCH_PERFMON_EVENTSEL_USR (1 << 16) + +#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL (0x3c) +#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8) +#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX (0) +#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \ + (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX)) + +union cpuid10_eax { + struct { + unsigned int version_id:8; + unsigned int num_counters:8; + unsigned int bit_width:8; + unsigned int mask_length:8; + } split; + unsigned int full; +}; + +#endif /* _ASM_X86_INTEL_ARCH_PERFMON_H */ diff --git a/include/asm-x86/intel_arch_perfmon_32.h b/include/asm-x86/intel_arch_perfmon_32.h deleted file mode 100644 index b52cd60a075b..000000000000 --- a/include/asm-x86/intel_arch_perfmon_32.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef X86_INTEL_ARCH_PERFMON_H -#define X86_INTEL_ARCH_PERFMON_H 1 - -#define MSR_ARCH_PERFMON_PERFCTR0 0xc1 -#define MSR_ARCH_PERFMON_PERFCTR1 0xc2 - -#define MSR_ARCH_PERFMON_EVENTSEL0 0x186 -#define MSR_ARCH_PERFMON_EVENTSEL1 0x187 - -#define ARCH_PERFMON_EVENTSEL0_ENABLE (1 << 22) -#define ARCH_PERFMON_EVENTSEL_INT (1 << 20) -#define ARCH_PERFMON_EVENTSEL_OS (1 << 17) -#define ARCH_PERFMON_EVENTSEL_USR (1 << 16) - -#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL (0x3c) -#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8) -#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX (0) -#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \ - (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX)) - -union cpuid10_eax { - struct { - unsigned int version_id:8; - unsigned int num_counters:8; - unsigned int bit_width:8; - unsigned int mask_length:8; - } split; - unsigned int full; -}; - -#endif /* X86_INTEL_ARCH_PERFMON_H */ diff --git a/include/asm-x86/intel_arch_perfmon_64.h b/include/asm-x86/intel_arch_perfmon_64.h deleted file mode 100644 index 8633331420ec..000000000000 --- a/include/asm-x86/intel_arch_perfmon_64.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef X86_64_INTEL_ARCH_PERFMON_H -#define X86_64_INTEL_ARCH_PERFMON_H 1 - -#define MSR_ARCH_PERFMON_PERFCTR0 0xc1 -#define MSR_ARCH_PERFMON_PERFCTR1 0xc2 - -#define MSR_ARCH_PERFMON_EVENTSEL0 0x186 -#define MSR_ARCH_PERFMON_EVENTSEL1 0x187 - -#define ARCH_PERFMON_EVENTSEL0_ENABLE (1 << 22) -#define ARCH_PERFMON_EVENTSEL_INT (1 << 20) -#define ARCH_PERFMON_EVENTSEL_OS (1 << 17) -#define ARCH_PERFMON_EVENTSEL_USR (1 << 16) - -#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL (0x3c) -#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK (0x00 << 8) -#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX (0) -#define ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT \ - (1 << (ARCH_PERFMON_UNHALTED_CORE_CYCLES_INDEX)) - -union cpuid10_eax { - struct { - unsigned int version_id:8; - unsigned int num_counters:8; - unsigned int bit_width:8; - unsigned int mask_length:8; - } split; - unsigned int full; -}; - -#endif /* X86_64_INTEL_ARCH_PERFMON_H */ diff --git a/include/asm-x86/ipcbuf.h b/include/asm-x86/ipcbuf.h index eb2e448c6e28..2adf8b39a40b 100644 --- a/include/asm-x86/ipcbuf.h +++ b/include/asm-x86/ipcbuf.h @@ -1,13 +1,29 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "ipcbuf_32.h" -# else -# include "ipcbuf_64.h" -# endif -#else -# ifdef __i386__ -# include "ipcbuf_32.h" -# else -# include "ipcbuf_64.h" -# endif -#endif +#ifndef _ASM_X86_IPCBUF_H +#define _ASM_X86_IPCBUF_H + +/* + * The ipc64_perm structure for x86 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 32-bit mode_t and seq + * - 2 miscellaneous 32-bit values + */ + +struct ipc64_perm +{ + __kernel_key_t key; + __kernel_uid32_t uid; + __kernel_gid32_t gid; + __kernel_uid32_t cuid; + __kernel_gid32_t cgid; + __kernel_mode_t mode; + unsigned short __pad1; + unsigned short seq; + unsigned short __pad2; + unsigned long __unused1; + unsigned long __unused2; +}; + +#endif /* _ASM_X86_IPCBUF_H */ diff --git a/include/asm-x86/ipcbuf_32.h b/include/asm-x86/ipcbuf_32.h deleted file mode 100644 index 0dcad4f84c2a..000000000000 --- a/include/asm-x86/ipcbuf_32.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __i386_IPCBUF_H__ -#define __i386_IPCBUF_H__ - -/* - * The ipc64_perm structure for i386 architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 32-bit mode_t and seq - * - 2 miscellaneous 32-bit values - */ - -struct ipc64_perm -{ - __kernel_key_t key; - __kernel_uid32_t uid; - __kernel_gid32_t gid; - __kernel_uid32_t cuid; - __kernel_gid32_t cgid; - __kernel_mode_t mode; - unsigned short __pad1; - unsigned short seq; - unsigned short __pad2; - unsigned long __unused1; - unsigned long __unused2; -}; - -#endif /* __i386_IPCBUF_H__ */ diff --git a/include/asm-x86/ipcbuf_64.h b/include/asm-x86/ipcbuf_64.h deleted file mode 100644 index 470cf85e3ba8..000000000000 --- a/include/asm-x86/ipcbuf_64.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef __x86_64_IPCBUF_H__ -#define __x86_64_IPCBUF_H__ - -/* - * The ipc64_perm structure for x86_64 architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 32-bit mode_t and seq - * - 2 miscellaneous 32-bit values - */ - -struct ipc64_perm -{ - __kernel_key_t key; - __kernel_uid32_t uid; - __kernel_gid32_t gid; - __kernel_uid32_t cuid; - __kernel_gid32_t cgid; - __kernel_mode_t mode; - unsigned short __pad1; - unsigned short seq; - unsigned short __pad2; - unsigned long __unused1; - unsigned long __unused2; -}; - -#endif /* __x86_64_IPCBUF_H__ */ diff --git a/include/asm-x86/namei.h b/include/asm-x86/namei.h index 732f8f0b3dcd..415ef5d9550e 100644 --- a/include/asm-x86/namei.h +++ b/include/asm-x86/namei.h @@ -1,5 +1,11 @@ -#ifdef CONFIG_X86_32 -# include "namei_32.h" -#else -# include "namei_64.h" -#endif +#ifndef _ASM_X86_NAMEI_H +#define _ASM_X86_NAMEI_H + +/* This dummy routine maybe changed to something useful + * for /usr/gnemul/ emulation stuff. + * Look at asm-sparc/namei.h for details. + */ + +#define __emul_prefix() NULL + +#endif /* _ASM_X86_NAMEI_H */ diff --git a/include/asm-x86/namei_32.h b/include/asm-x86/namei_32.h deleted file mode 100644 index 814865088617..000000000000 --- a/include/asm-x86/namei_32.h +++ /dev/null @@ -1,17 +0,0 @@ -/* $Id: namei.h,v 1.1 1996/12/13 14:48:21 jj Exp $ - * linux/include/asm-i386/namei.h - * - * Included from linux/fs/namei.c - */ - -#ifndef __I386_NAMEI_H -#define __I386_NAMEI_H - -/* This dummy routine maybe changed to something useful - * for /usr/gnemul/ emulation stuff. - * Look at asm-sparc/namei.h for details. - */ - -#define __emul_prefix() NULL - -#endif /* __I386_NAMEI_H */ diff --git a/include/asm-x86/namei_64.h b/include/asm-x86/namei_64.h deleted file mode 100644 index bef239f5318f..000000000000 --- a/include/asm-x86/namei_64.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __X8664_NAMEI_H -#define __X8664_NAMEI_H - -/* This dummy routine maybe changed to something useful - * for /usr/gnemul/ emulation stuff. - * Look at asm-sparc/namei.h for details. - */ - -#define __emul_prefix() NULL - -#endif diff --git a/include/asm-x86/param.h b/include/asm-x86/param.h index 640851bab124..c996ec4da0c8 100644 --- a/include/asm-x86/param.h +++ b/include/asm-x86/param.h @@ -1,13 +1,22 @@ +#ifndef _ASM_X86_PARAM_H +#define _ASM_X86_PARAM_H + #ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "param_32.h" -# else -# include "param_64.h" -# endif -#else -# ifdef __i386__ -# include "param_32.h" -# else -# include "param_64.h" -# endif +# define HZ CONFIG_HZ /* Internal kernel timer frequency */ +# define USER_HZ 100 /* .. some user interfaces are in "ticks" */ +# define CLOCKS_PER_SEC (USER_HZ) /* like times() */ #endif + +#ifndef HZ +#define HZ 100 +#endif + +#define EXEC_PAGESIZE 4096 + +#ifndef NOGROUP +#define NOGROUP (-1) +#endif + +#define MAXHOSTNAMELEN 64 /* max length of hostname */ + +#endif /* _ASM_X86_PARAM_H */ diff --git a/include/asm-x86/param_32.h b/include/asm-x86/param_32.h deleted file mode 100644 index 21b32466fcdc..000000000000 --- a/include/asm-x86/param_32.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _ASMi386_PARAM_H -#define _ASMi386_PARAM_H - -#ifdef __KERNEL__ -# define HZ CONFIG_HZ /* Internal kernel timer frequency */ -# define USER_HZ 100 /* .. some user interfaces are in "ticks" */ -# define CLOCKS_PER_SEC (USER_HZ) /* like times() */ -#endif - -#ifndef HZ -#define HZ 100 -#endif - -#define EXEC_PAGESIZE 4096 - -#ifndef NOGROUP -#define NOGROUP (-1) -#endif - -#define MAXHOSTNAMELEN 64 /* max length of hostname */ - -#endif diff --git a/include/asm-x86/param_64.h b/include/asm-x86/param_64.h deleted file mode 100644 index a728786c3c7c..000000000000 --- a/include/asm-x86/param_64.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _ASMx86_64_PARAM_H -#define _ASMx86_64_PARAM_H - -#ifdef __KERNEL__ -# define HZ CONFIG_HZ /* Internal kernel timer frequency */ -# define USER_HZ 100 /* .. some user interfaces are in "ticks */ -#define CLOCKS_PER_SEC (USER_HZ) /* like times() */ -#endif - -#ifndef HZ -#define HZ 100 -#endif - -#define EXEC_PAGESIZE 4096 - -#ifndef NOGROUP -#define NOGROUP (-1) -#endif - -#define MAXHOSTNAMELEN 64 /* max length of hostname */ - -#endif diff --git a/include/asm-x86/parport.h b/include/asm-x86/parport.h index 2a31157349c9..019cbca24a38 100644 --- a/include/asm-x86/parport.h +++ b/include/asm-x86/parport.h @@ -1,5 +1,10 @@ -#ifdef CONFIG_X86_32 -# include "parport_32.h" -#else -# include "parport_64.h" -#endif +#ifndef _ASM_X86_PARPORT_H +#define _ASM_X86_PARPORT_H + +static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); +static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) +{ + return parport_pc_find_isa_ports (autoirq, autodma); +} + +#endif /* _ASM_X86_PARPORT_H */ diff --git a/include/asm-x86/parport_32.h b/include/asm-x86/parport_32.h deleted file mode 100644 index fa0e321e498e..000000000000 --- a/include/asm-x86/parport_32.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * parport.h: ia32-specific parport initialisation - * - * Copyright (C) 1999, 2000 Tim Waugh - * - * This file should only be included by drivers/parport/parport_pc.c. - */ - -#ifndef _ASM_I386_PARPORT_H -#define _ASM_I386_PARPORT_H 1 - -static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); -static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) -{ - return parport_pc_find_isa_ports (autoirq, autodma); -} - -#endif /* !(_ASM_I386_PARPORT_H) */ diff --git a/include/asm-x86/parport_64.h b/include/asm-x86/parport_64.h deleted file mode 100644 index 7135ef977c96..000000000000 --- a/include/asm-x86/parport_64.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * parport.h: ia32-specific parport initialisation - * - * Copyright (C) 1999, 2000 Tim Waugh - * - * This file should only be included by drivers/parport/parport_pc.c. - */ - -#ifndef _ASM_X8664_PARPORT_H -#define _ASM_X8664_PARPORT_H 1 - -static int __devinit parport_pc_find_isa_ports (int autoirq, int autodma); -static int __devinit parport_pc_find_nonpci_ports (int autoirq, int autodma) -{ - return parport_pc_find_isa_ports (autoirq, autodma); -} - -#endif diff --git a/include/asm-x86/rwlock.h b/include/asm-x86/rwlock.h index a3be7d8364af..f2b64a429e6b 100644 --- a/include/asm-x86/rwlock.h +++ b/include/asm-x86/rwlock.h @@ -1,5 +1,9 @@ -#ifdef CONFIG_X86_32 -# include "rwlock_32.h" -#else -# include "rwlock_64.h" -#endif +#ifndef _ASM_X86_RWLOCK_H +#define _ASM_X86_RWLOCK_H + +#define RW_LOCK_BIAS 0x01000000 +#define RW_LOCK_BIAS_STR "0x01000000" + +/* Actual code is in asm/spinlock.h or in arch/x86/lib/rwlock.S */ + +#endif /* _ASM_X86_RWLOCK_H */ diff --git a/include/asm-x86/rwlock_32.h b/include/asm-x86/rwlock_32.h deleted file mode 100644 index c3e5db32fa48..000000000000 --- a/include/asm-x86/rwlock_32.h +++ /dev/null @@ -1,25 +0,0 @@ -/* include/asm-i386/rwlock.h - * - * Helpers used by both rw spinlocks and rw semaphores. - * - * Based in part on code from semaphore.h and - * spinlock.h Copyright 1996 Linus Torvalds. - * - * Copyright 1999 Red Hat, Inc. - * - * Written by Benjamin LaHaise. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_I386_RWLOCK_H -#define _ASM_I386_RWLOCK_H - -#define RW_LOCK_BIAS 0x01000000 -#define RW_LOCK_BIAS_STR "0x01000000" - -/* Code is in asm-i386/spinlock.h */ - -#endif diff --git a/include/asm-x86/rwlock_64.h b/include/asm-x86/rwlock_64.h deleted file mode 100644 index 72aeebed920b..000000000000 --- a/include/asm-x86/rwlock_64.h +++ /dev/null @@ -1,26 +0,0 @@ -/* include/asm-x86_64/rwlock.h - * - * Helpers used by both rw spinlocks and rw semaphores. - * - * Based in part on code from semaphore.h and - * spinlock.h Copyright 1996 Linus Torvalds. - * - * Copyright 1999 Red Hat, Inc. - * Copyright 2001,2002 SuSE labs - * - * Written by Benjamin LaHaise. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -#ifndef _ASM_X86_64_RWLOCK_H -#define _ASM_X86_64_RWLOCK_H - -#define RW_LOCK_BIAS 0x01000000 -#define RW_LOCK_BIAS_STR "0x01000000" - -/* Actual code is in asm/spinlock.h or in arch/x86_64/lib/rwlock.S */ - -#endif diff --git a/include/asm-x86/sembuf.h b/include/asm-x86/sembuf.h index e42c971e383f..ee50c801f7b7 100644 --- a/include/asm-x86/sembuf.h +++ b/include/asm-x86/sembuf.h @@ -1,13 +1,24 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "sembuf_32.h" -# else -# include "sembuf_64.h" -# endif -#else -# ifdef __i386__ -# include "sembuf_32.h" -# else -# include "sembuf_64.h" -# endif -#endif +#ifndef _ASM_X86_SEMBUF_H +#define _ASM_X86_SEMBUF_H + +/* + * The semid64_ds structure for x86 architecture. + * Note extra padding because this structure is passed back and forth + * between kernel and user space. + * + * Pad space is left for: + * - 64-bit time_t to solve y2038 problem + * - 2 miscellaneous 32-bit values + */ +struct semid64_ds { + struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ + __kernel_time_t sem_otime; /* last semop time */ + unsigned long __unused1; + __kernel_time_t sem_ctime; /* last change time */ + unsigned long __unused2; + unsigned long sem_nsems; /* no. of semaphores in array */ + unsigned long __unused3; + unsigned long __unused4; +}; + +#endif /* _ASM_X86_SEMBUF_H */ diff --git a/include/asm-x86/sembuf_32.h b/include/asm-x86/sembuf_32.h deleted file mode 100644 index 323835166c14..000000000000 --- a/include/asm-x86/sembuf_32.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _I386_SEMBUF_H -#define _I386_SEMBUF_H - -/* - * The semid64_ds structure for i386 architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem - * - 2 miscellaneous 32-bit values - */ - -struct semid64_ds { - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - __kernel_time_t sem_otime; /* last semop time */ - unsigned long __unused1; - __kernel_time_t sem_ctime; /* last change time */ - unsigned long __unused2; - unsigned long sem_nsems; /* no. of semaphores in array */ - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _I386_SEMBUF_H */ diff --git a/include/asm-x86/sembuf_64.h b/include/asm-x86/sembuf_64.h deleted file mode 100644 index 63b52925ae2a..000000000000 --- a/include/asm-x86/sembuf_64.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _X86_64_SEMBUF_H -#define _X86_64_SEMBUF_H - -/* - * The semid64_ds structure for x86_64 architecture. - * Note extra padding because this structure is passed back and forth - * between kernel and user space. - * - * Pad space is left for: - * - 64-bit time_t to solve y2038 problem - * - 2 miscellaneous 32-bit values - */ - -struct semid64_ds { - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ - __kernel_time_t sem_otime; /* last semop time */ - unsigned long __unused1; - __kernel_time_t sem_ctime; /* last change time */ - unsigned long __unused2; - unsigned long sem_nsems; /* no. of semaphores in array */ - unsigned long __unused3; - unsigned long __unused4; -}; - -#endif /* _X86_64_SEMBUF_H */ diff --git a/include/asm-x86/shmparam.h b/include/asm-x86/shmparam.h index 165627cc5345..0880cf0917b9 100644 --- a/include/asm-x86/shmparam.h +++ b/include/asm-x86/shmparam.h @@ -1,13 +1,6 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "shmparam_32.h" -# else -# include "shmparam_64.h" -# endif -#else -# ifdef __i386__ -# include "shmparam_32.h" -# else -# include "shmparam_64.h" -# endif -#endif +#ifndef _ASM_X86_SHMPARAM_H +#define _ASM_X86_SHMPARAM_H + +#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ + +#endif /* _ASM_X86_SHMPARAM_H */ diff --git a/include/asm-x86/shmparam_32.h b/include/asm-x86/shmparam_32.h deleted file mode 100644 index 786243a5b319..000000000000 --- a/include/asm-x86/shmparam_32.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASMI386_SHMPARAM_H -#define _ASMI386_SHMPARAM_H - -#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ - -#endif /* _ASMI386_SHMPARAM_H */ diff --git a/include/asm-x86/shmparam_64.h b/include/asm-x86/shmparam_64.h deleted file mode 100644 index d7021620dcb7..000000000000 --- a/include/asm-x86/shmparam_64.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASMX8664_SHMPARAM_H -#define _ASMX8664_SHMPARAM_H - -#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ - -#endif /* _ASMX8664_SHMPARAM_H */ diff --git a/include/asm-x86/termbits.h b/include/asm-x86/termbits.h index 69f3080e2a1d..af1b70ea440f 100644 --- a/include/asm-x86/termbits.h +++ b/include/asm-x86/termbits.h @@ -1,13 +1,198 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "termbits_32.h" -# else -# include "termbits_64.h" -# endif -#else -# ifdef __i386__ -# include "termbits_32.h" -# else -# include "termbits_64.h" -# endif -#endif +#ifndef _ASM_X86_TERMBITS_H +#define _ASM_X86_TERMBITS_H + +#include + +typedef unsigned char cc_t; +typedef unsigned int speed_t; +typedef unsigned int tcflag_t; + +#define NCCS 19 +struct termios { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline */ + cc_t c_cc[NCCS]; /* control characters */ +}; + +struct termios2 { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline */ + cc_t c_cc[NCCS]; /* control characters */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ +}; + +struct ktermios { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline */ + cc_t c_cc[NCCS]; /* control characters */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ +}; + +/* c_cc characters */ +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 +#define VKILL 3 +#define VEOF 4 +#define VTIME 5 +#define VMIN 6 +#define VSWTC 7 +#define VSTART 8 +#define VSTOP 9 +#define VSUSP 10 +#define VEOL 11 +#define VREPRINT 12 +#define VDISCARD 13 +#define VWERASE 14 +#define VLNEXT 15 +#define VEOL2 16 + +/* c_iflag bits */ +#define IGNBRK 0000001 +#define BRKINT 0000002 +#define IGNPAR 0000004 +#define PARMRK 0000010 +#define INPCK 0000020 +#define ISTRIP 0000040 +#define INLCR 0000100 +#define IGNCR 0000200 +#define ICRNL 0000400 +#define IUCLC 0001000 +#define IXON 0002000 +#define IXANY 0004000 +#define IXOFF 0010000 +#define IMAXBEL 0020000 +#define IUTF8 0040000 + +/* c_oflag bits */ +#define OPOST 0000001 +#define OLCUC 0000002 +#define ONLCR 0000004 +#define OCRNL 0000010 +#define ONOCR 0000020 +#define ONLRET 0000040 +#define OFILL 0000100 +#define OFDEL 0000200 +#define NLDLY 0000400 +#define NL0 0000000 +#define NL1 0000400 +#define CRDLY 0003000 +#define CR0 0000000 +#define CR1 0001000 +#define CR2 0002000 +#define CR3 0003000 +#define TABDLY 0014000 +#define TAB0 0000000 +#define TAB1 0004000 +#define TAB2 0010000 +#define TAB3 0014000 +#define XTABS 0014000 +#define BSDLY 0020000 +#define BS0 0000000 +#define BS1 0020000 +#define VTDLY 0040000 +#define VT0 0000000 +#define VT1 0040000 +#define FFDLY 0100000 +#define FF0 0000000 +#define FF1 0100000 + +/* c_cflag bit meaning */ +#define CBAUD 0010017 +#define B0 0000000 /* hang up */ +#define B50 0000001 +#define B75 0000002 +#define B110 0000003 +#define B134 0000004 +#define B150 0000005 +#define B200 0000006 +#define B300 0000007 +#define B600 0000010 +#define B1200 0000011 +#define B1800 0000012 +#define B2400 0000013 +#define B4800 0000014 +#define B9600 0000015 +#define B19200 0000016 +#define B38400 0000017 +#define EXTA B19200 +#define EXTB B38400 +#define CSIZE 0000060 +#define CS5 0000000 +#define CS6 0000020 +#define CS7 0000040 +#define CS8 0000060 +#define CSTOPB 0000100 +#define CREAD 0000200 +#define PARENB 0000400 +#define PARODD 0001000 +#define HUPCL 0002000 +#define CLOCAL 0004000 +#define CBAUDEX 0010000 +#define BOTHER 0010000 /* non standard rate */ +#define B57600 0010001 +#define B115200 0010002 +#define B230400 0010003 +#define B460800 0010004 +#define B500000 0010005 +#define B576000 0010006 +#define B921600 0010007 +#define B1000000 0010010 +#define B1152000 0010011 +#define B1500000 0010012 +#define B2000000 0010013 +#define B2500000 0010014 +#define B3000000 0010015 +#define B3500000 0010016 +#define B4000000 0010017 +#define CIBAUD 002003600000 /* input baud rate */ +#define CMSPAR 010000000000 /* mark or space (stick) parity */ +#define CRTSCTS 020000000000 /* flow control */ + +#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ + +/* c_lflag bits */ +#define ISIG 0000001 +#define ICANON 0000002 +#define XCASE 0000004 +#define ECHO 0000010 +#define ECHOE 0000020 +#define ECHOK 0000040 +#define ECHONL 0000100 +#define NOFLSH 0000200 +#define TOSTOP 0000400 +#define ECHOCTL 0001000 +#define ECHOPRT 0002000 +#define ECHOKE 0004000 +#define FLUSHO 0010000 +#define PENDIN 0040000 +#define IEXTEN 0100000 + +/* tcflow() and TCXONC use these */ +#define TCOOFF 0 +#define TCOON 1 +#define TCIOFF 2 +#define TCION 3 + +/* tcflush() and TCFLSH use these */ +#define TCIFLUSH 0 +#define TCOFLUSH 1 +#define TCIOFLUSH 2 + +/* tcsetattr uses these */ +#define TCSANOW 0 +#define TCSADRAIN 1 +#define TCSAFLUSH 2 + +#endif /* _ASM_X86_TERMBITS_H */ diff --git a/include/asm-x86/termbits_32.h b/include/asm-x86/termbits_32.h deleted file mode 100644 index a21700352e7b..000000000000 --- a/include/asm-x86/termbits_32.h +++ /dev/null @@ -1,198 +0,0 @@ -#ifndef __ARCH_I386_TERMBITS_H__ -#define __ARCH_I386_TERMBITS_H__ - -#include - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -#define NCCS 19 -struct termios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ -}; - -struct termios2 { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - -struct ktermios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -/* c_oflag bits */ -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#define NLDLY 0000400 -#define NL0 0000000 -#define NL1 0000400 -#define CRDLY 0003000 -#define CR0 0000000 -#define CR1 0001000 -#define CR2 0002000 -#define CR3 0003000 -#define TABDLY 0014000 -#define TAB0 0000000 -#define TAB1 0004000 -#define TAB2 0010000 -#define TAB3 0014000 -#define XTABS 0014000 -#define BSDLY 0020000 -#define BS0 0000000 -#define BS1 0020000 -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 -#define FFDLY 0100000 -#define FF0 0000000 -#define FF1 0100000 - -/* c_cflag bit meaning */ -#define CBAUD 0010017 -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#define EXTA B19200 -#define EXTB B38400 -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 -#define CBAUDEX 0010000 -#define BOTHER 0010000 -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 -#define CIBAUD 002003600000 -#define CMSPAR 010000000000 /* mark or space (stick) parity */ -#define CRTSCTS 020000000000 /* flow control */ - -#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ - -/* c_lflag bits */ -#define ISIG 0000001 -#define ICANON 0000002 -#define XCASE 0000004 -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 -#define IEXTEN 0100000 - -/* tcflow() and TCXONC use these */ -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -/* tcflush() and TCFLSH use these */ -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -/* tcsetattr uses these */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#endif diff --git a/include/asm-x86/termbits_64.h b/include/asm-x86/termbits_64.h deleted file mode 100644 index 7405756dd41b..000000000000 --- a/include/asm-x86/termbits_64.h +++ /dev/null @@ -1,198 +0,0 @@ -#ifndef __ARCH_X8664_TERMBITS_H__ -#define __ARCH_X8664_TERMBITS_H__ - -#include - -typedef unsigned char cc_t; -typedef unsigned int speed_t; -typedef unsigned int tcflag_t; - -#define NCCS 19 -struct termios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ -}; - -struct termios2 { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - -struct ktermios { - tcflag_t c_iflag; /* input mode flags */ - tcflag_t c_oflag; /* output mode flags */ - tcflag_t c_cflag; /* control mode flags */ - tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline */ - cc_t c_cc[NCCS]; /* control characters */ - speed_t c_ispeed; /* input speed */ - speed_t c_ospeed; /* output speed */ -}; - -/* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 -#define VKILL 3 -#define VEOF 4 -#define VTIME 5 -#define VMIN 6 -#define VSWTC 7 -#define VSTART 8 -#define VSTOP 9 -#define VSUSP 10 -#define VEOL 11 -#define VREPRINT 12 -#define VDISCARD 13 -#define VWERASE 14 -#define VLNEXT 15 -#define VEOL2 16 - -/* c_iflag bits */ -#define IGNBRK 0000001 -#define BRKINT 0000002 -#define IGNPAR 0000004 -#define PARMRK 0000010 -#define INPCK 0000020 -#define ISTRIP 0000040 -#define INLCR 0000100 -#define IGNCR 0000200 -#define ICRNL 0000400 -#define IUCLC 0001000 -#define IXON 0002000 -#define IXANY 0004000 -#define IXOFF 0010000 -#define IMAXBEL 0020000 -#define IUTF8 0040000 - -/* c_oflag bits */ -#define OPOST 0000001 -#define OLCUC 0000002 -#define ONLCR 0000004 -#define OCRNL 0000010 -#define ONOCR 0000020 -#define ONLRET 0000040 -#define OFILL 0000100 -#define OFDEL 0000200 -#define NLDLY 0000400 -#define NL0 0000000 -#define NL1 0000400 -#define CRDLY 0003000 -#define CR0 0000000 -#define CR1 0001000 -#define CR2 0002000 -#define CR3 0003000 -#define TABDLY 0014000 -#define TAB0 0000000 -#define TAB1 0004000 -#define TAB2 0010000 -#define TAB3 0014000 -#define XTABS 0014000 -#define BSDLY 0020000 -#define BS0 0000000 -#define BS1 0020000 -#define VTDLY 0040000 -#define VT0 0000000 -#define VT1 0040000 -#define FFDLY 0100000 -#define FF0 0000000 -#define FF1 0100000 - -/* c_cflag bit meaning */ -#define CBAUD 0010017 -#define B0 0000000 /* hang up */ -#define B50 0000001 -#define B75 0000002 -#define B110 0000003 -#define B134 0000004 -#define B150 0000005 -#define B200 0000006 -#define B300 0000007 -#define B600 0000010 -#define B1200 0000011 -#define B1800 0000012 -#define B2400 0000013 -#define B4800 0000014 -#define B9600 0000015 -#define B19200 0000016 -#define B38400 0000017 -#define EXTA B19200 -#define EXTB B38400 -#define CSIZE 0000060 -#define CS5 0000000 -#define CS6 0000020 -#define CS7 0000040 -#define CS8 0000060 -#define CSTOPB 0000100 -#define CREAD 0000200 -#define PARENB 0000400 -#define PARODD 0001000 -#define HUPCL 0002000 -#define CLOCAL 0004000 -#define CBAUDEX 0010000 -#define BOTHER 0010000 /* non standard rate */ -#define B57600 0010001 -#define B115200 0010002 -#define B230400 0010003 -#define B460800 0010004 -#define B500000 0010005 -#define B576000 0010006 -#define B921600 0010007 -#define B1000000 0010010 -#define B1152000 0010011 -#define B1500000 0010012 -#define B2000000 0010013 -#define B2500000 0010014 -#define B3000000 0010015 -#define B3500000 0010016 -#define B4000000 0010017 -#define CIBAUD 002003600000 /* input baud rate */ -#define CMSPAR 010000000000 /* mark or space (stick) parity */ -#define CRTSCTS 020000000000 /* flow control */ - -#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ - -/* c_lflag bits */ -#define ISIG 0000001 -#define ICANON 0000002 -#define XCASE 0000004 -#define ECHO 0000010 -#define ECHOE 0000020 -#define ECHOK 0000040 -#define ECHONL 0000100 -#define NOFLSH 0000200 -#define TOSTOP 0000400 -#define ECHOCTL 0001000 -#define ECHOPRT 0002000 -#define ECHOKE 0004000 -#define FLUSHO 0010000 -#define PENDIN 0040000 -#define IEXTEN 0100000 - -/* tcflow() and TCXONC use these */ -#define TCOOFF 0 -#define TCOON 1 -#define TCIOFF 2 -#define TCION 3 - -/* tcflush() and TCFLSH use these */ -#define TCIFLUSH 0 -#define TCOFLUSH 1 -#define TCIOFLUSH 2 - -/* tcsetattr uses these */ -#define TCSANOW 0 -#define TCSADRAIN 1 -#define TCSAFLUSH 2 - -#endif diff --git a/include/asm-x86/termios.h b/include/asm-x86/termios.h index a4f4ae20a591..d501748700d2 100644 --- a/include/asm-x86/termios.h +++ b/include/asm-x86/termios.h @@ -1,13 +1,97 @@ +#ifndef _ASM_X86_TERMIOS_H +#define _ASM_X86_TERMIOS_H + +#include +#include + +struct winsize { + unsigned short ws_row; + unsigned short ws_col; + unsigned short ws_xpixel; + unsigned short ws_ypixel; +}; + +#define NCC 8 +struct termio { + unsigned short c_iflag; /* input mode flags */ + unsigned short c_oflag; /* output mode flags */ + unsigned short c_cflag; /* control mode flags */ + unsigned short c_lflag; /* local mode flags */ + unsigned char c_line; /* line discipline */ + unsigned char c_cc[NCC]; /* control characters */ +}; + +/* modem lines */ +#define TIOCM_LE 0x001 +#define TIOCM_DTR 0x002 +#define TIOCM_RTS 0x004 +#define TIOCM_ST 0x008 +#define TIOCM_SR 0x010 +#define TIOCM_CTS 0x020 +#define TIOCM_CAR 0x040 +#define TIOCM_RNG 0x080 +#define TIOCM_DSR 0x100 +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RI TIOCM_RNG +#define TIOCM_OUT1 0x2000 +#define TIOCM_OUT2 0x4000 +#define TIOCM_LOOP 0x8000 + +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ + #ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "termios_32.h" -# else -# include "termios_64.h" -# endif -#else -# ifdef __i386__ -# include "termios_32.h" -# else -# include "termios_64.h" -# endif -#endif + +/* intr=^C quit=^\ erase=del kill=^U + eof=^D vtime=\0 vmin=\1 sxtc=\0 + start=^Q stop=^S susp=^Z eol=\0 + reprint=^R discard=^U werase=^W lnext=^V + eol2=\0 +*/ +#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" + +/* + * Translate a "termio" structure into a "termios". Ugh. + */ +#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ + unsigned short __tmp; \ + get_user(__tmp,&(termio)->x); \ + *(unsigned short *) &(termios)->x = __tmp; \ +} + +#define user_termio_to_kernel_termios(termios, termio) \ +({ \ + SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ + SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ + SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ + SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ + copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ +}) + +/* + * Translate a "termios" structure into a "termio". Ugh. + */ +#define kernel_termios_to_user_termio(termio, termios) \ +({ \ + put_user((termios)->c_iflag, &(termio)->c_iflag); \ + put_user((termios)->c_oflag, &(termio)->c_oflag); \ + put_user((termios)->c_cflag, &(termio)->c_cflag); \ + put_user((termios)->c_lflag, &(termio)->c_lflag); \ + put_user((termios)->c_line, &(termio)->c_line); \ + copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ +}) + +#define user_termios_to_kernel_termios(k, u) \ + copy_from_user(k, u, sizeof(struct termios2)) + +#define kernel_termios_to_user_termios(u, k) \ + copy_to_user(u, k, sizeof(struct termios2)) + +#define user_termios_to_kernel_termios_1(k, u) \ + copy_from_user(k, u, sizeof(struct termios)) + +#define kernel_termios_to_user_termios_1(u, k) \ + copy_to_user(u, k, sizeof(struct termios)) + +#endif /* __KERNEL__ */ + +#endif /* _ASM_X86_TERMIOS_H */ diff --git a/include/asm-x86/termios_32.h b/include/asm-x86/termios_32.h deleted file mode 100644 index 6fdb2c841b73..000000000000 --- a/include/asm-x86/termios_32.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef _I386_TERMIOS_H -#define _I386_TERMIOS_H - -#include -#include - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define NCC 8 -struct termio { - unsigned short c_iflag; /* input mode flags */ - unsigned short c_oflag; /* output mode flags */ - unsigned short c_cflag; /* control mode flags */ - unsigned short c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - -/* modem lines */ -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 - -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ - -#ifdef __KERNEL__ - -/* intr=^C quit=^\ erase=del kill=^U - eof=^D vtime=\0 vmin=\1 sxtc=\0 - start=^Q stop=^S susp=^Z eol=\0 - reprint=^R discard=^U werase=^W lnext=^V - eol2=\0 -*/ -#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" - -/* - * Translate a "termio" structure into a "termios". Ugh. - */ -#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ - unsigned short __tmp; \ - get_user(__tmp,&(termio)->x); \ - *(unsigned short *) &(termios)->x = __tmp; \ -} - -#define user_termio_to_kernel_termios(termios, termio) \ -({ \ - SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ - copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ -}) - -/* - * Translate a "termios" structure into a "termio". Ugh. - */ -#define kernel_termios_to_user_termio(termio, termios) \ -({ \ - put_user((termios)->c_iflag, &(termio)->c_iflag); \ - put_user((termios)->c_oflag, &(termio)->c_oflag); \ - put_user((termios)->c_cflag, &(termio)->c_cflag); \ - put_user((termios)->c_lflag, &(termio)->c_lflag); \ - put_user((termios)->c_line, &(termio)->c_line); \ - copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ -}) - -#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) -#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) -#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) -#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) - -#endif /* __KERNEL__ */ - -#endif /* _I386_TERMIOS_H */ diff --git a/include/asm-x86/termios_64.h b/include/asm-x86/termios_64.h deleted file mode 100644 index 35ee59b78329..000000000000 --- a/include/asm-x86/termios_64.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef _X8664_TERMIOS_H -#define _X8664_TERMIOS_H - -#include -#include - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define NCC 8 -struct termio { - unsigned short c_iflag; /* input mode flags */ - unsigned short c_oflag; /* output mode flags */ - unsigned short c_cflag; /* control mode flags */ - unsigned short c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - -/* modem lines */ -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 - -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ - -#ifdef __KERNEL__ - -/* intr=^C quit=^\ erase=del kill=^U - eof=^D vtime=\0 vmin=\1 sxtc=\0 - start=^Q stop=^S susp=^Z eol=\0 - reprint=^R discard=^U werase=^W lnext=^V - eol2=\0 -*/ -#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" - -/* - * Translate a "termio" structure into a "termios". Ugh. - */ -#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ - unsigned short __tmp; \ - get_user(__tmp,&(termio)->x); \ - *(unsigned short *) &(termios)->x = __tmp; \ -} - -#define user_termio_to_kernel_termios(termios, termio) \ -({ \ - SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ - copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ -}) - -/* - * Translate a "termios" structure into a "termio". Ugh. - */ -#define kernel_termios_to_user_termio(termio, termios) \ -({ \ - put_user((termios)->c_iflag, &(termio)->c_iflag); \ - put_user((termios)->c_oflag, &(termio)->c_oflag); \ - put_user((termios)->c_cflag, &(termio)->c_cflag); \ - put_user((termios)->c_lflag, &(termio)->c_lflag); \ - put_user((termios)->c_line, &(termio)->c_line); \ - copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ -}) - -#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) -#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) -#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) -#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) - -#endif /* __KERNEL__ */ - -#endif /* _X8664_TERMIOS_H */ diff --git a/include/asm-x86/ucontext.h b/include/asm-x86/ucontext.h index 175c8cb59731..50a79f7fcde9 100644 --- a/include/asm-x86/ucontext.h +++ b/include/asm-x86/ucontext.h @@ -1,13 +1,12 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "ucontext_32.h" -# else -# include "ucontext_64.h" -# endif -#else -# ifdef __i386__ -# include "ucontext_32.h" -# else -# include "ucontext_64.h" -# endif -#endif +#ifndef _ASM_X86_UCONTEXT_H +#define _ASM_X86_UCONTEXT_H + +struct ucontext { + unsigned long uc_flags; + struct ucontext *uc_link; + stack_t uc_stack; + struct sigcontext uc_mcontext; + sigset_t uc_sigmask; /* mask last for extensibility */ +}; + +#endif /* _ASM_X86_UCONTEXT_H */ diff --git a/include/asm-x86/ucontext_32.h b/include/asm-x86/ucontext_32.h deleted file mode 100644 index b0db36925f55..000000000000 --- a/include/asm-x86/ucontext_32.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _ASMi386_UCONTEXT_H -#define _ASMi386_UCONTEXT_H - -struct ucontext { - unsigned long uc_flags; - struct ucontext *uc_link; - stack_t uc_stack; - struct sigcontext uc_mcontext; - sigset_t uc_sigmask; /* mask last for extensibility */ -}; - -#endif /* !_ASMi386_UCONTEXT_H */ diff --git a/include/asm-x86/ucontext_64.h b/include/asm-x86/ucontext_64.h deleted file mode 100644 index 159a3da9e112..000000000000 --- a/include/asm-x86/ucontext_64.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _ASMX8664_UCONTEXT_H -#define _ASMX8664_UCONTEXT_H - -struct ucontext { - unsigned long uc_flags; - struct ucontext *uc_link; - stack_t uc_stack; - struct sigcontext uc_mcontext; - sigset_t uc_sigmask; /* mask last for extensibility */ -}; - -#endif diff --git a/include/asm-x86/unaligned.h b/include/asm-x86/unaligned.h index 68067150fbcb..913598d4f761 100644 --- a/include/asm-x86/unaligned.h +++ b/include/asm-x86/unaligned.h @@ -1,5 +1,37 @@ -#ifdef CONFIG_X86_32 -# include "unaligned_32.h" -#else -# include "unaligned_64.h" -#endif +#ifndef _ASM_X86_UNALIGNED_H +#define _ASM_X86_UNALIGNED_H + +/* + * The x86 can do unaligned accesses itself. + * + * The strange macros are there to make sure these can't + * be misused in a way that makes them not work on other + * architectures where unaligned accesses aren't as simple. + */ + +/** + * get_unaligned - get value from possibly mis-aligned location + * @ptr: pointer to value + * + * This macro should be used for accessing values larger in size than + * single bytes at locations that are expected to be improperly aligned, + * e.g. retrieving a u16 value from a location not u16-aligned. + * + * Note that unaligned accesses can be very expensive on some architectures. + */ +#define get_unaligned(ptr) (*(ptr)) + +/** + * put_unaligned - put value to a possibly mis-aligned location + * @val: value to place + * @ptr: pointer to location + * + * This macro should be used for placing values larger in size than + * single bytes at locations that are expected to be improperly aligned, + * e.g. writing a u16 value to a location not u16-aligned. + * + * Note that unaligned accesses can be very expensive on some architectures. + */ +#define put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) + +#endif /* _ASM_X86_UNALIGNED_H */ diff --git a/include/asm-x86/unaligned_32.h b/include/asm-x86/unaligned_32.h deleted file mode 100644 index 7acd7957621e..000000000000 --- a/include/asm-x86/unaligned_32.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef __I386_UNALIGNED_H -#define __I386_UNALIGNED_H - -/* - * The i386 can do unaligned accesses itself. - * - * The strange macros are there to make sure these can't - * be misused in a way that makes them not work on other - * architectures where unaligned accesses aren't as simple. - */ - -/** - * get_unaligned - get value from possibly mis-aligned location - * @ptr: pointer to value - * - * This macro should be used for accessing values larger in size than - * single bytes at locations that are expected to be improperly aligned, - * e.g. retrieving a u16 value from a location not u16-aligned. - * - * Note that unaligned accesses can be very expensive on some architectures. - */ -#define get_unaligned(ptr) (*(ptr)) - -/** - * put_unaligned - put value to a possibly mis-aligned location - * @val: value to place - * @ptr: pointer to location - * - * This macro should be used for placing values larger in size than - * single bytes at locations that are expected to be improperly aligned, - * e.g. writing a u16 value to a location not u16-aligned. - * - * Note that unaligned accesses can be very expensive on some architectures. - */ -#define put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) - -#endif diff --git a/include/asm-x86/unaligned_64.h b/include/asm-x86/unaligned_64.h deleted file mode 100644 index d4bf78dc6f39..000000000000 --- a/include/asm-x86/unaligned_64.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef __X8664_UNALIGNED_H -#define __X8664_UNALIGNED_H - -/* - * The x86-64 can do unaligned accesses itself. - * - * The strange macros are there to make sure these can't - * be misused in a way that makes them not work on other - * architectures where unaligned accesses aren't as simple. - */ - -/** - * get_unaligned - get value from possibly mis-aligned location - * @ptr: pointer to value - * - * This macro should be used for accessing values larger in size than - * single bytes at locations that are expected to be improperly aligned, - * e.g. retrieving a u16 value from a location not u16-aligned. - * - * Note that unaligned accesses can be very expensive on some architectures. - */ -#define get_unaligned(ptr) (*(ptr)) - -/** - * put_unaligned - put value to a possibly mis-aligned location - * @val: value to place - * @ptr: pointer to location - * - * This macro should be used for placing values larger in size than - * single bytes at locations that are expected to be improperly aligned, - * e.g. writing a u16 value to a location not u16-aligned. - * - * Note that unaligned accesses can be very expensive on some architectures. - */ -#define put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) - -#endif -- cgit v1.2.3 From 17d36707dd9c5c3c4ef09a278ee7444cfc60481e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:19 +0200 Subject: x86: unify include/asm/agp_32/64.h Same file, except for whitespace, comment formatting and the usage of wbinvd() instead of asm volatile("wbinvd":::"memory"), which is the same. Signed-off-by: Thomas Gleixner --- include/asm-x86/agp.h | 43 +++++++++++++++++++++++++++++++++++++++---- include/asm-x86/agp_32.h | 36 ------------------------------------ include/asm-x86/agp_64.h | 34 ---------------------------------- 3 files changed, 39 insertions(+), 74 deletions(-) delete mode 100644 include/asm-x86/agp_32.h delete mode 100644 include/asm-x86/agp_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/agp.h b/include/asm-x86/agp.h index 9348f1e4f6f1..62df2a9e7130 100644 --- a/include/asm-x86/agp.h +++ b/include/asm-x86/agp.h @@ -1,5 +1,40 @@ -#ifdef CONFIG_X86_32 -# include "agp_32.h" -#else -# include "agp_64.h" +#ifndef _ASM_X86_AGP_H +#define _ASM_X86_AGP_H + +#include +#include + +/* + * Functions to keep the agpgart mappings coherent with the MMU. The + * GART gives the CPU a physical alias of pages in memory. The alias + * region is mapped uncacheable. Make sure there are no conflicting + * mappings with different cachability attributes for the same + * page. This avoids data corruption on some CPUs. + */ + +/* + * Caller's responsibility to call global_flush_tlb() for performance + * reasons + */ +#define map_page_into_agp(page) change_page_attr(page, 1, PAGE_KERNEL_NOCACHE) +#define unmap_page_from_agp(page) change_page_attr(page, 1, PAGE_KERNEL) +#define flush_agp_mappings() global_flush_tlb() + +/* + * Could use CLFLUSH here if the cpu supports it. But then it would + * need to be called for each cacheline of the whole page so it may + * not be worth it. Would need a page for it. + */ +#define flush_agp_cache() wbinvd() + +/* Convert a physical address to an address suitable for the GART. */ +#define phys_to_gart(x) (x) +#define gart_to_phys(x) (x) + +/* GATT allocation. Returns/accepts GATT kernel virtual address. */ +#define alloc_gatt_pages(order) \ + ((char *)__get_free_pages(GFP_KERNEL, (order))) +#define free_gatt_pages(table, order) \ + free_pages((unsigned long)(table), (order)) + #endif diff --git a/include/asm-x86/agp_32.h b/include/asm-x86/agp_32.h deleted file mode 100644 index 6af173dbf123..000000000000 --- a/include/asm-x86/agp_32.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef AGP_H -#define AGP_H 1 - -#include -#include - -/* - * Functions to keep the agpgart mappings coherent with the MMU. - * The GART gives the CPU a physical alias of pages in memory. The alias region is - * mapped uncacheable. Make sure there are no conflicting mappings - * with different cachability attributes for the same page. This avoids - * data corruption on some CPUs. - */ - -/* Caller's responsibility to call global_flush_tlb() for - * performance reasons */ -#define map_page_into_agp(page) change_page_attr(page, 1, PAGE_KERNEL_NOCACHE) -#define unmap_page_from_agp(page) change_page_attr(page, 1, PAGE_KERNEL) -#define flush_agp_mappings() global_flush_tlb() - -/* Could use CLFLUSH here if the cpu supports it. But then it would - need to be called for each cacheline of the whole page so it may not be - worth it. Would need a page for it. */ -#define flush_agp_cache() wbinvd() - -/* Convert a physical address to an address suitable for the GART. */ -#define phys_to_gart(x) (x) -#define gart_to_phys(x) (x) - -/* GATT allocation. Returns/accepts GATT kernel virtual address. */ -#define alloc_gatt_pages(order) \ - ((char *)__get_free_pages(GFP_KERNEL, (order))) -#define free_gatt_pages(table, order) \ - free_pages((unsigned long)(table), (order)) - -#endif diff --git a/include/asm-x86/agp_64.h b/include/asm-x86/agp_64.h deleted file mode 100644 index de338666f3f9..000000000000 --- a/include/asm-x86/agp_64.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef AGP_H -#define AGP_H 1 - -#include - -/* - * Functions to keep the agpgart mappings coherent. - * The GART gives the CPU a physical alias of memory. The alias is - * mapped uncacheable. Make sure there are no conflicting mappings - * with different cachability attributes for the same page. - */ - -/* Caller's responsibility to call global_flush_tlb() for - * performance reasons */ -#define map_page_into_agp(page) change_page_attr(page, 1, PAGE_KERNEL_NOCACHE) -#define unmap_page_from_agp(page) change_page_attr(page, 1, PAGE_KERNEL) -#define flush_agp_mappings() global_flush_tlb() - -/* Could use CLFLUSH here if the cpu supports it. But then it would - need to be called for each cacheline of the whole page so it may not be - worth it. Would need a page for it. */ -#define flush_agp_cache() asm volatile("wbinvd":::"memory") - -/* Convert a physical address to an address suitable for the GART. */ -#define phys_to_gart(x) (x) -#define gart_to_phys(x) (x) - -/* GATT allocation. Returns/accepts GATT kernel virtual address. */ -#define alloc_gatt_pages(order) \ - ((char *)__get_free_pages(GFP_KERNEL, (order))) -#define free_gatt_pages(table, order) \ - free_pages((unsigned long)(table), (order)) - -#endif -- cgit v1.2.3 From 0b4dc7c3524c59fae4c369ee5de274275b95d053 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:19 +0200 Subject: x86: unify include/asm/auxvec_32/64.h Same file, except for whitespace, comment formatting and the AT_SYSINFO define for 32bit Signed-off-by: Thomas Gleixner --- include/asm-x86/Kbuild | 2 -- include/asm-x86/auxvec.h | 23 +++++++++++------------ include/asm-x86/auxvec_32.h | 11 ----------- include/asm-x86/auxvec_64.h | 6 ------ 4 files changed, 11 insertions(+), 31 deletions(-) delete mode 100644 include/asm-x86/auxvec_32.h delete mode 100644 include/asm-x86/auxvec_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild index bf98b67d3822..d300cff2201e 100644 --- a/include/asm-x86/Kbuild +++ b/include/asm-x86/Kbuild @@ -14,8 +14,6 @@ header-y += vsyscall32.h unifdef-y += a.out_32.h unifdef-y += a.out_64.h -unifdef-y += auxvec_32.h -unifdef-y += auxvec_64.h unifdef-y += byteorder_32.h unifdef-y += byteorder_64.h unifdef-y += elf_32.h diff --git a/include/asm-x86/auxvec.h b/include/asm-x86/auxvec.h index 7ff866f829ca..87f5e6d5a020 100644 --- a/include/asm-x86/auxvec.h +++ b/include/asm-x86/auxvec.h @@ -1,13 +1,12 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "auxvec_32.h" -# else -# include "auxvec_64.h" -# endif -#else -# ifdef __i386__ -# include "auxvec_32.h" -# else -# include "auxvec_64.h" -# endif +#ifndef _ASM_X86_AUXVEC_H +#define _ASM_X86_AUXVEC_H +/* + * Architecture-neutral AT_ values in 0-17, leave some room + * for more of them, start the x86-specific ones at 32. + */ +#ifdef __i386__ +#define AT_SYSINFO 32 +#endif +#define AT_SYSINFO_EHDR 33 + #endif diff --git a/include/asm-x86/auxvec_32.h b/include/asm-x86/auxvec_32.h deleted file mode 100644 index 395e13016bfb..000000000000 --- a/include/asm-x86/auxvec_32.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ASMi386_AUXVEC_H -#define __ASMi386_AUXVEC_H - -/* - * Architecture-neutral AT_ values in 0-17, leave some room - * for more of them, start the x86-specific ones at 32. - */ -#define AT_SYSINFO 32 -#define AT_SYSINFO_EHDR 33 - -#endif diff --git a/include/asm-x86/auxvec_64.h b/include/asm-x86/auxvec_64.h deleted file mode 100644 index 1d5ab0d03950..000000000000 --- a/include/asm-x86/auxvec_64.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ASM_X86_64_AUXVEC_H -#define __ASM_X86_64_AUXVEC_H - -#define AT_SYSINFO_EHDR 33 - -#endif -- cgit v1.2.3 From b2bba72c10cdd907f73c57c8bdeb3354f8c233c6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:20 +0200 Subject: x86: unify include/asm/cacheflush_32/64.h Same file, except for whitespace, comment formatting and the extra DEBUG_PAGE_ALLOC function in _32. Signed-off-by: Thomas Gleixner --- include/asm-x86/cacheflush.h | 43 +++++++++++++++++++++++++++++++++++++---- include/asm-x86/cacheflush_32.h | 39 ------------------------------------- include/asm-x86/cacheflush_64.h | 35 --------------------------------- 3 files changed, 39 insertions(+), 78 deletions(-) delete mode 100644 include/asm-x86/cacheflush_32.h delete mode 100644 include/asm-x86/cacheflush_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/cacheflush.h b/include/asm-x86/cacheflush.h index e2df3b55034a..b3d43de44c59 100644 --- a/include/asm-x86/cacheflush.h +++ b/include/asm-x86/cacheflush.h @@ -1,5 +1,40 @@ -#ifdef CONFIG_X86_32 -# include "cacheflush_32.h" -#else -# include "cacheflush_64.h" +#ifndef _ASM_X86_CACHEFLUSH_H +#define _ASM_X86_CACHEFLUSH_H + +/* Keep includes the same across arches. */ +#include + +/* Caches aren't brain-dead on the intel. */ +#define flush_cache_all() do { } while (0) +#define flush_cache_mm(mm) do { } while (0) +#define flush_cache_dup_mm(mm) do { } while (0) +#define flush_cache_range(vma, start, end) do { } while (0) +#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) +#define flush_dcache_page(page) do { } while (0) +#define flush_dcache_mmap_lock(mapping) do { } while (0) +#define flush_dcache_mmap_unlock(mapping) do { } while (0) +#define flush_icache_range(start, end) do { } while (0) +#define flush_icache_page(vma,pg) do { } while (0) +#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) +#define flush_cache_vmap(start, end) do { } while (0) +#define flush_cache_vunmap(start, end) do { } while (0) + +#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) +#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ + memcpy(dst, src, len) + +void global_flush_tlb(void); +int change_page_attr(struct page *page, int numpages, pgprot_t prot); +int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot); + +#ifdef CONFIG_DEBUG_PAGEALLOC +/* internal debugging function */ +void kernel_map_pages(struct page *page, int numpages, int enable); +#endif + +#ifdef CONFIG_DEBUG_RODATA +void mark_rodata_ro(void); +#endif + #endif diff --git a/include/asm-x86/cacheflush_32.h b/include/asm-x86/cacheflush_32.h deleted file mode 100644 index 74e03c8f2e51..000000000000 --- a/include/asm-x86/cacheflush_32.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _I386_CACHEFLUSH_H -#define _I386_CACHEFLUSH_H - -/* Keep includes the same across arches. */ -#include - -/* Caches aren't brain-dead on the intel. */ -#define flush_cache_all() do { } while (0) -#define flush_cache_mm(mm) do { } while (0) -#define flush_cache_dup_mm(mm) do { } while (0) -#define flush_cache_range(vma, start, end) do { } while (0) -#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) -#define flush_dcache_page(page) do { } while (0) -#define flush_dcache_mmap_lock(mapping) do { } while (0) -#define flush_dcache_mmap_unlock(mapping) do { } while (0) -#define flush_icache_range(start, end) do { } while (0) -#define flush_icache_page(vma,pg) do { } while (0) -#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) -#define flush_cache_vmap(start, end) do { } while (0) -#define flush_cache_vunmap(start, end) do { } while (0) - -#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ - memcpy(dst, src, len) -#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ - memcpy(dst, src, len) - -void global_flush_tlb(void); -int change_page_attr(struct page *page, int numpages, pgprot_t prot); - -#ifdef CONFIG_DEBUG_PAGEALLOC -/* internal debugging function */ -void kernel_map_pages(struct page *page, int numpages, int enable); -#endif - -#ifdef CONFIG_DEBUG_RODATA -void mark_rodata_ro(void); -#endif - -#endif /* _I386_CACHEFLUSH_H */ diff --git a/include/asm-x86/cacheflush_64.h b/include/asm-x86/cacheflush_64.h deleted file mode 100644 index ab1cb5c7dc92..000000000000 --- a/include/asm-x86/cacheflush_64.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef _X8664_CACHEFLUSH_H -#define _X8664_CACHEFLUSH_H - -/* Keep includes the same across arches. */ -#include - -/* Caches aren't brain-dead on the intel. */ -#define flush_cache_all() do { } while (0) -#define flush_cache_mm(mm) do { } while (0) -#define flush_cache_dup_mm(mm) do { } while (0) -#define flush_cache_range(vma, start, end) do { } while (0) -#define flush_cache_page(vma, vmaddr, pfn) do { } while (0) -#define flush_dcache_page(page) do { } while (0) -#define flush_dcache_mmap_lock(mapping) do { } while (0) -#define flush_dcache_mmap_unlock(mapping) do { } while (0) -#define flush_icache_range(start, end) do { } while (0) -#define flush_icache_page(vma,pg) do { } while (0) -#define flush_icache_user_range(vma,pg,adr,len) do { } while (0) -#define flush_cache_vmap(start, end) do { } while (0) -#define flush_cache_vunmap(start, end) do { } while (0) - -#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ - memcpy(dst, src, len) -#define copy_from_user_page(vma, page, vaddr, dst, src, len) \ - memcpy(dst, src, len) - -void global_flush_tlb(void); -int change_page_attr(struct page *page, int numpages, pgprot_t prot); -int change_page_attr_addr(unsigned long addr, int numpages, pgprot_t prot); - -#ifdef CONFIG_DEBUG_RODATA -void mark_rodata_ro(void); -#endif - -#endif /* _X8664_CACHEFLUSH_H */ -- cgit v1.2.3 From 9bfa23df5632775bcb70b87975743046a71f7a3b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:20 +0200 Subject: x86: unify include/asm/cache_32/64.h Same file, except for whitespace, comment formatting and the extra defines in _64, which are conditional on VSMP anyway. Signed-off-by: Thomas Gleixner --- include/asm-x86/cache.h | 23 +++++++++++++++++++---- include/asm-x86/cache_32.h | 14 -------------- include/asm-x86/cache_64.h | 26 -------------------------- 3 files changed, 19 insertions(+), 44 deletions(-) delete mode 100644 include/asm-x86/cache_32.h delete mode 100644 include/asm-x86/cache_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/cache.h b/include/asm-x86/cache.h index c36d190ac9d8..1e0bac86f38f 100644 --- a/include/asm-x86/cache.h +++ b/include/asm-x86/cache.h @@ -1,5 +1,20 @@ -#ifdef CONFIG_X86_32 -# include "cache_32.h" -#else -# include "cache_64.h" +#ifndef _ARCH_X86_CACHE_H +#define _ARCH_X86_CACHE_H + +/* L1 cache line size */ +#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) +#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) + +#define __read_mostly __attribute__((__section__(".data.read_mostly"))) + +#ifdef CONFIG_X86_VSMP +/* vSMP Internode cacheline shift */ +#define INTERNODE_CACHE_SHIFT (12) +#ifdef CONFIG_SMP +#define __cacheline_aligned_in_smp \ + __attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \ + __attribute__((__section__(".data.page_aligned"))) +#endif +#endif + #endif diff --git a/include/asm-x86/cache_32.h b/include/asm-x86/cache_32.h deleted file mode 100644 index 57c62f414158..000000000000 --- a/include/asm-x86/cache_32.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * include/asm-i386/cache.h - */ -#ifndef __ARCH_I386_CACHE_H -#define __ARCH_I386_CACHE_H - - -/* L1 cache line size */ -#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) -#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) - -#define __read_mostly __attribute__((__section__(".data.read_mostly"))) - -#endif diff --git a/include/asm-x86/cache_64.h b/include/asm-x86/cache_64.h deleted file mode 100644 index 052df758ae61..000000000000 --- a/include/asm-x86/cache_64.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * include/asm-x86_64/cache.h - */ -#ifndef __ARCH_X8664_CACHE_H -#define __ARCH_X8664_CACHE_H - - -/* L1 cache line size */ -#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) -#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) - -#ifdef CONFIG_X86_VSMP - -/* vSMP Internode cacheline shift */ -#define INTERNODE_CACHE_SHIFT (12) -#ifdef CONFIG_SMP -#define __cacheline_aligned_in_smp \ - __attribute__((__aligned__(1 << (INTERNODE_CACHE_SHIFT)))) \ - __attribute__((__section__(".data.page_aligned"))) -#endif - -#endif - -#define __read_mostly __attribute__((__section__(".data.read_mostly"))) - -#endif -- cgit v1.2.3 From f1ea05466a13c4fbae852f2ce87aada594f3134f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:20 +0200 Subject: x86: unify include/asm/delay_32/64.h Same file, except for whitespace, comment formatting and the extra function prototype usc_tsc_delay() in _32. Signed-off-by: Thomas Gleixner --- include/asm-x86/delay.h | 36 +++++++++++++++++++++++++++++++----- include/asm-x86/delay_32.h | 31 ------------------------------- include/asm-x86/delay_64.h | 30 ------------------------------ 3 files changed, 31 insertions(+), 66 deletions(-) delete mode 100644 include/asm-x86/delay_32.h delete mode 100644 include/asm-x86/delay_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/delay.h b/include/asm-x86/delay.h index 10f2c71d622b..d11d47fc1a0e 100644 --- a/include/asm-x86/delay.h +++ b/include/asm-x86/delay.h @@ -1,5 +1,31 @@ -#ifdef CONFIG_X86_32 -# include "delay_32.h" -#else -# include "delay_64.h" -#endif +#ifndef _ASM_X86_DELAY_H +#define _ASM_X86_DELAY_H + +/* + * Copyright (C) 1993 Linus Torvalds + * + * Delay routines calling functions in arch/x86/lib/delay.c + */ + +/* Undefined functions to get compile-time errors */ +extern void __bad_udelay(void); +extern void __bad_ndelay(void); + +extern void __udelay(unsigned long usecs); +extern void __ndelay(unsigned long nsecs); +extern void __const_udelay(unsigned long usecs); +extern void __delay(unsigned long loops); + +/* 0x10c7 is 2**32 / 1000000 (rounded up) */ +#define udelay(n) (__builtin_constant_p(n) ? \ + ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \ + __udelay(n)) + +/* 0x5 is 2**32 / 1000000000 (rounded up) */ +#define ndelay(n) (__builtin_constant_p(n) ? \ + ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \ + __ndelay(n)) + +void use_tsc_delay(void); + +#endif /* _ASM_X86_DELAY_H */ diff --git a/include/asm-x86/delay_32.h b/include/asm-x86/delay_32.h deleted file mode 100644 index 9ae5e3782ed8..000000000000 --- a/include/asm-x86/delay_32.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _I386_DELAY_H -#define _I386_DELAY_H - -/* - * Copyright (C) 1993 Linus Torvalds - * - * Delay routines calling functions in arch/i386/lib/delay.c - */ - -/* Undefined functions to get compile-time errors */ -extern void __bad_udelay(void); -extern void __bad_ndelay(void); - -extern void __udelay(unsigned long usecs); -extern void __ndelay(unsigned long nsecs); -extern void __const_udelay(unsigned long usecs); -extern void __delay(unsigned long loops); - -/* 0x10c7 is 2**32 / 1000000 (rounded up) */ -#define udelay(n) (__builtin_constant_p(n) ? \ - ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \ - __udelay(n)) - -/* 0x5 is 2**32 / 1000000000 (rounded up) */ -#define ndelay(n) (__builtin_constant_p(n) ? \ - ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \ - __ndelay(n)) - -void use_tsc_delay(void); - -#endif /* defined(_I386_DELAY_H) */ diff --git a/include/asm-x86/delay_64.h b/include/asm-x86/delay_64.h deleted file mode 100644 index c2669f1f5529..000000000000 --- a/include/asm-x86/delay_64.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef _X8664_DELAY_H -#define _X8664_DELAY_H - -/* - * Copyright (C) 1993 Linus Torvalds - * - * Delay routines calling functions in arch/x86_64/lib/delay.c - */ - -/* Undefined functions to get compile-time errors */ -extern void __bad_udelay(void); -extern void __bad_ndelay(void); - -extern void __udelay(unsigned long usecs); -extern void __ndelay(unsigned long nsecs); -extern void __const_udelay(unsigned long usecs); -extern void __delay(unsigned long loops); - -/* 0x10c7 is 2**32 / 1000000 (rounded up) */ -#define udelay(n) (__builtin_constant_p(n) ? \ - ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \ - __udelay(n)) - -/* 0x5 is 2**32 / 1000000000 (rounded up) */ -#define ndelay(n) (__builtin_constant_p(n) ? \ - ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \ - __ndelay(n)) - - -#endif /* defined(_X8664_DELAY_H) */ -- cgit v1.2.3 From 327c21bc3d347d545d227103d7cc58039ab8a0be Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:20 +0200 Subject: x86: unify include/asm/dmi_32/64.h Unification, so we have these things in one file. Signed-off-by: Thomas Gleixner --- include/asm-x86/dmi.h | 36 +++++++++++++++++++++++++++++++++--- include/asm-x86/dmi_32.h | 11 ----------- include/asm-x86/dmi_64.h | 24 ------------------------ 3 files changed, 33 insertions(+), 38 deletions(-) delete mode 100644 include/asm-x86/dmi_32.h delete mode 100644 include/asm-x86/dmi_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/dmi.h b/include/asm-x86/dmi.h index c9e4e8ebc270..8e2b0e6aa8e7 100644 --- a/include/asm-x86/dmi.h +++ b/include/asm-x86/dmi.h @@ -1,5 +1,35 @@ +#ifndef _ASM_X86_DMI_H +#define _ASM_X86_DMI_H + +#include + #ifdef CONFIG_X86_32 -# include "dmi_32.h" -#else -# include "dmi_64.h" + +/* Use early IO mappings for DMI because it's initialized early */ +#define dmi_ioremap bt_ioremap +#define dmi_iounmap bt_iounmap +#define dmi_alloc alloc_bootmem + +#else /* CONFIG_X86_32 */ + +#define DMI_MAX_DATA 2048 + +extern int dmi_alloc_index; +extern char dmi_alloc_data[DMI_MAX_DATA]; + +/* This is so early that there is no good way to allocate dynamic memory. + Allocate data in an BSS array. */ +static inline void *dmi_alloc(unsigned len) +{ + int idx = dmi_alloc_index; + if ((dmi_alloc_index += len) > DMI_MAX_DATA) + return NULL; + return dmi_alloc_data + idx; +} + +#define dmi_ioremap early_ioremap +#define dmi_iounmap early_iounmap + +#endif + #endif diff --git a/include/asm-x86/dmi_32.h b/include/asm-x86/dmi_32.h deleted file mode 100644 index 38d4eeb7fc7e..000000000000 --- a/include/asm-x86/dmi_32.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _ASM_DMI_H -#define _ASM_DMI_H 1 - -#include - -/* Use early IO mappings for DMI because it's initialized early */ -#define dmi_ioremap bt_ioremap -#define dmi_iounmap bt_iounmap -#define dmi_alloc alloc_bootmem - -#endif diff --git a/include/asm-x86/dmi_64.h b/include/asm-x86/dmi_64.h deleted file mode 100644 index d02e32e3c3f0..000000000000 --- a/include/asm-x86/dmi_64.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef _ASM_DMI_H -#define _ASM_DMI_H 1 - -#include - -#define DMI_MAX_DATA 2048 - -extern int dmi_alloc_index; -extern char dmi_alloc_data[DMI_MAX_DATA]; - -/* This is so early that there is no good way to allocate dynamic memory. - Allocate data in an BSS array. */ -static inline void *dmi_alloc(unsigned len) -{ - int idx = dmi_alloc_index; - if ((dmi_alloc_index += len) > DMI_MAX_DATA) - return NULL; - return dmi_alloc_data + idx; -} - -#define dmi_ioremap early_ioremap -#define dmi_iounmap early_iounmap - -#endif -- cgit v1.2.3 From 1f7afb08a595292d946a5f1fd4929c81db7042d2 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:20 +0200 Subject: x86: unify include/asm/cache_32/64.h Same file, except for whitespace, comment formatting and: 32-bit: unsigned long *virt_addr = va; 64-bit: unsigned int *virt_addr = va; Both can be safely replaced by: u32 i, *virt_addr = va; Signed-off-by: Thomas Gleixner --- include/asm-x86/edac.h | 21 +++++++++++++++++---- include/asm-x86/edac_32.h | 18 ------------------ include/asm-x86/edac_64.h | 18 ------------------ 3 files changed, 17 insertions(+), 40 deletions(-) delete mode 100644 include/asm-x86/edac_32.h delete mode 100644 include/asm-x86/edac_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/edac.h b/include/asm-x86/edac.h index f8b888e140b0..cf3200a745ad 100644 --- a/include/asm-x86/edac.h +++ b/include/asm-x86/edac.h @@ -1,5 +1,18 @@ -#ifdef CONFIG_X86_32 -# include "edac_32.h" -#else -# include "edac_64.h" +#ifndef _ASM_X86_EDAC_H +#define _ASM_X86_EDAC_H + +/* ECC atomic, DMA, SMP and interrupt safe scrub function */ + +static __inline__ void atomic_scrub(void *va, u32 size) +{ + u32 i, *virt_addr = va; + + /* + * Very carefully read and write to memory atomically so we + * are interrupt, DMA and SMP safe. + */ + for (i = 0; i < size / 4; i++, virt_addr++) + __asm__ __volatile__("lock; addl $0, %0"::"m"(*virt_addr)); +} + #endif diff --git a/include/asm-x86/edac_32.h b/include/asm-x86/edac_32.h deleted file mode 100644 index 3e7dd0ab68ce..000000000000 --- a/include/asm-x86/edac_32.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASM_EDAC_H -#define ASM_EDAC_H - -/* ECC atomic, DMA, SMP and interrupt safe scrub function */ - -static __inline__ void atomic_scrub(void *va, u32 size) -{ - unsigned long *virt_addr = va; - u32 i; - - for (i = 0; i < size / 4; i++, virt_addr++) - /* Very carefully read and write to memory atomically - * so we are interrupt, DMA and SMP safe. - */ - __asm__ __volatile__("lock; addl $0, %0"::"m"(*virt_addr)); -} - -#endif diff --git a/include/asm-x86/edac_64.h b/include/asm-x86/edac_64.h deleted file mode 100644 index cad1cd42b4ee..000000000000 --- a/include/asm-x86/edac_64.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef ASM_EDAC_H -#define ASM_EDAC_H - -/* ECC atomic, DMA, SMP and interrupt safe scrub function */ - -static __inline__ void atomic_scrub(void *va, u32 size) -{ - unsigned int *virt_addr = va; - u32 i; - - for (i = 0; i < size / 4; i++, virt_addr++) - /* Very carefully read and write to memory atomically - * so we are interrupt, DMA and SMP safe. - */ - __asm__ __volatile__("lock; addl $0, %0"::"m"(*virt_addr)); -} - -#endif -- cgit v1.2.3 From 106619c440a7cd5a100eaba38665231ab8c762b8 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:20 +0200 Subject: x86: unify include/asm/cache_32/64.h Same file, except for whitespace, comment formatting and the two variants of fb_is_primary_device() Signed-off-by: Thomas Gleixner --- include/asm-x86/fb.h | 20 ++++++++++++++++++-- include/asm-x86/fb_32.h | 17 ----------------- include/asm-x86/fb_64.h | 19 ------------------- 3 files changed, 18 insertions(+), 38 deletions(-) delete mode 100644 include/asm-x86/fb_32.h delete mode 100644 include/asm-x86/fb_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/fb.h b/include/asm-x86/fb.h index 238c7ca45877..53018464aea6 100644 --- a/include/asm-x86/fb.h +++ b/include/asm-x86/fb.h @@ -1,5 +1,21 @@ +#ifndef _ASM_X86_FB_H +#define _ASM_X86_FB_H + +#include +#include +#include + +static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, + unsigned long off) +{ + if (boot_cpu_data.x86 > 3) + pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; +} + #ifdef CONFIG_X86_32 -# include "fb_32.h" +extern int fb_is_primary_device(struct fb_info *info); #else -# include "fb_64.h" +static inline int fb_is_primary_device(struct fb_info *info) { return 0; } #endif + +#endif /* _ASM_X86_FB_H */ diff --git a/include/asm-x86/fb_32.h b/include/asm-x86/fb_32.h deleted file mode 100644 index d1c6297d4a61..000000000000 --- a/include/asm-x86/fb_32.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _ASM_FB_H_ -#define _ASM_FB_H_ - -#include -#include -#include - -extern int fb_is_primary_device(struct fb_info *info); - -static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, - unsigned long off) -{ - if (boot_cpu_data.x86 > 3) - pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; -} - -#endif /* _ASM_FB_H_ */ diff --git a/include/asm-x86/fb_64.h b/include/asm-x86/fb_64.h deleted file mode 100644 index 60548e651d12..000000000000 --- a/include/asm-x86/fb_64.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _ASM_FB_H_ -#define _ASM_FB_H_ -#include -#include -#include - -static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, - unsigned long off) -{ - if (boot_cpu_data.x86 > 3) - pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; -} - -static inline int fb_is_primary_device(struct fb_info *info) -{ - return 0; -} - -#endif /* _ASM_FB_H_ */ -- cgit v1.2.3 From 2dc27f01ec3990d79fc97386459191fc3da2b02f Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:20 +0200 Subject: x86: apply missing DMA/OOM prevention to floppy_32.h commit 554d284ba90bc2306c31e5363789f05c320969c3 added _GPF_NORETRY to floppy_64.h to prevent OOM killer on floppy DMA allocations. Apply the same to the 32 bit variant. Found during the attempt to unify the _32/_64 variants. Seperate commit to document the resulting code change. Signed-off-by: Thomas Gleixner --- include/asm-x86/floppy_32.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/asm-x86') diff --git a/include/asm-x86/floppy_32.h b/include/asm-x86/floppy_32.h index 99583b39d216..cca9be7f6c81 100644 --- a/include/asm-x86/floppy_32.h +++ b/include/asm-x86/floppy_32.h @@ -154,7 +154,7 @@ static int fd_request_irq(void) static unsigned long dma_mem_alloc(unsigned long size) { - return __get_dma_pages(GFP_KERNEL,get_order(size)); + return __get_dma_pages(GFP_KERNEL | __GFP_NORETRY, get_order(size)); } -- cgit v1.2.3 From b515e4767ffd07d1b14f4dc4f328d75f765215ab Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 17 Oct 2007 20:24:56 +0200 Subject: x86: unify include/asm/floppy_32/64.h Same file, except for whitespace, comment formatting and: 32-bit: if((unsigned int) addr >= (unsigned int) high_memory) 64-bit: if((unsigned long) addr >= (unsigned long) high_memory) where the latter can be used safely for both. Signed-off-by: Thomas Gleixner Conflicts: include/asm-x86/floppy_32.h include/asm-x86/floppy_64.h --- include/asm-x86/floppy.h | 281 +++++++++++++++++++++++++++++++++++++++++++- include/asm-x86/floppy_32.h | 280 ------------------------------------------- include/asm-x86/floppy_64.h | 279 ------------------------------------------- 3 files changed, 277 insertions(+), 563 deletions(-) delete mode 100644 include/asm-x86/floppy_32.h delete mode 100644 include/asm-x86/floppy_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/floppy.h b/include/asm-x86/floppy.h index aecbb6dca21d..a48d7153c097 100644 --- a/include/asm-x86/floppy.h +++ b/include/asm-x86/floppy.h @@ -1,5 +1,278 @@ -#ifdef CONFIG_X86_32 -# include "floppy_32.h" -#else -# include "floppy_64.h" +/* + * Architecture specific parts of the Floppy driver + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1995 + */ +#ifndef _ASM_X86_FLOPPY_H +#define _ASM_X86_FLOPPY_H + +#include + +/* + * The DMA channel used by the floppy controller cannot access data at + * addresses >= 16MB + * + * Went back to the 1MB limit, as some people had problems with the floppy + * driver otherwise. It doesn't matter much for performance anyway, as most + * floppy accesses go through the track buffer. + */ +#define _CROSS_64KB(a,s,vdma) \ +(!(vdma) && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64)) + +#define CROSS_64KB(a,s) _CROSS_64KB(a,s,use_virtual_dma & 1) + + +#define SW fd_routine[use_virtual_dma&1] +#define CSW fd_routine[can_use_virtual_dma & 1] + + +#define fd_inb(port) inb_p(port) +#define fd_outb(value,port) outb_p(value,port) + +#define fd_request_dma() CSW._request_dma(FLOPPY_DMA,"floppy") +#define fd_free_dma() CSW._free_dma(FLOPPY_DMA) +#define fd_enable_irq() enable_irq(FLOPPY_IRQ) +#define fd_disable_irq() disable_irq(FLOPPY_IRQ) +#define fd_free_irq() free_irq(FLOPPY_IRQ, NULL) +#define fd_get_dma_residue() SW._get_dma_residue(FLOPPY_DMA) +#define fd_dma_mem_alloc(size) SW._dma_mem_alloc(size) +#define fd_dma_setup(addr, size, mode, io) SW._dma_setup(addr, size, mode, io) + +#define FLOPPY_CAN_FALLBACK_ON_NODMA + +static int virtual_dma_count; +static int virtual_dma_residue; +static char *virtual_dma_addr; +static int virtual_dma_mode; +static int doing_pdma; + +static irqreturn_t floppy_hardint(int irq, void *dev_id) +{ + register unsigned char st; + +#undef TRACE_FLPY_INT + +#ifdef TRACE_FLPY_INT + static int calls=0; + static int bytes=0; + static int dma_wait=0; #endif + if (!doing_pdma) + return floppy_interrupt(irq, dev_id); + +#ifdef TRACE_FLPY_INT + if(!calls) + bytes = virtual_dma_count; +#endif + + { + register int lcount; + register char *lptr; + + st = 1; + for(lcount=virtual_dma_count, lptr=virtual_dma_addr; + lcount; lcount--, lptr++) { + st=inb(virtual_dma_port+4) & 0xa0 ; + if(st != 0xa0) + break; + if(virtual_dma_mode) + outb_p(*lptr, virtual_dma_port+5); + else + *lptr = inb_p(virtual_dma_port+5); + } + virtual_dma_count = lcount; + virtual_dma_addr = lptr; + st = inb(virtual_dma_port+4); + } + +#ifdef TRACE_FLPY_INT + calls++; +#endif + if(st == 0x20) + return IRQ_HANDLED; + if(!(st & 0x20)) { + virtual_dma_residue += virtual_dma_count; + virtual_dma_count=0; +#ifdef TRACE_FLPY_INT + printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n", + virtual_dma_count, virtual_dma_residue, calls, bytes, + dma_wait); + calls = 0; + dma_wait=0; +#endif + doing_pdma = 0; + floppy_interrupt(irq, dev_id); + return IRQ_HANDLED; + } +#ifdef TRACE_FLPY_INT + if(!virtual_dma_count) + dma_wait++; +#endif + return IRQ_HANDLED; +} + +static void fd_disable_dma(void) +{ + if(! (can_use_virtual_dma & 1)) + disable_dma(FLOPPY_DMA); + doing_pdma = 0; + virtual_dma_residue += virtual_dma_count; + virtual_dma_count=0; +} + +static int vdma_request_dma(unsigned int dmanr, const char * device_id) +{ + return 0; +} + +static void vdma_nop(unsigned int dummy) +{ +} + + +static int vdma_get_dma_residue(unsigned int dummy) +{ + return virtual_dma_count + virtual_dma_residue; +} + + +static int fd_request_irq(void) +{ + if(can_use_virtual_dma) + return request_irq(FLOPPY_IRQ, floppy_hardint, + IRQF_DISABLED, "floppy", NULL); + else + return request_irq(FLOPPY_IRQ, floppy_interrupt, + IRQF_DISABLED, "floppy", NULL); +} + +static unsigned long dma_mem_alloc(unsigned long size) +{ + return __get_dma_pages(GFP_KERNEL|__GFP_NORETRY,get_order(size)); +} + + +static unsigned long vdma_mem_alloc(unsigned long size) +{ + return (unsigned long) vmalloc(size); + +} + +#define nodma_mem_alloc(size) vdma_mem_alloc(size) + +static void _fd_dma_mem_free(unsigned long addr, unsigned long size) +{ + if((unsigned long) addr >= (unsigned long) high_memory) + vfree((void *)addr); + else + free_pages(addr, get_order(size)); +} + +#define fd_dma_mem_free(addr, size) _fd_dma_mem_free(addr, size) + +static void _fd_chose_dma_mode(char *addr, unsigned long size) +{ + if(can_use_virtual_dma == 2) { + if((unsigned long) addr >= (unsigned long) high_memory || + isa_virt_to_bus(addr) >= 0x1000000 || + _CROSS_64KB(addr, size, 0)) + use_virtual_dma = 1; + else + use_virtual_dma = 0; + } else { + use_virtual_dma = can_use_virtual_dma & 1; + } +} + +#define fd_chose_dma_mode(addr, size) _fd_chose_dma_mode(addr, size) + + +static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io) +{ + doing_pdma = 1; + virtual_dma_port = io; + virtual_dma_mode = (mode == DMA_MODE_WRITE); + virtual_dma_addr = addr; + virtual_dma_count = size; + virtual_dma_residue = 0; + return 0; +} + +static int hard_dma_setup(char *addr, unsigned long size, int mode, int io) +{ +#ifdef FLOPPY_SANITY_CHECK + if (CROSS_64KB(addr, size)) { + printk("DMA crossing 64-K boundary %p-%p\n", addr, addr+size); + return -1; + } +#endif + /* actual, physical DMA */ + doing_pdma = 0; + clear_dma_ff(FLOPPY_DMA); + set_dma_mode(FLOPPY_DMA,mode); + set_dma_addr(FLOPPY_DMA,isa_virt_to_bus(addr)); + set_dma_count(FLOPPY_DMA,size); + enable_dma(FLOPPY_DMA); + return 0; +} + +static struct fd_routine_l { + int (*_request_dma)(unsigned int dmanr, const char * device_id); + void (*_free_dma)(unsigned int dmanr); + int (*_get_dma_residue)(unsigned int dummy); + unsigned long (*_dma_mem_alloc) (unsigned long size); + int (*_dma_setup)(char *addr, unsigned long size, int mode, int io); +} fd_routine[] = { + { + request_dma, + free_dma, + get_dma_residue, + dma_mem_alloc, + hard_dma_setup + }, + { + vdma_request_dma, + vdma_nop, + vdma_get_dma_residue, + vdma_mem_alloc, + vdma_dma_setup + } +}; + + +static int FDC1 = 0x3f0; +static int FDC2 = -1; + +/* + * Floppy types are stored in the rtc's CMOS RAM and so rtc_lock + * is needed to prevent corrupted CMOS RAM in case "insmod floppy" + * coincides with another rtc CMOS user. Paul G. + */ +#define FLOPPY0_TYPE ({ \ + unsigned long flags; \ + unsigned char val; \ + spin_lock_irqsave(&rtc_lock, flags); \ + val = (CMOS_READ(0x10) >> 4) & 15; \ + spin_unlock_irqrestore(&rtc_lock, flags); \ + val; \ +}) + +#define FLOPPY1_TYPE ({ \ + unsigned long flags; \ + unsigned char val; \ + spin_lock_irqsave(&rtc_lock, flags); \ + val = CMOS_READ(0x10) & 15; \ + spin_unlock_irqrestore(&rtc_lock, flags); \ + val; \ +}) + +#define N_FDC 2 +#define N_DRIVE 8 + +#define EXTRA_FLOPPY_PARAMS + +#endif /* _ASM_X86_FLOPPY_H */ diff --git a/include/asm-x86/floppy_32.h b/include/asm-x86/floppy_32.h deleted file mode 100644 index cca9be7f6c81..000000000000 --- a/include/asm-x86/floppy_32.h +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Architecture specific parts of the Floppy driver - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1995 - */ -#ifndef __ASM_I386_FLOPPY_H -#define __ASM_I386_FLOPPY_H - -#include - - -/* - * The DMA channel used by the floppy controller cannot access data at - * addresses >= 16MB - * - * Went back to the 1MB limit, as some people had problems with the floppy - * driver otherwise. It doesn't matter much for performance anyway, as most - * floppy accesses go through the track buffer. - */ -#define _CROSS_64KB(a,s,vdma) \ -(!(vdma) && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64)) - -#define CROSS_64KB(a,s) _CROSS_64KB(a,s,use_virtual_dma & 1) - - -#define SW fd_routine[use_virtual_dma&1] -#define CSW fd_routine[can_use_virtual_dma & 1] - - -#define fd_inb(port) inb_p(port) -#define fd_outb(value,port) outb_p(value,port) - -#define fd_request_dma() CSW._request_dma(FLOPPY_DMA,"floppy") -#define fd_free_dma() CSW._free_dma(FLOPPY_DMA) -#define fd_enable_irq() enable_irq(FLOPPY_IRQ) -#define fd_disable_irq() disable_irq(FLOPPY_IRQ) -#define fd_free_irq() free_irq(FLOPPY_IRQ, NULL) -#define fd_get_dma_residue() SW._get_dma_residue(FLOPPY_DMA) -#define fd_dma_mem_alloc(size) SW._dma_mem_alloc(size) -#define fd_dma_setup(addr, size, mode, io) SW._dma_setup(addr, size, mode, io) - -#define FLOPPY_CAN_FALLBACK_ON_NODMA - -static int virtual_dma_count; -static int virtual_dma_residue; -static char *virtual_dma_addr; -static int virtual_dma_mode; -static int doing_pdma; - -static irqreturn_t floppy_hardint(int irq, void *dev_id) -{ - register unsigned char st; - -#undef TRACE_FLPY_INT - -#ifdef TRACE_FLPY_INT - static int calls=0; - static int bytes=0; - static int dma_wait=0; -#endif - if (!doing_pdma) - return floppy_interrupt(irq, dev_id); - -#ifdef TRACE_FLPY_INT - if(!calls) - bytes = virtual_dma_count; -#endif - - { - register int lcount; - register char *lptr; - - st = 1; - for(lcount=virtual_dma_count, lptr=virtual_dma_addr; - lcount; lcount--, lptr++) { - st=inb(virtual_dma_port+4) & 0xa0 ; - if(st != 0xa0) - break; - if(virtual_dma_mode) - outb_p(*lptr, virtual_dma_port+5); - else - *lptr = inb_p(virtual_dma_port+5); - } - virtual_dma_count = lcount; - virtual_dma_addr = lptr; - st = inb(virtual_dma_port+4); - } - -#ifdef TRACE_FLPY_INT - calls++; -#endif - if(st == 0x20) - return IRQ_HANDLED; - if(!(st & 0x20)) { - virtual_dma_residue += virtual_dma_count; - virtual_dma_count=0; -#ifdef TRACE_FLPY_INT - printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n", - virtual_dma_count, virtual_dma_residue, calls, bytes, - dma_wait); - calls = 0; - dma_wait=0; -#endif - doing_pdma = 0; - floppy_interrupt(irq, dev_id); - return IRQ_HANDLED; - } -#ifdef TRACE_FLPY_INT - if(!virtual_dma_count) - dma_wait++; -#endif - return IRQ_HANDLED; -} - -static void fd_disable_dma(void) -{ - if(! (can_use_virtual_dma & 1)) - disable_dma(FLOPPY_DMA); - doing_pdma = 0; - virtual_dma_residue += virtual_dma_count; - virtual_dma_count=0; -} - -static int vdma_request_dma(unsigned int dmanr, const char * device_id) -{ - return 0; -} - -static void vdma_nop(unsigned int dummy) -{ -} - - -static int vdma_get_dma_residue(unsigned int dummy) -{ - return virtual_dma_count + virtual_dma_residue; -} - - -static int fd_request_irq(void) -{ - if(can_use_virtual_dma) - return request_irq(FLOPPY_IRQ, floppy_hardint, - IRQF_DISABLED, "floppy", NULL); - else - return request_irq(FLOPPY_IRQ, floppy_interrupt, - IRQF_DISABLED, "floppy", NULL); - -} - -static unsigned long dma_mem_alloc(unsigned long size) -{ - return __get_dma_pages(GFP_KERNEL | __GFP_NORETRY, get_order(size)); -} - - -static unsigned long vdma_mem_alloc(unsigned long size) -{ - return (unsigned long) vmalloc(size); - -} - -#define nodma_mem_alloc(size) vdma_mem_alloc(size) - -static void _fd_dma_mem_free(unsigned long addr, unsigned long size) -{ - if((unsigned int) addr >= (unsigned int) high_memory) - vfree((void *)addr); - else - free_pages(addr, get_order(size)); -} - -#define fd_dma_mem_free(addr, size) _fd_dma_mem_free(addr, size) - -static void _fd_chose_dma_mode(char *addr, unsigned long size) -{ - if(can_use_virtual_dma == 2) { - if((unsigned int) addr >= (unsigned int) high_memory || - isa_virt_to_bus(addr) >= 0x1000000 || - _CROSS_64KB(addr, size, 0)) - use_virtual_dma = 1; - else - use_virtual_dma = 0; - } else { - use_virtual_dma = can_use_virtual_dma & 1; - } -} - -#define fd_chose_dma_mode(addr, size) _fd_chose_dma_mode(addr, size) - - -static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io) -{ - doing_pdma = 1; - virtual_dma_port = io; - virtual_dma_mode = (mode == DMA_MODE_WRITE); - virtual_dma_addr = addr; - virtual_dma_count = size; - virtual_dma_residue = 0; - return 0; -} - -static int hard_dma_setup(char *addr, unsigned long size, int mode, int io) -{ -#ifdef FLOPPY_SANITY_CHECK - if (CROSS_64KB(addr, size)) { - printk("DMA crossing 64-K boundary %p-%p\n", addr, addr+size); - return -1; - } -#endif - /* actual, physical DMA */ - doing_pdma = 0; - clear_dma_ff(FLOPPY_DMA); - set_dma_mode(FLOPPY_DMA,mode); - set_dma_addr(FLOPPY_DMA,isa_virt_to_bus(addr)); - set_dma_count(FLOPPY_DMA,size); - enable_dma(FLOPPY_DMA); - return 0; -} - -static struct fd_routine_l { - int (*_request_dma)(unsigned int dmanr, const char * device_id); - void (*_free_dma)(unsigned int dmanr); - int (*_get_dma_residue)(unsigned int dummy); - unsigned long (*_dma_mem_alloc) (unsigned long size); - int (*_dma_setup)(char *addr, unsigned long size, int mode, int io); -} fd_routine[] = { - { - request_dma, - free_dma, - get_dma_residue, - dma_mem_alloc, - hard_dma_setup - }, - { - vdma_request_dma, - vdma_nop, - vdma_get_dma_residue, - vdma_mem_alloc, - vdma_dma_setup - } -}; - - -static int FDC1 = 0x3f0; -static int FDC2 = -1; - -/* - * Floppy types are stored in the rtc's CMOS RAM and so rtc_lock - * is needed to prevent corrupted CMOS RAM in case "insmod floppy" - * coincides with another rtc CMOS user. Paul G. - */ -#define FLOPPY0_TYPE ({ \ - unsigned long flags; \ - unsigned char val; \ - spin_lock_irqsave(&rtc_lock, flags); \ - val = (CMOS_READ(0x10) >> 4) & 15; \ - spin_unlock_irqrestore(&rtc_lock, flags); \ - val; \ -}) - -#define FLOPPY1_TYPE ({ \ - unsigned long flags; \ - unsigned char val; \ - spin_lock_irqsave(&rtc_lock, flags); \ - val = CMOS_READ(0x10) & 15; \ - spin_unlock_irqrestore(&rtc_lock, flags); \ - val; \ -}) - -#define N_FDC 2 -#define N_DRIVE 8 - -#define EXTRA_FLOPPY_PARAMS - -#endif /* __ASM_I386_FLOPPY_H */ diff --git a/include/asm-x86/floppy_64.h b/include/asm-x86/floppy_64.h deleted file mode 100644 index d993380dcb47..000000000000 --- a/include/asm-x86/floppy_64.h +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Architecture specific parts of the Floppy driver - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 1995 - */ -#ifndef __ASM_X86_64_FLOPPY_H -#define __ASM_X86_64_FLOPPY_H - -#include - - -/* - * The DMA channel used by the floppy controller cannot access data at - * addresses >= 16MB - * - * Went back to the 1MB limit, as some people had problems with the floppy - * driver otherwise. It doesn't matter much for performance anyway, as most - * floppy accesses go through the track buffer. - */ -#define _CROSS_64KB(a,s,vdma) \ -(!(vdma) && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64)) - -#define CROSS_64KB(a,s) _CROSS_64KB(a,s,use_virtual_dma & 1) - - -#define SW fd_routine[use_virtual_dma&1] -#define CSW fd_routine[can_use_virtual_dma & 1] - - -#define fd_inb(port) inb_p(port) -#define fd_outb(value,port) outb_p(value,port) - -#define fd_request_dma() CSW._request_dma(FLOPPY_DMA,"floppy") -#define fd_free_dma() CSW._free_dma(FLOPPY_DMA) -#define fd_enable_irq() enable_irq(FLOPPY_IRQ) -#define fd_disable_irq() disable_irq(FLOPPY_IRQ) -#define fd_free_irq() free_irq(FLOPPY_IRQ, NULL) -#define fd_get_dma_residue() SW._get_dma_residue(FLOPPY_DMA) -#define fd_dma_mem_alloc(size) SW._dma_mem_alloc(size) -#define fd_dma_setup(addr, size, mode, io) SW._dma_setup(addr, size, mode, io) - -#define FLOPPY_CAN_FALLBACK_ON_NODMA - -static int virtual_dma_count; -static int virtual_dma_residue; -static char *virtual_dma_addr; -static int virtual_dma_mode; -static int doing_pdma; - -static irqreturn_t floppy_hardint(int irq, void *dev_id) -{ - register unsigned char st; - -#undef TRACE_FLPY_INT - -#ifdef TRACE_FLPY_INT - static int calls=0; - static int bytes=0; - static int dma_wait=0; -#endif - if (!doing_pdma) - return floppy_interrupt(irq, dev_id); - -#ifdef TRACE_FLPY_INT - if(!calls) - bytes = virtual_dma_count; -#endif - - { - register int lcount; - register char *lptr; - - st = 1; - for(lcount=virtual_dma_count, lptr=virtual_dma_addr; - lcount; lcount--, lptr++) { - st=inb(virtual_dma_port+4) & 0xa0 ; - if(st != 0xa0) - break; - if(virtual_dma_mode) - outb_p(*lptr, virtual_dma_port+5); - else - *lptr = inb_p(virtual_dma_port+5); - } - virtual_dma_count = lcount; - virtual_dma_addr = lptr; - st = inb(virtual_dma_port+4); - } - -#ifdef TRACE_FLPY_INT - calls++; -#endif - if(st == 0x20) - return IRQ_HANDLED; - if(!(st & 0x20)) { - virtual_dma_residue += virtual_dma_count; - virtual_dma_count=0; -#ifdef TRACE_FLPY_INT - printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n", - virtual_dma_count, virtual_dma_residue, calls, bytes, - dma_wait); - calls = 0; - dma_wait=0; -#endif - doing_pdma = 0; - floppy_interrupt(irq, dev_id); - return IRQ_HANDLED; - } -#ifdef TRACE_FLPY_INT - if(!virtual_dma_count) - dma_wait++; -#endif - return IRQ_HANDLED; -} - -static void fd_disable_dma(void) -{ - if(! (can_use_virtual_dma & 1)) - disable_dma(FLOPPY_DMA); - doing_pdma = 0; - virtual_dma_residue += virtual_dma_count; - virtual_dma_count=0; -} - -static int vdma_request_dma(unsigned int dmanr, const char * device_id) -{ - return 0; -} - -static void vdma_nop(unsigned int dummy) -{ -} - - -static int vdma_get_dma_residue(unsigned int dummy) -{ - return virtual_dma_count + virtual_dma_residue; -} - - -static int fd_request_irq(void) -{ - if(can_use_virtual_dma) - return request_irq(FLOPPY_IRQ, floppy_hardint, - IRQF_DISABLED, "floppy", NULL); - else - return request_irq(FLOPPY_IRQ, floppy_interrupt, - IRQF_DISABLED, "floppy", NULL); -} - -static unsigned long dma_mem_alloc(unsigned long size) -{ - return __get_dma_pages(GFP_KERNEL|__GFP_NORETRY,get_order(size)); -} - - -static unsigned long vdma_mem_alloc(unsigned long size) -{ - return (unsigned long) vmalloc(size); - -} - -#define nodma_mem_alloc(size) vdma_mem_alloc(size) - -static void _fd_dma_mem_free(unsigned long addr, unsigned long size) -{ - if((unsigned long) addr >= (unsigned long) high_memory) - vfree((void *)addr); - else - free_pages(addr, get_order(size)); -} - -#define fd_dma_mem_free(addr, size) _fd_dma_mem_free(addr, size) - -static void _fd_chose_dma_mode(char *addr, unsigned long size) -{ - if(can_use_virtual_dma == 2) { - if((unsigned long) addr >= (unsigned long) high_memory || - isa_virt_to_bus(addr) >= 0x1000000 || - _CROSS_64KB(addr, size, 0)) - use_virtual_dma = 1; - else - use_virtual_dma = 0; - } else { - use_virtual_dma = can_use_virtual_dma & 1; - } -} - -#define fd_chose_dma_mode(addr, size) _fd_chose_dma_mode(addr, size) - - -static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io) -{ - doing_pdma = 1; - virtual_dma_port = io; - virtual_dma_mode = (mode == DMA_MODE_WRITE); - virtual_dma_addr = addr; - virtual_dma_count = size; - virtual_dma_residue = 0; - return 0; -} - -static int hard_dma_setup(char *addr, unsigned long size, int mode, int io) -{ -#ifdef FLOPPY_SANITY_CHECK - if (CROSS_64KB(addr, size)) { - printk("DMA crossing 64-K boundary %p-%p\n", addr, addr+size); - return -1; - } -#endif - /* actual, physical DMA */ - doing_pdma = 0; - clear_dma_ff(FLOPPY_DMA); - set_dma_mode(FLOPPY_DMA,mode); - set_dma_addr(FLOPPY_DMA,isa_virt_to_bus(addr)); - set_dma_count(FLOPPY_DMA,size); - enable_dma(FLOPPY_DMA); - return 0; -} - -static struct fd_routine_l { - int (*_request_dma)(unsigned int dmanr, const char * device_id); - void (*_free_dma)(unsigned int dmanr); - int (*_get_dma_residue)(unsigned int dummy); - unsigned long (*_dma_mem_alloc) (unsigned long size); - int (*_dma_setup)(char *addr, unsigned long size, int mode, int io); -} fd_routine[] = { - { - request_dma, - free_dma, - get_dma_residue, - dma_mem_alloc, - hard_dma_setup - }, - { - vdma_request_dma, - vdma_nop, - vdma_get_dma_residue, - vdma_mem_alloc, - vdma_dma_setup - } -}; - - -static int FDC1 = 0x3f0; -static int FDC2 = -1; - -/* - * Floppy types are stored in the rtc's CMOS RAM and so rtc_lock - * is needed to prevent corrupted CMOS RAM in case "insmod floppy" - * coincides with another rtc CMOS user. Paul G. - */ -#define FLOPPY0_TYPE ({ \ - unsigned long flags; \ - unsigned char val; \ - spin_lock_irqsave(&rtc_lock, flags); \ - val = (CMOS_READ(0x10) >> 4) & 15; \ - spin_unlock_irqrestore(&rtc_lock, flags); \ - val; \ -}) - -#define FLOPPY1_TYPE ({ \ - unsigned long flags; \ - unsigned char val; \ - spin_lock_irqsave(&rtc_lock, flags); \ - val = CMOS_READ(0x10) & 15; \ - spin_unlock_irqrestore(&rtc_lock, flags); \ - val; \ -}) - -#define N_FDC 2 -#define N_DRIVE 8 - -#define EXTRA_FLOPPY_PARAMS - -#endif /* __ASM_X86_64_FLOPPY_H */ -- cgit v1.2.3 From 612d26a72a3fad16a0a5e37f7b1652a0ea965fc0 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:20 +0200 Subject: x86: unify include/asm/ioctls_32/64.h Same file, except for whitespace and comment formatting. Signed-off-by: Thomas Gleixner --- include/asm-x86/Kbuild | 2 - include/asm-x86/ioctls.h | 98 +++++++++++++++++++++++++++++++++++++++------ include/asm-x86/ioctls_32.h | 87 ---------------------------------------- include/asm-x86/ioctls_64.h | 86 --------------------------------------- 4 files changed, 86 insertions(+), 187 deletions(-) delete mode 100644 include/asm-x86/ioctls_32.h delete mode 100644 include/asm-x86/ioctls_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild index d300cff2201e..a617f752ea6e 100644 --- a/include/asm-x86/Kbuild +++ b/include/asm-x86/Kbuild @@ -18,8 +18,6 @@ unifdef-y += byteorder_32.h unifdef-y += byteorder_64.h unifdef-y += elf_32.h unifdef-y += elf_64.h -unifdef-y += ioctls_32.h -unifdef-y += ioctls_64.h unifdef-y += mce.h unifdef-y += mman_32.h unifdef-y += mman_64.h diff --git a/include/asm-x86/ioctls.h b/include/asm-x86/ioctls.h index 1e0fd48f18bc..93c894dc5154 100644 --- a/include/asm-x86/ioctls.h +++ b/include/asm-x86/ioctls.h @@ -1,13 +1,87 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "ioctls_32.h" -# else -# include "ioctls_64.h" -# endif -#else -# ifdef __i386__ -# include "ioctls_32.h" -# else -# include "ioctls_64.h" -# endif +#ifndef _ASM_X86_IOCTLS_H +#define _ASM_X86_IOCTLS_H + +#include + +/* 0x54 is just a magic number to make these relatively unique ('T') */ + +#define TCGETS 0x5401 +#define TCSETS 0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */ +#define TCSETSW 0x5403 +#define TCSETSF 0x5404 +#define TCGETA 0x5405 +#define TCSETA 0x5406 +#define TCSETAW 0x5407 +#define TCSETAF 0x5408 +#define TCSBRK 0x5409 +#define TCXONC 0x540A +#define TCFLSH 0x540B +#define TIOCEXCL 0x540C +#define TIOCNXCL 0x540D +#define TIOCSCTTY 0x540E +#define TIOCGPGRP 0x540F +#define TIOCSPGRP 0x5410 +#define TIOCOUTQ 0x5411 +#define TIOCSTI 0x5412 +#define TIOCGWINSZ 0x5413 +#define TIOCSWINSZ 0x5414 +#define TIOCMGET 0x5415 +#define TIOCMBIS 0x5416 +#define TIOCMBIC 0x5417 +#define TIOCMSET 0x5418 +#define TIOCGSOFTCAR 0x5419 +#define TIOCSSOFTCAR 0x541A +#define FIONREAD 0x541B +#define TIOCINQ FIONREAD +#define TIOCLINUX 0x541C +#define TIOCCONS 0x541D +#define TIOCGSERIAL 0x541E +#define TIOCSSERIAL 0x541F +#define TIOCPKT 0x5420 +#define FIONBIO 0x5421 +#define TIOCNOTTY 0x5422 +#define TIOCSETD 0x5423 +#define TIOCGETD 0x5424 +#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ +/* #define TIOCTTYGSTRUCT 0x5426 - Former debugging-only ioctl */ +#define TIOCSBRK 0x5427 /* BSD compatibility */ +#define TIOCCBRK 0x5428 /* BSD compatibility */ +#define TIOCGSID 0x5429 /* Return the session ID of FD */ +#define TCGETS2 _IOR('T',0x2A, struct termios2) +#define TCSETS2 _IOW('T',0x2B, struct termios2) +#define TCSETSW2 _IOW('T',0x2C, struct termios2) +#define TCSETSF2 _IOW('T',0x2D, struct termios2) +#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ +#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ + +#define FIONCLEX 0x5450 +#define FIOCLEX 0x5451 +#define FIOASYNC 0x5452 +#define TIOCSERCONFIG 0x5453 +#define TIOCSERGWILD 0x5454 +#define TIOCSERSWILD 0x5455 +#define TIOCGLCKTRMIOS 0x5456 +#define TIOCSLCKTRMIOS 0x5457 +#define TIOCSERGSTRUCT 0x5458 /* For debugging only */ +#define TIOCSERGETLSR 0x5459 /* Get line status register */ +#define TIOCSERGETMULTI 0x545A /* Get multiport config */ +#define TIOCSERSETMULTI 0x545B /* Set multiport config */ + +#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ +#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ +#define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */ +#define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */ +#define FIOQSIZE 0x5460 + +/* Used for packet mode */ +#define TIOCPKT_DATA 0 +#define TIOCPKT_FLUSHREAD 1 +#define TIOCPKT_FLUSHWRITE 2 +#define TIOCPKT_STOP 4 +#define TIOCPKT_START 8 +#define TIOCPKT_NOSTOP 16 +#define TIOCPKT_DOSTOP 32 + +#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ + #endif diff --git a/include/asm-x86/ioctls_32.h b/include/asm-x86/ioctls_32.h deleted file mode 100644 index ef5878762dc9..000000000000 --- a/include/asm-x86/ioctls_32.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef __ARCH_I386_IOCTLS_H__ -#define __ARCH_I386_IOCTLS_H__ - -#include - -/* 0x54 is just a magic number to make these relatively unique ('T') */ - -#define TCGETS 0x5401 -#define TCSETS 0x5402 /* Clashes with SNDCTL_TMR_START sound ioctl */ -#define TCSETSW 0x5403 -#define TCSETSF 0x5404 -#define TCGETA 0x5405 -#define TCSETA 0x5406 -#define TCSETAW 0x5407 -#define TCSETAF 0x5408 -#define TCSBRK 0x5409 -#define TCXONC 0x540A -#define TCFLSH 0x540B -#define TIOCEXCL 0x540C -#define TIOCNXCL 0x540D -#define TIOCSCTTY 0x540E -#define TIOCGPGRP 0x540F -#define TIOCSPGRP 0x5410 -#define TIOCOUTQ 0x5411 -#define TIOCSTI 0x5412 -#define TIOCGWINSZ 0x5413 -#define TIOCSWINSZ 0x5414 -#define TIOCMGET 0x5415 -#define TIOCMBIS 0x5416 -#define TIOCMBIC 0x5417 -#define TIOCMSET 0x5418 -#define TIOCGSOFTCAR 0x5419 -#define TIOCSSOFTCAR 0x541A -#define FIONREAD 0x541B -#define TIOCINQ FIONREAD -#define TIOCLINUX 0x541C -#define TIOCCONS 0x541D -#define TIOCGSERIAL 0x541E -#define TIOCSSERIAL 0x541F -#define TIOCPKT 0x5420 -#define FIONBIO 0x5421 -#define TIOCNOTTY 0x5422 -#define TIOCSETD 0x5423 -#define TIOCGETD 0x5424 -#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ -/* #define TIOCTTYGSTRUCT 0x5426 - Former debugging-only ioctl */ -#define TIOCSBRK 0x5427 /* BSD compatibility */ -#define TIOCCBRK 0x5428 /* BSD compatibility */ -#define TIOCGSID 0x5429 /* Return the session ID of FD */ -#define TCGETS2 _IOR('T',0x2A, struct termios2) -#define TCSETS2 _IOW('T',0x2B, struct termios2) -#define TCSETSW2 _IOW('T',0x2C, struct termios2) -#define TCSETSF2 _IOW('T',0x2D, struct termios2) -#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ -#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ - -#define FIONCLEX 0x5450 -#define FIOCLEX 0x5451 -#define FIOASYNC 0x5452 -#define TIOCSERCONFIG 0x5453 -#define TIOCSERGWILD 0x5454 -#define TIOCSERSWILD 0x5455 -#define TIOCGLCKTRMIOS 0x5456 -#define TIOCSLCKTRMIOS 0x5457 -#define TIOCSERGSTRUCT 0x5458 /* For debugging only */ -#define TIOCSERGETLSR 0x5459 /* Get line status register */ -#define TIOCSERGETMULTI 0x545A /* Get multiport config */ -#define TIOCSERSETMULTI 0x545B /* Set multiport config */ - -#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ -#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ -#define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */ -#define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */ -#define FIOQSIZE 0x5460 - -/* Used for packet mode */ -#define TIOCPKT_DATA 0 -#define TIOCPKT_FLUSHREAD 1 -#define TIOCPKT_FLUSHWRITE 2 -#define TIOCPKT_STOP 4 -#define TIOCPKT_START 8 -#define TIOCPKT_NOSTOP 16 -#define TIOCPKT_DOSTOP 32 - -#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ - -#endif diff --git a/include/asm-x86/ioctls_64.h b/include/asm-x86/ioctls_64.h deleted file mode 100644 index 3fc0b15a0d7e..000000000000 --- a/include/asm-x86/ioctls_64.h +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef __ARCH_X8664_IOCTLS_H__ -#define __ARCH_X8664_IOCTLS_H__ - -#include - -/* 0x54 is just a magic number to make these relatively unique ('T') */ - -#define TCGETS 0x5401 -#define TCSETS 0x5402 -#define TCSETSW 0x5403 -#define TCSETSF 0x5404 -#define TCGETA 0x5405 -#define TCSETA 0x5406 -#define TCSETAW 0x5407 -#define TCSETAF 0x5408 -#define TCSBRK 0x5409 -#define TCXONC 0x540A -#define TCFLSH 0x540B -#define TIOCEXCL 0x540C -#define TIOCNXCL 0x540D -#define TIOCSCTTY 0x540E -#define TIOCGPGRP 0x540F -#define TIOCSPGRP 0x5410 -#define TIOCOUTQ 0x5411 -#define TIOCSTI 0x5412 -#define TIOCGWINSZ 0x5413 -#define TIOCSWINSZ 0x5414 -#define TIOCMGET 0x5415 -#define TIOCMBIS 0x5416 -#define TIOCMBIC 0x5417 -#define TIOCMSET 0x5418 -#define TIOCGSOFTCAR 0x5419 -#define TIOCSSOFTCAR 0x541A -#define FIONREAD 0x541B -#define TIOCINQ FIONREAD -#define TIOCLINUX 0x541C -#define TIOCCONS 0x541D -#define TIOCGSERIAL 0x541E -#define TIOCSSERIAL 0x541F -#define TIOCPKT 0x5420 -#define FIONBIO 0x5421 -#define TIOCNOTTY 0x5422 -#define TIOCSETD 0x5423 -#define TIOCGETD 0x5424 -#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ -#define TIOCSBRK 0x5427 /* BSD compatibility */ -#define TIOCCBRK 0x5428 /* BSD compatibility */ -#define TIOCGSID 0x5429 /* Return the session ID of FD */ -#define TCGETS2 _IOR('T',0x2A, struct termios2) -#define TCSETS2 _IOW('T',0x2B, struct termios2) -#define TCSETSW2 _IOW('T',0x2C, struct termios2) -#define TCSETSF2 _IOW('T',0x2D, struct termios2) -#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ -#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ - -#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ -#define FIOCLEX 0x5451 -#define FIOASYNC 0x5452 -#define TIOCSERCONFIG 0x5453 -#define TIOCSERGWILD 0x5454 -#define TIOCSERSWILD 0x5455 -#define TIOCGLCKTRMIOS 0x5456 -#define TIOCSLCKTRMIOS 0x5457 -#define TIOCSERGSTRUCT 0x5458 /* For debugging only */ -#define TIOCSERGETLSR 0x5459 /* Get line status register */ -#define TIOCSERGETMULTI 0x545A /* Get multiport config */ -#define TIOCSERSETMULTI 0x545B /* Set multiport config */ - -#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ -#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ -#define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */ -#define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */ -#define FIOQSIZE 0x5460 - -/* Used for packet mode */ -#define TIOCPKT_DATA 0 -#define TIOCPKT_FLUSHREAD 1 -#define TIOCPKT_FLUSHWRITE 2 -#define TIOCPKT_STOP 4 -#define TIOCPKT_START 8 -#define TIOCPKT_NOSTOP 16 -#define TIOCPKT_DOSTOP 32 - -#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ - -#endif -- cgit v1.2.3 From 35cc46119d256364f179d7b3554f06ba468af3f7 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:20 +0200 Subject: x86: unify include/asm/kdebug_32/64.h The 64 bit variant has additional function prototypes which do no harm for 32 bit. Signed-off-by: Thomas Gleixner --- include/asm-x86/kdebug.h | 36 ++++++++++++++++++++++++++++++++---- include/asm-x86/kdebug_32.h | 27 --------------------------- include/asm-x86/kdebug_64.h | 32 -------------------------------- 3 files changed, 32 insertions(+), 63 deletions(-) delete mode 100644 include/asm-x86/kdebug_32.h delete mode 100644 include/asm-x86/kdebug_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/kdebug.h b/include/asm-x86/kdebug.h index 38479106c259..e2f9b62e535e 100644 --- a/include/asm-x86/kdebug.h +++ b/include/asm-x86/kdebug.h @@ -1,5 +1,33 @@ -#ifdef CONFIG_X86_32 -# include "kdebug_32.h" -#else -# include "kdebug_64.h" +#ifndef _ASM_X86_KDEBUG_H +#define _ASM_X86_KDEBUG_H + +#include + +struct pt_regs; + +/* Grossly misnamed. */ +enum die_val { + DIE_OOPS = 1, + DIE_INT3, + DIE_DEBUG, + DIE_PANIC, + DIE_NMI, + DIE_DIE, + DIE_NMIWATCHDOG, + DIE_KERNELDEBUG, + DIE_TRAP, + DIE_GPF, + DIE_CALL, + DIE_NMI_IPI, + DIE_PAGE_FAULT, +}; + +extern void printk_address(unsigned long address); +extern void die(const char *,struct pt_regs *,long); +extern void __die(const char *,struct pt_regs *,long); +extern void show_registers(struct pt_regs *regs); +extern void dump_pagetable(unsigned long); +extern unsigned long oops_begin(void); +extern void oops_end(unsigned long); + #endif diff --git a/include/asm-x86/kdebug_32.h b/include/asm-x86/kdebug_32.h deleted file mode 100644 index 181d437eef4b..000000000000 --- a/include/asm-x86/kdebug_32.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef _I386_KDEBUG_H -#define _I386_KDEBUG_H 1 - -/* - * Aug-05 2004 Ported by Prasanna S Panchamukhi - * from x86_64 architecture. - */ - -struct pt_regs; - -/* Grossly misnamed. */ -enum die_val { - DIE_OOPS = 1, - DIE_INT3, - DIE_DEBUG, - DIE_PANIC, - DIE_NMI, - DIE_DIE, - DIE_NMIWATCHDOG, - DIE_KERNELDEBUG, - DIE_TRAP, - DIE_GPF, - DIE_CALL, - DIE_NMI_IPI, -}; - -#endif diff --git a/include/asm-x86/kdebug_64.h b/include/asm-x86/kdebug_64.h deleted file mode 100644 index df413e05375e..000000000000 --- a/include/asm-x86/kdebug_64.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef _X86_64_KDEBUG_H -#define _X86_64_KDEBUG_H 1 - -#include - -struct pt_regs; - -/* Grossly misnamed. */ -enum die_val { - DIE_OOPS = 1, - DIE_INT3, - DIE_DEBUG, - DIE_PANIC, - DIE_NMI, - DIE_DIE, - DIE_NMIWATCHDOG, - DIE_KERNELDEBUG, - DIE_TRAP, - DIE_GPF, - DIE_CALL, - DIE_NMI_IPI, -}; - -extern void printk_address(unsigned long address); -extern void die(const char *,struct pt_regs *,long); -extern void __die(const char *,struct pt_regs *,long); -extern void show_registers(struct pt_regs *regs); -extern void dump_pagetable(unsigned long); -extern unsigned long oops_begin(void); -extern void oops_end(unsigned long); - -#endif -- cgit v1.2.3 From c4ac82a8818c6decd0fa57cdb55d4225f43d923a Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:20 +0200 Subject: x86: unify include/asm/agp_32/64.h The 32bit D(n) debug addon can be made exclusive for 32 bit compiles. Otherwise all the same. Signed-off-by: Thomas Gleixner --- include/asm-x86/kmap_types.h | 30 +++++++++++++++++++++++++++--- include/asm-x86/kmap_types_32.h | 30 ------------------------------ include/asm-x86/kmap_types_64.h | 19 ------------------- 3 files changed, 27 insertions(+), 52 deletions(-) delete mode 100644 include/asm-x86/kmap_types_32.h delete mode 100644 include/asm-x86/kmap_types_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/kmap_types.h b/include/asm-x86/kmap_types.h index e4ec724b298e..5f4174132a22 100644 --- a/include/asm-x86/kmap_types.h +++ b/include/asm-x86/kmap_types.h @@ -1,5 +1,29 @@ -#ifdef CONFIG_X86_32 -# include "kmap_types_32.h" +#ifndef _ASM_X86_KMAP_TYPES_H +#define _ASM_X86_KMAP_TYPES_H + +#if defined(CONFIG_X86_32) && defined(CONFIG_DEBUG_HIGHMEM) +# define D(n) __KM_FENCE_##n , #else -# include "kmap_types_64.h" +# define D(n) +#endif + +enum km_type { +D(0) KM_BOUNCE_READ, +D(1) KM_SKB_SUNRPC_DATA, +D(2) KM_SKB_DATA_SOFTIRQ, +D(3) KM_USER0, +D(4) KM_USER1, +D(5) KM_BIO_SRC_IRQ, +D(6) KM_BIO_DST_IRQ, +D(7) KM_PTE0, +D(8) KM_PTE1, +D(9) KM_IRQ0, +D(10) KM_IRQ1, +D(11) KM_SOFTIRQ0, +D(12) KM_SOFTIRQ1, +D(13) KM_TYPE_NR +}; + +#undef D + #endif diff --git a/include/asm-x86/kmap_types_32.h b/include/asm-x86/kmap_types_32.h deleted file mode 100644 index 806aae3c5338..000000000000 --- a/include/asm-x86/kmap_types_32.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef _ASM_KMAP_TYPES_H -#define _ASM_KMAP_TYPES_H - - -#ifdef CONFIG_DEBUG_HIGHMEM -# define D(n) __KM_FENCE_##n , -#else -# define D(n) -#endif - -enum km_type { -D(0) KM_BOUNCE_READ, -D(1) KM_SKB_SUNRPC_DATA, -D(2) KM_SKB_DATA_SOFTIRQ, -D(3) KM_USER0, -D(4) KM_USER1, -D(5) KM_BIO_SRC_IRQ, -D(6) KM_BIO_DST_IRQ, -D(7) KM_PTE0, -D(8) KM_PTE1, -D(9) KM_IRQ0, -D(10) KM_IRQ1, -D(11) KM_SOFTIRQ0, -D(12) KM_SOFTIRQ1, -D(13) KM_TYPE_NR -}; - -#undef D - -#endif diff --git a/include/asm-x86/kmap_types_64.h b/include/asm-x86/kmap_types_64.h deleted file mode 100644 index 7486338c6cea..000000000000 --- a/include/asm-x86/kmap_types_64.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _ASM_KMAP_TYPES_H -#define _ASM_KMAP_TYPES_H - -enum km_type { - KM_BOUNCE_READ, - KM_SKB_SUNRPC_DATA, - KM_SKB_DATA_SOFTIRQ, - KM_USER0, - KM_USER1, - KM_BIO_SRC_IRQ, - KM_BIO_DST_IRQ, - KM_IRQ0, - KM_IRQ1, - KM_SOFTIRQ0, - KM_SOFTIRQ1, - KM_TYPE_NR -}; - -#endif -- cgit v1.2.3 From 5c8eec501968cf9b608bba22748d7ca1a91dadf1 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:21 +0200 Subject: x86: unify include/asm/mman_32/64.h Same file, except for the extra 64bit MAP_32BIT define, which does not hurt for 32 bit compiles. Signed-off-by: Thomas Gleixner --- include/asm-x86/Kbuild | 2 -- include/asm-x86/mman.h | 32 +++++++++++++++++++------------- include/asm-x86/mman_32.h | 17 ----------------- include/asm-x86/mman_64.h | 19 ------------------- 4 files changed, 19 insertions(+), 51 deletions(-) delete mode 100644 include/asm-x86/mman_32.h delete mode 100644 include/asm-x86/mman_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild index a617f752ea6e..966a1176a7ce 100644 --- a/include/asm-x86/Kbuild +++ b/include/asm-x86/Kbuild @@ -19,8 +19,6 @@ unifdef-y += byteorder_64.h unifdef-y += elf_32.h unifdef-y += elf_64.h unifdef-y += mce.h -unifdef-y += mman_32.h -unifdef-y += mman_64.h unifdef-y += msgbuf_32.h unifdef-y += msgbuf_64.h unifdef-y += msr_32.h diff --git a/include/asm-x86/mman.h b/include/asm-x86/mman.h index 322db07e82c3..c1682b542daf 100644 --- a/include/asm-x86/mman.h +++ b/include/asm-x86/mman.h @@ -1,13 +1,19 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "mman_32.h" -# else -# include "mman_64.h" -# endif -#else -# ifdef __i386__ -# include "mman_32.h" -# else -# include "mman_64.h" -# endif -#endif +#ifndef _ASM_X86_MMAN_H +#define _ASM_X86_MMAN_H + +#include + +#define MAP_32BIT 0x40 /* only give out 32bit addresses */ + +#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ +#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ +#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ +#define MAP_LOCKED 0x2000 /* pages are locked */ +#define MAP_NORESERVE 0x4000 /* don't check for reservations */ +#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ +#define MAP_NONBLOCK 0x10000 /* do not block on IO */ + +#define MCL_CURRENT 1 /* lock all current mappings */ +#define MCL_FUTURE 2 /* lock all future mappings */ + +#endif /* _ASM_X86_MMAN_H */ diff --git a/include/asm-x86/mman_32.h b/include/asm-x86/mman_32.h deleted file mode 100644 index 8fd9d7ab7faf..000000000000 --- a/include/asm-x86/mman_32.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef __I386_MMAN_H__ -#define __I386_MMAN_H__ - -#include - -#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ -#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ -#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ -#define MAP_LOCKED 0x2000 /* pages are locked */ -#define MAP_NORESERVE 0x4000 /* don't check for reservations */ -#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ -#define MAP_NONBLOCK 0x10000 /* do not block on IO */ - -#define MCL_CURRENT 1 /* lock all current mappings */ -#define MCL_FUTURE 2 /* lock all future mappings */ - -#endif /* __I386_MMAN_H__ */ diff --git a/include/asm-x86/mman_64.h b/include/asm-x86/mman_64.h deleted file mode 100644 index dd5cb0534d37..000000000000 --- a/include/asm-x86/mman_64.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __X8664_MMAN_H__ -#define __X8664_MMAN_H__ - -#include - -#define MAP_32BIT 0x40 /* only give out 32bit addresses */ - -#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ -#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ -#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ -#define MAP_LOCKED 0x2000 /* pages are locked */ -#define MAP_NORESERVE 0x4000 /* don't check for reservations */ -#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ -#define MAP_NONBLOCK 0x10000 /* do not block on IO */ - -#define MCL_CURRENT 1 /* lock all current mappings */ -#define MCL_FUTURE 2 /* lock all future mappings */ - -#endif -- cgit v1.2.3 From 68fdc55c48fd2e8f4938a1e815216c25baf8a17e Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 17 Oct 2007 17:19:30 +0200 Subject: x86: unify include/asm/bug_32/64.h Same file, except for whitespace, comment formatting and the .long/.quad delta which can be solved by a define. Signed-off-by: Thomas Gleixner --- include/asm-x86/bug.h | 41 +++++++++++++++++++++++++++++++++++++++-- include/asm-x86/bug_32.h | 37 ------------------------------------- include/asm-x86/bug_64.h | 34 ---------------------------------- 3 files changed, 39 insertions(+), 73 deletions(-) delete mode 100644 include/asm-x86/bug_32.h delete mode 100644 include/asm-x86/bug_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/bug.h b/include/asm-x86/bug.h index c655d7f3a5e0..fd8bdc639c48 100644 --- a/include/asm-x86/bug.h +++ b/include/asm-x86/bug.h @@ -1,5 +1,42 @@ +#ifndef _ASM_X86_BUG_H +#define _ASM_X86_BUG_H + +#ifdef CONFIG_BUG +#define HAVE_ARCH_BUG + +#ifdef CONFIG_DEBUG_BUGVERBOSE + #ifdef CONFIG_X86_32 -# include "bug_32.h" +# define __BUG_C0 "2:\t.long 1b, %c0\n" #else -# include "bug_64.h" +# define __BUG_C0 "2:\t.quad 1b, %c0\n" +#endif + +#define BUG() \ + do { \ + asm volatile("1:\tud2\n" \ + ".pushsection __bug_table,\"a\"\n" \ + __BUG_C0 \ + "\t.word %c1, 0\n" \ + "\t.org 2b+%c2\n" \ + ".popsection" \ + : : "i" (__FILE__), "i" (__LINE__), \ + "i" (sizeof(struct bug_entry))); \ + for(;;) ; \ + } while(0) + +#else +#define BUG() \ + do { \ + asm volatile("ud2"); \ + for(;;) ; \ + } while(0) +#endif + +void out_of_line_bug(void); +#else /* CONFIG_BUG */ +static inline void out_of_line_bug(void) { } +#endif /* !CONFIG_BUG */ + +#include #endif diff --git a/include/asm-x86/bug_32.h b/include/asm-x86/bug_32.h deleted file mode 100644 index b0fd78ca2619..000000000000 --- a/include/asm-x86/bug_32.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _I386_BUG_H -#define _I386_BUG_H - - -/* - * Tell the user there is some problem. - * The offending file and line are encoded encoded in the __bug_table section. - */ - -#ifdef CONFIG_BUG -#define HAVE_ARCH_BUG - -#ifdef CONFIG_DEBUG_BUGVERBOSE -#define BUG() \ - do { \ - asm volatile("1:\tud2\n" \ - ".pushsection __bug_table,\"a\"\n" \ - "2:\t.long 1b, %c0\n" \ - "\t.word %c1, 0\n" \ - "\t.org 2b+%c2\n" \ - ".popsection" \ - : : "i" (__FILE__), "i" (__LINE__), \ - "i" (sizeof(struct bug_entry))); \ - for(;;) ; \ - } while(0) - -#else -#define BUG() \ - do { \ - asm volatile("ud2"); \ - for(;;) ; \ - } while(0) -#endif -#endif - -#include -#endif diff --git a/include/asm-x86/bug_64.h b/include/asm-x86/bug_64.h deleted file mode 100644 index 682606414913..000000000000 --- a/include/asm-x86/bug_64.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef __ASM_X8664_BUG_H -#define __ASM_X8664_BUG_H 1 - -#ifdef CONFIG_BUG -#define HAVE_ARCH_BUG - -#ifdef CONFIG_DEBUG_BUGVERBOSE -#define BUG() \ - do { \ - asm volatile("1:\tud2\n" \ - ".pushsection __bug_table,\"a\"\n" \ - "2:\t.quad 1b, %c0\n" \ - "\t.word %c1, 0\n" \ - "\t.org 2b+%c2\n" \ - ".popsection" \ - : : "i" (__FILE__), "i" (__LINE__), \ - "i" (sizeof(struct bug_entry))); \ - for(;;) ; \ - } while(0) -#else -#define BUG() \ - do { \ - asm volatile("ud2"); \ - for(;;) ; \ - } while(0) -#endif - -void out_of_line_bug(void); -#else -static inline void out_of_line_bug(void) { } -#endif - -#include -#endif -- cgit v1.2.3 From f16ee288545be36cdcc404e9b7c505eb0fe2633c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:21 +0200 Subject: x86: unify include/asm/siginfo_32/64.h Same file, except for the 64bit PREAMBLE_SIZE define. Signed-off-by: Thomas Gleixner --- include/asm-x86/Kbuild | 2 -- include/asm-x86/siginfo.h | 21 +++++++++------------ include/asm-x86/siginfo_32.h | 6 ------ include/asm-x86/siginfo_64.h | 8 -------- 4 files changed, 9 insertions(+), 28 deletions(-) delete mode 100644 include/asm-x86/siginfo_32.h delete mode 100644 include/asm-x86/siginfo_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild index 966a1176a7ce..3decf180107d 100644 --- a/include/asm-x86/Kbuild +++ b/include/asm-x86/Kbuild @@ -39,8 +39,6 @@ unifdef-y += shmbuf_32.h unifdef-y += shmbuf_64.h unifdef-y += sigcontext_32.h unifdef-y += sigcontext_64.h -unifdef-y += siginfo_32.h -unifdef-y += siginfo_64.h unifdef-y += signal_32.h unifdef-y += signal_64.h unifdef-y += stat_32.h diff --git a/include/asm-x86/siginfo.h b/include/asm-x86/siginfo.h index 0b8e4bb47d25..a477bea0c2a1 100644 --- a/include/asm-x86/siginfo.h +++ b/include/asm-x86/siginfo.h @@ -1,13 +1,10 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "siginfo_32.h" -# else -# include "siginfo_64.h" -# endif -#else -# ifdef __i386__ -# include "siginfo_32.h" -# else -# include "siginfo_64.h" -# endif +#ifndef _ASM_X86_SIGINFO_H +#define _ASM_X86_SIGINFO_H + +#ifdef __x86_64__ +# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) +#endif + +#include + #endif diff --git a/include/asm-x86/siginfo_32.h b/include/asm-x86/siginfo_32.h deleted file mode 100644 index fe18f98fccfa..000000000000 --- a/include/asm-x86/siginfo_32.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _I386_SIGINFO_H -#define _I386_SIGINFO_H - -#include - -#endif diff --git a/include/asm-x86/siginfo_64.h b/include/asm-x86/siginfo_64.h deleted file mode 100644 index d09a1e6e7246..000000000000 --- a/include/asm-x86/siginfo_64.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _X8664_SIGINFO_H -#define _X8664_SIGINFO_H - -#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) - -#include - -#endif -- cgit v1.2.3 From 01749f6d6d0aa677081d13a2685bad028b778c22 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:21 +0200 Subject: x86: unify include/asm/tlb_32/64.h Same file, except for whitespace, comment formatting. Signed-off-by: Thomas Gleixner --- include/asm-x86/tlb.h | 14 ++++++++++---- include/asm-x86/tlb_32.h | 20 -------------------- include/asm-x86/tlb_64.h | 13 ------------- 3 files changed, 10 insertions(+), 37 deletions(-) delete mode 100644 include/asm-x86/tlb_32.h delete mode 100644 include/asm-x86/tlb_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/tlb.h b/include/asm-x86/tlb.h index 7d55c3762b43..e4e9e2d07a93 100644 --- a/include/asm-x86/tlb.h +++ b/include/asm-x86/tlb.h @@ -1,5 +1,11 @@ -#ifdef CONFIG_X86_32 -# include "tlb_32.h" -#else -# include "tlb_64.h" +#ifndef _ASM_X86_TLB_H +#define _ASM_X86_TLB_H + +#define tlb_start_vma(tlb, vma) do { } while (0) +#define tlb_end_vma(tlb, vma) do { } while (0) +#define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0) +#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm) + +#include + #endif diff --git a/include/asm-x86/tlb_32.h b/include/asm-x86/tlb_32.h deleted file mode 100644 index c006c5c92bea..000000000000 --- a/include/asm-x86/tlb_32.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _I386_TLB_H -#define _I386_TLB_H - -/* - * x86 doesn't need any special per-pte or - * per-vma handling.. - */ -#define tlb_start_vma(tlb, vma) do { } while (0) -#define tlb_end_vma(tlb, vma) do { } while (0) -#define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0) - -/* - * .. because we flush the whole mm when it - * fills up. - */ -#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm) - -#include - -#endif diff --git a/include/asm-x86/tlb_64.h b/include/asm-x86/tlb_64.h deleted file mode 100644 index cd4c3c590a0e..000000000000 --- a/include/asm-x86/tlb_64.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef TLB_H -#define TLB_H 1 - - -#define tlb_start_vma(tlb, vma) do { } while (0) -#define tlb_end_vma(tlb, vma) do { } while (0) -#define __tlb_remove_tlb_entry(tlb, ptep, address) do { } while (0) - -#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm) - -#include - -#endif -- cgit v1.2.3 From 9d256ff51c174d8b157d99db038a1045f37a17c8 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 17 Oct 2007 20:32:07 +0200 Subject: x86: unify include/asm/types_32/64.h Mostly the same. Make the few exceptions conditional. Signed-off-by: Thomas Gleixner Conflicts: include/asm-x86/types_32.h --- include/asm-x86/Kbuild | 2 -- include/asm-x86/types.h | 77 ++++++++++++++++++++++++++++++++++++++++------ include/asm-x86/types_32.h | 64 -------------------------------------- include/asm-x86/types_64.h | 55 --------------------------------- 4 files changed, 67 insertions(+), 131 deletions(-) delete mode 100644 include/asm-x86/types_32.h delete mode 100644 include/asm-x86/types_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild index 3decf180107d..24bbde8c1b72 100644 --- a/include/asm-x86/Kbuild +++ b/include/asm-x86/Kbuild @@ -45,8 +45,6 @@ unifdef-y += stat_32.h unifdef-y += stat_64.h unifdef-y += statfs_32.h unifdef-y += statfs_64.h -unifdef-y += types_32.h -unifdef-y += types_64.h unifdef-y += unistd_32.h unifdef-y += unistd_64.h unifdef-y += user_32.h diff --git a/include/asm-x86/types.h b/include/asm-x86/types.h index a777a9b83974..63733f315688 100644 --- a/include/asm-x86/types.h +++ b/include/asm-x86/types.h @@ -1,13 +1,70 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "types_32.h" -# else -# include "types_64.h" +#ifndef _ASM_X86_TYPES_H +#define _ASM_X86_TYPES_H + +#ifndef __ASSEMBLY__ + +typedef unsigned short umode_t; + +/* + * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the + * header files exported to user space + */ + +typedef __signed__ char __s8; +typedef unsigned char __u8; + +typedef __signed__ short __s16; +typedef unsigned short __u16; + +typedef __signed__ int __s32; +typedef unsigned int __u32; + +#ifdef __i386__ +# ifdef __GNUC__ +__extension__ typedef __signed__ long long __s64; +__extension__ typedef unsigned long long __u64; # endif #else -# ifdef __i386__ -# include "types_32.h" -# else -# include "types_64.h" -# endif +typedef __signed__ long long __s64; +typedef unsigned long long __u64; +#endif + +#endif /* __ASSEMBLY__ */ + +/* + * These aren't exported outside the kernel to avoid name space clashes + */ +#ifdef __KERNEL__ + +#ifdef CONFIG_X86_32 +# define BITS_PER_LONG 32 +#else +# define BITS_PER_LONG 64 +#endif + +#ifndef __ASSEMBLY__ + +typedef signed char s8; +typedef unsigned char u8; + +typedef signed short s16; +typedef unsigned short u16; + +typedef signed int s32; +typedef unsigned int u32; + +typedef signed long long s64; +typedef unsigned long long u64; + +typedef u64 dma64_addr_t; +#if defined(CONFIG_X86_64) || defined(CONFIG_HIGHMEM64G) +/* DMA addresses come in 32-bit and 64-bit flavours. */ +typedef u64 dma_addr_t; +#else +typedef u32 dma_addr_t; +#endif + +#endif /* __ASSEMBLY__ */ +#endif /* __KERNEL__ */ + #endif diff --git a/include/asm-x86/types_32.h b/include/asm-x86/types_32.h deleted file mode 100644 index faca1922c4c3..000000000000 --- a/include/asm-x86/types_32.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef _I386_TYPES_H -#define _I386_TYPES_H - -#ifndef __ASSEMBLY__ - -typedef unsigned short umode_t; - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -#if defined(__GNUC__) -__extension__ typedef __signed__ long long __s64; -__extension__ typedef unsigned long long __u64; -#endif - -#endif /* __ASSEMBLY__ */ - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -#define BITS_PER_LONG 32 - -#ifndef __ASSEMBLY__ - - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -/* DMA addresses come in generic and 64-bit flavours. */ - -#ifdef CONFIG_HIGHMEM64G -typedef u64 dma_addr_t; -#else -typedef u32 dma_addr_t; -#endif -typedef u64 dma64_addr_t; - -#endif /* __ASSEMBLY__ */ - -#endif /* __KERNEL__ */ - -#endif diff --git a/include/asm-x86/types_64.h b/include/asm-x86/types_64.h deleted file mode 100644 index 2d4491aae281..000000000000 --- a/include/asm-x86/types_64.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef _X86_64_TYPES_H -#define _X86_64_TYPES_H - -#ifndef __ASSEMBLY__ - -typedef unsigned short umode_t; - -/* - * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the - * header files exported to user space - */ - -typedef __signed__ char __s8; -typedef unsigned char __u8; - -typedef __signed__ short __s16; -typedef unsigned short __u16; - -typedef __signed__ int __s32; -typedef unsigned int __u32; - -typedef __signed__ long long __s64; -typedef unsigned long long __u64; - -#endif /* __ASSEMBLY__ */ - -/* - * These aren't exported outside the kernel to avoid name space clashes - */ -#ifdef __KERNEL__ - -#define BITS_PER_LONG 64 - -#ifndef __ASSEMBLY__ - -typedef signed char s8; -typedef unsigned char u8; - -typedef signed short s16; -typedef unsigned short u16; - -typedef signed int s32; -typedef unsigned int u32; - -typedef signed long long s64; -typedef unsigned long long u64; - -typedef u64 dma64_addr_t; -typedef u64 dma_addr_t; - -#endif /* __ASSEMBLY__ */ - -#endif /* __KERNEL__ */ - -#endif -- cgit v1.2.3 From 3f0bde835364fd503ac836ebb7d6cac7352a1f30 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 15 Oct 2007 23:28:21 +0200 Subject: x86: unify include/asm/unwind_32/64.h 32bit has an extra UNW_FP define, which does not hurt. Signed-off-by: Thomas Gleixner --- include/asm-x86/unwind.h | 18 +++++++++++++----- include/asm-x86/unwind_32.h | 13 ------------- include/asm-x86/unwind_64.h | 12 ------------ 3 files changed, 13 insertions(+), 30 deletions(-) delete mode 100644 include/asm-x86/unwind_32.h delete mode 100644 include/asm-x86/unwind_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/unwind.h b/include/asm-x86/unwind.h index 7e4d7ad55208..8b064bd9c553 100644 --- a/include/asm-x86/unwind.h +++ b/include/asm-x86/unwind.h @@ -1,5 +1,13 @@ -#ifdef CONFIG_X86_32 -# include "unwind_32.h" -#else -# include "unwind_64.h" -#endif +#ifndef _ASM_X86_UNWIND_H +#define _ASM_X86_UNWIND_H + +#define UNW_PC(frame) ((void)(frame), 0UL) +#define UNW_SP(frame) ((void)(frame), 0UL) +#define UNW_FP(frame) ((void)(frame), 0UL) + +static inline int arch_unw_user_mode(const void *info) +{ + return 0; +} + +#endif /* _ASM_X86_UNWIND_H */ diff --git a/include/asm-x86/unwind_32.h b/include/asm-x86/unwind_32.h deleted file mode 100644 index 43c70c3de2f9..000000000000 --- a/include/asm-x86/unwind_32.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _ASM_I386_UNWIND_H -#define _ASM_I386_UNWIND_H - -#define UNW_PC(frame) ((void)(frame), 0) -#define UNW_SP(frame) ((void)(frame), 0) -#define UNW_FP(frame) ((void)(frame), 0) - -static inline int arch_unw_user_mode(const void *info) -{ - return 0; -} - -#endif /* _ASM_I386_UNWIND_H */ diff --git a/include/asm-x86/unwind_64.h b/include/asm-x86/unwind_64.h deleted file mode 100644 index 02710f6a4560..000000000000 --- a/include/asm-x86/unwind_64.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _ASM_X86_64_UNWIND_H -#define _ASM_X86_64_UNWIND_H - -#define UNW_PC(frame) ((void)(frame), 0UL) -#define UNW_SP(frame) ((void)(frame), 0UL) - -static inline int arch_unw_user_mode(const void *info) -{ - return 0; -} - -#endif /* _ASM_X86_64_UNWIND_H */ -- cgit v1.2.3 From 21ebddd3efd3aff961153f1bac4793218dfaea9c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 17 Oct 2007 20:35:37 +0200 Subject: x86: unify include/asm/debugreg_32/64.h Almost identical except for the extra DR_LEN_8 and the different DR_CONTROL_RESERVED defines. Signed-off-by: Thomas Gleixner Conflicts: include/asm-x86/Kbuild --- include/asm-x86/Kbuild | 2 -- include/asm-x86/debugreg.h | 79 +++++++++++++++++++++++++++++++++++++------ include/asm-x86/debugreg_32.h | 64 ----------------------------------- include/asm-x86/debugreg_64.h | 65 ----------------------------------- 4 files changed, 68 insertions(+), 142 deletions(-) delete mode 100644 include/asm-x86/debugreg_32.h delete mode 100644 include/asm-x86/debugreg_64.h (limited to 'include/asm-x86') diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild index 24bbde8c1b72..559830ece755 100644 --- a/include/asm-x86/Kbuild +++ b/include/asm-x86/Kbuild @@ -1,8 +1,6 @@ include include/asm-generic/Kbuild.asm header-y += boot.h -header-y += debugreg_32.h -header-y += debugreg_64.h header-y += debugreg.h header-y += ldt.h header-y += msr-index.h diff --git a/include/asm-x86/debugreg.h b/include/asm-x86/debugreg.h index b6ce7e4fa002..c6344d572b03 100644 --- a/include/asm-x86/debugreg.h +++ b/include/asm-x86/debugreg.h @@ -1,13 +1,70 @@ -#ifdef __KERNEL__ -# ifdef CONFIG_X86_32 -# include "debugreg_32.h" -# else -# include "debugreg_64.h" -# endif +#ifndef _ASM_X86_DEBUGREG_H +#define _ASM_X86_DEBUGREG_H + + +/* Indicate the register numbers for a number of the specific + debug registers. Registers 0-3 contain the addresses we wish to trap on */ +#define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */ +#define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */ + +#define DR_STATUS 6 /* u_debugreg[DR_STATUS] */ +#define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */ + +/* Define a few things for the status register. We can use this to determine + which debugging register was responsible for the trap. The other bits + are either reserved or not of interest to us. */ + +#define DR_TRAP0 (0x1) /* db0 */ +#define DR_TRAP1 (0x2) /* db1 */ +#define DR_TRAP2 (0x4) /* db2 */ +#define DR_TRAP3 (0x8) /* db3 */ + +#define DR_STEP (0x4000) /* single-step */ +#define DR_SWITCH (0x8000) /* task switch */ + +/* Now define a bunch of things for manipulating the control register. + The top two bytes of the control register consist of 4 fields of 4 + bits - each field corresponds to one of the four debug registers, + and indicates what types of access we trap on, and how large the data + field is that we are looking at */ + +#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */ +#define DR_CONTROL_SIZE 4 /* 4 control bits per register */ + +#define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */ +#define DR_RW_WRITE (0x1) +#define DR_RW_READ (0x3) + +#define DR_LEN_1 (0x0) /* Settings for data length to trap on */ +#define DR_LEN_2 (0x4) +#define DR_LEN_4 (0xC) +#define DR_LEN_8 (0x8) + +/* The low byte to the control register determine which registers are + enabled. There are 4 fields of two bits. One bit is "local", meaning + that the processor will reset the bit after a task switch and the other + is global meaning that we have to explicitly reset the bit. With linux, + you can use either one, since we explicitly zero the register when we enter + kernel mode. */ + +#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */ +#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */ +#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */ + +#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */ +#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */ + +/* The second byte to the control register has a few special things. + We can slow the instruction pipeline for instructions coming via the + gdt or the ldt if we want to. I am not sure why this is an advantage */ + +#ifdef __i386__ +#define DR_CONTROL_RESERVED (0xFC00) /* Reserved by Intel */ #else -# ifdef __i386__ -# include "debugreg_32.h" -# else -# include "debugreg_64.h" -# endif +#define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL) /* Reserved */ +#endif + +#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */ +#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */ + #endif diff --git a/include/asm-x86/debugreg_32.h b/include/asm-x86/debugreg_32.h deleted file mode 100644 index f0b2b06ae0f7..000000000000 --- a/include/asm-x86/debugreg_32.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef _I386_DEBUGREG_H -#define _I386_DEBUGREG_H - - -/* Indicate the register numbers for a number of the specific - debug registers. Registers 0-3 contain the addresses we wish to trap on */ -#define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */ -#define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */ - -#define DR_STATUS 6 /* u_debugreg[DR_STATUS] */ -#define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */ - -/* Define a few things for the status register. We can use this to determine - which debugging register was responsible for the trap. The other bits - are either reserved or not of interest to us. */ - -#define DR_TRAP0 (0x1) /* db0 */ -#define DR_TRAP1 (0x2) /* db1 */ -#define DR_TRAP2 (0x4) /* db2 */ -#define DR_TRAP3 (0x8) /* db3 */ - -#define DR_STEP (0x4000) /* single-step */ -#define DR_SWITCH (0x8000) /* task switch */ - -/* Now define a bunch of things for manipulating the control register. - The top two bytes of the control register consist of 4 fields of 4 - bits - each field corresponds to one of the four debug registers, - and indicates what types of access we trap on, and how large the data - field is that we are looking at */ - -#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */ -#define DR_CONTROL_SIZE 4 /* 4 control bits per register */ - -#define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */ -#define DR_RW_WRITE (0x1) -#define DR_RW_READ (0x3) - -#define DR_LEN_1 (0x0) /* Settings for data length to trap on */ -#define DR_LEN_2 (0x4) -#define DR_LEN_4 (0xC) - -/* The low byte to the control register determine which registers are - enabled. There are 4 fields of two bits. One bit is "local", meaning - that the processor will reset the bit after a task switch and the other - is global meaning that we have to explicitly reset the bit. With linux, - you can use either one, since we explicitly zero the register when we enter - kernel mode. */ - -#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */ -#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */ -#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */ - -#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */ -#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */ - -/* The second byte to the control register has a few special things. - We can slow the instruction pipeline for instructions coming via the - gdt or the ldt if we want to. I am not sure why this is an advantage */ - -#define DR_CONTROL_RESERVED (0xFC00) /* Reserved by Intel */ -#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */ -#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */ - -#endif diff --git a/include/asm-x86/debugreg_64.h b/include/asm-x86/debugreg_64.h deleted file mode 100644 index bd1aab1d8c4a..000000000000 --- a/include/asm-x86/debugreg_64.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef _X86_64_DEBUGREG_H -#define _X86_64_DEBUGREG_H - - -/* Indicate the register numbers for a number of the specific - debug registers. Registers 0-3 contain the addresses we wish to trap on */ -#define DR_FIRSTADDR 0 /* u_debugreg[DR_FIRSTADDR] */ -#define DR_LASTADDR 3 /* u_debugreg[DR_LASTADDR] */ - -#define DR_STATUS 6 /* u_debugreg[DR_STATUS] */ -#define DR_CONTROL 7 /* u_debugreg[DR_CONTROL] */ - -/* Define a few things for the status register. We can use this to determine - which debugging register was responsible for the trap. The other bits - are either reserved or not of interest to us. */ - -#define DR_TRAP0 (0x1) /* db0 */ -#define DR_TRAP1 (0x2) /* db1 */ -#define DR_TRAP2 (0x4) /* db2 */ -#define DR_TRAP3 (0x8) /* db3 */ - -#define DR_STEP (0x4000) /* single-step */ -#define DR_SWITCH (0x8000) /* task switch */ - -/* Now define a bunch of things for manipulating the control register. - The top two bytes of the control register consist of 4 fields of 4 - bits - each field corresponds to one of the four debug registers, - and indicates what types of access we trap on, and how large the data - field is that we are looking at */ - -#define DR_CONTROL_SHIFT 16 /* Skip this many bits in ctl register */ -#define DR_CONTROL_SIZE 4 /* 4 control bits per register */ - -#define DR_RW_EXECUTE (0x0) /* Settings for the access types to trap on */ -#define DR_RW_WRITE (0x1) -#define DR_RW_READ (0x3) - -#define DR_LEN_1 (0x0) /* Settings for data length to trap on */ -#define DR_LEN_2 (0x4) -#define DR_LEN_4 (0xC) -#define DR_LEN_8 (0x8) - -/* The low byte to the control register determine which registers are - enabled. There are 4 fields of two bits. One bit is "local", meaning - that the processor will reset the bit after a task switch and the other - is global meaning that we have to explicitly reset the bit. With linux, - you can use either one, since we explicitly zero the register when we enter - kernel mode. */ - -#define DR_LOCAL_ENABLE_SHIFT 0 /* Extra shift to the local enable bit */ -#define DR_GLOBAL_ENABLE_SHIFT 1 /* Extra shift to the global enable bit */ -#define DR_ENABLE_SIZE 2 /* 2 enable bits per register */ - -#define DR_LOCAL_ENABLE_MASK (0x55) /* Set local bits for all 4 regs */ -#define DR_GLOBAL_ENABLE_MASK (0xAA) /* Set global bits for all 4 regs */ - -/* The second byte to the control register has a few special things. - We can slow the instruction pipeline for instructions coming via the - gdt or the ldt if we want to. I am not sure why this is an advantage */ - -#define DR_CONTROL_RESERVED (0xFFFFFFFF0000FC00UL) /* Reserved */ -#define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */ -#define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */ - -#endif -- cgit v1.2.3