diff -urN tux-ref/arch/alpha/kernel/entry.S tux/arch/alpha/kernel/entry.S --- tux-ref/arch/alpha/kernel/entry.S Mon Mar 11 05:56:47 2002 +++ tux/arch/alpha/kernel/entry.S Mon Mar 11 06:01:56 2002 @@ -988,7 +988,15 @@ .quad alpha_ni_syscall .quad alpha_ni_syscall /* 220 */ .quad alpha_ni_syscall +#ifdef CONFIG_TUX + .quad __sys_tux +#else +# ifdef CONFIG_TUX_MODULE + .quad sys_tux +# else .quad alpha_ni_syscall +# endif +#endif .quad alpha_ni_syscall .quad alpha_ni_syscall .quad alpha_ni_syscall /* 225 */ diff -urN tux-ref/arch/i386/kernel/entry.S tux/arch/i386/kernel/entry.S --- tux-ref/arch/i386/kernel/entry.S Mon Feb 25 22:05:04 2002 +++ tux/arch/i386/kernel/entry.S Mon Mar 11 06:01:56 2002 @@ -618,7 +618,15 @@ .long SYMBOL_NAME(sys_madvise) .long SYMBOL_NAME(sys_getdents64) /* 220 */ .long SYMBOL_NAME(sys_fcntl64) +#ifdef CONFIG_TUX + .long SYMBOL_NAME(__sys_tux) +#else +# ifdef CONFIG_TUX_MODULE + .long SYMBOL_NAME(sys_tux) +# else .long SYMBOL_NAME(sys_ni_syscall) /* reserved for TUX */ +# endif +#endif .long SYMBOL_NAME(sys_ni_syscall) /* Reserved for Security */ .long SYMBOL_NAME(sys_gettid) .long SYMBOL_NAME(sys_readahead) /* 225 */ diff -urN tux-ref/net/netsyms.c tux/net/netsyms.c --- tux-ref/net/netsyms.c Mon Feb 25 22:05:09 2002 +++ tux/net/netsyms.c Mon Mar 11 06:01:56 2002 @@ -56,7 +56,7 @@ extern struct net_proto_family inet_family_ops; -#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) || defined (CONFIG_KHTTPD) || defined (CONFIG_KHTTPD_MODULE) +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) || defined (CONFIG_KHTTPD) || defined (CONFIG_KHTTPD_MODULE) || defined (CONFIG_TUX) || defined (CONFIG_TUX_MODULE) #include #include #include @@ -295,7 +295,7 @@ #include EXPORT_SYMBOL(ip6_route_output); #endif -#if defined (CONFIG_IPV6_MODULE) || defined (CONFIG_KHTTPD) || defined (CONFIG_KHTTPD_MODULE) +#if defined (CONFIG_IPV6_MODULE) || defined (CONFIG_KHTTPD) || defined (CONFIG_KHTTPD_MODULE) || defined (CONFIG_TUX) || defined (CONFIG_TUX_MODULE) /* inet functions common to v4 and v6 */ EXPORT_SYMBOL(inet_release); EXPORT_SYMBOL(inet_stream_connect); @@ -587,5 +587,11 @@ EXPORT_SYMBOL(net_call_rx_atomic); EXPORT_SYMBOL(softnet_data); + +#ifdef CONFIG_TUX_MODULE +EXPORT_SYMBOL(tux_module_lock); +EXPORT_SYMBOL(tux_module); +EXPORT_SYMBOL(sys_tux_ptr); +#endif #endif /* CONFIG_NET */ diff -urN tux-ref/net/socket.c tux/net/socket.c --- tux-ref/net/socket.c Mon Mar 11 05:56:45 2002 +++ tux/net/socket.c Mon Mar 11 06:01:56 2002 @@ -1764,3 +1764,38 @@ len = 0; return len; } + +#ifdef CONFIG_TUX_MODULE + +int (*sys_tux_ptr) (unsigned int action, user_req_t *u_info) = NULL; + +struct module *tux_module = NULL; +spinlock_t tux_module_lock = SPIN_LOCK_UNLOCKED; + +asmlinkage int sys_tux (unsigned int action, user_req_t *u_info) +{ + int ret; + + if (current->tux_info) + return sys_tux_ptr(action, u_info); + + ret = -ENOSYS; + spin_lock(&tux_module_lock); + if (!tux_module) + goto out_unlock; + __MOD_INC_USE_COUNT(tux_module); + spin_unlock(&tux_module_lock); + + if (!sys_tux_ptr) + TUX_BUG(); + ret = sys_tux_ptr(action, u_info); + + spin_lock(&tux_module_lock); + __MOD_DEC_USE_COUNT(tux_module); +out_unlock: + spin_unlock(&tux_module_lock); + + return ret; +} + +#endif