Deleted Added
full compact
linux_sysvec.c (40237) linux_sysvec.c (40435)
1/*-
2 * Copyright (c) 1994-1996 S�ren Schmidt
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

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
1/*-
2 * Copyright (c) 1994-1996 S�ren Schmidt
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

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $Id: linux_sysvec.c,v 1.35 1998/10/05 16:37:36 jfieber Exp $
28 * $Id: linux_sysvec.c,v 1.36 1998/10/11 21:08:02 alex Exp $
29 */
30
31/* XXX we use functions that might not exist. */
32#include "opt_compat.h"
33
34#ifndef COMPAT_43
35#error "Unable to compile Linux-emulator due to missing COMPAT_43 option!"
36#endif

--- 10 unchanged lines hidden (view full) ---

47#include <sys/malloc.h>
48#include <vm/vm.h>
49#include <vm/vm_param.h>
50#include <vm/vm_prot.h>
51#include <vm/vm_page.h>
52#include <vm/vm_extern.h>
53#include <sys/exec.h>
54#include <sys/kernel.h>
29 */
30
31/* XXX we use functions that might not exist. */
32#include "opt_compat.h"
33
34#ifndef COMPAT_43
35#error "Unable to compile Linux-emulator due to missing COMPAT_43 option!"
36#endif

--- 10 unchanged lines hidden (view full) ---

47#include <sys/malloc.h>
48#include <vm/vm.h>
49#include <vm/vm_param.h>
50#include <vm/vm_prot.h>
51#include <vm/vm_page.h>
52#include <vm/vm_extern.h>
53#include <sys/exec.h>
54#include <sys/kernel.h>
55#include <sys/module.h>
55#include <machine/cpu.h>
56
57#include <i386/linux/linux.h>
58#include <i386/linux/linux_proto.h>
59
60static int linux_fixup __P((long **stack_base,
61 struct image_params *iparams));
62static int elf_linux_fixup __P((long **stack_base,

--- 379 unchanged lines hidden (view full) ---

442 };
443
444Elf32_Brandinfo *linux_brandlist[] = {
445 &linux_brand,
446 &linux_glibc2brand,
447 NULL
448 };
449
56#include <machine/cpu.h>
57
58#include <i386/linux/linux.h>
59#include <i386/linux/linux_proto.h>
60
61static int linux_fixup __P((long **stack_base,
62 struct image_params *iparams));
63static int elf_linux_fixup __P((long **stack_base,

--- 379 unchanged lines hidden (view full) ---

443 };
444
445Elf32_Brandinfo *linux_brandlist[] = {
446 &linux_brand,
447 &linux_glibc2brand,
448 NULL
449 };
450
450#ifndef LKM
451/*
452 * XXX: this is WRONG, it needs to be SI_SUB_EXEC, but this is just at the
453 * "proof of concept" stage and will be fixed shortly
454 */
451/*
452 * XXX: this is WRONG, it needs to be SI_SUB_EXEC, but this is just at the
453 * "proof of concept" stage and will be fixed shortly
454 */
455static void linux_elf_init __P((void *dummy));
455static int linux_elf_modevent __P((module_t mod, modeventtype_t type, void *data));
456
456
457static void
458linux_elf_init(dummy)
459 void *dummy;
457static int
458linux_elf_modevent(module_t mod, modeventtype_t type, void *data)
460{
461 Elf32_Brandinfo **brandinfo;
462 int error;
463
464 error = 0;
465
459{
460 Elf32_Brandinfo **brandinfo;
461 int error;
462
463 error = 0;
464
466 for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; ++brandinfo)
467 if (elf_insert_brand_entry(*brandinfo) < 0)
468 error = 1;
469
470 if (error)
471 printf("cannot insert Linux elf brand handler\n");
472 else if (bootverbose)
473 printf("Linux-ELF exec handler installed\n");
465 switch(type) {
466 case MOD_LOAD:
467 for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL;
468 ++brandinfo)
469 if (elf_insert_brand_entry(*brandinfo) < 0)
470 error = EINVAL;
471 if (error)
472 printf("cannot insert Linux elf brand handler\n");
473 else if (bootverbose)
474 printf("Linux-ELF exec handler installed\n");
475 break;
476 case MOD_UNLOAD:
477 for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL;
478 ++brandinfo)
479 if (elf_remove_brand_entry(*brandinfo) < 0)
480 error = EINVAL;
481 if (error)
482 printf("Could not deinstall ELF interpreter entry\n");
483 else if (bootverbose)
484 printf("Linux-elf exec handler removed\n");
485 break;
486 default:
487 break;
488 }
489 return error;
474}
490}
475
476SYSINIT(linuxelf, SI_SUB_VFS, SI_ORDER_ANY, linux_elf_init, NULL);
477#endif
491static moduledata_t linux_elf_mod = {
492 "linuxelf",
493 linux_elf_modevent,
494 0
495};
496DECLARE_MODULE(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);