System Configuration Information Management Functions

System configuration information management functions maintain and manage various information related to system configuration.

A part of system configuration information including the information on the maximum number of tasks, timer interrupt intervals, etc. are defined as the standard definition. Other than these, any information arbitrarily defined in applications, subsystems, or device drivers can be used by adding it to the system configuration information.

The format of system configuration information consists of a name and defined data as a pair.

Name

The name is a string of up to 16 characters.

Characters that can be used (UB) are a to z, A to Z, 0 to 9 and '_' (underscore).

Defined Data

Data consists of numbers (integers) or character strings.

Characters that can be used (UB) are any characters other than 0x00 to 0x1F, 0x7F, or 0xFF (in character code).

Example 5. Example of Format of System Configuration Information

NameDefined Data
SysVer1 0
SysNameT-Kernel Version 1.00

How the system configuration information is to be stored is not specified here, but it is generally put in memory (ROM/RAM). This functionality is therefore not intended for storing large amounts of information.

System configuration information can be retrieved by tk_get_cfn and tk_get_cfs.

However, system configuration information cannot be added or changed during system execution.

System Configuration Information Acquisition

There are tk_get_cfn and tk_get_cfs as extended SVCs to retrieve system configuration information. These are callable from applications, subsystems, device drivers, etc. and are also used internally in the T-Kernel. Usage inside T-Kernel does not have to go through extended SVC; this choice is implementation-dependent.

tk_get_cfn - Get Numbers

C Language Interface

#include <tk/tkernel.h>

INT ct = tk_get_cfn (CONST UB *name , INT *val , INT max );

Parameter

CONST UB* name NameName
INT* val ValueArray storing numbers
INT max Maximum Count Number of elements in val array

Return Parameter

INT ct Defined Numeric Information CountNumber of defined numeric information
orError CodeError code

Error Codes

E_NOEXS No information is defined for the name specified in the name parameter

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESNO

Description

Gets numeric information from system configuration information. This function gets up to max items of numerical information defined for the name specified in the name parameter and stores the acquired information in val. The number of defined numeric information is passed in the return code. If return code > max, this indicates that not all the information could be stored. By specifying max = 0, the number of defined numeric values can be found out without actually storing them in val.

E_NOEXS is returned if no information is defined for the name specified in the name parameter. The behavior if the information defined for name is a character string is indeterminate.

This function can be invoked from any protection level, without being limited to the protection level from which T-Kernel/OS system call can be invoked.

tk_get_cfs - Get Character String

C Language Interface

#include <tk/tkernel.h>

INT rlen = tk_get_cfs (CONST UB *name , UB *buf , INT max );

Parameter

CONST UB* name NameName
UB* buf BufferArray storing character string
INT max Maximum LengthMaximum size of buf (in bytes)

Return Parameter

INT rlen Size of Defined Character String InformationSize of defined character string information (in bytes)
orError CodeError code

Error Codes

E_NOEXS No information is defined for the name specified in the name parameter

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESNO

Description

Gets character string information from system configuration information. This function gets up to max characters of character string information defined for the name specified in the name parameter and stores the acquired information in buf. If the acquired character string is shorter than max characters, it is terminated by '\0' when stored. The length of the defined character string information (not including '\0') is passed in the return code. If return code > max, this indicates that not all the information could be stored. By specifying max = 0, the character string length can be found out without actually storing anything in buf .

E_NOEXS is returned if no information is defined for the name specified in the name parameter. The behavior if the information defined for name is a numeric string is indeterminate.

This function can be invoked from any protection level, without being limited to the protection level from which T-Kernel/OS system call can be invoked.

Standard System Configuration Information

The following information is defined as standard system configuration information. A standard information name is prefixed by T.

character stringSummary description
NNumeric string information
SCharacter string information

When multiple values are defined for any of the above numeric strings, they are stored in the same order as in the explanation.

Example 6. Example of Storage Order of More than One Numeric Value

tk_get_cfn("TDEvtMbfSz", val, 2)

val[0] = Event notification message buffer size
val[1] = Maximum event notification message length

NoteDifference from T-Kernel 1.0
 

Setting information in microseconds is added as the second element of TTimPeriod.