shithub: riscv

ref: a15863b8ae23a26a2f825daf6107ab92e53c2669
dir: /sys/src/ape/lib/ap/plan9/acidlib/

View raw version
sizeof_1_ = 8;
aggr _1_
{
	'D' 0 quot;
	'D' 4 rem;
};

defn
_1_(addr) {
	complex _1_ addr;
	print("	quot	", addr.quot, "\n");
	print("	rem	", addr.rem, "\n");
};

sizeof_2_ = 8;
aggr _2_
{
	'D' 0 quot;
	'D' 4 rem;
};

defn
_2_(addr) {
	complex _2_ addr;
	print("	quot	", addr.quot, "\n");
	print("	rem	", addr.rem, "\n");
};

sizeofsigaction = 12;
aggr sigaction
{
	'X' 0 sa_handler;
	'D' 4 sa_mask;
	'D' 8 sa_flags;
};

defn
sigaction(addr) {
	complex sigaction addr;
	print("	sa_handler	", addr.sa_handler\X, "\n");
	print("	sa_mask	", addr.sa_mask, "\n");
	print("	sa_flags	", addr.sa_flags, "\n");
};

sizeof_3_ = 32;
aggr _3_
{
	'D' 0 fd;
	'C' 4 flags;
	'C' 5 state;
	'X' 8 buf;
	'X' 12 rp;
	'X' 16 wp;
	'X' 20 lp;
	'U' 24 bufl;
	'a' 28 unbuf;
};

defn
_3_(addr) {
	complex _3_ addr;
	print("	fd	", addr.fd, "\n");
	print("	flags	", addr.flags, "\n");
	print("	state	", addr.state, "\n");
	print("	buf	", addr.buf\X, "\n");
	print("	rp	", addr.rp\X, "\n");
	print("	wp	", addr.wp\X, "\n");
	print("	lp	", addr.lp\X, "\n");
	print("	bufl	", addr.bufl, "\n");
	print("	unbuf	", addr.unbuf, "\n");
};

sizeof_4_ = 4;
aggr _4_
{
	'D' 0 val;
};

defn
_4_(addr) {
	complex _4_ addr;
	print("	val	", addr.val, "\n");
};

sizeoftimeval = 8;
aggr timeval
{
	'D' 0 tv_sec;
	'D' 4 tv_usec;
};

defn
timeval(addr) {
	complex timeval addr;
	print("	tv_sec	", addr.tv_sec, "\n");
	print("	tv_usec	", addr.tv_usec, "\n");
};

sizeoftimezone = 8;
aggr timezone
{
	'D' 0 tz_minuteswest;
	'D' 4 tz_dsttime;
};

defn
timezone(addr) {
	complex timezone addr;
	print("	tz_minuteswest	", addr.tz_minuteswest, "\n");
	print("	tz_dsttime	", addr.tz_dsttime, "\n");
};

sizeoffd_set = 12;
aggr fd_set
{
	'a' 0 fds_bits;
};

defn
fd_set(addr) {
	complex fd_set addr;
	mem(addr, "3X");
};

sizeofstat = 28;
aggr stat
{
	'u' 0 st_dev;
	'u' 2 st_ino;
	'u' 4 st_mode;
	'd' 6 st_nlink;
	'd' 8 st_uid;
	'd' 10 st_gid;
	'D' 12 st_size;
	'D' 16 st_atime;
	'D' 20 st_mtime;
	'D' 24 st_ctime;
};

defn
stat(addr) {
	complex stat addr;
	print("	st_dev	", addr.st_dev, "\n");
	print("	st_ino	", addr.st_ino, "\n");
	print("	st_mode	", addr.st_mode, "\n");
	print("	st_nlink	", addr.st_nlink, "\n");
	print("	st_uid	", addr.st_uid, "\n");
	print("	st_gid	", addr.st_gid, "\n");
	print("	st_size	", addr.st_size, "\n");
	print("	st_atime	", addr.st_atime, "\n");
	print("	st_mtime	", addr.st_mtime, "\n");
	print("	st_ctime	", addr.st_ctime, "\n");
};

sizeofflock = 16;
aggr flock
{
	'd' 0 l_type;
	'd' 2 l_whence;
	'D' 4 l_start;
	'D' 8 l_len;
	'D' 12 l_pid;
};

