vx32

Local 9vx git repository for patches.
git clone git://r-36.net/vx32
Log | Files | Refs

fns.ed (2007B)


      1 g/bios32/d
      2 g/Pcidev/d
      3 g/mfence/d
      4 g/syscallprint/d
      5 $a
      6 
      7 // Plan 9 VX additions
      8 void	gotolabel(Label*);
      9 int	isuaddr(void*);
     10 void	labelinit(Label *l, ulong pc, ulong sp);
     11 void	latin1putc(int, void(*)(int));
     12 void	makekprocdev(Dev*);
     13 void	newmach(void);
     14 void	oserror(void);
     15 void	oserrstr(void);
     16 void restoretty(void);
     17 int	setlabel(Label*);
     18 void	setsigsegv(int invx32);
     19 int	tailkmesg(char*, int);
     20 void	trap(Ureg*);
     21 void	uartecho(char*, int);
     22 void	uartinit(int);
     23 void	*uvalidaddr(ulong addr, ulong len, int write);
     24 
     25 #define GSHORT(p)	(((p)[1]<<8)|(p)[0])
     26 #define GLONG(p)	((GSHORT(p+2)<<16)|GSHORT(p))
     27 
     28 void	__plock(Psleep*);
     29 void	__punlock(Psleep*);
     30 void	__pwakeup(Psleep*);
     31 void	__psleep(Psleep*);
     32 
     33 extern int tracelock;
     34 
     35 #define lockfngen(type)	__ ## type
     36 
     37 #define lockgen(type, arg) 								\
     38 	do {										\
     39 		if (tracelock) {							\
     40 			iprint("%s %p %s %d\n", (#type), (arg), __FILE__, __LINE__);	\
     41 			lockfngen(type)((arg));						\
     42 		} else {								\
     43 			lockfngen(type)((arg));						\
     44 		}									\
     45 	} while (0)
     46 
     47 #define qlock(x)	lockgen(qlock, (x))
     48 #define qunlock(x)	lockgen(qunlock, (x))
     49 #define rlock(x)	lockgen(rlock, (x))
     50 #define runlock(x)	lockgen(runlock, (x))
     51 #define wlock(x)	lockgen(wlock, (x))
     52 #define wunlock(x)	lockgen(wunlock, (x))
     53 #define plock(x)	lockgen(plock, (x))
     54 #define punlock(x)	lockgen(punlock, (x))
     55 #define pwakeup(x)	lockgen(pwakeup, (x))
     56 #define psleep(x)	lockgen(psleep, (x))
     57 // #define lock(x)		lockgen(lock, (x))
     58 // #define unlock(x)	lockgen(unlock, (x))
     59 #define lock(x) __lock(x)
     60 #define unlock(x) __unlock(x)
     61 #define canqlock	__canqlock
     62 #define canrlock	__canrlock
     63 
     64 #define	LOCK(x)		lock(&((x)->lk))
     65 #define	UNLOCK(x)	unlock(&((x)->lk))
     66 #define CANQLOCK(x)	canqlock(&((x)->qlock))
     67 #define	QLOCK(x)	qlock(&((x)->qlock))
     68 #define	QUNLOCK(x)	qunlock(&((x)->qlock))
     69 #define CANRLOCK(x)	canrlock(&((x)->rwlock))
     70 #define	RLOCK(x)	rlock(&((x)->rwlock))
     71 #define	RUNLOCK(x)	runlock(&((x)->rwlock))
     72 #define	WLOCK(x)	wlock(&((x)->rwlock))
     73 #define	WUNLOCK(x)	wunlock(&((x)->rwlock))
     74 .