summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2005-06-04 02:25:54 +0000
committerChad Loder <cloder@cvs.openbsd.org>2005-06-04 02:25:54 +0000
commitf55a888462678d374b01d4a2fed7f72e85384ae7 (patch)
tree5ccb3e0f06ff8d5da334a3bfeb05c126dd924891
parent8fa93c8e129db89e65d6b737281a95b5c7444727 (diff)
Clean up gcc-isms. OK tholo
-rw-r--r--usr.sbin/acpidump/Makefile6
-rw-r--r--usr.sbin/acpidump/acpi.c5
-rw-r--r--usr.sbin/acpidump/acpidump.h7
-rw-r--r--usr.sbin/acpidump/aml/aml_common.h7
-rw-r--r--usr.sbin/acpidump/aml/aml_parse.c82
-rw-r--r--usr.sbin/acpidump/asl_dump.c31
6 files changed, 118 insertions, 20 deletions
diff --git a/usr.sbin/acpidump/Makefile b/usr.sbin/acpidump/Makefile
index 1645c634f6e..4700686d6af 100644
--- a/usr.sbin/acpidump/Makefile
+++ b/usr.sbin/acpidump/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.2 2005/06/03 19:18:32 deraadt Exp $
+# $OpenBSD: Makefile,v 1.3 2005/06/04 02:25:53 cloder Exp $
.if (${MACHINE} == "i386") || (${MACHINE} == "amd64")
PROG= acpidump
@@ -11,8 +11,8 @@ NOPROG= yes
MAN= acpidump.8
-VPATH= ${.CURDIR}/aml
-CFLAGS= -I${.CURDIR}
+VPATH=${.CURDIR}/aml
+CFLAGS+=-I${.CURDIR}
BINDIR?=/usr/sbin
diff --git a/usr.sbin/acpidump/acpi.c b/usr.sbin/acpidump/acpi.c
index f26cd57695f..50eed086eaa 100644
--- a/usr.sbin/acpidump/acpi.c
+++ b/usr.sbin/acpidump/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.1 2005/06/02 20:09:39 tholo Exp $ */
+/* $OpenBSD: acpi.c,v 1.2 2005/06/04 02:25:53 cloder Exp $ */
/*-
* Copyright (c) 1998 Doug Rabson
* Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org>
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: acpi.c,v 1.1 2005/06/02 20:09:39 tholo Exp $
+ * $Id: acpi.c,v 1.2 2005/06/04 02:25:53 cloder Exp $
* $FreeBSD: src/usr.sbin/acpi/acpidump/acpi.c,v 1.3 2000/11/08 02:37:00 iwasaki Exp $
*/
#include <sys/types.h>
@@ -36,6 +36,7 @@
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
+#include <string.h>
#include "acpidump.h"
diff --git a/usr.sbin/acpidump/acpidump.h b/usr.sbin/acpidump/acpidump.h
index 4d1ce79966e..b090218d4cd 100644
--- a/usr.sbin/acpidump/acpidump.h
+++ b/usr.sbin/acpidump/acpidump.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpidump.h,v 1.1 2005/06/02 20:09:39 tholo Exp $ */
+/* $OpenBSD: acpidump.h,v 1.2 2005/06/04 02:25:53 cloder Exp $ */
/*-
* Copyright (c) 1999 Doug Rabson
* Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org>
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: acpidump.h,v 1.1 2005/06/02 20:09:39 tholo Exp $
+ * $Id: acpidump.h,v 1.2 2005/06/04 02:25:53 cloder Exp $
* $FreeBSD: src/usr.sbin/acpi/acpidump/acpidump.h,v 1.2 2000/11/08 02:37:00 iwasaki Exp $
*/
@@ -162,7 +162,8 @@ struct FACS {
void *acpi_map_physical(vm_offset_t, size_t);
struct ACPIrsdp *acpi_find_rsd_ptr(void);
-int acpi_checksum(void *, size_t);
+int acpi_checksum(void *, size_t)
+ __attribute__ ((__bounded__(__buffer__,1,2)));
struct ACPIsdt *acpi_map_sdt(vm_offset_t);
void acpi_print_rsd_ptr(struct ACPIrsdp *);
void acpi_print_sdt(struct ACPIsdt *);
diff --git a/usr.sbin/acpidump/aml/aml_common.h b/usr.sbin/acpidump/aml/aml_common.h
index 5ea32924a4a..24f3a7344da 100644
--- a/usr.sbin/acpidump/aml/aml_common.h
+++ b/usr.sbin/acpidump/aml/aml_common.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: aml_common.h,v 1.1 2005/06/02 20:09:39 tholo Exp $ */
+/* $OpenBSD: aml_common.h,v 1.2 2005/06/04 02:25:53 cloder Exp $ */
/*-
* Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org>
* All rights reserved.
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aml_common.h,v 1.1 2005/06/02 20:09:39 tholo Exp $
+ * $Id: aml_common.h,v 1.2 2005/06/04 02:25:53 cloder Exp $
* $FreeBSD: src/usr.sbin/acpi/amldb/aml/aml_common.h,v 1.4 2000/10/02 08:58:47 iwasaki Exp $
*/
@@ -46,6 +46,7 @@
AML_SYSABORT(); \
} \
} while(0)
+/* XXX: named variadic macros are a gcc-ism, and __VA_ARGS__ is C99-only */
#define AML_SYSERRX(eval, fmt, args...) do { \
printf(fmt, args); \
} while(0)
@@ -55,6 +56,7 @@
#else /* !_KERNEL */
#define AML_SYSASSERT(x) assert(x)
#define AML_SYSABORT() abort()
+/* XXX: named variadic macros are a gcc-ism, and __VA_ARGS__ is C99-only */
#define AML_SYSERRX(eval, fmt, args...) errx(eval, fmt, args)
#define AML_DEBUGGER(x, y) aml_dbgr(x, y)
#define AML_STALL(micro) /* not required in userland */
@@ -66,6 +68,7 @@ struct aml_name;
extern int aml_debug;
+/* XXX: named variadic macros are a gcc-ism, and __VA_ARGS__ is C99-only */
#define AML_DEBUGPRINT(args...) do { \
if (aml_debug) { \
printf(args); \
diff --git a/usr.sbin/acpidump/aml/aml_parse.c b/usr.sbin/acpidump/aml/aml_parse.c
index 0da801de5cd..4fe333926bb 100644
--- a/usr.sbin/acpidump/aml/aml_parse.c
+++ b/usr.sbin/acpidump/aml/aml_parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aml_parse.c,v 1.1 2005/06/02 20:09:39 tholo Exp $ */
+/* $OpenBSD: aml_parse.c,v 1.2 2005/06/04 02:25:53 cloder Exp $ */
/*-
* Copyright (c) 1999 Doug Rabson
* Copyright (c) 1999, 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org>
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aml_parse.c,v 1.1 2005/06/02 20:09:39 tholo Exp $
+ * $Id: aml_parse.c,v 1.2 2005/06/04 02:25:53 cloder Exp $
* $FreeBSD: src/usr.sbin/acpi/amldb/aml/aml_parse.c,v 1.7 2001/10/23 14:54:15 takawata Exp $
*/
@@ -701,7 +701,32 @@ aml_parse_field(struct aml_environ *env, struct aml_field *template)
switch (*env->dp) {
case '\\':
case '^':
- case 'A'...'Z':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
case '_':
case '.':
case '/':
@@ -1310,7 +1335,32 @@ aml_parse_termobj(struct aml_environ *env, int indent)
switch (opcode) {
case '\\':
case '^':
- case 'A' ... 'Z':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
case '_':
case '.':
case '/':
@@ -1611,11 +1661,25 @@ aml_parse_termobj(struct aml_environ *env, int indent)
AML_SYSABORT();
}
break;
- case 0x68 ... 0x6e: /* ArgN */
+ case 0x68:
+ case 0x69:
+ case 0x6a:
+ case 0x6b:
+ case 0x6c:
+ case 0x6d:
+ case 0x6e:
+ /* ArgN */
AML_DEBUGPRINT("Arg%d", opcode - 0x68);
return (aml_local_stack_getArgX(NULL, opcode - 0x68));
break;
- case 0x60 ... 0x67:
+ case 0x60:
+ case 0x61:
+ case 0x62:
+ case 0x63:
+ case 0x64:
+ case 0x65:
+ case 0x66:
+ case 0x67:
AML_DEBUGPRINT("Local%d", opcode - 0x60);
return (aml_local_stack_getLocalX(opcode - 0x60));
break;
@@ -1906,7 +1970,11 @@ aml_parse_termobj(struct aml_environ *env, int indent)
env->tempobject.num = anum.num;
break;
#undef MATCHOP
- case 0x8a ... 0x8d: /* CreateDWordFieldOp */
+ case 0x8a:
+ case 0x8b:
+ case 0x8c:
+ case 0x8d:
+ /* CreateDWordFieldOp */
widthindex = *(env->dp - 1) - 0x8a;
AML_DEBUGPRINT("%s(", opname[widthindex]);
srcbuf = aml_eval_name(env, aml_parse_termobj(env, indent));
diff --git a/usr.sbin/acpidump/asl_dump.c b/usr.sbin/acpidump/asl_dump.c
index 25cea02bb05..d102ce6bb5b 100644
--- a/usr.sbin/acpidump/asl_dump.c
+++ b/usr.sbin/acpidump/asl_dump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asl_dump.c,v 1.1 2005/06/02 20:09:39 tholo Exp $ */
+/* $OpenBSD: asl_dump.c,v 1.2 2005/06/04 02:25:53 cloder Exp $ */
/*-
* Copyright (c) 1999 Doug Rabson
* Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org>
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: asl_dump.c,v 1.1 2005/06/02 20:09:39 tholo Exp $
+ * $Id: asl_dump.c,v 1.2 2005/06/04 02:25:53 cloder Exp $
* $FreeBSD: src/usr.sbin/acpi/acpidump/asl_dump.c,v 1.5 2001/10/23 14:53:58 takawata Exp $
*/
@@ -376,7 +376,32 @@ asl_dump_field(u_int8_t **dpp, u_int32_t offset)
switch (*dp) {
case '\\':
case '^':
- case 'A' ... 'Z':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
case '_':
case '.':
case '/':