patch-2.4.19 linux-2.4.19/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c

Next file: linux-2.4.19/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h
Previous file: linux-2.4.19/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c linux-2.4.19/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c
@@ -36,7 +36,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_symbol.c#9 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_symbol.c#13 $
  *
  * $FreeBSD: src/sys/dev/aic7xxx/aicasm/aicasm_symbol.c,v 1.11 2000/09/22 22:19:54 gibbs Exp $
  */
@@ -49,6 +49,7 @@
 #include <db.h>
 #endif
 #include <fcntl.h>
+#include <regex.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -318,12 +319,15 @@
 	symlist_t constants;
 	symlist_t download_constants;
 	symlist_t aliases;
+	symlist_t exported_labels;
+	u_int	  i;
 
 	SLIST_INIT(&registers);
 	SLIST_INIT(&masks);
 	SLIST_INIT(&constants);
 	SLIST_INIT(&download_constants);
 	SLIST_INIT(&aliases);
+	SLIST_INIT(&exported_labels);
 
 	if (symtable != NULL) {
 		DBT	 key;
@@ -345,10 +349,8 @@
 				symlist_add(&masks, cursym, SYMLIST_SORT);
 				break;
 			case CONST:
-				if (cursym->info.cinfo->define == FALSE) {
-					symlist_add(&constants, cursym,
-						    SYMLIST_INSERT_HEAD);
-				}
+				symlist_add(&constants, cursym,
+					    SYMLIST_INSERT_HEAD);
 				break;
 			case DOWNLOAD_CONST:
 				symlist_add(&download_constants, cursym,
@@ -358,6 +360,12 @@
 				symlist_add(&aliases, cursym,
 					    SYMLIST_INSERT_HEAD);
 				break;
+			case LABEL:
+				if (cursym->info.linfo->exported == 0)
+					break;
+				symlist_add(&exported_labels, cursym,
+					    SYMLIST_INSERT_HEAD);
+				break;
 			default:
 				break;
 			}
@@ -403,7 +411,7 @@
 %s */\n", versions);
 		while (SLIST_FIRST(&registers) != NULL) {
 			symbol_node_t *curnode;
-			u_int8_t value;
+			u_int value;
 			char *tab_str;
 			char *tab_str2;
 
@@ -463,7 +471,7 @@
 		
 		fprintf(ofile, "\n\n/* Downloaded Constant Definitions */\n");
 
-		while (SLIST_FIRST(&download_constants) != NULL) {
+		for (i = 0; SLIST_FIRST(&download_constants) != NULL; i++) {
 			symbol_node_t *curnode;
 
 			curnode = SLIST_FIRST(&download_constants);
@@ -473,6 +481,20 @@
 				curnode->symbol->info.cinfo->value);
 			free(curnode);
 		}
+		fprintf(ofile, "#define\tDOWNLOAD_CONST_COUNT\t0x%02x\n", i);
+
+		fprintf(ofile, "\n\n/* Exported Labels */\n");
+
+		while (SLIST_FIRST(&exported_labels) != NULL) {
+			symbol_node_t *curnode;
+
+			curnode = SLIST_FIRST(&exported_labels);
+			SLIST_REMOVE_HEAD(&exported_labels, links);
+			fprintf(ofile, "#define\tLABEL_%-8s\t0x%02x\n",
+				curnode->symbol->name,
+				curnode->symbol->info.linfo->address);
+			free(curnode);
+		}
 	}
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)