diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:43:11 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 19:43:11 +0000 |
commit | fc22b3d6507c6745911b9dfcc68f1e665ae13dbc (patch) | |
tree | ce1e3bce06471410239a6f41282e328770aa404a /upstream/mageia-cauldron/man9 | |
parent | Initial commit. (diff) | |
download | manpages-l10n-fc22b3d6507c6745911b9dfcc68f1e665ae13dbc.tar.xz manpages-l10n-fc22b3d6507c6745911b9dfcc68f1e665ae13dbc.zip |
Adding upstream version 4.22.0.upstream/4.22.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'upstream/mageia-cauldron/man9')
41 files changed, 3114 insertions, 0 deletions
diff --git a/upstream/mageia-cauldron/man9/MAJOR.9 b/upstream/mageia-cauldron/man9/MAJOR.9 new file mode 100644 index 00000000..b322981a --- /dev/null +++ b/upstream/mageia-cauldron/man9/MAJOR.9 @@ -0,0 +1,87 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Stephen Williams <steve@icarus.com> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH MAJOR 9 "$Date:$" "Linux DDI" "Kernel Functions" +.\" +.\" Turn off hyphenation and right justification for the first sections. +.hlm 0 +.na +.\" The name should be formatted this way for apropos to work +.SH NAME +MAJOR, MINOR, MKDEV \- macros to manipulate device major/minor numbers +.\" +.\" +.SH SYNOPSIS +.B #include <linux/fs.h> +.sp +.BI "#define MAJOR(" dev ")" +.br +.BI "#define MINOR(" dev ")" +.br +.BI "#define MKDEV(" major ", " minor ")" +.HP +.\" +.\" Turn hyphenation and adjustment back on. +.hlm 1 +.ad +.SH DESCRIPTION +The +.B MAJOR +and +.B MINOR +macros extract from a device id (of type +.IR dev_t ) +the major and minor numbers respectively. It is the combined device +number that is found in the +.B "struct~file" +structure. +.PP +The +.B MKDEV +macro assembles a device number from the supplied major and minor +numbers. +.SH "RETURN VALUE" +Describe the return values. Enumerate all the distinct values and all +the ranges. +.SH AVAILABILITY +Linux 0.0+ +.PP +In later kernels (Linux 2.1 and later) there is movement towards using +64bit device numbers. Although it is generally a good idea to not +presume to know how device numbers are constructed, it is during this +period of transition fundamentally important that you ONLY use these +functions to manipulate device numbers. +.SH "SEE ALSO" +.hlm 0 +.na +.BR mknod "(1)" +.ad +.hlm 1 +.PP +Also list some source files for the +kernel that implement the functions of the page. +.SH AUTHOR +Stephen Williams <steve@icarus.com> +.SH BUGS +These are macros, so parameters may be evaluated multiple times. diff --git a/upstream/mageia-cauldron/man9/MAP_NR.9 b/upstream/mageia-cauldron/man9/MAP_NR.9 new file mode 100644 index 00000000..a43d3b63 --- /dev/null +++ b/upstream/mageia-cauldron/man9/MAP_NR.9 @@ -0,0 +1,76 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Stephen Williams <steve@icarus.com> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH skel 9 "$Date:$" "Linux DDI" "VM Functions" +.\" +.\" Turn off hyphenation and right justification for the first sections. +.hlm 0 +.na +.\" The name should be formatted this way for apropos to work +.SH NAME +MAP_NR \- get memory map index for page in kernel memory +.\" +.\" +.SH SYNOPSIS +.B #include <linux/mm.h> +.sp +.BI "#define MAP_NR(" page ")" +.HP +.\" +.\" Turn hyphenation and adjustment back on. +.hlm 1 +.ad +.SH DESCRIPTION +This macro maps the page of kernel memory to an index into the +.B mem_map +array. The input page is kernel-space page addresses such as those +that come from the +.BR get_free_page "(9)" +function. The expression +.I "mem_map[MAP_NR(page)]" +returns a pointer to a +.I mem_map_t +for the page in question. +.PP +Device drivers need access to the page structure if it is implimenting +some special kind of memory segment, i.e. cache for a virtual frame buffer. +.SH "RETURN VALUE" +Returns an index into the +.B mem_map +array. +.SH AVAILABILITY +Linux 2.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR get_free_pages "(9)" +.ad +.hlm 1 +.PP +.I "/usr/include/asm/page.h" +.SH AUTHOR +Stephen Williams <steve@icarus.com> +.SH BUGS +There is no check that the page you are passing really is a valid page +address. diff --git a/upstream/mageia-cauldron/man9/MOD_INC_USE_COUNT.9 b/upstream/mageia-cauldron/man9/MOD_INC_USE_COUNT.9 new file mode 100644 index 00000000..e3509b80 --- /dev/null +++ b/upstream/mageia-cauldron/man9/MOD_INC_USE_COUNT.9 @@ -0,0 +1,65 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Stephen Williams <steve@icarus.com> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH MOD_INC_USE_COUNT 9 "$Date:$" "Linux DDI" "Kernel Functions" +.SH NAME +MOD_INC_USE_COUNT, MOD_DEC_USE_COUNT \- Support reference counting of modules +.SH SYNOPSIS +.B #include <linux/module.h> +.sp +.B #define MOD_INC_USE_COUNT +.br +.B #define MOD_DEC_USE_COUNT +.SH DESCRIPTION +These macros support reference counting of modules during their +lifetime. Each time +.BR MOD_INC_USE_COUNT "(9)" +is invoked, the kernel increases the number of counted references to +the module. The +.BR MOD_DEC_USE_COUNT "(9)" +decreases the reference count. +.PP +The reference count is used by the kernel to know when a module is no +longer in use by the device or application software. A +.BR MOD_INC_USE_COUNT "(9)" +is generally placed in the open entry for a driver, and a +.BR MOD_DEC_USE_COUNT "(9)" +in the release for the driver, +to count the number of times the device has been opened, and thus +prevent the module being unloaded when in use. The device driver may +increment the use count other times, such as when memory is mapped or +the module must remain loaded for external events. +.PP +If the device driver is not compiled as a module +.IR "" ( MODULE +is not defined) then the macro reduces to no behavior. +.SH "RETURN VALUE" +These macros take no parameters and return no result. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.I "/usr/include/linux/module.h" +.SH AUTHOR +Stephen Williams <steve@icarus.com> +.SH BUGS diff --git a/upstream/mageia-cauldron/man9/atomic_add.9 b/upstream/mageia-cauldron/man9/atomic_add.9 new file mode 100644 index 00000000..dce43cb1 --- /dev/null +++ b/upstream/mageia-cauldron/man9/atomic_add.9 @@ -0,0 +1,90 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Stephen Williams <steve@icarus.com> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH atomic_add 9 "$Date:$" "Linux DDI" "Kernel Functions" +.\" +.\" Turn off hyphenation and right justification for the first sections. +.hlm 0 +.na +.\" The name should be formatted this way for apropos to work +.SH NAME +atomic_add, atomic_sub, atomic_inc, atomic_dec \- thread/SMP safe arithmetic on atomic data +.\" +.\" +.SH SYNOPSIS +.B #include <asm/atomic.h> +.sp +.BI "void atomic_add(int " i ", volatile atomic_t*" v ")" +.br +.BI "void atomic_sub(int " i ", volatile atomic_t*" v ")" +.br +.BI "void atomic_inc(volatile atomic_t*" v ")" +.br +.BI "void atomic_dec(volatile atomic_t*" v ")" +.br +.BI "int atomic_read(volatile atomic_t*" v ")" +.br +.BI "void atomic_set(volatile atomic_t*" v ", int " i ")" +.br +.BI "int atomic_dec_and_test(volatile atomic_t*" v ")" +.HP +.\" +.\" Turn hyphenation and adjustment back on. +.hlm 1 +.ad +.SH DESCRIPTION +These functions manipulate variables of type +.B atomic_t +is SMP and interrupt safe ways. These variables can be used to hold +spin locks or SMP-safe reference counters. These functions guarantee +that the operation that they represent is performed correctly. If +necessary, hardware bus locking is performed to protect the operation. +Usually, the CPU has some sort of atomic instructions that allow these +operations to be performed quickly and safely. +.PP +The +.B atomic_dec_and_test +decrements the atomic variable, and returns true if the result is +zero. This function is particularly useful in implementing spin locks +on SMP systems. +.SH "RETURN VALUE" +The +.B atomic_read +function returns the integer value of the atomic variable. +.PP +The +.B atomic_dec_and_test +returns TRUE if the value becomes zero after the decrement. +.SH AVAILABILITY +Linux 2.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR intro "(9)" +.ad +.hlm 1 +.SH AUTHOR +Stephen Williams <steve@icarus.com> +.SH BUGS +The read and set operations generally have no special protections. diff --git a/upstream/mageia-cauldron/man9/cli.9 b/upstream/mageia-cauldron/man9/cli.9 new file mode 100644 index 00000000..5ec26161 --- /dev/null +++ b/upstream/mageia-cauldron/man9/cli.9 @@ -0,0 +1,37 @@ +.\" -*- nroff -*- +.TH cli 9 "$Date:$" "Linux DDI" "Kernel Functions" +.SH NAME +cli, sti \- disable/enable interrupts +.SH SYNOPSIS +.B #include <asm/system.h> +.sp +.BI "extern void cli()" +.br +.BI "extern void sti()" +.SH DESCRIPTION +The +.B cli +function causes interrupts to be blocked on the host, so that +following critical code may run uninterrupted. The +.B sti +function enables interrupts again. +.PP +Although it is possible to use cli/sti pairs to protect critical code, +it is best to use +.B cli +with the +.B save_flags +macro. See +.B save_flags "(9)." +.SH "RETURN VALUE" +none +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.BR save_flags "(9)" +.PP +.IR "include/asm-*/system.h" +.SH AUTHOR +Stephen Williams (steve@icarus.com) +.SH BUGS +The i386 ancestry of the names can be slightly confusing. diff --git a/upstream/mageia-cauldron/man9/init_bh.9 b/upstream/mageia-cauldron/man9/init_bh.9 new file mode 100644 index 00000000..9a1aac8a --- /dev/null +++ b/upstream/mageia-cauldron/man9/init_bh.9 @@ -0,0 +1,188 @@ +.\" -*- nroff -*- +.TH INIT_BH 9 "1997/08/14 07:53:12" "Linux DDI 2.1.48" "Linux Kernel Functions" +.\" copyright (C) 1997 Neil Moore <amethyst@maxwell.ml.org> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. + +.\" Turn off hyphentation +.hlm 0 +.\" Turn off adjustment +.na +.SH NAME +init_bh, remove_bh, mark_bh, disable_bh, enable_bh \- split-half interrupt handling +.SH SYNOPSIS +.B #include <linux/interrupt.h> +.\" To keep all components of a declaration together, escape all white +.\" space except after a comma. In case the proc name plus the first +.\" declaration is too long for one line, allow a break after '(' by +.\" adding '\%'. +.HP +.BI "void\ init_bh(int " nr ", void\ (*" routine ")(void));" +.\" We don't want an inter-paragraph space between the two declarations, +.\" but we have to end the paragraph to stop the hanging indent. .PD 0 +.\" gets rid of inter-paragraph spacing +.PD 0 +.HP +.BI "void\ remove_bh(int\ " nr ");" +.HP +.BI "void\ mark_bh(int\ " nr ");" +.HP +.BI "void\ disable_bh(int\ " nr ");" +.HP +.BI "void\ enable_bh(int\ " nr ");" +.\" And set it back to normal now +.PD 1 +.\" Back to standard adjustment +.ad +.\" Allow hypenation, omit if you want no hyphenation in the man page +.hlm 1 +.SH DESCRIPTION +.SS Theory +.PP +Split-half handling is a means of dividing an interrupt handler into two +sections, one of which (known as the \(oqtop half') is time-critical and +one of which (the \(oqbottom half') is not. +.PP +The top half (the handler registered with +.BR "request_irq" "(9))" +normally moves data between the device and a memory buffer, ensures that the +device is in a sane state, and little else. While the top half of a handler +is running, the IRQ is question is blocked; if it is a fast interrupt handler +(i.e., it has +.B SA_INTERRUPT +set), all interrupts are disabled. +.PP +The bottom half does whatever remains to be done. Bottom halves run with +interrupts enabled, although a locking mechanism ensures that only one +bottom half will be running at a given time. Bottom halves are run by +.BR do_bottom_half() , +which is called from +.B schedule() +and +.BR ret_from_sys_call() ". " +.SS Usage +.PP +.B init_bh() +installs +.I routine() +as bottom half number +.IR nr ". " +It operates by adding an entry to the +.B bh_base[] +table, and setting the appropriate bit of the +.B bh_mask +vector. Rather than specifying a number explicitly, one should add an entry +to the anonymous enum in +.IR "include/linux/interrupt.h" ". " +.PP +.B remove_bh() +removes bottom half number +.I nr +from the list of bottom halves. It removes the entry from +.B bh_base[] +and clears the appropriate bit of +.BR bh_mask ". " +.PP +.B mark_bh() +requests that the kernel run the specified bottom half at the first available +opportunity. This function is normally called from the top half of an interrupt +handler. It operates by setting the appropriate bit of the +.B bh_active +vector. +.PP +.B disable_bh() +disables bottom half number +.I nr +by clearing the appropriate bit of +.BR bh_mask . +This function also increments +.BI bh_mask_count[ nr ]\fR, +which is used to ensure that nested calls to +.B disable_bh() +must be matched by an equal number of calls to +.BR enable_bh() . +.PP +.B enable_bh() +enables a bottom half previously disabled by +.BR disable_bh() . +This function decrements +.BI bh_mask_count[ nr ]\fR. +Then, if that value is zero, the specified bottom half is enabled +by setting the appropriate bit of +.BR bh_mask . +.SH "RETURN VALUE" +No value is returned. +.SH AVAILABILITY +Linux 2.0+. +.B init_bh() +and +.B remove_bh() +were not present in older versions on Linux. Under those versions, +.B bh_base[] +and +.B bh_mask +must be modified by hand. +.SH "SEE ALSO" +.BR request_irq "(9), " queue_task "(9)" +.PP +.IR include/asm*/softirq.h ", " include/linux/interrupt.h ", " kernel/softirq.c +.PP +\(lqKernel Korner\(rq in issue 26 of +.I The Linux Journal +includes a discussion of split-half interrupts under Linux. An online copy of +this article can be found at +.BR http://www.ssc.com/lj/issue26/interrupt.html . +.SH AUTHOR +.RI "Neil Moore <" amethyst@maxwell.ml.org ">" +.SH BUGS +Only 32 bottom halves are allowed. Increasing this number requires changing +the size of +.B bh_base[] +and +.BI bh_mask_count[] +in +.IR kernel/softirq.c, +and changing +.B bh_active +and +.B bh_mask +(in the same file) to a larger type. A better solution, however, would be to +consolidate multiple bottom halves into a single one by using task queues. +See +.BR queue_task (9) +for details. +.\" +.\" init_bh.9,v +.\" Revision 1.4 1997/08/14 07:53:12 amethyst +.\" Formatting changes. +.\" +.\" Revision 1.3 1997/08/08 16:40:50 amethyst +.\" Updated for 2.1.48 -- init_bh() and friends are now available again on the PPC. +.\" +.\" Revision 1.2 1997/07/27 09:39:45 amethyst +.\" Changed some wording. +.\" Fixed a few typographical warts. +.\" Added email address to copyright notice. +.\" +.\" Revision 1.1 1997/07/27 09:27:17 amethyst +.\" Initial revision +.\" +.\" diff --git a/upstream/mageia-cauldron/man9/init_module.9 b/upstream/mageia-cauldron/man9/init_module.9 new file mode 100644 index 00000000..c582c168 --- /dev/null +++ b/upstream/mageia-cauldron/man9/init_module.9 @@ -0,0 +1,90 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Stephen Williams <steve@icarus.com> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH init_module 9 "$Date:$" "Linux DDI" "Kernel Functions" +.\" +.\" Turn off hyphenation and right justification for the first sections. +.hlm 0 +.na +.\" The name should be formatted this way for apropos to work +.SH NAME +init_module, cleanup_module \- module load and unload functions +.\" +.\" +.SH SYNOPSIS +.B #include <linux/module.h> +.br +.B #include <linux/modversions.h> +.sp +.BI "int init_module(void);" +.br +.BI "void cleanup_module(void);" +.HP +.\" +.\" Turn hyphenation and adjustment back on. +.hlm 1 +.ad +.SH DESCRIPTION +These functions are not part of the kernel but entry points into +loadable modules. These are the only symbols that must be externally +defined in order to load a module into a running kernel. +.PP +When a module is loaded into a running kernel, the +.BR init_module "(9)" +function within that object file is called to set up the module. The +implementation of that function initializes local features and +uses functions such as +.BR register_chrdev "(9)" +to attach itself to the kernel. It then returns zero(0) if it +succeeds. If there is a problem or the module decides that it cannot +be loaded, it returns instead an error code (i.e. +.IR -ENODEV ) +and the kernel releases the module again. +.PP +Once loaded, the +.BR cleanup_module "(9)" +function of a module is used by the kernel to remove the module +again. The module detaches itself from the kernel and returns. +.SH "RETURN VALUE" +The +.BR init_module "(9)" +function returns 0 on success, or an error code <0 if the module +cannot be initialized. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR MOD_INC_USE_COUNT "(9), " insmod "(1)" +.ad +.hlm 1 +.PP +Also list some source files for the +kernel that implement the functions of the page. +.SH AUTHOR +Stephen Williams <steve@icarus.com> +.SH BUGS +It is entirely up to the driver to be sure it is detached from the +kernel when unloaded. If a module makes an error in this regard, bad +things may happen. diff --git a/upstream/mageia-cauldron/man9/intro.9 b/upstream/mageia-cauldron/man9/intro.9 new file mode 100644 index 00000000..1b64e096 --- /dev/null +++ b/upstream/mageia-cauldron/man9/intro.9 @@ -0,0 +1,177 @@ +.\" -*- nroff -*- +.TH intro 9 "July 1997" "Linux DDI" "Linux DDI" + +.\" Copyright 1997 Stephen Williams + +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. + +.SH NAME +intro \- Introduction to kernel interface +.SH SYNOPSIS +.B #include <linux/version.h> +.SH DESCRIPTION +This section documents the functions available to device driver +writers and kernel level modules. The functions are of interest mainly +to device driver writers, although anyone considering running code in +linux kernel mode may need to be familiar with these interfaces. +.PP +Some of the functions of the DDI exist only in certain versions of the +kernel. Use the +.B LINUX_VERSION_CODE +macro to test for specific versions of the kernel. For example, to use +a feature that is new to 2.1, say: +.PP +.nf +#if LINUX_VERSION_CODE >= 0x020100 + ... use new stuff ... +#else + ... do it the old way ... +#endif +.fi +.PP +The following is a list of the man pages, divided roughly into +function groups. +.SS "Kernel Functions" +These are general kernel functions. +.RS +.TP +MAJOR +.TP +MOD_INC_USE_COUNT +.TP +cli +.TP +init_bh +.TP +init_module +.TP +kmalloc +.TP +poll_wait +.TP +printk +.TP +probe_irq_on +.TP +register_chrdev +.TP +register_console +.TP +request_irq +.TP +save_flags +.TP +sleep_on +.TP +wake_up +.RE +.SS "/proc functions" +These functions relate to manipulation of the +.B /proc +filesystem. +.RS +.TP +proc_dir_entry +.TP +proc_net_register +.TP +proc_scsi_register +.RE +.SS "BIOS32 functions" +These are specific to PCI (BIOS32) support. +.RS +.TP +pcibios_find_class +.TP +pcibios_present +.TP +pcibios_read_config_byte +.TP +pcibios_read_config_dword +.TP +pcibios_read_config_word +.TP +pcibios_strerror +.TP +pcibios_write_config_byte +.TP +pcibios_write_config_dword +.TP +pcibios_write_config_word +.RE +.SS "VM functions" +These are functions that support manipulating the virtual memory +subsystem. +.RS +.TP +MAP_NR +.TP +mem_map_reserve +.RE +.SS "Network Functions" +.RS +.TP +skb_dequeue +.TP +skb_insert +.TP +skb_peek +.TP +skb_queue_empty +.TP +skb_queue_head +.TP +skb_queue_head_init +.TP +skb_queue_len +.TP +skb_queue_tail +.TP +skb_unlink +.RE +.SH AVAILABILITY +Each man page attempts to list the kernel versions where the function +is available. If the form of the function changes, this section tells +when the described form applies. +.SH "SEE ALSO" +This section lists other man pages that may be of interest. Also, +interesting source files in the linux kernel may be listed here. +.SH AUTHORS +Each man page has a section like this one that lists the author(s) who +contributed significantly to that page. Other unnamed individuals may +also have contributed corrections, editorial, etc. +.PP +Major contributors are (in alphabetical order) +Cyrus Durgin <cider@speakeasy.org>, +Niel Moore <amethyst@maxwell.ml.org>, +Keith Owens <kaos@ocs.com.au>, +Kirk Petersen <kirk@speakeasy.org>, +and Stephen Williams <steve@icarus.com>. +.PP +Editorial, and this intro page, were done by Stephen Williams +<steve@icarus.com>. +.SH BUGS +The living linux kernel is a moving target, and the kernel functions +are unique to linux. Therefore, although the editor and contributers +make a good effort to be as accurate as possible, errors may +exist. The source codes of the linux kernel are the ultimate authority +on the behavior of any function and should be considered the final +word. diff --git a/upstream/mageia-cauldron/man9/kmalloc.9 b/upstream/mageia-cauldron/man9/kmalloc.9 new file mode 100644 index 00000000..5bde08e5 --- /dev/null +++ b/upstream/mageia-cauldron/man9/kmalloc.9 @@ -0,0 +1,39 @@ +.\" -*- nroff -*- +.TH kmalloc 9 "Aug 3, 1997" "Linux" "Kernel Functions" +.SH NAME +kmalloc, kfree \- allocate and free pieces of memory +.SH SYNOPSIS +.B #include <linux/malloc.h> +.sp +.BI "void * kmalloc (size_t " size ", int " priority ");" +.br +.BI "void kfree (void * " __ptr ");" +.SH DESCRIPTION +The +.B kmalloc +function allocates a piece of memory. +.PP +The parameter +.I size +is the number of bytes that will be allocated. The parameter +.I priority +indicates the importance and type of the memory request. Some +possible values are GFP_DMA, GFP_ATOMIC, GFP_BUFFER, and GFP_NFS. +.PP +The +.B kfree +function releases a piece of memory that is passed as the +.I __ptr +parameter. +.SH "RETURN VALUE" +On success, +.B kmalloc +returns a pointer to the newly allocated memory. +.PP +If there is an error, NULL is returned instead. +.PP +.SH AVAILABILITY +Linux 2.0 +.SH AUTHOR +Kirk Petersen (kirk@speakeasy.org) +.SH BUGS diff --git a/upstream/mageia-cauldron/man9/mem_map_reserve.9 b/upstream/mageia-cauldron/man9/mem_map_reserve.9 new file mode 100644 index 00000000..d46dae87 --- /dev/null +++ b/upstream/mageia-cauldron/man9/mem_map_reserve.9 @@ -0,0 +1,77 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Stephen Williams <steve@icarus.com> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH skel 9 "$Date:$" "Linux DDI" "VM Functions" +.\" +.\" Turn off hyphenation and right justification for the first sections. +.hlm 0 +.na +.\" The name should be formatted this way for apropos to work +.SH NAME +mem_map_reserve, mem_map_unreserve \- Manipulate flags of virtual memory pages. +.\" +.\" +.SH SYNOPSIS +.B #include <linux/mm.h> +.br +.B #include <linux/wrapper.h> +.sp +.BI "#define mem_map_reserve(" page_nr ")" +.br +.BI "#define mem_map_unreserve(" page_nr ")" +.HP +.\" +.\" Turn hyphenation and adjustment back on. +.hlm 1 +.ad +.SH DESCRIPTION +These macros cause a page to become reserved/unreserved. A reserved +page is reserved from any further consideration by the linux kernel, +meaning it is not scanned as potentially pageable, or available for +page allocation. The kernel treats reserved pages as memory-mapped +hardware. +.PP +It makes sense for a driver to mark a page reserved, for example, if +the driver supports +.BR mmap "(2)" +with dynamically allocated pages that the target device can access via +DMA. +.SH "RETURN VALUE" +None +.SH AVAILABILITY +Linux 2.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR MAP_NR "(9), " get_free_pages "(9), " mmap "(2)" +.ad +.hlm 1 +.SH AUTHOR +Stephen Williams <steve@icarus.com> +.SH BUGS +If a page is marked reserved, a call to +.BR free_page "(9)" +will silenty ignore it. If the page was originally allocated by +get_free_page, you must remember to unmark the page before releasing +it to the system. Otherwise, the page is lost. diff --git a/upstream/mageia-cauldron/man9/pcibios_find_class.9 b/upstream/mageia-cauldron/man9/pcibios_find_class.9 new file mode 100644 index 00000000..b18741e2 --- /dev/null +++ b/upstream/mageia-cauldron/man9/pcibios_find_class.9 @@ -0,0 +1,82 @@ +.\" -*- nroff -*- +.TH pcibios_find_class 9 "August 5, 1997" "Linux DDI" "BIOS32 Functions" +.hlm 0 +.na +.SH NAME +pcibios_find_class, pcibios_find_device \- find a PCI class or device +.SH SYNOPSIS +.B #include <linux/bios32.h> +.sp +.TP +.BI "int pcibios_find_class(unsigned int " class_code \ +", unsigned short " index ", unsigned char* " bus \ +", unsigned char* " device_fn ");" +.TP +.BI "int pcibios_find_device(unsigned\ short\ "\ vendor \ +", unsigned\ short\ " device_id\ \ +", unsigned\ short\ " index ", unsigned\ char*\ " bus \ +", unsigned\ char*\ " device_fn ");" +.hlm 1 +.ad +.SH DESCRIPTION +The +.B pcibios_find_class +function searches for a certain class of device on the PCI bus. In this +instance, class is used to represent a few different categories of +devices. Some examples are storage, network, display, and memory +classes. The classes are defined by the PCI Specification, and the +.I class_code +is matched with the dword in the configuration space of the device at +offset 0x08. +.PP +The +.B pcibios_find_device +function finds a device on the PCI bus that has the matching device +and vendor ids. The vendor ids are assigned to the PCI Sig to vendors, +who in turn assign device ids to the devices they develop. The vendor +and device ids are encoded in dword 0x00 of the configuration space. +.PP +Both +.B pcibios_find_class +and +.B pcibios_find_device +include an extra +.I index +parameter, which is used to select the specific +device if there are multiple matches. An +.I index +of 0 matches the firts located board, 1 the second, and so on. +.PP +The +.I bus +and +.I device_fn +parameters are PCI specific cookies that are passed to other pcibios +functions to access the configuration space of the located device. +.SH "RETURN VALUE" +On success, the functions return +.IR PCIBIOS_SUCCESSFUL "." +Otherwise, one of the following error codes is returned: +.RS +.TP +PCIBIOS_DEVICE_NOT_FOUND +There is no device that matches the search criteria, +.TP +PCIBIOS_BAD_VENDOR_ID +The vendor id is invalid. (0xffff is not a valid id.) +.TP +PCIBIOS_FUNC_NOT_SUPPRTED +The PCI subsystem is not available +.RE +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.BR pcibios_present "(9)" +.PP +.BR /usr/include/linux/pci.h ", " +.BR /usr/include/linux/bios32.h +.PP +.I "PCI Local Bus Specification" +.SH AUTHOR +Kirk Petersen (kirk@speakeasy.org) +.SH BUGS diff --git a/upstream/mageia-cauldron/man9/pcibios_present.9 b/upstream/mageia-cauldron/man9/pcibios_present.9 new file mode 100644 index 00000000..a9941d0f --- /dev/null +++ b/upstream/mageia-cauldron/man9/pcibios_present.9 @@ -0,0 +1,28 @@ +.\" -*- nroff -*- +.TH pcibios_present 9 "August 5, 1997" "Linux DDI" "BIOS32 Functions" +.SH NAME +pcibios_present \- determine whether a PCI bus is available +.SH SYNOPSIS +.B #include <linux/bios32.h> +.sp +.BI "int pcibios_present(void);" +.SH DESCRIPTION +The +.B pcibios_present +tests for the presence of PCI support on the local host. It returns +true (!0) if PCI support exists, false otherwise. +.SH "RETURN VALUE" +Zero if PCI support is NOT present. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR "/usr/include/linux/bios32.h" "," +.BR "/usr/src/linux/arch/*/kernel/bios32.c" +.ad +.hlm 1 +.SH AUTHOR +Kirk Petersen (kirk@speakeasy.org) +.SH BUGS +Bugs?! This is way to trivial to have bugs. diff --git a/upstream/mageia-cauldron/man9/pcibios_read_config_byte.9 b/upstream/mageia-cauldron/man9/pcibios_read_config_byte.9 new file mode 100644 index 00000000..13bb6311 --- /dev/null +++ b/upstream/mageia-cauldron/man9/pcibios_read_config_byte.9 @@ -0,0 +1,35 @@ +.\" -*- nroff -*- +.TH pcibios_read_config_byte 9 "August 5, 1997" "Linux DDI" "BIOS32 Functions" +.SH NAME +pcibios_read_config_byte \- read one byte of data from the configuration +space of the PCI bus +.SH SYNOPSIS +.B #include <linux/bios32.h> +.sp +.BI "int pcibios_read_config_byte (unsigned char bus, unsigned char device_fn,\ +unsigned char where, unsigned char * value);" +.SH DESCRIPTION +The +.B pcibios_read_config_byte +function reads one byte from the configuration space of the PCI bus. The +bus can be specified with the +.B bus +parameters. The +.B device_fn +paramter determines which ? to use. +.B where +is set to the ?. After the call is made, +.B value +points to the value that was read. +.SH "RETURN VALUE" +The return value is taken from the PCI controller in a way that I'm +not quite sure of. +.PP +If the PCI system is unavailable, PCIBIOS_FUNC_NOT_SUPPORTED is +returned. +.SH AVAILABILITY +Linux 1.0? +.SH AUTHOR +Kirk Petersen (kirk@speakeasy.org) +.SH BUGS + diff --git a/upstream/mageia-cauldron/man9/pcibios_read_config_dword.9 b/upstream/mageia-cauldron/man9/pcibios_read_config_dword.9 new file mode 100644 index 00000000..45335114 --- /dev/null +++ b/upstream/mageia-cauldron/man9/pcibios_read_config_dword.9 @@ -0,0 +1,34 @@ +.\" -*- nroff -*- +.TH pcibios_read_config_dword 9 "August 5, 1997" "Linux DDI" "BIOS32 Functions" +.SH NAME +pcibios_read_config_dword \- read a double word of data from the configuration +space of the PCI bus +.SH SYNOPSIS +.B #include <linux/bios32.h> +.sp +.BI "int pcibios_read_config_dword (unsigned char bus, unsigned char device_fn,\ +unsigned char where, unsigned int * value);" +.SH DESCRIPTION +The +.B pcibios_read_config_dword +function reads a double word from the configuration space of the PCI bus. The +bus can be specified with the +.B bus +parameters. The +.B device_fn +paramter determines which ? to use. +.B where +is set to the ?. After the call is made, +.B value +points to the value that was read. +.SH "RETURN VALUE" +The return value is taken from the PCI controller in a way that I'm +not quite sure of. +.PP +If the PCI system is unavailable, PCIBIOS_FUNC_NOT_SUPPORTED is +returned. +.SH AVAILABILITY +Linux 1.0? +.SH AUTHOR +Kirk Petersen (kirk@speakeasy.org) +.SH BUGS diff --git a/upstream/mageia-cauldron/man9/pcibios_read_config_word.9 b/upstream/mageia-cauldron/man9/pcibios_read_config_word.9 new file mode 100644 index 00000000..faed7b42 --- /dev/null +++ b/upstream/mageia-cauldron/man9/pcibios_read_config_word.9 @@ -0,0 +1,34 @@ +.\" -*- nroff -*- +.TH pcibios_read_config_word 9 "August 5, 1997" "Linux DDI" "BIOS32 Functions" +.SH NAME +pcibios_read_config_word \- read a word of data from the configuration space +of the PCI bus +.SH SYNOPSIS +.B #include <linux/bios32.h> +.sp +.BI "int pcibios_read_config_word (unsigned char bus, unsigned char device_fn,\ +unsigned char where, unsigned short * value);" +.SH DESCRIPTION +The +.B pcibios_read_config_word +function reads a word from the configuration space of the PCI bus. The +bus can be specified with the +.B bus +parameters. The +.B device_fn +paramter determines which ? to use. +.B where +is set to the ?. After the call is made, +.B value +points to the value that was read. +.SH "RETURN VALUE" +The return value is taken from the PCI controller in a way that I'm +not quite sure of. +.PP +If the PCI system is unavailable, PCIBIOS_FUNC_NOT_SUPPORTED is +returned. +.SH AVAILABILITY +Linux 1.0? +.SH AUTHOR +Kirk Petersen (kirk@speakeasy.org) +.SH BUGS diff --git a/upstream/mageia-cauldron/man9/pcibios_strerror.9 b/upstream/mageia-cauldron/man9/pcibios_strerror.9 new file mode 100644 index 00000000..290819ce --- /dev/null +++ b/upstream/mageia-cauldron/man9/pcibios_strerror.9 @@ -0,0 +1,30 @@ +.\" -*- nroff -*- +.TH pcibios_strerror 9 "August 5, 1997" "Linux DDI" "BIOS32 Functions" +.SH NAME +pcibios_strerror \- Convert BIOS32 return codes to strings +.SH SYNOPSIS +.B #include <linux/bios32.h> +.sp +.BI "const\ char*\ pcibios_strerror(\%int\ " error\% ");" +.SH DESCRIPTION +The +.B pcibios_strerror +function converts a PCI BIOS32 error number into a human readable error +message. The bios32 error codes are defined by the PCI standard. +.SH "RETURN VALUE" +The return value is a pointer to the error message. +.SH "SEE ALSO" +.hlm 0 +.na +.BR /usr/include/linux/bios32.h , +.BR /usr/src/linux/arch/*/kernel/bios32.c +.PP +.I "PCI Local Bus -- PCI BIOS SPECIFICATION" +.ad +.SH AVAILABILITY +Linux 1.0? +.SH AUTHOR +Kirk Petersen (kirk@speakeasy.org) +.SH BUGS +The result may or may not be overwritten by a subsequent call to this +function. it is best to assume it does. diff --git a/upstream/mageia-cauldron/man9/pcibios_write_config_byte.9 b/upstream/mageia-cauldron/man9/pcibios_write_config_byte.9 new file mode 100644 index 00000000..6c111c7c --- /dev/null +++ b/upstream/mageia-cauldron/man9/pcibios_write_config_byte.9 @@ -0,0 +1,35 @@ +.\" -*- nroff -*- +.TH pcibios_write_config_byte 9 "August 5, 1997" "Linux DDI" "BIOS32 Functions" +.SH NAME +pcibios_write_config_byte \- write one byte of data to the configuration +space of the PCI bus +.SH SYNOPSIS +.B #include <linux/bios32.h> +.sp +.BI "int pcibios_write_config_byte(unsigned char bus, unsigned char device_fn,\ +unsigned char where, unsigned char value);" +.SH DESCRIPTION +The +.B pcibios_write_config_byte +function writes one byte to the configuration space of the PCI bus. The +bus can be specified with the +.B bus +parameters. The +.B device_fn +paramter determines which ? to use. +.B where +is set to the ?. The byte to be written to the configuration space is +stored in the +.B value +parameter. +.SH "RETURN VALUE" +The return value is taken from the PCI controller in a way that I'm +not quite sure of. +.PP +If the PCI system is unavailable, PCIBIOS_FUNC_NOT_SUPPORTED is +returned. +.SH AVAILABILITY +Linux 1.0? +.SH AUTHOR +Kirk Petersen (kirk@speakeasy.org) +.SH BUGS diff --git a/upstream/mageia-cauldron/man9/pcibios_write_config_dword.9 b/upstream/mageia-cauldron/man9/pcibios_write_config_dword.9 new file mode 100644 index 00000000..5e317b03 --- /dev/null +++ b/upstream/mageia-cauldron/man9/pcibios_write_config_dword.9 @@ -0,0 +1,35 @@ +.\" -*- nroff -*- +.TH pcibios_write_config_dword 9 "August 5, 1997" "Linux DDI" "BIOS32 Functions" +.SH NAME +pcibios_write_config_dword \- write one double word of data to the +configuration space of the PCI bus +.SH SYNOPSIS +.B #include <linux/bios32.h> +.sp +.BI "int pcibios_write_config_dword (unsigned char bus, unsigned char device_fn,\ +unsigned char where, unsigned int value);" +.SH DESCRIPTION +The +.B pcibios_write_config_dword +function writes one double word to the configuration space of the PCI bus. The +bus can be specified with the +.B bus +parameters. The +.B device_fn +paramter determines which ? to use. +.B where +is set to the ?. The word to be written to the configuration space is +stored in the +.B value +parameter. +.SH "RETURN VALUE" +The return value is taken from the PCI controller in a way that I'm +not quite sure of. +.PP +If the PCI system is unavailable, PCIBIOS_FUNC_NOT_SUPPORTED is +returned. +.SH AVAILABILITY +Linux 1.0? +.SH AUTHOR +Kirk Petersen (kirk@speakeasy.org) +.SH BUGS diff --git a/upstream/mageia-cauldron/man9/pcibios_write_config_word.9 b/upstream/mageia-cauldron/man9/pcibios_write_config_word.9 new file mode 100644 index 00000000..d1d9516b --- /dev/null +++ b/upstream/mageia-cauldron/man9/pcibios_write_config_word.9 @@ -0,0 +1,35 @@ +.\" -*- nroff -*- +.TH pcibios_write_config_word 9 "August 5, 1997" "Linux DDI" "BIOS32 Functions" +.SH NAME +pcibios_write_config_word \- write one word of data to the configuration +space of the PCI bus +.SH SYNOPSIS +.B #include <linux/bios32.h> +.sp +.BI "int pcibios_write_config_word (unsigned char bus, unsigned char device_fn,\ +unsigned char where, unsigned short value);" +.SH DESCRIPTION +The +.B pcibios_write_config_word +function writes one word to the configuration space of the PCI bus. The +bus can be specified with the +.B bus +parameters. The +.B device_fn +paramter determines which ? to use. +.B where +is set to the ?. The word to be written to the configuration space is +stored in the +.B value +parameter. +.SH "RETURN VALUE" +The return value is taken from the PCI controller in a way that I'm +not quite sure of. +.PP +If the PCI system is unavailable, PCIBIOS_FUNC_NOT_SUPPORTED is +returned. +.SH AVAILABILITY +Linux 1.0? +.SH AUTHOR +Kirk Petersen (kirk@speakeasy.org) +.SH BUGS diff --git a/upstream/mageia-cauldron/man9/poll_wait.9 b/upstream/mageia-cauldron/man9/poll_wait.9 new file mode 100644 index 00000000..9fc3d5a9 --- /dev/null +++ b/upstream/mageia-cauldron/man9/poll_wait.9 @@ -0,0 +1,76 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Stephen Williams <steve@icarus.com> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH poll_wait 9 "$Date:$" "Linux DDI" "Kernel Functions" +.\" +.\" Turn off hyphenation and right justification for the first sections. +.hlm 0 +.na +.\" The name should be formatted this way for apropos to work +.SH NAME +poll_wait \- wait for selectable event to be ready +.\" +.\" +.SH SYNOPSIS +.B #include <linux/poll.h> +.PP +.BI "void poll_wait(struct\%wait_queue**" sync ", poll_table*" pt ")" +.HP +.\" +.\" Turn hyphenation and adjustment back on. +.hlm 1 +.ad +.SH DESCRIPTION +This function is used in support of the poll device driver entry +point. The intent is for a device driver to put +.I sync +into the poll table immediately entering the device poll routine, then +returning a bit mask of events that are currently ready. The kernel +looks at the mask of events to see if something it needs is ready, and +suspends the process if not. +.PP +.nf +static unsigned int xxpoll(struct file*file, poll_table*pt) +{ + poll_wait(&data_in_sync, pt); + if (data_in.cnt > 0) return POLLIN | POLLRDNORM; + else return 0; +} +.fi +.PP +This example shows the basic use of +.BR poll_wait "(9)" +in a device driver poll function. +.SH AVAILABILITY +Linux kernel 2.1.34+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR intro "(9)" +.ad +.hlm 1 +.SH AUTHOR +Stephen Williams <steve@icarus.com> +.SH BUGS +To early to say. diff --git a/upstream/mageia-cauldron/man9/printk.9 b/upstream/mageia-cauldron/man9/printk.9 new file mode 100644 index 00000000..892812d9 --- /dev/null +++ b/upstream/mageia-cauldron/man9/printk.9 @@ -0,0 +1,78 @@ +.\" -*- nroff -*- +.TH printk 9 "$Date:$" "Linux DDI" "Kernel Functions" +.SH NAME +printk \- print messages to console log +.SH SYNOPSIS +.B #include <linux/kernel.h> +.sp +.BI "int printk(const char*" fmt ", ...)" +.SH DESCRIPTION +Print a formatted message to the kernel console, much like the +.B printf +function of the stdio library. Normally, the message is written to the +physical console device of the computer, although this behavior can be +changed with the +.B register_console +function. Messages are also stored in a message log book. +.PP +The generated string may also start with a message priority code, +which sets the priority of the message. The priority code strings are +of the form +.I "<n>" +where n is a number from 0 - 7. The following macros are defined in +the +.I "<linux/kernel.h>" +header file: +.RS +.TP +KERN_EMERG +System is unuseable +.TP +KERN_ALERT +Action must be taken immediately +.TP +KERN_CRIT +Critical conditions +.TP +KERN_ERR +Error conditions +.TP +KERN_WARNING +Warning conditions +.TP +KERN_NOTICE +Normal but significant condition +.TP +KERN_INFO +Informational +.TP +KERN_DEBUG +Debug-level messages +.RE + +For example +.nf + + printk(KERN_NOTICE "Hello, world.\\n"); + +.fi +does the expected thing. +.SH "RETURN VALUE" +Returns the number of characters written to the log. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.BR register_console "(9), " syslog "(2)" +.PP +.IR "kernel/printk.c" +.SH AUTHOR +Stephen Williams (steve@icarus.com) +.SH BUGS +float and double formats are not supported. Floats and doubles do not +belong inside the kernel anyhow. +.PP +The +.B printk +implementation protects itself from interruption, so in principle it +can be used in interrupts handlers and critical sections. However, +there are no guarantees about the console function that is registered. diff --git a/upstream/mageia-cauldron/man9/probe_irq_on.9 b/upstream/mageia-cauldron/man9/probe_irq_on.9 new file mode 100644 index 00000000..2eee7461 --- /dev/null +++ b/upstream/mageia-cauldron/man9/probe_irq_on.9 @@ -0,0 +1,144 @@ +.\" -*- nroff -*- +.TH PROBE_IRQ_ON 9 "1997/08/14 07:53:32" "Linux DDI 2.1.47" "Linux Kernel Functions" +.\" Copyright (C) 1997 Neil Moore <amethyst@maxwell.ml.org> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. + +.\" Turn off hyphentation +.hlm 0 +.\" Turn off adjustment +.na +.SH NAME +probe_irq_on, probe_irq_off \- safe probing for IRQs +.SH SYNOPSIS +.B #include <linux/interrupt.h> +.\" To keep all components of a declaration together, escape all white +.\" space except after a comma. In case the proc name plus the first +.\" declaration is too long for one line, allow a break after '(' by +.\" adding '\%'. +.HP +.B "unsigned\ long\ probe_irq_on(void)" +.\" We don't want an inter-paragraph space between the two declarations, +.\" but we have to end the paragraph to stop the hanging indent. .PD 0 +.\" gets rid of inter-paragraph spacing +.PD 0 +.HP +.BI "int\ probe_irq_off(unsigned\ long " irqs ");" +.\" And set it back to normal now +.PD 1 +.\" Back to standard adjustment +.ad +.\" Allow hypenation, omit if you want no hyphenation in the man page +.hlm 1 +.SH DESCRIPTION +.SS Usage +.PP +.B probe_irq_on() +turns on IRQ detection. It operates by enabling all interrupts which have +no handlers, while keeping the handlers for those interrupts NULL. The +kernel's generic interrupt handling routine will disable these IRQs when +an interrupt is received on them. +.B probe_irq_on() +adds each of these IRQ numbers to a vector which it will return. It waits +approximately 100ms for any spurious interrupts that may occur, and masks +these from its vector; it then returns this vector to its caller. +.PP +.B probe_irq_off() +tests an internal list of enabled IRQs against its +.I irqs +parameter, which should be the value returned by the last +.BR probe_irq_on() . +This function basically detects which IRQs have been switched off, and thus +which ones have received interrupts. +.SS Example +This explanation may seem a bit confusing, so here is an example of code +the mythical FUBAR 2000 driver could use to probe for IRQs: +.RS +.PP +unsigned long irqs; +.br +int irq; +.sp +irqs = probe_irq_on(); +.sp +outb(FB2K_GIVE_ME_AN_INTERRUPT_OR_GIVE_ME_DEATH, + FB2K_CONTROL_PORT); +.br + /* the interrupt could take a while to occur */ +.br +udelay(1000); +.sp +irq = probe_irq_off(irqs); +.sp +if (irq == 0) { +.br + printk("fb2k: could not detect IRQ.\en"); +.br + printk("fb2k: Installation failed.\en"); +.br +} else if (irq == -1) { +.br + printk("fb2k: multiple IRQs detected.\en"); +.br + printk("fb2k: Installation failed.\en"); +.br +} else { +.br + fb2k_dev->irq = irq; +.br + printk("fb2k: using probed IRQ %d.\en", irq); +.br +} +.br +.SH "RETURN VALUE" +.B probe_irq_on() +returns a bitmap of all unhandled IRQs (except those which are receiving +spurious interrupts). This value should only be used as a parameter to +the next call to +.BR probe_irq_off() . +.PP +.B probe_irq_off() +returns the IRQ number of whichever unhandled interrupt has occurred since +the last +.BR probe_irq_on() . +If no interrupts have occurred on any of the marked IRQs, 0 is returned; +if interrupts have occurred on more than one of these IRQs, -1 is returned. +.SH AVAILABILITY +Linux 1.2+. These functions are not available on m68k-based machines. +.SH "SEE ALSO" +.BR request_irq "(9)" +.PP +.I arch/*/kernel/irq.c +.SH AUTHOR +.RI "Neil Moore <" amethyst@maxwell.ml.org ">" +.SH BUGS +As mentioned above, these functions are not available on m68k-based machines. +.PP +This manpage is way too confusing. +.\" +.\" probe_irq_on.9,v +.\" Revision 1.2 1997/08/14 07:53:32 amethyst +.\" Formatting changes. +.\" +.\" Revision 1.1 1997/07/28 10:28:34 amethyst +.\" Initial revision +.\" +.\" diff --git a/upstream/mageia-cauldron/man9/proc_dir_entry.9 b/upstream/mageia-cauldron/man9/proc_dir_entry.9 new file mode 100644 index 00000000..88e95e6c --- /dev/null +++ b/upstream/mageia-cauldron/man9/proc_dir_entry.9 @@ -0,0 +1,163 @@ +.\" +.TH proc_dir_entry 9 "July 1997" "Linux 2.0.30" "/proc Functions" +.LO 9 +.hlm 0 +.na +.SH NAME +proc_dir_entry, proc_register, proc_register_dynamic, proc_unregister \- register entries in the /proc filesystem. +.SH SYNOPSIS +.B #include <linux/proc_fs.h> +.TP +.BI "int\ proc_register(\%struct\ proc_dir_entry\ *\ " "parent" ", struct\ proc_dir_entry\ *\ " "child"); +.TP +.BI "int\ proc_unregister(\%struct\ proc_dir_entry\ *\ " "parent" ", int\ " "inode"); +.TP +.BI "int\ proc_register_dynamic(\%struct\ proc_dir_entry\ *\ " "parent" ", struct\ proc_dir_entry\ *\ " "child"); +.ad +.SH DESCRIPTION +The +.B proc_register +functions add file or directory entries to the /proc file system. They +associate processing routines with each node of the /proc tree. +The structure +.B proc_dir_entry +is defined as +.nf + +.B +struct proc_dir_entry { +.B + unsigned short low_ino; +.B + unsigned short namelen; +.B + const char *name; +.B + mode_t mode; +.B + nlink_t nlink; +.B + uid_t uid; +.B + gid_t gid; +.B + unsigned long size; +.B + struct inode_operations * ops; +.B + int (*get_info)(char *buffer, char **start, +.B + off_t offset, int length, int unused); +.B + void (*fill_inode)(struct inode *); +.B + struct proc_dir_entry *next, *parent, *subdir; +.B + void *data; +.B +}; +.fi + +.IP low_ino 8 +The inode number of this directory entry. For +.B proc_register +this number should be unique within the /proc filesystem, values are +defined in +.IR <linux/proc_fs.h> . +For +.B proc_register_dynamic +the inode number is dynamically assigned. +.IP namelen +The length of the name, excluding the trailing null. +.IP name +The name of this node. +.IP mode +.ne 3 +The node's type and permissions. Drawn from +.IR <linux/stat.h> . +.IP nlink +Number of links to the node. Initialise to 2 if mode includes +S_IFDIR, 1 otherwise. +.IP uid +The uid that owns the node, normally 0. +.IP gid +The gid that owns the node. normally 0. +.IP size +Sets the size of the node, the value will appear as the inode size in +listings and be returned by +.BR stat . +Unless you really need a size, set this to zero. +.IP ops +Defines the set of inode operations to perform for your /proc node. +For a directory node, use +.I &proc_dir_inode_operations +unless you have special requirements. For a leaf node, set to NULL +unless you have special requirements. +.IP get_info +If defined, this proc is called when the node is read. Should be NULL +for directory nodes. +.B NOTE: +If you need to return large amounts of data, the proc must return the +data in chunks and reposition itself on the next call, using the +.I offset +variable. See +.I ip_masq_procinfo +for example code with large output. +.IP fill_inode +Dynamically fill in the inode characteristics during directory +operations. Not normally required and set to NULL. See +proc_pid_fill_inode for example code. +.IP "next, parent, subdir +Maintained by /proc routines. Initial value is irrelevant, set to NULL. +.IP data +An opaque pointer which can be used by proc handlers to pass local data +around. Set to whatever you like when calling +.BR proc_register , +normally NULL. This pointer is copied into the inode u.ip_generic +field (by proc_get_inode) so it is available to any proc routines that +are passed an inode. +.PP +.B proc_register +adds the +.B child +as a node under the +.BR parent . +.PP +.B proc_register_dynamic +dynamically assigns an inode number then adds the +.B child +as a node under the +.BR parent . +.PP +.B proc_unregister +scans the inode list under the +.B parent +for the specified +.B inode +number and removes the matching entry. +.SH "RETURN VALUE" +.PP +.ne 2 +.B proc_register +always returns 0. +.PP +.B proc_register_dynamic +.ne 2 +returns 0 for success or +.B -EAGAIN +if there are no free dynamic inode numbers. +.PP +.B proc_unregister +.ne 2 +returns 0 for success or +.B -EINVAL +if the node was not found. +.SH "SEE ALSO" +.na +.BR proc_net_register "(9), " proc_net_unregister "(9), " proc_scsi_register "(9), " proc_scsi_unregister "(9), " stat "(2)." +.ad +.SH AUTHOR +Keith Owens <kaos@ocs.com.au> +.SH BUGS +The uniqueness of /proc inode numbers is assumed, not enforced. It is +possible to add two nodes with the same inode number. diff --git a/upstream/mageia-cauldron/man9/proc_net_register.9 b/upstream/mageia-cauldron/man9/proc_net_register.9 new file mode 100644 index 00000000..436620e6 --- /dev/null +++ b/upstream/mageia-cauldron/man9/proc_net_register.9 @@ -0,0 +1,30 @@ +.\" +.TH proc_net_register 9 "July 1997" "Linux 2.0.30" "/proc Functions" +.LO 9 +.hlm 0 +.na +.SH NAME +proc_net_register, proc_net_unregister \- register network entries in the /proc filesystem +.SH SYNOPSIS +.B #include <linux/proc_fs.h> +.TP +.BI "int\ proc_net_register(\%struct\ proc_dir_entry\ *\ " "child"); +.TP +.BI "int\ proc_net_unregister(\%int\ " "inode"); +.ad + +.SH DESCRIPTION +These are wrapper functions around +.B proc_register +and +.BR proc_unregister . +They always use a parent of proc_net. +.SH "RETURN VALUE" +As for +.B proc_register +and +.BR proc_unregister . +.SH "SEE ALSO" +.BR proc_register "(9), " proc_unregister "(9)" +.SH AUTHOR +Keith Owens <kaos@ocs.com.au> diff --git a/upstream/mageia-cauldron/man9/proc_scsi_register.9 b/upstream/mageia-cauldron/man9/proc_scsi_register.9 new file mode 100644 index 00000000..cccda817 --- /dev/null +++ b/upstream/mageia-cauldron/man9/proc_scsi_register.9 @@ -0,0 +1,50 @@ +.\" +.TH proc_scsi_register 9 "July 1997" "Linux 2.0.30" "/proc Functions" +.LO 9 +.hlm 0 +.na +.SH NAME +proc_scsi_register, proc_scsi_unregister \- register SCSI entries in the /proc filesystem +.SH SYNOPSIS +.B #include <linux/proc_fs.h> +.TP +.BI "int\ proc_scsi_register(\%struct\ proc_dir_entry\ *\ " "driver" ", struct\ proc_dir_entry\ *\ " "child"); +.TP +.BI "int\ proc_scsi_unregister(\%struct\ proc_dir_entry\ *\ " "driver" ", int\ " "inode"); +.ad + +.SH DESCRIPTION +These are wrapper functions around +.B proc_register +and +.BR proc_unregister . +.PP +.B proc_scsi_register +always sets the +.I ops +field of +.B child +to proc_scsi_inode_operations. If the child inode number is less than +PROC_SCSI_FILE, the child is registered with a parent of proc_scsi and +.B driver +is ignored. +Otherwise the child is registered with a parent of +.BR driver . +.PP +.BR proc_scsi_unregister . +If the child inode number is less than PROC_SCSI_FILE, the child is +unregistered with a parent of proc_scsi and +.B driver +is ignored. +Otherwise the child is unregistered with a parent of +.B driver +and scsi_init_free is called on the child. +.SH "RETURN VALUE" +As for +.B proc_register +and +.BR proc_unregister . +.SH "SEE ALSO" +.BR proc_register "(9), " proc_unregister "(9)" +.SH AUTHOR +Keith Owens <kaos@ocs.com.au> diff --git a/upstream/mageia-cauldron/man9/register_chrdev.9 b/upstream/mageia-cauldron/man9/register_chrdev.9 new file mode 100644 index 00000000..c357aaa4 --- /dev/null +++ b/upstream/mageia-cauldron/man9/register_chrdev.9 @@ -0,0 +1,68 @@ +.\" -*- nroff -*- +.TH register_chrdev 9 "$Date:$" "Linux 2.0" "Kernel Functions" +.SH NAME +register_chrdev, unregister_chrdev \- register a driver major number +.SH SYNOPSIS +.B #include <linux/fs.h> +.sp +.BI "int register_chrdev(unsigned int " major ", const char*" name "," +.BI "struct file_operations*" ops ");" +.br +.BI "int unregister_chrdev(unsigned int " major ", const char *" name ");" +.SH DESCRIPTION +The +.B register_chrdev +function associates a character major number with set of driver entry +points. The file_operations structure contains pointers to functions +that the the driver uses to implement the kernel interface to the +driver. +.PP +The paramter +.I major +is the character major number assigned to the device driver and to be +mapped to the function table. The +.I name +parameter is a short name for the device and is displayed in the +The +.I "/proc/devices" +list. It also must exactly match the name passed to +.B unregister_chrdev +function when releasing the functions. +.PP +A device driver module may register as many different major numbers as +it supports, though this is not typically done. +.PP +The +.B unregister_chrdev +function releases the major number, and is normally called in the +module_cleanup function to remove the driver from the kernel. +.SH "RETURN VALUE" +On success, +.B register_chrdev +returns 0 if +.I major +is a number other then 0, otherwise Linux will choose a major number +and return the chosen value. +.PP +If there is an error, one of the following codes is returned instead: +.RS +.TP +-EINVAL +The specified number is not valid (> MAX_CHRDEV) +.TP +-EBUSY +The major number is busy +.RE +.PP +The +.B unregister_chrdev +function will return 0 if successful, or +.B "-EINVAL" +if the major number is not registered with the matching name. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.BR register_blkdev "(9) " mknod "(2)" +.SH AUTHOR +Stephen Williams (steve@icarus.com) +.SH BUGS diff --git a/upstream/mageia-cauldron/man9/register_console.9 b/upstream/mageia-cauldron/man9/register_console.9 new file mode 100644 index 00000000..a48fdf28 --- /dev/null +++ b/upstream/mageia-cauldron/man9/register_console.9 @@ -0,0 +1,52 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Stephen Williams <steve@icarus.com> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH register_console 9 "$Date:$" "Linux DDI" "Kernel Functions" +.SH NAME +register_console \- take on kernel console duties +.SH SYNOPSIS +.BI "extern void register_console(void(*" proc ")(const char*))" +.SH DESCRIPTION +This function registers with the kernel a function to display all the +kernel messages printed by the +.BR printk "(9)" +function. +.PP +This function is normally called once at boot time by the device +driver for the console device, whatever that turns out to be for the +machine. The console procedure is only called to print messages that +are to be printed, the filtering for log level is done already. +.SH "RETURN VALUE" +None. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.BR printk "(9)" +.PP +.I "/usr/src/linux/kernel/printk.c" +.SH AUTHOR +Stephen Williams <steve@icarus.com> +.SH BUGS +Only one console can exist at a time, and there is no way to know if +any other device has registered as a console. diff --git a/upstream/mageia-cauldron/man9/request_irq.9 b/upstream/mageia-cauldron/man9/request_irq.9 new file mode 100644 index 00000000..c55e72c8 --- /dev/null +++ b/upstream/mageia-cauldron/man9/request_irq.9 @@ -0,0 +1,305 @@ +.\" -*- nroff -*- +.TH REQUEST_IRQ 9 "1997/08/14 07:53:47" "Linux DDI 2.1.47" "Linux Kernel Functions" +.\" copyright (C) 1997 Neil Moore <amethyst@maxwell.ml.org> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. + +.\" Turn off hyphentation +.hlm 0 +.\" Turn off adjustment +.na +.SH NAME +request_irq, free_irq \- register an interrupt handler +.SH SYNOPSIS +.B #include <asm/irq.h> +.br +.B #include <linux/signal.h> +.br +.B #include <linux/sched.h> +.br +.B #include <linux/interrupt.h> +.\" To keep all components of a declaration together, escape all white +.\" space except after a comma. In case the proc name plus the first +.\" declaration is too long for one line, allow a break after '(' by +.\" adding '\%'. +.HP +.BI "int request_irq(unsigned\ int\ " irq "," +.BI "void\ (*" handler ")(int,\ void\ *,\ struct\ pt_regs\ *)," +.BI "unsigned\ long " irqflags ", const\ char\ *" devname "," +.BI "void\ *" dev_id ");" +.\" We don't want an inter-paragraph space between the two declarations, +.\" but we have to end the paragraph to stop the hanging indent. .PD 0 +.\" gets rid of inter-paragraph spacing +.PD 0 +.PP +.BI "void\ free_irq(unsigned\ int " irq ", void\ *" dev_id ");" +.\" And set it back to normal now +.PD 1 +.\" Back to standard adjustment +.ad +.\" Allow hypenation, omit if you want no hyphenation in the man page +.hlm 1 +.SH DESCRIPTION +.SS Usage +The +.B request_irq() +function requests that a specified function (the handler) be called +whenever the kernel receives a given interrupt. The handler may +in turn register a bottom half, which is usually a slower part of +the handler which does not need to be executed as soon as the interrupt +is received. See +.BR init_bh "(9) " +for more information on bottom halves. +.PP +The +.I irq +parameter is the interrupt number you want to handle. It must be less +than +.B NR_IRQS +(16 on Intel systems), and there may be additional limitations on the +value. See +.IR arch/*/kernel/irq.c " (" intr.c +on m68k machines) for +more information. +.PP +.I handler +is a pointer to the a pointer to the function that will handle the +interrupt. The handler is passed the following parameters: +.RS +.TP +.BI int " irq" +The interrupt number. By testing the value of this parameter, it is +possible for a single function to handle multiple IRQs. +.TP +.BI "void *" dev_id +The device ID of this handler (see below). +.TP +.BI "struct pt_regs *" regs +The registers stored on the stack of the process that was interrupted. +Normally, one shouldn't mess with these, although they can be read to +determine, for example, whether the interrupted process was in kernel +or user mode. +.RE +.PP +.I irqflags +is, as the name suggests, a bitmask of flags pertaining to this interrupt +handler. Legal bits are: +.RS +.TP +.B SA_INTERRUPT +This bit indicates that you are registering a fast interrupt handler. +The semantics of this are discussed below. +.TP +.B SA_SHIRQ +This bit indicates that your handler supports sharing an IRQ with other +handlers (see also +.RI * dev_id +below). +.TP +.B SA_SAMPLE_RANDOM +This bit indicates that this IRQ may be used as an entropy source for +.I /dev/random +and +.I /dev/urandom +(see +.IR "drivers/char/random.c" ")." +.TP +.B SA_PROBE +This bit indicates that the IRQ is being probed and that the handler +being installed is not a real one. It was intended that this value +be used internally by +.B probe_irq_on() +(q.v.), but it is no longer used in 2.1.x kernels. In fact, even with +2.0.x kernels, it is only used by the MIPS architecture. You should not +be using this value unless you know what you are doing. +.TP +.B SA_STATIC_ALLOC +(Sparc/Sparc64 only) This bit requests that your +.B struct irqaction +(see below) be added to a statically allocated array of four handlers, +rather than the normal +.B irq_action[] +table. This is used for IRQs that must be requested early in the boot +process, before +.B kmalloc_init() +has been called. +.RE +.PP +The +.I devname +parameter is a short name for the device and is displayed in the +.I "/proc/interrupts" +list. +.PP +The +.I dev_id +parameter is the device ID. This parameter is usually set to NULL, but should +be non-null if you wish to do IRQ sharing. This doesn't matter when hooking +the interrupt, but is required so that, when +.B free_irq() +is called, the correct driver is unhooked. Since this is a +.BR "void *" "," +it can point to anything (such as a device-specific structure, or even empty +space), but make sure you pass the same pointer to +.BR free_irq() "." +.PP +The +.B free_irq() +function releases an interrupt handler from operation. It takes as parameters +the IRQ to unregister, and the device ID of the handler to be unregistered. +You should pass the same values here as you did to +.BR request_irq() ". " +You probably shouldn't unregister other people's interrupt handlers unless you +know what you are doing. +.SS Operation +.PP +For most architectures, +.B request_irq() +operates by allocating memory for a +.BR "struct irqaction" ", " +filling out the fields thereof, and adding it to the +.B irq_action[] +table. +.B enable_irq() +is then called, which simply tells the kernel to start delivering interrupts +to the installed handler. This process is vastly different on m68k machines, +where it varies depending on what type of machine (Amiga, Atari, etc.) one is +using. +.B free_irq() +simply removes the entries that +.B request_irq() +added. Note that some of these names differ depending on the architecture (for +example, +.B "struct irqaction" +is known as +.B "struct irq_action" +on the Power PC). If you need to know more about the internal workings of +these functions, you are best off reading the source, as some of this +information may have changed by the time you read this (if so, tell me, so +I can try to update this page). +.SS +Fast Interrupt Handlers +.PP +A `fast' interrupt handler (one with +.B SA_INTERRUPT +set) has the following +differences from normal `slow' interrupt handlers: +.PP +.RS +On the ix86 and MIPS, the handler is called with interrupts disabled +(they are enabled by default on these machines; on other machines, +they are disabled by default). +.PP +On the MIPS, a faster return is used. +.PP +On the Alpha, MIPS, Sparc, and Sparc64, a fast and a slow handler +may not share the same IRQ. +.PP +On all architectures except the m68k and the ix86, a `+' is displayed +between the interrupt count and the device name in +.IR /proc/interrupts ". " +.RE +.PP +The slow-versus-fast interrupt distinction is slowly being phased out. For +example, under 2.0.x on the ix86, +.B SA_INTERRUPT +enabled a fast return as it still does on the MIPS; this distiction was +removed in 2.1.x. +.SH "RETURN VALUE" +On success, +.B request_irq() +returns 0 if everything goes as planned. Your interrupt handler will start +receiving its interrupts immediately. On failure, +.B request_irq() +returns: +.RS +.TP +.B -EINVAL +The IRQ number you requested was either invalid or reserved, or your passed a NULL +pointer for the +.I handler() +parameter. +.TP +.B -ENOMEM +.B request_irq() +could not allocate enough memory for something (probably the +.BR "struct irqaction" ")." +.TP +.B -EBUSY +The IRQ you requested is already being handled, and the IRQ cannot be +shared. This can occur because either the handler being registered or +the handler already present does not have +.B SA_SHIRQ +in its +.I irqflags +field. +In addition, on most architectures, all handlers sharing a single IRQ must be +of the same speed; i.e., either all or none of them may have the +.B SA_INTERRUPT +flag set. Finally, it is possible that your architecture may not support sharing +of the IRQ you are attempting to use. +.TP +.B -ENXIO +The m68k returns this value for an invalid IRQ number. +.RE +.PP +.B free_irq() +does not return a value. +.SH AVAILABILITY +Linux 2.1+. The information on this page should work for 2.0.x, but there +may be subtle differences (for example, the semantics of +.B SA_INTERRUPT +on Intel-based machines). Versions earlier than 2.0 had these functions, +but the +.I dev_id +parameter was missing. If you want your code to work with versions both earlier +and later than 2.0, you should protect your code with preprocessor macros using +.BR LINUX_VERSION_CODE ". " +.SH "SEE ALSO" +.BR init_bh "(9), " probe_irq_on "(9), " +.IR "arch/*/kernel/irq.c" ", " "arch/*/kernel/entry.S" ", " +.IR "include/linux/interrupt.h" ", " "include/asm*/signal.h" "." +.SH AUTHOR +.RI "Neil Moore <" amethyst@maxwell.ml.org ">" +.SH BUGS +It's not exactly a bug, but +.B request_irq() +on the m68k is +.I very +strange compared to the same function on the other supported architectures. +You should really read +.IR "arch/m68k/kernel/ints.c" ", " "arch/m68k/atari/ataints.c" ", " +.IR "arch/m68k/amiga/amiints.c" ", and " "arch/m68k/amiga/cia.c" +if you plan on writing drivers for any of these systems. +.\" request_irq.9,v +.\" Revision 1.3 1997/08/14 07:53:47 amethyst +.\" Formatting changes. +.\" +.\" Revision 1.2 1997/07/27 09:52:24 amethyst +.\" Changed some wording. +.\" Fixed a few typographical warts. +.\" Added email address to copyright notice. +.\" Changed one occurence of ``i386'' to ``ix86''. +.\" Changed ``Parameters'' subsection to ``Usage''. +.\" +.\" Revision 1.1 1997/07/27 09:28:25 amethyst +.\" Initial revision +.\" diff --git a/upstream/mageia-cauldron/man9/save_flags.9 b/upstream/mageia-cauldron/man9/save_flags.9 new file mode 100644 index 00000000..da290dd7 --- /dev/null +++ b/upstream/mageia-cauldron/man9/save_flags.9 @@ -0,0 +1,63 @@ +.\" -*- nroff -*- +.TH save_flags 9 "$Date:$" "Linux DDI" "Linux Kernel Functions" +.SH NAME +save_flags, restore_flags \- save/restore processor state and irq mask +.SH SYNOPSIS +.B #include <asm/system.h> +.sp +.BI "unsigned long " flags ";" +.br +.BI "void save_flags(" flags ")" +.br +.BI "void restore_flags(" flags ")" +.SH DESCRIPTION +The +.B save_flags +and +.B restore_flags +macros cooperate with the +.B cli +function to provide interrupt protection to critical sections of +code. The +.B save_flags +function saves the current processor state, most specifically the +interrupt priority level, in the +.I flags +value (which must be an l-value). The flags must be passed to a +subsequent call to +.B restore_flags +to restore the processor state. +.PP +The +.B save_flags +macro does not affect the processor state, but drivers may use the +.BR cli (9) +and +.B sti +functions to disable and enable interrupts after saving the current +flags. When the critical section of code is passed, the +.B restore_flags +returns the processor to its state at the point where the matching +.B save_flags +was called. +.PP +Only values returned by +.B save_flags +can be passed to +.B restore_flags. +Any other values may cause unpredictable results, and are +certainly not portable. +.SH "RETURN VALUE" +The +.B restore_flags +macro saves the processor state in the +.I flags +parameter, which must be a non-const l-value. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.BR "cli" (9) +.SH AUTHOR +Stephen Williams (steve@icarus.com) +.SH BUGS +How does all this react with symmetric multiprocessor machines? diff --git a/upstream/mageia-cauldron/man9/skb_dequeue.9 b/upstream/mageia-cauldron/man9/skb_dequeue.9 new file mode 100644 index 00000000..64a852be --- /dev/null +++ b/upstream/mageia-cauldron/man9/skb_dequeue.9 @@ -0,0 +1,65 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Cyrus Durgin <cider@speakeasy.org> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH SKB_DEQUEUE 9 "November 24, 1997" "Linux DDI" "Networking Functions" +.hlm 0 +.na +.SH NAME +__skb_dequeue, skb_dequeue \- remove an sk_buff from the head of a list +.SH SYNOPSIS +.B #include <linux/skbuff.h> +.HP +.BI "struct sk_buff *__skb_dequeue(struct sk_buff_head " *list ");" +.TP +.BI "struct sk_buff *skb_dequeue(struct sk_buff_head " *list ");" +.hlm 1 +.ad +.SH DESCRIPTION +The \fBskb_dequeue\fP function removes the head element of an sk_buff_head. +It decrements the list qlen pointer, and cleanly detaches the head from +the queue. This function should be used instead of performing this task +manually, as it provides a clean, standardized way of manipulating an +sk_buff_head, and provides interrupt disabling (see \fBNOTES\fP below.) +.SH "RETURN VALUE" +Returns a pointer to the head element of \fIlist\fP, or \fBNULL\fP if +\fIlist\fP is empty. +.SH NOTES +It is important to note the difference between not only \fB__skb_dequeue\fP +and \fBskb_dequeue\fP, but all the \fB__skb_\fP functions and their +\fBskb_\fP counterparts. Essentially, the \fB__skb_\fP functions are +non-atomic, and should only be used with interrupts disabled. As a convenience, +the \fBskb_\fP functions are provided, which perform interrupt disable / +enable wrapper functionality in addition to performing their specific tasks. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR intro "(9), " skb_unlink "(9), " skb_insert "(9), " skb_queue_head "(9), " skb_queue_tail "(9)" +.ad +.hlm 1 +.PP +/usr/src/linux/net/netlink.c /usr/src/linux/net/ax25/af_ax25.c /usr/src/linux/net/core/datagram.c /usr/src/linux/net/ipv4/ipmr.c /usr/src/linux/net/ipv4/tcp.c +.SH AUTHOR +Cyrus Durgin <cider@speakeasy.org> diff --git a/upstream/mageia-cauldron/man9/skb_insert.9 b/upstream/mageia-cauldron/man9/skb_insert.9 new file mode 100644 index 00000000..b4af6ecb --- /dev/null +++ b/upstream/mageia-cauldron/man9/skb_insert.9 @@ -0,0 +1,81 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Cyrus Durgin <cider@speakeasy.org> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH SKB_INSERT 9 "November 24, 1997" "Linux DDI" "Networking Functions" +.hlm 0 +.na +.SH NAME +__skb_insert, skb_insert, skb_append \- insert an sk_buff into a list +.SH SYNOPSIS +.B #include <linux/skbuff.h> +.HP +.BI "void __skb_insert(struct sk_buff " *newsk ", struct sk_buff " *prev ", struct sk_buff " *next ", struct sk_buff_head " *list ")" +.TP +.BI "void skb_insert(struct sk_buff " *old ", struct sk_buff " *newsk ")" +.TP +.BI "void skb_append(struct sk_buff " *old ", struct sk_buff " *newsk ")" +.hlm 1 +.ad +.SH DESCRIPTION +\fBskb_insert\fP and \fBskb_append\fP are essentially wrapper functions for +\fB__skb_insert\fP (see \fBNOTES\fP, below.) \fB__skb_insert\fP inserts +\fInewsk\fP into \fIlist\fP, and resets the appropriate next and prev +pointers. \fIprev\fP and \fInext\fP are used to frame \fInewsk\fP in +\fIlist\fP. After setting the next and prev pointers in \fInewsk\fP, +\fB__skb_insert\fP sets the prev pointer in \fInext\fP and the next pointer +in \fIprev\fP, sets the list pointer in \fInewsk\fP, and increments the qlen +counter in \fIlist\fP. + +\fBskb_insert\fP and \fBskb_append\fP should be used to add sk_buffs +to a list rather than performing this task manually; in addition to +performing this task in a standardized way, these functions also provide +for interrupt diasabling and prevent list mangling. Both of these +functions use the list pointer in \fIold\fP to determine to which list +\fInewsk\fP should be attached. + +The \fBskb_insert\fP function adds \fInewsk\fP to the list before \fIold\fP. + +The \fBskb_append\fP function adds \fInewsk\fP to the list after \fIold\fP. +.SH "RETURN VALUE" +None. +.SH NOTES +It is important to note the difference between not only \fBskb_insert\fP, +\fBskb_append\fP and \fB__skb_insert\fP, but all the \fB__skb_\fP functions +and their \fBskb_\fP counterparts. Essentially, the \fB__skb_\fP functions +are non-atomic, and should only be used with interrupts disabled. As a +convenience, the \fBskb_\fP functions are provided, which perform interrupt +disable / enable wrapper functionality in addition to performing their specific +tasks. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR intro "(9), " skb_queue_head "(9), " skb_queue_tail "(9)" +.ad +.hlm 1 +.PP +/usr/src/linux/net/ax25/af_ax25.c /usr/src/linux/net/core/skbuff.c /usr/src/linux/net/ipv4/tcp_input.c /usr/src/linux/net/netrom/nr_in.c +.SH AUTHOR +Cyrus Durgin <cider@speakeasy.org> diff --git a/upstream/mageia-cauldron/man9/skb_peek.9 b/upstream/mageia-cauldron/man9/skb_peek.9 new file mode 100644 index 00000000..d1b7bd66 --- /dev/null +++ b/upstream/mageia-cauldron/man9/skb_peek.9 @@ -0,0 +1,58 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Cyrus Durgin <cider@speakeasy.org> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH SKB_PEEK 9 "November 24, 1997" "Linux DDI" "Networking Functions" +.hlm 0 +.na +.SH NAME +skb_peek \- peek an sk_buff +.SH SYNOPSIS +.B #include <linux/skbuff.h> +.HP +.BI "struct sk_buff *skb_peek(struct sk_buff_head " *list_ ");" +.hlm 1 +.ad +.SH DESCRIPTION +The \fBskb_peek\fP function extracts the head element of \fIlist_\fP, +without modifying \fIlist_\fP. It is important to note that this is +not necessarily a safe operation, as \fIlist_\fP maintains the original +sk_buff, and other operations on \fIlist_\fP may effect it. To be safe, +either disable interrupts using \fBcli\fP(9), call \fBskb_peek\fP, copy +the data necessary to continue, and re-enable interrupts using +\fBsti\fP(9), or use \fBskb_dequeue\fP(9). +.SH "RETURN VALUE" +Returns a pointer to sk_buff if there is a next element on the \fIlist_\fP. +Otherwise, returns NULL. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR intro "(9), " skb_unlink "(9), " skb_dequeue "(9)" +.ad +.hlm 1 +.PP +/usr/src/linux/net/appletalk/ddp.c /usr/src/linux/net/core/datagram.c /usr/src/linux/net/ipv4/tcp.c /usr/src/linux/net/ipv4/udp.c /usr/src/linux/net/unix/af_unix.c +.SH AUTHOR +Cyrus Durgin <cider@speakeasy.org> diff --git a/upstream/mageia-cauldron/man9/skb_queue_empty.9 b/upstream/mageia-cauldron/man9/skb_queue_empty.9 new file mode 100644 index 00000000..c6154f83 --- /dev/null +++ b/upstream/mageia-cauldron/man9/skb_queue_empty.9 @@ -0,0 +1,54 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Cyrus Durgin <cider@speakeasy.org> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH SKB_QUEUE_EMPTY 9 "November 24, 1997" "Linux DDI" "Networking Functions" +.hlm 0 +.na +.SH NAME +skb_queue_empty \- detect an empty skbuff queue +.SH SYNOPSIS +.B #include <linux/skbuff.h> +.HP +.BI "int skb_queue_empty(struct sk_buff_head " *list ");" +.hlm 1 +.ad +.SH DESCRIPTION +The \fBskb_queue_empty\fP function checks an skbuff queue for "emptiness". +This function provides a quick and easy way to determine if there are +any sk_buff elements on a given queue. +.SH "RETURN VALUE" +If there are any sk_buff elements on the list, then 0 is returned. +Otherwise, 1 is returned to indicate that the list is empty. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR intro "(9), " skb_queue_len "(9)" +.ad +.hlm 1 +.PP +/usr/src/linux/net/core/datagram.c /usr/src/linux/net/core/dev.c /usr/src/linux/net/core/sock.c /usr/src/linux/net/ipv4/tcp.c +.SH AUTHOR +Cyrus Durgin <cider@speakeasy.org> diff --git a/upstream/mageia-cauldron/man9/skb_queue_head.9 b/upstream/mageia-cauldron/man9/skb_queue_head.9 new file mode 100644 index 00000000..c94a9f51 --- /dev/null +++ b/upstream/mageia-cauldron/man9/skb_queue_head.9 @@ -0,0 +1,64 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Cyrus Durgin <cider@speakeasy.org> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH SKB_QUEUE_HEAD 9 "November 24, 1997" "Linux DDI" "Networking Functions" +.hlm 0 +.na +.SH NAME +skb_queue_head \- insert an sk_buff at the head of a list +.SH SYNOPSIS +.B #include <linux/skbuff.h> +.HP +.BI "void __skb_queue_head(struct sk_buff_head " *list ", struct sk_buff " *newsk ");" +.TP +.BI "void skb_queue_head(struct sk_buff_head " *list ", struct sk_buff " *newsk ");" +.HP +.hlm 1 +.ad +.SH DESCRIPTION +The \fBskb_queue_head\fP function adds \fInewsk\fP to the head of \fIlist\fP. +Specifically, it sets the list, next, and prev pointers in \fInewsk\fP, and +increments the qlen element of \fIlist\fP. It also rearranges the next +and prev pointers in the existing head of \fIlist\fP before returning. +.SH "RETURN VALUE" +None. +.SH NOTES +It is important to note the difference between not only \fB__skb_queue_head\fP +and \fBskb_queue_head\fP, but all the \fB__skb_\fP functions and their +\fBskb_\fP counterparts. Essentially, the \fB__skb_\fP functions are +non-atomic, and should only be used with interrupts disabled. As a convenience, +the \fBskb_\fP functions are provided, which perform interrupt disable / +enable wrapper functionality in addition to performing their specific tasks. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR intro "(9), " skb_queue_tail "(9), " skb_insert "(9)" +.ad +.hlm 1 +.PP +/usr/src/linux/net/ax25/af_ax25.c /usr/src/linux/net/core/skbuff.c /usr/src/linux/net/ipv4/tcp_input.c /usr/src/linux/net/netrom/nr_in.c +.SH AUTHOR +Cyrus Durgin <cider@speakeasy.org> diff --git a/upstream/mageia-cauldron/man9/skb_queue_head_init.9 b/upstream/mageia-cauldron/man9/skb_queue_head_init.9 new file mode 100644 index 00000000..c5de1074 --- /dev/null +++ b/upstream/mageia-cauldron/man9/skb_queue_head_init.9 @@ -0,0 +1,58 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Cyrus Durgin <cider@speakeasy.org> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH SKB_QUEUE_HEAD_INIT 9 "November 24, 1997" "Linux DDI" "Networking Functions" +.hlm 0 +.na +.SH NAME +skb_queue_head_init \- prepare an sk_buff_head for use +.SH SYNOPSIS +.B #include <linux/skbuff.h> +.HP +.BI "void skb_queue_head_init(struct sk_buff_head " *list ");" +.hlm 1 +.ad +.SH DESCRIPTION +The \fBskb_queue_head_init\fP function prepares an sk_buff_head for +use by the other \fBskb_\fP functions, and should be called after +declaring and allocating memory for any sk_buff_head elements. +Specifically, \fBskb_queue_head_init\fP sets the prev and next +pointers of the \fIlist\fP to point back at the \fIlist\fP itself, +and sets the \fIlist\fP length to 0. The use of sk_buff_head elements +which have not been initialized with this function is undocumented and +may produce irregular results. +.SH "RETURN VALUE" +None. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR intro "(9)" +.ad +.hlm 1 +.PP +/usr/src/linux/net/netlink.c /usr/src/linux/net/appletalk/aarp.c /usr/src/linux/net/ipv4/af_inet.c /usr/src/linux/net/ipx/af_ipx.c /usr/src/linux/net/unix/af_unix.c +.SH AUTHOR +Cyrus Durgin <cider@speakeasy.org> diff --git a/upstream/mageia-cauldron/man9/skb_queue_len.9 b/upstream/mageia-cauldron/man9/skb_queue_len.9 new file mode 100644 index 00000000..be668fa1 --- /dev/null +++ b/upstream/mageia-cauldron/man9/skb_queue_len.9 @@ -0,0 +1,53 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Cyrus Durgin <cider@speakeasy.org> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH SKB_QUEUE_LEN 9 "November 24, 1997" "Linux DDI" "Networking Functions" +.hlm 0 +.na +.SH NAME +skb_queue_len \- determine the length of an sk_buff_head +.SH SYNOPSIS +.B #include <linux/skbuff.h> +.HP +.BI "__u32 skb_queue_len(struct sk_buff_head " *list ");" +.hlm 1 +.ad +.SH DESCRIPTION +The \fBskb_queue_len\fP function determines the number of sk_buffs assigned to +an sk_buff_head. +.SH "RETURN VALUE" +\fBskb_queue_len\fP returns the number of sk_buff elements attached to an +sk_buff_head. If the sk_buff_head is empty, then 0 is returned. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR intro "(9), " skb_queue_head_init "(9), " skb_queue_head "(9), " skb_queue_tail "(9), " skb_insert "(9)" +.ad +.hlm 1 +.PP +/usr/src/linux/net/core/datagram.c +.SH AUTHOR +Cyrus Durgin <cider@speakeasy.org> diff --git a/upstream/mageia-cauldron/man9/skb_queue_tail.9 b/upstream/mageia-cauldron/man9/skb_queue_tail.9 new file mode 100644 index 00000000..2a2003eb --- /dev/null +++ b/upstream/mageia-cauldron/man9/skb_queue_tail.9 @@ -0,0 +1,63 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Cyrus Durgin <cider@speakeasy.org> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH SKB_QUEUE_TAIL 9 "November 24, 1997" "Linux DDI" "Networking Functions" +.hlm 0 +.na +.SH NAME +__skb_queue_tail, skb_queue_tail \- insert an sk_buff at the tail of a list +.SH SYNOPSIS +.B #include <linux/skbuff.h> +.HP +.BI "void __skb_queue_tail(struct sk_buff_head " *list ", struct sk_buff " *newsk ");" +.TP +.BI "void skb_queue_tail(struct sk_buff_head " *list ", struct sk_buff " *newsk ");" +.hlm 1 +.ad +.SH DESCRIPTION +The \fBskb_queue_tail\fP function adds \fInewsk\fP to the tail +of \fIlist\fP. Specifically, it sets the list, next, and prev +pointers in \fInewsk\fP, and increments the qlen element of \fIlist\fP. +.SH "RETURN VALUE" +None. +.SH NOTES +It is important to note the difference between not only \fB__skb_queue_tail\fP +and \fBskb_queue_tail\fP, but all the \fB__skb_\fP functions and their +\fBskb_\fP counterparts. Essentially, the \fB__skb_\fP functions are +non-atomic, and should only be used with interrupts disabled. As a convenience, +the \fBskb_\fP functions are provided, which perform interrupt +disable / enable wrapper functionality in addition to performing their specific +tasks. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR intro "(9), " skb_queue_head "(9), " skb_insert "(9)" +.ad +.hlm 1 +.PP +/usr/src/linux/net/netlink.c /usr/src/linux/net/appletalk/aarp.c /usr/src/linux/net/core/skbuff.c /usr/src/linux/net/ipv4/arp.c /usr/src/linux/include/net/sock.h +.SH AUTHOR +Cyrus Durgin <cider@speakeasy.org> diff --git a/upstream/mageia-cauldron/man9/skb_unlink.9 b/upstream/mageia-cauldron/man9/skb_unlink.9 new file mode 100644 index 00000000..fe11af5b --- /dev/null +++ b/upstream/mageia-cauldron/man9/skb_unlink.9 @@ -0,0 +1,69 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Cyrus Durgin <cider@speakeasy.org> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH SKB_UNLINK 9 "November 24, 1997" "Linux DDI" "Networking Functions" +.hlm 0 +.na +.SH NAME +__skb_unlink, skb_unlink \- remove an sk_buff from its list +.SH SYNOPSIS +.B #include <linux/skbuff.h> +.HP +.BI "void __skb_unlink(struct sk_buff " *skb ", struct sk_buff_head " *list ");" +.TP +.BI "void skb_unlink(struct sk_buff " *skb ");" +.hlm 1 +.ad +.SH DESCRIPTION +The \fBskb_unlink\fP function is a wrapper for \fB__skb_unlink\fP. +\fB__skb_unlink\fP removes \fIskb\fP from its sk_buff_head. +It decrements the list qlen pointer, and cleanly detaches the sk_buff +from its queue. This function should always be used instead of +performing this task manually, as it provides a clean, standardized +way of manipulating an sk_buff_head, and provides interrupt disabling (see +\fBNOTES\fP below.) Most users will not call \fB__skb_unlink\fP +directly, as it requires that two arguments be supplied and does not +provide any interrupt handling. \fBskb_unlink\fP determines the list +from which \fIskb\fP should be detached, and disables interrupts. +.SH "RETURN VALUE" +None. +.SH NOTES +It is important to note the difference between not only \fB__skb_unlink\fP +and \fBskb_unlink\fP, but all the \fB__skb_\fP functions and their +\fBskb_\fP counterparts. Essentially, the \fB__skb_\fP functions are +non-atomic, and should only be used with interrupts disabled. As a convenience, +the \fBskb_\fP functions are provided, which perform interrupt disable / +enable wrapper functionality in addition to performing their specific tasks. +.SH AVAILABILITY +Linux 1.0+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR intro "(9), " skb_dequeue "(9), " skb_insert "(9), " skb_queue_head "(9), " skb_queue_tail "(9)" +.ad +.hlm 1 +.PP +/usr/src/linux/net/core/skbuff.c /usr/src/linux/net/ipv4/af_inet.c /usr/src/linux/net/ipv4/ip_output.c /usr/src/linux/net/ipv4/tcp.c +.SH AUTHOR +Cyrus Durgin <cider@speakeasy.org> diff --git a/upstream/mageia-cauldron/man9/skel.9 b/upstream/mageia-cauldron/man9/skel.9 new file mode 100644 index 00000000..5a1d477c --- /dev/null +++ b/upstream/mageia-cauldron/man9/skel.9 @@ -0,0 +1,65 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Stephen Williams <steve@icarus.com> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH skel 9 "$Date:$" "Linux DDI" "Kernel Functions" +.\" +.\" Turn off hyphenation and right justification for the first sections. +.hlm 0 +.na +.\" The name should be formatted this way for apropos to work +.SH NAME +skel \- skeleton man page for section 9 entries +.\" +.\" +.SH SYNOPSIS +.B #include <linux/linux.h> +.HP +.\" +.\" Turn hyphenation and adjustment back on. +.hlm 1 +.ad +.SH DESCRIPTION +Describe the function(s) and its parameters. This section should not +be considered an introduction to kernel programming, just an english +text description of the function at hand. It is OK to presume some +basic knowledge of driver programming. +.SH "RETURN VALUE" +Describe the return values. Enumerate all the distinct values and all +the ranges. +.SH AVAILABILITY +List kernel versions, and if restricted to certain architectures, say so. +.SH "SEE ALSO" +.hlm 0 +.na +.BR man "(1), " man "(7), " intro "(9)" +.ad +.hlm 1 +.PP +Also list some source files for the +kernel that implement the functions of the page. +.SH AUTHOR +Who are you? +.SH BUGS +Describe any misfeatures or suprises that the use of these functions +may lead to. The may not be errors, just unfortunate side effects. diff --git a/upstream/mageia-cauldron/man9/sleep_on.9 b/upstream/mageia-cauldron/man9/sleep_on.9 new file mode 100644 index 00000000..ec19865c --- /dev/null +++ b/upstream/mageia-cauldron/man9/sleep_on.9 @@ -0,0 +1,100 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Stephen Williams <steve@icarus.com> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH sleep_on 9 "$Date:$" "Linux DDI" "Kernel Functions" +.\" +.\" Turn off hyphenation and right justification for the first sections. +.hlm 0 +.na +.\" The name should be formatted this way for apropos to work +.SH NAME +sleep_on \- synchronization using a condition variable +.\" +.\" +.SH SYNOPSIS +.B #include <linux/sched.h> +.HP +.BI "void sleep_on(struct\ wait_queue**" condition ")" +.\" +.\" Turn hyphenation and adjustment back on. +.hlm 1 +.ad +.SH DESCRIPTION +The +.B sleep_on +function provides a means for synchronizing between processes and +with interrupt handlers. The +.I condition +parameter is a pointer to a pointer to the opaque wait_queue +type. Initialize the condition variable to zero, then pass a pointer +to it to the +.B sleep_on +function. The basic idea is as follows: +.PP +.na +struct wait_queue*con = 0; +.br + [...] +.br +sleep_on(&con); +.ad +.PP +While a process is sleeping, it is fully interruptible, no matter what +the cpu state when entering the function. The cpu state is restored on +being awakened. +.PP +If a null(0) is passed to +.BR sleep_on , +it returns immediately, without sleeping. This is a no-op. +.SH "RETURN VALUE" +The +.B sleep_on +function only returns when explicitly awakened. +.SH AVAILABILITY +Linux 1+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR wake_up "(9)" +.ad +.hlm 1 +.PP +.I "/usr/src/linux/kernel/sched.c" +.SH AUTHOR +Stephen Williams <steve@icarus.com> +.SH BUGS +A call to +.I "sleep_on(0)" +seems like an interesting way to test for and momentarily allow +interrupts, but that is not what happens. +.PP +The +.B sleep_on +function cannot be called by interrupt handlers. +.PP +The function is not atomic with the condition tests that the driver +writer might include, so the code executing the +.B sleep_on +function is protected from interrupts. Failure to do so generally +leads to race conditions.
\ No newline at end of file diff --git a/upstream/mageia-cauldron/man9/wake_up.9 b/upstream/mageia-cauldron/man9/wake_up.9 new file mode 100644 index 00000000..6ca4c2ef --- /dev/null +++ b/upstream/mageia-cauldron/man9/wake_up.9 @@ -0,0 +1,81 @@ +.\" -*- nroff -*- +.\" +.\" copyright (C) 1997 Stephen Williams <steve@icarus.com> +.\" +.\" Permission is granted to make and distribute verbatim copies of this +.\" manual provided the copyright notice and this permission notice are +.\" preserved on all copies. +.\" +.\" Permission is granted to copy and distribute modified versions of this +.\" manual under the conditions for verbatim copying, provided that the +.\" entire resulting derived work is distributed under the terms of a +.\" permission notice identical to this one +.\" +.\" Since the Linux kernel and libraries are constantly changing, this +.\" manual page may be incorrect or out-of-date. The author(s) assume no +.\" responsibility for errors or omissions, or for damages resulting from +.\" the use of the information contained herein. The author(s) may not +.\" have taken the same level of care in the production of this manual, +.\" which is licensed free of charge, as they might when working +.\" professionally. +.\" +.\" Formatted or processed versions of this manual, if unaccompanied by +.\" the source, must acknowledge the copyright and authors of this work. +.\" +.TH wake_up 9 "$Date:$" "Linux DDI" "Kernel Functions" +.\" +.\" Turn off hyphenation and right justification for the first sections. +.hlm 0 +.na +.\" The name should be formatted this way for apropos to work +.SH NAME +wake_up \- wake up sleeping processes +.\" +.\" +.SH SYNOPSIS +.B #include <linux/sched.h> +.HP +.BI "void wake_up(struct\ wait_queue**" condition ")" +.\" +.\" Turn hyphenation and adjustment back on. +.hlm 1 +.ad +.SH DESCRIPTION +The +.B wake_up +function is the opposite of the +.BR sleep_on "(9)" +function in that it awakens processes that have gone to sleep using +the same condition variable. All the processes sleeping on the given +condition are awakened. If there are no processes sleeping on the +condition, then none are affected. +.PP +Unlike the +.BR sleep_on "(9)" +function, +.B wake_up +does not block and may be called by interrupt handlers. It is in fact +the principle means of synchronizing with interrupt events. +.PP +If the +.I condition +parameter is NULL, or there are no processes sleeping on +.I condition, +the call to +.B wake_up +is a no-op. +.SH "RETURN VALUE" +None. +.SH AVAILABILITY +Linux 1+ +.SH "SEE ALSO" +.hlm 0 +.na +.BR sleep_on "(9)" +.ad +.hlm 1 +.PP +.I "/usr/src/linux/kernel/sched.c" +.SH AUTHOR +Stephen Williams <steve@icarus.com> +.SH BUGS |