Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
8d8f60c5
Commit
8d8f60c5
authored
Aug 22, 2016
by
Jonathan Corbet
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'doc/4.9' into docs-next
parents
e349b1b7
ca7bfe2c
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
178 additions
and
20 deletions
+178
-20
Documentation/DocBook/Makefile
Documentation/DocBook/Makefile
+1
-0
Documentation/Makefile.sphinx
Documentation/Makefile.sphinx
+6
-1
Documentation/conf.py
Documentation/conf.py
+35
-12
Documentation/kernel-documentation.rst
Documentation/kernel-documentation.rst
+29
-0
Documentation/media/uapi/cec/cec-func-open.rst
Documentation/media/uapi/cec/cec-func-open.rst
+1
-1
Documentation/media/uapi/cec/cec-ioc-dqevent.rst
Documentation/media/uapi/cec/cec-ioc-dqevent.rst
+3
-2
Documentation/sphinx/cdomain.py
Documentation/sphinx/cdomain.py
+102
-0
Makefile
Makefile
+1
-1
scripts/kernel-doc
scripts/kernel-doc
+0
-3
No files found.
Documentation/DocBook/Makefile
View file @
8d8f60c5
...
@@ -72,6 +72,7 @@ installmandocs: mandocs
...
@@ -72,6 +72,7 @@ installmandocs: mandocs
# no-op for the DocBook toolchain
# no-op for the DocBook toolchain
epubdocs
:
epubdocs
:
latexdocs
:
###
###
#External programs used
#External programs used
...
...
Documentation/Makefile.sphinx
View file @
8d8f60c5
...
@@ -66,12 +66,16 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4);
...
@@ -66,12 +66,16 @@ quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4);
htmldocs
:
htmldocs
:
@
$(
foreach
var,
$(SPHINXDIRS)
,
$(
call
loop_cmd,sphinx,html,
$(var)
,,
$(var)
))
@
$(
foreach
var,
$(SPHINXDIRS)
,
$(
call
loop_cmd,sphinx,html,
$(var)
,,
$(var)
))
pdf
docs
:
latex
docs
:
ifeq
($(HAVE_PDFLATEX),0)
ifeq
($(HAVE_PDFLATEX),0)
$(
warning
The
'xelatex'
command
was not found. Make sure you have it installed and
in
PATH to produce PDF output.
)
$(
warning
The
'xelatex'
command
was not found. Make sure you have it installed and
in
PATH to produce PDF output.
)
@
echo
" SKIP Sphinx
$@
target."
@
echo
" SKIP Sphinx
$@
target."
else
# HAVE_PDFLATEX
else
# HAVE_PDFLATEX
@
$(
call
loop_cmd,sphinx,latex,.,latex,.
)
@
$(
call
loop_cmd,sphinx,latex,.,latex,.
)
endif
# HAVE_PDFLATEX
pdfdocs
:
latexdocs
ifneq
($(HAVE_PDFLATEX),0)
$(Q)$(MAKE)
PDFLATEX
=
xelatex
LATEXOPTS
=
"-interaction=nonstopmode"
-C
$(BUILDDIR)
/latex
$(Q)$(MAKE)
PDFLATEX
=
xelatex
LATEXOPTS
=
"-interaction=nonstopmode"
-C
$(BUILDDIR)
/latex
endif
# HAVE_PDFLATEX
endif
# HAVE_PDFLATEX
...
@@ -95,6 +99,7 @@ endif # HAVE_SPHINX
...
@@ -95,6 +99,7 @@ endif # HAVE_SPHINX
dochelp
:
dochelp
:
@
echo
' Linux kernel internal documentation in different formats (Sphinx):'
@
echo
' Linux kernel internal documentation in different formats (Sphinx):'
@
echo
' htmldocs - HTML'
@
echo
' htmldocs - HTML'
@
echo
' latexdocs - LaTeX'
@
echo
' pdfdocs - PDF'
@
echo
' pdfdocs - PDF'
@
echo
' epubdocs - EPUB'
@
echo
' epubdocs - EPUB'
@
echo
' xmldocs - XML'
@
echo
' xmldocs - XML'
...
...
Documentation/conf.py
View file @
8d8f60c5
...
@@ -34,7 +34,7 @@ from load_config import loadConfig
...
@@ -34,7 +34,7 @@ from load_config import loadConfig
# Add any Sphinx extension module names here, as strings. They can be
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
# ones.
extensions
=
[
'kernel-doc'
,
'rstFlatTable'
,
'kernel_include'
]
extensions
=
[
'kernel-doc'
,
'rstFlatTable'
,
'kernel_include'
,
'cdomain'
]
# The name of the math extension changed on Sphinx 1.4
# The name of the math extension changed on Sphinx 1.4
if
minor
>
3
:
if
minor
>
3
:
...
@@ -277,26 +277,46 @@ latex_elements = {
...
@@ -277,26 +277,46 @@ latex_elements = {
% Allow generate some pages in landscape
% Allow generate some pages in landscape
\
\
usepackage{lscape}
\
\
usepackage{lscape}
% Put notes in gray color and let them be inside a table
% Put notes in color and let them be inside a table
\
\
definecolor{NoteColor}{RGB}{204,255,255}
\
\
definecolor{MyGray}{rgb}{0.80,0.80,0.80}
\
\
definecolor{WarningColor}{RGB}{255,204,204}
\
\
definecolor{AttentionColor}{RGB}{255,255,204}
\
\
makeatletter
\
\
newenvironment{graybox}{%
\
\
definecolor{OtherColor}{RGB}{204,204,204}
\
\
begin{lrbox}{
\
\
@tempboxa}
\
\
begin{minipage}{
\
\
columnwidth}}{
\
\
end{minipage}
\
\
end{lrbox}%
\
\
newlength{
\
\
mynoticelength}
\
\
colorbox{MyGray}{
\
\
usebox{
\
\
@tempboxa}}
\
\
makeatletter
\
\
newenvironment{coloredbox}[1]{%
\
\
setlength{
\
\
fboxrule}{1pt}
\
\
setlength{
\
\
fboxsep}{7pt}
\
\
setlength{
\
\
mynoticelength}{
\
\
linewidth}
\
\
addtolength{
\
\
mynoticelength}{-2
\
\
fboxsep}
\
\
addtolength{
\
\
mynoticelength}{-2
\
\
fboxrule}
\
\
begin{lrbox}{
\
\
@tempboxa}
\
\
begin{minipage}{
\
\
mynoticelength}}{
\
\
end{minipage}
\
\
end{lrbox}%
\
\
ifthenelse%
{
\
\
equal{
\
\
py@noticetype}{note}}%
{
\
\
colorbox{NoteColor}{
\
\
usebox{
\
\
@tempboxa}}}%
{%
\
\
ifthenelse%
{
\
\
equal{
\
\
py@noticetype}{warning}}%
{
\
\
colorbox{WarningColor}{
\
\
usebox{
\
\
@tempboxa}}}%
{%
\
\
ifthenelse%
{
\
\
equal{
\
\
py@noticetype}{attention}}%
{
\
\
colorbox{AttentionColor}{
\
\
usebox{
\
\
@tempboxa}}}%
{
\
\
colorbox{OtherColor}{
\
\
usebox{
\
\
@tempboxa}}}%
}%
}%
}
\
\
makeatother
}
\
\
makeatother
\
\
makeatletter
\
\
makeatletter
\
\
renewenvironment{notice}[2]{
\
\
renewenvironment{notice}[2]{%
\
\
begin{graybox}
\
\
bf
\
\
it
\
\
def
\
\
py@noticetype{#1}
\
\
def
\
\
py@noticetype{#1}
\
\
begin{coloredbox}{#1}
\
\
bf
\
\
it
\
\
par
\
\
strong{#2}
\
\
par
\
\
strong{#2}
\
\
csname py@noticestart@#1
\
\
endcsname
\
\
csname py@noticestart@#1
\
\
endcsname
}
}
{
{
\
\
csname py@noticeend@
\
\
py@noticetype
\
\
endcsname
\
\
csname py@noticeend@
\
\
py@noticetype
\
\
endcsname
\
\
end{
gray
box}
\
\
end{
colored
box}
}
}
\
\
makeatother
\
\
makeatother
...
@@ -306,6 +326,9 @@ latex_elements = {
...
@@ -306,6 +326,9 @@ latex_elements = {
\
\
setromanfont{DejaVu Sans}
\
\
setromanfont{DejaVu Sans}
\
\
setmonofont{DejaVu Sans Mono}
\
\
setmonofont{DejaVu Sans Mono}
% To allow adjusting table sizes
\
\
usepackage{adjustbox}
'''
'''
}
}
...
...
Documentation/kernel-documentation.rst
View file @
8d8f60c5
...
@@ -107,6 +107,35 @@ Here are some specific guidelines for the kernel documentation:
...
@@ -107,6 +107,35 @@ Here are some specific guidelines for the kernel documentation:
the order as encountered."), having the higher levels the same overall makes
the order as encountered."), having the higher levels the same overall makes
it easier to follow the documents.
it easier to follow the documents.
the C domain
------------
The `Sphinx C Domain`_ (name c) is suited for documentation of C API. E.g. a
function prototype:
.. code-block:: rst
.. c:function:: int ioctl( int fd, int request )
The C domain of the kernel-doc has some additional features. E.g. you can
*rename* the reference name of a function with a common name like ``open`` or
``ioctl``:
.. code-block:: rst
.. c:function:: int ioctl( int fd, int request )
:name: VIDIOC_LOG_STATUS
The func-name (e.g. ioctl) remains in the output but the ref-name changed from
``ioctl`` to ``VIDIOC_LOG_STATUS``. The index entry for this function is also
changed to ``VIDIOC_LOG_STATUS`` and the function can now referenced by:
.. code-block:: rst
:c:func:`VIDIOC_LOG_STATUS`
list tables
list tables
-----------
-----------
...
...
Documentation/media/uapi/cec/cec-func-open.rst
View file @
8d8f60c5
...
@@ -32,7 +32,7 @@ Arguments
...
@@ -32,7 +32,7 @@ Arguments
Open flags. Access mode must be ``O_RDWR``.
Open flags. Access mode must be ``O_RDWR``.
When the ``O_NONBLOCK`` flag is given, the
When the ``O_NONBLOCK`` flag is given, the
:ref:`CEC_RECEIVE <CEC_RECEIVE>` and :
ref:`CEC_DQEVENT <CEC_DQEVENT>
` ioctls
:ref:`CEC_RECEIVE <CEC_RECEIVE>` and :
c:func:`CEC_DQEVENT
` ioctls
will return the ``EAGAIN`` error code when no message or event is available, and
will return the ``EAGAIN`` error code when no message or event is available, and
ioctls :ref:`CEC_TRANSMIT <CEC_TRANSMIT>`,
ioctls :ref:`CEC_TRANSMIT <CEC_TRANSMIT>`,
:ref:`CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` and
:ref:`CEC_ADAP_S_PHYS_ADDR <CEC_ADAP_S_PHYS_ADDR>` and
...
...
Documentation/media/uapi/cec/cec-ioc-dqevent.rst
View file @
8d8f60c5
...
@@ -15,7 +15,8 @@ CEC_DQEVENT - Dequeue a CEC event
...
@@ -15,7 +15,8 @@ CEC_DQEVENT - Dequeue a CEC event
Synopsis
Synopsis
========
========
.. cpp:function:: int ioctl( int fd, int request, struct cec_event *argp )
.. c:function:: int ioctl( int fd, int request, struct cec_event *argp )
:name: CEC_DQEVENT
Arguments
Arguments
=========
=========
...
@@ -36,7 +37,7 @@ Description
...
@@ -36,7 +37,7 @@ Description
and is currently only available as a staging kernel module.
and is currently only available as a staging kernel module.
CEC devices can send asynchronous events. These can be retrieved by
CEC devices can send asynchronous events. These can be retrieved by
calling :
ref:`ioctl CEC_DQEVENT <CEC_DQEVENT>
`. If the file descriptor is in
calling :
c:func:`CEC_DQEVENT
`. If the file descriptor is in
non-blocking mode and no event is pending, then it will return -1 and
non-blocking mode and no event is pending, then it will return -1 and
set errno to the ``EAGAIN`` error code.
set errno to the ``EAGAIN`` error code.
...
...
Documentation/sphinx/cdomain.py
0 → 100644
View file @
8d8f60c5
# -*- coding: utf-8; mode: python -*-
u"""
cdomain
~~~~~~~
Replacement for the sphinx c-domain.
:copyright: Copyright (C) 2016 Markus Heiser
:license: GPL Version 2, June 1991 see Linux/COPYING for details.
List of customizations:
* Moved the *duplicate C object description* warnings for function
declarations in the nitpicky mode. See Sphinx documentation for
the config values for ``nitpick`` and ``nitpick_ignore``.
* Add option 'name' to the "c:function:" directive. With option 'name' the
ref-name of a function can be modified. E.g.::
.. c:function:: int ioctl( int fd, int request )
:name: VIDIOC_LOG_STATUS
The func-name (e.g. ioctl) remains in the output but the ref-name changed
from 'ioctl' to 'VIDIOC_LOG_STATUS'. The function is referenced by::
* :c:func:`VIDIOC_LOG_STATUS` or
* :any:`VIDIOC_LOG_STATUS` (``:any:`` needs sphinx 1.3)
"""
from
docutils.parsers.rst
import
directives
from
sphinx.domains.c
import
CObject
as
Base_CObject
from
sphinx.domains.c
import
CDomain
as
Base_CDomain
__version__
=
'1.0'
def
setup
(
app
):
app
.
override_domain
(
CDomain
)
return
dict
(
version
=
__version__
,
parallel_read_safe
=
True
,
parallel_write_safe
=
True
)
class
CObject
(
Base_CObject
):
"""
Description of a C language object.
"""
option_spec
=
{
"name"
:
directives
.
unchanged
}
def
handle_signature
(
self
,
sig
,
signode
):
"""Transform a C signature into RST nodes."""
fullname
=
super
(
CObject
,
self
).
handle_signature
(
sig
,
signode
)
if
"name"
in
self
.
options
:
if
self
.
objtype
==
'function'
:
fullname
=
self
.
options
[
"name"
]
else
:
# FIXME: handle :name: value of other declaration types?
pass
return
fullname
def
add_target_and_index
(
self
,
name
,
sig
,
signode
):
# for C API items we add a prefix since names are usually not qualified
# by a module name and so easily clash with e.g. section titles
targetname
=
'c.'
+
name
if
targetname
not
in
self
.
state
.
document
.
ids
:
signode
[
'names'
].
append
(
targetname
)
signode
[
'ids'
].
append
(
targetname
)
signode
[
'first'
]
=
(
not
self
.
names
)
self
.
state
.
document
.
note_explicit_target
(
signode
)
inv
=
self
.
env
.
domaindata
[
'c'
][
'objects'
]
if
(
name
in
inv
and
self
.
env
.
config
.
nitpicky
):
if
self
.
objtype
==
'function'
:
if
(
'c:func'
,
name
)
not
in
self
.
env
.
config
.
nitpick_ignore
:
self
.
state_machine
.
reporter
.
warning
(
'duplicate C object description of %s, '
%
name
+
'other instance in '
+
self
.
env
.
doc2path
(
inv
[
name
][
0
]),
line
=
self
.
lineno
)
inv
[
name
]
=
(
self
.
env
.
docname
,
self
.
objtype
)
indextext
=
self
.
get_index_text
(
name
)
if
indextext
:
self
.
indexnode
[
'entries'
].
append
((
'single'
,
indextext
,
targetname
,
''
,
None
))
class
CDomain
(
Base_CDomain
):
"""C language domain."""
name
=
'c'
label
=
'C'
directives
=
{
'function'
:
CObject
,
'member'
:
CObject
,
'macro'
:
CObject
,
'type'
:
CObject
,
'var'
:
CObject
,
}
Makefile
View file @
8d8f60c5
...
@@ -1432,7 +1432,7 @@ $(help-board-dirs): help-%:
...
@@ -1432,7 +1432,7 @@ $(help-board-dirs): help-%:
# Documentation targets
# Documentation targets
# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
DOC_TARGETS
:=
xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs epubdocs cleandocs
DOC_TARGETS
:=
xmldocs sgmldocs psdocs
latexdocs
pdfdocs htmldocs mandocs installmandocs epubdocs cleandocs
PHONY
+=
$(DOC_TARGETS)
PHONY
+=
$(DOC_TARGETS)
$(DOC_TARGETS)
:
scripts_basic FORCE
$(DOC_TARGETS)
:
scripts_basic FORCE
$(Q)$(MAKE)
$(build)
=
scripts build_docproc build_check-lc_ctype
$(Q)$(MAKE)
$(build)
=
scripts build_docproc build_check-lc_ctype
...
...
scripts/kernel-doc
View file @
8d8f60c5
...
@@ -1849,9 +1849,6 @@ sub output_function_rst(%) {
...
@@ -1849,9 +1849,6 @@ sub output_function_rst(%) {
$count
++
;
$count
++
;
$type
=
$args
{'
parametertypes
'}{
$parameter
};
$type
=
$args
{'
parametertypes
'}{
$parameter
};
# RST doesn't like address_space tags at function prototypes
$type
=~
s/__(user|kernel|iomem|percpu|pmem|rcu)\s*//
;
if
(
$type
=~
m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/
)
{
if
(
$type
=~
m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/
)
{
# pointer-to-function
# pointer-to-function
print
$1
.
$parameter
.
"
) (
"
.
$2
;
print
$1
.
$parameter
.
"
) (
"
.
$2
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment