From owner-acpi-jp@jp.freebsd.org  Tue Jun  6 02:26:31 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id CAA24721;
	Tue, 6 Jun 2000 02:26:31 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from tasogare.imasy.or.jp (daemon@tasogare.imasy.or.jp [202.227.24.5])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id CAA24716
	for <acpi-jp@jp.freebsd.org>; Tue, 6 Jun 2000 02:26:30 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Received: from localhost (isdn28.imasy.or.jp [202.227.24.220])
	by tasogare.imasy.or.jp (8.10.1+3.3W/3.7W-tasogare/smtpfeed 1.04) with ESMTP id e55HQRP42594
	for <acpi-jp@jp.freebsd.org>; Tue, 6 Jun 2000 02:26:27 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
To: acpi-jp@jp.freebsd.org
X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Message-Id: <20000606022626M.iwasaki@jp.FreeBSD.org>
Date: Tue, 06 Jun 2000 02:26:26 +0900
From: Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
X-Dispatcher: imput version 20000228(IM140)
Lines: 507
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: acpi-jp 385
Subject: [acpi-jp 385] style fix: aml_... the rest
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: iwasaki@jp.freebsd.org

$B$3$l$GA4It$G$9!#L@F|$NLk$"$?$j(B commit $B$7$^$9!#(B
$B:#=5$O$=$l0J9_%3!<%I$r$$$8$k;~4V$,<h$l$J$$M=Dj$J$N$G!"(B
$B0B?4$7$F$$$8$C$F$/$@$5$$(B :-)

Index: aml_region.c
===================================================================
RCS file: /home/cvs/ACPI/sys/i386/acpi/aml/aml_region.c,v
retrieving revision 1.1
diff -u -r1.1 aml_region.c
--- aml_region.c	2000/06/03 14:39:14	1.1
+++ aml_region.c	2000/06/05 16:23:23
@@ -31,7 +31,6 @@
  */
 
 #include <sys/param.h>
-#include <sys/types.h>
 
 #include <i386/acpi/aml/aml_region.h>
 
@@ -71,4 +70,3 @@
 {
 	return (0);
 }
-
Index: aml_region.h
===================================================================
RCS file: /home/cvs/ACPI/sys/i386/acpi/aml/aml_region.h,v
retrieving revision 1.1
diff -u -r1.1 aml_region.h
--- aml_region.h	2000/06/03 14:39:14	1.1
+++ aml_region.h	2000/06/05 16:30:12
@@ -26,29 +26,29 @@
  *	$Id: aml_region.h,v 1.1 2000/06/03 14:39:14 iwasaki Exp $
  */
 
-#ifndef _REGION_H_
-#define _REGION_H_
+#ifndef _AML_REGION_H_
+#define _AML_REGION_H_
 
 /*
  * Region I/O subroutine
  */
 
