├── .github └── workflows │ └── payload.yml ├── LICENSE ├── Makefile ├── README.md ├── crt0.s ├── include ├── _ctype.h ├── aio.h ├── altq │ ├── altqconf.h │ └── if_altq.h ├── arpa │ └── inet.h ├── assert.h ├── bsm │ ├── audit.h │ └── audit_kevents.h ├── complex.h ├── cpio.h ├── ctype.h ├── db.h ├── dirent.h ├── dlfcn.h ├── elf.h ├── err.h ├── errno.h ├── fcntl.h ├── fenv.h ├── float.h ├── fmtmsg.h ├── fnmatch.h ├── ftps4.h ├── ftw.h ├── glob.h ├── grp.h ├── inttypes.h ├── iso646.h ├── langinfo.h ├── libgen.h ├── limits.h ├── link.h ├── locale.h ├── machine │ ├── _align.h │ ├── _inttypes.h │ ├── _limits.h │ ├── _stdint.h │ ├── _types.h │ ├── atomic.h │ ├── cpu.h │ ├── cpufunc.h │ ├── elf.h │ ├── endian.h │ ├── fpu.h │ ├── frame.h │ ├── param.h │ ├── pcb.h │ ├── pcpu.h │ ├── pmap.h │ ├── proc.h │ ├── psl.h │ ├── ptrace.h │ ├── reg.h │ ├── runq.h │ ├── segments.h │ ├── setjmp.h │ ├── signal.h │ ├── specialreg.h │ ├── stdarg.h │ ├── sysarch.h │ ├── trap.h │ ├── ucontext.h │ ├── vm.h │ └── vmparam.h ├── math.h ├── monetary.h ├── mqueue.h ├── ndbm.h ├── net │ ├── if.h │ ├── if_var.h │ └── vnet.h ├── netdb.h ├── netinet │ ├── in.h │ └── tcp.h ├── netinet6 │ └── in6.h ├── nl_types.h ├── opt_compat.h ├── orbis │ ├── EGL │ │ ├── egl.h │ │ ├── eglext.h │ │ ├── eglplatform.h │ │ ├── eglsce.h │ │ └── khrplatform.h │ ├── GLES2 │ │ ├── gl2.h │ │ ├── gl2ext.h │ │ ├── gl2platform.h │ │ └── gl2sce.h │ ├── KHR │ │ └── khrplatform.h │ ├── features.h │ ├── libSceAudioOut.h │ ├── libSceCamera.h │ ├── libSceGnmDriver.h │ ├── libSceIme.h │ ├── libSceLibcInternal.h │ ├── libSceNet.h │ ├── libScePad.h │ ├── libScePigletv2VSH.h │ ├── libSceSysmodule.h │ ├── libSceSystemService.h │ ├── libSceUsbd.h │ ├── libSceUserService.h │ ├── libSceVideoOut.h │ ├── libkernel.h │ ├── piglet.h │ └── prerequisites.h ├── orbisdev.h ├── osreldate.h ├── poll.h ├── ps4sdk.h ├── pthread.h ├── pwd.h ├── regex.h ├── resolve.h ├── runetype.h ├── sched.h ├── search.h ├── semaphore.h ├── setjmp.h ├── signal.h ├── spawn.h ├── stdarg.h ├── stdbool.h ├── stddef.h ├── stdint.h ├── stdio.h ├── stdlib.h ├── string.h ├── strings.h ├── sys │ ├── _callout.h │ ├── _cpuset.h │ ├── _iovec.h │ ├── _lock.h │ ├── _lockmgr.h │ ├── _mutex.h │ ├── _null.h │ ├── _pthreadtypes.h │ ├── _rwlock.h │ ├── _semaphore.h │ ├── _sigset.h │ ├── _sockaddr_storage.h │ ├── _stack.h │ ├── _stdint.h │ ├── _sx.h │ ├── _task.h │ ├── _termios.h │ ├── _timespec.h │ ├── _timeval.h │ ├── _types.h │ ├── _umtx.h │ ├── acl.h │ ├── buf_ring.h │ ├── bufobj.h │ ├── callout.h │ ├── capability.h │ ├── cdefs.h │ ├── condvar.h │ ├── conf.h │ ├── consio.h │ ├── cpuset.h │ ├── dirent.h │ ├── elf.h │ ├── elf32.h │ ├── elf64.h │ ├── elf_common.h │ ├── elf_generic.h │ ├── endian.h │ ├── errno.h │ ├── event.h │ ├── eventhandler.h │ ├── eventvar.h │ ├── fcntl.h │ ├── file.h │ ├── filedesc.h │ ├── filio.h │ ├── imgact.h │ ├── ioccom.h │ ├── ioctl.h │ ├── ipc.h │ ├── jail.h │ ├── kbio.h │ ├── kdb.h │ ├── kernel.h │ ├── kobj.h │ ├── kthread.h │ ├── ktr.h │ ├── libkern.h │ ├── limits.h │ ├── link_elf.h │ ├── linker.h │ ├── linker_set.h │ ├── lock.h │ ├── lock_profile.h │ ├── lockmgr.h │ ├── lockstat.h │ ├── mac.h │ ├── malloc.h │ ├── mbuf.h │ ├── mman.h │ ├── module.h │ ├── mount.h │ ├── mqueue.h │ ├── msg.h │ ├── mutex.h │ ├── namei.h │ ├── osd.h │ ├── param.h │ ├── pcpu.h │ ├── poll.h │ ├── priority.h │ ├── proc.h │ ├── protosw.h │ ├── ptrace.h │ ├── queue.h │ ├── refcount.h │ ├── resource.h │ ├── resourcevar.h │ ├── rtprio.h │ ├── runq.h │ ├── rwlock.h │ ├── sched.h │ ├── select.h │ ├── selinfo.h │ ├── sem.h │ ├── sglist.h │ ├── shm.h │ ├── sigio.h │ ├── signal.h │ ├── signalvar.h │ ├── smp.h │ ├── sockbuf.h │ ├── socket.h │ ├── socketvar.h │ ├── sockio.h │ ├── sockopt.h │ ├── sockstate.h │ ├── stat.h │ ├── statvfs.h │ ├── stdatomic.h │ ├── stdint.h │ ├── sx.h │ ├── syscall.h │ ├── syscallsubr.h │ ├── sysctl.h │ ├── sysent.h │ ├── syslimits.h │ ├── sysproto.h │ ├── systm.h │ ├── time.h │ ├── times.h │ ├── timespec.h │ ├── ttycom.h │ ├── ttydefaults.h │ ├── types.h │ ├── ucontext.h │ ├── ucred.h │ ├── uio.h │ ├── un.h │ ├── unistd.h │ ├── user.h │ ├── utsname.h │ ├── vmmeter.h │ └── wait.h ├── syslog.h ├── tar.h ├── termios.h ├── tgmath.h ├── third_party │ ├── kernel │ │ └── uthash │ │ │ └── uthash.h │ └── udis86 │ │ ├── decode.h │ │ ├── extern.h │ │ ├── itab.h │ │ ├── syn.h │ │ ├── types.h │ │ ├── udint.h │ │ └── udis86.h ├── time.h ├── ulimit.h ├── unistd.h ├── utime.h ├── utmpx.h ├── vm │ ├── pmap.h │ ├── uma.h │ ├── vm.h │ ├── vm_extern.h │ ├── vm_map.h │ ├── vm_page.h │ └── vm_param.h ├── wchar.h ├── wctype.h ├── wordexp.h ├── x86 │ ├── _align.h │ └── _inttypes.h └── xlocale.h ├── linker.x └── source ├── ftps4.c ├── main.c └── syscall.s /.github/workflows/payload.yml: -------------------------------------------------------------------------------- 1 | name: Build payload 2 | 3 | on: push 4 | 5 | jobs: 6 | payload-build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | 10 | - name: Checkout 11 | uses: actions/checkout@v3 12 | 13 | - name: Set env vars 14 | run: | 15 | echo "llvm_ver=9" >> $GITHUB_ENV 16 | echo "elfname=ftps5.elf" >> $GITHUB_ENV 17 | 18 | - name: Set up GCC 19 | uses: illusion0001/gha-setup-gcc@master 20 | with: 21 | version: ${{ env.llvm_ver }} 22 | platform: x64 23 | 24 | - name: Build ${{ env.elfname }} 25 | run: make 26 | 27 | - name: Upload payload 28 | uses: actions/upload-artifact@v3 29 | with: 30 | name: ${{ env.elfname }} 31 | path: ${{ env.elfname }} 32 | if-no-files-found: error 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Sergi Granell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | CC := gcc 2 | AS := gcc 3 | ODIR := build 4 | SDIR := source 5 | IDIRS := -I. -Iinclude 6 | LDIRS := -L. -Llib 7 | 8 | ifeq ($(PERSIST),0) 9 | else 10 | PERSISTENT := -DPERSISTENT 11 | endif 12 | 13 | CFLAGS := $(PERSISTENT) $(IDIRS) -s -std=gnu11 -fno-builtin -fno-exceptions -fno-asynchronous-unwind-tables -nostartfiles -nostdlib -Wall -m64 -fPIC -mcmodel=small -nostartfiles 14 | SFLAGS := -fno-builtin -nostartfiles -nostdlib -fPIC -mcmodel=small 15 | LFLAGS := $(LDIRS) -Xlinker -T linker.x -Wl,--build-id=none 16 | CFILES := $(wildcard $(SDIR)/*.c) 17 | SFILES := $(wildcard $(SDIR)/*.s) 18 | OBJS := $(patsubst $(SDIR)/%.c, $(ODIR)/%.o, $(CFILES)) $(patsubst $(SDIR)/%.s, $(ODIR)/%.o, $(SFILES)) 19 | 20 | LIBS := 21 | 22 | TARGET = ftps5.elf 23 | 24 | $(TARGET): $(ODIR) $(OBJS) 25 | $(CC) crt0.s $(ODIR)/*.o -o $(TARGET) $(CFLAGS) $(LFLAGS) $(LIBS) 26 | 27 | $(ODIR)/%.o: $(SDIR)/%.c 28 | $(CC) -c -o $@ $< $(CFLAGS) 29 | 30 | $(ODIR)/%.o: $(SDIR)/%.s 31 | $(AS) -c -o $@ $< $(SFLAGS) 32 | 33 | $(ODIR): 34 | @mkdir $@ 35 | 36 | .PHONY: clean 37 | 38 | clean: 39 | rm -f $(shell basename $(CURDIR)).elf $(TARGET) $(ODIR)/*.o 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FTPS5 2 | FTP server for PS5 Webkit 3 | 4 | # Building 5 | 6 | Needs gcc 9 installed. 7 | 8 | # Custom commands: 9 | 10 | - MTRW: Remount /system and /system_ex partitions with read-write access 11 | 12 | ## Known issue 13 | Forking webkit process causes a kernel panic when the console is shut down. 14 | 15 | Build with `make PERSIST=0` to avoid it but persistence will be lost. 16 | 17 | ## Credits: 18 | 19 | - [xerpi](https://github.com/xerpi): Original source 20 | - [bigboss](https://github.com/psxdev): Source improvement 21 | - [ChendoChap](https://github.com/ChendoChap): Fixing loader 22 | - [SpecterDev](https://github.com/Cryptogenic): Fixing code 23 | - [SiSTRo](https://github.com/SiSTR0): Fixing code 24 | - [John Törnblom](https://github.com/john-tornblom): Syscall check bypass trick 25 | -------------------------------------------------------------------------------- /crt0.s: -------------------------------------------------------------------------------- 1 | .intel_syntax noprefix 2 | .text 3 | 4 | .global _start 5 | _start: 6 | jmp payload_main 7 | -------------------------------------------------------------------------------- /include/altq/altqconf.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: altqconf.h,v 1.1 2001/06/27 05:28:36 kjc Exp $ */ 2 | /* $NetBSD: altqconf.h,v 1.2 2001/05/30 11:57:16 mrg Exp $ */ 3 | 4 | #if defined(_KERNEL_OPT) || defined(__OpenBSD__) 5 | 6 | #if defined(_KERNEL_OPT) 7 | #include "opt_altq_enabled.h" 8 | #endif 9 | 10 | #include 11 | 12 | #ifdef ALTQ 13 | #define NALTQ 1 14 | #else 15 | #define NALTQ 0 16 | #endif 17 | 18 | cdev_decl(altq); 19 | 20 | #ifdef __OpenBSD__ 21 | #define cdev_altq_init(c,n) { \ 22 | dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \ 23 | (dev_type_write((*))) enodev, dev_init(c,n,ioctl), \ 24 | (dev_type_stop((*))) enodev, 0, (dev_type_select((*))) enodev, \ 25 | (dev_type_mmap((*))) enodev } 26 | #else 27 | #define cdev_altq_init(x,y) cdev__oci_init(x,y) 28 | #endif 29 | #endif /* defined(_KERNEL_OPT) || defined(__OpenBSD__) */ 30 | -------------------------------------------------------------------------------- /include/assert.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1992, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * (c) UNIX System Laboratories, Inc. 5 | * All or some portions of this file are derived from material licensed 6 | * to the University of California by American Telephone and Telegraph 7 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 | * the permission of UNIX System Laboratories, Inc. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 3. Neither the name of the University nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 | * SUCH DAMAGE. 33 | * 34 | * @(#)assert.h 8.2 (Berkeley) 1/21/94 35 | * $FreeBSD: release/9.0.0/include/assert.h 217207 2011-01-09 21:39:46Z ed $ 36 | */ 37 | 38 | #include 39 | 40 | /* 41 | * Unlike other ANSI header files, may usefully be included 42 | * multiple times, with and without NDEBUG defined. 43 | */ 44 | 45 | #undef assert 46 | #undef _assert 47 | 48 | #ifdef NDEBUG 49 | #define assert(e) ((void)0) 50 | #define _assert(e) ((void)0) 51 | #else 52 | #define _assert(e) assert(e) 53 | 54 | //#define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \ 55 | // __LINE__, #e)) 56 | #define assert(e) if(!(e)) { } 57 | #endif /* NDEBUG */ 58 | 59 | #ifndef _ASSERT_H_ 60 | #define _ASSERT_H_ 61 | __BEGIN_DECLS 62 | void __assert(const char *, const char *, int, const char *) __dead2; 63 | __END_DECLS 64 | #endif /* !_ASSERT_H_ */ 65 | -------------------------------------------------------------------------------- /include/complex.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2001-2008 The FreeBSD Project. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/complex.h 219379 2011-03-07 16:05:45Z das $ 27 | */ 28 | 29 | #ifndef _COMPLEX_H 30 | #define _COMPLEX_H 31 | 32 | #ifdef __GNUC__ 33 | #if __STDC_VERSION__ < 199901 34 | #define _Complex __complex__ 35 | #endif 36 | #define _Complex_I 1.0fi 37 | #endif 38 | 39 | #define complex _Complex 40 | #define I _Complex_I 41 | 42 | #include 43 | 44 | __BEGIN_DECLS 45 | 46 | double cabs(double complex); 47 | float cabsf(float complex); 48 | long double cabsl(long double complex); 49 | double carg(double complex); 50 | float cargf(float complex); 51 | long double cargl(long double complex); 52 | double complex cexp(double complex); 53 | float complex cexpf(float complex); 54 | double cimag(double complex) __pure2; 55 | float cimagf(float complex) __pure2; 56 | long double cimagl(long double complex) __pure2; 57 | double complex conj(double complex) __pure2; 58 | float complex conjf(float complex) __pure2; 59 | long double complex 60 | conjl(long double complex) __pure2; 61 | float complex cprojf(float complex) __pure2; 62 | double complex cproj(double complex) __pure2; 63 | long double complex 64 | cprojl(long double complex) __pure2; 65 | double creal(double complex) __pure2; 66 | float crealf(float complex) __pure2; 67 | long double creall(long double complex) __pure2; 68 | double complex csqrt(double complex); 69 | float complex csqrtf(float complex); 70 | long double complex 71 | csqrtl(long double complex); 72 | 73 | __END_DECLS 74 | 75 | #endif /* _COMPLEX_H */ 76 | -------------------------------------------------------------------------------- /include/cpio.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2002 Mike Barcroft 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/cpio.h 101138 2002-08-01 07:18:38Z mike $ 27 | */ 28 | 29 | #ifndef _CPIO_H_ 30 | #define _CPIO_H_ 31 | 32 | #define C_ISSOCK 0140000 /* Socket. */ 33 | #define C_ISLNK 0120000 /* Symbolic link. */ 34 | #define C_ISCTG 0110000 /* Reserved. */ 35 | #define C_ISREG 0100000 /* Regular file. */ 36 | #define C_ISBLK 0060000 /* Block special. */ 37 | #define C_ISDIR 0040000 /* Directory. */ 38 | #define C_ISCHR 0020000 /* Character special. */ 39 | #define C_ISFIFO 0010000 /* FIFO. */ 40 | #define C_ISUID 0004000 /* Set user ID. */ 41 | #define C_ISGID 0002000 /* Set group ID. */ 42 | #define C_ISVTX 0001000 /* On directories, restricted deletion flag. */ 43 | #define C_IRUSR 0000400 /* Read by owner. */ 44 | #define C_IWUSR 0000200 /* Write by owner. */ 45 | #define C_IXUSR 0000100 /* Execute by owner. */ 46 | #define C_IRGRP 0000040 /* Read by group. */ 47 | #define C_IWGRP 0000020 /* Write by group. */ 48 | #define C_IXGRP 0000010 /* Execute by group. */ 49 | #define C_IROTH 0000004 /* Read by others. */ 50 | #define C_IWOTH 0000002 /* Write by others. */ 51 | #define C_IXOTH 0000001 /* Execute by others. */ 52 | 53 | #define MAGIC "070707" 54 | 55 | #endif /* _CPIO_H_ */ 56 | -------------------------------------------------------------------------------- /include/elf.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2001 David E. O'Brien. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/elf.h 174044 2007-11-28 22:09:12Z jb $ 27 | */ 28 | 29 | /* 30 | * This is a Solaris compatibility header 31 | */ 32 | 33 | #ifndef _ELF_H_ 34 | #define _ELF_H_ 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #endif /* !_ELF_H_ */ 42 | -------------------------------------------------------------------------------- /include/err.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * @(#)err.h 8.1 (Berkeley) 6/2/93 30 | * $FreeBSD: release/9.0.0/include/err.h 203964 2010-02-16 19:39:50Z imp $ 31 | */ 32 | 33 | #ifndef _ERR_H_ 34 | #define _ERR_H_ 35 | 36 | /* 37 | * Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two 38 | * places ( and ), so if we include one 39 | * of them here we may collide with the utility's includes. It's unreasonable 40 | * for utilities to have to include one of them to include err.h, so we get 41 | * __va_list from and use it. 42 | */ 43 | #include 44 | #include 45 | 46 | __BEGIN_DECLS 47 | void err(int, const char *, ...) __dead2 __printf0like(2, 3); 48 | void verr(int, const char *, __va_list) __dead2 __printf0like(2, 0); 49 | void errc(int, int, const char *, ...) __dead2 __printf0like(3, 4); 50 | void verrc(int, int, const char *, __va_list) __dead2 51 | __printf0like(3, 0); 52 | void errx(int, const char *, ...) __dead2 __printf0like(2, 3); 53 | void verrx(int, const char *, __va_list) __dead2 __printf0like(2, 0); 54 | void warn(const char *, ...) __printf0like(1, 2); 55 | void vwarn(const char *, __va_list) __printf0like(1, 0); 56 | void warnc(int, const char *, ...) __printf0like(2, 3); 57 | void vwarnc(int, const char *, __va_list) __printf0like(2, 0); 58 | void warnx(const char *, ...) __printflike(1, 2); 59 | void vwarnx(const char *, __va_list) __printflike(1, 0); 60 | void err_set_file(void *); 61 | void err_set_exit(void (*)(int)); 62 | __END_DECLS 63 | 64 | #endif /* !_ERR_H_ */ 65 | -------------------------------------------------------------------------------- /include/fmtmsg.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2002 Mike Barcroft 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/fmtmsg.h 101390 2002-08-05 16:37:05Z mike $ 27 | */ 28 | 29 | #ifndef _FMTMSG_H_ 30 | #define _FMTMSG_H_ 31 | 32 | /* Source of condition is... */ 33 | #define MM_HARD 0x0001 /* ...hardware. */ 34 | #define MM_SOFT 0x0002 /* ...software. */ 35 | #define MM_FIRM 0x0004 /* ...fireware. */ 36 | 37 | /* Condition detected by... */ 38 | #define MM_APPL 0x0010 /* ...application. */ 39 | #define MM_UTIL 0x0020 /* ...utility. */ 40 | #define MM_OPSYS 0x0040 /* ...operating system. */ 41 | 42 | /* Display on... */ 43 | #define MM_PRINT 0x0100 /* ...standard error. */ 44 | #define MM_CONSOLE 0x0200 /* ...system console. */ 45 | 46 | #define MM_RECOVER 0x1000 /* Recoverable error. */ 47 | #define MM_NRECOV 0x2000 /* Non-recoverable error. */ 48 | 49 | /* Severity levels. */ 50 | #define MM_NOSEV 0 /* No severity level provided. */ 51 | #define MM_HALT 1 /* Error causing application to halt. */ 52 | #define MM_ERROR 2 /* Non-fault fault. */ 53 | #define MM_WARNING 3 /* Unusual non-error condition. */ 54 | #define MM_INFO 4 /* Informative message. */ 55 | 56 | /* Null options. */ 57 | #define MM_NULLLBL (char *)0 58 | #define MM_NULLSEV 0 59 | #define MM_NULLMC 0L 60 | #define MM_NULLTXT (char *)0 61 | #define MM_NULLACT (char *)0 62 | #define MM_NULLTAG (char *)0 63 | 64 | /* Return values. */ 65 | #define MM_OK 0 /* Success. */ 66 | #define MM_NOMSG 1 /* Failed to output to stderr. */ 67 | #define MM_NOCON 2 /* Failed to output to console. */ 68 | #define MM_NOTOK 3 /* Failed to output anything. */ 69 | 70 | int fmtmsg(long, const char *, int, const char *, const char *, 71 | const char *); 72 | 73 | #endif /* !_FMTMSG_H_ */ 74 | -------------------------------------------------------------------------------- /include/fnmatch.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1992, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * $FreeBSD: release/9.0.0/include/fnmatch.h 203964 2010-02-16 19:39:50Z imp $ 30 | * @(#)fnmatch.h 8.1 (Berkeley) 6/2/93 31 | */ 32 | 33 | #ifndef _FNMATCH_H_ 34 | #define _FNMATCH_H_ 35 | 36 | #include 37 | 38 | #define FNM_NOMATCH 1 /* Match failed. */ 39 | 40 | #define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */ 41 | #define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ 42 | #define FNM_PERIOD 0x04 /* Period must be matched by period. */ 43 | 44 | #if __XSI_VISIBLE 45 | #define FNM_NOSYS (-1) /* Reserved. */ 46 | #endif 47 | 48 | #if __BSD_VISIBLE 49 | #define FNM_LEADING_DIR 0x08 /* Ignore / after Imatch. */ 50 | #define FNM_CASEFOLD 0x10 /* Case insensitive search. */ 51 | #define FNM_IGNORECASE FNM_CASEFOLD 52 | #define FNM_FILE_NAME FNM_PATHNAME 53 | #endif 54 | 55 | __BEGIN_DECLS 56 | int fnmatch(const char *, const char *, int); 57 | __END_DECLS 58 | 59 | #endif /* !_FNMATCH_H_ */ 60 | -------------------------------------------------------------------------------- /include/ftps4.h: -------------------------------------------------------------------------------- 1 | #include "resolve.h" 2 | 3 | void ftp_init(const char *ip, unsigned short int port); 4 | void ftp_fini(); -------------------------------------------------------------------------------- /include/ftw.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: ftw.h,v 1.1 2003/07/21 21:13:18 millert Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 2003 Todd C. Miller 5 | * 6 | * Permission to use, copy, modify, and distribute this software for any 7 | * purpose with or without fee is hereby granted, provided that the above 8 | * copyright notice and this permission notice appear in all copies. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | * 18 | * Sponsored in part by the Defense Advanced Research Projects 19 | * Agency (DARPA) and Air Force Research Laboratory, Air Force 20 | * Materiel Command, USAF, under agreement number F39502-99-1-0512. 21 | * 22 | * $FreeBSD: release/9.0.0/include/ftw.h 134244 2004-08-24 13:00:55Z tjr $ 23 | */ 24 | 25 | #ifndef _FTW_H 26 | #define _FTW_H 27 | 28 | #include 29 | #include 30 | 31 | /* 32 | * Valid flags for the 3rd argument to the function that is passed as the 33 | * second argument to ftw(3) and nftw(3). Say it three times fast! 34 | */ 35 | #define FTW_F 0 /* File. */ 36 | #define FTW_D 1 /* Directory. */ 37 | #define FTW_DNR 2 /* Directory without read permission. */ 38 | #define FTW_DP 3 /* Directory with subdirectories visited. */ 39 | #define FTW_NS 4 /* Unknown type; stat() failed. */ 40 | #define FTW_SL 5 /* Symbolic link. */ 41 | #define FTW_SLN 6 /* Sym link that names a nonexistent file. */ 42 | 43 | /* 44 | * Flags for use as the 4th argument to nftw(3). These may be ORed together. 45 | */ 46 | #define FTW_PHYS 0x01 /* Physical walk, don't follow sym links. */ 47 | #define FTW_MOUNT 0x02 /* The walk does not cross a mount point. */ 48 | #define FTW_DEPTH 0x04 /* Subdirs visited before the dir itself. */ 49 | #define FTW_CHDIR 0x08 /* Change to a directory before reading it. */ 50 | 51 | struct FTW { 52 | int base; 53 | int level; 54 | }; 55 | 56 | __BEGIN_DECLS 57 | int ftw(const char *, int (*)(const char *, const struct stat *, int), int); 58 | int nftw(const char *, int (*)(const char *, const struct stat *, int, 59 | struct FTW *), int, int); 60 | __END_DECLS 61 | 62 | #endif /* !_FTW_H */ 63 | -------------------------------------------------------------------------------- /include/inttypes.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2001 Mike Barcroft 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/inttypes.h 205954 2010-03-31 02:12:24Z jmallett $ 27 | */ 28 | 29 | #ifndef _INTTYPES_H_ 30 | #define _INTTYPES_H_ 31 | 32 | #include 33 | #include 34 | 35 | #ifndef __cplusplus 36 | #ifndef _WCHAR_T_DECLARED 37 | typedef __wchar_t wchar_t; 38 | #define _WCHAR_T_DECLARED 39 | #endif 40 | #endif 41 | 42 | typedef struct { 43 | intmax_t quot; /* Quotient. */ 44 | intmax_t rem; /* Remainder. */ 45 | } imaxdiv_t; 46 | 47 | __BEGIN_DECLS 48 | intmax_t imaxabs(intmax_t) __pure2; 49 | imaxdiv_t imaxdiv(intmax_t, intmax_t) __pure2; 50 | 51 | intmax_t strtoimax(const char * __restrict, char ** __restrict, int); 52 | uintmax_t strtoumax(const char * __restrict, char ** __restrict, int); 53 | intmax_t wcstoimax(const wchar_t * __restrict, 54 | wchar_t ** __restrict, int); 55 | uintmax_t wcstoumax(const wchar_t * __restrict, 56 | wchar_t ** __restrict, int); 57 | __END_DECLS 58 | 59 | #endif /* !_INTTYPES_H_ */ 60 | -------------------------------------------------------------------------------- /include/iso646.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1998 Alex Nash 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/iso646.h 226036 2011-10-05 15:50:05Z jkim $ 27 | */ 28 | 29 | #ifndef _ISO646_H_ 30 | #define _ISO646_H_ 31 | 32 | #ifndef __cplusplus 33 | 34 | #define and && 35 | #define and_eq &= 36 | #define bitand & 37 | #define bitor | 38 | #define compl ~ 39 | #define not ! 40 | #define not_eq != 41 | #define or || 42 | #define or_eq |= 43 | #define xor ^ 44 | #define xor_eq ^= 45 | 46 | #endif /* !__cplusplus */ 47 | 48 | #endif /* !_ISO646_H_ */ 49 | -------------------------------------------------------------------------------- /include/libgen.h: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: libgen.h,v 1.4 1999/05/28 22:00:22 espie Exp $ */ 2 | /* $FreeBSD: release/9.0.0/include/libgen.h 197804 2009-10-06 14:05:57Z rwatson $ */ 3 | 4 | /* 5 | * Copyright (c) 1997 Todd C. Miller 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 20 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 21 | * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 23 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 25 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 27 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 28 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef _LIBGEN_H_ 32 | #define _LIBGEN_H_ 33 | 34 | #include 35 | 36 | __BEGIN_DECLS 37 | 38 | char *basename(const char *); 39 | char *basename_r(const char *, char *); 40 | char *dirname(const char *); 41 | #if 0 42 | char *regcmp(const char *, ...); 43 | char *regex(const char *, const char *, ...); 44 | 45 | extern char *__loc1; 46 | #endif 47 | 48 | __END_DECLS 49 | 50 | #endif /* _LIBGEN_H_ */ 51 | -------------------------------------------------------------------------------- /include/link.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1993 Paul Kranenburg 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by Paul Kranenburg. 16 | * 4. The name of the author may not be used to endorse or promote products 17 | * derived from this software without specific prior written permission 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | * $FreeBSD: release/9.0.0/include/link.h 103436 2002-09-17 01:49:00Z peter $ 31 | */ 32 | 33 | #include 34 | -------------------------------------------------------------------------------- /include/locale.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1991, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * @(#)locale.h 8.1 (Berkeley) 6/2/93 30 | * $FreeBSD: release/9.0.0/include/locale.h 203964 2010-02-16 19:39:50Z imp $ 31 | */ 32 | 33 | #ifndef _LOCALE_H_ 34 | #define _LOCALE_H_ 35 | 36 | #include 37 | 38 | struct lconv { 39 | char *decimal_point; 40 | char *thousands_sep; 41 | char *grouping; 42 | char *int_curr_symbol; 43 | char *currency_symbol; 44 | char *mon_decimal_point; 45 | char *mon_thousands_sep; 46 | char *mon_grouping; 47 | char *positive_sign; 48 | char *negative_sign; 49 | char int_frac_digits; 50 | char frac_digits; 51 | char p_cs_precedes; 52 | char p_sep_by_space; 53 | char n_cs_precedes; 54 | char n_sep_by_space; 55 | char p_sign_posn; 56 | char n_sign_posn; 57 | char int_p_cs_precedes; 58 | char int_n_cs_precedes; 59 | char int_p_sep_by_space; 60 | char int_n_sep_by_space; 61 | char int_p_sign_posn; 62 | char int_n_sign_posn; 63 | }; 64 | 65 | #define LC_ALL 0 66 | #define LC_COLLATE 1 67 | #define LC_CTYPE 2 68 | #define LC_MONETARY 3 69 | #define LC_NUMERIC 4 70 | #define LC_TIME 5 71 | #define LC_MESSAGES 6 72 | 73 | #define _LC_LAST 7 /* marks end */ 74 | 75 | #include 76 | 77 | __BEGIN_DECLS 78 | struct lconv *localeconv(void); 79 | char *setlocale(int, const char *); 80 | __END_DECLS 81 | 82 | #endif /* _LOCALE_H_ */ 83 | -------------------------------------------------------------------------------- /include/machine/_align.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * This file is in the public domain. 3 | */ 4 | /* $FreeBSD: release/9.0.0/sys/amd64/include/_align.h 215856 2010-11-26 10:59:20Z tijl $ */ 5 | 6 | #include 7 | -------------------------------------------------------------------------------- /include/machine/_inttypes.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * This file is in the public domain. 3 | */ 4 | /* $FreeBSD: release/9.0.0/sys/amd64/include/_inttypes.h 217157 2011-01-08 18:09:48Z tijl $ */ 5 | 6 | #include 7 | -------------------------------------------------------------------------------- /include/machine/cpu.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990 The Regents of the University of California. 3 | * All rights reserved. 4 | * 5 | * This code is derived from software contributed to Berkeley by 6 | * William Jolitz. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 4. Neither the name of the University nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | * SUCH DAMAGE. 31 | * 32 | * from: @(#)cpu.h 5.4 (Berkeley) 5/9/91 33 | * $FreeBSD: release/9.0.0/sys/amd64/include/cpu.h 219673 2011-03-15 17:19:52Z jkim $ 34 | */ 35 | 36 | #ifndef _MACHINE_CPU_H_ 37 | #define _MACHINE_CPU_H_ 38 | 39 | /* 40 | * Definitions unique to i386 cpu support. 41 | */ 42 | #include 43 | #include 44 | #include 45 | 46 | #define cpu_exec(p) /* nothing */ 47 | #define cpu_swapin(p) /* nothing */ 48 | #define cpu_getstack(td) ((td)->td_frame->tf_rsp) 49 | #define cpu_setstack(td, ap) ((td)->td_frame->tf_rsp = (ap)) 50 | #define cpu_spinwait() ia32_pause() 51 | 52 | #define TRAPF_USERMODE(framep) \ 53 | (ISPL((framep)->tf_cs) == SEL_UPL) 54 | #define TRAPF_PC(framep) ((framep)->tf_rip) 55 | 56 | #ifdef _KERNEL 57 | extern char btext[]; 58 | extern char etext[]; 59 | 60 | void cpu_halt(void); 61 | void cpu_reset(void); 62 | void fork_trampoline(void); 63 | void swi_vm(void *); 64 | 65 | /* 66 | * Return contents of in-cpu fast counter as a sort of "bogo-time" 67 | * for random-harvesting purposes. 68 | */ 69 | static __inline u_int64_t 70 | get_cyclecount(void) 71 | { 72 | 73 | return (rdtsc()); 74 | } 75 | 76 | #endif 77 | 78 | #endif /* !_MACHINE_CPU_H_ */ 79 | -------------------------------------------------------------------------------- /include/machine/frame.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Peter Wemm. 3 | * Copyright (c) 1990 The Regents of the University of California. 4 | * All rights reserved. 5 | * 6 | * This code is derived from software contributed to Berkeley by 7 | * William Jolitz. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 4. Neither the name of the University nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * from: @(#)frame.h 5.2 (Berkeley) 1/18/91 34 | * $FreeBSD: release/9.0.0/sys/amd64/include/frame.h 190620 2009-04-01 13:09:26Z kib $ 35 | */ 36 | 37 | #ifndef _MACHINE_FRAME_H_ 38 | #define _MACHINE_FRAME_H_ 1 39 | 40 | /* 41 | * System stack frames. 42 | */ 43 | 44 | /* 45 | * Exception/Trap Stack Frame 46 | * 47 | * The ordering of this is specifically so that we can take first 6 48 | * the syscall arguments directly from the beginning of the frame. 49 | */ 50 | 51 | struct trapframe { 52 | register_t tf_rdi; 53 | register_t tf_rsi; 54 | register_t tf_rdx; 55 | register_t tf_rcx; 56 | register_t tf_r8; 57 | register_t tf_r9; 58 | register_t tf_rax; 59 | register_t tf_rbx; 60 | register_t tf_rbp; 61 | register_t tf_r10; 62 | register_t tf_r11; 63 | register_t tf_r12; 64 | register_t tf_r13; 65 | register_t tf_r14; 66 | register_t tf_r15; 67 | uint32_t tf_trapno; 68 | uint16_t tf_fs; 69 | uint16_t tf_gs; 70 | register_t tf_addr; 71 | uint32_t tf_flags; 72 | uint16_t tf_es; 73 | uint16_t tf_ds; 74 | /* below portion defined in hardware */ 75 | register_t tf_err; 76 | register_t tf_rip; 77 | register_t tf_cs; 78 | register_t tf_rflags; 79 | register_t tf_rsp; 80 | register_t tf_ss; 81 | }; 82 | 83 | #define TF_HASSEGS 0x1 84 | /* #define _MC_HASBASES 0x2 */ 85 | 86 | #endif /* _MACHINE_FRAME_H_ */ 87 | -------------------------------------------------------------------------------- /include/machine/ptrace.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1992, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 4. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * @(#)ptrace.h 8.1 (Berkeley) 6/11/93 30 | * $FreeBSD: release/9.0.0/sys/amd64/include/ptrace.h 139731 2005-01-05 20:17:21Z imp $ 31 | */ 32 | 33 | #ifndef _MACHINE_PTRACE_H_ 34 | #define _MACHINE_PTRACE_H_ 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/machine/runq.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2001 Jake Burkholder 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/amd64/include/runq.h 139731 2005-01-05 20:17:21Z imp $ 27 | */ 28 | 29 | #ifndef _MACHINE_RUNQ_H_ 30 | #define _MACHINE_RUNQ_H_ 31 | 32 | #define RQB_LEN (1) /* Number of priority status words. */ 33 | #define RQB_L2BPW (6) /* Log2(sizeof(rqb_word_t) * NBBY)). */ 34 | #define RQB_BPW (1<> RQB_L2BPW) 38 | 39 | #define RQB_FFS(word) (bsfq(word)) 40 | 41 | /* 42 | * Type of run queue status word. 43 | */ 44 | typedef u_int64_t rqb_word_t; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /include/machine/setjmp.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1998 John Birrell . 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the author nor the names of any co-contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * $FreeBSD: release/9.0.0/sys/amd64/include/setjmp.h 165967 2007-01-12 07:26:21Z imp $ 30 | */ 31 | 32 | #ifndef _MACHINE_SETJMP_H_ 33 | #define _MACHINE_SETJMP_H_ 34 | 35 | #include 36 | 37 | #define _JBLEN 12 /* Size of the jmp_buf on AMD64. */ 38 | 39 | /* 40 | * jmp_buf and sigjmp_buf are encapsulated in different structs to force 41 | * compile-time diagnostics for mismatches. The structs are the same 42 | * internally to avoid some run-time errors for mismatches. 43 | */ 44 | #if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE 45 | typedef struct _sigjmp_buf { long _sjb[_JBLEN]; } sigjmp_buf[1]; 46 | #endif 47 | 48 | typedef struct _jmp_buf { long _jb[_JBLEN]; } jmp_buf[1]; 49 | 50 | #endif /* !_MACHINE_SETJMP_H_ */ 51 | -------------------------------------------------------------------------------- /include/machine/stdarg.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2002 David E. O'Brien. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 3. Neither the name of the University nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 | * SUCH DAMAGE. 27 | * 28 | * $FreeBSD: release/9.0.0/sys/amd64/include/stdarg.h 162487 2006-09-21 01:37:02Z kan $ 29 | */ 30 | 31 | #ifndef _MACHINE_STDARG_H_ 32 | #define _MACHINE_STDARG_H_ 33 | 34 | #include 35 | #include 36 | 37 | #ifndef _VA_LIST_DECLARED 38 | #define _VA_LIST_DECLARED 39 | typedef __va_list va_list; 40 | #endif 41 | 42 | #ifdef __GNUCLIKE_BUILTIN_STDARG 43 | 44 | #define va_start(ap, last) \ 45 | __builtin_va_start((ap), (last)) 46 | 47 | #define va_arg(ap, type) \ 48 | __builtin_va_arg((ap), type) 49 | 50 | #define __va_copy(dest, src) \ 51 | __builtin_va_copy((dest), (src)) 52 | 53 | #if __ISO_C_VISIBLE >= 1999 54 | #define va_copy(dest, src) \ 55 | __va_copy(dest, src) 56 | #endif 57 | 58 | #define va_end(ap) \ 59 | __builtin_va_end(ap) 60 | 61 | #elif defined(lint) 62 | /* Provide a fake implementation for lint's benefit */ 63 | #define __va_size(type) \ 64 | (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) 65 | #define va_start(ap, last) \ 66 | ((ap) = (va_list)&(last) + __va_size(last)) 67 | #define va_arg(ap, type) \ 68 | (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) 69 | #define va_end(ap) 70 | 71 | #else 72 | #error this file needs to be ported to your compiler 73 | #endif 74 | 75 | #endif /* !_MACHINE_STDARG_H_ */ 76 | -------------------------------------------------------------------------------- /include/machine/vm.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2009 Advanced Computing Technologies LLC 3 | * Written by: John H. Baldwin 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 | * SUCH DAMAGE. 26 | * 27 | * $FreeBSD: release/9.0.0/sys/amd64/include/vm.h 195649 2009-07-12 23:31:20Z alc $ 28 | */ 29 | 30 | #ifndef _MACHINE_VM_H_ 31 | #define _MACHINE_VM_H_ 32 | 33 | #include 34 | 35 | /* Memory attributes. */ 36 | #define VM_MEMATTR_UNCACHEABLE ((vm_memattr_t)PAT_UNCACHEABLE) 37 | #define VM_MEMATTR_WRITE_COMBINING ((vm_memattr_t)PAT_WRITE_COMBINING) 38 | #define VM_MEMATTR_WRITE_THROUGH ((vm_memattr_t)PAT_WRITE_THROUGH) 39 | #define VM_MEMATTR_WRITE_PROTECTED ((vm_memattr_t)PAT_WRITE_PROTECTED) 40 | #define VM_MEMATTR_WRITE_BACK ((vm_memattr_t)PAT_WRITE_BACK) 41 | #define VM_MEMATTR_UNCACHED ((vm_memattr_t)PAT_UNCACHED) 42 | 43 | #define VM_MEMATTR_DEFAULT VM_MEMATTR_WRITE_BACK 44 | 45 | #endif /* !_MACHINE_VM_H_ */ 46 | -------------------------------------------------------------------------------- /include/monetary.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2001 Alexey Zelkin 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/monetary.h 103667 2002-09-20 08:22:48Z mike $ 27 | */ 28 | 29 | #ifndef _MONETARY_H_ 30 | #define _MONETARY_H_ 31 | 32 | #include 33 | #include 34 | 35 | #ifndef _SIZE_T_DECLARED 36 | typedef __size_t size_t; 37 | #define _SIZE_T_DECLARED 38 | #endif 39 | 40 | #ifndef _SSIZE_T_DECLARED 41 | typedef __ssize_t ssize_t; 42 | #define _SSIZE_T_DECLARED 43 | #endif 44 | 45 | __BEGIN_DECLS 46 | ssize_t strfmon(char * __restrict, size_t, const char * __restrict, ...); 47 | __END_DECLS 48 | 49 | #endif /* !_MONETARY_H_ */ 50 | -------------------------------------------------------------------------------- /include/mqueue.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005 David Xu 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/mqueue.h 165828 2007-01-06 11:30:04Z davidxu $ 27 | */ 28 | 29 | #ifndef _MQUEUE_H_ 30 | #define _MQUEUE_H_ 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | struct sigevent; 37 | struct timespec; 38 | 39 | __BEGIN_DECLS 40 | int mq_close(mqd_t); 41 | int mq_getattr(mqd_t, struct mq_attr *); 42 | int mq_notify(mqd_t, const struct sigevent *); 43 | mqd_t mq_open(const char *, int, ...); 44 | ssize_t mq_receive(mqd_t, char *, size_t, unsigned *); 45 | int mq_send(mqd_t, const char *, size_t, unsigned); 46 | int mq_setattr(mqd_t, const struct mq_attr *__restrict, 47 | struct mq_attr *__restrict); 48 | ssize_t mq_timedreceive(mqd_t, char *__restrict, size_t, 49 | unsigned *__restrict, const struct timespec *__restrict); 50 | int mq_timedsend(mqd_t, const char *, size_t, unsigned, 51 | const struct timespec *); 52 | int mq_unlink(const char *); 53 | int __mq_oshandle(mqd_t mqd); 54 | 55 | __END_DECLS 56 | #endif 57 | -------------------------------------------------------------------------------- /include/ndbm.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * This code is derived from software contributed to Berkeley by 6 | * Margo Seltzer. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of the University nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | * SUCH DAMAGE. 31 | * 32 | * @(#)ndbm.h 8.1 (Berkeley) 6/2/93 33 | * $FreeBSD: release/9.0.0/include/ndbm.h 203964 2010-02-16 19:39:50Z imp $ 34 | */ 35 | 36 | #ifndef _NDBM_H_ 37 | #define _NDBM_H_ 38 | 39 | #include 40 | 41 | /* Map dbm interface onto db(3). */ 42 | #define DBM_RDONLY O_RDONLY 43 | 44 | /* Flags to dbm_store(). */ 45 | #define DBM_INSERT 0 46 | #define DBM_REPLACE 1 47 | 48 | /* 49 | * The db(3) support for ndbm always appends this suffix to the 50 | * file name to avoid overwriting the user's original database. 51 | */ 52 | #define DBM_SUFFIX ".db" 53 | 54 | typedef struct { 55 | char *dptr; 56 | int dsize; 57 | } datum; 58 | 59 | typedef DB DBM; 60 | #define dbm_pagfno(a) DBM_PAGFNO_NOT_AVAILABLE 61 | 62 | __BEGIN_DECLS 63 | int dbm_clearerr(DBM *); 64 | void dbm_close(DBM *); 65 | int dbm_delete(DBM *, datum); 66 | int dbm_error(DBM *); 67 | datum dbm_fetch(DBM *, datum); 68 | datum dbm_firstkey(DBM *); 69 | #if __BSD_VISIBLE 70 | long dbm_forder(DBM *, datum); 71 | #endif 72 | datum dbm_nextkey(DBM *); 73 | DBM *dbm_open(const char *, int, int); 74 | int dbm_store(DBM *, datum, datum, int); 75 | #if __BSD_VISIBLE 76 | int dbm_dirfno(DBM *); 77 | #endif 78 | __END_DECLS 79 | 80 | #endif /* !_NDBM_H_ */ 81 | -------------------------------------------------------------------------------- /include/opt_compat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /include/orbis/EGL/eglsce.h: -------------------------------------------------------------------------------- 1 | #ifndef __eglsce_h_ 2 | #define __eglsce_h_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | struct EGLPIGLETMEMORYINFOSCE; 9 | typedef struct EGLPIGLETMEMORYINFOSCE EGLPIGLETMEMORYINFOSCE_t; 10 | 11 | #define EGLMEMORYINFO_t EGLPIGLETMEMORYINFOSCE_t 12 | 13 | #define eglMemoryInfo eglPigletMemoryInfoSCE 14 | 15 | void eglPigletMemoryInfoSCE(EGLPIGLETMEMORYINFOSCE_t* pInfo); 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /include/orbis/GLES2/gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* 5 | ** Copyright (c) 2017 The Khronos Group Inc. 6 | ** 7 | ** Licensed under the Apache License, Version 2.0 (the "License"); 8 | ** you may not use this file except in compliance with the License. 9 | ** You may obtain a copy of the License at 10 | ** 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** 13 | ** Unless required by applicable law or agreed to in writing, software 14 | ** distributed under the License is distributed on an "AS IS" BASIS, 15 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | ** See the License for the specific language governing permissions and 17 | ** limitations under the License. 18 | */ 19 | 20 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 21 | * 22 | * Adopters may modify khrplatform.h and this file to suit their platform. 23 | * Please contribute modifications back to Khronos as pull requests on the 24 | * public github repository: 25 | * https://github.com/KhronosGroup/OpenGL-Registry 26 | */ 27 | 28 | #include 29 | 30 | #ifndef GL_APICALL 31 | #define GL_APICALL KHRONOS_APICALL 32 | #endif 33 | 34 | #ifndef GL_APIENTRY 35 | #define GL_APIENTRY KHRONOS_APIENTRY 36 | #endif 37 | 38 | #endif /* __gl2platform_h_ */ 39 | -------------------------------------------------------------------------------- /include/orbis/GLES2/gl2sce.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2sce_h_ 2 | #define __gl2sce_h_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #define glGetProgramBinary glPigletGetShaderBinarySCE 9 | 10 | #define glTexImageCanvas2D glOrbisTexImageCanvas2DSCE 11 | #define glTexImageResource glOrbisTexImageResourceSCE 12 | 13 | #define glMapTextureResource glOrbisMapTextureResourceSCE 14 | #define glUnmapTextureResource glOrbisUnmapTextureResourceSCE 15 | 16 | void glOrbisTexImageCanvas2DSCE(GLenum target, GLuint uCanvasHandle); 17 | void glOrbisTexImageResourceSCE(GLenum target, const GLvoid* texture_resource_descriptor, GLsizei descriptor_size); 18 | 19 | void glOrbisMapTextureResourceSCE(GLenum target, GLvoid* texture_resource_descriptor, GLsizei* descriptor_size); 20 | void glOrbisUnmapTextureResourceSCE(GLenum target); 21 | 22 | void glPigletGetShaderBinarySCE(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /include/orbis/features.h: -------------------------------------------------------------------------------- 1 | #ifndef _FEATURES_H 2 | #define _FEATURES_H 3 | 4 | #if defined(_ALL_SOURCE) && !defined(_GNU_SOURCE) 5 | #define _GNU_SOURCE 1 6 | #endif 7 | 8 | #if defined(_DEFAULT_SOURCE) && !defined(_BSD_SOURCE) 9 | #define _BSD_SOURCE 1 10 | #endif 11 | 12 | #if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \ 13 | && !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \ 14 | && !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__) 15 | #define _BSD_SOURCE 1 16 | #define _XOPEN_SOURCE 700 17 | #endif 18 | 19 | #if __STDC_VERSION__ >= 199901L 20 | #define __restrict restrict 21 | #elif !defined(__GNUC__) 22 | #define __restrict 23 | #endif 24 | 25 | #if __STDC_VERSION__ >= 199901L || defined(__cplusplus) 26 | #define __inline inline 27 | #elif !defined(__GNUC__) 28 | #define __inline 29 | #endif 30 | 31 | #if __STDC_VERSION__ >= 201112L 32 | #elif defined(__GNUC__) 33 | #define _Noreturn __attribute__((__noreturn__)) 34 | #else 35 | #define _Noreturn 36 | #endif 37 | 38 | #define __REDIR(x,y) __typeof__(x) x __asm__(#y) 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /include/orbis/libSceAudioOut.h: -------------------------------------------------------------------------------- 1 | /* 2 | # ____ ____ ____ ___ ____ ____ _ _ 3 | # | | ____> ____> | | | <____ \ / 4 | # |____| | \ ____> | ___| ____| <____ \_/ ORBISDEV Open Source Project. 5 | #------------------------------------------------------------------------------------ 6 | # Copyright 2010-2020, orbisdev - http://orbisdev.github.io 7 | # Licenced under MIT License 8 | # Review README & LICENSE files for further details. 9 | */ 10 | 11 | #ifndef _ORBIS_AUDIOOUT_H_ 12 | #define _ORBIS_AUDIOOUT_H_ 13 | 14 | 15 | #pragma once 16 | 17 | #include 18 | #include 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | 25 | int sceAudioOutInit(); 26 | int sceAudioOutOpen(SceUserServiceUserId userId,unsigned int channel,int unknown ,unsigned int samples, unsigned int frequency, unsigned int format); 27 | int sceAudioOutClose(int handle); 28 | int sceAudioOutOutput(int handle, void *buf); 29 | int sceAudioOutSetVolume(int handle, int filter, int *value); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/orbis/libSceGnmDriver.h: -------------------------------------------------------------------------------- 1 | /* 2 | # ____ ____ ____ ___ ____ ____ _ _ 3 | # | | ____> ____> | | | <____ \ / 4 | # |____| | \ ____> | ___| ____| <____ \_/ ORBISDEV Open Source Project. 5 | #------------------------------------------------------------------------------------ 6 | # Copyright 2010-2020, orbisdev - http://orbisdev.github.io 7 | # Licenced under MIT License 8 | # Review README & LICENSE files for further details. 9 | */ 10 | 11 | #ifndef _ORBIS_LIBSCEGNMDRIVER_H_ 12 | #define _ORBIS_LIBSCEGNMDRIVER_H_ 13 | 14 | #pragma once 15 | 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | int sceGnmFlushGarlic(); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /include/orbis/libSceIme.h: -------------------------------------------------------------------------------- 1 | /* 2 | # ____ ____ ____ ___ ____ ____ _ _ 3 | # | | ____> ____> | | | <____ \ / 4 | # |____| | \ ____> | ___| ____| <____ \_/ ORBISDEV Open Source Project. 5 | #------------------------------------------------------------------------------------ 6 | # Copyright 2010-2020, orbisdev - http://orbisdev.github.io 7 | # Licenced under MIT License 8 | # Review README & LICENSE files for further details. 9 | */ 10 | 11 | #ifndef _ORBIS_LIBSCEIME_H_ 12 | #define _ORBIS_LIBSCEIME_H_ 13 | 14 | #pragma once 15 | 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /include/orbis/libSceLibcInternal.h: -------------------------------------------------------------------------------- 1 | /* 2 | # ____ ____ ____ ___ ____ ____ _ _ 3 | # | | ____> ____> | | | <____ \ / 4 | # |____| | \ ____> | ___| ____| <____ \_/ ORBISDEV Open Source Project. 5 | #------------------------------------------------------------------------------------ 6 | # Copyright 2010-2020, orbisdev - http://orbisdev.github.io 7 | # Licenced under MIT License 8 | # Review README & LICENSE files for further details. 9 | */ 10 | typedef size_t rsize_t; 11 | typedef void* OrbisMspace; 12 | typedef struct OrbisMallocManagedSize 13 | { 14 | unsigned short sz; 15 | unsigned short ver; 16 | unsigned int reserv; 17 | size_t maxSysSz; 18 | size_t curSysSz; 19 | size_t maxUseSz; 20 | size_t curUseSz; 21 | }OrbisMallocManagedSize; 22 | 23 | OrbisMspace sceLibcMspaceCreate(char *, void *, size_t, unsigned int); 24 | int sceLibcMspaceDestroy(OrbisMspace); 25 | void * sceLibcMspaceMalloc(OrbisMspace, size_t size); 26 | int sceLibcMspaceFree(OrbisMspace, void *); 27 | void * sceLibcMspaceCalloc(OrbisMspace, size_t, size_t); 28 | void * sceLibcMspaceMemalign(OrbisMspace, size_t, size_t); 29 | void * sceLibcMspaceRealloc(OrbisMspace, void *, size_t); 30 | void * sceLibcMspaceReallocalign(OrbisMspace, void *, size_t, size_t); 31 | int sceLibcMspacePosixMemalign(OrbisMspace, void **, size_t, size_t); 32 | int sceLibcMspaceMallocStats(OrbisMspace, OrbisMallocManagedSize *); 33 | int sceLibcMspaceMallocStatsFast(OrbisMspace, OrbisMallocManagedSize *); 34 | size_t sceLibcMspaceMallocUsableSize(void *); 35 | int sceLibcMspaceMspaceisHeapEmpty(OrbisMspace); 36 | int snprintf_s(char *restrict buffer, rsize_t bufsz, const char *restrict format, ...); -------------------------------------------------------------------------------- /include/orbis/libSceNet.h: -------------------------------------------------------------------------------- 1 | /* 2 | # ____ ____ ____ ___ ____ ____ _ _ 3 | # | | ____> ____> | | | <____ \ / 4 | # |____| | \ ____> | ___| ____| <____ \_/ ORBISDEV Open Source Project. 5 | #------------------------------------------------------------------------------------ 6 | # Copyright 2010-2020, orbisdev - http://orbisdev.github.io 7 | # Licenced under MIT License 8 | # Review README & LICENSE files for further details. 9 | */ 10 | 11 | #ifndef _ORBIS_LIBSCENET_H_ 12 | #define _ORBIS_LIBSCENET_H_ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | 25 | 26 | /* useless C / POSIX wrappers */ 27 | char sceNetInetNtop(int af, const void *src, char *dst, int size); 28 | int sceNetAccept(int, struct sockaddr *, unsigned int *); 29 | int sceNetBind(int, struct sockaddr *, int); 30 | int sceNetConnect(int, struct sockaddr *, int); 31 | int sceNetGetsockname(int, struct sockaddr *, unsigned int *); 32 | int sceNetGetsockopt(int s, int level, int optname, void * optval, socklen_t * optlen); 33 | int sceNetInetPton(int af, const char *src, void *dst); 34 | int sceNetListen(int, int); 35 | int sceNetRecv(int, void *, size_t, int); 36 | int sceNetSend(int, const void *, size_t, int); 37 | int sceNetSetsockopt(int s, int level, int optname, const void *optval, socklen_t optlen); 38 | int sceNetSocket(const char *, int, int, int); 39 | int sceNetSocketAbort(int , int ); 40 | int sceNetSocketClose(int); 41 | uint16_t sceNetHtons(uint16_t host16); 42 | uint16_t sceNetNtohs(uint16_t net16); 43 | uint32_t sceNetHtonl(uint32_t host32); 44 | uint32_t sceNetNtohl(uint32_t net32); 45 | uint64_t sceNetHtonll(uint64_t host64); 46 | uint64_t sceNetNtohll(uint64_t net64); 47 | 48 | #define SCE_NET_CTL_SSID_LEN (32 + 1) 49 | #define SCE_NET_CTL_HOSTNAME_LEN (255 + 1) 50 | #define SCE_NET_CTL_AUTH_NAME_LEN (127 + 1) 51 | #define SCE_NET_CTL_IPV4_ADDR_STR_LEN (16) 52 | 53 | #define SCE_NET_ETHER_ADDR_LEN 6 54 | 55 | typedef struct SceNetEtherAddr { 56 | uint8_t data[SCE_NET_ETHER_ADDR_LEN]; 57 | } SceNetEtherAddr; 58 | 59 | typedef union SceNetCtlInfo { 60 | uint32_t device; 61 | SceNetEtherAddr ether_addr; 62 | uint32_t mtu; 63 | uint32_t link; 64 | SceNetEtherAddr bssid; 65 | char ssid[SCE_NET_CTL_SSID_LEN]; 66 | uint32_t wifi_security; 67 | uint8_t rssi_dbm; 68 | uint8_t rssi_percentage; 69 | uint8_t channel; 70 | uint32_t ip_config; 71 | char dhcp_hostname[SCE_NET_CTL_HOSTNAME_LEN]; 72 | char pppoe_auth_name[SCE_NET_CTL_AUTH_NAME_LEN]; 73 | char ip_address[SCE_NET_CTL_IPV4_ADDR_STR_LEN]; 74 | char netmask[SCE_NET_CTL_IPV4_ADDR_STR_LEN]; 75 | char default_route[SCE_NET_CTL_IPV4_ADDR_STR_LEN]; 76 | char primary_dns[SCE_NET_CTL_IPV4_ADDR_STR_LEN]; 77 | char secondary_dns[SCE_NET_CTL_IPV4_ADDR_STR_LEN]; 78 | uint32_t http_proxy_config; 79 | char http_proxy_server[SCE_NET_CTL_HOSTNAME_LEN]; 80 | uint16_t http_proxy_port; 81 | } SceNetCtlInfo; 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /include/orbis/libScePad.h: -------------------------------------------------------------------------------- 1 | /* 2 | # ____ ____ ____ ___ ____ ____ _ _ 3 | # | | ____> ____> | | | <____ \ / 4 | # |____| | \ ____> | ___| ____| <____ \_/ ORBISDEV Open Source Project. 5 | #------------------------------------------------------------------------------------ 6 | # Copyright 2010-2020, orbisdev - http://orbisdev.github.io 7 | # Licenced under MIT License 8 | # Review README & LICENSE files for further details. 9 | */ 10 | 11 | #ifndef _ORBIS_LIBSCEPAD_H_ 12 | #define _ORBIS_LIBSCEPAD_H_ 13 | #pragma once 14 | 15 | #include 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | 23 | 24 | typedef struct vec_float3 25 | { 26 | float x; 27 | float y; 28 | float z; 29 | }vec_float3; 30 | 31 | typedef struct vec_float4 32 | { 33 | float x; 34 | float y; 35 | float z; 36 | float w; 37 | }vec_float4; 38 | 39 | typedef struct ScePadData { 40 | unsigned int buttons; 41 | uint8_t lx; 42 | uint8_t ly; 43 | uint8_t rx; 44 | uint8_t ry; 45 | uint8_t l2; 46 | uint8_t r2; 47 | uint16_t padding; 48 | vec_float4 quat; 49 | vec_float3 vel; 50 | vec_float3 acell; 51 | uint8_t touch[24]; 52 | uint8_t connected; 53 | uint64_t timestamp; 54 | uint8_t ext[16]; 55 | uint8_t count; 56 | uint8_t unknown[15]; 57 | }ScePadData; 58 | 59 | int scePadInit(void); 60 | int scePadOpen(SceUserServiceUserId userId,int type,int index,uint8_t *param); 61 | int scePadClose(int handle); 62 | int scePadRead(int handle, ScePadData *data, int count); 63 | int scePadReadState(int handle, ScePadData *data); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /include/orbis/libScePigletv2VSH.h: -------------------------------------------------------------------------------- 1 | /* 2 | # ____ ____ ____ ___ ____ ____ _ _ 3 | # | | ____> ____> | | | <____ \ / 4 | # |____| | \ ____> | ___| ____| <____ \_/ ORBISDEV Open Source Project. 5 | #------------------------------------------------------------------------------------ 6 | # Copyright 2010-2020, orbisdev - http://orbisdev.github.io 7 | # Licenced under MIT License 8 | # Review README & LICENSE files for further details. 9 | */ 10 | 11 | #ifndef _ORBIS_LIBPIGLET2VSH_H_ 12 | #define _ORBIS_LIBPIGLET2VSH_H_ 13 | #pragma once 14 | 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /include/orbis/libSceSysmodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | # ____ ____ ____ ___ ____ ____ _ _ 3 | # | | ____> ____> | | | <____ \ / 4 | # |____| | \ ____> | ___| ____| <____ \_/ ORBISDEV Open Source Project. 5 | #------------------------------------------------------------------------------------ 6 | # Copyright 2010-2020, orbisdev - http://orbisdev.github.io 7 | # Licenced under MIT License 8 | # Review README & LICENSE files for further details. 9 | */ 10 | 11 | #ifndef _ORBIS_LIBSCESYSMODULE_H_ 12 | #define _ORBIS_LIBSCESYSMODULE_H_ 13 | 14 | #pragma once 15 | 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | int sceSysmoduleIsLoaded(uint16_t id); 23 | int sceSysmoduleLoadModule(uint16_t id); 24 | int sceSysmoduleUnloadModule(uint16_t id); 25 | 26 | #define SCE_SYSMODULE_INTERNAL_SYS_CORE 0x80000004 27 | #define SCE_SYSMODULE_INTERNAL_NETCTL 0x80000009 28 | #define SCE_SYSMODULE_INTERNAL_HTTP 0x8000000A 29 | #define SCE_SYSMODULE_INTERNAL_SSL 0x8000000B 30 | #define SCE_SYSMODULE_INTERNAL_NP_COMMON 0x8000000C 31 | #define SCE_SYSMODULE_INTERNAL_SYSTEM_SERVICE 0x80000010 32 | #define SCE_SYSMODULE_INTERNAL_USER_SERVICE 0x80000011 33 | #define SCE_SYSMODULE_INTERNAL_APPINSTUTIL 0x80000014 34 | #define SCE_SYSMODULE_INTERNAL_NET 0x8000001C 35 | #define SCE_SYSMODULE_INTERNAL_IPMI 0x8000001D 36 | #define SCE_SYSMODULE_INTERNAL_VIDEO_OUT 0x80000022 37 | #define SCE_SYSMODULE_INTERNAL_PAD 0x80000024 38 | #define SCE_SYSMODULE_INTERNAL_AUDIO_OUT 0x80000001 39 | #define SCE_SYSMODULE_INTERNAL_IME 0x80000095 40 | #define SCE_SYSMODULE_INTERNAL_GNM_DRIVER 0x80000052 41 | #define SCE_SYSMODULE_INTERNAL_BGFT 0x8000002A 42 | #define SCE_SYSMODULE_INTERNAL_PRECOMPILED_SHADERS 0x80000064 43 | 44 | int sceSysmoduleLoadModuleInternal(uint32_t id); 45 | int sceSysmoduleUnloadModuleInternal(uint32_t id); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /include/orbis/libSceSystemService.h: -------------------------------------------------------------------------------- 1 | /* 2 | # ____ ____ ____ ___ ____ ____ _ _ 3 | # | | ____> ____> | | | <____ \ / 4 | # |____| | \ ____> | ___| ____| <____ \_/ ORBISDEV Open Source Project. 5 | #------------------------------------------------------------------------------------ 6 | # Copyright 2010-2020, orbisdev - http://orbisdev.github.io 7 | # Licenced under MIT License 8 | # Review README & LICENSE files for further details. 9 | */ 10 | 11 | #ifndef _ORBIS_LIBSCESYSTEMSERVICE_H_ 12 | #define _ORBIS_LIBSCESYSTEMSERVICE_H_ 13 | 14 | #pragma once 15 | 16 | #include 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | int sceSystemServiceHideSplashScreen(); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /include/orbis/libSceUserService.h: -------------------------------------------------------------------------------- 1 | /* 2 | # ____ ____ ____ ___ ____ ____ _ _ 3 | # | | ____> ____> | | | <____ \ / 4 | # |____| | \ ____> | ___| ____| <____ \_/ ORBISDEV Open Source Project. 5 | #------------------------------------------------------------------------------------ 6 | # Copyright 2010-2020, orbisdev - http://orbisdev.github.io 7 | # Licenced under MIT License 8 | # Review README & LICENSE files for further details. 9 | */ 10 | 11 | #ifndef _ORBIS_LIBSCEUSERSERVICE_H_ 12 | #define _ORBIS_LIBSCEUSERSERVICE_H_ 13 | #pragma once 14 | 15 | #include 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | typedef int SceUserServiceUserId; 22 | 23 | int sceUserServiceInitialize(int *params); 24 | int sceUserServiceTerminate(); 25 | int sceUserServiceGetInitialUser(SceUserServiceUserId *userId); 26 | 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /include/orbis/libSceVideoOut.h: -------------------------------------------------------------------------------- 1 | /* 2 | # ____ ____ ____ ___ ____ ____ _ _ 3 | # | | ____> ____> | | | <____ \ / 4 | # |____| | \ ____> | ___| ____| <____ \_/ ORBISDEV Open Source Project. 5 | #------------------------------------------------------------------------------------ 6 | # Copyright 2010-2020, orbisdev - http://orbisdev.github.io 7 | # Licenced under MIT License 8 | # Review README & LICENSE files for further details. 9 | */ 10 | 11 | #ifndef _ORBIS_LIBSCEVIDEOOUT_H_ 12 | #define _ORBIS_LIBSCEVIDEOOUT_H_ 13 | 14 | #pragma once 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | typedef struct SceVideoOutBufferAttribute { 25 | int32_t format; 26 | int32_t tmode; 27 | int32_t aspect; 28 | uint32_t width; 29 | uint32_t height; 30 | uint32_t pixelPitch; 31 | uint64_t reserved[2]; 32 | } SceVideoOutBufferAttribute; 33 | 34 | typedef struct SceVideoOutFlipStatus { 35 | uint64_t num; 36 | uint64_t ptime; 37 | uint64_t stime; 38 | int64_t flipArg; 39 | uint64_t reserved[2]; 40 | int32_t numGpuFlipPending; 41 | int32_t numFlipPending; 42 | int32_t currentBuffer; 43 | uint32_t reserved1; 44 | } SceVideoOutFlipStatus; 45 | 46 | int sceVideoOutOpen(SceUserServiceUserId userId, int type, int index, const void *param); 47 | int sceVideoOutClose(int handle); 48 | int sceVideoOutRegisterBuffers(int handle, int initialIndex, void * const *addr, int numBuf, const SceVideoOutBufferAttribute *attr); 49 | int sceVideoOutUnregisterBuffers(int handle, int indexAttr); 50 | int sceVideoOutSubmitFlip(int handle, int indexBuf, unsigned int flipMode, int64_t flipArg); 51 | void sceVideoOutSetBufferAttribute(SceVideoOutBufferAttribute *attr, unsigned int format, unsigned int tmode,unsigned int aspect, unsigned int width, unsigned int height, unsigned int pixelPitch); 52 | int sceVideoOutSetFlipRate(int handle, int flipRate); 53 | int sceVideoOutAddFlipEvent(SceKernelEqueue eq, int handle, void *data); 54 | int sceVideoOutGetFlipStatus(int handle, SceVideoOutFlipStatus *status); 55 | 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/orbis/piglet.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "prerequisites.h" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #define EGL_EGLEXT_PROTOTYPES 1 18 | 19 | #define GL_GLES_PROTOTYPES 1 20 | #define GL_GLEXT_PROTOTYPES 1 21 | 22 | #define SCE_PGL_MAX_PROCESS_ORDER (2) 23 | 24 | #define SCE_PGL_FLAGS_USE_COMPOSITE_EXT (0x8) 25 | #define SCE_PGL_FLAGS_SKIP_APP_INITIALIZATION (0x10) 26 | #define SCE_PGL_FLAGS_USE_TILED_TEXTURE (0x40) 27 | #define SCE_PGL_FLAGS_USE_FLEXIBLE_MEMORY (0x80) /* should be used with SCE_PGL_FLAGS_USE_COMPOSITE_EXT */ 28 | 29 | #define SCE_PGL_MAX_SYS_SHARED_MEM (0x20000000) 30 | #define SCE_PGL_MAX_VIDEO_SHARED_MEM (0x20000000) 31 | #define SCE_PGL_MAX_VIDEO_PRIV_MEM (0x20000000) 32 | 33 | #define SIZEOF_SCE_PGL_CONFIG 0x88 34 | 35 | TYPE_BEGIN(struct _ScePglConfig, SIZEOF_SCE_PGL_CONFIG); 36 | TYPE_FIELD(uint32_t size, 0x00); 37 | TYPE_FIELD(uint32_t flags, 0x04); 38 | TYPE_FIELD(uint8_t processOrder, 0x08); 39 | TYPE_FIELD(uint32_t unk_0x0C, 0x0C); 40 | TYPE_FIELD(uint32_t unk_0x10, 0x10); 41 | TYPE_FIELD(uint32_t unk_0x14, 0x14); 42 | TYPE_FIELD(uint64_t systemSharedMemorySize, 0x18); 43 | 44 | TYPE_FIELD(uint32_t unk_0x20, 0x20); 45 | TYPE_FIELD(uint32_t unk_0x24, 0x24); 46 | TYPE_FIELD(uint64_t videoSharedMemorySize, 0x28); 47 | TYPE_FIELD(uint64_t maxMappedFlexibleMemory, 0x30); 48 | TYPE_FIELD(uint64_t minFlexibleMemoryChunkSize, 0x38); 49 | 50 | /* TODO: see sceCompositorSetDebugPositionCommand((uint8_t)unk_0x50, (uint16_t)unk_0x48, (uint16_t)unk_0x4C, (uint16_t)unk_0x40, (uint16_t)unk_0x44) */ 51 | TYPE_FIELD(uint32_t dbgPosCmd_0x40, 0x40); 52 | TYPE_FIELD(uint32_t dbgPosCmd_0x44, 0x44); 53 | TYPE_FIELD(uint32_t dbgPosCmd_0x48, 0x48); 54 | TYPE_FIELD(uint32_t dbgPosCmd_0x4C, 0x4C); 55 | TYPE_FIELD(uint8_t dbgPosCmd_0x50, 0x50); 56 | 57 | TYPE_FIELD(uint32_t drawCommandBufferSize, 0x54); 58 | TYPE_FIELD(uint32_t lcueResourceBufferSize, 0x58); 59 | 60 | TYPE_FIELD(uint32_t unk_0x5C, 0x5C); 61 | 62 | TYPE_FIELD(uint64_t unk_0x60, 0x60); 63 | TYPE_FIELD(uint64_t unk_0x68, 0x68); 64 | TYPE_FIELD(uint64_t unk_0x70, 0x70); 65 | TYPE_FIELD(uint64_t unk_0x78, 0x78); 66 | TYPE_END(); 67 | typedef struct _ScePglConfig ScePglConfig; 68 | 69 | bool scePigletSetConfigurationVSH(const ScePglConfig* config); 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | -------------------------------------------------------------------------------- /include/orbis/prerequisites.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | # include 5 | # include 6 | # include 7 | # include 8 | #else 9 | # include 10 | # include 11 | # include 12 | # include 13 | #endif 14 | 15 | #define JOIN_HELPER(x, y) x##y 16 | #define JOIN(x, y) JOIN_HELPER(x, y) 17 | 18 | #define TYPE_PAD(size) char JOIN(_pad_, __COUNTER__)[size] 19 | #define TYPE_VARIADIC_BEGIN(name) name { union { 20 | #define TYPE_BEGIN(name, size) name { union { TYPE_PAD(size) 21 | #define TYPE_END(...) }; } __VA_ARGS__ 22 | #define TYPE_FIELD(field, offset) struct { TYPE_PAD(offset); field; } 23 | 24 | #define TYPE_CHECK_SIZE(name, size) \ 25 | _Static_assert(sizeof(name) == (size), "Size of " #name " != " #size) 26 | 27 | #define TYPE_CHECK_FIELD_OFFSET(name, member, offset) \ 28 | _Static_assert(offsetof(name, member) == (offset), "Offset of " #name "." #member " != " #offset) 29 | 30 | #define TYPE_CHECK_FIELD_SIZE(name, member, size) \ 31 | _Static_assert(sizeof(((name*)0)->member) == (size), "Size of " #name "." #member " != " #size) 32 | 33 | #ifndef ARRAY_SIZE 34 | # define ARRAY_SIZE(ar) (sizeof(ar) / sizeof((ar)[0])) 35 | #endif 36 | 37 | #ifdef __LIB__ 38 | # define DLL_EXPORT __declspec(dllexport) 39 | #else 40 | # define DLL_EXPORT 41 | #endif 42 | -------------------------------------------------------------------------------- /include/orbisdev.h: -------------------------------------------------------------------------------- 1 | /* 2 | # ____ ____ ____ ___ ____ ____ _ _ 3 | # | | ____> ____> | | | <____ \ / 4 | # |____| | \ ____> | ___| ____| <____ \_/ ORBISDEV Open Source Project. 5 | #------------------------------------------------------------------------------------ 6 | # Copyright 2010-2020, orbisdev - http://orbisdev.github.io 7 | # Licenced under MIT license 8 | # Review README & LICENSE files for further details. 9 | */ 10 | 11 | #ifndef _ORBISDEV_H_ 12 | #define _ORBISDEV_H_ 13 | #pragma once 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/osreldate.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1992-2012 The FreeBSD Project. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | */ 27 | 28 | #ifdef _KERNEL 29 | #error " cannot be used in the kernel, use " 30 | #else 31 | #undef __FreeBSD_version 32 | #define __FreeBSD_version 900044 33 | #endif 34 | -------------------------------------------------------------------------------- /include/ps4sdk.h: -------------------------------------------------------------------------------- 1 | /* 2 | # ____ ____ ____ ___ ____ ____ _ _ 3 | # | | ____> ____> | | | <____ \ / 4 | # |____| | \ ____> | ___| ____| <____ \_/ ORBISDEV Open Source Project. 5 | #------------------------------------------------------------------------------------ 6 | # Copyright 2010-2020, orbisdev - http://orbisdev.github.io 7 | # Licenced under XXXXXXXX 8 | # Review README & LICENSE files for further details. 9 | */ 10 | 11 | #ifndef _PS4SDK_H_ 12 | #define _PS4SDK_H_ 13 | #pragma once 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/search.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Written by J.T. Conklin 3 | * Public domain. 4 | * 5 | * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ 6 | * $FreeBSD: release/9.0.0/include/search.h 105250 2002-10-16 14:29:23Z robert $ 7 | */ 8 | 9 | #ifndef _SEARCH_H_ 10 | #define _SEARCH_H_ 11 | 12 | #include 13 | #include 14 | 15 | #ifndef _SIZE_T_DECLARED 16 | typedef __size_t size_t; 17 | #define _SIZE_T_DECLARED 18 | #endif 19 | 20 | typedef struct entry { 21 | char *key; 22 | void *data; 23 | } ENTRY; 24 | 25 | typedef enum { 26 | FIND, ENTER 27 | } ACTION; 28 | 29 | typedef enum { 30 | preorder, 31 | postorder, 32 | endorder, 33 | leaf 34 | } VISIT; 35 | 36 | #ifdef _SEARCH_PRIVATE 37 | typedef struct node { 38 | char *key; 39 | struct node *llink, *rlink; 40 | } node_t; 41 | 42 | struct que_elem { 43 | struct que_elem *next; 44 | struct que_elem *prev; 45 | }; 46 | #endif 47 | 48 | __BEGIN_DECLS 49 | int hcreate(size_t); 50 | void hdestroy(void); 51 | ENTRY *hsearch(ENTRY, ACTION); 52 | void insque(void *, void *); 53 | void *lfind(const void *, const void *, size_t *, size_t, 54 | int (*)(const void *, const void *)); 55 | void *lsearch(const void *, void *, size_t *, size_t, 56 | int (*)(const void *, const void *)); 57 | void remque(void *); 58 | void *tdelete(const void * __restrict, void ** __restrict, 59 | int (*)(const void *, const void *)); 60 | void *tfind(const void *, void * const *, 61 | int (*)(const void *, const void *)); 62 | void *tsearch(const void *, void **, int (*)(const void *, const void *)); 63 | void twalk(const void *, void (*)(const void *, VISIT, int)); 64 | __END_DECLS 65 | 66 | #endif /* !_SEARCH_H_ */ 67 | -------------------------------------------------------------------------------- /include/semaphore.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 David Xu 3 | * 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice unmodified, this list of conditions, and the following 11 | * disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | * 27 | * $FreeBSD: release/9.0.0/include/semaphore.h 201546 2010-01-05 02:37:59Z davidxu $ 28 | */ 29 | 30 | /* semaphore.h: POSIX 1003.1b semaphores */ 31 | 32 | #ifndef _SEMAPHORE_H_ 33 | #define _SEMAPHORE_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | struct _sem { 40 | __uint32_t _magic; 41 | struct _usem _kern; 42 | }; 43 | 44 | typedef struct _sem sem_t; 45 | 46 | #define SEM_FAILED ((sem_t *)0) 47 | #define SEM_VALUE_MAX __INT_MAX 48 | 49 | struct timespec; 50 | 51 | __BEGIN_DECLS 52 | int sem_close(sem_t *); 53 | int sem_destroy(sem_t *); 54 | int sem_getvalue(sem_t * __restrict, int * __restrict); 55 | int sem_init(sem_t *, int, unsigned int); 56 | sem_t *sem_open(const char *, int, ...); 57 | int sem_post(sem_t *); 58 | int sem_timedwait(sem_t * __restrict, const struct timespec * __restrict); 59 | int sem_trywait(sem_t *); 60 | int sem_unlink(const char *); 61 | int sem_wait(sem_t *); 62 | __END_DECLS 63 | 64 | #endif /* !_SEMAPHORE_H_ */ 65 | -------------------------------------------------------------------------------- /include/setjmp.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * (c) UNIX System Laboratories, Inc. 5 | * All or some portions of this file are derived from material licensed 6 | * to the University of California by American Telephone and Telegraph 7 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 | * the permission of UNIX System Laboratories, Inc. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 3. Neither the name of the University nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 | * SUCH DAMAGE. 33 | * 34 | * @(#)setjmp.h 8.2 (Berkeley) 1/21/94 35 | * $FreeBSD: release/9.0.0/include/setjmp.h 203964 2010-02-16 19:39:50Z imp $ 36 | */ 37 | 38 | #ifndef _SETJMP_H_ 39 | #define _SETJMP_H_ 40 | 41 | #include 42 | 43 | /* The size of the jmp_buf is machine dependent: */ 44 | #include 45 | 46 | __BEGIN_DECLS 47 | #if __BSD_VISIBLE || __XSI_VISIBLE >= 600 48 | void _longjmp(jmp_buf, int) __dead2; 49 | int _setjmp(jmp_buf); 50 | #endif 51 | void longjmp(jmp_buf, int) __dead2; 52 | #if __BSD_VISIBLE 53 | void longjmperror(void); 54 | #endif 55 | int setjmp(jmp_buf); 56 | #if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE 57 | void siglongjmp(sigjmp_buf, int) __dead2; 58 | int sigsetjmp(sigjmp_buf, int); 59 | #endif 60 | __END_DECLS 61 | 62 | #endif /* !_SETJMP_H_ */ 63 | -------------------------------------------------------------------------------- /include/stdarg.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2002 David E. O'Brien. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 3. Neither the name of the University nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 | * SUCH DAMAGE. 27 | * 28 | * $FreeBSD: release/9.0.0/sys/amd64/include/stdarg.h 162487 2006-09-21 01:37:02Z kan $ 29 | */ 30 | 31 | #ifndef _MACHINE_STDARG_H_ 32 | #define _MACHINE_STDARG_H_ 33 | 34 | #include 35 | #include 36 | 37 | #ifndef _VA_LIST_DECLARED 38 | #define _VA_LIST_DECLARED 39 | typedef __va_list va_list; 40 | #endif 41 | 42 | #ifdef __GNUCLIKE_BUILTIN_STDARG 43 | 44 | #define va_start(ap, last) \ 45 | __builtin_va_start((ap), (last)) 46 | 47 | #define va_arg(ap, type) \ 48 | __builtin_va_arg((ap), type) 49 | 50 | #define __va_copy(dest, src) \ 51 | __builtin_va_copy((dest), (src)) 52 | 53 | #if __ISO_C_VISIBLE >= 1999 54 | #define va_copy(dest, src) \ 55 | __va_copy(dest, src) 56 | #endif 57 | 58 | #define va_end(ap) \ 59 | __builtin_va_end(ap) 60 | 61 | #elif defined(lint) 62 | /* Provide a fake implementation for lint's benefit */ 63 | #define __va_size(type) \ 64 | (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) 65 | #define va_start(ap, last) \ 66 | ((ap) = (va_list)&(last) + __va_size(last)) 67 | #define va_arg(ap, type) \ 68 | (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) 69 | #define va_end(ap) 70 | 71 | #else 72 | #error this file needs to be ported to your compiler 73 | #endif 74 | 75 | #endif /* !_MACHINE_STDARG_H_ */ 76 | -------------------------------------------------------------------------------- /include/stdbool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000 Jeroen Ruigrok van der Werven 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/stdbool.h 142088 2005-02-19 13:47:33Z marius $ 27 | */ 28 | 29 | #ifndef _STDBOOL_H_ 30 | #define _STDBOOL_H_ 31 | 32 | #define __bool_true_false_are_defined 1 33 | 34 | #ifndef __cplusplus 35 | 36 | #define false 0 37 | #define true 1 38 | 39 | #define bool _Bool 40 | #if __STDC_VERSION__ < 199901L && __GNUC__ < 3 && !defined(__INTEL_COMPILER) 41 | typedef int _Bool; 42 | #endif 43 | 44 | #endif /* !__cplusplus */ 45 | 46 | #endif /* !_STDBOOL_H_ */ 47 | -------------------------------------------------------------------------------- /include/stddef.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * @(#)stddef.h 8.1 (Berkeley) 6/2/93 30 | * 31 | * $FreeBSD: release/9.0.0/include/stddef.h 203964 2010-02-16 19:39:50Z imp $ 32 | */ 33 | 34 | #ifndef _STDDEF_H_ 35 | #define _STDDEF_H_ 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | typedef __ptrdiff_t ptrdiff_t; 42 | 43 | #if __BSD_VISIBLE 44 | #ifndef _RUNE_T_DECLARED 45 | typedef __rune_t rune_t; 46 | #define _RUNE_T_DECLARED 47 | #endif 48 | #endif 49 | 50 | #ifndef _SIZE_T_DECLARED 51 | typedef __size_t size_t; 52 | #define _SIZE_T_DECLARED 53 | #endif 54 | 55 | #ifndef __cplusplus 56 | #ifndef _WCHAR_T_DECLARED 57 | typedef __wchar_t wchar_t; 58 | #define _WCHAR_T_DECLARED 59 | #endif 60 | #endif 61 | 62 | #define offsetof(type, member) __offsetof(type, member) 63 | 64 | #endif /* _STDDEF_H_ */ 65 | -------------------------------------------------------------------------------- /include/stdint.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2001 Mike Barcroft 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/stdint.h 221502 2011-05-05 14:45:24Z obrien $ 27 | */ 28 | 29 | #ifndef _SYS_STDINT_H_ 30 | #define _SYS_STDINT_H_ 31 | 32 | #include 33 | #include 34 | 35 | #include 36 | #include 37 | 38 | typedef __int_least8_t int_least8_t; 39 | typedef __int_least16_t int_least16_t; 40 | typedef __int_least32_t int_least32_t; 41 | typedef __int_least64_t int_least64_t; 42 | 43 | typedef __uint_least8_t uint_least8_t; 44 | typedef __uint_least16_t uint_least16_t; 45 | typedef __uint_least32_t uint_least32_t; 46 | typedef __uint_least64_t uint_least64_t; 47 | 48 | typedef __int_fast8_t int_fast8_t; 49 | typedef __int_fast16_t int_fast16_t; 50 | typedef __int_fast32_t int_fast32_t; 51 | typedef __int_fast64_t int_fast64_t; 52 | 53 | typedef __uint_fast8_t uint_fast8_t; 54 | typedef __uint_fast16_t uint_fast16_t; 55 | typedef __uint_fast32_t uint_fast32_t; 56 | typedef __uint_fast64_t uint_fast64_t; 57 | 58 | #ifndef _INTMAX_T_DECLARED 59 | typedef __intmax_t intmax_t; 60 | #define _INTMAX_T_DECLARED 61 | #endif 62 | #ifndef _UINTMAX_T_DECLARED 63 | typedef __uintmax_t uintmax_t; 64 | #define _UINTMAX_T_DECLARED 65 | #endif 66 | 67 | #endif /* !_SYS_STDINT_H_ */ 68 | -------------------------------------------------------------------------------- /include/strings.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2002 Mike Barcroft 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/strings.h 201525 2010-01-04 18:46:54Z ed $ 27 | */ 28 | 29 | #ifndef _STRINGS_H_ 30 | #define _STRINGS_H_ 31 | 32 | #include 33 | #include 34 | 35 | #ifndef _SIZE_T_DECLARED 36 | typedef __size_t size_t; 37 | #define _SIZE_T_DECLARED 38 | #endif 39 | 40 | __BEGIN_DECLS 41 | #if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112 42 | int bcmp(const void *, const void *, size_t) __pure; /* LEGACY */ 43 | void bcopy(const void *, void *, size_t); /* LEGACY */ 44 | void bzero(void *, size_t); /* LEGACY */ 45 | #endif 46 | #if __XSI_VISIBLE 47 | int ffs(int) __pure2; 48 | #endif 49 | #if __BSD_VISIBLE 50 | int ffsl(long) __pure2; 51 | int ffsll(long long) __pure2; 52 | int fls(int) __pure2; 53 | int flsl(long) __pure2; 54 | int flsll(long long) __pure2; 55 | #endif 56 | #if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112 57 | char *index(const char *, int) __pure; /* LEGACY */ 58 | char *rindex(const char *, int) __pure; /* LEGACY */ 59 | #endif 60 | int strcasecmp(const char *, const char *) __pure; 61 | int strncasecmp(const char *, const char *, size_t) __pure; 62 | __END_DECLS 63 | 64 | #endif /* _STRINGS_H_ */ 65 | -------------------------------------------------------------------------------- /include/sys/_callout.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * (c) UNIX System Laboratories, Inc. 5 | * All or some portions of this file are derived from material licensed 6 | * to the University of California by American Telephone and Telegraph 7 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 | * the permission of UNIX System Laboratories, Inc. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 4. Neither the name of the University nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 | * SUCH DAMAGE. 33 | * 34 | * @(#)callout.h 8.2 (Berkeley) 1/21/94 35 | * $FreeBSD: release/9.0.0/sys/sys/_callout.h 221059 2011-04-26 11:39:56Z kib $ 36 | */ 37 | 38 | #ifndef _SYS__CALLOUT_H 39 | #define _SYS__CALLOUT_H 40 | 41 | #include 42 | 43 | struct lock_object; 44 | 45 | SLIST_HEAD(callout_list, callout); 46 | TAILQ_HEAD(callout_tailq, callout); 47 | 48 | struct callout { 49 | union { 50 | SLIST_ENTRY(callout) sle; 51 | TAILQ_ENTRY(callout) tqe; 52 | } c_links; 53 | int c_time; /* ticks to the event */ 54 | void *c_arg; /* function argument */ 55 | void (*c_func)(void *); /* function to call */ 56 | struct lock_object *c_lock; /* lock to handle */ 57 | int c_flags; /* state of this entry */ 58 | volatile int c_cpu; /* CPU we're scheduled on */ 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/sys/_cpuset.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2008, Jeffrey Roberson 3 | * All rights reserved. 4 | * 5 | * Copyright (c) 2008 Nokia Corporation 6 | * All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice unmodified, this list of conditions, and the following 13 | * disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * $FreeBSD: release/9.0.0/sys/sys/_cpuset.h 222813 2011-06-07 08:46:13Z attilio $ 30 | */ 31 | 32 | #ifndef _SYS__CPUSET_H_ 33 | #define _SYS__CPUSET_H_ 34 | 35 | #ifdef _KERNEL 36 | #define CPU_SETSIZE MAXCPU 37 | #endif 38 | 39 | #define CPU_MAXSIZE 128 40 | 41 | #ifndef CPU_SETSIZE 42 | #define CPU_SETSIZE CPU_MAXSIZE 43 | #endif 44 | 45 | #define _NCPUBITS (sizeof(long) * NBBY) /* bits per mask */ 46 | #define _NCPUWORDS howmany(CPU_SETSIZE, _NCPUBITS) 47 | 48 | typedef struct _cpuset { 49 | long __bits[howmany(CPU_SETSIZE, _NCPUBITS)]; 50 | } cpuset_t; 51 | 52 | #endif /* !_SYS__CPUSET_H_ */ 53 | -------------------------------------------------------------------------------- /include/sys/_iovec.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1982, 1986, 1993, 1994 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 4. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * @(#)uio.h 8.5 (Berkeley) 2/22/94 30 | * $FreeBSD: release/9.0.0/sys/sys/_iovec.h 139825 2005-01-07 02:29:27Z imp $ 31 | */ 32 | 33 | #ifndef _SYS__IOVEC_H_ 34 | #define _SYS__IOVEC_H_ 35 | 36 | #include 37 | 38 | #ifndef _SIZE_T_DECLARED 39 | typedef __size_t size_t; 40 | #define _SIZE_T_DECLARED 41 | #endif 42 | 43 | struct iovec { 44 | void *iov_base; /* Base address. */ 45 | size_t iov_len; /* Length. */ 46 | }; 47 | 48 | #endif /* !_SYS__IOVEC_H_ */ 49 | -------------------------------------------------------------------------------- /include/sys/_lock.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 3. Berkeley Software Design Inc's name may not be used to endorse or 13 | * promote products derived from this software without specific prior 14 | * written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN INC ``AS IS'' AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN INC BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 | * SUCH DAMAGE. 27 | * 28 | * $FreeBSD: release/9.0.0/sys/sys/_lock.h 179025 2008-05-15 20:10:06Z attilio $ 29 | */ 30 | 31 | #ifndef _SYS__LOCK_H_ 32 | #define _SYS__LOCK_H_ 33 | 34 | struct lock_object { 35 | const char *lo_name; /* Individual lock name. */ 36 | u_int lo_flags; 37 | u_int lo_data; /* General class specific data. */ 38 | struct witness *lo_witness; /* Data for witness. */ 39 | }; 40 | 41 | #endif /* !_SYS__LOCK_H_ */ 42 | -------------------------------------------------------------------------------- /include/sys/_lockmgr.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2008 Attilio Rao 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice(s), this list of conditions and the following disclaimer as 10 | * the first lines of this file unmodified other than the possible 11 | * addition of one or more copyright notices. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice(s), this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 26 | * DAMAGE. 27 | * 28 | * $FreeBSD: release/9.0.0/sys/sys/_lockmgr.h 200447 2009-12-12 21:31:07Z attilio $ 29 | */ 30 | 31 | #ifndef _SYS__LOCKMGR_H_ 32 | #define _SYS__LOCKMGR_H_ 33 | 34 | #ifdef DEBUG_LOCKS 35 | #include 36 | #endif 37 | 38 | struct lock { 39 | struct lock_object lock_object; 40 | volatile uintptr_t lk_lock; 41 | u_int lk_exslpfail; 42 | int lk_timo; 43 | int lk_pri; 44 | #ifdef DEBUG_LOCKS 45 | struct stack lk_stack; 46 | #endif 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /include/sys/_mutex.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 3. Berkeley Software Design Inc's name may not be used to endorse or 13 | * promote products derived from this software without specific prior 14 | * written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY BERKELEY SOFTWARE DESIGN INC ``AS IS'' AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL BERKELEY SOFTWARE DESIGN INC BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 | * SUCH DAMAGE. 27 | * 28 | * $FreeBSD: release/9.0.0/sys/sys/_mutex.h 179025 2008-05-15 20:10:06Z attilio $ 29 | */ 30 | 31 | #ifndef _SYS__MUTEX_H_ 32 | #define _SYS__MUTEX_H_ 33 | 34 | /* 35 | * Sleep/spin mutex. 36 | */ 37 | struct mtx { 38 | struct lock_object lock_object; /* Common lock properties. */ 39 | volatile uintptr_t mtx_lock; /* Owner and flags. */ 40 | }; 41 | 42 | #endif /* !_SYS__MUTEX_H_ */ 43 | -------------------------------------------------------------------------------- /include/sys/_null.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2003 Marcel Moolenaar 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/_null.h 192002 2009-05-11 21:13:00Z jhb $ 27 | */ 28 | 29 | #ifndef NULL 30 | 31 | #if !defined(__cplusplus) 32 | #define NULL ((void *)0) 33 | #else 34 | #if defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4 35 | #define NULL __null 36 | #else 37 | #if defined(__LP64__) 38 | #define NULL (0L) 39 | #else 40 | #define NULL 0 41 | #endif /* __LP64__ */ 42 | #endif /* __GNUG__ */ 43 | #endif /* !__cplusplus */ 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /include/sys/_rwlock.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 John Baldwin 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the author nor the names of any co-contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * $FreeBSD: release/9.0.0/sys/sys/_rwlock.h 179025 2008-05-15 20:10:06Z attilio $ 30 | */ 31 | 32 | #ifndef _SYS__RWLOCK_H_ 33 | #define _SYS__RWLOCK_H_ 34 | 35 | /* 36 | * Reader/writer lock. 37 | */ 38 | struct rwlock { 39 | struct lock_object lock_object; 40 | volatile uintptr_t rw_lock; 41 | }; 42 | 43 | #endif /* !_SYS__RWLOCK_H_ */ 44 | -------------------------------------------------------------------------------- /include/sys/_semaphore.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2002 Alfred Perlstein 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/_semaphore.h 201546 2010-01-05 02:37:59Z davidxu $ 27 | */ 28 | #ifndef __SEMAPHORE_H_ 29 | #define __SEMAPHORE_H_ 30 | 31 | typedef intptr_t semid_t; 32 | struct timespec; 33 | 34 | #define SEM_VALUE_MAX __INT_MAX 35 | 36 | #ifndef _KERNEL 37 | 38 | __BEGIN_DECLS 39 | 40 | int ksem_close(semid_t id); 41 | int ksem_post(semid_t id); 42 | int ksem_wait(semid_t id); 43 | int ksem_trywait(semid_t id); 44 | int ksem_timedwait(semid_t id, const struct timespec *abstime); 45 | int ksem_init(semid_t *idp, unsigned int value); 46 | int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode, 47 | unsigned int value); 48 | int ksem_unlink(const char *name); 49 | int ksem_getvalue(semid_t id, int *val); 50 | int ksem_destroy(semid_t id); 51 | 52 | __END_DECLS 53 | 54 | #endif /* !_KERNEL */ 55 | 56 | #endif /* __SEMAPHORE_H_ */ 57 | -------------------------------------------------------------------------------- /include/sys/_sigset.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * (c) UNIX System Laboratories, Inc. 5 | * All or some portions of this file are derived from material licensed 6 | * to the University of California by American Telephone and Telegraph 7 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 | * the permission of UNIX System Laboratories, Inc. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 4. Neither the name of the University nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 | * SUCH DAMAGE. 33 | * 34 | * @(#)signal.h 8.4 (Berkeley) 5/4/95 35 | * $FreeBSD: release/9.0.0/sys/sys/_sigset.h 139825 2005-01-07 02:29:27Z imp $ 36 | */ 37 | 38 | #ifndef _SYS__SIGSET_H_ 39 | #define _SYS__SIGSET_H_ 40 | 41 | /* 42 | * sigset_t macros. 43 | */ 44 | #define _SIG_WORDS 4 45 | #define _SIG_MAXSIG 128 46 | #define _SIG_IDX(sig) ((sig) - 1) 47 | #define _SIG_WORD(sig) (_SIG_IDX(sig) >> 5) 48 | #define _SIG_BIT(sig) (1 << (_SIG_IDX(sig) & 31)) 49 | #define _SIG_VALID(sig) ((sig) <= _SIG_MAXSIG && (sig) > 0) 50 | 51 | typedef struct __sigset { 52 | __uint32_t __bits[_SIG_WORDS]; 53 | } __sigset_t; 54 | 55 | #if defined(_KERNEL) && defined(COMPAT_43) 56 | typedef unsigned int osigset_t; 57 | #endif 58 | 59 | #endif /* !_SYS__SIGSET_H_ */ 60 | -------------------------------------------------------------------------------- /include/sys/_sockaddr_storage.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1982, 1985, 1986, 1988, 1993, 1994 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 4. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * @(#)socket.h 8.4 (Berkeley) 2/21/94 30 | * $FreeBSD: release/9.0.0/sys/sys/_sockaddr_storage.h 196967 2009-09-08 10:39:38Z phk $ 31 | */ 32 | 33 | #ifndef _SYS__SOCKADDR_STORAGE_H_ 34 | #define _SYS__SOCKADDR_STORAGE_H_ 35 | 36 | /* 37 | * RFC 2553: protocol-independent placeholder for socket addresses 38 | */ 39 | #define _SS_MAXSIZE 128U 40 | #define _SS_ALIGNSIZE (sizeof(__int64_t)) 41 | #define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(unsigned char) - \ 42 | sizeof(sa_family_t)) 43 | #define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(unsigned char) - \ 44 | sizeof(sa_family_t) - _SS_PAD1SIZE - _SS_ALIGNSIZE) 45 | 46 | struct sockaddr_storage { 47 | unsigned char ss_len; /* address length */ 48 | sa_family_t ss_family; /* address family */ 49 | char __ss_pad1[_SS_PAD1SIZE]; 50 | __int64_t __ss_align; /* force desired struct alignment */ 51 | char __ss_pad2[_SS_PAD2SIZE]; 52 | }; 53 | 54 | #endif /* !_SYS__SOCKADDR_STORAGE_H_ */ 55 | -------------------------------------------------------------------------------- /include/sys/_stack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005 Antoine Brodin 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/_stack.h 177957 2008-04-06 20:08:51Z attilio $ 27 | */ 28 | 29 | #ifndef _SYS__STACK_H_ 30 | #define _SYS__STACK_H_ 31 | 32 | #define STACK_MAX 18 /* Don't change, stack_ktr relies on this. */ 33 | 34 | struct stack { 35 | int depth; 36 | vm_offset_t pcs[STACK_MAX]; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /include/sys/_stdint.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2011 David E. O'Brien 3 | * Copyright (c) 2001 Mike Barcroft 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 | * SUCH DAMAGE. 26 | * 27 | * $FreeBSD: release/9.0.0/sys/sys/_stdint.h 222813 2011-06-07 08:46:13Z attilio $ 28 | */ 29 | 30 | #ifndef _SYS__STDINT_H_ 31 | #define _SYS__STDINT_H_ 32 | 33 | #ifndef _INT8_T_DECLARED 34 | typedef __int8_t int8_t; 35 | #define _INT8_T_DECLARED 36 | #endif 37 | 38 | #ifndef _INT16_T_DECLARED 39 | typedef __int16_t int16_t; 40 | #define _INT16_T_DECLARED 41 | #endif 42 | 43 | #ifndef _INT32_T_DECLARED 44 | typedef __int32_t int32_t; 45 | #define _INT32_T_DECLARED 46 | #endif 47 | 48 | #ifndef _INT64_T_DECLARED 49 | typedef __int64_t int64_t; 50 | #define _INT64_T_DECLARED 51 | #endif 52 | 53 | #ifndef _UINT8_T_DECLARED 54 | typedef __uint8_t uint8_t; 55 | #define _UINT8_T_DECLARED 56 | #endif 57 | 58 | #ifndef _UINT16_T_DECLARED 59 | typedef __uint16_t uint16_t; 60 | #define _UINT16_T_DECLARED 61 | #endif 62 | 63 | #ifndef _UINT32_T_DECLARED 64 | typedef __uint32_t uint32_t; 65 | #define _UINT32_T_DECLARED 66 | #endif 67 | 68 | #ifndef _UINT64_T_DECLARED 69 | typedef __uint64_t uint64_t; 70 | #define _UINT64_T_DECLARED 71 | #endif 72 | 73 | #ifndef _INTPTR_T_DECLARED 74 | typedef __intptr_t intptr_t; 75 | #define _INTPTR_T_DECLARED 76 | #endif 77 | #ifndef _UINTPTR_T_DECLARED 78 | typedef __uintptr_t uintptr_t; 79 | #define _UINTPTR_T_DECLARED 80 | #endif 81 | 82 | #endif /* !_SYS__STDINT_H_ */ 83 | -------------------------------------------------------------------------------- /include/sys/_sx.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2007 Attilio Rao 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice(s), this list of conditions and the following disclaimer as 10 | * the first lines of this file unmodified other than the possible 11 | * addition of one or more copyright notices. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice(s), this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 26 | * DAMAGE. 27 | * 28 | * $FreeBSD: release/9.0.0/sys/sys/_sx.h 179025 2008-05-15 20:10:06Z attilio $ 29 | */ 30 | 31 | #ifndef _SYS__SX_H_ 32 | #define _SYS__SX_H_ 33 | 34 | /* 35 | * Shared/exclusive lock main structure definition. 36 | */ 37 | struct sx { 38 | struct lock_object lock_object; 39 | volatile uintptr_t sx_lock; 40 | }; 41 | 42 | #endif /* !_SYS__SX_H_ */ 43 | -------------------------------------------------------------------------------- /include/sys/_task.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2000 Doug Rabson 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/_task.h 213813 2010-10-13 22:59:04Z mdf $ 27 | */ 28 | 29 | #ifndef _SYS__TASK_H_ 30 | #define _SYS__TASK_H_ 31 | 32 | #include 33 | 34 | /* 35 | * Each task includes a function which is called from 36 | * taskqueue_run(). The first argument is taken from the 'ta_context' 37 | * field of struct task and the second argument is a count of how many 38 | * times the task was enqueued before the call to taskqueue_run(). 39 | * 40 | * List of locks 41 | * (c) const after init 42 | * (q) taskqueue lock 43 | */ 44 | typedef void task_fn_t(void *context, int pending); 45 | 46 | struct task { 47 | STAILQ_ENTRY(task) ta_link; /* (q) link for queue */ 48 | u_short ta_pending; /* (q) count times queued */ 49 | u_short ta_priority; /* (c) Priority */ 50 | task_fn_t *ta_func; /* (c) task handler */ 51 | void *ta_context; /* (c) argument for handler */ 52 | }; 53 | 54 | #endif /* !_SYS__TASK_H_ */ 55 | -------------------------------------------------------------------------------- /include/sys/_timespec.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1982, 1986, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 4. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * @(#)time.h 8.5 (Berkeley) 5/4/95 30 | * from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp 31 | * $FreeBSD: release/9.0.0/sys/sys/_timespec.h 205792 2010-03-28 13:13:22Z ed $ 32 | */ 33 | 34 | #ifndef _SYS__TIMESPEC_H_ 35 | #define _SYS__TIMESPEC_H_ 36 | 37 | #include 38 | 39 | #ifndef _TIME_T_DECLARED 40 | typedef __time_t time_t; 41 | #define _TIME_T_DECLARED 42 | #endif 43 | 44 | struct timespec { 45 | time_t tv_sec; /* seconds */ 46 | long tv_nsec; /* and nanoseconds */ 47 | }; 48 | 49 | #endif /* !_SYS__TIMESPEC_H_ */ 50 | -------------------------------------------------------------------------------- /include/sys/_timeval.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2002 Mike Barcroft 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/_timeval.h 158471 2006-05-12 05:04:46Z jhb $ 27 | */ 28 | 29 | #ifndef _SYS__TIMEVAL_H_ 30 | #define _SYS__TIMEVAL_H_ 31 | 32 | #include 33 | 34 | #ifndef _SUSECONDS_T_DECLARED 35 | typedef __suseconds_t suseconds_t; 36 | #define _SUSECONDS_T_DECLARED 37 | #endif 38 | 39 | #ifndef _TIME_T_DECLARED 40 | typedef __time_t time_t; 41 | #define _TIME_T_DECLARED 42 | #endif 43 | 44 | /* 45 | * Structure returned by gettimeofday(2) system call, and used in other calls. 46 | */ 47 | struct timeval { 48 | time_t tv_sec; /* seconds */ 49 | suseconds_t tv_usec; /* and microseconds */ 50 | }; 51 | 52 | #endif /* !_SYS__TIMEVAL_H_ */ 53 | -------------------------------------------------------------------------------- /include/sys/_umtx.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2010, David Xu 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice unmodified, this list of conditions, and the following 10 | * disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/_umtx.h 216641 2010-12-22 05:01:52Z davidxu $ 27 | * 28 | */ 29 | 30 | #ifndef _SYS__UMTX_H_ 31 | #define _SYS__UMTX_H_ 32 | 33 | #include 34 | 35 | struct umtx { 36 | volatile unsigned long u_owner; /* Owner of the mutex. */ 37 | }; 38 | 39 | struct umutex { 40 | volatile __lwpid_t m_owner; /* Owner of the mutex */ 41 | __uint32_t m_flags; /* Flags of the mutex */ 42 | __uint32_t m_ceilings[2]; /* Priority protect ceiling */ 43 | __uint32_t m_spare[4]; 44 | }; 45 | 46 | struct ucond { 47 | volatile __uint32_t c_has_waiters; /* Has waiters in kernel */ 48 | __uint32_t c_flags; /* Flags of the condition variable */ 49 | __uint32_t c_clockid; /* Clock id */ 50 | __uint32_t c_spare[1]; /* Spare space */ 51 | }; 52 | 53 | struct urwlock { 54 | volatile __int32_t rw_state; 55 | __uint32_t rw_flags; 56 | __uint32_t rw_blocked_readers; 57 | __uint32_t rw_blocked_writers; 58 | __uint32_t rw_spare[4]; 59 | }; 60 | 61 | struct _usem { 62 | volatile __uint32_t _has_waiters; 63 | volatile __uint32_t _count; 64 | __uint32_t _flags; 65 | }; 66 | 67 | #endif /* !_SYS__UMTX_H_ */ 68 | -------------------------------------------------------------------------------- /include/sys/condvar.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2000 Jake Burkholder . 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/condvar.h 177085 2008-03-12 06:31:06Z jeff $ 27 | */ 28 | 29 | #ifndef _SYS_CONDVAR_H_ 30 | #define _SYS_CONDVAR_H_ 31 | 32 | #ifndef LOCORE 33 | #include 34 | 35 | struct lock_object; 36 | struct thread; 37 | 38 | TAILQ_HEAD(cv_waitq, thread); 39 | 40 | /* 41 | * Condition variable. The waiters count is protected by the mutex that 42 | * protects the condition; that is, the mutex that is passed to cv_wait*() 43 | * and is held across calls to cv_signal() and cv_broadcast(). It is an 44 | * optimization to avoid looking up the sleep queue if there are no waiters. 45 | */ 46 | struct cv { 47 | const char *cv_description; 48 | int cv_waiters; 49 | }; 50 | 51 | #ifdef _KERNEL 52 | void cv_init(struct cv *cvp, const char *desc); 53 | void cv_destroy(struct cv *cvp); 54 | 55 | void _cv_wait(struct cv *cvp, struct lock_object *lock); 56 | void _cv_wait_unlock(struct cv *cvp, struct lock_object *lock); 57 | int _cv_wait_sig(struct cv *cvp, struct lock_object *lock); 58 | int _cv_timedwait(struct cv *cvp, struct lock_object *lock, int timo); 59 | int _cv_timedwait_sig(struct cv *cvp, struct lock_object *lock, int timo); 60 | 61 | void cv_signal(struct cv *cvp); 62 | void cv_broadcastpri(struct cv *cvp, int pri); 63 | 64 | #define cv_wait(cvp, lock) \ 65 | _cv_wait((cvp), &(lock)->lock_object) 66 | #define cv_wait_unlock(cvp, lock) \ 67 | _cv_wait_unlock((cvp), &(lock)->lock_object) 68 | #define cv_wait_sig(cvp, lock) \ 69 | _cv_wait_sig((cvp), &(lock)->lock_object) 70 | #define cv_timedwait(cvp, lock, timo) \ 71 | _cv_timedwait((cvp), &(lock)->lock_object, (timo)) 72 | #define cv_timedwait_sig(cvp, lock, timo) \ 73 | _cv_timedwait_sig((cvp), &(lock)->lock_object, (timo)) 74 | 75 | #define cv_broadcast(cvp) cv_broadcastpri(cvp, 0) 76 | 77 | #define cv_wmesg(cvp) ((cvp)->cv_description) 78 | 79 | #endif /* _KERNEL */ 80 | #endif /* !LOCORE */ 81 | #endif /* _SYS_CONDVAR_H_ */ 82 | -------------------------------------------------------------------------------- /include/sys/elf.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2001 David E. O'Brien. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/elf.h 174043 2007-11-28 21:54:46Z jb $ 27 | */ 28 | 29 | /* 30 | * This is a Solaris compatibility header 31 | */ 32 | 33 | #ifndef _SYS_ELF_H_ 34 | #define _SYS_ELF_H_ 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #endif /* !_SYS_ELF_H_ */ 42 | -------------------------------------------------------------------------------- /include/sys/elf_generic.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1998 John D. Polstra. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/elf_generic.h 186667 2009-01-01 02:08:56Z obrien $ 27 | */ 28 | 29 | #ifndef _SYS_ELF_GENERIC_H_ 30 | #define _SYS_ELF_GENERIC_H_ 1 31 | 32 | #include 33 | 34 | /* 35 | * Definitions of generic ELF names which relieve applications from 36 | * needing to know the word size. 37 | */ 38 | 39 | #if __ELF_WORD_SIZE != 32 && __ELF_WORD_SIZE != 64 40 | #error "__ELF_WORD_SIZE must be defined as 32 or 64" 41 | #endif 42 | 43 | #define ELF_CLASS __CONCAT(ELFCLASS,__ELF_WORD_SIZE) 44 | 45 | #if BYTE_ORDER == LITTLE_ENDIAN 46 | #define ELF_DATA ELFDATA2LSB 47 | #elif BYTE_ORDER == BIG_ENDIAN 48 | #define ELF_DATA ELFDATA2MSB 49 | #else 50 | #error "Unknown byte order" 51 | #endif 52 | 53 | #define __elfN(x) __CONCAT(__CONCAT(__CONCAT(elf,__ELF_WORD_SIZE),_),x) 54 | #define __ElfN(x) __CONCAT(__CONCAT(__CONCAT(Elf,__ELF_WORD_SIZE),_),x) 55 | #define __ELFN(x) __CONCAT(__CONCAT(__CONCAT(ELF,__ELF_WORD_SIZE),_),x) 56 | #define __ElfType(x) typedef __ElfN(x) __CONCAT(Elf_,x) 57 | 58 | __ElfType(Addr); 59 | __ElfType(Half); 60 | __ElfType(Off); 61 | __ElfType(Sword); 62 | __ElfType(Word); 63 | __ElfType(Ehdr); 64 | __ElfType(Shdr); 65 | __ElfType(Phdr); 66 | __ElfType(Dyn); 67 | __ElfType(Rel); 68 | __ElfType(Rela); 69 | __ElfType(Sym); 70 | __ElfType(Verdef); 71 | __ElfType(Verdaux); 72 | __ElfType(Verneed); 73 | __ElfType(Vernaux); 74 | __ElfType(Versym); 75 | 76 | /* Non-standard ELF types. */ 77 | __ElfType(Hashelt); 78 | __ElfType(Size); 79 | __ElfType(Ssize); 80 | 81 | #define ELF_R_SYM __ELFN(R_SYM) 82 | #define ELF_R_TYPE __ELFN(R_TYPE) 83 | #define ELF_R_INFO __ELFN(R_INFO) 84 | #define ELF_ST_BIND __ELFN(ST_BIND) 85 | #define ELF_ST_TYPE __ELFN(ST_TYPE) 86 | #define ELF_ST_INFO __ELFN(ST_INFO) 87 | 88 | #endif /* !_SYS_ELF_GENERIC_H_ */ 89 | -------------------------------------------------------------------------------- /include/sys/eventvar.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1999,2000 Jonathan Lemon 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/eventvar.h 133741 2004-08-15 06:24:42Z jmg $ 27 | */ 28 | 29 | #ifndef _SYS_EVENTVAR_H_ 30 | #define _SYS_EVENTVAR_H_ 31 | 32 | #ifndef _KERNEL 33 | #error "no user-servicable parts inside" 34 | #endif 35 | 36 | #include 37 | 38 | #define KQ_NEVENTS 8 /* minimize copy{in,out} calls */ 39 | #define KQEXTENT 256 /* linear growth by this amount */ 40 | 41 | struct kqueue { 42 | struct mtx kq_lock; 43 | int kq_refcnt; 44 | SLIST_ENTRY(kqueue) kq_list; 45 | TAILQ_HEAD(, knote) kq_head; /* list of pending event */ 46 | int kq_count; /* number of pending events */ 47 | struct selinfo kq_sel; 48 | struct sigio *kq_sigio; 49 | struct filedesc *kq_fdp; 50 | int kq_state; 51 | #define KQ_SEL 0x01 52 | #define KQ_SLEEP 0x02 53 | #define KQ_FLUXWAIT 0x04 /* waiting for a in flux kn */ 54 | #define KQ_ASYNC 0x08 55 | #define KQ_CLOSING 0x10 56 | #define KQ_TASKSCHED 0x20 /* task scheduled */ 57 | #define KQ_TASKDRAIN 0x40 /* waiting for task to drain */ 58 | int kq_knlistsize; /* size of knlist */ 59 | struct klist *kq_knlist; /* list of knotes */ 60 | u_long kq_knhashmask; /* size of knhash */ 61 | struct klist *kq_knhash; /* hash table for knotes */ 62 | struct task kq_task; 63 | }; 64 | 65 | #endif /* !_SYS_EVENTVAR_H_ */ 66 | -------------------------------------------------------------------------------- /include/sys/filio.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1982, 1986, 1990, 1993, 1994 3 | * The Regents of the University of California. All rights reserved. 4 | * (c) UNIX System Laboratories, Inc. 5 | * All or some portions of this file are derived from material licensed 6 | * to the University of California by American Telephone and Telegraph 7 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 | * the permission of UNIX System Laboratories, Inc. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 4. Neither the name of the University nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 | * SUCH DAMAGE. 33 | * 34 | * @(#)filio.h 8.1 (Berkeley) 3/28/94 35 | * $FreeBSD: release/9.0.0/sys/sys/filio.h 195191 2009-06-30 13:38:49Z emaste $ 36 | */ 37 | 38 | #ifndef _SYS_FILIO_H_ 39 | #define _SYS_FILIO_H_ 40 | 41 | #include 42 | 43 | /* Generic file-descriptor ioctl's. */ 44 | #define FIOCLEX _IO('f', 1) /* set close on exec on fd */ 45 | #define FIONCLEX _IO('f', 2) /* remove close on exec */ 46 | #define FIONREAD _IOR('f', 127, int) /* get # bytes to read */ 47 | #define FIONBIO _IOW('f', 126, int) /* set/clear non-blocking i/o */ 48 | #define FIOASYNC _IOW('f', 125, int) /* set/clear async i/o */ 49 | #define FIOSETOWN _IOW('f', 124, int) /* set owner */ 50 | #define FIOGETOWN _IOR('f', 123, int) /* get owner */ 51 | #define FIODTYPE _IOR('f', 122, int) /* get d_flags type part */ 52 | #define FIOGETLBA _IOR('f', 121, int) /* get start blk # */ 53 | struct fiodgname_arg { 54 | int len; 55 | void *buf; 56 | }; 57 | #define FIODGNAME _IOW('f', 120, struct fiodgname_arg) /* get dev. name */ 58 | #define FIONWRITE _IOR('f', 119, int) /* get # bytes (yet) to write */ 59 | #define FIONSPACE _IOR('f', 118, int) /* get space in send queue */ 60 | /* Handle lseek SEEK_DATA and SEEK_HOLE for holey file knowledge. */ 61 | #define FIOSEEKDATA _IOWR('f', 97, off_t) /* SEEK_DATA */ 62 | #define FIOSEEKHOLE _IOWR('f', 98, off_t) /* SEEK_HOLE */ 63 | 64 | #endif /* !_SYS_FILIO_H_ */ 65 | -------------------------------------------------------------------------------- /include/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1982, 1986, 1990, 1993, 1994 3 | * The Regents of the University of California. All rights reserved. 4 | * (c) UNIX System Laboratories, Inc. 5 | * All or some portions of this file are derived from material licensed 6 | * to the University of California by American Telephone and Telegraph 7 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 | * the permission of UNIX System Laboratories, Inc. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 4. Neither the name of the University nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 | * SUCH DAMAGE. 33 | * 34 | * @(#)ioctl.h 8.6 (Berkeley) 3/28/94 35 | * $FreeBSD: release/9.0.0/sys/sys/ioctl.h 191947 2009-05-09 19:01:24Z ed $ 36 | */ 37 | 38 | #ifndef _SYS_IOCTL_H_ 39 | #define _SYS_IOCTL_H_ 40 | 41 | #ifdef _KERNEL 42 | #error "Don't #include ioctl.h in the kernel. Include xxxio.h instead." 43 | #endif /* _KERNEL */ 44 | 45 | #include 46 | 47 | #include 48 | #include 49 | #include 50 | 51 | #endif /* !_SYS_IOCTL_H_ */ 52 | -------------------------------------------------------------------------------- /include/sys/lock_profile.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2006 Kip Macy kmacy@FreeBSD.org 3 | * Copyright (c) 2006 Kris Kennaway kris@FreeBSD.org 4 | * Copyright (c) 2006 Dag-Erling Smorgrav des@des.no 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | * ARE DISCLAIMED. IN NO EVENT SHAL THE AUTHORS BE LIABLE FOR ANY 19 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 | * SUCH DAMAGE. 26 | * 27 | * $FreeBSD: release/9.0.0/sys/sys/lock_profile.h 194578 2009-06-21 09:01:12Z rdivacky $ 28 | */ 29 | 30 | 31 | #ifndef _SYS_LOCK_PROFILE_H_ 32 | #define _SYS_LOCK_PROFILE_H_ 33 | 34 | struct lock_profile_object; 35 | LIST_HEAD(lpohead, lock_profile_object); 36 | 37 | #ifdef _KERNEL 38 | #ifdef LOCK_PROFILING 39 | #include 40 | #include 41 | 42 | #ifndef USE_CPU_NANOSECONDS 43 | u_int64_t nanoseconds(void); 44 | #endif 45 | 46 | extern volatile int lock_prof_enable; 47 | 48 | void lock_profile_obtain_lock_success(struct lock_object *lo, int contested, 49 | uint64_t waittime, const char *file, int line); 50 | void lock_profile_release_lock(struct lock_object *lo); 51 | void lock_profile_thread_exit(struct thread *td); 52 | 53 | 54 | static inline void 55 | lock_profile_obtain_lock_failed(struct lock_object *lo, int *contested, 56 | uint64_t *waittime) 57 | { 58 | if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE) || *contested) 59 | return; 60 | *waittime = nanoseconds(); 61 | *contested = 1; 62 | } 63 | 64 | #else /* !LOCK_PROFILING */ 65 | 66 | #define lock_profile_release_lock(lo) (void)0 67 | #define lock_profile_obtain_lock_failed(lo, contested, waittime) (void)0 68 | #define lock_profile_obtain_lock_success(lo, contested, waittime, file, line) (void)0 69 | #define lock_profile_thread_exit(td) (void)0 70 | 71 | #endif /* !LOCK_PROFILING */ 72 | 73 | #endif /* _KERNEL */ 74 | 75 | #endif /* _SYS_LOCK_PROFILE_H_ */ 76 | -------------------------------------------------------------------------------- /include/sys/mqueue.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005 David Xu 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/mqueue.h 152948 2005-11-30 05:12:03Z davidxu $ 27 | */ 28 | 29 | #ifndef _SYS_MQUEUE_H_ 30 | #define _SYS_MQUEUE_H_ 31 | 32 | struct mq_attr { 33 | long mq_flags; /* Message queue flags. */ 34 | long mq_maxmsg; /* Maximum number of messages. */ 35 | long mq_msgsize; /* Maximum message size. */ 36 | long mq_curmsgs; /* Number of messages currently queued. */ 37 | long __reserved[4]; /* Ignored for input, zeroed for output */ 38 | }; 39 | 40 | #ifdef _KERNEL 41 | struct thread; 42 | struct file; 43 | extern void (*mq_fdclose)(struct thread *td, int fd, struct file *fp); 44 | #endif 45 | #endif 46 | -------------------------------------------------------------------------------- /include/sys/refcount.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2005 John Baldwin 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the author nor the names of any co-contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * $FreeBSD: release/9.0.0/sys/sys/refcount.h 180763 2008-07-23 16:44:20Z des $ 30 | */ 31 | 32 | #ifndef __SYS_REFCOUNT_H__ 33 | #define __SYS_REFCOUNT_H__ 34 | 35 | #include 36 | 37 | #ifdef _KERNEL 38 | #include 39 | #else 40 | #define KASSERT(exp, msg) /* */ 41 | #endif 42 | 43 | static __inline void 44 | refcount_init(volatile u_int *count, u_int value) 45 | { 46 | 47 | *count = value; 48 | } 49 | 50 | static __inline void 51 | refcount_acquire(volatile u_int *count) 52 | { 53 | 54 | atomic_add_acq_int(count, 1); 55 | } 56 | 57 | static __inline int 58 | refcount_release(volatile u_int *count) 59 | { 60 | u_int old; 61 | 62 | /* XXX: Should this have a rel membar? */ 63 | old = atomic_fetchadd_int(count, -1); 64 | KASSERT(old > 0, ("negative refcount %p", count)); 65 | return (old == 1); 66 | } 67 | 68 | #endif /* ! __SYS_REFCOUNT_H__ */ 69 | -------------------------------------------------------------------------------- /include/sys/runq.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2001 Jake Burkholder 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/runq.h 177435 2008-03-20 05:51:16Z jeff $ 27 | */ 28 | 29 | #ifndef _RUNQ_H_ 30 | #define _RUNQ_H_ 31 | 32 | #include 33 | 34 | struct thread; 35 | 36 | /* 37 | * Run queue parameters. 38 | */ 39 | 40 | #define RQ_NQS (64) /* Number of run queues. */ 41 | #define RQ_PPQ (4) /* Priorities per queue. */ 42 | 43 | /* 44 | * Head of run queues. 45 | */ 46 | TAILQ_HEAD(rqhead, thread); 47 | 48 | /* 49 | * Bit array which maintains the status of a run queue. When a queue is 50 | * non-empty the bit corresponding to the queue number will be set. 51 | */ 52 | struct rqbits { 53 | rqb_word_t rqb_bits[RQB_LEN]; 54 | }; 55 | 56 | /* 57 | * Run queue structure. Contains an array of run queues on which processes 58 | * are placed, and a structure to maintain the status of each queue. 59 | */ 60 | struct runq { 61 | struct rqbits rq_status; 62 | struct rqhead rq_queues[RQ_NQS]; 63 | }; 64 | 65 | void runq_add(struct runq *, struct thread *, int); 66 | void runq_add_pri(struct runq *, struct thread *, u_char, int); 67 | int runq_check(struct runq *); 68 | struct thread *runq_choose(struct runq *); 69 | struct thread *runq_choose_from(struct runq *, u_char); 70 | struct thread *runq_choose_fuzz(struct runq *, int); 71 | void runq_init(struct runq *); 72 | void runq_remove(struct runq *, struct thread *); 73 | void runq_remove_idx(struct runq *, struct thread *, u_char *); 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /include/sys/selinfo.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1992, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 4. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * @(#)select.h 8.2 (Berkeley) 1/4/94 30 | * $FreeBSD: release/9.0.0/sys/sys/selinfo.h 225177 2011-08-25 15:51:54Z attilio $ 31 | */ 32 | 33 | #ifndef _SYS_SELINFO_H_ 34 | #define _SYS_SELINFO_H_ 35 | 36 | #include /* for struct klist */ 37 | 38 | struct selfd; 39 | TAILQ_HEAD(selfdlist, selfd); 40 | 41 | /* 42 | * Used to maintain information about processes that wish to be 43 | * notified when I/O becomes possible. 44 | */ 45 | struct selinfo { 46 | struct selfdlist si_tdlist; /* List of sleeping threads. */ 47 | struct knlist si_note; /* kernel note list */ 48 | struct mtx *si_mtx; /* Lock for tdlist. */ 49 | }; 50 | 51 | #define SEL_WAITING(si) (!TAILQ_EMPTY(&(si)->si_tdlist)) 52 | 53 | #ifdef _KERNEL 54 | void seldrain(struct selinfo *sip); 55 | void selrecord(struct thread *selector, struct selinfo *sip); 56 | void selwakeup(struct selinfo *sip); 57 | void selwakeuppri(struct selinfo *sip, int pri); 58 | void seltdfini(struct thread *td); 59 | #endif 60 | 61 | #endif /* !_SYS_SELINFO_H_ */ 62 | -------------------------------------------------------------------------------- /include/sys/sigio.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 4. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * @(#)filedesc.h 8.1 (Berkeley) 6/2/93 30 | * $FreeBSD: release/9.0.0/sys/sys/sigio.h 139825 2005-01-07 02:29:27Z imp $ 31 | */ 32 | 33 | #ifndef _SYS_SIGIO_H_ 34 | #define _SYS_SIGIO_H_ 35 | 36 | /* 37 | * This structure holds the information needed to send a SIGIO or 38 | * a SIGURG signal to a process or process group when new data arrives 39 | * on a device or socket. The structure is placed on an SLIST belonging 40 | * to the proc or pgrp so that the entire list may be revoked when the 41 | * process exits or the process group disappears. 42 | * 43 | * (c) const 44 | * (pg) locked by either the process or process group lock 45 | */ 46 | struct sigio { 47 | union { 48 | struct proc *siu_proc; /* (c) process to receive SIGIO/SIGURG */ 49 | struct pgrp *siu_pgrp; /* (c) process group to receive ... */ 50 | } sio_u; 51 | SLIST_ENTRY(sigio) sio_pgsigio; /* (pg) sigio's for process or group */ 52 | struct sigio **sio_myref; /* (c) location of the pointer that holds 53 | * the reference to this structure */ 54 | struct ucred *sio_ucred; /* (c) current credentials */ 55 | pid_t sio_pgid; /* (c) pgid for signals */ 56 | }; 57 | #define sio_proc sio_u.siu_proc 58 | #define sio_pgrp sio_u.siu_pgrp 59 | 60 | SLIST_HEAD(sigiolst, sigio); 61 | 62 | pid_t fgetown(struct sigio **sigiop); 63 | int fsetown(pid_t pgid, struct sigio **sigiop); 64 | void funsetown(struct sigio **sigiop); 65 | void funsetownlst(struct sigiolst *sigiolst); 66 | 67 | #endif /* _SYS_SIGIO_H_ */ 68 | -------------------------------------------------------------------------------- /include/sys/stdint.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2001 Mike Barcroft 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/sys/sys/stdint.h 221502 2011-05-05 14:45:24Z obrien $ 27 | */ 28 | 29 | #ifndef _SYS_STDINT_H_ 30 | #define _SYS_STDINT_H_ 31 | 32 | #include 33 | #include 34 | 35 | #include 36 | #include 37 | 38 | typedef __int_least8_t int_least8_t; 39 | typedef __int_least16_t int_least16_t; 40 | typedef __int_least32_t int_least32_t; 41 | typedef __int_least64_t int_least64_t; 42 | 43 | typedef __uint_least8_t uint_least8_t; 44 | typedef __uint_least16_t uint_least16_t; 45 | typedef __uint_least32_t uint_least32_t; 46 | typedef __uint_least64_t uint_least64_t; 47 | 48 | typedef __int_fast8_t int_fast8_t; 49 | typedef __int_fast16_t int_fast16_t; 50 | typedef __int_fast32_t int_fast32_t; 51 | typedef __int_fast64_t int_fast64_t; 52 | 53 | typedef __uint_fast8_t uint_fast8_t; 54 | typedef __uint_fast16_t uint_fast16_t; 55 | typedef __uint_fast32_t uint_fast32_t; 56 | typedef __uint_fast64_t uint_fast64_t; 57 | 58 | #ifndef _INTMAX_T_DECLARED 59 | typedef __intmax_t intmax_t; 60 | #define _INTMAX_T_DECLARED 61 | #endif 62 | #ifndef _UINTMAX_T_DECLARED 63 | typedef __uintmax_t uintmax_t; 64 | #define _UINTMAX_T_DECLARED 65 | #endif 66 | 67 | #endif /* !_SYS_STDINT_H_ */ 68 | -------------------------------------------------------------------------------- /include/sys/times.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * (c) UNIX System Laboratories, Inc. 5 | * All or some portions of this file are derived from material licensed 6 | * to the University of California by American Telephone and Telegraph 7 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 | * the permission of UNIX System Laboratories, Inc. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 4. Neither the name of the University nor the names of its contributors 19 | * may be used to endorse or promote products derived from this software 20 | * without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 | * SUCH DAMAGE. 33 | * 34 | * @(#)times.h 8.4 (Berkeley) 1/21/94 35 | * $FreeBSD: release/9.0.0/sys/sys/times.h 127976 2004-04-07 04:19:52Z imp $ 36 | */ 37 | 38 | #ifndef _SYS_TIMES_H_ 39 | #define _SYS_TIMES_H_ 40 | 41 | #include 42 | 43 | #ifndef _CLOCK_T_DECLARED 44 | typedef __clock_t clock_t; 45 | #define _CLOCK_T_DECLARED 46 | #endif 47 | 48 | struct tms { 49 | clock_t tms_utime; /* User CPU time */ 50 | clock_t tms_stime; /* System CPU time */ 51 | clock_t tms_cutime; /* User CPU time of terminated child procs */ 52 | clock_t tms_cstime; /* System CPU time of terminated child procs */ 53 | }; 54 | 55 | #ifndef _KERNEL 56 | #include 57 | 58 | __BEGIN_DECLS 59 | clock_t times(struct tms *); 60 | __END_DECLS 61 | #endif 62 | #endif /* !_SYS_TIMES_H_ */ 63 | -------------------------------------------------------------------------------- /include/sys/timespec.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1982, 1986, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 4. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * @(#)time.h 8.5 (Berkeley) 5/4/95 30 | * from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp 31 | * $FreeBSD: release/9.0.0/sys/sys/timespec.h 205792 2010-03-28 13:13:22Z ed $ 32 | */ 33 | 34 | #ifndef _SYS_TIMESPEC_H_ 35 | #define _SYS_TIMESPEC_H_ 36 | 37 | #include 38 | #include 39 | 40 | #if __BSD_VISIBLE 41 | #define TIMEVAL_TO_TIMESPEC(tv, ts) \ 42 | do { \ 43 | (ts)->tv_sec = (tv)->tv_sec; \ 44 | (ts)->tv_nsec = (tv)->tv_usec * 1000; \ 45 | } while (0) 46 | #define TIMESPEC_TO_TIMEVAL(tv, ts) \ 47 | do { \ 48 | (tv)->tv_sec = (ts)->tv_sec; \ 49 | (tv)->tv_usec = (ts)->tv_nsec / 1000; \ 50 | } while (0) 51 | 52 | #endif /* __BSD_VISIBLE */ 53 | 54 | /* 55 | * Structure defined by POSIX.1b to be like a itimerval, but with 56 | * timespecs. Used in the timer_*() system calls. 57 | */ 58 | struct itimerspec { 59 | struct timespec it_interval; 60 | struct timespec it_value; 61 | }; 62 | 63 | #endif /* _SYS_TIMESPEC_H_ */ 64 | -------------------------------------------------------------------------------- /include/sys/un.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1982, 1986, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 4. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * @(#)un.h 8.3 (Berkeley) 2/19/95 30 | * $FreeBSD: release/9.0.0/sys/sys/un.h 183650 2008-10-06 18:43:11Z rwatson $ 31 | */ 32 | 33 | #ifndef _SYS_UN_H_ 34 | #define _SYS_UN_H_ 35 | 36 | #include 37 | #include 38 | 39 | #ifndef _SA_FAMILY_T_DECLARED 40 | typedef __sa_family_t sa_family_t; 41 | #define _SA_FAMILY_T_DECLARED 42 | #endif 43 | 44 | /* 45 | * Definitions for UNIX IPC domain. 46 | */ 47 | struct sockaddr_un { 48 | unsigned char sun_len; /* sockaddr len including null */ 49 | sa_family_t sun_family; /* AF_UNIX */ 50 | char sun_path[104]; /* path name (gag) */ 51 | }; 52 | 53 | #if __BSD_VISIBLE 54 | 55 | /* Socket options. */ 56 | #define LOCAL_PEERCRED 0x001 /* retrieve peer credentials */ 57 | #define LOCAL_CREDS 0x002 /* pass credentials to receiver */ 58 | #define LOCAL_CONNWAIT 0x004 /* connects block until accepted */ 59 | 60 | #ifndef _KERNEL 61 | 62 | /* actual length of an initialized sockaddr_un */ 63 | #define SUN_LEN(su) \ 64 | (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) 65 | 66 | #endif /* !_KERNEL */ 67 | 68 | #endif /* __BSD_VISIBLE */ 69 | 70 | #endif /* !_SYS_UN_H_ */ 71 | -------------------------------------------------------------------------------- /include/sys/utsname.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1994 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * This code is derived from software contributed to Berkeley by 6 | * Chuck Karish of Mindcraft, Inc. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 4. Neither the name of the University nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | * SUCH DAMAGE. 31 | * 32 | * @(#)utsname.h 8.1 (Berkeley) 1/4/94 33 | * $FreeBSD: release/9.0.0/sys/sys/utsname.h 127976 2004-04-07 04:19:52Z imp $ 34 | */ 35 | 36 | #ifndef _SYS_UTSNAME_H 37 | #define _SYS_UTSNAME_H 38 | 39 | #ifdef _KERNEL 40 | #define SYS_NMLN 32 /* uname(2) for the FreeBSD 1.1 ABI. */ 41 | #endif 42 | 43 | #ifndef SYS_NMLN 44 | #define SYS_NMLN 256 /* User can override. */ 45 | #endif 46 | 47 | struct utsname { 48 | char sysname[SYS_NMLN]; /* Name of this OS. */ 49 | char nodename[SYS_NMLN]; /* Name of this network node. */ 50 | char release[SYS_NMLN]; /* Release level. */ 51 | char version[SYS_NMLN]; /* Version level. */ 52 | char machine[SYS_NMLN]; /* Hardware type. */ 53 | }; 54 | 55 | #include 56 | 57 | #ifndef _KERNEL 58 | __BEGIN_DECLS 59 | int __xuname(int, void *); /* Variable record size. */ 60 | __END_DECLS 61 | 62 | static __inline int 63 | uname(struct utsname *name) 64 | { 65 | return __xuname(SYS_NMLN, (void *)name); 66 | } 67 | #endif /* _KERNEL */ 68 | 69 | #endif /* !_SYS_UTSNAME_H */ 70 | -------------------------------------------------------------------------------- /include/tar.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1994 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * This code is derived from software contributed to Berkeley by 6 | * Chuck Karish of Mindcraft, Inc. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of the University nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | * SUCH DAMAGE. 31 | * 32 | * @(#)tar.h 8.2 (Berkeley) 1/4/94 33 | * 34 | * $FreeBSD: release/9.0.0/include/tar.h 203964 2010-02-16 19:39:50Z imp $ 35 | */ 36 | 37 | #ifndef _TAR_H 38 | #define _TAR_H 39 | 40 | #define TMAGIC "ustar" /* ustar and a null */ 41 | #define TMAGLEN 6 42 | #define TVERSION "00" /* 00 and no null */ 43 | #define TVERSLEN 2 44 | 45 | /* Values used in typeflag field */ 46 | #define REGTYPE '0' /* Regular file */ 47 | #define AREGTYPE '\0' /* Regular file */ 48 | #define LNKTYPE '1' /* Link */ 49 | #define SYMTYPE '2' /* Reserved */ 50 | #define CHRTYPE '3' /* Character special */ 51 | #define BLKTYPE '4' /* Block special */ 52 | #define DIRTYPE '5' /* Directory */ 53 | #define FIFOTYPE '6' /* FIFO special */ 54 | #define CONTTYPE '7' /* Reserved */ 55 | 56 | /* Bits used in the mode field - values in octal */ 57 | #define TSUID 04000 /* Set UID on execution */ 58 | #define TSGID 02000 /* Set GID on execution */ 59 | #define TSVTX 01000 /* Reserved */ 60 | /* File permissions */ 61 | #define TUREAD 00400 /* Read by owner */ 62 | #define TUWRITE 00200 /* Write by owner */ 63 | #define TUEXEC 00100 /* Execute/Search by owner */ 64 | #define TGREAD 00040 /* Read by group */ 65 | #define TGWRITE 00020 /* Write by group */ 66 | #define TGEXEC 00010 /* Execute/Search by group */ 67 | #define TOREAD 00004 /* Read by other */ 68 | #define TOWRITE 00002 /* Write by other */ 69 | #define TOEXEC 00001 /* Execute/Search by other */ 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /include/third_party/udis86/syn.h: -------------------------------------------------------------------------------- 1 | /* udis86 - libudis86/syn.h 2 | * 3 | * Copyright (c) 2002-2009 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, 7 | * are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 22 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | #ifndef UD_SYN_H 27 | #define UD_SYN_H 28 | 29 | #include "types.h" 30 | #ifndef __UD_STANDALONE__ 31 | # include 32 | #endif /* __UD_STANDALONE__ */ 33 | 34 | extern const char* ud_reg_tab[]; 35 | 36 | uint64_t ud_syn_rel_target(struct ud*, struct ud_operand*); 37 | 38 | #ifdef __GNUC__ 39 | int ud_asmprintf(struct ud *u, const char *fmt, ...) 40 | __attribute__ ((format (printf, 2, 3))); 41 | #else 42 | int ud_asmprintf(struct ud *u, const char *fmt, ...); 43 | #endif 44 | 45 | void ud_syn_print_addr(struct ud *u, uint64_t addr); 46 | void ud_syn_print_imm(struct ud* u, const struct ud_operand *op); 47 | void ud_syn_print_mem_disp(struct ud* u, const struct ud_operand *, int sign); 48 | 49 | #endif /* UD_SYN_H */ 50 | 51 | /* 52 | vim: set ts=2 sw=2 expandtab 53 | */ 54 | -------------------------------------------------------------------------------- /include/third_party/udis86/udint.h: -------------------------------------------------------------------------------- 1 | /* udis86 - libudis86/udint.h -- definitions for internal use only 2 | * 3 | * Copyright (c) 2002-2009 Vivek Thampi 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, 7 | * are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 22 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | #ifndef _UDINT_H_ 27 | #define _UDINT_H_ 28 | 29 | #include "types.h" 30 | 31 | #ifdef HAVE_CONFIG_H 32 | # include 33 | #endif /* HAVE_CONFIG_H */ 34 | 35 | #if defined(UD_DEBUG) && HAVE_ASSERT_H 36 | # include 37 | # define UD_ASSERT(_x) assert(_x) 38 | #else 39 | # define UD_ASSERT(_x) 40 | #endif /* !HAVE_ASSERT_H */ 41 | 42 | #if defined(UD_DEBUG) 43 | #define UDERR(u, msg) \ 44 | do { \ 45 | (u)->error = 1; \ 46 | fprintf(stderr, "decode-error: %s:%d: %s", \ 47 | __FILE__, __LINE__, (msg)); \ 48 | } while (0) 49 | #else 50 | #define UDERR(u, m) \ 51 | do { \ 52 | (u)->error = 1; \ 53 | } while (0) 54 | #endif /* !LOGERR */ 55 | 56 | #define UD_RETURN_ON_ERROR(u) \ 57 | do { \ 58 | if ((u)->error != 0) { \ 59 | return (u)->error; \ 60 | } \ 61 | } while (0) 62 | 63 | #define UD_RETURN_WITH_ERROR(u, m) \ 64 | do { \ 65 | UDERR(u, m); \ 66 | return (u)->error; \ 67 | } while (0) 68 | 69 | #ifndef __UD_STANDALONE__ 70 | # define UD_NON_STANDALONE(x) x 71 | #else 72 | # define UD_NON_STANDALONE(x) 73 | #endif 74 | 75 | /* printf formatting int64 specifier */ 76 | #ifdef FMT64 77 | # undef FMT64 78 | #endif 79 | #if defined(_MSC_VER) || defined(__BORLANDC__) 80 | # define FMT64 "I64" 81 | #else 82 | # if defined(__APPLE__) 83 | # define FMT64 "ll" 84 | # elif defined(__amd64__) || defined(__x86_64__) 85 | # define FMT64 "l" 86 | # else 87 | # define FMT64 "ll" 88 | # endif /* !x64 */ 89 | #endif 90 | 91 | #endif /* _UDINT_H_ */ 92 | -------------------------------------------------------------------------------- /include/third_party/udis86/udis86.h: -------------------------------------------------------------------------------- 1 | /* udis86 - udis86.h 2 | * 3 | * Copyright (c) 2002-2009 Vivek Thampi 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without modification, 7 | * are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 22 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | #ifndef UDIS86_H 27 | #define UDIS86_H 28 | 29 | #include "types.h" 30 | #include "extern.h" 31 | #include "itab.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /include/ulimit.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2002 Kyle Martin 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/ulimit.h 108910 2003-01-08 01:18:13Z tjr $ 27 | */ 28 | 29 | #ifndef _ULIMIT_H_ 30 | #define _ULIMIT_H_ 31 | 32 | #include 33 | 34 | #define UL_GETFSIZE 1 35 | #define UL_SETFSIZE 2 36 | 37 | __BEGIN_DECLS 38 | long ulimit(int, ...); 39 | __END_DECLS 40 | 41 | #endif /* !_ULIMIT_H_ */ 42 | -------------------------------------------------------------------------------- /include/utime.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * @(#)utime.h 8.1 (Berkeley) 6/2/93 30 | * $FreeBSD: release/9.0.0/include/utime.h 203964 2010-02-16 19:39:50Z imp $ 31 | */ 32 | 33 | #ifndef _UTIME_H_ 34 | #define _UTIME_H_ 35 | 36 | #include 37 | #include 38 | 39 | #ifndef _TIME_T_DECLARED 40 | typedef __time_t time_t; 41 | #define _TIME_T_DECLARED 42 | #endif 43 | 44 | struct utimbuf { 45 | time_t actime; /* Access time */ 46 | time_t modtime; /* Modification time */ 47 | }; 48 | 49 | __BEGIN_DECLS 50 | int utime(const char *, const struct utimbuf *); 51 | __END_DECLS 52 | 53 | #endif /* !_UTIME_H_ */ 54 | -------------------------------------------------------------------------------- /include/wordexp.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2002 Tim J. Robbins. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | * 26 | * $FreeBSD: release/9.0.0/include/wordexp.h 131331 2004-06-30 13:55:08Z tjr $ 27 | */ 28 | 29 | #ifndef _WORDEXP_H_ 30 | #define _WORDEXP_H_ 31 | 32 | #include 33 | #include 34 | 35 | #if __XSI_VISIBLE && !defined(_SIZE_T_DECLARED) 36 | typedef __size_t size_t; 37 | #define _SIZE_T_DECLARED 38 | #endif 39 | 40 | typedef struct { 41 | __size_t we_wordc; /* count of words matched */ 42 | char **we_wordv; /* pointer to list of words */ 43 | __size_t we_offs; /* slots to reserve in we_wordv */ 44 | char *we_strings; /* storage for wordv strings */ 45 | __size_t we_nbytes; /* size of we_strings */ 46 | } wordexp_t; 47 | 48 | /* 49 | * Flags for wordexp(). 50 | */ 51 | #define WRDE_APPEND 0x1 /* append to previously generated */ 52 | #define WRDE_DOOFFS 0x2 /* we_offs member is valid */ 53 | #define WRDE_NOCMD 0x4 /* disallow command substitution */ 54 | #define WRDE_REUSE 0x8 /* reuse wordexp_t */ 55 | #define WRDE_SHOWERR 0x10 /* don't redirect stderr to /dev/null */ 56 | #define WRDE_UNDEF 0x20 /* disallow undefined shell vars */ 57 | 58 | /* 59 | * Return values from wordexp(). 60 | */ 61 | #define WRDE_BADCHAR 1 /* unquoted special character */ 62 | #define WRDE_BADVAL 2 /* undefined variable */ 63 | #define WRDE_CMDSUB 3 /* command substitution not allowed */ 64 | #define WRDE_NOSPACE 4 /* no memory for result */ 65 | #if __XSI_VISIBLE 66 | #define WRDE_NOSYS 5 /* obsolete, reserved */ 67 | #endif 68 | #define WRDE_SYNTAX 6 /* shell syntax error */ 69 | 70 | __BEGIN_DECLS 71 | int wordexp(const char * __restrict, wordexp_t * __restrict, int); 72 | void wordfree(wordexp_t *); 73 | __END_DECLS 74 | 75 | #endif /* !_WORDEXP_H_ */ 76 | -------------------------------------------------------------------------------- /include/x86/_align.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2001 David E. O'Brien 3 | * Copyright (c) 1990 The Regents of the University of California. 4 | * All rights reserved. 5 | * 6 | * This code is derived from software contributed to Berkeley by 7 | * William Jolitz. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. All advertising materials mentioning features or use of this software 18 | * must display the following acknowledgement: 19 | * This product includes software developed by the University of 20 | * California, Berkeley and its contributors. 21 | * 4. Neither the name of the University nor the names of its contributors 22 | * may be used to endorse or promote products derived from this software 23 | * without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 | * SUCH DAMAGE. 36 | * 37 | * from: @(#)param.h 5.8 (Berkeley) 6/28/91 38 | * $FreeBSD: release/9.0.0/sys/x86/include/_align.h 215856 2010-11-26 10:59:20Z tijl $ 39 | */ 40 | 41 | #ifndef _X86_INCLUDE__ALIGN_H_ 42 | #define _X86_INCLUDE__ALIGN_H_ 43 | 44 | /* 45 | * Round p (pointer or byte index) up to a correctly-aligned value 46 | * for all data types (int, long, ...). The result is unsigned int 47 | * and must be cast to any desired pointer type. 48 | */ 49 | #define _ALIGNBYTES (sizeof(register_t) - 1) 50 | #define _ALIGN(p) (((uintptr_t)(p) + _ALIGNBYTES) & ~_ALIGNBYTES) 51 | 52 | #endif /* !_X86_INCLUDE__ALIGN_H_ */ 53 | -------------------------------------------------------------------------------- /include/xlocale.h: -------------------------------------------------------------------------------- 1 | // -*- C++ -*- 2 | //===-----------------------------------------------------------------------===// 3 | // 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 | // See https://llvm.org/LICENSE.txt for license information. 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #ifndef _LIBCPP_SUPPORT_OPENBSD_XLOCALE_H 11 | #define _LIBCPP_SUPPORT_OPENBSD_XLOCALE_H 12 | 13 | #include <__support/xlocale/__nop_locale_mgmt.h> 14 | #include <__support/xlocale/__posix_l_fallback.h> 15 | #include <__support/xlocale/__strtonum_fallback.h> 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /linker.x: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf64-x86-64") 2 | OUTPUT_ARCH(i386:x86-64) 3 | 4 | ENTRY(_start) 5 | 6 | PHDRS 7 | { 8 | /* 9 | * PF_X = 0x1 10 | * PF_W = 0x2 11 | * PF_R = 0x4 12 | */ 13 | 14 | ph_text PT_LOAD FLAGS (0x1 | 0x4); 15 | ph_data PT_LOAD FLAGS (0x2 | 0x4); 16 | } 17 | 18 | SECTIONS 19 | { 20 | __payload_base = .; 21 | 22 | .text : 23 | { 24 | KEEP (*(.init)) 25 | KEEP (*(.fini)) 26 | 27 | *(.text .text.*) 28 | 29 | . = ALIGN(4); 30 | } : ph_text = 0x90909090 31 | 32 | .rodata : 33 | { 34 | *(.rodata .rodata.*) 35 | 36 | . = ALIGN(4); 37 | } 38 | 39 | . = ALIGN(0x4000); 40 | 41 | .data : 42 | { 43 | *(.data .data.*) 44 | 45 | . = ALIGN(0x10); 46 | 47 | __imports_start = .; 48 | KEEP(*(.imports .imports.*)) 49 | __imports_end = .; 50 | 51 | __patches_start = .; 52 | KEEP(*(.patches .patches.*)) 53 | QUAD(0); BYTE(0); BYTE(0); 54 | __patches_end = .; 55 | 56 | __bss_start = .; 57 | *(.bss .bss.*) *(COMMON) 58 | __bss_end = .; 59 | 60 | . = . + 4; 61 | . = ALIGN(4); 62 | } : ph_data 63 | } 64 | -------------------------------------------------------------------------------- /source/syscall.s: -------------------------------------------------------------------------------- 1 | # Coded by John Törnblom + SiSTRo 2 | .intel_syntax noprefix 3 | 4 | .extern ptr_syscall 5 | 6 | .global f_syscall 7 | .type f_syscall @function 8 | 9 | f_syscall: 10 | mov rax, rdi 11 | mov rdi, rsi 12 | mov rsi, rdx 13 | mov rdx, rcx 14 | mov r10, r8 15 | mov r8, r9 16 | mov r9, qword ptr [rsp + 8] 17 | jmp qword ptr [rip + ptr_syscall] 18 | ret 19 | --------------------------------------------------------------------------------