NetBSD/sys/arch/sun3/stand/libsa/devopen.c

36 lines
799 B
C
Raw Normal View History

1998-02-05 07:56:24 +03:00
/* $NetBSD: devopen.c,v 1.4 1998/02/05 04:57:08 gwr Exp $ */
1998-01-05 10:02:46 +03:00
1995-06-02 00:37:44 +04:00
1998-02-05 07:56:24 +03:00
#include <sys/types.h>
1995-06-02 00:37:44 +04:00
#include <machine/mon.h>
1998-02-05 07:56:24 +03:00
1995-06-02 00:37:44 +04:00
#include <stand.h>
1998-02-05 07:56:24 +03:00
#include "libsa.h"
1995-06-02 00:37:44 +04:00
/*
* Open the device named by the combined device/file name
* given as the "fname" arg, something like: "sd()netbsd"
*
* 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, prom_bootdev);
return (error);
}