11.1Stsutsui/*	$NetBSD: iris_devopen.c,v 1.1 2019/01/12 16:44:47 tsutsui Exp $	*/
21.1Stsutsui
31.1Stsutsui/*
41.1Stsutsui * Copyright (c) 2018 Naruaki Etomi
51.1Stsutsui * All rights reserved.
61.1Stsutsui *
71.1Stsutsui * Redistribution and use in source and binary forms, with or without
81.1Stsutsui * modification, are permitted provided that the following conditions
91.1Stsutsui * are met:
101.1Stsutsui * 1. Redistributions of source code must retain the above copyright
111.1Stsutsui *    notice, this list of conditions and the following disclaimer.
121.1Stsutsui * 2. Redistributions in binary form must reproduce the above copyright
131.1Stsutsui *    notice, this list of conditions and the following disclaimer in the
141.1Stsutsui *    documentation and/or other materials provided with the distribution.
151.1Stsutsui *
161.1Stsutsui * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
171.1Stsutsui * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
181.1Stsutsui * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
191.1Stsutsui * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
201.1Stsutsui * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
211.1Stsutsui * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
221.1Stsutsui * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
231.1Stsutsui * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
241.1Stsutsui * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
251.1Stsutsui * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
261.1Stsutsui */
271.1Stsutsui
281.1Stsutsui/*
291.1Stsutsui * Silicon Graphics "IRIS" series MIPS processors machine bootloader.
301.1Stsutsui */
311.1Stsutsui
321.1Stsutsui#include <lib/libsa/stand.h>
331.1Stsutsui#include <lib/libkern/libkern.h>
341.1Stsutsui#include "iris_machdep.h"
351.1Stsutsui
361.1Stsutsuiint
371.1Stsutsuidevopen(struct open_file *f, const char *fname, char **file)
381.1Stsutsui{
391.1Stsutsui	int error;
401.1Stsutsui	const char *cp;
411.1Stsutsui
421.1Stsutsui	struct devsw *dp;
431.1Stsutsui
441.1Stsutsui	cp = fname;
451.1Stsutsui
461.1Stsutsui	dp = &devsw[0];
471.1Stsutsui
481.1Stsutsui	error = (dp->dv_open)(f, fname);
491.1Stsutsui
501.1Stsutsui	if (error)
511.1Stsutsui		return error;
521.1Stsutsui
531.1Stsutsui	f->f_dev = dp;
541.1Stsutsui
551.1Stsutsui	if (file && *cp != '\0')
561.1Stsutsui		*file = (char *)cp;	/* XXX */
571.1Stsutsui
581.1Stsutsui	return 0;
591.1Stsutsui}
60