doxygen: fix comments in printk.c

Change-Id: Ia76b2ef1798999057d8b3a8f1e100e930702d179
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2015-07-16 14:07:57 -04:00
commit 212146d5b4
2 changed files with 22 additions and 35 deletions

View file

@ -101,6 +101,7 @@ INPUT = \
include/ \ include/ \
kernel/microkernel/ \ kernel/microkernel/ \
kernel/nanokernel/ \ kernel/nanokernel/ \
misc/ \
INPUT_ENCODING = UTF-8 INPUT_ENCODING = UTF-8
FILE_PATTERNS = "*.c" "*.h" "*.S" FILE_PATTERNS = "*.c" "*.h" "*.S"
RECURSIVE = YES RECURSIVE = YES

View file

@ -1,5 +1,3 @@
/* printk.c - low-level debug output */
/* /*
* Copyright (c) 2010, 2013-2014 Wind River Systems, Inc. * Copyright (c) 2010, 2013-2014 Wind River Systems, Inc.
* *
@ -30,10 +28,12 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
/* /**
DESCRIPTION * @file
Low-level debugging output. BSP installs a character output routine at * @brief Low-level debug output
init time. If no routine is installed, a nop routine is called. *
* Low-level debugging output. BSP installs a character output routine at
* init time. If no routine is installed, a nop routine is called.
*/ */
#include <misc/printk.h> #include <misc/printk.h>
@ -47,14 +47,12 @@ static void _printk_dec_ulong(const unsigned long num);
static void _printk_hex_ulong(const unsigned long num); static void _printk_hex_ulong(const unsigned long num);
/** /**
*
* @brief Default character output routine that does nothing * @brief Default character output routine that does nothing
* @param c Character to swallow
* *
* @return 0 * @return 0
*/ */
static int _nop_char_out(int c)
static int _nop_char_out(int c /* character to swallow */
)
{ {
ARG_UNUSED(c); ARG_UNUSED(c);
@ -66,33 +64,29 @@ static int (*_char_out)(int) = _nop_char_out;
/** /**
*
* @brief Install the character output routine for printk * @brief Install the character output routine for printk
* *
* To be called by the BSP's console driver at init time. Installs a routine * To be called by the BSP's console driver at init time. Installs a routine
* that outputs one ASCII character at a time. * that outputs one ASCII character at a time.
* @param fn putc routine to install
* *
* @return N/A * @return N/A
*/ */
void __printk_hook_install(int (*fn)(int))
void __printk_hook_install(int (*fn)(int) /* putc routine to install */
)
{ {
_char_out = fn; _char_out = fn;
} }
/** /**
*
* @brief Printk internals * @brief Printk internals
* *
* See printk() for description. * See printk() for description.
* @param fmt Format string
* @param ap Variable parameters
* *
* @return N/A * @return N/A
*/ */
static inline void _vprintk(const char *fmt, va_list ap)
static inline void _vprintk(const char *fmt, /* format string */
va_list ap /* variable parameters */
)
{ {
int might_format = 0; /* 1 if encountered a '%' */ int might_format = 0; /* 1 if encountered a '%' */
@ -155,7 +149,6 @@ static inline void _vprintk(const char *fmt, /* format string */
} }
/** /**
*
* @brief Output a string * @brief Output a string
* *
* Output a string on output installed by BSP at init time. Some printf-like * Output a string on output installed by BSP at init time. Some printf-like
@ -169,11 +162,11 @@ static inline void _vprintk(const char *fmt, /* format string */
* - %p: pointer, same as %x * - %p: pointer, same as %x
* - %d/%i/%u: outputs a 32-bit number in unsigned decimal format. * - %d/%i/%u: outputs a 32-bit number in unsigned decimal format.
* *
* @param fmt formatted string to output
*
* @return N/A * @return N/A
*/ */
void printk(const char *fmt, ...)
void printk(const char *fmt, /* formatted string to output */
...)
{ {
va_list ap; va_list ap;
@ -183,18 +176,15 @@ void printk(const char *fmt, /* formatted string to output */
} }
/** /**
*
* @brief Output an unsigned long in hex format * @brief Output an unsigned long in hex format
* *
* Output an unsigned long on output installed by BSP at init time. Should be * Output an unsigned long on output installed by BSP at init time. Should be
* able to handle an unsigned long of any size, 32 or 64 bit. * able to handle an unsigned long of any size, 32 or 64 bit.
* @param num Number to output
* *
* @return N/A * @return N/A
*/ */
static void _printk_hex_ulong(const unsigned long num)
static void _printk_hex_ulong(
const unsigned long num /* number to output */
)
{ {
int size = sizeof(num) * 2; int size = sizeof(num) * 2;
@ -206,18 +196,15 @@ static void _printk_hex_ulong(
} }
/** /**
*
* @brief Output an unsigned long (32-bit) in decimal format * @brief Output an unsigned long (32-bit) in decimal format
* *
* Output an unsigned long on output installed by BSP at init time. Only works * Output an unsigned long on output installed by BSP at init time. Only works
* with 32-bit values. * with 32-bit values.
* @param num Number to output
* *
* @return N/A * @return N/A
*/ */
static void _printk_dec_ulong(const unsigned long num)
static void _printk_dec_ulong(
const unsigned long num /* number to output */
)
{ {
unsigned long pos = 999999999; unsigned long pos = 999999999;
unsigned long remainder = num; unsigned long remainder = num;
@ -237,14 +224,13 @@ static void _printk_dec_ulong(
#else /* CONFIG_PRINTK */ #else /* CONFIG_PRINTK */
/** /**
*
* @brief Output a string * @brief Output a string
* *
* Debugging output is dropped if it is not to be sent to the console. * Debugging output is dropped if it is not to be sent to the console.
* @param fmt Format
* *
* @return N/A * @return N/A
*/ */
void printk(const char *fmt, ...) void printk(const char *fmt, ...)
{ {
ARG_UNUSED(fmt); ARG_UNUSED(fmt);