Changeset View
Changeset View
Standalone View
Standalone View
cddl/contrib/opensolaris/lib/libctf/common/ctf.5
.\" | .\" | ||||
.\" This file and its contents are supplied under the terms of the | .\" This file and its contents are supplied under the terms of the | ||||
.\" Common Development and Distribution License ("CDDL"), version 1.0. | .\" Common Development and Distribution License ("CDDL"), version 1.0. | ||||
.\" You may only use this file in accordance with the terms of version | .\" You may only use this file in accordance with the terms of version | ||||
.\" 1.0 of the CDDL. | .\" 1.0 of the CDDL. | ||||
.\" | .\" | ||||
.\" A full copy of the text of the CDDL should have accompanied this | .\" A full copy of the text of the CDDL should have accompanied this | ||||
.\" source. A copy of the CDDL is also available via the Internet at | .\" source. A copy of the CDDL is also available via the Internet at | ||||
.\" http://www.illumos.org/license/CDDL. | .\" http://www.illumos.org/license/CDDL. | ||||
.\" | .\" | ||||
.\" | .\" | ||||
.\" Copyright (c) 2014 Joyent, Inc. | .\" Copyright (c) 2014 Joyent, Inc. | ||||
.\" | .\" | ||||
.Dd Sep 26, 2014 | .Dd Feb 17, 2019 | ||||
.Dt CTF 5 | .Dt CTF 5 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm ctf | .Nm ctf | ||||
.Nd Compact C Type Format | .Nd Compact C Type Format | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.In sys/ctf.h | .In sys/ctf.h | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
▲ Show 20 Lines • Show All 460 Lines • ▼ Show 20 Lines | |||||
#define CTF_K_STRUCT 6 | #define CTF_K_STRUCT 6 | ||||
#define CTF_K_UNION 7 | #define CTF_K_UNION 7 | ||||
#define CTF_K_ENUM 8 | #define CTF_K_ENUM 8 | ||||
#define CTF_K_FORWARD 9 | #define CTF_K_FORWARD 9 | ||||
#define CTF_K_TYPEDEF 10 | #define CTF_K_TYPEDEF 10 | ||||
#define CTF_K_VOLATILE 11 | #define CTF_K_VOLATILE 11 | ||||
#define CTF_K_CONST 12 | #define CTF_K_CONST 12 | ||||
#define CTF_K_RESTRICT 13 | #define CTF_K_RESTRICT 13 | ||||
#define CTF_K_CONSTVAL 14 | |||||
.Ed | .Ed | ||||
.Lp | .Lp | ||||
Programs directly reference many types; however, other types are referenced | Programs directly reference many types; however, other types are referenced | ||||
indirectly because they are part of some other structure. | indirectly because they are part of some other structure. | ||||
These types that are referenced directly and used are called | These types that are referenced directly and used are called | ||||
.Sy root | .Sy root | ||||
types. | types. | ||||
Other types may be used indirectly, for example, a program may reference | Other types may be used indirectly, for example, a program may reference | ||||
▲ Show 20 Lines • Show All 635 Lines • ▼ Show 20 Lines | |||||
.Sy CTF_K_VOLATILE , | .Sy CTF_K_VOLATILE , | ||||
.Sy CTF_K_RESTRICT , | .Sy CTF_K_RESTRICT , | ||||
and | and | ||||
.Sy CTF_K_CONST . | .Sy CTF_K_CONST . | ||||
.Lp | .Lp | ||||
These types have no variable list entries and use the member | These types have no variable list entries and use the member | ||||
.Em ctt_type | .Em ctt_type | ||||
to refer to the base type that they modify. | to refer to the base type that they modify. | ||||
.Ss Encoding of Typed Constant Values | |||||
Sometimes, compilers will optimize out constant arguments to subroutines. | |||||
It is still useful to track that a logical argument is present for dtrace. | |||||
This kind of constant value as a function parameter type is represented much like | |||||
the typedef, volatile, const, or restrict types above. | |||||
The | |||||
.Nm | |||||
type is | |||||
.Sy CTF_K_CONSTVAL | |||||
and like the other referential types, | |||||
.Em ctt_type | |||||
refers to the type of the value. | |||||
.Lp | |||||
This type has an associated signed, 64-bit numerical value. | |||||
It is stored in a variable-length encoding. | |||||
The length of the encoded integer in bytes is specified in | |||||
.Sy vlen . | |||||
Valid encodings are zero, to represent the numerical value zero; | |||||
four, to represent a signed 32-bit value in native endian; | |||||
and eight, to represent a signed 64-bit value. | |||||
.Lp | |||||
Independent values each get their own type. | |||||
.Ss Encoding of Unknown Types | .Ss Encoding of Unknown Types | ||||
Types with the kind | Types with the kind | ||||
.Sy CTF_K_UNKNOWN | .Sy CTF_K_UNKNOWN | ||||
are used to indicate gaps in the type identifier space. | are used to indicate gaps in the type identifier space. | ||||
These entries consume an identifier, but do not define anything. | These entries consume an identifier, but do not define anything. | ||||
Nothing should refer to these gap identifiers. | Nothing should refer to these gap identifiers. | ||||
.Ss Dependencies Between Types | .Ss Dependencies Between Types | ||||
C types can be imagined as a directed, cyclic, graph. | C types can be imagined as a directed, cyclic, graph. | ||||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |