bootvfs.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1994-1996, 2002-2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_BOOTVFS_H
#define _SYS_BOOTVFS_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/bootstat.h>
#define SEEK_SET 0 /* Offset */
/* mountroot/unmountroot return values */
#define VFS_SUCCESS 0
#define VFS_FAILURE -1
/*
* unified (vfs-like) file system operations for booters
*/
struct boot_fs_ops {
char *fsw_name;
int (*fsw_mountroot)(char *str);
int (*fsw_unmountroot)(void);
void (*fsw_closeall)(int flag);
};
/*
* Function prototypes
*
* fstat() (if exists) supports size and mode right now.
*/
extern int unmountroot(void);
/*
* The compfs filesystem provides additional fsswitch-like entry points,
* though these are not yet hooked properly into the fsswitch.
*/
#ifdef __i386
extern int rename(char *, char *);
extern int unlink(char *);
#endif
extern int kern_close(int fd);
extern int kern_mountroot(char *path);
extern int kern_unmountroot(void);
/*
* these are for common fs switch interface routines
*/
extern int boot_no_ops(void); /* no ops entry */
extern void boot_no_ops_void(void); /* no ops entry */
extern struct boot_fs_ops *get_default_fs(void);
extern void set_default_fs(char *fsw_name);
extern void clr_default_fs(void);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_BOOTVFS_H */