Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4be44fcd authored by Len Brown's avatar Len Brown
Browse files

[ACPI] Lindent all ACPI files



Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent c65ade4d
Loading
Loading
Loading
Loading
+260 −270
Original line number Diff line number Diff line
@@ -40,9 +40,15 @@

#ifdef	CONFIG_X86_64

static inline void  acpi_madt_oem_check(char *oem_id, char *oem_table_id) { }
static inline void acpi_madt_oem_check(char *oem_id, char *oem_table_id)
{
}
extern void __init clustered_apic_check(void);
static inline int ioapic_setup_disabled(void) { return 0; }
static inline int ioapic_setup_disabled(void)
{
	return 0;
}

#include <asm/proto.h>

#else				/* X86 */
@@ -212,10 +218,7 @@ int __init acpi_parse_mcfg(unsigned long phys_addr, unsigned long size)
#endif				/* CONFIG_PCI_MMCONFIG */

#ifdef CONFIG_X86_LOCAL_APIC
static int __init
acpi_parse_madt (
	unsigned long		phys_addr,
	unsigned long		size)
static int __init acpi_parse_madt(unsigned long phys_addr, unsigned long size)
{
	struct acpi_table_madt *madt = NULL;

@@ -240,10 +243,8 @@ acpi_parse_madt (
	return 0;
}


static int __init
acpi_parse_lapic (
	acpi_table_entry_header *header, const unsigned long end)
acpi_parse_lapic(acpi_table_entry_header * header, const unsigned long end)
{
	struct acpi_table_lapic *processor = NULL;

@@ -260,16 +261,15 @@ acpi_parse_lapic (

	x86_acpiid_to_apicid[processor->acpi_id] = processor->id;

	mp_register_lapic (
		processor->id,					   /* APIC ID */
	mp_register_lapic(processor->id,	/* APIC ID */
			  processor->flags.enabled);	/* Enabled? */

	return 0;
}

static int __init
acpi_parse_lapic_addr_ovr (
	acpi_table_entry_header *header, const unsigned long end)
acpi_parse_lapic_addr_ovr(acpi_table_entry_header * header,
			  const unsigned long end)
{
	struct acpi_table_lapic_addr_ovr *lapic_addr_ovr = NULL;

@@ -284,8 +284,7 @@ acpi_parse_lapic_addr_ovr (
}

static int __init
acpi_parse_lapic_nmi (
	acpi_table_entry_header *header, const unsigned long end)
acpi_parse_lapic_nmi(acpi_table_entry_header * header, const unsigned long end)
{
	struct acpi_table_lapic_nmi *lapic_nmi = NULL;

@@ -302,14 +301,12 @@ acpi_parse_lapic_nmi (
	return 0;
}


#endif				/*CONFIG_X86_LOCAL_APIC */

#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_ACPI_INTERPRETER)

static int __init
acpi_parse_ioapic (
	acpi_table_entry_header *header, const unsigned long end)
acpi_parse_ioapic(acpi_table_entry_header * header, const unsigned long end)
{
	struct acpi_table_ioapic *ioapic = NULL;

@@ -320,10 +317,8 @@ acpi_parse_ioapic (

	acpi_table_print_madt_entry(header);

	mp_register_ioapic (
		ioapic->id,
		ioapic->address,
		ioapic->global_irq_base);
	mp_register_ioapic(ioapic->id,
			   ioapic->address, ioapic->global_irq_base);

	return 0;
}
@@ -331,8 +326,7 @@ acpi_parse_ioapic (
/*
 * Parse Interrupt Source Override for the ACPI SCI
 */
static void
acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
static void acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
{
	if (trigger == 0)	/* compatible SCI trigger is level */
		trigger = 3;
@@ -363,8 +357,8 @@ acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger)
}

static int __init
acpi_parse_int_src_ovr (
	acpi_table_entry_header *header, const unsigned long end)
acpi_parse_int_src_ovr(acpi_table_entry_header * header,
		       const unsigned long end)
{
	struct acpi_table_int_src_ovr *intsrc = NULL;

@@ -377,7 +371,8 @@ acpi_parse_int_src_ovr (

	if (intsrc->bus_irq == acpi_fadt.sci_int) {
		acpi_sci_ioapic_setup(intsrc->global_irq,
			intsrc->flags.polarity, intsrc->flags.trigger);
				      intsrc->flags.polarity,
				      intsrc->flags.trigger);
		return 0;
	}

@@ -387,19 +382,15 @@ acpi_parse_int_src_ovr (
		return 0;
	}

	mp_override_legacy_irq (
		intsrc->bus_irq,
	mp_override_legacy_irq(intsrc->bus_irq,
			       intsrc->flags.polarity,
		intsrc->flags.trigger,
		intsrc->global_irq);
			       intsrc->flags.trigger, intsrc->global_irq);

	return 0;
}


static int __init
acpi_parse_nmi_src (
	acpi_table_entry_header *header, const unsigned long end)
acpi_parse_nmi_src(acpi_table_entry_header * header, const unsigned long end)
{
	struct acpi_table_nmi_src *nmi_src = NULL;

@@ -433,8 +424,7 @@ acpi_parse_nmi_src (
 * ECLR2 is IRQ's 8-15 (IRQ 8, 13 must be 0)
 */

void __init
acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
{
	unsigned int mask = 1 << irq;
	unsigned int old, new;
@@ -470,7 +460,6 @@ acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
	outb(new >> 8, 0x4d1);
}


#endif				/* CONFIG_ACPI_BUS */

int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
@@ -513,50 +502,48 @@ int acpi_register_gsi(u32 gsi, int edge_level, int active_high_low)
	acpi_gsi_to_irq(plat_gsi, &irq);
	return irq;
}

EXPORT_SYMBOL(acpi_register_gsi);

/*
 *  ACPI based hotplug support for CPU
 */
#ifdef CONFIG_ACPI_HOTPLUG_CPU
int
acpi_map_lsapic(acpi_handle handle, int *pcpu)
int acpi_map_lsapic(acpi_handle handle, int *pcpu)
{
	/* TBD */
	return -EINVAL;
}
EXPORT_SYMBOL(acpi_map_lsapic);

EXPORT_SYMBOL(acpi_map_lsapic);

int
acpi_unmap_lsapic(int cpu)
int acpi_unmap_lsapic(int cpu)
{
	/* TBD */
	return -EINVAL;
}

EXPORT_SYMBOL(acpi_unmap_lsapic);
#endif				/* CONFIG_ACPI_HOTPLUG_CPU */

int
acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
{
	/* TBD */
	return -EINVAL;
}

EXPORT_SYMBOL(acpi_register_ioapic);

int
acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base)
{
	/* TBD */
	return -EINVAL;
}

EXPORT_SYMBOL(acpi_unregister_ioapic);

static unsigned long __init
acpi_scan_rsdp (
	unsigned long		start,
	unsigned long		length)
acpi_scan_rsdp(unsigned long start, unsigned long length)
{
	unsigned long offset = 0;
	unsigned long sig_len = sizeof("RSD PTR ") - 1;
@@ -592,7 +579,6 @@ static int __init acpi_parse_sbf(unsigned long phys_addr, unsigned long size)
	return 0;
}


#ifdef CONFIG_HPET_TIMER

static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
@@ -613,7 +599,6 @@ static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
		       "memory.\n");
		return -1;
	}

#ifdef	CONFIG_X86_64
	vxtime.hpet_address = hpet_tbl->addr.addrl |
	    ((long)hpet_tbl->addr.addrh << 32);
@@ -649,7 +634,6 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
		printk(KERN_WARNING PREFIX "Unable to map FADT\n");
		return 0;
	}

#ifdef	CONFIG_ACPI_INTERPRETER
	/* initialize sci_int early for INT_SRC_OVR MADT parsing */
	acpi_fadt.sci_int = fadt->sci_int;
@@ -658,14 +642,16 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
#ifdef CONFIG_ACPI_BUS
	/* initialize rev and apic_phys_dest_mode for x86_64 genapic */
	acpi_fadt.revision = fadt->revision;
	acpi_fadt.force_apic_physical_destination_mode = fadt->force_apic_physical_destination_mode;
	acpi_fadt.force_apic_physical_destination_mode =
	    fadt->force_apic_physical_destination_mode;
#endif

#ifdef CONFIG_X86_PM_TIMER
	/* detect the location of the ACPI PM Timer */
	if (fadt->revision >= FADT2_REVISION_ID) {
		/* FADT rev. 2 */
		if (fadt->xpm_tmr_blk.address_space_id != ACPI_ADR_SPACE_SYSTEM_IO)
		if (fadt->xpm_tmr_blk.address_space_id !=
		    ACPI_ADR_SPACE_SYSTEM_IO)
			return 0;

		pmtmr_ioport = fadt->xpm_tmr_blk.address;
@@ -674,14 +660,13 @@ static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
		pmtmr_ioport = fadt->V1_pm_tmr_blk;
	}
	if (pmtmr_ioport)
		printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", pmtmr_ioport);
		printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n",
		       pmtmr_ioport);
#endif
	return 0;
}


unsigned long __init
acpi_find_rsdp (void)
unsigned long __init acpi_find_rsdp(void)
{
	unsigned long rsdp_phys = 0;

@@ -707,8 +692,7 @@ acpi_find_rsdp (void)
 * Parse LAPIC entries in MADT
 * returns 0 on success, < 0 on error
 */
static int __init
acpi_parse_madt_lapic_entries(void)
static int __init acpi_parse_madt_lapic_entries(void)
{
	int count;

@@ -717,9 +701,12 @@ acpi_parse_madt_lapic_entries(void)
	 * and (optionally) overriden by a LAPIC_ADDR_OVR entry (64-bit value).
	 */

	count = acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR, acpi_parse_lapic_addr_ovr, 0);
	count =
	    acpi_table_parse_madt(ACPI_MADT_LAPIC_ADDR_OVR,
				  acpi_parse_lapic_addr_ovr, 0);
	if (count < 0) {
		printk(KERN_ERR PREFIX "Error parsing LAPIC address override entry\n");
		printk(KERN_ERR PREFIX
		       "Error parsing LAPIC address override entry\n");
		return count;
	}

@@ -731,14 +718,14 @@ acpi_parse_madt_lapic_entries(void)
		printk(KERN_ERR PREFIX "No LAPIC entries present\n");
		/* TBD: Cleanup to allow fallback to MPS */
		return -ENODEV;
	}
	else if (count < 0) {
	} else if (count < 0) {
		printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n");
		/* TBD: Cleanup to allow fallback to MPS */
		return count;
	}

	count = acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0);
	count =
	    acpi_table_parse_madt(ACPI_MADT_LAPIC_NMI, acpi_parse_lapic_nmi, 0);
	if (count < 0) {
		printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
		/* TBD: Cleanup to allow fallback to MPS */
@@ -753,8 +740,7 @@ acpi_parse_madt_lapic_entries(void)
 * Parse IOAPIC related entries in MADT
 * returns 0 on success, < 0 on error
 */
static int __init
acpi_parse_madt_ioapic_entries(void)
static int __init acpi_parse_madt_ioapic_entries(void)
{
	int count;

@@ -777,19 +763,23 @@ acpi_parse_madt_ioapic_entries(void)
		return -ENODEV;
	}

	count = acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic, MAX_IO_APICS);
	count =
	    acpi_table_parse_madt(ACPI_MADT_IOAPIC, acpi_parse_ioapic,
				  MAX_IO_APICS);
	if (!count) {
		printk(KERN_ERR PREFIX "No IOAPIC entries present\n");
		return -ENODEV;
	}
	else if (count < 0) {
	} else if (count < 0) {
		printk(KERN_ERR PREFIX "Error parsing IOAPIC entry\n");
		return count;
	}

	count = acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr, NR_IRQ_VECTORS);
	count =
	    acpi_table_parse_madt(ACPI_MADT_INT_SRC_OVR, acpi_parse_int_src_ovr,
				  NR_IRQ_VECTORS);
	if (count < 0) {
		printk(KERN_ERR PREFIX "Error parsing interrupt source overrides entry\n");
		printk(KERN_ERR PREFIX
		       "Error parsing interrupt source overrides entry\n");
		/* TBD: Cleanup to allow fallback to MPS */
		return count;
	}
