lkml.org 
[lkml]   [2000]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
SubjectDOCBOOK patch

hello;

This patch does the following:

1) Enhances the kernel-doc script to strip out macros from header files
2) Corrects path to videodev.c in makefile, kernel-api.tmpl and
videobook.tmpl
3) Adds docbook tags to /asm-i386/atomic.h and /linux/init.h
4) Adds atomic and module calls to kernel-api.tmpl


TIA;

armin



diff -ru ../linux-2.4.0-test8_org/Documentation/DocBook/Makefile
./Documentation/DocBook/Makefile
--- ../linux-2.4.0-test8_org/Documentation/DocBook/Makefile Tue Sep 26
01:55:33 2000
+++ ./Documentation/DocBook/Makefile Tue Sep 26 02:48:40 2000
@@ -55,11 +55,11 @@
$(TOPDIR)/scripts/docgen $(TOPDIR)/arch/i386/kernel/mca.c \
<mcabook.tmpl >mcabook.sgml

-videobook.sgml: videobook.tmpl $(TOPDIR)/drivers/char/videodev.c
- $(TOPDIR)/scripts/docgen $(TOPDIR)/drivers/char/videodev.c \
+videobook.sgml: videobook.tmpl $(TOPDIR)/drivers/media/video/videodev.c
+ $(TOPDIR)/scripts/docgen $(TOPDIR)/drivers/media/video/videodev.c \
<videobook.tmpl >videobook.sgml

-APISOURCES := $(TOPDIR)/drivers/char/videodev.c \
+APISOURCES := $(TOPDIR)/drivers/media/video/videodev.c \
$(TOPDIR)/arch/i386/kernel/mca.c \
$(TOPDIR)/arch/i386/kernel/mtrr.c \
$(TOPDIR)/drivers/char/misc.c \
diff -ru ../linux-2.4.0-test8_org/Documentation/DocBook/kernel-api.tmpl
./Documentation/DocBook/kernel-api.tmpl
--- ../linux-2.4.0-test8_org/Documentation/DocBook/kernel-api.tmpl Tue
Sep 26 01:55:33 2000
+++ ./Documentation/DocBook/kernel-api.tmpl Tue Sep 26 02:48:40 2000
@@ -34,8 +34,20 @@
</bookinfo>

<toc></toc>
- <chapter id="adt">
- <title>Data Types</title>
+
+ <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>
!Iinclude/linux/list.h
</sect1>
@@ -141,7 +153,7 @@

<chapter id="viddev">
<title>Video4Linux</title>
-!Edrivers/char/videodev.c
+!Edrivers/media/video/videodev.c
</chapter>

<chapter id="snddev">
diff -ru ../linux-2.4.0-test8_org/Documentation/DocBook/videobook.tmpl
./Documentation/DocBook/videobook.tmpl
--- ../linux-2.4.0-test8_org/Documentation/DocBook/videobook.tmpl Wed
Mar 15 10:28:32 2000
+++ ./Documentation/DocBook/videobook.tmpl Tue Sep 26 02:48:40 2000
@@ -66,7 +66,7 @@
vertical blanking data interfaces are also provided.
</para>
</chapter>
- <chapter>
+ <chapter id="radio">
<title>Radio Devices</title>
<para>
There are a wide variety of radio interfaces available for
PC's, and these
@@ -1657,7 +1657,7 @@

<chapter id="pubfunctions">
<title>Public Functions Provided</title>
-!Edrivers/char/videodev.c
+!Edrivers/media/video/videodev.c
</chapter>

</book>
diff -ru ../linux-2.4.0-test8_org/include/asm-i386/atomic.h
./include/asm-i386/atomic.h
--- ../linux-2.4.0-test8_org/include/asm-i386/atomic.h Tue Sep 26
01:56:09 2000
+++ ./include/asm-i386/atomic.h Tue Sep 26 06:09:07 2000
@@ -23,9 +23,30 @@

#define ATOMIC_INIT(i) { (i) }

+/**
+ * atomic_read - reads variable
+ * @v: pointer of type atomic_t
+ *
+ * Reads the atomic value of the interger "v"
+ */
#define atomic_read(v) ((v)->counter)
+
+/**
+ * atomic_set - sets variable
+ * @v: pointer of type atomic_t
+ * @i: variable to
+ *
+ * Sets the atomic value of the interger "v" to "i"
+ */
#define atomic_set(v,i) (((v)->counter) = (i))

+/**
+ * atomic_add - Add interger to atomic variable
+ * @i: interger
+ * @v: pointer of type atomic_t
+ *
+ * Adds interger "i" to atomic variable pointed to by "v"
+ */
static __inline__ void atomic_add(int i, atomic_t *v)
{
__asm__ __volatile__(
@@ -34,6 +55,13 @@
:"ir" (i), "m" (v->counter));
}

