Skip to content

Commit

Permalink
Started to create an adoc man page for eachman page
Browse files Browse the repository at this point in the history
hansu committed Sep 2, 2024
1 parent 8ee1c91 commit 305997b
Showing 28 changed files with 408 additions and 156 deletions.
17 changes: 10 additions & 7 deletions docs/man/.gitignore
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ man1/xyzab-tdr-gui.1
man1/xyzac-trt-gui.1
man1/xyzbc-trt-gui.1

man3/EXPORT_FUNCTION.3
man3/EXPORT_FUNCTION.3rtapi
man3/hal_add_funct_to_thread.3
man3/hal_bit_t.3
man3/hal_bool.3
@@ -134,6 +134,9 @@ man3/hal_get_lock.3
man3/hal_init.3hal
man3/hal_link.3
man3/hal_malloc.3hal
man3/MODULE_AUTHOR.3rtapi
man3/MODULE_DESCRIPTION.3rtapi
man3/MODULE_LICENSE.3rtapi
man3/hal_param_alias.3hal
man3/hal_param_bit_new.3
man3/hal_param_bit_newf.3
@@ -211,12 +214,12 @@ man3/rtapi_io.3rtapi
man3/rtapi_is.3rtapi
man3/rtapi_list.3rtapi
man3/rtapi_module_param.3
man3/RTAPI_MP_ARRAY_INT.3
man3/RTAPI_MP_ARRAY_LONG.3
man3/RTAPI_MP_ARRAY_STRING.3
man3/RTAPI_MP_INT.3
man3/RTAPI_MP_LONG.3
man3/RTAPI_MP_STRING.3
man3/RTAPI_MP_ARRAY_INT.3rtapi
man3/RTAPI_MP_ARRAY_LONG.3rtapi
man3/RTAPI_MP_ARRAY_STRING.3rtapi
man3/RTAPI_MP_INT.3rtapi
man3/RTAPI_MP_LONG.3rtapi
man3/RTAPI_MP_STRING.3rtapi
man3/rtapi_mutex.3rtapi
man3/rtapi_open_as_root.3rtapi
man3/rtapi_outb.3
9 changes: 9 additions & 0 deletions docs/src/man/man3/EXPORT_FUNCTION.3rtapi.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= EXPORT_FUNCTION(3rtapi)

== NAME

EXPORT_FUNCTION - Specifying module parameters

include::rtapi_module_param.3.body[]
7 changes: 7 additions & 0 deletions docs/src/man/man3/MODULE_AUTHOR.3rtapi.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
= MODULE_AUTOR(3rtapi)

== NAME

MODULE_AUTHOR - Specifying module parameters

include::rtapi_module_param.3.body[]
7 changes: 7 additions & 0 deletions docs/src/man/man3/MODULE_DESCRIPTION.3rtapi.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
= MODULE_DESCRIPTION(3rtapi)

== NAME

MODULE_DESCRIPTION - Specifying module parameters

include::rtapi_module_param.3.adoc[]
7 changes: 7 additions & 0 deletions docs/src/man/man3/MODULE_LICENSE.3rtapi.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
= MODULE_LICENSE(3rtapi)

== NAME

MODULE_LICENSE - Specifying module parameters

include::rtapi_module_param.3.adoc[]
9 changes: 9 additions & 0 deletions docs/src/man/man3/RTAPI_MP_ARRAY_INT.3rtapi.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= RTAPI_MP_ARRAY_INT(3rtapi)

== NAME

RTAPI_MP_ARRAY_INT - Specifying module parameters

include::rtapi_module_param.3.body[]
9 changes: 9 additions & 0 deletions docs/src/man/man3/RTAPI_MP_ARRAY_LONG.3rtapi.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= RTAPI_MP_ARRAY_LONG(3rtapi)

== NAME

RTAPI_MP_ARRAY_LONG - Specifying module parameters

include::rtapi_module_param.3.body[]
9 changes: 9 additions & 0 deletions docs/src/man/man3/RTAPI_MP_ARRAY_STRING.3rtapi.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= RTAPI_MP_ARRAY_STRING(3rtapi)