@@ -804,7 +794,9 @@ acpi_parse_madt_ioapic_entries(void)
	/* Fill in identity legacy mapings where no override */
	mp_config_acpi_legacy_irqs();

	count = acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src, NR_IRQ_VECTORS);
	count =
	    acpi_table_parse_madt(ACPI_MADT_NMI_SRC, acpi_parse_nmi_src,
				  NR_IRQ_VECTORS);
	if (count < 0) {
		printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
		/* TBD: Cleanup to allow fallback to MPS */
@@ -820,9 +812,7 @@ static inline int acpi_parse_madt_ioapic_entries(void)
}
#endif				/* !(CONFIG_X86_IO_APIC && CONFIG_ACPI_INTERPRETER) */


static void __init
acpi_process_madt(void)
static void __init acpi_process_madt(void)
{
#ifdef CONFIG_X86_LOCAL_APIC
	int count, error;
@@ -854,7 +844,8 @@ acpi_process_madt(void)
			/*
			 * Dell Precision Workstation 410, 610 come here.
			 */
			printk(KERN_ERR PREFIX "Invalid BIOS MADT, disabling ACPI\n");
			printk(KERN_ERR PREFIX
			       "Invalid BIOS MADT, disabling ACPI\n");
			disable_acpi();
		}
	}
