From c3b27201d1fa4f0149196757101c35192e8d247c Mon Sep 17 00:00:00 2001 From: obrien Date: Sun, 5 Nov 2000 10:41:35 +0000 Subject: ELF kernels should use an ELF sysvec. This allows us to move a.out specific files to those platforms that acutally support a.out. --- sys/conf/files | 3 --- sys/conf/files.i386 | 3 +++ sys/kern/imgact_elf.c | 2 +- sys/kern/init_main.c | 4 ++++ sys/sys/sysent.h | 1 + 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index a9e93bd..5a13ace 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -598,9 +598,7 @@ isofs/cd9660/cd9660_rrip.c optional cd9660 isofs/cd9660/cd9660_util.c optional cd9660 isofs/cd9660/cd9660_vfsops.c optional cd9660 isofs/cd9660/cd9660_vnops.c optional cd9660 -kern/imgact_aout.c standard kern/imgact_elf.c standard -kern/imgact_gzip.c optional gzip kern/imgact_shell.c standard kern/inflate.c optional gzip kern/init_main.c standard @@ -646,7 +644,6 @@ kern/kern_threads.c standard kern/kern_time.c standard kern/kern_timeout.c standard kern/kern_xxx.c standard -kern/link_aout.c standard kern/link_elf.c standard kern/md5c.c standard kern/subr_autoconf.c standard diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index 1ac09b9..493fa07 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -351,6 +351,9 @@ isa/psm.c optional psm isa/sio.c count sio isa/syscons_isa.c optional sc isa/vga_isa.c optional vga +kern/imgact_aout.c standard +kern/imgact_gzip.c optional gzip +kern/link_aout.c standard kern/subr_diskmbr.c standard libkern/divdi3.c standard libkern/moddi3.c standard diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 1ab4181..069bc9a 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -84,7 +84,7 @@ static int exec_elf_imgact __P((struct image_params *imgp)); static int elf_trace = 0; SYSCTL_INT(_debug, OID_AUTO, elf_trace, CTLFLAG_RW, &elf_trace, 0, ""); -static struct sysentvec elf_freebsd_sysvec = { +struct sysentvec elf_freebsd_sysvec = { SYS_MAXSYSCALL, sysent, 0, diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 344dac2..de702bc 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -295,7 +295,11 @@ proc0_init(void *dummy __unused) session0.s_count = 1; session0.s_leader = p; +#ifdef __ELF__ + p->p_sysent = &elf_freebsd_sysvec; +#else p->p_sysent = &aout_sysvec; +#endif p->p_flag = P_INMEM | P_SYSTEM; p->p_stat = SRUN; diff --git a/sys/sys/sysent.h b/sys/sys/sysent.h index 15dbdbf..fc06f77 100644 --- a/sys/sys/sysent.h +++ b/sys/sys/sysent.h @@ -84,6 +84,7 @@ struct sysentvec { #ifdef _KERNEL extern struct sysentvec aout_sysvec; +extern struct sysentvec elf_freebsd_sysvec; extern struct sysent sysent[]; #define NO_SYSCALL (-1) -- cgit v1.1