defn
flock(addr) {
	complex flock addr;
	print("	l_type	", addr.l_type, "\n");
	print("	l_whence	", addr.l_whence, "\n");
	print("	l_start	", addr.l_start, "\n");
	print("	l_len	", addr.l_len, "\n");
	print("	l_pid	", addr.l_pid, "\n");
};

sizeofdirent = 28;
aggr dirent
{
	'a' 0 d_name;
};

defn
dirent(addr) {
	complex dirent addr;
	print("	d_name	", addr.d_name, "\n");
};

sizeof_dirdesc = 16;
aggr _dirdesc
{
	'D' 0 dd_fd;
	'D' 4 dd_loc;
	'D' 8 dd_size;
	'X' 12 dd_buf;
};

defn
_dirdesc(addr) {
	complex _dirdesc addr;
	print("	dd_fd	", addr.dd_fd, "\n");
	print("	dd_loc	", addr.dd_loc, "\n");
	print("	dd_size	", addr.dd_size, "\n");
	print("	dd_buf	", addr.dd_buf\X, "\n");
};

sizeoftermios = 28;
aggr termios
{
	'U' 0 c_iflag;
	'U' 4 c_oflag;
	'U' 8 c_cflag;
	'U' 12 c_lflag;
	'a' 16 c_cc;
};

defn
termios(addr) {
	complex termios addr;
	print("	c_iflag	", addr.c_iflag, "\n");
	print("	c_oflag	", addr.c_oflag, "\n");
	print("	c_cflag	", addr.c_cflag, "\n");
	print("	c_lflag	", addr.c_lflag, "\n");
	print("	c_cc	", addr.c_cc, "\n");
};

sizeofutsname = 20;
aggr utsname
{
	'X' 0 sysname;
	'X' 4 nodename;
	'X' 8 release;
	'X' 12 version;
	'X' 16 machine;
};

defn
utsname(addr) {
	complex utsname addr;
	print("	sysname	", addr.sysname\X, "\n");
	print("	nodename	", addr.nodename\X, "\n");
	print("	release	", addr.release\X, "\n");
	print("	version	", addr.version\X, "\n");
	print("	machine	", addr.machine\X, "\n");
};

sizeofMuxbuf = 16400;
aggr Muxbuf
{
	'D' 0 n;
	'X' 4 putnext;
	'X' 8 getnext;
	'b' 12 fd;
	'b' 13 eof;
	'b' 14 roomwait;
	'b' 15 datawait;
	'a' 16 data;
};

defn
Muxbuf(addr) {
	complex Muxbuf addr;
	print("	n	", addr.n, "\n");
	print("	putnext	", addr.putnext\X, "\n");
	print("	getnext	", addr.getnext\X, "\n");
	print("	fd	", addr.fd, "\n");
	print("	eof	", addr.eof, "\n");
	print("	roomwait	", addr.roomwait, "\n");
	print("	datawait	", addr.datawait, "\n");
	print("	data	", addr.data, "\n");
};

sizeofFdinfo = 16;
aggr Fdinfo
{
	'U' 0 flags;
	'U' 4 oflags;
	'X' 8 name;
	'A' Muxbuf 12 buf;
};

defn
Fdinfo(addr) {
	complex Fdinfo addr;
	print("	flags	", addr.flags, "\n");
	print("	oflags	", addr.oflags, "\n");
	print("	name	", addr.name\X, "\n");
	print("	buf	", addr.buf\X, "\n");
};

sizeofWaitmsg = 112;
aggr Waitmsg
{
	'a' 0 pid;
	'a' 12 time;
	'a' 48 msg;
};

defn
Waitmsg(addr) {
	complex Waitmsg addr;
	print("	pid	", addr.pid, "\n");
	print("	time	", addr.time, "\n");
	print("	msg	", addr.msg, "\n");
};

sizeof_5_ = 8;
aggr _5_
{
	'D' 0 hlength;
	'D' 4 length;
};

defn
_5_(addr) {
	complex _5_ addr;
	print("	hlength	", addr.hlength, "\n");
	print("	length	", addr.length, "\n");
};

sizeof_6_ = 8;
aggr _6_
{
	'a' 0 clength;
	'D' 0 vlength;
	{
	'D' 0 hlength;
	'D' 4 length;
	};
};

defn
_6_(addr) {
	complex _6_ addr;
	print("	clength	", addr.clength, "\n");
	print("	vlength	", addr.vlength, "\n");
	print("_5_ {\n");
		_5_(addr+0);
	print("}\n");
};

