diff options
author | jb <jb@FreeBSD.org> | 2007-11-28 21:50:40 +0000 |
---|---|---|
committer | jb <jb@FreeBSD.org> | 2007-11-28 21:50:40 +0000 |
commit | 4b02e2256720836fa381d03ba18850645cc62d4b (patch) | |
tree | 0d496fdd3f6f4649e07962c0290e26915242ba09 /sys/cddl/compat | |
parent | 1e16c5b22bdfdf74bd7da9b61dafa794707b98e1 (diff) | |
download | FreeBSD-src-4b02e2256720836fa381d03ba18850645cc62d4b.zip FreeBSD-src-4b02e2256720836fa381d03ba18850645cc62d4b.tar.gz |
Add more OpenSolaris compatibility headers.
Diffstat (limited to 'sys/cddl/compat')
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/bitmap.h | 116 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/cpupart.h | 36 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/cpuvar.h | 95 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/cyclic.h | 39 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/elf.h | 116 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/mman.h | 37 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/modctl.h | 38 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/objfs.h | 33 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/param.h | 37 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/pcpu.h | 39 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/stat.h | 38 |
11 files changed, 624 insertions, 0 deletions
diff --git a/sys/cddl/compat/opensolaris/sys/bitmap.h b/sys/cddl/compat/opensolaris/sys/bitmap.h new file mode 100644 index 0000000..d75b8bd --- /dev/null +++ b/sys/cddl/compat/opensolaris/sys/bitmap.h @@ -0,0 +1,116 @@ +/* + * 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 + * or http://www.opensolaris.org/os/licensing. + * 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 2005 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + + +#ifndef _COMPAT_OPENSOLARIS_SYS_BITMAP_H +#define _COMPAT_OPENSOLARIS_SYS_BITMAP_H + +#include <sys/atomic.h> + +/* + * Operations on bitmaps of arbitrary size + * A bitmap is a vector of 1 or more ulong_t's. + * The user of the package is responsible for range checks and keeping + * track of sizes. + */ + +#ifdef _LP64 +#define BT_ULSHIFT 6 /* log base 2 of BT_NBIPUL, to extract word index */ +#define BT_ULSHIFT32 5 /* log base 2 of BT_NBIPUL, to extract word index */ +#else +#define BT_ULSHIFT 5 /* log base 2 of BT_NBIPUL, to extract word index */ +#endif + +#define BT_NBIPUL (1 << BT_ULSHIFT) /* n bits per ulong_t */ +#define BT_ULMASK (BT_NBIPUL - 1) /* to extract bit index */ + +#ifdef _LP64 +#define BT_NBIPUL32 (1 << BT_ULSHIFT32) /* n bits per ulong_t */ +#define BT_ULMASK32 (BT_NBIPUL32 - 1) /* to extract bit index */ +#define BT_ULMAXMASK 0xffffffffffffffff /* used by bt_getlowbit */ +#else +#define BT_ULMAXMASK 0xffffffff +#endif + +/* + * bitmap is a ulong_t *, bitindex an index_t + * + * The macros BT_WIM and BT_BIW internal; there is no need + * for users of this package to use them. + */ + +/* + * word in map + */ +#define BT_WIM(bitmap, bitindex) \ + ((bitmap)[(bitindex) >> BT_ULSHIFT]) +/* + * bit in word + */ +#define BT_BIW(bitindex) \ + (1UL << ((bitindex) & BT_ULMASK)) + +#ifdef _LP64 +#define BT_WIM32(bitmap, bitindex) \ + ((bitmap)[(bitindex) >> BT_ULSHIFT32]) + +#define BT_BIW32(bitindex) \ + (1UL << ((bitindex) & BT_ULMASK32)) +#endif + +/* + * These are public macros + * + * BT_BITOUL == n bits to n ulong_t's + */ +#define BT_BITOUL(nbits) \ + (((nbits) + BT_NBIPUL - 1l) / BT_NBIPUL) +#define BT_SIZEOFMAP(nbits) \ + (BT_BITOUL(nbits) * sizeof (ulong_t)) +#define BT_TEST(bitmap, bitindex) \ + ((BT_WIM((bitmap), (bitindex)) & BT_BIW(bitindex)) ? 1 : 0) +#define BT_SET(bitmap, bitindex) \ + { BT_WIM((bitmap), (bitindex)) |= BT_BIW(bitindex); } +#define BT_CLEAR(bitmap, bitindex) \ + { BT_WIM((bitmap), (bitindex)) &= ~BT_BIW(bitindex); } + +#ifdef _LP64 +#define BT_BITOUL32(nbits) \ + (((nbits) + BT_NBIPUL32 - 1l) / BT_NBIPUL32) +#define BT_SIZEOFMAP32(nbits) \ + (BT_BITOUL32(nbits) * sizeof (uint_t)) +#define BT_TEST32(bitmap, bitindex) \ + ((BT_WIM32((bitmap), (bitindex)) & BT_BIW32(bitindex)) ? 1 : 0) +#define BT_SET32(bitmap, bitindex) \ + { BT_WIM32((bitmap), (bitindex)) |= BT_BIW32(bitindex); } +#define BT_CLEAR32(bitmap, bitindex) \ + { BT_WIM32((bitmap), (bitindex)) &= ~BT_BIW32(bitindex); } +#endif /* _LP64 */ + +#endif /* _COMPAT_OPENSOLARIS_SYS_BITMAP_H */ diff --git a/sys/cddl/compat/opensolaris/sys/cpupart.h b/sys/cddl/compat/opensolaris/sys/cpupart.h new file mode 100644 index 0000000..29e0910 --- /dev/null +++ b/sys/cddl/compat/opensolaris/sys/cpupart.h @@ -0,0 +1,36 @@ +/* + * 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 + * or http://www.opensolaris.org/os/licensing. + * 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. + */ + +#ifndef _COMPAT_OPENSOLARIS_SYS_CPUPART_H +#define _COMPAT_OPENSOLARIS_SYS_CPUPART_H + +typedef int cpupartid_t; + +typedef struct cpupart { + cpupartid_t cp_id; /* partition ID */ +} cpupart_t; + +#endif /* _COMPAT_OPENSOLARIS_SYS_CPUPART_H */ diff --git a/sys/cddl/compat/opensolaris/sys/cpuvar.h b/sys/cddl/compat/opensolaris/sys/cpuvar.h new file mode 100644 index 0000000..11b591f --- /dev/null +++ b/sys/cddl/compat/opensolaris/sys/cpuvar.h @@ -0,0 +1,95 @@ +/* + * 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 + * or http://www.opensolaris.org/os/licensing. + * 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. + */ + +#ifndef _COMPAT_OPENSOLARIS_SYS_CPUVAR_H +#define _COMPAT_OPENSOLARIS_SYS_CPUVAR_H + +#include <sys/mutex.h> + +#ifdef _KERNEL +#define CPU_CACHE_COHERENCE_SIZE 64 + +/* + * The cpu_core structure consists of per-CPU state available in any context. + * On some architectures, this may mean that the page(s) containing the + * NCPU-sized array of cpu_core structures must be locked in the TLB -- it + * is up to the platform to assure that this is performed properly. Note that + * the structure is sized to avoid false sharing. + */ +#define CPUC_SIZE (sizeof (uint16_t) + sizeof (uintptr_t) + \ + sizeof (kmutex_t)) +#define CPUC_PADSIZE CPU_CACHE_COHERENCE_SIZE - CPUC_SIZE + +typedef struct cpu_core { + uint16_t cpuc_dtrace_flags; /* DTrace flags */ + uint8_t cpuc_pad[CPUC_PADSIZE]; /* padding */ + uintptr_t cpuc_dtrace_illval; /* DTrace illegal value */ + kmutex_t cpuc_pid_lock; /* DTrace pid provider lock */ +} cpu_core_t; + +extern cpu_core_t cpu_core[]; +#endif /* _KERNEL */ + +/* + * DTrace flags. + */ +#define CPU_DTRACE_NOFAULT 0x0001 /* Don't fault */ +#define CPU_DTRACE_DROP 0x0002 /* Drop this ECB */ +#define CPU_DTRACE_BADADDR 0x0004 /* DTrace fault: bad address */ +#define CPU_DTRACE_BADALIGN 0x0008 /* DTrace fault: bad alignment */ +#define CPU_DTRACE_DIVZERO 0x0010 /* DTrace fault: divide by zero */ +#define CPU_DTRACE_ILLOP 0x0020 /* DTrace fault: illegal operation */ +#define CPU_DTRACE_NOSCRATCH 0x0040 /* DTrace fault: out of scratch */ +#define CPU_DTRACE_KPRIV 0x0080 /* DTrace fault: bad kernel access */ +#define CPU_DTRACE_UPRIV 0x0100 /* DTrace fault: bad user access */ +#define CPU_DTRACE_TUPOFLOW 0x0200 /* DTrace fault: tuple stack overflow */ +#if defined(__sparc) +#define CPU_DTRACE_FAKERESTORE 0x0400 /* pid provider hint to getreg */ +#endif +#define CPU_DTRACE_ENTRY 0x0800 /* pid provider hint to ustack() */ +#define CPU_DTRACE_BADSTACK 0x1000 /* DTrace fault: bad stack */ + +#define CPU_DTRACE_FAULT (CPU_DTRACE_BADADDR | CPU_DTRACE_BADALIGN | \ + CPU_DTRACE_DIVZERO | CPU_DTRACE_ILLOP | \ + CPU_DTRACE_NOSCRATCH | CPU_DTRACE_KPRIV | \ + CPU_DTRACE_UPRIV | CPU_DTRACE_TUPOFLOW | \ + CPU_DTRACE_BADSTACK) +#define CPU_DTRACE_ERROR (CPU_DTRACE_FAULT | CPU_DTRACE_DROP) + +typedef enum { + CPU_INIT, + CPU_CONFIG, + CPU_UNCONFIG, + CPU_ON, + CPU_OFF, + CPU_CPUPART_IN, + CPU_CPUPART_OUT +} cpu_setup_t; + +typedef int cpu_setup_func_t(cpu_setup_t, int, void *); + + +#endif /* _COMPAT_OPENSOLARIS_SYS_CPUVAR_H */ diff --git a/sys/cddl/compat/opensolaris/sys/cyclic.h b/sys/cddl/compat/opensolaris/sys/cyclic.h new file mode 100644 index 0000000..331a28c --- /dev/null +++ b/sys/cddl/compat/opensolaris/sys/cyclic.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2007 John Birrell <jb@freebsd.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_SYS_CYCLIC_H_ +#define _COMPAT_OPENSOLARIS_SYS_CYCLIC_H_ + +#ifndef _KERNEL +typedef void cpu_t; +#endif + +#include_next <sys/cyclic.h> + +#endif diff --git a/sys/cddl/compat/opensolaris/sys/elf.h b/sys/cddl/compat/opensolaris/sys/elf.h new file mode 100644 index 0000000..a630f28 --- /dev/null +++ b/sys/cddl/compat/opensolaris/sys/elf.h @@ -0,0 +1,116 @@ +/* + * 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 + * or http://www.opensolaris.org/os/licensing. + * 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 + * + * $FreeBSD$ + * + * ELF compatibility definitions for OpenSolaris source. + * + */ + +#ifndef _SYS__ELF_SOLARIS_H_ +#define _SYS__ELF_SOLARIS_H_ + +#include_next <sys/elf.h> + +#define __sElfN(x) typedef __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x) x + +__sElfN(Addr); +__sElfN(Cap); +__sElfN(Dyn); +__sElfN(Ehdr); +__sElfN(Move); +__sElfN(Off); +__sElfN(Phdr); +__sElfN(Rel); +__sElfN(Rela); +__sElfN(Shdr); +__sElfN(Sym); +__sElfN(Syminfo); +__sElfN(Verdaux); +__sElfN(Verdef); +__sElfN(Vernaux); +__sElfN(Verneed); +__sElfN(Versym); + +__sElfN(Half); +__sElfN(Sword); +__sElfN(Word); + +#if __ELF_WORD_SIZE == 32 +typedef Elf32_Word Xword; /* Xword/Sxword are 32-bits in Elf32 */ +typedef Elf32_Sword Sxword; +#else +typedef Elf64_Xword Xword; +typedef Elf64_Sxword Sxword; +#endif + +#define ELF_M_INFO __ELFN(M_INFO) +#define ELF_M_SIZE __ELFN(M_SIZE) +#define ELF_M_SYM __ELFN(M_SYM) + +/* + * Elf `printf' type-cast macros. These force arguments to be a fixed size + * so that Elf32 and Elf64 can share common format strings. + */ +#define EC_ADDR(a) ((Elf64_Addr)(a)) /* "ull" */ +#define EC_OFF(a) ((Elf64_Off)(a)) /* "ull" */ +#define EC_HALF(a) ((Elf64_Half)(a)) /* "d" */ +#define EC_WORD(a) ((Elf64_Word)(a)) /* "u" */ +#define EC_SWORD(a) ((Elf64_Sword)(a)) /* "d" */ +#define EC_XWORD(a) ((Elf64_Xword)(a)) /* "ull" */ +#define EC_SXWORD(a) ((Elf64_Sxword)(a)) /* "ll" */ +#define EC_LWORD(a) ((Elf64_Lword)(a)) /* "ull" */ + +#define elf_checksum __elfN(checksum) +#define elf_fsize __elfN(fsize) +#define elf_getehdr __elfN(getehdr) +#define elf_getphdr __elfN(getphdr) +#define elf_newehdr __elfN(newehdr) +#define elf_newphdr __elfN(newphdr) +#define elf_getshdr __elfN(getshdr) +#define elf_xlatetof __elfN(xlatetof) +#define elf_xlatetom __elfN(xlatetom) + +#define Elf_cap_entry __ElfN(cap_entry) +#define Elf_cap_title __ElfN(cap_title) +#define Elf_demangle_name __ElfN(demangle_name) +#define Elf_dyn_entry __ElfN(dyn_entry) +#define Elf_dyn_title __ElfN(dyn_title) +#define Elf_ehdr __ElfN(ehdr) +#define Elf_got_entry __ElfN(got_entry) +#define Elf_got_title __ElfN(got_title) +#define Elf_reloc_apply_reg __ElfN(reloc_apply_reg) +#define Elf_reloc_apply_val __ElfN(reloc_apply_val) +#define Elf_reloc_entry_1 __ElfN(reloc_entry_1) +#define Elf_reloc_entry_2 __ElfN(reloc_entry_2) +#define Elf_reloc_title __ElfN(reloc_title) +#define Elf_phdr __ElfN(phdr) +#define Elf_shdr __ElfN(shdr) +#define Elf_syms_table_entry __ElfN(syms_table_entry) +#define Elf_syms_table_title __ElfN(syms_table_title) +#define Elf_ver_def_title __ElfN(ver_def_title) +#define Elf_ver_line_1 __ElfN(ver_line_1) +#define Elf_ver_line_2 __ElfN(ver_line_2) +#define Elf_ver_line_3 __ElfN(ver_line_3) +#define Elf_ver_line_4 __ElfN(ver_line_4) +#define Elf_ver_line_5 __ElfN(ver_line_5) +#define Elf_ver_need_title __ElfN(ver_need_title) + +#endif /* !_SYS__ELF_SOLARIS_H_ */ diff --git a/sys/cddl/compat/opensolaris/sys/mman.h b/sys/cddl/compat/opensolaris/sys/mman.h new file mode 100644 index 0000000..ca74689 --- /dev/null +++ b/sys/cddl/compat/opensolaris/sys/mman.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2007 John Birrell <jb@freebsd.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_SYS_MMAN_H_ +#define _COMPAT_OPENSOLARIS_SYS_MMAN_H_ + +#include_next <sys/mman.h> + +#define mmap64(_a,_b,_c,_d,_e,_f) mmap(_a,_b,_c,_d,_e,_f) + +#endif diff --git a/sys/cddl/compat/opensolaris/sys/modctl.h b/sys/cddl/compat/opensolaris/sys/modctl.h new file mode 100644 index 0000000..7af39b0 --- /dev/null +++ b/sys/cddl/compat/opensolaris/sys/modctl.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2007 John Birrell <jb@freebsd.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_SYS_MODCTL_H +#define _COMPAT_OPENSOLARIS_SYS_MODCTL_H + +#include <sys/param.h> +#include <sys/linker.h> + +typedef struct linker_file modctl_t; + +#endif /* _COMPAT_OPENSOLARIS_SYS_MODCTL_H */ diff --git a/sys/cddl/compat/opensolaris/sys/objfs.h b/sys/cddl/compat/opensolaris/sys/objfs.h new file mode 100644 index 0000000..3904f4c --- /dev/null +++ b/sys/cddl/compat/opensolaris/sys/objfs.h @@ -0,0 +1,33 @@ +/* + * 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 + * or http://www.opensolaris.org/os/licensing. + * 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 _COMPAT_OPENSOLARIS_SYS_OBJFS_H +#define _COMPAT_OPENSOLARIS_SYS_OBJFS_H + +/* + * Private data structure found in '.info' section + */ +typedef struct objfs_info { + int objfs_info_primary; +} objfs_info_t; + + +#endif /* _COMPAT_OPENSOLARIS_SYS_OBJFS_H */ diff --git a/sys/cddl/compat/opensolaris/sys/param.h b/sys/cddl/compat/opensolaris/sys/param.h new file mode 100644 index 0000000..8d36a9d --- /dev/null +++ b/sys/cddl/compat/opensolaris/sys/param.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2007 John Birrell <jb@freebsd.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_SYS_PARAM_H_ +#define _COMPAT_OPENSOLARIS_SYS_PARAM_H_ + +#include_next <sys/param.h> + +#define PAGESIZE PAGE_SIZE + +#endif diff --git a/sys/cddl/compat/opensolaris/sys/pcpu.h b/sys/cddl/compat/opensolaris/sys/pcpu.h new file mode 100644 index 0000000..db38de6 --- /dev/null +++ b/sys/cddl/compat/opensolaris/sys/pcpu.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2007 John Birrell <jb@freebsd.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_SYS_PCPU_H_ +#define _COMPAT_OPENSOLARIS_SYS_PCPU_H_ + +#include_next <sys/pcpu.h> + +typedef struct pcpu cpu_t; + +#define cpu_id pc_cpuid + +#endif diff --git a/sys/cddl/compat/opensolaris/sys/stat.h b/sys/cddl/compat/opensolaris/sys/stat.h new file mode 100644 index 0000000..5f45ebe --- /dev/null +++ b/sys/cddl/compat/opensolaris/sys/stat.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2007 John Birrell <jb@freebsd.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _COMPAT_OPENSOLARIS_SYS_STAT_H_ +#define _COMPAT_OPENSOLARIS_SYS_STAT_H_ + +#include_next <sys/stat.h> + +#define stat64 stat +#define fstat64 fstat + +#endif |