diff options
Diffstat (limited to 'Documentation/DocBook')
| -rw-r--r-- | Documentation/DocBook/kernel-locking.tmpl | 25 | ||||
| -rw-r--r-- | Documentation/DocBook/kgdb.tmpl | 20 |
2 files changed, 31 insertions, 14 deletions
diff --git a/Documentation/DocBook/kernel-locking.tmpl b/Documentation/DocBook/kernel-locking.tmpl index 77c42f40be5d..2510763295d0 100644 --- a/Documentation/DocBook/kernel-locking.tmpl +++ b/Documentation/DocBook/kernel-locking.tmpl | |||
| @@ -703,6 +703,31 @@ | |||
| 703 | </sect1> | 703 | </sect1> |
| 704 | </chapter> | 704 | </chapter> |
| 705 | 705 | ||
| 706 | <chapter id="trylock-functions"> | ||
| 707 | <title>The trylock Functions</title> | ||
| 708 | <para> | ||
| 709 | There are functions that try to acquire a lock only once and immediately | ||
| 710 | return a value telling about success or failure to acquire the lock. | ||
| 711 | They can be used if you need no access to the data protected with the lock | ||
| 712 | when some other thread is holding the lock. You should acquire the lock | ||
| 713 | later if you then need access to the data protected with the lock. | ||
| 714 | </para> | ||
| 715 | |||
| 716 | <para> | ||
| 717 | <function>spin_trylock()</function> does not spin but returns non-zero if | ||
| 718 | it acquires the spinlock on the first try or 0 if not. This function can | ||
| 719 | be used in all contexts like <function>spin_lock</function>: you must have | ||
| 720 | disabled the contexts that might interrupt you and acquire the spin lock. | ||
| 721 | </para> | ||
| 722 | |||
| 723 | <para> | ||
| 724 | <function>mutex_trylock()</function> does not suspend your task | ||
| 725 | but returns non-zero if it could lock the mutex on the first try | ||
| 726 | or 0 if not. This function cannot be safely used in hardware or software | ||
| 727 | interrupt contexts despite not sleeping. | ||
| 728 | </para> | ||
| 729 | </chapter> | ||
| 730 | |||
| 706 | <chapter id="Examples"> | 731 | <chapter id="Examples"> |
| 707 | <title>Common Examples</title> | 732 | <title>Common Examples</title> |
| 708 | <para> | 733 | <para> |
diff --git a/Documentation/DocBook/kgdb.tmpl b/Documentation/DocBook/kgdb.tmpl index 028a8444d95e..e8acd1f03456 100644 --- a/Documentation/DocBook/kgdb.tmpl +++ b/Documentation/DocBook/kgdb.tmpl | |||
| @@ -84,10 +84,9 @@ | |||
| 84 | runs an instance of gdb against the vmlinux file which contains | 84 | runs an instance of gdb against the vmlinux file which contains |
| 85 | the symbols (not boot image such as bzImage, zImage, uImage...). | 85 | the symbols (not boot image such as bzImage, zImage, uImage...). |
| 86 | In gdb the developer specifies the connection parameters and | 86 | In gdb the developer specifies the connection parameters and |
| 87 | connects to kgdb. Depending on which kgdb I/O modules exist in | 87 | connects to kgdb. The type of connection a developer makes with |
| 88 | the kernel for a given architecture, it may be possible to debug | 88 | gdb depends on the availability of kgdb I/O modules compiled as |
| 89 | the test machine's kernel with the development machine using a | 89 | builtin's or kernel modules in the test machine's kernel. |
| 90 | rs232 or ethernet connection. | ||
| 91 | </para> | 90 | </para> |
| 92 | </chapter> | 91 | </chapter> |
| 93 | <chapter id="CompilingAKernel"> | 92 | <chapter id="CompilingAKernel"> |
| @@ -223,7 +222,7 @@ | |||
| 223 | </para> | 222 | </para> |
| 224 | <para> | 223 | <para> |
| 225 | IMPORTANT NOTE: Using this option with kgdb over the console | 224 | IMPORTANT NOTE: Using this option with kgdb over the console |
| 226 | (kgdboc) or kgdb over ethernet (kgdboe) is not supported. | 225 | (kgdboc) is not supported. |
| 227 | </para> | 226 | </para> |
| 228 | </sect1> | 227 | </sect1> |
| 229 | </chapter> | 228 | </chapter> |
| @@ -249,18 +248,11 @@ | |||
| 249 | (gdb) target remote /dev/ttyS0 | 248 | (gdb) target remote /dev/ttyS0 |
| 250 | </programlisting> | 249 | </programlisting> |
| 251 | <para> | 250 | <para> |
| 252 | Example (kgdb to a terminal server): | 251 | Example (kgdb to a terminal server on tcp port 2012): |
| 253 | </para> | 252 | </para> |
| 254 | <programlisting> | 253 | <programlisting> |
| 255 | % gdb ./vmlinux | 254 | % gdb ./vmlinux |
| 256 | (gdb) target remote udp:192.168.2.2:6443 | 255 | (gdb) target remote 192.168.2.2:2012 |
| 257 | </programlisting> | ||
| 258 | <para> | ||
| 259 | Example (kgdb over ethernet): | ||
| 260 | </para> | ||
| 261 | <programlisting> | ||
| 262 | % gdb ./vmlinux | ||
| 263 | (gdb) target remote udp:192.168.2.2:6443 | ||
| 264 | </programlisting> | 256 | </programlisting> |
| 265 | <para> | 257 | <para> |
| 266 | Once connected, you can debug a kernel the way you would debug an | 258 | Once connected, you can debug a kernel the way you would debug an |
