sn1_brand.c revision 319378d99bca1eacf64f0a464b0175bf66b422ab
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/archsystm.h>
#include <sys/machbrand.h>
#include "sn1_brand.h"
char *sn1_emulation_table = NULL;
void sn1_init_brand_data(zone_t *);
void sn1_free_brand_data(zone_t *);
void sn1_setbrand(proc_t *);
void sn1_exec();
int sn1_initlwp(klwp_t *);
void sn1_freelwp(klwp_t *);
void sn1_lwpexit(klwp_t *);
/* sn1 brand */
};
#ifdef sparc
struct brand_mach_ops sn1_mops = {
};
#else /* sparc */
#ifdef __amd64
struct brand_mach_ops sn1_mops = {
NULL,
};
#else /* ! __amd64 */
struct brand_mach_ops sn1_mops = {
NULL,
NULL,
NULL,
};
#endif /* __amd64 */
#endif /* _sparc */
"sn1",
};
};
static struct modlinkage modlinkage = {
};
void
sn1_setbrand(proc_t *p)
{
p->p_brand_data = NULL;
}
/* ARGSUSED */
int
{
return (EINVAL);
}
/* ARGSUSED */
int
{
return (EINVAL);
}
/*
* Get the address of the user-space system call handler from the user
* process and attach it to the proc structure.
*/
/*ARGSUSED*/
int
{
*rval = 0;
if (cmd == B_REGISTER) {
p->p_brand_data = (void *) arg1;
return (0);
}
return (EINVAL);
}
/*
* Copy the per-process brand data from a parent proc to a child. In the
* sn1 brand, the only per-process state is the address of the user-space
* handler.
*/
void
{
}
/*ARGSUSED*/
void
{
p->p_brand_data = NULL;
p->p_brand = &native_brand;
}
void
sn1_exec()
{
}
/*ARGSUSED*/
int
sn1_initlwp(klwp_t *l)
{
return (0);
}
/*ARGSUSED*/
void
{
}
/*ARGSUSED*/
void
{
}
/*ARGSUSED*/
void
{
}
/*ARGSUSED*/
void
sn1_freelwp(klwp_t *l)
{
}
/*ARGSUSED*/
void
sn1_lwpexit(klwp_t *l)
{
}
int
int brand_action)
{
}
int
_init(void)
{
int err;
/*
* Set up the table indicating which system calls we want to
* interpose on. We should probably build this automatically from
* a list of system calls that is shared with the user-space
* library.
*/
if (err) {
}
return (err);
}
int
{
}
int
_fini(void)
{
int err;
/*
* If there are any zones using this brand, we can't allow it to be
* unloaded.
*/
if (brand_zone_count(&sn1_brand))
return (EBUSY);
if (err)
return (err);
}