summaryrefslogtreecommitdiffstats
path: root/sys/sys/sysent.h
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2011-01-08 16:13:44 +0000
committerkib <kib@FreeBSD.org>2011-01-08 16:13:44 +0000
commit06eb8de1e11605ee7d4ae2e5c58cdadccc659f0d (patch)
tree89f01dcb94af1295c1d16e6a0cf6aa53ea8dcefc /sys/sys/sysent.h
parent12d561f88acf9296f4d7f1ba98ad4d9a8da70bf3 (diff)
downloadFreeBSD-src-06eb8de1e11605ee7d4ae2e5c58cdadccc659f0d.zip
FreeBSD-src-06eb8de1e11605ee7d4ae2e5c58cdadccc659f0d.tar.gz
Create shared (readonly) page. Each ABI may specify the use of page by
setting SV_SHP flag and providing pointer to the vm object and mapping address. Provide simple allocator to carve space in the page, tailored to put the code with alignment restrictions. Enable shared page use for amd64, both native and 32bit FreeBSD binaries. Page is private mapped at the top of the user address space, moving a start of the stack one page down. Move signal trampoline code from the top of the stack to the shared page. Reviewed by: alc
Diffstat (limited to 'sys/sys/sysent.h')
-rw-r--r--sys/sys/sysent.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index e726fce..55cac2b 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -116,12 +116,17 @@ struct sysentvec {
int (*sv_fetch_syscall_args)(struct thread *, struct
syscall_args *);
const char **sv_syscallnames;
+ vm_offset_t sv_shared_page_base;
+ vm_offset_t sv_shared_page_len;
+ vm_offset_t sv_sigcode_base;
+ void *sv_shared_page_obj;
};
#define SV_ILP32 0x000100
#define SV_LP64 0x000200
#define SV_IA32 0x004000
#define SV_AOUT 0x008000
+#define SV_SHP 0x010000
#define SV_ABI_MASK 0xff
#define SV_CURPROC_FLAG(x) (curproc->p_sysent->sv_flags & (x))
@@ -222,6 +227,13 @@ int lkmressys(struct thread *, struct nosys_args *);
int syscall_thread_enter(struct thread *td, struct sysent *se);
void syscall_thread_exit(struct thread *td, struct sysent *se);
+int shared_page_fill(int size, int align, const char *data);
+void exec_sysvec_init(void *param);
+
+#define INIT_SYSENTVEC(name, sv) \
+ SYSINIT(name, SI_SUB_EXEC, SI_ORDER_ANY, \
+ (sysinit_cfunc_t)exec_sysvec_init, sv);
+
#endif /* _KERNEL */
#endif /* !_SYS_SYSENT_H_ */
OpenPOWER on IntegriCloud