zephyr/doc
Johan Hedberg c3e08c8fea net: buf: Redesigned pool & buffer allocation API
Until now it has been necessary to separately define a k_fifo and
an array of buffers when creating net_buf pools. This has been a bit
of an inconvenience as well as blurred the line of what exactly
constitutes the "pool".

This patch removes the NET_BUF_POOL() macro and replaces it with a
NET_BUF_POOL_DEFINE() macro that internally expands into the buffer
array and new net_buf_pool struct with a given name:

	NET_BUF_POOL_DEFINE(pool_name, ...);

Having a dedicated context struct for the pool has the added benefit
that we can start moving there net_buf members that have the same
value for all buffers from the same pool. The first such member that
gets moved is the destroy callback, thus shrinking net_buf by four
bytes. Another potential candidate is the user_data_size, however
right not that's left out since it would just leave 2 bytes of padding
in net_buf (i.e. not influence its size). Another common value is
buf->size, however that one is also used by net_buf_simple and can
therefore not be moved.

This patch also splits getting buffers from a FIFO and allocating a
new buffer from a pool into two separate APIs: net_buf_get and
net_buf_alloc, thus simplifying the APIs and their usage. There is no
separate 'reserve_head' parameter anymore when allocating, rather the
user is expected to call net_buf_reserve() afterwards if something
else than 0 headroom is desired.

Change-Id: Id91b1e5c2be2deb1274dde47f5edebfe29af383a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-13 21:41:53 +00:00
..
api doc: Revise kernel event logger documentation 2016-11-18 23:17:51 +00:00
application build: Document outputexports 2016-11-12 02:08:08 +00:00
board doc: point to wiki for board documnetation 2016-10-24 18:51:50 +00:00
contribute
crypto
drivers kernel: deprecate old init levels 2016-11-09 17:59:44 +00:00
getting_started docs: remove usage of ARCH=arm 2016-11-10 17:24:45 +00:00
introduction unified/doc: Update Introducing Zephyr 2016-11-01 21:45:38 +00:00
kernel_v2 doc: adapt source tree for new structure 2016-12-07 13:03:51 +00:00
porting kernel: delete old micro and nanokernel documentation 2016-11-04 20:51:01 +00:00
reference unified/doc: Update Kbuild Reference 2016-11-01 21:45:39 +00:00
scripts/genrest
subsystems net: buf: Redesigned pool & buffer allocation API 2016-12-13 21:41:53 +00:00
themes/zephyr
LICENSING.rst LICENSING: clarify licenses of imported / reused code 2016-11-11 01:36:14 +00:00
Makefile
README.rst
conf.py
doxygen.config ztest: Add documentation 2016-09-30 21:17:40 +00:00
index.rst doc: add link to 1.6 documentation 2016-12-03 22:01:47 +00:00

README.rst

:orphan:

Welcome to Zephyr Kernel
########################

.. This document is in Restructured Text Format.
   Find more information regarding the ReST markup in the
   `ReST documentation`_.
   This is a comment that won't show up in formatted output

Welcome to the Zephyr Project.

Thank you for your interest in the Zephyr Project. These instructions are
designed to walk you through generating the Zephyr Project's documentation.

Documentation Notes
*******************

The project's documentation currently comprises the following items:

* An Installation Guide for Linux host systems

* A set of Collaboration Guidelines for the project.

* Doxygen output from the code base for all APIs.

Installing the documentation processors
***************************************

Install the current version of ``Sphinx``, type:

.. code-block:: bash

   $ git clone https://github.com/sphinx-doc/sphinx.git sphinx

   $ cd sphinx

   $ sudo -E python setup.py install

   $ cd ..

   $ git clone https://github.com/michaeljones/breathe.git breathe

   $ cd breathe

   $ sudo -E python setup.py install

.. note::

   Make sure that ``Doxygen`` is installed in your system.
   The installation of Doxygen is beyond the scope of this document.

Running the Documentation Generators
************************************

Assuming that the Zephyr Project tree with the doc directory is in
``DIRECTORY``, type:

.. code-block:: bash

   $ cd DIRECTORY/doc

   $ make doxy html

Find the output in ``DIRECTORY/doc/_build/html/index.html``

Review the available formats with:

.. code-block:: bash

   $ make -C DIRECTORY/doc doxy html

If you want the LaTeX PDF output, you need to install all the Latex
packages first. That installation is beyond the scope of this document.

.. _ReST documentation: http://sphinx-doc.org/rest.html