summaryrefslogtreecommitdiffstats
path: root/sys/sys/sysent.h
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2008-11-22 12:36:15 +0000
committerkib <kib@FreeBSD.org>2008-11-22 12:36:15 +0000
commit8fad2283b3211a15c495b42689a5b65d91b96f3b (patch)
treec5e6cdb7219d5ec854c9a25a01e8ddfce232c5e9 /sys/sys/sysent.h
parent45f7975419230cdc3b0ba2cffb4b5fdebf5607bd (diff)
downloadFreeBSD-src-8fad2283b3211a15c495b42689a5b65d91b96f3b.zip
FreeBSD-src-8fad2283b3211a15c495b42689a5b65d91b96f3b.tar.gz
Add sv_flags field to struct sysentvec with intention to provide description
of the ABI of the currently executing image. Change some places to test the flags instead of explicit comparing with address of known sysentvec structures to determine ABI features. Discussed with: dchagin, imp, jhb, peter
Diffstat (limited to 'sys/sys/sysent.h')
-rw-r--r--sys/sys/sysent.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h
index 0ec07a7..c068946 100644
--- a/sys/sys/sysent.h
+++ b/sys/sys/sysent.h
@@ -100,8 +100,22 @@ struct sysentvec {
void (*sv_setregs)(struct thread *, u_long, u_long, u_long);
void (*sv_fixlimit)(struct rlimit *, int);
u_long *sv_maxssiz;
+ u_int sv_flags;
};
+#define SV_ILP32 0x000100
+#define SV_LP64 0x000200
+#define SV_IA32 0x004000
+#define SV_AOUT 0x008000
+
+#define SV_ABI_MASK 0xff
+#define SV_CURPROC_FLAG(x) (curproc->p_sysent->sv_flags & (x))
+#define SV_CURPROC_ABI() (curproc->p_sysent->sv_flags & SV_ABI_MASK)
+/* same as ELFOSABI_XXX, to prevent header pollution */
+#define SV_ABI_LINUX 3
+#define SV_ABI_FREEBSD 9
+#define SV_ABI_UNDEF 255
+
#ifdef _KERNEL
extern struct sysentvec aout_sysvec;
extern struct sysentvec elf_freebsd_sysvec;
OpenPOWER on IntegriCloud