/*
* 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 (c) 2015 Joyent, Inc. All rights reserved.
*/
/*
* This file takes care of reading the boot time modules and constructing them
* into the appropriate series of vnodes.
*/
#include <sys/sysmacros.h>
AT_ALL, /* va_mask */
VDIR, /* va_type */
0, /* va_uid */
0, /* va_gid */
0, /* va_fsid */
0, /* va_nodeid */
1, /* va_nlink */
0, /* va_size */
0, /* va_atime */
0, /* va_mtime */
0, /* va_ctime */
0, /* va_rdev */
0, /* va_blksize */
0, /* va_nblocks */
0 /* va_seq */
};
AT_ALL, /* va_mask */
VREG, /* va_type */
0, /* va_uid */
0, /* va_gid */
0, /* va_fsid */
0, /* va_nodeid */
1, /* va_nlink */
0, /* va_size */
0, /* va_atime */
0, /* va_mtime */
0, /* va_ctime */
0, /* va_rdev */
0, /* va_blksize */
0, /* va_nblocks */
0 /* va_seq */
};
/*ARGSUSED*/
int
{
return (-1);
return (0);
}
/*ARGSUSED*/
void
{
}
static int
bootfs_comparator(const void *a, const void *b)
{
int ret;
lfs = a;
rfs = b;
if (ret > 0)
ret = 1;
if (ret < 0)
ret = -1;
return (ret);
}
static void
{
sizeof (bootfs_node_t),
}
gethrestime(&now);
bfs->bfs_ninode++;
}
static void
{
}
static int
{
char *buf;
/* Directories can collide, files cannot */
return (0);
}
return (EEXIST);
}
} else {
}
return (0);
}
/*
* Given the address, size, and path a boot-time module would like, go through
* and create all of the directory entries that are required and then the file
* itself. If someone has passed in a module that has the same name as another
* one, we honor the first one.
*/
static int
const char *mname)
{
char *sp;
int ret;
const char *p = mname;
if (*p == '\0')
return (EINVAL);
for (;;) {
/* First eliminate all leading / characters. */
while (*p == '/')
p++;
/* A name with all slashes or ending in a / */
if (*p == '\0')
return (EINVAL);
break;
p = sp + 1;
continue;
}
p = sp + 1;
continue;
}
p = sp + 1;
}
if (ret != 0)
return (ret);
return (0);
}
/*
* We're going to go through every boot time module and construct the
* appropriate vnodes for them now. Because there are very few of these that
* exist, generally on the order of a handful, we're going to create them all
* when the file system is initialized and then tear them all down when the
* module gets unloaded.
*
* The information about the modules is contained in properties on the root of
* the devinfo tree. Specifically there are three properties per module:
*
* - module-size-%d int64_t size, in bytes, of the boot time module.
* - module-addr-%d The address of the boot time module
* - module-name-%d The string name of the boot time module
*
* Note that the module-size and module-addr fields are always 64-bit values
* regardless of being on a 32-bit or 64-bit kernel. module-name is a string
* property.
*
* There is no property that indicates the total number of such modules. Modules
* start at 0 and work their way up incrementally. The first time we can't find
* a module or a property, then we stop.
*/
void
{
int ret;
root = ddi_root_node();
for (;;) {
if (id == UINT32_MAX)
break;
sizeof (paddr))
break;
sizeof (paddr))
break;
sizeof (paddr))
break;
break;
if (ndata == 8)
if (ndata != 8)
break;
break;
if (ndata == 8)
if (ndata != 8)
break;
break;
id++;
}
}
void
{
}
}