# 9k risc-v cpu server for tinyemu
dev +dev
	root
	cons
	arch
	env
	pipe
	proc
	mnt
	srv
	dup
#	rtc
	ssl
	tls
	cap
	kprof
	segment
	ether		netif
	ip		arp chandial ip ipv6 ipaux iproute netlog nullmedium pktmedium
	uart
	bridge		log
#	draw	screen

uart +dev
	uarti8250

ip +dev
	tcp
	udp
	ipifc
	icmp
	icmp6
#	ipmux

link +dev
	ethertemu
	ethermedium
	loopbackmedium
	netdevmedium
#	usbehci		usbehcipc

misc +dev
	cache

boot cpu
	tcp

rootdir
	boot$CONF.out		boot
	/riscv64/bin/auth/factotum
	/riscv64/bin/ip/ipconfig
	/cfg/example/nvram.coll	nvram

conf
	#include "riscv64.h"

	int cpuserver = 1;
	uvlong cpuhz = 34*MHZ;	/* from timesync, emulated on 3ghz nuc */
	uvlong timebase = 10*MHZ;	/* clint ticks per second */
	Membank membanks[] = {	 	/* (address, size) pairs */
		PHYSMEM, BANK0SIZE,
		0
	};
	char defnvram[] = "/boot/nvram";

	uintptr uartregs[] = { PAUart0 };
	int nuart = nelem(uartregs);
	vlong uartfreq = 384000;

	uchar ether0mac[] = { 2, 0, 0, 0, 0, 1 };

	/* the emulated plic doesn't seem to follow the spec; we ignore it. */
	Soc soc = {
		.plic	= (char *)0x40100000,
		.ether[0] = (char *)0x40011000,

		.hobbled = 0,		/* only 1 hart */
	};
	Ioconf socconf[] = { /* devices without drivers that vmap their regs */
		{ "clint", 64*KB, &soc.clint, },
		{ "uart",  PGSZ, &soc.uart, 1, },
		{ "plic",  4*MB, &soc.plic, },		/* common but smaller */
		0
	};
	Ioconf ioconfs[] = {	/* devices whose drivers vmap their regs */
		{ "ether", 2*PGSZ, &soc.ether[0], 2, },
		0
	};

riscv64
	start
	low
	mach
	mtrap
	strap
	mch
	main
	allocb
	arch
	archrv
	color
	csr
	dmamalloc
	fp
	fpu
	ioconf
#	kbd
	map
	memory
	mmu
	fakepci
	fakeptenc
	sane
	sbi
	fakesbi
	plic
	trap
	fakeucalloc
port
	alarm
	awaitbit
	byteserial
	chan
	ctype
	dev
	devtab
	edf
	fault
	image
#	latin1
	logpow
	page
	parse
	pgrp
	portclock
	prf
	print
	proc
	ps
	qio
	qlock
	qmalloc
	random
	rebootcmd
	segment
	sysauth
	syscall
	syscallfmt
	sysfile
	sysproc
	sysseg
	systab
	taslock
	tod
	watermarks

#
# controls which directories to look in for source files; must be relative to ..
#
dir
	ip
	port
	../9/port