@@ -906,7 +897,8 @@ static int __init dmi_disable_acpi(struct dmi_system_id *d)
static int __init force_acpi_ht(struct dmi_system_id *d)
{
	if (!acpi_force) {
		printk(KERN_NOTICE "%s detected: force use of acpi=ht\n", d->ident);
		printk(KERN_NOTICE "%s detected: force use of acpi=ht\n",
		       d->ident);
		disable_acpi();
		acpi_ht = 1;
	} else {
@@ -1044,7 +1036,8 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC"),
		     DMI_MATCH(DMI_BOARD_NAME, "<A7V>"),
		     /* newer BIOS, Revision 1011, does work */
			DMI_MATCH(DMI_BIOS_VERSION, "ASUS A7V ACPI BIOS Revision 1007"),
		     DMI_MATCH(DMI_BIOS_VERSION,
			       "ASUS A7V ACPI BIOS Revision 1007"),
		     },
	 },

@@ -1057,7 +1050,8 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
	 .matches = {
		     DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
		     DMI_MATCH(DMI_BOARD_NAME, "PR-DLS"),
			DMI_MATCH(DMI_BIOS_VERSION, "ASUS PR-DLS ACPI BIOS Revision 1010"),
		     DMI_MATCH(DMI_BIOS_VERSION,
			       "ASUS PR-DLS ACPI BIOS Revision 1010"),
		     DMI_MATCH(DMI_BIOS_DATE, "03/21/2003")
		     },
	 },