== NAME

RTAPI_MP_ARRAY_STRING - Specifying module parameters

include::rtapi_module_param.3.body[]
9 changes: 9 additions & 0 deletions docs/src/man/man3/RTAPI_MP_INT.3rtapi.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= RTAPI_MP_INT(3rtapi)

== NAME

RTAPI_MP_INT - Specifying module parameters

include::rtapi_module_param.3.body[]
9 changes: 9 additions & 0 deletions docs/src/man/man3/RTAPI_MP_LONG.3rtapi.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= RTAPI_MP_LONG(3rtapi)

== NAME

RTAPI_MP_LONG - Specifying module parameters

include::rtapi_module_param.3.body[]
9 changes: 9 additions & 0 deletions docs/src/man/man3/RTAPI_MP_STRING.3rtapi.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= RTAPI_MP_STRING(3rtapi)

== NAME

RTAPI_MP_STRING - Specifying module parameters

include::rtapi_module_param.3.body[]
2 changes: 1 addition & 1 deletion docs/src/man/man3/hal_add_funct_to_thread.3.adoc
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

== NAME

hal_add_funct_to_thread, hal_del_funct_from_thread - cause a function to be executed at regular intervals
hal_add_funct_to_thread - cause a function to be executed at regular intervals

== SYNTAX

9 changes: 9 additions & 0 deletions docs/src/man/man3/hal_bit_t.3.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= hal_bit_t(3hal)

== NAME

hal_bit_t - typedefs for HAL datatypes

include::hal_type_t.3.body[]
9 changes: 9 additions & 0 deletions docs/src/man/man3/hal_bool.3.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= hal_bool(3hal)

== NAME

hal_bool - typedefs for HAL datatypes

include::hal_type_t.3.body[]
51 changes: 51 additions & 0 deletions docs/src/man/man3/hal_del_funct_from_thread.3.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
:manvolnum: 3

= hal_del_funct_from_thread(3hal)

== NAME

hal_del_funct_from_thread - cause a function to be executed at regular intervals

== SYNTAX

int hal_add_funct_to_thread(const char *_funct_name_, const char
*_thread_name_, int position)

int hal_del_funct_from_thread(const char *_funct_name_, const char
*_thread_name_)

== ARGUMENTS

funct_name::
The name of the function.
thread_name::
The name of the thread.
position::
The desired location within the thread. This determines when the
function will run, in relation to other functions in the thread. A
positive number indicates the desired location as measured from the
beginning of the thread, and a negative is measured from the end. So
+1 means this function will become the first one to run, +5 means it
will be the fifth one to run, -2 means it will be next to last, and -1
means it will be last. Zero is illegal.

== DESCRIPTION

*hal_add_funct_to_thread* adds a function exported by a realtime HAL
component to a realtime thread. This determines how often and in what
order functions are executed.

*hal_del_funct_from_thread* removes a function from a thread.

== RETURN VALUE

Returns a HAL status code.

== REALTIME CONSIDERATIONS

Call only from realtime init code, not from other realtime or
non-realtime code.

== SEE ALSO

hal_thread_new(3hal), hal_export_funct(3hal)
2 changes: 1 addition & 1 deletion docs/src/man/man3/hal_export_funct.3.adoc
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@

== NAME

hal_export_funct, hal_export_functf - create a realtime function callable from a thread
hal_export_funct - create a realtime function callable from a thread

== SYNTAX

27 changes: 27 additions & 0 deletions docs/src/man/man3/hal_export_functf.3.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
:manvolnum: 3

= hal_export_functf(3hal)

== NAME

hal_export_functf - create a realtime function callable from a thread

== SYNTAX

int hal_export_funct(const char *name, void (*funct) (void *, long),
void *arg, int uses_fp, int reentrant, int comp_id);

== DESCRIPTION

*hal_export_functf* is similar to hal_export_funct except that it also does
printf-style formatting to compute the function name.
If successful, it returns 0.
On failure it returns a negative error code.

== RETURN VALUE

Returns a HAL status code.

== SEE ALSO

