Annotation of coherent/f/usr/include/kernel/defer.h, revision 1.1.1.1

1.1       root        1: #ifndef        __KERNEL_DEFER_H__
                      2: #define        __KERNEL_DEFER_H__
                      3: 
                      4: /*
                      5:  *-IMPORTS:
                      6:  *     <common/ccompat.h>
                      7:  *             __EXTERN_C_BEGIN__
                      8:  *             __EXTERN_C_END__
                      9:  *             __PROTO ()
                     10:  *     <common/_cpuid.h>
                     11:  *             processorid_t
                     12:  */
                     13: 
                     14: #include <common/ccompat.h>
                     15: #include <kernel/_cpuid.h>
                     16: #include <kernel/_defer.h>
                     17: 
                     18: /*
                     19:  * An interesting facility is used in the Coherent kernel; called defer (), it
                     20:  * requests that a function (with a single argument) be called before return
                     21:  * to user level. It's a useful facility, but need some work to be useful for
                     22:  * a multiprocessor system. At the same time, it seems like a good idea to
                     23:  * alter it a litte; unfortunately, the facility suffers severe abuse from (a)
                     24:  * being used to solve problems of poor design such as not having interrupts
                     25:  * prioritized, and (b) being used as a global "solution" for synchronization
                     26:  * issues by moving parts of interrupt code out into base level, where no
                     27:  * thought need be given to synchronization. In this system, (a) has been
                     28:  * dealt with properly, and (b) synchronization issues *must* be dealt with in
                     29:  * a multiprocessor system properly.
                     30:  *
                     31:  * The version presented here has two aims; as a general mechanism for
                     32:  * deferring activity for "return to user level" time to reduce interrupt
                     33:  * latency, and as a mechanism for binding activities to specific processors.
                     34:  * A benefit of using this approach is simplifying the complex set of "before
                     35:  * we return to user level" features.
                     36:  *
                     37:  * Note that this version does not permit callback functions to take any
                     38:  * parameters, thus avoiding type problems (see bufcall () for some of these
                     39:  * that AT&T have foisted on us) and also discourages using it in fashion (b)
                     40:  * above. This could be changed if we find a genuine reason.
                     41:  */
                     42: 
                     43: 
                     44: __EXTERN_C_BEGIN__
                     45: 
                     46: int            defer_int_cpu   __PROTO ((__deffuncp_t _funcp,
                     47:                                          processorid_t _cpuid));
                     48: int            defer_int_any   __PROTO ((__deffuncp_t _funcp));
                     49: int            defer_int_here  __PROTO ((__deffuncp_t _funcp));
                     50: 
                     51: int            defer_proc_cpu  __PROTO ((__deffuncp_t _funcp,
                     52:                                          processorid_t _cpuid));
                     53: int            defer_proc_any  __PROTO ((__deffuncp_t _funcp));
                     54: int            defer_proc_here __PROTO ((__deffuncp_t _funcp));
                     55: 
                     56: __EXTERN_C_END__
                     57: 
                     58: 
                     59: #endif /* ! defined (__KERNEL_DEFER_H__) */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.