|
|
Power 6/32 Unix version 1.2b
/* @(#)macdefs.h 2.5 */
/* the following defines give the SIZE and ALIGNMENT requirements
* of the various types in BITS. This information differs
* from machine to machine. If you have the source for the
* PCC compiler, this can be found in the `macdefs.h' file
*/
/* ANY use of the union STUFFU is inherently MACHINE DEPENDENT
* it is used for stuffing bytes into longs, etc.
* most machines can be made to work if you move the fields and recompile
*/
#ifdef TAHOE
#define SZCHAR 8
#define SZSHORT 16
#define SZINT 32
#define SZLONG 32
#define SZPOINT 32
#define SZFLOAT 32
#define SZDOUBLE 64
#define ALCHAR 8
#define ALSHORT 16
#define ALINT 32
#define ALLONG 32
#define ALPOINT 32
#define ALFLOAT 32
#define ALDOUBLE 32
#define ALSTRUCT 32
#define LTORBYTES /* bytes are numbered from left to right */
#define RTOLBITS /* bits are numbered from right to left */
#define cbPage 512 /* # of bytes on a disk page */
typedef union {
long lng;
float fl;
struct {
short shortHi;
short shortLo;
} shorts;
struct {
char chHiHi;
char chHiLo;
char chLoHi;
char chLoLo;
} chars;
} STUFFU;
#endif
#ifdef ONYX
#define SZCHAR 8
#define SZSHORT 16
#define SZINT 16
#define SZLONG 32
#define SZPOINT 16
#define SZFLOAT 32
#define SZDOUBLE 64
#define ALCHAR 8
#define ALSHORT 16
#define ALINT 16
#define ALLONG 16
#define ALPOINT 16
#define ALFLOAT 16
#define ALDOUBLE 16
#define ALSTRUCT 8
#define EVENBYTES /* accesses must be made on even byte boundaries */
#define RTOLBYTES /* bytes are numbered from right to left */
#define RTOLBITS /* bits are numbered from right to left */
#define cbPage 512 /* # of bytes on a disk page */
typedef union {
long lng;
float fl;
struct {
short shortHi;
short shortLo;
} shorts;
struct {
char chHiHi;
char chHiLo;
char chLoHi;
char chLoLo;
} chars;
} STUFFU;
#endif
#ifdef REGULUS
#define SZCHAR 8
#define SZSHORT 16
#define SZINT 16
#define SZLONG 32
#define SZPOINT 32
#define SZFLOAT 32
#define SZDOUBLE 32
#define ALCHAR 16
#define ALSHORT 16
#define ALINT 16
#define ALLONG 16
#define ALPOINT 16
#define ALFLOAT 16
#define ALDOUBLE 16
#define ALSTRUCT 16
#define EVENBYTES /* accesses must be made on even byte boundaries */
#define LTORBYTES /* bytes are numbered from left to right */
#define LTORBITS /* bits are numbered from left to right */
#define cbPage 512 /* # of bytes on a disk page */
typedef union {
long lng;
float fl;
struct {
short shortHi;
short shortLo;
} shorts;
struct {
char chHiHi;
char chHiLo;
char chLoHi;
char chLoLo;
} chars;
} STUFFU;
#endif
#ifdef VAX
#define SZCHAR 8
#define SZSHORT 16
#define SZINT 32
#define SZLONG 32
#define SZPOINT 32
#define SZFLOAT 32
#define SZDOUBLE 64
#define ALCHAR 8
#define ALSHORT 8
#define ALINT 8
#define ALLONG 8
#define ALPOINT 8
#define ALFLOAT 8
#define ALDOUBLE 8
#define ALSTRUCT 8
#define RTOLBYTES /* bytes are numbered from right to left */
#define RTOLBITS /* bits are numbered from right to left */
#define cbPage 512 /* # of bytes on a disk page */
typedef union {
long lng;
float fl;
struct {
short shortLo;
short shortHi;
} shorts;
struct {
char chLoLo;
char chLoHi;
char chHiLo;
char chHiHi;
} chars;
} STUFFU;
#endif
#ifdef SUN
#define SZCHAR 8
#define SZSHORT 16
#define SZINT 32
#define SZLONG 32
#define SZPOINT 32
#define SZFLOAT 32
#define SZDOUBLE 64
#define ALCHAR 8
#define ALSHORT 8
#define ALINT 8
#define ALLONG 8
#define ALPOINT 8
#define ALFLOAT 8
#define ALDOUBLE 8
#define ALSTRUCT 8
#define EVENBYTES /* accesses must be made on even byte boundaries */
#define LTORBYTES /* bytes are numbered from left to right */
#define LTORBITS /* bits are numbered from left to right */
#define cbPage 512 /* # of bytes on a disk page */
typedef union {
long lng;
float fl;
struct {
short shortHi;
short shortLo;
} shorts;
struct {
char chHiHi;
char chHiLo;
char chLoHi;
char chLoLo;
} chars;
} STUFFU;
/* SUN */
#endif
#define CBCHAR 1 /* I hope that this is right!!! */
#define CBSHORT SZSHORT/SZCHAR
#define CBINT SZINT/SZCHAR
#define CBLONG SZLONG/SZCHAR
#define CBPOINT SZPOINT/SZCHAR
#define CBFLOAT SZFLOAT/SZCHAR
#define CBDOUBLE SZDOUBLE/SZCHAR
#define U1 ((unsigned)~0)
#define shortMax (U1>>(SZINT-SZSHORT+1)) /* largest signed short integer */
#define shortMin (-shortMax-1) /* smallest signed short integer */
#define intMax (U1>>1) /* largest signed integer */
#define intMin (-intMax-1) /* smallest signed long integer */
#define longMax (U1>>1) /* largest signed long */
#define longMin (-longMax-1) /* smallest signed long */
#define Mask(width) (~(U1<<width)) /* generate a bunch of 1111111's */
#ifdef RTOLBITS
#define Extract(x, pos, width) ((x>>pos) & Mask(width))
#define SetBits(x, width, pos, val) {x &= ~(Mask(width)<<pos); x |= val<<pos;}
#else
#define Extract(x, pos, width) ((x>>(SZINT-pos-width)) & Mask(width))
#define SetBits(x, width, pos, val)\
{x &= ~(Mask(width)<<(SZINT-pos-width)); x |= val<<(SZINT-pos-width);}
#endif
/* adrReg0 is usually the reference point in "core". It's the displacement
* for the end of the (user+kernel) stack.
* adrReason is the displacement in a core file header where we can find
* the reason for the child's death (relative to adrReg0). I know of no way to
* determine this number other than by Divine insight, or by
* looking at the sources for the crash program(?).
*/
#ifdef TAHOE
#ifndef BSD42
#define adrReg0 (4*1024) /* see InitAll in init.c for discussion */
#else
#define adrReg0 (6*1024) /* The _u structure is 6k in Unix 4.2 ! */
#endif
#define adrReason -3*4 /* On Tahoe, HW pushes psl, pc, then the code */
#endif
#ifdef ONYX
#define adrReg0 ((int *)03742) /* see InitAll in init.c for discussion */
#define adrReason 03654 /* -27 */
#endif
#ifdef PLEXUS
#undef adrReg0
#undef adrReason
#define adrReg0 ((int *)03750) /* see InitAll in init.c for discussion */
#define adrReason 03650
#define SP R15
#endif
#ifdef M68000
#define adrReg0 ((int *)010000) /* see InitAll in init.c for discussion */
#define adrReason 07764 /* -3 */
#endif
#ifdef VAX
#define adrReg0 ((int *)010000) /* see InitAll in init.c for discussion */
#define adrReason 07764 /* -3 */
#endif
#ifndef M68000
/* these are internal names for registers, REAL offsets are in vrgOffset */
#define u0 0
#define u1 1
#define u2 2
#define u3 3
#define u4 4
#define u5 5
#define u6 6
#define u7 7
#define u8 8
#define u9 9
#define u10 10
#define u11 11
#define u12 12
#ifndef TAHOE
#define u13 13
#endif
#ifdef ONYX
#define u14 14
#define u15 15
#define usp 16
#define upc 17
#define ufp 18
#define ufcw 19
#define uregMax 20
#endif
#ifdef VAX
#define uap 14
#define ufp 15
#define usp 16
#define ups 17
#define upc 18
#define uregMax 19
#endif
#ifdef TAHOE
#define ufp 13
#define usp 14
#define upc 15
#define ups 16
#define uregMax 17
#endif
#endif
#ifdef SUN
#define adrReg0 ((int *)013666) /* see InitAll in init.c for discussion */
#define adrReason 013652 /* -3 */
#endif
#ifdef M68000
/* these are internal names for registers, REAL offsets are in vrgOffset */
#define ud0 0
#define ud1 1
#define ud2 2
#define ud3 3
#define ud4 4
#define ud5 5
#define ud6 6
#define ud7 7
#define ua0 8
#define ua1 9
#define ua2 10
#define ua3 11
#define ua4 12
#define ua5 13
#define ua6 14
#define ua7 15
#define upc 16
#define ups 17
#define ufp 18
#define usp 19
#define uregMax 20
#endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.