1: /*
2: * Copyright (c) 1980 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)pc.h 5.1 (Berkeley) 6/5/85
7: */
8:
9: #include <setjmp.h>
10:
11: /*
12: * random constants for pc
13: */
14:
15: /*
16: * the name of the display.
17: */
18: #define DISPLAYNAME "__disply"
19:
20: /*
21: * the structure below describes the locals used by the run time system.
22: * at function entry, at least this much space is allocated,
23: * and the following information is filled in:
24: * the address of a routine to close the current frame for unwinding,
25: * a pointer to the display entry for the current static level and
26: * the previous contents of the display for this static level.
27: * the curfile location is used to point to the currently active file,
28: * and is filled in as io is initiated.
29: * one of these structures is allocated on the (negatively growing) stack.
30: * at function entry, fp is set to point to the last field of the struct,
31: * thus the offsets of the fields are as indicated below.
32: */
33: struct rtlocals {
34: jmp_buf gotoenv;
35: struct iorec *curfile;
36: struct dispsave dsave;
37: } rtlocs;
38: #define GOTOENVOFFSET ( -sizeof rtlocs )
39: #define CURFILEOFFSET ( GOTOENVOFFSET + sizeof rtlocs.gotoenv )
40: #define DSAVEOFFSET ( CURFILEOFFSET + sizeof rtlocs.curfile )
41:
42: /*
43: * this is a cookie used to communicate between the
44: * routine entry code and the routine exit code.
45: * mostly it's for labels shared between the two.
46: */
47: #ifdef vax
48: struct entry_exit_cookie {
49: struct nl *nlp;
50: char extname[BUFSIZ];
51: int toplabel;
52: int savlabel;
53: };
54: #define FRAME_SIZE_LABEL "LF"
55: #define SAVE_MASK_LABEL "L"
56: #endif vax
57:
58: #ifdef mc68000
59: struct entry_exit_cookie {
60: struct nl *nlp;
61: char extname[BUFSIZ];
62: int toplabel;
63: };
64: #define FRAME_SIZE_LABEL "LF"
65: #define PAGE_BREAK_LABEL "LP"
66: #define SAVE_MASK_LABEL "LS"
67: #endif mc68000
68:
69: /*
70: * formats for various names
71: * NAMEFORMAT arbitrary length strings.
72: * EXTFORMAT for externals, a preceding underscore.
73: * LABELFORMAT for label names, a preceding dollar-sign.
74: * PREFIXFORMAT used to print made up names with prefixes.
75: * LABELPREFIX with getlab() makes up label names.
76: * LLABELPREFIX with getlab() makes up sdb labels.
77: * FORMALPREFIX prefix for EXTFORMAT for formal entry points.
78: * a typical use might be to print out a name with a preceeding underscore
79: * with putprintf( EXTFORMAT , 0 , name );
80: */
81: #define NAMEFORMAT "%s"
82: #define EXTFORMAT "_%s"
83: #define LABELFORMAT "$%s"
84: #define PREFIXFORMAT "%s%d"
85: #define LABELPREFIX "L"
86: #define LLABELPREFIX "LL"
87: #define FORMALPREFIX "__"
88:
89: /*
90: * the name of the statement counter
91: */
92: #define STMTCOUNT "__stcnt"
93:
94: /*
95: * the name of the pcp counters
96: */
97: #define PCPCOUNT "__pcpcount"
98:
99: /*
100: * a vector of pointer to enclosing functions for fully qualified names.
101: */
102: char *enclosing[ DSPLYSZ ];
103:
104: #ifdef vax
105: /*
106: * the runtime framepointer and argumentpointer registers
107: */
108: # define P2FP 13
109: # define P2FPNAME "fp"
110: # define P2AP 12
111: # define P2APNAME "ap"
112:
113: /*
114: * the register save mask for saving no registers
115: */
116: # define RSAVEMASK ( 0 )
117:
118: /*
119: * runtime check mask for divide check and integer overflow
120: */
121: # define RUNCHECK ( ( 1 << 15 ) | ( 1 << 14 ) )
122:
123: /*
124: * and of course ...
125: */
126: # define BITSPERBYTE 8
127: #endif vax
128:
129: #ifdef mc68000
130: /*
131: * these magic numbers lifted from pcc/mac2defs
132: * the offsets are for mapping data and address register numbers
133: * to linear register numbers. e.g. d2 ==> r2, and a2 ==> r10.
134: */
135: # define DATA_REG_OFFSET 0
136: # define ADDR_REG_OFFSET 8
137: # define P2FPNAME "a6"
138: # define P2FP (ADDR_REG_OFFSET + 6)
139: # define P2APNAME "a6"
140: # define P2AP (ADDR_REG_OFFSET + 6)
141:
142: /*
143: * and still ...
144: */
145: # define BITSPERBYTE 8
146: #endif mc68000
Defined variables
Defined struct's
entry_exit_cookie
defined in line
59; used 26 times
- in /usr/src/ucb/PORT/pascal/src/fend.c line
65(2),
535(2),
549(2),
570(2),
657(2),
732(2),
744(2),
785(2),
800(2),
817(2),
895(2),
967(2),
975(2)
Defined macros
CURFILEOFFSET
defined in line
39; used 26 times
- in line 40
- in /usr/src/ucb/PORT/pascal/src/pcproc.c line
192,
217,
238,
247,
430,
574,
588,
622-627(2),
638,
817,
856,
888,
898,
938,
954,
963,
1058,
1106,
1139,
1153,
1168,
1426,
1443,
1452
LABELPREFIX
defined in line
85; used 28 times
- in /usr/src/ucb/PORT/pascal/src/cset.c line
423
- in /usr/src/ucb/PORT/pascal/src/fend.c line
587,
697,
831,
935
- in /usr/src/ucb/PORT/pascal/src/p2put.c line
359,
403,
728
- in /usr/src/ucb/PORT/pascal/src/pccaseop.c line
281-284(2),
304,
336-341(3),
347-352(3),
393-398(2),
408-414(4),
432-436(2)
- in /usr/src/ucb/PORT/pascal/src/pcproc.c line
790,
1109
- in /usr/src/ucb/PORT/pascal/src/put.c line
787
P2AP
defined in line
140; used 3 times
P2FP
defined in line
138; used 3 times
Usage of this include