Plan 9 from Bell Labs’s /usr/web/sources/extra/9hist/mtx/dat.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


## diffname mtx/dat.h 2001/0810
## diff -e /dev/null /n/emeliedump/2001/0810/sys/src/9/mtx/dat.h
0a
typedef struct Conf	Conf;
typedef struct FPsave	FPsave;
typedef struct ISAConf	ISAConf;
typedef struct Label	Label;
typedef struct Lock	Lock;
typedef struct Mach	Mach;
typedef struct Notsave	Notsave;
typedef struct Page	Page;
typedef struct PCArch	PCArch;
typedef struct PCB	PCB;
typedef struct Pcidev	Pcidev;
typedef struct PMMU	PMMU;
typedef struct Proc	Proc;
typedef struct Sys	Sys;
typedef struct Ureg	Ureg;
typedef struct Vctl	Vctl;

#define MAXSYSARG	5	/* for mount(fd, mpt, flag, arg, srv) */

/*
 *  parameters for sysproc.c
 */
#define AOUT_MAGIC	Q_MAGIC

/*
 *  machine dependent definitions used by ../port/dat.h
 */

struct Lock
{
	ulong	key;			/* semaphore (non-zero = locked) */
	ulong	sr;
	ulong	pc;
	Proc	*p;
	ulong	pid;
	ushort	isilock;
};

struct Label
{
	ulong	sp;
	ulong	pc;
};

/*
 * FPsave.fpstatus
 */
enum
{
	FPinit,
	FPactive,
	FPinactive,
};

struct	FPsave
{
int dummy;
};

struct Conf
{
	ulong	nmach;		/* processors */
	ulong	nproc;		/* processes */
	ulong	npage0;		/* total physical pages of memory */
	ulong	npage1;		/* total physical pages of memory */
	ulong	npage;		/* total physical pages of memory */
	ulong	base0;		/* base of bank 0 */
	ulong	base1;		/* base of bank 1 */
	ulong	upages;		/* user page pool */
	ulong	nimage;		/* number of page cache image headers */
	ulong	nswap;		/* number of swap pages */
	int	nswppo;		/* max # of pageouts per segment pass */
	ulong	copymode;	/* 0 is copy on write, 1 is copy on reference */
	int	monitor;		/* has display? */
	ulong	ialloc;		/* bytes available for interrupt time allocation */
	ulong	pipeqsize;	/* size in bytes of pipe queues */
};

/*
 *  mmu goo in the Proc structure
 */
struct PMMU
{
int dummy;
};

/*
 *  things saved in the Proc structure during a notify
 */
struct Notsave
{
	ulong	UNUSED;
};

#include "../port/portdat.h"

/*
 *  machine dependent definitions not used by ../port/dat.h
 */
/*
 * Fake kmap
 */
typedef	void		KMap;
#define	VA(k)		((ulong)(k))
#define	kmap(p)		(KMap*)((p)->pa|KZERO)
#define	kunmap(k)

/*
 *	Process Control Block, used by PALcode
 */
struct PCB {
	uvlong	ksp;
	uvlong	usp;
	uvlong	ptbr;
	ulong	asn;
	ulong	pcc;
	uvlong	unique;
	ulong	fen;
	ulong	dummy;
	uvlong	rsrv1;
	uvlong	rsrv2;
};

struct Mach
{
	/* OFFSETS OF THE FOLLOWING KNOWN BY l.s */
	int	machno;			/* physical id of processor */
	ulong	splpc;			/* pc that called splhi() */
	Proc	*proc;			/* current process on this processor */

	/* ordering from here on irrelevant */

	ulong	ticks;			/* of the clock since boot time */
	Label	sched;			/* scheduler wakeup */
	Lock	alarmlock;		/* access to alarm list */
	void	*alarm;			/* alarms bound to this clock */
	int	inclockintr;

	ulong	fairness;		/* for runproc */

	ulong	cpuhz;			/* hwrpb->cfreq */
	ulong	pcclast;
	uvlong	fastclock;
	vlong	intrts;			/* time stamp of last interrupt */

	int	tlbfault;		/* only used by devproc; no access to tlb */
	int	tlbpurge;		/* ... */
	int	pfault;
	int	cs;
	int	syscall;
	int	load;
	int	intr;
	int	flushmmu;		/* make current proc flush it's mmu state */

