diff options
| author | Greg Kroah-Hartman <greg@kroah.com> | 2003-05-07 11:10:22 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2003-05-07 11:10:22 -0700 |
| commit | 2f2a2dd085f6abd2a875401a99523a172108f496 (patch) | |
| tree | ef751436a2ce57daf48d4ae8cf44126ba0f66cab /include | |
| parent | 29abb650987802c94d7464d0af20ec5d9f641284 (diff) | |
| parent | c495aaaf4d5dddc7e626e7e305bb7dac5e166b29 (diff) | |
Merge gregkh@kernel.bkbits.net:/home/gregkh/linux/linus-2.5
into kroah.com:/home/linux/linux/BK/gregkh-2.5
Diffstat (limited to 'include')
42 files changed, 502 insertions, 101 deletions
diff --git a/include/asm-i386/apicdef.h b/include/asm-i386/apicdef.h index 485c1d8a8db5..c689554ad5b9 100644 --- a/include/asm-i386/apicdef.h +++ b/include/asm-i386/apicdef.h @@ -11,13 +11,6 @@ #define APIC_DEFAULT_PHYS_BASE 0xfee00000 #define APIC_ID 0x20 -#ifdef CONFIG_X86_SUMMIT - #define APIC_ID_MASK (0xFF<<24) - #define GET_APIC_ID(x) (((x)>>24)&0xFF) -#else - #define APIC_ID_MASK (0x0F<<24) - #define GET_APIC_ID(x) (((x)>>24)&0x0F) -#endif #define APIC_LVR 0x30 #define APIC_LVR_MASK 0xFF00FF #define GET_APIC_VERSION(x) ((x)&0xFF) diff --git a/include/asm-i386/edd.h b/include/asm-i386/edd.h index 061373b28782..66f7246dd13c 100644 --- a/include/asm-i386/edd.h +++ b/include/asm-i386/edd.h @@ -141,7 +141,7 @@ struct edd_device_params { u32 array_number; u32 reserved1; u64 reserved2; - } __attribute((packed)) raid; + } __attribute__ ((packed)) raid; struct { u8 device; u8 reserved1; diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h index 40373cd7a163..6570d0d65e02 100644 --- a/include/asm-i386/fixmap.h +++ b/include/asm-i386/fixmap.h @@ -60,7 +60,7 @@ enum fixed_addresses { #ifdef CONFIG_X86_F00F_BUG FIX_F00F_IDT, /* Virtual mapping for IDT */ #endif -#ifdef CONFIG_X86_SUMMIT +#ifdef CONFIG_X86_CYCLONE_TIMER FIX_CYCLONE_TIMER, /*cyclone timer register*/ #endif #ifdef CONFIG_HIGHMEM diff --git a/include/asm-i386/genapic.h b/include/asm-i386/genapic.h new file mode 100644 index 000000000000..d6d94d5436b0 --- /dev/null +++ b/include/asm-i386/genapic.h @@ -0,0 +1,106 @@ +#ifndef _ASM_GENAPIC_H +#define _ASM_GENAPIC_H 1 + +/* + * Generic APIC driver interface. + * + * An straight forward mapping of the APIC related parts of the + * x86 subarchitecture interface to a dynamic object. + * + * This is used by the "generic" x86 subarchitecture. + * + * Copyright 2003 Andi Kleen, SuSE Labs. + */ + +struct mpc_config_translation; +struct mpc_config_bus; +struct mp_config_table; +struct mpc_config_processor; + +struct genapic { + char *name; + int (*probe)(void); + + int (*apic_id_registered)(void); + unsigned long (*target_cpus)(void); + int int_delivery_mode; + int int_dest_mode; + int apic_broadcast_id; + int esr_disable; + unsigned long (*check_apicid_used)(unsigned long bitmap, int apicid); + unsigned long (*check_apicid_present)(int apicid); + int no_balance_irq; + void (*init_apic_ldr)(void); + unsigned long (*ioapic_phys_id_map)(unsigned long map); + + void (*clustered_apic_check)(void); + int (*multi_timer_check)(int apic, int irq); + int (*apicid_to_node)(int logical_apicid); + int (*cpu_to_logical_apicid)(int cpu); + int (*cpu_present_to_apicid)(int mps_cpu); + unsigned long (*apicid_to_cpu_present)(int phys_apicid); + int (*mpc_apic_id)(struct mpc_config_processor *m, + struct mpc_config_translation *t); + void (*setup_portio_remap)(void); + int (*check_phys_apicid_present)(int boot_cpu_physical_apicid); + + /* mpparse */ + void (*mpc_oem_bus_info)(struct mpc_config_bus *, char *, + struct mpc_config_translation *); + void (*mpc_oem_pci_bus)(struct mpc_config_bus *, + struct mpc_config_translation *); + + /* When one of the next two hooks returns 1 the genapic + is switched to this. Essentially they are additional probe + functions. */ + int (*mps_oem_check)(struct mp_config_table *mpc, char *oem, + char *productid); + int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id); + + unsigned (*get_apic_id)(unsigned long x); + unsigned long apic_id_mask; + + /* ipi */ + void (*send_IPI_mask)(int mask, int vector); + void (*send_IPI_allbutself)(int vector); + void (*send_IPI_all)(int vector); +}; + +#define APICFUNC(x) .x = x + +#define APIC_INIT(aname, aprobe) { \ + .name = aname, \ + .probe = aprobe, \ + .int_delivery_mode = INT_DELIVERY_MODE, \ + .int_dest_mode = INT_DEST_MODE, \ + .apic_broadcast_id = APIC_BROADCAST_ID, \ + .no_balance_irq = NO_BALANCE_IRQ, \ + APICFUNC(apic_id_registered), \ + APICFUNC(target_cpus), \ + APICFUNC(check_apicid_used), \ + APICFUNC(check_apicid_present), \ + APICFUNC(init_apic_ldr), \ + APICFUNC(ioapic_phys_id_map), \ + APICFUNC(clustered_apic_check), \ + APICFUNC(multi_timer_check), \ + APICFUNC(apicid_to_node), \ + APICFUNC(cpu_to_logical_apicid), \ + APICFUNC(cpu_present_to_apicid), \ + APICFUNC(apicid_to_cpu_present), \ + APICFUNC(mpc_apic_id), \ + APICFUNC(setup_portio_remap), \ + APICFUNC(check_phys_apicid_present), \ + APICFUNC(mpc_oem_bus_info), \ + APICFUNC(mpc_oem_pci_bus), \ + APICFUNC(mps_oem_check), \ + APICFUNC(get_apic_id), \ + .apic_id_mask = APIC_ID_MASK, \ + APICFUNC(acpi_madt_oem_check), \ + APICFUNC(send_IPI_mask), \ + APICFUNC(send_IPI_allbutself), \ + APICFUNC(send_IPI_all), \ + } + +extern struct genapic *genapic; + +#endif diff --git a/include/asm-i386/kmap_types.h b/include/asm-i386/kmap_types.h index dda910c4f1ba..a117c0ade4d0 100644 --- a/include/asm-i386/kmap_types.h +++ b/include/asm-i386/kmap_types.h @@ -3,7 +3,7 @@ #include <linux/config.h> -#if CONFIG_DEBUG_HIGHMEM +#ifdef CONFIG_DEBUG_HIGHMEM # define D(n) __KM_FENCE_##n , #else # define D(n) diff --git a/include/asm-i386/mach-bigsmp/mach_apic.h b/include/asm-i386/mach-bigsmp/mach_apic.h index b6d7c5e946a3..93972fcd768f 100644 --- a/include/asm-i386/mach-bigsmp/mach_apic.h +++ b/include/asm-i386/mach-bigsmp/mach_apic.h @@ -15,18 +15,28 @@ static inline int apic_id_registered(void) { - return (1); + return (1); } #define APIC_DFR_VALUE (APIC_DFR_CLUSTER) -#define TARGET_CPUS ((cpu_online_map < 0xf)?cpu_online_map:0xf) +static inline unsigned long target_cpus(void) +{ + return ((cpu_online_map < 0xf)?cpu_online_map:0xf); +} +#define TARGET_CPUS (target_cpus()) #define INT_DELIVERY_MODE dest_LowestPrio #define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */ #define APIC_BROADCAST_ID (0x0f) -#define check_apicid_used(bitmap, apicid) (0) -#define check_apicid_present(bit) (phys_cpu_present_map & (1 << bit)) +static inline unsigned long check_apicid_used(unsigned long bitmap, int apicid) +{ + return 0; +} +static inline unsigned long check_apicid_present(int bit) +{ + return (phys_cpu_present_map & (1 << bit)); +} static inline unsigned long calculate_ldr(unsigned long old) { @@ -115,4 +125,13 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) return (1); } +#define APIC_ID_MASK (0x0F<<24) + +static inline unsigned get_apic_id(unsigned long x) +{ + return (((x)>>24)&0x0F); +} + +#define GET_APIC_ID(x) get_apic_id(x) + #endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-i386/mach-bigsmp/mach_ipi.h b/include/asm-i386/mach-bigsmp/mach_ipi.h index e0866134e624..87bd9fc4add8 100644 --- a/include/asm-i386/mach-bigsmp/mach_ipi.h +++ b/include/asm-i386/mach-bigsmp/mach_ipi.h @@ -1,7 +1,7 @@ #ifndef __ASM_MACH_IPI_H #define __ASM_MACH_IPI_H -static inline void send_IPI_mask_sequence(int mask, int vector); +inline void send_IPI_mask_sequence(int mask, int vector); static inline void send_IPI_mask(int mask, int vector) { diff --git a/include/asm-i386/mach-default/mach_apic.h b/include/asm-i386/mach-default/mach_apic.h index 8a1311d6df7b..e865f01f5167 100644 --- a/include/asm-i386/mach-default/mach_apic.h +++ b/include/asm-i386/mach-default/mach_apic.h @@ -3,11 +3,15 @@ #define APIC_DFR_VALUE (APIC_DFR_FLAT) +static inline unsigned long target_cpus(void) +{ #ifdef CONFIG_SMP - #define TARGET_CPUS (cpu_online_map) + return cpu_online_map; #else - #define TARGET_CPUS 0x01 + return 1; #endif +} +#define TARGET_CPUS (target_cpus()) #define NO_BALANCE_IRQ (0) #define esr_disable (0) @@ -16,13 +20,15 @@ #define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */ #define APIC_BROADCAST_ID 0x0F -#define check_apicid_used(bitmap, apicid) (bitmap & (1 << apicid)) -#define check_apicid_present(bit) (phys_cpu_present_map & (1 << bit)) -static inline int apic_id_registered(void) +static inline unsigned long check_apicid_used(unsigned long bitmap, int apicid) +{ + return (bitmap & (1UL << apicid)); +} + +static inline unsigned long check_apicid_present(int bit) { - return (test_bit(GET_APIC_ID(apic_read(APIC_ID)), - &phys_cpu_present_map)); + return (phys_cpu_present_map & (1UL << bit)); } /* @@ -42,7 +48,7 @@ static inline void init_apic_ldr(void) apic_write_around(APIC_LDR, val); } -static inline ulong ioapic_phys_id_map(ulong phys_map) +static inline unsigned long ioapic_phys_id_map(unsigned long phys_map) { return phys_map; } @@ -99,4 +105,19 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) return test_bit(boot_cpu_physical_apicid, &phys_cpu_present_map); } +#define APIC_ID_MASK (0xF<<24) + +static inline unsigned get_apic_id(unsigned long x) +{ + return (((x)>>24)&0xF); +} + +#define GET_APIC_ID(x) get_apic_id(x) + +static inline int apic_id_registered(void) +{ + return (test_bit(GET_APIC_ID(apic_read(APIC_ID)), + &phys_cpu_present_map)); +} + #endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-i386/mach-default/mach_ipi.h b/include/asm-i386/mach-default/mach_ipi.h index 481692a7b885..43d78f307db5 100644 --- a/include/asm-i386/mach-default/mach_ipi.h +++ b/include/asm-i386/mach-default/mach_ipi.h @@ -1,8 +1,8 @@ #ifndef __ASM_MACH_IPI_H #define __ASM_MACH_IPI_H -static inline void send_IPI_mask_bitmask(int mask, int vector); -static inline void __send_IPI_shortcut(unsigned int shortcut, int vector); +inline void send_IPI_mask_bitmask(int mask, int vector); +inline void __send_IPI_shortcut(unsigned int shortcut, int vector); static inline void send_IPI_mask(int mask, int vector) { diff --git a/include/asm-i386/mach-default/mach_mpparse.h b/include/asm-i386/mach-default/mach_mpparse.h index 3b399a3bcd11..1d3832482580 100644 --- a/include/asm-i386/mach-default/mach_mpparse.h +++ b/include/asm-i386/mach-default/mach_mpparse.h @@ -12,14 +12,16 @@ static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, { } -static inline void mps_oem_check(struct mp_config_table *mpc, char *oem, +static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid) { + return 0; } /* Hook from generic ACPI tables.c */ -static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id) +static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { + return 0; } diff --git a/include/asm-i386/mach-generic/mach_apic.h b/include/asm-i386/mach-generic/mach_apic.h new file mode 100644 index 000000000000..9adab2c3f2fc --- /dev/null +++ b/include/asm-i386/mach-generic/mach_apic.h @@ -0,0 +1,30 @@ +#ifndef __ASM_MACH_APIC_H +#define __ASM_MACH_APIC_H + +#include <asm/genapic.h> + +#define esr_disable (genapic->esr_disable) +#define NO_BALANCE_IRQ (genapic->no_balance_irq) +#define APIC_BROADCAST_ID (genapic->apic_broadcast_id) +#define INT_DELIVERY_MODE (genapic->int_delivery_mode) +#define INT_DEST_MODE (genapic->int_dest_mode) +#define TARGET_CPUS (genapic->target_cpus()) +#define apic_id_registered (genapic->apic_id_registered) +#define apic_id_registered (genapic->apic_id_registered) +#define init_apic_ldr (genapic->init_apic_ldr) +#define ioapic_phys_id_map (genapic->ioapic_phys_id_map) +#define clustered_apic_check (genapic->clustered_apic_check) +#define multi_timer_check (genapic->multi_timer_check) +#define apicid_to_node (genapic->apicid_to_node) +#define cpu_to_logical_apicid (genapic->cpu_to_logical_apicid) +#define cpu_present_to_apicid (genapic->cpu_present_to_apicid) +#define apicid_to_cpu_present (genapic->apicid_to_cpu_present) +#define mpc_apic_id (genapic->mpc_apic_id) +#define setup_portio_remap (genapic->setup_portio_remap) +#define check_apicid_present (genapic->check_apicid_present) +#define check_phys_apicid_present (genapic->check_phys_apicid_present) +#define check_apicid_used (genapic->check_apicid_used) +#define GET_APIC_ID (genapic->get_apic_id) +#define APIC_ID_MASK (genapic->apic_id_mask) + +#endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-i386/mach-generic/mach_ipi.h b/include/asm-i386/mach-generic/mach_ipi.h new file mode 100644 index 000000000000..441b0fe3ed1d --- /dev/null +++ b/include/asm-i386/mach-generic/mach_ipi.h @@ -0,0 +1,10 @@ +#ifndef _MACH_IPI_H +#define _MACH_IPI_H 1 + +#include <asm/genapic.h> + +#define send_IPI_mask (genapic->send_IPI_mask) +#define send_IPI_allbutself (genapic->send_IPI_allbutself) +#define send_IPI_all (genapic->send_IPI_all) + +#endif diff --git a/include/asm-i386/mach-generic/mach_mpparse.h b/include/asm-i386/mach-generic/mach_mpparse.h new file mode 100644 index 000000000000..dbd9fce54f4d --- /dev/null +++ b/include/asm-i386/mach-generic/mach_mpparse.h @@ -0,0 +1,12 @@ +#ifndef _MACH_MPPARSE_H +#define _MACH_MPPARSE_H 1 + +#include <asm/genapic.h> + +#define mpc_oem_bus_info (genapic->mpc_oem_bus_info) +#define mpc_oem_pci_bus (genapic->mpc_oem_pci_bus) + +int mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid); +int acpi_madt_oem_check(char *oem_id, char *oem_table_id); + +#endif diff --git a/include/asm-i386/mach-numaq/mach_apic.h b/include/asm-i386/mach-numaq/mach_apic.h index 1b322209306e..54a7c97fe8d1 100644 --- a/include/asm-i386/mach-numaq/mach_apic.h +++ b/include/asm-i386/mach-numaq/mach_apic.h @@ -1,6 +1,9 @@ #ifndef __ASM_MACH_APIC_H #define __ASM_MACH_APIC_H +#include <asm/io.h> +#include <linux/mmzone.h> + #define APIC_DFR_VALUE (APIC_DFR_CLUSTER) #define TARGET_CPUS (0xf) @@ -103,4 +106,13 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) return (1); } +#define APIC_ID_MASK (0xF<<24) + +static inline unsigned get_apic_id(unsigned long x) +{ + return (((x)>>24)&0x0F); +} + +#define GET_APIC_ID(x) get_apic_id(x) + #endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h index 988e40647378..ae58d629c9ba 100644 --- a/include/asm-i386/mach-summit/mach_apic.h +++ b/include/asm-i386/mach-summit/mach_apic.h @@ -1,7 +1,13 @@ #ifndef __ASM_MACH_APIC_H #define __ASM_MACH_APIC_H +#include <linux/config.h> + +#ifdef CONFIG_X86_GENERICARCH +#define x86_summit 1 /* must be an constant expressiona for generic arch */ +#else extern int x86_summit; +#endif #define esr_disable (x86_summit ? 1 : 0) #define NO_BALANCE_IRQ (0) @@ -9,20 +15,34 @@ extern int x86_summit; #define XAPIC_DEST_CPUS_MASK 0x0Fu #define XAPIC_DEST_CLUSTER_MASK 0xF0u -#define xapic_phys_to_log_apicid(phys_apic) ( (1ul << ((phys_apic) & 0x3)) |\ - ((phys_apic) & XAPIC_DEST_CLUSTER_MASK) ) +static inline unsigned long xapic_phys_to_log_apicid(int phys_apic) +{ + return ( (1ul << ((phys_apic) & 0x3)) | + ((phys_apic) & XAPIC_DEST_CLUSTER_MASK) ); +} #define APIC_DFR_VALUE (x86_summit ? APIC_DFR_CLUSTER : APIC_DFR_FLAT) -#define TARGET_CPUS (x86_summit ? XAPIC_DEST_CPUS_MASK : cpu_online_map) + +static inline unsigned long target_cpus(void) +{ + return (x86_summit ? XAPIC_DEST_CPUS_MASK : cpu_online_map); +} +#define TARGET_CPUS (target_cpus()) #define INT_DELIVERY_MODE (x86_summit ? dest_Fixed : dest_LowestPrio) #define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */ -#define APIC_BROADCAST_ID (x86_summit ? 0xFF : 0x0F) -#define check_apicid_used(bitmap, apicid) (x86_summit ? 0 : (bitmap & (1 << apicid))) +#define APIC_BROADCAST_ID (0x0F) +static inline unsigned long check_apicid_used(unsigned long bitmap, int apicid) +{ + return (x86_summit ? 0 : (bitmap & (1 << apicid))); +} /* we don't use the phys_cpu_present_map to indicate apicid presence */ -#define check_apicid_present(bit) (x86_summit ? 1 : (phys_cpu_present_map & (1 << bit))) +static inline unsigned long check_apicid_present(int bit) +{ + return (x86_summit ? 1 : (phys_cpu_present_map & (1 << bit))); +} extern u8 bios_cpu_apicid[]; @@ -113,4 +133,13 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid) return test_bit(boot_cpu_physical_apicid, &phys_cpu_present_map); } +#define APIC_ID_MASK (0xFF<<24) + +static inline unsigned get_apic_id(unsigned long x) +{ + return (((x)>>24)&0xFF); +} + +#define GET_APIC_ID(x) get_apic_id(x) + #endif /* __ASM_MACH_APIC_H */ diff --git a/include/asm-i386/mach-summit/mach_ipi.h b/include/asm-i386/mach-summit/mach_ipi.h index e0866134e624..87bd9fc4add8 100644 --- a/include/asm-i386/mach-summit/mach_ipi.h +++ b/include/asm-i386/mach-summit/mach_ipi.h @@ -1,7 +1,7 @@ #ifndef __ASM_MACH_IPI_H #define __ASM_MACH_IPI_H -static inline void send_IPI_mask_sequence(int mask, int vector); +inline void send_IPI_mask_sequence(int mask, int vector); static inline void send_IPI_mask(int mask, int vector) { diff --git a/include/asm-i386/mach-summit/mach_mpparse.h b/include/asm-i386/mach-summit/mach_mpparse.h index d34f3df6468d..3a6d53c10afc 100644 --- a/include/asm-i386/mach-summit/mach_mpparse.h +++ b/include/asm-i386/mach-summit/mach_mpparse.h @@ -14,26 +14,34 @@ static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, { } -static inline void mps_oem_check(struct mp_config_table *mpc, char *oem, +static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid) { if (!strncmp(oem, "IBM ENSW", 8) && (!strncmp(productid, "VIGIL SMP", 9) || !strncmp(productid, "EXA", 3) || !strncmp(productid, "RUTHLESS SMP", 12))){ +#ifndef CONFIG_X86_GENERICARCH x86_summit = 1; +#endif use_cyclone = 1; /*enable cyclone-timer*/ + return 1; } + return 0; } /* Hook from generic ACPI tables.c */ -static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id) +static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { if (!strncmp(oem_id, "IBM", 3) && (!strncmp(oem_table_id, "SERVIGIL", 8) || !strncmp(oem_table_id, "EXA", 3))){ +#ifndef CONFIG_X86_GENERICARCH x86_summit = 1; +#endif use_cyclone = 1; /*enable cyclone-timer*/ + return 1; } + return 0; } #endif /* __ASM_MACH_MPPARSE_H */ diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h index 257bfa929428..b6138f07c309 100644 --- a/include/asm-i386/mmzone.h +++ b/include/asm-i386/mmzone.h @@ -120,7 +120,7 @@ static inline struct pglist_data *pfn_to_pgdat(unsigned long pfn) #ifdef CONFIG_X86_NUMAQ #include <asm/numaq.h> -#elif CONFIG_X86_SUMMIT +#elif CONFIG_NUMA /* summit or generic arch */ #include <asm/srat.h> #elif CONFIG_X86_PC #define get_memcfg_numa get_memcfg_numa_flat diff --git a/include/asm-i386/mpspec.h b/include/asm-i386/mpspec.h index bdb208ca961c..ea4023a0bc61 100644 --- a/include/asm-i386/mpspec.h +++ b/include/asm-i386/mpspec.h @@ -16,7 +16,7 @@ /* * a maximum of 16 APICs with the current APIC ID architecture. */ -#if defined(CONFIG_X86_NUMAQ) || defined (CONFIG_X86_SUMMIT) +#if defined(CONFIG_X86_NUMAQ) || defined (CONFIG_X86_SUMMIT) || defined(CONFIG_X86_GENERICARCH) #define MAX_APICS 256 #else #define MAX_APICS 16 diff --git a/include/asm-i386/numnodes.h b/include/asm-i386/numnodes.h index 8d14f4ad7ef3..1b7443f748a5 100644 --- a/include/asm-i386/numnodes.h +++ b/include/asm-i386/numnodes.h @@ -5,7 +5,7 @@ #ifdef CONFIG_X86_NUMAQ #include <asm/numaq.h> -#elif CONFIG_X86_SUMMIT +#elif CONFIG_NUMA #include <asm/srat.h> #else #define MAX_NUMNODES 1 diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 6bbb21e6e205..9e9e07de8f9e 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -536,7 +536,7 @@ static inline void rep_nop(void) #define ASM_NOP6 K8_NOP6 #define ASM_NOP7 K8_NOP7 #define ASM_NOP8 K8_NOP8 -#elif CONFIG_MK7 +#elif defined(CONFIG_MK7) #define ASM_NOP1 K7_NOP1 #define ASM_NOP2 K7_NOP2 #define ASM_NOP3 K7_NOP3 diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h index 57521b90c548..67a5353fdb59 100644 --- a/include/asm-i386/smp.h +++ b/include/asm-i386/smp.h @@ -87,11 +87,17 @@ extern inline int any_online_cpu(unsigned int mask) return -1; } #ifdef CONFIG_X86_LOCAL_APIC -static __inline int hard_smp_processor_id(void) + +#ifdef APIC_DEFINITION +extern int hard_smp_processor_id(void); +#else +#include <mach_apic.h> +static inline int hard_smp_processor_id(void) { /* we don't want to mark this access volatile - bad code generation */ return GET_APIC_ID(*(unsigned long *)(APIC_BASE+APIC_ID)); } +#endif static __inline int logical_smp_processor_id(void) { diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h index 379d278686f0..15aa2e7ef765 100644 --- a/include/asm-i386/uaccess.h +++ b/include/asm-i386/uaccess.h @@ -62,8 +62,6 @@ int __verify_write(const void *, unsigned long); :"1" (addr),"g" ((int)(size)),"g" (current_thread_info()->addr_limit.seg)); \ flag; }) -#ifdef CONFIG_X86_WP_WORKS_OK - /** * access_ok: - Checks if a user space pointer is valid * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE. Note that @@ -85,14 +83,6 @@ int __verify_write(const void *, unsigned long); */ #define access_ok(type,addr,size) (__range_ok(addr,size) == 0) -#else - -#define access_ok(type,addr,size) ( (__range_ok(addr,size) == 0) && \ - ((type) == VERIFY_READ || boot_cpu_data.wp_works_ok || \ - __verify_write((void *)(addr),(size)))) - -#endif - /** * verify_area: - Obsolete, use access_ok() * @type: Type of access: %VERIFY_READ or %VERIFY_WRITE @@ -191,14 +181,8 @@ extern void __get_user_4(void); __ret_gu; \ }) -extern void __put_user_1(void); -extern void __put_user_2(void); -extern void __put_user_4(void); -extern void __put_user_8(void); - extern void __put_user_bad(void); - /** * put_user: - Write a simple value into user space. * @x: Value to copy to user space. @@ -299,6 +283,8 @@ extern void __put_user_bad(void); : "=r"(err) \ : "A" (x), "r" (addr), "i"(-EFAULT), "0"(err)) +#ifdef CONFIG_X86_WP_WORKS_OK + #define __put_user_size(x,ptr,size,retval,errret) \ do { \ retval = 0; \ @@ -311,6 +297,18 @@ do { \ } \ } while (0) +#else + +#define __put_user_size(x,ptr,size,retval,errret) \ +do { \ + __typeof__(*(ptr)) __pus_tmp = x; \ + retval = 0; \ + \ + if(unlikely(__copy_to_user_ll(ptr, &__pus_tmp, size) != 0)) \ + retval = errret; \ +} while (0) + +#endif struct __large_struct { unsigned long buf[100]; }; #define __m(x) (*(struct __large_struct *)(x)) diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index e0f4fd1f8ce0..84d35a14522e 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h @@ -399,6 +399,8 @@ static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) * What we want is __attribute__((weak,alias("sys_ni_syscall"))), * but it doesn't work on all toolchains, so we just do it by hand */ +#ifndef cond_syscall #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall"); +#endif #endif /* _ASM_I386_UNISTD_H_ */ diff --git a/include/linux/atm_he.h b/include/linux/atm_he.h new file mode 100644 index 000000000000..2a7713b597cf --- /dev/null +++ b/include/linux/atm_he.h @@ -0,0 +1,20 @@ +/* atm_he.h */ + +#ifndef LINUX_ATM_HE_H +#define LINUX_ATM_HE_H + +#include <linux/atmioc.h> + +#define HE_GET_REG _IOW('a', ATMIOC_SARPRV, struct atmif_sioc) + +#define HE_REGTYPE_PCI 1 +#define HE_REGTYPE_RCM 2 +#define HE_REGTYPE_TCM 3 +#define HE_REGTYPE_MBOX 4 + +struct he_ioctl_reg { + unsigned addr, val; + char type; +}; + +#endif /* LINUX_ATM_HE_H */ diff --git a/include/linux/atmbr2684.h b/include/linux/atmbr2684.h new file mode 100644 index 000000000000..7981b733f1ef --- /dev/null +++ b/include/linux/atmbr2684.h @@ -0,0 +1,101 @@ +#ifndef _LINUX_ATMBR2684_H +#define _LINUX_ATMBR2684_H + +#include <linux/atm.h> +#include <linux/if.h> /* For IFNAMSIZ */ + +/* + * Type of media we're bridging (ethernet, token ring, etc) Currently only + * ethernet is supported + */ +#define BR2684_MEDIA_ETHERNET (0) /* 802.3 */ +#define BR2684_MEDIA_802_4 (1) /* 802.4 */ +#define BR2684_MEDIA_TR (2) /* 802.5 - token ring */ +#define BR2684_MEDIA_FDDI (3) +#define BR2684_MEDIA_802_6 (4) /* 802.6 */ + +/* + * Is there FCS inbound on this VC? This currently isn't supported. + */ +#define BR2684_FCSIN_NO (0) +#define BR2684_FCSIN_IGNORE (1) +#define BR2684_FCSIN_VERIFY (2) + +/* + * Is there FCS outbound on this VC? This currently isn't supported. + */ +#define BR2684_FCSOUT_NO (0) +#define BR2684_FCSOUT_SENDZERO (1) +#define BR2684_FCSOUT_GENERATE (2) + +/* + * Does this VC include LLC encapsulation? + */ +#define BR2684_ENCAPS_VC (0) /* VC-mux */ +#define BR2684_ENCAPS_LLC (1) +#define BR2684_ENCAPS_AUTODETECT (2) /* Unsuported */ + +/* + * This is for the ATM_NEWBACKENDIF call - these are like socket families: + * the first element of the structure is the backend number and the rest + * is per-backend specific + */ +struct atm_newif_br2684 { + atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */ + int media; /* BR2684_MEDIA_* */ + char ifname[IFNAMSIZ]; + int mtu; +}; + +/* + * This structure is used to specify a br2684 interface - either by a + * positive integer (returned by ATM_NEWBACKENDIF) or the interfaces name + */ +#define BR2684_FIND_BYNOTHING (0) +#define BR2684_FIND_BYNUM (1) +#define BR2684_FIND_BYIFNAME (2) +struct br2684_if_spec { + int method; /* BR2684_FIND_* */ + union { + char ifname[IFNAMSIZ]; + int devnum; + } spec; +}; + +/* + * This is for the ATM_SETBACKEND call - these are like socket families: + * the first element of the structure is the backend number and the rest + * is per-backend specific + */ +struct atm_backend_br2684 { + atm_backend_t backend_num; /* ATM_BACKEND_BR2684 */ + struct br2684_if_spec ifspec; + int fcs_in; /* BR2684_FCSIN_* */ + int fcs_out; /* BR2684_FCSOUT_* */ + int fcs_auto; /* 1: fcs_{in,out} disabled if no FCS rx'ed */ + int encaps; /* BR2684_ENCAPS_* */ + int has_vpiid; /* 1: use vpn_id - Unsupported */ + __u8 vpn_id[7]; + int send_padding; /* unsupported */ + int min_size; /* we will pad smaller packets than this */ +}; + +/* + * The BR2684_SETFILT ioctl is an experimental mechanism for folks + * terminating a large number of IP-only vcc's. When netfilter allows + * efficient per-if in/out filters, this support will be removed + */ +struct br2684_filter { + __u32 prefix; /* network byte order */ + __u32 netmask; /* 0 = disable filter */ +}; + +struct br2684_filter_set { + struct br2684_if_spec ifspec; + struct br2684_filter filter; +}; + +#define BR2684_SETFILT _IOW( 'a', ATMIOC_BACKEND + 0, \ + struct br2684_filter_set) + +#endif /* _LINUX_ATMBR2684_H */ diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index d6dce90537bf..d564eb34e7ce 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h @@ -96,6 +96,8 @@ struct atm_dev_stats { /* enable or disable single-copy */ #define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t) /* set backend handler */ +#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t) + /* use backend to make new if */ /* * These are backend handkers that can be set via the ATM_SETBACKEND call @@ -104,7 +106,7 @@ struct atm_dev_stats { */ #define ATM_BACKEND_RAW 0 #define ATM_BACKEND_PPP 1 /* PPPoATM - RFC2364 */ -#define ATM_BACKEND_BR_2684 2 /* Bridged RFC1483/2684 */ +#define ATM_BACKEND_BR2684 2 /* Bridged RFC1483/2684 */ /* for ATM_GETTYPE */ #define ATM_ITFTYP_LEN 8 /* maximum length of interface type name */ @@ -304,9 +306,6 @@ struct atm_vcc { struct sockaddr_atmsvc local; struct sockaddr_atmsvc remote; void (*callback)(struct atm_vcc *vcc); - struct sk_buff_head listenq; - int backlog_quota; /* number of connection requests we */ - /* can still accept */ int reply; /* also used by ATMTCP */ /* Multipoint part ------------------------------------------------- */ struct atm_vcc *session; /* session VCC descriptor */ diff --git a/include/linux/blkpg.h b/include/linux/blkpg.h index 571618972e30..15b61f7bf0b5 100644 --- a/include/linux/blkpg.h +++ b/include/linux/blkpg.h @@ -54,10 +54,4 @@ struct blkpg_partition { char volname[BLKPG_VOLNAMELTH]; /* volume label */ }; -#ifdef __KERNEL__ - -extern char * partition_name(dev_t dev); - -#endif /* __KERNEL__ */ - #endif /* _LINUX_BLKPG_H */ diff --git a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h index 8ee76799308c..34ebe93c6194 100644 --- a/include/linux/devfs_fs_kernel.h +++ b/include/linux/devfs_fs_kernel.h @@ -27,6 +27,8 @@ extern devfs_handle_t devfs_register (devfs_handle_t dir, const char *name, umode_t mode, void *ops, void *info); extern int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...) __attribute__((format (printf, 3, 4))); +extern int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...) + __attribute__((format (printf, 3, 4))); extern int devfs_mk_symlink(const char *name, const char *link); extern int devfs_mk_dir(const char *fmt, ...) __attribute__((format (printf, 1, 2))); @@ -51,6 +53,10 @@ static inline int devfs_mk_bdev(dev_t dev, umode_t mode, const char *fmt, ...) { return 0; } +static inline int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...) +{ + return 0; +} static inline int devfs_mk_symlink (const char *name, const char *link) { return 0; diff --git a/include/linux/file.h b/include/linux/file.h index 6fbd27f755d5..a488f738f9f0 100644 --- a/include/linux/file.h +++ b/include/linux/file.h @@ -35,7 +35,15 @@ struct files_struct { extern void FASTCALL(__fput(struct file *)); extern void FASTCALL(fput(struct file *)); + +static inline void fput_light(struct file *file, int fput_needed) +{ + if (unlikely(fput_needed)) + fput(file); +} + extern struct file * FASTCALL(fget(unsigned int fd)); +extern struct file * FASTCALL(fget_light(unsigned int fd, int *fput_needed)); extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag)); extern void put_filp(struct file *); extern int get_unused_fd(void); diff --git a/include/linux/fs.h b/include/linux/fs.h index b9b2cf5b69e8..8d618555e772 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -206,8 +206,8 @@ extern int leases_enable, dir_notify_enable, lease_break_time; #include <asm/semaphore.h> #include <asm/byteorder.h> +/* Used to be a macro which just called the function, now just a function */ extern void update_atime (struct inode *); -#define UPDATE_ATIME(inode) update_atime (inode) extern void inode_init(unsigned long); extern void mnt_init(unsigned long); @@ -1113,6 +1113,10 @@ extern int filemap_flush(struct address_space *); extern int filemap_fdatawait(struct address_space *); extern void sync_supers(void); extern void sync_filesystems(int wait); +extern void emergency_sync(void); +extern void emergency_remount(void); +extern int do_remount_sb(struct super_block *sb, int flags, + void *data, int force); extern sector_t bmap(struct inode *, sector_t); extern int setattr_mask(unsigned int); extern int notify_change(struct dentry *, struct iattr *); diff --git a/include/linux/input.h b/include/linux/input.h index 9df2e226a1f2..ae71e3ea453e 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -894,9 +894,6 @@ void input_close_device(struct input_handle *); int input_accept_process(struct input_handle *handle, struct file *file); int input_flush_device(struct input_handle* handle, struct file* file); -/* will go away once devfs_register gets sanitized */ -void input_register_minor(char *name, int minor, int minor_base); - void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); #define input_report_key(a,b,c) input_event(a, EV_KEY, b, !!(c)) diff --git a/include/linux/major.h b/include/linux/major.h index 200e3653181b..0e2d112c89e5 100644 --- a/include/linux/major.h +++ b/include/linux/major.h @@ -27,6 +27,7 @@ #define MUX_MAJOR 11 /* PA-RISC only */ #define QIC02_TAPE_MAJOR 12 #define XT_DISK_MAJOR 13 +#define INPUT_MAJOR 13 #define SOUND_MAJOR 14 #define CDU31A_CDROM_MAJOR 15 #define JOYSTICK_MAJOR 15 diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index 02ff30e5a187..98f0d1e27c4c 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h @@ -61,9 +61,20 @@ #define MD_MINOR_VERSION 90 #define MD_PATCHLEVEL_VERSION 0 -extern inline char * bdev_partition_name (struct block_device *bdev) +/* + * XXX(hch): This function is broken. Someone who understands the md + * code needs to go through all callers, check whether bdev could + * be NULL and replace it with direct calls to bdevmame. + * + * This would also fix the returns buffer on stack issue nicely :) + */ +static inline const char *bdev_partition_name (struct block_device *bdev) { - return partition_name(bdev ? bdev->bd_dev : 0); + char b[BDEVNAME_SIZE]; + + if (!bdev) + return __bdevname(0, b); + return bdevname(bdev, b); } extern int register_md_personality (int p_num, mdk_personality_t *p); extern int unregister_md_personality (int p_num); diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 64b443d136a9..36573ba3c202 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -78,7 +78,7 @@ struct rtattr /****************************************************************************** - * Definitions used in routing table administation. + * Definitions used in routing table administration. ****/ struct rtmsg @@ -129,14 +129,14 @@ enum #define RTPROT_STATIC 4 /* Route installed by administrator */ /* Values of protocol >= RTPROT_STATIC are not interpreted by kernel; - they just passed from user and back as is. + they are just passed from user and back as is. It will be used by hypothetical multiple routing daemons. Note that protocol values should be standardized in order to avoid conflicts. */ #define RTPROT_GATED 8 /* Apparently, GateD */ -#define RTPROT_RA 9 /* RDISC/ND router advertisments */ +#define RTPROT_RA 9 /* RDISC/ND router advertisements */ #define RTPROT_MRT 10 /* Merit MRT */ #define RTPROT_ZEBRA 11 /* Zebra */ #define RTPROT_BIRD 12 /* BIRD */ @@ -210,8 +210,8 @@ enum rtattr_type_t /* RTM_MULTIPATH --- array of struct rtnexthop. * - * "struct rtnexthop" describres all necessary nexthop information, - * i.e. parameters of path to a destination via this nextop. + * "struct rtnexthop" describes all necessary nexthop information, + * i.e. parameters of path to a destination via this nexthop. * * At the moment it is impossible to set different prefsrc, mtu, window * and rtt for different paths from multipath. @@ -485,7 +485,7 @@ enum Comments: - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid - - If neiher of these three flags are set; + - If neither of these three flags are set; the interface is NBMA. - IFF_MULTICAST does not mean anything special: diff --git a/include/linux/sched.h b/include/linux/sched.h index ca3c22f974c2..01ea66352c74 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -294,6 +294,7 @@ extern struct user_struct root_user; typedef struct prio_array prio_array_t; struct backing_dev_info; +struct reclaim_state; /* POSIX.1b interval timer structure. */ struct k_itimer { @@ -433,6 +434,10 @@ struct task_struct { /* journalling filesystem info */ void *journal_info; + +/* VM state */ + struct reclaim_state *reclaim_state; + struct dentry *proc_dentry; struct backing_dev_info *backing_dev_info; diff --git a/include/linux/security.h b/include/linux/security.h index 6a98cb692bf8..4d052ad9759d 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -361,6 +361,9 @@ struct swap_info_struct; * Check permission before setting the extended attributes * @value identified by @name for @dentry. * Return 0 if permission is granted. + * @inode_post_setxattr: + * Update inode security field after successful setxattr operation. + * @value identified by @name for @dentry. * @inode_getxattr: * Check permission before obtaining the extended attributes * identified by @name for @dentry. @@ -1036,6 +1039,8 @@ struct security_operations { void (*inode_delete) (struct inode *inode); int (*inode_setxattr) (struct dentry *dentry, char *name, void *value, size_t size, int flags); + void (*inode_post_setxattr) (struct dentry *dentry, char *name, void *value, + size_t size, int flags); int (*inode_getxattr) (struct dentry *dentry, char *name); int (*inode_listxattr) (struct dentry *dentry); int (*inode_removexattr) (struct dentry *dentry, char *name); @@ -1464,6 +1469,12 @@ static inline int security_inode_setxattr (struct dentry *dentry, char *name, return security_ops->inode_setxattr (dentry, name, value, size, flags); } +static inline void security_inode_post_setxattr (struct dentry *dentry, char *name, + void *value, size_t size, int flags) +{ + security_ops->inode_post_setxattr (dentry, name, value, size, flags); +} + static inline int security_inode_getxattr (struct dentry *dentry, char *name) { return security_ops->inode_getxattr (dentry, name); @@ -2063,6 +2074,10 @@ static inline int security_inode_setxattr (struct dentry *dentry, char *name, return 0; } +static inline void security_inode_post_setxattr (struct dentry *dentry, char *name, + void *value, size_t size, int flags) +{ } + static inline int security_inode_getxattr (struct dentry *dentry, char *name) { return 0; diff --git a/include/linux/slab.h b/include/linux/slab.h index 49374df2d450..b2b6f0498e2a 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -49,7 +49,6 @@ typedef struct kmem_cache_s kmem_cache_t; /* prototypes */ extern void kmem_cache_init(void); -extern void kmem_cache_sizes_init(void); extern kmem_cache_t *kmem_find_general_cachep(size_t, int gfpflags); extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long, diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 6553637b70ee..09f7d54052eb 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h @@ -176,8 +176,10 @@ static inline int svc_take_page(struct svc_rqst *rqstp) { if (rqstp->rq_arghi <= rqstp->rq_argused) return -ENOMEM; - rqstp->rq_respages[rqstp->rq_resused++] = - rqstp->rq_argpages[--rqstp->rq_arghi]; + rqstp->rq_arghi--; + rqstp->rq_respages[rqstp->rq_resused] = + rqstp->rq_argpages[rqstp->rq_arghi]; + rqstp->rq_resused++; return 0; } diff --git a/include/linux/swap.h b/include/linux/swap.h index 50f651d752cc..147e5bf40cbf 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -66,6 +66,14 @@ typedef struct { unsigned long val; } swp_entry_t; +/* + * current->reclaim_state points to one of these when a task is running + * memory reclaim + */ +struct reclaim_state { + unsigned long reclaimed_slab; +}; + #ifdef __KERNEL__ struct address_space; diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index ee340cd26eaf..1acdb0bd4689 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h @@ -92,21 +92,3 @@ static inline int __reterr(void) #define unregister_sysrq_key(ig,nore) __reterr() #endif - - -/* Deferred actions */ - -extern int emergency_sync_scheduled; - -#define EMERG_SYNC 1 -#define EMERG_REMOUNT 2 - -void do_emergency_sync(void); - -#ifdef CONFIG_MAGIC_SYSRQ -#define CHECK_EMERGENCY_SYNC \ - if (emergency_sync_scheduled) \ - do_emergency_sync(); -#else -#define CHECK_EMERGENCY_SYNC -#endif diff --git a/include/linux/tty.h b/include/linux/tty.h index d7948e7ad0eb..fa5529ad5c6e 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -243,6 +243,7 @@ struct tty_flip_buffer { #define L_PENDIN(tty) _L_FLAG((tty),PENDIN) #define L_IEXTEN(tty) _L_FLAG((tty),IEXTEN) +struct device; /* * Where all of the state associated with a tty is kept while the tty * is open. Since the termios state should be kept even if the tty @@ -380,7 +381,7 @@ extern void start_tty(struct tty_struct * tty); extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc); extern int tty_register_driver(struct tty_driver *driver); extern int tty_unregister_driver(struct tty_driver *driver); -extern void tty_register_device(struct tty_driver *driver, unsigned index); +extern void tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev); extern void tty_unregister_device(struct tty_driver *driver, unsigned index); extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, int buflen); |