sizeofQid = 8;
aggr Qid
{
	'U' 0 path;
	'U' 4 vers;
};

defn
Qid(addr) {
	complex Qid addr;
	print("	path	", addr.path, "\n");
	print("	vers	", addr.vers, "\n");
};

sizeofDir = 116;
aggr Dir
{
	'a' 0 name;
	'a' 28 uid;
	'a' 56 gid;
	Qid 84 qid;
	'U' 92 mode;
	'D' 96 atime;
	'D' 100 mtime;
	{
	'a' 104 clength;
	'D' 104 vlength;
	{
	'D' 104 hlength;
	'D' 108 length;
	};
	};
	'd' 112 type;
	'd' 114 dev;
};

defn
Dir(addr) {
	complex Dir addr;
	print("	name	", addr.name, "\n");
	print("	uid	", addr.uid, "\n");
	print("	gid	", addr.gid, "\n");
	print("Qid qid {\n");
	Qid(addr.qid);
	print("}\n");
	print("	mode	", addr.mode, "\n");
	print("	atime	", addr.atime, "\n");
	print("	mtime	", addr.mtime, "\n");
	print("_6_ {\n");
		_6_(addr+104);
	print("}\n");
	print("	type	", addr.type, "\n");
	print("	dev	", addr.dev, "\n");
};

sizeof_7_ = 28;
aggr _7_
{
	'u' 0 oldtag;
	Qid 4 qid;
	'a' 12 rauth;
};

defn
_7_(addr) {
	complex _7_ addr;
	print("	oldtag	", addr.oldtag, "\n");
	print("Qid qid {\n");
	Qid(addr.qid);
	print("}\n");
	print("	rauth	", addr.rauth, "\n");
};

sizeof_8_ = 144;
aggr _8_
{
	'a' 0 uname;
	'a' 28 aname;
	'a' 56 ticket;
	'a' 128 auth;
};

defn
_8_(addr) {
	complex _8_ addr;
	print("	uname	", addr.uname, "\n");
	print("	aname	", addr.aname, "\n");
	print("	ticket	", addr.ticket, "\n");
	print("	auth	", addr.auth, "\n");
};

sizeof_9_ = 148;
aggr _9_
{
	'a' 0 ename;
	'a' 64 authid;
	'a' 92 authdom;
	'a' 140 chal;
};

defn
_9_(addr) {
	complex _9_ addr;
	print("	ename	", addr.ename, "\n");
	print("	authid	", addr.authid, "\n");
	print("	authdom	", addr.authdom, "\n");
	print("	chal	", addr.chal, "\n");
};

sizeof_10_ = 36;
aggr _10_
{
	'D' 0 perm;
	'd' 4 newfid;
	'a' 6 name;
	'C' 34 mode;
};

defn
_10_(addr) {
	complex _10_ addr;
	print("	perm	", addr.perm, "\n");
	print("	newfid	", addr.newfid, "\n");
	print("	name	", addr.name, "\n");
	print("	mode	", addr.mode, "\n");
};

sizeof_11_ = 12;
aggr _11_
{
	'D' 0 offset;
	'D' 4 count;
	'X' 8 data;
};

defn
_11_(addr) {
	complex _11_ addr;
	print("	offset	", addr.offset, "\n");
	print("	count	", addr.count, "\n");
	print("	data	", addr.data\X, "\n");
};

sizeof_12_ = 116;
aggr _12_
{
	'a' 0 stat;
};

defn
_12_(addr) {
	complex _12_ addr;
	print("	stat	", addr.stat, "\n");
};

sizeof_13_ = 148;
aggr _13_
{
	{
	'u' 0 oldtag;
	Qid 4 qid;
	'a' 12 rauth;
	};
	{
	'a' 0 uname;
	'a' 28 aname;
	'a' 56 ticket;
	'a' 128 auth;
	};
	{
	'a' 0 ename;
	'a' 64 authid;
	'a' 92 authdom;
	'a' 140 chal;
	};
	{
	'D' 0 perm;
	'd' 4 newfid;
	'a' 6 name;
	'C' 34 mode;
	};
	{
	'D' 0 offset;
	'D' 4 count;
	'X' 8 data;
	};
	{
	'a' 0 stat;
	};
};

