diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/acpi/acpi.c | 22 | ||||
-rw-r--r-- | sys/dev/acpi/acpibat.c | 4 | ||||
-rw-r--r-- | sys/dev/acpi/acpidebug.c | 8 | ||||
-rw-r--r-- | sys/dev/acpi/acpimadt.c | 32 | ||||
-rw-r--r-- | sys/dev/acpi/acpiprt.c | 15 | ||||
-rw-r--r-- | sys/dev/acpi/acpivar.h | 6 | ||||
-rw-r--r-- | sys/dev/acpi/dsdt.h | 4 |
7 files changed, 45 insertions, 46 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 12b4c78470c..645fc909f86 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.72 2006/12/21 05:57:17 marco Exp $ */ +/* $OpenBSD: acpi.c,v 1.73 2006/12/21 19:59:02 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -156,7 +156,7 @@ acpi_gasio(struct acpi_softc *sc, int iodir, int iospace, uint64_t address, printf("Unable to map iospace!\n"); return (-1); } - for (reg=0; reg < len; reg += access_size) { + for (reg = 0; reg < len; reg += access_size) { if (iodir == ACPI_IOREAD) { switch (access_size) { case 1: @@ -222,7 +222,7 @@ acpi_gasio(struct acpi_softc *sc, int iodir, int iospace, uint64_t address, /* XXX: This is ugly. read-modify-write does a byte at a time */ reg = ACPI_PCI_REG(address); - for (idx=reg; idx<reg+len; idx++) { + for (idx = reg; idx < reg+len; idx++) { ival = pci_conf_read(pc, tag, idx & ~0x3); if (iodir == ACPI_IOREAD) { *pb = ival >> (8 * (idx & 0x3)); @@ -1058,14 +1058,14 @@ acpi_interrupt(void *arg) processed = 0; dnprintf(40, "ACPI Interrupt\n"); - for (idx=0; idx<sc->sc_lastgpe; idx+=8) { + for (idx = 0; idx < sc->sc_lastgpe; idx += 8) { sts = acpi_read_pmreg(sc, ACPIREG_GPE_STS, idx>>3); en = acpi_read_pmreg(sc, ACPIREG_GPE_EN, idx>>3); if (en & sts) { dnprintf(10, "GPE block: %.2x %.2x %.2x\n", idx, sts, en); acpi_write_pmreg(sc, ACPIREG_GPE_EN, idx>>3, en & ~sts); - for (jdx=0; jdx<8; jdx++) { + for (jdx = 0; jdx < 8; jdx++) { if (en & sts & (1L << jdx)) { /* Signal this GPE */ sc->gpe_table[idx+jdx].active = 1; @@ -1188,24 +1188,24 @@ acpi_init_gpes(struct acpi_softc *sc) ngpe = 0; /* Clear GPE status */ - for (idx=0; idx<sc->sc_lastgpe; idx+=8) { + for (idx = 0; idx < sc->sc_lastgpe; idx += 8) { acpi_write_pmreg(sc, ACPIREG_GPE_EN, idx>>3, 0); acpi_write_pmreg(sc, ACPIREG_GPE_STS, idx>>3, -1); } - for (idx=0; idx<sc->sc_lastgpe; idx++) { + for (idx = 0; idx < sc->sc_lastgpe; idx++) { /* Search Level-sensitive GPES */ snprintf(name, sizeof(name), "\\_GPE._L%.2X", idx); gpe = aml_searchname(&aml_root, name); if (gpe != NULL) acpi_set_gpehandler(sc, idx, acpi_gpe_level, gpe, - "level"); + "level"); if (gpe == NULL) { /* Search Edge-sensitive GPES */ snprintf(name, sizeof(name), "\\_GPE._E%.2X", idx); gpe = aml_searchname(&aml_root, name); if (gpe != NULL) acpi_set_gpehandler(sc, idx, acpi_gpe_edge, gpe, - "edge"); + "edge"); } } sc->sc_maxgpe = ngpe; @@ -1562,7 +1562,7 @@ acpi_isr_thread(void *arg) acpi_write_pmreg(sc, ACPIREG_PM1_EN, 0, flag); /* Enable handled GPEs here */ - for (gpe=0; gpe<sc->sc_lastgpe; gpe++) { + for (gpe = 0; gpe < sc->sc_lastgpe; gpe++) { if (sc->gpe_table[gpe].handler) acpi_enable_onegpe(sc, gpe, 1); } @@ -1575,7 +1575,7 @@ acpi_isr_thread(void *arg) sc->sc_wakeup = 1; dnprintf(10, "wakeup..\n"); - for (gpe=0; gpe < sc->sc_lastgpe; gpe++) { + for (gpe = 0; gpe < sc->sc_lastgpe; gpe++) { struct gpe_block *pgpe = &sc->gpe_table[gpe]; if (pgpe->active) { diff --git a/sys/dev/acpi/acpibat.c b/sys/dev/acpi/acpibat.c index 69809962308..ca8e76b0d8c 100644 --- a/sys/dev/acpi/acpibat.c +++ b/sys/dev/acpi/acpibat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpibat.c,v 1.34 2006/12/21 13:10:57 marco Exp $ */ +/* $OpenBSD: acpibat.c,v 1.35 2006/12/21 19:59:02 deraadt Exp $ */ /* * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * @@ -88,7 +88,7 @@ acpibat_attach(struct device *parent, struct device *self, void *aux) sc->sc_bif.bif_oem); } else printf(": %s: not present\n", sc->sc_devnode->parent->name); - + aml_freevalue(&res); /* create sensors */ diff --git a/sys/dev/acpi/acpidebug.c b/sys/dev/acpi/acpidebug.c index 3aaa7995afb..f11b1cf7934 100644 --- a/sys/dev/acpi/acpidebug.c +++ b/sys/dev/acpi/acpidebug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpidebug.c,v 1.13 2006/12/21 11:29:58 deraadt Exp $ */ +/* $OpenBSD: acpidebug.c,v 1.14 2006/12/21 19:59:02 deraadt Exp $ */ /* * Copyright (c) 2006 Marco Peereboom <marco@openbsd.org> * @@ -485,8 +485,8 @@ db_aml_disasm(struct aml_node *root, uint8_t *start, uint8_t *end, break; /* Method calls */ - for (idx=0; - idx<AML_METHOD_ARGCOUNT(node->value->v_method.flags); + for (idx = 0; + idx < AML_METHOD_ARGCOUNT(node->value->v_method.flags); idx++) { scope->pos = db_aml_disasm(node, scope->pos, scope->end, 1, depth+1); @@ -510,7 +510,7 @@ db_aml_disasm(struct aml_node *root, uint8_t *start, uint8_t *end, break; case 'B': tmpstr = malloc(16 * 6 + 1, M_DEVBUF, M_WAITOK); - for (idx=0; idx<min(end-scope->pos, 8); idx++) + for (idx = 0; idx < min(end-scope->pos, 8); idx++) snprintf(tmpstr+idx*6, 7, "0x%.2x, ", scope->pos[idx]); db_aml_disline(pos, depth+1, "ByteList <%s>\n", tmpstr); diff --git a/sys/dev/acpi/acpimadt.c b/sys/dev/acpi/acpimadt.c index d26a21f2347..e7a339c77b9 100644 --- a/sys/dev/acpi/acpimadt.c +++ b/sys/dev/acpi/acpimadt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpimadt.c,v 1.4 2006/12/21 11:33:21 deraadt Exp $ */ +/* $OpenBSD: acpimadt.c,v 1.5 2006/12/21 19:59:02 deraadt Exp $ */ /* * Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org> * @@ -134,12 +134,12 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux) while (addr < (caddr_t)madt + madt->hdr.length) { union acpi_madt_entry *entry = (union acpi_madt_entry *)addr; - switch(entry->madt_lapic.apic_type) { + switch (entry->madt_lapic.apic_type) { case ACPI_MADT_LAPIC: printf("LAPIC: acpi_proc_id %x, apic_id %x, flags 0x%x\n", - entry->madt_lapic.acpi_proc_id, - entry->madt_lapic.apic_id, - entry->madt_lapic.flags); + entry->madt_lapic.acpi_proc_id, + entry->madt_lapic.apic_id, + entry->madt_lapic.flags); { struct cpu_attach_args caa; @@ -165,9 +165,9 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux) break; case ACPI_MADT_IOAPIC: printf("IOAPIC: acpi_ioapic_id %x, address 0x%x, global_int_base 0x%x\n", - entry->madt_ioapic.acpi_ioapic_id, - entry->madt_ioapic.address, - entry->madt_ioapic.global_int_base); + entry->madt_ioapic.acpi_ioapic_id, + entry->madt_ioapic.address, + entry->madt_ioapic.global_int_base); { struct apic_attach_args aaa; @@ -190,17 +190,17 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux) while (addr < (caddr_t)madt + madt->hdr.length) { union acpi_madt_entry *entry = (union acpi_madt_entry *)addr; - switch(entry->madt_lapic.apic_type) { + switch (entry->madt_lapic.apic_type) { case ACPI_MADT_LAPIC: case ACPI_MADT_IOAPIC: break; case ACPI_MADT_OVERRIDE: printf("OVERRIDE: bus %x, source %x, global_int %x, flags %x\n", - entry->madt_override.bus, - entry->madt_override.source, - entry->madt_override.global_int, - entry->madt_override.flags); + entry->madt_override.bus, + entry->madt_override.source, + entry->madt_override.global_int, + entry->madt_override.flags); pin = entry->madt_override.global_int; apic = ioapic_find_bybase(pin); @@ -220,7 +220,8 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux) acpimadt_cfg_intr(entry->madt_override.flags, &map->redir); map->ioapic_ih = APIC_INT_VIA_APIC | - ((apic->sc_apicid << APIC_INT_APIC_SHIFT) | (pin << APIC_INT_PIN_SHIFT)); + ((apic->sc_apicid << APIC_INT_APIC_SHIFT) | + (pin << APIC_INT_PIN_SHIFT)); apic->sc_pins[pin].ip_map = map; @@ -254,7 +255,8 @@ acpimadt_attach(struct device *parent, struct device *self, void *aux) map->redir = (IOAPIC_REDLO_DEL_LOPRI << IOAPIC_REDLO_DEL_SHIFT); map->ioapic_ih = APIC_INT_VIA_APIC | - ((apic->sc_apicid << APIC_INT_APIC_SHIFT) | (pin << APIC_INT_PIN_SHIFT)); + ((apic->sc_apicid << APIC_INT_APIC_SHIFT) | + (pin << APIC_INT_PIN_SHIFT)); apic->sc_pins[pin].ip_map = map; diff --git a/sys/dev/acpi/acpiprt.c b/sys/dev/acpi/acpiprt.c index 5366d46f13d..1bee1cfcfe4 100644 --- a/sys/dev/acpi/acpiprt.c +++ b/sys/dev/acpi/acpiprt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpiprt.c,v 1.10 2006/12/21 11:33:21 deraadt Exp $ */ +/* $OpenBSD: acpiprt.c,v 1.11 2006/12/21 19:59:02 deraadt Exp $ */ /* * Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org> * @@ -115,7 +115,7 @@ acpiprt_getirq(union acpi_resource *crs, void *arg) int *irq = (int *)arg; int typ; - typ=AML_CRSTYPE(crs); + typ = AML_CRSTYPE(crs); switch (typ) { case SR_IRQ: *irq = ffs(aml_letohost16(crs->sr_irq.irq_mask)) - 1; @@ -171,29 +171,26 @@ acpiprt_prt_add(struct acpiprt_softc *sc, struct aml_value *v) } if (pp->type == AML_OBJTYPE_DEVICE) { node = pp->node; - if (aml_evalname(sc->sc_acpi, node, "_STA", 0, NULL, &res)) { + if (aml_evalname(sc->sc_acpi, node, "_STA", 0, NULL, &res)) printf("no _STA method\n"); - } sta = aml_val2int(&res); - if (aml_evalname(sc->sc_acpi, node, "_CRS", 0, NULL, &res)) { + if (aml_evalname(sc->sc_acpi, node, "_CRS", 0, NULL, &res)) printf("no _CRS method\n"); - } if (res.type != AML_OBJTYPE_BUFFER || res.length < 6) { printf("invalid _CRS object\n"); return; } aml_parse_resource(res.length, res.v_buffer, - acpiprt_getirq, - &irq); + acpiprt_getirq, &irq); } else { irq = aml_val2int(v->v_package[3]); } #ifdef ACPI_DEBUG printf("%s: %s addr 0x%llx pin %d irq %d sta %x\n", - DEVNAME(sc), aml_nodename(pp->node), addr, pin, irq, sta); + DEVNAME(sc), aml_nodename(pp->node), addr, pin, irq, sta); #endif #if NIOAPIC > 0 diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h index 9f06042cbe6..ee3c728f6ac 100644 --- a/sys/dev/acpi/acpivar.h +++ b/sys/dev/acpi/acpivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acpivar.h,v 1.31 2006/12/21 11:33:21 deraadt Exp $ */ +/* $OpenBSD: acpivar.h,v 1.32 2006/12/21 19:59:02 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * @@ -24,8 +24,8 @@ /* #define ACPI_DEBUG */ #ifdef ACPI_DEBUG extern int acpi_debug; -#define dprintf(x...) do { if (acpi_debug) printf(x); } while(0) -#define dnprintf(n,x...) do { if (acpi_debug > (n)) printf(x); } while(0) +#define dprintf(x...) do { if (acpi_debug) printf(x); } while (0) +#define dnprintf(n,x...) do { if (acpi_debug > (n)) printf(x); } while (0) #else #define dprintf(x...) #define dnprintf(n,x...) diff --git a/sys/dev/acpi/dsdt.h b/sys/dev/acpi/dsdt.h index 38568a3b4dc..319be28d0d7 100644 --- a/sys/dev/acpi/dsdt.h +++ b/sys/dev/acpi/dsdt.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.h,v 1.22 2006/12/21 11:23:41 deraadt Exp $ */ +/* $OpenBSD: dsdt.h,v 1.23 2006/12/21 19:59:02 deraadt Exp $ */ /* * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * @@ -110,7 +110,7 @@ union acpi_resource { uint8_t typecode; uint16_t length; } __packed hdr; - + /* Small resource structures * format of typecode is: tttttlll, t = type, l = length */ |