hal_export_funct(3hal)
23 changes: 23 additions & 0 deletions docs/src/man/man3/hal_get_lock.3.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
:manvolnum: 3

= hal_get_lock(3hal)

== NAME

hal_get_lock - Get the HAL lock level

== SYNTAX

int hal_get_lock()

== ARGUMENTS

lock_type::
The desired lock type, which may be a bitwise combination of:
*HAL_LOCK_LOAD*, *HAL_LOCK_CONFIG*, *HAL_LOCK_PARAMS*, or
*HAL_LOCK_PARAMS*. *HAL_LOCK_NONE* or 0 locks nothing, and
*HAL_LOCK_ALL locks everything.*

== RETURN VALUE

*hal_get_lock* returns the current HAL lock level or a HAL status code.
9 changes: 9 additions & 0 deletions docs/src/man/man3/hal_port_t.3.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= hal_port_t(3hal)

== NAME

hal_port_t - typedefs for HAL datatypes

include::hal_type_t.3.body[]
9 changes: 9 additions & 0 deletions docs/src/man/man3/hal_s32_t.3.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= hal_s32_t(3hal)

== NAME

hal_s32_t - typedefs for HAL datatypes

include::hal_type_t.3.body[]
7 changes: 2 additions & 5 deletions docs/src/man/man3/hal_set_lock.3.adoc
Original file line number Diff line number Diff line change
@@ -4,14 +4,12 @@

== NAME

hal_set_lock, hal_get_lock - Set or get the HAL lock level
hal_set_lock - Set the HAL lock level

== SYNTAX

int hal_set_lock(unsigned char _lock_type_)

int hal_get_lock()

== ARGUMENTS

lock_type::
@@ -22,5 +20,4 @@ lock_type::

== RETURN VALUE

*hal_set_lock* Returns a HAL status code. *hal_get_lock* returns the
current HAL lock level or a HAL status code.
*hal_set_lock* Returns a HAL status code.
69 changes: 2 additions & 67 deletions docs/src/man/man3/hal_type_t.3.adoc
Original file line number Diff line number Diff line change
@@ -4,71 +4,6 @@

== NAME

hal_type_t, hal_bool, hal_bit_t, hal_s32_t, hal_u32_t, hal_port_t, hal_float_t, real_t, ireal_t - typedefs for HAL datatypes
hal_type_t - typedefs for HAL datatypes

== DESCRIPTION

typedef ... *hal_bool;*::
A type which may have a value of 0 or nonzero.
typedef ... *hal_bit_t;*::
A volatile type which may have a value of 0 or nonzero.
typedef ... *hal_s32_t*;::
A volatile type which may have a value from -2147483648 to 2147483647.
typedef ... *hal_u32_t*;::
A volatile type which may have a value from 0 to 4294967295.
typedef ... *hal_port_t*;::
A volatile handle to a port object. Used with hal_port* functions.
typedef ... *hal_float_t*;::
A volatile floating-point type, which typically has the same precision
and range as the C type *double*.
typedef ... *real_t*;::
A nonvolatile floating-point type with at least as much precision as
*hal_float_t*.
typedef ... *ireal_t*;::
A nonvolatile unsigned integral type the same size as *hal_float_t*.
typedef enum *hal_type_t*;::
+
*HAL_BIT*;;
Corresponds to the type *hal_bit_t*.
*HAL_FLOAT*;;
Corresponds to the type *hal_float_t*.
*HAL_S32*;;
Corresponds to the type *hal_s32_t*.
*HAL_U32*;;
Corresponds to the type *hal_u32_t*.

== NOTES

*hal_bit_t* is typically a typedef to an integer type whose range is
larger than just 0 and 1. When testing the value of a *hal_bit_t*, never
compare it to 1. Prefer one of the following:

____
* if(b)
* if(b != 0)
____

It is often useful to refer to a type that can represent all the values
as a HAL type, but without the volatile qualifier. The following types
correspond with the HAL types:

____
hal_bit_t::
int
hal_s32_t::
__s32
hal_u32_t::
__u32
hal_float_t::
hal_real_t
hal_port_t::
int
____