	ulong	spuriousintr;
	int	lastintr;

	PCB;

	/* MUST BE LAST */
	int	stack[1];
};

struct
{
	Lock;
	short	machs;
	short	exiting;
	short	ispanic;
}active;

/*
 *	Implementation-dependant functions (outside of Alpha architecture proper).
 *	Called PCArch because that's what mkdevc calls it (for the PC).
 */
struct PCArch
{
	char*	id;
	int	(*ident)(void);

	void	(*coreinit)(void);		/* set up core logic, PCI mappings etc */
	void	(*corehello)(void);		/* identify core logic to user */
	void	(*coredetach)(void);		/* restore core logic before return to console */
	void	*(*pcicfg)(int, int);		/* map and point to PCI cfg space */
	void	*(*pcimem)(int, int);		/* map and point to PCI memory space */
	int	(*intrenable)(Vctl*);

	int		(*_inb)(int);
	ushort	(*_ins)(int);
	ulong	(*_inl)(int);
	void		(*_outb)(int, int);
	void		(*_outs)(int, ushort);
	void		(*_outl)(int, ulong);
	void		(*_insb)(int, void*, int);
	void		(*_inss)(int, void*, int);
	void		(*_insl)(int, void*, int);
	void		(*_outsb)(int, void*, int);
	void		(*_outss)(int, void*, int);
	void		(*_outsl)(int, void*, int);
};

/*
 *  a parsed plan9.ini line
 */
#define NISAOPT		8

struct ISAConf {
	char		*type;
	ulong	port;
	ulong	irq;
	ulong	dma;
	ulong	mem;
	ulong	size;
	ulong	freq;

	int	nopt;
	char	*opt[NISAOPT];
};

extern PCArch	*arch;

#define	MACHP(n)	((Mach *)((int)&mach0+n*BY2PG))
extern Mach		mach0;

extern register Mach	*m;
extern register Proc	*up;
.
## diffname mtx/dat.h 2001/1122
## diff -e /n/emeliedump/2001/0810/sys/src/9/mtx/dat.h /n/emeliedump/2001/1122/sys/src/9/mtx/dat.h
222,223c
//#define	MACHP(n)	((Mach *)((int)&mach0+n*BY2PG))
//extern Mach		mach0;
.
84c
	int	pidonmach[MAXMACH];
.
81a
#define NCOLOR 1
.
## diffname mtx/dat.h 2001/1208
## diff -e /n/emeliedump/2001/1122/sys/src/9/mtx/dat.h /n/emeliedump/2001/1208/sys/src/9/mtx/dat.h
158,159d
138a
	int	cputype;
	ulong	loopconst;
.
109,124d
57c
	double	fpreg[32];
	union {
		double	fpscrd;
		struct {
			ulong	pad;
			ulong	fpscr;
		};
	};
	int	fpistate;	/* emulated fp */
	ulong	emreg[32][3];	/* emulated fp */
.
54a
/*
 * This structure must agree with fpsave and fprestore asm routines
 */
.
## diffname mtx/dat.h 2001/1212
## diff -e /n/emeliedump/2001/1208/sys/src/9/mtx/dat.h /n/emeliedump/2001/1212/sys/src/9/mtx/dat.h
217,220c
#define	MACHP(n)	((Mach *)((int)&mach0+n*BY2PG))
extern Mach		mach0;
.
170,199d
9,10d
## diffname mtx/dat.h 2001/1218
## diff -e /n/emeliedump/2001/1212/sys/src/9/mtx/dat.h /n/emeliedump/2001/1218/sys/src/9/mtx/dat.h
165a

/*
 *	Implementation-dependant functions (outside of PPC architecture proper).
 *	Called PCArch because that's what mkdevc calls it (for the PC).
 */
struct PCArch
{
	char*	id;
	int	(*ident)(void);		/* this should be in the model */

