9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * CDDL HEADER START
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * The contents of this file are subject to the terms of the
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * Common Development and Distribution License (the "License").
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * You may not use this file except in compliance with the License.
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * See the License for the specific language governing permissions
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * and limitations under the License.
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * When distributing Covered Code, include this CDDL HEADER in each
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * If applicable, add the following below this CDDL HEADER, with the
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * fields enclosed by brackets "[]" replaced with your own identifying
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * information: Portions Copyright [yyyy] [name of copyright owner]
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * CDDL HEADER END
80e2ca8596e3435bc3b76f3c597833ea0a87f85e * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnnextern "C" {
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * All Brands supported by this kernel must use BRAND_VER_1.
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * sub-commands to brandsys.
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * 1 - 128 are for common commands
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * 128+ are available for brand-specific commands.
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * Structure used by zoneadmd to communicate the name of a brand and the
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * supporting brand module into the kernel.
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn/* What we call the native brand. */
9a5d73e03cd3312ddb571a748c40a63c58bd66e5Ric Aleshire/* What we call the labeled brand. */
80e2ca8596e3435bc3b76f3c597833ea0a87f85e * Aux vector containing lddata pointer of brand library linkmap.
80e2ca8596e3435bc3b76f3c597833ea0a87f85e * Used by common {brand}_librtld_db.
80e2ca8596e3435bc3b76f3c597833ea0a87f85e * Information needed by the brand library to launch an executable.
80e2ca8596e3435bc3b76f3c597833ea0a87f85e * Common structure used to register a branded processes
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn int (*b_brandsys)(int, int64_t *, uintptr_t, uintptr_t, uintptr_t,
8f798d3afbe38d59cc0a708261dbb729f1b6b209Roger A. Faulkner void (*b_sigset_native_to_brand)(sigset_t *);
8f798d3afbe38d59cc0a708261dbb729f1b6b209Roger A. Faulkner void (*b_sigset_brand_to_native)(sigset_t *);
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * The b_version field must always be the first entry in this struct.
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn * Convenience macros
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn#define PROC_IS_BRANDED(p) ((p)->p_brand != &native_brand)
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn#define ZONE_IS_BRANDED(z) ((z)->zone_brand != &native_brand)
8f798d3afbe38d59cc0a708261dbb729f1b6b209Roger A. Faulkner BROP(curproc)->b_sigset_native_to_brand) \
8f798d3afbe38d59cc0a708261dbb729f1b6b209Roger A. Faulkner BROP(curproc)->b_sigset_native_to_brand(sigset)
8f798d3afbe38d59cc0a708261dbb729f1b6b209Roger A. Faulkner BROP(curproc)->b_sigset_brand_to_native) \
8f798d3afbe38d59cc0a708261dbb729f1b6b209Roger A. Faulkner BROP(curproc)->b_sigset_brand_to_native(sigset)
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnnextern void brand_init();
e9f7cbf00b5dbfafe45ffb00125fa0cc683595c6Vamsi Nagineniextern void brand_clearbrand(proc_t *, boolean_t);
80e2ca8596e3435bc3b76f3c597833ea0a87f85e * The following functions can be shared among kernel brand modules which
80e2ca8596e3435bc3b76f3c597833ea0a87f85e * implement Solaris-derived brands, all of which need to do similar tasks to
80e2ca8596e3435bc3b76f3c597833ea0a87f85e * manage the brand.
80e2ca8596e3435bc3b76f3c597833ea0a87f85eextern int brand_solaris_cmd(int, uintptr_t, uintptr_t, uintptr_t,
80e2ca8596e3435bc3b76f3c597833ea0a87f85e struct brand *, int);
80e2ca8596e3435bc3b76f3c597833ea0a87f85e struct brand *);
80e2ca8596e3435bc3b76f3c597833ea0a87f85eextern int brand_solaris_elfexec(vnode_t *, execa_t *, uarg_t *,
80e2ca8596e3435bc3b76f3c597833ea0a87f85e struct brand *, char *, char *, char *, char *, char *);
80e2ca8596e3435bc3b76f3c597833ea0a87f85e struct brand *);
80e2ca8596e3435bc3b76f3c597833ea0a87f85eextern void brand_solaris_forklwp(klwp_t *, klwp_t *, struct brand *);
80e2ca8596e3435bc3b76f3c597833ea0a87f85eextern void brand_solaris_freelwp(klwp_t *, struct brand *);
80e2ca8596e3435bc3b76f3c597833ea0a87f85eextern void brand_solaris_lwpexit(klwp_t *, struct brand *);
80e2ca8596e3435bc3b76f3c597833ea0a87f85eextern void brand_solaris_proc_exit(struct proc *, klwp_t *,
80e2ca8596e3435bc3b76f3c597833ea0a87f85e struct brand *);
80e2ca8596e3435bc3b76f3c597833ea0a87f85eextern void brand_solaris_setbrand(proc_t *, struct brand *);
80e2ca8596e3435bc3b76f3c597833ea0a87f85e#if defined(_SYSCALL32)
80e2ca8596e3435bc3b76f3c597833ea0a87f85e#endif /* _SYSCALL32 */
80e2ca8596e3435bc3b76f3c597833ea0a87f85e * Common information associated with all branded processes
80e2ca8596e3435bc3b76f3c597833ea0a87f85e brand_elf_data_t spd_elf_data; /* common ELF data for branded app. */
80e2ca8596e3435bc3b76f3c597833ea0a87f85e#define BRAND_NATIVE_LINKER32 BRAND_NATIVE_DIR "lib/ld.so.1"
80e2ca8596e3435bc3b76f3c597833ea0a87f85e#define BRAND_NATIVE_LINKER64 BRAND_NATIVE_DIR "lib/64/ld.so.1"
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn#endif /* _KERNEL */
9acbbeaf2a1ffe5c14b244867d427714fab43c5cnn#endif /* _SYS_BRAND_H */