2 * Copyright (c) 1982, 1990 The Regents of the University of California.
5 * This code is derived from software contributed to Berkeley by
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
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.
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
35 #include "opt_compat.h"
36 #include "opt_kstack_pages.h"
38 #include <sys/param.h>
39 #include <sys/systm.h>
40 #include <sys/assym.h>
44 #include <sys/errno.h>
46 #include <sys/mount.h>
47 #include <sys/socket.h>
48 #include <sys/resource.h>
49 #include <sys/resourcevar.h>
50 #include <sys/ucontext.h>
51 #include <machine/frame.h>
52 #include <machine/mutex.h>
53 #include <machine/elf.h>
54 #include <machine/pal.h>
55 #include <machine/pcb.h>
56 #include <sys/vmmeter.h>
58 #include <vm/vm_param.h>
60 #include <vm/vm_map.h>
62 #include <netinet/in.h>
64 #ifdef COMPAT_FREEBSD32
65 ASSYM(COMPAT_FREEBSD32, COMPAT_FREEBSD32);
68 ASSYM(DT_NULL, DT_NULL);
69 ASSYM(DT_RELA, DT_RELA);
70 ASSYM(DT_RELAENT, DT_RELAENT);
71 ASSYM(DT_RELASZ, DT_RELASZ);
72 ASSYM(DT_SYMTAB, DT_SYMTAB);
73 ASSYM(DT_SYMENT, DT_SYMENT);
75 ASSYM(EFAULT, EFAULT);
76 ASSYM(ENAMETOOLONG, ENAMETOOLONG);
77 ASSYM(ERESTART, ERESTART);
79 ASSYM(FRAME_SYSCALL, FRAME_SYSCALL);
81 ASSYM(IA64_ID_PAGE_SHIFT, IA64_ID_PAGE_SHIFT);
83 ASSYM(KSTACK_PAGES, KSTACK_PAGES);
85 ASSYM(MC_PRESERVED, offsetof(mcontext_t, mc_preserved));
86 ASSYM(MC_PRESERVED_FP, offsetof(mcontext_t, mc_preserved_fp));
87 ASSYM(MC_SPECIAL, offsetof(mcontext_t, mc_special));
88 ASSYM(MC_SPECIAL_BSPSTORE, offsetof(mcontext_t, mc_special.bspstore));
89 ASSYM(MC_SPECIAL_RNAT, offsetof(mcontext_t, mc_special.rnat));
91 ASSYM(PAGE_SHIFT, PAGE_SHIFT);
92 ASSYM(PAGE_SIZE, PAGE_SIZE);
94 ASSYM(PC_CURRENT_PMAP, offsetof(struct pcpu, pc_md.current_pmap));
95 ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
96 ASSYM(PC_IDLETHREAD, offsetof(struct pcpu, pc_idlethread));
98 ASSYM(PCB_CURRENT_PMAP, offsetof(struct pcb, pcb_current_pmap));
99 ASSYM(PCB_ONFAULT, offsetof(struct pcb, pcb_onfault));
100 ASSYM(PCB_SPECIAL_RP, offsetof(struct pcb, pcb_special.rp));
102 ASSYM(R_IA_64_DIR64LSB, R_IA_64_DIR64LSB);
103 ASSYM(R_IA_64_FPTR64LSB, R_IA_64_FPTR64LSB);
104 ASSYM(R_IA_64_NONE, R_IA_64_NONE);
105 ASSYM(R_IA_64_REL64LSB, R_IA_64_REL64LSB);
107 ASSYM(SIZEOF_PCB, sizeof(struct pcb));
108 ASSYM(SIZEOF_SPECIAL, sizeof(struct _special));
109 ASSYM(SIZEOF_TRAPFRAME, sizeof(struct trapframe));
111 ASSYM(TD_FLAGS, offsetof(struct thread, td_flags));
112 ASSYM(TD_KSTACK, offsetof(struct thread, td_kstack));
113 ASSYM(TD_PCB, offsetof(struct thread, td_pcb));
115 ASSYM(TDF_ASTPENDING, TDF_ASTPENDING);
116 ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED);
118 ASSYM(UC_MCONTEXT, offsetof(ucontext_t, uc_mcontext));
120 ASSYM(VM_MAX_ADDRESS, VM_MAX_ADDRESS);