projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use struct nlist; change field names; vgrind format fixes
[unix-history]
/
usr
/
src
/
old
/
as.vax
/
asjxxx.c
diff --git
a/usr/src/old/as.vax/asjxxx.c
b/usr/src/old/as.vax/asjxxx.c
index
a416426
..
a3d4a45
100644
(file)
--- a/
usr/src/old/as.vax/asjxxx.c
+++ b/
usr/src/old/as.vax/asjxxx.c
@@
-1,7
+1,6
@@
/* Copyright (c) 1980 Regents of the University of California */
/* Copyright (c) 1980 Regents of the University of California */
-static char sccsid[] = "@(#)asjxxx.c 4.
1
%G%";
+static char sccsid[] = "@(#)asjxxx.c 4.
2
%G%";
#include <stdio.h>
#include <stdio.h>
-#include <sys/types.h>
#include "as.h"
#include "assyms.h"
#include "as.h"
#include "assyms.h"
@@
-42,23
+41,23
@@
ijxout(op,ap,nact)
*/
putins(op,ap,nact);
jumpfrom = lastjxxx;
*/
putins(op,ap,nact);
jumpfrom = lastjxxx;
- jumpfrom->tag = JXACTIVE;
- jumpfrom->jxbump = 0;
+ jumpfrom->
s_
tag = JXACTIVE;
+ jumpfrom->
s_
jxbump = 0;
if (op == JBR)
if (op == JBR)
- jumpfrom->jxfear = JBRFSIZE;
+ jumpfrom->
s_
jxfear = JBRFSIZE;
else
else
- jumpfrom->jxfear = JXXXFSIZE;
+ jumpfrom->
s_
jxfear = JXXXFSIZE;
if (lastnam == 0)
yyerror("jxxx destination not a label");
if (lastnam == 0)
yyerror("jxxx destination not a label");
- jumpfrom->dest = lastnam;
- jumpfrom->
type = dotp->xtype;
/*only TEXT or DATA*/
- jumpfrom->index = dotp-usedot;
+ jumpfrom->
s_
dest = lastnam;
+ jumpfrom->
s_type = dotp->e_xtype;
/*only TEXT or DATA*/
+ jumpfrom->
s_
index = dotp-usedot;
/*
* value ALWAYS (ALWAYS!!!) indexes the next instruction
* after the jump, even in the jump must be exploded
* (bumped)
*/
/*
* value ALWAYS (ALWAYS!!!) indexes the next instruction
* after the jump, even in the jump must be exploded
* (bumped)
*/
- jumpfrom->
value = dotp->
xvalue;
+ jumpfrom->
s_value = dotp->e_
xvalue;
njxxx++;
} else {/* pass2, resolve */
/*
njxxx++;
} else {/* pass2, resolve */
/*
@@
-70,25
+69,25
@@
ijxout(op,ap,nact)
register struct arg *aplast;
aplast = ap + nact - 1;
register struct arg *aplast;
aplast = ap + nact - 1;
- xp = aplast->xp;
- if (lastjxxx->tag == JXTUNNEL){
- lastjxxx->tag = JXINACTIVE;
- tunnel = lastjxxx->dest;
- xp->
xvalue = tunnel->value
/*index of instruction following*/
+ xp = aplast->
a_
xp;
+ if (lastjxxx->
s_
tag == JXTUNNEL){
+ lastjxxx->
s_
tag = JXINACTIVE;
+ tunnel = lastjxxx->
s_
dest;
+ xp->
e_xvalue = tunnel->s_value
/*index of instruction following*/
- 3 /* size of brw + word*/
- 3 /* size of brw + word*/
- + ( ( (tunnel->jxfear == JBRFSIZE) &&
- (tunnel->jxbump == 0))?1:0);
+ + ( ( (tunnel->
s_
jxfear == JBRFSIZE) &&
+ (tunnel->
s_
jxbump == 0))?1:0);
/*non bumped branch byteis only 2 back*/
}
/*non bumped branch byteis only 2 back*/
}
- if (lastjxxx->
jxbump == 0){
/*wasn't bumped, so is short form*/
+ if (lastjxxx->
s_jxbump == 0){
/*wasn't bumped, so is short form*/
putins(op, ap, nact);
} else {
if (op != JBR){ /*branch reverse conditional byte over
branch unconditional word*/
putins(op, ap, nact);
} else {
if (op != JBR){ /*branch reverse conditional byte over
branch unconditional word*/
- oxvalue = xp->xvalue;
- xp->
xvalue = lastjxxx->
value;
+ oxvalue = xp->
e_
xvalue;
+ xp->
e_xvalue = lastjxxx->s_
value;
putins(op^1, ap, nact);
putins(op^1, ap, nact);
- xp->xvalue = oxvalue;
+ xp->
e_
xvalue = oxvalue;
}
putins(BRW, aplast, 1);
}
}
putins(BRW, aplast, 1);
}
@@
-100,16
+99,16
@@
jalign(xp, sp)
register struct symtab *sp;
{
register int mask;
register struct symtab *sp;
{
register int mask;
- if (xp->
xtype != XABS || xp->xvalue < 0 || xp->
xvalue > 16) {
+ if (xp->
e_xtype != XABS || xp->e_xvalue < 0 || xp->e_
xvalue > 16) {
yyerror("Illegal `align' argument");
return;
}
flushfield(NBPW/4);
if (passno == 1) {
yyerror("Illegal `align' argument");
return;
}
flushfield(NBPW/4);
if (passno == 1) {
- sp->tag = JXALIGN;
- sp->
jxfear = (1 << xp->
xvalue) - 1;
- sp->
type = dotp->
xtype;
- sp->index = dotp-usedot;
+ sp->
s_
tag = JXALIGN;
+ sp->
s_jxfear = (1 << xp->e_
xvalue) - 1;
+ sp->
s_type = dotp->e_
xtype;
+ sp->
s_
index = dotp-usedot;
/*
* We guess that the align will take up at least one
* byte in the code output. We will correct for this
/*
* We guess that the align will take up at least one
* byte in the code output. We will correct for this
@@
-123,19
+122,19
@@
jalign(xp, sp)
* the code stream point to the next byte following
* the logical entry in the symbol table
*/
* the code stream point to the next byte following
* the logical entry in the symbol table
*/
- dotp->xvalue += 1;
- sp->
value = dotp->
xvalue;
+ dotp->
e_
xvalue += 1;
+ sp->
s_value = dotp->e_
xvalue;
njxxx++;
} else {
njxxx++;
} else {
- mask = (1 << xp->xvalue) - 1;
- while (dotp->xvalue & mask){
+ mask = (1 << xp->
e_
xvalue) - 1;
+ while (dotp->
e_
xvalue & mask){
#ifdef UNIX
outb(0);
#endif UNIX
#ifdef VMS
*vms_obj_ptr++ = -1;
*vms_obj_ptr++ = 0;
#ifdef UNIX
outb(0);
#endif UNIX
#ifdef VMS
*vms_obj_ptr++ = -1;
*vms_obj_ptr++ = 0;
- dotp->xvalue += 1;
+ dotp->
e_
xvalue += 1;
#endif VMS
}
}
#endif VMS
}
}
@@
-189,26
+188,26
@@
jxxxfix()
*/
tunnel = 0; /*initially, no tunnel*/
SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom, ubjumpfrom, ++){
*/
tunnel = 0; /*initially, no tunnel*/
SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom, ubjumpfrom, ++){
- tag = jumpfrom->tag;
+ tag = jumpfrom->
s_
tag;
if (tag <= IGNOREBOUND)
continue; /*just an ordinary symbol*/
if (tag == JXALIGN){
tunnel = 0; /*avoid tunneling across a flex alocation*/
continue; /*we take care of these later*/
}
if (tag <= IGNOREBOUND)
continue; /*just an ordinary symbol*/
if (tag == JXALIGN){
tunnel = 0; /*avoid tunneling across a flex alocation*/
continue; /*we take care of these later*/
}
- if ( jumpfrom->
jxfear == JBRFSIZE
/*unconditional*/
+ if ( jumpfrom->
s_jxfear == JBRFSIZE
/*unconditional*/
|| ( tag == JXINACTIVE /*inactive bumped*/
|| ( tag == JXINACTIVE /*inactive bumped*/
- && (jumpfrom->jxbump != 0)
+ && (jumpfrom->
s_
jxbump != 0)
)
) tunnel = jumpfrom;
if (tag != JXACTIVE)
continue;
)
) tunnel = jumpfrom;
if (tag != JXACTIVE)
continue;
- dest = jumpfrom->dest;
- if (jumpfrom->
index != dest->
index){
+ dest = jumpfrom->
s_
dest;
+ if (jumpfrom->
s_index != dest->s_
index){
yyerror("Intersegment jxxx");
continue;
}
yyerror("Intersegment jxxx");
continue;
}
- displ = dest->
value - jumpfrom->
value;
+ displ = dest->
s_value - jumpfrom->s_
value;
if (displ < MINBYTE || displ > MAXBYTE) {
/*
* This is an immediate lose!
if (displ < MINBYTE || displ > MAXBYTE) {
/*
* This is an immediate lose!
@@
-222,27
+221,27
@@
jxxxfix()
* its relative position will be unaffected
* by future jxxx expansions.
*/
* its relative position will be unaffected
* by future jxxx expansions.
*/
- if ( (jumpfrom->jxfear > JBRFSIZE)
+ if ( (jumpfrom->
s_
jxfear > JBRFSIZE)
&& (tunnel)
&& (tunnel)
- && (tunnel->
dest == jumpfrom->dest)
- && (tunnel->
index == jumpfrom->
index)
- && (tunnel->
value - jumpfrom->
value >=
+ && (tunnel->
s_dest == jumpfrom->s_dest)
+ && (tunnel->
s_index == jumpfrom->s_
index)
+ && (tunnel->
s_value - jumpfrom->s_
value >=
MINBYTE + JXXXFSIZE)
) {
/*
* tunnelling is OK
*/
MINBYTE + JXXXFSIZE)
) {
/*
* tunnelling is OK
*/
- jumpfrom->dest = tunnel;
+ jumpfrom->
s_
dest = tunnel;
/*
* no bumping needed, this
* is now effectively inactive
* but must be remembered
*/
/*
* no bumping needed, this
* is now effectively inactive
* but must be remembered
*/
- jumpfrom->tag = JXTUNNEL;
+ jumpfrom->
s_
tag = JXTUNNEL;
#ifdef DEBUG
if(debug)
printf("Tunnel from %s from line %d\n",
#ifdef DEBUG
if(debug)
printf("Tunnel from %s from line %d\n",
- jumpfrom->name, lineno);
+ jumpfrom->
s_
name, lineno);
#endif
continue;
} else { /*tunneling not possible*/
#endif
continue;
} else { /*tunneling not possible*/
@@
-253,7
+252,7
@@
jxxxfix()
* as a tunnel
*/
tunnel = jumpfrom;
* as a tunnel
*/
tunnel = jumpfrom;
- jumpfrom->tag = JXNOTYET;
+ jumpfrom->
s_
tag = JXNOTYET;
++nchange;
continue;
}
++nchange;
continue;
}
@@
-264,19
+263,19
@@
jxxxfix()
if (displ >= 0) {
SEGITERATE(segno, cojumpfrom + 1,0,cointdest,
intdest, ubintdest, ++){
if (displ >= 0) {
SEGITERATE(segno, cojumpfrom + 1,0,cointdest,
intdest, ubintdest, ++){
- if (intdest->
value > dest->
value)
+ if (intdest->
s_value > dest->s_
value)
break; /* beyond destination */
break; /* beyond destination */
- if (intdest->tag <= JXQUESTIONABLE)
+ if (intdest->
s_
tag <= JXQUESTIONABLE)
continue; /*frozen solid*/
continue; /*frozen solid*/
- if (intdest->tag == JXALIGN){
- jumpfrom->jxoveralign = 1;
+ if (intdest->
s_
tag == JXALIGN){
+ jumpfrom->
s_
jxoveralign = 1;
badjxalign++;
}
/*
* we assume the worst case
* for unfrozen jxxxxes
*/
badjxalign++;
}
/*
* we assume the worst case
* for unfrozen jxxxxes
*/
- displ += intdest->jxfear;
+ displ += intdest->
s_
jxfear;
}
if (displ <= MAXBYTE){
/*
}
if (displ <= MAXBYTE){
/*
@@
-284,7
+283,7
@@
jxxxfix()
* can't hurt us, so forget about
* this jump
*/
* can't hurt us, so forget about
* this jump
*/
- jumpfrom->tag = JXINACTIVE;
+ jumpfrom->
s_
tag = JXINACTIVE;
} else {
stillactives++;
}
} else {
stillactives++;
}
@@
-294,18
+293,18
@@
jxxxfix()
*/
SEGITERATE(segno, cojumpfrom - 1,1,cointdest,
intdest, ubintdest, --){
*/
SEGITERATE(segno, cojumpfrom - 1,1,cointdest,
intdest, ubintdest, --){
- if (intdest->
value <= dest->
value)
+ if (intdest->
s_value <= dest->s_
value)
break; /* beyond destination */
break; /* beyond destination */
- if (intdest->tag <= JXQUESTIONABLE)
+ if (intdest->
s_
tag <= JXQUESTIONABLE)
continue; /*frozen solid*/
continue; /*frozen solid*/
- if (intdest->tag == JXALIGN){
- jumpfrom->jxoveralign = 1;
+ if (intdest->
s_
tag == JXALIGN){
+ jumpfrom->
s_
jxoveralign = 1;
badjxalign++;
}
badjxalign++;
}
- displ -= intdest->jxfear;
+ displ -= intdest->
s_
jxfear;
}
if (displ >= MINBYTE) {
}
if (displ >= MINBYTE) {
- jumpfrom->tag = JXINACTIVE;
+ jumpfrom->
s_
tag = JXINACTIVE;
} else {
stillactives++;
}
} else {
stillactives++;
}
@@
-334,8
+333,8
@@
jxxxfix()
if (stillactives){
SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom,
ubjumpfrom, ++){
if (stillactives){
SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom,
ubjumpfrom, ++){
- if (jumpfrom->tag == JXACTIVE){
- jumpfrom->tag =
+ if (jumpfrom->
s_
tag == JXACTIVE){
+ jumpfrom->
s_
tag =
badjxalign?JXNOTYET:JXINACTIVE;
}
}
badjxalign?JXNOTYET:JXINACTIVE;
}
}
@@
-348,35
+347,35
@@
jxxxfix()
*/
SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom,
ubjumpfrom, ++){
*/
SEGITERATE(segno, 0, 0, cojumpfrom, jumpfrom,
ubjumpfrom, ++){
- if (jumpfrom->tag == JXALIGN){
+ if (jumpfrom->
s_
tag == JXALIGN){
/*
* Predict the true displacement
* needed, irregardless of the
* fact that we guessed 1
*/
/*
* Predict the true displacement
* needed, irregardless of the
* fact that we guessed 1
*/
- displ = (jumpfrom->
value - 1) & (unsigned)jumpfrom->
jxfear;
+ displ = (jumpfrom->
s_value - 1) & (unsigned)jumpfrom->s_
jxfear;
if (displ == 0){ /*no virtual displacement*/
if (displ == 0){ /*no virtual displacement*/
- jumpfrom->jxfear = -1;
+ jumpfrom->
s_
jxfear = -1;
} else {
} else {
- jumpfrom->
jxfear = (jumpfrom->
jxfear + 1) - displ;
+ jumpfrom->
s_jxfear = (jumpfrom->s_
jxfear + 1) - displ;
/*
/*
- * assert jumpfrom->jxfear > 0
+ * assert jumpfrom->
s_
jxfear > 0
*/
*/
- if (jumpfrom->jxfear == 1){
+ if (jumpfrom->
s_
jxfear == 1){
/*our prediction was correct*/
continue;
}
/*
/*our prediction was correct*/
continue;
}
/*
- * assert jumpfrom->jxfear > 1
+ * assert jumpfrom->
s_
jxfear > 1
*/
*/
- jumpfrom->
jxfear -= 1;
/*correct guess*/
+ jumpfrom->
s_jxfear -= 1;
/*correct guess*/
}
/*
}
/*
- * assert jumpfrom->jxfear = -1, +1...2**n-1
+ * assert jumpfrom->
s_
jxfear = -1, +1...2**n-1
*/
*/
- jumpfrom->
tag = JXNOTYET;
/*signal*/
+ jumpfrom->
s_tag = JXNOTYET;
/*signal*/
jxxxbump(segno, cojumpfrom);
jxxxbump(segno, cojumpfrom);
- jumpfrom->tag = JXINACTIVE;
+ jumpfrom->
s_
tag = JXINACTIVE;
/*
* Assert jxfrom->jxvalue indexes the first
* code byte after the added bytes, and
/*
* Assert jxfrom->jxvalue indexes the first
* code byte after the added bytes, and
@@
-411,20
+410,20
@@
jxxxbump(segno, starthint)
cum_bump = 0;
SEGITERATE(segno, starthint, 0, cosp, sp, ub, ++){
cum_bump = 0;
SEGITERATE(segno, starthint, 0, cosp, sp, ub, ++){
- tag = sp->tag;
+ tag = sp->
s_
tag;
if (tag == JXNOTYET){
#ifdef DEBUG
if (debug){
if (tag == JXNOTYET){
#ifdef DEBUG
if (debug){
- if (sp->dest != 0)
+ if (sp->
s_
dest != 0)
printf("Explode jump to %s on line %d\n",
printf("Explode jump to %s on line %d\n",
- sp->
dest->
name, lineno);
+ sp->
s_dest->s_
name, lineno);
else
printf("Explode an align!\n");
}
#endif
else
printf("Explode an align!\n");
}
#endif
- sp->tag = JXINACTIVE;
- sp->jxbump = 1;
- cum_bump += sp->jxfear;
+ sp->
s_
tag = JXINACTIVE;
+ sp->
s_
jxbump = 1;
+ cum_bump += sp->
s_
jxfear;
}
/*
* Only bump labels and jxxxes. Ignored entries can
}
/*
* Only bump labels and jxxxes. Ignored entries can
@@
-433,7
+432,7
@@
jxxxbump(segno, starthint)
* pass.
*/
if (tag >= OKTOBUMP) /*only bump labels and jxxxes and floating stabs*/
* pass.
*/
if (tag >= OKTOBUMP) /*only bump labels and jxxxes and floating stabs*/
- sp->value += cum_bump;
+ sp->
s_
value += cum_bump;
}
}
- usedot[segno].xvalue += cum_bump;
+ usedot[segno].
e_
xvalue += cum_bump;
}
}