Commit fa25b99a authored by Denys Vlasenko's avatar Denys Vlasenko Committed by James Bottomley

[SCSI] aic7xxx: introduce "dont_generate_debug_code" keyword in aicasm parser

aic7xxx still contains ~30kb of dead code if pretty printing of registers
is requested. These patches deal with it.

Size differences:

   text    data     bss     dec     hex filename
DEBUG_ENABLE+PRETTY_PRINT:
 234697    2362    1188  238247   3a2a7 linux-2.6.26-rc8-/drivers/scsi/aic7xxx/built-in.o
 205092    2362    1188  208642   32f02 linux-2.6.26-rc8/drivers/scsi/aic7xxx/built-in.o
NO_DEBUG_ENABLE+PRETTY_PRINT:
 227272    2362    1172  230806   38596 linux-2.6.26-rc8-/drivers/scsi/aic7xxx/built-in.o
 197671    2362    1172  201205   311f5 linux-2.6.26-rc8/drivers/scsi/aic7xxx/built-in.o
DEBUG_ENABLE+NO_PRETTY_PRINT:
 192457    2362    1188  196007   2fda7 linux-2.6.26-rc8-/drivers/scsi/aic7xxx/built-in.o
 192457    2362    1188  196007   2fda7 linux-2.6.26-rc8/drivers/scsi/aic7xxx/built-in.o
NO_DEBUG_ENABLE+NO_PRETTY_PRINT:
 185040    2362    1172  188574   2e09e linux-2.6.26-rc8-/drivers/scsi/aic7xxx/built-in.o
 185040    2362    1172  188574   2e09e linux-2.6.26-rc8/drivers/scsi/aic7xxx/built-in.o

This patch:

Introduce "dont_generate_debug_code" keyword in aicasm parser.
Signed-off-by: default avatarDenys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Acked-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 5a36756b
...@@ -147,6 +147,8 @@ void yyerror(const char *string); ...@@ -147,6 +147,8 @@ void yyerror(const char *string);
%token T_ACCESS_MODE %token T_ACCESS_MODE
%token T_DONT_GENERATE_DEBUG_CODE
%token T_MODES %token T_MODES
%token T_DEFINE %token T_DEFINE
...@@ -357,6 +359,7 @@ reg_attribute: ...@@ -357,6 +359,7 @@ reg_attribute:
| size | size
| count | count
| access_mode | access_mode
| dont_generate_debug_code
| modes | modes
| field_defn | field_defn
| enum_defn | enum_defn
...@@ -410,6 +413,13 @@ access_mode: ...@@ -410,6 +413,13 @@ access_mode:
} }
; ;
dont_generate_debug_code:
T_DONT_GENERATE_DEBUG_CODE
{
cur_symbol->dont_generate_debug_code = 1;
}
;
modes: modes:
T_MODES mode_list T_MODES mode_list
{ {
......
...@@ -164,6 +164,7 @@ download { return T_DOWNLOAD; } ...@@ -164,6 +164,7 @@ download { return T_DOWNLOAD; }
address { return T_ADDRESS; } address { return T_ADDRESS; }
count { return T_COUNT; } count { return T_COUNT; }
access_mode { return T_ACCESS_MODE; } access_mode { return T_ACCESS_MODE; }
dont_generate_debug_code { return T_DONT_GENERATE_DEBUG_CODE; }
modes { return T_MODES; } modes { return T_MODES; }
RW|RO|WO { RW|RO|WO {
if (strcmp(yytext, "RW") == 0) if (strcmp(yytext, "RW") == 0)
......
...@@ -539,6 +539,9 @@ symtable_dump(FILE *ofile, FILE *dfile) ...@@ -539,6 +539,9 @@ symtable_dump(FILE *ofile, FILE *dfile)
aic_print_include(dfile, stock_include_file); aic_print_include(dfile, stock_include_file);
SLIST_FOREACH(curnode, &registers, links) { SLIST_FOREACH(curnode, &registers, links) {
if (curnode->symbol->dont_generate_debug_code)
continue;
switch(curnode->symbol->type) { switch(curnode->symbol->type) {
case REGISTER: case REGISTER:
case SCBLOC: case SCBLOC:
......
...@@ -137,7 +137,8 @@ typedef struct symbol { ...@@ -137,7 +137,8 @@ typedef struct symbol {
struct label_info *linfo; struct label_info *linfo;
struct cond_info *condinfo; struct cond_info *condinfo;
struct macro_info *macroinfo; struct macro_info *macroinfo;
}info; } info;
int dont_generate_debug_code;
} symbol_t; } symbol_t;
typedef struct symbol_ref { typedef struct symbol_ref {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment