diff options
author | marcel <marcel@FreeBSD.org> | 1999-12-04 11:10:22 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 1999-12-04 11:10:22 +0000 |
commit | ab78406859294ed692980f9adcf75ce70f7d9e6d (patch) | |
tree | 8269a72dd31266ff6a3e1a602005fb055f1d1450 /sys/i386/linux/linux_sysvec.c | |
parent | 7abb3f060ee61c8619560641712d72752a702cd7 (diff) | |
download | FreeBSD-src-ab78406859294ed692980f9adcf75ce70f7d9e6d.zip FreeBSD-src-ab78406859294ed692980f9adcf75ce70f7d9e6d.tar.gz |
Implement pluggable ioctl handlers.
Other modules can register and unregister ioctl handlers to extend the
ioctls known by the Linuxulator. A recent application is the vmware
port. The Linuxulator itself uses the new interface to register its
handlers as well. Handlers for the following types of ioctls have been
defined:
cdrom
console (=keyboard and VT handling)
socket
sound
termio
All ioctl related defines and declarations have been moved to a new
file (linux_ioctl.h), except for the pluggable ioctl handler interface
definition.
While there, cleanup linux.h some more.
linux.h and linux_ioctl.[ch] have been made to conform to style(9) as
much as possible.
Inspired and reviewed by: Vladimir N. Silyaev
Diffstat (limited to 'sys/i386/linux/linux_sysvec.c')
-rw-r--r-- | sys/i386/linux/linux_sysvec.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index eaf2a04..76be2b4 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -57,6 +57,15 @@ #include <i386/linux/linux.h> #include <i386/linux/linux_proto.h> +MALLOC_DEFINE(M_LINUX, "linux", "Linux mode structures"); + +extern char linux_sigcode[]; +extern int linux_szsigcode; + +extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL]; + +extern struct linker_set linux_ioctl_handler_set; + static int linux_fixup __P((long **stack_base, struct image_params *iparams)); static int elf_linux_fixup __P((long **stack_base, @@ -460,24 +469,27 @@ linux_elf_modevent(module_t mod, int type, void *data) switch(type) { case MOD_LOAD: for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; - ++brandinfo) + ++brandinfo) if (elf_insert_brand_entry(*brandinfo) < 0) error = EINVAL; if (error) printf("cannot insert Linux elf brand handler\n"); - else if (bootverbose) - printf("Linux-ELF exec handler installed\n"); + else { + linux_ioctl_register_handlers(&linux_ioctl_handler_set); + if (bootverbose) + printf("Linux-ELF exec handler installed\n"); + } break; case MOD_UNLOAD: + linux_ioctl_unregister_handlers(&linux_ioctl_handler_set); for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; - ++brandinfo) - if (elf_brand_inuse(*brandinfo)) { + ++brandinfo) + if (elf_brand_inuse(*brandinfo)) error = EBUSY; - } if (error == 0) { for (brandinfo = &linux_brandlist[0]; - *brandinfo != NULL; ++brandinfo) + *brandinfo != NULL; ++brandinfo) if (elf_remove_brand_entry(*brandinfo) < 0) error = EINVAL; } |