/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2013 Joyent, Inc. All rights reserved.
*/
#include <sys/bootconf.h>
#include <sys/sysmacros.h>
#include <sys/bootinfo.h>
#ifdef _BOOT
#else
#endif
extern void *bkmem_alloc(size_t);
extern void bkmem_free(void *, size_t);
/*
* TODO: Replace these declarations with inclusion of the ordinary userland
* bootfs headers once they're available.
*/
typedef struct bfile {
} bfile_t;
typedef struct bf_fd {
} bf_fd_t;
static void bbootfs_closeall(int);
static void
{
const char *p;
char *q, *s;
char *last;
char *oc;
int is_slash = 0;
*out = '\0';
return;
}
/*
* Remove leading slashes and condense all multiple slashes into one.
*/
p = fn;
while (*p == '/')
++p;
for (q = scratch; *p != '\0'; p++) {
if (*p == '/' && !is_slash) {
*q++ = '/';
is_slash = 1;
} else if (*p != '/') {
*q++ = *p;
is_slash = 0;
}
}
*q = '\0';
s = scratch + 12;
} else {
s = scratch;
}
continue;
;
q = oc;
continue;
}
if (q > out)
*q++ = '/';
}
*q = '\0';
}
/* ARGSUSED */
static int
{
return (-1);
}
static int
bbootfs_unmountroot(void)
{
return (-1);
}
static int
bbootfs_init(void)
{
uint_t i;
for (i = 0; i < MAX_FILES; i++) {
"module-name-%u", i);
break;
bbootfs_closeall(1);
return (-1);
}
"module-addr-%u", i);
continue;
}
"module-size-%u", i);
continue;
}
}
return (0);
}
/*ARGSUSED*/
static int
{
uint_t i;
if (!init_done) {
if (bbootfs_init() != 0)
return (-1);
init_done = 1;
}
break;
}
return (-1);
for (i = 0; i < MAX_FDS; i++) {
return (i);
}
}
return (-1);
}
static int
{
return (-1);
return (0);
}
static ssize_t
{
return (-1);
return (-1);
else
return (len);
}
static off_t
{
return (-1);
switch (whence) {
case SEEK_CUR:
break;
case SEEK_SET:
break;
case SEEK_END:
break;
default:
return (-1);
}
return (0);
}
static int
{
return (-1);
return (0);
}
/* ARGSUSED */
static void
{
}
init_done = 0;
}
"bootfs",
};