From: deraadt Date: Wed, 21 Jul 2010 15:07:40 +0000 (+0000) Subject: clean up a pile of prototypes and shred some macros which were just covering X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3c1b5b89b0100ba2d70574d443ae4d6d6616e1f3;p=openbsd clean up a pile of prototypes and shred some macros which were just covering for ones everyone knows better --- diff --git a/sys/dev/acpi/acpiprt.c b/sys/dev/acpi/acpiprt.c index cc8daaf11c6..5b9da688ca0 100644 --- a/sys/dev/acpi/acpiprt.c +++ b/sys/dev/acpi/acpiprt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpiprt.c,v 1.40 2010/07/10 04:59:55 jordan Exp $ */ +/* $OpenBSD: acpiprt.c,v 1.41 2010/07/21 15:07:40 deraadt Exp $ */ /* * Copyright (c) 2006 Mark Kettenis * @@ -148,10 +148,10 @@ acpiprt_getirq(union acpi_resource *crs, void *arg) typ = AML_CRSTYPE(crs); switch (typ) { case SR_IRQ: - *irq = ffs(aml_letohost16(crs->sr_irq.irq_mask)) - 1; + *irq = ffs(letoh16(crs->sr_irq.irq_mask)) - 1; break; case LR_EXTIRQ: - *irq = aml_letohost32(crs->lr_extirq.irq[0]); + *irq = letoh32(crs->lr_extirq.irq[0]); break; default: printf("unknown interrupt: %x\n", typ); diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index f690b152aa5..3c09f9f3467 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.169 2010/07/20 12:14:10 deraadt Exp $ */ +/* $OpenBSD: dsdt.c,v 1.170 2010/07/21 15:07:40 deraadt Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave * @@ -47,7 +47,8 @@ #define AML_INTSTRLEN 16 #define AML_NAMESEG_LEN 4 -struct acpi_q *acpi_maptable(struct acpi_softc *sc, paddr_t, const char *, const char *, +struct acpi_q *acpi_maptable(struct acpi_softc *sc, paddr_t, + const char *, const char *, const char *, int); struct aml_scope *aml_load(struct acpi_softc *, struct aml_scope *, struct aml_value *, struct aml_value *); @@ -69,8 +70,8 @@ int aml_msb(u_int64_t); int aml_tstbit(const u_int8_t *, int); void aml_setbit(u_int8_t *, int, int); -void aml_xaddref(struct aml_value *, const char *); -void aml_xdelref(struct aml_value **, const char *); +void aml_xaddref(struct aml_value *, const char *); +void aml_xdelref(struct aml_value **, const char *); void aml_bufcpy(void *, int, const void *, int, int); @@ -581,7 +582,8 @@ aml_notify_dev(const char *pnpid, int notify_value) pdata->cbproc(pdata->node, notify_value, pdata->cbarg); } -void acpi_poll_notify(void) +void +acpi_poll_notify(void) { struct aml_notify_data *pdata = NULL; @@ -1565,10 +1567,10 @@ aml_print_resource(union acpi_resource *crs, void *arg) case LR_EXTIRQ: printf("extirq\tflags:%.2x len:%.2x irq:%.4x\n", crs->lr_extirq.flags, crs->lr_extirq.irq_count, - aml_letohost32(crs->lr_extirq.irq[0])); + letoh32(crs->lr_extirq.irq[0])); break; case SR_IRQ: - printf("irq\t%.4x %.2x\n", aml_letohost16(crs->sr_irq.irq_mask), + printf("irq\t%.4x %.2x\n", letoh16(crs->sr_irq.irq_mask), crs->sr_irq.irq_flags); break; case SR_DMA: diff --git a/sys/dev/acpi/dsdt.h b/sys/dev/acpi/dsdt.h index 98e4ef1cbf8..522229e545e 100644 --- a/sys/dev/acpi/dsdt.h +++ b/sys/dev/acpi/dsdt.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.h,v 1.50 2010/07/20 05:49:53 deraadt Exp $ */ +/* $OpenBSD: dsdt.h,v 1.51 2010/07/21 15:07:40 deraadt Exp $ */ /* * Copyright (c) 2005 Marco Peereboom * @@ -216,11 +216,6 @@ int aml_parse_resource(struct aml_value *, #define AML_MAX_ARG 7 #define AML_MAX_LOCAL 8 -/* XXX: endian macros */ -#define aml_letohost16(x) letoh16(x) -#define aml_letohost32(x) letoh32(x) -#define aml_letohost64(x) letoh64(x) - #define AML_WALK_PRE 0x00 #define AML_WALK_POST 0x01 @@ -232,27 +227,26 @@ void acpi_poll_notify(void); void aml_hashopcodes(void); -void aml_foreachpkg(struct aml_value *, int, - void (*fn)(struct aml_value *, void *), void *); +void aml_foreachpkg(struct aml_value *, int, + void (*fn)(struct aml_value *, void *), void *); -const char *aml_val_to_string(const struct aml_value *); +const char *aml_val_to_string(const struct aml_value *); -int valid_acpihdr(void *, int, const char *); -void aml_disasm(struct aml_scope *scope, int lvl, - void (*dbprintf)(void *, const char *, ...), - void *arg); -int aml_xgetpci(struct aml_node *, int64_t *); -int aml_evalhid(struct aml_node *, struct aml_value *); +int valid_acpihdr(void *, int, const char *); +void aml_disasm(struct aml_scope *scope, int lvl, + void (*dbprintf)(void *, const char *, ...), + void *arg); +int aml_xgetpci(struct aml_node *, int64_t *); +int aml_evalhid(struct aml_node *, struct aml_value *); -int acpi_walkmem(int, const char *); +int acpi_walkmem(int, const char *); #define aml_get8(p) *(uint8_t *)(p) #define aml_get16(p) *(uint16_t *)(p) #define aml_get32(p) *(uint32_t *)(p) #define aml_get64(p) *(uint64_t *)(p) -union amlpci_t -{ +union amlpci_t { uint64_t addr; struct { uint16_t reg; @@ -261,10 +255,11 @@ union amlpci_t uint16_t bus; }; }; -int aml_rdpciaddr(struct aml_node *pcidev, union amlpci_t *); +int aml_rdpciaddr(struct aml_node *pcidev, + union amlpci_t *); -void acpi_getdevlist(struct acpi_devlist_head *, struct aml_node *, - struct aml_value *, int); -void acpi_freedevlist(struct acpi_devlist_head *); +void acpi_getdevlist(struct acpi_devlist_head *, + struct aml_node *, struct aml_value *, int); +void acpi_freedevlist(struct acpi_devlist_head *); #endif /* __DEV_ACPI_DSDT_H__ */