+/**
+ * atomic_sub - Subtract the atomic variable
+ * @i: interger
+ * @v: pointer of type atomic_t
+ *
+ * Subtracts interger "i" from atomic variable pointed to by "v"
+ */
static __inline__ void atomic_sub(int i, atomic_t *v)
{
__asm__ __volatile__(
@@ -42,6 +70,15 @@
:"ir" (i), "m" (v->counter));
}

+/**
+ * atomic_sub_and_test - test variable then subtract
+ * @i: interger
+ * @v: pointer of type atomic_t
+ *
+ * Subtracts by interger "i" from atomic variable pointed
+ * to by "v" and returns true if value is 0 else false
+ * for all other cases
+ */
static __inline__ int atomic_sub_and_test(int i, atomic_t *v)
{
unsigned char c;
@@ -53,6 +90,13 @@
return c;
}

+/**
+ * atomic_inc - Increaments atomic variable
+ * @v: pointer of type atomic_t
+ *
+ * Increaments by 1 the atomic value pointed
+ * to by "v"
+ */
static __inline__ void atomic_inc(atomic_t *v)
{
__asm__ __volatile__(
@@ -61,6 +105,13 @@
:"m" (v->counter));
}

+/**
+ * atomic_dec - Decreament the atomic variable
+ * @v: pointer of type atomic_t
+ *
+ * Decreament by 1 the atomic value pointed to
+ * by "v"
+ */
static __inline__ void atomic_dec(atomic_t *v)
{
__asm__ __volatile__(
@@ -69,6 +120,14 @@
:"m" (v->counter));
}

+/**
+ * atomic_dec_and_test - Decreament by 1 and test
+ * @v: pointer of type atomic_t
+ *
+ * Decreament the value pointed to by "v" by 1 and
+ * return true if result is 0 else false for all other
+ * cases
+ */
static __inline__ int atomic_dec_and_test(atomic_t *v)
{
unsigned char c;
@@ -80,6 +139,14 @@
return c != 0;
}

+/**
+ * atomic_inc_and_test - Increament by 1 and test
+ * @v: pointer of type atomic_t
+ *
+ * Increament by 1 the atomic value pointed to by "v"
+ * and return true if result is 0 else false for all
+ * other cases
+ */
static __inline__ int atomic_inc_and_test(atomic_t *v)
{
unsigned char c;
@@ -91,6 +158,15 @@
return c != 0;
}

+/**
+ * atomic_add_and_negative - Add and test for negative
+ * @v: pointer of type atomic_t
+ * @i: interger i
+ *
+ * Add intergter "i" to atomic variable pointed to by
+ * "v" and return true if the result is negative else
+ * return false when result is greater than or equall to 0
+ */
static __inline__ int atomic_add_negative(int i, atomic_t *v)
{
unsigned char c;
diff -ru ../linux-2.4.0-test8_org/include/linux/init.h
./include/linux/init.h
--- ../linux-2.4.0-test8_org/include/linux/init.h Fri Sep 8 12:52:41
2000
+++ ./include/linux/init.h Tue Sep 26 02:48:45 2000
@@ -85,7 +85,27 @@
#define __FINIT .previous
#define __INITDATA .section ".data.init","aw"

+/**
+ * module_init() - Driver initialization entry point
+ * @x: funtion 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 else it will wrape 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: funtion to be run at when driver is removed
+ *
+ * module_exit() will do nothing if static else it will
+ * wrape the driver cleanup code with cleanup_module
+ * when used with rmmod when the driver is a module
+ */
#define module_exit(x) __exitcall(x);

#else
diff -ru ../linux-2.4.0-test8_org/scripts/kernel-doc
./scripts/kernel-doc
--- ../linux-2.4.0-test8_org/scripts/kernel-doc Wed Jul 5 12:56:01 2000
+++ ./scripts/kernel-doc Tue Sep 26 02:48:45 2000
@@ -2,6 +2,9 @@

## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
## Copyright (C) 2000 Tim Waugh <twaugh@redhat.com> ##
+## ##
+## #define enhancements by Armin Kuster <akuster@mvista.com> ##
+## Copyright (c) 2000 MontaVista Software, Inc. ##
## ##
## This software falls under the GNU General Public License. ##
## Please read the COPYING file for more information ##
@@ -662,8 +665,14 @@
$prototype =~ s/^extern+ //;
$prototype =~ s/^inline+ //;
$prototype =~ s/^__inline__+ //;
+ $prototype =~ s/^#define+ //; #ak added

- if ($prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
+ if ($prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
+ $prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
+ $prototype =~ m/^(\w+\s*\*)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
+ $prototype =~ m/^(\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
+ $prototype =~ m/^(\w+\s+\w+\s*\*)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/
||
+ $prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
$prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
$prototype =~ m/^(\w+\s*\*)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
$prototype =~ m/^(\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
@@ -876,7 +885,7 @@
elsif (/([^\{]*)/) {
$prototype .= $1;
}
- if (/\{/) {
+ if (/\{/ || /\#/) { # added for #define AK
$prototype =~ s@/\*.*?\*/@@gos; # strip comments.
$prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
$prototype =~ s@^ +@@gos; # strip leading spaces
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.526 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site