summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-10-29 15:33:36 +0000
committerphk <phk@FreeBSD.org>1995-10-29 15:33:36 +0000
commit88d6fa4d4abcae38b7ea2520fe4f00203d58d677 (patch)
tree5994df578f3d766b837fe6548617062ae4661aac /sys/amd64
parentcc116c7cb7917f4b59507c90c1b0c2a45b1f6364 (diff)
downloadFreeBSD-src-88d6fa4d4abcae38b7ea2520fe4f00203d58d677.zip
FreeBSD-src-88d6fa4d4abcae38b7ea2520fe4f00203d58d677.tar.gz
Second batch of cleanup changes.
This time mostly making a lot of things static and some unused variables here and there.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/db_disasm.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/sys/amd64/amd64/db_disasm.c b/sys/amd64/amd64/db_disasm.c
index 8ce7365..c133831 100644
--- a/sys/amd64/amd64/db_disasm.c
+++ b/sys/amd64/amd64/db_disasm.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_disasm.c,v 1.8 1995/01/29 02:38:15 bde Exp $
+ * $Id: db_disasm.c,v 1.9 1995/05/30 07:59:20 rgrimes Exp $
*/
/*
@@ -88,7 +88,7 @@
#define X 33 /* extended FP op */
#define XA 34 /* for 'fstcw %ax' */
-struct inst {
+static struct inst {
char * i_name; /* name */
short i_has_modrm; /* has regmodrm byte */
short i_size; /* operand size */
@@ -100,7 +100,7 @@ struct inst {
#define op2(x,y) ((x)|((y)<<8))
#define op3(x,y,z) ((x)|((y)<<8)|((z)<<16))
-struct finst {
+static struct finst {
char * f_name; /* name for memory instruction */
int f_size; /* size for memory instruction */
int f_rrmode; /* mode for rr instruction */
@@ -108,7 +108,7 @@ struct finst {
(or pointer to table) */
};
-char * db_Grp6[] = {
+static char * db_Grp6[] = {
"sldt",
"str",
"lldt",
@@ -119,7 +119,7 @@ char * db_Grp6[] = {
""
};
-char * db_Grp7[] = {
+static char * db_Grp7[] = {
"sgdt",
"sidt",
"lgdt",
@@ -130,7 +130,7 @@ char * db_Grp7[] = {
"invlpg"
};
-char * db_Grp8[] = {
+static char * db_Grp8[] = {
"",
"",
"",
@@ -141,7 +141,7 @@ char * db_Grp8[] = {
"btc"
};
-struct inst db_inst_0f0x[] = {
+static struct inst db_inst_0f0x[] = {
/*00*/ { "", TRUE, NONE, op1(Ew), (char *)db_Grp6 },
/*01*/ { "", TRUE, NONE, op1(Ew), (char *)db_Grp7 },
/*02*/ { "lar", TRUE, LONG, op2(E,R), 0 },
@@ -161,7 +161,7 @@ struct inst db_inst_0f0x[] = {
/*0f*/ { "", FALSE, NONE, 0, 0 },
};
-struct inst db_inst_0f2x[] = {
+static struct inst db_inst_0f2x[] = {
/*20*/ { "mov", TRUE, LONG, op2(CR,E), 0 }, /* use E for reg */
/*21*/ { "mov", TRUE, LONG, op2(DR,E), 0 }, /* since mod == 11 */
/*22*/ { "mov", TRUE, LONG, op2(E,CR), 0 },
@@ -181,7 +181,7 @@ struct inst db_inst_0f2x[] = {
/*2f*/ { "", FALSE, NONE, 0, 0 },
};
-struct inst db_inst_0f8x[] = {
+static struct inst db_inst_0f8x[] = {
/*80*/ { "jo", FALSE, NONE, op1(Dl), 0 },
/*81*/ { "jno", FALSE, NONE, op1(Dl), 0 },
/*82*/ { "jb", FALSE, NONE, op1(Dl), 0 },
@@ -201,7 +201,7 @@ struct inst db_inst_0f8x[] = {
/*8f*/ { "jnle", FALSE, NONE, op1(Dl), 0 },
};
-struct inst db_inst_0f9x[] = {
+static struct inst db_inst_0f9x[] = {
/*90*/ { "seto", TRUE, NONE, op1(Eb), 0 },
/*91*/ { "setno", TRUE, NONE, op1(Eb), 0 },
/*92*/ { "setb", TRUE, NONE, op1(Eb), 0 },
@@ -221,7 +221,7 @@ struct inst db_inst_0f9x[] = {
/*9f*/ { "setnle",TRUE, NONE, op1(Eb), 0 },
};
-struct inst db_inst_0fax[] = {
+static struct inst db_inst_0fax[] = {
/*a0*/ { "push", FALSE, NONE, op1(Si), 0 },
/*a1*/ { "pop", FALSE, NONE, op1(Si), 0 },
/*a2*/ { "", FALSE, NONE, 0, 0 },
@@ -241,7 +241,7 @@ struct inst db_inst_0fax[] = {
/*a7*/ { "imul", TRUE, LONG, op2(E,R), 0 },
};
-struct inst db_inst_0fbx[] = {
+static struct inst db_inst_0fbx[] = {
/*b0*/ { "", FALSE, NONE, 0, 0 },
/*b1*/ { "", FALSE, NONE, 0, 0 },
/*b2*/ { "lss", TRUE, LONG, op2(E, R), 0 },
@@ -261,7 +261,7 @@ struct inst db_inst_0fbx[] = {
/*bf*/ { "movsw", TRUE, LONG, op2(E, R), 0 },
};
-struct inst db_inst_0fcx[] = {
+static struct inst db_inst_0fcx[] = {
/*c0*/ { "xadd", TRUE, BYTE, op2(R, E), 0 },
/*c1*/ { "xadd", TRUE, LONG, op2(R, E), 0 },
/*c2*/ { "", FALSE, NONE, 0, 0 },
@@ -280,7 +280,7 @@ struct inst db_inst_0fcx[] = {
/*cf*/ { "bswap", FALSE, LONG, op1(Ri), 0 },
};
-struct inst db_inst_0fdx[] = {
+static struct inst db_inst_0fdx[] = {
/*c0*/ { "cmpxchg",TRUE, BYTE, op2(R, E), 0 },
/*c1*/ { "cmpxchg",TRUE, LONG, op2(R, E), 0 },
/*c2*/ { "", FALSE, NONE, 0, 0 },
@@ -299,7 +299,7 @@ struct inst db_inst_0fdx[] = {
/*cf*/ { "", FALSE, NONE, 0, 0 },
};
-struct inst *db_inst_0f[] = {
+static struct inst *db_inst_0f[] = {
db_inst_0f0x,
0,
db_inst_0f2x,
@@ -318,43 +318,43 @@ struct inst *db_inst_0f[] = {
0
};
-char * db_Esc92[] = {
+static char * db_Esc92[] = {
"fnop", "", "", "", "", "", "", ""
};
-char * db_Esc93[] = {
+static char * db_Esc93[] = {
"", "", "", "", "", "", "", ""
};
-char * db_Esc94[] = {
+static char * db_Esc94[] = {
"fchs", "fabs", "", "", "ftst", "fxam", "", ""
};
-char * db_Esc95[] = {
+static char * db_Esc95[] = {
"fld1", "fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz",""
};
-char * db_Esc96[] = {
+static char * db_Esc96[] = {
"f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp",
"fincstp"
};
-char * db_Esc97[] = {
+static char * db_Esc97[] = {
"fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos"
};
-char * db_Esca4[] = {
+static char * db_Esca4[] = {
"", "fucompp","", "", "", "", "", ""
};
-char * db_Escb4[] = {
+static char * db_Escb4[] = {
"", "", "fnclex","fninit","", "", "", ""
};
-char * db_Esce3[] = {
+static char * db_Esce3[] = {
"", "fcompp","", "", "", "", "", ""
};
-char * db_Escf4[] = {
+static char * db_Escf4[] = {
"fnstsw","", "", "", "", "", "", ""
};
-struct finst db_Esc8[] = {
+static struct finst db_Esc8[] = {
/*0*/ { "fadd", SNGL, op2(STI,ST), 0 },
/*1*/ { "fmul", SNGL, op2(STI,ST), 0 },
/*2*/ { "fcom", SNGL, op2(STI,ST), 0 },
@@ -365,7 +365,7 @@ struct finst db_Esc8[] = {
/*7*/ { "fdivr", SNGL, op2(STI,ST), 0 },
};
-struct finst db_Esc9[] = {
+static struct finst db_Esc9[] = {
/*0*/ { "fld", SNGL, op1(STI), 0 },
/*1*/ { "", NONE, op1(STI), "fxch" },
/*2*/ { "fst", SNGL, op1(X), (char *)db_Esc92 },
@@ -376,7 +376,7 @@ struct finst db_Esc9[] = {
/*7*/ { "fnstcw", NONE, op1(X), (char *)db_Esc97 },
};
-struct finst db_Esca[] = {
+static struct finst db_Esca[] = {
/*0*/ { "fiadd", WORD, 0, 0 },
/*1*/ { "fimul", WORD, 0, 0 },
/*2*/ { "ficom", WORD, 0, 0 },
@@ -387,7 +387,7 @@ struct finst db_Esca[] = {
/*7*/ { "fidivr", WORD, 0, 0 }
};
-struct finst db_Escb[] = {
+static struct finst db_Escb[] = {
/*0*/ { "fild", WORD, 0, 0 },
/*1*/ { "", NONE, 0, 0 },
/*2*/ { "fist", WORD, 0, 0 },
@@ -398,7 +398,7 @@ struct finst db_Escb[] = {
/*7*/ { "fstp", EXTR, 0, 0 },
};
-struct finst db_Escc[] = {
+static struct finst db_Escc[] = {
/*0*/ { "fadd", DBLR, op2(ST,STI), 0 },
/*1*/ { "fmul", DBLR, op2(ST,STI), 0 },
/*2*/ { "fcom", DBLR, op2(ST,STI), 0 },
@@ -409,7 +409,7 @@ struct finst db_Escc[] = {
/*7*/ { "fdivr", DBLR, op2(ST,STI), "fdiv" },
};
-struct finst db_Escd[] = {
+static struct finst db_Escd[] = {
/*0*/ { "fld", DBLR, op1(STI), "ffree" },
/*1*/ { "", NONE, 0, 0 },
/*2*/ { "fst", DBLR, op1(STI), 0 },
@@ -420,7 +420,7 @@ struct finst db_Escd[] = {
/*7*/ { "fnstsw", NONE, 0, 0 },
};
-struct finst db_Esce[] = {
+static struct finst db_Esce[] = {
/*0*/ { "fiadd", LONG, op2(ST,STI), "faddp" },
/*1*/ { "fimul", LONG, op2(ST,STI), "fmulp" },
/*2*/ { "ficom", LONG, 0, 0 },
@@ -431,7 +431,7 @@ struct finst db_Esce[] = {
/*7*/ { "fidivr", LONG, op2(ST,STI), "fdivp" },
};
-struct finst db_Escf[] = {
+static struct finst db_Escf[] = {
/*0*/ { "fild", LONG, 0, 0 },
/*1*/ { "", LONG, 0, 0 },
/*2*/ { "fist", LONG, 0, 0 },
@@ -442,12 +442,12 @@ struct finst db_Escf[] = {
/*7*/ { "fstp", QUAD, 0, 0 },
};
-struct finst *db_Esc_inst[] = {
+static struct finst *db_Esc_inst[] = {
db_Esc8, db_Esc9, db_Esca, db_Escb,
db_Escc, db_Escd, db_Esce, db_Escf
};
-char * db_Grp1[] = {
+static char * db_Grp1[] = {
"add",
"or",
"adc",
@@ -458,7 +458,7 @@ char * db_Grp1[] = {
"cmp"
};
-char * db_Grp2[] = {
+static char * db_Grp2[] = {
"rol",
"ror",
"rcl",
@@ -469,7 +469,7 @@ char * db_Grp2[] = {
"sar"
};
-struct inst db_Grp3[] = {
+static struct inst db_Grp3[] = {
{ "test", TRUE, NONE, op2(I,E), 0 },
{ "test", TRUE, NONE, op2(I,E), 0 },
{ "not", TRUE, NONE, op1(E), 0 },
@@ -480,7 +480,7 @@ struct inst db_Grp3[] = {
{ "idiv", TRUE, NONE, op2(E,A), 0 },
};
-struct inst db_Grp4[] = {
+static struct inst db_Grp4[] = {
{ "inc", TRUE, BYTE, op1(E), 0 },
{ "dec", TRUE, BYTE, op1(E), 0 },
{ "", TRUE, NONE, 0, 0 },
@@ -491,7 +491,7 @@ struct inst db_Grp4[] = {
{ "", TRUE, NONE, 0, 0 }
};
-struct inst db_Grp5[] = {
+static struct inst db_Grp5[] = {
{ "inc", TRUE, LONG, op1(E), 0 },
{ "dec", TRUE, LONG, op1(E), 0 },
{ "call", TRUE, NONE, op1(Eind),0 },
@@ -502,7 +502,7 @@ struct inst db_Grp5[] = {
{ "", TRUE, NONE, 0, 0 }
};
-struct inst db_inst_table[256] = {
+static struct inst db_inst_table[256] = {
/*00*/ { "add", TRUE, BYTE, op2(R, E), 0 },
/*01*/ { "add", TRUE, LONG, op2(R, E), 0 },
/*02*/ { "add", TRUE, BYTE, op2(E, R), 0 },
@@ -793,7 +793,7 @@ struct inst db_inst_table[256] = {
/*ff*/ { "", TRUE, NONE, 0, (char *)db_Grp5 },
};
-struct inst db_bad_inst =
+static struct inst db_bad_inst =
{ "???", FALSE, NONE, 0, 0 }
;
@@ -805,7 +805,7 @@ struct inst db_bad_inst =
#define sib_index(byte) (((byte)>>3)&0x7)
#define sib_base(byte) ((byte)&0x7)
-struct i_addr {
+static struct i_addr {
int is_reg; /* if reg, reg number is in 'disp' */
int disp;
char * base;
@@ -813,7 +813,7 @@ struct i_addr {
int ss;
};
-char * db_index_reg_16[8] = {
+static char * db_index_reg_16[8] = {
"%bx,%si",
"%bx,%di",
"%bp,%si",
@@ -824,20 +824,20 @@ char * db_index_reg_16[8] = {
"%bx"
};
-char * db_reg[3][8] = {
+static char * db_reg[3][8] = {
"%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
"%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
"%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi"
};
-char * db_seg_reg[8] = {
+static char * db_seg_reg[8] = {
"%es", "%cs", "%ss", "%ds", "%fs", "%gs", "", ""
};
/*
* lengths for size attributes
*/
-int db_lengths[] = {
+static int db_lengths[] = {
1, /* BYTE */
2, /* WORD */
4, /* LONG */
@@ -854,7 +854,7 @@ int db_lengths[] = {
/*
* Read address at location and return updated location.
*/
-db_addr_t
+static db_addr_t
db_read_address(loc, short_addr, regmodrm, addrp)
db_addr_t loc;
int short_addr;
@@ -939,7 +939,7 @@ db_read_address(loc, short_addr, regmodrm, addrp)
return (loc);
}
-void
+static void
db_print_address(seg, size, addrp)
char * seg;
int size;
@@ -969,7 +969,7 @@ db_print_address(seg, size, addrp)
* Disassemble floating-point ("escape") instruction
* and return updated location.
*/
-db_addr_t
+static db_addr_t
db_disasm_esc(loc, inst, short_addr, size, seg)
db_addr_t loc;
int inst;
OpenPOWER on IntegriCloud