NetBSD/sys/arch/mvme68k/stand/netboot/devopen.c
jdolecek 921705c3eb cleanup Makefiles, put common stuff to Makefile.booters, ditch unnecessary
stuff
make this all compile with -Wall -Wno-main -Wmissing-prototypes
	-Wstrict-prototypes -Werror , also compilable on 1.4.1
label itself as NetBSD/mvme68k instead of "BSD" in bootblock message
move bugcrt.c to libbug, remove bugcrt directory (bugcrt is still built
	and used separately to rest of libbug)
convert sboot to use ordinary mvme68 libsa, instead of copying needed
	stuff in libc_sa.c
convert to use version info generated by sys/conf/newvers_stand.sh
	instead of previous version.c files, add necessary 'version' files
put chiptotime() to separate libsa file (used also by sboot/clock.c)

Thanks to Steve Woodford for help with this. Note that -current build
might be hosed by this change, will be addressed by Steve shortly.
2000-07-24 18:39:01 +00:00

32 lines
747 B
C

/* $NetBSD: devopen.c,v 1.2 2000/07/24 18:39:50 jdolecek Exp $ */
#include <sys/param.h>
#include <stand.h>
/*
* Open the device named by the combined device/file name
* given as the "fname" arg, something like: "sd()bsd"
*
* However, Sun PROMs don't really let you choose which
* device you will talk to. You can only open the device
* that was used to load the boot program. Therefore, we
* do not accept a "device" part in the "fname" string.
* Pass the PROM device name to open in case it needs it.
*/
int
devopen(f, fname, file)
struct open_file *f;
const char *fname;
char **file;
{
struct devsw *dp;
int error;
*file = (char*)fname;
dp = &devsw[0];
f->f_dev = dp;
error = (*dp->dv_open)(f, NULL);
return (error);
}