|
|
|
1991/0427/sys/src/9/power/dat.h:1,48 –
1991/0428/sys/src/9/power/dat.h:1,25
(short | long | prev | next)
|
|
1990/0227
| |
typedef struct Alarm Alarm;
|
|
1990/0324
| |
typedef struct Bit3msg Bit3msg;
|
|
1990/0227
| |
typedef struct Blist Blist;
typedef struct Block Block;
typedef struct Chan Chan;
typedef struct Conf Conf;
typedef struct Dev Dev;
typedef struct Dirtab Dirtab;
typedef struct Env Env;
typedef struct Envp Envp;
typedef struct Envval Envval;
|
|
1990/1228
| |
typedef struct Etherpkt Etherpkt;
|
|
1990/0227
| |
typedef struct FPsave FPsave;
|
|
1991/0209
| |
typedef struct Hotmsg Hotmsg;
|
|
1990/1231
| |
typedef struct Lance Lance;
typedef struct Lancemem Lancemem;
|
|
1990/0227
| |
typedef struct Label Label;
typedef struct List List;
typedef struct Lock Lock;
typedef struct Mach Mach;
|
|
1991/0428
| |
typedef struct MMU MMU;
|
|
1991/0425
| |
typedef struct Softtlb Softtlb;
|
|
1990/0227
| |
typedef struct Mount Mount;
typedef struct Mtab Mtab;
typedef struct Note Note;
typedef struct Orig Orig;
typedef struct PTE PTE;
typedef struct Page Page;
typedef struct Pgrp Pgrp;
typedef struct Proc Proc;
typedef struct QLock QLock;
typedef struct Qinfo Qinfo;
typedef struct Queue Queue;
typedef struct Ref Ref;
typedef struct Rendez Rendez;
typedef struct Seg Seg;
|
|
1990/03091
| |
typedef struct Stream Stream;
|
|
1990/0227
| |
typedef struct Ureg Ureg;
typedef struct User User;
typedef int Devgen(Chan*, Dirtab*, int, int, Dir*);
|
|
1991/0428
| |
/*
* parameters for sysproc.c
*/
#define AOUT_MAGIC V_MAGIC
|
|
1990/0227
| |
struct List
{
void *next;
};
|
|
1991/0428
| |
/*
* machine dependent definitions used by ../port/dat.h
*/
|
|
1990/0227
| |
struct Lock
{
|
|
1991/0427/sys/src/9/power/dat.h:50,75 –
1991/0428/sys/src/9/power/dat.h:27,32
|
|
1990/0227
| |
ulong pc;
};
struct Ref
{
Lock;
int ref;
};
struct QLock
{
Proc *head; /* next process waiting for object */
Proc *tail; /* last process waiting for object */
|
|
1990/0324
| |
Lock use; /* to use object */
Lock queue; /* to access list */
|
|
1990/0227
| |
};
|
|
1991/0306
| |
struct Rendez
{
Lock;
Proc *p;
};
|
|
1990/0227
| |
struct Label
{
ulong pc;
|
|
1991/0427/sys/src/9/power/dat.h:76,143 –
1991/0428/sys/src/9/power/dat.h:33,38
|
|
1990/0227
| |
ulong sp;
};
struct Alarm
{
List;
Lock;
int busy;
long dt; /* may underflow in clock(); must be signed */
void (*f)(void*);
void *arg;
};
|
|
1990/0324
| |
struct Bit3msg
|
|
1990/0306
| |
{
ulong cmd;
ulong addr;
ulong count;
|
|
1990/03081
| |
ulong rcount;
|
|
1990/0306
| |
};
|
|
1991/0209
| |
struct Hotmsg
{
ulong cmd;
ulong param[5];
|
|
1991/0306
| |
Rendez r;
|
|
1991/0402
| |
uchar intr; /* flag: interrupt has occurred */
uchar abort; /* flag: don't interrupt */
|
|
1991/0403
| |
ushort wlen; /* length of last message written */
|
|
1991/0209
| |
};
|
|
1990/0227
| |
#define CHDIR 0x80000000L
struct Chan
{
|
|
1991/0411
| |
QLock rdl; /* read access */
QLock wrl; /* write access */
|
|
1990/0227
| |
Ref;
union{
Chan *next; /* allocation */
ulong offset; /* in file */
};
ushort type;
ushort dev;
ushort mode; /* read/write */
ushort flag;
|
|
1990/11211
| |
Qid qid;
|
|
1990/0227
| |
Mount *mnt; /* mount point that derived Chan */
ulong mountid;
int fid; /* for devmnt */
|
|
1990/1002
| |
union{
Stream *stream; /* for stream channels */
void *aux;
|
|
1990/11211
| |
Qid pgrpid; /* for #p/notepg */
|
|
1991/0421
| |
int mntindex; /* for devmnt */
|
|
1990/1002
| |
};
|
|
1990/0303
| |
Chan *mchan; /* channel to mounted server */
|
|
1990/11211
| |
Qid mqid; /* qid of root of mount point */
|
|
1990/0227
| |
};
struct FPsave
{
long fpreg[32];
long fpstatus;
};
struct Conf
{
|
|
1990/0504
| |
ulong nmach; /* processors */
|
|
1991/0427/sys/src/9/power/dat.h:178,227 –
1991/0428/sys/src/9/power/dat.h:73,115
|
|
1991/0424
| |
|
|
1990/0227
| |
};
struct Dev
|
|
1991/0428
| |
/*
* floating point registers
*/
enum
|
|
1990/0227
| |
{
void (*reset)(void);
void (*init)(void);
Chan *(*attach)(char*);
Chan *(*clone)(Chan*, Chan*);
int (*walk)(Chan*, char*);
void (*stat)(Chan*, char*);
Chan *(*open)(Chan*, int);
void (*create)(Chan*, char*, int, ulong);
void (*close)(Chan*);
|
|
1991/0411
| |
long (*read)(Chan*, void*, long, ulong);
long (*write)(Chan*, void*, long, ulong);
|
|
1990/0227
| |
void (*remove)(Chan*);
void (*wstat)(Chan*, char*);
|
|
1991/0428
| |
FPinit,
FPactive,
FPinactive,
|
|
1990/0227
| |
};
struct Dirtab
|
|
1991/0428
| |
struct FPsave
|
|
1990/0227
| |
{
char name[NAMELEN];
|
|
1990/11211
| |
Qid qid;
|
|
1990/0227
| |
long length;
long perm;
|
|
1991/0428
| |
long fpreg[32];
long fpstatus;
|
|
1990/0227
| |
};
struct Env
{
Lock;
Envval *val;
char name[NAMELEN];
Env *next; /* in chain of Envs for a pgrp */
int pgref; /* # pgrps pointing here */
};
|
|
1991/0428
| |
#include "../port/portdat.h"
|
|
1990/0227
| |
struct Envp
|
|
1991/0428
| |
/*
* machine dependent definitions not used by ../port/dat.h
*/
struct Bit3msg
|
|
1990/0227
| |
{
Env *env;
int chref; /* # chans from pgrp pointing here */
|
|
1991/0428
| |
ulong cmd;
ulong addr;
ulong count;
ulong rcount;
|
|
1990/0227
| |
};
|
|
1991/0425
| |
struct Softtlb
|
|
1991/0428
| |
struct Hotmsg
|
|
1991/0425
| |
{
ulong virt;
ulong phys;
|
|
1991/0428
| |
ulong cmd;
ulong param[5];
Rendez r;
uchar intr; /* flag: interrupt has occurred */
uchar abort; /* flag: don't interrupt */
ushort wlen; /* length of last message written */
|
|
1991/0425
| |
};
|
|
1990/0227
| |
struct Mach
|
|
1991/0427/sys/src/9/power/dat.h:248,417 –
1991/0428/sys/src/9/power/dat.h:136,150
|
|
1990/0227
| |
int stack[1];
};
struct Mount
|
|
1991/0428
| |
/*
* machine dependent definitions not used by ../port/dat.h
*/
struct Softtlb
|
|
1990/0227
| |
{
Ref; /* also used as a lock when playing lists */
short term; /* terminates list */
ulong mountid;
Mount *next;
Chan *c; /* channel replacing underlying channel */
|
|
1991/0428
| |
ulong virt;
ulong phys;
|
|
1990/0227
| |
};
struct Mtab
{
Chan *c; /* channel mounted upon */
Mount *mnt; /* what's mounted upon it */
};
enum{
NUser, /* note provided externally */
NExit, /* process should exit */
NDebug, /* process should hang */
};
struct Note
{
char msg[ERRLEN];
int flag; /* whether system posted it */
};
struct Orig
{
Lock;
Orig *next; /* for allocation */
ushort nproc; /* processes using it */
ushort npage; /* sum of refs of pages in it */
ushort flag;
ulong va; /* va of 0th pte */
ulong npte; /* #pte's in list */
PTE *pte;
Chan *chan; /* channel deriving segment (if open) */
ushort type; /* of channel (which could be non-open) */
|
|
1990/11211
| |
Qid qid;
|
|
1990/0303
| |
Chan *mchan;
|
|
1990/11211
| |
Qid mqid;
|
|
1990/0227
| |
ulong minca; /* base of region in chan */
ulong maxca; /* end of region in chan */
};
struct Page
{
Orig *o; /* origin of segment owning page */
ulong va; /* virtual address */
ulong pa; /* physical address */
ushort ref;
Page *next;
Page *prev;
};
struct Pgrp
{
Ref; /* also used as a lock when mounting */
Pgrp *next;
|
|
1990/1110
| |
int index; /* index in pgrp table */
|
|
1990/0227
| |
ulong pgrpid;
char user[NAMELEN];
int nmtab; /* highest active mount table entry, +1 */
int nenv; /* highest active env table entry, +1 */
|
|
1991/0212
| |
QLock debug; /* single access via devproc.c */
|
|
1990/0227
| |
Mtab *mtab;
Envp *etab;
};
struct PTE
{
Proc *proc; /* process owning this PTE (0 in Orig) */
PTE *nextmod; /* next at this va */
PTE *nextva; /* next in this proc at higher va */
Page *page;
};
struct Seg
{
Proc *proc; /* process owning this segment */
Orig *o; /* root list of pte's */
ulong minva; /* va of 0th pte (not necessarily Seg->o->va) */
ulong maxva; /* va of last pte */
PTE *mod; /* list of modified pte's */
ulong pad[3]; /**/
};
struct Proc
{
Label sched;
Mach *mach; /* machine running this proc */
char text[NAMELEN];
Proc *rnext; /* next process in run queue */
Proc *qnext; /* next process on queue for a QLock */
int state;
short pidonmach[MAXMACH]; /* TLB pid on each mmu */
Page *upage; /* BUG: should be unlinked from page list */
Seg seg[NSEG];
|
|
1990/1211
| |
ulong bssend; /* initial top of bss seg */
|
|
1990/0227
| |
ulong pid;
|
|
1990/0324
| |
int nchild;
QLock wait; /* exiting children to be waited for */
|
|
1991/0109
| |
Waitmsg waitmsg; /* this is large but must be addressable */
|
|
1990/0227
| |
Proc *child;
Proc *parent;
Pgrp *pgrp;
ulong parentpid;
ulong time[6]; /* User, Sys, Real; child U, S, R */
short exiting;
short insyscall;
int fpstate;
Lock debug; /* to access debugging elements of User */
Rendez *r; /* rendezvous point slept on */
Rendez sleep; /* place for tsleep and syssleep */
int wokeup; /* whether sleep was interrupted */
ulong pc; /* DEBUG only */
|
|
1990/1212
| |
int kp; /* true if kernel process */
|
|
1990/0227
| |
};
|
|
1990/1124
| |
#define NERR 20
|
|
1990/0227
| |
#define NFD 100
#define NNOTE 5
struct User
{
Proc *p;
Label errlab[NERR];
int nerrlab;
|
|
1990/11211
| |
char error[ERRLEN];
|
|
1990/0227
| |
FPsave fpsave; /* address of this is known by vdb */
char elem[NAMELEN]; /* last name element from namec */
Chan *slash;
Chan *dot;
Chan *fd[NFD];
int maxfd; /* highest fd in use */
|
|
1990/0306
| |
/*
|
|
1991/0209
| |
* I/O point for bit3 and hotrod interfaces.
* This is the easiest way to allocate
|
|
1990/0306
| |
* them, but not the prettiest or most general.
*/
|
|
1991/0306
| |
union{ /* for i/o from kernel */
|
|
1991/0209
| |
Bit3msg kbit3;
Hotmsg khot;
};
|
|
1991/0306
| |
union{ /* for i/o from user */
|
|
1991/0209
| |
Bit3msg ubit3;
Hotmsg uhot;
|
|
1991/0306
| |
};
union{ /* special location for Tflush */
Bit3msg fbit3;
Hotmsg fhot;
|
|
1991/0209
| |
};
|
|
1990/0227
| |
/*
* Rest of structure controlled by devproc.c and friends.
* lock(&p->debug) to modify.
*/
Note note[NNOTE];
short nnote;
short notified; /* sysnoted is due */
int (*notify)(void*, char*);
void *ureg;
};
|
|
1990/0614
| |
/*
* Fake kmap
*/
|
|
1991/0427/sys/src/9/power/dat.h:422,549 –
1991/0428/sys/src/9/power/dat.h:155,160
|
|
1990/1212
| |
#define PPN(x) x
|
|
1990/0227
| |
/*
* operations available to a queue
*/
struct Qinfo
{
void (*iput)(Queue*, Block*); /* input routine */
void (*oput)(Queue*, Block*); /* output routine */
void (*open)(Queue*, Stream*);
void (*close)(Queue*);
char *name;
|
|
1990/0911
| |
void (*reset)(void);
Qinfo *next;
|
|
1990/0227
| |
};
/*
* We reference lance buffers via descriptors kept in host memory
*/
struct Block
{
Block *next;
uchar *rptr; /* first unconsumed byte */
uchar *wptr; /* first empty byte */
uchar *lim; /* 1 past the end of the buffer */
uchar *base; /* start of the buffer */
uchar flags;
uchar type;
|
|
1990/1228
| |
ulong va; /* virtual address if mapped for a dev */
|
|
1990/0227
| |
};
/* flag bits */
#define S_DELIM 0x80
#define S_CLASS 0x07
/* type values */
#define M_DATA 0
#define M_CTL 1
#define M_HANGUP 2
/*
* a list of blocks
*/
struct Blist {
Lock;
Block *first; /* first data block */
Block *last; /* last data block */
long len; /* length of list in bytes */
|
|
1990/0406
| |
int nb; /* number of blocks in list */
|
|
1990/0227
| |
};
/*
* a queue of blocks
*/
struct Queue {
Blist;
int flag;
Qinfo *info; /* line discipline definition */
Queue *other; /* opposite direction, same line discipline */
Queue *next; /* next queue in the stream */
void (*put)(Queue*, Block*);
|
|
1990/1018
| |
QLock rlock; /* mutex for r */
|
|
1990/1212
| |
Rendez r; /* standard place to wait for flow control */
Rendez *rp; /* where flow control wakeups go to */
|
|
1990/0227
| |
void *ptr; /* private info for the queue */
};
#define QHUNGUP 0x1 /* flag bit meaning the stream has been hung up */
#define QINUSE 0x2
#define QHIWAT 0x4 /* queue has gone past the high water mark */
|
|
1990/0721
| |
#define QDEBUG 0x8
|
|
1990/0227
| |
/*
* a stream head
*/
struct Stream {
|
|
1990/11161
| |
QLock; /* structure lock */
|
|
1990/1009
| |
short inuse; /* number of processes in stream */
short opens; /* number of processes with stream open */
ushort hread; /* number of reads after hangup */
ushort type; /* correlation with Chan */
ushort dev; /* ... */
ushort id; /* ... */
|
|
1990/0227
| |
QLock rdlock; /* read lock */
Queue *procq; /* write queue at process end */
Queue *devq; /* read queue at device end */
|
|
1991/0411
| |
Block *err; /* error message from down stream */
|
|
1990/0227
| |
};
#define RD(q) ((q)->other < (q) ? (q->other) : q)
#define WR(q) ((q)->other > (q) ? (q->other) : q)
#define GLOBAL(a) (((ulong)(a)) & 0x80000000)
#define STREAMTYPE(x) ((x)&0x1f)
#define STREAMID(x) (((x)&~CHDIR)>>5)
#define STREAMQID(i,t) (((i)<<5)|(t))
|
|
1990/0312
| |
#define PUTNEXT(q,b) (*(q)->next->put)((q)->next, b)
#define BLEN(b) ((b)->wptr - (b)->rptr)
|
|
1990/0403
| |
#define QFULL(q) ((q)->flag & QHIWAT)
|
|
1990/0406
| |
#define FLOWCTL(q) { if(QFULL(q->next)) flowctl(q); }
|
|
1990/0227
| |
/*
* stream file qid's & high water mark
*/
enum {
Shighqid = STREAMQID(1,0) - 1,
Sdataqid = Shighqid,
Sctlqid = Sdataqid-1,
Slowqid = Sctlqid,
|
|
1990/0406
| |
Streamhi= (17*1024), /* byte count high water mark */
|
|
1990/0905
| |
Streambhi= 32, /* block count high water mark */
|
|
1990/1228
| |
};
/*
* Ethernet packet buffers.
*/
struct Etherpkt {
uchar d[6];
uchar s[6];
uchar type[2];
uchar data[1500];
uchar crc[4];
|
|
1990/0629
| |
};
|
|
1991/0407
| |
#define ETHERMINTU 60 /* minimum transmit size */
#define ETHERMAXTU 1514 /* maximum transmit size */
#define ETHERHDRSIZE 14 /* size of an ethernet header */
|
|
1990/1231
| |
/*
|
|
1991/0109
| |
* LANCE CSR3 (bus control bits)
*/
#define BSWP 0x4
|
|
1991/0427/sys/src/9/power/dat.h:574,580 –
1991/0428/sys/src/9/power/dat.h:185,190
|
|
1990/1231
| |
Etherpkt *ltp; /* transmit buffers (lance address) */
|
|
1990/0227
| |
};
#define PRINTSIZE 256
struct
{
Lock;
|
|
1991/0427/sys/src/9/power/dat.h:582,681 –
1991/0428/sys/src/9/power/dat.h:192,244
|
|
1990/0227
| |
short exiting;
}active;
extern register Mach *m;
extern register User *u;
|
|
1991/0428
| |
#define MACHP(n) ((Mach *)(MACHADDR+n*BY2PG))
|
|
1990/0227
| |
/*
* Process states
*/
enum
|
|
1991/0428
| |
#define NERR 15
#define NNOTE 5
#define NFD 100
struct User
|
|
1990/0227
| |
{
Dead = 0,
Moribund,
Zombie,
Ready,
Scheding,
Running,
Queueing,
MMUing,
Exiting,
Inwait,
Wakeme,
Broken,
|
|
1991/0428
| |
Proc *p;
int nerrlab;
Label errlab[NERR];
char error[ERRLEN];
FPsave fpsave; /* address of this is known by vdb */
char elem[NAMELEN]; /* last name element from namec */
Chan *slash;
Chan *dot;
Chan *fd[NFD];
int maxfd; /* highest fd in use */
/*
* Rest of structure controlled by devproc.c and friends.
* lock(&p->debug) to modify.
*/
Note note[NNOTE];
short nnote;
short notified; /* sysnoted is due */
int (*notify)(void*, char*);
void *ureg;
/*
* machine dependent User stuff
*/
/*
* I/O point for bit3 and hotrod interfaces.
* This is the easiest way to allocate
* them, but not the prettiest or most general.
*/
union{ /* for i/o from kernel */
Bit3msg kbit3;
Hotmsg khot;
};
union{ /* for i/o from user */
Bit3msg ubit3;
Hotmsg uhot;
};
union{ /* special location for Tflush */
Bit3msg fbit3;
Hotmsg fhot;
};
|
|
1990/0227
| |
};
extern char *statename[];
|
|
1990/11211
| |
extern char user[NAMELEN];
extern char *errstrtab[];
|
|
1990/0227
| |
/*
* Chan flags
*/
#define COPEN 1 /* for i/o */
#define CMOUNT 2 /* is result of a mount/bind */
#define CCREATE 4 /* permits creation if CMOUNT */
|
|
1990/08141
| |
#define CCEXEC 8 /* close on exec */
|
|
1990/0907
| |
#define CFREE 16 /* not in use */
|
|
1990/0227
| |
/*
* Proc.time
*/
enum
{
TUser,
TSys,
TReal,
TCUser,
TCSys,
TCReal,
};
/*
* floating point registers
*/
enum
{
FPinit,
FPactive,
|
|
1990/0820
| |
FPinactive,
|
|
1990/0227
| |
};
/*
* Memory management
*/
#define SSEG 0
#define TSEG 1
#define DSEG 2
#define BSEG 3
#define ESEG 4 /* used by exec to build new stack */
#define OWRPERM 0x01 /* write permission */
#define OPURE 0x02 /* original data mustn't be written */
#define OCACHED 0x04 /* cached; don't discard on exit */
/*
* Access types in namec
*/
enum
{
Aaccess, /* as in access, stat */
Atodir, /* as in chdir */
Aopen, /* for i/o */
Amount, /* to be mounted upon */
Acreate, /* file is to be created */
};
#define NUMSIZE 12 /* size of formatted number */
#define MACHP(n) ((Mach *)(MACHADDR+n*BY2PG))
extern Conf conf;
extern ulong initcode[];
extern Dev devtab[];
extern char devchar[];
extern FPsave initfp;
|
|
1990/0718
| |
|
|
1990/1211
| |
/*
* parameters for sysproc.c
*/
#define AOUT_MAGIC V_MAGIC
|
|
1991/0428
| |
extern register Mach *m;
extern register User *u;
|