/*
* 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
*/
/*
*/
#ifndef _SYS_BRAND_H
#define _SYS_BRAND_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* All Brands supported by this kernel must use BRAND_VER_1.
*/
/*
* sub-commands to brandsys.
* 1 - 128 are for common commands
* 128+ are available for brand-specific commands.
*/
/*
* Structure used by zoneadmd to communicate the name of a brand and the
* supporting brand module into the kernel.
*/
struct brand_attr {
};
/* What we call the native brand. */
/* What we call the labeled brand. */
/*
* Aux vector containing lddata pointer of brand library linkmap.
* Used by common {brand}_librtld_db.
*/
/*
* Information needed by the brand library to launch an executable.
*/
typedef struct brand_elf_data {
/*
* Common structure used to register a branded processes
*/
typedef struct brand_proc_reg {
#ifdef _KERNEL
struct proc;
struct uarg;
struct brand_mach_ops;
struct intpdata;
struct execa;
struct brand_ops {
void (*b_exec)();
int b_nsig;
};
/*
* The b_version field must always be the first entry in this struct.
*/
typedef struct brand {
int b_version;
char *b_name;
} brand_t;
extern brand_t native_brand;
/*
* Convenience macros
*/
if (PROC_IS_BRANDED(curproc) && \
if (PROC_IS_BRANDED(curproc) && \
extern void brand_init();
extern int brand_register(brand_t *);
extern int brand_unregister(brand_t *);
extern brand_t *brand_find_name(char *);
extern void brand_unregister_zone(brand_t *);
extern int brand_zone_count(brand_t *);
extern void brand_setbrand(proc_t *);
/*
* The following functions can be shared among kernel brand modules which
* implement Solaris-derived brands, all of which need to do similar tasks to
* manage the brand.
*/
struct brand *, int);
struct brand *);
struct brand *, char *, char *, char *, char *, char *);
extern void brand_solaris_exec(struct brand *);
extern int brand_solaris_fini(char **, struct modlinkage *,
struct brand *);
struct brand *);
#if defined(_SYSCALL32)
typedef struct brand_elf_data32 {
typedef struct brand_common_reg32 {
#endif /* _SYSCALL32 */
/*
* Common information associated with all branded processes
*/
typedef struct brand_proc_data {
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_BRAND_H */