@@ -1098,8 +1092,7 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
 *	!0: failure
 */

int __init
acpi_boot_table_init(void)
int __init acpi_boot_table_init(void)
{
	int error;

@@ -1122,7 +1115,6 @@ acpi_boot_table_init(void)
		disable_acpi();
		return error;
	}

#ifdef __i386__
	check_acpi_pci();
#endif
@@ -1146,7 +1138,6 @@ acpi_boot_table_init(void)
	return 0;
}


int __init acpi_boot_init(void)
{
	/*
@@ -1172,4 +1163,3 @@ int __init acpi_boot_init(void)

	return 0;
}
+18 −17
Original line number Diff line number Diff line
@@ -24,7 +24,8 @@ static void init_low_mapping(pgd_t *pgd, int pgd_limit)
{
	int pgd_ofs = 0;

	while ((pgd_ofs < pgd_limit) && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) {
	while ((pgd_ofs < pgd_limit)
	       && (pgd_ofs + USER_PTRS_PER_PGD < PTRS_PER_PGD)) {
		set_pgd(pgd, *(pgd + USER_PTRS_PER_PGD));
		pgd_ofs++, pgd++;
	}
@@ -42,7 +43,8 @@ int acpi_save_state_mem (void)
	if (!acpi_wakeup_address)
		return 1;
	init_low_mapping(swapper_pg_dir, USER_PTRS_PER_PGD);
	memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start);
	memcpy((void *)acpi_wakeup_address, &wakeup_start,
	       &wakeup_end - &wakeup_start);
	acpi_copy_wakeup_routine(acpi_wakeup_address);

	return 0;
@@ -67,7 +69,8 @@ void acpi_restore_state_mem (void)
void __init acpi_reserve_bootmem(void)
{
	if ((&wakeup_end - &wakeup_start) > PAGE_SIZE) {
		printk(KERN_ERR "ACPI: Wakeup code way too big, S3 disabled.\n");
		printk(KERN_ERR
		       "ACPI: Wakeup code way too big, S3 disabled.\n");
		return;
	}

@@ -90,10 +93,8 @@ static int __init acpi_sleep_setup(char *str)
	return 1;
}


__setup("acpi_sleep=", acpi_sleep_setup);


static __init int reset_videomode_after_s3(struct dmi_system_id *d)
{
	acpi_video_flags |= 2;
+21 −16
Original line number Diff line number Diff line
@@ -50,7 +50,9 @@ acpi_vendor_resource_match(struct acpi_resource *resource, void *context)
	if (!info->data)
		return AE_NO_MEMORY;

	memcpy(info->data, vendor->reserved + sizeof(struct acpi_vendor_descriptor), length);
	memcpy(info->data,
	       vendor->reserved + sizeof(struct acpi_vendor_descriptor),
	       length);
	info->length = length;
	return AE_CTRL_TERMINATE;
}
@@ -64,7 +66,8 @@ acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor *id,
	info.descriptor = id;
	info.data = NULL;

	acpi_walk_resources(obj, METHOD_NAME__CRS, acpi_vendor_resource_match, &info);
	acpi_walk_resources(obj, METHOD_NAME__CRS, acpi_vendor_resource_match,
			    &info);
	if (!info.data)
		return AE_NOT_FOUND;

@@ -75,17 +78,19 @@ acpi_find_vendor_resource(acpi_handle obj, struct acpi_vendor_descriptor *id,

struct acpi_vendor_descriptor hp_ccsr_descriptor = {
	.guid_id = 2,
	.guid    = EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, 0xf6, 0x4a, 0x24, 0xd2, 0x01, 0x37, 0x0e, 0xad)
	.guid =
	    EFI_GUID(0x69e9adf9, 0x924f, 0xab5f, 0xf6, 0x4a, 0x24, 0xd2, 0x01,
		     0x37, 0x0e, 0xad)
};

acpi_status
hp_acpi_csr_space(acpi_handle obj, u64 *csr_base, u64 *csr_length)
acpi_status hp_acpi_csr_space(acpi_handle obj, u64 * csr_base, u64 * csr_length)
{
	acpi_status status;
	u8 *data;
	u32 length;

	status = acpi_find_vendor_resource(obj, &hp_ccsr_descriptor, &data, &length);
	status =
	    acpi_find_vendor_resource(obj, &hp_ccsr_descriptor, &data, &length);

	if (ACPI_FAILURE(status) || length != 16)
		return AE_NOT_FOUND;
+167 −157

File changed.

Preview size limit exceeded, changes collapsed.

+10 −7
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@
#include <asm/proto.h>
#include <asm/tlbflush.h>


/* --------------------------------------------------------------------------
                              Low-Level Sleep Support
   -------------------------------------------------------------------------- */
@@ -81,7 +80,8 @@ int acpi_save_state_mem (void)
{
	init_low_mapping();

	memcpy((void *) acpi_wakeup_address, &wakeup_start, &wakeup_end - &wakeup_start);
	memcpy((void *)acpi_wakeup_address, &wakeup_start,
	       &wakeup_end - &wakeup_start);
	acpi_copy_wakeup_routine(acpi_wakeup_address);

	return 0;
@@ -108,7 +108,8 @@ void __init acpi_reserve_bootmem(void)
{
	acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE);
	if ((&wakeup_end - &wakeup_start) > PAGE_SIZE)
		printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
		printk(KERN_CRIT
		       "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
}

static int __init acpi_sleep_setup(char *str)
@@ -129,4 +130,6 @@ __setup("acpi_sleep=", acpi_sleep_setup);

#endif				/*CONFIG_ACPI_SLEEP */

void acpi_pci_link_exit(void) {}
void acpi_pci_link_exit(void)
{
}
Loading