# $NetBSD: GENERIC,v 1.21 2022/11/25 12:35:44 jmcneill Exp $
#
# GENERIC machine description file
#
# This machine description file is used to generate the default NetBSD
# kernel.  The generic kernel does not include all options, subsystems
# and device drivers, but should be useful for most applications.
#
# The machine description file can be customised for your specific
# machine to reduce the kernel size and improve its performance.
#
# For further information on compiling NetBSD kernels, see the config(8)
# man page.
#
# For further information on hardware support for this architecture, see
# the intro(4) man page.  For further information about kernel options
# for this architecture, see the options(4) man page.  For an explanation
# of each device driver in this file see the section 4 man page for the
# device.

include	"arch/riscv/conf/std.riscv64"
include "arch/riscv/sifive/files.sifive"

options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary

#ident 		"GENERIC-$Revision: 1.21 $"

maxusers	64		# estimated number of users

options 	FDT

#options 	EARLYCONS=com, CONSADDR=0x10000000	# qemu virt
#options 	EARLYCONS=com, CONSADDR=0x12440000	# sifive
options 	VERBOSE_INIT_RISCV

# Standard system options
#options 	FPE		# Floating-point extension support
options 	NTP		# NTP phase/frequency locked loop

options 	KTRACE		# system call tracing via ktrace(1)

# Note: SysV IPC parameters could be changed dynamically, see sysctl(8).
options 	SYSVMSG		# System V-like message queues
options 	SYSVSEM		# System V-like semaphores
options 	SYSVSHM		# System V-like memory sharing

options 	MODULAR		# new style module(7) framework
options 	MODULAR_DEFAULT_AUTOLOAD
options 	USERCONF	# userconf(4) support
#options 	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel

# Alternate buffer queue strategies for better responsiveness under high
# disk I/O load.
#options 	BUFQ_READPRIO
options 	BUFQ_PRIOCSCAN

# Diagnostic/debugging support options
options 	DIAGNOSTIC	# inexpensive kernel consistency checks
				# XXX to be commented out on release branch
#options  	DEBUG		# expensive debugging checks/support
#options  	LOCKDEBUG	# expensive locking checks/support
#options  	KERNHIST
#options  	KERNHIST_PRINT
#options  	UVMHIST
#options  	UVMHIST_PRINT
#options  	PMAPHIST
#options  	PMAPHIST_PRINT
#options  	SYSCTL_DEBUG
#options  	SYSCTL_DEBUG_SETUP
#options  	SYSCTL_DEBUG_CREATE


#
# Because gcc omits the frame pointer for any -O level, the line below
# is needed to make backtraces in DDB work.
#
makeoptions	COPTS="-O2 -fno-omit-frame-pointer"
makeoptions	COPY_SYMTAB=1
options 	DDB		# in-kernel debugger
#options 	DDB_COMMANDONENTER="bt"	# execute command when ddb is entered
options 	DDB_ONPANIC=1	# see also sysctl(7): `ddb.onpanic'
options 	DDB_HISTORY_SIZE=512	# enable history editing in DDB
#options 	KGDB		# remote debugger
#options 	KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x3f8,KGDB_DEVRATE=9600
#options 	SYSCALL_STATS	# per syscall counts
#options 	SYSCALL_TIMES	# per syscall times
#options 	SYSCALL_TIMES_HASCOUNTER	# use 'broken' rdtsc (soekris)

# Compatibility options
include 	"conf/compat_netbsd70.config"

#options 	COMPAT_NETBSD32
#options 	EXEC_ELF32

# Wedge support
options 	DKWEDGE_AUTODISCOVER	# Automatically add dk(4) instances
options 	DKWEDGE_METHOD_GPT	# Supports GPT partitions as wedges
options 	DKWEDGE_METHOD_BSDLABEL	# Support disklabel entries as wedges
options 	DKWEDGE_METHOD_MBR	# Support MBR partitions as wedges
options 	DKWEDGE_METHOD_APPLE    # Support Apple partitions as wedges
#options 	DKWEDGE_METHOD_RDB	# Support RDB partitions as wedges

