diff --git a/distrib/sets/lists/minix-base/mi b/distrib/sets/lists/minix-base/mi index a2bfd2162..d2a9d8b1d 100644 --- a/distrib/sets/lists/minix-base/mi +++ b/distrib/sets/lists/minix-base/mi @@ -875,6 +875,66 @@ ./usr/lib/librumpdev.so.0.0 minix-base rump ./usr/lib/librumpdev.so.0 minix-base rump ./usr/lib/librumpdev.so minix-base rump +./usr/lib/librumpdev_audio.so.0.0 minix-base rump +./usr/lib/librumpdev_audio.so.0 minix-base rump +./usr/lib/librumpdev_audio.so minix-base rump +./usr/lib/librumpdev_bpf.so.0.0 minix-base rump +./usr/lib/librumpdev_bpf.so.0 minix-base rump +./usr/lib/librumpdev_bpf.so minix-base rump +./usr/lib/librumpdev_cgd.so.0.0 minix-base rump +./usr/lib/librumpdev_cgd.so.0 minix-base rump +./usr/lib/librumpdev_cgd.so minix-base rump +./usr/lib/librumpdev_disk.so.0.0 minix-base rump +./usr/lib/librumpdev_disk.so.0 minix-base rump +./usr/lib/librumpdev_disk.so minix-base rump +./usr/lib/librumpdev_dm.so.0.0 minix-base rump +./usr/lib/librumpdev_dm.so.0 minix-base rump +./usr/lib/librumpdev_dm.so minix-base rump +./usr/lib/librumpdev_drvctl.so.0.0 minix-base rump +./usr/lib/librumpdev_drvctl.so.0 minix-base rump +./usr/lib/librumpdev_drvctl.so minix-base rump +./usr/lib/librumpdev_fss.so.0.0 minix-base rump +./usr/lib/librumpdev_fss.so.0 minix-base rump +./usr/lib/librumpdev_fss.so minix-base rump +./usr/lib/librumpdev_md.so.0.0 minix-base rump +./usr/lib/librumpdev_md.so.0 minix-base rump +./usr/lib/librumpdev_md.so minix-base rump +./usr/lib/librumpdev_netsmb.so.0.0 minix-base rump +./usr/lib/librumpdev_netsmb.so.0 minix-base rump +./usr/lib/librumpdev_netsmb.so minix-base rump +./usr/lib/librumpdev_opencrypto.so.0.0 minix-base rump +./usr/lib/librumpdev_opencrypto.so.0 minix-base rump +./usr/lib/librumpdev_opencrypto.so minix-base rump +./usr/lib/librumpdev_pad.so.0.0 minix-base rump +./usr/lib/librumpdev_pad.so.0 minix-base rump +./usr/lib/librumpdev_pad.so minix-base rump +./usr/lib/librumpdev_pud.so.0.0 minix-base rump +./usr/lib/librumpdev_pud.so.0 minix-base rump +./usr/lib/librumpdev_pud.so minix-base rump +./usr/lib/librumpdev_putter.so.0.0 minix-base rump +./usr/lib/librumpdev_putter.so.0 minix-base rump +./usr/lib/librumpdev_putter.so minix-base rump +./usr/lib/librumpdev_raidframe.so.0.0 minix-base rump +./usr/lib/librumpdev_raidframe.so.0 minix-base rump +./usr/lib/librumpdev_raidframe.so minix-base rump +./usr/lib/librumpdev_rnd.so.0.0 minix-base rump +./usr/lib/librumpdev_rnd.so.0 minix-base rump +./usr/lib/librumpdev_rnd.so minix-base rump +./usr/lib/librumpdev_sysmon.so.0.0 minix-base rump +./usr/lib/librumpdev_sysmon.so.0 minix-base rump +./usr/lib/librumpdev_sysmon.so minix-base rump +./usr/lib/librumpdev_ugenhc.so.0.0 minix-base rump +./usr/lib/librumpdev_ugenhc.so.0 minix-base rump +./usr/lib/librumpdev_ugenhc.so minix-base rump +./usr/lib/librumpdev_ulpt.so.0.0 minix-base rump +./usr/lib/librumpdev_ulpt.so.0 minix-base rump +./usr/lib/librumpdev_ulpt.so minix-base rump +./usr/lib/librumpdev_umass.so.0.0 minix-base rump +./usr/lib/librumpdev_umass.so.0 minix-base rump +./usr/lib/librumpdev_umass.so minix-base rump +./usr/lib/librumpdev_vnd.so.0.0 minix-base rump +./usr/lib/librumpdev_vnd.so.0 minix-base rump +./usr/lib/librumpdev_vnd.so minix-base rump ./usr/lib/librumpfs_cd9660.so.0.0 minix-base rump ./usr/lib/librumpfs_cd9660.so.0 minix-base rump ./usr/lib/librumpfs_cd9660.so minix-base rump diff --git a/distrib/sets/lists/minix-comp/mi b/distrib/sets/lists/minix-comp/mi index 87e2b0992..3ba2de230 100644 --- a/distrib/sets/lists/minix-comp/mi +++ b/distrib/sets/lists/minix-comp/mi @@ -2305,7 +2305,47 @@ ./usr/lib/librump.a minix-comp rump ./usr/lib/librump_pic.a minix-comp rump ./usr/lib/librumpdev.a minix-comp rump +./usr/lib/librumpdev_audio.a minix-comp rump +./usr/lib/librumpdev_audio_pic.a minix-comp rump +./usr/lib/librumpdev_bpf.a minix-comp rump +./usr/lib/librumpdev_bpf_pic.a minix-comp rump +./usr/lib/librumpdev_cgd.a minix-comp rump +./usr/lib/librumpdev_cgd_pic.a minix-comp rump +./usr/lib/librumpdev_disk.a minix-comp rump +./usr/lib/librumpdev_disk_pic.a minix-comp rump +./usr/lib/librumpdev_dm.a minix-comp rump +./usr/lib/librumpdev_dm_pic.a minix-comp rump +./usr/lib/librumpdev_drvctl.a minix-comp rump +./usr/lib/librumpdev_drvctl_pic.a minix-comp rump +./usr/lib/librumpdev_fss.a minix-comp rump +./usr/lib/librumpdev_fss_pic.a minix-comp rump +./usr/lib/librumpdev_md.a minix-comp rump +./usr/lib/librumpdev_md_pic.a minix-comp rump +./usr/lib/librumpdev_netsmb.a minix-comp rump +./usr/lib/librumpdev_netsmb_pic.a minix-comp rump +./usr/lib/librumpdev_opencrypto.a minix-comp rump +./usr/lib/librumpdev_opencrypto_pic.a minix-comp rump +./usr/lib/librumpdev_pad.a minix-comp rump +./usr/lib/librumpdev_pad_pic.a minix-comp rump ./usr/lib/librumpdev_pic.a minix-comp rump +./usr/lib/librumpdev_pud.a minix-comp rump +./usr/lib/librumpdev_pud_pic.a minix-comp rump +./usr/lib/librumpdev_putter.a minix-comp rump +./usr/lib/librumpdev_putter_pic.a minix-comp rump +./usr/lib/librumpdev_raidframe.a minix-comp rump +./usr/lib/librumpdev_raidframe_pic.a minix-comp rump +./usr/lib/librumpdev_rnd.a minix-comp rump +./usr/lib/librumpdev_rnd_pic.a minix-comp rump +./usr/lib/librumpdev_sysmon.a minix-comp rump +./usr/lib/librumpdev_sysmon_pic.a minix-comp rump +./usr/lib/librumpdev_ugenhc.a minix-comp rump +./usr/lib/librumpdev_ugenhc_pic.a minix-comp rump +./usr/lib/librumpdev_ulpt.a minix-comp rump +./usr/lib/librumpdev_ulpt_pic.a minix-comp rump +./usr/lib/librumpdev_umass.a minix-comp rump +./usr/lib/librumpdev_umass_pic.a minix-comp rump +./usr/lib/librumpdev_vnd.a minix-comp rump +./usr/lib/librumpdev_vnd_pic.a minix-comp rump ./usr/lib/librumpfs_cd9660.a minix-comp rump ./usr/lib/librumpfs_cd9660_pic.a minix-comp rump ./usr/lib/librumpfs_efs.a minix-comp rump diff --git a/lib/Makefile b/lib/Makefile index 14ef24c2c..a7badf1ad 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -323,7 +323,7 @@ SUBDIR+= ../crypto/external/cpl/tpm-tools/lib # depends on trousers .endif .if !defined(BSD_MK_COMPAT_FILE) -#SUBDIR+= ../sys/rump/dev/lib +SUBDIR+= ../sys/rump/dev/lib SUBDIR+= ../sys/rump/fs/lib SUBDIR+= ../sys/rump/kern/lib SUBDIR+= ../sys/rump/net/lib diff --git a/sys/conf/files b/sys/conf/files new file mode 100644 index 000000000..b28f857a0 --- /dev/null +++ b/sys/conf/files @@ -0,0 +1,1567 @@ +# $NetBSD: files,v 1.1150 2015/09/04 06:10:47 uebayasi Exp $ +# @(#)files.newconf 7.5 (Berkeley) 5/10/93 + +version 20150846 + +# +# device classes +# +devclass disk +devclass tape +devclass ifnet +devclass tty +devclass audiodev +devclass displaydev +devclass bus + +# options understood by the machine-independent part of the kernel +# (note, these are case-sensitive) +# +defparam opt_param.h MAXUSERS +defflag INSECURE +defflag KMEMSTATS +defflag KTRACE +defflag MBUFTRACE +defflag PTRACE +defflag COREDUMP +defflag opt_modular.h MODULAR +defflag opt_modular.h MODULAR_DEFAULT_AUTOLOAD +defflag KEYLOCK +defparam opt_syslimits.h CHILD_MAX OPEN_MAX +defflag opt_diagnostic.h _DIAGNOSTIC + +defparam opt_copy_symtab.h makeoptions_COPY_SYMTAB + +defparam DEFCORENAME +defparam HZ +defparam MAXUPRC +defparam RTC_OFFSET +defflag opt_pipe.h PIPE_SOCKETPAIR PIPE_NODIRECT + +defflag AIO +defflag MQUEUE + +defflag BUFQ_DISKSORT +defflag BUFQ_FCFS +defflag BUFQ_PRIOCSCAN +defflag BUFQ_READPRIO +defflag NEW_BUFQ_STRATEGY # same as BUFQ_READPRIO + +defflag opt_sched.h SCHED_4BSD +defflag opt_sched.h SCHED_M2 + +defparam SOMAXKVA +defflag opt_sock_counters.h SOSEND_COUNTERS +defflag opt_sosend_loan.h SOSEND_NO_LOAN +defflag opt_route.h RTCACHE_DEBUG RTFLUSH_DEBUG + +defflag MULTIPROCESSOR +defflag NET_MPSAFE + +defflag opt_config.h INCLUDE_CONFIG_FILE INCLUDE_JUST_CONFIG + +defparam opt_dump.h DUMP_ON_PANIC + +defflag opt_callout.h CALLWHEEL_STATS + +defflag CPU_IN_CKSUM + +defflag opt_dtrace.h KDTRACE_HOOKS + +defflag opt_sysv.h SYSVMSG SYSVSEM SYSVSHM +defparam opt_sysvparam.h SHMMAXPGS SEMMNI SEMMNS SEMUME SEMMNU + +defflag opt_ntp.h PPS_SYNC PPS_DEBUG NTP + +defflag opt_ptm.h NO_DEV_PTM COMPAT_BSDPTY + +defparam opt_kmempages.h NKMEMPAGES NKMEMPAGES_MIN NKMEMPAGES_MAX + +defflag opt_revcache.h NAMECACHE_ENTER_REVERSE + +defflag opt_exec.h DEBUG_EXEC + +defflag opt_execfmt.h EXEC_AOUT EXEC_COFF EXEC_ECOFF EXEC_ELF32 + EXEC_ELF64 EXEC_SCRIPT + EXEC_ELF_NOTELESS + +defflag opt_dkwedge.h DKWEDGE_AUTODISCOVER + DKWEDGE_METHOD_BSDLABEL + DKWEDGE_METHOD_GPT + DKWEDGE_METHOD_MBR + DKWEDGE_METHOD_APPLE + +defflag opt_veriexec.h VERIFIED_EXEC_FP_SHA1 + VERIFIED_EXEC_FP_SHA256 + VERIFIED_EXEC_FP_SHA384 + VERIFIED_EXEC_FP_SHA512 + VERIFIED_EXEC_FP_MD5 + VERIFIED_EXEC_FP_RMD160 + +# Per system call number counts and times +defflag opt_syscall_stats.h SYSCALL_STATS +defflag opt_syscall_stats.h SYSCALL_TIMES: SYSCALL_STATS +# Assume cpu_hascounter() returns true - to use disabled rdtsc() (for soekris) +defflag opt_syscall_stats.h SYSCALL_TIMES_HASCOUNTER: SYSCALL_TIMES +file kern/subr_syscall_stats.c syscall_stats + +defparam opt_pax.h PAX_MPROTECT + PAX_SEGVGUARD + PAX_ASLR + PAX_ASLR_DELTA_MMAP_LSB + PAX_ASLR_DELTA_MMAP_LEN + PAX_ASLR_DELTA_STACK_LSB + PAX_ASLR_DELTA_STACK_LEN + PAX_ASLR_DELTA_PROG_LEN + PAX_ASLR_DEBUG + +defflag opt_fileassoc.h FILEASSOC + +defflag opt_gre.h GRE_DEBUG + +# Write Ahead Physical Block Logging +defflag opt_wapbl.h WAPBL WAPBL_DEBUG +defparam opt_wapbl.h WAPBL_DEBUG_PRINT + +# printf entropy source +defflag opt_rnd_printf.h RND_PRINTF + +defflag opt_todr.h TODR_DEBUG + +# compatibility options +# +defflag opt_compat_netbsd.h COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_70: COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_60: COMPAT_70, COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_50: COMPAT_60, COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_40: COMPAT_50, COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_30: COMPAT_40, COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_20: COMPAT_30, COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_16: COMPAT_20, COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_15: COMPAT_16, COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_14: COMPAT_15, COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_13: COMPAT_14, COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_12: COMPAT_13, COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_11: COMPAT_12, COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_10: COMPAT_11, COMPAT_NETBSD +defflag opt_compat_netbsd.h COMPAT_09: COMPAT_10, COMPAT_NETBSD +defflag COMPAT_OSSAUDIO +defflag COMPAT_FREEBSD: COMPAT_30 +defflag COMPAT_IBCS2 +defflag COMPAT_LINUX: COMPAT_16 +defflag COMPAT_LINUX32 : COMPAT_LINUX +defflag COMPAT_OSF1 +defflag COMPAT_SUNOS: COMPAT_30 +defflag opt_compat_svr4.h COMPAT_SVR4 COMPAT_SVR4_32 SVR4_COMPAT_SOLARIS2 +defflag COMPAT_ULTRIX: COMPAT_50 +defflag COMPAT_NETBSD32 +defflag COMPAT_AOUT_M68K: COMPAT_40 +defflag COMPAT_M68K4K +defflag COMPAT_VAX1K +defflag COMPAT_43 +defflag opt_compat_netbsd.h COMPAT_NOMID + +define machdep +defflag opt_machdep.h MACHDEP + +# +# Cryptography support. Include this early, since several things +# use it. + +# Individual crypto transforms +include "crypto/arc4/files.arc4" +include "crypto/des/files.des" +include "crypto/blowfish/files.blowfish" +include "crypto/cast128/files.cast128" +include "crypto/rijndael/files.rijndael" +include "crypto/skipjack/files.skipjack" +include "crypto/camellia/files.camellia" +# General-purpose crypto processing framework. +include "opencrypto/files.opencrypto" + +# NIST SP800.90 CTR DRBG +include "crypto/nist_ctr_drbg/files.nist_ctr_drbg" + +# ChaCha-based fast PRNG +include "crypto/cprng_fast/files.cprng_fast" + +# +# Kernel history/tracing. Old UVMHIST depends upon this. +# +defflag opt_kernhist.h KERNHIST KERNHIST_PRINT +defparam opt_kernhist.h KERNHIST_DELAY +file kern/kern_history.c kernhist + +# +# System monitoring framework +# +include "dev/sysmon/files.sysmon" + +# +# Networking protocols +# + +# Attribute used by various things that need BPF's virtual machine +# +define bpf_filter +defparam opt_bpf.h BPF_BUFSIZE + +defflag opt_bpf.h BPFJIT + +file net/bpfjit.c sljit & bpfjit + +include "net80211/files.net80211" +include "netatalk/files.netatalk" +include "netbt/files.netbt" +include "netinet/files.netinet" +include "netinet6/files.netinet6" +include "netipsec/files.netipsec" +include "netmpls/files.netmpls" +include "netnatm/files.netnatm" +include "netsmb/files.netsmb" + +include "net/npf/files.npf" +include "netinet/files.ipfilter" +include "net/files.pf" + +obsolete defflag CCITT # obsolete +obsolete defflag HDLC # obsolete +obsolete defflag LLC # obsolete +obsolete defflag opt_ns.h NS NSIP # obsolete +obsolete defflag IPX # obsolete +obsolete defparam opt_md.h MEMORY_RBFLAGS # superseded by + # MEMORY_DISK_RBFLAGS + +defflag opt_bridge_ipf.h BRIDGE_IPF # bridge(4) use inet_pfil_hooks +defflag opt_ppp.h PPP_DEFLATE PPP_BSDCOMP PPP_FILTER + # Include deflate or bsd + # compression, enable pppd + # packet filtering support +defflag opt_pppoe.h PPPOE_SERVER PPPOE_TERM_UNKNOWN_SESSIONS + +# networking options +# +defflag GATEWAY +defparam opt_nmbclusters.h NMBCLUSTERS +defparam SB_MAX + +# file system options +# +defflag opt_quota.h QUOTA QUOTA2 # XXX files.ufs? +defflag VNODE_LOCKDEBUG +defflag MAGICLINKS + +# buffer cache size options +# +defparam opt_bufcache.h BUFCACHE BUFPAGES + +# userconf +# +defflag USERCONF + +# sysctl related +# +defflag opt_sysctl.h SYSCTL_DISALLOW_CREATE SYSCTL_DISALLOW_KWRITE + SYSCTL_DEBUG_SETUP SYSCTL_DEBUG_CREATE + SYSCTL_INCLUDE_DESCR + +# +# Not entirely MI, but present on multiple arch's +# + +# PC-style MBR handling +# +defflag opt_mbr.h COMPAT_386BSD_MBRPART + +# +# debugging options +# +include "ddb/files.ddb" # in-kernel dynamic debugger + +defflag opt_kgdb.h KGDB +defparam opt_kgdb.h KGDB_DEV KGDB_DEVNAME KGDB_DEVPORT + KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE +defflag LOCKDEBUG +defflag SYSCALL_DEBUG +defflag opt_kstack.h KSTACK_CHECK_MAGIC + +# memory (ram) disk options +# +defflag opt_md.h MEMORY_DISK_HOOKS MEMORY_DISK_IS_ROOT + MEMORY_DISK_DYNAMIC +defparam opt_md.h MEMORY_DISK_SERVER=1 MEMORY_DISK_ROOT_SIZE + MEMORY_DISK_RBFLAGS +defparam opt_memory_disk_image.h makeoptions_MEMORY_DISK_IMAGE + +defflag opt_tftproot.h TFTPROOT TFTPROOT_DEBUG + +# Support for hardware performance monitoring counters +# +defflag opt_perfctrs.h PERFCTRS + +defflag opt_wlan.h WLAN + +# Machine-independent device majors assignements +include "conf/majors" + +# generic attributes +# +define videobus { } +define ata {[channel = -1]} +define sata +define sata_fis +define sata_pmp +define scsi_core +define scsi {[channel = -1]}: scsi_core +define ata_hl {[drive = -1]} +define atapi { } +define radiodev { } +define gpibdev {[address = -1]} +define gpiobus { } +define onewirebus { } +define pckbport {[slot = -1]} +define pckbport_machdep_cnattach +define firmload + +include "dev/files.audio" + +# High definition audio +include "dev/hdaudio/files.hdaudio" + +# Base verbose vendor/product printing support +file dev/dev_verbose.c + +# video devices, attaches to video hardware driver +# +device video +attach video at videobus + +# DTV subsystem +# +include "dev/dtv/files.dtv" + +# HDMI CEC +# +include "dev/hdmicec/files.hdmicec" + +# National Semiconductor LM7[89] +# +# (included here so files.i2c can define an attachment) + +device lm: sysmon_envsys +file dev/ic/nslm7x.c lm needs-flag + +# JEDEC standard SPD EPROM +# +# (included here so files.i2c can define an attachment) + +device spdmem +file dev/ic/spdmem.c spdmem + +# I2C device support +include "dev/i2c/files.i2c" + +# SPI device support +include "dev/spi/files.spi" + +# IR device support +include "dev/ir/files.ir" + +# Parallel Port Bus support +include "dev/ppbus/files.ppbus" + +# raster operations attributes +# +define rasops1 +define rasops2 +define rasops4 +define rasops8 +define rasops15 +define rasops16 +define rasops24 +define rasops32 +define rasops_rotation + +# image decoding support +include "dev/stbi/files.stbi" + +# splash screen support +include "dev/splash/files.splash" + +# videomode support +include "dev/videomode/files.videomode" + +# net device attributes - we have generic code for arc(net), ether(net), +# fddi, token ring, atm and eco(net). +# +define arcnet +define atm +define eco +define ether +define fddi +define hippi +define ieee1394 +define token +define sppp +define wlan +define crypto + +# TPM +device tpm +file dev/ic/tpm.c tpm needs-flag + +# devices ARPing IPv4 pull this in: +# +define arp + +# +# ALTQ network traffic shaping subsystem +# +include "altq/files.altq" + +# +# IPKDB kernel debugger +# +include "ipkdb/files.ipkdb" + +# Logical disk +# +device ld: disk +file dev/ld.c ld needs-flag + +# +# MII/PHY support for network devices +# +include "dev/mii/files.mii" + +# +# RAIDframe +# +include "dev/raidframe/files.raidframe" + +# +# Hardware-assisted data mover API +# +include "dev/dmover/files.dmover" + +# +# "Chipset" drivers. These are the bus-independent routines which +# contain the cfdrivers. Attachments are provided by files. +# + +# Adaptec AIC-6[32]60 ICs +# +device aic: scsi +file dev/ic/aic6360.c aic + +# SMC 93Cx6 Serial EEPROM devices +# +define smc93cx6 +file dev/ic/smc93cx6.c smc93cx6 + +# Adaptec 2[789]4X, 394X, aic7770 and aic78[5678]0 SCSI controllers +# +defparam opt_ahc.h AHC_DEBUG +defflag opt_ahc.h AHC_NO_TAGS +device ahc: scsi +define ahc_seeprom +define ahc_aic77xx +file dev/ic/aic7xxx.c ahc +file dev/ic/aic7xxx_osm.c ahc +file dev/ic/aic7xxx_seeprom.c ahc_seeprom +file dev/ic/aic77xx.c ahc_aic77xx + +# Adaptec aic79xx SCSI controllers +defflag opt_ahd.h AHD_DEBUG +device ahd: scsi +file dev/ic/aic79xx.c ahd +file dev/ic/aic79xx_osm.c ahd + +# DPT EATA SCSI controllers +# +device dpt: scsi +file dev/ic/dpt.c dpt + +# Compaq Smart ARRAY controllers +# +device cac {unit = -1} +file dev/ic/cac.c cac + +attach ld at cac with ld_cac +file dev/ic/ld_cac.c ld_cac + +# HP/Compaq Command Interface for SCSI-3 Support +# +device ciss: scsi +file dev/ic/ciss.c ciss + +# Mylex DAC960 RAID controllers +# +device mlx {unit = -1} +file dev/ic/mlx.c mlx needs-flag + +attach ld at mlx with ld_mlx +file dev/ic/ld_mlx.c ld_mlx + +# ICP-Vortex/Intel RAID controllers +# +device icp {unit = -1} +file dev/ic/icp.c icp needs-flag +file dev/ic/icp_ioctl.c icp + +attach ld at icp with ld_icp +file dev/ic/ld_icp.c ld_icp + +device icpsp: scsi +file dev/ic/icpsp.c icpsp +attach icpsp at icp + +# Adaptec FSA RAID controllers +# +device aac {unit = -1} +file dev/ic/aac.c aac + +attach ld at aac with ld_aac +file dev/ic/ld_aac.c ld_aac + +# AdvanSys 1200A, 1200B and ULTRA SCSI controllers +# +device adv: scsi +file dev/ic/adv.c adv +file dev/ic/advlib.c adv +file dev/ic/advmcode.c adv + +# AdvanSys ULTRA WIDE SCSI controllers +# +device adw: scsi +file dev/ic/adw.c adw + +# BusLogic MultiMaster and MultiMaster Ultra SCSI controllers +# (Must be declared before AHA to ensure bha probes before aha. +# Probing AHA first configures bhas as aha, via their AHA +# hardware-compatibility mode.) +# +device bha: scsi +file dev/ic/bha.c bha + +# Adaptec AHA-154x and AHA-164x controllers +# (must be after bha, see above) +# +device aha: scsi +file dev/ic/aha.c aha + +# Initio INIC-940/950 SCSI controllers +# +device iha: scsi +file dev/ic/iha.c iha + +# Qlogic ISP 10x0 SCSI Controllers +# +defflag opt_isp.h ISP_DISABLE_1020_SUPPORT + ISP_DISABLE_1080_SUPPORT + ISP_DISABLE_2100_SUPPORT + ISP_DISABLE_2200_SUPPORT + ISP_DISABLE_2300_SUPPORT + ISP_DISABLE_2322_SUPPORT + ISP_DISABLE_2400_SUPPORT + ISP_DISABLE_FW + ISP_TARGET_MODE +defparam opt_isp.h ISP_LOGDEFAULT + ISP_VPORTS +device isp: scsi +file dev/ic/isp.c isp +file dev/ic/isp_library.c isp +file dev/ic/isp_netbsd.c isp +file dev/ic/isp_target.c isp & isp_target_mode +# LSILogic MegaRAID SAS +# +device mfi: scsi +file dev/ic/mfi.c mfi + +# LSILogic Fusion-MPT I/O Processor SCSI/FC Controllers +# +device mpt: scsi +file dev/ic/mpt.c mpt +file dev/ic/mpt_debug.c mpt +file dev/ic/mpt_netbsd.c mpt + +# Workbit NinjaSCSI-32 controllers +device njs: scsi +file dev/ic/ninjascsi32.c njs + +# Symbios/NCR 53c700 SCSI controllers +device oosiop: scsi +file dev/ic/oosiop.c oosiop + +# Symbios/NCR 53c710 SCSI controllers +# +device osiop: scsi +file dev/ic/osiop.c osiop + +# common stuff for siop and esiop +# +define siop_common +file dev/ic/siop_common.c siop_common + +# Symbios/NCR 53c720/53c8xx SCSI controllers +# +device siop: scsi,siop_common +file dev/ic/siop.c siop & (siop_pci | siop_gedoens) +defflag opt_siop.h SIOP_SYMLED + +device esiop: scsi,siop_common +file dev/ic/esiop.c esiop + +# UltraStor SCSI controllers +# +device uha: scsi +file dev/ic/uha.c uha + +# 3Com common probe code +define elink +file dev/isa/elink.c elink + +# Aironet PC4500/PC4800 +# +device an: arp, wlan, ifnet +file dev/ic/an.c an + +# AMD 79c930-based 802.11 cards +# +device awi: arp, wlan, ifnet +file dev/ic/awi.c awi +file dev/ic/am79c930.c awi + +# Lucent & Intersil WaveLan IEEE (802.11) +# +device wi: arp, wlan, ifnet +file dev/ic/wi.c wi + +# Atheros HAL +# +include "external/isc/atheros_hal/conf/files.ath_hal" + +# Atheros 5210/5211/5212 multi-mode 802.11 +# +device ath: arp, wlan, ifnet +file dev/ic/ath.c ath +file dev/ic/ath_netbsd.c ath +file dev/ic/athrate-sample.c ath + +# ADMtek ADM8211 802.11 +# +device atw: arp, wlan, ifnet, smc93cx6 +file dev/ic/atw.c atw + +# Realtek RTL8180 802.11 +# +device rtw: arp, wlan, ifnet, smc93cx6 +file dev/ic/rtw.c rtw +file dev/ic/rtwphy.c rtw +file dev/ic/rtwphyio.c rtw + +# Ralink RT2500/RT2600 802.11 +device ral: arp, ether, ifnet, wlan, firmload +file dev/ic/rt2560.c ral +file dev/ic/rt2661.c ral + +# Marvell Libertas Open +device malo: arp, ether, ifnet, wlan, firmload +file dev/ic/malo.c malo + +# 3Com Etherlink-III Ethernet controller +# +device ep: arp, ether, ifnet, mii, mii_bitbang +file dev/ic/elink3.c ep + +# 3Com EtherLink XL Controller +# +device ex: arp, ether, ifnet, mii, mii_bitbang +file dev/ic/elinkxl.c ex + +# DEC EtherWORKS III (LEMAC) Ethernet controllers +# +device lc: arp, ether, ifnet +file dev/ic/lemac.c lc + +# LANCE and PCnet Ethernet controllers +# +device le: arp, ether, ifnet +define le24 +define le32 +file dev/ic/am7990.c le24 +file dev/ic/am79900.c le32 +file dev/ic/lance.c le24 | le32 + +# DEC DEPCA-family of LANCE Ethernet controllers +# +device depca { }: le24 +file dev/ic/depca.c depca +attach le at depca with le_depca + +# Sun HME Ethernet controllers +# +device hme: arp, ether, ifnet, mii +file dev/ic/hme.c hme + +# Sun GEM Ethernet controllers +# +device gem: arp, ether, ifnet, mii +file dev/ic/gem.c gem + +# Synopsis Designware GMAC core, as found on allwinner a20 +# and other SoCs +device awge: arp, ether, ifnet, mii +file dev/ic/dwc_gmac.c awge + +# 8390-family Ethernet controllers +# +defflag opt_ipkdb.h IPKDB_DP8390 +define dp8390nic +file dev/ic/dp8390.c dp8390nic | ipkdb_dp8390 + +# National Semiconductor DP83905 AT/LANTIC Ethernet media support +# +define dp83905 +file dev/ic/dp83905.c dp83905 + +# Macronix MX98905 Ethernet controller +# (use as an attribute for an "ne" bus attachment) +# +define mx98905 +file dev/ic/mx98905.c mx98905 + +# TROPIC Token-Ring controller +# +device tr: arp, token, ifnet +file dev/ic/tropic.c tr + +# NCR 5380 SCSI Bus Controller +# +define ncr5380sbc +file dev/ic/ncr5380sbc.c ncr5380sbc +device nca: scsi, ncr5380sbc + +# Sun sc PAL SCSI Bus Controller +# +define sunscpal +file dev/ic/sunscpal.c sunscpal +device ssc: scsi, sunscpal + +# DEC FDDI Chipset +# +define pdq +file dev/ic/pdq.c pdq +file dev/ic/pdq_ifsubr.c pdq + +# Cyclades Cyclom-8/16/32 +# +device cy: tty +file dev/ic/cy.c cy needs-flag + +# Efficient Networks, Inc. ATM interface +# +device en: atm, ifnet +file dev/ic/midway.c en + +# NCR 53x9x or Emulex ESP SCSI Controller +# +define ncr53c9x +device esp: scsi, ncr53c9x +file dev/ic/ncr53c9x.c ncr53c9x + +# Fujitsu MB87030/MB89352 SCSI Protocol Controller +device spc: scsi +file dev/ic/mb89352.c spc + +# Western Digital WD33C93/WD33C93A SCSI Bus Interface Controller +define wd33c93 +file dev/ic/wd33c93.c wd33c93 + +# Hitachi HD44780 LCD panel controller +define hd44780 +file dev/ic/hd44780_subr.c hd44780 +file dev/ic/lcdkp_subr.c hd44780 + +# Matrix keypad +define matrixkp +file dev/ic/matrixkp_subr.c matrixkp + +# Hitachi HD64570 serial controller +# +define hd64570 +file dev/ic/hd64570.c hd64570 + +# Riscom/N2 ISA/PCI Sync Serial Controller +# +device ntwoc: ifnet, hd64570 + +# Intel 82586 Ethernet Controller +# +define i82586 +file dev/ic/i82586.c i82586 + +# Intel 82596 Ethernet Controller +# +define i82596 +file dev/ic/i82596.c i82596 + +# Intel 82557/82558/82559 Ethernet Controller +# +device fxp: ether, ifnet, arp, mii +file dev/ic/i82557.c fxp + +# SEEQ 8005 Advanced Ethernet Data Link Controller +# +define seeq8005 +file dev/ic/seeq8005.c seeq8005 + +# SMC 91Cxx Ethernet Controller +# +device sm: arp, ether, ifnet, mii, mii_bitbang +file dev/ic/smc91cxx.c sm + +# SMC 83C170 EPIC/100 Fast Ethernet Controller +# +device epic: arp, ether, ifnet, mii +file dev/ic/smc83c170.c epic + +# DEC SGEC Second Generation Ethernet Controller +# +define sgec +file dev/ic/sgec.c sgec + +# MB86950 Ethernet Controller +# +define mb86950 +file dev/ic/mb86950.c mb86950 + +# MB8696x Ethernet Controller +# +define mb86960 +file dev/ic/mb86960.c mb86960 + +# Generic MB8696x Ethernet Controller driver +# +device mbe: arp, ether, ifnet, mb86960 + +# Interwave Am78C201 audio driver +# +define interwave +file dev/ic/interwave.c interwave + +# TMS 320av110 MPEG2/audio driver +# +define tms320av110 +file dev/ic/tms320av110.c tms320av110 + +# Novell NE2000-compatible Ethernet cards, based on the +# National Semiconductor DS8390. +# +defflag opt_ipkdb.h IPKDB_NE : IPKDB_DP8390 +device ne: ether, ifnet, arp, dp8390nic, mii +file dev/ic/ne2000.c ne | ipkdb_ne + +# 8250/16[45]50-based "com" ports +# +defflag opt_com.h COM_DEBUG +# XXX In a perfect world, this would be done with attributes +defflag opt_com.h COM_16650 COM_16750 + COM_HAYESP COM_PXA2X0 COM_AU1X00 + COM_REGMAP COM_FUNCMAP +defparam opt_com.h COM_TOLERANCE +device com { } : tty +file dev/ic/com.c com needs-flag + +# PC-like keyboard controller +# +device pckbc: pckbport +file dev/ic/pckbc.c pckbc needs-flag + +device attimer +file dev/ic/attimer.c attimer needs-flag + +# Cirrus Logic CD240[01] 4-port Multi-Protocol Communications Controller +# +device clmpcc: tty +file dev/ic/clmpcc.c clmpcc needs-flag + +# Abit uGuru +# +device ug: sysmon_envsys +file dev/ic/ug.c ug needs-flag + +# Essential Communications Corp. HIPPI Interface +# +device esh: hippi, ifnet +file dev/ic/rrunner.c esh needs-flag + +# SMC 90c26, SMC 90C56 (and 90C66 if in compat mode) chip driver +# +device bah: ifnet, arcnet, arp +file dev/ic/smc90cx6.c bah + +# OPL2/OPL3 FM synth driver +# +device opl: midibus, midisyn +file dev/ic/opl.c opl +file dev/ic/oplinstrs.c opl + +# MPU401 MIDI UART compatibles +# +device mpu: midibus +file dev/ic/mpu.c mpu needs-flag + +# AD1848 (CS4248, CS4231, AD1845) audio codec support; used by other drivers +# +define ad1848 +file dev/ic/ad1848.c ad1848 + +# AMD 7930 audio/ISDN codec +# +define am7930 +file dev/ic/am7930.c am7930 + +# Siemens PSB2160 audio codec, as found in HP systems +device arcofi: audiobus, auconv, mulaw +file dev/ic/arcofi.c arcofi + +# SPARC `SUNW,audiocs' +# +device audiocs: audiobus, auconv, ad1848 +file dev/ic/cs4231.c audiocs + +# AC-97 CODECs +# +define ac97 +file dev/ic/ac97.c ac97 + +# UDA1341 CODEC support +define uda1341 +file dev/ic/uda1341.c uda1341 + +# Oki MSM6258 support code +# +define msm6258 +file dev/ic/msm6258.c msm6258 + +# LSI64854 DMA controller back-end +# +define lsi64854 +file dev/ic/lsi64854.c lsi64854 + +# Cirrus Logic CL-CD180/1864/1865 multi port serial controller back-end +# +define cd18xx +file dev/ic/cd18xx.c cd18xx + +# Realtek 8019/8029 NE2000-compatible network interface subroutines +# +define rtl80x9 +file dev/ic/rtl80x9.c rtl80x9 needs-flag + +# Realtek 8129/8139 Ethernet controllers +# +device rtk: ether, ifnet, arp, mii +file dev/ic/rtl81x9.c rtk | re + +# Realtek 8169 Ethernet controllers +# +device re: ether, ifnet, arp, mii +file dev/ic/rtl8169.c re + +# Common code for ESDI/IDE/etc. controllers +# +define wdc_common +define ata_dma +define ata_udma +define ata_piobm +device wdc: ata, wdc_common + +defflag opt_ata.h ATADEBUG +defparam opt_ata.h ATADEBUG_MASK +defflag opt_wdc.h WDC_NO_IDS + +device atabus: atapi,ata_hl +attach atabus at ata +# The strange expression is to dump ata_* definitions to ata_dma.h. +file dev/ic/wdc.c (ata_dma | ata_udma | ata_piobm | atabus) & atabus & wdc_common needs-flag + +# Workbit NinjaATA-32 IDE controllers +device njata: ata, ata_piobm, wdc_common +file dev/ic/ninjaata32.c njata + +# CHIPS and Technologies 82C7[12][01] Universal Peripheral Controller +# +device upc { [offset = -1] } +attach wdc at upc with wdc_upc +attach com at upc with com_upc +attach lpt at upc with lpt_upc +file dev/ic/upc.c upc +file dev/ic/wdc_upc.c wdc_upc +file dev/ic/com_upc.c com_upc +file dev/ic/lpt_upc.c lpt_upc + +# AHCI-compatible SATA controllers +define ahcisata_core +file dev/ic/ahcisata_core.c ahcisata_core +device ahcisata: ata, ata_dma, ata_udma, sata, sata_fis, sata_pmp, ahcisata_core + +# Silicon Image SteelVine SATA-II controllers +define siisata +file dev/ic/siisata.c siisata +device siisata: ata, ata_dma, ata_udma, sata, sata_fis, sata_pmp, siisata + +# Marvell Serial-ATA Host Controller +define mvsata +file dev/ic/mvsata.c mvsata +device mvsata: ata, ata_dma, ata_udma, wdc_common, sata, sata_pmp, mvsata +defflag opt_mvsata.h MVSATA_WITHOUTDMA + +# DECchip 21x4x Ethernet controller family, and assorted clones. +# +device tlp: arp, ether, ifnet, mii, mii_bitbang +file dev/ic/tulip.c tlp + +# Adaptec AIC-6915 Ethernet interface +# +device sf: arp, ether, ifnet, mii +file dev/ic/aic6915.c sf + +# Mostek time-of-day clock and NVRAM +# +define mk48txx +file dev/ic/mk48txx.c mk48txx + +# OKI MSM6242B +# +define msm6242b +file dev/ic/msm6242b.c msm6242b + +# Intersil 7170 time-of-day clock +# +define intersil7170 +file dev/ic/intersil7170.c intersil7170 + +# National Semiconductor MM58167 time-of-day clock +# +define mm58167 +file dev/ic/mm58167.c mm58167 + +# Motorola mc146818 (and compatible) time-of-day clock +# +define mc146818 +file dev/ic/mc146818.c mc146818 + +# Ricoh RS5C313 time of-day-clock +# +define rs5c313 +file dev/ic/rs5c313.c rs5c313 + +# D-Link DL10019/10022 NE2000-compatible network interface subroutines +# +define dl10019 +file dev/ic/dl10019.c dl10019 + +# ASIX AX88190 NE2000-compatible network interface subroutines +# +define ax88190 +file dev/ic/ax88190.c ax88190 + +# WD/SMC 80x3 family, SMC Elite Ultra [8216], SMC EtherEZ +# +device we: ether, ifnet, arp, dp8390nic +file dev/ic/we.c we + +# Allied-Telesis Ethernet driver based on Fujitsu MB8696xA controllers +# +device ate: arp, ether, ifnet, mb86960 + +# Fujitsu FMV-18x Ethernet driver based on Fujitsu MB8696xA controllers +# +device fmv: arp, ether, ifnet, mb86960 +file dev/ic/fmv.c fmv + +# Crystal Semiconductor CS8900, CS8920, and CS8920M Ethernet +# +device cs: arp, ether, ifnet +device tscs: arp, ether, ifnet +file dev/ic/cs89x0.c cs | tscs + +# Radio device attributes +# +define tea5757 +file dev/ic/tea5757.c tea5757 +define lm700x +file dev/ic/lm700x.c lm700x + +# Philips PCF8584 i2c controller +define pcf8584 +file dev/ic/pcf8584.c pcf8584 + +# PCA9564 i2c controller +define pca9564 +file dev/ic/pca9564.c pca9564 + +# ACPI power management timer (hardware access, independent of ACPI) +# +define acpipmtimer +file dev/ic/acpipmtimer.c acpipmtimer + +device hpet +file dev/ic/hpet.c hpet needs-flag + +# DesignWare timer +device dwctmr +file dev/ic/dwc_tmr.c dwctmr + +# SMSC LAN9118 Family Ethernet Controller +# +device smsh: arp, ether, ifnet, mii +file dev/ic/lan9118.c smsh + +# Apple System Management Controller +# +define applesmcbus { } +device applesmc: applesmcbus +file dev/ic/apple_smc.c applesmc + +# Apple SMC fan sensors and control +device applesmcfan: applesmcbus, sysmon_envsys +attach applesmcfan at applesmcbus with apple_smc_fan +file dev/ic/apple_smc_fan.c applesmcfan + +# Apple SMC temperature sensors +device applesmctemp: applesmcbus, sysmon_envsys +attach applesmctemp at applesmcbus with apple_smc_temp +file dev/ic/apple_smc_temp.c applesmctemp + +# Apple SMC accelerometer (not yet implemented!) +#device applesmcaccel: applesmcbus, sysmon_envsys +#attach applesmcaccel at applesmcbus with apple_smc_accel +#file dev/ic/apple_smc_accel.c applesmcaccel + +# DRM - Direct Rendering Infrastructure: dev/drm +define drm {} +include "external/bsd/drm/conf/files.drm" +include "dev/drm/files.drm" + +# DRM/KMS - Newer direct rendering manager with kernel mode-switching +include "external/bsd/drm2/drm/files.drmkms" + + +# Definitions for wscons +# device attributes: display, display with emulator, keyboard, and mouse +# +define wsdisplaydev {[kbdmux = 1]} +define wsemuldisplaydev {[console = -1], [kbdmux = 1]} +define wskbddev {[console = -1], [mux = 1]} +define wsmousedev {[mux = 0]} +define vcons +# attribute to pull in raster support +# +define wsrasteremulops +# common PC display functions +# +defflag opt_pcdisplay.h PCDISPLAY_SOFTCURSOR +define pcdisplayops +file dev/ic/pcdisplay_subr.c pcdisplayops +file dev/ic/pcdisplay_chars.c pcdisplayops +# an attribute used by arch specific config files to include /dev/fb* (or +# equivalent) support - on most archs this is just a NOP (untill, maybe +# someday when we might make /dev/fb* support MI) +define fb +# VGA graphics +# +defparam opt_vga.h VGA_CONSOLE_SCREENTYPE +defflag opt_vga.h VGA_CONSOLE_ATI_BROKEN_FONTSEL +defflag opt_vga.h VGA_RASTERCONSOLE +defflag opt_vga.h VGA_RESET +device vga: displaydev, wsemuldisplaydev, pcdisplayops, drm +file dev/ic/vga.c vga & !vga_rasterconsole needs-flag +file dev/ic/vga_raster.c vga_rasterconsole needs-flag +file dev/ic/vga_subr.c vga | vga_rasterconsole +file dev/ic/vga_common.c vga | vga_rasterconsole + +# Integraphics Systems IGA168x and CyberPro framebuffers (linear non-VGA mode) +# +device igsfb: wsemuldisplaydev, rasops8, vcons, videomode +file dev/ic/igsfb.c igsfb needs-flag +file dev/ic/igsfb_subr.c igsfb + +device chipsfb: wsemuldisplaydev, rasops8, vcons, videomode +file dev/ic/ct65550.c chipsfb +defflag opt_chipsfb.h CHIPSFB_DEBUG +defflag opt_chipsfb.h CHIPSFB_WAIT + +# STI (hp graphics) +device sti: wsemuldisplaydev +file dev/ic/sti.c sti + +include "dev/wscons/files.wscons" +include "dev/rasops/files.rasops" +include "dev/wsfont/files.wsfont" +include "dev/wsfb/files.wsfb" + +# Attributes which machine-independent bus support can be attached to. +# These should be defined here, because some of these busses can have +# devices which provide these attributes, and we'd like to avoid hairy +# ordering constraints on inclusion of the busses' "files" files. +# +define isabus { } # ISA attachment +define eisabus { } # EISA attachment +define pcibus {[bus = -1]} # PCI attachment +define tcbus { } # TurboChannel attachment +define mcabus { } # MicroChannel attachment +define usbus { } # USB attachment +define fwbus { } # IEEE 1394 attachment +define vmebus { } # VME bus attachment +define acpibus { } # ACPI "bus" attachment +define pcmciabus { [controller = -1], [socket = -1]} # PCMCIA bus attachment +define cbbus { } # CardBus attachment +define pcmciaslot { } # PCMCIA slot itself +define sdmmcbus { } # SD/MMC attachment + +# We need the USB bus controllers here so different busses can +# use them in an 'attach-with'. +# + +defparam USB_MEM_RESERVE + +define usbroothub +file dev/usb/usbroothub_subr.c usbroothub + +define usb_dma + +# UHCI USB controller +# +device uhci: usbus, usbroothub, usb_dma +file dev/usb/uhci.c uhci needs-flag + +# OHCI USB controller +# +device ohci: usbus, usbroothub, usb_dma +file dev/usb/ohci.c ohci needs-flag + +# EHCI USB2 controller +# +device ehci: usbus, usbroothub, usb_dma +file dev/usb/ehci.c ehci needs-flag + +# xHCI USB3 controller +# +device xhci: usbus, usbroothub, usb_dma +file dev/usb/xhci.c xhci needs-flag + +# Mentor graphics OTG IP +defflag opt_motg.h MOTG_ALLWINNER +device motg: usbus, usbroothub, usb_dma +file dev/usb/motg.c motg needs-flag + +# SL811HS/T USB controller +defflag opt_slhci.h SLHCI_DEBUG SLHCI_TRY_LSVH SLHCI_PROFILE_TRANSFER +device slhci: usbus, usbroothub +file dev/ic/sl811hs.c slhci needs-flag + +# DesignWare OTG host controller +# +include "external/bsd/dwc2/conf/files.dwc2" + +# USB HID processing (as used by bluetooth and usb code) +define hid +file dev/usb/hid.c hid + +# SD Host controller +device sdhc: sdmmcbus +file dev/sdmmc/sdhc.c sdhc needs-flag + +# Winbond Integrated Media Reader +device wb: sdmmcbus +file dev/ic/w83l518d.c wb +file dev/ic/w83l518d_sdmmc.c wb + +# Realtek RTS5209/RTS5229 Card Reader +device rtsx: sdmmcbus +file dev/ic/rtsx.c rtsx + +# DesignWare SD/MMC host controller +defflag opt_dwc_mmc.h DWC_MMC_DEBUG +device dwcmmc: sdmmcbus +file dev/ic/dwc_mmc.c dwcmmc + +# ARM PrimeCell PL181 (MMCI) host controller +device plmmc: sdmmcbus +file dev/ic/pl181.c plmmc + +# Myson MTD803 3-in-1 Fast Ethernet Controller +device mtd: arp, ether, ifnet, mii +file dev/ic/mtd803.c mtd + +# radio devices, attaches to radio hardware driver +device radio +attach radio at radiodev + +# IEEE 1394 controllers +# (These need to be here since it will have both PCI and CardBus attachments) +# +device fwohci: fwbus + +# Sony Programmable I/O Controller +device spic: wsmousedev +file dev/ic/spic.c spic + +# IBM CPC700 PowerPC bridge +define cpcbus { addr, [irq=-1] } +device cpc: cpcbus, pcibus +file dev/ic/cpc700.c cpc + +attach com at cpcbus with com_cpcbus +file dev/ic/com_cpcbus.c com_cpcbus + +device cpctim +attach cpctim at cpcbus +file dev/ic/timer_cpcbus.c cpctim + +device cpciic +attach cpciic at cpcbus with iic_cpcbus +file dev/ic/iic_cpcbus.c iic_cpcbus + + +# Attributes used by the ISDN subsystem +# +define isdndev # the ISDN subsystem +define passive_isdn # files needed by passive cards (XXX - protocol + # specific) +define isdncapi # ISDN CAPI (http://www.capi.org/) + +# The isac found on the Fritz V2.0 Card. +define nisacsx +file dev/ic/isacsx.c nisacsx needs-flag + +# The 'standard' isac +define nisac +file dev/ic/isac.c nisac needs-flag + +# ISDN cards based on the Siemens ISAC/HSCX chipset (or lookalikes) +# +device isic: isdndev, passive_isdn, nisac + +file dev/ic/isic.c isic +file dev/ic/isic_l1.c isic|ifpci|ifritz +file dev/ic/isic_l1fsm.c isic|ifpci|ifritz +file dev/ic/hscx.c isic +file dev/ic/isic_bchan.c isic + +# (old) Diehl active ISDN cards +# +#device daic: isdndev +#file dev/ic/daic.c daic + +# AWM B1/T1 +# XXX: passive_isdn +device iavc: isdndev, isdncapi, passive_isdn +file dev/ic/iavc.c iavc + +# Broadcom AirForce / Apple Airport Extreme +device bwi: arp, ifnet, firmload, wlan +file dev/ic/bwi.c bwi + +# DM9000 Ethernet controllers +# +device dme: arp, ether, ifnet +file dev/ic/dm9000.c dme + +# legitimate pseudo-devices +# +defpseudodev vnd: disk +defflag opt_vnd.h VND_COMPRESSION +defpseudo ccd: disk +defpseudodev cgd: disk, des, blowfish, cast128 +defpseudodev md: disk +defpseudodev fss: disk + +defpseudo pty: tty +defpseudo rnd +defpseudo ksyms +defpseudo nullcons +defpseudo lockstat +defpseudo bio: sysmon_envsys + +defpseudo loop: ifnet +defpseudo sl: ifnet +defpseudo ppp: ifnet, bpf_filter +defpseudo pppoe: ifnet, ether, sppp +defpseudo sppp: ifnet +defpseudo tun: ifnet +defpseudo vlan: ifnet, ether +defpseudo bridge: ifnet, ether +defpseudo bpfilter: ifnet, bpf_filter +defpseudo strip: ifnet +defpseudo gre: ifnet +defpseudo gif: ifnet +defpseudo faith: ifnet +defpseudo ifmpls: ifnet +defpseudo srt: ifnet +defpseudo stf: ifnet +defpseudodev tap: ifnet, ether, arp +defpseudo carp: ifnet, ether, arp +defpseudodev etherip: ifnet, ether, arp + +defpseudo sequencer +defpseudo clockctl + +# +# Accept filters. XXX should use another registration/initialization method. +# +defpseudo accf_data +defpseudo accf_http + +# ISDN userland pseudo devices +# +defpseudo isdntrc: isdndev, tty +defpseudo isdnbchan: isdndev, tty +defpseudo isdntel: isdndev, tty +defpseudo isdnctl: isdndev, tty +defpseudo isdn: isdndev, tty + +# ISDN network interfaces +defpseudo irip: isdndev, ifnet +defflag opt_irip.h IRIP_VJ +defpseudo ippp: isdndev, sppp, ifnet + +# KTTCP network throughput testing pseudo-device +defpseudo kttcp +file dev/kttcp.c kttcp needs-flag + +# Veriexec +defpseudo veriexec +file kern/kern_veriexec.c veriexec +file dev/verified_exec.c veriexec needs-flag + +# driver attach / detach user interface +defpseudo drvctl +file kern/kern_drvctl.c drvctl needs-flag + +# cpu control +defpseudo cpuctl +defflag CPU_UCODE: firmload + +# pass-to-userspace transporter +defpseudo putter +file dev/putter/putter.c putter + +# userspace block/char device drivers +defpseudo pud +file dev/pud/pud.c pud +file dev/pud/pud_dev.c pud + +# device-mapper driver for LVM +include "dev/dm/files.dm" + +# +# File systems +# +include "coda/files.coda" +include "fs/adosfs/files.adosfs" +include "fs/cd9660/files.cd9660" +include "fs/efs/files.efs" +include "fs/filecorefs/files.filecorefs" +include "fs/hfs/files.hfs" +include "fs/msdosfs/files.msdosfs" +include "fs/nilfs/files.nilfs" +include "fs/ntfs/files.ntfs" +include "fs/ptyfs/files.ptyfs" +include "fs/puffs/files.puffs" +include "fs/udf/files.udf" +include "fs/smbfs/files.smbfs" +include "fs/sysvbfs/files.sysvbfs" +include "fs/tmpfs/files.tmpfs" +include "fs/union/files.union" +include "fs/v7fs/files.v7fs" +include "miscfs/fdesc/files.fdesc" +include "miscfs/kernfs/files.kernfs" +include "miscfs/nullfs/files.nullfs" +include "miscfs/overlay/files.overlay" +include "miscfs/procfs/files.procfs" +include "miscfs/umapfs/files.umapfs" +include "nfs/files.nfs" +include "ufs/files.ufs" + +# +# UVM (virtual memory) +# +include "uvm/files.uvm" + +# +# Security models +# +include "secmodel/files.secmodel" + +include "kern/files.kern" + +include "dev/files.dev" + +include "net/files.net" + +# Game adapter (joystick) +device joy +file dev/ic/joy.c joy needs-flag + +# process monitor for make(1) +# normally built as module +defpseudo filemon +file dev/filemon/filemon.c filemon +file dev/filemon/filemon_wrapper.c filemon + +# +# General Purpose Input/Output framework +# +define onewire_bitbang +include "dev/gpio/files.gpio" + +include "dev/onewire/files.onewire" + +# +# Pseudo audio device +# +include "dev/pad/files.pad" + +# +# Intel 386 Real Mode emulator +# +include "lib/libx86emu/files.x86emu" + +# +# "tprof" profiler. +# +include "dev/tprof/files.tprof" + +# +# alternate memory device +# +include "dev/altmem/files.altmem" + +# +# Flash subsystem +# +include "dev/flash/files.flash" + +# +# NAND subsytem +# +include "dev/nand/files.nand" + +# +# NOR subsytem +# +include "dev/nor/files.nor" + +# +# iscsi +# +include "dev/iscsi/files.iscsi" + +# +# athn +# +include "dev/ic/files.athn" diff --git a/sys/dev/cgd.c b/sys/dev/cgd.c index 35bfeebfc..73eb365c6 100644 --- a/sys/dev/cgd.c +++ b/sys/dev/cgd.c @@ -130,6 +130,10 @@ CFATTACH_DECL3_NEW(cgd, sizeof(struct cgd_softc), cgd_match, cgd_attach, cgd_detach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN); extern struct cfdriver cgd_cd; +#if defined(__minix) +void cgdattach(int); +#endif + /* DIAGNOSTIC and DEBUG definitions */ #if defined(CGDDEBUG) && !defined(DEBUG) diff --git a/sys/dev/dm/device-mapper.c b/sys/dev/dm/device-mapper.c index 41a80ed7b..3fe8fa2ed 100644 --- a/sys/dev/dm/device-mapper.c +++ b/sys/dev/dm/device-mapper.c @@ -111,6 +111,10 @@ CFATTACH_DECL3_NEW(dm, 0, dm_match, dm_attach, dm_detach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN); +#if defined(__minix) +void dmattach(int); +#endif + extern struct cfdriver dm_cd; extern uint32_t dm_dev_counter; diff --git a/sys/dev/fss.c b/sys/dev/fss.c index c76d86edf..73cc62624 100644 --- a/sys/dev/fss.c +++ b/sys/dev/fss.c @@ -132,6 +132,10 @@ CFATTACH_DECL_NEW(fss, sizeof(struct fss_softc), fss_match, fss_attach, fss_detach, NULL); extern struct cfdriver fss_cd; +#if defined(__minix) +void fssattach(int); +#endif + void fssattach(int num) { diff --git a/sys/dev/md.c b/sys/dev/md.c index 5d0f4a682..8b1782393 100644 --- a/sys/dev/md.c +++ b/sys/dev/md.c @@ -139,6 +139,10 @@ extern struct cfdriver md_cd; CFATTACH_DECL3_NEW(md, sizeof(struct md_softc), 0, md_attach, md_detach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN); +#if defined(__minix) +void mdattach(int); +#endif + static kmutex_t md_device_lock; /* Protect unit creation / deletion. */ extern size_t md_root_size; diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c index 83e021974..61bea7b82 100644 --- a/sys/dev/raidframe/rf_netbsdkintf.c +++ b/sys/dev/raidframe/rf_netbsdkintf.c @@ -322,6 +322,10 @@ int rf_have_enough_components(RF_ConfigSet_t *); struct raid_softc *rf_auto_config_set(RF_ConfigSet_t *); static void rf_fix_old_label_size(RF_ComponentLabel_t *, uint64_t); +#if defined(__minix) +void raidattach(int); +#endif + /* * Debugging, mostly. Set to 0 to not allow autoconfig to take place. * Note that this is overridden by having RAID_AUTOCONFIG as an option diff --git a/sys/dev/rndpseudo.c b/sys/dev/rndpseudo.c index 77d74731c..46518e5db 100644 --- a/sys/dev/rndpseudo.c +++ b/sys/dev/rndpseudo.c @@ -151,6 +151,10 @@ static struct evcnt rndpseudo_hard = EVCNT_INITIALIZER(EVCNT_TYPE_MISC, EVCNT_ATTACH_STATIC(rndpseudo_soft); EVCNT_ATTACH_STATIC(rndpseudo_hard); +#if defined(__minix) +void rndattach(int); +#endif + /* * Generate a 32-bit counter. */ diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index 872bd8511..6d1098814 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -230,6 +230,10 @@ CFATTACH_DECL3_NEW(vnd, sizeof(struct vnd_softc), vnd_match, vnd_attach, vnd_detach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN); extern struct cfdriver vnd_cd; +#if defined(__minix) +void vndattach(int); +#endif + static struct vnd_softc *vnd_spawn(int); int vnd_destroy(device_t); diff --git a/sys/kern/kern_drvctl.c b/sys/kern/kern_drvctl.c index 25a515c22..9744443bd 100644 --- a/sys/kern/kern_drvctl.c +++ b/sys/kern/kern_drvctl.c @@ -108,6 +108,10 @@ static const struct fileops drvctl_fileops = { static int drvctl_command(struct lwp *, struct plistref *, u_long, int); static int drvctl_getevent(struct lwp *, struct plistref *, u_long, int); +#if defined(__minix) +void drvctlattach(int); +#endif + void drvctl_init(void) { diff --git a/sys/netsmb/smb_dev.c b/sys/netsmb/smb_dev.c index 21db71d1f..059cb1a34 100644 --- a/sys/netsmb/smb_dev.c +++ b/sys/netsmb/smb_dev.c @@ -104,6 +104,10 @@ const struct cdevsw nsmb_cdevsw = { static bool nsmb_inited = false; +#if defined(__minix) +void nsmbattach(int); +#endif + void nsmbattach(int num) { diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c index 006b125ff..5691fd2f1 100644 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -197,6 +197,10 @@ static int cryptodev_getstatus(struct fcrypt *, struct crypt_result *); extern int ocryptof_ioctl(struct file *, u_long, void *); #endif +#if defined(__minix) +void cryptoattach(int); +#endif + /* * sysctl-able control variables for /dev/crypto now defined in crypto.c: * crypto_usercrypto, crypto_userasmcrypto, crypto_devallowsoft. diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c index 06ccc30c1..e98c1f5ad 100644 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -77,6 +77,10 @@ static int swcr_process(void *, struct cryptop *, int); static int swcr_newsession(void *, u_int32_t *, struct cryptoini *); static int swcr_freesession(void *, u_int64_t); +#if defined(__minix) +void swcryptoattach(int); +#endif + /* * Apply a symmetric encryption/decryption algorithm. */ diff --git a/sys/rump/Makefile b/sys/rump/Makefile index ee01cd338..a959f0706 100644 --- a/sys/rump/Makefile +++ b/sys/rump/Makefile @@ -3,7 +3,7 @@ SUBDIR= include SUBDIR+= librump -SUBDIR+= fs kern net +SUBDIR+= dev fs kern net #SUBDIR+= share .include diff --git a/sys/rump/dev/Makefile b/sys/rump/dev/Makefile new file mode 100644 index 000000000..b50bad263 --- /dev/null +++ b/sys/rump/dev/Makefile @@ -0,0 +1,6 @@ +# $NetBSD: Makefile,v 1.1 2009/06/09 16:16:14 pooka Exp $ +# + +SUBDIR= lib + +.include diff --git a/sys/rump/dev/Makefile.rumpdevcomp b/sys/rump/dev/Makefile.rumpdevcomp new file mode 100644 index 000000000..54174921b --- /dev/null +++ b/sys/rump/dev/Makefile.rumpdevcomp @@ -0,0 +1,29 @@ +# $NetBSD: Makefile.rumpdevcomp,v 1.21 2015/06/03 14:06:19 pooka Exp $ +# + +RUMPDEVCOMP= audio bpf cgd disk dm drvctl fss md netsmb \ + pad pud putter raidframe rnd sysmon vnd \ + opencrypto + +RUMPUSBDEVS= ugenhc ulpt umass + +RUMPPCIDEVS= pci pci_if_iwn pci_if_pcn pci_if_wm +RUMPPCIDEVS+= pci_usbhc +RUMPPCIDEVS+= pci_virtio virtio_if_vioif virtio_ld virtio_viornd +RUMPPCIDEVS+= audio_ac97 pci_auich pci_eap pci_hdaudio hdaudio_hdafg +# Not really a PCI device, but .... +RUMPPCIDEVS+= miiphy + +.for var in ${RUMPDEVCOMP} +RUMPDEVLIBS+=lib${var} +RUMPDEVLDADD+=-lrumpdev_${var} +.endfor + +.for var in ${RUMPUSBDEVS} +RUMPDEVLIBS+=lib${var} +.endfor + +# Currently no NetBSD host support. +#.for var in ${RUMPPCIDEVS} +#RUMPDEVLIBS+=lib${var} +#.endfor diff --git a/sys/rump/dev/files.rump b/sys/rump/dev/files.rump new file mode 100644 index 000000000..9b68b541a --- /dev/null +++ b/sys/rump/dev/files.rump @@ -0,0 +1,11 @@ +# $NetBSD: files.rump,v 1.4 2013/09/17 00:50:19 pooka Exp $ +# + +device mainbus { }: pcibus +attach mainbus at root + +device ugenhc: usbus, usbroothub +attach ugenhc at mainbus + +device scsitest: scsi +attach scsitest at mainbus diff --git a/sys/rump/dev/lib/Makefile b/sys/rump/dev/lib/Makefile new file mode 100644 index 000000000..6d186b399 --- /dev/null +++ b/sys/rump/dev/lib/Makefile @@ -0,0 +1,8 @@ +# $NetBSD: Makefile,v 1.2 2010/12/05 16:53:46 pooka Exp $ +# + +.include "${.CURDIR}/../Makefile.rumpdevcomp" + +SUBDIR+= ${RUMPDEVLIBS} + +.include diff --git a/sys/rump/dev/lib/Makefile.inc b/sys/rump/dev/lib/Makefile.inc new file mode 100644 index 000000000..9a916bfce --- /dev/null +++ b/sys/rump/dev/lib/Makefile.inc @@ -0,0 +1,7 @@ +# $NetBSD: Makefile.inc,v 1.4 2015/08/24 23:01:58 pooka Exp $ +# + +RUMPTOP= ${.CURDIR}/../../.. +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpdev + +.include "${RUMPTOP}/Makefile.rump" diff --git a/sys/rump/dev/lib/libaudio/AUDIO.ioconf b/sys/rump/dev/lib/libaudio/AUDIO.ioconf new file mode 100644 index 000000000..8d348909c --- /dev/null +++ b/sys/rump/dev/lib/libaudio/AUDIO.ioconf @@ -0,0 +1,10 @@ +# $NetBSD: AUDIO.ioconf,v 1.1 2010/05/01 23:19:56 pooka Exp $ +# + +ioconf audio + +include "conf/files" + +pseudo-root audiobus* + +audio* at audiobus? diff --git a/sys/rump/dev/lib/libaudio/Makefile b/sys/rump/dev/lib/libaudio/Makefile new file mode 100644 index 000000000..343494353 --- /dev/null +++ b/sys/rump/dev/lib/libaudio/Makefile @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.3 2014/11/18 04:29:06 nonaka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev + +LIB= rumpdev_audio +IOCONF= AUDIO.ioconf + +SRCS= audio.c auconv.c aurateconv.c auvolconv.c mulaw.c +SRCS+= audio_component.c + +CPPFLAGS+= -I${.CURDIR}/../../../librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libaudio/audio.h b/sys/rump/dev/lib/libaudio/audio.h new file mode 100644 index 000000000..8f21ca8a4 --- /dev/null +++ b/sys/rump/dev/lib/libaudio/audio.h @@ -0,0 +1,3 @@ +/* $NetBSD: audio.h,v 1.1 2010/05/01 23:19:56 pooka Exp $ */ + +#define NAUDIO 1 diff --git a/sys/rump/dev/lib/libaudio/audio_component.c b/sys/rump/dev/lib/libaudio/audio_component.c new file mode 100644 index 000000000..3207acdbb --- /dev/null +++ b/sys/rump/dev/lib/libaudio/audio_component.c @@ -0,0 +1,77 @@ +/* $NetBSD: audio_component.c,v 1.2 2015/06/08 12:18:04 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: audio_component.c,v 1.2 2015/06/08 12:18:04 pooka Exp $"); + +#include +#include +#include +#include +#include + +#include + +#include "ioconf.c" + +#include "rump_private.h" +#include "rump_vfs_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern const struct cdevsw audio_cdevsw; + devmajor_t bmaj, cmaj; + int error; + + config_init_component(cfdriver_ioconf_audio, + cfattach_ioconf_audio, cfdata_ioconf_audio); + + bmaj = cmaj = NODEVMAJOR; + if ((error = devsw_attach("audio", NULL, &bmaj, + &audio_cdevsw, &cmaj)) != 0) + panic("audio devsw attach failed: %d", error); + if ((error = rump_vfs_makedevnodes(S_IFCHR, "/dev/audio", '0', + cmaj, AUDIO_DEVICE, 4)) !=0) + panic("cannot create audio device nodes: %d", error); + if ((error = rump_vfs_makesymlink("audio0", "/dev/audio")) != 0) + panic("cannot create audio symlink: %d", error); + if ((error = rump_vfs_makedevnodes(S_IFCHR, "/dev/sound", '0', + cmaj, SOUND_DEVICE, 4)) !=0) + panic("cannot create sound device nodes: %d", error); + if ((error = rump_vfs_makesymlink("sound0", "/dev/sound")) != 0) + panic("cannot create sound symlink: %d", error); + if ((error = rump_vfs_makedevnodes(S_IFCHR, "/dev/audioctl", '0', + cmaj, AUDIOCTL_DEVICE, 4)) !=0) + panic("cannot create audioctl device nodes: %d", error); + if ((error = rump_vfs_makesymlink("audioctl0", "/dev/audioctl")) != 0) + panic("cannot create audioctl symlink: %d", error); + if ((error = rump_vfs_makedevnodes(S_IFCHR, "/dev/mixer", '0', + cmaj, MIXER_DEVICE, 4)) !=0) + panic("cannot create mixer device nodes: %d", error); + if ((error = rump_vfs_makesymlink("mixer0", "/dev/mixer")) != 0) + panic("cannot create mixer symlink: %d", error); +} diff --git a/sys/rump/dev/lib/libaudio/aurateconv.h b/sys/rump/dev/lib/libaudio/aurateconv.h new file mode 100644 index 000000000..7bce23d37 --- /dev/null +++ b/sys/rump/dev/lib/libaudio/aurateconv.h @@ -0,0 +1,3 @@ +/* $NetBSD: aurateconv.h,v 1.1 2010/05/01 23:19:56 pooka Exp $ */ + +#define NAURATECONV 1 diff --git a/sys/rump/dev/lib/libaudio/i386 b/sys/rump/dev/lib/libaudio/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libaudio/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libaudio/ioconf.c b/sys/rump/dev/lib/libaudio/ioconf.c new file mode 100644 index 000000000..0ef8d1cdd --- /dev/null +++ b/sys/rump/dev/lib/libaudio/ioconf.c @@ -0,0 +1,32 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libaudio/AUDIO.ioconf" + */ + +#include +#include +#include +#include + + + +static struct cfdriver * const cfdriver_ioconf_audio[] = { + NULL +}; + + + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_audio[] = { + /* driver attachment unit state loc flags pspec */ + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + + +static const struct cfattachinit cfattach_ioconf_audio[] = { + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libaudio/ioconf.h b/sys/rump/dev/lib/libaudio/ioconf.h new file mode 100644 index 000000000..861041417 --- /dev/null +++ b/sys/rump/dev/lib/libaudio/ioconf.h @@ -0,0 +1,4 @@ + +/* pseudo-devices */ + +/* driver structs */ diff --git a/sys/rump/dev/lib/libaudio/locators.h b/sys/rump/dev/lib/libaudio/locators.h new file mode 100644 index 000000000..e69de29bb diff --git a/sys/rump/dev/lib/libaudio/machine b/sys/rump/dev/lib/libaudio/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libaudio/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libaudio/midi.h b/sys/rump/dev/lib/libaudio/midi.h new file mode 100644 index 000000000..07236fb09 --- /dev/null +++ b/sys/rump/dev/lib/libaudio/midi.h @@ -0,0 +1 @@ +/* $NetBSD: midi.h,v 1.1 2010/05/01 23:19:56 pooka Exp $ */ diff --git a/sys/rump/dev/lib/libaudio/mulaw.h b/sys/rump/dev/lib/libaudio/mulaw.h new file mode 100644 index 000000000..20ea511f6 --- /dev/null +++ b/sys/rump/dev/lib/libaudio/mulaw.h @@ -0,0 +1,3 @@ +/* $NetBSD: mulaw.h,v 1.1 2010/05/01 23:19:56 pooka Exp $ */ + +#define NMULAW 1 diff --git a/sys/rump/dev/lib/libaudio/x86 b/sys/rump/dev/lib/libaudio/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libaudio/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libaudio_ac97/Makefile b/sys/rump/dev/lib/libaudio_ac97/Makefile new file mode 100644 index 000000000..d8957187b --- /dev/null +++ b/sys/rump/dev/lib/libaudio_ac97/Makefile @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.1 2014/11/18 09:04:20 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/ic + +LIB= rumpdev_audio_ac97 + +SRCS= ac97.c + +.include +.include diff --git a/sys/rump/dev/lib/libbpf/Makefile b/sys/rump/dev/lib/libbpf/Makefile new file mode 100644 index 000000000..407dfc095 --- /dev/null +++ b/sys/rump/dev/lib/libbpf/Makefile @@ -0,0 +1,14 @@ +# $NetBSD: Makefile,v 1.2 2014/03/13 02:01:04 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../net + +LIB= rumpdev_bpf + +SRCS= bpf.c bpf_filter.c +SRCS+= bpf_component.c + +CPPFLAGS+= -I${.CURDIR}/../../../librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libbpf/bpf_component.c b/sys/rump/dev/lib/libbpf/bpf_component.c new file mode 100644 index 000000000..1fa6b6296 --- /dev/null +++ b/sys/rump/dev/lib/libbpf/bpf_component.c @@ -0,0 +1,53 @@ +/* $NetBSD: bpf_component.c,v 1.1 2014/03/13 02:01:04 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: bpf_component.c,v 1.1 2014/03/13 02:01:04 pooka Exp $"); + +#include +#include +#include +#include +#include + +#include + +#include "rump_private.h" +#include "rump_vfs_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_NET) +{ + extern const struct cdevsw bpf_cdevsw; + devmajor_t bmaj, cmaj; + int error; + + bmaj = cmaj = NODEVMAJOR; + if ((error = devsw_attach("bpf", NULL, &bmaj, &bpf_cdevsw, &cmaj)) != 0) + panic("bpf devsw attach failed: %d", error); + if ((error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/bpf", cmaj, 0)) !=0) + panic("cannot create bpf device nodes: %d", error); +} diff --git a/sys/rump/dev/lib/libbpf/i386 b/sys/rump/dev/lib/libbpf/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libbpf/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libbpf/machine b/sys/rump/dev/lib/libbpf/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libbpf/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libbpf/x86 b/sys/rump/dev/lib/libbpf/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libbpf/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libcgd/CGD.ioconf b/sys/rump/dev/lib/libcgd/CGD.ioconf new file mode 100644 index 000000000..393e0cb4f --- /dev/null +++ b/sys/rump/dev/lib/libcgd/CGD.ioconf @@ -0,0 +1,8 @@ +# $NetBSD: CGD.ioconf,v 1.1 2015/08/20 11:51:12 christos Exp $ +# + +ioconf cgd + +include "conf/files" + +pseudo-device cgd diff --git a/sys/rump/dev/lib/libcgd/Makefile b/sys/rump/dev/lib/libcgd/Makefile new file mode 100644 index 000000000..e4624d6a5 --- /dev/null +++ b/sys/rump/dev/lib/libcgd/Makefile @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.5 2015/08/20 11:51:12 christos Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev + +LIB= rumpdev_cgd +IOCONF= CGD.ioconf +SRCS= cgd.c cgd_crypto.c + +SRCS+= cgd_component.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libcgd/cgd_component.c b/sys/rump/dev/lib/libcgd/cgd_component.c new file mode 100644 index 000000000..8cc1f40cf --- /dev/null +++ b/sys/rump/dev/lib/libcgd/cgd_component.c @@ -0,0 +1,59 @@ +/* $NetBSD: cgd_component.c,v 1.1 2014/03/13 01:50:51 pooka Exp $ */ + +/* + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: cgd_component.c,v 1.1 2014/03/13 01:50:51 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" +#include "rump_vfs_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern const struct bdevsw cgd_bdevsw; + extern const struct cdevsw cgd_cdevsw; + devmajor_t bmaj, cmaj; + int error; + + /* go, mydevfs */ + bmaj = cmaj = -1; + + if ((error = devsw_attach("/dev/cgd0", &cgd_bdevsw, &bmaj, + &cgd_cdevsw, &cmaj)) != 0) + panic("cannot attach cgd: %d", error); + + if ((error = rump_vfs_makedevnodes(S_IFBLK, "/dev/cgd0", 'a', + bmaj, 0, 7)) != 0) + panic("cannot create cooked cgd dev nodes: %d", error); + if ((error = rump_vfs_makedevnodes(S_IFCHR, "/dev/rcgd0", 'a', + cmaj, 0, 7)) != 0) + panic("cannot create raw cgd dev nodes: %d", error); +} diff --git a/sys/rump/dev/lib/libcgd/i386 b/sys/rump/dev/lib/libcgd/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libcgd/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libcgd/ioconf.c b/sys/rump/dev/lib/libcgd/ioconf.c new file mode 100644 index 000000000..ed4a9deda --- /dev/null +++ b/sys/rump/dev/lib/libcgd/ioconf.c @@ -0,0 +1,32 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libcgd/CGD.ioconf" + */ + +#include +#include +#include +#include + + + +static struct cfdriver * const cfdriver_ioconf_cgd[] = { + NULL +}; + + + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_cgd[] = { + /* driver attachment unit state loc flags pspec */ + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + + +static const struct cfattachinit cfattach_ioconf_cgd[] = { + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libcgd/ioconf.h b/sys/rump/dev/lib/libcgd/ioconf.h new file mode 100644 index 000000000..861041417 --- /dev/null +++ b/sys/rump/dev/lib/libcgd/ioconf.h @@ -0,0 +1,4 @@ + +/* pseudo-devices */ + +/* driver structs */ diff --git a/sys/rump/dev/lib/libcgd/locators.h b/sys/rump/dev/lib/libcgd/locators.h new file mode 100644 index 000000000..e69de29bb diff --git a/sys/rump/dev/lib/libcgd/machine b/sys/rump/dev/lib/libcgd/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libcgd/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libcgd/x86 b/sys/rump/dev/lib/libcgd/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libcgd/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libdisk/Makefile b/sys/rump/dev/lib/libdisk/Makefile new file mode 100644 index 000000000..f8c3d1e12 --- /dev/null +++ b/sys/rump/dev/lib/libdisk/Makefile @@ -0,0 +1,23 @@ +# $NetBSD: Makefile,v 1.8 2015/05/16 13:59:00 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../kern \ + ${.CURDIR}/../../../../dev ${.CURDIR}/../../../../dev/dkwedge + +LIB= rumpdev_disk +SRCS= disk_component.c + +# +# We use subr_disk_mbr on all platforms. The current structure of +# code allows us to pick only one readdisklabel() routine. While +# this is not the native one for all platforms, it's probably the +# most common one in an image floating on the internetto. +SRCS+= subr_disk_mbr.c + +# sys/kern +SRCS+= subr_disk.c subr_disk_open.c +# sys/dev +SRCS+= dksubr.c dk.c + +.include +.include diff --git a/sys/rump/dev/lib/libdisk/disk_component.c b/sys/rump/dev/lib/libdisk/disk_component.c new file mode 100644 index 000000000..98283c17a --- /dev/null +++ b/sys/rump/dev/lib/libdisk/disk_component.c @@ -0,0 +1,43 @@ +/* $NetBSD: disk_component.c,v 1.1 2015/05/16 13:59:00 pooka Exp $ */ + +/* + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: disk_component.c,v 1.1 2015/05/16 13:59:00 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" +#include "rump_dev_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + dkwedge_init(); +} diff --git a/sys/rump/dev/lib/libdisk/i386 b/sys/rump/dev/lib/libdisk/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libdisk/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libdisk/machine b/sys/rump/dev/lib/libdisk/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libdisk/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libdisk/x86 b/sys/rump/dev/lib/libdisk/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libdisk/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libdm/DM.ioconf b/sys/rump/dev/lib/libdm/DM.ioconf new file mode 100644 index 000000000..0da052001 --- /dev/null +++ b/sys/rump/dev/lib/libdm/DM.ioconf @@ -0,0 +1,8 @@ +# $NetBSD: DM.ioconf,v 1.1 2015/08/20 11:51:12 christos Exp $ +# + +ioconf dm + +include "conf/files" + +pseudo-device dm diff --git a/sys/rump/dev/lib/libdm/Makefile b/sys/rump/dev/lib/libdm/Makefile new file mode 100644 index 000000000..52aad36e3 --- /dev/null +++ b/sys/rump/dev/lib/libdm/Makefile @@ -0,0 +1,16 @@ +# $NetBSD: Makefile,v 1.5 2015/08/20 11:51:12 christos Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/dm + +LIB= rumpdev_dm +IOCONF= DM.ioconf +SRCS= device-mapper.c dm_dev.c dm_ioctl.c dm_pdev.c dm_table.c dm_target.c \ + dm_target_linear.c dm_target_stripe.c + +SRCS+= dm_component.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libdm/dm_component.c b/sys/rump/dev/lib/libdm/dm_component.c new file mode 100644 index 000000000..9bec89ce5 --- /dev/null +++ b/sys/rump/dev/lib/libdm/dm_component.c @@ -0,0 +1,64 @@ +/* $NetBSD: dm_component.c,v 1.1 2014/03/13 01:54:22 pooka Exp $ */ + +/* + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: dm_component.c,v 1.1 2014/03/13 01:54:22 pooka Exp $"); + +#include +#include +#include +#include +#include + +#include + +#include "rump_private.h" +#include "rump_dev_private.h" +#include "rump_vfs_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern const struct bdevsw dm_bdevsw; + extern const struct cdevsw dm_cdevsw; + devmajor_t bmaj, cmaj; + int error; + + /* go, mydevfs */ + bmaj = cmaj = -1; + + if ((error = devsw_attach("dm", &dm_bdevsw, &bmaj, + &dm_cdevsw, &cmaj)) != 0) + panic("cannot attach dm: %d", error); + + do_sys_mkdir("/dev/mapper", 0770, UIO_SYSSPACE); + + if ((error = rump_vfs_makedevnodes(S_IFCHR, "/dev/mapper/control", 0, + cmaj, 0, 1)) != 0) { + panic("cannot create device-mapper control device: %d", error); + + } +} diff --git a/sys/rump/dev/lib/libdm/i386 b/sys/rump/dev/lib/libdm/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libdm/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libdm/ioconf.c b/sys/rump/dev/lib/libdm/ioconf.c new file mode 100644 index 000000000..940ac98da --- /dev/null +++ b/sys/rump/dev/lib/libdm/ioconf.c @@ -0,0 +1,32 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libdm/DM.ioconf" + */ + +#include +#include +#include +#include + + + +static struct cfdriver * const cfdriver_ioconf_dm[] = { + NULL +}; + + + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_dm[] = { + /* driver attachment unit state loc flags pspec */ + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + + +static const struct cfattachinit cfattach_ioconf_dm[] = { + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libdm/ioconf.h b/sys/rump/dev/lib/libdm/ioconf.h new file mode 100644 index 000000000..861041417 --- /dev/null +++ b/sys/rump/dev/lib/libdm/ioconf.h @@ -0,0 +1,4 @@ + +/* pseudo-devices */ + +/* driver structs */ diff --git a/sys/rump/dev/lib/libdm/locators.h b/sys/rump/dev/lib/libdm/locators.h new file mode 100644 index 000000000..e69de29bb diff --git a/sys/rump/dev/lib/libdm/machine b/sys/rump/dev/lib/libdm/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libdm/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libdm/x86 b/sys/rump/dev/lib/libdm/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libdm/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libdrvctl/DRVCTL.ioconf b/sys/rump/dev/lib/libdrvctl/DRVCTL.ioconf new file mode 100644 index 000000000..7840e89f5 --- /dev/null +++ b/sys/rump/dev/lib/libdrvctl/DRVCTL.ioconf @@ -0,0 +1,8 @@ +# $NetBSD: DRVCTL.ioconf,v 1.1 2010/12/07 21:38:07 pooka Exp $ +# + +ioconf drvctl + +include "conf/files" + +pseudo-device drvctl diff --git a/sys/rump/dev/lib/libdrvctl/Makefile b/sys/rump/dev/lib/libdrvctl/Makefile new file mode 100644 index 000000000..1c8300792 --- /dev/null +++ b/sys/rump/dev/lib/libdrvctl/Makefile @@ -0,0 +1,13 @@ +# $NetBSD: Makefile,v 1.2 2014/03/13 01:56:55 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../kern + +LIB= rumpdev_drvctl +IOCONF= DRVCTL.ioconf + +SRCS= kern_drvctl.c +SRCS+= drvctl_component.c + +.include +.include diff --git a/sys/rump/dev/lib/libdrvctl/drvctl_component.c b/sys/rump/dev/lib/libdrvctl/drvctl_component.c new file mode 100644 index 000000000..84b27cf55 --- /dev/null +++ b/sys/rump/dev/lib/libdrvctl/drvctl_component.c @@ -0,0 +1,55 @@ +/* $NetBSD: drvctl_component.c,v 1.1 2014/03/13 01:56:55 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: drvctl_component.c,v 1.1 2014/03/13 01:56:55 pooka Exp $"); + +#include +#include +#include +#include + +#include "ioconf.c" + +#include "rump_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern const struct cdevsw drvctl_cdevsw; + devmajor_t bmaj, cmaj; + int error; + + drvctl_init(); + + config_init_component(cfdriver_ioconf_drvctl, + cfattach_ioconf_drvctl, cfdata_ioconf_drvctl); + + bmaj = cmaj = NODEVMAJOR; + if ((error = devsw_attach("drvctl", NULL, &bmaj, + &drvctl_cdevsw, &cmaj)) != 0) + panic("drvctl devsw attach failed: %d", error); +} diff --git a/sys/rump/dev/lib/libdrvctl/i386 b/sys/rump/dev/lib/libdrvctl/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libdrvctl/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libdrvctl/ioconf.c b/sys/rump/dev/lib/libdrvctl/ioconf.c new file mode 100644 index 000000000..1c687d85a --- /dev/null +++ b/sys/rump/dev/lib/libdrvctl/ioconf.c @@ -0,0 +1,32 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libdrvctl/DRVCTL.ioconf" + */ + +#include +#include +#include +#include + + + +static struct cfdriver * const cfdriver_ioconf_drvctl[] = { + NULL +}; + + + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_drvctl[] = { + /* driver attachment unit state loc flags pspec */ + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + + +static const struct cfattachinit cfattach_ioconf_drvctl[] = { + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libdrvctl/ioconf.h b/sys/rump/dev/lib/libdrvctl/ioconf.h new file mode 100644 index 000000000..861041417 --- /dev/null +++ b/sys/rump/dev/lib/libdrvctl/ioconf.h @@ -0,0 +1,4 @@ + +/* pseudo-devices */ + +/* driver structs */ diff --git a/sys/rump/dev/lib/libdrvctl/locators.h b/sys/rump/dev/lib/libdrvctl/locators.h new file mode 100644 index 000000000..e69de29bb diff --git a/sys/rump/dev/lib/libdrvctl/machine b/sys/rump/dev/lib/libdrvctl/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libdrvctl/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libdrvctl/x86 b/sys/rump/dev/lib/libdrvctl/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libdrvctl/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libfss/FSS.ioconf b/sys/rump/dev/lib/libfss/FSS.ioconf new file mode 100644 index 000000000..0359e326e --- /dev/null +++ b/sys/rump/dev/lib/libfss/FSS.ioconf @@ -0,0 +1,8 @@ +# $NetBSD: FSS.ioconf,v 1.1 2015/08/20 11:51:12 christos Exp $ +# + +ioconf fss + +include "conf/files" + +pseudo-device fss diff --git a/sys/rump/dev/lib/libfss/Makefile b/sys/rump/dev/lib/libfss/Makefile new file mode 100644 index 000000000..7644e0735 --- /dev/null +++ b/sys/rump/dev/lib/libfss/Makefile @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.3 2015/08/20 11:51:12 christos Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev + +LIB= rumpdev_fss +IOCONF= FSS.ioconf +SRCS= fss.c + +SRCS+= fss_component.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libfss/fss_component.c b/sys/rump/dev/lib/libfss/fss_component.c new file mode 100644 index 000000000..86adc7dbd --- /dev/null +++ b/sys/rump/dev/lib/libfss/fss_component.c @@ -0,0 +1,59 @@ +/* $NetBSD: fss_component.c,v 1.1 2014/03/13 01:59:05 pooka Exp $ */ + +/* + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: fss_component.c,v 1.1 2014/03/13 01:59:05 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" +#include "rump_vfs_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern const struct bdevsw fss_bdevsw; + extern const struct cdevsw fss_cdevsw; + devmajor_t bmaj, cmaj; + int error; + + bmaj = bdevsw_lookup_major(&fss_bdevsw); + cmaj = cdevsw_lookup_major(&fss_cdevsw); + + if ((error = devsw_attach("fss", &fss_bdevsw, &bmaj, + &fss_cdevsw, &cmaj)) != 0) + panic("cannot attach fss: %d", error); + + if ((error = rump_vfs_makedevnodes(S_IFBLK, "/dev/fss", '0', + bmaj, 0, 4)) != 0) + panic("cannot create cooked fss dev nodes: %d", error); + if ((error = rump_vfs_makedevnodes(S_IFCHR, "/dev/rfss", '0', + cmaj, 0, 4)) != 0) + panic("cannot create raw fss dev nodes: %d", error); +} diff --git a/sys/rump/dev/lib/libfss/i386 b/sys/rump/dev/lib/libfss/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libfss/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libfss/ioconf.c b/sys/rump/dev/lib/libfss/ioconf.c new file mode 100644 index 000000000..20da37847 --- /dev/null +++ b/sys/rump/dev/lib/libfss/ioconf.c @@ -0,0 +1,32 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libfss/FSS.ioconf" + */ + +#include +#include +#include +#include + + + +static struct cfdriver * const cfdriver_ioconf_fss[] = { + NULL +}; + + + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_fss[] = { + /* driver attachment unit state loc flags pspec */ + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + + +static const struct cfattachinit cfattach_ioconf_fss[] = { + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libfss/ioconf.h b/sys/rump/dev/lib/libfss/ioconf.h new file mode 100644 index 000000000..861041417 --- /dev/null +++ b/sys/rump/dev/lib/libfss/ioconf.h @@ -0,0 +1,4 @@ + +/* pseudo-devices */ + +/* driver structs */ diff --git a/sys/rump/dev/lib/libfss/locators.h b/sys/rump/dev/lib/libfss/locators.h new file mode 100644 index 000000000..e69de29bb diff --git a/sys/rump/dev/lib/libfss/machine b/sys/rump/dev/lib/libfss/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libfss/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libfss/x86 b/sys/rump/dev/lib/libfss/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libfss/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libhdaudio_hdafg/Makefile b/sys/rump/dev/lib/libhdaudio_hdafg/Makefile new file mode 100644 index 000000000..dfe0922ec --- /dev/null +++ b/sys/rump/dev/lib/libhdaudio_hdafg/Makefile @@ -0,0 +1,13 @@ +# $NetBSD: Makefile,v 1.1 2014/11/19 00:18:58 pooka Exp $ +# + +RUMPTOP=${TOPRUMP} + +.include +.include "${NETBSDSRCDIR}/sys/modules/hdafg/Makefile.inc" + +LIB= rumpdev_hdaudio_hdafg + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libmd/MD.ioconf b/sys/rump/dev/lib/libmd/MD.ioconf new file mode 100644 index 000000000..e0d035852 --- /dev/null +++ b/sys/rump/dev/lib/libmd/MD.ioconf @@ -0,0 +1,8 @@ +# $NetBSD: MD.ioconf,v 1.1 2010/11/22 21:20:32 pooka Exp $ +# + +ioconf md + +include "conf/files" + +pseudo-device md diff --git a/sys/rump/dev/lib/libmd/Makefile b/sys/rump/dev/lib/libmd/Makefile new file mode 100644 index 000000000..2dc7d9923 --- /dev/null +++ b/sys/rump/dev/lib/libmd/Makefile @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.2 2014/03/17 11:30:40 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev + +LIB= rumpdev_md +IOCONF= MD.ioconf + +SRCS= md.c +SRCS+= md_component.c + +CPPFLAGS+= -I${.CURDIR}/../../../librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libmd/i386 b/sys/rump/dev/lib/libmd/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libmd/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libmd/ioconf.c b/sys/rump/dev/lib/libmd/ioconf.c new file mode 100644 index 000000000..04a384374 --- /dev/null +++ b/sys/rump/dev/lib/libmd/ioconf.c @@ -0,0 +1,32 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libmd/MD.ioconf" + */ + +#include +#include +#include +#include + + + +static struct cfdriver * const cfdriver_ioconf_md[] = { + NULL +}; + + + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_md[] = { + /* driver attachment unit state loc flags pspec */ + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + + +static const struct cfattachinit cfattach_ioconf_md[] = { + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libmd/ioconf.h b/sys/rump/dev/lib/libmd/ioconf.h new file mode 100644 index 000000000..861041417 --- /dev/null +++ b/sys/rump/dev/lib/libmd/ioconf.h @@ -0,0 +1,4 @@ + +/* pseudo-devices */ + +/* driver structs */ diff --git a/sys/rump/dev/lib/libmd/locators.h b/sys/rump/dev/lib/libmd/locators.h new file mode 100644 index 000000000..e69de29bb diff --git a/sys/rump/dev/lib/libmd/machine b/sys/rump/dev/lib/libmd/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libmd/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libmd/md_component.c b/sys/rump/dev/lib/libmd/md_component.c new file mode 100644 index 000000000..561794652 --- /dev/null +++ b/sys/rump/dev/lib/libmd/md_component.c @@ -0,0 +1,68 @@ +/* $NetBSD: md_component.c,v 1.1 2014/03/17 11:30:40 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: md_component.c,v 1.1 2014/03/17 11:30:40 pooka Exp $"); + +#include +#include +#include +#include +#include + +#include "ioconf.c" + +#include "rump_private.h" +#include "rump_dev_private.h" +#include "rump_vfs_private.h" + +extern void mdattach(int); /* XXX */ + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern const struct bdevsw md_bdevsw; + extern const struct cdevsw md_cdevsw; + devmajor_t bmaj, cmaj; + int error; + + config_init_component(cfdriver_ioconf_md, + cfattach_ioconf_md, cfdata_ioconf_md); + + bmaj = cmaj = NODEVMAJOR; + if ((error = devsw_attach("md", &md_bdevsw, &bmaj, + &md_cdevsw, &cmaj)) != 0) + panic("md devsw attach failed: %d", error); + + if ((error = rump_vfs_makedevnodes(S_IFBLK, "/dev/md0", 'a', + bmaj, 0, 7)) != 0) + panic("cannot create cooked md dev nodes: %d", error); + if ((error = rump_vfs_makedevnodes(S_IFCHR, "/dev/rmd0", 'a', + cmaj, 0, 7)) != 0) + panic("cannot create raw md dev nodes: %d", error); + + rump_pdev_add(mdattach, 0); +} diff --git a/sys/rump/dev/lib/libmd/x86 b/sys/rump/dev/lib/libmd/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libmd/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libmiiphy/MIIPHY.ioconf b/sys/rump/dev/lib/libmiiphy/MIIPHY.ioconf new file mode 100644 index 000000000..64e612ecf --- /dev/null +++ b/sys/rump/dev/lib/libmiiphy/MIIPHY.ioconf @@ -0,0 +1,41 @@ +# $NetBSD: MIIPHY.ioconf,v 1.1 2014/04/04 14:18:19 pooka Exp $ +# + +ioconf phy + +include "conf/files" + +pseudo-root mii* + +acphy* at mii? phy ? # Altima AC101 and AMD Am79c874 PHYs +amhphy* at mii? phy ? # AMD 79c901 Ethernet PHYs +atphy* at mii? phy ? # Attansic/Atheros PHYs +bmtphy* at mii? phy ? # Broadcom BCM5201 and BCM5202 PHYs +brgphy* at mii? phy ? # Broadcom BCM5400-family PHYs +ciphy* at mii? phy ? # Cicada CS8201 Gig-E PHYs +dmphy* at mii? phy ? # Davicom DM9101 PHYs +etphy* at mii? phy ? # Agere/LSI ET1011 TruePHY Gig-E PHYs +exphy* at mii? phy ? # 3Com internal PHYs +gentbi* at mii? phy ? # Generic Ten-Bit 1000BASE-[CLS]X PHYs +glxtphy* at mii? phy ? # Level One LXT-1000 PHYs +gphyter* at mii? phy ? # NS83861 Gig-E PHY +icsphy* at mii? phy ? # Integrated Circuit Systems ICS189x +igphy* at mii? phy ? # Intel IGP01E1000 +ihphy* at mii? phy ? # Intel 82577 PHYs +ikphy* at mii? phy ? # Intel 82563 PHYs +inphy* at mii? phy ? # Intel 82555 PHYs +iophy* at mii? phy ? # Intel 82553 PHYs +lxtphy* at mii? phy ? # Level One LXT-970 PHYs +makphy* at mii? phy ? # Marvell Semiconductor 88E1000 PHYs +nsphy* at mii? phy ? # NS83840 PHYs +nsphyter* at mii? phy ? # NS83843 PHYs +pnaphy* at mii? phy ? # generic HomePNA PHYs +qsphy* at mii? phy ? # Quality Semiconductor QS6612 PHYs +rdcphy* at mii? phy ? # RDC R6040 10/100 PHY +rgephy* at mii? phy ? # Realtek 8169S/8110S internal PHYs +rlphy* at mii? phy ? # Realtek 8139/8201L PHYs +sqphy* at mii? phy ? # Seeq 80220/80221/80223 PHYs +tlphy* at mii? phy ? # ThunderLAN PHYs +tqphy* at mii? phy ? # TDK Semiconductor PHYs +ukphy* at mii? phy ? # generic unknown PHYs +urlphy* at mii? phy ? # Realtek RTL8150L internal PHYs diff --git a/sys/rump/dev/lib/libmiiphy/Makefile b/sys/rump/dev/lib/libmiiphy/Makefile new file mode 100644 index 000000000..e978c9582 --- /dev/null +++ b/sys/rump/dev/lib/libmiiphy/Makefile @@ -0,0 +1,23 @@ +# $NetBSD: Makefile,v 1.3 2015/08/24 23:21:50 pooka Exp $ +# + +RUMPTOP=${TOPRUMP} + +.PATH: ${RUMPTOP}/../dev/pci ${RUMPTOP}/../dev/mii + +LIB= rumpdev_miiphy +IOCONF= MIIPHY.ioconf + +SRCS= phy_at_mii.c + +SRCS+= mii.c mii_ethersubr.c mii_physubr.c ukphy.c ukphy_subr.c +SRCS+= acphy.c amhphy.c atphy.c bmtphy.c brgphy.c ciphy.c dmphy.c etphy.c \ + exphy.c gentbi.c glxtphy.c gphyter.c icsphy.c igphy.c ihphy.c ikphy.c \ + inphy.c iophy.c lxtphy.c makphy.c nsphy.c nsphyter.c pnaphy.c \ + qsphy.c rdcphy.c rgephy.c rlphy.c sqphy.c tlphy.c tqphy.c urlphy.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libmiiphy/phy_at_mii.c b/sys/rump/dev/lib/libmiiphy/phy_at_mii.c new file mode 100644 index 000000000..2a133c559 --- /dev/null +++ b/sys/rump/dev/lib/libmiiphy/phy_at_mii.c @@ -0,0 +1,45 @@ +/* $NetBSD: phy_at_mii.c,v 1.1 2014/04/04 14:18:19 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: phy_at_mii.c,v 1.1 2014/04/04 14:18:19 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" + +#include "ioconf.c" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_phy, + cfattach_ioconf_phy, cfdata_ioconf_phy); +} diff --git a/sys/rump/dev/lib/libnetsmb/Makefile b/sys/rump/dev/lib/libnetsmb/Makefile new file mode 100644 index 000000000..32a2c14f8 --- /dev/null +++ b/sys/rump/dev/lib/libnetsmb/Makefile @@ -0,0 +1,20 @@ +# $NetBSD: Makefile,v 1.7 2015/08/20 14:27:15 christos Exp $ +# + +.PATH: ${.CURDIR}/../../../../netsmb + +LIB= rumpdev_netsmb +IOCONF= NETSMB.ioconf +SRCS= iconv.c smb_conn.c smb_crypt.c smb_dev.c smb_iod.c smb_rq.c \ + smb_smb.c smb_subr.c smb_trantcp.c smb_usr.c subr_mchain.c + +SRCS+= netsmb_component.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs +#CPPFLAGS+= -DSMB_SOCKET_DEBUG -DSMB_IOD_DEBUG + +SRCS+= netsmb_iconv.c +RUMPCOMP_USER_SRCS= netsmb_user.c + +.include +.include diff --git a/sys/rump/dev/lib/libnetsmb/NETSMB.ioconf b/sys/rump/dev/lib/libnetsmb/NETSMB.ioconf new file mode 100644 index 000000000..2a492fb3d --- /dev/null +++ b/sys/rump/dev/lib/libnetsmb/NETSMB.ioconf @@ -0,0 +1,8 @@ +# $NetBSD: NETSMB.ioconf,v 1.1 2015/08/20 11:51:12 christos Exp $ +# + +ioconf netsmb + +include "conf/files" + +pseudo-device nsmb diff --git a/sys/rump/dev/lib/libnetsmb/i386 b/sys/rump/dev/lib/libnetsmb/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libnetsmb/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libnetsmb/ioconf.c b/sys/rump/dev/lib/libnetsmb/ioconf.c new file mode 100644 index 000000000..e098d03c3 --- /dev/null +++ b/sys/rump/dev/lib/libnetsmb/ioconf.c @@ -0,0 +1,32 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libnetsmb/NETSMB.ioconf" + */ + +#include +#include +#include +#include + + + +static struct cfdriver * const cfdriver_ioconf_netsmb[] = { + NULL +}; + + + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_netsmb[] = { + /* driver attachment unit state loc flags pspec */ + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + + +static const struct cfattachinit cfattach_ioconf_netsmb[] = { + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libnetsmb/ioconf.h b/sys/rump/dev/lib/libnetsmb/ioconf.h new file mode 100644 index 000000000..861041417 --- /dev/null +++ b/sys/rump/dev/lib/libnetsmb/ioconf.h @@ -0,0 +1,4 @@ + +/* pseudo-devices */ + +/* driver structs */ diff --git a/sys/rump/dev/lib/libnetsmb/locators.h b/sys/rump/dev/lib/libnetsmb/locators.h new file mode 100644 index 000000000..e69de29bb diff --git a/sys/rump/dev/lib/libnetsmb/machine b/sys/rump/dev/lib/libnetsmb/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libnetsmb/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libnetsmb/netsmb_component.c b/sys/rump/dev/lib/libnetsmb/netsmb_component.c new file mode 100644 index 000000000..80ea9f3d4 --- /dev/null +++ b/sys/rump/dev/lib/libnetsmb/netsmb_component.c @@ -0,0 +1,63 @@ +/* $NetBSD: netsmb_component.c,v 1.3 2015/08/20 11:51:12 christos Exp $ */ + +/* + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * Development of this software was supported by The Nokia Foundation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: netsmb_component.c,v 1.3 2015/08/20 11:51:12 christos Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" +#include "rump_dev_private.h" +#include "rump_vfs_private.h" + +#include "ioconf.h" + +#if defined(__minix) +void nsmbattach(int); +#endif + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern const struct cdevsw nsmb_cdevsw; + devmajor_t bmaj, cmaj; + int error; + + bmaj = cmaj = NODEVMAJOR; + error = devsw_attach("nsmb", NULL, &bmaj, &nsmb_cdevsw, &cmaj); + if (error && error != EEXIST) + panic("nsmb devsw attach failed: %d", error); + if ((error = rump_vfs_makedevnodes(S_IFCHR, "/dev/nsmb", '0', + cmaj, 0, 4)) != 0) + panic("cannot create nsmb device nodes: %d", error); + + rump_pdev_add(nsmbattach, 4); +} diff --git a/sys/rump/dev/lib/libnetsmb/netsmb_iconv.c b/sys/rump/dev/lib/libnetsmb/netsmb_iconv.c new file mode 100644 index 000000000..00fe9a006 --- /dev/null +++ b/sys/rump/dev/lib/libnetsmb/netsmb_iconv.c @@ -0,0 +1,79 @@ +/* $NetBSD: netsmb_iconv.c,v 1.1 2014/11/15 18:49:04 nakayama Exp $ */ + +/* + * Copyright (c) 2014 Takeshi Nakayama. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: netsmb_iconv.c,v 1.1 2014/11/15 18:49:04 nakayama Exp $"); + +#include +#include +#include +#include + +#include + +#include "netsmb_user.h" + +int +iconv_open(const char *to, const char *from, void **handle) +{ + if (strcmp(to, "tolower") && strcmp(to, "toupper")) + return rumpcomp_netsmb_iconv_open(to, from, handle); + return 0; +} + +int +iconv_close(void *handle) +{ + if (handle != NULL) + return rumpcomp_netsmb_iconv_close(handle); + return 0; +} + +int +iconv_conv(void *handle, const char **inbuf, size_t *inbytesleft, + char **outbuf, size_t *outbytesleft) +{ + size_t len; + + if (handle != NULL) + return rumpcomp_netsmb_iconv_conv(handle, inbuf, inbytesleft, + outbuf, outbytesleft); + + if (inbuf == NULL) + return 0; + + if (*inbytesleft > *outbytesleft) + return E2BIG; + + len = *inbytesleft; + memcpy(*outbuf, *inbuf, len); + *inbuf += len; + *inbytesleft = 0; + *outbuf += len; + *outbytesleft -= len; + return 0; +} diff --git a/sys/rump/dev/lib/libnetsmb/netsmb_user.c b/sys/rump/dev/lib/libnetsmb/netsmb_user.c new file mode 100644 index 000000000..3131d421a --- /dev/null +++ b/sys/rump/dev/lib/libnetsmb/netsmb_user.c @@ -0,0 +1,98 @@ +/* $NetBSD: netsmb_user.c,v 1.3 2014/11/16 15:31:12 nakayama Exp $ */ + +/* + * Copyright (c) 2014 Takeshi Nakayama. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _KERNEL +#include +#include +#ifdef __NetBSD__ +#include +#endif + +#include + +#include "netsmb_user.h" + +int +rumpcomp_netsmb_iconv_open(const char *to, const char *from, void **handle) +{ +#ifdef __NetBSD__ + iconv_t cd; + int rv; + + cd = iconv_open(to, from); + if (cd == (iconv_t)-1) + rv = errno; + else { + if (handle != NULL) + *handle = (void *)cd; + rv = 0; + } + + return rumpuser_component_errtrans(rv); +#else + /* fallback to use dumb copy function */ + return 0; +#endif +} + +int +rumpcomp_netsmb_iconv_close(void *handle) +{ +#ifdef __NetBSD__ + int rv; + + if (iconv_close((iconv_t)handle) == -1) + rv = errno; + else + rv = 0; + + return rumpuser_component_errtrans(rv); +#else + /* do nothing */ + return 0; +#endif +} + +int +rumpcomp_netsmb_iconv_conv(void *handle, const char **inbuf, + size_t *inbytesleft, char **outbuf, size_t *outbytesleft) +{ +#ifdef __NetBSD__ + int rv; + + if (iconv((iconv_t)handle, inbuf, inbytesleft, outbuf, outbytesleft) + == (size_t)-1) + rv = errno; + else + rv = 0; + + return rumpuser_component_errtrans(rv); +#else + /* do nothing */ + return 0; +#endif +} +#endif diff --git a/sys/rump/dev/lib/libnetsmb/netsmb_user.h b/sys/rump/dev/lib/libnetsmb/netsmb_user.h new file mode 100644 index 000000000..c003f37f2 --- /dev/null +++ b/sys/rump/dev/lib/libnetsmb/netsmb_user.h @@ -0,0 +1,31 @@ +/* $NetBSD: netsmb_user.h,v 1.1 2014/11/15 18:49:04 nakayama Exp $ */ + +/* + * Copyright (c) 2014 Takeshi Nakayama. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +int rumpcomp_netsmb_iconv_open(const char *, const char *, void **); +int rumpcomp_netsmb_iconv_close(void *); +int rumpcomp_netsmb_iconv_conv(void *, const char **, size_t *, char **, + size_t *); diff --git a/sys/rump/dev/lib/libnetsmb/x86 b/sys/rump/dev/lib/libnetsmb/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libnetsmb/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libopencrypto/Makefile b/sys/rump/dev/lib/libopencrypto/Makefile new file mode 100644 index 000000000..d99def261 --- /dev/null +++ b/sys/rump/dev/lib/libopencrypto/Makefile @@ -0,0 +1,32 @@ +# $NetBSD: Makefile,v 1.8 2015/08/20 11:51:12 christos Exp $ +# + +.PATH: ${.CURDIR}/../../../../opencrypto + +LIB= rumpdev_opencrypto +IOCONF= OPENCRYPTO.ioconf +SRCS= opencrypto_component.c + +# Sources for crypto framework + +SRCS+= criov.c +SRCS+= crypto.c +SRCS+= xform.c + +# Sources for crypto device, for userland access + +SRCS+= cryptodev.c +SRCS+= ocryptodev.c + +# Sources for swcrypto device to access opencrypto software algorithms +# (Other algorithms are in rumpkern_crypto) + +SRCS+= aesxcbcmac.c +SRCS+= cryptosoft.c +SRCS+= deflate.c +SRCS+= gmac.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libopencrypto/OPENCRYPTO.ioconf b/sys/rump/dev/lib/libopencrypto/OPENCRYPTO.ioconf new file mode 100644 index 000000000..bc0701939 --- /dev/null +++ b/sys/rump/dev/lib/libopencrypto/OPENCRYPTO.ioconf @@ -0,0 +1,9 @@ +# $NetBSD: OPENCRYPTO.ioconf,v 1.1 2015/08/20 11:51:12 christos Exp $ + +ioconf opencrypto + +include "conf/files" + +pseudo-device opencrypto +pseudo-device crypto +pseudo-device swcrypto diff --git a/sys/rump/dev/lib/libopencrypto/i386 b/sys/rump/dev/lib/libopencrypto/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libopencrypto/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libopencrypto/ioconf.c b/sys/rump/dev/lib/libopencrypto/ioconf.c new file mode 100644 index 000000000..218257b55 --- /dev/null +++ b/sys/rump/dev/lib/libopencrypto/ioconf.c @@ -0,0 +1,32 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libopencrypto/OPENCRYPTO.ioconf" + */ + +#include +#include +#include +#include + + + +static struct cfdriver * const cfdriver_ioconf_opencrypto[] = { + NULL +}; + + + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_opencrypto[] = { + /* driver attachment unit state loc flags pspec */ + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + + +static const struct cfattachinit cfattach_ioconf_opencrypto[] = { + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libopencrypto/ioconf.h b/sys/rump/dev/lib/libopencrypto/ioconf.h new file mode 100644 index 000000000..25e3943a7 --- /dev/null +++ b/sys/rump/dev/lib/libopencrypto/ioconf.h @@ -0,0 +1,6 @@ + +/* pseudo-devices */ +void cryptoattach(int); +void swcryptoattach(int); + +/* driver structs */ diff --git a/sys/rump/dev/lib/libopencrypto/locators.h b/sys/rump/dev/lib/libopencrypto/locators.h new file mode 100644 index 000000000..e1e369eed --- /dev/null +++ b/sys/rump/dev/lib/libopencrypto/locators.h @@ -0,0 +1,85 @@ +#define WSKBDDEVCF_CONSOLE 0 +#define WSKBDDEVCF_CONSOLE_DEFAULT -1 +#define WSKBDDEVCF_MUX 1 +#define WSKBDDEVCF_MUX_DEFAULT 1 +#define WSKBDDEVCF_NLOCS 2 +#define WSEMULDISPLAYDEVCF_CONSOLE 0 +#define WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT -1 +#define WSEMULDISPLAYDEVCF_KBDMUX 1 +#define WSEMULDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSEMULDISPLAYDEVCF_NLOCS 2 +#define AACCF_UNIT 0 +#define AACCF_UNIT_DEFAULT -1 +#define AACCF_NLOCS 1 +#define PCKBPORTCF_SLOT 0 +#define PCKBPORTCF_SLOT_DEFAULT -1 +#define PCKBPORTCF_NLOCS 1 +#define MLXCF_UNIT 0 +#define MLXCF_UNIT_DEFAULT -1 +#define MLXCF_NLOCS 1 +#define WSMOUSEDEVCF_MUX 0 +#define WSMOUSEDEVCF_MUX_DEFAULT 0 +#define WSMOUSEDEVCF_NLOCS 1 +#define SCSICF_CHANNEL 0 +#define SCSICF_CHANNEL_DEFAULT -1 +#define SCSICF_NLOCS 1 +#define HDAUDIOBUSCF_NID 0 +#define HDAUDIOBUSCF_NID_DEFAULT -1 +#define HDAUDIOBUSCF_NLOCS 1 +#define CPCBUSCF_ADDR 0 +#define CPCBUSCF_IRQ 1 +#define CPCBUSCF_IRQ_DEFAULT -1 +#define CPCBUSCF_NLOCS 2 +#define ATACF_CHANNEL 0 +#define ATACF_CHANNEL_DEFAULT -1 +#define ATACF_NLOCS 1 +#define PCMCIABUSCF_CONTROLLER 0 +#define PCMCIABUSCF_CONTROLLER_DEFAULT -1 +#define PCMCIABUSCF_SOCKET 1 +#define PCMCIABUSCF_SOCKET_DEFAULT -1 +#define PCMCIABUSCF_NLOCS 2 +#define FLASHBUSCF_OFFSET 0 +#define FLASHBUSCF_OFFSET_DEFAULT 0 +#define FLASHBUSCF_SIZE 1 +#define FLASHBUSCF_SIZE_DEFAULT 0 +#define FLASHBUSCF_READONLY 2 +#define FLASHBUSCF_READONLY_DEFAULT 0 +#define FLASHBUSCF_NLOCS 3 +#define CACCF_UNIT 0 +#define CACCF_UNIT_DEFAULT -1 +#define CACCF_NLOCS 1 +#define GPIBDEVCF_ADDRESS 0 +#define GPIBDEVCF_ADDRESS_DEFAULT -1 +#define GPIBDEVCF_NLOCS 1 +#define IICCF_ADDR 0 +#define IICCF_ADDR_DEFAULT -1 +#define IICCF_SIZE 1 +#define IICCF_SIZE_DEFAULT -1 +#define IICCF_NLOCS 2 +#define PCIBUSCF_BUS 0 +#define PCIBUSCF_BUS_DEFAULT -1 +#define PCIBUSCF_NLOCS 1 +#define ATA_HLCF_DRIVE 0 +#define ATA_HLCF_DRIVE_DEFAULT -1 +#define ATA_HLCF_NLOCS 1 +#define GPIOCF_OFFSET 0 +#define GPIOCF_OFFSET_DEFAULT -1 +#define GPIOCF_MASK 1 +#define GPIOCF_MASK_DEFAULT 0 +#define GPIOCF_FLAG 2 +#define GPIOCF_FLAG_DEFAULT 0 +#define GPIOCF_NLOCS 3 +#define ICPCF_UNIT 0 +#define ICPCF_UNIT_DEFAULT -1 +#define ICPCF_NLOCS 1 +#define WSDISPLAYDEVCF_KBDMUX 0 +#define WSDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSDISPLAYDEVCF_NLOCS 1 +#define MIICF_PHY 0 +#define MIICF_PHY_DEFAULT -1 +#define MIICF_NLOCS 1 +#define UPCCF_OFFSET 0 +#define UPCCF_OFFSET_DEFAULT -1 +#define UPCCF_NLOCS 1 +#define SPICF_SLAVE 0 +#define SPICF_NLOCS 1 diff --git a/sys/rump/dev/lib/libopencrypto/machine b/sys/rump/dev/lib/libopencrypto/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libopencrypto/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libopencrypto/opencrypto_component.c b/sys/rump/dev/lib/libopencrypto/opencrypto_component.c new file mode 100644 index 000000000..7c710085d --- /dev/null +++ b/sys/rump/dev/lib/libopencrypto/opencrypto_component.c @@ -0,0 +1,68 @@ +/* $NetBSD: opencrypto_component.c,v 1.3 2015/08/20 11:51:12 christos Exp $ */ + +/* + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: opencrypto_component.c,v 1.3 2015/08/20 11:51:12 christos Exp $"); + +#include +#include +#include +#include +#include + +#include "rump_private.h" +#include "rump_dev_private.h" +#include "rump_vfs_private.h" + +#include "ioconf.h" + +void crypto_init(void); + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern const struct cdevsw crypto_cdevsw; + devmajor_t bmaj, cmaj; + int error; + + /* go, mydevfs */ + bmaj = cmaj = -1; + + if ((error = devsw_attach("crypto", NULL, &bmaj, + &crypto_cdevsw, &cmaj)) != 0) + panic("cannot attach crypto: %d", error); + + if ((error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/crypto", + cmaj, 0)) != 0) + panic("cannot create /dev/crypto: %d", error); + + /* + * Initialize OpenCrypto and its pseudo-devices here + */ + crypto_init(); + rump_pdev_add(cryptoattach, 1); + rump_pdev_add(swcryptoattach, 0); +} diff --git a/sys/rump/dev/lib/libopencrypto/x86 b/sys/rump/dev/lib/libopencrypto/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libopencrypto/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libpad/Makefile b/sys/rump/dev/lib/libpad/Makefile new file mode 100644 index 000000000..4e72884cf --- /dev/null +++ b/sys/rump/dev/lib/libpad/Makefile @@ -0,0 +1,14 @@ +# $NetBSD: Makefile,v 1.4 2014/11/18 04:29:06 nonaka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/pad + +LIB= rumpdev_pad + +SRCS= pad.c +SRCS+= pad_component.c + +CPPFLAGS+= -I${.CURDIR}/../../../librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libpad/i386 b/sys/rump/dev/lib/libpad/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libpad/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libpad/machine b/sys/rump/dev/lib/libpad/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libpad/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libpad/pad_component.c b/sys/rump/dev/lib/libpad/pad_component.c new file mode 100644 index 000000000..b59f62bab --- /dev/null +++ b/sys/rump/dev/lib/libpad/pad_component.c @@ -0,0 +1,46 @@ +/* $NetBSD: pad_component.c,v 1.1 2014/03/13 01:52:04 pooka Exp $ */ + +/*- + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: pad_component.c,v 1.1 2014/03/13 01:52:04 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" +#include "rump_vfs_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + int error; + + if ((error = rump_vfs_makedevnodes(S_IFCHR, + "/dev/pad", '0', 189, 0, 4)) != 0) + panic("cannot create pad device: %d", error); +} diff --git a/sys/rump/dev/lib/libpad/x86 b/sys/rump/dev/lib/libpad/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libpad/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libpci/Makefile b/sys/rump/dev/lib/libpci/Makefile new file mode 100644 index 000000000..4f591f0a8 --- /dev/null +++ b/sys/rump/dev/lib/libpci/Makefile @@ -0,0 +1,46 @@ +# $NetBSD: Makefile,v 1.7 2015/08/24 23:21:50 pooka Exp $ +# + +RUMPTOP= ${TOPRUMP} + +.include + +.PATH: ${RUMPTOP}/../dev/pci + +LIB= rumpdev_pci +IOCONF= PCI.ioconf + +SRCS+= pci.c pci_map.c pci_quirks.c pci_subr.c pci_stub.c pci_usrreq.c +SRCS+= pcibusprint.c + +SRCS+= rumpdev_pci.c + +# ok, these don't _really_ belong here, but it's the only +# place they're currently useful, so let it slide +SRCS+= rumpdev_bus_space.c +SRCS+= rumpdev_bus_dma.c + +SRCS+= pci_at_mainbus.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.if ${RUMP_PCI_IOSPACE:Uno} == "yes" +.error RUMP_PCI_IOSPACE defined in Makefile. Use userfeatures.h instead. +.endif + +.PATH: ${RUMPCOMP_USER_PATH.rumpdev_pci} +RUMPCOMP_USER_SRCS= ${RUMPCOMP_USER_SRCS.rumpdev_pci} +MYDIR:= ${.PARSEDIR} +RUMPCOMP_USER_CPPFLAGS= -I${MYDIR} +RUMPCOMP_USER_CPPFLAGS+=${RUMPCOMP_USER_CPPFLAGS.rumpdev_pci} +RUMPCOMP_USER_CFLAGS= ${RUMPCOMP_USER_CFLAGS.rumpdev_pci} + +CPPFLAGS+= ${RUMPCOMP_CPPFLAGS.rumpdev_pci} + +# XXX: messy +.undef RUMPKERN_ONLY + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libpci/PCI.ioconf b/sys/rump/dev/lib/libpci/PCI.ioconf new file mode 100644 index 000000000..7d6bf5e0a --- /dev/null +++ b/sys/rump/dev/lib/libpci/PCI.ioconf @@ -0,0 +1,12 @@ +# $NetBSD: PCI.ioconf,v 1.1 2014/04/04 12:53:59 pooka Exp $ +# + +ioconf pci + +include "conf/files" +include "dev/pci/files.pci" +include "rump/dev/files.rump" + +pseudo-root mainbus* + +pci* at mainbus? bus ? diff --git a/sys/rump/dev/lib/libpci/pci_at_mainbus.c b/sys/rump/dev/lib/libpci/pci_at_mainbus.c new file mode 100644 index 000000000..0d8f1d758 --- /dev/null +++ b/sys/rump/dev/lib/libpci/pci_at_mainbus.c @@ -0,0 +1,102 @@ +/* $NetBSD: pci_at_mainbus.c,v 1.6 2015/06/15 15:38:52 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: pci_at_mainbus.c,v 1.6 2015/06/15 15:38:52 pooka Exp $"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "ioconf.c" + +#include "rump_private.h" +#include "rump_vfs_private.h" + +#include "pci_user.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern const struct cdevsw pci_cdevsw; + devmajor_t cmaj, bmaj; + int error; + + config_init_component(cfdriver_ioconf_pci, + cfattach_ioconf_pci, cfdata_ioconf_pci); + + bmaj = cmaj = -1; + if ((error = devsw_attach("pci", NULL, &bmaj, + &pci_cdevsw, &cmaj)) != 0) { + printf("pci: devsw_attach failed: %d\n", error); + return; + } + + if ((error = rump_vfs_makedevnodes(S_IFCHR, "/dev/pci", '0', + cmaj, 0, 4)) != 0) + printf("pci: failed to create /dev/pci nodes: %d\n", error); +} + +RUMP_COMPONENT(RUMP_COMPONENT_DEV_AFTERMAINBUS) +{ + struct pcibus_attach_args pba; + device_t mainbus; + + /* XXX: attach args should come from elsewhere */ + memset(&pba, 0, sizeof(pba)); + pba.pba_bus = 0; + pba.pba_iot = (bus_space_tag_t)0; + pba.pba_memt = (bus_space_tag_t)1; + pba.pba_dmat = (void *)0x20; +#ifdef _LP64 + pba.pba_dmat64 = (void *)0x40; +#endif + pba.pba_flags = PCI_FLAGS_MEM_OKAY | + PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;; + +#ifdef RUMPCOMP_USERFEATURE_PCI_IOSPACE + int error; + + error = rumpcomp_pci_iospace_init(); + if (!error) { + pba.pba_flags |= PCI_FLAGS_IO_OKAY; + } else { + aprint_error("pci: I/O space init error %d, I/O space not " + "available\n", error); + } +#endif + + mainbus = device_find_by_driver_unit("mainbus", 0); + if (!mainbus) + panic("no mainbus. use maintaxi instead?"); + config_found_ia(mainbus, "pcibus", &pba, pcibusprint); +} diff --git a/sys/rump/dev/lib/libpci/pci_user.h b/sys/rump/dev/lib/libpci/pci_user.h new file mode 100644 index 000000000..a683f8827 --- /dev/null +++ b/sys/rump/dev/lib/libpci/pci_user.h @@ -0,0 +1,39 @@ +/* + * Possible userfeature macro flags: + * + * RUMPCOMP_USERFEATURE_PCI_DMAFREE: + * Support free'ing DMA memory. If not, panic() when free() is called. + * + * RUMPCOMP_USERFEATURE_PCI_IOSPACE + * Support for PCI I/O space. If yes, rumpcomp_pci_iospace_init() + * must be provided. + */ + +#include "rumpcomp_userfeatures_pci.h" + +void *rumpcomp_pci_map(unsigned long, unsigned long); +int rumpcomp_pci_confread(unsigned, unsigned, unsigned, int, unsigned int *); +int rumpcomp_pci_confwrite(unsigned, unsigned, unsigned, int, unsigned int); + +int rumpcomp_pci_irq_map(unsigned, unsigned, unsigned, int, unsigned); +void *rumpcomp_pci_irq_establish(unsigned, int (*)(void *), void *); + +/* XXX: needs work: support boundary-restricted allocations */ +int rumpcomp_pci_dmalloc(size_t, size_t, unsigned long *, unsigned long *); +#ifdef RUMPCOMP_USERFEATURE_PCI_DMAFREE +void rumpcomp_pci_dmafree(unsigned long, size_t); +#endif + +struct rumpcomp_pci_dmaseg { + unsigned long ds_pa; + unsigned long ds_len; + unsigned long ds_vacookie; +}; +int rumpcomp_pci_dmamem_map(struct rumpcomp_pci_dmaseg *, size_t, size_t, + void **); + +unsigned long rumpcomp_pci_virt_to_mach(void *); + +#ifdef RUMPCOMP_USERFEATURE_PCI_IOSPACE +int rumpcomp_pci_iospace_init(void); +#endif diff --git a/sys/rump/dev/lib/libpci/rumpdev_bus_dma.c b/sys/rump/dev/lib/libpci/rumpdev_bus_dma.c new file mode 100644 index 000000000..87bba7018 --- /dev/null +++ b/sys/rump/dev/lib/libpci/rumpdev_bus_dma.c @@ -0,0 +1,573 @@ +/* $NetBSD: rumpdev_bus_dma.c,v 1.5 2015/06/15 15:38:52 pooka Exp $ */ + +/*- + * Copyright (c) 2013 Antti Kantee + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/*- + * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, + * NASA Ames Research Center. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * bus_dma(9) implementation which runs on top of rump kernel hypercalls. + * It's essentially the same as the PowerPC implementation its based on, + * except with some indirection and PowerPC MD features removed. + * This should/could be expected to run on x86, other archs may need + * some cache flushing hooks. + * + * From sys/arch/powerpc/powerpc/bus_dma.c: + * NetBSD: bus_dma.c,v 1.46 2012/02/01 09:54:03 matt Exp + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "pci_user.h" + +#define EIEIO membar_sync() + +int _bus_dmamap_load_buffer (bus_dma_tag_t, bus_dmamap_t, void *, + bus_size_t, struct vmspace *, int, paddr_t *, int *, int); + +/* + * Common function for DMA map creation. May be called by bus-specific + * DMA map creation functions. + */ +int +bus_dmamap_create(bus_dma_tag_t t, bus_size_t size, int nsegments, + bus_size_t maxsegsz, bus_size_t boundary, int flags, + bus_dmamap_t *dmamp) +{ + bus_dmamap_t map; + void *mapstore; + size_t mapsize; + + /* + * Allocate and initialize the DMA map. The end of the map + * is a variable-sized array of segments, so we allocate enough + * room for them in one shot. + * + * Note we don't preserve the WAITOK or NOWAIT flags. Preservation + * of ALLOCNOW notifies others that we've reserved these resources, + * and they are not to be freed. + * + * The bus_dmamap_t includes one bus_dma_segment_t, hence + * the (nsegments - 1). + */ + mapsize = sizeof(*map) + sizeof(bus_dma_segment_t [nsegments - 1]); + if ((mapstore = kmem_intr_alloc(mapsize, + (flags & BUS_DMA_NOWAIT) ? KM_NOSLEEP : KM_SLEEP)) == NULL) + return (ENOMEM); + + memset(mapstore, 0, mapsize); + map = (void *)mapstore; + map->_dm_size = size; + map->_dm_segcnt = nsegments; + map->_dm_maxmaxsegsz = maxsegsz; + map->_dm_boundary = boundary; + map->_dm_bounce_thresh = 0; + map->_dm_flags = flags & ~(BUS_DMA_WAITOK|BUS_DMA_NOWAIT); + map->dm_maxsegsz = maxsegsz; + map->dm_mapsize = 0; /* no valid mappings */ + map->dm_nsegs = 0; + + *dmamp = map; + return (0); +} + +/* + * Common function for DMA map destruction. May be called by bus-specific + * DMA map destruction functions. + */ +void +bus_dmamap_destroy(bus_dma_tag_t t, bus_dmamap_t map) +{ + + size_t mapsize = sizeof(*map) + + sizeof(bus_dma_segment_t [map->_dm_segcnt - 1]); + kmem_intr_free(map, mapsize); +} + +/* + * Utility function to load a linear buffer. lastaddrp holds state + * between invocations (for multiple-buffer loads). segp contains + * the starting segment on entrance, and the ending segment on exit. + * first indicates if this is the first invocation of this function. + */ +int +_bus_dmamap_load_buffer(bus_dma_tag_t t, bus_dmamap_t map, + void *buf, bus_size_t buflen, struct vmspace *vm, int flags, + paddr_t *lastaddrp, int *segp, int first) +{ + bus_size_t sgsize; + bus_addr_t curaddr, lastaddr, baddr, bmask; + vaddr_t vaddr = (vaddr_t)buf; + int seg; + +// printf("%s(%p,%p,%p,%u,%p,%#x,%p,%p,%u)\n", __func__, +// t, map, buf, buflen, vm, flags, lastaddrp, segp, first); + + lastaddr = *lastaddrp; + bmask = ~(map->_dm_boundary - 1); + + for (seg = *segp; buflen > 0 ; ) { + /* + * Get the physical address for this segment. + */ + if (!VMSPACE_IS_KERNEL_P(vm)) + (void) pmap_extract(vm_map_pmap(&vm->vm_map), + vaddr, (void *)&curaddr); + else + curaddr = vtophys(vaddr); + + /* + * If we're beyond the bounce threshold, notify + * the caller. + */ + if (map->_dm_bounce_thresh != 0 && + curaddr >= map->_dm_bounce_thresh) + return (EINVAL); + + /* + * Compute the segment size, and adjust counts. + */ + sgsize = PAGE_SIZE - ((u_long)vaddr & PGOFSET); + if (buflen < sgsize) + sgsize = buflen; + sgsize = min(sgsize, map->dm_maxsegsz); + + /* + * Make sure we don't cross any boundaries. + */ + if (map->_dm_boundary > 0) { + baddr = (curaddr + map->_dm_boundary) & bmask; + if (sgsize > (baddr - curaddr)) + sgsize = (baddr - curaddr); + } + + /* + * Insert chunk into a segment, coalescing with + * the previous segment if possible. + */ + if (first) { + map->dm_segs[seg].ds_addr + = rumpcomp_pci_virt_to_mach((void *)curaddr); + map->dm_segs[seg].ds_len = sgsize; + first = 0; + } else { + if (curaddr == lastaddr && + (map->dm_segs[seg].ds_len + sgsize) <= + map->dm_maxsegsz && + (map->_dm_boundary == 0 || + (map->dm_segs[seg].ds_addr & bmask) == + (rumpcomp_pci_virt_to_mach((void*)curaddr)&bmask))) + map->dm_segs[seg].ds_len += sgsize; + else { + if (++seg >= map->_dm_segcnt) + break; + map->dm_segs[seg].ds_addr = + rumpcomp_pci_virt_to_mach((void *)curaddr); + map->dm_segs[seg].ds_len = sgsize; + } + } + + lastaddr = curaddr + sgsize; + vaddr += sgsize; + buflen -= sgsize; + } + + *segp = seg; + *lastaddrp = lastaddr; + + /* + * Did we fit? + */ + if (buflen != 0) + return (EFBIG); /* XXX better return value here? */ + + return (0); +} + +/* + * Common function for loading a DMA map with a linear buffer. May + * be called by bus-specific DMA map load functions. + */ +int +bus_dmamap_load(bus_dma_tag_t t, bus_dmamap_t map, + void *buf, bus_size_t buflen, struct proc *p, int flags) +{ + paddr_t lastaddr = 0; + int seg, error; + struct vmspace *vm; + + /* + * Make sure that on error condition we return "no valid mappings". + */ + map->dm_mapsize = 0; + map->dm_nsegs = 0; + KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz); + + if (buflen > map->_dm_size) + return (EINVAL); + + if (p != NULL) { + vm = p->p_vmspace; + } else { + vm = vmspace_kernel(); + } + + seg = 0; + error = _bus_dmamap_load_buffer(t, map, buf, buflen, vm, flags, + &lastaddr, &seg, 1); + if (error == 0) { + map->dm_mapsize = buflen; + map->dm_nsegs = seg + 1; + } + return (error); +} + +/* + * Like _bus_dmamap_load(), but for mbufs. + */ +int +bus_dmamap_load_mbuf(bus_dma_tag_t t, bus_dmamap_t map, + struct mbuf *m0, int flags) +{ + paddr_t lastaddr = 0; + int seg, error, first; + struct mbuf *m; + + /* + * Make sure that on error condition we return "no valid mappings." + */ + map->dm_mapsize = 0; + map->dm_nsegs = 0; + KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz); + +#ifdef DIAGNOSTIC + if ((m0->m_flags & M_PKTHDR) == 0) + panic("_bus_dmamap_load_mbuf: no packet header"); +#endif + + if (m0->m_pkthdr.len > map->_dm_size) + return (EINVAL); + + first = 1; + seg = 0; + error = 0; + for (m = m0; m != NULL && error == 0; m = m->m_next, first = 0) { + if (m->m_len == 0) + continue; +#ifdef POOL_VTOPHYS + /* XXX Could be better about coalescing. */ + /* XXX Doesn't check boundaries. */ + switch (m->m_flags & (M_EXT|M_CLUSTER)) { + case M_EXT|M_CLUSTER: + /* XXX KDASSERT */ + KASSERT(m->m_ext.ext_paddr != M_PADDR_INVALID); + lastaddr = m->m_ext.ext_paddr + + (m->m_data - m->m_ext.ext_buf); + have_addr: + if (first == 0 && ++seg >= map->_dm_segcnt) { + error = EFBIG; + continue; + } + map->dm_segs[seg].ds_addr = + rumpcomp_pci_virt_to_mach((void *)lastaddr); + map->dm_segs[seg].ds_len = m->m_len; + lastaddr += m->m_len; + continue; + + case 0: + lastaddr = m->m_paddr + M_BUFOFFSET(m) + + (m->m_data - M_BUFADDR(m)); + goto have_addr; + + default: + break; + } +#endif + error = _bus_dmamap_load_buffer(t, map, m->m_data, + m->m_len, vmspace_kernel(), flags, &lastaddr, &seg, first); + } + if (error == 0) { + map->dm_mapsize = m0->m_pkthdr.len; + map->dm_nsegs = seg + 1; + } + return (error); +} + +/* + * Like _bus_dmamap_load(), but for uios. + */ +int +bus_dmamap_load_uio(bus_dma_tag_t t, bus_dmamap_t map, + struct uio *uio, int flags) +{ + paddr_t lastaddr = 0; + int seg, i, error, first; + bus_size_t minlen, resid; + struct iovec *iov; + void *addr; + + /* + * Make sure that on error condition we return "no valid mappings." + */ + map->dm_mapsize = 0; + map->dm_nsegs = 0; + KASSERT(map->dm_maxsegsz <= map->_dm_maxmaxsegsz); + + resid = uio->uio_resid; + iov = uio->uio_iov; + + first = 1; + seg = 0; + error = 0; + for (i = 0; i < uio->uio_iovcnt && resid != 0 && error == 0; i++) { + /* + * Now at the first iovec to load. Load each iovec + * until we have exhausted the residual count. + */ + minlen = resid < iov[i].iov_len ? resid : iov[i].iov_len; + addr = (void *)iov[i].iov_base; + + error = _bus_dmamap_load_buffer(t, map, addr, minlen, + uio->uio_vmspace, flags, &lastaddr, &seg, first); + first = 0; + + resid -= minlen; + } + if (error == 0) { + map->dm_mapsize = uio->uio_resid; + map->dm_nsegs = seg + 1; + } + return (error); +} + +/* + * Like _bus_dmamap_load(), but for raw memory allocated with + * bus_dmamem_alloc(). + */ +int +bus_dmamap_load_raw(bus_dma_tag_t t, bus_dmamap_t map, + bus_dma_segment_t *segs, int nsegs, bus_size_t size, int flags) +{ + + panic("_bus_dmamap_load_raw: not implemented"); +} + +/* + * Common function for unloading a DMA map. May be called by + * chipset-specific DMA map unload functions. + */ +void +bus_dmamap_unload(bus_dma_tag_t t, bus_dmamap_t map) +{ + + /* + * No resources to free; just mark the mappings as + * invalid. + */ + map->dm_maxsegsz = map->_dm_maxmaxsegsz; + map->dm_mapsize = 0; + map->dm_nsegs = 0; +} + +void +bus_dmamap_sync(bus_dma_tag_t t, bus_dmamap_t map, + bus_addr_t offset, bus_size_t len, int ops) +{ + + /* XXX: this might need some MD tweaks */ + membar_sync(); +} + +/* + * Common function for freeing DMA-safe memory. May be called by + * bus-specific DMA memory free functions. + */ +void +bus_dmamem_free(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs) +{ +#ifdef RUMPCOMP_USERFEATURE_PCI_DMAFREE + vaddr_t vacookie = segs[0]._ds_vacookie; + bus_size_t sizecookie = segs[0]._ds_sizecookie; + + rumpcomp_pci_dmafree(vacookie, sizecookie); +#else + panic("bus_dmamem_free not implemented"); +#endif +} + +/* + * Don't have hypercall for mapping scatter-gather memory. + * So just simply fail if there's more than one segment to map + */ +int +bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, + size_t size, void **kvap, int flags) +{ + struct rumpcomp_pci_dmaseg *dss; + size_t allocsize = nsegs * sizeof(*dss); + int rv, i; + + /* + * Though rumpcomp_pci_dmaseg "accidentally" matches the + * bus_dma segment descriptor (at least for now), act + * proper and actually translate it. + */ + dss = kmem_alloc(allocsize, KM_SLEEP); + for (i = 0; i < nsegs; i++) { + dss[i].ds_pa = segs[i].ds_addr; + dss[i].ds_len = segs[i].ds_len; + dss[i].ds_vacookie = segs[i]._ds_vacookie; + } + rv = rumpcomp_pci_dmamem_map(dss, nsegs, size, kvap); + kmem_free(dss, allocsize); + + return rv; +} + +/* + * Common function for unmapping DMA-safe memory. May be called by + * bus-specific DMA memory unmapping functions. + */ +void +bus_dmamem_unmap(bus_dma_tag_t t, void *kva, size_t size) +{ + + /* nothing to do as long as bus_dmamem_map() is what it is */ +} + +paddr_t +bus_dmamem_mmap(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs, + off_t off, int prot, int flags) +{ + + panic("bus_dmamem_mmap not supported"); +} + +/* + * Allocate physical memory from the given physical address range. + * Called by DMA-safe memory allocation methods. + */ +int +bus_dmamem_alloc(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment, + bus_size_t boundary, bus_dma_segment_t *segs, int nsegs, int *rsegs, + int flags) +{ + paddr_t curaddr, lastaddr, pa; + vaddr_t vacookie; + size_t sizecookie; + int curseg, error; + + /* Always round the size. */ + size = round_page(size); + + sizecookie = size; + + /* + * Allocate pages from the VM system. + */ +#if 0 + error = uvm_pglistalloc(size, low, high, alignment, boundary, + &mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0); +#else + /* XXX: ignores boundary, nsegs, etc. */ + //printf("dma allocation %lx %lx %d\n", alignment, boundary, nsegs); + error = rumpcomp_pci_dmalloc(size, alignment, &pa, &vacookie); +#endif + if (error) + return (error); + + /* + * Compute the location, size, and number of segments actually + * returned by the VM code. + */ + curseg = 0; + lastaddr = segs[curseg].ds_addr = pa; + segs[curseg].ds_len = PAGE_SIZE; + segs[curseg]._ds_vacookie = vacookie; + segs[curseg]._ds_sizecookie = sizecookie; + size -= PAGE_SIZE; + pa += PAGE_SIZE; + vacookie += PAGE_SIZE; + + for (; size; + pa += PAGE_SIZE, vacookie += PAGE_SIZE, size -= PAGE_SIZE) { + curaddr = pa; + if (curaddr == (lastaddr + PAGE_SIZE) && + (lastaddr & boundary) == (curaddr & boundary)) { + segs[curseg].ds_len += PAGE_SIZE; + } else { + curseg++; + if (curseg >= nsegs) + return EFBIG; + segs[curseg].ds_addr = curaddr; + segs[curseg].ds_len = PAGE_SIZE; + segs[curseg]._ds_vacookie = vacookie; + segs[curseg]._ds_sizecookie = sizecookie; + } + lastaddr = curaddr; + } + *rsegs = curseg + 1; + + return (0); +} diff --git a/sys/rump/dev/lib/libpci/rumpdev_bus_space.c b/sys/rump/dev/lib/libpci/rumpdev_bus_space.c new file mode 100644 index 000000000..2091fbb7c --- /dev/null +++ b/sys/rump/dev/lib/libpci/rumpdev_bus_space.c @@ -0,0 +1,285 @@ +/* $NetBSD: rumpdev_bus_space.c,v 1.6 2015/08/11 22:28:34 pooka Exp $ */ + +/*- + * Copyright (c) 2013 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +#include + +#include + +#include "pci_user.h" + +#if defined(RUMPCOMP_USERFEATURE_PCI_IOSPACE) \ + && (defined(__i386__) || defined(__x86_64__)) +#define IOSPACE_SUPPORTED +#endif + +int +bus_space_map(bus_space_tag_t bst, bus_addr_t address, bus_size_t size, + int flags, bus_space_handle_t *handlep) +{ + int rv; + + /* + * I/O space we just "let it bli" in case someone wants to + * map it (e.g. on Xen) + * + * Memory space needs to be mapped into our guest, so we + * make a hypercall to request it. + */ + if (bst == 0) { +#ifdef IOSPACE_SUPPORTED + *handlep = address; + rv = 0; +#else + rv = ENOTSUP; +#endif + } else { + *handlep = (bus_space_handle_t)rumpcomp_pci_map(address, size); + rv = *handlep ? 0 : EINVAL; + } + + return rv; +} + +uint8_t +bus_space_read_1(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset) +{ + uint8_t rv; + + if (bst == 0) { +#ifdef IOSPACE_SUPPORTED + unsigned short addr = bsh + offset; + __asm__ __volatile__("inb %1, %0" : "=a"(rv) : "d"(addr)); +#else + panic("IO space not supported"); +#endif + } else { + rv = *(volatile uint8_t *)(bsh + offset); + } + + return rv; +} + +uint16_t +bus_space_read_2(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset) +{ + uint16_t rv; + + if (bst == 0) { +#ifdef IOSPACE_SUPPORTED + unsigned short addr = bsh + offset; + __asm__ __volatile__("in %1, %0" : "=a"(rv) : "d"(addr)); +#else + panic("IO space not supported"); +#endif + } else { + rv = *(volatile uint16_t *)(bsh + offset); + } + + return rv; +} + +uint32_t +bus_space_read_4(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset) +{ + uint32_t rv; + + if (bst == 0) { +#ifdef IOSPACE_SUPPORTED + unsigned short addr = bsh + offset; + __asm__ __volatile__("inl %1, %0" : "=a"(rv) : "d"(addr)); +#else + panic("IO space not supported"); +#endif + } else { + rv = *(volatile uint32_t *)(bsh + offset); + } + + return rv; +} + +void +bus_space_read_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset, uint8_t *datap, bus_size_t count) +{ + + while (count--) { + *datap++ = bus_space_read_1(bst, bsh, offset); + bus_space_barrier(bst, bsh, offset, 1, BUS_SPACE_BARRIER_READ); + } +} + +void +bus_space_read_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset, uint16_t *datap, bus_size_t count) +{ + + while (count--) { + *datap++ = bus_space_read_2(bst, bsh, offset); + bus_space_barrier(bst, bsh, offset, 2, BUS_SPACE_BARRIER_READ); + } +} + +void +bus_space_read_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset, uint32_t *datap, bus_size_t count) +{ + + while (count--) { + *datap++ = bus_space_read_4(bst, bsh, offset); + bus_space_barrier(bst, bsh, offset, 4, BUS_SPACE_BARRIER_READ); + } +} + +void +bus_space_write_1(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset, uint8_t v) +{ + + if (bst == 0) { +#ifdef IOSPACE_SUPPORTED + unsigned short addr = bsh + offset; + __asm__ __volatile__("outb %0, %1" :: "a"(v), "d"(addr)); +#else + panic("IO space not supported"); +#endif + } else { + *(volatile uint8_t *)(bsh + offset) = v; + } +} + +void +bus_space_write_2(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset, uint16_t v) +{ + + if (bst == 0) { +#ifdef IOSPACE_SUPPORTED + unsigned short addr = bsh + offset; + __asm__ __volatile__("out %0, %1" :: "a"(v), "d"(addr)); +#else + panic("IO space not supported"); +#endif + } else { + *(volatile uint16_t *)(bsh + offset) = v; + } +} + +void +bus_space_write_4(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset, uint32_t v) +{ + + if (bst == 0) { +#ifdef IOSPACE_SUPPORTED + unsigned short addr = bsh + offset; + __asm__ __volatile__("outl %0, %1" :: "a"(v), "d"(addr)); +#else + panic("IO space not supported"); +#endif + } else { + *(volatile uint32_t *)(bsh + offset) = v; + } +} + +void +bus_space_write_multi_1(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset, const uint8_t *datap, bus_size_t count) +{ + + while (count--) { + const uint8_t value = *datap++; + + bus_space_write_1(bst, bsh, offset, value); + bus_space_barrier(bst, bsh, offset, 1, BUS_SPACE_BARRIER_WRITE); + } +} + +void +bus_space_write_multi_2(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset, const uint16_t *datap, bus_size_t count) +{ + + while (count--) { + const uint16_t value = *datap++; + + bus_space_write_2(bst, bsh, offset, value); + bus_space_barrier(bst, bsh, offset, 2, BUS_SPACE_BARRIER_WRITE); + } +} + +void +bus_space_write_multi_4(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset, const uint32_t *datap, bus_size_t count) +{ + + while (count--) { + const uint32_t value = *datap++; + + bus_space_write_4(bst, bsh, offset, value); + bus_space_barrier(bst, bsh, offset, 4, BUS_SPACE_BARRIER_WRITE); + } +} + +paddr_t +bus_space_mmap(bus_space_tag_t bst, bus_addr_t addr, off_t off, + int prot, int flags) +{ + + panic("%s: unimplemented", __func__); +} + +int +bus_space_subregion(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset, bus_size_t size, bus_space_handle_t *nhandlep) +{ + + *nhandlep = bsh + offset; + return 0; +} + +void +bus_space_unmap(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t size) +{ + + panic("%s: unimplemented", __func__); +} + +void +bus_space_barrier(bus_space_tag_t bst, bus_space_handle_t bsh, + bus_size_t offset, bus_size_t len, int flags) +{ + + /* weelll ... */ + membar_sync(); +} diff --git a/sys/rump/dev/lib/libpci/rumpdev_pci.c b/sys/rump/dev/lib/libpci/rumpdev_pci.c new file mode 100644 index 000000000..249076ab3 --- /dev/null +++ b/sys/rump/dev/lib/libpci/rumpdev_pci.c @@ -0,0 +1,191 @@ +/* $NetBSD: rumpdev_pci.c,v 1.5 2015/05/17 13:51:31 pooka Exp $ */ + +/* + * Copyright (c) 2013 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: rumpdev_pci.c,v 1.5 2015/05/17 13:51:31 pooka Exp $"); + +#include +#include +#include + +#include + +#include "pci_user.h" + +void +pci_attach_hook(device_t parent, device_t self, struct pcibus_attach_args *pba) +{ + + /* nada */ +} + +int +pci_bus_maxdevs(pci_chipset_tag_t pc, int busno) +{ + + return 32; +} + +pcitag_t +pci_make_tag(pci_chipset_tag_t pc, int bus, int device, int function) +{ + pcitag_t pt; + int *tag; + unsigned csr; + int rv; + + CTASSERT(sizeof(pt) >= sizeof(int)); + + /* a "bit" ugly, but keeps us MI */ + tag = (int *)&pt; + *tag = (bus << 16) | (device << 8) | (function << 0); + + /* + * On Xen, we need to enable the device io/mem space. + * Doesn't really belong here, but we need to do it somewhere. + */ + rv = rumpcomp_pci_confread(bus, device, function, + PCI_COMMAND_STATUS_REG, &csr); + if (rv == 0 && (csr & PCI_COMMAND_MEM_ENABLE) == 0) { + rumpcomp_pci_confwrite(bus, device, function, + PCI_COMMAND_STATUS_REG, csr | PCI_COMMAND_MEM_ENABLE); + } + + return pt; +} + +pcireg_t +pci_conf_read(pci_chipset_tag_t pc, pcitag_t tag, int reg) +{ + unsigned int rv; + int bus, device, fun; + + pci_decompose_tag(pc, tag, &bus, &device, &fun); + rumpcomp_pci_confread(bus, device, fun, reg, &rv); + return rv; +} + +void +pci_conf_write(pci_chipset_tag_t pc, pcitag_t tag, int reg, pcireg_t data) +{ + int bus, device, fun; + + pci_decompose_tag(pc, tag, &bus, &device, &fun); + rumpcomp_pci_confwrite(bus, device, fun, reg, data); +} + +void +pci_decompose_tag(pci_chipset_tag_t pc, pcitag_t tag, + int *bp, int *dp, int *fp) +{ + int *t = (int *)&tag; + + *bp = (*t >> 16) & 0xff; + *dp = (*t >> 8) & 0xff; + *fp = (*t >> 0) & 0xff; +} + +/* + * Well, yay, deal with the wonders of weird_t. We'll just + * assume it's an integral type (which, btw, isn't universally true). + * The hypercall will map "cookie" to its internal structure. + * Dial _t for a good time. + */ +int +pci_intr_map(const struct pci_attach_args *pa, pci_intr_handle_t *ih) +{ + static unsigned int intrhandle; + unsigned cookie; + int rv; + + cookie = atomic_inc_uint_nv(&intrhandle); + rv = rumpcomp_pci_irq_map(pa->pa_bus, + pa->pa_device, pa->pa_function, pa->pa_intrline, cookie); + if (rv == 0) + *ih = cookie; + return 0; +} + +const char * +pci_intr_string(pci_chipset_tag_t pc, pci_intr_handle_t ih, + char *buf, size_t buflen) +{ + + snprintf(buf, buflen, "pausebreak"); + return buf; +} + +void * +pci_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih, + int level, int (*func)(void *), void *arg) +{ + + return rumpcomp_pci_irq_establish(ih, func, arg); +} + +int +pci_intr_setattr(pci_chipset_tag_t pc, pci_intr_handle_t *ih, + int attr, uint64_t data) +{ + + switch (attr) { + case PCI_INTR_MPSAFE: + return 0; + default: + return ENODEV; + } +} + +void +pci_intr_disestablish(pci_chipset_tag_t pc, void *not_your_above_ih) +{ + + panic("%s: unimplemented", __func__); +} + +#ifdef __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH +#include +#include +#include +#include + +void * +pciide_machdep_compat_intr_establish(device_t dev, + const struct pci_attach_args *pa, int chan, + int (*func)(void *), void *arg) +{ + pci_intr_handle_t ih; + struct pci_attach_args mypa = *pa; + + mypa.pa_intrline = PCIIDE_COMPAT_IRQ(chan); + if (pci_intr_map(&mypa, &ih) != 0) + return NULL; + return rumpcomp_pci_irq_establish(ih, func, arg); +} + +__strong_alias(pciide_machdep_compat_intr_disestablish,pci_intr_disestablish); +#endif /* __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH */ diff --git a/sys/rump/dev/lib/libpci_auich/Makefile b/sys/rump/dev/lib/libpci_auich/Makefile new file mode 100644 index 000000000..17f2929ae --- /dev/null +++ b/sys/rump/dev/lib/libpci_auich/Makefile @@ -0,0 +1,18 @@ +# $NetBSD: Makefile,v 1.1 2015/06/03 14:06:19 pooka Exp $ +# + +RUMPTOP=${TOPRUMP} + +.PATH: ${RUMPTOP}/../dev/pci + +LIB= rumpdev_pci_auich +IOCONF= PCI_AUICH.ioconf +SRCS= auich_at_pci.c +SRCS+= auich.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/../dev +CPPFLAGS+= -I${.CURDIR}/../libaudio + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libpci_auich/PCI_AUICH.ioconf b/sys/rump/dev/lib/libpci_auich/PCI_AUICH.ioconf new file mode 100644 index 000000000..ca056e4ce --- /dev/null +++ b/sys/rump/dev/lib/libpci_auich/PCI_AUICH.ioconf @@ -0,0 +1,11 @@ +# $NetBSD: PCI_AUICH.ioconf,v 1.1 2015/06/03 14:06:19 pooka Exp $ +# + +ioconf pci_auich + +include "conf/files" +include "dev/pci/files.pci" + +pseudo-root pci* + +auich* at pci? diff --git a/sys/rump/dev/lib/libpci_auich/auich_at_pci.c b/sys/rump/dev/lib/libpci_auich/auich_at_pci.c new file mode 100644 index 000000000..8a5414b5a --- /dev/null +++ b/sys/rump/dev/lib/libpci_auich/auich_at_pci.c @@ -0,0 +1,45 @@ +/* $NetBSD: auich_at_pci.c,v 1.1 2015/06/03 14:06:19 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: auich_at_pci.c,v 1.1 2015/06/03 14:06:19 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" + +#include "ioconf.c" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_pci_auich, + cfattach_ioconf_pci_auich, cfdata_ioconf_pci_auich); +} diff --git a/sys/rump/dev/lib/libpci_eap/Makefile b/sys/rump/dev/lib/libpci_eap/Makefile new file mode 100644 index 000000000..6847fa000 --- /dev/null +++ b/sys/rump/dev/lib/libpci_eap/Makefile @@ -0,0 +1,18 @@ +# $NetBSD: Makefile,v 1.1 2014/11/18 08:43:03 pooka Exp $ +# + +RUMPTOP=${TOPRUMP} + +.PATH: ${RUMPTOP}/../dev/pci + +LIB= rumpdev_pci_eap +IOCONF= PCI_EAP.ioconf +SRCS= eap_at_pci.c +SRCS+= eap.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/../dev +CPPFLAGS+= -I${.CURDIR}/../libaudio + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libpci_eap/PCI_EAP.ioconf b/sys/rump/dev/lib/libpci_eap/PCI_EAP.ioconf new file mode 100644 index 000000000..0932d2b9b --- /dev/null +++ b/sys/rump/dev/lib/libpci_eap/PCI_EAP.ioconf @@ -0,0 +1,11 @@ +# $NetBSD: PCI_EAP.ioconf,v 1.1 2014/11/18 08:43:03 pooka Exp $ +# + +ioconf pci_eap + +include "conf/files" +include "dev/pci/files.pci" + +pseudo-root pci* + +eap* at pci? diff --git a/sys/rump/dev/lib/libpci_eap/eap_at_pci.c b/sys/rump/dev/lib/libpci_eap/eap_at_pci.c new file mode 100644 index 000000000..3d3b43e3e --- /dev/null +++ b/sys/rump/dev/lib/libpci_eap/eap_at_pci.c @@ -0,0 +1,45 @@ +/* $NetBSD: eap_at_pci.c,v 1.1 2014/11/18 08:43:03 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: eap_at_pci.c,v 1.1 2014/11/18 08:43:03 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" + +#include "ioconf.c" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_pci_eap, + cfattach_ioconf_pci_eap, cfdata_ioconf_pci_eap); +} diff --git a/sys/rump/dev/lib/libpci_eap/joy_eap.h b/sys/rump/dev/lib/libpci_eap/joy_eap.h new file mode 100644 index 000000000..56bef2a51 --- /dev/null +++ b/sys/rump/dev/lib/libpci_eap/joy_eap.h @@ -0,0 +1 @@ +/* $NetBSD: joy_eap.h,v 1.1 2014/11/18 08:43:03 pooka Exp $ */ diff --git a/sys/rump/dev/lib/libpci_hdaudio/Makefile b/sys/rump/dev/lib/libpci_hdaudio/Makefile new file mode 100644 index 000000000..defa46f6d --- /dev/null +++ b/sys/rump/dev/lib/libpci_hdaudio/Makefile @@ -0,0 +1,14 @@ +# $NetBSD: Makefile,v 1.2 2015/03/28 14:09:59 jmcneill Exp $ +# + +RUMPTOP=${TOPRUMP} + +.include +.include "${NETBSDSRCDIR}/sys/modules/hdaudio/Makefile.inc" +.include "${NETBSDSRCDIR}/sys/modules/hdaudio_pci/Makefile.inc" + +LIB= rumpdev_pci_hdaudio + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libpci_if_iwn/Makefile b/sys/rump/dev/lib/libpci_if_iwn/Makefile new file mode 100644 index 000000000..c5b2cc13a --- /dev/null +++ b/sys/rump/dev/lib/libpci_if_iwn/Makefile @@ -0,0 +1,19 @@ +# $NetBSD: Makefile,v 1.1 2014/04/07 01:45:36 pooka Exp $ +# + +RUMPTOP=${TOPRUMP} + +.PATH: ${RUMPTOP}/../dev/pci + +LIB= rumpdev_pci_if_iwn +IOCONF= PCI_IF_IWN.ioconf + +SRCS= iwn_at_pci.c + +SRCS+= if_iwn.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libpci_if_iwn/PCI_IF_IWN.ioconf b/sys/rump/dev/lib/libpci_if_iwn/PCI_IF_IWN.ioconf new file mode 100644 index 000000000..52481148b --- /dev/null +++ b/sys/rump/dev/lib/libpci_if_iwn/PCI_IF_IWN.ioconf @@ -0,0 +1,12 @@ +# $NetBSD: PCI_IF_IWN.ioconf,v 1.1 2014/04/07 01:45:36 pooka Exp $ +# + +ioconf pci_if_iwn + +include "conf/files" +include "dev/pci/files.pci" +include "rump/dev/files.rump" + +pseudo-root pci* + +iwn* at pci? dev ? function ? # Intel PRO/Wireless diff --git a/sys/rump/dev/lib/libpci_if_iwn/iwn_at_pci.c b/sys/rump/dev/lib/libpci_if_iwn/iwn_at_pci.c new file mode 100644 index 000000000..a16907066 --- /dev/null +++ b/sys/rump/dev/lib/libpci_if_iwn/iwn_at_pci.c @@ -0,0 +1,45 @@ +/* $NetBSD: iwn_at_pci.c,v 1.1 2014/04/07 01:45:36 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: iwn_at_pci.c,v 1.1 2014/04/07 01:45:36 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" + +#include "ioconf.c" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_pci_if_iwn, + cfattach_ioconf_pci_if_iwn, cfdata_ioconf_pci_if_iwn); +} diff --git a/sys/rump/dev/lib/libpci_if_pcn/Makefile b/sys/rump/dev/lib/libpci_if_pcn/Makefile new file mode 100644 index 000000000..d48c49100 --- /dev/null +++ b/sys/rump/dev/lib/libpci_if_pcn/Makefile @@ -0,0 +1,19 @@ +# $NetBSD: Makefile,v 1.1 2014/08/13 15:01:32 pooka Exp $ +# + +RUMPTOP=${TOPRUMP} + +.PATH: ${RUMPTOP}/../dev/pci + +LIB= rumpdev_pci_if_pcn +IOCONF= PCI_IF_PCN.ioconf + +SRCS= pcn_at_pci.c + +SRCS+= if_pcn.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libpci_if_pcn/PCI_IF_PCN.ioconf b/sys/rump/dev/lib/libpci_if_pcn/PCI_IF_PCN.ioconf new file mode 100644 index 000000000..cba352d9b --- /dev/null +++ b/sys/rump/dev/lib/libpci_if_pcn/PCI_IF_PCN.ioconf @@ -0,0 +1,11 @@ +# $NetBSD: PCI_IF_PCN.ioconf,v 1.1 2014/08/13 15:01:32 pooka Exp $ +# + +ioconf pci_if_pcn + +include "conf/files" +include "dev/pci/files.pci" + +pseudo-root pci* + +pcn* at pci? dev ? function ? diff --git a/sys/rump/dev/lib/libpci_if_pcn/pcn_at_pci.c b/sys/rump/dev/lib/libpci_if_pcn/pcn_at_pci.c new file mode 100644 index 000000000..ef35f68d8 --- /dev/null +++ b/sys/rump/dev/lib/libpci_if_pcn/pcn_at_pci.c @@ -0,0 +1,44 @@ +/* $NetBSD: pcn_at_pci.c,v 1.1 2014/08/13 15:01:32 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: pcn_at_pci.c,v 1.1 2014/08/13 15:01:32 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" +#include "ioconf.c" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_pci_if_pcn, + cfattach_ioconf_pci_if_pcn, cfdata_ioconf_pci_if_pcn); +} diff --git a/sys/rump/dev/lib/libpci_if_wm/Makefile b/sys/rump/dev/lib/libpci_if_wm/Makefile new file mode 100644 index 000000000..ee693f3ac --- /dev/null +++ b/sys/rump/dev/lib/libpci_if_wm/Makefile @@ -0,0 +1,19 @@ +# $NetBSD: Makefile,v 1.1 2014/04/04 14:49:09 pooka Exp $ +# + +RUMPTOP=${TOPRUMP} + +.PATH: ${RUMPTOP}/../dev/pci + +LIB= rumpdev_pci_if_wm +IOCONF= PCI_IF_WM.ioconf + +SRCS= wm_at_pci.c + +SRCS+= if_wm.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libpci_if_wm/PCI_IF_WM.ioconf b/sys/rump/dev/lib/libpci_if_wm/PCI_IF_WM.ioconf new file mode 100644 index 000000000..3dba314e3 --- /dev/null +++ b/sys/rump/dev/lib/libpci_if_wm/PCI_IF_WM.ioconf @@ -0,0 +1,12 @@ +# $NetBSD: PCI_IF_WM.ioconf,v 1.1 2014/04/04 14:49:09 pooka Exp $ +# + +ioconf pci_if_wm + +include "conf/files" +include "dev/pci/files.pci" +include "rump/dev/files.rump" + +pseudo-root pci* + +wm* at pci? dev ? function ? # Intel gigabit diff --git a/sys/rump/dev/lib/libpci_if_wm/wm_at_pci.c b/sys/rump/dev/lib/libpci_if_wm/wm_at_pci.c new file mode 100644 index 000000000..9c8bb852f --- /dev/null +++ b/sys/rump/dev/lib/libpci_if_wm/wm_at_pci.c @@ -0,0 +1,45 @@ +/* $NetBSD: wm_at_pci.c,v 1.1 2014/04/04 14:49:09 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: wm_at_pci.c,v 1.1 2014/04/04 14:49:09 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" + +#include "ioconf.c" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_pci_if_wm, + cfattach_ioconf_pci_if_wm, cfdata_ioconf_pci_if_wm); +} diff --git a/sys/rump/dev/lib/libpci_usbhc/Makefile b/sys/rump/dev/lib/libpci_usbhc/Makefile new file mode 100644 index 000000000..09da6fca0 --- /dev/null +++ b/sys/rump/dev/lib/libpci_usbhc/Makefile @@ -0,0 +1,21 @@ +# $NetBSD: Makefile,v 1.2 2015/08/24 23:21:51 pooka Exp $ +# + +RUMPTOP=${TOPRUMP} + +.PATH: ${RUMPTOP}/../dev/pci ${RUMPTOP}/../dev/usb + +LIB= rumpdev_pci_usbhc +IOCONF= PCI_USBHC.ioconf +SRCS= usbhc_at_pci.c + +SRCS+= ohci_pci.c ohci.c +SRCS+= uhci_pci.c uhci.c +SRCS+= ehci_pci.c ehci.c +SRCS+= usb_pci.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/../dev + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libpci_usbhc/PCI_USBHC.ioconf b/sys/rump/dev/lib/libpci_usbhc/PCI_USBHC.ioconf new file mode 100644 index 000000000..4c324d0fb --- /dev/null +++ b/sys/rump/dev/lib/libpci_usbhc/PCI_USBHC.ioconf @@ -0,0 +1,13 @@ +# $NetBSD: PCI_USBHC.ioconf,v 1.1 2015/05/20 12:21:38 pooka Exp $ +# + +ioconf pci_usbhc + +include "conf/files" +include "dev/pci/files.pci" + +pseudo-root pci* + +ohci* at pci? +uhci* at pci? +ehci* at pci? diff --git a/sys/rump/dev/lib/libpci_usbhc/ehci.h b/sys/rump/dev/lib/libpci_usbhc/ehci.h new file mode 100644 index 000000000..927bd3380 --- /dev/null +++ b/sys/rump/dev/lib/libpci_usbhc/ehci.h @@ -0,0 +1,5 @@ +/* $NetBSD: ehci.h,v 1.1 2015/05/20 12:21:38 pooka Exp $ */ + +#define NEHCI 1 +#define NOHCI 1 +#define NUHCI 1 diff --git a/sys/rump/dev/lib/libpci_usbhc/ohci.h b/sys/rump/dev/lib/libpci_usbhc/ohci.h new file mode 100644 index 000000000..8a1b1ef60 --- /dev/null +++ b/sys/rump/dev/lib/libpci_usbhc/ohci.h @@ -0,0 +1,5 @@ +/* $NetBSD: ohci.h,v 1.1 2015/05/20 12:21:38 pooka Exp $ */ + +#define NEHCI 1 +#define NOHCI 1 +#define NUHCI 1 diff --git a/sys/rump/dev/lib/libpci_usbhc/uhci.h b/sys/rump/dev/lib/libpci_usbhc/uhci.h new file mode 100644 index 000000000..c982a5fb2 --- /dev/null +++ b/sys/rump/dev/lib/libpci_usbhc/uhci.h @@ -0,0 +1,5 @@ +/* $NetBSD: uhci.h,v 1.1 2015/05/20 12:21:38 pooka Exp $ */ + +#define NEHCI 1 +#define NOHCI 1 +#define NUHCI 1 diff --git a/sys/rump/dev/lib/libpci_usbhc/usbhc_at_pci.c b/sys/rump/dev/lib/libpci_usbhc/usbhc_at_pci.c new file mode 100644 index 000000000..58c5b7246 --- /dev/null +++ b/sys/rump/dev/lib/libpci_usbhc/usbhc_at_pci.c @@ -0,0 +1,45 @@ +/* $NetBSD: usbhc_at_pci.c,v 1.1 2015/05/20 12:21:38 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: usbhc_at_pci.c,v 1.1 2015/05/20 12:21:38 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" + +#include "ioconf.c" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_pci_usbhc, + cfattach_ioconf_pci_usbhc, cfdata_ioconf_pci_usbhc); +} diff --git a/sys/rump/dev/lib/libpci_virtio/Makefile b/sys/rump/dev/lib/libpci_virtio/Makefile new file mode 100644 index 000000000..f224b8576 --- /dev/null +++ b/sys/rump/dev/lib/libpci_virtio/Makefile @@ -0,0 +1,19 @@ +# $NetBSD: Makefile,v 1.1 2014/08/22 09:45:29 pooka Exp $ +# + +RUMPTOP=${TOPRUMP} + +.PATH: ${RUMPTOP}/../dev/pci + +LIB= rumpdev_pci_virtio +IOCONF= PCI_VIRTIO.ioconf + +SRCS= virtio_at_pci.c + +SRCS+= virtio.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libpci_virtio/PCI_VIRTIO.ioconf b/sys/rump/dev/lib/libpci_virtio/PCI_VIRTIO.ioconf new file mode 100644 index 000000000..afc56451c --- /dev/null +++ b/sys/rump/dev/lib/libpci_virtio/PCI_VIRTIO.ioconf @@ -0,0 +1,12 @@ +# $NetBSD: PCI_VIRTIO.ioconf,v 1.1 2014/08/22 09:45:29 pooka Exp $ +# + +ioconf pci_virtio + +include "conf/files" +include "dev/pci/files.pci" +include "rump/dev/files.rump" + +pseudo-root pci* + +virtio* at pci? dev ? function ? # Virtio PCI device diff --git a/sys/rump/dev/lib/libpci_virtio/virtio_at_pci.c b/sys/rump/dev/lib/libpci_virtio/virtio_at_pci.c new file mode 100644 index 000000000..3269d2af8 --- /dev/null +++ b/sys/rump/dev/lib/libpci_virtio/virtio_at_pci.c @@ -0,0 +1,45 @@ +/* $NetBSD: virtio_at_pci.c,v 1.1 2014/08/22 09:45:29 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: virtio_at_pci.c,v 1.1 2014/08/22 09:45:29 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" + +#include "ioconf.c" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_pci_virtio, + cfattach_ioconf_pci_virtio, cfdata_ioconf_pci_virtio); +} diff --git a/sys/rump/dev/lib/libpud/Makefile b/sys/rump/dev/lib/libpud/Makefile new file mode 100644 index 000000000..278dfd984 --- /dev/null +++ b/sys/rump/dev/lib/libpud/Makefile @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.2 2014/03/13 01:53:04 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/pud + +LIB= rumpdev_pud + +SRCS= pud.c pud_dev.c + +SRCS+= pud_component.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libpud/i386 b/sys/rump/dev/lib/libpud/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libpud/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libpud/machine b/sys/rump/dev/lib/libpud/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libpud/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libpud/pud_component.c b/sys/rump/dev/lib/libpud/pud_component.c new file mode 100644 index 000000000..7b4d22d68 --- /dev/null +++ b/sys/rump/dev/lib/libpud/pud_component.c @@ -0,0 +1,45 @@ +/* $NetBSD: pud_component.c,v 1.1 2014/03/13 01:53:04 pooka Exp $ */ + +/* + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: pud_component.c,v 1.1 2014/03/13 01:53:04 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" +#include "rump_vfs_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + int error; + + if ((error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/pud", 178, 1)) != 0) + panic("cannot create /dev/pud: %d", error); +} diff --git a/sys/rump/dev/lib/libpud/x86 b/sys/rump/dev/lib/libpud/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libpud/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libputter/Makefile b/sys/rump/dev/lib/libputter/Makefile new file mode 100644 index 000000000..e9b4a037b --- /dev/null +++ b/sys/rump/dev/lib/libputter/Makefile @@ -0,0 +1,14 @@ +# $NetBSD: Makefile,v 1.6 2014/03/13 01:53:48 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/putter + +LIB= rumpdev_putter + +SRCS= putter.c +SRCS+= putter_component.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libputter/i386 b/sys/rump/dev/lib/libputter/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libputter/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libputter/machine b/sys/rump/dev/lib/libputter/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libputter/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libputter/putter_component.c b/sys/rump/dev/lib/libputter/putter_component.c new file mode 100644 index 000000000..95e1e1e36 --- /dev/null +++ b/sys/rump/dev/lib/libputter/putter_component.c @@ -0,0 +1,46 @@ +/* $NetBSD: putter_component.c,v 1.1 2014/03/13 01:53:48 pooka Exp $ */ + +/*- + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: putter_component.c,v 1.1 2014/03/13 01:53:48 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" +#include "rump_vfs_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + int error; + + if ((error = rump_vfs_makeonedevnode(S_IFCHR, + "/dev/putter", 178, 0)) != 0) + panic("cannot create /dev/putter: %d", error); +} diff --git a/sys/rump/dev/lib/libputter/x86 b/sys/rump/dev/lib/libputter/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libputter/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libraidframe/Makefile b/sys/rump/dev/lib/libraidframe/Makefile new file mode 100644 index 000000000..0299d9b05 --- /dev/null +++ b/sys/rump/dev/lib/libraidframe/Makefile @@ -0,0 +1,35 @@ +# $NetBSD: Makefile,v 1.8 2015/08/20 11:58:26 christos Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/raidframe + +LIB= rumpdev_raidframe +IOCONF= RAIDFRAME.ioconf +SRCS= rf_acctrace.c rf_alloclist.c rf_aselect.c rf_callback.c \ + rf_chaindecluster.c rf_copyback.c rf_cvscan.c rf_dagdegrd.c \ + rf_dagdegwr.c rf_dagffrd.c rf_dagffwr.c rf_dagfuncs.c \ + rf_dagutils.c rf_debugMem.c rf_debugprint.c rf_decluster.c \ + rf_declusterPQ.c rf_diskqueue.c rf_disks.c rf_driver.c \ + rf_engine.c rf_evenodd.c rf_evenodd_dagfuncs.c rf_evenodd_dags.c\ + rf_fifo.c rf_interdecluster.c rf_invertq.c rf_layout.c \ + rf_map.c rf_mcpair.c rf_netbsdkintf.c rf_nwayxor.c rf_options.c \ + rf_paritylog.c rf_paritylogDiskMgr.c rf_paritylogging.c \ + rf_parityloggingdags.c rf_parityscan.c rf_pq.c rf_pqdeg.c \ + rf_pqdegdags.c rf_psstatus.c rf_raid0.c rf_raid1.c rf_raid4.c \ + rf_raid5.c rf_raid5_rotatedspare.c rf_reconbuffer.c \ + rf_reconmap.c rf_reconstruct.c rf_reconutil.c rf_revent.c \ + rf_shutdown.c rf_sstf.c rf_states.c rf_stripelocks.c \ + rf_strutils.c rf_utils.c rf_paritymap.c + +SRCS+= raidframe_component.c + +.include + +.if !empty(RUMP_NBCOMPAT:M50) +SRCS+= rf_compat50.c +.endif + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libraidframe/RAIDFRAME.ioconf b/sys/rump/dev/lib/libraidframe/RAIDFRAME.ioconf new file mode 100644 index 000000000..ca3090c3d --- /dev/null +++ b/sys/rump/dev/lib/libraidframe/RAIDFRAME.ioconf @@ -0,0 +1,8 @@ +# $NetBSD: RAIDFRAME.ioconf,v 1.1 2015/08/20 11:51:12 christos Exp $ +# + +ioconf raidframe + +include "conf/files" + +pseudo-device raid diff --git a/sys/rump/dev/lib/libraidframe/i386 b/sys/rump/dev/lib/libraidframe/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libraidframe/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libraidframe/ioconf.c b/sys/rump/dev/lib/libraidframe/ioconf.c new file mode 100644 index 000000000..45bccb20d --- /dev/null +++ b/sys/rump/dev/lib/libraidframe/ioconf.c @@ -0,0 +1,32 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libraidframe/RAIDFRAME.ioconf" + */ + +#include +#include +#include +#include + + + +static struct cfdriver * const cfdriver_ioconf_raidframe[] = { + NULL +}; + + + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_raidframe[] = { + /* driver attachment unit state loc flags pspec */ + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + + +static const struct cfattachinit cfattach_ioconf_raidframe[] = { + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libraidframe/ioconf.h b/sys/rump/dev/lib/libraidframe/ioconf.h new file mode 100644 index 000000000..861041417 --- /dev/null +++ b/sys/rump/dev/lib/libraidframe/ioconf.h @@ -0,0 +1,4 @@ + +/* pseudo-devices */ + +/* driver structs */ diff --git a/sys/rump/dev/lib/libraidframe/locators.h b/sys/rump/dev/lib/libraidframe/locators.h new file mode 100644 index 000000000..e69de29bb diff --git a/sys/rump/dev/lib/libraidframe/machine b/sys/rump/dev/lib/libraidframe/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libraidframe/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libraidframe/raidframe_component.c b/sys/rump/dev/lib/libraidframe/raidframe_component.c new file mode 100644 index 000000000..b94b24f7f --- /dev/null +++ b/sys/rump/dev/lib/libraidframe/raidframe_component.c @@ -0,0 +1,70 @@ +/* $NetBSD: raidframe_component.c,v 1.2 2015/08/20 11:51:12 christos Exp $ */ + +/* + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: raidframe_component.c,v 1.2 2015/08/20 11:51:12 christos Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" +#include "rump_dev_private.h" +#include "rump_vfs_private.h" + +#include "ioconf.h" + +CFDRIVER_DECL(raid, DV_DISK, NULL); + +#if defined(__minix) +void raidattach(int); +#endif + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern const struct bdevsw raid_bdevsw; + extern const struct cdevsw raid_cdevsw; + devmajor_t bmaj, cmaj; + int error; + + config_cfdriver_attach(&raid_cd); + + bmaj = cmaj = -1; + if ((error = devsw_attach("raid", &raid_bdevsw, &bmaj, + &raid_cdevsw, &cmaj)) != 0) + panic("raid devsw attach failed: %d", error); + + if ((error = rump_vfs_makedevnodes(S_IFBLK, "/dev/raid0", 'a', + bmaj, 0, 7)) != 0) + panic("cannot create cooked raid dev nodes: %d", error); + if ((error = rump_vfs_makedevnodes(S_IFCHR, "/dev/rraid0", 'a', + cmaj, 0, 7)) != 0) + panic("cannot create raw raid dev nodes: %d", error); + + rump_pdev_add(raidattach, 4); +} diff --git a/sys/rump/dev/lib/libraidframe/x86 b/sys/rump/dev/lib/libraidframe/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libraidframe/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/librnd/Makefile b/sys/rump/dev/lib/librnd/Makefile new file mode 100644 index 000000000..5ee3e8914 --- /dev/null +++ b/sys/rump/dev/lib/librnd/Makefile @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.9 2015/08/20 11:51:12 christos Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev + +LIB= rumpdev_rnd +IOCONF= RND.ioconf +SRCS= rndpseudo.c + +SRCS+= rnd_component.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/librnd/RND.ioconf b/sys/rump/dev/lib/librnd/RND.ioconf new file mode 100644 index 000000000..76f1c9fa4 --- /dev/null +++ b/sys/rump/dev/lib/librnd/RND.ioconf @@ -0,0 +1,8 @@ +# $NetBSD: RND.ioconf,v 1.1 2015/08/20 11:51:12 christos Exp $ +# + +ioconf rnd + +include "conf/files" + +pseudo-device rnd diff --git a/sys/rump/dev/lib/librnd/i386 b/sys/rump/dev/lib/librnd/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/librnd/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/librnd/ioconf.c b/sys/rump/dev/lib/librnd/ioconf.c new file mode 100644 index 000000000..317fb4399 --- /dev/null +++ b/sys/rump/dev/lib/librnd/ioconf.c @@ -0,0 +1,32 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/librnd/RND.ioconf" + */ + +#include +#include +#include +#include + + + +static struct cfdriver * const cfdriver_ioconf_rnd[] = { + NULL +}; + + + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_rnd[] = { + /* driver attachment unit state loc flags pspec */ + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + + +static const struct cfattachinit cfattach_ioconf_rnd[] = { + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/librnd/ioconf.h b/sys/rump/dev/lib/librnd/ioconf.h new file mode 100644 index 000000000..861041417 --- /dev/null +++ b/sys/rump/dev/lib/librnd/ioconf.h @@ -0,0 +1,4 @@ + +/* pseudo-devices */ + +/* driver structs */ diff --git a/sys/rump/dev/lib/librnd/locators.h b/sys/rump/dev/lib/librnd/locators.h new file mode 100644 index 000000000..e69de29bb diff --git a/sys/rump/dev/lib/librnd/machine b/sys/rump/dev/lib/librnd/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/librnd/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/librnd/rnd_component.c b/sys/rump/dev/lib/librnd/rnd_component.c new file mode 100644 index 000000000..d19ac9be0 --- /dev/null +++ b/sys/rump/dev/lib/librnd/rnd_component.c @@ -0,0 +1,69 @@ +/* $NetBSD: rnd_component.c,v 1.2 2015/08/20 11:51:12 christos Exp $ */ + +/* + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: rnd_component.c,v 1.2 2015/08/20 11:51:12 christos Exp $"); + +#include +#include +#include +#include +#include + +#include "rump_private.h" +#include "rump_dev_private.h" +#include "rump_vfs_private.h" + +#include "ioconf.h" + +#if defined(__minix) +void rndattach(int); +#endif + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern const struct cdevsw rnd_cdevsw; + devmajor_t bmaj, cmaj; + int error; + + /* go, mydevfs */ + bmaj = cmaj = -1; + + if ((error = devsw_attach("random", NULL, &bmaj, + &rnd_cdevsw, &cmaj)) != 0) + panic("cannot attach rnd: %d", error); + + if ((error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/random", + cmaj, RND_DEV_RANDOM)) != 0) + panic("cannot create /dev/random: %d", error); + if ((error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/urandom", + cmaj, RND_DEV_URANDOM)) != 0) + panic("cannot create /dev/urandom: %d", error); + + rump_pdev_add(rndattach, 4); + rnd_init(); +} diff --git a/sys/rump/dev/lib/librnd/x86 b/sys/rump/dev/lib/librnd/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/librnd/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libscsipi/Makefile b/sys/rump/dev/lib/libscsipi/Makefile new file mode 100644 index 000000000..d5fa57a93 --- /dev/null +++ b/sys/rump/dev/lib/libscsipi/Makefile @@ -0,0 +1,22 @@ +# $NetBSD: Makefile,v 1.3 2015/08/24 23:21:51 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/scsipi + +LIB= rumpdev_scsipi +IOCONF= SCSIPI.ioconf + +SRCS+= scsipiconf.c scsipi_base.c scsipi_ioctl.c scsi_base.c scsiconf.c +SRCS+= atapi_base.c atapiconf.c +SRCS+= cd.c sd.c + +.if 1 +SRCS+= scsipi_verbose.c +.endif + +SRCS+= scsipi_component.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libscsipi/SCSIPI.ioconf b/sys/rump/dev/lib/libscsipi/SCSIPI.ioconf new file mode 100644 index 000000000..777267b5d --- /dev/null +++ b/sys/rump/dev/lib/libscsipi/SCSIPI.ioconf @@ -0,0 +1,20 @@ +# $NetBSD: SCSIPI.ioconf,v 1.1 2010/08/23 20:49:53 pooka Exp $ +# + +ioconf scsipi + +include "conf/files" +include "dev/scsipi/files.scsipi" + +pseudo-root scsi* +pseudo-root atapi* + +# SCSI support +scsibus* at scsi? +sd* at scsibus? target ? lun ? +cd* at scsibus? target ? lun ? + +# ATAPI support +atapibus* at atapi? +sd* at atapibus? drive ? flags 0x0000 +cd* at atapibus? drive ? flags 0x0000 diff --git a/sys/rump/dev/lib/libscsipi/i386 b/sys/rump/dev/lib/libscsipi/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libscsipi/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libscsipi/ioconf.c b/sys/rump/dev/lib/libscsipi/ioconf.c new file mode 100644 index 000000000..b1ea71951 --- /dev/null +++ b/sys/rump/dev/lib/libscsipi/ioconf.c @@ -0,0 +1,116 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libscsipi/SCSIPI.ioconf" + */ + +#include +#include +#include +#include + +static const struct cfiattrdata atapicf_iattrdata = { + "atapi", 0, { + { NULL, NULL, 0 }, + } +}; +static const struct cfiattrdata scsicf_iattrdata = { + "scsi", 1, { + { "channel", "-1", -1 }, + } +}; +static const struct cfiattrdata scsibuscf_iattrdata = { + "scsibus", 2, { + { "target", "-1", -1 }, + { "lun", "-1", -1 }, + } +}; +static const struct cfiattrdata atapibuscf_iattrdata = { + "atapibus", 1, { + { "drive", "-1", -1 }, + } +}; + +static const struct cfiattrdata * const scsibus_attrs[] = { &scsibuscf_iattrdata, NULL }; +CFDRIVER_DECL(scsibus, DV_DULL, scsibus_attrs); + +static const struct cfiattrdata * const atapibus_attrs[] = { &atapibuscf_iattrdata, NULL }; +CFDRIVER_DECL(atapibus, DV_DULL, atapibus_attrs); + +CFDRIVER_DECL(cd, DV_DISK, NULL); + +CFDRIVER_DECL(sd, DV_DISK, NULL); + + +static struct cfdriver * const cfdriver_ioconf_scsipi[] = { + &scsibus_cd, + &atapibus_cd, + &cd_cd, + &sd_cd, + NULL +}; + +extern struct cfattach scsibus_ca; +extern struct cfattach atapibus_ca; +extern struct cfattach cd_ca; +extern struct cfattach sd_ca; + +/* locators */ +static int loc[7] = { + -1, -1, -1, -1, -1, -1, -1, +}; + +static const struct cfparent pspec0 = { + "scsi", NULL, 0 +}; +static const struct cfparent pspec1 = { + "scsibus", "scsibus", DVUNIT_ANY +}; +static const struct cfparent pspec2 = { + "atapi", NULL, 0 +}; +static const struct cfparent pspec3 = { + "atapibus", "atapibus", DVUNIT_ANY +}; + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_scsipi[] = { + /* driver attachment unit state loc flags pspec */ +/* 0: scsibus* at scsi? channel -1 */ + { "scsibus", "scsibus", 0, STAR, loc+ 4, 0, &pspec0 }, +/* 1: atapibus* at atapi? */ + { "atapibus", "atapibus", 0, STAR, NULL, 0, &pspec2 }, +/* 2: cd* at scsibus? target -1 lun -1 */ + { "cd", "cd", 0, STAR, loc+ 0, 0, &pspec1 }, +/* 3: cd* at atapibus? drive -1 */ + { "cd", "cd", 0, STAR, loc+ 5, 0, &pspec3 }, +/* 4: sd* at scsibus? target -1 lun -1 */ + { "sd", "sd", 0, STAR, loc+ 2, 0, &pspec1 }, +/* 5: sd* at atapibus? drive -1 */ + { "sd", "sd", 0, STAR, loc+ 6, 0, &pspec3 }, + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + +static struct cfattach * const scsibus_cfattachinit[] = { + &scsibus_ca, NULL +}; +static struct cfattach * const atapibus_cfattachinit[] = { + &atapibus_ca, NULL +}; +static struct cfattach * const cd_cfattachinit[] = { + &cd_ca, NULL +}; +static struct cfattach * const sd_cfattachinit[] = { + &sd_ca, NULL +}; + +static const struct cfattachinit cfattach_ioconf_scsipi[] = { + { "scsibus", scsibus_cfattachinit }, + { "atapibus", atapibus_cfattachinit }, + { "cd", cd_cfattachinit }, + { "sd", sd_cfattachinit }, + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libscsipi/ioconf.h b/sys/rump/dev/lib/libscsipi/ioconf.h new file mode 100644 index 000000000..09861cc33 --- /dev/null +++ b/sys/rump/dev/lib/libscsipi/ioconf.h @@ -0,0 +1,8 @@ + +/* pseudo-devices */ + +/* driver structs */ +extern struct cfdriver scsibus_cd; +extern struct cfdriver atapibus_cd; +extern struct cfdriver cd_cd; +extern struct cfdriver sd_cd; diff --git a/sys/rump/dev/lib/libscsipi/locators.h b/sys/rump/dev/lib/libscsipi/locators.h new file mode 100644 index 000000000..3457ef0a6 --- /dev/null +++ b/sys/rump/dev/lib/libscsipi/locators.h @@ -0,0 +1,93 @@ +#define WSKBDDEVCF_CONSOLE 0 +#define WSKBDDEVCF_CONSOLE_DEFAULT -1 +#define WSKBDDEVCF_MUX 1 +#define WSKBDDEVCF_MUX_DEFAULT 1 +#define WSKBDDEVCF_NLOCS 2 +#define WSEMULDISPLAYDEVCF_CONSOLE 0 +#define WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT -1 +#define WSEMULDISPLAYDEVCF_KBDMUX 1 +#define WSEMULDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSEMULDISPLAYDEVCF_NLOCS 2 +#define AACCF_UNIT 0 +#define AACCF_UNIT_DEFAULT -1 +#define AACCF_NLOCS 1 +#define PCKBPORTCF_SLOT 0 +#define PCKBPORTCF_SLOT_DEFAULT -1 +#define PCKBPORTCF_NLOCS 1 +#define MLXCF_UNIT 0 +#define MLXCF_UNIT_DEFAULT -1 +#define MLXCF_NLOCS 1 +#define WSMOUSEDEVCF_MUX 0 +#define WSMOUSEDEVCF_MUX_DEFAULT 0 +#define WSMOUSEDEVCF_NLOCS 1 +#define SCSICF_CHANNEL 0 +#define SCSICF_CHANNEL_DEFAULT -1 +#define SCSICF_NLOCS 1 +#define HDAUDIOBUSCF_NID 0 +#define HDAUDIOBUSCF_NID_DEFAULT -1 +#define HDAUDIOBUSCF_NLOCS 1 +#define SCSIBUSCF_TARGET 0 +#define SCSIBUSCF_TARGET_DEFAULT -1 +#define SCSIBUSCF_LUN 1 +#define SCSIBUSCF_LUN_DEFAULT -1 +#define SCSIBUSCF_NLOCS 2 +#define CPCBUSCF_ADDR 0 +#define CPCBUSCF_IRQ 1 +#define CPCBUSCF_IRQ_DEFAULT -1 +#define CPCBUSCF_NLOCS 2 +#define ATACF_CHANNEL 0 +#define ATACF_CHANNEL_DEFAULT -1 +#define ATACF_NLOCS 1 +#define PCMCIABUSCF_CONTROLLER 0 +#define PCMCIABUSCF_CONTROLLER_DEFAULT -1 +#define PCMCIABUSCF_SOCKET 1 +#define PCMCIABUSCF_SOCKET_DEFAULT -1 +#define PCMCIABUSCF_NLOCS 2 +#define FLASHBUSCF_OFFSET 0 +#define FLASHBUSCF_OFFSET_DEFAULT 0 +#define FLASHBUSCF_SIZE 1 +#define FLASHBUSCF_SIZE_DEFAULT 0 +#define FLASHBUSCF_READONLY 2 +#define FLASHBUSCF_READONLY_DEFAULT 0 +#define FLASHBUSCF_NLOCS 3 +#define CACCF_UNIT 0 +#define CACCF_UNIT_DEFAULT -1 +#define CACCF_NLOCS 1 +#define GPIBDEVCF_ADDRESS 0 +#define GPIBDEVCF_ADDRESS_DEFAULT -1 +#define GPIBDEVCF_NLOCS 1 +#define IICCF_ADDR 0 +#define IICCF_ADDR_DEFAULT -1 +#define IICCF_SIZE 1 +#define IICCF_SIZE_DEFAULT -1 +#define IICCF_NLOCS 2 +#define PCIBUSCF_BUS 0 +#define PCIBUSCF_BUS_DEFAULT -1 +#define PCIBUSCF_NLOCS 1 +#define ATA_HLCF_DRIVE 0 +#define ATA_HLCF_DRIVE_DEFAULT -1 +#define ATA_HLCF_NLOCS 1 +#define GPIOCF_OFFSET 0 +#define GPIOCF_OFFSET_DEFAULT -1 +#define GPIOCF_MASK 1 +#define GPIOCF_MASK_DEFAULT 0 +#define GPIOCF_FLAG 2 +#define GPIOCF_FLAG_DEFAULT 0 +#define GPIOCF_NLOCS 3 +#define ICPCF_UNIT 0 +#define ICPCF_UNIT_DEFAULT -1 +#define ICPCF_NLOCS 1 +#define ATAPIBUSCF_DRIVE 0 +#define ATAPIBUSCF_DRIVE_DEFAULT -1 +#define ATAPIBUSCF_NLOCS 1 +#define WSDISPLAYDEVCF_KBDMUX 0 +#define WSDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSDISPLAYDEVCF_NLOCS 1 +#define MIICF_PHY 0 +#define MIICF_PHY_DEFAULT -1 +#define MIICF_NLOCS 1 +#define UPCCF_OFFSET 0 +#define UPCCF_OFFSET_DEFAULT -1 +#define UPCCF_NLOCS 1 +#define SPICF_SLAVE 0 +#define SPICF_NLOCS 1 diff --git a/sys/rump/dev/lib/libscsipi/machine b/sys/rump/dev/lib/libscsipi/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libscsipi/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libscsipi/scsipi_component.c b/sys/rump/dev/lib/libscsipi/scsipi_component.c new file mode 100644 index 000000000..27531f5b5 --- /dev/null +++ b/sys/rump/dev/lib/libscsipi/scsipi_component.c @@ -0,0 +1,39 @@ +/* $NetBSD: scsipi_component.c,v 1.1 2014/03/13 01:58:20 pooka Exp $ */ + +#include +#include +#include +#include +#include + +#include "ioconf.c" + +#include "rump_private.h" +#include "rump_dev_private.h" +#include "rump_vfs_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern struct bdevsw sd_bdevsw, cd_bdevsw; + extern struct cdevsw sd_cdevsw, cd_cdevsw; + devmajor_t bmaj, cmaj; + + config_init_component(cfdriver_ioconf_scsipi, + cfattach_ioconf_scsipi, cfdata_ioconf_scsipi); + + bmaj = cmaj = -1; + FLAWLESSCALL(devsw_attach("sd", &sd_bdevsw, &bmaj, &sd_cdevsw, &cmaj)); + + FLAWLESSCALL(rump_vfs_makedevnodes(S_IFBLK, "/dev/sd0", 'a', + bmaj, 0, 8)); + FLAWLESSCALL(rump_vfs_makedevnodes(S_IFCHR, "/dev/rsd0", 'a', + cmaj, 0, 8)); + + bmaj = cmaj = -1; + FLAWLESSCALL(devsw_attach("cd", &cd_bdevsw, &bmaj, &cd_cdevsw, &cmaj)); + + FLAWLESSCALL(rump_vfs_makedevnodes(S_IFBLK, "/dev/cd0", 'a', + bmaj, 0, 8)); + FLAWLESSCALL(rump_vfs_makedevnodes(S_IFCHR, "/dev/rcd0", 'a', + cmaj, 0, 8)); +} diff --git a/sys/rump/dev/lib/libscsipi/x86 b/sys/rump/dev/lib/libscsipi/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libscsipi/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libsysmon/Makefile b/sys/rump/dev/lib/libsysmon/Makefile new file mode 100644 index 000000000..14ef12a7b --- /dev/null +++ b/sys/rump/dev/lib/libsysmon/Makefile @@ -0,0 +1,18 @@ +# $NetBSD: Makefile,v 1.7 2015/08/24 23:01:58 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/sysmon + +LIB= rumpdev_sysmon +IOCONF= SYSMON.ioconf + +SRCS= sysmon_taskq.c sysmon_power.c sysmon_envsys.c sysmon_envsys_events.c \ + sysmon_envsys_tables.c sysmon_envsys_util.c sysmon_wdog.c sysmon.c \ + swsensor.c swwdog.c + +SRCS+= sysmon_component.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libsysmon/SYSMON.ioconf b/sys/rump/dev/lib/libsysmon/SYSMON.ioconf new file mode 100644 index 000000000..ca1978e45 --- /dev/null +++ b/sys/rump/dev/lib/libsysmon/SYSMON.ioconf @@ -0,0 +1,8 @@ +# $NetBSD: SYSMON.ioconf,v 1.1 2010/07/22 14:10:14 pgoyette Exp $ +# + +ioconf swwdog + +include "conf/files" + +pseudo-device swwdog diff --git a/sys/rump/dev/lib/libsysmon/i386 b/sys/rump/dev/lib/libsysmon/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libsysmon/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libsysmon/ioconf.c b/sys/rump/dev/lib/libsysmon/ioconf.c new file mode 100644 index 000000000..ed54e4508 --- /dev/null +++ b/sys/rump/dev/lib/libsysmon/ioconf.c @@ -0,0 +1,35 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libsysmon/SYSMON.ioconf" + */ + +#include +#include +#include +#include + + +CFDRIVER_DECL(swwdog, DV_DULL, NULL); + + +static struct cfdriver * const cfdriver_ioconf_swwdog[] = { + &swwdog_cd, + NULL +}; + + + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_swwdog[] = { + /* driver attachment unit state loc flags pspec */ + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + + +static const struct cfattachinit cfattach_ioconf_swwdog[] = { + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libsysmon/ioconf.h b/sys/rump/dev/lib/libsysmon/ioconf.h new file mode 100644 index 000000000..253a4bf19 --- /dev/null +++ b/sys/rump/dev/lib/libsysmon/ioconf.h @@ -0,0 +1,6 @@ + +/* pseudo-devices */ +void swwdogattach(int); + +/* driver structs */ +extern struct cfdriver swwdog_cd; diff --git a/sys/rump/dev/lib/libsysmon/locators.h b/sys/rump/dev/lib/libsysmon/locators.h new file mode 100644 index 000000000..e1e369eed --- /dev/null +++ b/sys/rump/dev/lib/libsysmon/locators.h @@ -0,0 +1,85 @@ +#define WSKBDDEVCF_CONSOLE 0 +#define WSKBDDEVCF_CONSOLE_DEFAULT -1 +#define WSKBDDEVCF_MUX 1 +#define WSKBDDEVCF_MUX_DEFAULT 1 +#define WSKBDDEVCF_NLOCS 2 +#define WSEMULDISPLAYDEVCF_CONSOLE 0 +#define WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT -1 +#define WSEMULDISPLAYDEVCF_KBDMUX 1 +#define WSEMULDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSEMULDISPLAYDEVCF_NLOCS 2 +#define AACCF_UNIT 0 +#define AACCF_UNIT_DEFAULT -1 +#define AACCF_NLOCS 1 +#define PCKBPORTCF_SLOT 0 +#define PCKBPORTCF_SLOT_DEFAULT -1 +#define PCKBPORTCF_NLOCS 1 +#define MLXCF_UNIT 0 +#define MLXCF_UNIT_DEFAULT -1 +#define MLXCF_NLOCS 1 +#define WSMOUSEDEVCF_MUX 0 +#define WSMOUSEDEVCF_MUX_DEFAULT 0 +#define WSMOUSEDEVCF_NLOCS 1 +#define SCSICF_CHANNEL 0 +#define SCSICF_CHANNEL_DEFAULT -1 +#define SCSICF_NLOCS 1 +#define HDAUDIOBUSCF_NID 0 +#define HDAUDIOBUSCF_NID_DEFAULT -1 +#define HDAUDIOBUSCF_NLOCS 1 +#define CPCBUSCF_ADDR 0 +#define CPCBUSCF_IRQ 1 +#define CPCBUSCF_IRQ_DEFAULT -1 +#define CPCBUSCF_NLOCS 2 +#define ATACF_CHANNEL 0 +#define ATACF_CHANNEL_DEFAULT -1 +#define ATACF_NLOCS 1 +#define PCMCIABUSCF_CONTROLLER 0 +#define PCMCIABUSCF_CONTROLLER_DEFAULT -1 +#define PCMCIABUSCF_SOCKET 1 +#define PCMCIABUSCF_SOCKET_DEFAULT -1 +#define PCMCIABUSCF_NLOCS 2 +#define FLASHBUSCF_OFFSET 0 +#define FLASHBUSCF_OFFSET_DEFAULT 0 +#define FLASHBUSCF_SIZE 1 +#define FLASHBUSCF_SIZE_DEFAULT 0 +#define FLASHBUSCF_READONLY 2 +#define FLASHBUSCF_READONLY_DEFAULT 0 +#define FLASHBUSCF_NLOCS 3 +#define CACCF_UNIT 0 +#define CACCF_UNIT_DEFAULT -1 +#define CACCF_NLOCS 1 +#define GPIBDEVCF_ADDRESS 0 +#define GPIBDEVCF_ADDRESS_DEFAULT -1 +#define GPIBDEVCF_NLOCS 1 +#define IICCF_ADDR 0 +#define IICCF_ADDR_DEFAULT -1 +#define IICCF_SIZE 1 +#define IICCF_SIZE_DEFAULT -1 +#define IICCF_NLOCS 2 +#define PCIBUSCF_BUS 0 +#define PCIBUSCF_BUS_DEFAULT -1 +#define PCIBUSCF_NLOCS 1 +#define ATA_HLCF_DRIVE 0 +#define ATA_HLCF_DRIVE_DEFAULT -1 +#define ATA_HLCF_NLOCS 1 +#define GPIOCF_OFFSET 0 +#define GPIOCF_OFFSET_DEFAULT -1 +#define GPIOCF_MASK 1 +#define GPIOCF_MASK_DEFAULT 0 +#define GPIOCF_FLAG 2 +#define GPIOCF_FLAG_DEFAULT 0 +#define GPIOCF_NLOCS 3 +#define ICPCF_UNIT 0 +#define ICPCF_UNIT_DEFAULT -1 +#define ICPCF_NLOCS 1 +#define WSDISPLAYDEVCF_KBDMUX 0 +#define WSDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSDISPLAYDEVCF_NLOCS 1 +#define MIICF_PHY 0 +#define MIICF_PHY_DEFAULT -1 +#define MIICF_NLOCS 1 +#define UPCCF_OFFSET 0 +#define UPCCF_OFFSET_DEFAULT -1 +#define UPCCF_NLOCS 1 +#define SPICF_SLAVE 0 +#define SPICF_NLOCS 1 diff --git a/sys/rump/dev/lib/libsysmon/machine b/sys/rump/dev/lib/libsysmon/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libsysmon/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libsysmon/sysmon_component.c b/sys/rump/dev/lib/libsysmon/sysmon_component.c new file mode 100644 index 000000000..2122cefbd --- /dev/null +++ b/sys/rump/dev/lib/libsysmon/sysmon_component.c @@ -0,0 +1,69 @@ +/* $NetBSD: sysmon_component.c,v 1.2 2015/04/23 23:23:14 pgoyette Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: sysmon_component.c,v 1.2 2015/04/23 23:23:14 pgoyette Exp $"); + +#include +#include +#include +#include + +#include +#include + +#include "rump_private.h" +#include "rump_dev_private.h" +#include "rump_vfs_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern const struct cdevsw sysmon_cdevsw; + devmajor_t bmaj, cmaj; + int error; + + /* + * Temporarily attach the devsw so we can determine our + * major device number. We'll detach it immediately, so + * normal module initialization can permanently attach. + */ + bmaj = cmaj = -1; + if ((error = devsw_attach("sysmon", NULL, &bmaj, + &sysmon_cdevsw, &cmaj)) != 0) + panic("sysmon devsw attach failed: %d", error); + devsw_detach(NULL, &sysmon_cdevsw); + + if ((error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/sysmon", + cmaj, SYSMON_MINOR_ENVSYS)) != 0) + panic("cannot create /dev/sysmon: %d", error); + if ((error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/watchdog", + cmaj, SYSMON_MINOR_WDOG)) != 0) + panic("cannot create /dev/watchdog: %d", error); + if ((error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/power", + cmaj, SYSMON_MINOR_POWER)) != 0) + panic("cannot create /dev/power: %d", error); +} diff --git a/sys/rump/dev/lib/libsysmon/x86 b/sys/rump/dev/lib/libsysmon/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libsysmon/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libubt/Makefile b/sys/rump/dev/lib/libubt/Makefile new file mode 100644 index 000000000..7d9929e23 --- /dev/null +++ b/sys/rump/dev/lib/libubt/Makefile @@ -0,0 +1,14 @@ +# $NetBSD: Makefile,v 1.3 2010/03/26 18:15:15 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/usb ${.CURDIR}/../../../../dev/bluetooth + +LIB= rumpdev_ubt +IOCONF= UBT.ioconf + +SRCS= ubt.c bthub.c + +SRCS+= ubt_at_usb.c + +.include +.include diff --git a/sys/rump/dev/lib/libubt/UBT.ioconf b/sys/rump/dev/lib/libubt/UBT.ioconf new file mode 100644 index 000000000..77da8b2af --- /dev/null +++ b/sys/rump/dev/lib/libubt/UBT.ioconf @@ -0,0 +1,15 @@ +# $NetBSD: UBT.ioconf,v 1.2 2010/03/22 14:47:02 pooka Exp $ +# + +ioconf ubt + +include "conf/files" +include "dev/usb/files.usb" +include "dev/bluetooth/files.bluetooth" +include "rump/dev/files.rump" + +pseudo-root uhub* + +# Bluetooth USB Controllers +ubt* at uhub? port ? +bthub* at ubt? diff --git a/sys/rump/dev/lib/libubt/i386 b/sys/rump/dev/lib/libubt/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libubt/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libubt/ioconf.c b/sys/rump/dev/lib/libubt/ioconf.c new file mode 100644 index 000000000..652e69ed0 --- /dev/null +++ b/sys/rump/dev/lib/libubt/ioconf.c @@ -0,0 +1,95 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libubt/UBT.ioconf" + */ + +#include +#include +#include +#include + +static const struct cfiattrdata usbififcf_iattrdata = { + "usbifif", 6, { + { "port", "-1", -1 }, + { "configuration", "-1", -1 }, + { "interface", "-1", -1 }, + { "vendor", "-1", -1 }, + { "product", "-1", -1 }, + { "release", "-1", -1 }, + } +}; +static const struct cfiattrdata usbdevifcf_iattrdata = { + "usbdevif", 6, { + { "port", "-1", -1 }, + { "configuration", "-1", -1 }, + { "interface", "-1", -1 }, + { "vendor", "-1", -1 }, + { "product", "-1", -1 }, + { "release", "-1", -1 }, + } +}; +static const struct cfiattrdata btbuscf_iattrdata = { + "btbus", 0, { + { NULL, NULL, 0 }, + } +}; +static const struct cfiattrdata bthubcf_iattrdata = { + "bthub", 0, { + { NULL, NULL, 0 }, + } +}; + +static const struct cfiattrdata * const ubt_attrs[] = { &btbuscf_iattrdata, NULL }; +CFDRIVER_DECL(ubt, DV_DULL, ubt_attrs); + +static const struct cfiattrdata * const bthub_attrs[] = { &bthubcf_iattrdata, NULL }; +CFDRIVER_DECL(bthub, DV_DULL, bthub_attrs); + + +static struct cfdriver * const cfdriver_ioconf_ubt[] = { + &ubt_cd, + &bthub_cd, + NULL +}; + +extern struct cfattach ubt_ca; +extern struct cfattach bthub_ca; + +/* locators */ +static int loc[6] = { + -1, -1, -1, -1, -1, -1, +}; + +static const struct cfparent pspec0 = { + "usbdevif", "uhub", DVUNIT_ANY +}; +static const struct cfparent pspec1 = { + "btbus", "ubt", DVUNIT_ANY +}; + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_ubt[] = { + /* driver attachment unit state loc flags pspec */ +/* 0: ubt* at uhub? port -1 configuration -1 interface -1 vendor -1 product -1 release -1 */ + { "ubt", "ubt", 0, STAR, loc+ 0, 0, &pspec0 }, +/* 1: bthub* at ubt? */ + { "bthub", "bthub", 0, STAR, NULL, 0, &pspec1 }, + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + +static struct cfattach * const ubt_cfattachinit[] = { + &ubt_ca, NULL +}; +static struct cfattach * const bthub_cfattachinit[] = { + &bthub_ca, NULL +}; + +static const struct cfattachinit cfattach_ioconf_ubt[] = { + { "ubt", ubt_cfattachinit }, + { "bthub", bthub_cfattachinit }, + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libubt/ioconf.h b/sys/rump/dev/lib/libubt/ioconf.h new file mode 100644 index 000000000..8fe246eb4 --- /dev/null +++ b/sys/rump/dev/lib/libubt/ioconf.h @@ -0,0 +1,6 @@ + +/* pseudo-devices */ + +/* driver structs */ +extern struct cfdriver ubt_cd; +extern struct cfdriver bthub_cd; diff --git a/sys/rump/dev/lib/libubt/locators.h b/sys/rump/dev/lib/libubt/locators.h new file mode 100644 index 000000000..9729b5d8a --- /dev/null +++ b/sys/rump/dev/lib/libubt/locators.h @@ -0,0 +1,120 @@ +#define WSKBDDEVCF_CONSOLE 0 +#define WSKBDDEVCF_CONSOLE_DEFAULT -1 +#define WSKBDDEVCF_MUX 1 +#define WSKBDDEVCF_MUX_DEFAULT 1 +#define WSKBDDEVCF_NLOCS 2 +#define WSEMULDISPLAYDEVCF_CONSOLE 0 +#define WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT -1 +#define WSEMULDISPLAYDEVCF_KBDMUX 1 +#define WSEMULDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSEMULDISPLAYDEVCF_NLOCS 2 +#define AACCF_UNIT 0 +#define AACCF_UNIT_DEFAULT -1 +#define AACCF_NLOCS 1 +#define PCKBPORTCF_SLOT 0 +#define PCKBPORTCF_SLOT_DEFAULT -1 +#define PCKBPORTCF_NLOCS 1 +#define MLXCF_UNIT 0 +#define MLXCF_UNIT_DEFAULT -1 +#define MLXCF_NLOCS 1 +#define WSMOUSEDEVCF_MUX 0 +#define WSMOUSEDEVCF_MUX_DEFAULT 0 +#define WSMOUSEDEVCF_NLOCS 1 +#define SCSICF_CHANNEL 0 +#define SCSICF_CHANNEL_DEFAULT -1 +#define SCSICF_NLOCS 1 +#define HDAUDIOBUSCF_NID 0 +#define HDAUDIOBUSCF_NID_DEFAULT -1 +#define HDAUDIOBUSCF_NLOCS 1 +#define USBIFIFCF_PORT 0 +#define USBIFIFCF_PORT_DEFAULT -1 +#define USBIFIFCF_CONFIGURATION 1 +#define USBIFIFCF_CONFIGURATION_DEFAULT -1 +#define USBIFIFCF_INTERFACE 2 +#define USBIFIFCF_INTERFACE_DEFAULT -1 +#define USBIFIFCF_VENDOR 3 +#define USBIFIFCF_VENDOR_DEFAULT -1 +#define USBIFIFCF_PRODUCT 4 +#define USBIFIFCF_PRODUCT_DEFAULT -1 +#define USBIFIFCF_RELEASE 5 +#define USBIFIFCF_RELEASE_DEFAULT -1 +#define USBIFIFCF_NLOCS 6 +#define CPCBUSCF_ADDR 0 +#define CPCBUSCF_IRQ 1 +#define CPCBUSCF_IRQ_DEFAULT -1 +#define CPCBUSCF_NLOCS 2 +#define ATACF_CHANNEL 0 +#define ATACF_CHANNEL_DEFAULT -1 +#define ATACF_NLOCS 1 +#define USBDEVIFCF_PORT 0 +#define USBDEVIFCF_PORT_DEFAULT -1 +#define USBDEVIFCF_CONFIGURATION 1 +#define USBDEVIFCF_CONFIGURATION_DEFAULT -1 +#define USBDEVIFCF_INTERFACE 2 +#define USBDEVIFCF_INTERFACE_DEFAULT -1 +#define USBDEVIFCF_VENDOR 3 +#define USBDEVIFCF_VENDOR_DEFAULT -1 +#define USBDEVIFCF_PRODUCT 4 +#define USBDEVIFCF_PRODUCT_DEFAULT -1 +#define USBDEVIFCF_RELEASE 5 +#define USBDEVIFCF_RELEASE_DEFAULT -1 +#define USBDEVIFCF_NLOCS 6 +#define BTHIDBUSCF_REPORTID 0 +#define BTHIDBUSCF_REPORTID_DEFAULT -1 +#define BTHIDBUSCF_NLOCS 1 +#define PCMCIABUSCF_CONTROLLER 0 +#define PCMCIABUSCF_CONTROLLER_DEFAULT -1 +#define PCMCIABUSCF_SOCKET 1 +#define PCMCIABUSCF_SOCKET_DEFAULT -1 +#define PCMCIABUSCF_NLOCS 2 +#define FLASHBUSCF_OFFSET 0 +#define FLASHBUSCF_OFFSET_DEFAULT 0 +#define FLASHBUSCF_SIZE 1 +#define FLASHBUSCF_SIZE_DEFAULT 0 +#define FLASHBUSCF_READONLY 2 +#define FLASHBUSCF_READONLY_DEFAULT 0 +#define FLASHBUSCF_NLOCS 3 +#define CACCF_UNIT 0 +#define CACCF_UNIT_DEFAULT -1 +#define CACCF_NLOCS 1 +#define GPIBDEVCF_ADDRESS 0 +#define GPIBDEVCF_ADDRESS_DEFAULT -1 +#define GPIBDEVCF_NLOCS 1 +#define IICCF_ADDR 0 +#define IICCF_ADDR_DEFAULT -1 +#define IICCF_SIZE 1 +#define IICCF_SIZE_DEFAULT -1 +#define IICCF_NLOCS 2 +#define PCIBUSCF_BUS 0 +#define PCIBUSCF_BUS_DEFAULT -1 +#define PCIBUSCF_NLOCS 1 +#define ATA_HLCF_DRIVE 0 +#define ATA_HLCF_DRIVE_DEFAULT -1 +#define ATA_HLCF_NLOCS 1 +#define GPIOCF_OFFSET 0 +#define GPIOCF_OFFSET_DEFAULT -1 +#define GPIOCF_MASK 1 +#define GPIOCF_MASK_DEFAULT 0 +#define GPIOCF_FLAG 2 +#define GPIOCF_FLAG_DEFAULT 0 +#define GPIOCF_NLOCS 3 +#define UHIDBUSCF_REPORTID 0 +#define UHIDBUSCF_REPORTID_DEFAULT -1 +#define UHIDBUSCF_NLOCS 1 +#define ICPCF_UNIT 0 +#define ICPCF_UNIT_DEFAULT -1 +#define ICPCF_NLOCS 1 +#define WSDISPLAYDEVCF_KBDMUX 0 +#define WSDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSDISPLAYDEVCF_NLOCS 1 +#define MIICF_PHY 0 +#define MIICF_PHY_DEFAULT -1 +#define MIICF_NLOCS 1 +#define UPCCF_OFFSET 0 +#define UPCCF_OFFSET_DEFAULT -1 +#define UPCCF_NLOCS 1 +#define SPICF_SLAVE 0 +#define SPICF_NLOCS 1 +#define UCOMBUSCF_PORTNO 0 +#define UCOMBUSCF_PORTNO_DEFAULT -1 +#define UCOMBUSCF_NLOCS 1 diff --git a/sys/rump/dev/lib/libubt/machine b/sys/rump/dev/lib/libubt/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libubt/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libubt/ubt_at_usb.c b/sys/rump/dev/lib/libubt/ubt_at_usb.c new file mode 100644 index 000000000..08641ddf0 --- /dev/null +++ b/sys/rump/dev/lib/libubt/ubt_at_usb.c @@ -0,0 +1,19 @@ +/* $NetBSD: ubt_at_usb.c,v 1.4 2010/03/26 15:51:55 pooka Exp $ */ + +#include +#include +#include +#include +#include + +#include "ioconf.c" + +#include "rump_private.h" +#include "rump_dev_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_ubt, + cfattach_ioconf_ubt, cfdata_ioconf_ubt); +} diff --git a/sys/rump/dev/lib/libubt/x86 b/sys/rump/dev/lib/libubt/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libubt/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libucom/Makefile b/sys/rump/dev/lib/libucom/Makefile new file mode 100644 index 000000000..a17e4d832 --- /dev/null +++ b/sys/rump/dev/lib/libucom/Makefile @@ -0,0 +1,16 @@ +# $NetBSD: Makefile,v 1.5 2010/06/14 14:47:58 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/usb ${.CURDIR}/../../../../kern + +LIB= rumpdev_ucom +IOCONF= UCOM.ioconf + +SRCS= ucom.c uplcom.c u3g.c + +SRCS+= ucom_at_usb.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libucom/UCOM.ioconf b/sys/rump/dev/lib/libucom/UCOM.ioconf new file mode 100644 index 000000000..fb258fd89 --- /dev/null +++ b/sys/rump/dev/lib/libucom/UCOM.ioconf @@ -0,0 +1,19 @@ +# $NetBSD: UCOM.ioconf,v 1.5 2010/08/30 11:51:29 pooka Exp $ +# + +ioconf ucom + +include "conf/files" +include "dev/usb/files.usb" + +pseudo-root uhub* + +# I/O DATA USB-RSAQ2 serial adapter +uplcom* at uhub? +ucom* at uplcom? portno ? + +# USB 3G datacards +u3g* at uhub? port ? +u3ginit* at uhub? port ? + +ucom* at u3g? diff --git a/sys/rump/dev/lib/libucom/i386 b/sys/rump/dev/lib/libucom/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libucom/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libucom/ioconf.c b/sys/rump/dev/lib/libucom/ioconf.c new file mode 100644 index 000000000..7d543f38a --- /dev/null +++ b/sys/rump/dev/lib/libucom/ioconf.c @@ -0,0 +1,120 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libucom/UCOM.ioconf" + */ + +#include +#include +#include +#include + +static const struct cfiattrdata usbififcf_iattrdata = { + "usbifif", 6, { + { "port", "-1", -1 }, + { "configuration", "-1", -1 }, + { "interface", "-1", -1 }, + { "vendor", "-1", -1 }, + { "product", "-1", -1 }, + { "release", "-1", -1 }, + } +}; +static const struct cfiattrdata usbdevifcf_iattrdata = { + "usbdevif", 6, { + { "port", "-1", -1 }, + { "configuration", "-1", -1 }, + { "interface", "-1", -1 }, + { "vendor", "-1", -1 }, + { "product", "-1", -1 }, + { "release", "-1", -1 }, + } +}; +static const struct cfiattrdata ucombuscf_iattrdata = { + "ucombus", 1, { + { "portno", "-1", -1 }, + } +}; + +CFDRIVER_DECL(ucom, DV_DULL, NULL); + +static const struct cfiattrdata * const u3g_attrs[] = { &ucombuscf_iattrdata, NULL }; +CFDRIVER_DECL(u3g, DV_DULL, u3g_attrs); + +CFDRIVER_DECL(u3ginit, DV_DULL, NULL); + +static const struct cfiattrdata * const uplcom_attrs[] = { &ucombuscf_iattrdata, NULL }; +CFDRIVER_DECL(uplcom, DV_DULL, uplcom_attrs); + + +static struct cfdriver * const cfdriver_ioconf_ucom[] = { + &ucom_cd, + &u3g_cd, + &u3ginit_cd, + &uplcom_cd, + NULL +}; + +extern struct cfattach ucom_ca; +extern struct cfattach u3g_ca; +extern struct cfattach u3ginit_ca; +extern struct cfattach uplcom_ca; + +/* locators */ +static int loc[20] = { + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, +}; + +static const struct cfparent pspec0 = { + "usbdevif", "uhub", DVUNIT_ANY +}; +static const struct cfparent pspec1 = { + "ucombus", "uplcom", DVUNIT_ANY +}; +static const struct cfparent pspec2 = { + "usbifif", "uhub", DVUNIT_ANY +}; +static const struct cfparent pspec3 = { + "ucombus", "u3g", DVUNIT_ANY +}; + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_ucom[] = { + /* driver attachment unit state loc flags pspec */ +/* 0: ucom* at uplcom? portno -1 */ + { "ucom", "ucom", 0, STAR, loc+ 18, 0, &pspec1 }, +/* 1: ucom* at u3g? portno -1 */ + { "ucom", "ucom", 0, STAR, loc+ 19, 0, &pspec3 }, +/* 2: u3g* at uhub? port -1 configuration -1 interface -1 vendor -1 product -1 release -1 */ + { "u3g", "u3g", 0, STAR, loc+ 0, 0, &pspec2 }, +/* 3: u3ginit* at uhub? port -1 configuration -1 interface -1 vendor -1 product -1 release -1 */ + { "u3ginit", "u3ginit", 0, STAR, loc+ 6, 0, &pspec0 }, +/* 4: uplcom* at uhub? port -1 configuration -1 interface -1 vendor -1 product -1 release -1 */ + { "uplcom", "uplcom", 0, STAR, loc+ 12, 0, &pspec0 }, + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + +static struct cfattach * const ucom_cfattachinit[] = { + &ucom_ca, NULL +}; +static struct cfattach * const u3g_cfattachinit[] = { + &u3g_ca, NULL +}; +static struct cfattach * const u3ginit_cfattachinit[] = { + &u3ginit_ca, NULL +}; +static struct cfattach * const uplcom_cfattachinit[] = { + &uplcom_ca, NULL +}; + +static const struct cfattachinit cfattach_ioconf_ucom[] = { + { "ucom", ucom_cfattachinit }, + { "u3g", u3g_cfattachinit }, + { "u3ginit", u3ginit_cfattachinit }, + { "uplcom", uplcom_cfattachinit }, + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libucom/ioconf.h b/sys/rump/dev/lib/libucom/ioconf.h new file mode 100644 index 000000000..40b9ac275 --- /dev/null +++ b/sys/rump/dev/lib/libucom/ioconf.h @@ -0,0 +1,8 @@ + +/* pseudo-devices */ + +/* driver structs */ +extern struct cfdriver ucom_cd; +extern struct cfdriver u3g_cd; +extern struct cfdriver u3ginit_cd; +extern struct cfdriver uplcom_cd; diff --git a/sys/rump/dev/lib/libucom/locators.h b/sys/rump/dev/lib/libucom/locators.h new file mode 100644 index 000000000..998e1f4aa --- /dev/null +++ b/sys/rump/dev/lib/libucom/locators.h @@ -0,0 +1,117 @@ +#define WSKBDDEVCF_CONSOLE 0 +#define WSKBDDEVCF_CONSOLE_DEFAULT -1 +#define WSKBDDEVCF_MUX 1 +#define WSKBDDEVCF_MUX_DEFAULT 1 +#define WSKBDDEVCF_NLOCS 2 +#define WSEMULDISPLAYDEVCF_CONSOLE 0 +#define WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT -1 +#define WSEMULDISPLAYDEVCF_KBDMUX 1 +#define WSEMULDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSEMULDISPLAYDEVCF_NLOCS 2 +#define AACCF_UNIT 0 +#define AACCF_UNIT_DEFAULT -1 +#define AACCF_NLOCS 1 +#define PCKBPORTCF_SLOT 0 +#define PCKBPORTCF_SLOT_DEFAULT -1 +#define PCKBPORTCF_NLOCS 1 +#define MLXCF_UNIT 0 +#define MLXCF_UNIT_DEFAULT -1 +#define MLXCF_NLOCS 1 +#define WSMOUSEDEVCF_MUX 0 +#define WSMOUSEDEVCF_MUX_DEFAULT 0 +#define WSMOUSEDEVCF_NLOCS 1 +#define SCSICF_CHANNEL 0 +#define SCSICF_CHANNEL_DEFAULT -1 +#define SCSICF_NLOCS 1 +#define HDAUDIOBUSCF_NID 0 +#define HDAUDIOBUSCF_NID_DEFAULT -1 +#define HDAUDIOBUSCF_NLOCS 1 +#define USBIFIFCF_PORT 0 +#define USBIFIFCF_PORT_DEFAULT -1 +#define USBIFIFCF_CONFIGURATION 1 +#define USBIFIFCF_CONFIGURATION_DEFAULT -1 +#define USBIFIFCF_INTERFACE 2 +#define USBIFIFCF_INTERFACE_DEFAULT -1 +#define USBIFIFCF_VENDOR 3 +#define USBIFIFCF_VENDOR_DEFAULT -1 +#define USBIFIFCF_PRODUCT 4 +#define USBIFIFCF_PRODUCT_DEFAULT -1 +#define USBIFIFCF_RELEASE 5 +#define USBIFIFCF_RELEASE_DEFAULT -1 +#define USBIFIFCF_NLOCS 6 +#define CPCBUSCF_ADDR 0 +#define CPCBUSCF_IRQ 1 +#define CPCBUSCF_IRQ_DEFAULT -1 +#define CPCBUSCF_NLOCS 2 +#define ATACF_CHANNEL 0 +#define ATACF_CHANNEL_DEFAULT -1 +#define ATACF_NLOCS 1 +#define USBDEVIFCF_PORT 0 +#define USBDEVIFCF_PORT_DEFAULT -1 +#define USBDEVIFCF_CONFIGURATION 1 +#define USBDEVIFCF_CONFIGURATION_DEFAULT -1 +#define USBDEVIFCF_INTERFACE 2 +#define USBDEVIFCF_INTERFACE_DEFAULT -1 +#define USBDEVIFCF_VENDOR 3 +#define USBDEVIFCF_VENDOR_DEFAULT -1 +#define USBDEVIFCF_PRODUCT 4 +#define USBDEVIFCF_PRODUCT_DEFAULT -1 +#define USBDEVIFCF_RELEASE 5 +#define USBDEVIFCF_RELEASE_DEFAULT -1 +#define USBDEVIFCF_NLOCS 6 +#define PCMCIABUSCF_CONTROLLER 0 +#define PCMCIABUSCF_CONTROLLER_DEFAULT -1 +#define PCMCIABUSCF_SOCKET 1 +#define PCMCIABUSCF_SOCKET_DEFAULT -1 +#define PCMCIABUSCF_NLOCS 2 +#define FLASHBUSCF_OFFSET 0 +#define FLASHBUSCF_OFFSET_DEFAULT 0 +#define FLASHBUSCF_SIZE 1 +#define FLASHBUSCF_SIZE_DEFAULT 0 +#define FLASHBUSCF_READONLY 2 +#define FLASHBUSCF_READONLY_DEFAULT 0 +#define FLASHBUSCF_NLOCS 3 +#define CACCF_UNIT 0 +#define CACCF_UNIT_DEFAULT -1 +#define CACCF_NLOCS 1 +#define GPIBDEVCF_ADDRESS 0 +#define GPIBDEVCF_ADDRESS_DEFAULT -1 +#define GPIBDEVCF_NLOCS 1 +#define IICCF_ADDR 0 +#define IICCF_ADDR_DEFAULT -1 +#define IICCF_SIZE 1 +#define IICCF_SIZE_DEFAULT -1 +#define IICCF_NLOCS 2 +#define PCIBUSCF_BUS 0 +#define PCIBUSCF_BUS_DEFAULT -1 +#define PCIBUSCF_NLOCS 1 +#define ATA_HLCF_DRIVE 0 +#define ATA_HLCF_DRIVE_DEFAULT -1 +#define ATA_HLCF_NLOCS 1 +#define GPIOCF_OFFSET 0 +#define GPIOCF_OFFSET_DEFAULT -1 +#define GPIOCF_MASK 1 +#define GPIOCF_MASK_DEFAULT 0 +#define GPIOCF_FLAG 2 +#define GPIOCF_FLAG_DEFAULT 0 +#define GPIOCF_NLOCS 3 +#define UHIDBUSCF_REPORTID 0 +#define UHIDBUSCF_REPORTID_DEFAULT -1 +#define UHIDBUSCF_NLOCS 1 +#define ICPCF_UNIT 0 +#define ICPCF_UNIT_DEFAULT -1 +#define ICPCF_NLOCS 1 +#define WSDISPLAYDEVCF_KBDMUX 0 +#define WSDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSDISPLAYDEVCF_NLOCS 1 +#define MIICF_PHY 0 +#define MIICF_PHY_DEFAULT -1 +#define MIICF_NLOCS 1 +#define UPCCF_OFFSET 0 +#define UPCCF_OFFSET_DEFAULT -1 +#define UPCCF_NLOCS 1 +#define SPICF_SLAVE 0 +#define SPICF_NLOCS 1 +#define UCOMBUSCF_PORTNO 0 +#define UCOMBUSCF_PORTNO_DEFAULT -1 +#define UCOMBUSCF_NLOCS 1 diff --git a/sys/rump/dev/lib/libucom/machine b/sys/rump/dev/lib/libucom/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libucom/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libucom/ucom.h b/sys/rump/dev/lib/libucom/ucom.h new file mode 100644 index 000000000..959b2cfe7 --- /dev/null +++ b/sys/rump/dev/lib/libucom/ucom.h @@ -0,0 +1,3 @@ +/* $NetBSD: ucom.h,v 1.1 2010/02/11 02:22:09 pooka Exp $ */ + +#define NUCOM 1 diff --git a/sys/rump/dev/lib/libucom/ucom_at_usb.c b/sys/rump/dev/lib/libucom/ucom_at_usb.c new file mode 100644 index 000000000..15e5aa757 --- /dev/null +++ b/sys/rump/dev/lib/libucom/ucom_at_usb.c @@ -0,0 +1,35 @@ +/* $NetBSD: ucom_at_usb.c,v 1.7 2010/03/26 15:51:55 pooka Exp $ */ + +#include +#include +#include +#include +#include +#include + +#include "ioconf.c" + +#include "rump_private.h" +#include "rump_dev_private.h" +#include "rump_vfs_private.h" + +void tty_init(void); + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern struct cdevsw ucom_cdevsw; + devmajor_t cmaj, bmaj; + + config_init_component(cfdriver_ioconf_ucom, + cfattach_ioconf_ucom, cfdata_ioconf_ucom); + + bmaj = cmaj = -1; + FLAWLESSCALL(devsw_attach("ucom", NULL, &bmaj, &ucom_cdevsw, &cmaj)); + + FLAWLESSCALL(rump_vfs_makedevnodes(S_IFCHR, "/dev/ttyU", '0', + cmaj, 0, 2)); + FLAWLESSCALL(rump_vfs_makedevnodes(S_IFCHR, "/dev/dtyU", '0', + cmaj, 0x80000, 2)); + + tty_init(); +} diff --git a/sys/rump/dev/lib/libucom/x86 b/sys/rump/dev/lib/libucom/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libucom/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libugenhc/Makefile b/sys/rump/dev/lib/libugenhc/Makefile new file mode 100644 index 000000000..5557eb19e --- /dev/null +++ b/sys/rump/dev/lib/libugenhc/Makefile @@ -0,0 +1,20 @@ +# $NetBSD: Makefile,v 1.9 2015/09/14 15:09:35 pooka Exp $ +# + +LIB= rumpdev_ugenhc + +.if ${MACHINE} == "i386" || ${MACHINE} == "amd64" +IOCONF= UGENHC.ioconf + +SRCS= ugenhc.c ugenhc_at_mainbus.c ugenhc_dma.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern + +RUMPCOMP_USER_SRCS= ugenhc_user.c +.else +.PATH: ${.CURDIR}/../libusb +SRCS= dummy.c +.endif + +.include +.include diff --git a/sys/rump/dev/lib/libugenhc/UGENHC.ioconf b/sys/rump/dev/lib/libugenhc/UGENHC.ioconf new file mode 100644 index 000000000..854ff57e4 --- /dev/null +++ b/sys/rump/dev/lib/libugenhc/UGENHC.ioconf @@ -0,0 +1,15 @@ +# $NetBSD: UGENHC.ioconf,v 1.1 2010/03/08 10:24:37 pooka Exp $ +# + +ioconf ugenhc + +include "conf/files" +include "dev/usb/files.usb" +include "rump/dev/files.rump" + +pseudo-root mainbus* + +ugenhc0 at mainbus? +ugenhc1 at mainbus? +ugenhc2 at mainbus? +ugenhc3 at mainbus? diff --git a/sys/rump/dev/lib/libugenhc/i386 b/sys/rump/dev/lib/libugenhc/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libugenhc/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libugenhc/ioconf.c b/sys/rump/dev/lib/libugenhc/ioconf.c new file mode 100644 index 000000000..ecb83b9dc --- /dev/null +++ b/sys/rump/dev/lib/libugenhc/ioconf.c @@ -0,0 +1,67 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libugenhc/UGENHC.ioconf" + */ + +#include +#include +#include +#include + +static const struct cfiattrdata mainbuscf_iattrdata = { + "mainbus", 0, { + { NULL, NULL, 0 }, + } +}; +static const struct cfiattrdata usbuscf_iattrdata = { + "usbus", 0, { + { NULL, NULL, 0 }, + } +}; +static const struct cfiattrdata pcibuscf_iattrdata = { + "pcibus", 1, { + { "bus", "-1", -1 }, + } +}; + +static const struct cfiattrdata * const ugenhc_attrs[] = { &usbuscf_iattrdata, NULL }; +CFDRIVER_DECL(ugenhc, DV_DULL, ugenhc_attrs); + + +static struct cfdriver * const cfdriver_ioconf_ugenhc[] = { + &ugenhc_cd, + NULL +}; + +extern struct cfattach ugenhc_ca; + +static const struct cfparent pspec0 = { + "mainbus", "mainbus", DVUNIT_ANY +}; + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_ugenhc[] = { + /* driver attachment unit state loc flags pspec */ +/* 0: ugenhc0 at mainbus? */ + { "ugenhc", "ugenhc", 0, NORM, NULL, 0, &pspec0 }, +/* 1: ugenhc1 at mainbus? */ + { "ugenhc", "ugenhc", 1, NORM, NULL, 0, &pspec0 }, +/* 2: ugenhc2 at mainbus? */ + { "ugenhc", "ugenhc", 2, NORM, NULL, 0, &pspec0 }, +/* 3: ugenhc3 at mainbus? */ + { "ugenhc", "ugenhc", 3, NORM, NULL, 0, &pspec0 }, + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + +static struct cfattach * const ugenhc_cfattachinit[] = { + &ugenhc_ca, NULL +}; + +static const struct cfattachinit cfattach_ioconf_ugenhc[] = { + { "ugenhc", ugenhc_cfattachinit }, + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libugenhc/ioconf.h b/sys/rump/dev/lib/libugenhc/ioconf.h new file mode 100644 index 000000000..74a0ddee6 --- /dev/null +++ b/sys/rump/dev/lib/libugenhc/ioconf.h @@ -0,0 +1,5 @@ + +/* pseudo-devices */ + +/* driver structs */ +extern struct cfdriver ugenhc_cd; diff --git a/sys/rump/dev/lib/libugenhc/locators.h b/sys/rump/dev/lib/libugenhc/locators.h new file mode 100644 index 000000000..998e1f4aa --- /dev/null +++ b/sys/rump/dev/lib/libugenhc/locators.h @@ -0,0 +1,117 @@ +#define WSKBDDEVCF_CONSOLE 0 +#define WSKBDDEVCF_CONSOLE_DEFAULT -1 +#define WSKBDDEVCF_MUX 1 +#define WSKBDDEVCF_MUX_DEFAULT 1 +#define WSKBDDEVCF_NLOCS 2 +#define WSEMULDISPLAYDEVCF_CONSOLE 0 +#define WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT -1 +#define WSEMULDISPLAYDEVCF_KBDMUX 1 +#define WSEMULDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSEMULDISPLAYDEVCF_NLOCS 2 +#define AACCF_UNIT 0 +#define AACCF_UNIT_DEFAULT -1 +#define AACCF_NLOCS 1 +#define PCKBPORTCF_SLOT 0 +#define PCKBPORTCF_SLOT_DEFAULT -1 +#define PCKBPORTCF_NLOCS 1 +#define MLXCF_UNIT 0 +#define MLXCF_UNIT_DEFAULT -1 +#define MLXCF_NLOCS 1 +#define WSMOUSEDEVCF_MUX 0 +#define WSMOUSEDEVCF_MUX_DEFAULT 0 +#define WSMOUSEDEVCF_NLOCS 1 +#define SCSICF_CHANNEL 0 +#define SCSICF_CHANNEL_DEFAULT -1 +#define SCSICF_NLOCS 1 +#define HDAUDIOBUSCF_NID 0 +#define HDAUDIOBUSCF_NID_DEFAULT -1 +#define HDAUDIOBUSCF_NLOCS 1 +#define USBIFIFCF_PORT 0 +#define USBIFIFCF_PORT_DEFAULT -1 +#define USBIFIFCF_CONFIGURATION 1 +#define USBIFIFCF_CONFIGURATION_DEFAULT -1 +#define USBIFIFCF_INTERFACE 2 +#define USBIFIFCF_INTERFACE_DEFAULT -1 +#define USBIFIFCF_VENDOR 3 +#define USBIFIFCF_VENDOR_DEFAULT -1 +#define USBIFIFCF_PRODUCT 4 +#define USBIFIFCF_PRODUCT_DEFAULT -1 +#define USBIFIFCF_RELEASE 5 +#define USBIFIFCF_RELEASE_DEFAULT -1 +#define USBIFIFCF_NLOCS 6 +#define CPCBUSCF_ADDR 0 +#define CPCBUSCF_IRQ 1 +#define CPCBUSCF_IRQ_DEFAULT -1 +#define CPCBUSCF_NLOCS 2 +#define ATACF_CHANNEL 0 +#define ATACF_CHANNEL_DEFAULT -1 +#define ATACF_NLOCS 1 +#define USBDEVIFCF_PORT 0 +#define USBDEVIFCF_PORT_DEFAULT -1 +#define USBDEVIFCF_CONFIGURATION 1 +#define USBDEVIFCF_CONFIGURATION_DEFAULT -1 +#define USBDEVIFCF_INTERFACE 2 +#define USBDEVIFCF_INTERFACE_DEFAULT -1 +#define USBDEVIFCF_VENDOR 3 +#define USBDEVIFCF_VENDOR_DEFAULT -1 +#define USBDEVIFCF_PRODUCT 4 +#define USBDEVIFCF_PRODUCT_DEFAULT -1 +#define USBDEVIFCF_RELEASE 5 +#define USBDEVIFCF_RELEASE_DEFAULT -1 +#define USBDEVIFCF_NLOCS 6 +#define PCMCIABUSCF_CONTROLLER 0 +#define PCMCIABUSCF_CONTROLLER_DEFAULT -1 +#define PCMCIABUSCF_SOCKET 1 +#define PCMCIABUSCF_SOCKET_DEFAULT -1 +#define PCMCIABUSCF_NLOCS 2 +#define FLASHBUSCF_OFFSET 0 +#define FLASHBUSCF_OFFSET_DEFAULT 0 +#define FLASHBUSCF_SIZE 1 +#define FLASHBUSCF_SIZE_DEFAULT 0 +#define FLASHBUSCF_READONLY 2 +#define FLASHBUSCF_READONLY_DEFAULT 0 +#define FLASHBUSCF_NLOCS 3 +#define CACCF_UNIT 0 +#define CACCF_UNIT_DEFAULT -1 +#define CACCF_NLOCS 1 +#define GPIBDEVCF_ADDRESS 0 +#define GPIBDEVCF_ADDRESS_DEFAULT -1 +#define GPIBDEVCF_NLOCS 1 +#define IICCF_ADDR 0 +#define IICCF_ADDR_DEFAULT -1 +#define IICCF_SIZE 1 +#define IICCF_SIZE_DEFAULT -1 +#define IICCF_NLOCS 2 +#define PCIBUSCF_BUS 0 +#define PCIBUSCF_BUS_DEFAULT -1 +#define PCIBUSCF_NLOCS 1 +#define ATA_HLCF_DRIVE 0 +#define ATA_HLCF_DRIVE_DEFAULT -1 +#define ATA_HLCF_NLOCS 1 +#define GPIOCF_OFFSET 0 +#define GPIOCF_OFFSET_DEFAULT -1 +#define GPIOCF_MASK 1 +#define GPIOCF_MASK_DEFAULT 0 +#define GPIOCF_FLAG 2 +#define GPIOCF_FLAG_DEFAULT 0 +#define GPIOCF_NLOCS 3 +#define UHIDBUSCF_REPORTID 0 +#define UHIDBUSCF_REPORTID_DEFAULT -1 +#define UHIDBUSCF_NLOCS 1 +#define ICPCF_UNIT 0 +#define ICPCF_UNIT_DEFAULT -1 +#define ICPCF_NLOCS 1 +#define WSDISPLAYDEVCF_KBDMUX 0 +#define WSDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSDISPLAYDEVCF_NLOCS 1 +#define MIICF_PHY 0 +#define MIICF_PHY_DEFAULT -1 +#define MIICF_NLOCS 1 +#define UPCCF_OFFSET 0 +#define UPCCF_OFFSET_DEFAULT -1 +#define UPCCF_NLOCS 1 +#define SPICF_SLAVE 0 +#define SPICF_NLOCS 1 +#define UCOMBUSCF_PORTNO 0 +#define UCOMBUSCF_PORTNO_DEFAULT -1 +#define UCOMBUSCF_NLOCS 1 diff --git a/sys/rump/dev/lib/libugenhc/machine b/sys/rump/dev/lib/libugenhc/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libugenhc/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libugenhc/ugenhc.c b/sys/rump/dev/lib/libugenhc/ugenhc.c new file mode 100644 index 000000000..663116d0e --- /dev/null +++ b/sys/rump/dev/lib/libugenhc/ugenhc.c @@ -0,0 +1,1133 @@ +/* $NetBSD: ugenhc.c,v 1.22 2014/08/02 12:38:01 skrll Exp $ */ + +/* + * Copyright (c) 2009, 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Lennart Augustsson (lennart@augustsson.net) at + * Carlstedt Research & Technology. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * This rump driver attaches ugen as a kernel usb host controller. + * It's still somewhat under the hammer .... + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: ugenhc.c,v 1.22 2014/08/02 12:38:01 skrll Exp $"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "ugenhc_user.h" + +#include "rump_private.h" +#include "rump_dev_private.h" + +#define UGEN_NEPTS 16 +#define UGEN_EPT_CTRL 0 /* ugenx.00 is the control endpoint */ + +struct ugenhc_softc { + struct usbd_bus sc_bus; + int sc_devnum; + + int sc_ugenfd[UGEN_NEPTS]; + int sc_fdmodes[UGEN_NEPTS]; + + int sc_port_status; + int sc_port_change; + int sc_addr; + int sc_conf; + + struct lwp *sc_rhintr; + usbd_xfer_handle sc_intrxfer; + + kmutex_t sc_lock; +}; + +static int ugenhc_probe(device_t, cfdata_t, void *); +static void ugenhc_attach(device_t, device_t, void *); + +CFATTACH_DECL_NEW(ugenhc, sizeof(struct ugenhc_softc), + ugenhc_probe, ugenhc_attach, NULL, NULL); + +struct rusb_xfer { + struct usbd_xfer rusb_xfer; + int rusb_status; /* now this is a cheap trick */ +}; +#define RUSB(x) ((struct rusb_xfer *)x) + +#define UGENDEV_BASESTR "/dev/ugen" +#define UGENDEV_BUFSIZE 32 +static void +makeugendevstr(int devnum, int endpoint, char *buf, size_t len) +{ + + CTASSERT(UGENDEV_BUFSIZE > sizeof(UGENDEV_BASESTR)+sizeof("0.00")+1); + snprintf(buf, len, "%s%d.%02d", UGENDEV_BASESTR, devnum, endpoint); +} + +/* + * Our fictional hubbie. + */ + +static const usb_device_descriptor_t rumphub_udd = { + .bLength = USB_DEVICE_DESCRIPTOR_SIZE, + .bDescriptorType = UDESC_DEVICE, + .bDeviceClass = UDCLASS_HUB, + .bDeviceSubClass = UDSUBCLASS_HUB, + .bDeviceProtocol = UDPROTO_FSHUB, + .bMaxPacketSize = 64, + .idVendor = { 0x75, 0x72 }, + .idProduct = { 0x70, 0x6d }, + .bNumConfigurations = 1, +}; + +static const usb_config_descriptor_t rumphub_ucd = { + .bLength = USB_CONFIG_DESCRIPTOR_SIZE, + .bDescriptorType = UDESC_CONFIG, + .wTotalLength = { USB_CONFIG_DESCRIPTOR_SIZE + + USB_INTERFACE_DESCRIPTOR_SIZE + + USB_ENDPOINT_DESCRIPTOR_SIZE }, + .bNumInterface = 1, + .bmAttributes = UC_SELF_POWERED | UC_ATTR_MBO, +}; + +static const usb_interface_descriptor_t rumphub_uid = { + .bLength = USB_INTERFACE_DESCRIPTOR_SIZE, + .bDescriptorType = UDESC_INTERFACE, + .bInterfaceNumber = 0, + .bNumEndpoints = 1, + .bInterfaceClass = UICLASS_HUB, + .bInterfaceSubClass = UISUBCLASS_HUB, + .bInterfaceProtocol = UIPROTO_FSHUB, +}; + +static const usb_endpoint_descriptor_t rumphub_epd = { + .bLength = USB_ENDPOINT_DESCRIPTOR_SIZE, + .bDescriptorType = UDESC_ENDPOINT, + .bmAttributes = UE_INTERRUPT, + .wMaxPacketSize = {64, 0}, +}; + +static const usb_hub_descriptor_t rumphub_hdd = { + .bDescLength = USB_HUB_DESCRIPTOR_SIZE, + .bDescriptorType = UDESC_HUB, + .bNbrPorts = 1, +}; + +static usbd_status +rumpusb_root_ctrl_start(usbd_xfer_handle xfer) +{ + usb_device_request_t *req = &xfer->request; + struct ugenhc_softc *sc = xfer->pipe->device->bus->hci_private; + int len, totlen, value, curlen, err; + uint8_t *buf = NULL; + + len = totlen = UGETW(req->wLength); + if (len) + buf = KERNADDR(&xfer->dmabuf, 0); + value = UGETW(req->wValue); + +#define C(x,y) ((x) | ((y) << 8)) + switch(C(req->bRequest, req->bmRequestType)) { + + case C(UR_GET_CONFIG, UT_READ_DEVICE): + if (len > 0) { + *buf = sc->sc_conf; + totlen = 1; + } + break; + + case C(UR_GET_DESCRIPTOR, UT_READ_DEVICE): + switch (value >> 8) { + case UDESC_DEVICE: + totlen = min(len, USB_DEVICE_DESCRIPTOR_SIZE); + memcpy(buf, &rumphub_udd, totlen); + break; + + case UDESC_CONFIG: + totlen = 0; + curlen = min(len, USB_CONFIG_DESCRIPTOR_SIZE); + memcpy(buf, &rumphub_ucd, curlen); + len -= curlen; + buf += curlen; + totlen += curlen; + + curlen = min(len, USB_INTERFACE_DESCRIPTOR_SIZE); + memcpy(buf, &rumphub_uid, curlen); + len -= curlen; + buf += curlen; + totlen += curlen; + + curlen = min(len, USB_ENDPOINT_DESCRIPTOR_SIZE); + memcpy(buf, &rumphub_epd, curlen); + len -= curlen; + buf += curlen; + totlen += curlen; + break; + + case UDESC_STRING: +#define sd ((usb_string_descriptor_t *)buf) + switch (value & 0xff) { + case 0: /* Language table */ + totlen = usb_makelangtbl(sd, len); + break; + case 1: /* Vendor */ + totlen = usb_makestrdesc(sd, len, "rod nevada"); + break; + case 2: /* Product */ + totlen = usb_makestrdesc(sd, len, + "RUMPUSBHC root hub"); + break; + } +#undef sd + break; + + default: + panic("unhandled read device request"); + break; + } + break; + + case C(UR_SET_ADDRESS, UT_WRITE_DEVICE): + if (value >= USB_MAX_DEVICES) { + err = USBD_IOERROR; + goto ret; + } + sc->sc_addr = value; + break; + + case C(UR_SET_CONFIG, UT_WRITE_DEVICE): + if (value != 0 && value != 1) { + err = USBD_IOERROR; + goto ret; + } + sc->sc_conf = value; + break; + + case C(UR_SET_FEATURE, UT_WRITE_CLASS_OTHER): + switch (value) { + case UHF_PORT_RESET: + sc->sc_port_change |= UPS_C_PORT_RESET; + break; + case UHF_PORT_POWER: + break; + default: + panic("unhandled"); + } + break; + + case C(UR_CLEAR_FEATURE, UT_WRITE_CLASS_OTHER): + sc->sc_port_change &= ~value; + break; + + case C(UR_GET_DESCRIPTOR, UT_READ_CLASS_DEVICE): + totlen = min(len, USB_HUB_DESCRIPTOR_SIZE); + memcpy(buf, &rumphub_hdd, totlen); + break; + + case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE): + /* huh? other hc's do this */ + memset(buf, 0, len); + totlen = len; + break; + + case C(UR_GET_STATUS, UT_READ_CLASS_OTHER): + { + usb_port_status_t ps; + + USETW(ps.wPortStatus, sc->sc_port_status); + USETW(ps.wPortChange, sc->sc_port_change); + totlen = min(len, sizeof(ps)); + memcpy(buf, &ps, totlen); + break; + } + + default: + panic("unhandled request"); + break; + } + err = USBD_NORMAL_COMPLETION; + xfer->actlen = totlen; + +ret: + xfer->status = err; + mutex_enter(&sc->sc_lock); + usb_transfer_complete(xfer); + mutex_exit(&sc->sc_lock); + + return (USBD_IN_PROGRESS); +} + +static usbd_status +rumpusb_root_ctrl_transfer(usbd_xfer_handle xfer) +{ + struct ugenhc_softc *sc = xfer->pipe->device->bus->hci_private; + usbd_status err; + + mutex_enter(&sc->sc_lock); + err = usb_insert_transfer(xfer); + mutex_exit(&sc->sc_lock); + if (err) + return (err); + + return (rumpusb_root_ctrl_start(SIMPLEQ_FIRST(&xfer->pipe->queue))); +} + +static void +rumpusb_root_ctrl_abort(usbd_xfer_handle xfer) +{ + +} + +static void +rumpusb_root_ctrl_close(usbd_pipe_handle pipe) +{ + +} + +static void +rumpusb_root_ctrl_cleartoggle(usbd_pipe_handle pipe) +{ + +} + +static void +rumpusb_root_ctrl_done(usbd_xfer_handle xfer) +{ + +} + +static const struct usbd_pipe_methods rumpusb_root_ctrl_methods = { + .transfer = rumpusb_root_ctrl_transfer, + .start = rumpusb_root_ctrl_start, + .abort = rumpusb_root_ctrl_abort, + .close = rumpusb_root_ctrl_close, + .cleartoggle = rumpusb_root_ctrl_cleartoggle, + .done = rumpusb_root_ctrl_done, +}; + +static usbd_status +rumpusb_device_ctrl_start(usbd_xfer_handle xfer) +{ + usb_device_request_t *req = &xfer->request; + struct ugenhc_softc *sc = xfer->pipe->device->bus->hci_private; + uint8_t *buf = NULL; + int len, totlen; + int value; + int err = 0; + int ru_error, mightfail = 0; + + len = totlen = UGETW(req->wLength); + if (len) + buf = KERNADDR(&xfer->dmabuf, 0); + value = UGETW(req->wValue); + +#define C(x,y) ((x) | ((y) << 8)) + switch(C(req->bRequest, req->bmRequestType)) { + case C(UR_GET_DESCRIPTOR, UT_READ_DEVICE): + switch (value>>8) { + case UDESC_DEVICE: + { + usb_device_descriptor_t uddesc; + totlen = min(len, USB_DEVICE_DESCRIPTOR_SIZE); + memset(buf, 0, totlen); + if (rumpcomp_ugenhc_ioctl(sc->sc_ugenfd[UGEN_EPT_CTRL], + USB_GET_DEVICE_DESC, &uddesc, &ru_error) == -1) { + err = EIO; + goto ret; + } + memcpy(buf, &uddesc, totlen); + } + + break; + case UDESC_CONFIG: + { + struct usb_full_desc ufdesc; + ufdesc.ufd_config_index = value & 0xff; + ufdesc.ufd_size = len; + ufdesc.ufd_data = buf; + memset(buf, 0, len); + if (rumpcomp_ugenhc_ioctl(sc->sc_ugenfd[UGEN_EPT_CTRL], + USB_GET_FULL_DESC, &ufdesc, &ru_error) == -1) { + err = USBD_IOERROR; + goto ret; + } + totlen = ufdesc.ufd_size; + } + break; + + case UDESC_STRING: + { + struct usb_device_info udi; + + if (rumpcomp_ugenhc_ioctl(sc->sc_ugenfd[UGEN_EPT_CTRL], + USB_GET_DEVICEINFO, &udi, &ru_error) == -1) { + printf("ugenhc: get dev info failed: %d\n", + ru_error); + err = USBD_IOERROR; + goto ret; + } + + switch (value & 0xff) { +#define sd ((usb_string_descriptor_t *)buf) + case 0: /* language table */ + break; + case 1: /* vendor */ + totlen = usb_makestrdesc(sd, len, + udi.udi_vendor); + break; + case 2: /* product */ + totlen = usb_makestrdesc(sd, len, + udi.udi_product); + break; + } +#undef sd + } + break; + + default: + panic("not handled"); + } + break; + + case C(UR_SET_ADDRESS, UT_WRITE_DEVICE): + /* ignored, ugen won't let us */ + break; + + case C(UR_SET_CONFIG, UT_WRITE_DEVICE): + if (rumpcomp_ugenhc_ioctl(sc->sc_ugenfd[UGEN_EPT_CTRL], + USB_SET_CONFIG, &value, &ru_error) == -1) { + printf("ugenhc: set config failed: %d\n", + ru_error); + err = USBD_IOERROR; + goto ret; + } + break; + + case C(UR_SET_INTERFACE, UT_WRITE_INTERFACE): + { + struct usb_alt_interface uai; + + totlen = 0; + uai.uai_interface_index = UGETW(req->wIndex); + uai.uai_alt_no = value; + if (rumpcomp_ugenhc_ioctl(sc->sc_ugenfd[UGEN_EPT_CTRL], + USB_SET_ALTINTERFACE, &uai, &ru_error) == -1) { + printf("ugenhc: set alt interface failed: %d\n", + ru_error); + err = USBD_IOERROR; + goto ret; + } + break; + } + + /* + * This request might fail unknown reasons. "EIO" doesn't + * give much help, and debugging the host ugen would be + * necessary. However, since it doesn't seem to really + * affect anything, just let it fail for now. + */ + case C(0x00, UT_WRITE_CLASS_INTERFACE): + mightfail = 1; + /*FALLTHROUGH*/ + + /* + * XXX: don't wildcard these yet. I want to better figure + * out what to trap here. This is kinda silly, though ... + */ + + case C(0x01, UT_WRITE_VENDOR_DEVICE): + case C(0x06, UT_WRITE_VENDOR_DEVICE): + case C(0x07, UT_READ_VENDOR_DEVICE): + case C(0x09, UT_READ_VENDOR_DEVICE): + case C(0xfe, UT_READ_CLASS_INTERFACE): + case C(0x01, UT_READ_CLASS_INTERFACE): + case C(UR_GET_STATUS, UT_READ_CLASS_OTHER): + case C(UR_GET_STATUS, UT_READ_CLASS_DEVICE): + case C(UR_GET_DESCRIPTOR, UT_READ_CLASS_DEVICE): + case C(UR_GET_DESCRIPTOR, UT_READ_INTERFACE): + case C(0xff, UT_WRITE_CLASS_INTERFACE): + case C(0x20, UT_WRITE_CLASS_INTERFACE): + case C(0x22, UT_WRITE_CLASS_INTERFACE): + case C(0x0a, UT_WRITE_CLASS_INTERFACE): + case C(UR_SET_FEATURE, UT_WRITE_CLASS_OTHER): + case C(0x00, UT_WRITE_CLASS_DEVICE): + case C(UR_SET_FEATURE, UT_WRITE_DEVICE): + case C(UR_CLEAR_FEATURE, UT_WRITE_CLASS_OTHER): + case C(UR_SET_REPORT, UT_WRITE_CLASS_INTERFACE): + case C(UR_CLEAR_FEATURE, UT_WRITE_ENDPOINT): + { + struct usb_ctl_request ucr; + + memcpy(&ucr.ucr_request, req, sizeof(ucr.ucr_request)); + ucr.ucr_data = buf; + if (rumpcomp_ugenhc_ioctl(sc->sc_ugenfd[UGEN_EPT_CTRL], + USB_DO_REQUEST, &ucr, &ru_error) == -1) { + if (!mightfail) { + panic("request failed: %d", ru_error); + } else { + err = ru_error; + } + } + } + break; + + default: + panic("unhandled request"); + break; + } + xfer->actlen = totlen; + err = USBD_NORMAL_COMPLETION; + + ret: + xfer->status = err; + mutex_enter(&sc->sc_lock); + usb_transfer_complete(xfer); + mutex_exit(&sc->sc_lock); + + return (USBD_IN_PROGRESS); +} + +static usbd_status +rumpusb_device_ctrl_transfer(usbd_xfer_handle xfer) +{ + struct ugenhc_softc *sc = xfer->pipe->device->bus->hci_private; + usbd_status err; + + mutex_enter(&sc->sc_lock); + err = usb_insert_transfer(xfer); + mutex_exit(&sc->sc_lock); + if (err) + return (err); + + return (rumpusb_device_ctrl_start(SIMPLEQ_FIRST(&xfer->pipe->queue))); +} + +static void +rumpusb_device_ctrl_abort(usbd_xfer_handle xfer) +{ + +} + +static void +rumpusb_device_ctrl_close(usbd_pipe_handle pipe) +{ + +} + +static void +rumpusb_device_ctrl_cleartoggle(usbd_pipe_handle pipe) +{ + +} + +static void +rumpusb_device_ctrl_done(usbd_xfer_handle xfer) +{ + +} + +static const struct usbd_pipe_methods rumpusb_device_ctrl_methods = { + .transfer = rumpusb_device_ctrl_transfer, + .start = rumpusb_device_ctrl_start, + .abort = rumpusb_device_ctrl_abort, + .close = rumpusb_device_ctrl_close, + .cleartoggle = rumpusb_device_ctrl_cleartoggle, + .done = rumpusb_device_ctrl_done, +}; + +static void +rhscintr(void *arg) +{ + char buf[UGENDEV_BUFSIZE]; + struct ugenhc_softc *sc = arg; + usbd_xfer_handle xfer; + int fd, error; + + makeugendevstr(sc->sc_devnum, 0, buf, sizeof(buf)); + + for (;;) { + /* + * Detect device attach. + */ + + for (;;) { + error = rumpuser_open(buf, RUMPUSER_OPEN_RDWR, &fd); + if (error == 0) + break; + kpause("ugwait", false, hz/4, NULL); + } + + sc->sc_ugenfd[UGEN_EPT_CTRL] = fd; + sc->sc_port_status = UPS_CURRENT_CONNECT_STATUS + | UPS_PORT_ENABLED | UPS_PORT_POWER; + sc->sc_port_change = UPS_C_CONNECT_STATUS | UPS_C_PORT_RESET; + + xfer = sc->sc_intrxfer; + memset(xfer->buffer, 0xff, xfer->length); + xfer->actlen = xfer->length; + xfer->status = USBD_NORMAL_COMPLETION; + + mutex_enter(&sc->sc_lock); + usb_transfer_complete(xfer); + mutex_exit(&sc->sc_lock); + + kpause("ugwait2", false, hz, NULL); + + /* + * Detect device detach. + */ + + for (;;) { + fd = rumpuser_open(buf, RUMPUSER_OPEN_RDWR, &error); + if (fd == -1) + break; + + error = rumpuser_close(fd); + kpause("ugwait2", false, hz/4, NULL); + } + + sc->sc_port_status = ~(UPS_CURRENT_CONNECT_STATUS + | UPS_PORT_ENABLED | UPS_PORT_POWER); + sc->sc_port_change = UPS_C_CONNECT_STATUS | UPS_C_PORT_RESET; + + error = rumpuser_close(sc->sc_ugenfd[UGEN_EPT_CTRL]); + sc->sc_ugenfd[UGEN_EPT_CTRL] = -1; + + xfer = sc->sc_intrxfer; + memset(xfer->buffer, 0xff, xfer->length); + xfer->actlen = xfer->length; + xfer->status = USBD_NORMAL_COMPLETION; + mutex_enter(&sc->sc_lock); + usb_transfer_complete(xfer); + mutex_exit(&sc->sc_lock); + + kpause("ugwait3", false, hz, NULL); + } + + kthread_exit(0); +} + +static usbd_status +rumpusb_root_intr_start(usbd_xfer_handle xfer) +{ + struct ugenhc_softc *sc = xfer->pipe->device->bus->hci_private; + int error; + + mutex_enter(&sc->sc_lock); + sc->sc_intrxfer = xfer; + if (!sc->sc_rhintr) { + error = kthread_create(PRI_NONE, 0, NULL, + rhscintr, sc, &sc->sc_rhintr, "ugenrhi"); + if (error) + xfer->status = USBD_IOERROR; + } + mutex_exit(&sc->sc_lock); + + return (USBD_IN_PROGRESS); +} + +static usbd_status +rumpusb_root_intr_transfer(usbd_xfer_handle xfer) +{ + struct ugenhc_softc *sc = xfer->pipe->device->bus->hci_private; + usbd_status err; + + mutex_enter(&sc->sc_lock); + err = usb_insert_transfer(xfer); + mutex_exit(&sc->sc_lock); + if (err) + return (err); + + return (rumpusb_root_intr_start(SIMPLEQ_FIRST(&xfer->pipe->queue))); +} + +static void +rumpusb_root_intr_abort(usbd_xfer_handle xfer) +{ + +} + +static void +rumpusb_root_intr_close(usbd_pipe_handle pipe) +{ + +} + +static void +rumpusb_root_intr_cleartoggle(usbd_pipe_handle pipe) +{ + +} + +static void +rumpusb_root_intr_done(usbd_xfer_handle xfer) +{ + +} + +static const struct usbd_pipe_methods rumpusb_root_intr_methods = { + .transfer = rumpusb_root_intr_transfer, + .start = rumpusb_root_intr_start, + .abort = rumpusb_root_intr_abort, + .close = rumpusb_root_intr_close, + .cleartoggle = rumpusb_root_intr_cleartoggle, + .done = rumpusb_root_intr_done, +}; + +static usbd_status +rumpusb_device_bulk_start(usbd_xfer_handle xfer) +{ + struct ugenhc_softc *sc = xfer->pipe->device->bus->hci_private; + usb_endpoint_descriptor_t *ed = xfer->pipe->endpoint->edesc; + size_t n, done; + bool isread; + int len, error, endpt; + uint8_t *buf; + int xfererr = USBD_NORMAL_COMPLETION; + int shortval, i; + + ed = xfer->pipe->endpoint->edesc; + endpt = ed->bEndpointAddress; + isread = UE_GET_DIR(endpt) == UE_DIR_IN; + endpt = UE_GET_ADDR(endpt); + KASSERT(endpt < UGEN_NEPTS); + + buf = KERNADDR(&xfer->dmabuf, 0); + done = 0; + if ((ed->bmAttributes & UE_XFERTYPE) == UE_ISOCHRONOUS) { + for (i = 0, len = 0; i < xfer->nframes; i++) + len += xfer->frlengths[i]; + } else { + KASSERT(xfer->length); + len = xfer->length; + } + shortval = (xfer->flags & USBD_SHORT_XFER_OK) != 0; + + while (RUSB(xfer)->rusb_status == 0) { + if (isread) { + struct rumpuser_iovec iov; + + rumpcomp_ugenhc_ioctl(sc->sc_ugenfd[endpt], + USB_SET_SHORT_XFER, &shortval, &error); + iov.iov_base = buf+done; + iov.iov_len = len-done; + error = rumpuser_iovread(sc->sc_ugenfd[endpt], &iov, 1, + RUMPUSER_IOV_NOSEEK, &n); + if (error) { + n = 0; + if (done == 0) { + if (error == ETIMEDOUT) + continue; + xfererr = USBD_IOERROR; + goto out; + } + } + done += n; + if (done == len) + break; + } else { + struct rumpuser_iovec iov; + + iov.iov_base = buf; + iov.iov_len = len; + error = rumpuser_iovwrite(sc->sc_ugenfd[endpt], &iov, 1, + RUMPUSER_IOV_NOSEEK, &n); + done = n; + if (done == len) + break; + else if (!error) + panic("short write"); + + xfererr = USBD_IOERROR; + goto out; + } + + if (shortval) { + /* + * Holy XXX, bitman. I get >16byte interrupt + * transfers from ugen in 16 byte chunks. + * Don't know how to better fix this for now. + * Of course this hack will fail e.g. if someone + * sports other magic values or if the transfer + * happens to be an integral multiple of 16 + * in size .... + */ + if ((ed->bmAttributes & UE_XFERTYPE) == UE_INTERRUPT + && n == 16) { + continue; + } else { + break; + } + } + } + + if (RUSB(xfer)->rusb_status == 0) { + xfer->actlen = done; + } else { + xfererr = USBD_CANCELLED; + RUSB(xfer)->rusb_status = 2; + } + out: + if ((ed->bmAttributes & UE_XFERTYPE) == UE_ISOCHRONOUS) + if (done != len) + panic("lazy bum"); + xfer->status = xfererr; + mutex_enter(&sc->sc_lock); + usb_transfer_complete(xfer); + mutex_exit(&sc->sc_lock); + return (USBD_IN_PROGRESS); +} + +static void +doxfer_kth(void *arg) +{ + usbd_pipe_handle pipe = arg; + struct ugenhc_softc *sc = pipe->device->bus->hci_private; + + mutex_enter(&sc->sc_lock); + do { + usbd_xfer_handle xfer = SIMPLEQ_FIRST(&pipe->queue); + mutex_exit(&sc->sc_lock); + rumpusb_device_bulk_start(xfer); + mutex_enter(&sc->sc_lock); + } while (!SIMPLEQ_EMPTY(&pipe->queue)); + mutex_exit(&sc->sc_lock); + kthread_exit(0); +} + +static usbd_status +rumpusb_device_bulk_transfer(usbd_xfer_handle xfer) +{ + struct ugenhc_softc *sc = xfer->pipe->device->bus->hci_private; + usbd_status err; + + if (!rump_threads) { + /* XXX: lie about supporting async transfers */ + if ((xfer->flags & USBD_SYNCHRONOUS) == 0) { + printf("non-threaded rump does not support " + "async transfers.\n"); + return USBD_IN_PROGRESS; + } + + mutex_enter(&sc->sc_lock); + err = usb_insert_transfer(xfer); + mutex_exit(&sc->sc_lock); + if (err) + return err; + + return rumpusb_device_bulk_start( + SIMPLEQ_FIRST(&xfer->pipe->queue)); + } else { + mutex_enter(&sc->sc_lock); + err = usb_insert_transfer(xfer); + mutex_exit(&sc->sc_lock); + if (err) + return err; + kthread_create(PRI_NONE, 0, NULL, doxfer_kth, xfer->pipe, NULL, + "rusbhcxf"); + + return USBD_IN_PROGRESS; + } +} + +/* wait for transfer to abort. yea, this is cheesy (from a spray can) */ +static void +rumpusb_device_bulk_abort(usbd_xfer_handle xfer) +{ + struct rusb_xfer *rx = RUSB(xfer); + + rx->rusb_status = 1; + while (rx->rusb_status < 2) { + kpause("jopo", false, hz/10, NULL); + } +} + +static void +rumpusb_device_bulk_close(usbd_pipe_handle pipe) +{ + struct ugenhc_softc *sc = pipe->device->bus->hci_private; + int endpt = pipe->endpoint->edesc->bEndpointAddress; + usbd_xfer_handle xfer; + + KASSERT(mutex_owned(&sc->sc_lock)); + + endpt = UE_GET_ADDR(endpt); + + while ((xfer = SIMPLEQ_FIRST(&pipe->queue)) != NULL) + rumpusb_device_bulk_abort(xfer); + + rumpuser_close(sc->sc_ugenfd[endpt]); + sc->sc_ugenfd[endpt] = -1; + sc->sc_fdmodes[endpt] = -1; +} + +static void +rumpusb_device_bulk_cleartoggle(usbd_pipe_handle pipe) +{ + +} + +static void +rumpusb_device_bulk_done(usbd_xfer_handle xfer) +{ + +} + +static const struct usbd_pipe_methods rumpusb_device_bulk_methods = { + .transfer = rumpusb_device_bulk_transfer, + .start = rumpusb_device_bulk_start, + .abort = rumpusb_device_bulk_abort, + .close = rumpusb_device_bulk_close, + .cleartoggle = rumpusb_device_bulk_cleartoggle, + .done = rumpusb_device_bulk_done, +}; + +static usbd_status +ugenhc_open(struct usbd_pipe *pipe) +{ + usbd_device_handle dev = pipe->device; + struct ugenhc_softc *sc = dev->bus->hci_private; + usb_endpoint_descriptor_t *ed = pipe->endpoint->edesc; + u_int8_t addr = dev->address; + u_int8_t xfertype = ed->bmAttributes & UE_XFERTYPE; + char buf[UGENDEV_BUFSIZE]; + int endpt, oflags, error; + int fd, val; + + if (addr == sc->sc_addr) { + switch (xfertype) { + case UE_CONTROL: + pipe->methods = &rumpusb_root_ctrl_methods; + break; + case UE_INTERRUPT: + pipe->methods = &rumpusb_root_intr_methods; + break; + default: + panic("%d not supported", xfertype); + break; + } + } else { + switch (xfertype) { + case UE_CONTROL: + pipe->methods = &rumpusb_device_ctrl_methods; + break; + case UE_INTERRUPT: + case UE_BULK: + case UE_ISOCHRONOUS: + pipe->methods = &rumpusb_device_bulk_methods; + endpt = pipe->endpoint->edesc->bEndpointAddress; + if (UE_GET_DIR(endpt) == UE_DIR_IN) { + oflags = O_RDONLY; + } else { + oflags = O_WRONLY; + } + endpt = UE_GET_ADDR(endpt); + + if (oflags != O_RDONLY && xfertype == UE_ISOCHRONOUS) { + printf("WARNING: faking isoc write open\n"); + oflags = O_RDONLY; + } + + if (sc->sc_fdmodes[endpt] == oflags + || sc->sc_fdmodes[endpt] == O_RDWR) + break; + + if (sc->sc_fdmodes[endpt] != -1) { + /* XXX: closing from under someone? */ + error = rumpuser_close(sc->sc_ugenfd[endpt]); + oflags = O_RDWR; + } + + makeugendevstr(sc->sc_devnum, endpt, buf, sizeof(buf)); + /* XXX: theoretically should convert oflags */ + error = rumpuser_open(buf, oflags, &fd); + if (error != 0) { + return USBD_INVAL; /* XXX: no mapping */ + } + val = 100; + if (rumpcomp_ugenhc_ioctl(fd, USB_SET_TIMEOUT, &val, + &error) == -1) + panic("timeout set failed"); + sc->sc_ugenfd[endpt] = fd; + sc->sc_fdmodes[endpt] = oflags; + + break; + default: + panic("%d not supported", xfertype); + break; + + } + } + return 0; +} + +static void +ugenhc_softint(void *arg) +{ + +} + +static void +ugenhc_poll(struct usbd_bus *ubus) +{ + +} + +static usbd_status +ugenhc_allocm(struct usbd_bus *bus, usb_dma_t *dma, uint32_t size) +{ + struct ugenhc_softc *sc = bus->hci_private; + + return usb_allocmem(&sc->sc_bus, size, 0, dma); +} + +static void +ugenhc_freem(struct usbd_bus *bus, usb_dma_t *dma) +{ + struct ugenhc_softc *sc = bus->hci_private; + + usb_freemem(&sc->sc_bus, dma); +} + +static struct usbd_xfer * +ugenhc_allocx(struct usbd_bus *bus) +{ + usbd_xfer_handle xfer; + + xfer = kmem_zalloc(sizeof(struct usbd_xfer), KM_SLEEP); + xfer->busy_free = XFER_BUSY; + + return xfer; +} + +static void +ugenhc_freex(struct usbd_bus *bus, struct usbd_xfer *xfer) +{ + + kmem_free(xfer, sizeof(struct usbd_xfer)); +} + + +static void +ugenhc_getlock(struct usbd_bus *bus, kmutex_t **lock) +{ + struct ugenhc_softc *sc = bus->hci_private; + + *lock = &sc->sc_lock; +} + +struct ugenhc_pipe { + struct usbd_pipe pipe; +}; + +static const struct usbd_bus_methods ugenhc_bus_methods = { + .open_pipe = ugenhc_open, + .soft_intr = ugenhc_softint, + .do_poll = ugenhc_poll, + .allocm = ugenhc_allocm, + .freem = ugenhc_freem, + .allocx = ugenhc_allocx, + .freex = ugenhc_freex, + .get_lock = ugenhc_getlock +}; + +static int +ugenhc_probe(device_t parent, cfdata_t match, void *aux) +{ + char buf[UGENDEV_BUFSIZE]; + + makeugendevstr(match->cf_unit, 0, buf, sizeof(buf)); + if (rumpuser_getfileinfo(buf, NULL, NULL) != 0) + return 0; + + return 1; +} + +static void +ugenhc_attach(device_t parent, device_t self, void *aux) +{ + struct mainbus_attach_args *maa = aux; + struct ugenhc_softc *sc = device_private(self); + + aprint_normal("\n"); + + memset(sc, 0, sizeof(*sc)); + memset(&sc->sc_ugenfd, -1, sizeof(sc->sc_ugenfd)); + memset(&sc->sc_fdmodes, -1, sizeof(sc->sc_fdmodes)); + + sc->sc_bus.usbrev = USBREV_2_0; + sc->sc_bus.methods = &ugenhc_bus_methods; + sc->sc_bus.hci_private = sc; + sc->sc_bus.pipe_size = sizeof(struct ugenhc_pipe); + sc->sc_devnum = maa->maa_unit; + + mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE); + + config_found(self, &sc->sc_bus, usbctlprint); +} diff --git a/sys/rump/dev/lib/libugenhc/ugenhc_at_mainbus.c b/sys/rump/dev/lib/libugenhc/ugenhc_at_mainbus.c new file mode 100644 index 000000000..77fe05d37 --- /dev/null +++ b/sys/rump/dev/lib/libugenhc/ugenhc_at_mainbus.c @@ -0,0 +1,22 @@ +/* $NetBSD: ugenhc_at_mainbus.c,v 1.3 2010/03/26 15:51:55 pooka Exp $ */ + +#include +#include +#include +#include +#include +#include + +#include "ioconf.c" + +#include "rump_private.h" +#include "rump_dev_private.h" + +void tty_init(void); + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_ugenhc, + cfattach_ioconf_ugenhc, cfdata_ioconf_ugenhc); +} diff --git a/sys/rump/dev/lib/libugenhc/ugenhc_dma.c b/sys/rump/dev/lib/libugenhc/ugenhc_dma.c new file mode 100644 index 000000000..8bf3a6554 --- /dev/null +++ b/sys/rump/dev/lib/libugenhc/ugenhc_dma.c @@ -0,0 +1,119 @@ +/* $NetBSD: ugenhc_dma.c,v 1.2 2015/09/14 15:08:50 pooka Exp $ */ + +/* + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include + +/* + * bus_dma(9) that works for USB drivers. + * + * So why is it here instead of in libusb? Well, first of all, it's + * actually a bus_dma implementation which works with ugenhc. Of course, + * ugenhc doesn't make any bus_dma calls itself, all of those calls come + * from the usb code. However, the USB component can be paired with other + * USB host controllers, such as {e,o,u}hci. Therefore, we keep the "D"MA + * code here. + * + * Note: this implementation requires a __HAVE_NEW_STYLE_BUS_H arch + */ + +int +bus_dmamap_create(bus_dma_tag_t tag, bus_size_t sz, int flag, bus_size_t bsz, + bus_size_t bsz2, int i, bus_dmamap_t *ptr) +{ + + return 0; +} + +void +bus_dmamap_destroy(bus_dma_tag_t tag, bus_dmamap_t map) +{ + + panic("unimplemented %s", __func__); +} + +int +bus_dmamap_load(bus_dma_tag_t t, bus_dmamap_t a, void *b, bus_size_t c, + struct proc *d, int e) +{ + + return 0; +} + +void +bus_dmamap_unload(bus_dma_tag_t a, bus_dmamap_t b) +{ + + panic("unimplemented %s", __func__); +} + +void +bus_dmamap_sync(bus_dma_tag_t a, bus_dmamap_t b, bus_addr_t c, + bus_size_t d, int e) +{ + + panic("unimplemented %s", __func__); +} + +int +bus_dmamem_alloc(bus_dma_tag_t tag, bus_size_t size, bus_size_t align, + bus_size_t boundary, bus_dma_segment_t *segs, int nsegs, + int *rsegs, int flags) +{ + + *rsegs = nsegs; + return 0; +} + +void +bus_dmamem_free(bus_dma_tag_t a, bus_dma_segment_t *b, int c) +{ + + panic("unimplemented %s", __func__); +} + +int +bus_dmamem_map(bus_dma_tag_t tag, bus_dma_segment_t *segs, int nsegs, + size_t size, void **kvap, int flags) +{ + + KASSERT(nsegs == 1); + *kvap = kmem_alloc(size, KM_SLEEP); + return 0; +} + +void +bus_dmamem_unmap(bus_dma_tag_t a, void *kva, size_t b) +{ + + kmem_free(kva, b); +} diff --git a/sys/rump/dev/lib/libugenhc/ugenhc_user.c b/sys/rump/dev/lib/libugenhc/ugenhc_user.c new file mode 100644 index 000000000..c63e2a758 --- /dev/null +++ b/sys/rump/dev/lib/libugenhc/ugenhc_user.c @@ -0,0 +1,54 @@ +/* $NetBSD: ugenhc_user.c,v 1.1 2014/03/13 01:38:11 pooka Exp $ */ + +/* + * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#ifndef _KERNEL +#include +#include + +#include +#include + +#include + +#include "ugenhc_user.h" + +int +rumpcomp_ugenhc_ioctl(int fd, u_long cmd, void *data, int *ioctlrv) +{ + void *cookie; + int rv; + + cookie = rumpuser_component_unschedule(); + *ioctlrv = ioctl(fd, cmd, data); + if (*ioctlrv == -1) + rv = errno; + else + rv = 0; + rumpuser_component_schedule(cookie); + + return rumpuser_component_errtrans(rv); +} +#endif diff --git a/sys/rump/dev/lib/libugenhc/ugenhc_user.h b/sys/rump/dev/lib/libugenhc/ugenhc_user.h new file mode 100644 index 000000000..199637755 --- /dev/null +++ b/sys/rump/dev/lib/libugenhc/ugenhc_user.h @@ -0,0 +1,28 @@ +/* $NetBSD: ugenhc_user.h,v 1.1 2014/03/13 01:38:11 pooka Exp $ */ + +/* + * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +int rumpcomp_ugenhc_ioctl(int, u_long, void *, int *); diff --git a/sys/rump/dev/lib/libugenhc/x86 b/sys/rump/dev/lib/libugenhc/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libugenhc/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libulpt/Makefile b/sys/rump/dev/lib/libulpt/Makefile new file mode 100644 index 000000000..2af0c560e --- /dev/null +++ b/sys/rump/dev/lib/libulpt/Makefile @@ -0,0 +1,16 @@ +# $NetBSD: Makefile,v 1.3 2010/03/01 15:41:15 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/usb + +LIB= rumpdev_ulpt +IOCONF= ULPT.ioconf + +SRCS= ulpt.c + +SRCS+= ulpt_at_usb.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libulpt/ULPT.ioconf b/sys/rump/dev/lib/libulpt/ULPT.ioconf new file mode 100644 index 000000000..d3e1ffefa --- /dev/null +++ b/sys/rump/dev/lib/libulpt/ULPT.ioconf @@ -0,0 +1,11 @@ +# $NetBSD: ULPT.ioconf,v 1.4 2010/08/30 11:52:10 pooka Exp $ +# + +ioconf ulpt + +include "conf/files" +include "dev/usb/files.usb" + +pseudo-root uhub* + +ulpt* at uhub? port ? configuration ? interface ? diff --git a/sys/rump/dev/lib/libulpt/i386 b/sys/rump/dev/lib/libulpt/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libulpt/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libulpt/ioconf.c b/sys/rump/dev/lib/libulpt/ioconf.c new file mode 100644 index 000000000..fcab2fa17 --- /dev/null +++ b/sys/rump/dev/lib/libulpt/ioconf.c @@ -0,0 +1,70 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libulpt/ULPT.ioconf" + */ + +#include +#include +#include +#include + +static const struct cfiattrdata usbififcf_iattrdata = { + "usbifif", 6, { + { "port", "-1", -1 }, + { "configuration", "-1", -1 }, + { "interface", "-1", -1 }, + { "vendor", "-1", -1 }, + { "product", "-1", -1 }, + { "release", "-1", -1 }, + } +}; +static const struct cfiattrdata usbdevifcf_iattrdata = { + "usbdevif", 6, { + { "port", "-1", -1 }, + { "configuration", "-1", -1 }, + { "interface", "-1", -1 }, + { "vendor", "-1", -1 }, + { "product", "-1", -1 }, + { "release", "-1", -1 }, + } +}; + +CFDRIVER_DECL(ulpt, DV_DULL, NULL); + + +static struct cfdriver * const cfdriver_ioconf_ulpt[] = { + &ulpt_cd, + NULL +}; + +extern struct cfattach ulpt_ca; + +/* locators */ +static int loc[6] = { + -1, -1, -1, -1, -1, -1, +}; + +static const struct cfparent pspec0 = { + "usbifif", "uhub", DVUNIT_ANY +}; + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_ulpt[] = { + /* driver attachment unit state loc flags pspec */ +/* 0: ulpt* at uhub? port -1 configuration -1 interface -1 vendor -1 product -1 release -1 */ + { "ulpt", "ulpt", 0, STAR, loc+ 0, 0, &pspec0 }, + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + +static struct cfattach * const ulpt_cfattachinit[] = { + &ulpt_ca, NULL +}; + +static const struct cfattachinit cfattach_ioconf_ulpt[] = { + { "ulpt", ulpt_cfattachinit }, + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libulpt/ioconf.h b/sys/rump/dev/lib/libulpt/ioconf.h new file mode 100644 index 000000000..f38f9da40 --- /dev/null +++ b/sys/rump/dev/lib/libulpt/ioconf.h @@ -0,0 +1,5 @@ + +/* pseudo-devices */ + +/* driver structs */ +extern struct cfdriver ulpt_cd; diff --git a/sys/rump/dev/lib/libulpt/locators.h b/sys/rump/dev/lib/libulpt/locators.h new file mode 100644 index 000000000..998e1f4aa --- /dev/null +++ b/sys/rump/dev/lib/libulpt/locators.h @@ -0,0 +1,117 @@ +#define WSKBDDEVCF_CONSOLE 0 +#define WSKBDDEVCF_CONSOLE_DEFAULT -1 +#define WSKBDDEVCF_MUX 1 +#define WSKBDDEVCF_MUX_DEFAULT 1 +#define WSKBDDEVCF_NLOCS 2 +#define WSEMULDISPLAYDEVCF_CONSOLE 0 +#define WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT -1 +#define WSEMULDISPLAYDEVCF_KBDMUX 1 +#define WSEMULDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSEMULDISPLAYDEVCF_NLOCS 2 +#define AACCF_UNIT 0 +#define AACCF_UNIT_DEFAULT -1 +#define AACCF_NLOCS 1 +#define PCKBPORTCF_SLOT 0 +#define PCKBPORTCF_SLOT_DEFAULT -1 +#define PCKBPORTCF_NLOCS 1 +#define MLXCF_UNIT 0 +#define MLXCF_UNIT_DEFAULT -1 +#define MLXCF_NLOCS 1 +#define WSMOUSEDEVCF_MUX 0 +#define WSMOUSEDEVCF_MUX_DEFAULT 0 +#define WSMOUSEDEVCF_NLOCS 1 +#define SCSICF_CHANNEL 0 +#define SCSICF_CHANNEL_DEFAULT -1 +#define SCSICF_NLOCS 1 +#define HDAUDIOBUSCF_NID 0 +#define HDAUDIOBUSCF_NID_DEFAULT -1 +#define HDAUDIOBUSCF_NLOCS 1 +#define USBIFIFCF_PORT 0 +#define USBIFIFCF_PORT_DEFAULT -1 +#define USBIFIFCF_CONFIGURATION 1 +#define USBIFIFCF_CONFIGURATION_DEFAULT -1 +#define USBIFIFCF_INTERFACE 2 +#define USBIFIFCF_INTERFACE_DEFAULT -1 +#define USBIFIFCF_VENDOR 3 +#define USBIFIFCF_VENDOR_DEFAULT -1 +#define USBIFIFCF_PRODUCT 4 +#define USBIFIFCF_PRODUCT_DEFAULT -1 +#define USBIFIFCF_RELEASE 5 +#define USBIFIFCF_RELEASE_DEFAULT -1 +#define USBIFIFCF_NLOCS 6 +#define CPCBUSCF_ADDR 0 +#define CPCBUSCF_IRQ 1 +#define CPCBUSCF_IRQ_DEFAULT -1 +#define CPCBUSCF_NLOCS 2 +#define ATACF_CHANNEL 0 +#define ATACF_CHANNEL_DEFAULT -1 +#define ATACF_NLOCS 1 +#define USBDEVIFCF_PORT 0 +#define USBDEVIFCF_PORT_DEFAULT -1 +#define USBDEVIFCF_CONFIGURATION 1 +#define USBDEVIFCF_CONFIGURATION_DEFAULT -1 +#define USBDEVIFCF_INTERFACE 2 +#define USBDEVIFCF_INTERFACE_DEFAULT -1 +#define USBDEVIFCF_VENDOR 3 +#define USBDEVIFCF_VENDOR_DEFAULT -1 +#define USBDEVIFCF_PRODUCT 4 +#define USBDEVIFCF_PRODUCT_DEFAULT -1 +#define USBDEVIFCF_RELEASE 5 +#define USBDEVIFCF_RELEASE_DEFAULT -1 +#define USBDEVIFCF_NLOCS 6 +#define PCMCIABUSCF_CONTROLLER 0 +#define PCMCIABUSCF_CONTROLLER_DEFAULT -1 +#define PCMCIABUSCF_SOCKET 1 +#define PCMCIABUSCF_SOCKET_DEFAULT -1 +#define PCMCIABUSCF_NLOCS 2 +#define FLASHBUSCF_OFFSET 0 +#define FLASHBUSCF_OFFSET_DEFAULT 0 +#define FLASHBUSCF_SIZE 1 +#define FLASHBUSCF_SIZE_DEFAULT 0 +#define FLASHBUSCF_READONLY 2 +#define FLASHBUSCF_READONLY_DEFAULT 0 +#define FLASHBUSCF_NLOCS 3 +#define CACCF_UNIT 0 +#define CACCF_UNIT_DEFAULT -1 +#define CACCF_NLOCS 1 +#define GPIBDEVCF_ADDRESS 0 +#define GPIBDEVCF_ADDRESS_DEFAULT -1 +#define GPIBDEVCF_NLOCS 1 +#define IICCF_ADDR 0 +#define IICCF_ADDR_DEFAULT -1 +#define IICCF_SIZE 1 +#define IICCF_SIZE_DEFAULT -1 +#define IICCF_NLOCS 2 +#define PCIBUSCF_BUS 0 +#define PCIBUSCF_BUS_DEFAULT -1 +#define PCIBUSCF_NLOCS 1 +#define ATA_HLCF_DRIVE 0 +#define ATA_HLCF_DRIVE_DEFAULT -1 +#define ATA_HLCF_NLOCS 1 +#define GPIOCF_OFFSET 0 +#define GPIOCF_OFFSET_DEFAULT -1 +#define GPIOCF_MASK 1 +#define GPIOCF_MASK_DEFAULT 0 +#define GPIOCF_FLAG 2 +#define GPIOCF_FLAG_DEFAULT 0 +#define GPIOCF_NLOCS 3 +#define UHIDBUSCF_REPORTID 0 +#define UHIDBUSCF_REPORTID_DEFAULT -1 +#define UHIDBUSCF_NLOCS 1 +#define ICPCF_UNIT 0 +#define ICPCF_UNIT_DEFAULT -1 +#define ICPCF_NLOCS 1 +#define WSDISPLAYDEVCF_KBDMUX 0 +#define WSDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSDISPLAYDEVCF_NLOCS 1 +#define MIICF_PHY 0 +#define MIICF_PHY_DEFAULT -1 +#define MIICF_NLOCS 1 +#define UPCCF_OFFSET 0 +#define UPCCF_OFFSET_DEFAULT -1 +#define UPCCF_NLOCS 1 +#define SPICF_SLAVE 0 +#define SPICF_NLOCS 1 +#define UCOMBUSCF_PORTNO 0 +#define UCOMBUSCF_PORTNO_DEFAULT -1 +#define UCOMBUSCF_NLOCS 1 diff --git a/sys/rump/dev/lib/libulpt/machine b/sys/rump/dev/lib/libulpt/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libulpt/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libulpt/ulpt_at_usb.c b/sys/rump/dev/lib/libulpt/ulpt_at_usb.c new file mode 100644 index 000000000..cf0856825 --- /dev/null +++ b/sys/rump/dev/lib/libulpt/ulpt_at_usb.c @@ -0,0 +1,28 @@ +/* $NetBSD: ulpt_at_usb.c,v 1.5 2010/03/26 15:51:55 pooka Exp $ */ + +#include +#include +#include +#include +#include + +#include "ioconf.c" + +#include "rump_private.h" +#include "rump_dev_private.h" +#include "rump_vfs_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern struct cdevsw ulpt_cdevsw; + devmajor_t bmaj, cmaj; + + config_init_component(cfdriver_ioconf_ulpt, + cfattach_ioconf_ulpt, cfdata_ioconf_ulpt); + + bmaj = cmaj = -1; + FLAWLESSCALL(devsw_attach("ulpt", NULL, &bmaj, &ulpt_cdevsw, &cmaj)); + + FLAWLESSCALL(rump_vfs_makedevnodes(S_IFCHR, "/dev/ulpt", '0', + cmaj, 0, 1)); +} diff --git a/sys/rump/dev/lib/libulpt/x86 b/sys/rump/dev/lib/libulpt/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libulpt/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libumass/Makefile b/sys/rump/dev/lib/libumass/Makefile new file mode 100644 index 000000000..87d507b38 --- /dev/null +++ b/sys/rump/dev/lib/libumass/Makefile @@ -0,0 +1,18 @@ +# $NetBSD: Makefile,v 1.9 2015/08/24 23:21:51 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/usb + +LIB= rumpdev_umass +IOCONF= UMASS.ioconf + +.if ${MACHINE} == "i386" || ${MACHINE} == "amd64" +SRCS= umass.c umass_isdata.c umass_quirks.c umass_scsipi.c + +SRCS+= umass_component.c +.else +SRCS= dummy.c +.endif + +.include +.include diff --git a/sys/rump/dev/lib/libumass/UMASS.ioconf b/sys/rump/dev/lib/libumass/UMASS.ioconf new file mode 100644 index 000000000..39c787a81 --- /dev/null +++ b/sys/rump/dev/lib/libumass/UMASS.ioconf @@ -0,0 +1,12 @@ +# $NetBSD: UMASS.ioconf,v 1.4 2010/08/23 20:49:53 pooka Exp $ +# + +ioconf umass + +include "conf/files" +include "dev/usb/files.usb" + +pseudo-root uhub* + +# USB Mass Storage +umass* at uhub? port ? configuration ? interface ? diff --git a/sys/rump/dev/lib/libumass/dummy.c b/sys/rump/dev/lib/libumass/dummy.c new file mode 100644 index 000000000..80bb33cad --- /dev/null +++ b/sys/rump/dev/lib/libumass/dummy.c @@ -0,0 +1 @@ +int nada; diff --git a/sys/rump/dev/lib/libumass/i386 b/sys/rump/dev/lib/libumass/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libumass/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libumass/ioconf.c b/sys/rump/dev/lib/libumass/ioconf.c new file mode 100644 index 000000000..ad4fb8205 --- /dev/null +++ b/sys/rump/dev/lib/libumass/ioconf.c @@ -0,0 +1,86 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libumass/UMASS.ioconf" + */ + +#include +#include +#include +#include + +static const struct cfiattrdata atapicf_iattrdata = { + "atapi", 0, { + { NULL, NULL, 0 }, + } +}; +static const struct cfiattrdata scsicf_iattrdata = { + "scsi", 1, { + { "channel", "-1", -1 }, + } +}; +static const struct cfiattrdata usbififcf_iattrdata = { + "usbifif", 6, { + { "port", "-1", -1 }, + { "configuration", "-1", -1 }, + { "interface", "-1", -1 }, + { "vendor", "-1", -1 }, + { "product", "-1", -1 }, + { "release", "-1", -1 }, + } +}; +static const struct cfiattrdata usbdevifcf_iattrdata = { + "usbdevif", 6, { + { "port", "-1", -1 }, + { "configuration", "-1", -1 }, + { "interface", "-1", -1 }, + { "vendor", "-1", -1 }, + { "product", "-1", -1 }, + { "release", "-1", -1 }, + } +}; +static const struct cfiattrdata ata_hlcf_iattrdata = { + "ata_hl", 1, { + { "drive", "-1", -1 }, + } +}; + +static const struct cfiattrdata * const umass_attrs[] = { &ata_hlcf_iattrdata, &atapicf_iattrdata, &scsicf_iattrdata, NULL }; +CFDRIVER_DECL(umass, DV_DULL, umass_attrs); + + +static struct cfdriver * const cfdriver_ioconf_umass[] = { + &umass_cd, + NULL +}; + +extern struct cfattach umass_ca; + +/* locators */ +static int loc[6] = { + -1, -1, -1, -1, -1, -1, +}; + +static const struct cfparent pspec0 = { + "usbifif", "uhub", DVUNIT_ANY +}; + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_umass[] = { + /* driver attachment unit state loc flags pspec */ +/* 0: umass* at uhub? port -1 configuration -1 interface -1 vendor -1 product -1 release -1 */ + { "umass", "umass", 0, STAR, loc+ 0, 0, &pspec0 }, + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + +static struct cfattach * const umass_cfattachinit[] = { + &umass_ca, NULL +}; + +static const struct cfattachinit cfattach_ioconf_umass[] = { + { "umass", umass_cfattachinit }, + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libumass/ioconf.h b/sys/rump/dev/lib/libumass/ioconf.h new file mode 100644 index 000000000..812fca324 --- /dev/null +++ b/sys/rump/dev/lib/libumass/ioconf.h @@ -0,0 +1,5 @@ + +/* pseudo-devices */ + +/* driver structs */ +extern struct cfdriver umass_cd; diff --git a/sys/rump/dev/lib/libumass/locators.h b/sys/rump/dev/lib/libumass/locators.h new file mode 100644 index 000000000..998e1f4aa --- /dev/null +++ b/sys/rump/dev/lib/libumass/locators.h @@ -0,0 +1,117 @@ +#define WSKBDDEVCF_CONSOLE 0 +#define WSKBDDEVCF_CONSOLE_DEFAULT -1 +#define WSKBDDEVCF_MUX 1 +#define WSKBDDEVCF_MUX_DEFAULT 1 +#define WSKBDDEVCF_NLOCS 2 +#define WSEMULDISPLAYDEVCF_CONSOLE 0 +#define WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT -1 +#define WSEMULDISPLAYDEVCF_KBDMUX 1 +#define WSEMULDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSEMULDISPLAYDEVCF_NLOCS 2 +#define AACCF_UNIT 0 +#define AACCF_UNIT_DEFAULT -1 +#define AACCF_NLOCS 1 +#define PCKBPORTCF_SLOT 0 +#define PCKBPORTCF_SLOT_DEFAULT -1 +#define PCKBPORTCF_NLOCS 1 +#define MLXCF_UNIT 0 +#define MLXCF_UNIT_DEFAULT -1 +#define MLXCF_NLOCS 1 +#define WSMOUSEDEVCF_MUX 0 +#define WSMOUSEDEVCF_MUX_DEFAULT 0 +#define WSMOUSEDEVCF_NLOCS 1 +#define SCSICF_CHANNEL 0 +#define SCSICF_CHANNEL_DEFAULT -1 +#define SCSICF_NLOCS 1 +#define HDAUDIOBUSCF_NID 0 +#define HDAUDIOBUSCF_NID_DEFAULT -1 +#define HDAUDIOBUSCF_NLOCS 1 +#define USBIFIFCF_PORT 0 +#define USBIFIFCF_PORT_DEFAULT -1 +#define USBIFIFCF_CONFIGURATION 1 +#define USBIFIFCF_CONFIGURATION_DEFAULT -1 +#define USBIFIFCF_INTERFACE 2 +#define USBIFIFCF_INTERFACE_DEFAULT -1 +#define USBIFIFCF_VENDOR 3 +#define USBIFIFCF_VENDOR_DEFAULT -1 +#define USBIFIFCF_PRODUCT 4 +#define USBIFIFCF_PRODUCT_DEFAULT -1 +#define USBIFIFCF_RELEASE 5 +#define USBIFIFCF_RELEASE_DEFAULT -1 +#define USBIFIFCF_NLOCS 6 +#define CPCBUSCF_ADDR 0 +#define CPCBUSCF_IRQ 1 +#define CPCBUSCF_IRQ_DEFAULT -1 +#define CPCBUSCF_NLOCS 2 +#define ATACF_CHANNEL 0 +#define ATACF_CHANNEL_DEFAULT -1 +#define ATACF_NLOCS 1 +#define USBDEVIFCF_PORT 0 +#define USBDEVIFCF_PORT_DEFAULT -1 +#define USBDEVIFCF_CONFIGURATION 1 +#define USBDEVIFCF_CONFIGURATION_DEFAULT -1 +#define USBDEVIFCF_INTERFACE 2 +#define USBDEVIFCF_INTERFACE_DEFAULT -1 +#define USBDEVIFCF_VENDOR 3 +#define USBDEVIFCF_VENDOR_DEFAULT -1 +#define USBDEVIFCF_PRODUCT 4 +#define USBDEVIFCF_PRODUCT_DEFAULT -1 +#define USBDEVIFCF_RELEASE 5 +#define USBDEVIFCF_RELEASE_DEFAULT -1 +#define USBDEVIFCF_NLOCS 6 +#define PCMCIABUSCF_CONTROLLER 0 +#define PCMCIABUSCF_CONTROLLER_DEFAULT -1 +#define PCMCIABUSCF_SOCKET 1 +#define PCMCIABUSCF_SOCKET_DEFAULT -1 +#define PCMCIABUSCF_NLOCS 2 +#define FLASHBUSCF_OFFSET 0 +#define FLASHBUSCF_OFFSET_DEFAULT 0 +#define FLASHBUSCF_SIZE 1 +#define FLASHBUSCF_SIZE_DEFAULT 0 +#define FLASHBUSCF_READONLY 2 +#define FLASHBUSCF_READONLY_DEFAULT 0 +#define FLASHBUSCF_NLOCS 3 +#define CACCF_UNIT 0 +#define CACCF_UNIT_DEFAULT -1 +#define CACCF_NLOCS 1 +#define GPIBDEVCF_ADDRESS 0 +#define GPIBDEVCF_ADDRESS_DEFAULT -1 +#define GPIBDEVCF_NLOCS 1 +#define IICCF_ADDR 0 +#define IICCF_ADDR_DEFAULT -1 +#define IICCF_SIZE 1 +#define IICCF_SIZE_DEFAULT -1 +#define IICCF_NLOCS 2 +#define PCIBUSCF_BUS 0 +#define PCIBUSCF_BUS_DEFAULT -1 +#define PCIBUSCF_NLOCS 1 +#define ATA_HLCF_DRIVE 0 +#define ATA_HLCF_DRIVE_DEFAULT -1 +#define ATA_HLCF_NLOCS 1 +#define GPIOCF_OFFSET 0 +#define GPIOCF_OFFSET_DEFAULT -1 +#define GPIOCF_MASK 1 +#define GPIOCF_MASK_DEFAULT 0 +#define GPIOCF_FLAG 2 +#define GPIOCF_FLAG_DEFAULT 0 +#define GPIOCF_NLOCS 3 +#define UHIDBUSCF_REPORTID 0 +#define UHIDBUSCF_REPORTID_DEFAULT -1 +#define UHIDBUSCF_NLOCS 1 +#define ICPCF_UNIT 0 +#define ICPCF_UNIT_DEFAULT -1 +#define ICPCF_NLOCS 1 +#define WSDISPLAYDEVCF_KBDMUX 0 +#define WSDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSDISPLAYDEVCF_NLOCS 1 +#define MIICF_PHY 0 +#define MIICF_PHY_DEFAULT -1 +#define MIICF_NLOCS 1 +#define UPCCF_OFFSET 0 +#define UPCCF_OFFSET_DEFAULT -1 +#define UPCCF_NLOCS 1 +#define SPICF_SLAVE 0 +#define SPICF_NLOCS 1 +#define UCOMBUSCF_PORTNO 0 +#define UCOMBUSCF_PORTNO_DEFAULT -1 +#define UCOMBUSCF_NLOCS 1 diff --git a/sys/rump/dev/lib/libumass/machine b/sys/rump/dev/lib/libumass/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libumass/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libumass/umass_component.c b/sys/rump/dev/lib/libumass/umass_component.c new file mode 100644 index 000000000..c942d866c --- /dev/null +++ b/sys/rump/dev/lib/libumass/umass_component.c @@ -0,0 +1,19 @@ +/* $NetBSD: umass_component.c,v 1.1 2014/03/13 01:54:59 pooka Exp $ */ + +#include +#include +#include +#include +#include + +#include "ioconf.c" + +#include "rump_private.h" +#include "rump_dev_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_umass, + cfattach_ioconf_umass, cfdata_ioconf_umass); +} diff --git a/sys/rump/dev/lib/libumass/x86 b/sys/rump/dev/lib/libumass/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libumass/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libusb/Makefile b/sys/rump/dev/lib/libusb/Makefile new file mode 100644 index 000000000..f9ed52ca3 --- /dev/null +++ b/sys/rump/dev/lib/libusb/Makefile @@ -0,0 +1,21 @@ +# $NetBSD: Makefile,v 1.8 2015/08/24 23:01:59 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/usb + +LIB= rumpdev_usb + +.if ${MACHINE} == "i386" || ${MACHINE} == "amd64" +IOCONF= USB.ioconf + +SRCS= usb.c usbdi.c usbdi_util.c usb_mem.c usb_subr.c usb_quirks.c \ + uhub.c usbroothub_subr.c usb_verbose.c +SRCS+= usb_at_hc.c +.else +SRCS= dummy.c +.endif + +#CPPFLAGS+= -DUHUB_DEBUG + +.include +.include diff --git a/sys/rump/dev/lib/libusb/USB.ioconf b/sys/rump/dev/lib/libusb/USB.ioconf new file mode 100644 index 000000000..ca6e2bd71 --- /dev/null +++ b/sys/rump/dev/lib/libusb/USB.ioconf @@ -0,0 +1,36 @@ +# $NetBSD: USB.ioconf,v 1.2 2015/05/20 11:51:32 pooka Exp $ +# + +ioconf usb + +include "conf/files" +include "dev/usb/files.usb" +include "dev/pci/files.pci" +include "rump/dev/files.rump" + +# /dev/ugen fake host controller +pseudo-root ugenhc* + +# PCI host controllers +pseudo-root ehci* +pseudo-root ohci* +pseudo-root uhci* + + +# +# USB bus support +# +usb* at ugenhc? + +usb* at ehci? +usb* at ohci? +usb* at uhci? + + +# USB ROOT Hub +# +# Do *NOT* configure uhub @ uhub. +# That is not compatible with ugen. +# XXX: fix ugenhc to deal with it? +# +uhub* at usb? diff --git a/sys/rump/dev/lib/libusb/dummy.c b/sys/rump/dev/lib/libusb/dummy.c new file mode 100644 index 000000000..986e5dc9b --- /dev/null +++ b/sys/rump/dev/lib/libusb/dummy.c @@ -0,0 +1 @@ +int njet; diff --git a/sys/rump/dev/lib/libusb/i386 b/sys/rump/dev/lib/libusb/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libusb/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libusb/ioconf.c b/sys/rump/dev/lib/libusb/ioconf.c new file mode 100644 index 000000000..9b7caf0a2 --- /dev/null +++ b/sys/rump/dev/lib/libusb/ioconf.c @@ -0,0 +1,105 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libusb/USB.ioconf" + */ + +#include +#include +#include +#include + +static const struct cfiattrdata usbuscf_iattrdata = { + "usbus", 0, { + { NULL, NULL, 0 }, + } +}; +static const struct cfiattrdata usbififcf_iattrdata = { + "usbifif", 6, { + { "port", "-1", -1 }, + { "configuration", "-1", -1 }, + { "interface", "-1", -1 }, + { "vendor", "-1", -1 }, + { "product", "-1", -1 }, + { "release", "-1", -1 }, + } +}; +static const struct cfiattrdata usbdevifcf_iattrdata = { + "usbdevif", 6, { + { "port", "-1", -1 }, + { "configuration", "-1", -1 }, + { "interface", "-1", -1 }, + { "vendor", "-1", -1 }, + { "product", "-1", -1 }, + { "release", "-1", -1 }, + } +}; +static const struct cfiattrdata usbroothubifcf_iattrdata = { + "usbroothubif", 0, { + { NULL, NULL, 0 }, + } +}; + +static const struct cfiattrdata * const usb_attrs[] = { &usbroothubifcf_iattrdata, NULL }; +CFDRIVER_DECL(usb, DV_DULL, usb_attrs); + +static const struct cfiattrdata * const uhub_attrs[] = { &usbififcf_iattrdata, &usbdevifcf_iattrdata, NULL }; +CFDRIVER_DECL(uhub, DV_DULL, uhub_attrs); + + +static struct cfdriver * const cfdriver_ioconf_usb[] = { + &usb_cd, + &uhub_cd, + NULL +}; + +extern struct cfattach usb_ca; +extern struct cfattach uroothub_ca; + +static const struct cfparent pspec0 = { + "usbus", "ugenhc", DVUNIT_ANY +}; +static const struct cfparent pspec1 = { + "usbus", "ehci", DVUNIT_ANY +}; +static const struct cfparent pspec2 = { + "usbus", "ohci", DVUNIT_ANY +}; +static const struct cfparent pspec3 = { + "usbus", "uhci", DVUNIT_ANY +}; +static const struct cfparent pspec4 = { + "usbroothubif", "usb", DVUNIT_ANY +}; + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_usb[] = { + /* driver attachment unit state loc flags pspec */ +/* 0: usb* at ugenhc? */ + { "usb", "usb", 0, STAR, NULL, 0, &pspec0 }, +/* 1: usb* at ehci? */ + { "usb", "usb", 0, STAR, NULL, 0, &pspec1 }, +/* 2: usb* at ohci? */ + { "usb", "usb", 0, STAR, NULL, 0, &pspec2 }, +/* 3: usb* at uhci? */ + { "usb", "usb", 0, STAR, NULL, 0, &pspec3 }, +/* 4: uhub* at usb? */ + { "uhub", "uroothub", 0, STAR, NULL, 0, &pspec4 }, + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + +static struct cfattach * const usb_cfattachinit[] = { + &usb_ca, NULL +}; +static struct cfattach * const uhub_cfattachinit[] = { + &uroothub_ca, NULL +}; + +static const struct cfattachinit cfattach_ioconf_usb[] = { + { "usb", usb_cfattachinit }, + { "uhub", uhub_cfattachinit }, + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libusb/ioconf.h b/sys/rump/dev/lib/libusb/ioconf.h new file mode 100644 index 000000000..9f82bdd0b --- /dev/null +++ b/sys/rump/dev/lib/libusb/ioconf.h @@ -0,0 +1,6 @@ + +/* pseudo-devices */ + +/* driver structs */ +extern struct cfdriver usb_cd; +extern struct cfdriver uhub_cd; diff --git a/sys/rump/dev/lib/libusb/locators.h b/sys/rump/dev/lib/libusb/locators.h new file mode 100644 index 000000000..976b5676b --- /dev/null +++ b/sys/rump/dev/lib/libusb/locators.h @@ -0,0 +1,134 @@ +#define WSKBDDEVCF_CONSOLE 0 +#define WSKBDDEVCF_CONSOLE_DEFAULT -1 +#define WSKBDDEVCF_MUX 1 +#define WSKBDDEVCF_MUX_DEFAULT 1 +#define WSKBDDEVCF_NLOCS 2 +#define PCKBPORTCF_SLOT 0 +#define PCKBPORTCF_SLOT_DEFAULT -1 +#define PCKBPORTCF_NLOCS 1 +#define MLXCF_UNIT 0 +#define MLXCF_UNIT_DEFAULT -1 +#define MLXCF_NLOCS 1 +#define WSMOUSEDEVCF_MUX 0 +#define WSMOUSEDEVCF_MUX_DEFAULT 0 +#define WSMOUSEDEVCF_NLOCS 1 +#define CPCBUSCF_ADDR 0 +#define CPCBUSCF_IRQ 1 +#define CPCBUSCF_IRQ_DEFAULT -1 +#define CPCBUSCF_NLOCS 2 +#define PCMCIABUSCF_CONTROLLER 0 +#define PCMCIABUSCF_CONTROLLER_DEFAULT -1 +#define PCMCIABUSCF_SOCKET 1 +#define PCMCIABUSCF_SOCKET_DEFAULT -1 +#define PCMCIABUSCF_NLOCS 2 +#define FLASHBUSCF_OFFSET 0 +#define FLASHBUSCF_OFFSET_DEFAULT 0 +#define FLASHBUSCF_SIZE 1 +#define FLASHBUSCF_SIZE_DEFAULT 0 +#define FLASHBUSCF_READONLY 2 +#define FLASHBUSCF_READONLY_DEFAULT 0 +#define FLASHBUSCF_NLOCS 3 +#define PUCCF_PORT 0 +#define PUCCF_PORT_DEFAULT -1 +#define PUCCF_NLOCS 1 +#define PCICF_DEV 0 +#define PCICF_DEV_DEFAULT -1 +#define PCICF_FUNCTION 1 +#define PCICF_FUNCTION_DEFAULT -1 +#define PCICF_NLOCS 2 +#define GPIBDEVCF_ADDRESS 0 +#define GPIBDEVCF_ADDRESS_DEFAULT -1 +#define GPIBDEVCF_NLOCS 1 +#define PCIBUSCF_BUS 0 +#define PCIBUSCF_BUS_DEFAULT -1 +#define PCIBUSCF_NLOCS 1 +#define MIICF_PHY 0 +#define MIICF_PHY_DEFAULT -1 +#define MIICF_NLOCS 1 +#define WSDISPLAYDEVCF_KBDMUX 0 +#define WSDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSDISPLAYDEVCF_NLOCS 1 +#define UPCCF_OFFSET 0 +#define UPCCF_OFFSET_DEFAULT -1 +#define UPCCF_NLOCS 1 +#define SPICF_SLAVE 0 +#define SPICF_NLOCS 1 +#define WSEMULDISPLAYDEVCF_CONSOLE 0 +#define WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT -1 +#define WSEMULDISPLAYDEVCF_KBDMUX 1 +#define WSEMULDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSEMULDISPLAYDEVCF_NLOCS 2 +#define AACCF_UNIT 0 +#define AACCF_UNIT_DEFAULT -1 +#define AACCF_NLOCS 1 +#define SCSICF_CHANNEL 0 +#define SCSICF_CHANNEL_DEFAULT -1 +#define SCSICF_NLOCS 1 +#define USBIFIFCF_PORT 0 +#define USBIFIFCF_PORT_DEFAULT -1 +#define USBIFIFCF_CONFIGURATION 1 +#define USBIFIFCF_CONFIGURATION_DEFAULT -1 +#define USBIFIFCF_INTERFACE 2 +#define USBIFIFCF_INTERFACE_DEFAULT -1 +#define USBIFIFCF_VENDOR 3 +#define USBIFIFCF_VENDOR_DEFAULT -1 +#define USBIFIFCF_PRODUCT 4 +#define USBIFIFCF_PRODUCT_DEFAULT -1 +#define USBIFIFCF_RELEASE 5 +#define USBIFIFCF_RELEASE_DEFAULT -1 +#define USBIFIFCF_NLOCS 6 +#define HDAUDIOBUSCF_NID 0 +#define HDAUDIOBUSCF_NID_DEFAULT -1 +#define HDAUDIOBUSCF_NLOCS 1 +#define TWACF_UNIT 0 +#define TWACF_UNIT_DEFAULT -1 +#define TWACF_NLOCS 1 +#define ATACF_CHANNEL 0 +#define ATACF_CHANNEL_DEFAULT -1 +#define ATACF_NLOCS 1 +#define USBDEVIFCF_PORT 0 +#define USBDEVIFCF_PORT_DEFAULT -1 +#define USBDEVIFCF_CONFIGURATION 1 +#define USBDEVIFCF_CONFIGURATION_DEFAULT -1 +#define USBDEVIFCF_INTERFACE 2 +#define USBDEVIFCF_INTERFACE_DEFAULT -1 +#define USBDEVIFCF_VENDOR 3 +#define USBDEVIFCF_VENDOR_DEFAULT -1 +#define USBDEVIFCF_PRODUCT 4 +#define USBDEVIFCF_PRODUCT_DEFAULT -1 +#define USBDEVIFCF_RELEASE 5 +#define USBDEVIFCF_RELEASE_DEFAULT -1 +#define USBDEVIFCF_NLOCS 6 +#define CACCF_UNIT 0 +#define CACCF_UNIT_DEFAULT -1 +#define CACCF_NLOCS 1 +#define AMRCF_UNIT 0 +#define AMRCF_UNIT_DEFAULT -1 +#define AMRCF_NLOCS 1 +#define TWECF_UNIT 0 +#define TWECF_UNIT_DEFAULT -1 +#define TWECF_NLOCS 1 +#define IICCF_ADDR 0 +#define IICCF_ADDR_DEFAULT -1 +#define IICCF_SIZE 1 +#define IICCF_SIZE_DEFAULT -1 +#define IICCF_NLOCS 2 +#define ATA_HLCF_DRIVE 0 +#define ATA_HLCF_DRIVE_DEFAULT -1 +#define ATA_HLCF_NLOCS 1 +#define GPIOCF_OFFSET 0 +#define GPIOCF_OFFSET_DEFAULT -1 +#define GPIOCF_MASK 1 +#define GPIOCF_MASK_DEFAULT 0 +#define GPIOCF_FLAG 2 +#define GPIOCF_FLAG_DEFAULT 0 +#define GPIOCF_NLOCS 3 +#define UHIDBUSCF_REPORTID 0 +#define UHIDBUSCF_REPORTID_DEFAULT -1 +#define UHIDBUSCF_NLOCS 1 +#define ICPCF_UNIT 0 +#define ICPCF_UNIT_DEFAULT -1 +#define ICPCF_NLOCS 1 +#define UCOMBUSCF_PORTNO 0 +#define UCOMBUSCF_PORTNO_DEFAULT -1 +#define UCOMBUSCF_NLOCS 1 diff --git a/sys/rump/dev/lib/libusb/machine b/sys/rump/dev/lib/libusb/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libusb/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libusb/usb_at_hc.c b/sys/rump/dev/lib/libusb/usb_at_hc.c new file mode 100644 index 000000000..f5433b51b --- /dev/null +++ b/sys/rump/dev/lib/libusb/usb_at_hc.c @@ -0,0 +1,20 @@ +/* $NetBSD: usb_at_hc.c,v 1.1 2015/05/20 11:53:08 pooka Exp $ */ + +#include +#include +#include +#include +#include +#include + +#include "ioconf.c" + +#include "rump_private.h" +#include "rump_dev_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_usb, + cfattach_ioconf_usb, cfdata_ioconf_usb); +} diff --git a/sys/rump/dev/lib/libusb/x86 b/sys/rump/dev/lib/libusb/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libusb/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libvirtio_if_vioif/Makefile b/sys/rump/dev/lib/libvirtio_if_vioif/Makefile new file mode 100644 index 000000000..cfec9d39b --- /dev/null +++ b/sys/rump/dev/lib/libvirtio_if_vioif/Makefile @@ -0,0 +1,19 @@ +# $NetBSD: Makefile,v 1.1 2014/08/22 09:48:54 pooka Exp $ +# + +RUMPTOP=${TOPRUMP} + +.PATH: ${RUMPTOP}/../dev/pci + +LIB= rumpdev_virtio_if_vioif +IOCONF= VIRTIO_IF_VIOIF.ioconf + +SRCS= vioif_at_virtio.c + +SRCS+= if_vioif.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libvirtio_if_vioif/VIRTIO_IF_VIOIF.ioconf b/sys/rump/dev/lib/libvirtio_if_vioif/VIRTIO_IF_VIOIF.ioconf new file mode 100644 index 000000000..8b31bf5ed --- /dev/null +++ b/sys/rump/dev/lib/libvirtio_if_vioif/VIRTIO_IF_VIOIF.ioconf @@ -0,0 +1,12 @@ +# $NetBSD: VIRTIO_IF_VIOIF.ioconf,v 1.1 2014/08/22 09:48:54 pooka Exp $ +# + +ioconf virtio_if_vioif + +include "conf/files" +include "dev/pci/files.pci" +include "rump/dev/files.rump" + +pseudo-root virtio* + +vioif* at virtio? # Virtio network device diff --git a/sys/rump/dev/lib/libvirtio_if_vioif/vioif_at_virtio.c b/sys/rump/dev/lib/libvirtio_if_vioif/vioif_at_virtio.c new file mode 100644 index 000000000..14a769bff --- /dev/null +++ b/sys/rump/dev/lib/libvirtio_if_vioif/vioif_at_virtio.c @@ -0,0 +1,45 @@ +/* $NetBSD: vioif_at_virtio.c,v 1.1 2014/08/22 09:48:54 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: vioif_at_virtio.c,v 1.1 2014/08/22 09:48:54 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" + +#include "ioconf.c" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_virtio_if_vioif, + cfattach_ioconf_virtio_if_vioif, cfdata_ioconf_virtio_if_vioif); +} diff --git a/sys/rump/dev/lib/libvirtio_ld/Makefile b/sys/rump/dev/lib/libvirtio_ld/Makefile new file mode 100644 index 000000000..4dfaaf06c --- /dev/null +++ b/sys/rump/dev/lib/libvirtio_ld/Makefile @@ -0,0 +1,28 @@ +# $NetBSD: Makefile,v 1.1 2014/08/22 09:57:05 pooka Exp $ +# + +RUMPTOP=${TOPRUMP} + +.PATH: ${RUMPTOP}/../dev \ + ${RUMPTOP}/../dev/pci + +LIB= rumpdev_virtio_ld +IOCONF= VIRTIO_LD.ioconf + +SRCS= ld_at_virtio.c + +SRCS+= ld_virtio.c + +# XXX: ld.c does not really belong here, but placing it in libdisk +# requires revamping config to be more modular in how CFDRIVER() is +# used. moving ld up in the component tree later to libdisk won't +# create problems, so just put it here for now. the excessive +# dependencies of virtio_ld should prevent anyone from want to +# provide ld via this component ... +SRCS+= ld.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern -I${RUMPTOP}/librump/rumpvfs + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libvirtio_ld/VIRTIO_LD.ioconf b/sys/rump/dev/lib/libvirtio_ld/VIRTIO_LD.ioconf new file mode 100644 index 000000000..a1b06e115 --- /dev/null +++ b/sys/rump/dev/lib/libvirtio_ld/VIRTIO_LD.ioconf @@ -0,0 +1,12 @@ +# $NetBSD: VIRTIO_LD.ioconf,v 1.1 2014/08/22 09:57:05 pooka Exp $ +# + +ioconf virtio_ld + +include "conf/files" +include "dev/pci/files.pci" +include "rump/dev/files.rump" + +pseudo-root virtio* + +ld* at virtio? # Virtio disk device diff --git a/sys/rump/dev/lib/libvirtio_ld/ld_at_virtio.c b/sys/rump/dev/lib/libvirtio_ld/ld_at_virtio.c new file mode 100644 index 000000000..f30e5198b --- /dev/null +++ b/sys/rump/dev/lib/libvirtio_ld/ld_at_virtio.c @@ -0,0 +1,84 @@ +/* $NetBSD: ld_at_virtio.c,v 1.2 2015/05/16 15:03:12 pooka Exp $ */ + +/* + * Copyright (c) 2010 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: ld_at_virtio.c,v 1.2 2015/05/16 15:03:12 pooka Exp $"); + +#include +#include +#include +#include +#include +#include + +#include "rump_private.h" +#include "rump_vfs_private.h" + +#include "ioconf.c" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + config_init_component(cfdriver_ioconf_virtio_ld, + cfattach_ioconf_virtio_ld, cfdata_ioconf_virtio_ld); +} + +/* + * Pseudo-devfs. Since creating device nodes is non-free, don't + * speculatively create hundreds of them (= milliseconds slower + * bootstrap). Instead, after the probe is done, see which units + * were found and create nodes only for them. + */ +RUMP_COMPONENT(RUMP_COMPONENT_POSTINIT) +{ + extern const struct bdevsw ld_bdevsw; + extern const struct cdevsw ld_cdevsw; + devmajor_t bmaj = -1, cmaj = -1; + int error, i; + + if ((error = devsw_attach("ld", &ld_bdevsw, &bmaj, + &ld_cdevsw, &cmaj)) != 0) + panic("cannot attach ld: %d", error); + + for (i = 0; i < 10; i++) { + char bbase[] = "/dev/ldX"; + char rbase[] = "/dev/rldX"; + + if (device_lookup(&ld_cd, i) == NULL) + break; + + bbase[sizeof(bbase)-2] = '0' + i; + rbase[sizeof(rbase)-2] = '0' + i; + + if ((error = rump_vfs_makedevnodes(S_IFBLK, bbase, 'a', + bmaj, DISKMINOR(i, 0), 5)) != 0) + panic("cannot create cooked ld dev nodes: %d", error); + if ((error = rump_vfs_makedevnodes(S_IFCHR, rbase, 'a', + cmaj, DISKMINOR(i, 0), 5)) != 0) + panic("cannot create raw ld dev nodes: %d", error); + } +} diff --git a/sys/rump/dev/lib/libvirtio_viornd/Makefile b/sys/rump/dev/lib/libvirtio_viornd/Makefile new file mode 100644 index 000000000..ff01c2813 --- /dev/null +++ b/sys/rump/dev/lib/libvirtio_viornd/Makefile @@ -0,0 +1,19 @@ +# $NetBSD: Makefile,v 1.1 2014/11/06 00:45:58 pooka Exp $ +# + +RUMPTOP=${TOPRUMP} + +.PATH: ${RUMPTOP}/../dev/pci + +LIB= rumpdev_virtio_viornd +IOCONF= VIRTIO_VIORND.ioconf + +SRCS= viornd_at_virtio.c + +SRCS+= viornd.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern + +.include "${RUMPTOP}/Makefile.rump" +.include +.include diff --git a/sys/rump/dev/lib/libvirtio_viornd/VIRTIO_VIORND.ioconf b/sys/rump/dev/lib/libvirtio_viornd/VIRTIO_VIORND.ioconf new file mode 100644 index 000000000..807f9c8b9 --- /dev/null +++ b/sys/rump/dev/lib/libvirtio_viornd/VIRTIO_VIORND.ioconf @@ -0,0 +1,12 @@ +# $NetBSD: VIRTIO_VIORND.ioconf,v 1.1 2014/11/06 00:45:58 pooka Exp $ +# + +ioconf virtio_viornd + +include "conf/files" +include "dev/pci/files.pci" +include "rump/dev/files.rump" + +pseudo-root virtio* + +viornd* at virtio? # Virtio entropy device diff --git a/sys/rump/dev/lib/libvirtio_viornd/viornd_at_virtio.c b/sys/rump/dev/lib/libvirtio_viornd/viornd_at_virtio.c new file mode 100644 index 000000000..cd9a082e3 --- /dev/null +++ b/sys/rump/dev/lib/libvirtio_viornd/viornd_at_virtio.c @@ -0,0 +1,49 @@ +/* $NetBSD: viornd_at_virtio.c,v 1.1 2014/11/06 00:45:58 pooka Exp $ */ + +/* + * Copyright (c) 2014 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: viornd_at_virtio.c,v 1.1 2014/11/06 00:45:58 pooka Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" + +#include "ioconf.c" + +#define CONFIG_INIT_COMPONENT(a) config_init_component( \ + __CONCAT(cfdriver_ioconf_,a), \ + __CONCAT(cfattach_ioconf_,a), \ + __CONCAT(cfdata_ioconf_,a)); + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + + CONFIG_INIT_COMPONENT(virtio_viornd); +} diff --git a/sys/rump/dev/lib/libvnd/Makefile b/sys/rump/dev/lib/libvnd/Makefile new file mode 100644 index 000000000..e4fe4b4f4 --- /dev/null +++ b/sys/rump/dev/lib/libvnd/Makefile @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.2 2015/08/20 11:51:12 christos Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev + +LIB= rumpdev_vnd +IOCONF= VND.ioconf +SRCS= vnd.c + +SRCS+= vnd_component.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libvnd/VND.ioconf b/sys/rump/dev/lib/libvnd/VND.ioconf new file mode 100644 index 000000000..a3f17ac63 --- /dev/null +++ b/sys/rump/dev/lib/libvnd/VND.ioconf @@ -0,0 +1,8 @@ +# $NetBSD: VND.ioconf,v 1.1 2015/08/20 11:51:12 christos Exp $ +# + +ioconf vnd + +include "conf/files" + +pseudo-device vnd diff --git a/sys/rump/dev/lib/libvnd/i386 b/sys/rump/dev/lib/libvnd/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libvnd/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libvnd/ioconf.c b/sys/rump/dev/lib/libvnd/ioconf.c new file mode 100644 index 000000000..62d292385 --- /dev/null +++ b/sys/rump/dev/lib/libvnd/ioconf.c @@ -0,0 +1,35 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libvnd/VND.ioconf" + */ + +#include +#include +#include +#include + + +CFDRIVER_DECL(vnd, DV_DISK, NULL); + + +static struct cfdriver * const cfdriver_ioconf_vnd[] = { + &vnd_cd, + NULL +}; + + + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_vnd[] = { + /* driver attachment unit state loc flags pspec */ + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + + +static const struct cfattachinit cfattach_ioconf_vnd[] = { + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libvnd/ioconf.h b/sys/rump/dev/lib/libvnd/ioconf.h new file mode 100644 index 000000000..6c5c27c27 --- /dev/null +++ b/sys/rump/dev/lib/libvnd/ioconf.h @@ -0,0 +1,6 @@ + +/* pseudo-devices */ +void vndattach(int); + +/* driver structs */ +extern struct cfdriver vnd_cd; diff --git a/sys/rump/dev/lib/libvnd/locators.h b/sys/rump/dev/lib/libvnd/locators.h new file mode 100644 index 000000000..e1e369eed --- /dev/null +++ b/sys/rump/dev/lib/libvnd/locators.h @@ -0,0 +1,85 @@ +#define WSKBDDEVCF_CONSOLE 0 +#define WSKBDDEVCF_CONSOLE_DEFAULT -1 +#define WSKBDDEVCF_MUX 1 +#define WSKBDDEVCF_MUX_DEFAULT 1 +#define WSKBDDEVCF_NLOCS 2 +#define WSEMULDISPLAYDEVCF_CONSOLE 0 +#define WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT -1 +#define WSEMULDISPLAYDEVCF_KBDMUX 1 +#define WSEMULDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSEMULDISPLAYDEVCF_NLOCS 2 +#define AACCF_UNIT 0 +#define AACCF_UNIT_DEFAULT -1 +#define AACCF_NLOCS 1 +#define PCKBPORTCF_SLOT 0 +#define PCKBPORTCF_SLOT_DEFAULT -1 +#define PCKBPORTCF_NLOCS 1 +#define MLXCF_UNIT 0 +#define MLXCF_UNIT_DEFAULT -1 +#define MLXCF_NLOCS 1 +#define WSMOUSEDEVCF_MUX 0 +#define WSMOUSEDEVCF_MUX_DEFAULT 0 +#define WSMOUSEDEVCF_NLOCS 1 +#define SCSICF_CHANNEL 0 +#define SCSICF_CHANNEL_DEFAULT -1 +#define SCSICF_NLOCS 1 +#define HDAUDIOBUSCF_NID 0 +#define HDAUDIOBUSCF_NID_DEFAULT -1 +#define HDAUDIOBUSCF_NLOCS 1 +#define CPCBUSCF_ADDR 0 +#define CPCBUSCF_IRQ 1 +#define CPCBUSCF_IRQ_DEFAULT -1 +#define CPCBUSCF_NLOCS 2 +#define ATACF_CHANNEL 0 +#define ATACF_CHANNEL_DEFAULT -1 +#define ATACF_NLOCS 1 +#define PCMCIABUSCF_CONTROLLER 0 +#define PCMCIABUSCF_CONTROLLER_DEFAULT -1 +#define PCMCIABUSCF_SOCKET 1 +#define PCMCIABUSCF_SOCKET_DEFAULT -1 +#define PCMCIABUSCF_NLOCS 2 +#define FLASHBUSCF_OFFSET 0 +#define FLASHBUSCF_OFFSET_DEFAULT 0 +#define FLASHBUSCF_SIZE 1 +#define FLASHBUSCF_SIZE_DEFAULT 0 +#define FLASHBUSCF_READONLY 2 +#define FLASHBUSCF_READONLY_DEFAULT 0 +#define FLASHBUSCF_NLOCS 3 +#define CACCF_UNIT 0 +#define CACCF_UNIT_DEFAULT -1 +#define CACCF_NLOCS 1 +#define GPIBDEVCF_ADDRESS 0 +#define GPIBDEVCF_ADDRESS_DEFAULT -1 +#define GPIBDEVCF_NLOCS 1 +#define IICCF_ADDR 0 +#define IICCF_ADDR_DEFAULT -1 +#define IICCF_SIZE 1 +#define IICCF_SIZE_DEFAULT -1 +#define IICCF_NLOCS 2 +#define PCIBUSCF_BUS 0 +#define PCIBUSCF_BUS_DEFAULT -1 +#define PCIBUSCF_NLOCS 1 +#define ATA_HLCF_DRIVE 0 +#define ATA_HLCF_DRIVE_DEFAULT -1 +#define ATA_HLCF_NLOCS 1 +#define GPIOCF_OFFSET 0 +#define GPIOCF_OFFSET_DEFAULT -1 +#define GPIOCF_MASK 1 +#define GPIOCF_MASK_DEFAULT 0 +#define GPIOCF_FLAG 2 +#define GPIOCF_FLAG_DEFAULT 0 +#define GPIOCF_NLOCS 3 +#define ICPCF_UNIT 0 +#define ICPCF_UNIT_DEFAULT -1 +#define ICPCF_NLOCS 1 +#define WSDISPLAYDEVCF_KBDMUX 0 +#define WSDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSDISPLAYDEVCF_NLOCS 1 +#define MIICF_PHY 0 +#define MIICF_PHY_DEFAULT -1 +#define MIICF_NLOCS 1 +#define UPCCF_OFFSET 0 +#define UPCCF_OFFSET_DEFAULT -1 +#define UPCCF_NLOCS 1 +#define SPICF_SLAVE 0 +#define SPICF_NLOCS 1 diff --git a/sys/rump/dev/lib/libvnd/machine b/sys/rump/dev/lib/libvnd/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libvnd/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libvnd/vnd_component.c b/sys/rump/dev/lib/libvnd/vnd_component.c new file mode 100644 index 000000000..8d4b8a852 --- /dev/null +++ b/sys/rump/dev/lib/libvnd/vnd_component.c @@ -0,0 +1,59 @@ +/* $NetBSD: vnd_component.c,v 1.1 2014/07/17 08:16:12 prlw1 Exp $ */ + +/* + * Copyright (c) 2009 Antti Kantee. All Rights Reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS + * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__KERNEL_RCSID(0, "$NetBSD: vnd_component.c,v 1.1 2014/07/17 08:16:12 prlw1 Exp $"); + +#include +#include +#include +#include + +#include "rump_private.h" +#include "rump_vfs_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern const struct bdevsw vnd_bdevsw; + extern const struct cdevsw vnd_cdevsw; + devmajor_t bmaj, cmaj; + int error; + + /* go, mydevfs */ + bmaj = cmaj = -1; + + if ((error = devsw_attach("/dev/vnd0", &vnd_bdevsw, &bmaj, + &vnd_cdevsw, &cmaj)) != 0) + panic("cannot attach vnd: %d", error); + + if ((error = rump_vfs_makedevnodes(S_IFBLK, "/dev/vnd0", 'a', + bmaj, 0, 7)) != 0) + panic("cannot create cooked vnd dev nodes: %d", error); + if ((error = rump_vfs_makedevnodes(S_IFCHR, "/dev/rvnd0", 'a', + cmaj, 0, 7)) != 0) + panic("cannot create raw vnd dev nodes: %d", error); +} diff --git a/sys/rump/dev/lib/libvnd/x86 b/sys/rump/dev/lib/libvnd/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libvnd/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libwscons/Makefile b/sys/rump/dev/lib/libwscons/Makefile new file mode 100644 index 000000000..ff9eb567e --- /dev/null +++ b/sys/rump/dev/lib/libwscons/Makefile @@ -0,0 +1,16 @@ +# $NetBSD: Makefile,v 1.5 2015/08/24 23:01:59 pooka Exp $ +# + +.PATH: ${.CURDIR}/../../../../dev/wscons + +LIB= rumpdev_wscons +IOCONF= WSCONS.ioconf + +SRCS= wsevent.c wskbd.c wskbdutil.c wsmouse.c + +SRCS+= wscons_component.c + +CPPFLAGS+= -I${RUMPTOP}/librump/rumpvfs + +.include +.include diff --git a/sys/rump/dev/lib/libwscons/WSCONS.ioconf b/sys/rump/dev/lib/libwscons/WSCONS.ioconf new file mode 100644 index 000000000..67c029ab3 --- /dev/null +++ b/sys/rump/dev/lib/libwscons/WSCONS.ioconf @@ -0,0 +1,13 @@ +# $NetBSD: WSCONS.ioconf,v 1.1 2010/03/08 10:54:21 pooka Exp $ +# + +ioconf wscons + +include "conf/files" +include "dev/usb/files.usb" + +pseudo-root ums* +pseudo-root ukbd* + +wsmouse* at ums? mux 0 +wskbd* at ukbd? console ? mux 1 diff --git a/sys/rump/dev/lib/libwscons/i386 b/sys/rump/dev/lib/libwscons/i386 new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libwscons/i386 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libwscons/ioconf.c b/sys/rump/dev/lib/libwscons/ioconf.c new file mode 100644 index 000000000..f51e7c18e --- /dev/null +++ b/sys/rump/dev/lib/libwscons/ioconf.c @@ -0,0 +1,74 @@ +#include "ioconf.h" +/* + * MACHINE GENERATED: DO NOT EDIT + * + * ioconf.c, from "/home/boricj/Documents/Projets/minix/src/sys/rump/dev/lib/libwscons/WSCONS.ioconf" + */ + +#include +#include +#include +#include + +static const struct cfiattrdata wskbddevcf_iattrdata = { + "wskbddev", 2, { + { "console", "-1", -1 }, + { "mux", "1", 1 }, + } +}; +static const struct cfiattrdata wsmousedevcf_iattrdata = { + "wsmousedev", 1, { + { "mux", "0", 0 }, + } +}; + +CFDRIVER_DECL(wskbd, DV_DULL, NULL); + +CFDRIVER_DECL(wsmouse, DV_DULL, NULL); + + +static struct cfdriver * const cfdriver_ioconf_wscons[] = { + &wskbd_cd, + &wsmouse_cd, + NULL +}; + +extern struct cfattach wskbd_ca; +extern struct cfattach wsmouse_ca; + +/* locators */ +static int loc[3] = { + -1, 1, 0, +}; + +static const struct cfparent pspec0 = { + "wsmousedev", "ums", DVUNIT_ANY +}; +static const struct cfparent pspec1 = { + "wskbddev", "ukbd", DVUNIT_ANY +}; + +#define NORM FSTATE_NOTFOUND +#define STAR FSTATE_STAR + +static struct cfdata cfdata_ioconf_wscons[] = { + /* driver attachment unit state loc flags pspec */ +/* 0: wskbd* at ukbd? console -1 mux 1 */ + { "wskbd", "wskbd", 0, STAR, loc+ 0, 0, &pspec1 }, +/* 1: wsmouse* at ums? mux 0 */ + { "wsmouse", "wsmouse", 0, STAR, loc+ 2, 0, &pspec0 }, + { NULL, NULL, 0, 0, NULL, 0, NULL } +}; + +static struct cfattach * const wskbd_cfattachinit[] = { + &wskbd_ca, NULL +}; +static struct cfattach * const wsmouse_cfattachinit[] = { + &wsmouse_ca, NULL +}; + +static const struct cfattachinit cfattach_ioconf_wscons[] = { + { "wskbd", wskbd_cfattachinit }, + { "wsmouse", wsmouse_cfattachinit }, + { NULL, NULL } +}; diff --git a/sys/rump/dev/lib/libwscons/ioconf.h b/sys/rump/dev/lib/libwscons/ioconf.h new file mode 100644 index 000000000..b359e75ac --- /dev/null +++ b/sys/rump/dev/lib/libwscons/ioconf.h @@ -0,0 +1,6 @@ + +/* pseudo-devices */ + +/* driver structs */ +extern struct cfdriver wskbd_cd; +extern struct cfdriver wsmouse_cd; diff --git a/sys/rump/dev/lib/libwscons/locators.h b/sys/rump/dev/lib/libwscons/locators.h new file mode 100644 index 000000000..998e1f4aa --- /dev/null +++ b/sys/rump/dev/lib/libwscons/locators.h @@ -0,0 +1,117 @@ +#define WSKBDDEVCF_CONSOLE 0 +#define WSKBDDEVCF_CONSOLE_DEFAULT -1 +#define WSKBDDEVCF_MUX 1 +#define WSKBDDEVCF_MUX_DEFAULT 1 +#define WSKBDDEVCF_NLOCS 2 +#define WSEMULDISPLAYDEVCF_CONSOLE 0 +#define WSEMULDISPLAYDEVCF_CONSOLE_DEFAULT -1 +#define WSEMULDISPLAYDEVCF_KBDMUX 1 +#define WSEMULDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSEMULDISPLAYDEVCF_NLOCS 2 +#define AACCF_UNIT 0 +#define AACCF_UNIT_DEFAULT -1 +#define AACCF_NLOCS 1 +#define PCKBPORTCF_SLOT 0 +#define PCKBPORTCF_SLOT_DEFAULT -1 +#define PCKBPORTCF_NLOCS 1 +#define MLXCF_UNIT 0 +#define MLXCF_UNIT_DEFAULT -1 +#define MLXCF_NLOCS 1 +#define WSMOUSEDEVCF_MUX 0 +#define WSMOUSEDEVCF_MUX_DEFAULT 0 +#define WSMOUSEDEVCF_NLOCS 1 +#define SCSICF_CHANNEL 0 +#define SCSICF_CHANNEL_DEFAULT -1 +#define SCSICF_NLOCS 1 +#define HDAUDIOBUSCF_NID 0 +#define HDAUDIOBUSCF_NID_DEFAULT -1 +#define HDAUDIOBUSCF_NLOCS 1 +#define USBIFIFCF_PORT 0 +#define USBIFIFCF_PORT_DEFAULT -1 +#define USBIFIFCF_CONFIGURATION 1 +#define USBIFIFCF_CONFIGURATION_DEFAULT -1 +#define USBIFIFCF_INTERFACE 2 +#define USBIFIFCF_INTERFACE_DEFAULT -1 +#define USBIFIFCF_VENDOR 3 +#define USBIFIFCF_VENDOR_DEFAULT -1 +#define USBIFIFCF_PRODUCT 4 +#define USBIFIFCF_PRODUCT_DEFAULT -1 +#define USBIFIFCF_RELEASE 5 +#define USBIFIFCF_RELEASE_DEFAULT -1 +#define USBIFIFCF_NLOCS 6 +#define CPCBUSCF_ADDR 0 +#define CPCBUSCF_IRQ 1 +#define CPCBUSCF_IRQ_DEFAULT -1 +#define CPCBUSCF_NLOCS 2 +#define ATACF_CHANNEL 0 +#define ATACF_CHANNEL_DEFAULT -1 +#define ATACF_NLOCS 1 +#define USBDEVIFCF_PORT 0 +#define USBDEVIFCF_PORT_DEFAULT -1 +#define USBDEVIFCF_CONFIGURATION 1 +#define USBDEVIFCF_CONFIGURATION_DEFAULT -1 +#define USBDEVIFCF_INTERFACE 2 +#define USBDEVIFCF_INTERFACE_DEFAULT -1 +#define USBDEVIFCF_VENDOR 3 +#define USBDEVIFCF_VENDOR_DEFAULT -1 +#define USBDEVIFCF_PRODUCT 4 +#define USBDEVIFCF_PRODUCT_DEFAULT -1 +#define USBDEVIFCF_RELEASE 5 +#define USBDEVIFCF_RELEASE_DEFAULT -1 +#define USBDEVIFCF_NLOCS 6 +#define PCMCIABUSCF_CONTROLLER 0 +#define PCMCIABUSCF_CONTROLLER_DEFAULT -1 +#define PCMCIABUSCF_SOCKET 1 +#define PCMCIABUSCF_SOCKET_DEFAULT -1 +#define PCMCIABUSCF_NLOCS 2 +#define FLASHBUSCF_OFFSET 0 +#define FLASHBUSCF_OFFSET_DEFAULT 0 +#define FLASHBUSCF_SIZE 1 +#define FLASHBUSCF_SIZE_DEFAULT 0 +#define FLASHBUSCF_READONLY 2 +#define FLASHBUSCF_READONLY_DEFAULT 0 +#define FLASHBUSCF_NLOCS 3 +#define CACCF_UNIT 0 +#define CACCF_UNIT_DEFAULT -1 +#define CACCF_NLOCS 1 +#define GPIBDEVCF_ADDRESS 0 +#define GPIBDEVCF_ADDRESS_DEFAULT -1 +#define GPIBDEVCF_NLOCS 1 +#define IICCF_ADDR 0 +#define IICCF_ADDR_DEFAULT -1 +#define IICCF_SIZE 1 +#define IICCF_SIZE_DEFAULT -1 +#define IICCF_NLOCS 2 +#define PCIBUSCF_BUS 0 +#define PCIBUSCF_BUS_DEFAULT -1 +#define PCIBUSCF_NLOCS 1 +#define ATA_HLCF_DRIVE 0 +#define ATA_HLCF_DRIVE_DEFAULT -1 +#define ATA_HLCF_NLOCS 1 +#define GPIOCF_OFFSET 0 +#define GPIOCF_OFFSET_DEFAULT -1 +#define GPIOCF_MASK 1 +#define GPIOCF_MASK_DEFAULT 0 +#define GPIOCF_FLAG 2 +#define GPIOCF_FLAG_DEFAULT 0 +#define GPIOCF_NLOCS 3 +#define UHIDBUSCF_REPORTID 0 +#define UHIDBUSCF_REPORTID_DEFAULT -1 +#define UHIDBUSCF_NLOCS 1 +#define ICPCF_UNIT 0 +#define ICPCF_UNIT_DEFAULT -1 +#define ICPCF_NLOCS 1 +#define WSDISPLAYDEVCF_KBDMUX 0 +#define WSDISPLAYDEVCF_KBDMUX_DEFAULT 1 +#define WSDISPLAYDEVCF_NLOCS 1 +#define MIICF_PHY 0 +#define MIICF_PHY_DEFAULT -1 +#define MIICF_NLOCS 1 +#define UPCCF_OFFSET 0 +#define UPCCF_OFFSET_DEFAULT -1 +#define UPCCF_NLOCS 1 +#define SPICF_SLAVE 0 +#define SPICF_NLOCS 1 +#define UCOMBUSCF_PORTNO 0 +#define UCOMBUSCF_PORTNO_DEFAULT -1 +#define UCOMBUSCF_NLOCS 1 diff --git a/sys/rump/dev/lib/libwscons/machine b/sys/rump/dev/lib/libwscons/machine new file mode 120000 index 000000000..1c75cf687 --- /dev/null +++ b/sys/rump/dev/lib/libwscons/machine @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/i386/include \ No newline at end of file diff --git a/sys/rump/dev/lib/libwscons/wscons_component.c b/sys/rump/dev/lib/libwscons/wscons_component.c new file mode 100644 index 000000000..e627f31f2 --- /dev/null +++ b/sys/rump/dev/lib/libwscons/wscons_component.c @@ -0,0 +1,31 @@ +/* $NetBSD: wscons_component.c,v 1.1 2014/03/13 01:48:08 pooka Exp $ */ + +#include +#include +#include +#include +#include + +#include "ioconf.c" + +#include "rump_private.h" +#include "rump_dev_private.h" +#include "rump_vfs_private.h" + +RUMP_COMPONENT(RUMP_COMPONENT_DEV) +{ + extern struct cdevsw wskbd_cdevsw, wsmouse_cdevsw; + devmajor_t bmaj, cmaj; + + config_init_component(cfdriver_ioconf_wscons, + cfattach_ioconf_wscons, cfdata_ioconf_wscons); + + bmaj = cmaj = -1; + FLAWLESSCALL(devsw_attach("wskbd", NULL, &bmaj, &wskbd_cdevsw, &cmaj)); + FLAWLESSCALL(rump_vfs_makeonedevnode(S_IFCHR, "/dev/wskbd", cmaj, 0)); + + bmaj = cmaj = -1; + FLAWLESSCALL(devsw_attach("wsmouse", NULL, &bmaj, + &wsmouse_cdevsw, &cmaj)); + FLAWLESSCALL(rump_vfs_makeonedevnode(S_IFCHR, "/dev/wsmouse", cmaj, 0)); +} diff --git a/sys/rump/dev/lib/libwscons/x86 b/sys/rump/dev/lib/libwscons/x86 new file mode 120000 index 000000000..a11afa2e4 --- /dev/null +++ b/sys/rump/dev/lib/libwscons/x86 @@ -0,0 +1 @@ +/home/boricj/Documents/Projets/minix/src/sys/arch/x86/include \ No newline at end of file