X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/a68924a6e07d69bc4b8d6106b3af0ac5a7490905..1bbf66cfa8d4bce84261143b05ad0a438067e71d:/usr/src/cmd/adb/defs.h diff --git a/usr/src/cmd/adb/defs.h b/usr/src/cmd/adb/defs.h index 427be15ab9..40a11f3847 100644 --- a/usr/src/cmd/adb/defs.h +++ b/usr/src/cmd/adb/defs.h @@ -9,30 +9,34 @@ /* Layout of a.out file (fsym): * - * header of 8 words magic number 405, 407, 410, 411 + * header of 8 longwords + * magic number 410 * text size ) - * data size ) in bytes but even + * data size ) padded with 0 to multiple of 4 bytes * bss size ) * symbol table size - * entry point - * {unused} - * flag set if no relocation + * entry address + * size of text relocation info + * size of data relocation info * * * header: 0 - * text: 16 - * data: 16+textsize - * relocation: 16+textsize+datasize - * symbol table: 16+2*(textsize+datasize) or 16+textsize+datasize + * text: 32 + * data: 32+textsize + * text reloc: 32+textsize+datasize + * data reloc: 32+textsize+datasize+textreloc + * symbol table: 32+textsize+datasize+textreloc+datareloc * */ +#ifdef EDDT +#define printf printadb +#endif #include #include -#include +#include #include -#include #include "mac.h" #include "mode.h" @@ -53,19 +57,21 @@ #define DSP 2 #define STAR 4 #define STARCOM 0200 -#define DSYM 7 -#define ISYM 2 -#define ASYM 1 +#define DSYM 4 +#define ISYM 4 +#define ASYM 2 #define NSYM 0 #define ESYM (-1) +#define XSYM (-2) #define BKPTSET 1 #define BKPTEXEC 2 #define SYMSIZ 100 #define MAXSIG 20 -#define USERPS 2*(512-1) -#define USERPC 2*(512-2) +#define USERPS PSL +#define USERPC PC #define BPT 03 +#define TBIT 020 #define FD 0200 #define SETTRC 0 #define RDUSER 2 @@ -75,28 +81,47 @@ #define RUREGS 3 #define WUREGS 6 #define CONTIN 7 -#define SINGLE 9 #define EXIT 8 +#define SINGLE 9 #define FROFF (&(0->fpsr)) #define FRLEN 25 #define FRMAX 6 -#define ps -1 -#define pc -2 -#define sp -6 -#define r5 -9 -#define r4 -10 -#define r3 -11 -#define r2 -12 -#define r1 -5 -#define r0 -3 +/* the quantities involving ctob() are located in the kernel stack. +/* the others are in the pcb. +*/ +#define KSP 0 +#define ESP 4 +#define SSP 8 +#define USP (ctob(UPAGES)-5*sizeof(int)) +#define R0 (ctob(UPAGES)-19*sizeof(int)) +#define R1 (ctob(UPAGES)-18*sizeof(int)) +#define R2 (ctob(UPAGES)-17*sizeof(int)) +#define R3 (ctob(UPAGES)-16*sizeof(int)) +#define R4 (ctob(UPAGES)-15*sizeof(int)) +#define R5 (ctob(UPAGES)-14*sizeof(int)) +#define R6 (ctob(UPAGES)-13*sizeof(int)) +#define R7 (ctob(UPAGES)-12*sizeof(int)) +#define R8 (ctob(UPAGES)-11*sizeof(int)) +#define R9 (ctob(UPAGES)-10*sizeof(int)) +#define R10 (ctob(UPAGES)-9*sizeof(int)) +#define R11 (ctob(UPAGES)-8*sizeof(int)) +#define AP (ctob(UPAGES)-7*sizeof(int)) +#define FP (ctob(UPAGES)-6*sizeof(int)) +#define PC (ctob(UPAGES)-2*sizeof(int)) +#define PSL (ctob(UPAGES)-1*sizeof(int)) +#define P0BR 80 +#define P0LR 84 +#define P1BR 88 +#define P1LR 92 #define MAXOFF 255 #define MAXPOS 80 #define MAXLIN 128 #define EOF 0 #define EOR '\n' +#define SP ' ' #define TB '\t' #define QUOTE 0200 #define STRIP 0177 @@ -110,9 +135,15 @@ union { L_INT L; } itolws; +#ifndef vax #define leng(a) ((long)((unsigned)(a))) #define shorten(a) ((int)(a)) #define itol(a,b) (itolws.I[0]=(a), itolws.I[1]=(b), itolws.L) +#else +#define leng(a) itol(0,a) +#define shorten(a) ((short)(a)) +#define itol(a,b) (itolws.I[0]=(b), itolws.I[1]=(a), itolws.L) +#endif @@ -126,8 +157,3 @@ STRING exform(); L_INT round(); BKPTR scanbkpt(); VOID fault(); - -typedef struct sgttyb TTY; -TTY adbtty, usrtty; -#include -jmp_buf erradb;