Take care not to use the types *s32* and *u32*. These will compile in
kernel modules but not in userspace, and not for realtime components
when using uspace realtime.

== SEE ALSO

hal_pin_new(3hal), hal_param_new(3hal)
include::hal_type_t.3.body[]
67 changes: 67 additions & 0 deletions docs/src/man/man3/hal_type_t.3.body
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

== DESCRIPTION

typedef ... *hal_bool;*::
A type which may have a value of 0 or nonzero.
typedef ... *hal_bit_t;*::
A volatile type which may have a value of 0 or nonzero.
typedef ... *hal_s32_t*;::
A volatile type which may have a value from -2147483648 to 2147483647.
typedef ... *hal_u32_t*;::
A volatile type which may have a value from 0 to 4294967295.
typedef ... *hal_port_t*;::
A volatile handle to a port object. Used with hal_port* functions.
typedef ... *hal_float_t*;::
A volatile floating-point type, which typically has the same precision
and range as the C type *double*.
typedef ... *real_t*;::
A nonvolatile floating-point type with at least as much precision as
*hal_float_t*.
typedef ... *ireal_t*;::
A nonvolatile unsigned integral type the same size as *hal_float_t*.
typedef enum *hal_type_t*;::
+
*HAL_BIT*;;
Corresponds to the type *hal_bit_t*.
*HAL_FLOAT*;;
Corresponds to the type *hal_float_t*.
*HAL_S32*;;
Corresponds to the type *hal_s32_t*.
*HAL_U32*;;
Corresponds to the type *hal_u32_t*.

== NOTES

*hal_bit_t* is typically a typedef to an integer type whose range is
larger than just 0 and 1. When testing the value of a *hal_bit_t*, never
compare it to 1. Prefer one of the following:

____
* if(b)
* if(b != 0)
____

It is often useful to refer to a type that can represent all the values
as a HAL type, but without the volatile qualifier. The following types
correspond with the HAL types:

____
hal_bit_t::
int
hal_s32_t::
__s32
hal_u32_t::
__u32
hal_float_t::
hal_real_t
hal_port_t::
int
____

Take care not to use the types *s32* and *u32*. These will compile in
kernel modules but not in userspace, and not for realtime components
when using uspace realtime.

== SEE ALSO

hal_pin_new(3hal), hal_param_new(3hal)
9 changes: 9 additions & 0 deletions docs/src/man/man3/hal_u32_t.3.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= hal_u32_t(3hal)

== NAME

hal_u32_t - typedefs for HAL datatypes

include::hal_type_t.3.body[]
9 changes: 9 additions & 0 deletions docs/src/man/man3/ireal_t.3.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= ireal_t(3hal)

== NAME

ireal_t - typedefs for HAL datatypes

include::hal_type_t.3.body[]
9 changes: 9 additions & 0 deletions docs/src/man/man3/real_t.3.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:manvolnum: 3

= real_t(3hal)

== NAME

real_t - typedefs for HAL datatypes

include::hal_type_t.3.body[]
77 changes: 2 additions & 75 deletions docs/src/man/man3/rtapi_module_param.3.adoc
Original file line number Diff line number Diff line change
@@ -4,79 +4,6 @@

== NAME

rtapi_module_param, EXPORT_FUNCTION, RTAPI_MP_INT, RTAPI_MP_LONG,
RTAPI_MP_STRING, RTAPI_MP_ARRAY_INT, RTAPI_MP_ARRAY_LONG,
RTAPI_MP_ARRAY_STRING, MODULE_LICENSE, MODULE_AUTHOR,
MODULE_DESCRIPTION - Specifying module parameters
rtapi_module_param - Specifying module parameters

== SYNTAX

....
RTAPI_MP_INT(_var_, _description_);
RTAPI_MP_LONG(_var_, _description_);
RTAPI_MP_STRING(_var_, _description_);
RTAPI_MP_ARRAY_INT(_var_, _num_, _description_);
RTAPI_MP_ARRAY_LONG(_var_, _num_, _description_);
RTAPI_MP_ARRAY_STRING(_var_, _num_, _description_);
MODULE_LICENSE(_license_);
MODULE_AUTHOR(_author_);
MODULE_DESCRIPTION(_description_);
EXPORT_FUNCTION(_function_);
....