include 	"conf/filesystems.config"

# File system options
options 	FFS_EI		# FFS Endian Independent support
#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
options 	QUOTA		# legacy UFS quotas
options 	QUOTA2		# new, in-filesystem UFS quotas
#options 	UFS_DIRHASH	# UFS Large Directory Hashing
options 	WAPBL		# File system journaling support
#options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and
				# immutable) behave as system flags.
#options 	DISKLABEL_EI	# disklabel Endian Independent support
options 	NFSSERVER	# Network File System server
options 	NFS_BOOT_DHCP	# Support DHCP NFS root

# Networking options
#options 	GATEWAY		# packet forwarding
options 	INET		# IP + ICMP + TCP + UDP
options 	INET6		# IPV6
options 	IPSEC		# IP security
#options 	IPSEC_DEBUG	# debug for IP security
#options 	MPLS		# MultiProtocol Label Switching (needs mpls)
#options 	MROUTING	# IP multicast routing
#options 	PIM		# Protocol Independent Multicast
#options 	NETATALK	# AppleTalk networking protocols
#options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
#options 	PPP_DEFLATE	# Deflate compression support for PPP
#options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
#options 	TCP_DEBUG	# Record last TCP_NDEBUG packets with SO_DEBUG

#options 	ALTQ		# Manipulate network interfaces' output queues
#options 	ALTQ_BLUE	# Stochastic Fair Blue
#options 	ALTQ_CBQ	# Class-Based Queueing
#options 	ALTQ_CDNR	# Diffserv Traffic Conditioner
#options 	ALTQ_FIFOQ	# First-In First-Out Queue
#options 	ALTQ_FLOWVALVE	# RED/flow-valve (red-penalty-box)
#options 	ALTQ_HFSC	# Hierarchical Fair Service Curve
#options 	ALTQ_LOCALQ	# Local queueing discipline
#options 	ALTQ_PRIQ	# Priority Queueing
#options 	ALTQ_RED	# Random Early Detection
#options 	ALTQ_RIO	# RED with IN/OUT
#options 	ALTQ_WFQ	# Weighted Fair Queueing

# These options enable verbose messages for several subsystems.
# Warning, these may compile large string tables into the kernel!

# Kernel root file system and dump configuration.
config		netbsd	root on ? type ?

#
# Device configuration
#
mainbus0 	at root
simplebus* 	at fdt? pass 0

# Clock and reset controller
prci*		at fdt?			# SiFive FU540 PRCI

# UART
com* 		at fdt?			# UART

# Pseudo-Devices

pseudo-device 	crypto			# /dev/crypto device
pseudo-device	swcrypto		# software crypto implementation

# disk/mass storage pseudo-devices
#pseudo-device	md			# memory disk device (ramdisk)
#options 	MEMORY_DISK_HOOKS	# enable root ramdisk
#options 	MEMORY_DISK_DYNAMIC	# loaded via kernel module(7)

pseudo-device	vnd			# disk-like interface to files
options 	VND_COMPRESSION		# compressed vnd(4)

pseudo-device	loop			# network loopback
pseudo-device	pty			# pseudo-terminals
pseudo-device	clockctl		# user control of clock subsystem
pseudo-device	ksyms			# /dev/ksyms
pseudo-device	lockstat		# lock profiling
pseudo-device 	swwdog			# software watchdog timer -- swwdog(4)

# userland interface to drivers, including autoconf and properties retrieval
pseudo-device	drvctl

options 	PAX_MPROTECT=0		# PaX mprotect(2) restrictions
options 	PAX_ASLR=0		# PaX Address Space Layout Randomization

cinclude 	"arch/riscv/conf/GENERIC.local"
