Skip to contentSkip to conversation

2.4.0-test12:

PATCH In review Tim Waugh 2 participants 3 messages Dec 13, 2000 – Dec 14, 2000

Subsystems (2)
lore
Share & tools
lore

Tim Waugh

author
#0 lore raw

PATCH 1/1 2.4.0-test12:

Linus,

Here is a patch from Armin Kuster which adds inline documentation to some macros.

Tim.
*/

2000-12-13 Tim Waugh <[email protected]>

* include/linux/init.h, include/linux/module.h: Inline documentation for some macros. Patch from Armin Kuster.

include/linux/init.h renamed from include/linux/init.h.macrodoc +20 -0
@@ -86,7 +86,27 @@
 #define __FINIT		.previous
 #define __INITDATA	.section	".data.init","aw"
 
+/**
+ * module_init() - driver initialization entry point
+ * @x: function to be run at kernel boot time or module insertion
+ * 
+ * module_init() will add the driver initialization routine in
+ * the "__initcall.int" code segment if the driver is checked as
+ * "y" or static, or else it will wrap the driver initialization
+ * routine with init_module() which is used by insmod and
+ * modprobe when the driver is used as a module.
+ */
 #define module_init(x)	__initcall(x);
+
+/**
+ * module_exit() - driver exit entry point
+ * @x: function to be run when driver is removed
+ * 
+ * module_exit() will wrap the driver clean-up code
+ * with cleanup_module() when used with rmmod when
+ * the driver is a module.  If the driver is statically
+ * compiled into the kernel, module_exit() has no effect.
+ */
 #define module_exit(x)	__exitcall(x);
 
 #else
include/asm-i386/atomic.h renamed from include/asm-i386/atomic.h.macrodoc +74 -0

125 lines not on this page · raw message

Documentation/DocBook/kernel-api.tmpl renamed from Documentation/DocBook/kernel-api.tmpl.macrodoc +12 -0
@@ -34,6 +34,18 @@
  </bookinfo>
 
 <toc></toc>
+
+  <chapter id="Basics">
+     <title>Driver Basic</title>
+     <sect1><title>Driver Entry and Exit points</title>
+!Iinclude/linux/init.h
+     </sect1>
+
+     <sect1><title>Atomics</title>
+!Iinclude/asm-i386/atomic.h
+     </sect1>
+  </chapter>
+
   <chapter id="adt">
      <title>Data Types</title>
      <sect1><title>Doubly Linked Lists</title>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 5 lines · Tim Waugh

+ * atomic_add - add integer to atomic variable
+ * @i: integer value to add
+ * @v: pointer of type atomic_t
+ *
+ * Atomically adds @i to @v.

Perhaps it should mention that the guaranteed useful range of atomic_t is only 24bit ? Documentation without source would rather useless if it didn't mention such pitfalls.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

author
#2 lore raw
In reply to Tim Waugh
Quoted 3 lines · Andi Kleen

Perhaps it should mention that the guaranteed useful range of atomic_t is only 24bit ? Documentation without source would rather useless if it didn't mention such pitfalls.

Does <URL:ftp://people.redhat.com/twaugh/patches/linux24/linux-macrodoc.patch> look better?

Tim.
*/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/