defn
_13_(addr) {
	complex _13_ addr;
	print("_7_ {\n");
		_7_(addr+0);
	print("}\n");
	print("_8_ {\n");
		_8_(addr+0);
	print("}\n");
	print("_9_ {\n");
		_9_(addr+0);
	print("}\n");
	print("_10_ {\n");
		_10_(addr+0);
	print("}\n");
	print("_11_ {\n");
		_11_(addr+0);
	print("}\n");
	print("_12_ {\n");
		_12_(addr+0);
	print("}\n");
};

sizeofFcall = 156;
aggr Fcall
{
	'C' 0 type;
	'd' 2 fid;
	'u' 4 tag;
	{
	{
	'u' 8 oldtag;
	Qid 12 qid;
	'a' 20 rauth;
	};
	{
	'a' 8 uname;
	'a' 36 aname;
	'a' 64 ticket;
	'a' 136 auth;
	};
	{
	'a' 8 ename;
	'a' 72 authid;
	'a' 100 authdom;
	'a' 148 chal;
	};
	{
	'D' 8 perm;
	'd' 12 newfid;
	'a' 14 name;
	'C' 42 mode;
	};
	{
	'D' 8 offset;
	'D' 12 count;
	'X' 16 data;
	};
	{
	'a' 8 stat;
	};
	};
};

defn
Fcall(addr) {
	complex Fcall addr;
	print("	type	", addr.type, "\n");
	print("	fid	", addr.fid, "\n");
	print("	tag	", addr.tag, "\n");
	print("_13_ {\n");
		_13_(addr+8);
	print("}\n");
};

sizeofMuxbuf = 16400;
aggr Muxbuf
{
	'D' 0 n;
	'X' 4 putnext;
	'X' 8 getnext;
	'b' 12 fd;
	'b' 13 eof;
	'b' 14 roomwait;
	'b' 15 datawait;
	'a' 16 data;
};

defn
Muxbuf(addr) {
	complex Muxbuf addr;
	print("	n	", addr.n, "\n");
	print("	putnext	", addr.putnext\X, "\n");
	print("	getnext	", addr.getnext\X, "\n");
	print("	fd	", addr.fd, "\n");
	print("	eof	", addr.eof, "\n");
	print("	roomwait	", addr.roomwait, "\n");
	print("	datawait	", addr.datawait, "\n");
	print("	data	", addr.data, "\n");
};

sizeofFdinfo = 16;
aggr Fdinfo
{
	'U' 0 flags;
	'U' 4 oflags;
	'X' 8 name;
	'A' Muxbuf 12 buf;
};

defn
Fdinfo(addr) {
	complex Fdinfo addr;
	print("	flags	", addr.flags, "\n");
	print("	oflags	", addr.oflags, "\n");
	print("	name	", addr.name\X, "\n");
	print("	buf	", addr.buf\X, "\n");
};

sizeofWaitmsg = 112;
aggr Waitmsg
{
	'a' 0 pid;
	'a' 12 time;
	'a' 48 msg;
};

defn
Waitmsg(addr) {
	complex Waitmsg addr;
	print("	pid	", addr.pid, "\n");
	print("	time	", addr.time, "\n");
	print("	msg	", addr.msg, "\n");
};

sizeofMuxseg = 65640;
aggr Muxseg
{
	_4_ 0 lock;
	'D' 4 curfds;
	'D' 8 selwait;
	'D' 12 waittime;
	fd_set 16 rwant;
	fd_set 28 ewant;
	'a' 40 bufs;
};

defn
Muxseg(addr) {
	complex Muxseg addr;
	print("_4_ lock {\n");
	_4_(addr.lock);
	print("}\n");
	print("	curfds	", addr.curfds, "\n");
	print("	selwait	", addr.selwait, "\n");
	print("	waittime	", addr.waittime, "\n");
	print("fd_set rwant {\n");
	fd_set(addr.rwant);
	print("}\n");
	print("fd_set ewant {\n");
	fd_set(addr.ewant);
	print("}\n");
	print("	bufs	", addr.bufs, "\n");
};

complex Muxseg mux;
complex Fdinfo _startbuf:f;
complex Muxbuf _startbuf:b;
complex Muxbuf _copyproc:b;
complex Muxbuf _readbuf:b;
complex fd_set select:rfds;
complex fd_set select:wfds;
complex fd_set select:efds;
complex timeval select:timeout;
complex Fdinfo select:f;
complex Muxbuf select:b;