	void	(*intrinit)(void);
	int	(*intrenable)(Vctl*);
	int	(*intrvecno)(int);
	int	(*intrdisable)(int);
};
.
8a
typedef struct PCArch	PCArch;
.
## diffname mtx/dat.h 2001/1219
## diff -e /n/emeliedump/2001/1218/sys/src/9/mtx/dat.h /n/emeliedump/2001/1219/sys/src/9/mtx/dat.h
139c
	ulong	cpuhz;
	ulong	bushz;
	ulong	dechz;
	ulong	tbhz;

.
## diffname mtx/dat.h 2001/1222
## diff -e /n/emeliedump/2001/1219/sys/src/9/mtx/dat.h /n/emeliedump/2001/1222/sys/src/9/mtx/dat.h
171,185d
96c
	int	mmupid;
.
## diffname mtx/dat.h 2002/0112
## diff -e /n/emeliedump/2001/1222/sys/src/9/mtx/dat.h /n/emeliedump/2002/0112/sys/src/9/mtx/dat.h
67,68d
45c
 * Proc.fpstate
.
## diffname mtx/dat.h 2002/0126
## diff -e /n/emeliedump/2002/0112/sys/src/9/mtx/dat.h /n/emeliedump/2002/0126/sys/src/9/mtx/dat.h
154a
	ulong	ptabbase;		/* start of page table in kernel virtual space */
	int		slotgen;		/* next pte (byte offset) when pteg is full */
	int		mmupid;		/* next mmu pid to use */
	int		minpid;
	int		maxpid;

.
## diffname mtx/dat.h 2002/0212
## diff -e /n/emeliedump/2002/0126/sys/src/9/mtx/dat.h /n/emeliedump/2002/0212/sys/src/9/mtx/dat.h
158,159c
	int		sweepcolor;
	int		trigcolor;
	Rendez	sweepr;
.
## diffname mtx/dat.h 2002/0222
## diff -e /n/emeliedump/2002/0212/sys/src/9/mtx/dat.h /n/emeliedump/2002/0222/sys/src/9/mtx/dat.h
137c
	vlong	cpuhz;
.
## diffname mtx/dat.h 2002/0404
## diff -e /n/emeliedump/2002/0222/sys/src/9/mtx/dat.h /n/emeliedump/2002/0404/sys/src/9/mtx/dat.h
192a
};
/*
 * fasttick timer interrupts (Dummy for now)
 */
struct Cycintr
{
	vlong	when;			/* fastticks when f should be called */
	void	(*f)(Ureg*, Cycintr*);
	void	*a;
	Cycintr	*next;
.
1a
typedef struct Cycintr		Cycintr;
.
## diffname mtx/dat.h 2002/0405
## diff -e /n/emeliedump/2002/0404/sys/src/9/mtx/dat.h /n/emeliedump/2002/0405/sys/src/9/mtx/dat.h
203c
	Timer	*next;
.
201c
	void	(*f)(Ureg*, Timer*);
.
198c
struct Timer
.
2c
typedef struct Timer		Timer;
.
## diffname mtx/dat.h 2002/0410
## diff -e /n/emeliedump/2002/0405/sys/src/9/mtx/dat.h /n/emeliedump/2002/0410/sys/src/9/mtx/dat.h
194,203d
2d
## diffname mtx/dat.h 2002/0420
## diff -e /n/emeliedump/2002/0410/sys/src/9/mtx/dat.h /n/emeliedump/2002/0420/sys/src/9/mtx/dat.h
153a
	int	ilockdepth;
.
## diffname mtx/dat.h 2002/0821
## diff -e /n/emeliedump/2002/0420/sys/src/9/mtx/dat.h /n/emeliedump/2002/0821/sys/src/9/mtx/dat.h
144a
	ulong	inidle;			/* fastticks in idlehands() since last slowtick */
	ulong	avginidle;		/* avg fastticks in idlehands() per slowtick */
.
## diffname mtx/dat.h 2002/0822
## diff -e /n/emeliedump/2002/0821/sys/src/9/mtx/dat.h /n/emeliedump/2002/0822/sys/src/9/mtx/dat.h
144,146c
	Perf	perf;			/* performance counters */
.
## diffname mtx/dat.h 2003/0301
## diff -e /n/emeliedump/2002/0822/sys/src/9/mtx/dat.h /n/emeliedump/2003/0301/sys/src/9/mtx/dat.h
186c
	int	irq;
.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].