shithub: riscv

ref: fe1eb39db7ae6904924f3ab1f6f9b34416f2eb1b
dir: /sys/src/cmd/syscall/mktab.awk/

View raw version
#!/bin/awk -f
{	e = e $2 ", "
	s = s sprintf("[%s] \"%s\", (int(*)(...))%s,\n",
		$2, tolower($2), tolower($2))
}
END{
	e = e "READ, WRITE, NTAB"
	s = s "[READ] \"read\", (int(*)(...))read,\n"
	s = s "[WRITE] \"write\", (int(*)(...))write,\n"
	s = s "[NTAB] nil, 0\n"
	
	print "enum{", e, "};"
	print "struct Call tab[] = {\n", s, "};"
}