-u_int32_t	acpi_region_read(int, u_int32_t, u_int32_t,
-				 u_int32_t, u_int32_t);
-int		acpi_region_write(int, u_int32_t, u_int32_t,
-    				  u_int32_t, u_int32_t, u_int32_t);
-int		acpi_region_read_into_buffer(int, u_int32_t, u_int32_t,
+u_int32_t	 acpi_region_read(int, u_int32_t, u_int32_t,
+				  u_int32_t, u_int32_t);
+int		 acpi_region_write(int, u_int32_t, u_int32_t,
+				  u_int32_t, u_int32_t, u_int32_t);
+int		 acpi_region_read_into_buffer(int, u_int32_t, u_int32_t,
 					     u_int32_t, u_int32_t, u_int8_t *);
-int		acpi_region_write_from_buffer(int, u_int32_t, u_int8_t *,
+int		 acpi_region_write_from_buffer(int, u_int32_t, u_int8_t *,
 					      u_int32_t, u_int32_t, u_int32_t);
-int		acpi_region_bcopy(int, u_int32_t, u_int32_t, u_int32_t, u_int32_t,
-				  u_int32_t, u_int32_t, u_int32_t, u_int32_t);
+int		 acpi_region_bcopy(int, u_int32_t, u_int32_t,
+				   u_int32_t, u_int32_t, u_int32_t,
+				   u_int32_t, u_int32_t, u_int32_t);
 
 #ifndef _KERNEL
-void		acpi_simulation_regdump(const char *);
+void	acpi_simulation_regdump(const char *);
 extern int	acpi_debug_prompt_regoutput;
 extern int	acpi_debug_prompt_reginput;
-#endif	/* _KERNEL */
+#endif /* !_KERNEL */
 
-#endif
-
+#endif /* !_AML_REGION_H_ */
Index: aml_status.h
===================================================================
RCS file: /home/cvs/ACPI/sys/i386/acpi/aml/aml_status.h,v
retrieving revision 1.4
diff -u -r1.4 aml_status.h
--- aml_status.h	2000/06/02 07:15:10	1.4
+++ aml_status.h	2000/06/05 16:31:38
@@ -26,16 +26,15 @@
  *	$Id: aml_status.h,v 1.4 2000/06/02 07:15:10 yokoyama Exp $
  */
 
-#ifndef _STATUS_H_
-#define _STATUS_H_
+#ifndef _AML_STATUS_H_
+#define _AML_STATUS_H_
 
-enum aml_status{
-  aml_stat_none=0,
-  aml_stat_return,
-  aml_stat_break,
-  aml_stat_panic,
-  aml_stat_step
- };
+enum	aml_status {
+	aml_stat_none = 0,
+	aml_stat_return,
+	aml_stat_break,
+	aml_stat_panic,
+	aml_stat_step
+};
 
-#endif
-
+#endif /* !_AML_STATUS_H_ */
Index: aml_store.c
===================================================================
RCS file: /home/cvs/ACPI/sys/i386/acpi/aml/aml_store.c,v
retrieving revision 1.13
diff -u -r1.13 aml_store.c
--- aml_store.c	2000/06/03 14:32:57	1.13
+++ aml_store.c	2000/06/05 16:43:16
@@ -27,7 +27,6 @@
  */
 
 #include <sys/param.h>
-#include <sys/types.h>
 
 #include <i386/acpi/aml/aml_amlmem.h>
 #include <i386/acpi/aml/aml_common.h>
@@ -43,37 +42,41 @@
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
+
 #include "debug.h"
-#else
+#else /* _KERNEL */
 #include <sys/systm.h>
-#endif
+#endif /* !_KERNEL */
 
 static void
-acpi_store_to_fieldname(struct aml_environ *env,union aml_object *obj,struct aml_name *name)
+acpi_store_to_fieldname(struct aml_environ *env, union aml_object *obj,
+    struct aml_name *name)
 {
-	struct aml_name *wname,*oname;
-	struct aml_field *field;
 	char	*buffer;
-	field=&name->property->field;
-	oname=env->curname;
-	env->curname=name->parent;
-	if(field->f.ftype==f_t_field){
-		struct aml_opregion *or;
-		wname=acpi_search_name(env,field->f.fld.regname);
-		if(wname ==NULL ||
-		    wname->property==NULL||
-		    wname->property->type!=aml_t_opregion){
+	struct	aml_name *wname, *oname;
+	struct	aml_field *field;
+	struct	aml_opregion *or;
+	union	aml_object tobj;
+
+	field = &name->property->field;
+	oname = env->curname;
+	env->curname = name->parent;
+	if (field->f.ftype == f_t_field) {
+		wname = acpi_search_name(env, field->f.fld.regname);
+		if (wname == NULL ||
+		    wname->property == NULL ||
+		    wname->property->type != aml_t_opregion) {
 			AML_PRINTF("Inappropreate Type\n");
-			env->stat=aml_stat_panic;
-			env->curname=oname;
-			return ;
+			env->stat = aml_stat_panic;
+			env->curname = oname;
+			return;
 		}
-		or=&wname->property->opregion;
+		or = &wname->property->opregion;
 		switch (obj->type) {
 		case aml_t_num:
 			AML_PRINTF("[write(From%d, 0x%x, 0x%x)]",
 			    or->space, obj->num.number,
-			    or->offset+field->bitoffset/8);
+			    or->offset + field->bitoffset / 8);
 			acpi_region_write(or->space, field->flags,
 			    obj->num.number, or->offset,
 			    field->bitoffset, field->bitlen);
@@ -93,57 +96,56 @@
 		case aml_t_regfield:
 			if (or->space != obj->regfield.space) {
 				AML_PRINTF("acpi_store_to_fieldname: "
-				       "Different type of space\n");
+					   "Different type of space\n");
 				break;
 			}
 			acpi_region_bcopy(obj->regfield.space,
-			    obj->regfield.flags, obj->regfield.offset, 
-			    obj->regfield.bitoffset, obj->regfield.bitlen, 
+			    obj->regfield.flags, obj->regfield.offset,
+			    obj->regfield.bitoffset, obj->regfield.bitlen,
 			    field->flags, or->offset, field->bitoffset,
 			    field->bitlen);
 			break;
 		default:
 			AML_PRINTF("acpi_store_to_fieldname: "
-			       "Inappropreate Type of src object\n");
+				   "Inappropreate Type of src object\n");
 			break;
 		}
-	}else if(field->f.ftype==f_t_index){
-		union aml_object tobj;
-		wname=acpi_search_name(env,field->f.ifld.indexname);
-		tobj.type=aml_t_num;
-		tobj.num.number=field->bitoffset/8;/*AccessType Boundary*/
-		acpi_store_to_name(env,&tobj,wname);
-		wname=acpi_search_name(env,field->f.ifld.dataname);
-		tobj.num=obj->num;
-		tobj.num.number=tobj.num.number<<(field->bitoffset&7);
-		acpi_store_to_name(env,&tobj,wname);
+	} else if (field->f.ftype == f_t_index) {
+		wname = acpi_search_name(env, field->f.ifld.indexname);
+		tobj.type = aml_t_num;
+		tobj.num.number = field->bitoffset / 8;	/* AccessType Boundary */
+		acpi_store_to_name(env, &tobj, wname);
+		wname = acpi_search_name(env, field->f.ifld.dataname);
+		tobj.num = obj->num;
+		tobj.num.number = tobj.num.number << (field->bitoffset & 7);
+		acpi_store_to_name(env, &tobj, wname);
 	}
-	env->curname=oname;
+	env->curname = oname;
 }
 
 static void
-acpi_store_to_buffer(struct aml_environ *env,union aml_object *obj, union aml_object *buf, int offset)
+acpi_store_to_buffer(struct aml_environ *env, union aml_object *obj,
+    union aml_object *buf, int offset)
 {
 	int	size;
 
-	switch (obj->type){
+	switch (obj->type) {
 	case aml_t_num:
 		if (offset > buf->buffer.size) {
 			acpi_realloc_object(buf, offset);
 		}
 		buf->buffer.data[offset] = obj->num.number & 0xff;
-		AML_PRINTF("[Store number 0x%x to buffer]", obj->num.number & 0xff);
+		AML_PRINTF("[Store number 0x%x to buffer]",
+		    obj->num.number & 0xff);
 		break;
-
 	case aml_t_string:
 		size = strlen(obj->str.string);
 		if (buf->buffer.size - offset < size) {
 			acpi_realloc_object(buf, offset + size + 1);
 		}
-		strcpy(&buf->buffer.data[offset],obj->str.string);
+		strcpy(&buf->buffer.data[offset], obj->str.string);
 		AML_PRINTF("[Store string to buffer]");
 		break;
-
 	case aml_t_buffer:
 		bzero(buf->buffer.data, buf->buffer.size);
 		if (obj->buffer.size > buf->buffer.size) {
@@ -153,14 +155,12 @@
 		}
 		bcopy(obj->buffer.data, buf->buffer.data, size);
 		break;
-
 	case aml_t_regfield:
 		acpi_region_read_into_buffer(obj->regfield.space,
-		    obj->regfield.flags, obj->regfield.offset, 
-		    obj->regfield.bitoffset, obj->regfield.bitlen, 
+		    obj->regfield.flags, obj->regfield.offset,
+		    obj->regfield.bitoffset, obj->regfield.bitlen,
 		    buf->buffer.data);
 		break;
-
 	default:
 		goto not_yet;
 	}
@@ -171,23 +171,21 @@
 
 
 void
-acpi_store_to_object(struct aml_environ *env,union aml_object *src, union aml_object *dist)
+acpi_store_to_object(struct aml_environ *env, union aml_object *src,
+    union aml_object * dist)
 {
-	switch(dist->type){
-	case aml_t_num:
-		if(src->type==aml_t_num){
-			dist->num=src->num;
+	char	*buffer, *srcbuf;
+	int	offset, bitlen;
+
+	switch (dist->type) {
+		case aml_t_num:
+		if (src->type == aml_t_num) {
+			dist->num = src->num;
 			AML_PRINTF("[Store number 0x%x]", src->num.number);
-		}
-		else{
-			env->stat=aml_stat_panic;
+		} else {
+			env->stat = aml_stat_panic;
 		}
 		break;
-#if 0
-	case aml_t_field:
-		acpi_store_to_fieldname(env,obj,name);
-		break;
-#endif
 	case aml_t_string:
 	case aml_t_package:
 		break;
@@ -195,11 +193,9 @@
 		acpi_store_to_buffer(env, src, dist, 0);
 		break;
 	case aml_t_bufferfield:
-	{
-		char	*buffer = dist->bfld.origin;
-		char	*srcbuf;
-		int	offset = dist->bfld.bitoffset;
-		int	bitlen = dist->bfld.bitlen;
+		buffer = dist->bfld.origin;
+		offset = dist->bfld.bitoffset;
+		bitlen = dist->bfld.bitlen;
 
 		buffer += offset / 8;
 		switch (src->type) {
@@ -220,44 +216,42 @@
 			break;
 		case aml_t_regfield:
 			acpi_region_read_into_buffer(src->regfield.space,
-			    src->regfield.flags, src->regfield.offset, 
-			    src->regfield.bitoffset, src->regfield.bitlen, 
+			    src->regfield.flags, src->regfield.offset,
+			    src->regfield.bitoffset, src->regfield.bitlen,
 			    buffer);
 			break;
 		default:
 			AML_PRINTF("not implemented yet");
 			break;
 		}
-	}
 		break;
 	case aml_t_debug:
 		showobject(src);
 		break;
 	default:
-		AML_PRINTF("[Unimplemented %d]",dist->type);
+		AML_PRINTF("[Unimplemented %d]", dist->type);
 		break;
 	}
 }
 
 static void
-acpi_store_to_objref(struct aml_environ *env,union aml_object *obj, union aml_object *r)
+acpi_store_to_objref(struct aml_environ *env, union aml_object *obj,
+    union aml_object *r)
 {
 	int	offset;
-	union aml_object *ref;
+	union	aml_object *ref;
 
 	if (r->objref.ref == NULL) {
-		r->objref.ref = acpi_alloc_object(obj->type, NULL);/* XXX */
+		r->objref.ref = acpi_alloc_object(obj->type, NULL);	/* XXX */
 		r->objref.nameref->property = r->objref.ref;
 	}
-
 	ref = r->objref.ref;
 
-	switch(ref->type){
+	switch (ref->type) {
 	case aml_t_buffer:
 		offset = r->objref.offset;
 		acpi_store_to_buffer(env, obj, ref, r->objref.offset);
 		break;
-
 	case aml_t_package:
 		offset = r->objref.offset;
 		if (r->objref.ref->package.elements < offset) {
@@ -274,49 +268,46 @@
 	}
 }
 
-/*Store to Named object */
-void 
-acpi_store_to_name(struct aml_environ *env,union aml_object *obj,struct aml_name *name)
+/*
+ * Store to Named object
+ */
+void
+acpi_store_to_name(struct aml_environ *env, union aml_object *obj,
+    struct aml_name *name)
 {
-	struct aml_name *name2;
-	if(env->stat==aml_stat_panic){
-		return ;
-	}
-	if(name==NULL||obj==NULL){
-#if 0
-		/*Index() is not implemented yet*/
-		env->stat=aml_stat_panic;
-#endif
+	struct	aml_name *wname;
+
+	if (env->stat == aml_stat_panic) {
+		return;
+	}
+	if (name == NULL || obj == NULL) {
 		AML_PRINTF("[Try to store no existant name ]");
 		return;
 	}
-	if(name->property==NULL){
-		name->property=acpi_copy_object(env,obj);
+	if (name->property == NULL) {
+		name->property = acpi_copy_object(env, obj);
 		AML_PRINTF("[Copy number 0x%x]", obj->num.number);
 		return;
 	}
-	
-	if(name->property->type==aml_t_namestr){
-		name2=acpi_search_name(env,name->property->nstr.dp);
-		name=name2;
+	if (name->property->type == aml_t_namestr) {
+		wname = acpi_search_name(env, name->property->nstr.dp);
+		name = wname;
 	}
-	if(name==NULL){
-		env->stat=aml_stat_panic;
+	if (name == NULL) {
+		env->stat = aml_stat_panic;
 		return;
 	}
-	if(name->property==NULL||name->property->type==aml_t_null){
-		name->property=acpi_copy_object(env,obj);
+	if (name->property == NULL || name->property->type == aml_t_null) {
+		name->property = acpi_copy_object(env, obj);
 		AML_PRINTF("[Copy number 0x%x]", obj->num.number);
 		return;
 	}
-
 	/* no need to store to Zero object */
 	if (name->name[0] == NULL && name->property != NULL &&
 	    name->property->type == aml_t_num &&
 	    name->property->num.number == 0) {
 		return;
 	}
-
 	/* try to dereference */
 	if (obj->type == aml_t_objref && obj->objref.deref == 0) {
 		AML_PRINTF("Source object isn't dereferenced yet, "
@@ -324,25 +315,18 @@
 		obj->objref.deref = 1;
 		obj = acpi_eval_objref(env, obj);
 	}
-
-	switch(name->property->type){
+	switch (name->property->type) {
 	case aml_t_field:
-		acpi_store_to_fieldname(env,obj,name);
+		acpi_store_to_fieldname(env, obj, name);
 		break;
 	case aml_t_objref:
 		acpi_store_to_objref(env, obj, name->property);
 		break;
 	case aml_t_num:
-		if(name==&env->work)
+		if (name == &env->work)
 			break;
 	default:
 		acpi_store_to_object(env, obj, name->property);
 		break;
 	}
 }
-
-
-
-
-
-
Index: aml_store.h
===================================================================
RCS file: /home/cvs/ACPI/sys/i386/acpi/aml/aml_store.h,v
retrieving revision 1.4
diff -u -r1.4 aml_store.h
--- aml_store.h	2000/06/02 07:15:10	1.4
+++ aml_store.h	2000/06/05 16:47:50
@@ -25,6 +25,13 @@
  *
  *	$Id: aml_store.h,v 1.4 2000/06/02 07:15:10 yokoyama Exp $
  */
-void 
-acpi_store_to_name(struct aml_environ *,union aml_object *,struct aml_name *);
-void	acpi_store_to_object(struct aml_environ *, union aml_object *, union aml_object *);
+
+#ifndef _AML_STORE_H_
+#define _AML_STORE_H_
+
+void	 acpi_store_to_name(struct aml_environ *, union aml_object *,
+			    struct aml_name *);
+void	 acpi_store_to_object(struct aml_environ *, union aml_object *,
+			      union aml_object *);
+
+#endif /* _AML_STORE_H_ */