== ARGUMENTS

var::
The variable where the parameter should be stored
description::
A short description of the parameter or module
num::
The maximum number of values for an array parameter
license::
The license of the module, for instance "GPL"
author::
The author of the module
function::
The pointer to the function to be exported

== DESCRIPTION

These macros are portable ways to declare kernel module parameters. They
must be used in the global scope, and are not followed by a terminating
semicolon. They must be used after the associated variable or function
has been defined.

== NOTES

EXPORT_FUNCTION makes a symbol available for use by a subsequently
loaded component. It is unrelated to HAL functions, which are described
in hal_export_funct(3hal)

== Interpretation of license strings

*MODULE_LICENSE* follows the kernel's definition of license strings.
Notably, "GPL" indicates "GNU General Public License v2 _or later_".
(emphasis ours).

"GPL"::
GNU General Public License v2 or later
"GPL v2"::
GNU General Public License v2
"GPL and additional rights"::
GNU General Public License v2 rights and more
"Dual BSD/GPL"::
GNU General Public License v2 or BSD license choice
"Dual MIT/GPL"::
GNU General Public License v2 or MIT license choice
"Dual MPL/GPL"::
GNU General Public License v2 or Mozilla license choice
"Proprietary"::
Non-free products

It is still good practice to include a license block which indicates the
author, copyright date, and disclaimer of warranty as recommended by the
GNU GPL.

== REALTIME CONSIDERATIONS

Not available in userspace code.
include::rtapi_module_param.3.body[]
75 changes: 75 additions & 0 deletions docs/src/man/man3/rtapi_module_param.3.body
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// Tis is the content of rtapi_module_param(3rtapi) without header to avoid
// problems with name mismatches as it is included in other man pages.


== SYNTAX

....
RTAPI_MP_INT(_var_, _description_);
RTAPI_MP_LONG(_var_, _description_);
RTAPI_MP_STRING(_var_, _description_);
RTAPI_MP_ARRAY_INT(_var_, _num_, _description_);
RTAPI_MP_ARRAY_LONG(_var_, _num_, _description_);
RTAPI_MP_ARRAY_STRING(_var_, _num_, _description_);
MODULE_LICENSE(_license_);
MODULE_AUTHOR(_author_);
MODULE_DESCRIPTION(_description_);
EXPORT_FUNCTION(_function_);
....

== ARGUMENTS

var::
The variable where the parameter should be stored
description::
A short description of the parameter or module
num::
The maximum number of values for an array parameter
license::
The license of the module, for instance "GPL"
author::
The author of the module
function::
The pointer to the function to be exported

== DESCRIPTION

These macros are portable ways to declare kernel module parameters. They
must be used in the global scope, and are not followed by a terminating
semicolon. They must be used after the associated variable or function
has been defined.

== NOTES

EXPORT_FUNCTION makes a symbol available for use by a subsequently
loaded component. It is unrelated to HAL functions, which are described
in hal_export_funct(3hal)

== Interpretation of license strings

*MODULE_LICENSE* follows the kernel's definition of license strings.
Notably, "GPL" indicates "GNU General Public License v2 _or later_".
(emphasis ours).

"GPL"::
GNU General Public License v2 or later
"GPL v2"::
GNU General Public License v2
"GPL and additional rights"::
GNU General Public License v2 rights and more
"Dual BSD/GPL"::
GNU General Public License v2 or BSD license choice
"Dual MIT/GPL"::
GNU General Public License v2 or MIT license choice
"Dual MPL/GPL"::
GNU General Public License v2 or Mozilla license choice
"Proprietary"::
Non-free products

It is still good practice to include a license block which indicates the
author, copyright date, and disclaimer of warranty as recommended by the
GNU GPL.

== REALTIME CONSIDERATIONS

Not available in userspace code.

0 comments on commit 305997b

Please sign in to comment.