From bda663d36b94c723153246a4231bbc0f1cd1836e Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Fri, 16 Sep 2005 16:51:15 -0400 Subject: [ACPI] ACPICA 20050916 Fixed a problem within the Resource Manager where support for the Generic Register descriptor was not fully implemented. This descriptor is now fully recognized, parsed, disassembled, and displayed. Restructured the Resource Manager code to utilize table-driven dispatch and lookup, eliminating many of the large switch() statements. This reduces overall subsystem code size and code complexity. Affects the resource parsing and construction, disassembly, and debug dump output. Cleaned up and restructured the debug dump output for all resource descriptors. Improved readability of the output and reduced code size. Fixed a problem where changes to internal data structures caused the optional ACPI_MUTEX_DEBUG code to fail compilation if specified. Signed-off-by: Robert Moore Signed-off-by: Len Brown --- include/acpi/acconfig.h | 4 ++-- include/acpi/acdisasm.h | 36 ++++++++++++++-------------- include/acpi/aclocal.h | 23 ++++++++++++++---- include/acpi/acresrc.h | 46 ++++++++++++++++++++++------------- include/acpi/actypes.h | 13 +++++++++- include/acpi/amlresrc.h | 56 +++++++++++++++++-------------------------- include/acpi/platform/acenv.h | 1 + 7 files changed, 104 insertions(+), 75 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 427cff1a3f8..1427c5cf430 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -61,9 +61,9 @@ * */ -/* Version string */ +/* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20050902 +#define ACPI_CA_VERSION 0x20050916 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index 3d96dcb1bb4..759b4cff4f8 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h @@ -187,73 +187,73 @@ void acpi_dm_decode_attribute(u8 attribute); * dmresrcl */ void -acpi_dm_word_descriptor(struct asl_word_address_desc *resource, +acpi_dm_word_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_dword_descriptor(struct asl_dword_address_desc *resource, +acpi_dm_dword_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_extended_descriptor(struct asl_extended_address_desc *resource, +acpi_dm_extended_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_qword_descriptor(struct asl_qword_address_desc *resource, +acpi_dm_qword_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_memory24_descriptor(struct asl_memory_24_desc *resource, +acpi_dm_memory24_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_memory32_descriptor(struct asl_memory_32_desc *resource, +acpi_dm_memory32_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_fixed_mem32_descriptor(struct asl_fixed_memory_32_desc *resource, - u32 length, u32 level); +acpi_dm_fixed_memory32_descriptor(union asl_resource_desc *resource, + u32 length, u32 level); void -acpi_dm_generic_register_descriptor(struct asl_general_register_desc *resource, +acpi_dm_generic_register_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_interrupt_descriptor(struct asl_extended_xrupt_desc *resource, +acpi_dm_interrupt_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_vendor_large_descriptor(struct asl_large_vendor_desc *resource, +acpi_dm_vendor_large_descriptor(union asl_resource_desc *resource, u32 length, u32 level); /* * dmresrcs */ void -acpi_dm_irq_descriptor(struct asl_irq_format_desc *resource, +acpi_dm_irq_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_dma_descriptor(struct asl_dma_format_desc *resource, +acpi_dm_dma_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_io_descriptor(struct asl_io_port_desc *resource, u32 length, u32 level); +acpi_dm_io_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_fixed_io_descriptor(struct asl_fixed_io_port_desc *resource, +acpi_dm_fixed_io_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_start_dependent_descriptor(struct asl_start_dependent_desc *resource, +acpi_dm_start_dependent_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_end_dependent_descriptor(struct asl_start_dependent_desc *resource, +acpi_dm_end_dependent_descriptor(union asl_resource_desc *resource, u32 length, u32 level); void -acpi_dm_vendor_small_descriptor(struct asl_small_vendor_desc *resource, +acpi_dm_vendor_small_descriptor(union asl_resource_desc *resource, u32 length, u32 level); /* diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 9fba0fddda9..76ac1533c40 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -744,12 +744,13 @@ struct acpi_bit_register_info { #define ACPI_RDESC_TYPE_LARGE 0x80 #define ACPI_RDESC_TYPE_SMALL 0x00 -#define ACPI_RDESC_TYPE_MASK 0x80 -#define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */ +#define ACPI_RDESC_SMALL_MASK 0x78 /* Bits 6:3 contain the type */ +#define ACPI_RDESC_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */ +#define ACPI_RDESC_LARGE_MASK 0x7F /* Bits 6:0 contain the type */ /* * Small resource descriptor types - * Note: The 3 length bits (2:0) must be zero + * Note: Bits 2:0 are used for the descriptor length */ #define ACPI_RDESC_TYPE_IRQ_FORMAT 0x20 #define ACPI_RDESC_TYPE_DMA_FORMAT 0x28 @@ -757,6 +758,10 @@ struct acpi_bit_register_info { #define ACPI_RDESC_TYPE_END_DEPENDENT 0x38 #define ACPI_RDESC_TYPE_IO_PORT 0x40 #define ACPI_RDESC_TYPE_FIXED_IO_PORT 0x48 +#define ACPI_RDESC_TYPE_RESERVED_S1 0x50 +#define ACPI_RDESC_TYPE_RESERVED_S2 0x58 +#define ACPI_RDESC_TYPE_RESERVED_S3 0x60 +#define ACPI_RDESC_TYPE_RESERVED_S4 0x68 #define ACPI_RDESC_TYPE_SMALL_VENDOR 0x70 #define ACPI_RDESC_TYPE_END_TAG 0x78 @@ -764,7 +769,8 @@ struct acpi_bit_register_info { * Large resource descriptor types */ #define ACPI_RDESC_TYPE_MEMORY_24 0x81 -#define ACPI_RDESC_TYPE_GENERAL_REGISTER 0x82 +#define ACPI_RDESC_TYPE_GENERIC_REGISTER 0x82 +#define ACPI_RDESC_TYPE_RESERVED_L1 0x83 #define ACPI_RDESC_TYPE_LARGE_VENDOR 0x84 #define ACPI_RDESC_TYPE_MEMORY_32 0x85 #define ACPI_RDESC_TYPE_FIXED_MEMORY_32 0x86 @@ -773,6 +779,15 @@ struct acpi_bit_register_info { #define ACPI_RDESC_TYPE_EXTENDED_XRUPT 0x89 #define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A #define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B +#define ACPI_RDESC_LARGE_MAX 0x8B + +/* + * Minimum lengths for descriptors with optional fields + */ +#define ACPI_RDESC_QWORD_MIN 43 +#define ACPI_RDESC_DWORD_MIN 23 +#define ACPI_RDESC_WORD_MIN 13 +#define ACPI_RDESC_EXT_XRUPT_MIN 6 /***************************************************************************** * diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index 38e798b05d0..ce2cf72fd4c 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h @@ -110,7 +110,7 @@ acpi_rs_byte_stream_to_list(u8 * byte_stream_buffer, u32 byte_stream_buffer_length, u8 * output_buffer); acpi_status -acpi_rs_list_to_byte_stream(struct acpi_resource *linked_list, +acpi_rs_list_to_byte_stream(struct acpi_resource *resource, acpi_size byte_stream_size_needed, u8 * output_buffer); @@ -125,11 +125,11 @@ acpi_rs_fixed_io_resource(u8 * byte_stream_buffer, u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_io_stream(struct acpi_resource *linked_list, +acpi_rs_io_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_fixed_io_stream(struct acpi_resource *linked_list, +acpi_rs_fixed_io_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status @@ -138,7 +138,7 @@ acpi_rs_irq_resource(u8 * byte_stream_buffer, u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_irq_stream(struct acpi_resource *linked_list, +acpi_rs_irq_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status @@ -147,7 +147,7 @@ acpi_rs_dma_resource(u8 * byte_stream_buffer, u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_dma_stream(struct acpi_resource *linked_list, +acpi_rs_dma_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status @@ -156,7 +156,7 @@ acpi_rs_address16_resource(u8 * byte_stream_buffer, u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_address16_stream(struct acpi_resource *linked_list, +acpi_rs_address16_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status @@ -165,7 +165,7 @@ acpi_rs_address32_resource(u8 * byte_stream_buffer, u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_address32_stream(struct acpi_resource *linked_list, +acpi_rs_address32_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status @@ -174,7 +174,7 @@ acpi_rs_address64_resource(u8 * byte_stream_buffer, u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_address64_stream(struct acpi_resource *linked_list, +acpi_rs_address64_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status @@ -190,12 +190,12 @@ acpi_rs_end_depend_fns_resource(u8 * byte_stream_buffer, acpi_size * structure_size); acpi_status -acpi_rs_start_depend_fns_stream(struct acpi_resource *linked_list, +acpi_rs_start_depend_fns_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_end_depend_fns_stream(struct acpi_resource *linked_list, +acpi_rs_end_depend_fns_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status @@ -204,7 +204,7 @@ acpi_rs_memory24_resource(u8 * byte_stream_buffer, u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_memory24_stream(struct acpi_resource *linked_list, +acpi_rs_memory24_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status @@ -220,11 +220,11 @@ acpi_rs_fixed_memory32_resource(u8 * byte_stream_buffer, acpi_size * structure_size); acpi_status -acpi_rs_memory32_range_stream(struct acpi_resource *linked_list, +acpi_rs_memory32_range_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status -acpi_rs_fixed_memory32_stream(struct acpi_resource *linked_list, +acpi_rs_fixed_memory32_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status @@ -233,7 +233,7 @@ acpi_rs_extended_irq_resource(u8 * byte_stream_buffer, u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_extended_irq_stream(struct acpi_resource *linked_list, +acpi_rs_extended_irq_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status @@ -242,7 +242,7 @@ acpi_rs_end_tag_resource(u8 * byte_stream_buffer, u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_end_tag_stream(struct acpi_resource *linked_list, +acpi_rs_end_tag_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); acpi_status @@ -251,9 +251,23 @@ acpi_rs_vendor_resource(u8 * byte_stream_buffer, u8 ** output_buffer, acpi_size * structure_size); acpi_status -acpi_rs_vendor_stream(struct acpi_resource *linked_list, +acpi_rs_vendor_stream(struct acpi_resource *resource, u8 ** output_buffer, acpi_size * bytes_consumed); u8 acpi_rs_get_resource_type(u8 resource_start_byte); +/* + * rsmisc + */ +acpi_status +acpi_rs_generic_register_resource(u8 * byte_stream_buffer, + acpi_size * bytes_consumed, + u8 ** output_buffer, + acpi_size * structure_size); + +acpi_status +acpi_rs_generic_register_stream(struct acpi_resource *resource, + u8 ** output_buffer, + acpi_size * bytes_consumed); + #endif /* __ACRESRC_H__ */ diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 6213b27516e..1dfa64fae4e 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -1125,6 +1125,14 @@ struct acpi_resource_ext_irq { u32 interrupts[1]; }; +struct acpi_resource_generic_reg { + u32 space_id; + u32 bit_width; + u32 bit_offset; + u32 address_size; + u64 address; +}; + /* ACPI_RESOURCE_TYPEs */ #define ACPI_RSTYPE_IRQ 0 @@ -1142,6 +1150,8 @@ struct acpi_resource_ext_irq { #define ACPI_RSTYPE_ADDRESS32 12 #define ACPI_RSTYPE_ADDRESS64 13 #define ACPI_RSTYPE_EXT_IRQ 14 +#define ACPI_RSTYPE_GENERIC_REG 15 +#define ACPI_RSTYPE_MAX 15 typedef u32 acpi_resource_type; @@ -1161,10 +1171,11 @@ union acpi_resource_data { struct acpi_resource_address32 address32; struct acpi_resource_address64 address64; struct acpi_resource_ext_irq extended_irq; + struct acpi_resource_generic_reg generic_reg; }; struct acpi_resource { - acpi_resource_type id; + acpi_resource_type type; u32 length; union acpi_resource_data data; }; diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h index 051786e4b21..a3c46ba6358 100644 --- a/include/acpi/amlresrc.h +++ b/include/acpi/amlresrc.h @@ -157,10 +157,15 @@ struct asl_end_tag_desc { /* LARGE descriptors */ +#define ASL_LARGE_HEADER_COMMON \ + u8 descriptor_type;\ + u16 length; + +struct asl_large_header { +ASL_LARGE_HEADER_COMMON}; + struct asl_memory_24_desc { - u8 descriptor_type; - u16 length; - u8 information; + ASL_LARGE_HEADER_COMMON u8 information; u16 address_min; u16 address_max; u16 alignment; @@ -168,15 +173,11 @@ struct asl_memory_24_desc { }; struct asl_large_vendor_desc { - u8 descriptor_type; - u16 length; - u8 vendor_defined[1]; + ASL_LARGE_HEADER_COMMON u8 vendor_defined[1]; }; struct asl_memory_32_desc { - u8 descriptor_type; - u16 length; - u8 information; + ASL_LARGE_HEADER_COMMON u8 information; u32 address_min; u32 address_max; u32 alignment; @@ -184,17 +185,13 @@ struct asl_memory_32_desc { }; struct asl_fixed_memory_32_desc { - u8 descriptor_type; - u16 length; - u8 information; + ASL_LARGE_HEADER_COMMON u8 information; u32 base_address; u32 range_length; }; struct asl_extended_address_desc { - u8 descriptor_type; - u16 length; - u8 resource_type; + ASL_LARGE_HEADER_COMMON u8 resource_type; u8 flags; u8 specific_flags; u8 revision_iD; @@ -211,9 +208,7 @@ struct asl_extended_address_desc { #define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */ struct asl_qword_address_desc { - u8 descriptor_type; - u16 length; - u8 resource_type; + ASL_LARGE_HEADER_COMMON u8 resource_type; u8 flags; u8 specific_flags; u64 granularity; @@ -225,9 +220,7 @@ struct asl_qword_address_desc { }; struct asl_dword_address_desc { - u8 descriptor_type; - u16 length; - u8 resource_type; + ASL_LARGE_HEADER_COMMON u8 resource_type; u8 flags; u8 specific_flags; u32 granularity; @@ -239,9 +232,7 @@ struct asl_dword_address_desc { }; struct asl_word_address_desc { - u8 descriptor_type; - u16 length; - u8 resource_type; + ASL_LARGE_HEADER_COMMON u8 resource_type; u8 flags; u8 specific_flags; u16 granularity; @@ -253,18 +244,14 @@ struct asl_word_address_desc { }; struct asl_extended_xrupt_desc { - u8 descriptor_type; - u16 length; - u8 flags; + ASL_LARGE_HEADER_COMMON u8 flags; u8 table_length; u32 interrupt_number[1]; /* res_source_index, res_source optional fields follow */ }; -struct asl_general_register_desc { - u8 descriptor_type; - u16 length; - u8 address_space_id; +struct asl_generic_register_desc { + ASL_LARGE_HEADER_COMMON u8 address_space_id; u8 bit_width; u8 bit_offset; u8 access_size; /* ACPI 3.0, was Reserved */ @@ -280,13 +267,14 @@ struct asl_general_register_desc { union asl_resource_desc { struct asl_irq_format_desc irq; struct asl_dma_format_desc dma; - struct asl_start_dependent_desc std; - struct asl_end_dependent_desc end; struct asl_io_port_desc iop; struct asl_fixed_io_port_desc fio; + struct asl_start_dependent_desc std; + struct asl_end_dependent_desc end; struct asl_small_vendor_desc smv; struct asl_end_tag_desc et; + struct asl_large_header lhd; struct asl_memory_24_desc M24; struct asl_large_vendor_desc lgv; struct asl_memory_32_desc M32; @@ -296,7 +284,7 @@ union asl_resource_desc { struct asl_word_address_desc was; struct asl_extended_address_desc eas; struct asl_extended_xrupt_desc exx; - struct asl_general_register_desc grg; + struct asl_generic_register_desc grg; u32 u32_item; u16 u16_item; u8 U8item; diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 16609c1ab2e..08539125696 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -68,6 +68,7 @@ #define ACPI_APPLICATION #define ACPI_DEBUGGER #define ACPI_DISASSEMBLER +#define ACPI_MUTEX_DEBUG #endif #ifdef ACPI_ASL_COMPILER -- cgit v1.2.3 From 05131ecc99ea9da7f45ba3058fe8a2c1d0ceeab8 Mon Sep 17 00:00:00 2001 From: Venkatesh Pallipadi Date: Sun, 23 Oct 2005 16:31:00 -0400 Subject: [ACPI] Avoid BIOS inflicted crashes by evaluating _PDC only once Linux invokes the AML _PDC method (Processor Driver Capabilities) to tell the BIOS what features it can handle. While the ACPI spec says nothing about the OS invoking _PDC multiple times, doing so with changing bits seems to hopelessly confuse the BIOS on multiple platforms up to and including crashing the system. Factor out the _PDC invocation so Linux invokes it only once. http://bugzilla.kernel.org/show_bug.cgi?id=5483 Signed-off-by: Venkatesh Pallipadi Signed-off-by: Len Brown --- include/acpi/pdc_intel.h | 4 +--- include/acpi/processor.h | 22 +++++----------------- include/asm-i386/acpi.h | 2 +- 3 files changed, 7 insertions(+), 21 deletions(-) (limited to 'include') diff --git a/include/acpi/pdc_intel.h b/include/acpi/pdc_intel.h index 91f4a12a99a..3fa81d55cd0 100644 --- a/include/acpi/pdc_intel.h +++ b/include/acpi/pdc_intel.h @@ -15,9 +15,7 @@ #define ACPI_PDC_C_C1_FFH (0x0100) #define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \ - ACPI_PDC_C_C1_HALT) - -#define ACPI_PDC_EST_CAPABILITY_SMP_MSR (ACPI_PDC_EST_CAPABILITY_SMP | \ + ACPI_PDC_C_C1_HALT | \ ACPI_PDC_P_FFH) #define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \ diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 7a00d5089de..82a9b7d430e 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -62,9 +62,6 @@ struct acpi_processor_power { u32 bm_activity; int count; struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; - - /* the _PDC objects passed by the driver, if any */ - struct acpi_object_list *pdc; }; /* Performance Management */ @@ -96,8 +93,6 @@ struct acpi_processor_performance { unsigned int state_count; struct acpi_processor_px *states; - /* the _PDC objects passed by the driver, if any */ - struct acpi_object_list *pdc; }; /* Throttling Control */ @@ -151,6 +146,9 @@ struct acpi_processor { struct acpi_processor_performance *performance; struct acpi_processor_throttling throttling; struct acpi_processor_limit limit; + + /* the _PDC objects for this processor, if any */ + struct acpi_object_list *pdc; }; struct acpi_processor_errata { @@ -178,22 +176,12 @@ int acpi_processor_notify_smm(struct module *calling_module); extern struct acpi_processor *processors[NR_CPUS]; extern struct acpi_processor_errata errata; -int acpi_processor_set_pdc(struct acpi_processor *pr, - struct acpi_object_list *pdc_in); +void arch_acpi_processor_init_pdc(struct acpi_processor *pr); -#ifdef ARCH_HAS_POWER_PDC_INIT -void acpi_processor_power_init_pdc(struct acpi_processor_power *pow, - unsigned int cpu); +#ifdef ARCH_HAS_POWER_INIT void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, unsigned int cpu); #else -static inline void acpi_processor_power_init_pdc(struct acpi_processor_power - *pow, unsigned int cpu) -{ - pow->pdc = NULL; - return; -} - static inline void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, unsigned int cpu) diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h index df4ed323aa4..55059abf9c9 100644 --- a/include/asm-i386/acpi.h +++ b/include/asm-i386/acpi.h @@ -179,7 +179,7 @@ extern void acpi_reserve_bootmem(void); extern u8 x86_acpiid_to_apicid[]; -#define ARCH_HAS_POWER_PDC_INIT 1 +#define ARCH_HAS_POWER_INIT 1 #endif /*__KERNEL__*/ -- cgit v1.2.3 From 50eca3eb89d73d9f0aa070b126c7ee6a616016ab Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 30 Sep 2005 19:03:00 -0400 Subject: [ACPI] ACPICA 20050930 Completed a major overhaul of the Resource Manager code - specifically, optimizations in the area of the AML/internal resource conversion code. The code has been optimized to simplify and eliminate duplicated code, CPU stack use has been decreased by optimizing function parameters and local variables, and naming conventions across the manager have been standardized for clarity and ease of maintenance (this includes function, parameter, variable, and struct/typedef names.) All Resource Manager dispatch and information tables have been moved to a single location for clarity and ease of maintenance. One new file was created, named "rsinfo.c". The ACPI return macros (return_ACPI_STATUS, etc.) have been modified to guarantee that the argument is not evaluated twice, making them less prone to macro side-effects. However, since there exists the possibility of additional stack use if a particular compiler cannot optimize them (such as in the debug generation case), the original macros are optionally available. Note that some invocations of the return_VALUE macro may now cause size mismatch warnings; the return_UINT8 and return_UINT32 macros are provided to eliminate these. (From Randy Dunlap) Implemented a new mechanism to enable debug tracing for individual control methods. A new external interface, acpi_debug_trace(), is provided to enable this mechanism. The intent is to allow the host OS to easily enable and disable tracing for problematic control methods. This interface can be easily exposed to a user or debugger interface if desired. See the file psxface.c for details. acpi_ut_callocate() will now return a valid pointer if a length of zero is specified - a length of one is used and a warning is issued. This matches the behavior of acpi_ut_allocate(). Signed-off-by: Bob Moore Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- include/acpi/acdisasm.h | 40 +++--- include/acpi/acglobal.h | 9 ++ include/acpi/aclocal.h | 79 +++++------ include/acpi/acmacros.h | 58 +++++++- include/acpi/acpi_drivers.h | 4 +- include/acpi/acpixf.h | 3 + include/acpi/acresrc.h | 313 +++++++++++++++++++++++++++++--------------- include/acpi/actypes.h | 152 +++++++++++---------- include/acpi/amlresrc.h | 242 +++++++++++++++++----------------- include/asm-x86_64/mpspec.h | 2 +- include/linux/acpi.h | 2 +- 12 files changed, 537 insertions(+), 369 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 1427c5cf430..cb59b018c84 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20050916 +#define ACPI_CA_VERSION 0x20050930 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index 759b4cff4f8..b2921b869bb 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h @@ -187,73 +187,67 @@ void acpi_dm_decode_attribute(u8 attribute); * dmresrcl */ void -acpi_dm_word_descriptor(union asl_resource_desc *resource, - u32 length, u32 level); +acpi_dm_word_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_dword_descriptor(union asl_resource_desc *resource, - u32 length, u32 level); +acpi_dm_dword_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_extended_descriptor(union asl_resource_desc *resource, +acpi_dm_extended_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_qword_descriptor(union asl_resource_desc *resource, - u32 length, u32 level); +acpi_dm_qword_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_memory24_descriptor(union asl_resource_desc *resource, +acpi_dm_memory24_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_memory32_descriptor(union asl_resource_desc *resource, +acpi_dm_memory32_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_fixed_memory32_descriptor(union asl_resource_desc *resource, +acpi_dm_fixed_memory32_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_generic_register_descriptor(union asl_resource_desc *resource, +acpi_dm_generic_register_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_interrupt_descriptor(union asl_resource_desc *resource, +acpi_dm_interrupt_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_vendor_large_descriptor(union asl_resource_desc *resource, +acpi_dm_vendor_large_descriptor(union aml_resource *resource, u32 length, u32 level); /* * dmresrcs */ void -acpi_dm_irq_descriptor(union asl_resource_desc *resource, - u32 length, u32 level); +acpi_dm_irq_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_dma_descriptor(union asl_resource_desc *resource, - u32 length, u32 level); +acpi_dm_dma_descriptor(union aml_resource *resource, u32 length, u32 level); -void -acpi_dm_io_descriptor(union asl_resource_desc *resource, u32 length, u32 level); +void acpi_dm_io_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_fixed_io_descriptor(union asl_resource_desc *resource, +acpi_dm_fixed_io_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_start_dependent_descriptor(union asl_resource_desc *resource, +acpi_dm_start_dependent_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_end_dependent_descriptor(union asl_resource_desc *resource, +acpi_dm_end_dependent_descriptor(union aml_resource *resource, u32 length, u32 level); void -acpi_dm_vendor_small_descriptor(union asl_resource_desc *resource, +acpi_dm_vendor_small_descriptor(union aml_resource *resource, u32 length, u32 level); /* diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index e9c2790139e..cef51b1ddf9 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h @@ -80,6 +80,15 @@ extern u32 acpi_dbg_layer; extern u32 acpi_gbl_nesting_level; +/* Support for dynamic control method tracing mechanism */ + +ACPI_EXTERN u32 acpi_gbl_original_dbg_level; +ACPI_EXTERN u32 acpi_gbl_original_dbg_layer; +ACPI_EXTERN acpi_name acpi_gbl_trace_method_name; +ACPI_EXTERN u32 acpi_gbl_trace_dbg_level; +ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer; +ACPI_EXTERN u32 acpi_gbl_trace_flags; + /***************************************************************************** * * Runtime configuration (static defaults that can be overriden at runtime) diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 76ac1533c40..dca0d40ea39 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -735,59 +735,52 @@ struct acpi_bit_register_info { /* resource_type values */ -#define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0 -#define ACPI_RESOURCE_TYPE_IO_RANGE 1 -#define ACPI_RESOURCE_TYPE_BUS_NUMBER_RANGE 2 +#define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0 +#define ACPI_ADDRESS_TYPE_IO_RANGE 1 +#define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2 /* Resource descriptor types and masks */ -#define ACPI_RDESC_TYPE_LARGE 0x80 -#define ACPI_RDESC_TYPE_SMALL 0x00 +#define ACPI_RESOURCE_NAME_LARGE 0x80 +#define ACPI_RESOURCE_NAME_SMALL 0x00 -#define ACPI_RDESC_SMALL_MASK 0x78 /* Bits 6:3 contain the type */ -#define ACPI_RDESC_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */ -#define ACPI_RDESC_LARGE_MASK 0x7F /* Bits 6:0 contain the type */ +#define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */ +#define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */ +#define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */ /* - * Small resource descriptor types + * Small resource descriptor "names" as defined by the ACPI specification. * Note: Bits 2:0 are used for the descriptor length */ -#define ACPI_RDESC_TYPE_IRQ_FORMAT 0x20 -#define ACPI_RDESC_TYPE_DMA_FORMAT 0x28 -#define ACPI_RDESC_TYPE_START_DEPENDENT 0x30 -#define ACPI_RDESC_TYPE_END_DEPENDENT 0x38 -#define ACPI_RDESC_TYPE_IO_PORT 0x40 -#define ACPI_RDESC_TYPE_FIXED_IO_PORT 0x48 -#define ACPI_RDESC_TYPE_RESERVED_S1 0x50 -#define ACPI_RDESC_TYPE_RESERVED_S2 0x58 -#define ACPI_RDESC_TYPE_RESERVED_S3 0x60 -#define ACPI_RDESC_TYPE_RESERVED_S4 0x68 -#define ACPI_RDESC_TYPE_SMALL_VENDOR 0x70 -#define ACPI_RDESC_TYPE_END_TAG 0x78 +#define ACPI_RESOURCE_NAME_IRQ 0x20 +#define ACPI_RESOURCE_NAME_DMA 0x28 +#define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30 +#define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38 +#define ACPI_RESOURCE_NAME_IO 0x40 +#define ACPI_RESOURCE_NAME_FIXED_IO 0x48 +#define ACPI_RESOURCE_NAME_RESERVED_S1 0x50 +#define ACPI_RESOURCE_NAME_RESERVED_S2 0x58 +#define ACPI_RESOURCE_NAME_RESERVED_S3 0x60 +#define ACPI_RESOURCE_NAME_RESERVED_S4 0x68 +#define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70 +#define ACPI_RESOURCE_NAME_END_TAG 0x78 /* - * Large resource descriptor types + * Large resource descriptor "names" as defined by the ACPI specification. + * Note: includes the Large Descriptor bit in bit[7] */ -#define ACPI_RDESC_TYPE_MEMORY_24 0x81 -#define ACPI_RDESC_TYPE_GENERIC_REGISTER 0x82 -#define ACPI_RDESC_TYPE_RESERVED_L1 0x83 -#define ACPI_RDESC_TYPE_LARGE_VENDOR 0x84 -#define ACPI_RDESC_TYPE_MEMORY_32 0x85 -#define ACPI_RDESC_TYPE_FIXED_MEMORY_32 0x86 -#define ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE 0x87 -#define ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE 0x88 -#define ACPI_RDESC_TYPE_EXTENDED_XRUPT 0x89 -#define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A -#define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B -#define ACPI_RDESC_LARGE_MAX 0x8B - -/* - * Minimum lengths for descriptors with optional fields - */ -#define ACPI_RDESC_QWORD_MIN 43 -#define ACPI_RDESC_DWORD_MIN 23 -#define ACPI_RDESC_WORD_MIN 13 -#define ACPI_RDESC_EXT_XRUPT_MIN 6 +#define ACPI_RESOURCE_NAME_MEMORY24 0x81 +#define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82 +#define ACPI_RESOURCE_NAME_RESERVED_L1 0x83 +#define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84 +#define ACPI_RESOURCE_NAME_MEMORY32 0x85 +#define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86 +#define ACPI_RESOURCE_NAME_ADDRESS32 0x87 +#define ACPI_RESOURCE_NAME_ADDRESS16 0x88 +#define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89 +#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A +#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B +#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B /***************************************************************************** * @@ -795,7 +788,7 @@ struct acpi_bit_register_info { * ****************************************************************************/ -#define ACPI_ASCII_ZERO 0x30 +#define ACPI_ASCII_ZERO 0x30 /***************************************************************************** * diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 702cc4e57f5..258cfe5e2aa 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -525,6 +525,9 @@ * bad form, but having a separate exit macro is very ugly and difficult to maintain. * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros * so that "_acpi_function_name" is defined. + * + * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining + * about these constructs. */ #ifdef ACPI_USE_DO_WHILE_0 #define ACPI_DO_WHILE0(a) do a while(0) @@ -532,10 +535,55 @@ #define ACPI_DO_WHILE0(a) a #endif -#define return_VOID ACPI_DO_WHILE0 ({acpi_ut_exit(ACPI_DEBUG_PARAMETERS);return;}) -#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({acpi_ut_status_exit(ACPI_DEBUG_PARAMETERS,(s));return((s));}) -#define return_VALUE(s) ACPI_DO_WHILE0 ({acpi_ut_value_exit(ACPI_DEBUG_PARAMETERS,(acpi_integer)(s));return((s));}) -#define return_PTR(s) ACPI_DO_WHILE0 ({acpi_ut_ptr_exit(ACPI_DEBUG_PARAMETERS,(u8 *)(s));return((s));}) +#define return_VOID ACPI_DO_WHILE0 ({ \ + acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \ + return;}) +/* + * There are two versions of most of the return macros. The default version is + * safer, since it avoids side-effects by guaranteeing that the argument will + * not be evaluated twice. + * + * A less-safe version of the macros is provided for optional use if the + * compiler uses excessive CPU stack (for example, this may happen in the + * debug case if code optimzation is disabled.) + */ +#ifndef ACPI_SIMPLE_RETURN_MACROS + +#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \ + register acpi_status _s = (s); \ + acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, _s); \ + return (_s); }) +#define return_PTR(s) ACPI_DO_WHILE0 ({ \ + register void *_s = (void *) (s); \ + acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) _s); \ + return (_s); }) +#define return_VALUE(s) ACPI_DO_WHILE0 ({ \ + register acpi_integer _s = (s); \ + acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \ + return (_s); }) +#define return_UINT8(s) ACPI_DO_WHILE0 ({ \ + register u8 _s = (u8) (s); \ + acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \ + return (_s); }) +#define return_UINT32(s) ACPI_DO_WHILE0 ({ \ + register u32 _s = (u32) (s); \ + acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \ + return (_s); }) +#else /* Use original less-safe macros */ + +#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \ + acpi_ut_status_exit (ACPI_DEBUG_PARAMETERS, (s)); \ + return((s)); }) +#define return_PTR(s) ACPI_DO_WHILE0 ({ \ + acpi_ut_ptr_exit (ACPI_DEBUG_PARAMETERS, (u8 *) (s)); \ + return((s)); }) +#define return_VALUE(s) ACPI_DO_WHILE0 ({ \ + acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) (s)); \ + return((s)); }) +#define return_UINT8(s) return_VALUE(s) +#define return_UINT32(s) return_VALUE(s) + +#endif /* ACPI_SIMPLE_RETURN_MACROS */ /* Conditional execution */ @@ -612,6 +660,8 @@ #define return_VOID return #define return_ACPI_STATUS(s) return(s) #define return_VALUE(s) return(s) +#define return_UINT8(s) return(s) +#define return_UINT32(s) return(s) #define return_PTR(s) return(s) #endif diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index c1b4e1f882e..b425f9bb6d4 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -52,8 +52,8 @@ /* ACPI PCI Interrupt Link (pci_link.c) */ int acpi_irq_penalty_init(void); -int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *edge_level, - int *active_high_low, char **name); +int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering, + int *polarity, char **name); int acpi_pci_link_free_irq(acpi_handle handle); /* ACPI PCI Interrupt Routing (pci_irq.c) */ diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 2a9dbc13b0f..02f00a8fee0 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -149,6 +149,9 @@ acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler); acpi_status acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data); +acpi_status +acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags); + /* * Object manipulation and enumeration */ diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index ce2cf72fd4c..b66994e9e4e 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h @@ -44,6 +44,51 @@ #ifndef __ACRESRC_H__ #define __ACRESRC_H__ +/* Need the AML resource descriptor structs */ + +#include "amlresrc.h" + +/* + * Resource dispatch and info tables + */ +struct acpi_resource_info { + u8 length_type; + u8 minimum_aml_resource_length; + u8 minimum_internal_struct_length; +}; + +/* Types for length_type above */ + +#define ACPI_FIXED_LENGTH 0 +#define ACPI_VARIABLE_LENGTH 1 +#define ACPI_SMALL_VARIABLE_LENGTH 2 + +/* Handlers */ + +typedef acpi_status(*ACPI_SET_RESOURCE_HANDLER) (struct acpi_resource * + resource, + union aml_resource * aml); + +typedef acpi_status(*ACPI_GET_RESOURCE_HANDLER) (union aml_resource * aml, + u16 aml_resource_length, + struct acpi_resource * + resource); + +typedef void (*ACPI_DUMP_RESOURCE_HANDLER) (union acpi_resource_data * data); + +/* Tables indexed by internal resource type */ + +extern u8 acpi_gbl_aml_resource_sizes[]; +extern ACPI_SET_RESOURCE_HANDLER acpi_gbl_set_resource_dispatch[]; +extern ACPI_DUMP_RESOURCE_HANDLER acpi_gbl_dump_resource_dispatch[]; + +/* Tables indexed by raw AML resource descriptor type */ + +extern struct acpi_resource_info acpi_gbl_sm_resource_info[]; +extern struct acpi_resource_info acpi_gbl_lg_resource_info[]; +extern ACPI_GET_RESOURCE_HANDLER acpi_gbl_sm_get_resource_dispatch[]; +extern ACPI_GET_RESOURCE_HANDLER acpi_gbl_lg_get_resource_dispatch[]; + /* * Function prototypes called from Acpi* APIs */ @@ -66,12 +111,12 @@ acpi_status acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); acpi_status -acpi_rs_create_resource_list(union acpi_operand_object *byte_stream_buffer, +acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, struct acpi_buffer *output_buffer); acpi_status -acpi_rs_create_byte_stream(struct acpi_resource *linked_list_buffer, - struct acpi_buffer *output_buffer); +acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer, + struct acpi_buffer *output_buffer); acpi_status acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, @@ -90,184 +135,240 @@ void acpi_rs_dump_irq_list(u8 * route_table); * rscalc */ acpi_status -acpi_rs_get_byte_stream_start(u8 * byte_stream_buffer, - u8 ** byte_stream_start, u32 * size); - -acpi_status -acpi_rs_get_list_length(u8 * byte_stream_buffer, - u32 byte_stream_buffer_length, acpi_size * size_needed); +acpi_rs_get_list_length(u8 * aml_buffer, + u32 aml_buffer_length, acpi_size * size_needed); acpi_status -acpi_rs_get_byte_stream_length(struct acpi_resource *linked_list_buffer, - acpi_size * size_needed); +acpi_rs_get_aml_length(struct acpi_resource *linked_list_buffer, + acpi_size * size_needed); acpi_status acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object, acpi_size * buffer_size_needed); acpi_status -acpi_rs_byte_stream_to_list(u8 * byte_stream_buffer, - u32 byte_stream_buffer_length, u8 * output_buffer); +acpi_rs_convert_aml_to_resources(u8 * aml_buffer, + u32 aml_buffer_length, u8 * output_buffer); acpi_status -acpi_rs_list_to_byte_stream(struct acpi_resource *resource, - acpi_size byte_stream_size_needed, - u8 * output_buffer); +acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, + acpi_size aml_size_needed, u8 * output_buffer); +/* + * rsio + */ acpi_status -acpi_rs_io_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, acpi_size * structure_size); +acpi_rs_get_io(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_fixed_io_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, acpi_size * structure_size); +acpi_rs_set_io(struct acpi_resource *resource, union aml_resource *aml); acpi_status -acpi_rs_io_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_get_fixed_io(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_fixed_io_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_set_fixed_io(struct acpi_resource *resource, union aml_resource *aml); acpi_status -acpi_rs_irq_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, acpi_size * structure_size); +acpi_rs_get_dma(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_irq_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_set_dma(struct acpi_resource *resource, union aml_resource *aml); +/* + * rsirq + */ acpi_status -acpi_rs_dma_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, acpi_size * structure_size); +acpi_rs_get_irq(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_dma_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_set_irq(struct acpi_resource *resource, union aml_resource *aml); acpi_status -acpi_rs_address16_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, acpi_size * structure_size); +acpi_rs_get_ext_irq(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_address16_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_set_ext_irq(struct acpi_resource *resource, union aml_resource *aml); + +/* + * rsaddr + */ +acpi_status +acpi_rs_get_address16(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_address32_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, acpi_size * structure_size); +acpi_rs_set_address16(struct acpi_resource *resource, union aml_resource *aml); acpi_status -acpi_rs_address32_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_get_address32(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_address64_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, acpi_size * structure_size); +acpi_rs_set_address32(struct acpi_resource *resource, union aml_resource *aml); acpi_status -acpi_rs_address64_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_get_address64(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_start_depend_fns_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, - acpi_size * structure_size); +acpi_rs_set_address64(struct acpi_resource *resource, union aml_resource *aml); + +acpi_status +acpi_rs_get_ext_address64(union aml_resource *aml, + u16 aml_resource_length, + struct acpi_resource *resource); + +acpi_status +acpi_rs_set_ext_address64(struct acpi_resource *resource, + union aml_resource *aml); + +/* + * rsmemory + */ +acpi_status +acpi_rs_get_memory24(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_end_depend_fns_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, - acpi_size * structure_size); +acpi_rs_set_memory24(struct acpi_resource *resource, union aml_resource *aml); acpi_status -acpi_rs_start_depend_fns_stream(struct acpi_resource *resource, - u8 ** output_buffer, - acpi_size * bytes_consumed); +acpi_rs_get_memory32(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_end_depend_fns_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_set_memory32(struct acpi_resource *resource, union aml_resource *aml); acpi_status -acpi_rs_memory24_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, acpi_size * structure_size); +acpi_rs_get_fixed_memory32(union aml_resource *aml, + u16 aml_resource_length, + struct acpi_resource *resource); acpi_status -acpi_rs_memory24_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_set_fixed_memory32(struct acpi_resource *resource, + union aml_resource *aml); +/* + * rsmisc + */ acpi_status -acpi_rs_memory32_range_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, - acpi_size * structure_size); +acpi_rs_get_generic_reg(union aml_resource *aml, + u16 aml_resource_length, + struct acpi_resource *resource); acpi_status -acpi_rs_fixed_memory32_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, - acpi_size * structure_size); +acpi_rs_set_generic_reg(struct acpi_resource *resource, + union aml_resource *aml); acpi_status -acpi_rs_memory32_range_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_get_vendor(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_fixed_memory32_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_set_vendor(struct acpi_resource *resource, union aml_resource *aml); acpi_status -acpi_rs_extended_irq_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, acpi_size * structure_size); +acpi_rs_get_start_dpf(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_extended_irq_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_set_start_dpf(struct acpi_resource *resource, union aml_resource *aml); acpi_status -acpi_rs_end_tag_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, acpi_size * structure_size); +acpi_rs_get_end_dpf(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_end_tag_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_set_end_dpf(struct acpi_resource *resource, union aml_resource *aml); acpi_status -acpi_rs_vendor_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, acpi_size * structure_size); +acpi_rs_get_end_tag(union aml_resource *aml, + u16 aml_resource_length, struct acpi_resource *resource); acpi_status -acpi_rs_vendor_stream(struct acpi_resource *resource, - u8 ** output_buffer, acpi_size * bytes_consumed); +acpi_rs_set_end_tag(struct acpi_resource *resource, union aml_resource *aml); + +/* + * rsutils + */ +void +acpi_rs_move_data(void *destination, + void *source, u16 item_count, u8 move_type); + +/* Types used in move_type above */ + +#define ACPI_MOVE_TYPE_16_TO_32 0 +#define ACPI_MOVE_TYPE_32_TO_16 1 +#define ACPI_MOVE_TYPE_32_TO_32 2 +#define ACPI_MOVE_TYPE_64_TO_64 3 + +u16 +acpi_rs_get_resource_source(u16 resource_length, + acpi_size minimum_length, + struct acpi_resource_source *resource_source, + union aml_resource *aml, char *string_ptr); + +acpi_size +acpi_rs_set_resource_source(union aml_resource *aml, + acpi_size minimum_length, + struct acpi_resource_source *resource_source); u8 acpi_rs_get_resource_type(u8 resource_start_byte); +u32 acpi_rs_get_descriptor_length(union aml_resource *aml); + +u16 acpi_rs_get_resource_length(union aml_resource *aml); + +void +acpi_rs_set_resource_header(u8 descriptor_type, + acpi_size total_length, union aml_resource *aml); + +struct acpi_resource_info *acpi_rs_get_resource_info(u8 resource_type); + +#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) /* - * rsmisc + * rsdump */ -acpi_status -acpi_rs_generic_register_resource(u8 * byte_stream_buffer, - acpi_size * bytes_consumed, - u8 ** output_buffer, - acpi_size * structure_size); +void acpi_rs_dump_irq(union acpi_resource_data *resource); -acpi_status -acpi_rs_generic_register_stream(struct acpi_resource *resource, - u8 ** output_buffer, - acpi_size * bytes_consumed); +void acpi_rs_dump_address16(union acpi_resource_data *resource); + +void acpi_rs_dump_address32(union acpi_resource_data *resource); + +void acpi_rs_dump_address64(union acpi_resource_data *resource); + +void acpi_rs_dump_ext_address64(union acpi_resource_data *resource); + +void acpi_rs_dump_dma(union acpi_resource_data *resource); + +void acpi_rs_dump_io(union acpi_resource_data *resource); + +void acpi_rs_dump_ext_irq(union acpi_resource_data *resource); + +void acpi_rs_dump_fixed_io(union acpi_resource_data *resource); + +void acpi_rs_dump_fixed_memory32(union acpi_resource_data *resource); + +void acpi_rs_dump_memory24(union acpi_resource_data *resource); + +void acpi_rs_dump_memory32(union acpi_resource_data *resource); + +void acpi_rs_dump_start_dpf(union acpi_resource_data *resource); + +void acpi_rs_dump_vendor(union acpi_resource_data *resource); + +void acpi_rs_dump_generic_reg(union acpi_resource_data *resource); + +void acpi_rs_dump_end_dpf(union acpi_resource_data *resource); + +void acpi_rs_dump_end_tag(union acpi_resource_data *resource); + +#endif #endif /* __ACRESRC_H__ */ diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 1dfa64fae4e..43f7c509317 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -978,10 +978,10 @@ struct acpi_mem_space_context { * Structures used to describe device resources */ struct acpi_resource_irq { - u32 edge_level; - u32 active_high_low; - u32 shared_exclusive; - u32 number_of_interrupts; + u32 triggering; + u32 polarity; + u32 sharable; + u32 interrupt_count; u32 interrupts[1]; }; @@ -989,11 +989,11 @@ struct acpi_resource_dma { u32 type; u32 bus_master; u32 transfer; - u32 number_of_channels; + u32 channel_count; u32 channels[1]; }; -struct acpi_resource_start_dpf { +struct acpi_resource_start_dependent { u32 compatibility_priority; u32 performance_robustness; }; @@ -1005,46 +1005,46 @@ struct acpi_resource_start_dpf { struct acpi_resource_io { u32 io_decode; - u32 min_base_address; - u32 max_base_address; + u32 minimum; + u32 maximum; u32 alignment; - u32 range_length; + u32 address_length; }; struct acpi_resource_fixed_io { - u32 base_address; - u32 range_length; + u32 address; + u32 address_length; }; struct acpi_resource_vendor { - u32 length; - u8 reserved[1]; + u32 byte_length; + u8 byte_data[1]; }; struct acpi_resource_end_tag { u8 checksum; }; -struct acpi_resource_mem24 { +struct acpi_resource_memory24 { u32 read_write_attribute; - u32 min_base_address; - u32 max_base_address; + u32 minimum; + u32 maximum; u32 alignment; - u32 range_length; + u32 address_length; }; -struct acpi_resource_mem32 { +struct acpi_resource_memory32 { u32 read_write_attribute; - u32 min_base_address; - u32 max_base_address; + u32 minimum; + u32 maximum; u32 alignment; - u32 range_length; + u32 address_length; }; -struct acpi_resource_fixed_mem32 { +struct acpi_resource_fixed_memory32 { u32 read_write_attribute; - u32 range_base_address; - u32 range_length; + u32 address; + u32 address_length; }; struct acpi_memory_attribute { @@ -1089,93 +1089,105 @@ ACPI_RESOURCE_ADDRESS_COMMON}; struct acpi_resource_address16 { ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; - u32 min_address_range; - u32 max_address_range; - u32 address_translation_offset; + u32 minimum; + u32 maximum; + u32 translation_offset; u32 address_length; struct acpi_resource_source resource_source; }; struct acpi_resource_address32 { ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; - u32 min_address_range; - u32 max_address_range; - u32 address_translation_offset; + u32 minimum; + u32 maximum; + u32 translation_offset; u32 address_length; struct acpi_resource_source resource_source; }; struct acpi_resource_address64 { ACPI_RESOURCE_ADDRESS_COMMON u64 granularity; - u64 min_address_range; - u64 max_address_range; - u64 address_translation_offset; + u64 minimum; + u64 maximum; + u64 translation_offset; u64 address_length; - u64 type_specific_attributes; struct acpi_resource_source resource_source; }; -struct acpi_resource_ext_irq { +struct acpi_resource_extended_address64 { + ACPI_RESOURCE_ADDRESS_COMMON u64 granularity; + u64 minimum; + u64 maximum; + u64 translation_offset; + u64 address_length; + u64 type_specific_attributes; + u8 revision_iD; +}; + +struct acpi_resource_extended_irq { u32 producer_consumer; - u32 edge_level; - u32 active_high_low; - u32 shared_exclusive; - u32 number_of_interrupts; + u32 triggering; + u32 polarity; + u32 sharable; + u32 interrupt_count; struct acpi_resource_source resource_source; u32 interrupts[1]; }; -struct acpi_resource_generic_reg { +struct acpi_resource_generic_register { u32 space_id; u32 bit_width; u32 bit_offset; - u32 address_size; + u32 access_size; u64 address; }; /* ACPI_RESOURCE_TYPEs */ -#define ACPI_RSTYPE_IRQ 0 -#define ACPI_RSTYPE_DMA 1 -#define ACPI_RSTYPE_START_DPF 2 -#define ACPI_RSTYPE_END_DPF 3 -#define ACPI_RSTYPE_IO 4 -#define ACPI_RSTYPE_FIXED_IO 5 -#define ACPI_RSTYPE_VENDOR 6 -#define ACPI_RSTYPE_END_TAG 7 -#define ACPI_RSTYPE_MEM24 8 -#define ACPI_RSTYPE_MEM32 9 -#define ACPI_RSTYPE_FIXED_MEM32 10 -#define ACPI_RSTYPE_ADDRESS16 11 -#define ACPI_RSTYPE_ADDRESS32 12 -#define ACPI_RSTYPE_ADDRESS64 13 -#define ACPI_RSTYPE_EXT_IRQ 14 -#define ACPI_RSTYPE_GENERIC_REG 15 -#define ACPI_RSTYPE_MAX 15 - -typedef u32 acpi_resource_type; +#define ACPI_RESOURCE_TYPE_IRQ 0 +#define ACPI_RESOURCE_TYPE_DMA 1 +#define ACPI_RESOURCE_TYPE_START_DEPENDENT 2 +#define ACPI_RESOURCE_TYPE_END_DEPENDENT 3 +#define ACPI_RESOURCE_TYPE_IO 4 +#define ACPI_RESOURCE_TYPE_FIXED_IO 5 +#define ACPI_RESOURCE_TYPE_VENDOR 6 +#define ACPI_RESOURCE_TYPE_END_TAG 7 +#define ACPI_RESOURCE_TYPE_MEMORY24 8 +#define ACPI_RESOURCE_TYPE_MEMORY32 9 +#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10 +#define ACPI_RESOURCE_TYPE_ADDRESS16 11 +#define ACPI_RESOURCE_TYPE_ADDRESS32 12 +#define ACPI_RESOURCE_TYPE_ADDRESS64 13 +#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */ +#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15 +#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16 +#define ACPI_RESOURCE_TYPE_MAX 16 union acpi_resource_data { struct acpi_resource_irq irq; struct acpi_resource_dma dma; - struct acpi_resource_start_dpf start_dpf; + struct acpi_resource_start_dependent start_dpf; struct acpi_resource_io io; struct acpi_resource_fixed_io fixed_io; - struct acpi_resource_vendor vendor_specific; + struct acpi_resource_vendor vendor; struct acpi_resource_end_tag end_tag; - struct acpi_resource_mem24 memory24; - struct acpi_resource_mem32 memory32; - struct acpi_resource_fixed_mem32 fixed_memory32; - struct acpi_resource_address address; /* Common 16/32/64 address fields */ + struct acpi_resource_memory24 memory24; + struct acpi_resource_memory32 memory32; + struct acpi_resource_fixed_memory32 fixed_memory32; struct acpi_resource_address16 address16; struct acpi_resource_address32 address32; struct acpi_resource_address64 address64; - struct acpi_resource_ext_irq extended_irq; - struct acpi_resource_generic_reg generic_reg; + struct acpi_resource_extended_address64 ext_address64; + struct acpi_resource_extended_irq extended_irq; + struct acpi_resource_generic_register generic_reg; + + /* Common fields */ + + struct acpi_resource_address address; /* Common 16/32/64 address fields */ }; struct acpi_resource { - acpi_resource_type type; + u32 type; u32 length; union acpi_resource_data data; }; @@ -1183,7 +1195,7 @@ struct acpi_resource { #define ACPI_RESOURCE_LENGTH 12 #define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ -#define ACPI_SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) +#define ACPI_SIZEOF_RESOURCE(type) (u32) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h index a3c46ba6358..103aff07db1 100644 --- a/include/acpi/amlresrc.h +++ b/include/acpi/amlresrc.h @@ -96,165 +96,159 @@ struct asl_resource_node { * Resource descriptors defined in the ACPI specification. * * Packing/alignment must be BYTE because these descriptors - * are used to overlay the AML byte stream. + * are used to overlay the raw AML byte stream. */ #pragma pack(1) -struct asl_irq_format_desc { - u8 descriptor_type; - u16 irq_mask; +/* + * SMALL descriptors + */ +#define AML_RESOURCE_SMALL_HEADER_COMMON \ + u8 descriptor_type; + +struct aml_resource_small_header { +AML_RESOURCE_SMALL_HEADER_COMMON}; + +struct aml_resource_irq { + AML_RESOURCE_SMALL_HEADER_COMMON u16 irq_mask; u8 flags; }; -struct asl_irq_noflags_desc { - u8 descriptor_type; - u16 irq_mask; +struct aml_resource_irq_noflags { + AML_RESOURCE_SMALL_HEADER_COMMON u16 irq_mask; }; -struct asl_dma_format_desc { - u8 descriptor_type; - u8 dma_channel_mask; +struct aml_resource_dma { + AML_RESOURCE_SMALL_HEADER_COMMON u8 dma_channel_mask; u8 flags; }; -struct asl_start_dependent_desc { - u8 descriptor_type; - u8 flags; +struct aml_resource_start_dependent { + AML_RESOURCE_SMALL_HEADER_COMMON u8 flags; }; -struct asl_start_dependent_noprio_desc { - u8 descriptor_type; -}; +struct aml_resource_start_dependent_noprio { +AML_RESOURCE_SMALL_HEADER_COMMON}; -struct asl_end_dependent_desc { - u8 descriptor_type; -}; +struct aml_resource_end_dependent { +AML_RESOURCE_SMALL_HEADER_COMMON}; -struct asl_io_port_desc { - u8 descriptor_type; - u8 information; - u16 address_min; - u16 address_max; +struct aml_resource_io { + AML_RESOURCE_SMALL_HEADER_COMMON u8 information; + u16 minimum; + u16 maximum; u8 alignment; - u8 length; + u8 address_length; }; -struct asl_fixed_io_port_desc { - u8 descriptor_type; - u16 base_address; - u8 length; +struct aml_resource_fixed_io { + AML_RESOURCE_SMALL_HEADER_COMMON u16 address; + u8 address_length; }; -struct asl_small_vendor_desc { - u8 descriptor_type; - u8 vendor_defined[7]; -}; +struct aml_resource_vendor_small { +AML_RESOURCE_SMALL_HEADER_COMMON}; -struct asl_end_tag_desc { - u8 descriptor_type; - u8 checksum; +struct aml_resource_end_tag { + AML_RESOURCE_SMALL_HEADER_COMMON u8 checksum; }; -/* LARGE descriptors */ - -#define ASL_LARGE_HEADER_COMMON \ +/* + * LARGE descriptors + */ +#define AML_RESOURCE_LARGE_HEADER_COMMON \ u8 descriptor_type;\ - u16 length; + u16 resource_length; -struct asl_large_header { -ASL_LARGE_HEADER_COMMON}; +struct aml_resource_large_header { +AML_RESOURCE_LARGE_HEADER_COMMON}; -struct asl_memory_24_desc { - ASL_LARGE_HEADER_COMMON u8 information; - u16 address_min; - u16 address_max; +struct aml_resource_memory24 { + AML_RESOURCE_LARGE_HEADER_COMMON u8 information; + u16 minimum; + u16 maximum; u16 alignment; - u16 range_length; + u16 address_length; }; -struct asl_large_vendor_desc { - ASL_LARGE_HEADER_COMMON u8 vendor_defined[1]; -}; +struct aml_resource_vendor_large { +AML_RESOURCE_LARGE_HEADER_COMMON}; -struct asl_memory_32_desc { - ASL_LARGE_HEADER_COMMON u8 information; - u32 address_min; - u32 address_max; +struct aml_resource_memory32 { + AML_RESOURCE_LARGE_HEADER_COMMON u8 information; + u32 minimum; + u32 maximum; u32 alignment; - u32 range_length; + u32 address_length; }; -struct asl_fixed_memory_32_desc { - ASL_LARGE_HEADER_COMMON u8 information; - u32 base_address; - u32 range_length; +struct aml_resource_fixed_memory32 { + AML_RESOURCE_LARGE_HEADER_COMMON u8 information; + u32 address; + u32 address_length; }; -struct asl_extended_address_desc { - ASL_LARGE_HEADER_COMMON u8 resource_type; - u8 flags; - u8 specific_flags; - u8 revision_iD; +#define AML_RESOURCE_ADDRESS_COMMON \ + u8 resource_type; \ + u8 flags; \ + u8 specific_flags; + +struct aml_resource_address { +AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_ADDRESS_COMMON}; + +struct aml_resource_extended_address64 { + AML_RESOURCE_LARGE_HEADER_COMMON + AML_RESOURCE_ADDRESS_COMMON u8 revision_iD; u8 reserved; u64 granularity; - u64 address_min; - u64 address_max; + u64 minimum; + u64 maximum; u64 translation_offset; u64 address_length; u64 type_specific_attributes; - u8 optional_fields[2]; /* Used for length calculation only */ }; -#define ASL_EXTENDED_ADDRESS_DESC_REVISION 1 /* ACPI 3.0 */ +#define AML_RESOURCE_EXTENDED_ADDRESS_REVISION 1 /* ACPI 3.0 */ -struct asl_qword_address_desc { - ASL_LARGE_HEADER_COMMON u8 resource_type; - u8 flags; - u8 specific_flags; - u64 granularity; - u64 address_min; - u64 address_max; +struct aml_resource_address64 { + AML_RESOURCE_LARGE_HEADER_COMMON + AML_RESOURCE_ADDRESS_COMMON u64 granularity; + u64 minimum; + u64 maximum; u64 translation_offset; u64 address_length; - u8 optional_fields[2]; }; -struct asl_dword_address_desc { - ASL_LARGE_HEADER_COMMON u8 resource_type; - u8 flags; - u8 specific_flags; - u32 granularity; - u32 address_min; - u32 address_max; +struct aml_resource_address32 { + AML_RESOURCE_LARGE_HEADER_COMMON + AML_RESOURCE_ADDRESS_COMMON u32 granularity; + u32 minimum; + u32 maximum; u32 translation_offset; u32 address_length; - u8 optional_fields[2]; }; -struct asl_word_address_desc { - ASL_LARGE_HEADER_COMMON u8 resource_type; - u8 flags; - u8 specific_flags; - u16 granularity; - u16 address_min; - u16 address_max; +struct aml_resource_address16 { + AML_RESOURCE_LARGE_HEADER_COMMON + AML_RESOURCE_ADDRESS_COMMON u16 granularity; + u16 minimum; + u16 maximum; u16 translation_offset; u16 address_length; - u8 optional_fields[2]; }; -struct asl_extended_xrupt_desc { - ASL_LARGE_HEADER_COMMON u8 flags; +struct aml_resource_extended_irq { + AML_RESOURCE_LARGE_HEADER_COMMON u8 flags; u8 table_length; u32 interrupt_number[1]; /* res_source_index, res_source optional fields follow */ }; -struct asl_generic_register_desc { - ASL_LARGE_HEADER_COMMON u8 address_space_id; +struct aml_resource_generic_register { + AML_RESOURCE_LARGE_HEADER_COMMON u8 address_space_id; u8 bit_width; u8 bit_offset; - u8 access_size; /* ACPI 3.0, was Reserved */ + u8 access_size; /* ACPI 3.0, was previously Reserved */ u64 address; }; @@ -264,27 +258,39 @@ struct asl_generic_register_desc { /* Union of all resource descriptors, so we can allocate the worst case */ -union asl_resource_desc { - struct asl_irq_format_desc irq; - struct asl_dma_format_desc dma; - struct asl_io_port_desc iop; - struct asl_fixed_io_port_desc fio; - struct asl_start_dependent_desc std; - struct asl_end_dependent_desc end; - struct asl_small_vendor_desc smv; - struct asl_end_tag_desc et; - - struct asl_large_header lhd; - struct asl_memory_24_desc M24; - struct asl_large_vendor_desc lgv; - struct asl_memory_32_desc M32; - struct asl_fixed_memory_32_desc F32; - struct asl_qword_address_desc qas; - struct asl_dword_address_desc das; - struct asl_word_address_desc was; - struct asl_extended_address_desc eas; - struct asl_extended_xrupt_desc exx; - struct asl_generic_register_desc grg; +union aml_resource { + /* Descriptor headers */ + + struct aml_resource_small_header small_header; + struct aml_resource_large_header large_header; + + /* Small resource descriptors */ + + struct aml_resource_irq irq; + struct aml_resource_dma dma; + struct aml_resource_start_dependent start_dpf; + struct aml_resource_end_dependent end_dpf; + struct aml_resource_io io; + struct aml_resource_fixed_io fixed_io; + struct aml_resource_vendor_small vendor_small; + struct aml_resource_end_tag end_tag; + + /* Large resource descriptors */ + + struct aml_resource_memory24 memory24; + struct aml_resource_generic_register generic_reg; + struct aml_resource_vendor_large vendor_large; + struct aml_resource_memory32 memory32; + struct aml_resource_fixed_memory32 fixed_memory32; + struct aml_resource_address16 address16; + struct aml_resource_address32 address32; + struct aml_resource_address64 address64; + struct aml_resource_extended_address64 ext_address64; + struct aml_resource_extended_irq extended_irq; + + /* Utility overlays */ + + struct aml_resource_address address; u32 u32_item; u16 u16_item; u8 U8item; diff --git a/include/asm-x86_64/mpspec.h b/include/asm-x86_64/mpspec.h index 6f8a17d105a..ac59045e7ba 100644 --- a/include/asm-x86_64/mpspec.h +++ b/include/asm-x86_64/mpspec.h @@ -188,7 +188,7 @@ extern void mp_register_lapic_address (u64 address); extern void mp_register_ioapic (u8 id, u32 address, u32 gsi_base); extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 gsi); extern void mp_config_acpi_legacy_irqs (void); -extern int mp_register_gsi (u32 gsi, int edge_level, int active_high_low); +extern int mp_register_gsi (u32 gsi, int triggering, int polarity); #endif /*CONFIG_X86_IO_APIC*/ #endif diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 026c3c011dc..84d3d9f034c 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -435,7 +435,7 @@ extern int sbf_port ; #endif /* !CONFIG_ACPI */ -int acpi_register_gsi (u32 gsi, int edge_level, int active_high_low); +int acpi_register_gsi (u32 gsi, int triggering, int polarity); int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); /* -- cgit v1.2.3 From 0897831bb54eb36fd9e2a22da7f0f64be1b20d09 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 21 Oct 2005 00:00:00 -0400 Subject: [ACPI] ACPICA 20051021 Implemented support for the EM64T and other x86_64 processors. This essentially entails recognizing that these processors support non-aligned memory transfers. Previously, all 64-bit processors were assumed to lack hardware support for non-aligned transfers. Completed conversion of the Resource Manager to nearly full table-driven operation. Specifically, the resource conversion code (convert AML to internal format and the reverse) and the debug code to dump internal resource descriptors are fully table-driven, reducing code and data size and improving maintainability. The OSL interfaces for Acquire and Release Lock now use a 64-bit flag word on 64-bit processors instead of a fixed 32-bit word. (Alexey Starikovskiy) Implemented support within the resource conversion code for the Type-Specific byte within the various ACPI 3.0 *WordSpace macros. Fixed some issues within the resource conversion code for the type-specific flags for both Memory and I/O address resource descriptors. For Memory, implemented support for the MTP and TTP flags. For I/O, split the TRS and TTP flags into two separate fields. Signed-off-by: Bob Moore Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- include/acpi/acdisasm.h | 17 +- include/acpi/acmacros.h | 6 +- include/acpi/acpiosxf.h | 4 +- include/acpi/acresrc.h | 401 +++++++++++++++++++----------------------- include/acpi/actypes.h | 183 ++++++++++--------- include/acpi/acutils.h | 7 +- include/acpi/amlresrc.h | 14 +- include/acpi/platform/acenv.h | 11 +- 9 files changed, 323 insertions(+), 322 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index cb59b018c84..7676afec09a 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20050930 +#define ACPI_CA_VERSION 0x20051021 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index b2921b869bb..99250ee1b9d 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h @@ -60,6 +60,7 @@ extern struct acpi_external_list *acpi_gbl_external_list; extern const char *acpi_gbl_io_decode[2]; extern const char *acpi_gbl_word_decode[4]; extern const char *acpi_gbl_consume_decode[2]; +extern const char *acpi_gbl_config_decode[4]; extern const char *acpi_gbl_min_decode[2]; extern const char *acpi_gbl_max_decode[2]; extern const char *acpi_gbl_DECdecode[2]; @@ -171,11 +172,19 @@ u8 acpi_dm_is_string_buffer(union acpi_parse_object *op); /* * dmresrc */ +void acpi_dm_dump_integer8(u8 value, char *name); + +void acpi_dm_dump_integer16(u16 value, char *name); + +void acpi_dm_dump_integer32(u32 value, char *name); + +void acpi_dm_dump_integer64(u64 value, char *name); + void -acpi_dm_resource_descriptor(struct acpi_op_walk_info *info, - u8 * byte_data, u32 byte_count); +acpi_dm_resource_template(struct acpi_op_walk_info *info, + u8 * byte_data, u32 byte_count); -u8 acpi_dm_is_resource_descriptor(union acpi_parse_object *op); +u8 acpi_dm_is_resource_template(union acpi_parse_object *op); void acpi_dm_indent(u32 level); @@ -223,6 +232,8 @@ void acpi_dm_vendor_large_descriptor(union aml_resource *resource, u32 length, u32 level); +void acpi_dm_vendor_common(char *name, u8 * byte_data, u32 length, u32 level); + /* * dmresrcs */ diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 258cfe5e2aa..e42222c3d34 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -202,7 +202,7 @@ #define ACPI_BUFFER_INDEX(buf_len,buf_offset,byte_gran) (buf_offset) -#ifdef ACPI_MISALIGNED_TRANSFERS +#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED /* The hardware supports unaligned transfers, just do the little-endian move */ @@ -563,11 +563,11 @@ return (_s); }) #define return_UINT8(s) ACPI_DO_WHILE0 ({ \ register u8 _s = (u8) (s); \ - acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \ + acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \ return (_s); }) #define return_UINT32(s) ACPI_DO_WHILE0 ({ \ register u32 _s = (u32) (s); \ - acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, _s); \ + acpi_ut_value_exit (ACPI_DEBUG_PARAMETERS, (acpi_integer) _s); \ return (_s); }) #else /* Use original less-safe macros */ diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 98e0b8cd14e..58473f60755 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -108,9 +108,9 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle); void acpi_os_delete_lock(acpi_handle handle); -unsigned long acpi_os_acquire_lock(acpi_handle handle); +acpi_native_uint acpi_os_acquire_lock(acpi_handle handle); -void acpi_os_release_lock(acpi_handle handle, unsigned long flags); +void acpi_os_release_lock(acpi_handle handle, acpi_native_uint flags); /* * Memory allocation and mapping diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index b66994e9e4e..25cff0d5ba5 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h @@ -48,49 +48,133 @@ #include "amlresrc.h" +/* + * If possible, pack the following structures to byte alignment, since we + * don't care about performance for debug output + */ +#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED +#pragma pack(1) +#endif + +/* + * Individual entry for the resource conversion tables + */ +typedef const struct acpi_rsconvert_info { + u8 opcode; + u8 resource_offset; + u8 aml_offset; + u8 value; + +} acpi_rsconvert_info; + +/* Resource conversion opcodes */ + +#define ACPI_RSC_INITGET 0 +#define ACPI_RSC_INITSET 1 +#define ACPI_RSC_FLAGINIT 2 +#define ACPI_RSC_1BITFLAG 3 +#define ACPI_RSC_2BITFLAG 4 +#define ACPI_RSC_COUNT 5 +#define ACPI_RSC_COUNT16 6 +#define ACPI_RSC_LENGTH 7 +#define ACPI_RSC_MOVE8 8 +#define ACPI_RSC_MOVE16 9 +#define ACPI_RSC_MOVE32 10 +#define ACPI_RSC_MOVE64 11 +#define ACPI_RSC_SET8 12 +#define ACPI_RSC_DATA8 13 +#define ACPI_RSC_ADDRESS 14 +#define ACPI_RSC_SOURCE 15 +#define ACPI_RSC_SOURCEX 16 +#define ACPI_RSC_BITMASK 17 +#define ACPI_RSC_BITMASK16 18 +#define ACPI_RSC_EXIT_NE 19 +#define ACPI_RSC_EXIT_LE 20 + +/* Resource Conversion sub-opcodes */ + +#define ACPI_RSC_COMPARE_AML_LENGTH 0 +#define ACPI_RSC_COMPARE_VALUE 1 + +#define ACPI_RSC_TABLE_SIZE(d) (sizeof (d) / sizeof (struct acpi_rsconvert_info)) + +#define ACPI_RS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_resource,f) +#define AML_OFFSET(f) (u8) ACPI_OFFSET (union aml_resource,f) + /* * Resource dispatch and info tables */ -struct acpi_resource_info { +typedef const struct acpi_resource_info { u8 length_type; u8 minimum_aml_resource_length; u8 minimum_internal_struct_length; -}; + +} acpi_resource_info; /* Types for length_type above */ -#define ACPI_FIXED_LENGTH 0 -#define ACPI_VARIABLE_LENGTH 1 -#define ACPI_SMALL_VARIABLE_LENGTH 2 +#define ACPI_FIXED_LENGTH 0 +#define ACPI_VARIABLE_LENGTH 1 +#define ACPI_SMALL_VARIABLE_LENGTH 2 + +typedef const struct acpi_rsdump_info { + u8 opcode; + u8 offset; + char *name; + const void *pointer; -/* Handlers */ +} acpi_rsdump_info; -typedef acpi_status(*ACPI_SET_RESOURCE_HANDLER) (struct acpi_resource * - resource, - union aml_resource * aml); +/* Values for the Opcode field above */ -typedef acpi_status(*ACPI_GET_RESOURCE_HANDLER) (union aml_resource * aml, - u16 aml_resource_length, - struct acpi_resource * - resource); +#define ACPI_RSD_TITLE 0 +#define ACPI_RSD_LITERAL 1 +#define ACPI_RSD_STRING 2 +#define ACPI_RSD_UINT8 3 +#define ACPI_RSD_UINT16 4 +#define ACPI_RSD_UINT32 5 +#define ACPI_RSD_UINT64 6 +#define ACPI_RSD_1BITFLAG 7 +#define ACPI_RSD_2BITFLAG 8 +#define ACPI_RSD_SHORTLIST 9 +#define ACPI_RSD_LONGLIST 10 +#define ACPI_RSD_DWORDLIST 11 +#define ACPI_RSD_ADDRESS 12 +#define ACPI_RSD_SOURCE 13 -typedef void (*ACPI_DUMP_RESOURCE_HANDLER) (union acpi_resource_data * data); +/* restore default alignment */ -/* Tables indexed by internal resource type */ +#pragma pack() -extern u8 acpi_gbl_aml_resource_sizes[]; -extern ACPI_SET_RESOURCE_HANDLER acpi_gbl_set_resource_dispatch[]; -extern ACPI_DUMP_RESOURCE_HANDLER acpi_gbl_dump_resource_dispatch[]; +/* Resource tables indexed by internal resource type */ -/* Tables indexed by raw AML resource descriptor type */ +extern const u8 acpi_gbl_aml_resource_sizes[]; +extern struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[]; + +/* Resource tables indexed by raw AML resource descriptor type */ extern struct acpi_resource_info acpi_gbl_sm_resource_info[]; extern struct acpi_resource_info acpi_gbl_lg_resource_info[]; -extern ACPI_GET_RESOURCE_HANDLER acpi_gbl_sm_get_resource_dispatch[]; -extern ACPI_GET_RESOURCE_HANDLER acpi_gbl_lg_get_resource_dispatch[]; +extern struct acpi_rsconvert_info *acpi_gbl_sm_get_resource_dispatch[]; +extern struct acpi_rsconvert_info *acpi_gbl_lg_get_resource_dispatch[]; + +/* + * rscreate + */ +acpi_status +acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, + struct acpi_buffer *output_buffer); + +acpi_status +acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer, + struct acpi_buffer *output_buffer); + +acpi_status +acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, + struct acpi_buffer *output_buffer); /* - * Function prototypes called from Acpi* APIs + * rsutils */ acpi_status acpi_rs_get_prt_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); @@ -110,27 +194,6 @@ acpi_rs_get_method_data(acpi_handle handle, acpi_status acpi_rs_set_srs_method_data(acpi_handle handle, struct acpi_buffer *ret_buffer); -acpi_status -acpi_rs_create_resource_list(union acpi_operand_object *aml_buffer, - struct acpi_buffer *output_buffer); - -acpi_status -acpi_rs_create_aml_resources(struct acpi_resource *linked_list_buffer, - struct acpi_buffer *output_buffer); - -acpi_status -acpi_rs_create_pci_routing_table(union acpi_operand_object *package_object, - struct acpi_buffer *output_buffer); - -/* - * rsdump - */ -#ifdef ACPI_FUTURE_USAGE -void acpi_rs_dump_resource_list(struct acpi_resource *resource); - -void acpi_rs_dump_irq_list(u8 * route_table); -#endif /* ACPI_FUTURE_USAGE */ - /* * rscalc */ @@ -154,145 +217,29 @@ acpi_status acpi_rs_convert_resources_to_aml(struct acpi_resource *resource, acpi_size aml_size_needed, u8 * output_buffer); -/* - * rsio - */ -acpi_status -acpi_rs_get_io(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_io(struct acpi_resource *resource, union aml_resource *aml); - -acpi_status -acpi_rs_get_fixed_io(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_fixed_io(struct acpi_resource *resource, union aml_resource *aml); - -acpi_status -acpi_rs_get_dma(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_dma(struct acpi_resource *resource, union aml_resource *aml); - -/* - * rsirq - */ -acpi_status -acpi_rs_get_irq(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_irq(struct acpi_resource *resource, union aml_resource *aml); - -acpi_status -acpi_rs_get_ext_irq(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_ext_irq(struct acpi_resource *resource, union aml_resource *aml); - /* * rsaddr */ -acpi_status -acpi_rs_get_address16(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_address16(struct acpi_resource *resource, union aml_resource *aml); - -acpi_status -acpi_rs_get_address32(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_address32(struct acpi_resource *resource, union aml_resource *aml); - -acpi_status -acpi_rs_get_address64(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_address64(struct acpi_resource *resource, union aml_resource *aml); - -acpi_status -acpi_rs_get_ext_address64(union aml_resource *aml, - u16 aml_resource_length, - struct acpi_resource *resource); - -acpi_status -acpi_rs_set_ext_address64(struct acpi_resource *resource, - union aml_resource *aml); - -/* - * rsmemory - */ -acpi_status -acpi_rs_get_memory24(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_memory24(struct acpi_resource *resource, union aml_resource *aml); - -acpi_status -acpi_rs_get_memory32(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_memory32(struct acpi_resource *resource, union aml_resource *aml); - -acpi_status -acpi_rs_get_fixed_memory32(union aml_resource *aml, - u16 aml_resource_length, +void +acpi_rs_set_address_common(union aml_resource *aml, struct acpi_resource *resource); -acpi_status -acpi_rs_set_fixed_memory32(struct acpi_resource *resource, +u8 +acpi_rs_get_address_common(struct acpi_resource *resource, union aml_resource *aml); /* * rsmisc */ acpi_status -acpi_rs_get_generic_reg(union aml_resource *aml, - u16 aml_resource_length, - struct acpi_resource *resource); - -acpi_status -acpi_rs_set_generic_reg(struct acpi_resource *resource, - union aml_resource *aml); - -acpi_status -acpi_rs_get_vendor(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_vendor(struct acpi_resource *resource, union aml_resource *aml); - -acpi_status -acpi_rs_get_start_dpf(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_start_dpf(struct acpi_resource *resource, union aml_resource *aml); - -acpi_status -acpi_rs_get_end_dpf(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_end_dpf(struct acpi_resource *resource, union aml_resource *aml); +acpi_rs_convert_aml_to_resource(struct acpi_resource *resource, + union aml_resource *aml, + struct acpi_rsconvert_info *info); acpi_status -acpi_rs_get_end_tag(union aml_resource *aml, - u16 aml_resource_length, struct acpi_resource *resource); - -acpi_status -acpi_rs_set_end_tag(struct acpi_resource *resource, union aml_resource *aml); +acpi_rs_convert_resource_to_aml(struct acpi_resource *resource, + union aml_resource *aml, + struct acpi_rsconvert_info *info); /* * rsutils @@ -301,74 +248,94 @@ void acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type); -/* Types used in move_type above */ +u8 acpi_rs_decode_bitmask(u16 mask, u8 * list); -#define ACPI_MOVE_TYPE_16_TO_32 0 -#define ACPI_MOVE_TYPE_32_TO_16 1 -#define ACPI_MOVE_TYPE_32_TO_32 2 -#define ACPI_MOVE_TYPE_64_TO_64 3 +u16 acpi_rs_encode_bitmask(u8 * list, u8 count); -u16 -acpi_rs_get_resource_source(u16 resource_length, - acpi_size minimum_length, +acpi_rs_length +acpi_rs_get_resource_source(acpi_rs_length resource_length, + acpi_rs_length minimum_length, struct acpi_resource_source *resource_source, union aml_resource *aml, char *string_ptr); -acpi_size +acpi_rsdesc_size acpi_rs_set_resource_source(union aml_resource *aml, - acpi_size minimum_length, + acpi_rs_length minimum_length, struct acpi_resource_source *resource_source); -u8 acpi_rs_get_resource_type(u8 resource_start_byte); - -u32 acpi_rs_get_descriptor_length(union aml_resource *aml); - -u16 acpi_rs_get_resource_length(union aml_resource *aml); - void acpi_rs_set_resource_header(u8 descriptor_type, - acpi_size total_length, union aml_resource *aml); + acpi_rsdesc_size total_length, + union aml_resource *aml); + +void +acpi_rs_set_resource_length(acpi_rsdesc_size total_length, + union aml_resource *aml); struct acpi_resource_info *acpi_rs_get_resource_info(u8 resource_type); -#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) /* * rsdump */ -void acpi_rs_dump_irq(union acpi_resource_data *resource); - -void acpi_rs_dump_address16(union acpi_resource_data *resource); - -void acpi_rs_dump_address32(union acpi_resource_data *resource); - -void acpi_rs_dump_address64(union acpi_resource_data *resource); - -void acpi_rs_dump_ext_address64(union acpi_resource_data *resource); - -void acpi_rs_dump_dma(union acpi_resource_data *resource); - -void acpi_rs_dump_io(union acpi_resource_data *resource); - -void acpi_rs_dump_ext_irq(union acpi_resource_data *resource); - -void acpi_rs_dump_fixed_io(union acpi_resource_data *resource); - -void acpi_rs_dump_fixed_memory32(union acpi_resource_data *resource); - -void acpi_rs_dump_memory24(union acpi_resource_data *resource); - -void acpi_rs_dump_memory32(union acpi_resource_data *resource); - -void acpi_rs_dump_start_dpf(union acpi_resource_data *resource); - -void acpi_rs_dump_vendor(union acpi_resource_data *resource); +void acpi_rs_dump_resource_list(struct acpi_resource *resource); -void acpi_rs_dump_generic_reg(union acpi_resource_data *resource); +void acpi_rs_dump_irq_list(u8 * route_table); -void acpi_rs_dump_end_dpf(union acpi_resource_data *resource); +/* + * Resource conversion tables + */ +extern struct acpi_rsconvert_info acpi_rs_convert_dma[]; +extern struct acpi_rsconvert_info acpi_rs_convert_end_dpf[]; +extern struct acpi_rsconvert_info acpi_rs_convert_io[]; +extern struct acpi_rsconvert_info acpi_rs_convert_fixed_io[]; +extern struct acpi_rsconvert_info acpi_rs_convert_end_tag[]; +extern struct acpi_rsconvert_info acpi_rs_convert_memory24[]; +extern struct acpi_rsconvert_info acpi_rs_convert_generic_reg[]; +extern struct acpi_rsconvert_info acpi_rs_convert_memory32[]; +extern struct acpi_rsconvert_info acpi_rs_convert_fixed_memory32[]; +extern struct acpi_rsconvert_info acpi_rs_convert_address32[]; +extern struct acpi_rsconvert_info acpi_rs_convert_address16[]; +extern struct acpi_rsconvert_info acpi_rs_convert_ext_irq[]; +extern struct acpi_rsconvert_info acpi_rs_convert_address64[]; +extern struct acpi_rsconvert_info acpi_rs_convert_ext_address64[]; + +/* These resources require separate get/set tables */ + +extern struct acpi_rsconvert_info acpi_rs_get_irq[]; +extern struct acpi_rsconvert_info acpi_rs_get_start_dpf[]; +extern struct acpi_rsconvert_info acpi_rs_get_vendor_small[]; +extern struct acpi_rsconvert_info acpi_rs_get_vendor_large[]; + +extern struct acpi_rsconvert_info acpi_rs_set_irq[]; +extern struct acpi_rsconvert_info acpi_rs_set_start_dpf[]; +extern struct acpi_rsconvert_info acpi_rs_set_vendor[]; -void acpi_rs_dump_end_tag(union acpi_resource_data *resource); +#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) +/* + * rsinfo + */ +extern struct acpi_rsdump_info *acpi_gbl_dump_resource_dispatch[]; +/* + * rsdump + */ +extern struct acpi_rsdump_info acpi_rs_dump_irq[]; +extern struct acpi_rsdump_info acpi_rs_dump_dma[]; +extern struct acpi_rsdump_info acpi_rs_dump_start_dpf[]; +extern struct acpi_rsdump_info acpi_rs_dump_end_dpf[]; +extern struct acpi_rsdump_info acpi_rs_dump_io[]; +extern struct acpi_rsdump_info acpi_rs_dump_fixed_io[]; +extern struct acpi_rsdump_info acpi_rs_dump_vendor[]; +extern struct acpi_rsdump_info acpi_rs_dump_end_tag[]; +extern struct acpi_rsdump_info acpi_rs_dump_memory24[]; +extern struct acpi_rsdump_info acpi_rs_dump_memory32[]; +extern struct acpi_rsdump_info acpi_rs_dump_fixed_memory32[]; +extern struct acpi_rsdump_info acpi_rs_dump_address16[]; +extern struct acpi_rsdump_info acpi_rs_dump_address32[]; +extern struct acpi_rsdump_info acpi_rs_dump_address64[]; +extern struct acpi_rsdump_info acpi_rs_dump_ext_address64[]; +extern struct acpi_rsdump_info acpi_rs_dump_ext_irq[]; +extern struct acpi_rsdump_info acpi_rs_dump_generic_reg[]; #endif #endif /* __ACRESRC_H__ */ diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 43f7c509317..29b887017b1 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -83,10 +83,11 @@ typedef COMPILER_DEPENDENT_UINT64 u64; * UINT32 32-bit (4 byte) unsigned value * INT64 64-bit (8 byte) signed value * UINT64 64-bit (8 byte) unsigned value - * ACPI_NATIVE_INT 32-bit on IA-32, 64-bit on IA-64 signed value - * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on IA-64 unsigned value + * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on x86_64/IA-64 unsigned value */ +typedef unsigned long acpi_native_uint; + #ifndef ACPI_MACHINE_WIDTH #error ACPI_MACHINE_WIDTH not defined #endif @@ -108,9 +109,6 @@ typedef COMPILER_DEPENDENT_UINT64 UINT64; /*! [End] no source code translation !*/ -typedef s64 acpi_native_int; -typedef u64 acpi_native_uint; - typedef u64 acpi_table_ptr; typedef u64 acpi_io_address; typedef u64 acpi_physical_address; @@ -121,9 +119,22 @@ typedef u64 acpi_size; #define ACPI_MAX_PTR ACPI_UINT64_MAX #define ACPI_SIZE_MAX ACPI_UINT64_MAX +/* + * In the case of the Itanium Processor Family (IPF), the hardware does not + * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag + * to indicate that special precautions must be taken to avoid alignment faults. + * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) + * + * Note: Em64_t and other X86-64 processors do support misaligned transfers, + * so there is no need to define this flag. + */ +#if defined (__IA64__) || defined (__ia64__) +#define ACPI_MISALIGNMENT_NOT_SUPPORTED +#endif + #elif ACPI_MACHINE_WIDTH == 16 -/*! [Begin] no source code translation (keep the typedefs) */ +/*! [Begin] no source code translation (keep the typedefs as-is) */ /* * 16-bit type definitions @@ -142,16 +153,12 @@ struct { /*! [End] no source code translation !*/ -typedef u16 acpi_native_uint; -typedef s16 acpi_native_int; - typedef u32 acpi_table_ptr; typedef u32 acpi_io_address; typedef char *acpi_physical_address; typedef u16 acpi_size; #define ALIGNED_ADDRESS_BOUNDARY 0x00000002 -#define ACPI_MISALIGNED_TRANSFERS #define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ #define ACPI_MAX_PTR ACPI_UINT16_MAX #define ACPI_SIZE_MAX ACPI_UINT16_MAX @@ -179,16 +186,12 @@ typedef COMPILER_DEPENDENT_UINT64 UINT64; /*! [End] no source code translation !*/ -typedef s32 acpi_native_int; -typedef u32 acpi_native_uint; - typedef u64 acpi_table_ptr; typedef u32 acpi_io_address; typedef u64 acpi_physical_address; typedef u32 acpi_size; #define ALIGNED_ADDRESS_BOUNDARY 0x00000004 -#define ACPI_MISALIGNED_TRANSFERS #define ACPI_MAX_PTR ACPI_UINT32_MAX #define ACPI_SIZE_MAX ACPI_UINT32_MAX @@ -895,6 +898,8 @@ struct acpi_mem_space_context { /* * Definitions for Resource Attributes */ +typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */ +typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (64_k-1)+3 */ /* * Memory Attributes @@ -927,8 +932,8 @@ struct acpi_mem_space_context { /* * IRQ Attributes */ -#define ACPI_EDGE_SENSITIVE (u8) 0x00 -#define ACPI_LEVEL_SENSITIVE (u8) 0x01 +#define ACPI_LEVEL_SENSITIVE (u8) 0x00 +#define ACPI_EDGE_SENSITIVE (u8) 0x01 #define ACPI_ACTIVE_HIGH (u8) 0x00 #define ACPI_ACTIVE_LOW (u8) 0x01 @@ -974,28 +979,35 @@ struct acpi_mem_space_context { #define ACPI_PRODUCER (u8) 0x00 #define ACPI_CONSUMER (u8) 0x01 +/* + * If possible, pack the following structures to byte alignment + */ +#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED +#pragma pack(1) +#endif + /* * Structures used to describe device resources */ struct acpi_resource_irq { - u32 triggering; - u32 polarity; - u32 sharable; - u32 interrupt_count; - u32 interrupts[1]; + u8 triggering; + u8 polarity; + u8 sharable; + u8 interrupt_count; + u8 interrupts[1]; }; struct acpi_resource_dma { - u32 type; - u32 bus_master; - u32 transfer; - u32 channel_count; - u32 channels[1]; + u8 type; + u8 bus_master; + u8 transfer; + u8 channel_count; + u8 channels[1]; }; struct acpi_resource_start_dependent { - u32 compatibility_priority; - u32 performance_robustness; + u8 compatibility_priority; + u8 performance_robustness; }; /* @@ -1004,20 +1016,20 @@ struct acpi_resource_start_dependent { */ struct acpi_resource_io { - u32 io_decode; - u32 minimum; - u32 maximum; - u32 alignment; - u32 address_length; + u8 io_decode; + u8 alignment; + u8 address_length; + u16 minimum; + u16 maximum; }; struct acpi_resource_fixed_io { - u32 address; - u32 address_length; + u16 address; + u8 address_length; }; struct acpi_resource_vendor { - u32 byte_length; + u16 byte_length; u8 byte_data[1]; }; @@ -1026,15 +1038,15 @@ struct acpi_resource_end_tag { }; struct acpi_resource_memory24 { - u32 read_write_attribute; - u32 minimum; - u32 maximum; - u32 alignment; - u32 address_length; + u8 write_protect; + u16 minimum; + u16 maximum; + u16 alignment; + u16 address_length; }; struct acpi_resource_memory32 { - u32 read_write_attribute; + u8 write_protect; u32 minimum; u32 maximum; u32 alignment; @@ -1042,57 +1054,59 @@ struct acpi_resource_memory32 { }; struct acpi_resource_fixed_memory32 { - u32 read_write_attribute; + u8 write_protect; u32 address; u32 address_length; }; struct acpi_memory_attribute { - u16 cache_attribute; - u16 read_write_attribute; + u8 write_protect; + u8 caching; + u8 range_type; + u8 translation; }; struct acpi_io_attribute { - u16 range_attribute; - u16 translation_attribute; -}; - -struct acpi_bus_attribute { - u16 reserved1; - u16 reserved2; + u8 range_type; + u8 translation; + u8 translation_type; + u8 reserved1; }; union acpi_resource_attribute { - struct acpi_memory_attribute memory; + struct acpi_memory_attribute mem; struct acpi_io_attribute io; - struct acpi_bus_attribute bus; + + /* Used for the *word_space macros */ + + u8 type_specific; }; struct acpi_resource_source { - u32 index; - u32 string_length; + u8 index; + u16 string_length; char *string_ptr; }; /* Fields common to all address descriptors, 16/32/64 bit */ #define ACPI_RESOURCE_ADDRESS_COMMON \ - u32 resource_type; \ - u32 producer_consumer; \ - u32 decode; \ - u32 min_address_fixed; \ - u32 max_address_fixed; \ - union acpi_resource_attribute attribute; + u8 resource_type; \ + u8 producer_consumer; \ + u8 decode; \ + u8 min_address_fixed; \ + u8 max_address_fixed; \ + union acpi_resource_attribute info; struct acpi_resource_address { ACPI_RESOURCE_ADDRESS_COMMON}; struct acpi_resource_address16 { - ACPI_RESOURCE_ADDRESS_COMMON u32 granularity; - u32 minimum; - u32 maximum; - u32 translation_offset; - u32 address_length; + ACPI_RESOURCE_ADDRESS_COMMON u16 granularity; + u16 minimum; + u16 maximum; + u16 translation_offset; + u16 address_length; struct acpi_resource_source resource_source; }; @@ -1115,30 +1129,30 @@ struct acpi_resource_address64 { }; struct acpi_resource_extended_address64 { - ACPI_RESOURCE_ADDRESS_COMMON u64 granularity; + ACPI_RESOURCE_ADDRESS_COMMON u8 revision_iD; + u64 granularity; u64 minimum; u64 maximum; u64 translation_offset; u64 address_length; - u64 type_specific_attributes; - u8 revision_iD; + u64 type_specific; }; struct acpi_resource_extended_irq { - u32 producer_consumer; - u32 triggering; - u32 polarity; - u32 sharable; - u32 interrupt_count; + u8 producer_consumer; + u8 triggering; + u8 polarity; + u8 sharable; + u8 interrupt_count; struct acpi_resource_source resource_source; u32 interrupts[1]; }; struct acpi_resource_generic_register { - u32 space_id; - u32 bit_width; - u32 bit_offset; - u32 access_size; + u8 space_id; + u8 bit_width; + u8 bit_offset; + u8 access_size; u64 address; }; @@ -1192,14 +1206,17 @@ struct acpi_resource { union acpi_resource_data data; }; -#define ACPI_RESOURCE_LENGTH 12 -#define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */ +/* restore default alignment */ + +#pragma pack() -#define ACPI_SIZEOF_RESOURCE(type) (u32) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type)) +#define ACPI_RS_SIZE_MIN 12 +#define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */ +#define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) -#ifdef ACPI_MISALIGNED_TRANSFERS +#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED #define ACPI_ALIGN_RESOURCE_SIZE(length) (length) #else #define ACPI_ALIGN_RESOURCE_SIZE(length) ACPI_ROUND_UP_TO_NATIVE_WORD(length) diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index c1086452696..7386eb81bd2 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h @@ -159,7 +159,6 @@ extern const u8 _acpi_ctype[]; #define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) #define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU)) #define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) -#define ACPI_IS_ASCII(c) ((c) < 0x80) #endif /* ACPI_USE_SYSTEM_CLIBRARY */ @@ -419,6 +418,12 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); #define ACPI_ANY_BASE 0 +u32 acpi_ut_get_descriptor_length(void *aml); + +u16 acpi_ut_get_resource_length(void *aml); + +u8 acpi_ut_get_resource_type(void *aml); + u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc); u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h index 103aff07db1..3112be52773 100644 --- a/include/acpi/amlresrc.h +++ b/include/acpi/amlresrc.h @@ -134,7 +134,7 @@ struct aml_resource_end_dependent { AML_RESOURCE_SMALL_HEADER_COMMON}; struct aml_resource_io { - AML_RESOURCE_SMALL_HEADER_COMMON u8 information; + AML_RESOURCE_SMALL_HEADER_COMMON u8 flags; u16 minimum; u16 maximum; u8 alignment; @@ -164,7 +164,7 @@ struct aml_resource_large_header { AML_RESOURCE_LARGE_HEADER_COMMON}; struct aml_resource_memory24 { - AML_RESOURCE_LARGE_HEADER_COMMON u8 information; + AML_RESOURCE_LARGE_HEADER_COMMON u8 flags; u16 minimum; u16 maximum; u16 alignment; @@ -175,7 +175,7 @@ struct aml_resource_vendor_large { AML_RESOURCE_LARGE_HEADER_COMMON}; struct aml_resource_memory32 { - AML_RESOURCE_LARGE_HEADER_COMMON u8 information; + AML_RESOURCE_LARGE_HEADER_COMMON u8 flags; u32 minimum; u32 maximum; u32 alignment; @@ -183,7 +183,7 @@ struct aml_resource_memory32 { }; struct aml_resource_fixed_memory32 { - AML_RESOURCE_LARGE_HEADER_COMMON u8 information; + AML_RESOURCE_LARGE_HEADER_COMMON u8 flags; u32 address; u32 address_length; }; @@ -205,7 +205,7 @@ struct aml_resource_extended_address64 { u64 maximum; u64 translation_offset; u64 address_length; - u64 type_specific_attributes; + u64 type_specific; }; #define AML_RESOURCE_EXTENDED_ADDRESS_REVISION 1 /* ACPI 3.0 */ @@ -239,8 +239,8 @@ struct aml_resource_address16 { struct aml_resource_extended_irq { AML_RESOURCE_LARGE_HEADER_COMMON u8 flags; - u8 table_length; - u32 interrupt_number[1]; + u8 interrupt_count; + u32 interrupts[1]; /* res_source_index, res_source optional fields follow */ }; diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 08539125696..53aa997f05f 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -206,6 +206,8 @@ * *****************************************************************************/ +#define ACPI_IS_ASCII(c) ((c) < 0x80) + #ifdef ACPI_USE_SYSTEM_CLIBRARY /* * Use the standard C library headers. @@ -235,7 +237,7 @@ #define ACPI_STRCAT(d,s) (void) strcat((d), (s)) #define ACPI_STRNCAT(d,s,n) strncat((d), (s), (acpi_size)(n)) #define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (acpi_size)(n)) -#define ACPI_MEMCMP(s1,s2,n) memcmp((s1), (s2), (acpi_size)(n)) +#define ACPI_MEMCMP(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n)) #define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (acpi_size)(n)) #define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (acpi_size)(n)) @@ -247,7 +249,6 @@ #define ACPI_IS_UPPER(i) isupper((int) (i)) #define ACPI_IS_PRINT(i) isprint((int) (i)) #define ACPI_IS_ALPHA(i) isalpha((int) (i)) -#define ACPI_IS_ASCII(i) isascii((int) (i)) #else @@ -274,8 +275,8 @@ typedef char *va_list; /* * Storage alignment properties */ -#define _AUPBND (sizeof (acpi_native_int) - 1) -#define _ADNBND (sizeof (acpi_native_int) - 1) +#define _AUPBND (sizeof (acpi_native_uint) - 1) +#define _ADNBND (sizeof (acpi_native_uint) - 1) /* * Variable argument list macro definitions @@ -297,7 +298,7 @@ typedef char *va_list; #define ACPI_STRCAT(d,s) (void) acpi_ut_strcat ((d), (s)) #define ACPI_STRNCAT(d,s,n) acpi_ut_strncat ((d), (s), (acpi_size)(n)) #define ACPI_STRTOUL(d,s,n) acpi_ut_strtoul ((d), (s), (acpi_size)(n)) -#define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((s1), (s2), (acpi_size)(n)) +#define ACPI_MEMCMP(s1,s2,n) acpi_ut_memcmp((const char *)(s1), (const char *)(s2), (acpi_size)(n)) #define ACPI_MEMCPY(d,s,n) (void) acpi_ut_memcpy ((d), (s), (acpi_size)(n)) #define ACPI_MEMSET(d,v,n) (void) acpi_ut_memset ((d), (v), (acpi_size)(n)) #define ACPI_TOUPPER acpi_ut_to_upper -- cgit v1.2.3 From 96db255c8f014ae3497507104e8df809785a619f Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 2 Nov 2005 00:00:00 -0500 Subject: [ACPI] ACPICA 20051102 Modified the subsystem initialization sequence to improve GPE support. The GPE initialization has been split into two parts in order to defer execution of the _PRW methods (Power Resources for Wake) until after the hardware is fully initialized and the SCI handler is installed. This allows the _PRW methods to access fields protected by the Global Lock. This will fix systems where a NO_GLOBAL_LOCK exception has been seen during initialization. Fixed a regression with the ConcatenateResTemplate() ASL operator introduced in the 20051021 release. Implemented support for "local" internal ACPI object types within the debugger "Object" command and the acpi_walk_namespace() external interfaces. These local types include RegionFields, BankFields, IndexFields, Alias, and reference objects. Moved common AML resource handling code into a new file, "utresrc.c". This code is shared by both the Resource Manager and the AML Debugger. Signed-off-by: Bob Moore Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- include/acpi/acevents.h | 6 ++++++ include/acpi/acinterp.h | 46 ++++++++++++++++++++++++++++++++++++++++++++-- include/acpi/acresrc.h | 27 ++++----------------------- include/acpi/acutils.h | 17 ++++++++++++++++- include/acpi/amlresrc.h | 5 +++++ 6 files changed, 76 insertions(+), 27 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 7676afec09a..d371ec6b981 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20051021 +#define ACPI_CA_VERSION 0x20051102 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h index bfa54600ecd..b40062c3ba7 100644 --- a/include/acpi/acevents.h +++ b/include/acpi/acevents.h @@ -51,6 +51,8 @@ acpi_status acpi_ev_initialize_events(void); acpi_status acpi_ev_install_xrupt_handlers(void); +acpi_status acpi_ev_install_fadt_gpes(void); + u32 acpi_ev_fixed_event_detect(void); /* @@ -105,6 +107,10 @@ acpi_ev_create_gpe_block(struct acpi_namespace_node *gpe_device, u32 interrupt_number, struct acpi_gpe_block_info **return_gpe_block); +acpi_status +acpi_ev_initialize_gpe_block(struct acpi_namespace_node *gpe_device, + struct acpi_gpe_block_info *gpe_block); + acpi_status acpi_ev_delete_gpe_block(struct acpi_gpe_block_info *gpe_block); u32 diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h index 2c9c1a1d1b7..87e5e44572c 100644 --- a/include/acpi/acinterp.h +++ b/include/acpi/acinterp.h @@ -44,7 +44,49 @@ #ifndef __ACINTERP_H__ #define __ACINTERP_H__ -#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1])) +#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1])) + +/* Macros for tables used for debug output */ + +#define ACPI_EXD_OFFSET(f) (u8) ACPI_OFFSET (union acpi_operand_object,f) +#define ACPI_EXD_NSOFFSET(f) (u8) ACPI_OFFSET (struct acpi_namespace_node,f) +#define ACPI_EXD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_exdump_info)) + +/* + * If possible, pack the following structure to byte alignment, since we + * don't care about performance for debug output + */ +#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED +#pragma pack(1) +#endif + +typedef const struct acpi_exdump_info { + u8 opcode; + u8 offset; + char *name; + +} acpi_exdump_info; + +/* Values for the Opcode field above */ + +#define ACPI_EXD_INIT 0 +#define ACPI_EXD_TYPE 1 +#define ACPI_EXD_UINT8 2 +#define ACPI_EXD_UINT16 3 +#define ACPI_EXD_UINT32 4 +#define ACPI_EXD_UINT64 5 +#define ACPI_EXD_LITERAL 6 +#define ACPI_EXD_POINTER 7 +#define ACPI_EXD_ADDRESS 8 +#define ACPI_EXD_STRING 9 +#define ACPI_EXD_BUFFER 10 +#define ACPI_EXD_PACKAGE 11 +#define ACPI_EXD_FIELD 12 +#define ACPI_EXD_REFERENCE 13 + +/* restore default alignment */ + +#pragma pack() /* * exconvrt - object conversion @@ -327,7 +369,7 @@ acpi_ex_dump_operands(union acpi_operand_object **operands, void acpi_ex_dump_object_descriptor(union acpi_operand_object *object, u32 flags); -void acpi_ex_dump_node(struct acpi_namespace_node *node, u32 flags); +void acpi_ex_dump_namespace_node(struct acpi_namespace_node *node, u32 flags); #endif /* ACPI_FUTURE_USAGE */ /* diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index 25cff0d5ba5..2bf53940f25 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h @@ -101,27 +101,11 @@ typedef const struct acpi_rsconvert_info { #define ACPI_RS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_resource,f) #define AML_OFFSET(f) (u8) ACPI_OFFSET (union aml_resource,f) -/* - * Resource dispatch and info tables - */ -typedef const struct acpi_resource_info { - u8 length_type; - u8 minimum_aml_resource_length; - u8 minimum_internal_struct_length; - -} acpi_resource_info; - -/* Types for length_type above */ - -#define ACPI_FIXED_LENGTH 0 -#define ACPI_VARIABLE_LENGTH 1 -#define ACPI_SMALL_VARIABLE_LENGTH 2 - typedef const struct acpi_rsdump_info { u8 opcode; u8 offset; char *name; - const void *pointer; + const char **pointer; } acpi_rsdump_info; @@ -153,10 +137,9 @@ extern struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[]; /* Resource tables indexed by raw AML resource descriptor type */ -extern struct acpi_resource_info acpi_gbl_sm_resource_info[]; -extern struct acpi_resource_info acpi_gbl_lg_resource_info[]; -extern struct acpi_rsconvert_info *acpi_gbl_sm_get_resource_dispatch[]; -extern struct acpi_rsconvert_info *acpi_gbl_lg_get_resource_dispatch[]; +extern struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[]; + +extern const u8 acpi_gbl_resource_struct_sizes[]; /* * rscreate @@ -272,8 +255,6 @@ void acpi_rs_set_resource_length(acpi_rsdesc_size total_length, union aml_resource *aml); -struct acpi_resource_info *acpi_rs_get_resource_info(u8 resource_type); - /* * rsdump */ diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 7386eb81bd2..4ff963323de 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h @@ -44,6 +44,15 @@ #ifndef _ACUTILS_H #define _ACUTILS_H +extern const u8 acpi_gbl_resource_aml_sizes[]; + +/* Types for Resource descriptor entries */ + +#define ACPI_INVALID_RESOURCE 0 +#define ACPI_FIXED_LENGTH 1 +#define ACPI_VARIABLE_LENGTH 2 +#define ACPI_SMALL_VARIABLE_LENGTH 3 + typedef acpi_status(*acpi_pkg_callback) (u8 object_type, union acpi_operand_object * source_object, @@ -418,13 +427,19 @@ acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); #define ACPI_ANY_BASE 0 +acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index); + u32 acpi_ut_get_descriptor_length(void *aml); u16 acpi_ut_get_resource_length(void *aml); +u8 acpi_ut_get_resource_header_length(void *aml); + u8 acpi_ut_get_resource_type(void *aml); -u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc); +acpi_status +acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, + u8 ** end_tag); u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h index 3112be52773..2e3382c1e5e 100644 --- a/include/acpi/amlresrc.h +++ b/include/acpi/amlresrc.h @@ -92,6 +92,11 @@ struct asl_resource_node { struct asl_resource_node *next; }; +/* Macros used to generate AML resource length fields */ + +#define ACPI_AML_SIZE_LARGE(r) (sizeof (r) - sizeof (struct aml_resource_large_header)) +#define ACPI_AML_SIZE_SMALL(r) (sizeof (r) - sizeof (struct aml_resource_small_header)) + /* * Resource descriptors defined in the ACPI specification. * -- cgit v1.2.3 From c51a4de85de720670f2fbc592a6f8040af72ad87 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Thu, 17 Nov 2005 13:07:00 -0500 Subject: [ACPI] ACPICA 20051117 Fixed a problem in the AML parser where the method thread count could be decremented below zero if any errors occurred during the method parse phase. This should eliminate AE_AML_METHOD_LIMIT exceptions seen on some machines. This also fixed a related regression with the mechanism that detects and corrects methods that cannot properly handle reentrancy (related to the deployment of the new OwnerId mechanism.) Eliminated the pre-parsing of control methods (to detect errors) during table load. Related to the problem above, this was causing unwind issues if any errors occurred during the parse, and it seemed to be overkill. A table load should not be aborted if there are problems with any single control method, thus rendering this feature rather pointless. Fixed a problem with the new table-driven resource manager where an internal buffer overflow could occur for small resource templates. Implemented a new external interface, acpi_get_vendor_resource() This interface will find and return a vendor-defined resource descriptor within a _CRS or _PRS method via an ACPI 3.0 UUID match. (from Bjorn Helgaas) Removed the length limit (200) on string objects as per the upcoming ACPI 3.0A specification. This affects the following areas of the interpreter: 1) any implicit conversion of a Buffer to a String, 2) a String object result of the ASL Concatentate operator, 3) the String object result of the ASL ToString operator. Signed-off-by: Bob Moore Signed-off-by: Len Brown --- include/acpi/acconfig.h | 14 +++----------- include/acpi/acglobal.h | 1 + include/acpi/aclocal.h | 4 +++- include/acpi/acmacros.h | 27 ++++++++++++++++++++------- include/acpi/acpixf.h | 8 +++++++- include/acpi/acresrc.h | 7 ++++++- include/acpi/actypes.h | 23 ++++++++++++++++++++++- include/acpi/platform/aclinux.h | 4 ++++ 8 files changed, 66 insertions(+), 22 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index d371ec6b981..08eafece3ee 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20051102 +#define ACPI_CA_VERSION 0x20051117 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, @@ -98,11 +98,6 @@ #define ACPI_CA_SUPPORT_LEVEL 3 -/* String size constants */ - -#define ACPI_MAX_STRING_LENGTH 512 -#define ACPI_PATHNAME_MAX 256 /* A full namespace pathname */ - /* Maximum count for a semaphore object */ #define ACPI_MAX_SEMAPHORE_COUNT 256 @@ -134,14 +129,11 @@ #define ACPI_METHOD_NUM_ARGS 7 #define ACPI_METHOD_MAX_ARG 6 -/* Maximum length of resulting string when converting from a buffer */ - -#define ACPI_MAX_STRING_CONVERSION 200 - -/* Length of _HID, _UID, and _CID values */ +/* Length of _HID, _UID, _CID, and UUID values */ #define ACPI_DEVICE_ID_LENGTH 0x09 #define ACPI_MAX_CID_LENGTH 48 +#define ACPI_UUID_LENGTH 16 /* * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index cef51b1ddf9..bd344e51313 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h @@ -223,6 +223,7 @@ ACPI_EXTERN u32 acpi_gbl_ps_find_count; ACPI_EXTERN u32 acpi_gbl_owner_id_mask; ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; ACPI_EXTERN u16 acpi_gbl_global_lock_handle; +ACPI_EXTERN u8 acpi_gbl_last_owner_id; ACPI_EXTERN u8 acpi_gbl_debugger_configuration; ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; ACPI_EXTERN u8 acpi_gbl_step_to_next_call; diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index dca0d40ea39..0cb61a72d97 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -573,6 +573,8 @@ struct acpi_parse_obj_named { /* The parse node is the fundamental element of the parse tree */ +#define ACPI_MAX_PARSEOP_NAME 20 + struct acpi_parse_obj_asl { ACPI_PARSE_COMMON union acpi_parse_object *child; union acpi_parse_object *parent_method; @@ -597,7 +599,7 @@ struct acpi_parse_obj_asl { u8 aml_opcode_length; u8 aml_pkg_len_bytes; u8 extra; - char parse_op_name[12]; + char parse_op_name[ACPI_MAX_PARSEOP_NAME]; }; union acpi_parse_object { diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index e42222c3d34..5b78ff4091b 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -107,23 +107,29 @@ * Extract a byte of data using a pointer. Any more than a byte and we * get into potential aligment issues -- see the STORE macros below */ -#define ACPI_GET8(addr) (*(u8*)(addr)) +#define ACPI_GET8(ptr) *ACPI_CAST_PTR (u8, ptr) +#define ACPI_GET16(ptr) *ACPI_CAST_PTR (u16, ptr) +#define ACPI_GET32(ptr) *ACPI_CAST_PTR (u32, ptr) +#define ACPI_GET64(ptr) *ACPI_CAST_PTR (u64, ptr) +#define ACPI_SET8(ptr) *ACPI_CAST_PTR (u8, ptr) +#define ACPI_SET16(ptr) *ACPI_CAST_PTR (u16, ptr) +#define ACPI_SET32(ptr) *ACPI_CAST_PTR (u32, ptr) +#define ACPI_SET64(ptr) *ACPI_CAST_PTR (u64, ptr) -/* Pointer arithmetic */ +/* Pointer manipulation */ -#define ACPI_PTR_ADD(t,a,b) (t *) (void *)((char *)(a) + (acpi_native_uint)(b)) +#define ACPI_CAST_PTR(t, p) ((t *)(void *)(p)) +#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **)(void *)(p)) +#define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8, (a)) + (acpi_native_uint)(b))) #define ACPI_PTR_DIFF(a,b) (acpi_native_uint) ((char *)(a) - (char *)(b)) /* Pointer/Integer type conversions */ -#define ACPI_TO_POINTER(i) ACPI_PTR_ADD (void, (void *) NULL,(acpi_native_uint)i) +#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(acpi_native_uint)i) #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) #define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) #define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f) -#define ACPI_CAST_PTR(t, p) ((t *)(void *)(p)) -#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **)(void *)(p)) - #if ACPI_MACHINE_WIDTH == 16 #define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) #define ACPI_PHYSADDR_TO_PTR(i) (void *)(i) @@ -365,6 +371,13 @@ #define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask) #define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask) +/* Generate a UUID */ + +#define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) (a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \ + (b) & 0xFF, ((b) >> 8) & 0xFF, \ + (c) & 0xFF, ((c) >> 8) & 0xFF, \ + (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) + /* * An struct acpi_namespace_node * can appear in some contexts, * where a pointer to an union acpi_operand_object can also diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 02f00a8fee0..2a88429bc4e 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -271,6 +271,12 @@ typedef acpi_status(*ACPI_WALK_RESOURCE_CALLBACK) (struct acpi_resource * resource, void *context); +acpi_status +acpi_get_vendor_resource(acpi_handle device_handle, + char *name, + struct acpi_vendor_uuid *uuid, + struct acpi_buffer *ret_buffer); + acpi_status acpi_get_current_resources(acpi_handle device_handle, struct acpi_buffer *ret_buffer); @@ -283,7 +289,7 @@ acpi_get_possible_resources(acpi_handle device_handle, acpi_status acpi_walk_resources(acpi_handle device_handle, - char *path, + char *name, ACPI_WALK_RESOURCE_CALLBACK user_function, void *context); acpi_status diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index 2bf53940f25..ba281f7740a 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h @@ -137,9 +137,14 @@ extern struct acpi_rsconvert_info *acpi_gbl_set_resource_dispatch[]; /* Resource tables indexed by raw AML resource descriptor type */ +extern const u8 acpi_gbl_resource_struct_sizes[]; extern struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[]; -extern const u8 acpi_gbl_resource_struct_sizes[]; +struct acpi_vendor_walk_info { + struct acpi_vendor_uuid *uuid; + struct acpi_buffer *buffer; + acpi_status status; +}; /* * rscreate diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 29b887017b1..11847592ed1 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -326,7 +326,7 @@ typedef u64 acpi_integer; /* * Constants with special meanings */ -#define ACPI_ROOT_OBJECT (acpi_handle) ACPI_PTR_ADD (char, NULL, ACPI_MAX_PTR) +#define ACPI_ROOT_OBJECT ACPI_ADD_PTR (acpi_handle, NULL, ACPI_MAX_PTR) /* * Initialization sequence @@ -986,6 +986,17 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (6 #pragma pack(1) #endif +/* UUID data structures for use in vendor-defined resource descriptors */ + +struct acpi_uuid { + u8 data[ACPI_UUID_LENGTH]; +}; + +struct acpi_vendor_uuid { + u8 subtype; + u8 data[ACPI_UUID_LENGTH]; +}; + /* * Structures used to describe device resources */ @@ -1033,6 +1044,15 @@ struct acpi_resource_vendor { u8 byte_data[1]; }; +/* Vendor resource with UUID info (introduced in ACPI 3.0) */ + +struct acpi_resource_vendor_typed { + u16 byte_length; + u8 uuid_subtype; + u8 uuid[ACPI_UUID_LENGTH]; + u8 byte_data[1]; +}; + struct acpi_resource_end_tag { u8 checksum; }; @@ -1184,6 +1204,7 @@ union acpi_resource_data { struct acpi_resource_io io; struct acpi_resource_fixed_io fixed_io; struct acpi_resource_vendor vendor; + struct acpi_resource_vendor_typed vendor_typed; struct acpi_resource_end_tag end_tag; struct acpi_resource_memory24 memory24; struct acpi_resource_memory32 memory32; diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index c93e6562f0e..1b9cbf05b79 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -71,6 +71,10 @@ #define acpi_cache_t kmem_cache_t #endif +/* Full namespace pathname length limit - arbitrary */ + +#define ACPI_PATHNAME_MAX 256 + #else /* !__KERNEL__ */ #include -- cgit v1.2.3 From 28f55ebce5bd2fceec8adc7c8860953d3e4532a8 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 2 Dec 2005 18:27:00 -0500 Subject: [ACPI] ACPICA 20051202 Modified the parsing of control methods to no longer create namespace objects during the first pass of the parse. Objects are now created only during the execute phase, at the moment the namespace creation operator is encountered in the AML (Name, OperationRegion, CreateByteField, etc.) This should eliminate ALREADY_EXISTS exceptions seen on some machines where reentrant control methods are protected by an AML mutex. The mutex will now correctly block multiple threads from attempting to create the same object more than once. Increased the number of available Owner Ids for namespace object tracking from 32 to 255. This should eliminate the OWNER_ID_LIMIT exceptions seen on some machines with a large number of ACPI tables (either static or dynamic). Enhanced the namespace dump routine to output the owner ID for each namespace object. Signed-off-by: Bob Moore Signed-off-by: Len Brown --- include/acpi/acconfig.h | 6 +++++- include/acpi/acglobal.h | 5 +++-- include/acpi/acmacros.h | 4 ++++ 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 08eafece3ee..f48b9ee9a87 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20051117 +#define ACPI_CA_VERSION 0x20051202 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, @@ -110,6 +110,10 @@ #define ACPI_SYSMEM_REGION_WINDOW_SIZE 4096 +/* owner_id tracking. 8 entries allows for 255 owner_ids */ + +#define ACPI_NUM_OWNERID_MASKS 8 + /****************************************************************************** * * ACPI Specification constants (Do not change unless the specification changes) diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index bd344e51313..3f37560c26a 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h @@ -220,10 +220,11 @@ ACPI_EXTERN u32 acpi_gbl_original_mode; ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; ACPI_EXTERN u32 acpi_gbl_ps_find_count; -ACPI_EXTERN u32 acpi_gbl_owner_id_mask; +ACPI_EXTERN u32 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS]; ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; ACPI_EXTERN u16 acpi_gbl_global_lock_handle; -ACPI_EXTERN u8 acpi_gbl_last_owner_id; +ACPI_EXTERN u8 acpi_gbl_last_owner_id_index; +ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset; ACPI_EXTERN u8 acpi_gbl_debugger_configuration; ACPI_EXTERN u8 acpi_gbl_global_lock_acquired; ACPI_EXTERN u8 acpi_gbl_step_to_next_call; diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 5b78ff4091b..65a1a5c1a68 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -332,6 +332,10 @@ #define ACPI_MUL_16(a) _ACPI_MUL(a,4) #define ACPI_MOD_16(a) _ACPI_MOD(a,16) +#define ACPI_DIV_32(a) _ACPI_DIV(a,5) +#define ACPI_MUL_32(a) _ACPI_MUL(a,5) +#define ACPI_MOD_32(a) _ACPI_MOD(a,32) + /* * Rounding macros (Power of two boundaries only) */ -- cgit v1.2.3 From 729b4d4ce1982c52040bbf22d6711cdf8db07ad8 Mon Sep 17 00:00:00 2001 From: Alexey Starikovskiy Date: Thu, 1 Dec 2005 04:29:00 -0500 Subject: [ACPI] fix reboot upon suspend-to-disk http://bugzilla.kernel.org/show_bug.cgi?id=4320 Signed-off-by: Alexey Starikovskiy Acked-by: Pavel Machek Signed-off-by: Len Brown --- include/linux/kernel.h | 1 + include/linux/reboot.h | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/kernel.h b/include/linux/kernel.h index b1e407a4fbd..73aa55a7333 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -181,6 +181,7 @@ extern enum system_states { SYSTEM_HALT, SYSTEM_POWER_OFF, SYSTEM_RESTART, + SYSTEM_SUSPEND_DISK, } system_state; #define TAINT_PROPRIETARY_MODULE (1<<0) diff --git a/include/linux/reboot.h b/include/linux/reboot.h index 7ab2cdb83ef..015297ff73f 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h @@ -60,8 +60,7 @@ extern void machine_crash_shutdown(struct pt_regs *); */ extern void kernel_restart_prepare(char *cmd); -extern void kernel_halt_prepare(void); -extern void kernel_power_off_prepare(void); +extern void kernel_shutdown_prepare(enum system_states state); extern void kernel_restart(char *cmd); extern void kernel_halt(void); -- cgit v1.2.3 From defba1d8f233c0d5cf3e1ea6aeb898eca7231860 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 16 Dec 2005 17:05:00 -0500 Subject: [ACPI] ACPICA 20051216 Implemented optional support to allow unresolved names within ASL Package objects. A null object is inserted in the package when a named reference cannot be located in the current namespace. Enabled via the interpreter slack flag which Linux has enabled by default (acpi=strict to disable slack). This should eliminate AE_NOT_FOUND exceptions seen on machines that contain such code. Implemented an optimization to the initialization sequence that can improve boot time. During ACPI device initialization, the _STA method is now run if and only if the _INI method exists. The _STA method is used to determine if the device is present; An _INI can only be run if _STA returns present, but it is a waste of time to run the _STA method if the _INI does not exist. (Prototype and assistance from Dong Wei) Implemented use of the C99 uintptr_t for the pointer casting macros if it is available in the current compiler. Otherwise, the default (void *) cast is used as before. Fixed some possible memory leaks found within the execution path of the Break, Continue, If, and CreateField operators. (Valery Podrezov) Fixed a problem introduced in the 20051202 release where an exception is generated during method execution if a control method attempts to declare another method. Signed-off-by: Bob Moore Signed-off-by: Len Brown --- include/acpi/acconfig.h | 2 +- include/acpi/acdisasm.h | 22 +--- include/acpi/acdispat.h | 3 + include/acpi/acglobal.h | 8 +- include/acpi/aclocal.h | 31 +++++ include/acpi/acmacros.h | 24 ++-- include/acpi/actbl.h | 6 + include/acpi/actypes.h | 303 +++++++++++++++++++++++++++--------------------- include/acpi/acutils.h | 24 ++++ 9 files changed, 255 insertions(+), 168 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index f48b9ee9a87..1f2477eb95f 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20051202 +#define ACPI_CA_VERSION 0x20051216 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index 99250ee1b9d..0a8f49f5d2f 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h @@ -57,27 +57,11 @@ struct acpi_external_list { }; extern struct acpi_external_list *acpi_gbl_external_list; -extern const char *acpi_gbl_io_decode[2]; + +/* Strings used for decoding flags to ASL keywords */ + extern const char *acpi_gbl_word_decode[4]; -extern const char *acpi_gbl_consume_decode[2]; -extern const char *acpi_gbl_config_decode[4]; -extern const char *acpi_gbl_min_decode[2]; -extern const char *acpi_gbl_max_decode[2]; -extern const char *acpi_gbl_DECdecode[2]; -extern const char *acpi_gbl_RNGdecode[4]; -extern const char *acpi_gbl_MEMdecode[4]; -extern const char *acpi_gbl_RWdecode[2]; extern const char *acpi_gbl_irq_decode[2]; -extern const char *acpi_gbl_HEdecode[2]; -extern const char *acpi_gbl_LLdecode[2]; -extern const char *acpi_gbl_SHRdecode[2]; -extern const char *acpi_gbl_TYPdecode[4]; -extern const char *acpi_gbl_BMdecode[2]; -extern const char *acpi_gbl_SIZdecode[4]; -extern const char *acpi_gbl_TTPdecode[2]; -extern const char *acpi_gbl_MTPdecode[4]; -extern const char *acpi_gbl_TRSdecode[2]; - extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index 065f24a77cf..cc6407eef70 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h @@ -201,6 +201,9 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, union acpi_operand_object *obj_desc, struct acpi_namespace_node *calling_method_node); +acpi_status +acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state); + /* * dsinit */ diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index 3f37560c26a..dfb3b2493ae 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h @@ -98,11 +98,15 @@ ACPI_EXTERN u32 acpi_gbl_trace_flags; /* * Enable "slack" in the AML interpreter? Default is FALSE, and the * interpreter strictly follows the ACPI specification. Setting to TRUE - * allows the interpreter to forgive certain bad AML constructs. Currently: + * allows the interpreter to ignore certain errors and/or bad AML constructs. + * + * Currently, these features are enabled by this flag: + * * 1) Allow "implicit return" of last value in a control method - * 2) Allow access beyond end of operation region + * 2) Allow access beyond the end of an operation region * 3) Allow access to uninitialized locals/args (auto-init to integer 0) * 4) Allow ANY object type to be a source operand for the Store() operator + * 5) Allow unresolved references (invalid target name) in package objects */ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 0cb61a72d97..da7f1cb96f5 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -276,6 +276,37 @@ struct acpi_create_field_info { u8 field_type; }; +/* + * Bitmapped ACPI types. Used internally only + */ +#define ACPI_BTYPE_ANY 0x00000000 +#define ACPI_BTYPE_INTEGER 0x00000001 +#define ACPI_BTYPE_STRING 0x00000002 +#define ACPI_BTYPE_BUFFER 0x00000004 +#define ACPI_BTYPE_PACKAGE 0x00000008 +#define ACPI_BTYPE_FIELD_UNIT 0x00000010 +#define ACPI_BTYPE_DEVICE 0x00000020 +#define ACPI_BTYPE_EVENT 0x00000040 +#define ACPI_BTYPE_METHOD 0x00000080 +#define ACPI_BTYPE_MUTEX 0x00000100 +#define ACPI_BTYPE_REGION 0x00000200 +#define ACPI_BTYPE_POWER 0x00000400 +#define ACPI_BTYPE_PROCESSOR 0x00000800 +#define ACPI_BTYPE_THERMAL 0x00001000 +#define ACPI_BTYPE_BUFFER_FIELD 0x00002000 +#define ACPI_BTYPE_DDB_HANDLE 0x00004000 +#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000 +#define ACPI_BTYPE_REFERENCE 0x00010000 +#define ACPI_BTYPE_RESOURCE 0x00020000 + +#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER) + +#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) +#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) +#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) +#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ +#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF + /***************************************************************************** * * Event typedefs and structs diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 65a1a5c1a68..0fa8f72dbac 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -60,7 +60,7 @@ /* * For 16-bit addresses, we have to assume that the upper 32 bits - * are zero. + * (out of 64) are zero. */ #define ACPI_LODWORD(l) ((u32)(l)) #define ACPI_HIDWORD(l) ((u32)(0)) @@ -104,8 +104,9 @@ #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) /* - * Extract a byte of data using a pointer. Any more than a byte and we - * get into potential aligment issues -- see the STORE macros below + * Extract data using a pointer. Any more than a byte and we + * get into potential aligment issues -- see the STORE macros below. + * Use with care. */ #define ACPI_GET8(ptr) *ACPI_CAST_PTR (u8, ptr) #define ACPI_GET16(ptr) *ACPI_CAST_PTR (u16, ptr) @@ -116,16 +117,17 @@ #define ACPI_SET32(ptr) *ACPI_CAST_PTR (u32, ptr) #define ACPI_SET64(ptr) *ACPI_CAST_PTR (u64, ptr) -/* Pointer manipulation */ - -#define ACPI_CAST_PTR(t, p) ((t *)(void *)(p)) -#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **)(void *)(p)) -#define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8, (a)) + (acpi_native_uint)(b))) -#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) ((char *)(a) - (char *)(b)) +/* + * Pointer manipulation + */ +#define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p)) +#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p)) +#define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8,(a)) + (acpi_native_uint)(b))) +#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) (ACPI_CAST_PTR (u8,(a)) - ACPI_CAST_PTR (u8,(b))) /* Pointer/Integer type conversions */ -#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(acpi_native_uint)i) +#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) #define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) #define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f) @@ -133,7 +135,7 @@ #if ACPI_MACHINE_WIDTH == 16 #define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) #define ACPI_PHYSADDR_TO_PTR(i) (void *)(i) -#define ACPI_PTR_TO_PHYSADDR(i) (u32) (char *)(i) +#define ACPI_PTR_TO_PHYSADDR(i) (u32) ACPI_CAST_PTR (u8,(i)) #else #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index a46f406e1c9..ef2ddcadfe6 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h @@ -44,6 +44,12 @@ #ifndef __ACTBL_H__ #define __ACTBL_H__ +/* + * Note about bitfields: The u8 type is used for bitfields in ACPI tables. + * This is the only type that is even remotely portable. Anything else is not + * portable, so do not use any other bitfield types. + */ + /* * Values for description table header signatures */ diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 11847592ed1..18e1338c5c7 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -44,7 +44,15 @@ #ifndef __ACTYPES_H__ #define __ACTYPES_H__ -/*! [Begin] no source code translation (keep the typedefs) */ +/* + * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header + * and must be either 16, 32, or 64 + */ +#ifndef ACPI_MACHINE_WIDTH +#error ACPI_MACHINE_WIDTH not defined +#endif + +/*! [Begin] no source code translation */ /* * Data type ranges @@ -58,154 +66,210 @@ #define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ #define ACPI_ASCII_MAX 0x7F -#ifdef DEFINE_ALTERNATE_TYPES /* - * Types used only in translated source, defined here to enable - * cross-platform compilation only. + * Architecture-specific ACPICA Subsystem Data Types + * + * The goal of these types is to provide source code portability across + * 16-bit, 32-bit, and 64-bit targets. + * + * 1) The following types are of fixed size for all targets (16/32/64): + * + * BOOLEAN Logical boolean + * + * UINT8 8-bit (1 byte) unsigned value + * UINT16 16-bit (2 byte) unsigned value + * UINT32 32-bit (4 byte) unsigned value + * UINT64 64-bit (8 byte) unsigned value + * + * INT16 16-bit (2 byte) signed value + * INT32 32-bit (4 byte) signed value + * INT64 64-bit (8 byte) signed value + * + * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the + * compiler-dependent header(s) and were introduced because there is no common + * 64-bit integer type across the various compilation models, as shown in + * the table below. + * + * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit + * char 8 8 8 8 8 8 + * short 16 16 16 16 16 16 + * _int32 32 + * int 32 64 32 32 16 16 + * long 64 64 32 32 32 32 + * long long 64 64 + * pointer 64 64 64 32 32 32 + * + * Note: ILP64 and LP32 are currently not supported. + * + * + * 2) These types represent the native word size of the target mode of the + * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are + * usually used for memory allocation, efficient loop counters, and array + * indexes. The types are similar to the size_t type in the C library and are + * required because there is no C type that consistently represents the native + * data width. + * + * ACPI_SIZE 16/32/64-bit unsigned value + * ACPI_NATIVE_UINT 16/32/64-bit unsigned value + * ACPI_NATIVE_INT 16/32/64-bit signed value + * */ -typedef int s32; -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; -typedef COMPILER_DEPENDENT_UINT64 u64; -#endif - -/* - * Data types - Fixed across all compilation models (16/32/64) +/******************************************************************************* * - * BOOLEAN Logical Boolean. - * INT8 8-bit (1 byte) signed value - * UINT8 8-bit (1 byte) unsigned value - * INT16 16-bit (2 byte) signed value - * UINT16 16-bit (2 byte) unsigned value - * INT32 32-bit (4 byte) signed value - * UINT32 32-bit (4 byte) unsigned value - * INT64 64-bit (8 byte) signed value - * UINT64 64-bit (8 byte) unsigned value - * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on x86_64/IA-64 unsigned value - */ + * Common types for all compilers, all targets + * + ******************************************************************************/ + +typedef unsigned char BOOLEAN; +typedef unsigned char UINT8; +typedef unsigned short UINT16; +typedef COMPILER_DEPENDENT_UINT64 UINT64; +typedef COMPILER_DEPENDENT_INT64 INT64; -typedef unsigned long acpi_native_uint; +/*! [End] no source code translation !*/ -#ifndef ACPI_MACHINE_WIDTH -#error ACPI_MACHINE_WIDTH not defined -#endif +/******************************************************************************* + * + * Types specific to 64-bit targets + * + ******************************************************************************/ #if ACPI_MACHINE_WIDTH == 64 -/*! [Begin] no source code translation (keep the typedefs) */ +/*! [Begin] no source code translation (keep the typedefs as-is) */ -/* - * 64-bit type definitions - */ -typedef unsigned char UINT8; -typedef unsigned char BOOLEAN; -typedef unsigned short UINT16; -typedef int INT32; typedef unsigned int UINT32; -typedef COMPILER_DEPENDENT_INT64 INT64; -typedef COMPILER_DEPENDENT_UINT64 UINT64; +typedef int INT32; /*! [End] no source code translation !*/ +typedef u64 acpi_native_uint; +typedef s64 acpi_native_int; + typedef u64 acpi_table_ptr; typedef u64 acpi_io_address; typedef u64 acpi_physical_address; -typedef u64 acpi_size; -#define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */ -#define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */ #define ACPI_MAX_PTR ACPI_UINT64_MAX #define ACPI_SIZE_MAX ACPI_UINT64_MAX +#define ALIGNED_ADDRESS_BOUNDARY 0x00000008 +#define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */ + /* * In the case of the Itanium Processor Family (IPF), the hardware does not * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag * to indicate that special precautions must be taken to avoid alignment faults. * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) * - * Note: Em64_t and other X86-64 processors do support misaligned transfers, + * Note: Em64_t and other X86-64 processors support misaligned transfers, * so there is no need to define this flag. */ #if defined (__IA64__) || defined (__ia64__) #define ACPI_MISALIGNMENT_NOT_SUPPORTED #endif +/******************************************************************************* + * + * Types specific to 32-bit targets + * + ******************************************************************************/ + +#elif ACPI_MACHINE_WIDTH == 32 + +/*! [Begin] no source code translation (keep the typedefs as-is) */ + +typedef unsigned int UINT32; +typedef int INT32; + +/*! [End] no source code translation !*/ + +typedef u32 acpi_native_uint; +typedef s32 acpi_native_int; + +typedef u64 acpi_table_ptr; +typedef u32 acpi_io_address; +typedef u64 acpi_physical_address; + +#define ACPI_MAX_PTR ACPI_UINT32_MAX +#define ACPI_SIZE_MAX ACPI_UINT32_MAX + +#define ALIGNED_ADDRESS_BOUNDARY 0x00000004 + +/******************************************************************************* + * + * Types specific to 16-bit targets + * + ******************************************************************************/ + #elif ACPI_MACHINE_WIDTH == 16 /*! [Begin] no source code translation (keep the typedefs as-is) */ -/* - * 16-bit type definitions - */ -typedef unsigned char UINT8; -typedef unsigned char BOOLEAN; -typedef unsigned int UINT16; -typedef long INT32; -typedef int INT16; typedef unsigned long UINT32; - -struct { - UINT32 Lo; - UINT32 Hi; -}; +typedef short INT16; +typedef long INT32; /*! [End] no source code translation !*/ +typedef u16 acpi_native_uint; +typedef s16 acpi_native_int; + typedef u32 acpi_table_ptr; typedef u32 acpi_io_address; typedef char *acpi_physical_address; -typedef u16 acpi_size; -#define ALIGNED_ADDRESS_BOUNDARY 0x00000002 -#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ #define ACPI_MAX_PTR ACPI_UINT16_MAX #define ACPI_SIZE_MAX ACPI_UINT16_MAX -/* - * (16-bit only) internal integers must be 32-bits, so - * 64-bit integers cannot be supported - */ -#define ACPI_NO_INTEGER64_SUPPORT +#define ALIGNED_ADDRESS_BOUNDARY 0x00000002 +#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */ -#elif ACPI_MACHINE_WIDTH == 32 +/* 64-bit integers cannot be supported */ -/*! [Begin] no source code translation (keep the typedefs) */ +#define ACPI_NO_INTEGER64_SUPPORT -/* - * 32-bit type definitions (default) - */ -typedef unsigned char UINT8; -typedef unsigned char BOOLEAN; -typedef unsigned short UINT16; -typedef int INT32; -typedef unsigned int UINT32; -typedef COMPILER_DEPENDENT_INT64 INT64; -typedef COMPILER_DEPENDENT_UINT64 UINT64; +#else -/*! [End] no source code translation !*/ +/* ACPI_MACHINE_WIDTH must be either 64, 32, or 16 */ -typedef u64 acpi_table_ptr; -typedef u32 acpi_io_address; -typedef u64 acpi_physical_address; -typedef u32 acpi_size; +#error unknown ACPI_MACHINE_WIDTH +#endif -#define ALIGNED_ADDRESS_BOUNDARY 0x00000004 -#define ACPI_MAX_PTR ACPI_UINT32_MAX -#define ACPI_SIZE_MAX ACPI_UINT32_MAX +/******************************************************************************* + * + * OS- or compiler-dependent types + * + ******************************************************************************/ -#else -#error unknown ACPI_MACHINE_WIDTH +/* + * If acpi_uintptr_t was not defined in the OS- or compiler-dependent header, + * define it now (use C99 uintptr_t for pointer casting if available, + * "void *" otherwise) + */ +#ifndef acpi_uintptr_t +#define acpi_uintptr_t void * #endif /* - * This type is used for bitfields in ACPI tables. The only type that is - * even remotely portable is u8. Anything else is not portable, so - * do not add any more bitfield types. + * If acpi_cache_t was not defined in the OS-dependent header, + * define it now. This is typically the case where the local cache + * manager implementation is to be used (ACPI_USE_LOCAL_CACHE) */ -typedef u8 UINT8_BIT; -typedef acpi_native_uint ACPI_PTRDIFF; +#ifndef acpi_cache_t +#define acpi_cache_t struct acpi_memory_list +#endif + +/* Variable-width type, used instead of clib size_t */ + +typedef acpi_native_uint acpi_size; + +/******************************************************************************* + * + * Independent types + * + ******************************************************************************/ /* * Pointer overlays to avoid lots of typecasting for @@ -237,18 +301,8 @@ struct acpi_pointer { #define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER #define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER -/* - * If acpi_cache_t was not defined in the OS-dependent header, - * define it now. This is typically the case where the local cache - * manager implementation is to be used (ACPI_USE_LOCAL_CACHE) - */ -#ifndef acpi_cache_t -#define acpi_cache_t struct acpi_memory_list -#endif +/* Logical defines and NULL */ -/* - * Useful defines - */ #ifdef FALSE #undef FALSE #endif @@ -264,12 +318,12 @@ struct acpi_pointer { #endif /* - * Local datatypes + * Mescellaneous types */ typedef u32 acpi_status; /* All ACPI Exceptions */ typedef u32 acpi_name; /* 4-byte ACPI name */ typedef char *acpi_string; /* Null terminated ASCII string */ -typedef void *acpi_handle; /* Actually a ptr to an Node */ +typedef void *acpi_handle; /* Actually a ptr to a NS Node */ struct uint64_struct { u32 lo; @@ -472,37 +526,6 @@ typedef u32 acpi_object_type; #define ACPI_TYPE_INVALID 0x1E #define ACPI_TYPE_NOT_FOUND 0xFF -/* - * Bitmapped ACPI types. Used internally only - */ -#define ACPI_BTYPE_ANY 0x00000000 -#define ACPI_BTYPE_INTEGER 0x00000001 -#define ACPI_BTYPE_STRING 0x00000002 -#define ACPI_BTYPE_BUFFER 0x00000004 -#define ACPI_BTYPE_PACKAGE 0x00000008 -#define ACPI_BTYPE_FIELD_UNIT 0x00000010 -#define ACPI_BTYPE_DEVICE 0x00000020 -#define ACPI_BTYPE_EVENT 0x00000040 -#define ACPI_BTYPE_METHOD 0x00000080 -#define ACPI_BTYPE_MUTEX 0x00000100 -#define ACPI_BTYPE_REGION 0x00000200 -#define ACPI_BTYPE_POWER 0x00000400 -#define ACPI_BTYPE_PROCESSOR 0x00000800 -#define ACPI_BTYPE_THERMAL 0x00001000 -#define ACPI_BTYPE_BUFFER_FIELD 0x00002000 -#define ACPI_BTYPE_DDB_HANDLE 0x00004000 -#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000 -#define ACPI_BTYPE_REFERENCE 0x00010000 -#define ACPI_BTYPE_RESOURCE 0x00020000 - -#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER) - -#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) -#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) -#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) -#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ -#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF - /* * All I/O */ @@ -856,6 +879,14 @@ struct acpi_compatible_id_list { #define ACPI_VALID_CID 0x0010 #define ACPI_VALID_SXDS 0x0020 +/* Flags for _STA method */ + +#define ACPI_STA_DEVICE_PRESENT 0x01 +#define ACPI_STA_DEVICE_ENABLED 0x02 +#define ACPI_STA_DEVICE_UI 0x04 +#define ACPI_STA_DEVICE_OK 0x08 +#define ACPI_STA_BATTERY_PRESENT 0x10 + #define ACPI_COMMON_OBJ_INFO \ acpi_object_type type; /* ACPI object type */ \ acpi_name name /* ACPI object Name */ @@ -921,7 +952,9 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (6 #define ACPI_ISA_ONLY_RANGES (u8) 0x02 #define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) -#define ACPI_SPARSE_TRANSLATION (u8) 0x03 +/* Type of translation - 1=Sparse, 0=Dense */ + +#define ACPI_SPARSE_TRANSLATION (u8) 0x01 /* * IO Port Descriptor Decode diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 4ff963323de..5fa21e03a62 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h @@ -46,6 +46,30 @@ extern const u8 acpi_gbl_resource_aml_sizes[]; +/* Strings used by the disassembler and debugger resource dump routines */ + +#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) + +extern const char *acpi_gbl_BMdecode[2]; +extern const char *acpi_gbl_config_decode[4]; +extern const char *acpi_gbl_consume_decode[2]; +extern const char *acpi_gbl_DECdecode[2]; +extern const char *acpi_gbl_HEdecode[2]; +extern const char *acpi_gbl_io_decode[2]; +extern const char *acpi_gbl_LLdecode[2]; +extern const char *acpi_gbl_max_decode[2]; +extern const char *acpi_gbl_MEMdecode[4]; +extern const char *acpi_gbl_min_decode[2]; +extern const char *acpi_gbl_MTPdecode[4]; +extern const char *acpi_gbl_RNGdecode[4]; +extern const char *acpi_gbl_RWdecode[2]; +extern const char *acpi_gbl_SHRdecode[2]; +extern const char *acpi_gbl_SIZdecode[4]; +extern const char *acpi_gbl_TRSdecode[2]; +extern const char *acpi_gbl_TTPdecode[2]; +extern const char *acpi_gbl_TYPdecode[4]; +#endif + /* Types for Resource descriptor entries */ #define ACPI_INVALID_RESOURCE 0 -- cgit v1.2.3 From 757b18661ea0a0d890e8ce7b1a391e5b7d417d78 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Sat, 7 Jan 2006 13:19:00 -0500 Subject: [ACPI] make two processor functions static acpi_processor_write_throttling() acpi_processor_write_limit() Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- include/acpi/processor.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'include') diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 7a00d5089de..edb5a8919cb 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h @@ -235,9 +235,6 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) /* in processor_throttling.c */ int acpi_processor_get_throttling_info(struct acpi_processor *pr); int acpi_processor_set_throttling(struct acpi_processor *pr, int state); -ssize_t acpi_processor_write_throttling(struct file *file, - const char __user * buffer, - size_t count, loff_t * data); extern struct file_operations acpi_processor_throttling_fops; /* in processor_idle.c */ @@ -249,9 +246,6 @@ int acpi_processor_power_exit(struct acpi_processor *pr, /* in processor_thermal.c */ int acpi_processor_get_limit_info(struct acpi_processor *pr); -ssize_t acpi_processor_write_limit(struct file *file, - const char __user * buffer, - size_t count, loff_t * data); extern struct file_operations acpi_processor_limit_fops; #ifdef CONFIG_CPU_FREQ -- cgit v1.2.3 From 168678233ca45af3f74fef60c4265fa5dd217e29 Mon Sep 17 00:00:00 2001 From: "akpm@osdl.org" Date: Fri, 13 Jan 2006 15:51:02 -0800 Subject: [AGPGART] Semaphore to Mutex conversion. Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Arjan van de Ven Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Dave Jones --- include/linux/agpgart.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/agpgart.h b/include/linux/agpgart.h index 17a17c55a17..6d59c8efe3b 100644 --- a/include/linux/agpgart.h +++ b/include/linux/agpgart.h @@ -111,6 +111,7 @@ typedef struct _agp_unbind { } agp_unbind; #else /* __KERNEL__ */ +#include #define AGPGART_MINOR 175 @@ -201,7 +202,7 @@ struct agp_file_private { }; struct agp_front_data { - struct semaphore agp_mutex; + struct mutex agp_mutex; struct agp_controller *current_controller; struct agp_controller *controllers; struct agp_file_private *file_priv_list; -- cgit v1.2.3 From 9834a2bb4970547540222fcba04e0a37d04cb0a0 Mon Sep 17 00:00:00 2001 From: Vlad Yasevich Date: Tue, 17 Jan 2006 11:52:12 -0800 Subject: [SCTP]: Fix sctp_cookie alignment in the packet. On 64 bit architectures, sctp_cookie sent as part of INIT-ACK is not aligned on a 64 bit boundry and thus causes unaligned access exceptions. The layout of the cookie prameter is this: |<----- Parameter Header --------------------|<--- Cookie DATA -------- ----------------------------------------------------------------------- | param type (16 bits) | param len (16 bits) | sig [32 bytes] | cookie.. ----------------------------------------------------------------------- The cookie data portion contains 64 bit values on 64 bit architechtures (timeval) that fall on a 32 bit alignment boundry when used as part of the on-wire format, but align correctly when used in internal structures. This patch explicitely pads the on-wire format so that it is properly aligned. Signed-off-by: Vlad Yasevich Signed-off-by: Sridhar Samudrala --- include/net/sctp/structs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index f5c22d77fea..72aeae4a006 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -405,8 +405,9 @@ struct sctp_cookie { /* The format of our cookie that we send to our peer. */ struct sctp_signed_cookie { __u8 signature[SCTP_SECRET_SIZE]; + __u32 __pad; /* force sctp_cookie alignment to 64 bits */ struct sctp_cookie c; -}; +} __attribute__((packed)); /* This is another convenience type to allocate memory for address * params for the maximum size and pass such structures around -- cgit v1.2.3 From 8116ffad4180b39d7a755345c1fde09da83930c0 Mon Sep 17 00:00:00 2001 From: Vlad Yasevich Date: Tue, 17 Jan 2006 11:55:17 -0800 Subject: [SCTP]: Fix bad sysctl formatting of SCTP timeout values on 64-bit m/cs. Change all the structure members that hold jiffies to be of type unsigned long. This also corrects bad sysctl formating on 64 bit architectures. Signed-off-by: Vlad Yasevich Signed-off-by: Sridhar Samudrala --- include/net/sctp/structs.h | 78 ++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 37 deletions(-) (limited to 'include') diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 72aeae4a006..ad3d15cb0a0 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -127,9 +127,9 @@ extern struct sctp_globals { * RTO.Alpha - 1/8 (3 when converted to right shifts.) * RTO.Beta - 1/4 (2 when converted to right shifts.) */ - __u32 rto_initial; - __u32 rto_min; - __u32 rto_max; + unsigned long rto_initial; + unsigned long rto_min; + unsigned long rto_max; /* Note: rto_alpha and rto_beta are really defined as inverse * powers of two to facilitate integer operations. @@ -140,12 +140,18 @@ extern struct sctp_globals { /* Max.Burst - 4 */ int max_burst; - /* Valid.Cookie.Life - 60 seconds */ - int valid_cookie_life; - /* Whether Cookie Preservative is enabled(1) or not(0) */ int cookie_preserve_enable; + /* Valid.Cookie.Life - 60 seconds */ + unsigned long valid_cookie_life; + + /* Delayed SACK timeout 200ms default*/ + unsigned long sack_timeout; + + /* HB.interval - 30 seconds */ + unsigned long hb_interval; + /* Association.Max.Retrans - 10 attempts * Path.Max.Retrans - 5 attempts (per destination address) * Max.Init.Retransmits - 8 attempts @@ -168,12 +174,6 @@ extern struct sctp_globals { */ int rcvbuf_policy; - /* Delayed SACK timeout 200ms default*/ - int sack_timeout; - - /* HB.interval - 30 seconds */ - int hb_interval; - /* The following variables are implementation specific. */ /* Default initialization values to be applied to new associations. */ @@ -828,7 +828,7 @@ struct sctp_transport { __u32 rtt; /* This is the most recent RTT. */ /* RTO : The current retransmission timeout value. */ - __u32 rto; + unsigned long rto; /* RTTVAR : The current RTT variation. */ __u32 rttvar; @@ -878,22 +878,10 @@ struct sctp_transport { /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to * the destination address every heartbeat interval. */ - __u32 hbinterval; - - /* This is the max_retrans value for the transport and will - * be initialized from the assocs value. This can be changed - * using SCTP_SET_PEER_ADDR_PARAMS socket option. - */ - __u16 pathmaxrxt; - - /* PMTU : The current known path MTU. */ - __u32 pathmtu; + unsigned long hbinterval; /* SACK delay timeout */ - __u32 sackdelay; - - /* Flags controling Heartbeat, SACK delay, and Path MTU Discovery. */ - __u32 param_flags; + unsigned long sackdelay; /* When was the last time (in jiffies) that we heard from this * transport? We use this to pick new active and retran paths. @@ -905,6 +893,18 @@ struct sctp_transport { */ unsigned long last_time_ecne_reduced; + /* This is the max_retrans value for the transport and will + * be initialized from the assocs value. This can be changed + * using SCTP_SET_PEER_ADDR_PARAMS socket option. + */ + __u16 pathmaxrxt; + + /* PMTU : The current known path MTU. */ + __u32 pathmtu; + + /* Flags controling Heartbeat, SACK delay, and Path MTU Discovery. */ + __u32 param_flags; + /* The number of times INIT has been sent on this transport. */ int init_sent_count; @@ -1500,9 +1500,9 @@ struct sctp_association { * These values will be initialized by system defaults, but can * be modified via the SCTP_RTOINFO socket option. */ - __u32 rto_initial; - __u32 rto_max; - __u32 rto_min; + unsigned long rto_initial; + unsigned long rto_max; + unsigned long rto_min; /* Maximum number of new data packets that can be sent in a burst. */ int max_burst; @@ -1520,13 +1520,13 @@ struct sctp_association { __u16 init_retries; /* The largest timeout or RTO value to use in attempting an INIT */ - __u16 max_init_timeo; + unsigned long max_init_timeo; /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to * the destination address every heartbeat interval. This value * will be inherited by all new transports. */ - __u32 hbinterval; + unsigned long hbinterval; /* This is the max_retrans value for new transports in the * association. @@ -1538,13 +1538,14 @@ struct sctp_association { */ __u32 pathmtu; - /* SACK delay timeout */ - __u32 sackdelay; - /* Flags controling Heartbeat, SACK delay, and Path MTU Discovery. */ __u32 param_flags; - int timeouts[SCTP_NUM_TIMEOUT_TYPES]; + /* SACK delay timeout */ + unsigned long sackdelay; + + + unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES]; struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES]; /* Transport to which SHUTDOWN chunk was last sent. */ @@ -1649,7 +1650,10 @@ struct sctp_association { /* How many duplicated TSNs have we seen? */ int numduptsns; - /* Number of seconds of idle time before an association is closed. */ + /* Number of seconds of idle time before an association is closed. + * In the association context, this is really used as a boolean + * since the real timeout is stored in the timeouts array + */ __u32 autoclose; /* These are to support -- cgit v1.2.3 From 313e7b4d2588539e388d31c1febd50503a0083fc Mon Sep 17 00:00:00 2001 From: Vlad Yasevich Date: Tue, 17 Jan 2006 11:55:57 -0800 Subject: [SCTP]: Fix machine check/connection hang on IA64. sctp_unpack_cookie used an on-stack array called digest as a result/out parameter in the call to crypto_hmac. However, hmac code (crypto_hmac_final) assumes that the 'out' argument is in virtual memory (identity mapped region) and can use virt_to_page call on it. This does not work with the on-stack declared digest. The problems observed so far have been: a) incorrect hmac digest b) machine check and hardware reset. Solution is to define the digest in an identity mapped region by kmalloc'ing it. We can do this once as part of the endpoint structure and re-use it when verifying the SCTP cookie. Signed-off-by: Vlad Yasevich Signed-off-by: Sridhar Samudrala --- include/net/sctp/structs.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index ad3d15cb0a0..8c522ae031b 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -1250,6 +1250,14 @@ struct sctp_endpoint { int last_key; int key_changed_at; + /* digest: This is a digest of the sctp cookie. This field is + * only used on the receive path when we try to validate + * that the cookie has not been tampered with. We put + * this here so we pre-allocate this once and can re-use + * on every receive. + */ + __u8 digest[SCTP_SIGNATURE_SIZE]; + /* sendbuf acct. policy. */ __u32 sndbuf_policy; -- cgit v1.2.3 From c4d2444e992c4eda1d7fc3287e93ba58295bf6b9 Mon Sep 17 00:00:00 2001 From: Sridhar Samudrala Date: Tue, 17 Jan 2006 11:56:26 -0800 Subject: [SCTP]: Fix couple of races between sctp_peeloff() and sctp_rcv(). Validate and update the sk in sctp_rcv() to avoid the race where an assoc/ep could move to a different socket after we get the sk, but before the skb is added to the backlog. Also migrate the skb's in backlog queue to new sk when doing a peeloff. Signed-off-by: Sridhar Samudrala --- include/net/sctp/sctp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index a553f39f6ae..e673b2c984e 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -175,6 +175,8 @@ void sctp_icmp_frag_needed(struct sock *, struct sctp_association *, void sctp_icmp_proto_unreachable(struct sock *sk, struct sctp_association *asoc, struct sctp_transport *t); +void sctp_backlog_migrate(struct sctp_association *assoc, + struct sock *oldsk, struct sock *newsk); /* * Section: Macros, externs, and inlines -- cgit v1.2.3 From f9e505a9a03df5acace6e758c8d12982635a1c64 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Tue, 17 Jan 2006 12:52:21 -0500 Subject: [IA64-SGI] sn2 mutex conversion Migrate sn2 code to use mutex and completion events rather than semaphores. Signed-off-by: Jes Sorensen Acked-by: Dean Nelson Signed-off-by: Tony Luck --- include/asm-ia64/sn/xp.h | 3 ++- include/asm-ia64/sn/xpc.h | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/asm-ia64/sn/xp.h b/include/asm-ia64/sn/xp.h index 203945ae034..9bd2f9bf329 100644 --- a/include/asm-ia64/sn/xp.h +++ b/include/asm-ia64/sn/xp.h @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -359,7 +360,7 @@ typedef void (*xpc_notify_func)(enum xpc_retval reason, partid_t partid, * the channel. */ struct xpc_registration { - struct semaphore sema; + struct mutex mutex; xpc_channel_func func; /* function to call */ void *key; /* pointer to user's key */ u16 nentries; /* #of msg entries in local msg queue */ diff --git a/include/asm-ia64/sn/xpc.h b/include/asm-ia64/sn/xpc.h index 87e9cd58851..0c36928ffd8 100644 --- a/include/asm-ia64/sn/xpc.h +++ b/include/asm-ia64/sn/xpc.h @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include #include @@ -335,8 +337,7 @@ struct xpc_openclose_args { * and consumed by the intended recipient. */ struct xpc_notify { - struct semaphore sema; /* notify semaphore */ - volatile u8 type; /* type of notification */ + volatile u8 type; /* type of notification */ /* the following two fields are only used if type == XPC_N_CALL */ xpc_notify_func func; /* user's notify function */ @@ -465,8 +466,8 @@ struct xpc_channel { xpc_channel_func func; /* user's channel function */ void *key; /* pointer to user's key */ - struct semaphore msg_to_pull_sema; /* next msg to pull serialization */ - struct semaphore wdisconnect_sema; /* wait for channel disconnect */ + struct mutex msg_to_pull_mutex; /* next msg to pull serialization */ + struct completion wdisconnect_wait; /* wait for channel disconnect */ struct xpc_openclose_args *local_openclose_args; /* args passed on */ /* opening or closing of channel */ -- cgit v1.2.3 From 8d08aed8d7714683b33666cc066e20f957dda01d Mon Sep 17 00:00:00 2001 From: Jack Steiner Date: Tue, 17 Jan 2006 15:42:46 -0600 Subject: [IA64] Zonelists for nodes without cpus If a node runs out of memory, ensure that memory on nodes w/o cpus is used before using memory on nodes with cpus. Signed-off-by: Jack Steiner Signed-off-by: Tony Luck --- include/asm-ia64/topology.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h index d8aae4da397..412ef8e493a 100644 --- a/include/asm-ia64/topology.h +++ b/include/asm-ia64/topology.h @@ -18,6 +18,10 @@ #include #ifdef CONFIG_NUMA + +/* Nodes w/o CPUs are preferred for memory allocations, see build_zonelists */ +#define PENALTY_FOR_NODE_WITH_CPUS 255 + /* * Returns the number of the node containing CPU 'cpu' */ -- cgit v1.2.3 From 4b16bfbf8f8013fefb49592d030ff87651ab48cb Mon Sep 17 00:00:00 2001 From: Zoltan Menyhart Date: Fri, 13 Jan 2006 17:25:23 +0100 Subject: [IA64] Fix bug in ia64 specific down() function Chen, Kenneth W wrote: > The memory order semantics for include/asm-ia64/semaphore.h:down() > doesn't look right. It is using atomic_dec_return, which eventually > translate into ia64_fetch_and_add() that uses release semantics. > Shouldn't it use acquire semantics? Use ia64_fetchadd() instead of atomic_dec_return() Acked-by: Ken Chen Signed-off-by: Tony Luck --- include/asm-ia64/semaphore.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/asm-ia64/semaphore.h b/include/asm-ia64/semaphore.h index bb8906285fa..f483eeb95dd 100644 --- a/include/asm-ia64/semaphore.h +++ b/include/asm-ia64/semaphore.h @@ -61,7 +61,7 @@ static inline void down (struct semaphore *sem) { might_sleep(); - if (atomic_dec_return(&sem->count) < 0) + if (ia64_fetchadd(-1, &sem->count.counter, acq) < 1) __down(sem); } @@ -75,7 +75,7 @@ down_interruptible (struct semaphore * sem) int ret = 0; might_sleep(); - if (atomic_dec_return(&sem->count) < 0) + if (ia64_fetchadd(-1, &sem->count.counter, acq) < 1) ret = __down_interruptible(sem); return ret; } @@ -85,7 +85,7 @@ down_trylock (struct semaphore *sem) { int ret = 0; - if (atomic_dec_return(&sem->count) < 0) + if (ia64_fetchadd(-1, &sem->count.counter, acq) < 1) ret = __down_trylock(sem); return ret; } @@ -93,7 +93,7 @@ down_trylock (struct semaphore *sem) static inline void up (struct semaphore * sem) { - if (atomic_inc_return(&sem->count) <= 0) + if (ia64_fetchadd(1, &sem->count.counter, rel) <= -1) __up(sem); } -- cgit v1.2.3 From 83933af4720b282f6f6a0b6c05a2a47b4cf08819 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Sat, 14 Jan 2006 16:01:49 +0100 Subject: [CPUFREQ] convert remaining cpufreq semaphore to a mutex This one fell through the automation at first because it initializes the semaphore to locked, but that's easily remedied Signed-off-by: Arjan van de Ven Signed-off-by: Dave Jones drivers/cpufreq/cpufreq.c | 37 +++++++++++++++++++------------------ include/linux/cpufreq.h | 3 ++- 2 files changed, 21 insertions(+), 19 deletions(-) --- include/linux/cpufreq.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index c31650df924..17866d7e2b7 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -14,6 +14,7 @@ #ifndef _LINUX_CPUFREQ_H #define _LINUX_CPUFREQ_H +#include #include #include #include @@ -82,7 +83,7 @@ struct cpufreq_policy { unsigned int policy; /* see above */ struct cpufreq_governor *governor; /* see below */ - struct semaphore lock; /* CPU ->setpolicy or ->target may + struct mutex lock; /* CPU ->setpolicy or ->target may only be called once a time */ struct work_struct update; /* if update_policy() needs to be -- cgit v1.2.3 From f7111ceb5266750db2a1d193b98fb6a3d9b5a56a Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 18 Jan 2006 21:57:37 -0800 Subject: [SPARC]: sparc32 needs PROMDEV_{I,O}RSC defines too. Signed-off-by: David S. Miller --- include/asm-sparc/oplib.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/asm-sparc/oplib.h b/include/asm-sparc/oplib.h index 95944556d8b..d0d76b30eb4 100644 --- a/include/asm-sparc/oplib.h +++ b/include/asm-sparc/oplib.h @@ -164,6 +164,7 @@ enum prom_input_device { PROMDEV_IKBD, /* input from keyboard */ PROMDEV_ITTYA, /* input from ttya */ PROMDEV_ITTYB, /* input from ttyb */ + PROMDEV_IRSC, /* input from rsc */ PROMDEV_I_UNK, }; @@ -175,6 +176,7 @@ enum prom_output_device { PROMDEV_OSCREEN, /* to screen */ PROMDEV_OTTYA, /* to ttya */ PROMDEV_OTTYB, /* to ttyb */ + PROMDEV_ORSC, /* to rsc */ PROMDEV_O_UNK, }; -- cgit v1.2.3 From 2d7d5f05111a9d913131a2764d8b20157f8f758d Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 19 Jan 2006 02:42:49 -0800 Subject: [SPARC]: Add support for *at(), ppoll, and pselect syscalls. This also includes by necessity _TIF_RESTORE_SIGMASK support, which actually resulted in a lot of cleanups. The sparc signal handling code is quite a mess and I should clean it up some day. Signed-off-by: David S. Miller --- include/asm-sparc/thread_info.h | 5 +++-- include/asm-sparc/unistd.h | 22 +++++++++++++++++++--- include/asm-sparc64/thread_info.h | 6 +++--- include/asm-sparc64/unistd.h | 23 ++++++++++++++++++++--- 4 files changed, 45 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/asm-sparc/thread_info.h b/include/asm-sparc/thread_info.h index 65f060b040a..91b9f5888c8 100644 --- a/include/asm-sparc/thread_info.h +++ b/include/asm-sparc/thread_info.h @@ -128,9 +128,10 @@ BTFIXUPDEF_CALL(void, free_thread_info, struct thread_info *) * thread information flag bit numbers */ #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ -#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ +/* flag bit 1 is available */ #define TIF_SIGPENDING 2 /* signal pending */ #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ +#define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */ #define TIF_USEDFPU 8 /* FPU was used by this task * this quantum (SMP) */ #define TIF_POLLING_NRFLAG 9 /* true if poll_idle() is polling @@ -139,9 +140,9 @@ BTFIXUPDEF_CALL(void, free_thread_info, struct thread_info *) /* as above, but as bit values */ #define _TIF_SYSCALL_TRACE (1< Date: Thu, 19 Jan 2006 14:08:40 +0000 Subject: [AGPGART] 945GM support for agpgart Here's a very small diff for 945GM support for agpgart. Patch against 2.6.15. From: Alan Hourihane Signed-off-by: Dave Jones --- include/linux/pci_ids.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 5403257ae3e..2726140a673 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2084,6 +2084,8 @@ #define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 #define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 #define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772 +#define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0 +#define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2 #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 #define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 #define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642 -- cgit v1.2.3 From 4f2d7680cb1ac5c5a70f3ba2447d5aa5c0a1643a Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 19 Jan 2006 16:58:37 -0800 Subject: [NETFILTER] x_tables: Make XT_ALIGN align as strictly as necessary. Or else we break on ppc32 and other 32-bit platforms. Based upon a patch from Harald Welte. Signed-off-by: David S. Miller --- include/linux/netfilter/x_tables.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 472f0483480..59ff6c430cf 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h @@ -19,7 +19,7 @@ struct xt_get_revision /* For standard target */ #define XT_RETURN (-NF_REPEAT - 1) -#define XT_ALIGN(s) (((s) + (__alignof__(void *)-1)) & ~(__alignof__(void *)-1)) +#define XT_ALIGN(s) (((s) + (__alignof__(u_int64_t)-1)) & ~(__alignof__(u_int64_t)-1)) /* Standard return verdict, or do jump. */ #define XT_STANDARD_TARGET "" -- cgit v1.2.3 From 4a90c7e86202f46fa9af011bdbcdf36e355d1721 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 13 Jan 2006 16:22:00 -0500 Subject: [ACPI] ACPICA 20060113 Added 2006 copyright. At SuSE's suggestion, enabled all error messages without enabling function tracing, ie with CONFIG_ACPI_DEBUG=n Replaced all instances of the ACPI_DEBUG_PRINT macro invoked at the ACPI_DB_ERROR and ACPI_DB_WARN debug levels with the ACPI_REPORT_ERROR and ACPI_REPORT_WARNING macros, respectively. This preserves all error and warning messages in the non-debug version of the ACPICA code (this has been referred to as the "debug lite" option.) Over 200 cases were converted to create a total of over 380 error/warning messages across the ACPICA code. This increases the code and data size of the default non-debug version by about 13K. Added ACPI_NO_ERROR_MESSAGES flag to enable deleting all messages. The size of the debug version remains about the same. Signed-off-by: Bob Moore Signed-off-by: Len Brown --- include/acpi/acconfig.h | 4 +- include/acpi/acdebug.h | 2 +- include/acpi/acdisasm.h | 2 +- include/acpi/acdispat.h | 2 +- include/acpi/acevents.h | 2 +- include/acpi/acexcep.h | 2 +- include/acpi/acglobal.h | 2 +- include/acpi/achware.h | 2 +- include/acpi/acinterp.h | 2 +- include/acpi/aclocal.h | 2 +- include/acpi/acmacros.h | 83 ++++++++++++++++++++++------------------- include/acpi/acnames.h | 2 +- include/acpi/acnamesp.h | 4 +- include/acpi/acobject.h | 2 +- include/acpi/acopcode.h | 2 +- include/acpi/acoutput.h | 12 ++++-- include/acpi/acparser.h | 2 +- include/acpi/acpi.h | 2 +- include/acpi/acpiosxf.h | 2 +- include/acpi/acpixf.h | 2 +- include/acpi/acresrc.h | 2 +- include/acpi/acstruct.h | 2 +- include/acpi/actables.h | 2 +- include/acpi/actbl.h | 2 +- include/acpi/actbl1.h | 2 +- include/acpi/actbl2.h | 2 +- include/acpi/actypes.h | 2 +- include/acpi/acutils.h | 9 ++--- include/acpi/amlcode.h | 2 +- include/acpi/amlresrc.h | 2 +- include/acpi/platform/acenv.h | 2 +- include/acpi/platform/acgcc.h | 2 +- include/acpi/platform/aclinux.h | 2 +- 33 files changed, 89 insertions(+), 79 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 1f2477eb95f..675a32f7832 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,7 +63,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20051216 +#define ACPI_CA_VERSION 0x20060113 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h index 70ce3b4d006..d8167095caf 100644 --- a/include/acpi/acdebug.h +++ b/include/acpi/acdebug.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h index 0a8f49f5d2f..11a8fe39cb0 100644 --- a/include/acpi/acdisasm.h +++ b/include/acpi/acdisasm.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h index cc6407eef70..c41a926ff31 100644 --- a/include/acpi/acdispat.h +++ b/include/acpi/acdispat.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h index b40062c3ba7..f2717be4fe0 100644 --- a/include/acpi/acevents.h +++ b/include/acpi/acevents.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 4f005eb6592..dc768aa580e 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h index dfb3b2493ae..734cc77bf2c 100644 --- a/include/acpi/acglobal.h +++ b/include/acpi/acglobal.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/achware.h b/include/acpi/achware.h index 3644d7248e7..29b60a8c059 100644 --- a/include/acpi/achware.h +++ b/include/acpi/achware.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h index 87e5e44572c..9f22cfcb624 100644 --- a/include/acpi/acinterp.h +++ b/include/acpi/acinterp.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index da7f1cb96f5..97f8e4185e4 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 0fa8f72dbac..49ba151766d 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -443,56 +443,66 @@ #define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) /* - * Reporting macros that are never compiled out + * Module name is include in both debug and non-debug versions primarily for + * error messages. The __FILE__ macro is not very useful for this, because it + * often includes the entire pathname to the module */ -#define ACPI_PARAM_LIST(pl) pl +#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES) + +#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name; +#else +#define ACPI_MODULE_NAME(name) +#endif /* - * Error reporting. These versions add callers module and line#. - * - * Since _acpi_module_name gets compiled out when ACPI_DEBUG_OUTPUT - * isn't defined, only use it in debug mode. + * Ascii error messages can be configured out */ -#ifdef ACPI_DEBUG_OUTPUT +#ifndef ACPI_NO_ERROR_MESSAGES + +#define ACPI_PARAM_LIST(pl) pl +#define ACPI_LOCATION_INFO _acpi_module_name, __LINE__ -#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info(_acpi_module_name,__LINE__,_COMPONENT); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error(_acpi_module_name,__LINE__,_COMPONENT); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning(_acpi_module_name,__LINE__,_COMPONENT); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error(_acpi_module_name,__LINE__,_COMPONENT, s, e); +/* + * Error reporting. Callers module and line number are inserted automatically + * These macros are used for both the debug and non-debug versions of the code + */ +#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info (ACPI_LOCATION_INFO); \ + acpi_os_printf ACPI_PARAM_LIST (fp);} +#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error (ACPI_LOCATION_INFO); \ + acpi_os_printf ACPI_PARAM_LIST (fp);} +#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning (ACPI_LOCATION_INFO); \ + acpi_os_printf ACPI_PARAM_LIST (fp);} +#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error (ACPI_LOCATION_INFO, \ + s, e); +#define ACPI_REPORT_MTERROR(s,n,p,e) acpi_ns_report_method_error (ACPI_LOCATION_INFO, \ + s, n, p, e); -#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error(_acpi_module_name,__LINE__,_COMPONENT, s, n, p, e); +/* Error reporting. These versions pass thru the module and lineno */ +#define _ACPI_REPORT_INFO(a,b,fp) {acpi_ut_report_info (a,b); \ + acpi_os_printf ACPI_PARAM_LIST (fp);} +#define _ACPI_REPORT_ERROR(a,b,fp) {acpi_ut_report_error (a,b); \ + acpi_os_printf ACPI_PARAM_LIST (fp);} +#define _ACPI_REPORT_WARNING(a,b,fp) {acpi_ut_report_warning (a,b); \ + acpi_os_printf ACPI_PARAM_LIST (fp);} #else -#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info("ACPI",__LINE__,_COMPONENT); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error("ACPI",__LINE__,_COMPONENT); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning("ACPI",__LINE__,_COMPONENT); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error("ACPI",__LINE__,_COMPONENT, s, e); - -#define ACPI_REPORT_METHOD_ERROR(s,n,p,e) acpi_ns_report_method_error("ACPI",__LINE__,_COMPONENT, s, n, p, e); +/* No error messages */ +#define ACPI_REPORT_INFO(fp) +#define ACPI_REPORT_ERROR(fp) +#define ACPI_REPORT_WARNING(fp) +#define ACPI_REPORT_NSERROR(s,e) +#define ACPI_REPORT_MTERROR(s,n,p,e) +#define _ACPI_REPORT_INFO(a,b,c,fp) +#define _ACPI_REPORT_ERROR(a,b,c,fp) +#define _ACPI_REPORT_WARNING(a,b,c,fp) #endif -/* Error reporting. These versions pass thru the module and line# */ - -#define _ACPI_REPORT_INFO(a,b,c,fp) {acpi_ut_report_info(a,b,c); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define _ACPI_REPORT_ERROR(a,b,c,fp) {acpi_ut_report_error(a,b,c); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} -#define _ACPI_REPORT_WARNING(a,b,c,fp) {acpi_ut_report_warning(a,b,c); \ - acpi_os_printf ACPI_PARAM_LIST(fp);} - /* * Debug macros that are conditionally compiled */ #ifdef ACPI_DEBUG_OUTPUT -#define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name; /* * Common parameters used for debug output functions: @@ -649,9 +659,6 @@ * This is the non-debug case -- make everything go away, * leaving no executable debug code! */ -#define ACPI_MODULE_NAME(name) -#define _acpi_module_name "" - #define ACPI_DEBUG_EXEC(a) #define ACPI_NORMAL_EXEC(a) a; diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h index 4f9063f3e95..b67da363689 100644 --- a/include/acpi/acnames.h +++ b/include/acpi/acnames.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h index dd3501f7e5d..b667a804fc8 100644 --- a/include/acpi/acnamesp.h +++ b/include/acpi/acnamesp.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -263,13 +263,11 @@ u32 acpi_ns_local(acpi_object_type type); void acpi_ns_report_error(char *module_name, u32 line_number, - u32 component_id, char *internal_name, acpi_status lookup_status); void acpi_ns_report_method_error(char *module_name, u32 line_number, - u32 component_id, char *message, struct acpi_namespace_node *node, char *path, acpi_status lookup_status); diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index 4a326ba6d48..1bd411962c7 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h index 64da4299219..e6d78bd9e90 100644 --- a/include/acpi/acopcode.h +++ b/include/acpi/acopcode.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h index 68d7edf0f69..7785d481dc3 100644 --- a/include/acpi/acoutput.h +++ b/include/acpi/acoutput.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -137,13 +137,19 @@ /* Exception level -- used in the global "debug_level" */ -#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR) -#define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN) #define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT) #define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT) #define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO) #define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS) +/* + * These two levels are essentially obsolete, all instances in the + * ACPICA core code have been replaced by REPORT_ERROR and REPORT_WARNING + * (Kept here because some drivers may still use them) + */ +#define ACPI_DB_ERROR ACPI_DEBUG_LEVEL (ACPI_LV_ERROR) +#define ACPI_DB_WARN ACPI_DEBUG_LEVEL (ACPI_LV_WARN) + /* Trace level -- also used in the global "debug_level" */ #define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES) diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h index d352d40de1f..5a1ff484af3 100644 --- a/include/acpi/acparser.h +++ b/include/acpi/acparser.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h index ccf34f9dac6..b9a39d1009b 100644 --- a/include/acpi/acpi.h +++ b/include/acpi/acpi.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 58473f60755..768f63f391c 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -8,7 +8,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 2a88429bc4e..66cf2ecef57 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h index ba281f7740a..fa02e808338 100644 --- a/include/acpi/acresrc.h +++ b/include/acpi/acresrc.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h index 99d23533980..d8c1c2cdac0 100644 --- a/include/acpi/acstruct.h +++ b/include/acpi/acstruct.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/actables.h b/include/acpi/actables.h index f92c1858b80..30a47542e1c 100644 --- a/include/acpi/actables.h +++ b/include/acpi/actables.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index ef2ddcadfe6..ed53f842dad 100644 --- a/include/acpi/actbl.h +++ b/include/acpi/actbl.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 67312c3a915..cd428d57add 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 50305ce2681..dfc7ac1094b 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 18e1338c5c7..74819e9b469 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 5fa21e03a62..10f6625f639 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -275,12 +275,11 @@ acpi_ut_ptr_exit(u32 line_number, const char *function_name, char *module_name, u32 component_id, u8 * ptr); -void acpi_ut_report_info(char *module_name, u32 line_number, u32 component_id); +void acpi_ut_report_error(char *module_name, u32 line_number); -void acpi_ut_report_error(char *module_name, u32 line_number, u32 component_id); +void acpi_ut_report_info(char *module_name, u32 line_number); -void -acpi_ut_report_warning(char *module_name, u32 line_number, u32 component_id); +void acpi_ut_report_warning(char *module_name, u32 line_number); void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h index 7fdf5299f50..37964a59aef 100644 --- a/include/acpi/amlcode.h +++ b/include/acpi/amlcode.h @@ -7,7 +7,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h index 2e3382c1e5e..fb4735315ad 100644 --- a/include/acpi/amlresrc.h +++ b/include/acpi/amlresrc.h @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 53aa997f05f..31b0f18342f 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 4c0e0ba09ba..ea2a6322f64 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 1b9cbf05b79..c21c27fe7e1 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2005, R. Byron Moore + * Copyright (C) 2000 - 2006, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without -- cgit v1.2.3 From 6fbfc9688448aac064edbaccb5d30ecd565a9105 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Fri, 20 Jan 2006 11:57:07 -0800 Subject: [NETFILTER]: Unbreak x-tables on x86. x86 defines __alignof__(long long) as 8 yet it gives 4 for a struct containing a long long, ho hum... so my simplified form doesn't work everywhere. So use Harald Welte's original patch, which should work on all platforms. Signed-off-by: David S. Miller --- include/linux/netfilter/x_tables.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 59ff6c430cf..6500d4e59d4 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h @@ -19,7 +19,21 @@ struct xt_get_revision /* For standard target */ #define XT_RETURN (-NF_REPEAT - 1) -#define XT_ALIGN(s) (((s) + (__alignof__(u_int64_t)-1)) & ~(__alignof__(u_int64_t)-1)) +/* this is a dummy structure to find out the alignment requirement for a struct + * containing all the fundamental data types that are used in ipt_entry, + * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my + * personal pleasure to remove it -HW + */ +struct _xt_align +{ + u_int8_t u8; + u_int16_t u16; + u_int32_t u32; + u_int64_t u64; +}; + +#define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) \ + & ~(__alignof__(struct _xt_align)-1)) /* Standard return verdict, or do jump. */ #define XT_STANDARD_TARGET "" -- cgit v1.2.3 From ca740803856f23dbc5b1872039291231bc131ecb Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 21 Jan 2006 20:06:14 +0000 Subject: [SERIAL] Remove UPF_AUTOPROBE and UPF_BOOT_ONLYMCA The functionality UPF_BOOT_ONLYMCA provided has been replaced by the 8250_mca module, which only registers MCA ports if MCA is present. UPF_AUTOPROBE has no functional effect - in fact, it's never tested. Only ibmasm set the flag. Signed-off-by: Russell King --- include/linux/serial_core.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index ec351005bf9..f3af47713a4 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -245,9 +245,7 @@ struct uart_port { #define UPF_HARDPPS_CD (1 << 11) #define UPF_LOW_LATENCY (1 << 13) #define UPF_BUGGY_UART (1 << 14) -#define UPF_AUTOPROBE (1 << 15) #define UPF_MAGIC_MULTIPLIER (1 << 16) -#define UPF_BOOT_ONLYMCA (1 << 22) #define UPF_CONS_FLOW (1 << 23) #define UPF_SHARE_IRQ (1 << 24) #define UPF_BOOT_AUTOCONF (1 << 28) -- cgit v1.2.3 From ba899dbc036d24ab6b45faf64e3648a268721cc9 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 21 Jan 2006 22:45:50 +0000 Subject: [SERIAL] Make port->ops constant No one should write to the port->ops structure, so make it constant. Signed-off-by: Russell King --- include/linux/serial_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index f3af47713a4..b74ff34469b 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -257,7 +257,7 @@ struct uart_port { unsigned int mctrl; /* current modem ctrl settings */ unsigned int timeout; /* character-based timeout */ unsigned int type; /* port type */ - struct uart_ops *ops; + const struct uart_ops *ops; unsigned int custom_divisor; unsigned int line; /* port index */ unsigned long mapbase; /* for ioremap */ -- cgit v1.2.3 From 747c8a55946ed037bf7d62454c3c599c02af2262 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 21 Jan 2006 22:50:36 +0000 Subject: [SERIAL] Make uart_info flags a bitwise type The potential for confusing the flags is fairly high. Make uart_info's flags a bitwise type so sparse can check that the right flag definitions are used with the right structure. Signed-off-by: Russell King --- include/linux/serial_core.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index b74ff34469b..90f681789a6 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -287,6 +287,9 @@ struct uart_state { }; #define UART_XMIT_SIZE PAGE_SIZE + +typedef unsigned int __bitwise__ uif_t; + /* * This is the state information which is only valid when the port * is open; it may be freed by the core driver once the device has @@ -296,17 +299,16 @@ struct uart_state { struct uart_info { struct tty_struct *tty; struct circ_buf xmit; - unsigned int flags; + uif_t flags; /* - * These are the flags that specific to info->flags, and reflect our - * internal state. They can not be accessed via port->flags. Low - * level drivers must not change these, but may query them instead. + * Definitions for info->flags. These are _private_ to serial_core, and + * are specific to this structure. They may be queried by low level drivers. */ -#define UIF_CHECK_CD (1 << 25) -#define UIF_CTS_FLOW (1 << 26) -#define UIF_NORMAL_ACTIVE (1 << 29) -#define UIF_INITIALIZED (1 << 31) +#define UIF_CHECK_CD ((__force uif_t) (1 << 25)) +#define UIF_CTS_FLOW ((__force uif_t) (1 << 26)) +#define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29)) +#define UIF_INITIALIZED ((__force uif_t) (1 << 31)) int blocked_open; -- cgit v1.2.3 From 27ae7a7435634820e7f7e2b922d8119f79cfc6e4 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 21 Jan 2006 22:54:06 +0000 Subject: [SERIAL] Fix UPF_ flag usage with uart_info->flags The previous change found a bug in the serial SAK handling - because we were looking for UPF_SAK set in uart_info->flags, we would never raise a SAK condition. UPF_SAK is in uart_port->flags. Signed-off-by: Russell King --- include/linux/serial_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 90f681789a6..1a8cd0169c9 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -430,7 +430,7 @@ static inline int uart_handle_break(struct uart_port *port) port->sysrq = 0; } #endif - if (info->flags & UPF_SAK) + if (port->flags & UPF_SAK) do_SAK(info->tty); return 0; } -- cgit v1.2.3 From 0077d45e46fe2af3aaee5813c99268afcd0e7c0e Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 21 Jan 2006 23:03:28 +0000 Subject: [SERIAL] Make uart_port flags a bitwise type Same reasoning as commit 747c8a55946ed037bf7d62454c3c599c02af2262 but this time we're making uart_port flags a bitwise type - not all of these flags correspond with the old ASYNC_ flags, so there is the possibility for bugs if the wrong ASYNC_* constants are used. Always use UPF_* constants for uart_port->flags. Signed-off-by: Russell King --- include/linux/serial_8250.h | 2 +- include/linux/serial_core.h | 48 +++++++++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 24 deletions(-) (limited to 'include') diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index cee302aefdb..73b464f0926 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h @@ -26,7 +26,7 @@ struct plat_serial8250_port { unsigned char regshift; /* register shift */ unsigned char iotype; /* UPIO_* */ unsigned char hub6; - unsigned int flags; /* UPF_* flags */ + upf_t flags; /* UPF_* flags */ }; /* diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 1a8cd0169c9..4041122dabf 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -203,6 +203,8 @@ struct uart_icount { __u32 buf_overrun; }; +typedef unsigned int __bitwise__ upf_t; + struct uart_port { spinlock_t lock; /* port lock */ unsigned int iobase; /* in/out[bwl] */ @@ -230,29 +232,29 @@ struct uart_port { unsigned long sysrq; /* sysrq timeout */ #endif - unsigned int flags; - -#define UPF_FOURPORT (1 << 1) -#define UPF_SAK (1 << 2) -#define UPF_SPD_MASK (0x1030) -#define UPF_SPD_HI (0x0010) -#define UPF_SPD_VHI (0x0020) -#define UPF_SPD_CUST (0x0030) -#define UPF_SPD_SHI (0x1000) -#define UPF_SPD_WARP (0x1010) -#define UPF_SKIP_TEST (1 << 6) -#define UPF_AUTO_IRQ (1 << 7) -#define UPF_HARDPPS_CD (1 << 11) -#define UPF_LOW_LATENCY (1 << 13) -#define UPF_BUGGY_UART (1 << 14) -#define UPF_MAGIC_MULTIPLIER (1 << 16) -#define UPF_CONS_FLOW (1 << 23) -#define UPF_SHARE_IRQ (1 << 24) -#define UPF_BOOT_AUTOCONF (1 << 28) -#define UPF_IOREMAP (1 << 31) - -#define UPF_CHANGE_MASK (0x17fff) -#define UPF_USR_MASK (UPF_SPD_MASK|UPF_LOW_LATENCY) + upf_t flags; + +#define UPF_FOURPORT ((__force upf_t) (1 << 1)) +#define UPF_SAK ((__force upf_t) (1 << 2)) +#define UPF_SPD_MASK ((__force upf_t) (0x1030)) +#define UPF_SPD_HI ((__force upf_t) (0x0010)) +#define UPF_SPD_VHI ((__force upf_t) (0x0020)) +#define UPF_SPD_CUST ((__force upf_t) (0x0030)) +#define UPF_SPD_SHI ((__force upf_t) (0x1000)) +#define UPF_SPD_WARP ((__force upf_t) (0x1010)) +#define UPF_SKIP_TEST ((__force upf_t) (1 << 6)) +#define UPF_AUTO_IRQ ((__force upf_t) (1 << 7)) +#define UPF_HARDPPS_CD ((__force upf_t) (1 << 11)) +#define UPF_LOW_LATENCY ((__force upf_t) (1 << 13)) +#define UPF_BUGGY_UART ((__force upf_t) (1 << 14)) +#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) +#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) +#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) +#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) +#define UPF_IOREMAP ((__force upf_t) (1 << 31)) + +#define UPF_CHANGE_MASK ((__force upf_t) (0x17fff)) +#define UPF_USR_MASK ((__force upf_t) (UPF_SPD_MASK|UPF_LOW_LATENCY)) unsigned int mctrl; /* current modem ctrl settings */ unsigned int timeout; /* character-based timeout */ -- cgit v1.2.3 From cb6fc18e9ca615f03d18e60c49855b434ca2e51e Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Tue, 17 Jan 2006 12:40:40 -0700 Subject: [PARISC] Use kzalloc and other janitor-style cleanups Helge, o Convert a bunch of kmalloc/memset uses to kzalloc. o pci.c: Add some __read_mostly annotations. o pci.c: Move constant pci_post_reset_delay to asm/pci.h o grfioctl.h: Add A4450A to comment of CRT_ID_VISUALIZE_EG. o Add some consts to perf.c/perf_images.h Matthew, o sticore.c: Add some consts to suppress compile warnings. Signed-off-by: Helge Deller Signed-off-by: Matthew Wilcox Signed-off-by: Kyle McMartin --- include/asm-parisc/grfioctl.h | 2 +- include/asm-parisc/pci.h | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-parisc/grfioctl.h b/include/asm-parisc/grfioctl.h index 6a910311b56..671e06042b4 100644 --- a/include/asm-parisc/grfioctl.h +++ b/include/asm-parisc/grfioctl.h @@ -58,7 +58,7 @@ #define CRT_ID_ELK_1024DB 0x27849CA5 /* Elk 1024x768 double buffer */ #define CRT_ID_ELK_GS S9000_ID_A1924A /* Elk 1280x1024 GreyScale */ #define CRT_ID_CRX24 S9000_ID_A1439A /* Piranha */ -#define CRT_ID_VISUALIZE_EG 0x2D08C0A7 /* Graffiti (built-in B132+/B160L) */ +#define CRT_ID_VISUALIZE_EG 0x2D08C0A7 /* Graffiti, A4450A (built-in B132+/B160L) */ #define CRT_ID_THUNDER 0x2F23E5FC /* Thunder 1 VISUALIZE 48*/ #define CRT_ID_THUNDER2 0x2F8D570E /* Thunder 2 VISUALIZE 48 XP*/ #define CRT_ID_HCRX S9000_ID_HCRX /* Hyperdrive HCRX */ diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index f277254159b..4c5e15ea3a0 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h @@ -18,6 +18,18 @@ */ #define PCI_MAX_BUSSES 256 + +/* To be used as: mdelay(pci_post_reset_delay); + * + * post_reset is the time the kernel should stall to prevent anyone from + * accessing the PCI bus once #RESET is de-asserted. + * PCI spec somewhere says 1 second but with multi-PCI bus systems, + * this makes the boot time much longer than necessary. + * 20ms seems to work for all the HP PCI implementations to date. + */ +#define pci_post_reset_delay 50 + + /* ** pci_hba_data (aka H2P_OBJECT in HP/UX) ** @@ -83,7 +95,7 @@ static __inline__ int pci_is_lmmio(struct pci_hba_data *hba, unsigned long a) /* ** Convert between PCI (IO_VIEW) addresses and processor (PA_VIEW) addresses. -** See pcibios.c for more conversions used by Generic PCI code. +** See pci.c for more conversions used by Generic PCI code. ** ** Platform characteristics/firmware guarantee that ** (1) PA_VIEW - IO_VIEW = lmmio_offset for both LMMIO and ELMMIO @@ -191,7 +203,6 @@ struct pci_bios_ops { */ extern struct pci_port_ops *pci_port; extern struct pci_bios_ops *pci_bios; -extern int pci_post_reset_delay; /* delay after de-asserting #RESET */ extern int pci_hba_count; extern struct pci_hba_data *parisc_pci_hba[]; -- cgit v1.2.3 From 2c9aadabf454fb07b8f7533096e22bf005dd08df Mon Sep 17 00:00:00 2001 From: Grant Grundler Date: Thu, 19 Jan 2006 23:38:03 -0700 Subject: [PARISC] Remove unnecessary extern declarations from asm/pci.h Remove two unnecessary extern declarations from asm/pci.h. They collide with what gcc4.0 assumed was static (and should be static). Found by Joel Soete. Signed-off-by: Grant Grundler Signed-off-by: Kyle McMartin --- include/asm-parisc/pci.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index 4c5e15ea3a0..fe7f6a2f5aa 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h @@ -203,8 +203,6 @@ struct pci_bios_ops { */ extern struct pci_port_ops *pci_port; extern struct pci_bios_ops *pci_bios; -extern int pci_hba_count; -extern struct pci_hba_data *parisc_pci_hba[]; #ifdef CONFIG_PCI extern void pcibios_register_hba(struct pci_hba_data *); -- cgit v1.2.3 From c475eea2929a7f0dac21d20e10562a491fcf7c45 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sun, 15 Jan 2006 12:11:50 -0700 Subject: [PARISC] Drop unused do_check_pgt_cache() Drop the unused do_check_pgt_cache routine from mm/init.c and its prototype in asm/pgalloc.h Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- include/asm-parisc/pgalloc.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h index 6291d6692e5..3122fad38a1 100644 --- a/include/asm-parisc/pgalloc.h +++ b/include/asm-parisc/pgalloc.h @@ -137,7 +137,6 @@ static inline void pte_free_kernel(pte_t *pte) #define pte_free(page) pte_free_kernel(page_address(page)) -extern int do_check_pgt_cache(int, int); #define check_pgt_cache() do { } while (0) #endif -- cgit v1.2.3 From 2e13b31e5b0ff0b1f1e3359ebf8ca46c356e9391 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Tue, 17 Jan 2006 08:33:01 -0700 Subject: [PARISC] atomic64 support Implement atomic64_t so atomic_long_t works on parisc. Also clean up some of the coding style in atomic.h, and make sure ATOMIC_INIT is cast properly. Signed-off-by: Kyle McMartin --- include/asm-parisc/atomic.h | 84 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 69 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/asm-parisc/atomic.h b/include/asm-parisc/atomic.h index 2ca56d34aaa..4dc7253ff5d 100644 --- a/include/asm-parisc/atomic.h +++ b/include/asm-parisc/atomic.h @@ -1,9 +1,13 @@ +/* Copyright (C) 2000 Philipp Rumpf + * Copyright (C) 2006 Kyle McMartin + */ + #ifndef _ASM_PARISC_ATOMIC_H_ #define _ASM_PARISC_ATOMIC_H_ #include +#include #include -/* Copyright (C) 2000 Philipp Rumpf . */ /* * Atomic operations that C can't guarantee us. Useful for @@ -46,15 +50,6 @@ extern raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned; # define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0) #endif -/* Note that we need not lock read accesses - aligned word writes/reads - * are atomic, so a reader never sees unconsistent values. - * - * Cache-line alignment would conflict with, for example, linux/module.h - */ - -typedef struct { volatile int counter; } atomic_t; - - /* This should get optimized out since it's never called. ** Or get a link error if xchg is used "wrong". */ @@ -69,10 +64,9 @@ extern unsigned long __xchg64(unsigned long, unsigned long *); #endif /* optimizer better get rid of switch since size is a constant */ -static __inline__ unsigned long __xchg(unsigned long x, __volatile__ void * ptr, - int size) +static __inline__ unsigned long +__xchg(unsigned long x, __volatile__ void * ptr, int size) { - switch(size) { #ifdef __LP64__ case 8: return __xchg64(x,(unsigned long *) ptr); @@ -129,7 +123,13 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) (unsigned long)_n_, sizeof(*(ptr))); \ }) +/* Note that we need not lock read accesses - aligned word writes/reads + * are atomic, so a reader never sees unconsistent values. + * + * Cache-line alignment would conflict with, for example, linux/module.h + */ +typedef struct { volatile int counter; } atomic_t; /* It's possible to reduce all atomic operations to either * __atomic_add_return, atomic_set and atomic_read (the latter @@ -210,12 +210,66 @@ static __inline__ int atomic_read(const atomic_t *v) #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) -#define ATOMIC_INIT(i) { (i) } +#define ATOMIC_INIT(i) ((atomic_t) { (i) }) #define smp_mb__before_atomic_dec() smp_mb() #define smp_mb__after_atomic_dec() smp_mb() #define smp_mb__before_atomic_inc() smp_mb() #define smp_mb__after_atomic_inc() smp_mb() +#ifdef __LP64__ + +typedef struct { volatile s64 counter; } atomic64_t; + +#define ATOMIC64_INIT(i) ((atomic64_t) { (i) }) + +static __inline__ int +__atomic64_add_return(s64 i, atomic64_t *v) +{ + int ret; + unsigned long flags; + _atomic_spin_lock_irqsave(v, flags); + + ret = (v->counter += i); + + _atomic_spin_unlock_irqrestore(v, flags); + return ret; +} + +static __inline__ void +atomic64_set(atomic64_t *v, s64 i) +{ + unsigned long flags; + _atomic_spin_lock_irqsave(v, flags); + + v->counter = i; + + _atomic_spin_unlock_irqrestore(v, flags); +} + +static __inline__ s64 +atomic64_read(const atomic64_t *v) +{ + return v->counter; +} + +#define atomic64_add(i,v) ((void)(__atomic64_add_return( ((s64)i),(v)))) +#define atomic64_sub(i,v) ((void)(__atomic64_add_return(-((s64)i),(v)))) +#define atomic64_inc(v) ((void)(__atomic64_add_return( 1,(v)))) +#define atomic64_dec(v) ((void)(__atomic64_add_return( -1,(v)))) + +#define atomic64_add_return(i,v) (__atomic64_add_return( ((s64)i),(v))) +#define atomic64_sub_return(i,v) (__atomic64_add_return(-((s64)i),(v))) +#define atomic64_inc_return(v) (__atomic64_add_return( 1,(v))) +#define atomic64_dec_return(v) (__atomic64_add_return( -1,(v))) + +#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0) + +#define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0) +#define atomic64_dec_and_test(v) (atomic64_dec_return(v) == 0) + +#endif /* __LP64__ */ + #include -#endif + +#endif /* _ASM_PARISC_ATOMIC_H_ */ -- cgit v1.2.3 From 1bcdd8548286743e1d6b3d53c96a90c6da975620 Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Fri, 13 Jan 2006 13:21:06 -0700 Subject: [PARISC] Add CONFIG_DEBUG_RODATA to protect read-only data Add the parisc version of the "mark rodata section read only" patches. Based on code from and Signed-off-by Arjan van de Ven , Ingo Molnar , Andi Kleen , Andrew Morton , Linus Torvalds . Signed-off-by: Helge Deller Signed-off-by: Kyle McMartin --- include/asm-parisc/cacheflush.h | 6 ++++++ include/asm-parisc/pgtable.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h index 1bc3c83ee74..c53af9ff41b 100644 --- a/include/asm-parisc/cacheflush.h +++ b/include/asm-parisc/cacheflush.h @@ -183,4 +183,10 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long __flush_cache_page(vma, vmaddr); } + +#ifdef CONFIG_DEBUG_RODATA +void mark_rodata_ro(void); #endif + +#endif /* _PARISC_CACHEFLUSH_H */ + diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h index b4554711c3e..4e34c6b4405 100644 --- a/include/asm-parisc/pgtable.h +++ b/include/asm-parisc/pgtable.h @@ -213,7 +213,7 @@ extern void *vmalloc_start; #define PAGE_COPY PAGE_EXECREAD #define PAGE_RWX __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_READ | _PAGE_WRITE | _PAGE_EXEC |_PAGE_ACCESSED) #define PAGE_KERNEL __pgprot(_PAGE_KERNEL) -#define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_EXEC | _PAGE_READ | _PAGE_DIRTY | _PAGE_ACCESSED) +#define PAGE_KERNEL_RO __pgprot(_PAGE_KERNEL & ~_PAGE_WRITE) #define PAGE_KERNEL_UNC __pgprot(_PAGE_KERNEL | _PAGE_NO_CACHE) #define PAGE_GATEWAY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_GATEWAY| _PAGE_READ) #define PAGE_FLUSH __pgprot(_PAGE_FLUSH) -- cgit v1.2.3 From f671c45df23005692daa200aba768c642fb14ef2 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Sun, 15 Jan 2006 14:10:29 -0500 Subject: [PARISC] Arch-specific compat signals Add enough arch-specific compat signals code to enable parisc64 to compile and boot out of the mainline tree. There are likely still many dragons here, but this is a start to squashing the last big difference between the mainline tree and the parisc-linux tree. The remaining bugs can be squashed as they come up. Signed-off-by: Kyle McMartin --- include/asm-parisc/compat_ucontext.h | 3 +-- include/asm-parisc/rt_sigframe.h | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'include') diff --git a/include/asm-parisc/compat_ucontext.h b/include/asm-parisc/compat_ucontext.h index a1228a3d207..2f7292afde3 100644 --- a/include/asm-parisc/compat_ucontext.h +++ b/include/asm-parisc/compat_ucontext.h @@ -1,8 +1,7 @@ #ifndef _ASM_PARISC_COMPAT_UCONTEXT_H #define _ASM_PARISC_COMPAT_UCONTEXT_H -#include -#include +#include /* 32-bit ucontext as seen from an 64-bit kernel */ struct compat_ucontext { diff --git a/include/asm-parisc/rt_sigframe.h b/include/asm-parisc/rt_sigframe.h index 5623c032b64..f0dd3b30f6c 100644 --- a/include/asm-parisc/rt_sigframe.h +++ b/include/asm-parisc/rt_sigframe.h @@ -1,10 +1,6 @@ #ifndef _ASM_PARISC_RT_SIGFRAME_H #define _ASM_PARISC_RT_SIGFRAME_H -#ifdef CONFIG_COMPAT -#include -#endif - #define SIGRETURN_TRAMP 4 #define SIGRESTARTBLOCK_TRAMP 5 #define TRAMP_SIZE (SIGRETURN_TRAMP + SIGRESTARTBLOCK_TRAMP) -- cgit v1.2.3 From d3ed309a718bc6f79dc485a6d18731990daeee5e Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 23 Jan 2006 21:03:56 -0800 Subject: [SPARC64]: Implement __raw_read_trylock() generic__raw_read_trylock() just does a raw_read_lock() so that isn't very useful. Signed-off-by: David S. Miller --- include/asm-sparc64/spinlock.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h index ec85d12d73b..508c416e9d6 100644 --- a/include/asm-sparc64/spinlock.h +++ b/include/asm-sparc64/spinlock.h @@ -131,6 +131,28 @@ static void inline __read_lock(raw_rwlock_t *lock) : "memory"); } +static int inline __read_trylock(raw_rwlock_t *lock) +{ + int tmp1, tmp2; + + __asm__ __volatile__ ( +"1: ldsw [%2], %0\n" +" brlz,a,pn %0, 2f\n" +" mov 0, %0\n" +" add %0, 1, %1\n" +" cas [%2], %0, %1\n" +" cmp %0, %1\n" +" membar #StoreLoad | #StoreStore\n" +" bne,pn %%icc, 1b\n" +" mov 1, %0\n" +"2:" + : "=&r" (tmp1), "=&r" (tmp2) + : "r" (lock) + : "memory"); + + return tmp1; +} + static void inline __read_unlock(raw_rwlock_t *lock) { unsigned long tmp1, tmp2; @@ -211,12 +233,12 @@ static int inline __write_trylock(raw_rwlock_t *lock) } #define __raw_read_lock(p) __read_lock(p) +#define __raw_read_trylock(p) __read_trylock(p) #define __raw_read_unlock(p) __read_unlock(p) #define __raw_write_lock(p) __write_lock(p) #define __raw_write_unlock(p) __write_unlock(p) #define __raw_write_trylock(p) __write_trylock(p) -#define __raw_read_trylock(lock) generic__raw_read_trylock(lock) #define __raw_read_can_lock(rw) (!((rw)->lock & 0x80000000UL)) #define __raw_write_can_lock(rw) (!(rw)->lock) -- cgit v1.2.3 From 2cb2e147a6d20bffd1d6b7a79be7301560f751c3 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 17 Jan 2006 09:04:32 +0100 Subject: [BLOCK] ll_rw_blk: make max_sectors and max_hw_sectors unsigned ints IDE lba48 can support full 64k request size, which overflows the max_hw_sectors variable. Signed-off-by: Jens Axboe --- include/linux/blkdev.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 02a585faa62..860e7a485a5 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -392,8 +392,8 @@ struct request_queue unsigned int nr_congestion_off; unsigned int nr_batching; - unsigned short max_sectors; - unsigned short max_hw_sectors; + unsigned int max_sectors; + unsigned int max_hw_sectors; unsigned short max_phys_segments; unsigned short max_hw_segments; unsigned short hardsect_size; @@ -697,7 +697,7 @@ extern request_queue_t *blk_init_queue(request_fn_proc *, spinlock_t *); extern void blk_cleanup_queue(request_queue_t *); extern void blk_queue_make_request(request_queue_t *, make_request_fn *); extern void blk_queue_bounce_limit(request_queue_t *, u64); -extern void blk_queue_max_sectors(request_queue_t *, unsigned short); +extern void blk_queue_max_sectors(request_queue_t *, unsigned int); extern void blk_queue_max_phys_segments(request_queue_t *, unsigned short); extern void blk_queue_max_hw_segments(request_queue_t *, unsigned short); extern void blk_queue_max_segment_size(request_queue_t *, unsigned int); -- cgit v1.2.3 From fd8b206d1621ad526e7b00dc26322f546b2a57fb Mon Sep 17 00:00:00 2001 From: Dean Roe Date: Tue, 24 Jan 2006 14:49:43 -0800 Subject: [IA64-SGI] add sn_feature_sets bit SGI's prom has added a new feature which avoids an Altix-specific MCA that can occur with excessive use of ia64_pal_cache_flush. This patch adds the #define to the sn_feature_sets.h to reflect that bit is taken. Signed-off-by: Dean Roe Signed-off-by: Tony Luck --- include/asm-ia64/sn/sn_feature_sets.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/asm-ia64/sn/sn_feature_sets.h b/include/asm-ia64/sn/sn_feature_sets.h index e68a80853d5..f63f144e817 100644 --- a/include/asm-ia64/sn/sn_feature_sets.h +++ b/include/asm-ia64/sn/sn_feature_sets.h @@ -8,7 +8,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (c) 2005 Silicon Graphics, Inc. All rights reserved. + * Copyright (c) 2005-2006 Silicon Graphics, Inc. All rights reserved. */ @@ -27,14 +27,11 @@ extern int sn_prom_feature_available(int id); * "false" for new features. * * Use: - * if (sn_prom_feature_available(PRF_FEATURE_XXX)) + * if (sn_prom_feature_available(PRF_XXX)) * ... */ -/* - * Example: feature XXX - */ -#define PRF_FEATURE_XXX 0 +#define PRF_PAL_CACHE_FLUSH_SAFE 0 -- cgit v1.2.3 From dfcd77d16b5745fbfea7d5636f15fc80cc05fef8 Mon Sep 17 00:00:00 2001 From: Tetsuo Takata Date: Wed, 25 Jan 2006 11:12:40 +0100 Subject: [SCSI] Remove host template ordered_flush variable After the recent overhaul of the block layer the variable "ordered_flush" is no longer used. Signed-off-by: Tetsuo Takata Signed-off-by: Jens Axboe --- include/scsi/scsi_host.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 467274a764d..827992949c4 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -554,7 +554,6 @@ struct Scsi_Host { /* * ordered write support */ - unsigned ordered_flush:1; unsigned ordered_tag:1; /* -- cgit v1.2.3 From 0367a8d37af6028b64127ac70922717575b81113 Mon Sep 17 00:00:00 2001 From: Lucas Correia Villa Real Date: Thu, 26 Jan 2006 15:20:50 +0000 Subject: [ARM] 3266/1: S3C2400 - adds macro S3C24XX Patch from Lucas Correia Villa Real This patch defines S3C2400 memory map and adds a S3C24XX macro for common resources between S3C2400, S3C2410 and S3C2440 cpus. Signed-off-by: Lucas Correia Villa Real Signed-off-by: Ben Dooks Signed-off-by: Russell King --- include/asm-arm/arch-s3c2410/debug-macro.S | 6 ++--- include/asm-arm/arch-s3c2410/map.h | 38 ++++++++++++++++++++++++++++++ include/asm-arm/arch-s3c2410/regs-serial.h | 6 ++--- include/asm-arm/arch-s3c2410/uncompress.h | 6 ++--- 4 files changed, 47 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/asm-arm/arch-s3c2410/debug-macro.S b/include/asm-arm/arch-s3c2410/debug-macro.S index abfbe45cd17..5f8223e700d 100644 --- a/include/asm-arm/arch-s3c2410/debug-macro.S +++ b/include/asm-arm/arch-s3c2410/debug-macro.S @@ -25,7 +25,7 @@ .macro addruart, rx mrc p15, 0, \rx, c1, c0 tst \rx, #1 - ldreq \rx, = S3C2410_PA_UART + ldreq \rx, = S3C24XX_PA_UART ldrne \rx, = S3C24XX_VA_UART #if CONFIG_DEBUG_S3C2410_UART != 0 add \rx, \rx, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C2410_UART) @@ -44,7 +44,7 @@ 1003: mrc p15, 0, \rd, c1, c0 tst \rd, #1 - addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) + addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) bic \rd, \rd, #0xff000 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] @@ -75,7 +75,7 @@ 1003: mrc p15, 0, \rd, c1, c0 tst \rd, #1 - addeq \rd, \rx, #(S3C2410_PA_GPIO - S3C2410_PA_UART) + addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) bic \rd, \rd, #0xff000 ldr \rd, [ \rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0) ] diff --git a/include/asm-arm/arch-s3c2410/map.h b/include/asm-arm/arch-s3c2410/map.h index 1833ea5c422..c380d264a84 100644 --- a/include/asm-arm/arch-s3c2410/map.h +++ b/include/asm-arm/arch-s3c2410/map.h @@ -14,6 +14,7 @@ * 06-Jan-2003 BJD Linux 2.6.0 version, moved bast specifics out * 10-Feb-2005 BJD Added CAMIF definition from guillaume.gourat@nexvision.tv * 10-Mar-2005 LCVR Added support to S3C2400, changed {VA,SZ} names + * 15-Jan-2006 LCVR Added S3C24XX_PA macros for common S3C24XX resources */ #ifndef __ASM_ARCH_MAP_H @@ -188,5 +189,42 @@ #define S3C2400_SDRAM_PA (S3C2400_CS6) +/* Use a single interface for common resources between S3C24XX cpus */ + +#ifdef CONFIG_CPU_S3C2400 +#define S3C24XX_PA_IRQ S3C2400_PA_IRQ +#define S3C24XX_PA_MEMCTRL S3C2400_PA_MEMCTRL +#define S3C24XX_PA_USBHOST S3C2400_PA_USBHOST +#define S3C24XX_PA_DMA S3C2400_PA_DMA +#define S3C24XX_PA_CLKPWR S3C2400_PA_CLKPWR +#define S3C24XX_PA_LCD S3C2400_PA_LCD +#define S3C24XX_PA_UART S3C2400_PA_UART +#define S3C24XX_PA_TIMER S3C2400_PA_TIMER +#define S3C24XX_PA_USBDEV S3C2400_PA_USBDEV +#define S3C24XX_PA_WATCHDOG S3C2400_PA_WATCHDOG +#define S3C24XX_PA_IIC S3C2400_PA_IIC +#define S3C24XX_PA_IIS S3C2400_PA_IIS +#define S3C24XX_PA_GPIO S3C2400_PA_GPIO +#define S3C24XX_PA_RTC S3C2400_PA_RTC +#define S3C24XX_PA_ADC S3C2400_PA_ADC +#define S3C24XX_PA_SPI S3C2400_PA_SPI +#else +#define S3C24XX_PA_IRQ S3C2410_PA_IRQ +#define S3C24XX_PA_MEMCTRL S3C2410_PA_MEMCTRL +#define S3C24XX_PA_USBHOST S3C2410_PA_USBHOST +#define S3C24XX_PA_DMA S3C2410_PA_DMA +#define S3C24XX_PA_CLKPWR S3C2410_PA_CLKPWR +#define S3C24XX_PA_LCD S3C2410_PA_LCD +#define S3C24XX_PA_UART S3C2410_PA_UART +#define S3C24XX_PA_TIMER S3C2410_PA_TIMER +#define S3C24XX_PA_USBDEV S3C2410_PA_USBDEV +#define S3C24XX_PA_WATCHDOG S3C2410_PA_WATCHDOG +#define S3C24XX_PA_IIC S3C2410_PA_IIC +#define S3C24XX_PA_IIS S3C2410_PA_IIS +#define S3C24XX_PA_GPIO S3C2410_PA_GPIO +#define S3C24XX_PA_RTC S3C2410_PA_RTC +#define S3C24XX_PA_ADC S3C2410_PA_ADC +#define S3C24XX_PA_SPI S3C2410_PA_SPI +#endif #endif /* __ASM_ARCH_MAP_H */ diff --git a/include/asm-arm/arch-s3c2410/regs-serial.h b/include/asm-arm/arch-s3c2410/regs-serial.h index ce1bbbaad6d..83b01254c4a 100644 --- a/include/asm-arm/arch-s3c2410/regs-serial.h +++ b/include/asm-arm/arch-s3c2410/regs-serial.h @@ -39,9 +39,9 @@ #define S3C24XX_VA_UART1 (S3C24XX_VA_UART + 0x4000 ) #define S3C24XX_VA_UART2 (S3C24XX_VA_UART + 0x8000 ) -#define S3C2410_PA_UART0 (S3C2410_PA_UART) -#define S3C2410_PA_UART1 (S3C2410_PA_UART + 0x4000 ) -#define S3C2410_PA_UART2 (S3C2410_PA_UART + 0x8000 ) +#define S3C2410_PA_UART0 (S3C24XX_PA_UART) +#define S3C2410_PA_UART1 (S3C24XX_PA_UART + 0x4000 ) +#define S3C2410_PA_UART2 (S3C24XX_PA_UART + 0x8000 ) #define S3C2410_URXH (0x24) #define S3C2410_UTXH (0x20) diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h index ddd1578a7ee..4367ec054b5 100644 --- a/include/asm-arm/arch-s3c2410/uncompress.h +++ b/include/asm-arm/arch-s3c2410/uncompress.h @@ -35,13 +35,13 @@ #undef S3C2410_GPIOREG #undef S3C2410_WDOGREG -#define S3C2410_GPIOREG(x) ((S3C2410_PA_GPIO + (x))) -#define S3C2410_WDOGREG(x) ((S3C2410_PA_WATCHDOG + (x))) +#define S3C2410_GPIOREG(x) ((S3C24XX_PA_GPIO + (x))) +#define S3C2410_WDOGREG(x) ((S3C24XX_PA_WATCHDOG + (x))) /* how many bytes we allow into the FIFO at a time in FIFO mode */ #define FIFO_MAX (14) -#define uart_base S3C2410_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT) +#define uart_base S3C24XX_PA_UART + (0x4000*CONFIG_S3C2410_LOWLEVEL_UART_PORT) static __inline__ void uart_wr(unsigned int reg, unsigned int val) -- cgit v1.2.3 From 7efb83002bc20c5c72151d51468593834b510d71 Mon Sep 17 00:00:00 2001 From: "George G. Davis" Date: Thu, 26 Jan 2006 15:21:28 +0000 Subject: [ARM] 3269/1: Add ARMv6 MT_NONSHARED_DEVICE mem_types[] index Patch from George G. Davis This Freescale Semiconductor, Inc. contributed patch adds mem_types[] support for ARMv6 non-shared device memory region attributes. This implementation provides support for only first level section mapped non-shared devices. Second level non-shared device mappings are not yet supported. Signed-off-by: George G. Davis Signed-off-by: Russell King --- include/asm-arm/mach/map.h | 1 + include/asm-arm/pgtable.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include') diff --git a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h index 3351b77fab3..e8ea67c97c7 100644 --- a/include/asm-arm/mach/map.h +++ b/include/asm-arm/mach/map.h @@ -26,6 +26,7 @@ struct meminfo; #define MT_MEMORY 5 #define MT_ROM 6 #define MT_IXP2000_DEVICE 7 +#define MT_NONSHARED_DEVICE 8 extern void create_memmap_holes(struct meminfo *); extern void memtable_init(struct meminfo *); diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index 5a0d19b466b..70e00d08345 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h @@ -168,6 +168,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val); #define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) #define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE) #define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE) +#define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2)) /* * - coarse table (not used) -- cgit v1.2.3 From bb1d1073a10fdc8547e3eb821ee2488260094b39 Mon Sep 17 00:00:00 2001 From: "brking@us.ibm.com" Date: Mon, 23 Jan 2006 15:03:22 -0600 Subject: [SCSI] Prevent scsi_execute_async from guessing cdb length When the scsi_execute_async interface was added it ended up reducing the flexibility of userspace to send arbitrary scsi commands through sg using SG_IO. The SG_IO interface allows userspace to specify the CDB length. This is now ignored in scsi_execute_async and it is guessed using the COMMAND_SIZE macro, which is not always correct, particularly for vendor specific commands. This patch adds a cmd_len parameter to the scsi_execute_async interface to allow the caller to specify the length of the CDB. Signed-off-by: Brian King Signed-off-by: James Bottomley --- include/scsi/scsi_device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index e94ca4d3603..290e3b4d2ae 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -275,7 +275,7 @@ extern int scsi_execute_req(struct scsi_device *sdev, const unsigned char *cmd, int data_direction, void *buffer, unsigned bufflen, struct scsi_sense_hdr *, int timeout, int retries); extern int scsi_execute_async(struct scsi_device *sdev, - const unsigned char *cmd, int data_direction, + const unsigned char *cmd, int cmd_len, int data_direction, void *buffer, unsigned bufflen, int use_sg, int timeout, int retries, void *privdata, void (*done)(void *, char *, int, int), -- cgit v1.2.3 From 61d67f2e07d96d20d86135792ca591c491939c27 Mon Sep 17 00:00:00 2001 From: Prarit Bhargava Date: Wed, 25 Jan 2006 18:51:14 -0500 Subject: [IA64-SGI] Add PROM feature set for device flush list Introduce PRF_DEVICE_FLUSH_LIST flag for older PROMs. Signed-off-by: Prarit Bhargava Signed-off-by: Tony Luck --- include/asm-ia64/sn/sn_feature_sets.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-ia64/sn/sn_feature_sets.h b/include/asm-ia64/sn/sn_feature_sets.h index f63f144e817..9ca642cad33 100644 --- a/include/asm-ia64/sn/sn_feature_sets.h +++ b/include/asm-ia64/sn/sn_feature_sets.h @@ -31,7 +31,8 @@ extern int sn_prom_feature_available(int id); * ... */ -#define PRF_PAL_CACHE_FLUSH_SAFE 0 +#define PRF_PAL_CACHE_FLUSH_SAFE 0 +#define PRF_DEVICE_FLUSH_LIST 1 @@ -48,7 +49,7 @@ extern int sn_prom_feature_available(int id); * * By default, features are disabled unless explicitly enabled. */ -#define OSF_MCA_SLV_TO_OS_INIT_SLV 0 -#define OSF_FEAT_LOG_SBES 1 +#define OSF_MCA_SLV_TO_OS_INIT_SLV 0 +#define OSF_FEAT_LOG_SBES 1 #endif /* _ASM_IA64_SN_FEATURE_SETS_H */ -- cgit v1.2.3 From 4a99ac3a9ee7e1b90ebc3ddbb44db75eef5c41e6 Mon Sep 17 00:00:00 2001 From: Zhu Yi Date: Thu, 19 Jan 2006 16:21:19 +0800 Subject: [PATCH] ieee80211: Fix A band min and max channel definitions Signed-off-by: Hong Liu Signed-off-by: Zhu Yi Signed-off-by: John W. Linville --- include/net/ieee80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index df05f468fa5..9a92aef8b0b 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h @@ -803,9 +803,9 @@ enum ieee80211_state { #define IEEE80211_24GHZ_MAX_CHANNEL 14 #define IEEE80211_24GHZ_CHANNELS 14 -#define IEEE80211_52GHZ_MIN_CHANNEL 36 +#define IEEE80211_52GHZ_MIN_CHANNEL 34 #define IEEE80211_52GHZ_MAX_CHANNEL 165 -#define IEEE80211_52GHZ_CHANNELS 32 +#define IEEE80211_52GHZ_CHANNELS 131 enum { IEEE80211_CH_PASSIVE_ONLY = (1 << 0), -- cgit v1.2.3 From 68ee3eb8295c9c164071fcbd367c419121bd55f8 Mon Sep 17 00:00:00 2001 From: Kyle McMartin Date: Sun, 29 Jan 2006 20:25:49 -0700 Subject: [PARISC] New syscalls (inotify, *at, pselect6/ppoll, migrate_pages) Wire up some new syscalls that have been merged upstream, o inotify o openat et al o pselect6/ppoll o migrate_pages Signed-off-by: Kyle McMartin --- include/asm-parisc/unistd.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h index 80b7b98c70a..c56fccbf34a 100644 --- a/include/asm-parisc/unistd.h +++ b/include/asm-parisc/unistd.h @@ -761,8 +761,27 @@ #define __NR_keyctl (__NR_Linux + 266) #define __NR_ioprio_set (__NR_Linux + 267) #define __NR_ioprio_get (__NR_Linux + 268) +#define __NR_inotify_init (__NR_Linux + 269) +#define __NR_inotify_add_watch (__NR_Linux + 270) +#define __NR_inotify_rm_watch (__NR_Linux + 271) +#define __NR_migrate_pages (__NR_Linux + 272) +#define __NR_pselect6 (__NR_Linux + 273) +#define __NR_ppoll (__NR_Linux + 274) +#define __NR_openat (__NR_Linux + 275) +#define __NR_mkdirat (__NR_Linux + 276) +#define __NR_mknodat (__NR_Linux + 277) +#define __NR_fchownat (__NR_Linux + 278) +#define __NR_futimesat (__NR_Linux + 279) +#define __NR_newfstatat (__NR_Linux + 280) +#define __NR_unlinkat (__NR_Linux + 281) +#define __NR_renameat (__NR_Linux + 282) +#define __NR_linkat (__NR_Linux + 283) +#define __NR_symlinkat (__NR_Linux + 284) +#define __NR_readlinkat (__NR_Linux + 285) +#define __NR_fchmodat (__NR_Linux + 286) +#define __NR_faccessat (__NR_Linux + 287) -#define __NR_Linux_syscalls 269 +#define __NR_Linux_syscalls 288 #define HPUX_GATEWAY_ADDR 0xC0000004 #define LINUX_GATEWAY_ADDR 0x100 -- cgit v1.2.3 From b8e4d89357fc434618a59c1047cac72641191805 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Fri, 27 Jan 2006 16:43:00 -0500 Subject: [ACPI] ACPICA 20060127 Implemented support in the Resource Manager to allow unresolved namestring references within resource package objects for the _PRT method. This support is in addition to the previously implemented unresolved reference support within the AML parser. If the interpreter slack mode is enabled (true on Linux unless acpi=strict), these unresolved references will be passed through to the caller as a NULL package entry. http://bugzilla.kernel.org/show_bug.cgi?id=5741 Implemented and deployed new macros and functions for error and warning messages across the subsystem. These macros are simpler and generate less code than their predecessors. The new macros ACPI_ERROR, ACPI_EXCEPTION, ACPI_WARNING, and ACPI_INFO replace the ACPI_REPORT_* macros. Implemented the acpi_cpu_flags type to simplify host OS integration of the Acquire/Release Lock OSL interfaces. Suggested by Steven Rostedt and Andrew Morton. Fixed a problem where Alias ASL operators are sometimes not correctly resolved. causing AE_AML_INTERNAL http://bugzilla.kernel.org/show_bug.cgi?id=5189 http://bugzilla.kernel.org/show_bug.cgi?id=5674 Fixed several problems with the implementation of the ConcatenateResTemplate ASL operator. As per the ACPI specification, zero length buffers are now treated as a single EndTag. One-length buffers always cause a fatal exception. Non-zero length buffers that do not end with a full 2-byte EndTag cause a fatal exception. Fixed a possible structure overwrite in the AcpiGetObjectInfo external interface. (With assistance from Thomas Renninger) Signed-off-by: Bob Moore Signed-off-by: Len Brown --- include/acpi/acconfig.h | 4 +- include/acpi/aclocal.h | 9 ++--- include/acpi/acmacros.h | 87 +++++++++++++++-------------------------- include/acpi/acobject.h | 2 +- include/acpi/acpiosxf.h | 4 +- include/acpi/actypes.h | 41 +++++++++++++++---- include/acpi/acutils.h | 25 ++++++++++-- include/acpi/platform/acenv.h | 10 ++--- include/acpi/platform/acgcc.h | 8 ++-- include/acpi/platform/aclinux.h | 2 + 10 files changed, 107 insertions(+), 85 deletions(-) (limited to 'include') diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h index 675a32f7832..e27dc8f2997 100644 --- a/include/acpi/acconfig.h +++ b/include/acpi/acconfig.h @@ -63,7 +63,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20060113 +#define ACPI_CA_VERSION 0x20060127 /* * OS name, used for the _OS object. The _OS object is essentially obsolete, @@ -83,7 +83,7 @@ #define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ /* - * Should the subystem abort the loading of an ACPI table if the + * Should the subsystem abort the loading of an ACPI table if the * table checksum is incorrect? */ #define ACPI_CHECKSUM_ABORT FALSE diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h index 97f8e4185e4..8361820d297 100644 --- a/include/acpi/aclocal.h +++ b/include/acpi/aclocal.h @@ -416,13 +416,13 @@ struct acpi_field_info { #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 -#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ - u8 data_type; /* To differentiate various internal objs */\ +#define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\ + u8 data_type; /* To differentiate various internal objs */\ u8 flags; \ u16 value; \ u16 state; \ u16 reserved; \ - void *next; \ + void *next; struct acpi_common_state { ACPI_STATE_COMMON}; @@ -575,8 +575,7 @@ union acpi_parse_value { char aml_op_name[16]) /* Op name (debug only) */\ /* NON-DEBUG members below: */\ struct acpi_namespace_node *node; /* For use by interpreter */\ - union acpi_parse_value value; /* Value or args associated with the opcode */\ - + union acpi_parse_value value; /* Value or args associated with the opcode */ #define ACPI_DASM_BUFFER 0x00 #define ACPI_DASM_RESOURCE 0x01 diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h index 49ba151766d..f2be2a88173 100644 --- a/include/acpi/acmacros.h +++ b/include/acpi/acmacros.h @@ -341,8 +341,12 @@ /* * Rounding macros (Power of two boundaries only) */ -#define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & (~(((acpi_native_uint) boundary)-1))) -#define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + (((acpi_native_uint) boundary)-1)) & (~(((acpi_native_uint) boundary)-1))) +#define ACPI_ROUND_DOWN(value,boundary) (((acpi_native_uint)(value)) & \ + (~(((acpi_native_uint) boundary)-1))) + +#define ACPI_ROUND_UP(value,boundary) ((((acpi_native_uint)(value)) + \ + (((acpi_native_uint) boundary)-1)) & \ + (~(((acpi_native_uint) boundary)-1))) #define ACPI_ROUND_DOWN_TO_32_BITS(a) ACPI_ROUND_DOWN(a,4) #define ACPI_ROUND_DOWN_TO_64_BITS(a) ACPI_ROUND_DOWN(a,8) @@ -379,10 +383,11 @@ /* Generate a UUID */ -#define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) (a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \ - (b) & 0xFF, ((b) >> 8) & 0xFF, \ - (c) & 0xFF, ((c) >> 8) & 0xFF, \ - (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) +#define ACPI_INIT_UUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ + (a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \ + (b) & 0xFF, ((b) >> 8) & 0xFF, \ + (c) & 0xFF, ((c) >> 8) & 0xFF, \ + (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) /* * An struct acpi_namespace_node * can appear in some contexts, @@ -442,13 +447,12 @@ #define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) #define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) +#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES) /* * Module name is include in both debug and non-debug versions primarily for * error messages. The __FILE__ macro is not very useful for this, because it * often includes the entire pathname to the module */ -#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES) - #define ACPI_MODULE_NAME(name) static char ACPI_UNUSED_VAR *_acpi_module_name = name; #else #define ACPI_MODULE_NAME(name) @@ -458,45 +462,31 @@ * Ascii error messages can be configured out */ #ifndef ACPI_NO_ERROR_MESSAGES - -#define ACPI_PARAM_LIST(pl) pl -#define ACPI_LOCATION_INFO _acpi_module_name, __LINE__ +#define AE_INFO _acpi_module_name, __LINE__ /* - * Error reporting. Callers module and line number are inserted automatically - * These macros are used for both the debug and non-debug versions of the code + * Error reporting. Callers module and line number are inserted by AE_INFO, + * the plist contains a set of parens to allow variable-length lists. + * These macros are used for both the debug and non-debug versions of the code. */ -#define ACPI_REPORT_INFO(fp) {acpi_ut_report_info (ACPI_LOCATION_INFO); \ - acpi_os_printf ACPI_PARAM_LIST (fp);} -#define ACPI_REPORT_ERROR(fp) {acpi_ut_report_error (ACPI_LOCATION_INFO); \ - acpi_os_printf ACPI_PARAM_LIST (fp);} -#define ACPI_REPORT_WARNING(fp) {acpi_ut_report_warning (ACPI_LOCATION_INFO); \ - acpi_os_printf ACPI_PARAM_LIST (fp);} -#define ACPI_REPORT_NSERROR(s,e) acpi_ns_report_error (ACPI_LOCATION_INFO, \ - s, e); -#define ACPI_REPORT_MTERROR(s,n,p,e) acpi_ns_report_method_error (ACPI_LOCATION_INFO, \ - s, n, p, e); - -/* Error reporting. These versions pass thru the module and lineno */ +#define ACPI_INFO(plist) acpi_ut_info plist +#define ACPI_WARNING(plist) acpi_ut_warning plist +#define ACPI_EXCEPTION(plist) acpi_ut_exception plist +#define ACPI_ERROR(plist) acpi_ut_error plist +#define ACPI_ERROR_NAMESPACE(s,e) acpi_ns_report_error (AE_INFO, s, e); +#define ACPI_ERROR_METHOD(s,n,p,e) acpi_ns_report_method_error (AE_INFO, s, n, p, e); -#define _ACPI_REPORT_INFO(a,b,fp) {acpi_ut_report_info (a,b); \ - acpi_os_printf ACPI_PARAM_LIST (fp);} -#define _ACPI_REPORT_ERROR(a,b,fp) {acpi_ut_report_error (a,b); \ - acpi_os_printf ACPI_PARAM_LIST (fp);} -#define _ACPI_REPORT_WARNING(a,b,fp) {acpi_ut_report_warning (a,b); \ - acpi_os_printf ACPI_PARAM_LIST (fp);} #else /* No error messages */ -#define ACPI_REPORT_INFO(fp) -#define ACPI_REPORT_ERROR(fp) -#define ACPI_REPORT_WARNING(fp) -#define ACPI_REPORT_NSERROR(s,e) -#define ACPI_REPORT_MTERROR(s,n,p,e) -#define _ACPI_REPORT_INFO(a,b,c,fp) -#define _ACPI_REPORT_ERROR(a,b,c,fp) -#define _ACPI_REPORT_WARNING(a,b,c,fp) +#define ACPI_INFO(plist) +#define ACPI_WARNING(plist) +#define ACPI_EXCEPTION(plist) +#define ACPI_ERROR(plist) +#define ACPI_ERROR_NAMESPACE(s,e) +#define ACPI_ERROR_METHOD(s,n,p,e) + #endif /* @@ -538,7 +528,7 @@ #endif #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ - acpi_ut_trace(ACPI_DEBUG_PARAMETERS) + acpi_ut_trace(ACPI_DEBUG_PARAMETERS) #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ acpi_ut_trace_ptr(ACPI_DEBUG_PARAMETERS,(void *)b) #define ACPI_FUNCTION_TRACE_U32(a,b) ACPI_FUNCTION_NAME(a) \ @@ -632,18 +622,6 @@ #define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) #define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) #define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) -#define ACPI_BREAK_MSG(a) acpi_os_signal (ACPI_SIGNAL_BREAKPOINT,(a)) - -/* - * Generate INT3 on ACPI_ERROR (Debug only!) - */ -#define ACPI_ERROR_BREAK -#ifdef ACPI_ERROR_BREAK -#define ACPI_BREAK_ON_ERROR(lvl) if ((lvl)&ACPI_ERROR) \ - acpi_os_signal(ACPI_SIGNAL_BREAKPOINT,"Fatal error encountered\n") -#else -#define ACPI_BREAK_ON_ERROR(lvl) -#endif /* * Master debug print macros @@ -651,8 +629,8 @@ * 1) Debug print for the current component is enabled * 2) Debug error level or trace level for the print statement is enabled */ -#define ACPI_DEBUG_PRINT(pl) acpi_ut_debug_print ACPI_PARAM_LIST(pl) -#define ACPI_DEBUG_PRINT_RAW(pl) acpi_ut_debug_print_raw ACPI_PARAM_LIST(pl) +#define ACPI_DEBUG_PRINT(plist) acpi_ut_debug_print plist +#define ACPI_DEBUG_PRINT_RAW(plist) acpi_ut_debug_print_raw plist #else /* @@ -681,7 +659,6 @@ #define ACPI_DUMP_BUFFER(a,b) #define ACPI_DEBUG_PRINT(pl) #define ACPI_DEBUG_PRINT_RAW(pl) -#define ACPI_BREAK_MSG(a) #define return_VOID return #define return_ACPI_STATUS(s) return(s) diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h index 1bd411962c7..d130cfed8d5 100644 --- a/include/acpi/acobject.h +++ b/include/acpi/acobject.h @@ -69,7 +69,7 @@ u8 type; /* acpi_object_type */\ u16 reference_count; /* For object deletion management */\ union acpi_operand_object *next_object; /* Objects linked to parent NS node */\ - u8 flags; \ + u8 flags; /* Values for flag byte above */ diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 768f63f391c..970e9a6372c 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -108,9 +108,9 @@ acpi_status acpi_os_create_lock(acpi_handle * out_handle); void acpi_os_delete_lock(acpi_handle handle); -acpi_native_uint acpi_os_acquire_lock(acpi_handle handle); +acpi_cpu_flags acpi_os_acquire_lock(acpi_handle handle); -void acpi_os_release_lock(acpi_handle handle, acpi_native_uint flags); +void acpi_os_release_lock(acpi_handle handle, acpi_cpu_flags flags); /* * Memory allocation and mapping diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 74819e9b469..7ca89cde706 100644 --- a/include/acpi/actypes.h +++ b/include/acpi/actypes.h @@ -237,17 +237,22 @@ typedef char *acpi_physical_address; #error unknown ACPI_MACHINE_WIDTH #endif +/* Variable-width type, used instead of clib size_t */ + +typedef acpi_native_uint acpi_size; + /******************************************************************************* * * OS- or compiler-dependent types * + * If the defaults below are not appropriate for the host system, they can + * be defined in the compiler-specific or OS-specific header, and this will + * take precedence. + * ******************************************************************************/ -/* - * If acpi_uintptr_t was not defined in the OS- or compiler-dependent header, - * define it now (use C99 uintptr_t for pointer casting if available, - * "void *" otherwise) - */ +/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ + #ifndef acpi_uintptr_t #define acpi_uintptr_t void * #endif @@ -261,9 +266,31 @@ typedef char *acpi_physical_address; #define acpi_cache_t struct acpi_memory_list #endif -/* Variable-width type, used instead of clib size_t */ +/* + * Allow the CPU flags word to be defined per-OS to simplify the use of the + * lock and unlock OSL interfaces. + */ +#ifndef acpi_cpu_flags +#define acpi_cpu_flags acpi_native_uint +#endif -typedef acpi_native_uint acpi_size; +/* + * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because + * some compilers can catch printf format string problems + */ +#ifndef ACPI_PRINTF_LIKE +#define ACPI_PRINTF_LIKE(c) +#endif + +/* + * Some compilers complain about unused variables. Sometimes we don't want to + * use all the variables (for example, _acpi_module_name). This allows us + * to to tell the compiler in a per-variable manner that a variable + * is unused + */ +#ifndef ACPI_UNUSED_VAR +#define ACPI_UNUSED_VAR +#endif /******************************************************************************* * diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 10f6625f639..0927765df6a 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h @@ -275,20 +275,22 @@ acpi_ut_ptr_exit(u32 line_number, const char *function_name, char *module_name, u32 component_id, u8 * ptr); +void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); + void acpi_ut_report_error(char *module_name, u32 line_number); void acpi_ut_report_info(char *module_name, u32 line_number); void acpi_ut_report_warning(char *module_name, u32 line_number); -void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); +/* Error and message reporting interfaces */ void ACPI_INTERNAL_VAR_XFACE acpi_ut_debug_print(u32 requested_debug_level, u32 line_number, const char *function_name, char *module_name, - u32 component_id, char *format, ...) ACPI_PRINTF_LIKE_FUNC; + u32 component_id, char *format, ...) ACPI_PRINTF_LIKE(6); void ACPI_INTERNAL_VAR_XFACE acpi_ut_debug_print_raw(u32 requested_debug_level, @@ -296,7 +298,24 @@ acpi_ut_debug_print_raw(u32 requested_debug_level, const char *function_name, char *module_name, u32 component_id, - char *format, ...) ACPI_PRINTF_LIKE_FUNC; + char *format, ...) ACPI_PRINTF_LIKE(6); + +void ACPI_INTERNAL_VAR_XFACE +acpi_ut_error(char *module_name, + u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3); + +void ACPI_INTERNAL_VAR_XFACE +acpi_ut_exception(char *module_name, + u32 line_number, + acpi_status status, char *format, ...) ACPI_PRINTF_LIKE(4); + +void ACPI_INTERNAL_VAR_XFACE +acpi_ut_warning(char *module_name, + u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3); + +void ACPI_INTERNAL_VAR_XFACE +acpi_ut_info(char *module_name, + u32 line_number, char *format, ...) ACPI_PRINTF_LIKE(3); /* * utdelete - Object deletion and reference counts diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 31b0f18342f..223ec646710 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h @@ -149,6 +149,9 @@ #elif defined(NETWARE) #include "acnetware.h" +#elif defined(__sun) +#include "acsolaris.h" + #else /* All other environments */ @@ -158,13 +161,6 @@ #define COMPILER_DEPENDENT_INT64 long long #define COMPILER_DEPENDENT_UINT64 unsigned long long -/* - * This macro is used to tag functions as "printf-like" because - * some compilers can catch printf format string problems. MSVC - * doesn't, so this is proprocessed away. - */ -#define ACPI_PRINTF_LIKE_FUNC - #endif /* diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index ea2a6322f64..da80933963d 100644 --- a/include/acpi/platform/acgcc.h +++ b/include/acpi/platform/acgcc.h @@ -48,12 +48,14 @@ #define ACPI_GET_FUNCTION_NAME __FUNCTION__ -/* This macro is used to tag functions as "printf-like" because +/* + * This macro is used to tag functions as "printf-like" because * some compilers (like GCC) can catch printf format string problems. */ -#define ACPI_PRINTF_LIKE_FUNC __attribute__ ((__format__ (__printf__, 6, 7))) +#define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1))) -/* Some compilers complain about unused variables. Sometimes we don't want to +/* + * Some compilers complain about unused variables. Sometimes we don't want to * use all the variables (for example, _acpi_module_name). This allows us * to to tell the compiler warning in a per-variable manner that a variable * is unused. diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index c21c27fe7e1..2e6d54569ee 100644 --- a/include/acpi/platform/aclinux.h +++ b/include/acpi/platform/aclinux.h @@ -102,4 +102,6 @@ #include "acgcc.h" +#define acpi_cpu_flags unsigned long + #endif /* __ACLINUX_H__ */ -- cgit v1.2.3 From 7ce08c93e388922e25a96a7d9895784182e4c72c Mon Sep 17 00:00:00 2001 From: Luca Risolia Date: Wed, 11 Jan 2006 02:06:59 +0000 Subject: [PATCH] USB: Add ET61X[12]51 Video4Linux2 driver This patch adds a Video4Linux2 driver giving support to ET61X151 and ET61X251 PC Camera Controllers made by Etoms Electronics. Signed-off-by: Luca Risolia Signed-off-by: Greg Kroah-Hartman --- include/linux/videodev2.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index ce40675324b..6f6c6977764 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -315,6 +315,7 @@ struct v4l2_pix_format #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0') /* SN9C10x compression */ #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */ #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */ +#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5') /* ET61X251 compression */ /* * F O R M A T E N U M E R A T I O N -- cgit v1.2.3 From c02c4bb2058587d3c012ec08268fd93fdc654ae7 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Fri, 20 Jan 2006 14:44:12 -0800 Subject: [PATCH] USB: USB authentication states Another hook needed for wireless USB: there are states associated with the device authentication protocol. Wireless devices must authenticate using the host system's keystore. Note that wired connections could also use this authentication protocol, if for no other reason than to support the most secure "simple" key exchange protocols for wireless devices. Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- include/linux/usb_ch9.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h index ee21e6bf386..a2aacfc7af2 100644 --- a/include/linux/usb_ch9.h +++ b/include/linux/usb_ch9.h @@ -535,9 +535,11 @@ enum usb_device_state { */ USB_STATE_NOTATTACHED = 0, - /* the chapter 9 device states */ + /* chapter 9 and authentication (wireless) device states */ USB_STATE_ATTACHED, - USB_STATE_POWERED, + USB_STATE_POWERED, /* wired */ + USB_STATE_UNAUTHENTICATED, /* auth */ + USB_STATE_RECONNECTING, /* auth */ USB_STATE_DEFAULT, /* limited function */ USB_STATE_ADDRESS, USB_STATE_CONFIGURED, /* most functions */ -- cgit v1.2.3 From 5d39a795bfa217b5f7637028c83ab5cb291f37bf Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Tue, 31 Jan 2006 17:35:35 -0800 Subject: [IPV4]: Always set fl.proto in ip_route_newports ip_route_newports uses the struct flowi from the struct rtable returned by ip_route_connect for the new route lookup and just replaces the port numbers if they have changed. If an IPsec policy exists which doesn't match port 0 the struct flowi won't have the proto field set and no xfrm lookup is done for the changed ports. Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- include/net/route.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/net/route.h b/include/net/route.h index e3e5436f801..9c04f15090d 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -170,8 +170,8 @@ static inline int ip_route_connect(struct rtable **rp, u32 dst, return ip_route_output_flow(rp, &fl, sk, 0); } -static inline int ip_route_newports(struct rtable **rp, u16 sport, u16 dport, - struct sock *sk) +static inline int ip_route_newports(struct rtable **rp, u8 protocol, + u16 sport, u16 dport, struct sock *sk) { if (sport != (*rp)->fl.fl_ip_sport || dport != (*rp)->fl.fl_ip_dport) { @@ -180,6 +180,7 @@ static inline int ip_route_newports(struct rtable **rp, u16 sport, u16 dport, memcpy(&fl, &(*rp)->fl, sizeof(fl)); fl.fl_ip_sport = sport; fl.fl_ip_dport = dport; + fl.proto = protocol; ip_rt_put(*rp); *rp = NULL; return ip_route_output_flow(rp, &fl, sk, 0); -- cgit v1.2.3 From b6ebb2659065b6e03605e7f0c69449bda382261a Mon Sep 17 00:00:00 2001 From: Jason Gaston Date: Mon, 9 Jan 2006 10:53:45 -0800 Subject: [PATCH] PCI: irq and pci_ids: patch for Intel ICH8 This patch adds the Intel ICH8 DID's to the irq.c and pci_ids.h files. Signed-off-by: Jason Gaston Signed-off-by: Greg Kroah-Hartman --- include/linux/pci_ids.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 4401a7e0605..9eb1983b878 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2106,6 +2106,13 @@ #define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd #define PCI_DEVICE_ID_INTEL_ICH7_20 0x27de #define PCI_DEVICE_ID_INTEL_ICH7_21 0x27df +#define PCI_DEVICE_ID_INTEL_ICH8_0 0x2810 +#define PCI_DEVICE_ID_INTEL_ICH8_1 0x2811 +#define PCI_DEVICE_ID_INTEL_ICH8_2 0x2812 +#define PCI_DEVICE_ID_INTEL_ICH8_3 0x2814 +#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 +#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e +#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 #define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 #define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 #define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 -- cgit v1.2.3 From f8d65713332cf6306889a3036142a17e01e3447e Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Fri, 6 Jan 2006 03:25:37 +0100 Subject: [PATCH] PCI: drivers/pci/pci.c: #if 0 pci_find_ext_capability() This patch #if 0's the unused global function pci_find_ext_capability(). Signed-off-by: Adrian Bunk Signed-off-by: Greg Kroah-Hartman --- include/linux/pci.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/pci.h b/include/linux/pci.h index 0a44072383e..fe1a2b02fc5 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -406,7 +406,6 @@ struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int devic struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); int pci_find_capability (struct pci_dev *dev, int cap); int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); -int pci_find_ext_capability (struct pci_dev *dev, int cap); struct pci_bus * pci_find_next_bus(const struct pci_bus *from); struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from); @@ -626,7 +625,6 @@ static inline int pci_register_driver(struct pci_driver *drv) { return 0;} static inline void pci_unregister_driver(struct pci_driver *drv) { } static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; } -static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; } static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; } /* Power management related routines */ -- cgit v1.2.3 From 8cea8e9303d45556cb606cc8d9e41f889ff600c0 Mon Sep 17 00:00:00 2001 From: Mark Rustad Date: Thu, 5 Jan 2006 22:47:29 -0800 Subject: [PATCH] PCI: restore 2 missing pci ids Somewhere between 2.6.14 and 2.6.15-rc3, some PCI ids were apparently removed. The ecc.c module, which is not a part of the kernel.org tree, but included in some distributions, fails to compile. Signed-off-by: Mark Rustad Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- include/linux/pci_ids.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 9eb1983b878..7868a8ed190 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2065,6 +2065,7 @@ #define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5 #define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6 #define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db +#define PCI_DEVICE_ID_INTEL_82801EB_13 0x24dd #define PCI_DEVICE_ID_INTEL_ESB_1 0x25a1 #define PCI_DEVICE_ID_INTEL_ESB_2 0x25a2 #define PCI_DEVICE_ID_INTEL_ESB_4 0x25a4 @@ -2156,6 +2157,7 @@ #define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2 #define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601 #define PCI_DEVICE_ID_INTEL_82454GX 0x84c4 +#define PCI_DEVICE_ID_INTEL_82450GX 0x84c5 #define PCI_DEVICE_ID_INTEL_82451NX 0x84ca #define PCI_DEVICE_ID_INTEL_82454NX 0x84cb #define PCI_DEVICE_ID_INTEL_84460GX 0x84ea -- cgit v1.2.3 From 2181c971952ec2af56cd9cc68453f7ad5a0a38d6 Mon Sep 17 00:00:00 2001 From: Grant Coady Date: Sun, 15 Jan 2006 16:21:27 +1100 Subject: [PATCH] PCI: pci_ids: remove duplicates gathered during merge period pci_ids.h: remove duplicates. Compile tested allmodconfig. Signed-off-by: Grant Coady Signed-off-by: Greg Kroah-Hartman --- include/linux/pci_ids.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include') diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 7868a8ed190..b0b908f583c 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -394,14 +394,9 @@ #define PCI_DEVICE_ID_NS_SC1100_SMI 0x0511 #define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515 #define PCI_DEVICE_ID_NS_87410 0xd001 -#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d #define PCI_DEVICE_ID_NS_CS5535_HOST_BRIDGE 0x0028 #define PCI_DEVICE_ID_NS_CS5535_ISA_BRIDGE 0x002b -#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d -#define PCI_DEVICE_ID_NS_CS5535_AUDIO 0x002e -#define PCI_DEVICE_ID_NS_CS5535_USB 0x002f -#define PCI_DEVICE_ID_NS_CS5535_VIDEO 0x0030 #define PCI_VENDOR_ID_TSENG 0x100c #define PCI_DEVICE_ID_TSENG_W32P_2 0x3202 @@ -511,8 +506,6 @@ #define PCI_DEVICE_ID_AMD_CS5536_UOC 0x2097 #define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A -#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A - #define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081 #define PCI_DEVICE_ID_AMD_LX_AES 0x2082 -- cgit v1.2.3 From bd3f8f2b12bcf4ea25c89b84adeaafad232662c8 Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Tue, 31 Jan 2006 19:10:23 -0800 Subject: [PATCH] Make sure to always check upper bits of tv_nsec in timespec_valid. Signed-off-by: Chris Wright Signed-off-by: Linus Torvalds --- include/linux/time.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/time.h b/include/linux/time.h index 614dd846583..7b4dc36532b 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -48,7 +48,7 @@ extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); * Returns true if the timespec is norm, false if denorm: */ #define timespec_valid(ts) \ - (((ts)->tv_sec >= 0) && (((unsigned) (ts)->tv_nsec) < NSEC_PER_SEC)) + (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) /* * 64-bit nanosec type. Large enough to span 292+ years in nanosecond -- cgit v1.2.3 From 3a2ca64496cc1c9aeab1076e06d092b3ec74a43d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 1 Feb 2006 03:04:33 -0800 Subject: [PATCH] prototypes for *at functions & typo fix Here's the follow-up patch which introduces the prototypes for the new syscalls. There was also a typo in one of the new symbols. Signed-off-by: Ulrich Drepper Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-x86_64/ia32_unistd.h | 2 +- include/linux/syscalls.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-x86_64/ia32_unistd.h b/include/asm-x86_64/ia32_unistd.h index e87cd83a0e8..9afc0c7d366 100644 --- a/include/asm-x86_64/ia32_unistd.h +++ b/include/asm-x86_64/ia32_unistd.h @@ -300,7 +300,7 @@ #define __NR_ia32_inotify_add_watch 292 #define __NR_ia32_inotify_rm_watch 293 #define __NR_ia32_migrate_pages 294 -#define __NR_ia32_opanat 295 +#define __NR_ia32_openat 295 #define __NR_ia32_mkdirat 296 #define __NR_ia32_mknodat 297 #define __NR_ia32_fchownat 298 diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index e666d607056..fdbd436b24c 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -50,6 +50,8 @@ struct timezone; struct tms; struct utimbuf; struct mq_attr; +struct compat_stat; +struct compat_timeval; #include #include @@ -534,4 +536,35 @@ asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, asmlinkage long sys_spu_create(const char __user *name, unsigned int flags, mode_t mode); +asmlinkage long sys_mknodat(int dfd, const char __user * filename, int mode, + unsigned dev); +asmlinkage long sys_mkdirat(int dfd, const char __user * pathname, int mode); +asmlinkage long sys_unlinkat(int dfd, const char __user * pathname, int flag); +asmlinkage long sys_symlinkat(const char __user * oldname, + int newdfd, const char __user * newname); +asmlinkage long sys_linkat(int olddfd, const char __user *oldname, + int newdfd, const char __user *newname); +asmlinkage long sys_renameat(int olddfd, const char __user * oldname, + int newdfd, const char __user * newname); +asmlinkage long sys_futimesat(int dfd, char __user *filename, + struct timeval __user *utimes); +asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode); +asmlinkage long sys_fchmodat(int dfd, const char __user * filename, + mode_t mode); +asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user, + gid_t group, int flag); +asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, + int mode); +asmlinkage long sys_newfstatat(int dfd, char __user *filename, + struct stat __user *statbuf, int flag); +asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf, + int bufsiz); +asmlinkage long compat_sys_futimesat(int dfd, char __user *filename, + struct compat_timeval __user *t); +asmlinkage long compat_sys_newfstatat(int dfd, char __user * filename, + struct compat_stat __user *statbuf, + int flag); +asmlinkage long compat_sys_openat(int dfd, const char __user *filename, + int flags, int mode); + #endif -- cgit v1.2.3 From 9cd684551124e71630ab96d238747051463f5b56 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 1 Feb 2006 03:04:40 -0800 Subject: [PATCH] fuse: fix async read for legacy filesystems While asynchronous reads mean a performance improvement in most cases, if the filesystem assumed that reads are synchronous, then async reads may degrade performance (filesystem may receive reads out of order, which can confuse it's own readahead logic). With sshfs a 1.5 to 4 times slowdown can be measured. There's also a need for userspace filesystems to know whether asynchronous reads are supported by the kernel or not. To achive these, negotiate in the INIT request whether async reads will be used and the maximum readahead value. Update interface version to 7.6 If userspace uses a version earlier than 7.6, then disable async reads, and set maximum readahead value to the maximum read size, as done in previous versions. Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fuse.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 528959c52f1..5425b60021e 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h @@ -14,7 +14,7 @@ #define FUSE_KERNEL_VERSION 7 /** Minor version number of this interface */ -#define FUSE_KERNEL_MINOR_VERSION 5 +#define FUSE_KERNEL_MINOR_VERSION 6 /** The node ID of the root inode */ #define FUSE_ROOT_ID 1 @@ -58,6 +58,9 @@ struct fuse_kstatfs { __u32 spare[6]; }; +/** + * Bitmasks for fuse_setattr_in.valid + */ #define FATTR_MODE (1 << 0) #define FATTR_UID (1 << 1) #define FATTR_GID (1 << 2) @@ -75,6 +78,11 @@ struct fuse_kstatfs { #define FOPEN_DIRECT_IO (1 << 0) #define FOPEN_KEEP_CACHE (1 << 1) +/** + * INIT request/reply flags + */ +#define FUSE_ASYNC_READ (1 << 0) + enum fuse_opcode { FUSE_LOOKUP = 1, FUSE_FORGET = 2, /* no reply */ @@ -247,12 +255,16 @@ struct fuse_access_in { struct fuse_init_in { __u32 major; __u32 minor; + __u32 max_readahead; + __u32 flags; }; struct fuse_init_out { __u32 major; __u32 minor; - __u32 unused[3]; + __u32 max_readahead; + __u32 flags; + __u32 unused; __u32 max_write; }; -- cgit v1.2.3 From cc0fa84a01d328a1ad70076b90f08281c4c79f92 Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Wed, 1 Feb 2006 03:04:47 -0800 Subject: [PATCH] powerpc: enable irq's for platform functions. Make the platform function interrupt functions actually work. Calls irq_enable() for the first in the list, and irq_disable() for the last. Added *func to struct irq_client so the the user can pass just that to pmf_unregister_irq_client(). Signed-off-by: Ben Collins Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-powerpc/pmac_pfunc.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asm-powerpc/pmac_pfunc.h b/include/asm-powerpc/pmac_pfunc.h index d9728c80f86..cef61304ffc 100644 --- a/include/asm-powerpc/pmac_pfunc.h +++ b/include/asm-powerpc/pmac_pfunc.h @@ -167,6 +167,7 @@ struct pmf_irq_client { void *data; struct module *owner; struct list_head link; + struct pmf_function *func; }; @@ -187,9 +188,7 @@ extern int pmf_register_irq_client(struct device_node *np, const char *name, struct pmf_irq_client *client); -extern void pmf_unregister_irq_client(struct device_node *np, - const char *name, - struct pmf_irq_client *client); +extern void pmf_unregister_irq_client(struct pmf_irq_client *client); /* * Called by the handlers when an irq happens -- cgit v1.2.3 From 3ee247ebce93a526f482d6bc714ce796fa85a81a Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Wed, 1 Feb 2006 03:04:55 -0800 Subject: [PATCH] dm: dm-table warning fix drivers/md/dm-table.c:500: warning: comparison of distinct pointer types lacks a cast Signed-off-by: Alasdair G Kergon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/device-mapper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 83c7d207b80..51e0e95a421 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h @@ -91,7 +91,7 @@ struct target_type { }; struct io_restrictions { - unsigned short max_sectors; + unsigned int max_sectors; unsigned short max_phys_segments; unsigned short max_hw_segments; unsigned short hardsect_size; -- cgit v1.2.3 From ce5f8d70ba6e3d7ffcaff86b2cf91a42c27f77af Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 1 Feb 2006 03:04:56 -0800 Subject: [PATCH] alpha: dma-mapping.h: add "struct scatterlist;" On alpha-jensen: CC drivers/base/platform.o In file included from include/linux/dma-mapping.h:24, from drivers/base/platform.c:16: include/asm/dma-mapping.h:36: warning: "struct scatterlist" declared inside parameter list include/asm/dma-mapping.h:36: warning: its scope is only this definition or declaration, which is probably not what you want Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-alpha/dma-mapping.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-alpha/dma-mapping.h b/include/asm-alpha/dma-mapping.h index 9dc7256cf97..62d0d6681aa 100644 --- a/include/asm-alpha/dma-mapping.h +++ b/include/asm-alpha/dma-mapping.h @@ -30,6 +30,7 @@ #else /* no PCI - no IOMMU. */ +struct scatterlist; void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t gfp); int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, -- cgit v1.2.3 From ed5a92700d3ce2646cb7763792a5f7ad1bade7e8 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Wed, 1 Feb 2006 03:05:00 -0800 Subject: [PATCH] tpm_bios: needs more securityfs_ functions tpm_bios.c needs securityfs_xyz() functions. Does include/linux/security.h need stubs for these, or should char/tpm/Makefile just be modified to say: ifdef CONFIG_ACPI ifdef CONFIG_SECURITY obj-$(CONFIG_TCG_TPM) += tpm_bios.o endif endif drivers/char/tpm/tpm_bios.c:494: warning: implicit declaration of function 'securityfs_create_dir' drivers/char/tpm/tpm_bios.c:494: warning: assignment makes pointer from integer without a cast drivers/char/tpm/tpm_bios.c:499: warning: implicit declaration of function 'securityfs_create_file' drivers/char/tpm/tpm_bios.c:501: warning: assignment makes pointer from integer without a cast drivers/char/tpm/tpm_bios.c:508: warning: assignment makes pointer from integer without a cast drivers/char/tpm/tpm_bios.c:523: warning: implicit declaration of function 'securityfs_remove' *** Warning: "securityfs_create_file" [drivers/char/tpm/tpm_bios.ko] undefined! *** Warning: "securityfs_create_dir" [drivers/char/tpm/tpm_bios.ko] undefined! *** Warning: "securityfs_remove" [drivers/char/tpm/tpm_bios.ko] undefined! There are also some gcc and sparse warnings that could be fixed. (see http://www.xenotime.net/linux/doc/build-tpm.out) Signed-off-by: Randy Dunlap Cc: Serge Hallyn Cc: Greg KH Cc: Kylene Jo Hall Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/security.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include') diff --git a/include/linux/security.h b/include/linux/security.h index ef753654daa..bb1da86747c 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -2617,6 +2617,25 @@ static inline int security_netlink_recv (struct sk_buff *skb) return cap_netlink_recv (skb); } +static inline struct dentry *securityfs_create_dir(const char *name, + struct dentry *parent) +{ + return ERR_PTR(-ENODEV); +} + +static inline struct dentry *securityfs_create_file(const char *name, + mode_t mode, + struct dentry *parent, + void *data, + struct file_operations *fops) +{ + return ERR_PTR(-ENODEV); +} + +static inline void securityfs_remove(struct dentry *dentry) +{ +} + #endif /* CONFIG_SECURITY */ #ifdef CONFIG_SECURITY_NETWORK -- cgit v1.2.3 From ff60a5dc4fa584d47022d2533bc5c53b80096fb5 Mon Sep 17 00:00:00 2001 From: "akpm@osdl.org" Date: Wed, 1 Feb 2006 03:05:10 -0800 Subject: [PATCH] hrtimers: fix posix-timer requeue race From: Steven Rostedtrostedt@goodmis.org CPU0 expires a posix-timer and runs the callback function. The signal is queued. After releasing the posix-timer lock and before returning to hrtimer_run_queue CPU0 gets interrupted. CPU1 delivers the queued signal and rearms the timer. CPU0 comes back to hrtimer_run_queue and sets the timer state to expired. The next modification of the timer can result in an oops, because the state information is wrong. Keep track of state = RUNNING and check if the state has been in the return path of hrtimer_run_queue. In case the state has been changed, ignore a restart request and do not touch the state variable. Signed-off-by: Steven Rostedt Signed-off-by: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/hrtimer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 089bfb1fa01..c657f3d4924 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -40,6 +40,7 @@ enum hrtimer_restart { enum hrtimer_state { HRTIMER_INACTIVE, /* Timer is inactive */ HRTIMER_EXPIRED, /* Timer is expired */ + HRTIMER_RUNNING, /* Timer is running the callback function */ HRTIMER_PENDING, /* Timer is pending */ }; -- cgit v1.2.3 From 7978672c4d9a1e6a6081de3a9d9ba5e5b24904a0 Mon Sep 17 00:00:00 2001 From: George Anzinger Date: Wed, 1 Feb 2006 03:05:11 -0800 Subject: [PATCH] hrtimers: cleanups and simplifications Clean up the interface to hrtimers by changing the init code to pass the mode as well as the clock. This allow the init code to select the correct base and eliminates extra timer re-init code in posix-timers. We also simplify the restart interface nanosleep use. Signed-off-by: George Anzinger Signed-off-by: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/hrtimer.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index c657f3d4924..6361544bb6a 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -101,9 +101,8 @@ struct hrtimer_base { /* Exported timer functions: */ /* Initialize timers: */ -extern void hrtimer_init(struct hrtimer *timer, const clockid_t which_clock); -extern void hrtimer_rebase(struct hrtimer *timer, const clockid_t which_clock); - +extern void hrtimer_init(struct hrtimer *timer, clockid_t which_clock, + enum hrtimer_mode mode); /* Basic timer operations: */ extern int hrtimer_start(struct hrtimer *timer, ktime_t tim, -- cgit v1.2.3 From 66188fae3bf7f8dd951e2291d2a81888ed1b65de Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 1 Feb 2006 03:05:13 -0800 Subject: [PATCH] hrtimers: add back lost credit lines At some point we added credits to people who actively helped to bring k/hr-timers along. This was lost in the big code revamp. Add it back. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ktime.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 1bd6552cc34..6aca67a569a 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h @@ -10,6 +10,12 @@ * * Started by: Thomas Gleixner and Ingo Molnar * + * Credits: + * + * Roman Zippel provided the ideas and primary code snippets of + * the ktime_t union and further simplifications of the original + * code. + * * For licencing details see kernel-base/COPYING */ #ifndef _LINUX_KTIME_H -- cgit v1.2.3 From 493f01d1d0699ddafc30067d33fcc18d0b95b624 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Wed, 1 Feb 2006 03:05:14 -0800 Subject: [PATCH] kernel/posix-timers.c: remove do_posix_clock_notimer_create() This function is neither used nor has any real contents. Signed-off-by: Adrian Bunk Acked-by: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/posix-timers.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index 54faf5236da..95572c434bc 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h @@ -84,7 +84,6 @@ struct k_clock { void register_posix_clock(const clockid_t clock_id, struct k_clock *new_clock); /* error handlers for timer_create, nanosleep and settime */ -int do_posix_clock_notimer_create(struct k_itimer *timer); int do_posix_clock_nonanosleep(const clockid_t, int flags, struct timespec *, struct timespec __user *); int do_posix_clock_nosettime(const clockid_t, struct timespec *tp); -- cgit v1.2.3 From f7589f28d7dd4586b4e90ac3b2a180409669053a Mon Sep 17 00:00:00 2001 From: Bryan O'Sullivan Date: Wed, 1 Feb 2006 03:05:15 -0800 Subject: [PATCH] Define BITS_PER_BYTE This can make the intent behind some arithmetic expressions clearer. Signed-off-by: Bryan O'Sullivan Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/types.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/types.h b/include/linux/types.h index 21b9ce80364..54ae2d59e71 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -8,6 +8,8 @@ (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) #define DECLARE_BITMAP(name,bits) \ unsigned long name[BITS_TO_LONGS(bits)] + +#define BITS_PER_BYTE 8 #endif #include -- cgit v1.2.3 From c27a0d75b33c030965cc97d3d7f571107a673fb4 Mon Sep 17 00:00:00 2001 From: Bryan O'Sullivan Date: Wed, 1 Feb 2006 03:05:16 -0800 Subject: [PATCH] Introduce __iowrite32_copy This arch-independent routine copies data to a memory-mapped I/O region, using 32-bit accesses. The naming is double-underscored to make it clear that it does not guarantee write ordering, nor does it perform a memory barrier afterwards; the kernel doc also explicitly states this. This style of access is required by some devices. This change also introduces include/linux/io.h, at Andrew's suggestion. It only has one occupant at the moment, but is a logical destination for oft-replicated contents of include/asm-*/{io,iomap}.h to migrate to. Signed-off-by: Bryan O'Sullivan Cc: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/io.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 include/linux/io.h (limited to 'include') diff --git a/include/linux/io.h b/include/linux/io.h new file mode 100644 index 00000000000..85533ec5aaa --- /dev/null +++ b/include/linux/io.h @@ -0,0 +1,25 @@ +/* + * Copyright 2006 PathScale, Inc. All Rights Reserved. + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _LINUX_IO_H +#define _LINUX_IO_H + +#include + +void __iowrite32_copy(void __iomem *to, const void *from, size_t count); + +#endif /* _LINUX_IO_H */ -- cgit v1.2.3 From 79046ae07ae21245520ca0aab985ee6678a879f8 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Wed, 1 Feb 2006 03:05:26 -0800 Subject: [PATCH] GFP_ZONETYPES: add commentry on how to calculate GFP_ZONETYPES define using GFP_ZONEMASK and add commentry Add commentry explaining the optimisation that we can apply to GFP_ZONETYPES when the leftmost bit is a 'loaner', it can only be set in isolation. Signed-off-by: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mmzone.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 93a849f742d..88c30f844ab 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -91,6 +91,14 @@ struct per_cpu_pageset { * be 8 (2 ** 3) zonelists. GFP_ZONETYPES defines the number of possible * combinations of zone modifiers in "zone modifier space". * + * As an optimisation any zone modifier bits which are only valid when + * no other zone modifier bits are set (loners) should be placed in + * the highest order bits of this field. This allows us to reduce the + * extent of the zonelists thus saving space. For example in the case + * of three zone modifier bits, we could require up to eight zonelists. + * If the left most zone modifier is a "loner" then the highest valid + * zonelist would be four allowing us to allocate only five zonelists. + * * NOTE! Make sure this matches the zones in */ #define GFP_ZONEMASK 0x07 -- cgit v1.2.3 From ce2ea89ba101d976907128441ba3aca72a8804b9 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Wed, 1 Feb 2006 03:05:27 -0800 Subject: [PATCH] GFP_ZONETYPES: calculate from GFP_ZONEMASK GFP_ZONETYPES calculate from GFP_ZONEMASK GFP_ZONETYPES's value is directly related to the value of GFP_ZONEMASK. It takes one of two forms depending whether the top bit of GFP_ZONEMASK is a 'loner'. Supply both forms, enabling the loner. Signed-off-by: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/mmzone.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 88c30f844ab..ebfc238cc24 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -98,11 +98,14 @@ struct per_cpu_pageset { * of three zone modifier bits, we could require up to eight zonelists. * If the left most zone modifier is a "loner" then the highest valid * zonelist would be four allowing us to allocate only five zonelists. + * Use the first form for GFP_ZONETYPES when the left most bit is not + * a "loner", otherwise use the second. * * NOTE! Make sure this matches the zones in */ #define GFP_ZONEMASK 0x07 -#define GFP_ZONETYPES 5 +/* #define GFP_ZONETYPES (GFP_ZONEMASK + 1) */ /* Non-loner */ +#define GFP_ZONETYPES ((GFP_ZONEMASK + 1) / 2 + 1) /* Loner */ /* * On machines where it is needed (eg PCs) we divide physical memory -- cgit v1.2.3 From 2a11ff06d7d12be5d1bbcf592fff649b45ac2388 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Wed, 1 Feb 2006 03:05:33 -0800 Subject: [PATCH] zone_reclaim: configurable off node allocation period. Currently the zone_reclaim code has a fixed window of 30 seconds of off node allocations should a local zone have no unused pagecache pages left. Reclaim will be attempted again after this timeout period to avoid repeated useless scans for memory. This is also useful to established sufficiently large off node allocation chunks to relieve the local node. It may be beneficial to adjust that time period for some special situations. For example if memory use was exceeding node capacity one may want to give up for longer periods of time. If memory spikes intermittendly then one may want to shorten the time period to reduce the number of off node allocations. This patch allows just that.... Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/swap.h | 1 + include/linux/sysctl.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/swap.h b/include/linux/swap.h index 4a99e4a7fbf..e53fef7051e 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -178,6 +178,7 @@ extern int vm_swappiness; #ifdef CONFIG_NUMA extern int zone_reclaim_mode; +extern int zone_reclaim_interval; extern int zone_reclaim(struct zone *, gfp_t, unsigned int); #else #define zone_reclaim_mode 0 diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 8352a7ce589..32a4139c4ad 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -182,7 +182,8 @@ enum VM_SWAP_TOKEN_TIMEOUT=28, /* default time for token time out */ VM_DROP_PAGECACHE=29, /* int: nuke lots of pagecache */ VM_PERCPU_PAGELIST_FRACTION=30,/* int: fraction of pages in each percpu_pagelist */ - VM_ZONE_RECLAIM_MODE=31,/* reclaim local zone memory before going off node */ + VM_ZONE_RECLAIM_MODE=31, /* reclaim local zone memory before going off node */ + VM_ZONE_RECLAIM_INTERVAL=32, /* time period to wait after reclaim failure */ }; -- cgit v1.2.3 From a48d07afdf18212de22b959715b16793c5a6e57a Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Wed, 1 Feb 2006 03:05:38 -0800 Subject: [PATCH] Direct Migration V9: migrate_pages() extension Add direct migration support with fall back to swap. Direct migration support on top of the swap based page migration facility. This allows the direct migration of anonymous pages and the migration of file backed pages by dropping the associated buffers (requires writeout). Fall back to swap out if necessary. The patch is based on lots of patches from the hotplug project but the code was restructured, documented and simplified as much as possible. Note that an additional patch that defines the migrate_page() method for filesystems is necessary in order to avoid writeback for anonymous and file backed pages. Signed-off-by: KAMEZAWA Hiroyuki Signed-off-by: Mike Kravetz Signed-off-by: Christoph Lameter Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/rmap.h | 4 ++-- include/linux/swap.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 9d6fbeef210..0f1ea2d6ed8 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -91,7 +91,7 @@ static inline void page_dup_rmap(struct page *page) * Called from mm/vmscan.c to handle paging out */ int page_referenced(struct page *, int is_locked); -int try_to_unmap(struct page *); +int try_to_unmap(struct page *, int ignore_refs); /* * Called from mm/filemap_xip.c to unmap empty zero page @@ -111,7 +111,7 @@ unsigned long page_address_in_vma(struct page *, struct vm_area_struct *); #define anon_vma_link(vma) do {} while (0) #define page_referenced(page,l) TestClearPageReferenced(page) -#define try_to_unmap(page) SWAP_FAIL +#define try_to_unmap(page, refs) SWAP_FAIL #endif /* CONFIG_MMU */ diff --git a/include/linux/swap.h b/include/linux/swap.h index e53fef7051e..d359fc02243 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -191,6 +191,8 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) #ifdef CONFIG_MIGRATION extern int isolate_lru_page(struct page *p); extern int putback_lru_pages(struct list_head *l); +extern int migrate_page(struct page *, struct page *); +extern void migrate_page_copy(struct page *, struct page *); extern int migrate_pages(struct list_head *l, struct list_head *t, struct list_head *moved, struct list_head *failed); #else -- cgit v1.2.3 From a3351e525e4768c29aa5d22ef59b5b38e0361e53 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Wed, 1 Feb 2006 03:05:39 -0800 Subject: [PATCH] Direct Migration V9: remove_from_swap() to remove swap ptes Add remove_from_swap remove_from_swap() allows the restoration of the pte entries that existed before page migration occurred for anonymous pages by walking the reverse maps. This reduces swap use and establishes regular pte's without the need for page faults. Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/rmap.h | 1 + include/linux/swap.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 0f1ea2d6ed8..d6b9bcd1384 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h @@ -92,6 +92,7 @@ static inline void page_dup_rmap(struct page *page) */ int page_referenced(struct page *, int is_locked); int try_to_unmap(struct page *, int ignore_refs); +void remove_from_swap(struct page *page); /* * Called from mm/filemap_xip.c to unmap empty zero page diff --git a/include/linux/swap.h b/include/linux/swap.h index d359fc02243..229b6d04b4b 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -248,6 +248,7 @@ extern int remove_exclusive_swap_page(struct page *); struct backing_dev_info; extern spinlock_t swap_lock; +extern int remove_vma_swap(struct vm_area_struct *vma, struct page *page); /* linux/mm/thrash.c */ extern struct mm_struct * swap_token_mm; -- cgit v1.2.3 From e965f9630c651fa4249039fd4b80c9392d07a856 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Wed, 1 Feb 2006 03:05:41 -0800 Subject: [PATCH] Direct Migration V9: Avoid writeback / page_migrate() method Migrate a page with buffers without requiring writeback This introduces a new address space operation migratepage() that may be used by a filesystem to implement its own version of page migration. A version is provided that migrates buffers attached to pages. Some filesystems (ext2, ext3, xfs) are modified to utilize this feature. The swapper address space operation are modified so that a regular migrate_page() will occur for anonymous pages without writeback (migrate_pages forces every anonymous page to have a swap entry). Signed-off-by: Mike Kravetz Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/fs.h | 8 ++++++++ include/linux/swap.h | 5 +++++ 2 files changed, 13 insertions(+) (limited to 'include') diff --git a/include/linux/fs.h b/include/linux/fs.h index 84bb449b9b0..e059da94700 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -363,6 +363,8 @@ struct address_space_operations { loff_t offset, unsigned long nr_segs); struct page* (*get_xip_page)(struct address_space *, sector_t, int); + /* migrate the contents of a page to the specified target */ + int (*migratepage) (struct page *, struct page *); }; struct backing_dev_info; @@ -1719,6 +1721,12 @@ extern void simple_release_fs(struct vfsmount **mount, int *count); extern ssize_t simple_read_from_buffer(void __user *, size_t, loff_t *, const void *, size_t); +#ifdef CONFIG_MIGRATION +extern int buffer_migrate_page(struct page *, struct page *); +#else +#define buffer_migrate_page NULL +#endif + extern int inode_change_ok(struct inode *, struct iattr *); extern int __must_check inode_setattr(struct inode *, struct iattr *); diff --git a/include/linux/swap.h b/include/linux/swap.h index 229b6d04b4b..f3e17d5963c 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -193,13 +193,18 @@ extern int isolate_lru_page(struct page *p); extern int putback_lru_pages(struct list_head *l); extern int migrate_page(struct page *, struct page *); extern void migrate_page_copy(struct page *, struct page *); +extern int migrate_page_remove_references(struct page *, struct page *, int); extern int migrate_pages(struct list_head *l, struct list_head *t, struct list_head *moved, struct list_head *failed); +extern int fail_migrate_page(struct page *, struct page *); #else static inline int isolate_lru_page(struct page *p) { return -ENOSYS; } static inline int putback_lru_pages(struct list_head *l) { return 0; } static inline int migrate_pages(struct list_head *l, struct list_head *t, struct list_head *moved, struct list_head *failed) { return -ENOSYS; } +/* Possible settings for the migrate_page() method in address_operations */ +#define migrate_page NULL +#define fail_migrate_page NULL #endif #ifdef CONFIG_MMU -- cgit v1.2.3 From 7fd6b1413082c303613fc137aca9a004740cacf0 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Wed, 1 Feb 2006 03:05:52 -0800 Subject: [PATCH] slab: fix kzalloc and kstrdup caller report for CONFIG_DEBUG_SLAB Fix kzalloc() and kstrdup() caller report for CONFIG_DEBUG_SLAB. We must pass the caller to __cache_alloc() instead of directly doing __builtin_return_address(0) there; otherwise kzalloc() and kstrdup() are reported as the allocation site instead of the real one. Thanks to Valdis Kletnieks for reporting the problem and Steven Rostedt for the original idea. Signed-off-by: Pekka Enberg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/slab.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/linux/slab.h b/include/linux/slab.h index 1fb77a9cc14..8cf52939d0a 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -76,7 +76,14 @@ struct cache_sizes { kmem_cache_t *cs_dmacachep; }; extern struct cache_sizes malloc_sizes[]; + +#ifndef CONFIG_DEBUG_SLAB extern void *__kmalloc(size_t, gfp_t); +#else +extern void *__kmalloc_track_caller(size_t, gfp_t, void*); +#define __kmalloc(size, flags) \ + __kmalloc_track_caller(size, flags, __builtin_return_address(0)) +#endif static inline void *kmalloc(size_t size, gfp_t flags) { -- cgit v1.2.3 From 39931e41becd6abeb2014747369d8b6392f5dbac Mon Sep 17 00:00:00 2001 From: Albert Herranz Date: Wed, 1 Feb 2006 03:05:57 -0800 Subject: [PATCH] powerpc: fix for kexec ppc32 - kexec.h is included from assembly code, thus C code must be properly protected. - (embedded) ppc32 systems use machine_kexec_simple whose declaration vanished during a recent powerpc merge change. Signed-off-by: Albert Herranz Cc: Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-powerpc/kexec.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-powerpc/kexec.h b/include/asm-powerpc/kexec.h index 640a6459f2f..bda2f217e6f 100644 --- a/include/asm-powerpc/kexec.h +++ b/include/asm-powerpc/kexec.h @@ -33,6 +33,7 @@ #ifdef CONFIG_KEXEC +#ifndef __ASSEMBLY__ #ifdef __powerpc64__ /* * This function is responsible for capturing register states if coming @@ -104,7 +105,6 @@ static inline void crash_setup_regs(struct pt_regs *newregs, struct pt_regs *oldregs) { } #endif /* !__powerpc64 __ */ -#ifndef __ASSEMBLY__ #define MAX_NOTE_BYTES 1024 #ifdef __powerpc64__ @@ -121,6 +121,8 @@ extern void default_machine_kexec(struct kimage *image); extern int default_machine_kexec_prepare(struct kimage *image); extern void default_machine_crash_shutdown(struct pt_regs *regs); +extern void machine_kexec_simple(struct kimage *image); + #endif /* ! __ASSEMBLY__ */ #endif /* CONFIG_KEXEC */ #endif /* __KERNEL__ */ -- cgit v1.2.3 From 740172947b315fa97f8d29b0b9809b1ea1201642 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 1 Feb 2006 03:05:59 -0800 Subject: [PATCH] sh: SH4-202 microdev updates A few trivial updates for the microdev board support code: - Update for __IO_PREFIX changes. - Consolidate headers into a single microdev.h. - Update the microdev_defconfig. - Add init values for the S1D13806 used by s1d13xxxfb. Signed-off-by: Paul Mundt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-sh/microdev.h | 80 +++++++++++++++++++++++++++++++++++++++++++ include/asm-sh/microdev/io.h | 53 ---------------------------- include/asm-sh/microdev/irq.h | 72 -------------------------------------- 3 files changed, 80 insertions(+), 125 deletions(-) create mode 100644 include/asm-sh/microdev.h delete mode 100644 include/asm-sh/microdev/io.h delete mode 100644 include/asm-sh/microdev/irq.h (limited to 'include') diff --git a/include/asm-sh/microdev.h b/include/asm-sh/microdev.h new file mode 100644 index 00000000000..018332a9e59 --- /dev/null +++ b/include/asm-sh/microdev.h @@ -0,0 +1,80 @@ +/* + * linux/include/asm-sh/microdev.h + * + * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com) + * + * Definitions for the SuperH SH4-202 MicroDev board. + * + * May be copied or modified under the terms of the GNU General Public + * License. See linux/COPYING for more information. + */ +#ifndef __ASM_SH_MICRODEV_H +#define __ASM_SH_MICRODEV_H + +extern void init_microdev_irq(void); +extern void microdev_print_fpga_intc_status(void); + +/* + * The following are useful macros for manipulating the interrupt + * controller (INTC) on the CPU-board FPGA. should be noted that there + * is an INTC on the FPGA, and a seperate INTC on the SH4-202 core - + * these are two different things, both of which need to be prorammed to + * correctly route - unfortunately, they have the same name and + * abbreviations! + */ +#define MICRODEV_FPGA_INTC_BASE 0xa6110000ul /* INTC base address on CPU-board FPGA */ +#define MICRODEV_FPGA_INTENB_REG (MICRODEV_FPGA_INTC_BASE+0ul) /* Interrupt Enable Register on INTC on CPU-board FPGA */ +#define MICRODEV_FPGA_INTDSB_REG (MICRODEV_FPGA_INTC_BASE+8ul) /* Interrupt Disable Register on INTC on CPU-board FPGA */ +#define MICRODEV_FPGA_INTC_MASK(n) (1ul<<(n)) /* Interupt mask to enable/disable INTC in CPU-board FPGA */ +#define MICRODEV_FPGA_INTPRI_REG(n) (MICRODEV_FPGA_INTC_BASE+0x10+((n)/8)*8)/* Interrupt Priority Register on INTC on CPU-board FPGA */ +#define MICRODEV_FPGA_INTPRI_LEVEL(n,x) ((x)<<(((n)%8)*4)) /* MICRODEV_FPGA_INTPRI_LEVEL(int_number, int_level) */ +#define MICRODEV_FPGA_INTPRI_MASK(n) (MICRODEV_FPGA_INTPRI_LEVEL((n),0xful)) /* Interrupt Priority Mask on INTC on CPU-board FPGA */ +#define MICRODEV_FPGA_INTSRC_REG (MICRODEV_FPGA_INTC_BASE+0x30ul) /* Interrupt Source Register on INTC on CPU-board FPGA */ +#define MICRODEV_FPGA_INTREQ_REG (MICRODEV_FPGA_INTC_BASE+0x38ul) /* Interrupt Request Register on INTC on CPU-board FPGA */ + + +/* + * The following are the IRQ numbers for the Linux Kernel for external + * interrupts. i.e. the numbers seen by 'cat /proc/interrupt'. + */ +#define MICRODEV_LINUX_IRQ_KEYBOARD 1 /* SuperIO Keyboard */ +#define MICRODEV_LINUX_IRQ_SERIAL1 2 /* SuperIO Serial #1 */ +#define MICRODEV_LINUX_IRQ_ETHERNET 3 /* on-board Ethnernet */ +#define MICRODEV_LINUX_IRQ_SERIAL2 4 /* SuperIO Serial #2 */ +#define MICRODEV_LINUX_IRQ_USB_HC 7 /* on-board USB HC */ +#define MICRODEV_LINUX_IRQ_MOUSE 12 /* SuperIO PS/2 Mouse */ +#define MICRODEV_LINUX_IRQ_IDE2 13 /* SuperIO IDE #2 */ +#define MICRODEV_LINUX_IRQ_IDE1 14 /* SuperIO IDE #1 */ + +/* + * The following are the IRQ numbers for the INTC on the FPGA for + * external interrupts. i.e. the bits in the INTC registers in the + * FPGA. + */ +#define MICRODEV_FPGA_IRQ_KEYBOARD 1 /* SuperIO Keyboard */ +#define MICRODEV_FPGA_IRQ_SERIAL1 3 /* SuperIO Serial #1 */ +#define MICRODEV_FPGA_IRQ_SERIAL2 4 /* SuperIO Serial #2 */ +#define MICRODEV_FPGA_IRQ_MOUSE 12 /* SuperIO PS/2 Mouse */ +#define MICRODEV_FPGA_IRQ_IDE1 14 /* SuperIO IDE #1 */ +#define MICRODEV_FPGA_IRQ_IDE2 15 /* SuperIO IDE #2 */ +#define MICRODEV_FPGA_IRQ_USB_HC 16 /* on-board USB HC */ +#define MICRODEV_FPGA_IRQ_ETHERNET 18 /* on-board Ethnernet */ + +#define MICRODEV_IRQ_PCI_INTA 8 +#define MICRODEV_IRQ_PCI_INTB 9 +#define MICRODEV_IRQ_PCI_INTC 10 +#define MICRODEV_IRQ_PCI_INTD 11 + +#define __IO_PREFIX microdev +#include + +#if defined(CONFIG_PCI) +unsigned char microdev_pci_inb(unsigned long port); +unsigned short microdev_pci_inw(unsigned long port); +unsigned long microdev_pci_inl(unsigned long port); +void microdev_pci_outb(unsigned char data, unsigned long port); +void microdev_pci_outw(unsigned short data, unsigned long port); +void microdev_pci_outl(unsigned long data, unsigned long port); +#endif + +#endif /* __ASM_SH_MICRODEV_H */ diff --git a/include/asm-sh/microdev/io.h b/include/asm-sh/microdev/io.h deleted file mode 100644 index f2ca4ac8c88..00000000000 --- a/include/asm-sh/microdev/io.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * linux/include/asm-sh/io_microdev.h - * - * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com) - * - * IO functions for the SuperH SH4-202 MicroDev board. - * - * May be copied or modified under the terms of the GNU General Public - * License. See linux/COPYING for more information. - * - */ - - -#ifndef _ASM_SH_IO_MICRODEV_H -#define _ASM_SH_IO_MICRODEV_H - -extern unsigned long microdev_isa_port2addr(unsigned long offset); - -extern unsigned char microdev_inb(unsigned long port); -extern unsigned short microdev_inw(unsigned long port); -extern unsigned int microdev_inl(unsigned long port); - -extern void microdev_outb(unsigned char value, unsigned long port); -extern void microdev_outw(unsigned short value, unsigned long port); -extern void microdev_outl(unsigned int value, unsigned long port); - -extern unsigned char microdev_inb_p(unsigned long port); -extern unsigned short microdev_inw_p(unsigned long port); -extern unsigned int microdev_inl_p(unsigned long port); - -extern void microdev_outb_p(unsigned char value, unsigned long port); -extern void microdev_outw_p(unsigned short value, unsigned long port); -extern void microdev_outl_p(unsigned int value, unsigned long port); - -extern void microdev_insb(unsigned long port, void *addr, unsigned long count); -extern void microdev_insw(unsigned long port, void *addr, unsigned long count); -extern void microdev_insl(unsigned long port, void *addr, unsigned long count); - -extern void microdev_outsb(unsigned long port, const void *addr, unsigned long count); -extern void microdev_outsw(unsigned long port, const void *addr, unsigned long count); -extern void microdev_outsl(unsigned long port, const void *addr, unsigned long count); - -#if defined(CONFIG_PCI) -extern unsigned char microdev_pci_inb(unsigned long port); -extern unsigned short microdev_pci_inw(unsigned long port); -extern unsigned long microdev_pci_inl(unsigned long port); -extern void microdev_pci_outb(unsigned char data, unsigned long port); -extern void microdev_pci_outw(unsigned short data, unsigned long port); -extern void microdev_pci_outl(unsigned long data, unsigned long port); -#endif - -#endif /* _ASM_SH_IO_MICRODEV_H */ - diff --git a/include/asm-sh/microdev/irq.h b/include/asm-sh/microdev/irq.h deleted file mode 100644 index 47f6f77a65f..00000000000 --- a/include/asm-sh/microdev/irq.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * linux/include/asm-sh/irq_microdev.h - * - * Copyright (C) 2003 Sean McGoogan (Sean.McGoogan@superh.com) - * - * IRQ functions for the SuperH SH4-202 MicroDev board. - * - * May be copied or modified under the terms of the GNU General Public - * License. See linux/COPYING for more information. - * - */ - - -#ifndef _ASM_SH_IRQ_MICRODEV_H -#define _ASM_SH_IRQ_MICRODEV_H - -extern void init_microdev_irq(void); -extern void microdev_print_fpga_intc_status(void); - - - /* - * The following are useful macros for manipulating the - * interrupt controller (INTC) on the CPU-board FPGA. - * It should be noted that there is an INTC on the FPGA, - * and a seperate INTC on the SH4-202 core - these are - * two different things, both of which need to be prorammed - * to correctly route - unfortunately, they have the - * same name and abbreviations! - */ -#define MICRODEV_FPGA_INTC_BASE 0xa6110000ul /* INTC base address on CPU-board FPGA */ -#define MICRODEV_FPGA_INTENB_REG (MICRODEV_FPGA_INTC_BASE+0ul) /* Interrupt Enable Register on INTC on CPU-board FPGA */ -#define MICRODEV_FPGA_INTDSB_REG (MICRODEV_FPGA_INTC_BASE+8ul) /* Interrupt Disable Register on INTC on CPU-board FPGA */ -#define MICRODEV_FPGA_INTC_MASK(n) (1ul<<(n)) /* Interupt mask to enable/disable INTC in CPU-board FPGA */ -#define MICRODEV_FPGA_INTPRI_REG(n) (MICRODEV_FPGA_INTC_BASE+0x10+((n)/8)*8)/* Interrupt Priority Register on INTC on CPU-board FPGA */ -#define MICRODEV_FPGA_INTPRI_LEVEL(n,x) ((x)<<(((n)%8)*4)) /* MICRODEV_FPGA_INTPRI_LEVEL(int_number, int_level) */ -#define MICRODEV_FPGA_INTPRI_MASK(n) (MICRODEV_FPGA_INTPRI_LEVEL((n),0xful)) /* Interrupt Priority Mask on INTC on CPU-board FPGA */ -#define MICRODEV_FPGA_INTSRC_REG (MICRODEV_FPGA_INTC_BASE+0x30ul) /* Interrupt Source Register on INTC on CPU-board FPGA */ -#define MICRODEV_FPGA_INTREQ_REG (MICRODEV_FPGA_INTC_BASE+0x38ul) /* Interrupt Request Register on INTC on CPU-board FPGA */ - - - /* - * The following are the IRQ numbers for the Linux Kernel for external interrupts. - * i.e. the numbers seen by 'cat /proc/interrupt'. - */ -#define MICRODEV_LINUX_IRQ_KEYBOARD 1 /* SuperIO Keyboard */ -#define MICRODEV_LINUX_IRQ_SERIAL1 2 /* SuperIO Serial #1 */ -#define MICRODEV_LINUX_IRQ_ETHERNET 3 /* on-board Ethnernet */ -#define MICRODEV_LINUX_IRQ_SERIAL2 4 /* SuperIO Serial #2 */ -#define MICRODEV_LINUX_IRQ_USB_HC 7 /* on-board USB HC */ -#define MICRODEV_LINUX_IRQ_MOUSE 12 /* SuperIO PS/2 Mouse */ -#define MICRODEV_LINUX_IRQ_IDE2 13 /* SuperIO IDE #2 */ -#define MICRODEV_LINUX_IRQ_IDE1 14 /* SuperIO IDE #1 */ - - /* - * The following are the IRQ numbers for the INTC on the FPGA for external interrupts. - * i.e. the bits in the INTC registers in the FPGA. - */ -#define MICRODEV_FPGA_IRQ_KEYBOARD 1 /* SuperIO Keyboard */ -#define MICRODEV_FPGA_IRQ_SERIAL1 3 /* SuperIO Serial #1 */ -#define MICRODEV_FPGA_IRQ_SERIAL2 4 /* SuperIO Serial #2 */ -#define MICRODEV_FPGA_IRQ_MOUSE 12 /* SuperIO PS/2 Mouse */ -#define MICRODEV_FPGA_IRQ_IDE1 14 /* SuperIO IDE #1 */ -#define MICRODEV_FPGA_IRQ_IDE2 15 /* SuperIO IDE #2 */ -#define MICRODEV_FPGA_IRQ_USB_HC 16 /* on-board USB HC */ -#define MICRODEV_FPGA_IRQ_ETHERNET 18 /* on-board Ethnernet */ - -#define MICRODEV_IRQ_PCI_INTA 8 -#define MICRODEV_IRQ_PCI_INTB 9 -#define MICRODEV_IRQ_PCI_INTC 10 -#define MICRODEV_IRQ_PCI_INTD 11 - -#endif /* _ASM_SH_IRQ_MICRODEV_H */ -- cgit v1.2.3 From 091904ae5fc6f018680f83d71301ceac4f39d77f Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 1 Feb 2006 03:06:01 -0800 Subject: [PATCH] sh: Move TRA/EXPEVT/INTEVT definitions for reuse Currently entry.S is home to these definitions, so we move them somewhere more sensible. IPR IRQ handling depends on being to read from INTEVT. Signed-off-by: Paul Mundt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-sh/cpu-sh3/mmu_context.h | 10 ++++++++++ include/asm-sh/cpu-sh4/mmu_context.h | 8 ++++++++ 2 files changed, 18 insertions(+) (limited to 'include') diff --git a/include/asm-sh/cpu-sh3/mmu_context.h b/include/asm-sh/cpu-sh3/mmu_context.h index 5cfaa6bcf1e..a844ea0965b 100644 --- a/include/asm-sh/cpu-sh3/mmu_context.h +++ b/include/asm-sh/cpu-sh3/mmu_context.h @@ -24,5 +24,15 @@ #define MMU_NTLB_WAYS 4 #define MMU_CONTROL_INIT 0x007 /* SV=0, TF=1, IX=1, AT=1 */ +#define TRA 0xffffffd0 +#define EXPEVT 0xffffffd4 + +#if defined(CONFIG_CPU_SUBTYPE_SH7707) || defined(CONFIG_CPU_SUBTYPE_SH7709) || \ + defined(CONFIG_CPU_SUBTYPE_SH7300) || defined(CONFIG_CPU_SUBTYPE_SH7705) +#define INTEVT 0xa4000000 /* INTEVTE2(0xa4000000) */ +#else +#define INTEVT 0xffffffd8 +#endif + #endif /* __ASM_CPU_SH3_MMU_CONTEXT_H */ diff --git a/include/asm-sh/cpu-sh4/mmu_context.h b/include/asm-sh/cpu-sh4/mmu_context.h index 5b64d041f0b..ff4c5fbbfaf 100644 --- a/include/asm-sh/cpu-sh4/mmu_context.h +++ b/include/asm-sh/cpu-sh4/mmu_context.h @@ -23,7 +23,11 @@ #define MMU_PAGE_ASSOC_BIT 0x80 #define MMU_NTLB_ENTRIES 64 /* for 7750 */ +#ifdef CONFIG_SH_STORE_QUEUES +#define MMU_CONTROL_INIT 0x05 /* SQMD=0, SV=0, TI=1, AT=1 */ +#else #define MMU_CONTROL_INIT 0x205 /* SQMD=1, SV=0, TI=1, AT=1 */ +#endif #define MMU_ITLB_DATA_ARRAY 0xF3000000 #define MMU_UTLB_DATA_ARRAY 0xF7000000 @@ -35,5 +39,9 @@ #define MMU_I_ENTRY_SHIFT 8 #define MMU_ITLB_VALID 0x100 +#define TRA 0xff000020 +#define EXPEVT 0xff000024 +#define INTEVT 0xff000028 + #endif /* __ASM_CPU_SH4_MMU_CONTEXT_H */ -- cgit v1.2.3 From de02797aa744c96a90f47be7bc081ce2f74b17fd Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 1 Feb 2006 03:06:02 -0800 Subject: [PATCH] sh: Cleanup struct sh_cpuinfo for clock framework changes Now that the clock framework changes have been integrated, the manual clock accounting that was done in sh_cpuinfo can be dropped. Also correct a bug with running past the end of the CPU flags when there's a mismatch between the added flags and printed ones. Signed-off-by: Paul Mundt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-sh/processor.h | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'include') diff --git a/include/asm-sh/processor.h b/include/asm-sh/processor.h index c4904797d6d..fa5bd2d8803 100644 --- a/include/asm-sh/processor.h +++ b/include/asm-sh/processor.h @@ -12,7 +12,6 @@ #include #include #include -#include #include /* @@ -30,7 +29,7 @@ * CPU type and hardware bug flags. Kept separately for each CPU. * * Each one of these also needs a CONFIG_CPU_SUBTYPE_xxx entry - * in arch/sh/Kconfig, as well as an entry in arch/sh/kernel/setup.c + * in arch/sh/mm/Kconfig, as well as an entry in arch/sh/kernel/setup.c * for parsing the subtype in get_cpu_subtype(). */ enum cpu_type { @@ -44,7 +43,7 @@ enum cpu_type { /* SH-4 types */ CPU_SH7750, CPU_SH7750S, CPU_SH7750R, CPU_SH7751, CPU_SH7751R, CPU_SH7760, CPU_ST40RA, CPU_ST40GX1, CPU_SH4_202, CPU_SH4_501, - CPU_SH73180, + CPU_SH73180, CPU_SH7770, CPU_SH7780, CPU_SH7781, /* Unknown subtype */ CPU_SH_NONE @@ -52,14 +51,8 @@ enum cpu_type { struct sh_cpuinfo { enum cpu_type type; - char hard_math; unsigned long loops_per_jiffy; - unsigned int cpu_clock, master_clock, bus_clock, module_clock; -#ifdef CONFIG_CPU_SUBTYPE_ST40STB1 - unsigned int memory_clock; -#endif - struct cache_info icache; struct cache_info dcache; @@ -131,7 +124,7 @@ union sh_fpu_union { struct sh_fpu_soft_struct soft; }; -/* +/* * Processor flags */ @@ -140,6 +133,7 @@ union sh_fpu_union { #define CPU_HAS_MMU_PAGE_ASSOC 0x0004 /* SH3: TLB way selection bit support */ #define CPU_HAS_DSP 0x0008 /* SH-DSP: DSP support */ #define CPU_HAS_PERF_COUNTER 0x0010 /* Hardware performance counters */ +#define CPU_HAS_PTEA 0x0020 /* PTEA register */ struct thread_struct { unsigned long sp; @@ -160,10 +154,10 @@ extern int ubc_usercnt; #define INIT_THREAD { \ sizeof(init_stack) + (long) &init_stack, /* sp */ \ 0, /* pc */ \ - 0, 0, \ - 0, \ - 0, \ - {{{0,}},} /* fpu state */ \ + 0, 0, \ + 0, \ + 0, \ + {{{0,}},} /* fpu state */ \ } /* @@ -171,7 +165,7 @@ extern int ubc_usercnt; */ #define start_thread(regs, new_pc, new_sp) \ set_fs(USER_DS); \ - regs->pr = 0; \ + regs->pr = 0; \ regs->sr = SR_FD; /* User mode. */ \ regs->pc = new_pc; \ regs->regs[15] = new_sp @@ -239,16 +233,16 @@ extern void save_fpu(struct task_struct *__tsk, struct pt_regs *regs); #define save_fpu(tsk) do { } while (0) #endif -#define unlazy_fpu(tsk, regs) do { \ +#define unlazy_fpu(tsk, regs) do { \ if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \ - save_fpu(tsk, regs); \ + save_fpu(tsk, regs); \ } \ } while (0) -#define clear_fpu(tsk, regs) do { \ - if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \ - clear_tsk_thread_flag(tsk, TIF_USEDFPU); \ - release_fpu(regs); \ +#define clear_fpu(tsk, regs) do { \ + if (test_tsk_thread_flag(tsk, TIF_USEDFPU)) { \ + clear_tsk_thread_flag(tsk, TIF_USEDFPU); \ + release_fpu(regs); \ } \ } while (0) -- cgit v1.2.3 From 8d27e08191379b7a3302a33a6efdb8bdfd319c95 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 1 Feb 2006 03:06:04 -0800 Subject: [PATCH] sh: drop maskpos from make_ipr_irq(), remove duplicate irq definitions Clean up some of the subtype IRQ definitions for IPR IRQ, and consolidate the make_ipr_irq() definitions by dropping maskpos. SH-4A was the only thing interested in the maskpos, and this should be handled through INTC2 rather than IPR. Signed-off-by: Paul Mundt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-sh/irq-sh73180.h | 36 +----------------------------------- include/asm-sh/irq-sh7780.h | 23 ----------------------- include/asm-sh/irq.h | 10 ++++++++-- 3 files changed, 9 insertions(+), 60 deletions(-) (limited to 'include') diff --git a/include/asm-sh/irq-sh73180.h b/include/asm-sh/irq-sh73180.h index bf2e4310ffa..d705252be26 100644 --- a/include/asm-sh/irq-sh73180.h +++ b/include/asm-sh/irq-sh73180.h @@ -25,11 +25,6 @@ #undef DMA_IPR_POS #undef DMA_PRIORITY -#undef NR_IRQS - -#undef __irq_demux -#undef irq_demux - #undef INTC_IMCR0 #undef INTC_IMCR1 #undef INTC_IMCR2 @@ -229,33 +224,6 @@ #define SIU_IPR_POS 1 #define SIU_PRIORITY 3 - -/* ONCHIP_NR_IRQS */ -#define NR_IRQS 109 - -/* In a generic kernel, NR_IRQS is an upper bound, and we should use - * ACTUAL_NR_IRQS (which uses the machine vector) to get the correct value. - */ -#define ACTUAL_NR_IRQS NR_IRQS - - -extern void disable_irq(unsigned int); -extern void disable_irq_nosync(unsigned int); -extern void enable_irq(unsigned int); - -/* - * Simple Mask Register Support - */ -extern void make_maskreg_irq(unsigned int irq); -extern unsigned short *irq_mask_register; - -/* - * Function for "on chip support modules". - */ -extern void make_ipr_irq(unsigned int irq, unsigned int addr, - int pos, int priority); -extern void make_imask_irq(unsigned int irq); - #define PORT_PACR 0xA4050100UL #define PORT_PBCR 0xA4050102UL #define PORT_PCCR 0xA4050104UL @@ -343,8 +311,6 @@ extern void make_imask_irq(unsigned int irq); #define IRQ6_PRIORITY 1 #define IRQ7_PRIORITY 1 -extern int shmse_irq_demux(int irq); -#define __irq_demux(irq) shmse_irq_demux(irq) -#define irq_demux(irq) __irq_demux(irq) +int shmse_irq_demux(int irq); #endif /* __ASM_SH_IRQ_SH73180_H */ diff --git a/include/asm-sh/irq-sh7780.h b/include/asm-sh/irq-sh7780.h index 8c8ca128108..7f90315cd83 100644 --- a/include/asm-sh/irq-sh7780.h +++ b/include/asm-sh/irq-sh7780.h @@ -299,29 +299,6 @@ #define GPIO_IPR_POS 2 #define GPIO_PRIORITY 3 -/* ONCHIP_NR_IRQS */ -#define NR_IRQS 150 /* 111 + 16 */ - -/* In a generic kernel, NR_IRQS is an upper bound, and we should use - * ACTUAL_NR_IRQS (which uses the machine vector) to get the correct value. - */ -#define ACTUAL_NR_IRQS NR_IRQS - -extern void disable_irq(unsigned int); -extern void disable_irq_nosync(unsigned int); -extern void enable_irq(unsigned int); - -/* - * Simple Mask Register Support - */ -extern void make_maskreg_irq(unsigned int irq); -extern unsigned short *irq_mask_register; - -/* - * Function for "on chip support modules". - */ -extern void make_imask_irq(unsigned int irq); - #define INTC_TMU0_MSK 0 #define INTC_TMU3_MSK 1 #define INTC_RTC_MSK 2 diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h index 060ec3c2720..42b8394c04e 100644 --- a/include/asm-sh/irq.h +++ b/include/asm-sh/irq.h @@ -245,6 +245,7 @@ #endif /* ST40STB1 */ #endif /* 775x / SH4-202 / ST40STB1 */ +#endif /* 7780 */ /* NR_IRQS is made from three components: * 1. ONCHIP_NR_IRQS - number of IRLS + on-chip peripherial modules @@ -274,8 +275,11 @@ # define ONCHIP_NR_IRQS 72 #elif defined(CONFIG_CPU_SUBTYPE_ST40STB1) # define ONCHIP_NR_IRQS 144 -#elif defined(CONFIG_CPU_SUBTYPE_SH7300) +#elif defined(CONFIG_CPU_SUBTYPE_SH7300) || \ + defined(CONFIG_CPU_SUBTYPE_SH73180) # define ONCHIP_NR_IRQS 109 +#elif defined(CONFIG_CPU_SUBTYPE_SH7780) +# define ONCHIP_NR_IRQS 111 #elif defined(CONFIG_SH_UNKNOWN) /* Most be last */ # define ONCHIP_NR_IRQS 144 #endif @@ -306,6 +310,8 @@ # define OFFCHIP_NR_IRQS 96 #elif defined (CONFIG_SH_TITAN) # define OFFCHIP_NR_IRQS 4 +#elif defined(CONFIG_SH_R7780RP) +# define OFFCHIP_NR_IRQS 16 #elif defined(CONFIG_SH_UNKNOWN) # define OFFCHIP_NR_IRQS 16 /* Must also be last */ #else @@ -550,7 +556,7 @@ extern int ipr_irq_demux(int irq); #define INTC_ICR_IRLM (1<<7) #endif -#else +#ifdef CONFIG_CPU_SUBTYPE_SH7780 #include #endif -- cgit v1.2.3 From 37cc7943788c841b03a48c00751dfac0ad9f5b12 Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 1 Feb 2006 03:06:05 -0800 Subject: [PATCH] sh: convert voyagergx to platform device, drop sh-bus Trivial patch updating the voyagergx cchip code to reference a platform device instead, now that the dma mask is taken care of. Given this, there's no longer any reason to drag around the SH-bus code, so kill that off entirely. Signed-off-by: Manuel Lauss Signed-off-by: Paul Mundt Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-sh/bus-sh.h | 66 ------------------------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 include/asm-sh/bus-sh.h (limited to 'include') diff --git a/include/asm-sh/bus-sh.h b/include/asm-sh/bus-sh.h deleted file mode 100644 index e42d63b65cb..00000000000 --- a/include/asm-sh/bus-sh.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * include/asm-sh/bus-sh.h - * - * Copyright (C) 2004 Paul Mundt - * - * 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. - */ -#ifndef __ASM_SH_BUS_SH_H -#define __ASM_SH_BUS_SH_H - -extern struct bus_type sh_bus_types[]; - -struct sh_dev { - struct device dev; - char *name; - unsigned int dev_id; - unsigned int bus_id; - struct resource res; - void *mapbase; - unsigned int irq[6]; - u64 *dma_mask; - u64 coherent_dma_mask; -}; - -#define to_sh_dev(d) container_of((d), struct sh_dev, dev) - -#define sh_get_drvdata(d) dev_get_drvdata(&(d)->dev) -#define sh_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p)) - -struct sh_driver { - struct device_driver drv; - unsigned int dev_id; - unsigned int bus_id; - int (*probe)(struct sh_dev *); - int (*remove)(struct sh_dev *); - int (*suspend)(struct sh_dev *, pm_message_t); - int (*resume)(struct sh_dev *); -}; - -#define to_sh_driver(d) container_of((d), struct sh_driver, drv) -#define sh_name(d) ((d)->dev.driver->name) - -/* - * Device ID numbers for bus types - */ -enum { - SH_DEV_ID_USB_OHCI, -}; - -#define SH_NR_BUSES 1 -#define SH_BUS_NAME_VIRT "shbus" - -enum { - SH_BUS_VIRT, -}; - -/* arch/sh/kernel/cpu/bus.c */ -extern int sh_device_register(struct sh_dev *dev); -extern void sh_device_unregister(struct sh_dev *dev); -extern int sh_driver_register(struct sh_driver *drv); -extern void sh_driver_unregister(struct sh_driver *drv); - -#endif /* __ASM_SH_BUS_SH_H */ - -- cgit v1.2.3 From 87f55e67dc1be000fa76009532906b168a80b3dd Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 1 Feb 2006 03:06:09 -0800 Subject: [PATCH] sh/sh64: Fix bogus TIOCGICOUNT definitions As reported by Russell King, sh and sh64 currently have bogus definitions for TIOCGICOUNT, particularly referencing a kernel only structure. Switch to using a sensible ioctl value. Signed-off-by: Paul Mundt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-sh/ioctls.h | 2 +- include/asm-sh64/ioctls.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-sh/ioctls.h b/include/asm-sh/ioctls.h index 1866f3f9002..9d84a2d445a 100644 --- a/include/asm-sh/ioctls.h +++ b/include/asm-sh/ioctls.h @@ -94,6 +94,6 @@ #define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* 0x545B */ /* Set multiport config */ #define TIOCMIWAIT _IO('T', 92) /* 0x545C */ /* wait for a change on serial input line(s) */ -#define TIOCGICOUNT _IOR('T', 93, struct async_icount) /* 0x545D */ /* read serial port inline interrupt counts */ +#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ #endif /* __ASM_SH_IOCTLS_H */ diff --git a/include/asm-sh64/ioctls.h b/include/asm-sh64/ioctls.h index 08f3c1f2e41..6b0c04f63c5 100644 --- a/include/asm-sh64/ioctls.h +++ b/include/asm-sh64/ioctls.h @@ -111,6 +111,6 @@ #define TIOCSERSETMULTI 0x40a8545b /* _IOW('T', 91, struct serial_multiport_struct) 0x545B */ /* Set multiport config */ #define TIOCMIWAIT 0x545c /* _IO('T', 92) wait for a change on serial input line(s) */ -#define TIOCGICOUNT 0x802c545d /* _IOR('T', 93, struct async_icount) 0x545D */ /* read serial port inline interrupt counts */ +#define TIOCGICOUNT 0x545d /* read serial port inline interrupt counts */ #endif /* __ASM_SH64_IOCTLS_H */ -- cgit v1.2.3 From 975b3d3d5b983eb60706d35f0d24cd19f6badabf Mon Sep 17 00:00:00 2001 From: Mark Lord Date: Wed, 1 Feb 2006 03:06:11 -0800 Subject: [PATCH] VMSPLIT config options Enable selection of different user/kernel VM splits for i386, including an optimized mode for 1GB physical RAM, which gives the kernel a direct (non HIGHMEM) mapping to the entire 1GB rather than just the first 896MB. There is a similarly a similarly optimized mode for machines with exactly 2GB of physical RAM. This can speed up the kernel by avoiding having to create/destroy temporary HIGHMEM mappings, and by not having to include HIGHMEM support at all on such machines. The flip side is that there's less virtual addressing left for userspace in these alternatives, and some binary-only kernel modules may misbehave unless rebuilt with the same VMSPLIT option as the main kernel image. Original idea/patch from Jens Axboe, modified based on suggestions from Linus et al. Signed-off-by: Mark Lord Signed-off-by: Jens Axboe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/page.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h index 73296d9924f..997ca5d1787 100644 --- a/include/asm-i386/page.h +++ b/include/asm-i386/page.h @@ -110,10 +110,10 @@ extern int page_is_ram(unsigned long pagenr); #endif /* __ASSEMBLY__ */ #ifdef __ASSEMBLY__ -#define __PAGE_OFFSET (0xC0000000) +#define __PAGE_OFFSET CONFIG_PAGE_OFFSET #define __PHYSICAL_START CONFIG_PHYSICAL_START #else -#define __PAGE_OFFSET (0xC0000000UL) +#define __PAGE_OFFSET ((unsigned long)CONFIG_PAGE_OFFSET) #define __PHYSICAL_START ((unsigned long)CONFIG_PHYSICAL_START) #endif #define __KERNEL_START (__PAGE_OFFSET + __PHYSICAL_START) -- cgit v1.2.3 From a1320ae31b40df06fd7deec94b5369a11b0ec25c Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 1 Feb 2006 03:06:14 -0800 Subject: [PATCH] arm26: fix find_first_zero_bit related warnings include/linux/nodemask.h: In function `__first_unset_node': include/linux/nodemask.h:254: warning: passing arg 1 of `_find_first_zero_bit_le' discards qualifiers from pointer target type fs/minix/bitmap.c: In function `minix_new_block': fs/minix/bitmap.c:89: warning: passing arg 1 of `_find_first_zero_bit_le' from incompatible pointer type Signed-off-by: Alexey Dobriyan Acked-by: Ian Molton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm26/bitops.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-arm26/bitops.h b/include/asm-arm26/bitops.h index 15cc6f2da79..d87f8634e62 100644 --- a/include/asm-arm26/bitops.h +++ b/include/asm-arm26/bitops.h @@ -186,7 +186,7 @@ extern void _change_bit_le(int nr, volatile unsigned long * p); extern int _test_and_set_bit_le(int nr, volatile unsigned long * p); extern int _test_and_clear_bit_le(int nr, volatile unsigned long * p); extern int _test_and_change_bit_le(int nr, volatile unsigned long * p); -extern int _find_first_zero_bit_le(void * p, unsigned size); +extern int _find_first_zero_bit_le(const unsigned long * p, unsigned size); extern int _find_next_zero_bit_le(void * p, int size, int offset); extern int _find_first_bit_le(const unsigned long *p, unsigned size); extern int _find_next_bit_le(const unsigned long *p, int size, int offset); @@ -326,7 +326,7 @@ static inline int sched_find_first_bit(unsigned long *b) #define minix_test_and_clear_bit(nr,p) \ __test_and_clear_bit(WORD_BITOFF_TO_LE(nr), (unsigned long *)(p)) #define minix_find_first_zero_bit(p,sz) \ - _find_first_zero_bit_le(p,sz) + _find_first_zero_bit_le((unsigned long *)(p),sz) #endif /* __KERNEL__ */ -- cgit v1.2.3 From 19f03f75873aebb2fb7fb592b6223b9a38bb7ad3 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 1 Feb 2006 03:06:16 -0800 Subject: [PATCH] arm26: fix warnings about NR_IRQS being not defined Signed-off-by: Alexey Dobriyan Acked-by: Ian Molton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm26/hardirq.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-arm26/hardirq.h b/include/asm-arm26/hardirq.h index dc28daab8aa..9046c3c64a4 100644 --- a/include/asm-arm26/hardirq.h +++ b/include/asm-arm26/hardirq.h @@ -4,6 +4,7 @@ #include #include #include +#include typedef struct { unsigned int __softirq_pending; -- cgit v1.2.3 From 0679b75e5fb653fbf6691293e7fc45520abae1d7 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 1 Feb 2006 03:06:17 -0800 Subject: [PATCH] arm26: remove irq_exit() from hardirq.h Signed-off-by: Alexey Dobriyan Acked-by: Ian Molton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm26/hardirq.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include') diff --git a/include/asm-arm26/hardirq.h b/include/asm-arm26/hardirq.h index 9046c3c64a4..87c19d2bb6a 100644 --- a/include/asm-arm26/hardirq.h +++ b/include/asm-arm26/hardirq.h @@ -27,13 +27,6 @@ typedef struct { extern asmlinkage void __do_softirq(void); -#define irq_exit() \ - do { \ - preempt_count() -= IRQ_EXIT_OFFSET; \ - if (!in_interrupt() && local_softirq_pending()) \ - __do_softirq(); \ - preempt_enable_no_resched(); \ - } while (0) #endif -- cgit v1.2.3 From ae7a49666af427da745e69a39fcfdd3a8b4ab3e8 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 1 Feb 2006 03:06:20 -0800 Subject: [PATCH] arm26: drop local task_running copy Signed-off-by: Alexey Dobriyan Acked-by: Ian Molton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm26/system.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/asm-arm26/system.h b/include/asm-arm26/system.h index ca4ccfc4b57..71b89c4a3c3 100644 --- a/include/asm-arm26/system.h +++ b/include/asm-arm26/system.h @@ -100,7 +100,6 @@ extern unsigned int user_debug; */ #define prepare_arch_switch(rq,next) local_irq_enable() #define finish_arch_switch(rq,prev) spin_unlock(&(rq)->lock) -#define task_running(rq,p) ((rq)->curr == (p)) /* * switch_to(prev, next) should switch from task `prev' to `next' -- cgit v1.2.3 From 407c57b86237fc2512654fa2f2ceedda92684472 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 1 Feb 2006 03:06:20 -0800 Subject: [PATCH] arm26: drop first arg of prepare_arch_switch, finish_arch_switch Signed-off-by: Alexey Dobriyan Acked-by: Ian Molton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm26/system.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-arm26/system.h b/include/asm-arm26/system.h index 71b89c4a3c3..702884926a5 100644 --- a/include/asm-arm26/system.h +++ b/include/asm-arm26/system.h @@ -98,8 +98,8 @@ extern unsigned int user_debug; * spin_unlock_irq() and friends are implemented. This avoids * us needlessly decrementing and incrementing the preempt count. */ -#define prepare_arch_switch(rq,next) local_irq_enable() -#define finish_arch_switch(rq,prev) spin_unlock(&(rq)->lock) +#define prepare_arch_switch(next) local_irq_enable() +#define finish_arch_switch(prev) spin_unlock(&(rq)->lock) /* * switch_to(prev, next) should switch from task `prev' to `next' -- cgit v1.2.3 From 2fa63c4d0d89a3add74bf37f7768a79c1d39cb7a Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 1 Feb 2006 03:06:21 -0800 Subject: [PATCH] arm26: add __kernel_old_dev_t for nfsd Signed-off-by: Alexey Dobriyan Acked-by: Ian Molton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm26/posix_types.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-arm26/posix_types.h b/include/asm-arm26/posix_types.h index b88344ad390..f8d1eb4f4cb 100644 --- a/include/asm-arm26/posix_types.h +++ b/include/asm-arm26/posix_types.h @@ -44,6 +44,7 @@ typedef unsigned int __kernel_gid32_t; typedef unsigned short __kernel_old_uid_t; typedef unsigned short __kernel_old_gid_t; +typedef unsigned short __kernel_old_dev_t; #ifdef __GNUC__ typedef long long __kernel_loff_t; -- cgit v1.2.3 From 0c19585b0d2f6817dd9af607650d3f6cae2fd8bc Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Wed, 1 Feb 2006 03:06:24 -0800 Subject: [PATCH] uml: typo fixup Trivial innocent cosmetical fixup. Signed-off-by: Paolo 'Blaisorblade' Giarrusso Cc: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-um/ldt-x86_64.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-um/ldt-x86_64.h b/include/asm-um/ldt-x86_64.h index 175722a9116..57159f12dde 100644 --- a/include/asm-um/ldt-x86_64.h +++ b/include/asm-um/ldt-x86_64.h @@ -5,8 +5,8 @@ * Author: Bodo Stroesser */ -#ifndef __ASM_LDT_I386_H -#define __ASM_LDT_I386_H +#ifndef __ASM_LDT_X86_64_H +#define __ASM_LDT_X86_64_H #include "asm/semaphore.h" #include "asm/arch/ldt.h" -- cgit v1.2.3 From 4cd7ed94428babb0cdbf08cc14c257e223186079 Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Wed, 1 Feb 2006 03:06:28 -0800 Subject: [PATCH] uml: skas0-hold-own-ldt fixups for x86-64 In a recent fixup i386 code was copied raw to x86_64 subarch to make it compile again. Here there are some little fixups and resyncs needed for it (mainly for cleanliness sake) - I did an audit and found the rest of the code to be safe. Signed-off-by: Paolo 'Blaisorblade' Giarrusso Cc: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-um/ldt-x86_64.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-um/ldt-x86_64.h b/include/asm-um/ldt-x86_64.h index 57159f12dde..96b35aada79 100644 --- a/include/asm-um/ldt-x86_64.h +++ b/include/asm-um/ldt-x86_64.h @@ -39,11 +39,13 @@ typedef struct uml_ldt { } uml_ldt_t; /* - * macros stolen from include/asm-i386/desc.h + * macros stolen from include/asm-x86_64/desc.h */ #define LDT_entry_a(info) \ ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff)) +/* Don't allow setting of the lm bit. It is useless anyways because + * 64bit system calls require __USER_CS. */ #define LDT_entry_b(info) \ (((info)->base_addr & 0xff000000) | \ (((info)->base_addr & 0x00ff0000) >> 16) | \ @@ -54,6 +56,7 @@ typedef struct uml_ldt { ((info)->seg_32bit << 22) | \ ((info)->limit_in_pages << 23) | \ ((info)->useable << 20) | \ + /* ((info)->lm << 21) | */ \ 0x7000) #define LDT_empty(info) (\ @@ -64,6 +67,7 @@ typedef struct uml_ldt { (info)->seg_32bit == 0 && \ (info)->limit_in_pages == 0 && \ (info)->seg_not_present == 1 && \ - (info)->useable == 0 ) + (info)->useable == 0 && \ + (info)->lm == 0) #endif -- cgit v1.2.3 From 72e5525765ee01d72a9b92fab78ecea883ae7fdd Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Wed, 1 Feb 2006 03:06:29 -0800 Subject: [PATCH] uml: avoid "CONFIG_NR_CPUS undeclared" bogus error messages Olaf Hering Olaf reported UML doesn't build for him with a clear analisys of what happened - we're using NR_CPUS in files linked against glibc headers. Seems like it defines CONFIG_SMP but not CONFIG_NR_CPUS, so we get CONFIG_NR_CPUS undeclared. The fix is to move the declaration away from that header file and move it in asm-um headers, and to add that header where needed. Signed-off-by: Paolo 'Blaisorblade' Giarrusso Cc: Jeff Dike Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-um/smp.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/asm-um/smp.h b/include/asm-um/smp.h index d879eba2b52..aeda6657f36 100644 --- a/include/asm-um/smp.h +++ b/include/asm-um/smp.h @@ -23,6 +23,8 @@ extern inline void smp_cpus_done(unsigned int maxcpus) { } +extern struct task_struct *idle_threads[NR_CPUS]; + #endif #endif -- cgit v1.2.3 From 5ceba75f121004335616befd2045c8a6b75b2bc4 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Wed, 1 Feb 2006 03:06:30 -0800 Subject: [PATCH] xtensa: add asm/futex.h Signed-off-by: Alexey Dobriyan Cc: Chris Zankel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-xtensa/futex.h | 1 + 1 file changed, 1 insertion(+) create mode 100644 include/asm-xtensa/futex.h (limited to 'include') diff --git a/include/asm-xtensa/futex.h b/include/asm-xtensa/futex.h new file mode 100644 index 00000000000..0b745828f42 --- /dev/null +++ b/include/asm-xtensa/futex.h @@ -0,0 +1 @@ +#include -- cgit v1.2.3 From e018ba1fceee5bd306e31f6e3a60934d5f143ac5 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 1 Feb 2006 03:06:31 -0800 Subject: [PATCH] s390: Remove CVS generated information - Remove all CVS generated information like e.g. revision IDs from drivers/s390 and include/asm-s390 (none present in arch/s390). - Add newline at end of arch/s390/lib/Makefile to avoid diff message. Acked-by: Andreas Herrmann Acked-by: Frank Pavlic Signed-off-by: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-s390/dasd.h | 2 -- include/asm-s390/qdio.h | 2 -- 2 files changed, 4 deletions(-) (limited to 'include') diff --git a/include/asm-s390/dasd.h b/include/asm-s390/dasd.h index 77b10d6adab..1630c26e8f4 100644 --- a/include/asm-s390/dasd.h +++ b/include/asm-s390/dasd.h @@ -8,8 +8,6 @@ * any future changes wrt the API will result in a change of the APIVERSION reported * to userspace by the DASDAPIVER-ioctl * - * $Revision: 1.6 $ - * */ #ifndef DASD_H diff --git a/include/asm-s390/qdio.h b/include/asm-s390/qdio.h index 7bc15f0231d..a2f37a9353d 100644 --- a/include/asm-s390/qdio.h +++ b/include/asm-s390/qdio.h @@ -11,8 +11,6 @@ #ifndef __QDIO_H__ #define __QDIO_H__ -#define VERSION_QDIO_H "$Revision: 1.57 $" - /* note, that most of the typedef's are from ingo. */ #include -- cgit v1.2.3 From 54dfe5dd9abc547f63060d132dad2c024a47de1e Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 1 Feb 2006 03:06:38 -0800 Subject: [PATCH] s390: Add support for new syscalls/TIF_RESTORE_SIGMASK Add support for the new *at, pselect6 and ppoll system calls. This includes adding required support for TIF_RESTORE_SIGMASK. Signed-off-by: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-s390/thread_info.h | 6 +++--- include/asm-s390/unistd.h | 24 ++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/asm-s390/thread_info.h b/include/asm-s390/thread_info.h index f3797a52c4e..8e0c7ed73d0 100644 --- a/include/asm-s390/thread_info.h +++ b/include/asm-s390/thread_info.h @@ -2,7 +2,7 @@ * include/asm-s390/thread_info.h * * S390 version - * Copyright (C) 2002 IBM Deutschland Entwicklung GmbH, IBM Corporation + * Copyright (C) IBM Corp. 2002,2006 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com) */ @@ -88,7 +88,7 @@ static inline struct thread_info *current_thread_info(void) * thread information flags bit numbers */ #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ -#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ +#define TIF_RESTORE_SIGMASK 1 /* restore signal mask in do_signal() */ #define TIF_SIGPENDING 2 /* signal pending */ #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ #define TIF_RESTART_SVC 4 /* restart svc with new svc number */ @@ -102,7 +102,7 @@ static inline struct thread_info *current_thread_info(void) #define TIF_MEMDIE 19 #define _TIF_SYSCALL_TRACE (1< Date: Wed, 1 Feb 2006 03:06:43 -0800 Subject: [PATCH] reiserfs: remove kmalloc wrapper Remove kmalloc() wrapper from fs/reiserfs/. Please note that a reiserfs /proc entry format is changed because kmalloc statistics is removed. Signed-off-by: Pekka Enberg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/reiserfs_fs.h | 16 ---------------- include/linux/reiserfs_fs_sb.h | 1 - 2 files changed, 17 deletions(-) (limited to 'include') diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index e276c5ba2bb..7d51149bd79 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h @@ -1971,22 +1971,6 @@ extern struct file_operations reiserfs_file_operations; extern struct address_space_operations reiserfs_address_space_operations; /* fix_nodes.c */ -#ifdef CONFIG_REISERFS_CHECK -void *reiserfs_kmalloc(size_t size, gfp_t flags, struct super_block *s); -void reiserfs_kfree(const void *vp, size_t size, struct super_block *s); -#else -static inline void *reiserfs_kmalloc(size_t size, int flags, - struct super_block *s) -{ - return kmalloc(size, flags); -} - -static inline void reiserfs_kfree(const void *vp, size_t size, - struct super_block *s) -{ - kfree(vp); -} -#endif int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb, struct item_head *p_s_ins_ih, const void *); diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 3e68592e52e..31b4c0bd4fa 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h @@ -382,7 +382,6 @@ struct reiserfs_sb_info { on-disk FS format */ /* session statistics */ - int s_kmallocs; int s_disk_reads; int s_disk_writes; int s_fix_nodes; -- cgit v1.2.3 From c87d0c07ea198db1ce451421904edd60b7d385ee Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 1 Feb 2006 03:06:45 -0800 Subject: [PATCH] reiserfs: remove reiserfs_permission_locked This function is completely unused since the xattr permission checking changes. Remove it and fold __reiserfs_permission into reiserfs_permission. Signed-off-by: Christoph Hellwig Cc: Jeff Mahoney Cc: Chris Mason Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/reiserfs_xattr.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index c84354e8374..87280eb6083 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h @@ -43,8 +43,6 @@ int reiserfs_delete_xattrs(struct inode *inode); int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); int reiserfs_xattr_init(struct super_block *sb, int mount_flags); int reiserfs_permission(struct inode *inode, int mask, struct nameidata *nd); -int reiserfs_permission_locked(struct inode *inode, int mask, - struct nameidata *nd); int reiserfs_xattr_del(struct inode *, const char *); int reiserfs_xattr_get(const struct inode *, const char *, void *, size_t); -- cgit v1.2.3 From 16fb24252a8170799e7adf14d8fc31b817fcaf53 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Wed, 1 Feb 2006 12:18:22 -0500 Subject: NLM: Fix arguments to NLM_CANCEL call The OpenGroup docs state that the arguments "block", "exclusive" and "alock" must exactly match the arguments for the lock call that we are trying to cancel. Currently, "block" is always set to false, which is wrong. See bug# 5956 on bugzilla.kernel.org. Signed-off-by: Trond Myklebust --- include/linux/lockd/lockd.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 95c8fea293b..afe9a8f5c5a 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h @@ -148,7 +148,6 @@ struct nlm_rqst * nlmclnt_alloc_call(void); int nlmclnt_prepare_block(struct nlm_rqst *req, struct nlm_host *host, struct file_lock *fl); void nlmclnt_finish_block(struct nlm_rqst *req); long nlmclnt_block(struct nlm_rqst *req, long timeout); -int nlmclnt_cancel(struct nlm_host *, struct file_lock *); u32 nlmclnt_grant(struct nlm_lock *); void nlmclnt_recovery(struct nlm_host *, u32); int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); -- cgit v1.2.3 From aaaa99423b4b1f9cfd33ea5643d9274c25f62491 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Wed, 1 Feb 2006 12:18:25 -0500 Subject: NLM: Ensure that nlmclnt_cancel_callback() doesn't loop forever If the server returns NLM_LCK_DENIED_NOLOCKS, we currently retry the entire NLM_CANCEL request. This may end up looping forever unless the server changes its mind (why would it do that, though?). Ensure that we limit the number of retries (to 3). See bug# 5957 in bugzilla.kernel.org. Signed-off-by: Trond Myklebust --- include/linux/lockd/lockd.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index afe9a8f5c5a..920766cea79 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h @@ -84,6 +84,7 @@ struct nlm_rqst { struct nlm_args a_args; /* arguments */ struct nlm_res a_res; /* result */ struct nlm_wait * a_block; + unsigned int a_retries; /* Retry count */ char a_owner[NLMCLNT_OHSIZE]; }; -- cgit v1.2.3 From 8a3177604b729ec3b80e43790ee978863ac7551b Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Wed, 1 Feb 2006 12:18:36 -0500 Subject: SUNRPC: Fix a lock recursion in the auth_gss downcall When we look up a new cred in the auth_gss downcall so that we can stuff the credcache, we do not want that lookup to queue up an upcall in order to initialise it. To do an upcall here not only redundant, but since we are already holding the inode->i_mutex, it will trigger a lock recursion. This patch allows rpcauth cache searches to indicate that they can cope with uninitialised credentials. Signed-off-by: Trond Myklebust --- include/linux/sunrpc/auth.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index b68c11a2d6d..bfc5fb27953 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h @@ -50,6 +50,7 @@ struct rpc_cred { }; #define RPCAUTH_CRED_LOCKED 0x0001 #define RPCAUTH_CRED_UPTODATE 0x0002 +#define RPCAUTH_CRED_NEW 0x0004 #define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 @@ -87,6 +88,10 @@ struct rpc_auth { * uid/gid, fs[ug]id, gids) */ +/* Flags for rpcauth_lookupcred() */ +#define RPCAUTH_LOOKUP_NEW 0x01 /* Accept an uninitialised cred */ +#define RPCAUTH_LOOKUP_ROOTCREDS 0x02 /* This really ought to go! */ + /* * Client authentication ops */ -- cgit v1.2.3 From fba3bad488a2eec2d76c067edb7a5ff92ef42431 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Wed, 1 Feb 2006 12:19:27 -0500 Subject: SUNRPC: Move upcall out of auth->au_ops->crcreate() This fixes a bug whereby if two processes try to look up the same auth_gss credential, they may end up creating two creds, and triggering two upcalls because the upcall is performed before the credential is added to the credcache. Signed-off-by: Trond Myklebust --- include/linux/sunrpc/auth.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index bfc5fb27953..2647798b72c 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h @@ -110,6 +110,7 @@ struct rpc_authops { struct rpc_credops { const char * cr_name; /* Name of the auth flavour */ + int (*cr_init)(struct rpc_auth *, struct rpc_cred *); void (*crdestroy)(struct rpc_cred *); int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); -- cgit v1.2.3 From 00b464debf0038b1628996065f0be564ccfbfd86 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Wed, 1 Feb 2006 12:49:28 -0500 Subject: SUNRPC: Remove obsolete rpcauth #defines RPCAUTH_CRED_LOCKED, and RPC_AUTH_PROC_CREDS are unused. Kill them. Signed-off-by: Trond Myklebust --- include/linux/sunrpc/auth.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'include') diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index 2647798b72c..be4772ed43c 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h @@ -48,9 +48,8 @@ struct rpc_cred { /* per-flavor data */ }; -#define RPCAUTH_CRED_LOCKED 0x0001 +#define RPCAUTH_CRED_NEW 0x0001 #define RPCAUTH_CRED_UPTODATE 0x0002 -#define RPCAUTH_CRED_NEW 0x0004 #define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 @@ -84,9 +83,6 @@ struct rpc_auth { struct rpc_cred_cache * au_credcache; /* per-flavor data */ }; -#define RPC_AUTH_PROC_CREDS 0x0010 /* process creds (including - * uid/gid, fs[ug]id, gids) - */ /* Flags for rpcauth_lookupcred() */ #define RPCAUTH_LOOKUP_NEW 0x01 /* Accept an uninitialised cred */ -- cgit v1.2.3 From 62500d1f8eadff078cca462dc4df035a29180383 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Wed, 1 Feb 2006 19:26:00 +0000 Subject: [ARM] 3292/1: Fix memory corruption in asm-arm/checksum.h: ip_fast_csum() Patch from Richard Purdie ip_fast_csum() accesses memory via a pointer (iph) within an asm function. To prevent memory corruption when the function is inlined, it needs "memory" on the clobber list. This fixes ip checksum errors reported by a Zaurus user. Signed-off-by: Richard Purdie Signed-off-by: Russell King --- include/asm-arm/checksum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-arm/checksum.h b/include/asm-arm/checksum.h index d4256d5f3a7..747bdd31a74 100644 --- a/include/asm-arm/checksum.h +++ b/include/asm-arm/checksum.h @@ -77,7 +77,7 @@ ip_fast_csum(unsigned char * iph, unsigned int ihl) mov %0, %0, lsr #16" : "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1) : "1" (iph), "2" (ihl) - : "cc"); + : "cc", "memory"); return sum; } -- cgit v1.2.3 From 0ca5bc3de715f6e031d44ffecdd2d127891eccf5 Mon Sep 17 00:00:00 2001 From: Lucas Correia Villa Real Date: Wed, 1 Feb 2006 21:24:23 +0000 Subject: [ARM] 3284/1: S3C2400 - adds support to GPIO Patch from Lucas Correia Villa Real This patch adds support to GPIO on the S3C2400, which is going to be used by the GP32 machine and the SMDK2400 development board. Signed-off-by: Lucas Correia Villa Real Signed-off-by: Ben Dooks Signed-off-by: Russell King --- include/asm-arm/arch-s3c2410/hardware.h | 7 +++++++ include/asm-arm/arch-s3c2410/regs-gpio.h | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'include') diff --git a/include/asm-arm/arch-s3c2410/hardware.h b/include/asm-arm/arch-s3c2410/hardware.h index 1c9de29cafe..a2330bf8369 100644 --- a/include/asm-arm/arch-s3c2410/hardware.h +++ b/include/asm-arm/arch-s3c2410/hardware.h @@ -17,6 +17,7 @@ * 14-Sep-2004 BJD Added misccr and getpin to gpio * 01-Oct-2004 BJD Added the new gpio functions * 16-Oct-2004 BJD Removed the clock variables + * 15-Jan-2006 LCVR Added s3c2400_gpio_getirq() */ #ifndef __ASM_ARCH_HARDWARE_H @@ -55,6 +56,12 @@ extern unsigned int s3c2410_gpio_getcfg(unsigned int pin); extern int s3c2410_gpio_getirq(unsigned int pin); +#ifdef CONFIG_CPU_S3C2400 + +extern int s3c2400_gpio_getirq(unsigned int pin); + +#endif /* CONFIG_CPU_S3C2400 */ + /* s3c2410_gpio_irqfilter * * set the irq filtering on the given pin diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h index 7f1be48ad67..9697f93afe7 100644 --- a/include/asm-arm/arch-s3c2410/regs-gpio.h +++ b/include/asm-arm/arch-s3c2410/regs-gpio.h @@ -22,6 +22,7 @@ * 28-Mar-2005 LCVR Fixed definition of GPB10 * 26-Oct-2005 BJD Added generic configuration types * 27-Nov-2005 LCVR Added definitions to S3C2400 registers + * 15-Jan-2006 LCVR Written S3C24XX_GPIO_BASE() macro */ @@ -39,6 +40,27 @@ #define S3C2410_GPIO_BANKG (32*6) #define S3C2410_GPIO_BANKH (32*7) +#ifdef CONFIG_CPU_S3C2400 +#define S3C24XX_GPIO_BASE(x) S3C2400_GPIO_BASE(x) +#define S3C24XX_MISCCR S3C2400_MISCCR +#else +#define S3C24XX_GPIO_BASE(x) S3C2410_GPIO_BASE(x) +#define S3C24XX_MISCCR S3C2410_MISCCR +#endif /* CONFIG_CPU_S3C2400 */ + + +/* S3C2400 doesn't have a 1:1 mapping to S3C2410 gpio base pins */ + +#define S3C2400_BANKNUM(pin) (((pin) & ~31) / 32) +#define S3C2400_BASEA2B(pin) ((((pin) & ~31) >> 2)) +#define S3C2400_BASEC2H(pin) ((S3C2400_BANKNUM(pin) * 10) + \ + (2 * (S3C2400_BANKNUM(pin)-2))) + +#define S3C2400_GPIO_BASE(pin) (pin < S3C2410_GPIO_BANKC ? \ + S3C2400_BASEA2B(pin)+S3C24XX_VA_GPIO : \ + S3C2400_BASEC2H(pin)+S3C24XX_VA_GPIO) + + #define S3C2410_GPIO_BASE(pin) ((((pin) & ~31) >> 1) + S3C24XX_VA_GPIO) #define S3C2410_GPIO_OFFSET(pin) ((pin) & 31) -- cgit v1.2.3 From 9ad11ab48b1ad618bf47076e9e579f267f5306c2 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Thu, 2 Feb 2006 16:11:51 +1100 Subject: [PATCH] compat: fix compat_sys_openat and friends Most of the 64 bit architectures will zero extend the first argument to compat_sys_{openat,newfstatat,futimesat} which will fail if the 32 bit syscall was passed AT_FDCWD (which is a small negative number). Declare the first argument to be an unsigned int which will force the correct sign extension when the internal functions are called in each case. Also, do some small white space cleanups in fs/compat.c. Signed-off-by: Stephen Rothwell Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- include/linux/syscalls.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index fdbd436b24c..3877209d23c 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -559,12 +559,12 @@ asmlinkage long sys_newfstatat(int dfd, char __user *filename, struct stat __user *statbuf, int flag); asmlinkage long sys_readlinkat(int dfd, const char __user *path, char __user *buf, int bufsiz); -asmlinkage long compat_sys_futimesat(int dfd, char __user *filename, +asmlinkage long compat_sys_futimesat(unsigned int dfd, char __user *filename, struct compat_timeval __user *t); -asmlinkage long compat_sys_newfstatat(int dfd, char __user * filename, +asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename, struct compat_stat __user *statbuf, int flag); -asmlinkage long compat_sys_openat(int dfd, const char __user *filename, +asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, int flags, int mode); #endif -- cgit v1.2.3 From e92251762d02a46177d4105d1744041e3f8bc465 Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 2 Feb 2006 12:23:12 +0000 Subject: [MMC] Add MMC command type flags Some hosts need to know the command type, so pass it via a set of flags in cmd->flags. Signed-off-by: Russell King --- include/linux/mmc/mmc.h | 35 +++++++++++++++++++++++------------ include/linux/mmc/protocol.h | 2 +- 2 files changed, 24 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index ccd3e13de1e..f38872abc12 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h @@ -21,24 +21,35 @@ struct mmc_command { u32 arg; u32 resp[4]; unsigned int flags; /* expected response type */ -#define MMC_RSP_NONE (0 << 0) -#define MMC_RSP_SHORT (1 << 0) -#define MMC_RSP_LONG (2 << 0) -#define MMC_RSP_MASK (3 << 0) -#define MMC_RSP_CRC (1 << 3) /* expect valid crc */ -#define MMC_RSP_BUSY (1 << 4) /* card may send busy */ -#define MMC_RSP_OPCODE (1 << 5) /* response contains opcode */ +#define MMC_RSP_PRESENT (1 << 0) +#define MMC_RSP_136 (1 << 1) /* 136 bit response */ +#define MMC_RSP_CRC (1 << 2) /* expect valid crc */ +#define MMC_RSP_BUSY (1 << 3) /* card may send busy */ +#define MMC_RSP_OPCODE (1 << 4) /* response contains opcode */ +#define MMC_CMD_MASK (3 << 5) /* command type */ +#define MMC_CMD_AC (0 << 5) +#define MMC_CMD_ADTC (1 << 5) +#define MMC_CMD_BC (2 << 5) +#define MMC_CMD_BCR (3 << 5) /* * These are the response types, and correspond to valid bit * patterns of the above flags. One additional valid pattern * is all zeros, which means we don't expect a response. */ -#define MMC_RSP_R1 (MMC_RSP_SHORT|MMC_RSP_CRC|MMC_RSP_OPCODE) -#define MMC_RSP_R1B (MMC_RSP_SHORT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY) -#define MMC_RSP_R2 (MMC_RSP_LONG|MMC_RSP_CRC) -#define MMC_RSP_R3 (MMC_RSP_SHORT) -#define MMC_RSP_R6 (MMC_RSP_SHORT|MMC_RSP_CRC) +#define MMC_RSP_NONE (0) +#define MMC_RSP_R1 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE) +#define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY) +#define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC) +#define MMC_RSP_R3 (MMC_RSP_PRESENT) +#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC) + +#define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE)) + +/* + * These are the command types. + */ +#define mmc_cmd_type(cmd) ((cmd)->flags & MMC_CMD_TYPE) unsigned int retries; /* max number of retries */ unsigned int error; /* command error */ diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h index a14dc306545..81c3f77f652 100644 --- a/include/linux/mmc/protocol.h +++ b/include/linux/mmc/protocol.h @@ -79,7 +79,7 @@ /* SD commands type argument response */ /* class 8 */ /* This is basically the same command as for MMC with some quirks. */ -#define SD_SEND_RELATIVE_ADDR 3 /* ac R6 */ +#define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */ /* Application commands */ #define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ -- cgit v1.2.3 From 3ec9c59449744dcc390d593a017d30671546fd9e Mon Sep 17 00:00:00 2001 From: Andrey Panin Date: Thu, 2 Feb 2006 20:15:09 +0000 Subject: [SERIAL] SIIG 8-port serial boards support This patch adds support for SIIG 8-port boards. These boards have 4 ports in separate bars and another 4 ports in the single bar. Because of this strange port arrangement these cards need special setup function. Fortunately no other SIIG cards have more than 4 port, so this setup function could be used for them too. Signed-off-by: Andrey Panin Signed-off-by: Russell King --- include/linux/pci_ids.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index b0b908f583c..92a619ba163 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1670,6 +1670,9 @@ #define PCI_DEVICE_ID_SIIG_2S1P_20x_550 0x2060 #define PCI_DEVICE_ID_SIIG_2S1P_20x_650 0x2061 #define PCI_DEVICE_ID_SIIG_2S1P_20x_850 0x2062 +#define PCI_DEVICE_ID_SIIG_8S_20x_550 0x2080 +#define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081 +#define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082 #define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050 #define PCI_VENDOR_ID_RADISYS 0x1331 -- cgit v1.2.3 From 27852c26baab8b95fc9a2b3e8a18770ecd553f10 Mon Sep 17 00:00:00 2001 From: Vlad Yasevich Date: Thu, 2 Feb 2006 16:57:31 -0800 Subject: [SCTP]: Fix 'fast retransmit' to send a TSN only once. SCTP used to "fast retransmit" a TSN every time we hit the number of missing reports for the TSN. However the Implementers Guide specifies that we should only "fast retransmit" a given TSN once. Subsequent retransmits should be timeouts only. Also change the number of missing reports to 3 as per the latest IG(similar to TCP). Signed-off-by: Vlad Yasevich Signed-off-by: Sridhar Samudrala Signed-off-by: David S. Miller --- include/net/sctp/structs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 8c522ae031b..072f407848a 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -700,7 +700,7 @@ struct sctp_chunk { __u8 ecn_ce_done; /* Have we processed the ECN CE bit? */ __u8 pdiscard; /* Discard the whole packet now? */ __u8 tsn_gap_acked; /* Is this chunk acked by a GAP ACK? */ - __u8 fast_retransmit; /* Is this chunk fast retransmitted? */ + __s8 fast_retransmit; /* Is this chunk fast retransmitted? */ __u8 tsn_missing_report; /* Data chunk missing counter. */ }; -- cgit v1.2.3 From 0dec456d1fe73e0539625f0973ee8ef8fb805943 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 2 Feb 2006 20:40:09 -0800 Subject: [NET]: Add CONFIG_NETDEBUG to suppress bad packet messages. If you are on a hostile network, or are running protocol tests, you can easily get the logged swamped by messages about bad UDP and ICMP packets. This turns those messages off unless a config option is enabled. Signed-off-by: Stephen Hemminger Acked-by: Dave Jones Signed-off-by: David S. Miller --- include/net/sock.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/net/sock.h b/include/net/sock.h index 1806e5b6141..30758035d61 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -1354,12 +1354,12 @@ extern int sock_get_timestamp(struct sock *, struct timeval __user *); * Enable debug/info messages */ -#if 0 -#define NETDEBUG(fmt, args...) do { } while (0) -#define LIMIT_NETDEBUG(fmt, args...) do { } while(0) -#else +#ifdef CONFIG_NETDEBUG #define NETDEBUG(fmt, args...) printk(fmt,##args) #define LIMIT_NETDEBUG(fmt, args...) do { if (net_ratelimit()) printk(fmt,##args); } while(0) +#else +#define NETDEBUG(fmt, args...) do { } while (0) +#define LIMIT_NETDEBUG(fmt, args...) do { } while(0) #endif /* -- cgit v1.2.3 From c0c1633bdb844ec5b4ac15c97ab8927d80550c42 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Fri, 3 Feb 2006 03:03:44 -0800 Subject: [PATCH] Fix build failure in recent pm_prepare_* changes. kernel/power/power.h:49: error: static declaration of 'pm_prepare_console' follows non-static declaration include/linux/suspend.h:46: error: previous declaration of 'pm_prepare_console' was here kernel/power/power.h:50: error: static declaration of 'pm_restore_console' follows non-static declaration include/linux/suspend.h:47: error: previous declaration of 'pm_restore_console' was here Signed-off-by: Dave Jones Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/suspend.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 5dc94e777fa..43bcd13eb1e 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h @@ -42,10 +42,6 @@ extern void mark_free_pages(struct zone *zone); #ifdef CONFIG_PM /* kernel/power/swsusp.c */ extern int software_suspend(void); - -extern int pm_prepare_console(void); -extern void pm_restore_console(void); - #else static inline int software_suspend(void) { -- cgit v1.2.3 From f434baf4c6ae4a392b7c34843825af0894c89db2 Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Fri, 3 Feb 2006 03:03:46 -0800 Subject: [PATCH] fix generic_fls64() Noticed by Rune Torgersen. Fix generic_fls64(). tcp_cubic is using fls64(). Signed-off-by: Akinobu Mita Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/bitops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 6a2a19f14bb..208650b1ad3 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -81,7 +81,7 @@ static inline int generic_fls64(__u64 x) { __u32 h = x >> 32; if (h) - return fls(x) + 32; + return fls(h) + 32; return fls(x); } -- cgit v1.2.3 From 12c3a54848a6eba2b38cd92ba5925433d223332b Mon Sep 17 00:00:00 2001 From: Stefan Weinhuber Date: Fri, 3 Feb 2006 03:03:49 -0800 Subject: [PATCH] s390: dasd extended error reporting module The DASD extended error reporting is a facility that allows to get detailed information about certain problems in the DASD I/O. This information can be used to implement fail-over applications that can recover these problems. Signed-off-by: Stefan Weinhuber Signed-off-by: Martin Schwidefsky Signed-off-by: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-s390/dasd.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-s390/dasd.h b/include/asm-s390/dasd.h index 1630c26e8f4..c744ff33b1d 100644 --- a/include/asm-s390/dasd.h +++ b/include/asm-s390/dasd.h @@ -204,7 +204,8 @@ typedef struct attrib_data_t { * * Here ist how the ioctl-nr should be used: * 0 - 31 DASD driver itself - * 32 - 239 still open + * 32 - 229 still open + * 230 - 239 DASD extended error reporting * 240 - 255 reserved for EMC *******************************************************************************/ @@ -236,12 +237,22 @@ typedef struct attrib_data_t { #define BIODASDPSRD _IOR(DASD_IOCTL_LETTER,4,dasd_rssd_perf_stats_t) /* Get Attributes (cache operations) */ #define BIODASDGATTR _IOR(DASD_IOCTL_LETTER,5,attrib_data_t) +/* retrieve extended error-reporting value */ +#define BIODASDEERGET _IOR(DASD_IOCTL_LETTER,6,int) /* #define BIODASDFORMAT _IOW(IOCTL_LETTER,0,format_data_t) , deprecated */ #define BIODASDFMT _IOW(DASD_IOCTL_LETTER,1,format_data_t) /* Set Attributes (cache operations) */ #define BIODASDSATTR _IOW(DASD_IOCTL_LETTER,2,attrib_data_t) +/* retrieve extended error-reporting value */ +#define BIODASDEERSET _IOW(DASD_IOCTL_LETTER,3,int) + + +/* remove all records from the eer buffer */ +#define DASD_EER_PURGE _IO(DASD_IOCTL_LETTER,230) +/* set the number of pages that are used for the internal eer buffer */ +#define DASD_EER_SETBUFSIZE _IOW(DASD_IOCTL_LETTER,230,int) #endif /* DASD_H */ -- cgit v1.2.3 From 6d7bfd14e593455a0801c62db86f82912c52c3a1 Mon Sep 17 00:00:00 2001 From: Jan Glauber Date: Fri, 3 Feb 2006 03:03:50 -0800 Subject: [PATCH] s390: timer interface visibility Avoid visibility of kernel internal interface to user space. Signed-off-by: Jan Glauber Signed-off-by: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-s390/timer.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-s390/timer.h b/include/asm-s390/timer.h index ea0788967c5..fcd6c256a2d 100644 --- a/include/asm-s390/timer.h +++ b/include/asm-s390/timer.h @@ -1,7 +1,7 @@ /* * include/asm-s390/timer.h * - * (C) Copyright IBM Corp. 2003 + * (C) Copyright IBM Corp. 2003,2006 * Virtual CPU timer * * Author: Jan Glauber (jang@de.ibm.com) @@ -10,6 +10,8 @@ #ifndef _ASM_S390_TIMER_H #define _ASM_S390_TIMER_H +#ifdef __KERNEL__ + #include #define VTIMER_MAX_SLICE (0x7ffffffffffff000LL) @@ -43,4 +45,6 @@ extern void add_virt_timer_periodic(void *new); extern int mod_virt_timer(struct vtimer_list *timer, __u64 expires); extern int del_virt_timer(struct vtimer_list *timer); -#endif +#endif /* __KERNEL__ */ + +#endif /* _ASM_S390_TIMER_H */ -- cgit v1.2.3 From 6ff290a0c0dec40eb6f80efbb0ac88f518bbb2a7 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Fri, 3 Feb 2006 03:03:51 -0800 Subject: [PATCH] s390: compile fix: missing defines in asm-s390/io.h Compile fix: add missing __raw_read* and __raw_write* defines to include/asm-s390/io.h. These are mandatory since patch c27a0d75b33c030965cc97d3d7f571107a673fb4 was merged. Signed-off-by: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-s390/io.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/asm-s390/io.h b/include/asm-s390/io.h index 71f55eb2350..b05825dd16d 100644 --- a/include/asm-s390/io.h +++ b/include/asm-s390/io.h @@ -90,10 +90,16 @@ extern void iounmap(void *addr); #define readb_relaxed(addr) readb(addr) #define readw_relaxed(addr) readw(addr) #define readl_relaxed(addr) readl(addr) +#define __raw_readb readb +#define __raw_readw readw +#define __raw_readl readl #define writeb(b,addr) (*(volatile unsigned char *) __io_virt(addr) = (b)) #define writew(b,addr) (*(volatile unsigned short *) __io_virt(addr) = (b)) #define writel(b,addr) (*(volatile unsigned int *) __io_virt(addr) = (b)) +#define __raw_writeb writeb +#define __raw_writew writew +#define __raw_writel writel #define memset_io(a,b,c) memset(__io_virt(a),(b),(c)) #define memcpy_fromio(a,b,c) memcpy((a),__io_virt(b),(c)) -- cgit v1.2.3 From bcc68b8616bcac47dbfc414398e382b3b10faf4c Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Fri, 3 Feb 2006 03:03:54 -0800 Subject: [PATCH] include/asm-*/bitops.h: fix more "~0UL >> size" typos "[PATCH] m68knommu: fix find_next_zero_bit in bitops.h" fixed a typo in m68knommu implementation of find_next_zero_bit(). grep(1) shows that cris, frv, h8300, v850 are also affected. Signed-off-by: Alexey Dobriyan Cc: Mikael Starvik Cc: David Howells Cc: Yoshinori Sato Cc: Miles Bader Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-cris/bitops.h | 2 +- include/asm-frv/bitops.h | 2 +- include/asm-h8300/bitops.h | 2 +- include/asm-v850/bitops.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/asm-cris/bitops.h b/include/asm-cris/bitops.h index d3eb0f1e420..b7fef1572dc 100644 --- a/include/asm-cris/bitops.h +++ b/include/asm-cris/bitops.h @@ -290,7 +290,7 @@ static inline int find_next_zero_bit (const unsigned long * addr, int size, int tmp = *p; found_first: - tmp |= ~0UL >> size; + tmp |= ~0UL << size; found_middle: return result + ffz(tmp); } diff --git a/include/asm-frv/bitops.h b/include/asm-frv/bitops.h index 02be7b3a8a8..f686b519878 100644 --- a/include/asm-frv/bitops.h +++ b/include/asm-frv/bitops.h @@ -209,7 +209,7 @@ static inline int find_next_zero_bit(const void *addr, int size, int offset) tmp = *p; found_first: - tmp |= ~0UL >> size; + tmp |= ~0UL << size; found_middle: return result + ffz(tmp); } diff --git a/include/asm-h8300/bitops.h b/include/asm-h8300/bitops.h index c0411ec9d65..ff7c2b72159 100644 --- a/include/asm-h8300/bitops.h +++ b/include/asm-h8300/bitops.h @@ -227,7 +227,7 @@ static __inline__ int find_next_zero_bit (const unsigned long * addr, int size, tmp = *p; found_first: - tmp |= ~0UL >> size; + tmp |= ~0UL << size; found_middle: return result + ffz(tmp); } diff --git a/include/asm-v850/bitops.h b/include/asm-v850/bitops.h index 8955d2376ac..609b9e87222 100644 --- a/include/asm-v850/bitops.h +++ b/include/asm-v850/bitops.h @@ -188,7 +188,7 @@ static inline int find_next_zero_bit(const void *addr, int size, int offset) tmp = *p; found_first: - tmp |= ~0UL >> size; + tmp |= ~0UL << size; found_middle: return result + ffz (tmp); } -- cgit v1.2.3 From 490d6ab170c94a7a59870f528d765131b8963e79 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 3 Feb 2006 03:03:56 -0800 Subject: [PATCH] list.h: don't evaluate macro args multiple times I noticed that list.h init functions were evaluating macro arguments multiple times and thought it might be nice to protect the unsuspecting caller. Converting the macros to inline functions seems to reduce code size, too. A i386 defconfig build with gcc 3.3.3 from fc4: text data bss dec hex filename 3573148 565664 188828 4327640 4208d8 vmlinux.before 3572177 565664 188828 4326669 42050d vmlinux add/remove: 0/0 grow/shrink: 11/144 up/down: 88/-1016 (-928) There was no difference in checkstack output. Signed-off-by: Zach Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/list.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/linux/list.h b/include/linux/list.h index 945daa1f13d..47208bd99f9 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -34,9 +34,11 @@ struct list_head { #define LIST_HEAD(name) \ struct list_head name = LIST_HEAD_INIT(name) -#define INIT_LIST_HEAD(ptr) do { \ - (ptr)->next = (ptr); (ptr)->prev = (ptr); \ -} while (0) +static inline void INIT_LIST_HEAD(struct list_head *list) +{ + list->next = list; + list->prev = list; +} /* * Insert a new entry between two known consecutive entries. @@ -534,7 +536,11 @@ struct hlist_node { #define HLIST_HEAD_INIT { .first = NULL } #define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } #define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) -#define INIT_HLIST_NODE(ptr) ((ptr)->next = NULL, (ptr)->pprev = NULL) +static inline void INIT_HLIST_NODE(struct hlist_node *h) +{ + h->next = NULL; + h->pprev = NULL; +} static inline int hlist_unhashed(const struct hlist_node *h) { -- cgit v1.2.3 From e295cfcb2907ae4c5df57f5d4ada1ce6f3ae4657 Mon Sep 17 00:00:00 2001 From: Evgeniy Dushistov Date: Fri, 3 Feb 2006 03:04:04 -0800 Subject: [PATCH] ufs: fix oops with `ufs1' type "rm" command, on file system with "ufs1" type cause system hang up. This is, in fact, not so bad as it seems to be, because of after that in "kernel control path" there are 3-4 places which may cause "oops". So the first patch fix oopses, and the second patch fix "kernel hang up". "oops" appears because of reading of group's summary info partly wrong, and access to not first group's summary info cause "oops". Signed-off-by: Evgeniy Dushistov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ufs_fs.h | 3 +-- include/linux/ufs_fs_sb.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index 7a6babeca25..f26118ea1c5 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h @@ -502,8 +502,7 @@ struct ufs_super_block { /* * Convert cylinder group to base address of its global summary info. */ -#define fs_cs(indx) \ - s_csp[(indx) >> uspi->s_csshift][(indx) & ~uspi->s_csmask] +#define fs_cs(indx) s_csp[(indx)] /* * Cylinder group block for a file system. diff --git a/include/linux/ufs_fs_sb.h b/include/linux/ufs_fs_sb.h index c1be4c22648..8ff13c160f3 100644 --- a/include/linux/ufs_fs_sb.h +++ b/include/linux/ufs_fs_sb.h @@ -25,7 +25,7 @@ struct ufs_csum; struct ufs_sb_info { struct ufs_sb_private_info * s_uspi; - struct ufs_csum * s_csp[UFS_MAXCSBUFS]; + struct ufs_csum * s_csp; unsigned s_bytesex; unsigned s_flags; struct buffer_head ** s_ucg; -- cgit v1.2.3 From 09114eb8c53d2d3b2ff9523e011cb68b2e245dce Mon Sep 17 00:00:00 2001 From: Evgeniy Dushistov Date: Fri, 3 Feb 2006 03:04:06 -0800 Subject: [PATCH] ufs: fix hang during `rm' This fixes the code like this: bh = sb_find_get_block (sb, tmp + j); if ((bh && DATA_BUFFER_USED(bh)) || tmp != fs32_to_cpu(sb, *p)) { retry = 1; brelse (bh); goto next1; } bforget (bh); sb_find_get_block() ordinarily returns a buffer_head with b_count>=2, and this code assume that in case if "b_count>1" buffer is used, so this caused infinite loop. (akpm: that is-the-buffer-busy code is incomprehensible. Good riddance. Use of block_truncate_page() seems sane). Signed-off-by: Evgeniy Dushistov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ufs_fs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index f26118ea1c5..74aaf298b40 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h @@ -912,6 +912,7 @@ extern int ufs_sync_inode (struct inode *); extern void ufs_delete_inode (struct inode *); extern struct buffer_head * ufs_getfrag (struct inode *, unsigned, int, int *); extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *); +extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create); /* namei.c */ extern struct file_operations ufs_dir_operations; -- cgit v1.2.3 From 47ba87e0b1269698801310bfd1716b0538282405 Mon Sep 17 00:00:00 2001 From: Marcelo Tosatti Date: Fri, 3 Feb 2006 03:04:06 -0800 Subject: [PATCH] make "struct d_cookie" depend on CONFIG_PROFILING Shrinks "struct dentry" from 128 bytes to 124 on x86, allowing 31 objects per slab instead of 30. Cc: John Levon Cc: Philippe Elie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/dcache.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/dcache.h b/include/linux/dcache.h index a3ed5e059d4..a3f09947940 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -108,7 +108,9 @@ struct dentry { struct dentry_operations *d_op; struct super_block *d_sb; /* The root of the dentry tree */ void *d_fsdata; /* fs-specific data */ +#ifdef CONFIG_PROFILING struct dcookie_struct *d_cookie; /* cookie, if any */ +#endif int d_mounted; unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ }; -- cgit v1.2.3 From 9d923a0603b5909a6758cfaec503955775cb7ab1 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Fri, 3 Feb 2006 03:04:12 -0800 Subject: [PATCH] ufs: fix char vs. __s8 clash in ufs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix this warning: fs/ufs/super.c: In function ‘ufs_fill_super’: fs/ufs/super.c:858: warning: case label value exceeds maximum value for type which happens because __s8 != char. These macros are used for struct ufs_super_block.fs_clean which is declared as __s8. Signed-off-by: Andreas Schwab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ufs_fs.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index 74aaf298b40..b0ffe4356e5 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h @@ -148,11 +148,11 @@ typedef __u16 __bitwise __fs16; #define UFS_USEEFT ((__u16)65535) #define UFS_FSOK 0x7c269d38 -#define UFS_FSACTIVE ((char)0x00) -#define UFS_FSCLEAN ((char)0x01) -#define UFS_FSSTABLE ((char)0x02) -#define UFS_FSOSF1 ((char)0x03) /* is this correct for DEC OSF/1? */ -#define UFS_FSBAD ((char)0xff) +#define UFS_FSACTIVE ((__s8)0x00) +#define UFS_FSCLEAN ((__s8)0x01) +#define UFS_FSSTABLE ((__s8)0x02) +#define UFS_FSOSF1 ((__s8)0x03) /* is this correct for DEC OSF/1? */ +#define UFS_FSBAD ((__s8)0xff) /* From here to next blank line, s_flags for ufs_sb_info */ /* directory entry encoding */ -- cgit v1.2.3 From 8e75f744289f0a1c38b669e39a489af460640881 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 3 Feb 2006 03:04:16 -0800 Subject: [PATCH] parport: add parallel port support for SGI O2 Add support for the built-in parallel port on SGI O2 (a.k.a. IP32). Define a new configuration option: PARPORT_IP32. The module is named parport_ip32. Hardware support for SPP, EPP and ECP modes along with DMA support when available are currently implemented. Signed-off-by: Arnaud Giersch Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/parport.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/linux/parport.h b/include/linux/parport.h index f67f838a3a1..008d736a6c9 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -128,6 +128,11 @@ struct amiga_parport_state { unsigned char statusdir;/* ciab.ddrb & 7 */ }; +struct ip32_parport_state { + unsigned int dcr; + unsigned int ecr; +}; + struct parport_state { union { struct pc_parport_state pc; @@ -135,6 +140,7 @@ struct parport_state { struct ax_parport_state ax; struct amiga_parport_state amiga; /* Atari has not state. */ + struct ip32_parport_state ip32; void *misc; } u; }; -- cgit v1.2.3 From 8b3e09e19932835fb77c63aaf3b1af6117e78871 Mon Sep 17 00:00:00 2001 From: Markus Lidel Date: Fri, 3 Feb 2006 03:04:29 -0800 Subject: [PATCH] I2O: fix and workaround for Motorola/Freescale controller - This controller violates the I2O spec for the I/O registers. The patch contains a workaround which moves the registers to the proper location. (originally author: Matthew Starzewski) - If a message frame is beyond the mapped address range a error is returned. Signed-off-by: Markus Lidel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/i2o.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/i2o.h b/include/linux/i2o.h index 9ba80679666..5a9d8c59917 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h @@ -1115,9 +1115,11 @@ static inline struct i2o_message *i2o_msg_get(struct i2o_controller *c) return ERR_PTR(-ENOMEM); mmsg->mfa = readl(c->in_port); - if (mmsg->mfa == I2O_QUEUE_EMPTY) { + if (unlikely(mmsg->mfa >= c->in_queue.len)) { mempool_free(mmsg, c->in_msg.mempool); - return ERR_PTR(-EBUSY); + if(mmsg->mfa == I2O_QUEUE_EMPTY) + return ERR_PTR(-EBUSY); + return ERR_PTR(-EFAULT); } return &mmsg->msg; -- cgit v1.2.3 From 6bf8d889ed453f709dedacabdcf5db47470fdae9 Mon Sep 17 00:00:00 2001 From: Herbert Poetzl Date: Fri, 3 Feb 2006 03:04:32 -0800 Subject: [PATCH] quota: remove unused sync_dquots_dev() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The already removed sync_dquots_dev(dev,type) is still defined in the no-quota case. Signed-off-by: Herbert Pötzl Acked-by: Jan Kara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/quotaops.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 4f34d3d60f2..21e5a912485 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h @@ -190,7 +190,6 @@ static __inline__ int DQUOT_OFF(struct super_block *sb) */ #define sb_dquot_ops (NULL) #define sb_quotactl_ops (NULL) -#define sync_dquots_dev(dev,type) (NULL) #define DQUOT_INIT(inode) do { } while(0) #define DQUOT_DROP(inode) do { } while(0) #define DQUOT_ALLOC_INODE(inode) (0) -- cgit v1.2.3 From 69dcc99199fe29b0a29471a3488d39d9d33b25fc Mon Sep 17 00:00:00 2001 From: "Zhang, Yanmin" Date: Fri, 3 Feb 2006 03:04:36 -0800 Subject: [PATCH] Export cpu topology in sysfs The patch implements cpu topology exportation by sysfs. Items (attributes) are similar to /proc/cpuinfo. 1) /sys/devices/system/cpu/cpuX/topology/physical_package_id: represent the physical package id of cpu X; 2) /sys/devices/system/cpu/cpuX/topology/core_id: represent the cpu core id to cpu X; 3) /sys/devices/system/cpu/cpuX/topology/thread_siblings: represent the thread siblings to cpu X in the same core; 4) /sys/devices/system/cpu/cpuX/topology/core_siblings: represent the thread siblings to cpu X in the same physical package; To implement it in an architecture-neutral way, a new source file, driver/base/topology.c, is to export the 5 attributes. If one architecture wants to support this feature, it just needs to implement 4 defines, typically in file include/asm-XXX/topology.h. The 4 defines are: #define topology_physical_package_id(cpu) #define topology_core_id(cpu) #define topology_thread_siblings(cpu) #define topology_core_siblings(cpu) The type of **_id is int. The type of siblings is cpumask_t. To be consistent on all architectures, the 4 attributes should have deafult values if their values are unavailable. Below is the rule. 1) physical_package_id: If cpu has no physical package id, -1 is the default value. 2) core_id: If cpu doesn't support multi-core, its core id is 0. 3) thread_siblings: Just include itself, if the cpu doesn't support HT/multi-thread. 4) core_siblings: Just include itself, if the cpu doesn't support multi-core and HT/Multi-thread. So be careful when declaring the 4 defines in include/asm-XXX/topology.h. If an attribute isn't defined on an architecture, it won't be exported. Thank Nathan, Greg, Andi, Paul and Venki. The patch provides defines for i386/x86_64/ia64. Signed-off-by: Zhang, Yanmin Cc: Ingo Molnar Cc: Nick Piggin Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/topology.h | 9 +++++++++ include/asm-ia64/topology.h | 7 +++++++ include/asm-x86_64/topology.h | 9 +++++++++ 3 files changed, 25 insertions(+) (limited to 'include') diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h index d7e19eb344b..af503a122b2 100644 --- a/include/asm-i386/topology.h +++ b/include/asm-i386/topology.h @@ -27,6 +27,15 @@ #ifndef _ASM_I386_TOPOLOGY_H #define _ASM_I386_TOPOLOGY_H +#ifdef CONFIG_SMP +#define topology_physical_package_id(cpu) \ + (phys_proc_id[cpu] == BAD_APICID ? -1 : phys_proc_id[cpu]) +#define topology_core_id(cpu) \ + (cpu_core_id[cpu] == BAD_APICID ? 0 : cpu_core_id[cpu]) +#define topology_core_siblings(cpu) (cpu_core_map[cpu]) +#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) +#endif + #ifdef CONFIG_NUMA #include diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h index 412ef8e493a..3ee19dfa46d 100644 --- a/include/asm-ia64/topology.h +++ b/include/asm-ia64/topology.h @@ -102,6 +102,13 @@ void build_cpu_to_node_map(void); #endif /* CONFIG_NUMA */ +#ifdef CONFIG_SMP +#define topology_physical_package_id(cpu) (cpu_data(cpu)->socket_id) +#define topology_core_id(cpu) (cpu_data(cpu)->core_id) +#define topology_core_siblings(cpu) (cpu_core_map[cpu]) +#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) +#endif + #include #endif /* _ASM_IA64_TOPOLOGY_H */ diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h index 2fa7f27381b..c642f5d9882 100644 --- a/include/asm-x86_64/topology.h +++ b/include/asm-x86_64/topology.h @@ -57,6 +57,15 @@ extern int __node_distance(int, int); #endif +#ifdef CONFIG_SMP +#define topology_physical_package_id(cpu) \ + (phys_proc_id[cpu] == BAD_APICID ? -1 : phys_proc_id[cpu]) +#define topology_core_id(cpu) \ + (cpu_core_id[cpu] == BAD_APICID ? 0 : cpu_core_id[cpu]) +#define topology_core_siblings(cpu) (cpu_core_map[cpu]) +#define topology_thread_siblings(cpu) (cpu_sibling_map[cpu]) +#endif + #include #endif -- cgit v1.2.3 From bb3b9cf122eb097ed9fe8ae50e1b0dbba9bbe447 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Fri, 3 Feb 2006 03:04:38 -0800 Subject: [PATCH] Fix comment to synchronize_sched() Fix to broken comment to synchronize_rcu() noted by Keith Owens. Also add sentence noting that synchronize_sched() and synchronize_rcu() are not necessarily identical. Signed-off-by: Paul E. McKenney Cc: Keith Owens Cc: Stephen Hemminger Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/rcupdate.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 981f9aa4335..b87aefa082e 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -240,11 +240,14 @@ extern int rcu_pending(int cpu); * This means that all preempt_disable code sequences, including NMI and * hardware-interrupt handlers, in progress on entry will have completed * before this primitive returns. However, this does not guarantee that - * softirq handlers will have completed, since in some kernels + * softirq handlers will have completed, since in some kernels, these + * handlers can run in process context, and can block. * * This primitive provides the guarantees made by the (deprecated) * synchronize_kernel() API. In contrast, synchronize_rcu() only * guarantees that rcu_read_lock() sections will have completed. + * In "classic RCU", these two guarantees happen to be one and + * the same, but can differ in realtime RCU implementations. */ #define synchronize_sched() synchronize_rcu() -- cgit v1.2.3 From 2c5d81a58106fa333467beab5f11dafab07b3e66 Mon Sep 17 00:00:00 2001 From: Fernando Luis Vazquez Cao Date: Fri, 3 Feb 2006 03:04:39 -0800 Subject: [PATCH] Compilation of kexec/kdump broken The compilation of kexec/kdump seems to be broken for x86_64. Remove the dependency of kexec on CONFIG_IA32_EMULATION. Signed-off-by: Fernando Vazquez Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-x86_64/kexec.h | 3 ++- include/linux/elfcore.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-x86_64/kexec.h b/include/asm-x86_64/kexec.h index ae28cd44bcd..c564bae0343 100644 --- a/include/asm-x86_64/kexec.h +++ b/include/asm-x86_64/kexec.h @@ -1,8 +1,9 @@ #ifndef _X86_64_KEXEC_H #define _X86_64_KEXEC_H +#include + #include -#include #include /* diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index dbd7bb4a33b..0cf0bea010f 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h @@ -5,6 +5,7 @@ #include #include #include +#include struct elf_siginfo { -- cgit v1.2.3 From 808249ceba49cdb3054c0aa5b75a61862d6cab94 Mon Sep 17 00:00:00 2001 From: Paul Fulghum Date: Fri, 3 Feb 2006 03:04:41 -0800 Subject: [PATCH] new tty buffering locking fix Change locking in the new tty buffering facility from using tty->read_lock, which is currently ignored by drivers and thus ineffective. New locking uses a new tty buffering specific lock enforced centrally in the tty buffering code. Two drivers (esp and cyclades) are updated to use the tty buffering functions instead of accessing tty buffering internals directly. This is required for the new locking to work. Minor checks for NULL buffers added to tty_prepare_flip_string/tty_prepare_flip_string_flags Signed-off-by: Paul Fulghum Cc: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/kbd_kern.h | 5 +++++ include/linux/tty.h | 2 ++ include/linux/tty_flip.h | 7 ++++++- 3 files changed, 13 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index 45f625d7d0b..3aed37314ab 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h @@ -151,6 +151,11 @@ extern unsigned int keymap_count; static inline void con_schedule_flip(struct tty_struct *t) { + unsigned long flags; + spin_lock_irqsave(&t->buf.lock, flags); + if (t->buf.tail != NULL) + t->buf.tail->active = 0; + spin_unlock_irqrestore(&t->buf.lock, flags); schedule_work(&t->buf.work); } diff --git a/include/linux/tty.h b/include/linux/tty.h index 3787102e4b1..a7bd3b4558d 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -57,6 +57,7 @@ struct tty_buffer { unsigned char *flag_buf_ptr; int used; int size; + int active; /* Data points here */ unsigned long data[0]; }; @@ -64,6 +65,7 @@ struct tty_buffer { struct tty_bufhead { struct work_struct work; struct semaphore pty_sem; + spinlock_t lock; struct tty_buffer *head; /* Queue head */ struct tty_buffer *tail; /* Active buffer */ struct tty_buffer *free; /* Free queue head */ diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index be1400e8248..82961eb1988 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h @@ -17,7 +17,7 @@ _INLINE_ int tty_insert_flip_char(struct tty_struct *tty, unsigned char ch, char flag) { struct tty_buffer *tb = tty->buf.tail; - if (tb && tb->used < tb->size) { + if (tb && tb->active && tb->used < tb->size) { tb->flag_buf_ptr[tb->used] = flag; tb->char_buf_ptr[tb->used++] = ch; return 1; @@ -27,6 +27,11 @@ _INLINE_ int tty_insert_flip_char(struct tty_struct *tty, _INLINE_ void tty_schedule_flip(struct tty_struct *tty) { + unsigned long flags; + spin_lock_irqsave(&tty->buf.lock, flags); + if (tty->buf.tail != NULL) + tty->buf.tail->active = 0; + spin_unlock_irqrestore(&tty->buf.lock, flags); schedule_delayed_work(&tty->buf.work, 1); } -- cgit v1.2.3 From d57d39c81271a0808eabcf7bdc409312b5262b69 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Fri, 3 Feb 2006 03:04:53 -0800 Subject: [PATCH] ia64: drop arch-specific IDE MAX_HWIFS definition There's no reason MAX_HWIFS needs to be ia64-specific, so set MAX_HWIFS from CONFIG_IDE_MAX_HWIFS. This reduces the default from 10 to 4, but I don't think that's a problem. Signed-off-by: Bjorn Helgaas Acked-by: Bartlomiej Zolnierkiewicz Cc: Alan Cox Cc: "Luck, Tony" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-ia64/ide.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'include') diff --git a/include/asm-ia64/ide.h b/include/asm-ia64/ide.h index e62b95301d5..93f45c5f189 100644 --- a/include/asm-ia64/ide.h +++ b/include/asm-ia64/ide.h @@ -17,14 +17,6 @@ #include -#ifndef MAX_HWIFS -# ifdef CONFIG_PCI -#define MAX_HWIFS 10 -# else -#define MAX_HWIFS 6 -# endif -#endif - #define IDE_ARCH_OBSOLETE_DEFAULTS static inline int ide_default_irq(unsigned long base) -- cgit v1.2.3 From 9810933701a09f9c4dd0ad963d5ec2efb7df07b7 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Fri, 3 Feb 2006 03:04:55 -0800 Subject: [PATCH] stop CompactFlash devices being marked as removable This patch stops CompactFlash devices being marked as removable. They are not removable (as defined by Linux) as the media and device are inseparable. When a card is removed, the whole device is removed from the system and never sits in a media-less state. This stops some nasty udev device creation/destruction loops. Further, once this change is made, there is no need for ide to can be removed from ide_drive_t. Signed-off-by: Richard Purdie Acked-by: Bartlomiej Zolnierkiewicz Cc: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ide.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index 110b3cfac02..274d1528718 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -582,7 +582,6 @@ typedef struct ide_drive_s { unsigned noprobe : 1; /* from: hdx=noprobe */ unsigned removable : 1; /* 1 if need to do check_media_change */ unsigned attach : 1; /* needed for removable devices */ - unsigned is_flash : 1; /* 1 if probed as flash */ unsigned forced_geom : 1; /* 1 if hdx=c,h,s was given at boot */ unsigned no_unmask : 1; /* disallow setting unmask bit */ unsigned no_io_32bit : 1; /* disallow enabling 32bit I/O */ -- cgit v1.2.3 From a7ff7d41fec06c518caa82a818a70610a29d0e75 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Fri, 3 Feb 2006 03:04:56 -0800 Subject: [PATCH] drivers/ide/ide-io.c: make __ide_end_request() static Since there's no longer any external user, we can make __ide_end_request() static. Signed-off-by: Adrian Bunk Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/ide.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/ide.h b/include/linux/ide.h index 274d1528718..a7fc4cc79b2 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1005,7 +1005,6 @@ extern ide_hwif_t ide_hwifs[]; /* master data repository */ extern int noautodma; extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); -extern int __ide_end_request (ide_drive_t *drive, struct request *rq, int uptodate, int nrsecs); /* * This is used on exit from the driver to designate the next irq handler -- cgit v1.2.3 From 3d0f89bb169482d26d5aa4e82e763077e7e9bc4d Mon Sep 17 00:00:00 2001 From: Joel Becker Date: Wed, 25 Jan 2006 13:31:07 -0800 Subject: configfs: Add permission and ownership to configfs objects. configfs always made item and attribute ownership root.root and permissions based on a umask of 022. Add ->setattr() to allow chown(2)/chmod(2), and persist the changes for the lifetime of the items and attributes. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh --- include/linux/configfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/configfs.h b/include/linux/configfs.h index acffb8c9073..a7f01502753 100644 --- a/include/linux/configfs.h +++ b/include/linux/configfs.h @@ -126,7 +126,7 @@ extern struct config_item *config_group_find_obj(struct config_group *, const ch struct configfs_attribute { - char *ca_name; + const char *ca_name; struct module *ca_owner; mode_t ca_mode; }; -- cgit v1.2.3 From 53ea68ecea11bcbb3451c2758ce181bd97b569a9 Mon Sep 17 00:00:00 2001 From: Stephen Smalley Date: Fri, 3 Feb 2006 08:21:12 -0500 Subject: [PATCH] SELinux: fix size-128 slab leak Remove private inode tests from security_inode_alloc and security_inode_free, as we otherwise end up leaking inode security structures for private inodes. Signed-off-by: Stephen Smalley Acked-by: James Morris Signed-off-by: Linus Torvalds --- include/linux/security.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include') diff --git a/include/linux/security.h b/include/linux/security.h index bb1da86747c..7cbef482e13 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -1499,15 +1499,11 @@ static inline void security_sb_post_pivotroot (struct nameidata *old_nd, static inline int security_inode_alloc (struct inode *inode) { - if (unlikely (IS_PRIVATE (inode))) - return 0; return security_ops->inode_alloc_security (inode); } static inline void security_inode_free (struct inode *inode) { - if (unlikely (IS_PRIVATE (inode))) - return; security_ops->inode_free_security (inode); } -- cgit v1.2.3 From 226d780909f71bebfa4dfffa21493244aa22dfdc Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Fri, 3 Feb 2006 21:50:44 +0100 Subject: [PATCH] x86_64: Define pmtmr_ioport to 0 when PM_TIMER is not available Avoids some ifdef mess later. Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- include/asm-x86_64/proto.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index 115e496c613..d35c7e06f34 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h @@ -42,7 +42,11 @@ extern void iommu_hole_init(void); extern void time_init_gtod(void); extern int pmtimer_mark_offset(void); extern unsigned int do_gettimeoffset_pm(void); +#ifdef CONFIG_X86_PM_TIMER extern u32 pmtmr_ioport; +#else +#define pmtmr_ioport 0 +#endif extern unsigned long long monotonic_base; extern int sysctl_vsyscall; -- cgit v1.2.3 From 73dea47faeb96d54a984b9d7f4de564816966354 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Fri, 3 Feb 2006 21:50:50 +0100 Subject: [PATCH] x86_64: Allow to run main time keeping from the local APIC interrupt Another piece from the no-idle-tick patch. This can be enabled with the "apicmaintimer" option. This is mainly useful when the PIT/HPET interrupt is unreliable. Note there are some systems that are known to stop the APIC timer in C3. For those it will never work, but this case should be automatically detected. It also only works with PM timer right now. When HPET is used the way the main timer handler computes the delay doesn't work. It should be a bit more efficient because there is one less regular interrupt to process on the boot processor. Requires earlier bugfix from Venkatesh Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- include/asm-x86_64/apic.h | 1 + include/asm-x86_64/proto.h | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'include') diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h index 4f6a4dc455b..bdbd8935612 100644 --- a/include/asm-x86_64/apic.h +++ b/include/asm-x86_64/apic.h @@ -17,6 +17,7 @@ #define APIC_DEBUG 2 extern int apic_verbosity; +extern int apic_runs_main_timer; /* * Define the default level of output to be very little diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index d35c7e06f34..c1e2307445d 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h @@ -49,6 +49,8 @@ extern u32 pmtmr_ioport; #endif extern unsigned long long monotonic_base; extern int sysctl_vsyscall; +extern int nohpet; +extern unsigned long vxtime_hz; extern void do_softirq_thunk(void); @@ -69,6 +71,9 @@ extern void free_bootmem_generic(unsigned long phys, unsigned len); extern void load_gs_index(unsigned gs); +extern void stop_timer_interrupt(void); +extern void main_timer_handler(struct pt_regs *regs); + extern unsigned long end_pfn_map; extern void show_trace(unsigned long * rsp); -- cgit v1.2.3 From 0dd2ea9af8f0eca43cf6200baa182b3aba307049 Mon Sep 17 00:00:00 2001 From: Shaohua Li Date: Fri, 3 Feb 2006 21:50:56 +0100 Subject: [PATCH] x86_64: [PATCH] timer resume At resume time, TSC's value or something similar might be changed a lot against suspend time. This could make system gets a very big lost ticks. See http://bugzilla.kernel.org/show_bug.cgi?id=5825 Signed-off-by: Shaohua Li Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- include/asm-x86_64/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index c1e2307445d..a6748b9568f 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h @@ -41,6 +41,7 @@ extern void iommu_hole_init(void); extern void time_init_gtod(void); extern int pmtimer_mark_offset(void); +extern void pmtimer_resume(void); extern unsigned int do_gettimeoffset_pm(void); #ifdef CONFIG_X86_PM_TIMER extern u32 pmtmr_ioport; -- cgit v1.2.3 From 7bcd3f34e262bbebffa954d80eab3a84f053da31 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Fri, 3 Feb 2006 21:51:02 +0100 Subject: [PATCH] x86_64: Undo the earlier changes to remove unrolled copy/memset functions They cause quite bad performance regressions on Netburst This is temporary until we can get new optimized functions for these CPUs. This undoes changes that were done in 2.6.15 and in 2.6.16-rc1, essentially bringing the code back to 2.6.14 level. Only change is I renamed the X86_FEATURE_K8_C flag to X86_FEATURE_REP_GOOD and fixed the check for the flag and also fixed some comments. Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- include/asm-x86_64/cpufeature.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-x86_64/cpufeature.h b/include/asm-x86_64/cpufeature.h index 41c0ac8559b..76bb6193ae9 100644 --- a/include/asm-x86_64/cpufeature.h +++ b/include/asm-x86_64/cpufeature.h @@ -61,7 +61,7 @@ #define X86_FEATURE_K6_MTRR (3*32+ 1) /* AMD K6 nonstandard MTRRs */ #define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */ #define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */ -/* 4 free */ +#define X86_FEATURE_REP_GOOD (3*32+ 4) /* rep microcode works well on this CPU */ #define X86_FEATURE_CONSTANT_TSC (3*32+5) /* TSC runs at constant rate */ #define X86_FEATURE_SYNC_RDTSC (3*32+6) /* RDTSC syncs CPU core */ -- cgit v1.2.3 From 10f4dc8b27ac42f930ac55adb8c521264dc997f8 Mon Sep 17 00:00:00 2001 From: Ravikiran G Thirumalai Date: Fri, 3 Feb 2006 21:51:05 +0100 Subject: [PATCH] x86_64: Fix the node cpumask of a cpu going down Currently, x86_64 and ia64 arches do not clear the corresponding bits in the node's cpumask when a cpu goes down or cpu bring up is cancelled. This is buggy since there are pieces of common code where the cpumask is checked in the cpu down code path to decide on things (like in the slab down path). PPC does the right thing, but x86_64 and ia64 don't (This was the reason Sonny hit upon a slab bug during cpu offline on ppc and could not reproduce on other arches). This patch fixes it for x86_64. I won't attempt ia64 as I cannot test it. Credit for spotting this should go to Alok. Signed-off-by: Alok N Kataria Signed-off-by: Ravikiran Thirumalai Signed-off-by: Shai Fultheim Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- include/asm-x86_64/numa.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/asm-x86_64/numa.h b/include/asm-x86_64/numa.h index 34e434ce326..dffe276ca2d 100644 --- a/include/asm-x86_64/numa.h +++ b/include/asm-x86_64/numa.h @@ -22,8 +22,15 @@ extern void numa_set_node(int cpu, int node); extern unsigned char apicid_to_node[256]; #ifdef CONFIG_NUMA extern void __init init_cpu_to_node(void); + +static inline void clear_node_cpumask(int cpu) +{ + clear_bit(cpu, &node_to_cpumask[cpu_to_node(cpu)]); +} + #else #define init_cpu_to_node() do {} while (0) +#define clear_node_cpumask(cpu) do {} while (0) #endif #define NUMA_NO_NODE 0xff -- cgit v1.2.3 From 0c3749c41f5eee0da36bbf92b2793338b4d8574f Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Fri, 3 Feb 2006 21:51:41 +0100 Subject: [PATCH] x86_64: Calibrate APIC timer using PM timer On some broken motherboards (at least one NForce3 based AMD64 laptop) the PIT timer runs at a incorrect frequency. This patch adds a new option "apicpmtimer" that allows to use the APIC timer and calibrate it using the PMTimer. It requires the earlier patch that allows to run the main timer from the APIC. Specifying apicpmtimer implies apicmaintimer. The option defaults to off for now. I tested it on a few systems and the resulting APIC timer frequencies were usually a bit off, but always <1%, which should be tolerable. TBD figure out heuristic to enable this automatically on the affected systems TBD perhaps do it on all NForce3s or using DMI? Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- include/asm-x86_64/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index a6748b9568f..c99832e7bf3 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h @@ -42,6 +42,7 @@ extern void iommu_hole_init(void); extern void time_init_gtod(void); extern int pmtimer_mark_offset(void); extern void pmtimer_resume(void); +extern void pmtimer_wait(unsigned); extern unsigned int do_gettimeoffset_pm(void); #ifdef CONFIG_X86_PM_TIMER extern u32 pmtmr_ioport; -- cgit v1.2.3 From 3777a95903953c55f2309a89679b73c19ae5535b Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Fri, 3 Feb 2006 21:51:53 +0100 Subject: [PATCH] i386/x86-64: Don't ack the APIC for bad interrupts when the APIC is not enabled It's bad juju to touch the APIC when it hasn't been enabled. I also moved ack_bad_irq for x86-64 out of line following i386. Signed-off-by: Andi Kleen Acked-by: Ingo Molnar Signed-off-by: Linus Torvalds --- include/asm-x86_64/hardirq.h | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/asm-x86_64/hardirq.h b/include/asm-x86_64/hardirq.h index 8661b476fb4..8689951e350 100644 --- a/include/asm-x86_64/hardirq.h +++ b/include/asm-x86_64/hardirq.h @@ -16,23 +16,6 @@ #define set_softirq_pending(x) write_pda(__softirq_pending, (x)) #define or_softirq_pending(x) or_pda(__softirq_pending, (x)) -/* - * 'what should we do if we get a hw irq event on an illegal vector'. - * each architecture has to answer this themselves. - */ -static inline void ack_bad_irq(unsigned int irq) -{ - printk("unexpected IRQ trap at vector %02x\n", irq); -#ifdef CONFIG_X86_LOCAL_APIC - /* - * Currently unexpected vectors happen only on SMP and APIC. - * We _must_ ack these because every local APIC has only N - * irq slots per priority level, and a 'hanging, unacked' IRQ - * holds up an irq slot - in excessive cases (when multiple - * unexpected vectors occur) that might lock up the APIC - * completely. - */ - ack_APIC_irq(); -#endif -} +extern void ack_bad_irq(unsigned int irq); + #endif /* __ASM_HARDIRQ_H */ -- cgit v1.2.3 From ddc8d029ac6813827849801bce2d8c8813070db6 Mon Sep 17 00:00:00 2001 From: Yasuyuki Kozakai Date: Sat, 4 Feb 2006 02:12:14 -0800 Subject: [NETFILTER]: nf_conntrack: check address family when finding protocol module __nf_conntrack_{l3}proto_find() doesn't check the passed protocol family, then it's possible to touch out of the array which has only AF_MAX items. Spotted by Pablo Neira Ayuso. Signed-off-by: Yasuyuki Kozakai Signed-off-by: YOSHIFUJI Hideaki Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- include/net/netfilter/nf_conntrack_l3proto.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h index 67856eb93b4..dac43b15a5b 100644 --- a/include/net/netfilter/nf_conntrack_l3proto.h +++ b/include/net/netfilter/nf_conntrack_l3proto.h @@ -88,12 +88,6 @@ extern struct nf_conntrack_l3proto *nf_ct_l3protos[AF_MAX]; extern int nf_conntrack_l3proto_register(struct nf_conntrack_l3proto *proto); extern void nf_conntrack_l3proto_unregister(struct nf_conntrack_l3proto *proto); -static inline struct nf_conntrack_l3proto * -__nf_ct_l3proto_find(u_int16_t l3proto) -{ - return nf_ct_l3protos[l3proto]; -} - extern struct nf_conntrack_l3proto * nf_ct_l3proto_find_get(u_int16_t l3proto); @@ -103,4 +97,13 @@ extern void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p); extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4; extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6; extern struct nf_conntrack_l3proto nf_conntrack_generic_l3proto; + +static inline struct nf_conntrack_l3proto * +__nf_ct_l3proto_find(u_int16_t l3proto) +{ + if (unlikely(l3proto >= AF_MAX)) + return &nf_conntrack_generic_l3proto; + return nf_ct_l3protos[l3proto]; +} + #endif /*_NF_CONNTRACK_L3PROTO_H*/ -- cgit v1.2.3 From 19ea7302df2eb4f2ad7f29af814d8cf55fc8b9c9 Mon Sep 17 00:00:00 2001 From: Yasuyuki Kozakai Date: Sat, 4 Feb 2006 02:15:36 -0800 Subject: [NETFILTER]: iptables: fix typos in ipt_connbytes.h Fix some typos that make iptables userspace compilation fail. Signed-off-by: Yasuyuki Kozakai Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- include/linux/netfilter_ipv4/ipt_connbytes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/netfilter_ipv4/ipt_connbytes.h b/include/linux/netfilter_ipv4/ipt_connbytes.h index b04dfa3083c..f63e6ee9111 100644 --- a/include/linux/netfilter_ipv4/ipt_connbytes.h +++ b/include/linux/netfilter_ipv4/ipt_connbytes.h @@ -1,10 +1,10 @@ #ifndef _IPT_CONNBYTES_H #define _IPT_CONNBYTES_H -#include +#include #define ipt_connbytes_what xt_connbytes_what -#define IPT_CONNBYTES_PKTS XT_CONNBYTES_PACKETS +#define IPT_CONNBYTES_PKTS XT_CONNBYTES_PKTS #define IPT_CONNBYTES_BYTES XT_CONNBYTES_BYTES #define IPT_CONNBYTES_AVGPKT XT_CONNBYTES_AVGPKT -- cgit v1.2.3 From 0047c65a60fa3b6607b55e058ea6a89f39cb3f28 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Sat, 4 Feb 2006 02:19:09 -0800 Subject: [NETFILTER]: Prepare {ipt,ip6t}_policy match for x_tables unification The IPv4 and IPv6 version of the policy match are identical besides address comparison and the data structure used for userspace communication. Unify the data structures to break compatiblity now (before it is released), so we can port it to x_tables in 2.6.17. Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- include/linux/netfilter_ipv4/ipt_policy.h | 22 ++++++++++++++-------- include/linux/netfilter_ipv6/ip6t_policy.h | 22 ++++++++++++++-------- 2 files changed, 28 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/linux/netfilter_ipv4/ipt_policy.h b/include/linux/netfilter_ipv4/ipt_policy.h index 7fd1bec453f..a3f6eff39d3 100644 --- a/include/linux/netfilter_ipv4/ipt_policy.h +++ b/include/linux/netfilter_ipv4/ipt_policy.h @@ -27,16 +27,22 @@ struct ipt_policy_spec reqid:1; }; +union ipt_policy_addr +{ + struct in_addr a4; + struct in6_addr a6; +}; + struct ipt_policy_elem { - u_int32_t saddr; - u_int32_t smask; - u_int32_t daddr; - u_int32_t dmask; - u_int32_t spi; - u_int32_t reqid; - u_int8_t proto; - u_int8_t mode; + union ipt_policy_addr saddr; + union ipt_policy_addr smask; + union ipt_policy_addr daddr; + union ipt_policy_addr dmask; + u_int32_t spi; + u_int32_t reqid; + u_int8_t proto; + u_int8_t mode; struct ipt_policy_spec match; struct ipt_policy_spec invert; diff --git a/include/linux/netfilter_ipv6/ip6t_policy.h b/include/linux/netfilter_ipv6/ip6t_policy.h index 5a93afcd2ff..671bd818300 100644 --- a/include/linux/netfilter_ipv6/ip6t_policy.h +++ b/include/linux/netfilter_ipv6/ip6t_policy.h @@ -27,16 +27,22 @@ struct ip6t_policy_spec reqid:1; }; +union ip6t_policy_addr +{ + struct in_addr a4; + struct in6_addr a6; +}; + struct ip6t_policy_elem { - struct in6_addr saddr; - struct in6_addr smask; - struct in6_addr daddr; - struct in6_addr dmask; - u_int32_t spi; - u_int32_t reqid; - u_int8_t proto; - u_int8_t mode; + union ip6t_policy_addr saddr; + union ip6t_policy_addr smask; + union ip6t_policy_addr daddr; + union ip6t_policy_addr dmask; + u_int32_t spi; + u_int32_t reqid; + u_int8_t proto; + u_int8_t mode; struct ip6t_policy_spec match; struct ip6t_policy_spec invert; -- cgit v1.2.3 From cef5076987dd545ac74f4efcf1c962be8eac34b0 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 5 Feb 2006 10:51:57 -0800 Subject: Revert "[PATCH] x86_64: Fix the node cpumask of a cpu going down" This reverts commit 10f4dc8b27ac42f930ac55adb8c521264dc997f8. Quoth Andi Kleen: "Kiran decided that it makes the problem worse than it was before. Fixing it fully requires more work which is too much for 2.6.16. So please revert that commit for now." Signed-off-by: Linus Torvalds --- include/asm-x86_64/numa.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include') diff --git a/include/asm-x86_64/numa.h b/include/asm-x86_64/numa.h index dffe276ca2d..34e434ce326 100644 --- a/include/asm-x86_64/numa.h +++ b/include/asm-x86_64/numa.h @@ -22,15 +22,8 @@ extern void numa_set_node(int cpu, int node); extern unsigned char apicid_to_node[256]; #ifdef CONFIG_NUMA extern void __init init_cpu_to_node(void); - -static inline void clear_node_cpumask(int cpu) -{ - clear_bit(cpu, &node_to_cpumask[cpu_to_node(cpu)]); -} - #else #define init_cpu_to_node() do {} while (0) -#define clear_node_cpumask(cpu) do {} while (0) #endif #define NUMA_NO_NODE 0xff -- cgit v1.2.3 From a460ad62260def15c42130de253d6cfc32528a2f Mon Sep 17 00:00:00 2001 From: Phillip Susi Date: Sat, 4 Feb 2006 23:27:44 -0800 Subject: [PATCH] pktcdvd: Fix overflow for discs with large packets The pktcdvd driver was using an 8 bit field to store the packet length obtained from the disc track info. This causes it to overflow packet length values of 128KB or more. I changed the field to 32 bits to fix this. The pktcdvd driver defaulted to its maximum allowed packet length when it detected a 0 in the track info field. I changed this to fail the operation and refuse to access the media. This seems more sane than attempting to access it with a value that almost certainly will not work. Signed-off-by: Peter Osterlund Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/pktcdvd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h index 2c177e4c8f2..d1c9c4a86e5 100644 --- a/include/linux/pktcdvd.h +++ b/include/linux/pktcdvd.h @@ -114,7 +114,7 @@ struct pkt_ctrl_command { struct packet_settings { - __u8 size; /* packet size in (512 byte) sectors */ + __u32 size; /* packet size in (512 byte) sectors */ __u8 fp; /* fixed packets */ __u8 link_loss; /* the rest is specified * as per Mt Fuji */ -- cgit v1.2.3 From e1bc89bc9991e994f2b3c60d9ad2fdb5ad9b10fc Mon Sep 17 00:00:00 2001 From: Peter Osterlund Date: Sat, 4 Feb 2006 23:27:47 -0800 Subject: [PATCH] pktcdvd: Don't waste kernel memory Allocate memory for read-gathering at open time, when it is known just how much memory is needed. This avoids wasting kernel memory when the real packet size is smaller than the maximum packet size supported by the driver. This is always the case when using DVD discs. Signed-off-by: Peter Osterlund Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/pktcdvd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h index d1c9c4a86e5..1623da88d6f 100644 --- a/include/linux/pktcdvd.h +++ b/include/linux/pktcdvd.h @@ -170,7 +170,7 @@ struct packet_iosched #error "PAGE_SIZE must be a multiple of CD_FRAMESIZE" #endif #define PACKET_MAX_SIZE 32 -#define PAGES_PER_PACKET (PACKET_MAX_SIZE * CD_FRAMESIZE / PAGE_SIZE) +#define FRAMES_PER_PAGE (PAGE_SIZE / CD_FRAMESIZE) #define PACKET_MAX_SECTORS (PACKET_MAX_SIZE * CD_FRAMESIZE >> 9) enum packet_data_state { @@ -219,7 +219,7 @@ struct packet_data atomic_t io_errors; /* Number of read/write errors during IO */ struct bio *r_bios[PACKET_MAX_SIZE]; /* bios to use during data gathering */ - struct page *pages[PAGES_PER_PACKET]; + struct page *pages[PACKET_MAX_SIZE / FRAMES_PER_PAGE]; int cache_valid; /* If non-zero, the data for the zone defined */ /* by the sector variable is completely cached */ -- cgit v1.2.3 From 5c55ac9bbca22ee134408f83de5f2bda3b1b2a53 Mon Sep 17 00:00:00 2001 From: Phillip Susi Date: Sat, 4 Feb 2006 23:27:48 -0800 Subject: [PATCH] pktcdvd: Allow larger packets The pktcdvd driver uses a compile time macro constant to define the maximum supported packet length. I changed this from 32 sectors to 128 sectors because that allows over 100 MB of additional usable space on a 700 MB cdrw, and increases throughput. Note that you need a modified cdrwtool program that can format a CDRW disc with larger packets to benefit from this change. Signed-off-by: Peter Osterlund Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/pktcdvd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h index 1623da88d6f..8a94c717c26 100644 --- a/include/linux/pktcdvd.h +++ b/include/linux/pktcdvd.h @@ -169,7 +169,7 @@ struct packet_iosched #if (PAGE_SIZE % CD_FRAMESIZE) != 0 #error "PAGE_SIZE must be a multiple of CD_FRAMESIZE" #endif -#define PACKET_MAX_SIZE 32 +#define PACKET_MAX_SIZE 128 #define FRAMES_PER_PAGE (PAGE_SIZE / CD_FRAMESIZE) #define PACKET_MAX_SECTORS (PACKET_MAX_SIZE * CD_FRAMESIZE >> 9) -- cgit v1.2.3 From bc5e483da61eb5ab8d24b4a919fb512e5886d02c Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 4 Feb 2006 23:27:51 -0800 Subject: [PATCH] reiserfs_get_acl() build fix With CONFIG_REISERFS_FS_XATTR=y, CONFIG_REISERFS_FS_POSIX_ACL=n: fs/reiserfs/xattr.c: In function `reiserfs_check_acl': fs/reiserfs/xattr.c:1330: called object is not a function Cc: Chris Mason Cc: Jeff Mahoney Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/reiserfs_acl.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h index 0a3605099c4..806ec5b0670 100644 --- a/include/linux/reiserfs_acl.h +++ b/include/linux/reiserfs_acl.h @@ -58,9 +58,13 @@ extern struct reiserfs_xattr_handler posix_acl_default_handler; extern struct reiserfs_xattr_handler posix_acl_access_handler; #else -#define reiserfs_get_acl NULL #define reiserfs_cache_default_acl(inode) 0 +static inline struct posix_acl *reiserfs_get_acl(struct inode *inode, int type) +{ + return NULL; +} + static inline int reiserfs_xattr_posix_acl_init(void) { return 0; -- cgit v1.2.3 From fe1dcbc4f311c2e6c23b33c0fa8572461618ab3e Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 4 Feb 2006 23:27:54 -0800 Subject: [PATCH] jbd: fix transaction batching Ben points out that: When writing files out using O_SYNC, jbd's 1 jiffy delay results in a significant drop in throughput as the disk sits idle. The patch below results in a 4-5x performance improvement (from 6.5MB/s to ~24-30MB/s on my IDE test box) when writing out files using O_SYNC. So optimise the batching code by omitting it entirely if the process which is doing a sync write is the same as the one which did the most recent sync write. If that's true, we're unlikely to get any other processes joining the transaction. (Has been in -mm for ages - it took me a long time to get on to performance testing it) Numbers, on write-cache-disabled IDE: /usr/bin/time -p synctest -n 10 -uf -t 1 -p 1 dir-name Unpatched: 40 seconds Patched: 35 seconds Batching disabled: 35 seconds This is the problematic single-process-doing-fsync case. With multiple fsyncing processes the numbers are AFACIT unaltered by the patch. Aside: performance testing and instrumentation shows that the transaction batching almost doesn't help (testing with synctest -n 1 -uf -t 100 -p 10 dir-name on non-writeback-caching IDE). This is because by the time one process is running a synchronous commit, a bunch of other processes already have a transaction handle open, so they're all going to batch into the same transaction anyway. The batching seems to offer maybe 5-10% speedup with this workload, but I'm pretty sure it was more important than that when it was first developed 4-odd years ago... Cc: "Stephen C. Tweedie" Cc: Benjamin LaHaise Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/jbd.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 558cb4c26ec..751bb384946 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h @@ -23,6 +23,7 @@ #define jfs_debug jbd_debug #else +#include #include #include #include @@ -618,6 +619,7 @@ struct transaction_s * @j_wbuf: array of buffer_heads for journal_commit_transaction * @j_wbufsize: maximum number of buffer_heads allowed in j_wbuf, the * number that will fit in j_blocksize + * @j_last_sync_writer: most recent pid which did a synchronous write * @j_private: An opaque pointer to fs-private information. */ @@ -807,6 +809,8 @@ struct journal_s struct buffer_head **j_wbuf; int j_wbufsize; + pid_t j_last_sync_writer; + /* * An opaque pointer to fs-private information. ext3 puts its * superblock pointer here -- cgit v1.2.3 From 911b0ad25d167fede6aadc05065b414ec7ab5086 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Sat, 4 Feb 2006 23:28:05 -0800 Subject: [PATCH] Fix "value computed is not used" compile warnings with gcc-4.1 Fix gcc4.1 compile warnings "value computed is not used" with set_current_state() and set_task_state() on i386/SMP and x86-64. Signed-off-by: Takashi Iwai Cc: Nick Piggin Cc: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-i386/system.h | 2 +- include/asm-x86_64/system.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 36a92ed6a9d..399145a247f 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h @@ -507,7 +507,7 @@ struct alt_instr { #define smp_rmb() rmb() #define smp_wmb() wmb() #define smp_read_barrier_depends() read_barrier_depends() -#define set_mb(var, value) do { xchg(&var, value); } while (0) +#define set_mb(var, value) do { (void) xchg(&var, value); } while (0) #else #define smp_mb() barrier() #define smp_rmb() barrier() diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h index a73f0c789d8..b7f66034ae7 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86_64/system.h @@ -327,7 +327,7 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, #define wmb() asm volatile("" ::: "memory") #endif #define read_barrier_depends() do {} while(0) -#define set_mb(var, value) do { xchg(&var, value); } while (0) +#define set_mb(var, value) do { (void) xchg(&var, value); } while (0) #define set_wmb(var, value) do { var = value; wmb(); } while (0) #define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0) -- cgit v1.2.3 From b68239ee746760bd99a68692f4c97a28f08a5d01 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Fri, 3 Feb 2006 19:05:47 +1100 Subject: [PATCH] powerpc: Don't overwrite flat device tree with kdump kernel It's possible for prom_init to allocate the flat device tree inside the kdump crash kernel region. If this happens, when we load the kdump kernel we overwrite the flattened device tree, which is bad. We could make prom_init try and avoid allocating inside the crash kernel region, but then we run into issues if the crash kernel region uses all the space inside the RMO. The easiest solution is to move the flat device tree once we're running in the kernel. Signed-off-by: Michael Ellerman Signed-off-by: Paul Mackerras --- include/asm-powerpc/prom.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 5b2bd4eefb0..cbd297f44cc 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h @@ -222,5 +222,7 @@ extern int of_address_to_resource(struct device_node *dev, int index, extern int of_pci_address_to_resource(struct device_node *dev, int bar, struct resource *r); +extern void kdump_move_device_tree(void); + #endif /* __KERNEL__ */ #endif /* _POWERPC_PROM_H */ -- cgit v1.2.3 From b4367e7451f19a3ae8b453e8b7ac0a1fdd9bca04 Mon Sep 17 00:00:00 2001 From: "Grant C. Likely" Date: Thu, 19 Jan 2006 01:12:32 -0700 Subject: [PATCH] powerpc: Move xparameters.h into xilinx virtex device specific path xparameters should not be needed by anything but virtex platform code. Move it from include/asm-ppc/ to platforms/4xx/xparameters/ This is preparing for work to remove xparameters from the dependancy tree for most c files. xparam changes should not cause a recompile of the world. Instead, drivers should get device info from the platform bus (populated by the boot code) Signed-off-by: Grant C. Likely Signed-off-by: Paul Mackerras --- include/asm-ppc/xparameters.h | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 include/asm-ppc/xparameters.h (limited to 'include') diff --git a/include/asm-ppc/xparameters.h b/include/asm-ppc/xparameters.h deleted file mode 100644 index fe4eac62913..00000000000 --- a/include/asm-ppc/xparameters.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * include/asm-ppc/xparameters.h - * - * This file includes the correct xparameters.h for the CONFIG'ed board - * - * Author: MontaVista Software, Inc. - * source@mvista.com - * - * 2004 (c) MontaVista Software, Inc. This file is licensed under the terms - * of the GNU General Public License version 2. This program is licensed - * "as is" without any warranty of any kind, whether express or implied. - */ - -#include - -#if defined(CONFIG_XILINX_ML300) -#include -#endif -- cgit v1.2.3 From 1a42e53d175074f340a3f85042ed64cfc51be216 Mon Sep 17 00:00:00 2001 From: "Grant C. Likely" Date: Thu, 19 Jan 2006 01:12:48 -0700 Subject: [PATCH] powerpc: Migrate Xilinx Vertex support from the OCP bus to the platfom bus. This patch only deals with the serial port definitions as there is no support for any other xilinx IP cores in the kernel tree at the moment. Board specific configuration moved out of virtex.[ch] and into the xparameters.h wrapper. This also prepares for the transition to the flattened device tree model. When the bootloader provides a device tree generated from an xparameters.h files, the kernel will no longer need xparameters/*. The platform bus will get populated with data from the device tree, and the device drivers will be automatically connected to the devices. Only the bootloader (or ppcboot) will need xparameters directly. Signed-off-by: Grant C. Likely Signed-off-by: Paul Mackerras --- include/asm-ppc/ppc_sys.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h index 83d8c77c124..bdc4dde35ed 100644 --- a/include/asm-ppc/ppc_sys.h +++ b/include/asm-ppc/ppc_sys.h @@ -33,6 +33,8 @@ #include #elif defined(CONFIG_MPC10X_BRIDGE) #include +#elif defined(CONFIG_XILINX_VIRTEX) +#include #else #error "need definition of ppc_sys_devices" #endif -- cgit v1.2.3 From 909aeca664dd1fe55111dc4ec25c1bebe91674a2 Mon Sep 17 00:00:00 2001 From: "Grant C. Likely" Date: Thu, 19 Jan 2006 01:13:37 -0700 Subject: [PATCH] powerpc: Add support for Xilinx ML403 reference design Includes fix for Xilinx silicon errata 213 Signed-off-by: Grant C. Likely Signed-off-by: Paul Mackerras --- include/asm-ppc/ibm4xx.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h index 6c28ae7807f..38f99710752 100644 --- a/include/asm-ppc/ibm4xx.h +++ b/include/asm-ppc/ibm4xx.h @@ -51,6 +51,10 @@ #include #endif +#if defined(CONFIG_XILINX_ML403) +#include +#endif + #ifndef __ASSEMBLY__ #ifdef CONFIG_40x -- cgit v1.2.3 From d7a5b2ffa1352f0310630934a56aecbdfb617b72 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Wed, 25 Jan 2006 21:31:28 +1300 Subject: [PATCH] powerpc: Always panic if lmb_alloc() fails Currently most callers of lmb_alloc() don't check if it worked or not, if it ever does weird bad things will probably happen. The few callers who do check just panic or BUG_ON. So make lmb_alloc() panic internally, to catch bugs at the source. The few callers who did check the result no longer need to. The only caller that did anything interesting with the return result was careful_allocation(). For it we create __lmb_alloc_base() which _doesn't_ panic automatically, a little messy, but passable. Signed-off-by: Michael Ellerman Signed-off-by: Paul Mackerras --- include/asm-powerpc/lmb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/asm-powerpc/lmb.h b/include/asm-powerpc/lmb.h index d3546c4c9f4..4fda8eaaeaf 100644 --- a/include/asm-powerpc/lmb.h +++ b/include/asm-powerpc/lmb.h @@ -48,6 +48,8 @@ extern long __init lmb_reserve(unsigned long, unsigned long); extern unsigned long __init lmb_alloc(unsigned long, unsigned long); extern unsigned long __init lmb_alloc_base(unsigned long, unsigned long, unsigned long); +extern unsigned long __init __lmb_alloc_base(unsigned long, unsigned long, + unsigned long); extern unsigned long __init lmb_phys_mem_size(void); extern unsigned long __init lmb_end_of_DRAM(void); extern unsigned long __init lmb_abs_to_phys(unsigned long); -- cgit v1.2.3 From 3b9331dac16555e8788ae21723f2146c3f994ebb Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Wed, 25 Jan 2006 21:31:30 +1300 Subject: [PATCH] powerpc: Move LMB_ALLOC_ANYWHERE out of lmb.h LMB_ALLOC_ANYWHERE doesn't need to be part of the API, it's only used in lmb.c - so move it out of the header file. Signed-off-by: Michael Ellerman Signed-off-by: Paul Mackerras --- include/asm-powerpc/lmb.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include') diff --git a/include/asm-powerpc/lmb.h b/include/asm-powerpc/lmb.h index 4fda8eaaeaf..fbb7bde8fb0 100644 --- a/include/asm-powerpc/lmb.h +++ b/include/asm-powerpc/lmb.h @@ -19,8 +19,6 @@ #define MAX_LMB_REGIONS 128 -#define LMB_ALLOC_ANYWHERE 0 - struct lmb_property { unsigned long base; unsigned long size; -- cgit v1.2.3 From 56b5c9737cdd8814a10f3022fc0cef8af9ea9ba5 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Wed, 25 Jan 2006 21:31:36 +1300 Subject: [PATCH] powerpc: Put parameter names in lmb.h prototypes Prototypes aren't so useful without parameter names, add them to lmb.h based on the names in lmb.c Signed-off-by: Michael Ellerman Signed-off-by: Paul Mackerras --- include/asm-powerpc/lmb.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/asm-powerpc/lmb.h b/include/asm-powerpc/lmb.h index fbb7bde8fb0..377ac1b23aa 100644 --- a/include/asm-powerpc/lmb.h +++ b/include/asm-powerpc/lmb.h @@ -41,17 +41,16 @@ extern struct lmb lmb; extern void __init lmb_init(void); extern void __init lmb_analyze(void); -extern long __init lmb_add(unsigned long, unsigned long); -extern long __init lmb_reserve(unsigned long, unsigned long); -extern unsigned long __init lmb_alloc(unsigned long, unsigned long); -extern unsigned long __init lmb_alloc_base(unsigned long, unsigned long, - unsigned long); -extern unsigned long __init __lmb_alloc_base(unsigned long, unsigned long, - unsigned long); +extern long __init lmb_add(unsigned long base, unsigned long size); +extern long __init lmb_reserve(unsigned long base, unsigned long size); +extern unsigned long __init lmb_alloc(unsigned long size, unsigned long align); +extern unsigned long __init lmb_alloc_base(unsigned long size, + unsigned long align, unsigned long max_addr); +extern unsigned long __init __lmb_alloc_base(unsigned long size, + unsigned long align, unsigned long max_addr); extern unsigned long __init lmb_phys_mem_size(void); extern unsigned long __init lmb_end_of_DRAM(void); -extern unsigned long __init lmb_abs_to_phys(unsigned long); -extern void __init lmb_enforce_memory_limit(unsigned long); +extern void __init lmb_enforce_memory_limit(unsigned long memory_limit); extern void lmb_dump_all(void); -- cgit v1.2.3