From: deraadt Date: Wed, 21 Jul 2010 19:35:15 +0000 (+0000) Subject: spacing and indents that are driving me crazy X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=16da9be3a79758b9bc76f6e358aa1c5ce28e5ff9;p=openbsd spacing and indents that are driving me crazy --- diff --git a/sys/dev/acpi/acpibat.c b/sys/dev/acpi/acpibat.c index ea6e1876b07..ee6bcdb9977 100644 --- a/sys/dev/acpi/acpibat.c +++ b/sys/dev/acpi/acpibat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpibat.c,v 1.55 2009/11/24 21:37:42 deraadt Exp $ */ +/* $OpenBSD: acpibat.c,v 1.56 2010/07/21 19:35:15 deraadt Exp $ */ /* * Copyright (c) 2005 Marco Peereboom * @@ -405,7 +405,7 @@ acpibat_notify(struct aml_node *node, int notify_type, void *arg) /* Check if installed state of battery has changed */ if (aml_evalinteger(sc->sc_acpi, node, "_STA", 0, NULL, &sta) == 0) { - present = sta & STA_BATTERY; + present = sta & STA_BATTERY; if (!sc->sc_bat_present && present) sc->sc_bat_present = 1; else if (sc->sc_bat_present && !present) diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c index 0e6a3ab90d5..1a62b4dc1a6 100644 --- a/sys/dev/acpi/acpicpu.c +++ b/sys/dev/acpi/acpicpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpicpu.c,v 1.56 2009/08/29 11:01:15 miod Exp $ */ +/* $OpenBSD: acpicpu.c,v 1.57 2010/07/21 19:35:15 deraadt Exp $ */ /* * Copyright (c) 2005 Marco Peereboom * @@ -579,7 +579,7 @@ acpicpu_getpss(struct acpicpu_softc *sc) for (i = 0; i < res.length; i++) { cf = aml_val2int(res.v_package[i]->v_package[0]); - /* This heuristic comes from FreeBSDs + /* This heuristic comes from FreeBSDs * dev/acpica/acpi_perf.c to weed out invalid PSS entries. */ if (cf == sc->sc_pss[c].pss_core_freq) { diff --git a/sys/dev/acpi/acpidebug.c b/sys/dev/acpi/acpidebug.c index b5cf136af7c..2e4db02618f 100644 --- a/sys/dev/acpi/acpidebug.c +++ b/sys/dev/acpi/acpidebug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpidebug.c,v 1.26 2010/07/08 20:56:31 jordan Exp $ */ +/* $OpenBSD: acpidebug.c,v 1.27 2010/07/21 19:35:15 deraadt Exp $ */ /* * Copyright (c) 2006 Marco Peereboom * @@ -36,8 +36,8 @@ extern int aml_pc(uint8_t *); extern const char *aml_mnem(int opcode, uint8_t *); extern const char *aml_nodename(struct aml_node *); -extern void aml_disasm(struct aml_scope *scope, int lvl, - void (*dbprintf)(void *, const char *, ...), +extern void aml_disasm(struct aml_scope *scope, int lvl, + void (*dbprintf)(void *, const char *, ...), void *arg); const char *db_aml_objtype(struct aml_value *); @@ -46,7 +46,7 @@ int db_parse_name(void); void db_aml_dump(int, u_int8_t *); void db_aml_showvalue(struct aml_value *); void db_aml_walktree(struct aml_node *); -void db_disprint(void *, const char *, ...); +void db_disprint(void *, const char *, ...); const char *db_aml_fieldacc(int); const char *db_aml_fieldlock(int); @@ -171,7 +171,7 @@ db_aml_showvalue(struct aml_value *value) aml_mnem(value->v_field.type, NULL), value->v_field.bitpos, value->v_field.bitlen); - db_printf(" buffer: %s\n", + db_printf(" buffer: %s\n", aml_nodename(value->v_field.ref1->node)); break; case AML_OBJTYPE_OPREGION: @@ -299,7 +299,7 @@ void db_disprint(void *arg, const char *fmt, ...) { va_list ap; char stre[64]; - + va_start(ap,fmt); vsnprintf(stre, sizeof(stre), fmt, ap); va_end(ap); diff --git a/sys/dev/acpi/acpidock.c b/sys/dev/acpi/acpidock.c index e63253902d1..964a6adfcb2 100644 --- a/sys/dev/acpi/acpidock.c +++ b/sys/dev/acpi/acpidock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpidock.c,v 1.39 2010/06/27 09:13:36 jordan Exp $ */ +/* $OpenBSD: acpidock.c,v 1.40 2010/07/21 19:35:15 deraadt Exp $ */ /* * Copyright (c) 2006,2007 Michael Knudsen * @@ -246,7 +246,7 @@ acpidock_notify(struct aml_node *node, int notify_type, void *arg) sizeof(sc->sc_sens.desc)); printf("%s: %s\n", - DEVNAME(sc), sc->sc_docked == ACPIDOCK_STATUS_DOCKED ? + DEVNAME(sc), sc->sc_docked == ACPIDOCK_STATUS_DOCKED ? "docked" : "undocked"); return (0); diff --git a/sys/dev/acpi/acpihpet.c b/sys/dev/acpi/acpihpet.c index 5e9496ea36c..96e9be987ba 100644 --- a/sys/dev/acpi/acpihpet.c +++ b/sys/dev/acpi/acpihpet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpihpet.c,v 1.11 2009/11/23 15:17:45 deraadt Exp $ */ +/* $OpenBSD: acpihpet.c,v 1.12 2010/07/21 19:35:15 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * @@ -54,10 +54,10 @@ struct acpihpet_softc { }; struct cfattach acpihpet_ca = { - sizeof(struct acpihpet_softc), - acpihpet_match, - acpihpet_attach, - NULL, + sizeof(struct acpihpet_softc), + acpihpet_match, + acpihpet_attach, + NULL, acpihpet_activate }; @@ -78,8 +78,8 @@ acpihpet_activate(struct device *self, int act) } return 0; -} - +} + int acpihpet_match(struct device *parent, void *match, void *aux) { diff --git a/sys/dev/acpi/acpiprt.c b/sys/dev/acpi/acpiprt.c index 5b9da688ca0..cf3258e9b48 100644 --- a/sys/dev/acpi/acpiprt.c +++ b/sys/dev/acpi/acpiprt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpiprt.c,v 1.41 2010/07/21 15:07:40 deraadt Exp $ */ +/* $OpenBSD: acpiprt.c,v 1.42 2010/07/21 19:35:15 deraadt Exp $ */ /* * Copyright (c) 2006 Mark Kettenis * @@ -168,7 +168,7 @@ acpiprt_pri[16] = { 2, /* Serial Port B */ 5, /* Parallel Port / Generic */ 2, /* Floppy Disk */ - 4, /* Parallel Port / Generic */ + 4, /* Parallel Port / Generic */ 1, /* RTC */ 6, /* Generic */ 7, /* Generic */ diff --git a/sys/dev/acpi/acpipwrres.c b/sys/dev/acpi/acpipwrres.c index 3981a53969f..8f3afccdbc7 100644 --- a/sys/dev/acpi/acpipwrres.c +++ b/sys/dev/acpi/acpipwrres.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpipwrres.c,v 1.3 2010/06/27 09:13:36 jordan Exp $ */ +/* $OpenBSD: acpipwrres.c,v 1.4 2010/07/21 19:35:15 deraadt Exp $ */ /* * Copyright (c) 2009 Paul Irofti * @@ -83,7 +83,7 @@ acpipwrres_match(struct device *parent, void *match, void *aux) struct acpi_attach_args *aaa = aux; struct cfdata *cf = match; - if (aaa->aaa_name == NULL || strcmp(aaa->aaa_name, + if (aaa->aaa_name == NULL || strcmp(aaa->aaa_name, cf->cf_driver->cd_name) != 0 || aaa->aaa_table != NULL) return (0); @@ -110,16 +110,16 @@ acpipwrres_attach(struct device *parent, struct device *self, void *aux) if (!aml_evalname(sc->sc_acpi, sc->sc_devnode, "_STA", 0, NULL, &res)) { sc->sc_state = (int)aml_val2int(&res); - if (sc->sc_state != ACPIPWRRES_ON && + if (sc->sc_state != ACPIPWRRES_ON && sc->sc_state != ACPIPWRRES_OFF) sc->sc_state = ACPIPWRRES_UNK; - } else + } else sc->sc_state = ACPIPWRRES_UNK; DPRINTF(("%s: state = %d\n", DEVNAME(sc), sc->sc_state)); if (aml_evalnode(sc->sc_acpi, aaa->aaa_node, 0, NULL, &res) == 0) { sc->sc_level = res.v_powerrsrc.pwr_level; sc->sc_order = res.v_powerrsrc.pwr_order; - DPRINTF(("%s: level = %d, order %d\n", DEVNAME(sc), + DPRINTF(("%s: level = %d, order %d\n", DEVNAME(sc), sc->sc_level, sc->sc_order)); aml_freevalue(&res); } @@ -136,13 +136,13 @@ int acpipwrres_notify(struct aml_node *node, int notify, void *arg) { int fmatch = 0; - struct acpipwrres_consumer *cons; + struct acpipwrres_consumer *cons; struct acpipwrres_softc *sc = arg; struct aml_value res; memset(&res, 0, sizeof res); - TAILQ_FOREACH(cons, &sc->sc_cons, cs_link) + TAILQ_FOREACH(cons, &sc->sc_cons, cs_link) if (cons->cs_node == node) { fmatch = 1; break; @@ -179,7 +179,7 @@ acpipwrres_foundcons(struct aml_node *node, void *arg) int i = 0; struct acpipwrres_consumer *cons; struct aml_node *pnode; - struct acpipwrres_softc *sc = (struct acpipwrres_softc *)arg; + struct acpipwrres_softc *sc = (struct acpipwrres_softc *)arg; struct aml_value res; extern struct aml_node aml_root; @@ -191,14 +191,14 @@ acpipwrres_foundcons(struct aml_node *node, void *arg) return (-1); } else { DPRINTF(("%s: node name %s\n", DEVNAME(sc), aml_nodename(node))); - if (!strcmp(node->name, "_PRW")) + if (!strcmp(node->name, "_PRW")) i = 2; /* _PRW first two values are ints */ for (; i < res.length; i++) { pnode = aml_searchname(&aml_root, res.v_package[i]->v_string); if (pnode == sc->sc_devnode) { DPRINTF(("%s: consumer match\n", DEVNAME(sc))); - cons = malloc(sizeof *cons, M_DEVBUF, + cons = malloc(sizeof *cons, M_DEVBUF, M_WAITOK | M_ZERO); cons->cs_node = pnode; TAILQ_INSERT_HEAD(&sc->sc_cons, cons, cs_link); diff --git a/sys/dev/acpi/acpireg.h b/sys/dev/acpi/acpireg.h index 44560e01f1f..1669bec11bc 100644 --- a/sys/dev/acpi/acpireg.h +++ b/sys/dev/acpi/acpireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acpireg.h,v 1.22 2010/06/29 22:08:29 jordan Exp $ */ +/* $OpenBSD: acpireg.h,v 1.23 2010/07/21 19:35:15 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert * Copyright (c) 2005 Marco Peereboom @@ -396,8 +396,8 @@ struct acpi_facs { u_int8_t reserved[31]; } __packed; -/* - * Intel ACPI DMA Remapping Entries +/* + * Intel ACPI DMA Remapping Entries */ struct acpidmar_devpath { uint8_t device; @@ -406,10 +406,10 @@ struct acpidmar_devpath { struct acpidmar_devscope { uint8_t type; -#define DMAR_ENDPOINT 0x1 -#define DMAR_BRIDGE 0x2 -#define DMAR_IOAPIC 0x3 -#define DMAR_HPET 0x4 +#define DMAR_ENDPOINT 0x1 +#define DMAR_BRIDGE 0x2 +#define DMAR_IOAPIC 0x3 +#define DMAR_HPET 0x4 uint8_t length; uint16_t reserved; uint8_t enumid; @@ -454,10 +454,10 @@ struct acpidmar_atsr { union acpidmar_entry { struct { uint16_t type; -#define DMAR_DRHD 0x0 -#define DMAR_RMRR 0x1 -#define DMAR_ATSR 0x2 -#define DMAR_RHSA 0x3 +#define DMAR_DRHD 0x0 +#define DMAR_RMRR 0x1 +#define DMAR_ATSR 0x2 +#define DMAR_RHSA 0x3 uint16_t length; } __packed; struct acpidmar_drhd drhd; @@ -474,8 +474,8 @@ struct acpi_dmar { /* struct acpidmar_entry[]; */ } __packed; -/* - * AMD I/O Virtualization Remapping Entries +/* + * AMD I/O Virtualization Remapping Entries */ union acpi_ivhd_entry { uint8_t type; diff --git a/sys/dev/acpi/acpitz.c b/sys/dev/acpi/acpitz.c index b31f17400ea..c5c5ea8aecc 100644 --- a/sys/dev/acpi/acpitz.c +++ b/sys/dev/acpi/acpitz.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpitz.c,v 1.37 2010/07/20 20:21:02 deraadt Exp $ */ +/* $OpenBSD: acpitz.c,v 1.38 2010/07/21 19:35:15 deraadt Exp $ */ /* * Copyright (c) 2006 Can Erkin Acar * Copyright (c) 2005 Marco Peereboom @@ -144,7 +144,7 @@ acpitz_init(struct acpitz_softc *sc, int flag) /* Read device lists */ if (flag & ACPITZ_DEVLIST) { - if (!aml_evalname(sc->sc_acpi, sc->sc_devnode, "_PSL", + if (!aml_evalname(sc->sc_acpi, sc->sc_devnode, "_PSL", 0, NULL, &res)) { acpi_freedevlist(&sc->sc_psl); acpi_getdevlist(&sc->sc_psl, sc->sc_devnode, &res, 0); @@ -155,7 +155,7 @@ acpitz_init(struct acpitz_softc *sc, int flag) if (!aml_evalname(sc->sc_acpi, sc->sc_devnode, name, 0, NULL, &res)) { acpi_freedevlist(&sc->sc_alx[i]); - acpi_getdevlist(&sc->sc_alx[i], + acpi_getdevlist(&sc->sc_alx[i], sc->sc_devnode, &res, 0); aml_freevalue(&res); } @@ -334,14 +334,14 @@ acpitz_refresh(void *arg) /* passive cooling */ if (sc->sc_lasttmp != -1 && sc->sc_tc1 != -1 && sc->sc_tc2 != -1 && sc->sc_psv != -1) { - dnprintf(30, "%s: passive cooling: lasttmp: %d tc1: %d " + dnprintf(30, "%s: passive cooling: lasttmp: %d tc1: %d " "tc2: %d psv: %d\n", DEVNAME(sc), sc->sc_lasttmp, sc->sc_tc1, sc->sc_tc2, sc->sc_psv); nperf = acpitz_perflevel; if (sc->sc_psv <= sc->sc_tmp) { /* Passive cooling enabled */ - dnprintf(1, "%s: enabling passive %d %d\n", + dnprintf(1, "%s: enabling passive %d %d\n", DEVNAME(sc), sc->sc_tmp, sc->sc_psv); if (!sc->sc_pse) sc->sc_acpi->sc_pse++; @@ -353,12 +353,12 @@ acpitz_refresh(void *arg) /* Depending on trend, slow down/speed up */ if (trend > 0) nperf -= PERFSTEP; - else + else nperf += PERFSTEP; } else { /* Passive cooling disabled, increase % */ - dnprintf(1, "%s: disabling passive %d %d\n", + dnprintf(1, "%s: disabling passive %d %d\n", DEVNAME(sc), sc->sc_tmp, sc->sc_psv); if (sc->sc_pse) sc->sc_acpi->sc_pse--; diff --git a/sys/dev/acpi/acpivout.c b/sys/dev/acpi/acpivout.c index e62f9cda79e..425d04975fc 100644 --- a/sys/dev/acpi/acpivout.c +++ b/sys/dev/acpi/acpivout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpivout.c,v 1.5 2009/06/19 06:23:03 kettenis Exp $ */ +/* $OpenBSD: acpivout.c,v 1.6 2010/07/21 19:35:15 deraadt Exp $ */ /* * Copyright (c) 2009 Paul Irofti * @@ -61,9 +61,9 @@ struct acpivout_softc { int sc_dod; int sc_vout_type; -#define ACPIVOUT_OTHER 0 +#define ACPIVOUT_OTHER 0 #define ACPIVOUT_VGA 1 -#define ACPIVOUT_TV 2 +#define ACPIVOUT_TV 2 #define ACPIVOUT_DVI 3 #define ACPIVOUT_LCD 4 diff --git a/sys/dev/acpi/amltypes.h b/sys/dev/acpi/amltypes.h index d8f5523aa27..c3c3305627b 100644 --- a/sys/dev/acpi/amltypes.h +++ b/sys/dev/acpi/amltypes.h @@ -1,4 +1,4 @@ -/* $OpenBSD: amltypes.h,v 1.37 2010/07/08 20:56:31 jordan Exp $ */ +/* $OpenBSD: amltypes.h,v 1.38 2010/07/21 19:35:15 deraadt Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave * @@ -313,7 +313,7 @@ struct aml_value { int synclvl; int savelvl; int count; - char ownername[5]; + char ownername[5]; struct aml_scope *owner; struct aml_waitq_head waiters; } Vmutex; diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index 3c09f9f3467..00b2917839d 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.170 2010/07/21 15:07:40 deraadt Exp $ */ +/* $OpenBSD: dsdt.c,v 1.171 2010/07/21 19:35:15 deraadt Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave * @@ -47,11 +47,11 @@ #define AML_INTSTRLEN 16 #define AML_NAMESEG_LEN 4 -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 *); +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 *); void aml_copyvalue(struct aml_value *, struct aml_value *); @@ -271,7 +271,6 @@ _aml_die(const char *fn, int line, const char *fmt, ...) #ifndef SMALL_KERNEL struct aml_scope *root; struct aml_value *sp; - int idx; #endif /* SMALL_KERNEL */ va_list ap; @@ -312,7 +311,8 @@ aml_hashopcodes(void) int i; /* Dynamically allocate hash table */ - aml_ophash = (struct aml_opcode **)acpi_os_malloc(HASH_SIZE*sizeof(struct aml_opcode *)); + aml_ophash = (struct aml_opcode **)acpi_os_malloc(HASH_SIZE * + sizeof(struct aml_opcode *)); for (i = 0; i < sizeof(aml_table) / sizeof(aml_table[0]); i++) aml_ophash[HASH_KEY(aml_table[i].opcode)] = &aml_table[i]; } @@ -429,7 +429,7 @@ _acpi_os_free(void *ptr, const char *fn, int line) sptr = &(((struct acpi_memblock *)ptr)[-1]); acpi_nalloc -= sptr->size; -#ifdef ACPI_MEMDEBUG +#ifdef ACPI_MEMDEBUG LIST_REMOVE(sptr, link); #endif @@ -723,7 +723,7 @@ void aml_lockfield(struct aml_scope *, struct aml_value *); long acpi_acquire_global_lock(void*); long acpi_release_global_lock(void*); static long global_lock_count = 0; -#define acpi_acquire_global_lock(x) 1 +#define acpi_acquire_global_lock(x) 1 #define acpi_release_global_lock(x) 0 void aml_lockfield(struct aml_scope *scope, struct aml_value *field) @@ -1322,7 +1322,7 @@ aml_parsename(struct aml_node *inode, uint8_t *pos, struct aml_value **rval, int break; case AMLOP_MULTINAMEPREFIX: for (i=0; itype); } else { *rval = aml_allocvalue(AML_OBJTYPE_NAMEREF, 0, start); - dnprintf(10, "%s:%s not found\n", aml_nodename(inode), + dnprintf(10, "%s:%s not found\n", aml_nodename(inode), aml_getname(start)); } @@ -1482,7 +1482,7 @@ struct aml_defval { { "_REV", AML_OBJTYPE_INTEGER, 2, NULL }, { "_GL", AML_OBJTYPE_MUTEX, 1, NULL, &aml_global_lock }, { "_OSI", AML_OBJTYPE_METHOD, 1, aml_callosi }, - + /* Create default scopes */ { "_GPE" }, { "_PR_" }, @@ -1744,20 +1744,20 @@ aml_val_to_string(const struct aml_value *val) } /* - * XXX: NEW PARSER CODE GOES HERE + * XXX: NEW PARSER CODE GOES HERE */ int aml_error; struct aml_value *aml_gettgt(struct aml_value *, int); struct aml_value *aml_xeval(struct aml_scope *, struct aml_value *, int, int, struct aml_value *); -struct aml_value *aml_xparsesimple(struct aml_scope *, char, +struct aml_value *aml_xparsesimple(struct aml_scope *, char, struct aml_value *); struct aml_value *aml_xparse(struct aml_scope *, int, const char *); struct aml_value *aml_seterror(struct aml_scope *, const char *, ...); struct aml_scope *aml_xfindscope(struct aml_scope *, int, int); -struct aml_scope *aml_xpushscope(struct aml_scope *, struct aml_value *, +struct aml_scope *aml_xpushscope(struct aml_scope *, struct aml_value *, struct aml_node *, int); struct aml_scope *aml_xpopscope(struct aml_scope *); @@ -1773,7 +1773,7 @@ struct aml_value *aml_xconcatres(struct aml_value *, struct aml_value *); struct aml_value *aml_xmid(struct aml_value *, int, int); int aml_ccrlen(union acpi_resource *, void *); -void aml_xstore(struct aml_scope *, struct aml_value *, int64_t, +void aml_xstore(struct aml_scope *, struct aml_value *, int64_t, struct aml_value *); int @@ -1787,7 +1787,7 @@ valid_acpihdr(void *buf, int len, const char *sig) return (0); if (acpi_checksum(hdr, hdr->length) != 0) return (0); - return (1); + return (1); } /* @@ -1798,7 +1798,7 @@ aml_xaddref(struct aml_value *val, const char *lbl) { if (val == NULL) return; - dnprintf(50, "XAddRef: %p %s:[%s] %d\n", + dnprintf(50, "XAddRef: %p %s:[%s] %d\n", val, lbl, val->node ? aml_nodename(val->node) : "INTERNAL", val->refcnt); @@ -1816,7 +1816,7 @@ aml_xdelref(struct aml_value **pv, const char *lbl) val = *pv; val->refcnt--; if (val->refcnt == 0) { - dnprintf(50, "XDelRef: %p %s %2d [%s] %s\n", + dnprintf(50, "XDelRef: %p %s %2d [%s] %s\n", val, lbl, val->refcnt, val->node ? aml_nodename(val->node) : "INTERNAL", @@ -1833,7 +1833,7 @@ aml_xdelref(struct aml_value **pv, const char *lbl) struct aml_scope * aml_xfindscope(struct aml_scope *scope, int type, int endscope) { - while (scope) { + while (scope) { switch (endscope) { case AMLOP_RETURN: scope->pos = scope->end; @@ -1859,7 +1859,7 @@ aml_xfindscope(struct aml_scope *scope, int type, int endscope) struct aml_value * aml_getstack(struct aml_scope *scope, int opcode) { - struct aml_value *sp; + struct aml_value *sp; sp = NULL; scope = aml_xfindscope(scope, AMLOP_METHOD, 0); @@ -1871,7 +1871,7 @@ aml_getstack(struct aml_scope *scope, int opcode) sp = scope->locals->v_package[opcode - AMLOP_LOCAL0]; sp->stack = opcode; } else if (opcode >= AMLOP_ARG0 && opcode <= AMLOP_ARG6) { - if (scope->args == NULL) + if (scope->args == NULL) scope->args = aml_allocvalue(AML_OBJTYPE_PACKAGE, 7, NULL); sp = scope->args->v_package[opcode - AMLOP_ARG0]; if (sp->type == AML_OBJTYPE_OBJREF) @@ -1882,13 +1882,13 @@ aml_getstack(struct aml_scope *scope, int opcode) #ifdef ACPI_DEBUG /* Dump AML Stack */ -void +void aml_showstack(struct aml_scope *scope) { struct aml_value *sp; int idx; - dnprintf(10, "===== Stack %s:%s\n", aml_nodename(scope->node), + dnprintf(10, "===== Stack %s:%s\n", aml_nodename(scope->node), aml_mnem(scope->type, 0)); for (idx=0; scope->args && idx<7; idx++) { sp = aml_getstack(scope, AMLOP_ARG0+idx); @@ -2002,11 +2002,11 @@ aml_xmatch(struct aml_value *pkg, int index, while (index < pkg->length) { /* Convert package value to integer */ - tmp = aml_xconvert(pkg->v_package[index], + tmp = aml_xconvert(pkg->v_package[index], AML_OBJTYPE_INTEGER, -1); /* Perform test */ - flag = aml_xmatchtest(tmp->v_integer, v1, op1) && + flag = aml_xmatchtest(tmp->v_integer, v1, op1) && aml_xmatchtest(tmp->v_integer, v2, op2); aml_xdelref(&tmp, "xmatch"); @@ -2058,11 +2058,11 @@ aml_xconvert(struct aml_value *a, int ctype, int clen) dnprintf(10,"convert to buffer\n"); switch (a->type) { case AML_OBJTYPE_INTEGER: - c = aml_allocvalue(AML_OBJTYPE_BUFFER, a->length, + c = aml_allocvalue(AML_OBJTYPE_BUFFER, a->length, &a->v_integer); break; case AML_OBJTYPE_STRING: - c = aml_allocvalue(AML_OBJTYPE_BUFFER, a->length, + c = aml_allocvalue(AML_OBJTYPE_BUFFER, a->length, a->v_string); break; } @@ -2072,7 +2072,7 @@ aml_xconvert(struct aml_value *a, int ctype, int clen) switch (a->type) { case AML_OBJTYPE_BUFFER: c = aml_allocvalue(AML_OBJTYPE_INTEGER, 0, NULL); - memcpy(&c->v_integer, a->v_buffer, + memcpy(&c->v_integer, a->v_buffer, min(a->length, c->length)); break; case AML_OBJTYPE_STRING: @@ -2091,7 +2091,7 @@ aml_xconvert(struct aml_value *a, int ctype, int clen) switch (a->type) { case AML_OBJTYPE_INTEGER: c = aml_allocvalue(AML_OBJTYPE_STRING, 20, NULL); - snprintf(c->v_string, c->length, (ctype == AML_OBJTYPE_HEXSTRING) ? + snprintf(c->v_string, c->length, (ctype == AML_OBJTYPE_HEXSTRING) ? "0x%llx" : "%lld", a->v_integer); break; case AML_OBJTYPE_BUFFER: @@ -2124,7 +2124,7 @@ aml_xcompare(struct aml_value *a1, struct aml_value *a2, int opcode) rc = aml_evalexpr(a1->v_integer, a2->v_integer, opcode); else { /* Perform String/Buffer comparison */ - rc = memcmp(a1->v_buffer, a2->v_buffer, + rc = memcmp(a1->v_buffer, a2->v_buffer, min(a1->length, a2->length)); if (rc == 0) { /* If buffers match, which one is longer */ @@ -2148,19 +2148,19 @@ aml_xconcat(struct aml_value *a1, struct aml_value *a2) a2 = aml_xconvert(a2, a1->type, -1); switch (a1->type) { case AML_OBJTYPE_INTEGER: - c = aml_allocvalue(AML_OBJTYPE_BUFFER, + c = aml_allocvalue(AML_OBJTYPE_BUFFER, a1->length + a2->length, NULL); memcpy(c->v_buffer, &a1->v_integer, a1->length); memcpy(c->v_buffer+a1->length, &a2->v_integer, a2->length); break; case AML_OBJTYPE_BUFFER: - c = aml_allocvalue(AML_OBJTYPE_BUFFER, + c = aml_allocvalue(AML_OBJTYPE_BUFFER, a1->length + a2->length, NULL); memcpy(c->v_buffer, a1->v_buffer, a1->length); memcpy(c->v_buffer+a1->length, a2->v_buffer, a2->length); break; case AML_OBJTYPE_STRING: - c = aml_allocvalue(AML_OBJTYPE_STRING, + c = aml_allocvalue(AML_OBJTYPE_STRING, a1->length + a2->length, NULL); memcpy(c->v_string, a1->v_string, a1->length); memcpy(c->v_string+a1->length, a2->v_string, a2->length); @@ -2179,7 +2179,7 @@ int aml_ccrlen(union acpi_resource *rs, void *arg) { int *plen = arg; - + *plen += AML_CRSLEN(rs); return (0); } @@ -2192,7 +2192,7 @@ aml_xconcatres(struct aml_value *a1, struct aml_value *a2) int l1 = 0, l2 = 0, l3 = 2; uint8_t a3[] = { 0x79, 0x00 }; - if (a1->type != AML_OBJTYPE_BUFFER || a2->type != AML_OBJTYPE_BUFFER) + if (a1->type != AML_OBJTYPE_BUFFER || a2->type != AML_OBJTYPE_BUFFER) aml_die("concatres: not buffers\n"); /* Walk a1, a2, get length minus end tags, concatenate buffers, add end tag */ @@ -2217,10 +2217,10 @@ aml_xmid(struct aml_value *src, int index, int length) if ((index + length) > src->length) length = src->length - index; return aml_allocvalue(src->type, length, src->v_buffer + index); -} +} /* - * Field I/O utility functions + * Field I/O utility functions */ void aml_xcreatefield(struct aml_value *, int, struct aml_value *, int, int, struct aml_value *, int, int); @@ -2236,7 +2236,7 @@ aml_evalhid(struct aml_node *node, struct aml_value *val) return (-1); /* Integer _HID: convert to EISA ID */ - if (val->type == AML_OBJTYPE_INTEGER) + if (val->type == AML_OBJTYPE_INTEGER) _aml_setvalue(val, AML_OBJTYPE_STRING, -1, aml_eisaid(val->v_integer)); return (0); } @@ -2304,7 +2304,7 @@ aml_rwgas(struct aml_value *rgn, int bpos, int blen, struct aml_value *val, int sz = 1; break; } - + tbit = &tmp.v_integer; vbit = &val->v_integer; slen = (blen + 7) >> 3; @@ -2408,27 +2408,27 @@ aml_xcreatefield(struct aml_value *field, int opcode, struct aml_value *data, int bpos, int blen, struct aml_value *index, int indexval, int flags) { - dnprintf(10, "## %s(%s): %s %.4x-%.4x\n", + dnprintf(10, "## %s(%s): %s %.4x-%.4x\n", aml_mnem(opcode, 0), blen > aml_intlen ? "BUF" : "INT", aml_nodename(field->node), bpos, blen); if (index) { - dnprintf(10, " index:%s:%.2x\n", aml_nodename(index->node), + dnprintf(10, " index:%s:%.2x\n", aml_nodename(index->node), indexval); } dnprintf(10, " data:%s\n", aml_nodename(data->node)); - field->type = (opcode == AMLOP_FIELD || - opcode == AMLOP_INDEXFIELD || + field->type = (opcode == AMLOP_FIELD || + opcode == AMLOP_INDEXFIELD || opcode == AMLOP_BANKFIELD) ? - AML_OBJTYPE_FIELDUNIT : + AML_OBJTYPE_FIELDUNIT : AML_OBJTYPE_BUFFERFIELD; if (opcode == AMLOP_INDEXFIELD) { indexval = bpos >> 3; bpos &= 7; } - if (field->type == AML_OBJTYPE_BUFFERFIELD && - data->type != AML_OBJTYPE_BUFFER) + if (field->type == AML_OBJTYPE_BUFFERFIELD && + data->type != AML_OBJTYPE_BUFFER) { printf("WARN: %s not buffer\n", aml_nodename(data->node)); @@ -2449,7 +2449,7 @@ aml_xcreatefield(struct aml_value *field, int opcode, /* Parse Field/IndexField/BankField scope */ void -aml_xparsefieldlist(struct aml_scope *mscope, int opcode, int flags, +aml_xparsefieldlist(struct aml_scope *mscope, int opcode, int flags, struct aml_value *data, struct aml_value *index, int indexval) { struct aml_value *rv; @@ -2472,7 +2472,7 @@ aml_xparsefieldlist(struct aml_scope *mscope, int opcode, int flags, mscope->pos = aml_parsename(mscope->node, mscope->pos, &rv, 1); blen = aml_parselength(mscope); - aml_xcreatefield(rv, opcode, data, bpos, blen, index, + aml_xcreatefield(rv, opcode, data, bpos, blen, index, indexval, flags); aml_xdelref(&rv, 0); break; @@ -2483,7 +2483,7 @@ aml_xparsefieldlist(struct aml_scope *mscope, int opcode, int flags, } /* - * Mutex/Event utility functions + * Mutex/Event utility functions */ int acpi_xmutex_acquire(struct aml_scope *, struct aml_value *, int); void acpi_xmutex_release(struct aml_scope *, struct aml_value *); @@ -2492,7 +2492,7 @@ void acpi_xevent_signal(struct aml_scope *, struct aml_value *); void acpi_xevent_reset(struct aml_scope *, struct aml_value *); int -acpi_xmutex_acquire(struct aml_scope *scope, struct aml_value *mtx, +acpi_xmutex_acquire(struct aml_scope *scope, struct aml_value *mtx, int timeout) { int err; @@ -2520,7 +2520,7 @@ acpi_xmutex_release(struct aml_scope *scope, struct aml_value *mtx) int err; if (mtx == aml_global_lock) { - dnprintf(10,"UNLOCKING GLOBAL\n"); + dnprintf(10,"UNLOCKING GLOBAL\n"); err=acpi_release_global_lock(&acpi_softc->sc_facs->global_lock); } dnprintf(5, "%s releases mutex %s\n", scope->node->name, @@ -2558,7 +2558,7 @@ acpi_xevent_reset(struct aml_scope *scope, struct aml_value *evt) /* Store result value into an object */ void -aml_xstore(struct aml_scope *scope, struct aml_value *lhs , int64_t ival, +aml_xstore(struct aml_scope *scope, struct aml_value *lhs , int64_t ival, struct aml_value *rhs) { struct aml_value tmp; @@ -2573,7 +2573,7 @@ aml_xstore(struct aml_scope *scope, struct aml_value *lhs , int64_t ival, if (rhs == NULL) { rhs = _aml_setvalue(&tmp, AML_OBJTYPE_INTEGER, ival, NULL); } - if (rhs->type == AML_OBJTYPE_BUFFERFIELD || + if (rhs->type == AML_OBJTYPE_BUFFERFIELD || rhs->type == AML_OBJTYPE_FIELDUNIT) { aml_rwfield(rhs, 0, rhs->v_field.bitlen, &tmp, ACPI_IOREAD); rhs = &tmp; @@ -2641,8 +2641,8 @@ aml_disprintf(void *arg, const char *fmt, ...) } void -aml_disasm(struct aml_scope *scope, int lvl, - void (*dbprintf)(void *, const char *, ...), +aml_disasm(struct aml_scope *scope, int lvl, + void (*dbprintf)(void *, const char *, ...), void *arg) { int pc, opcode; @@ -2682,7 +2682,7 @@ aml_disasm(struct aml_scope *scope, int lvl, if (rv->type == AML_OBJTYPE_METHOD) { strlcat(mch, "(", sizeof(mch)); for (ival=0; ivalv_method.flags); ival++) { - strlcat(mch, ival ? ", %z" : "%z", + strlcat(mch, ival ? ", %z" : "%z", sizeof(mch)); } strlcat(mch, ")", sizeof(mch)); @@ -2730,7 +2730,7 @@ aml_disasm(struct aml_scope *scope, int lvl, ch="%q"; break; case AMLOP_STRINGPREFIX: - ch="%a"; + ch="%a"; break; case AMLOP_INCREMENT: @@ -2911,7 +2911,7 @@ aml_disasm(struct aml_scope *scope, int lvl, case 'a': dbprintf(arg, "\'%s\'", scope->pos); scope->pos += strlen(scope->pos)+1; - break; + break; case 'N': /* Create Name */ rv = aml_xparsesimple(scope, c, NULL); @@ -2924,7 +2924,7 @@ aml_disasm(struct aml_scope *scope, int lvl, case 'R': /* Search name */ printf("%s", aml_getname(scope->pos)); - scope->pos = aml_parsename(scope->node, scope->pos, + scope->pos = aml_parsename(scope->node, scope->pos, &rv, 0); aml_xdelref(&rv, 0); break; @@ -2950,10 +2950,10 @@ aml_disasm(struct aml_scope *scope, int lvl, } else if (*ms->pos == 0x01) { ms->pos+=3; } else { - ms->pos = aml_parsename(ms->node, + ms->pos = aml_parsename(ms->node, ms->pos, &rv, 1); aml_parselength(ms); - dbprintf(arg," %s\n", + dbprintf(arg," %s\n", aml_nodename(rv->node)); aml_xdelref(&rv, 0); } @@ -2974,7 +2974,7 @@ aml_disasm(struct aml_scope *scope, int lvl, ms = aml_xpushscope(scope, &tmp, scope->node, 0); while (ms && ms->pos < ms->end) { - aml_disasm(ms, (lvl + 1) & 0x7FFF, + aml_disasm(ms, (lvl + 1) & 0x7FFF, dbprintf, arg); } aml_xpopscope(ms); @@ -3012,12 +3012,12 @@ aml_xeval(struct aml_scope *scope, struct aml_value *my_ret, int ret_type, aml_getname(my_ret->v_nameref)); break; case AML_OBJTYPE_METHOD: - dnprintf(10,"\n--== Eval Method [%s, %d args] to %c ==--\n", - aml_nodename(tmp->node), + dnprintf(10,"\n--== Eval Method [%s, %d args] to %c ==--\n", + aml_nodename(tmp->node), AML_METHOD_ARGCOUNT(tmp->v_method.flags), ret_type); ms = aml_xpushscope(scope, tmp, tmp->node, AMLOP_METHOD); - + /* Parse method arguments */ for (idx=0; idxv_method.flags); idx++) { struct aml_value *sp; @@ -3033,7 +3033,7 @@ aml_xeval(struct aml_scope *scope, struct aml_value *my_ret, int ret_type, #ifdef ACPI_DEBUG aml_showstack(ms); #endif - + /* Evaluate method scope */ aml_root.start = tmp->v_method.base; if (tmp->v_method.fneval != NULL) { @@ -3042,7 +3042,7 @@ aml_xeval(struct aml_scope *scope, struct aml_value *my_ret, int ret_type, aml_xparse(ms, 'T', "METHEVAL"); my_ret = ms->retv; } - dnprintf(10,"\n--==Finished evaluating method: %s %c\n", + dnprintf(10,"\n--==Finished evaluating method: %s %c\n", aml_nodename(tmp->node), ret_type); #ifdef ACPI_DEBUG aml_showvalue(my_ret, 0); @@ -3053,7 +3053,7 @@ aml_xeval(struct aml_scope *scope, struct aml_value *my_ret, int ret_type, case AML_OBJTYPE_BUFFERFIELD: case AML_OBJTYPE_FIELDUNIT: my_ret = aml_allocvalue(0,0,NULL); - dnprintf(20,"quick: Convert Bufferfield to %c 0x%x\n", + dnprintf(20,"quick: Convert Bufferfield to %c 0x%x\n", ret_type, my_ret); aml_rwfield(tmp, 0, tmp->v_field.bitlen, my_ret, ACPI_IOREAD); break; @@ -3189,22 +3189,22 @@ aml_xparsesimple(struct aml_scope *scope, char ch, struct aml_value *rv) _aml_setvalue(rv, AML_OBJTYPE_DEBUGOBJ, 0, NULL); break; case AML_ARG_BYTE: - _aml_setvalue(rv, AML_OBJTYPE_INTEGER, + _aml_setvalue(rv, AML_OBJTYPE_INTEGER, aml_get8(scope->pos), NULL); scope->pos += 1; break; case AML_ARG_WORD: - _aml_setvalue(rv, AML_OBJTYPE_INTEGER, + _aml_setvalue(rv, AML_OBJTYPE_INTEGER, aml_get16(scope->pos), NULL); scope->pos += 2; break; case AML_ARG_DWORD: - _aml_setvalue(rv, AML_OBJTYPE_INTEGER, + _aml_setvalue(rv, AML_OBJTYPE_INTEGER, aml_get32(scope->pos), NULL); scope->pos += 4; break; case AML_ARG_QWORD: - _aml_setvalue(rv, AML_OBJTYPE_INTEGER, + _aml_setvalue(rv, AML_OBJTYPE_INTEGER, aml_get64(scope->pos), NULL); scope->pos += 8; break; @@ -3217,7 +3217,7 @@ aml_xparsesimple(struct aml_scope *scope, char ch, struct aml_value *rv) } /* - * Main Opcode Parser/Evaluator + * Main Opcode Parser/Evaluator * * ret_type is expected type for return value * 'o' = Data Object (Int/Str/Buf/Pkg/Name) @@ -3343,16 +3343,16 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) case AML_ARG_OBJLEN: end = aml_parseend(scope); break; - case AML_ARG_IFELSE: + case AML_ARG_IFELSE: /* Special Case: IF-ELSE:piTbpT or IF:piT */ - ch = (*end == AMLOP_ELSE && end < scope->end) ? + ch = (*end == AMLOP_ELSE && end < scope->end) ? "-TbpT" : "-T"; break; /* Complex arguments */ case 's': - case 'S': - case AML_ARG_TARGET: + case 'S': + case AML_ARG_TARGET: case AML_ARG_TERMOBJ: case AML_ARG_INTEGER: if (*ch == 'r' && *scope->pos == AMLOP_ZERO) { @@ -3378,7 +3378,7 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) scope->pos = end; break; case AML_ARG_CONST: - rv = aml_allocvalue(AML_OBJTYPE_INTEGER, + rv = aml_allocvalue(AML_OBJTYPE_INTEGER, (char)opcode, NULL); break; case AML_ARG_CREATENAME: @@ -3442,10 +3442,10 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) if (scope->type == AMLOP_PACKAGE) { /* Special case for package */ if (my_ret->type == AML_OBJTYPE_NAMEREF) - my_ret = aml_allocvalue(AML_OBJTYPE_STRING, -1, + my_ret = aml_allocvalue(AML_OBJTYPE_STRING, -1, aml_getname(my_ret->v_nameref)); else if (my_ret->node) - my_ret = aml_allocvalue(AML_OBJTYPE_STRING, -1, + my_ret = aml_allocvalue(AML_OBJTYPE_STRING, -1, aml_nodename(my_ret->node)); break; } @@ -3478,17 +3478,17 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) case AMLOP_BUFFER: /* Buffer: iB => Buffer */ - my_ret = aml_allocvalue(AML_OBJTYPE_BUFFER, + my_ret = aml_allocvalue(AML_OBJTYPE_BUFFER, opargs[0]->v_integer, NULL); - memcpy(my_ret->v_buffer, opargs[1]->v_buffer, + memcpy(my_ret->v_buffer, opargs[1]->v_buffer, opargs[1]->length); break; case AMLOP_PACKAGE: case AMLOP_VARPACKAGE: /* Package/VarPackage: bT/iT => Package */ - my_ret = aml_allocvalue(AML_OBJTYPE_PACKAGE, + my_ret = aml_allocvalue(AML_OBJTYPE_PACKAGE, opargs[0]->v_integer, 0); - mscope = aml_xpushscope(scope, opargs[1], scope->node, + mscope = aml_xpushscope(scope, opargs[1], scope->node, AMLOP_PACKAGE); /* Recursively parse package contents */ @@ -3516,21 +3516,21 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) case AMLOP_SUBTRACT: case AMLOP_MULTIPLY: /* XXX: iir => I */ - ival = aml_evalexpr(opargs[0]->v_integer, + ival = aml_evalexpr(opargs[0]->v_integer, opargs[1]->v_integer, opcode); aml_xstore(scope, opargs[2], ival, NULL); break; case AMLOP_DIVIDE: /* Divide: iirr => I */ if (opargs[1]->v_integer == 0) { - my_ret = aml_seterror(scope, "Divide by Zero!"); + my_ret = aml_seterror(scope, "Divide by Zero!"); break; } - ival = aml_evalexpr(opargs[0]->v_integer, + ival = aml_evalexpr(opargs[0]->v_integer, opargs[1]->v_integer, AMLOP_MOD); aml_xstore(scope, opargs[2], ival, NULL); - ival = aml_evalexpr(opargs[0]->v_integer, + ival = aml_evalexpr(opargs[0]->v_integer, opargs[1]->v_integer, AMLOP_DIVIDE); aml_xstore(scope, opargs[3], ival, NULL); break; @@ -3557,7 +3557,7 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) case AMLOP_LOR: case AMLOP_LAND: /* XXX: ii => Bool */ - ival = aml_evalexpr(opargs[0]->v_integer, + ival = aml_evalexpr(opargs[0]->v_integer, opargs[1]->v_integer, opcode); break; case AMLOP_LLESS: @@ -3597,7 +3597,7 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) #ifndef SMALL_KERNEL aml_showvalue(opargs[0], 0); #endif - aml_die("Index out of bounds %d/%d\n", idx, + aml_die("Index out of bounds %d/%d\n", idx, opargs[0]->length); } switch (opargs[0]->type) { @@ -3609,7 +3609,7 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) } else { my_ret = aml_allocvalue(AML_OBJTYPE_OBJREF, AMLOP_PACKAGE, opargs[0]->v_package[idx]); - aml_xaddref(my_ret->v_objref.ref, + aml_xaddref(my_ret->v_objref.ref, "Index.Package"); } break; @@ -3618,13 +3618,13 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) case AML_OBJTYPE_INTEGER: rv = aml_xconvert(opargs[0], AML_OBJTYPE_BUFFER, -1); if (ret_type == 't' || ret_type == 'i' || ret_type == 'T') { - dnprintf(12,"Index.Buf Term: %d = %x\n", + dnprintf(12,"Index.Buf Term: %d = %x\n", idx, rv->v_buffer[idx]); ival = rv->v_buffer[idx]; } else { dnprintf(12, "Index.Buf Targ\n"); my_ret = aml_allocvalue(0,0,NULL); - aml_xcreatefield(my_ret, AMLOP_INDEX, rv, + aml_xcreatefield(my_ret, AMLOP_INDEX, rv, 8 * idx, 8, NULL, 0, AML_FIELD_BYTEACC); } aml_xdelref(&rv, "Index.BufStr"); @@ -3680,7 +3680,7 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) break; case AMLOP_TOSTRING: /* Source:B, Length:I, Result => String */ - my_ret = aml_xconvert(opargs[0], AML_OBJTYPE_STRING, + my_ret = aml_xconvert(opargs[0], AML_OBJTYPE_STRING, opargs[1]->v_integer); aml_xstore(scope, opargs[2], 0, my_ret); break; @@ -3696,7 +3696,7 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) break; case AMLOP_MID: /* Source:BS, Index:I, Length:I, Result => BS */ - my_ret = aml_xmid(opargs[0], opargs[1]->v_integer, + my_ret = aml_xmid(opargs[0], opargs[1]->v_integer, opargs[2]->v_integer); aml_xstore(scope, opargs[3], 0, my_ret); break; @@ -3838,51 +3838,51 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) case AMLOP_CREATEBITFIELD: /* Source:B, BitIndex:I, FieldName */ rv = _aml_setvalue(opargs[2], AML_OBJTYPE_BUFFERFIELD, 0, 0); - aml_xcreatefield(rv, opcode, opargs[0], opargs[1]->v_integer, - 1, NULL, 0, 0); + aml_xcreatefield(rv, opcode, opargs[0], opargs[1]->v_integer, + 1, NULL, 0, 0); break; case AMLOP_CREATEBYTEFIELD: /* Source:B, ByteIndex:I, FieldName */ rv = _aml_setvalue(opargs[2], AML_OBJTYPE_BUFFERFIELD, 0, 0); - aml_xcreatefield(rv, opcode, opargs[0], opargs[1]->v_integer*8, + aml_xcreatefield(rv, opcode, opargs[0], opargs[1]->v_integer*8, 8, NULL, 0, AML_FIELD_BYTEACC); break; case AMLOP_CREATEWORDFIELD: /* Source:B, ByteIndex:I, FieldName */ rv = _aml_setvalue(opargs[2], AML_OBJTYPE_BUFFERFIELD, 0, 0); - aml_xcreatefield(rv, opcode, opargs[0], opargs[1]->v_integer*8, + aml_xcreatefield(rv, opcode, opargs[0], opargs[1]->v_integer*8, 16, NULL, 0, AML_FIELD_WORDACC); break; case AMLOP_CREATEDWORDFIELD: /* Source:B, ByteIndex:I, FieldName */ rv = _aml_setvalue(opargs[2], AML_OBJTYPE_BUFFERFIELD, 0, 0); - aml_xcreatefield(rv, opcode, opargs[0], opargs[1]->v_integer*8, + aml_xcreatefield(rv, opcode, opargs[0], opargs[1]->v_integer*8, 32, NULL, 0, AML_FIELD_DWORDACC); break; case AMLOP_CREATEQWORDFIELD: /* Source:B, ByteIndex:I, FieldName */ rv = _aml_setvalue(opargs[2], AML_OBJTYPE_BUFFERFIELD, 0, 0); - aml_xcreatefield(rv, opcode, opargs[0], opargs[1]->v_integer*8, + aml_xcreatefield(rv, opcode, opargs[0], opargs[1]->v_integer*8, 64, NULL, 0, AML_FIELD_QWORDACC); break; case AMLOP_FIELD: /* Field: n:OpRegion, b:Flags, F:ieldlist */ mscope = aml_xpushscope(scope, opargs[2], scope->node, opcode); - aml_xparsefieldlist(mscope, opcode, opargs[1]->v_integer, + aml_xparsefieldlist(mscope, opcode, opargs[1]->v_integer, opargs[0], NULL, 0); mscope = NULL; break; case AMLOP_INDEXFIELD: /* IndexField: n:Index, n:Data, b:Flags, F:ieldlist */ mscope = aml_xpushscope(scope, opargs[3], scope->node, opcode); - aml_xparsefieldlist(mscope, opcode, opargs[2]->v_integer, + aml_xparsefieldlist(mscope, opcode, opargs[2]->v_integer, opargs[1], opargs[0], 0); mscope = NULL; break; case AMLOP_BANKFIELD: /* BankField: n:OpRegion, n:Field, i:Bank, b:Flags, F:ieldlist */ mscope = aml_xpushscope(scope, opargs[4], scope->node, opcode); - aml_xparsefieldlist(mscope, opcode, opargs[3]->v_integer, + aml_xparsefieldlist(mscope, opcode, opargs[3]->v_integer, opargs[0], opargs[1], opargs[2]->v_integer); mscope = NULL; break; @@ -3899,8 +3899,8 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) case AMLOP_NOTIFY: /* Notify: Si */ rv = aml_gettgt(opargs[0], opcode); - dnprintf(50,"Notifying: %s %x\n", - aml_nodename(rv->node), + dnprintf(50,"Notifying: %s %x\n", + aml_nodename(rv->node), opargs[1]->v_integer); aml_notify(rv->node, opargs[1]->v_integer); break; @@ -3911,11 +3911,11 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) case AMLOP_FATAL: /* Fatal: bdi */ aml_die("AML FATAL ERROR: %x,%x,%x\n", - opargs[0]->v_integer, opargs[1]->v_integer, + opargs[0]->v_integer, opargs[1]->v_integer, opargs[2]->v_integer); break; case AMLOP_LOADTABLE: - /* LoadTable(Sig:Str, OEMID:Str, OEMTable:Str, [RootPath:Str], [ParmPath:Str], + /* LoadTable(Sig:Str, OEMID:Str, OEMTable:Str, [RootPath:Str], [ParmPath:Str], [ParmData:DataRefObj]) => DDBHandle */ aml_die("LoadTable"); break; @@ -3981,13 +3981,13 @@ aml_xparse(struct aml_scope *scope, int ret_type, const char *stype) my_ret = aml_allocvalue(AML_OBJTYPE_INTEGER, ival, NULL); } if (ret_type == 'i' && my_ret && my_ret->type != AML_OBJTYPE_INTEGER) { - dnprintf(10,"quick: %.4x convert to integer %s -> %s\n", + dnprintf(10,"quick: %.4x convert to integer %s -> %s\n", pc, htab->mnem, stype); my_ret = aml_xconvert(my_ret, AML_OBJTYPE_INTEGER, -1); } if (my_ret != NULL) { /* Display result */ - dnprintf(20,"quick: %.4x %18s %c %.4x\n", pc, stype, + dnprintf(20,"quick: %.4x %18s %c %.4x\n", pc, stype, ret_type, my_ret->stack); } @@ -4011,7 +4011,7 @@ parse_error: } odp--; - dnprintf(50, ">>return [%s] %s %c %p\n", aml_nodename(scope->node), + dnprintf(50, ">>return [%s] %s %c %p\n", aml_nodename(scope->node), stype, ret_type, my_ret); return my_ret; @@ -4028,7 +4028,7 @@ acpi_parse_aml(struct acpi_softc *sc, u_int8_t *start, u_int32_t length) res.type = AML_OBJTYPE_SCOPE; res.length = length; res.v_buffer = start; - + /* Push toplevel scope, parse AML */ aml_error = 0; scope = aml_xpushscope(NULL, &res, &aml_root, AMLOP_SCOPE); @@ -4055,7 +4055,7 @@ aml_evalnode(struct acpi_softc *sc, struct aml_node *node, int argc, struct aml_value *argv, struct aml_value *res) { struct aml_value *xres; - + if (res) memset(res, 0, sizeof(*res)); if (node == NULL || node->value == NULL) @@ -4109,7 +4109,7 @@ aml_evalinteger(struct acpi_softc *sc, struct aml_node *parent, } /* - * Search for an AML name in namespace.. root only + * Search for an AML name in namespace.. root only */ struct aml_node * aml_searchname(struct aml_node *root, const void *vname) diff --git a/sys/dev/acpi/dsdt.h b/sys/dev/acpi/dsdt.h index 522229e545e..c27d764ece2 100644 --- a/sys/dev/acpi/dsdt.h +++ b/sys/dev/acpi/dsdt.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.h,v 1.51 2010/07/21 15:07:40 deraadt Exp $ */ +/* $OpenBSD: dsdt.h,v 1.52 2010/07/21 19:35:15 deraadt Exp $ */ /* * Copyright (c) 2005 Marco Peereboom * @@ -46,7 +46,7 @@ int64_t aml_val2int(struct aml_value *); struct aml_node *aml_searchname(struct aml_node *, const void *); struct aml_node *aml_searchrel(struct aml_node *, const void *); -struct aml_value *aml_getstack(struct aml_scope *, int); +struct aml_value *aml_getstack(struct aml_scope *, int); struct aml_value *aml_allocint(uint64_t); struct aml_value *aml_allocstr(const char *); struct aml_value *aml_allocvalue(int, int64_t, const void *); @@ -233,8 +233,8 @@ void aml_foreachpkg(struct aml_value *, int, 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 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 *);