/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1994, by Sun Microsytems, Inc.
*/
#ifndef _SYS_TNF_COM_H
#define _SYS_TNF_COM_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* NOTE: All types are in host (not necessarily file) format.
* Readers are responsible for endian or other transformation.
*/
/*
* Magic number(s): first word of TNF file.
*
* A writer stores the native unsigned 32-bit integer TNF_MAGIC.
* A same-endian reader will load it as TNF_MAGIC.
* A different-endian reader will load it as TNF_MAGIC_1.
*/
/*
* Fundamental types. Machine dependent.
*/
typedef char tnf_char_t;
typedef signed char tnf_int8_t;
typedef unsigned char tnf_uint8_t;
typedef short tnf_int16_t;
typedef unsigned short tnf_uint16_t;
typedef int tnf_int32_t;
typedef unsigned int tnf_uint32_t;
typedef float tnf_float32_t;
typedef double tnf_float64_t;
/*
* TNF references
*/
/* Generation number for tag blocks */
/* definition of space values */
/* Macros on setting or checking space values */
#define TNF_REF32_SPACE(x) \
((tnf_uint32_t)(x) & TNF_SPACE_MASK)
#define TNF_REF32_IS_PERMANENT(x) \
(TNF_REF32_SPACE(x) == TNF_SPACE_PERMANENT)
#define TNF_REF32_IS_RECLAIMABLE(x) \
(TNF_REF32_SPACE(x) == TNF_SPACE_RECLAIMABLE)
#define TNF_REF32_SIGN_EXTEND(x) \
(x))
/* definition of references */
#define TNF_NULL 0
/* Macros on tnf_ref32_t values: */
#define TNF_REF32_TYPE(x) \
((tnf_uint32_t)(x) & TNF_REF32_TYPE_MASK)
#define TNF_REF32_VALUE(x) \
#define TNF_REF32_REF16(x) \
#define TNF_REF32_TAG16(x) \
/* Macros on tnf_ref16_t values: */
#define TNF_REF16_TYPE(x) \
((tnf_uint32_t)(x) & TNF_REF16_TYPE_MASK)
#define TNF_REF16_VALUE(x) \
#define TNF_TAG16_TYPE(x) \
((tnf_uint32_t)(x) & TNF_TAG16_TYPE_MASK)
/* The two kinds of values a tag16 can have: */
#define TNF_TAG16_REF16(x) \
#define TNF_TAG16_ABS16(x) \
/*
* TNF binary layouts
*/
struct tnf_tagged_hdr {
};
struct tnf_array_hdr {
};
struct tnf_type_hdr {
};
struct tnf_struct_type_hdr {
};
struct tnf_array_type_hdr {
};
struct tnf_derived_type_hdr {
};
/*
* File header, after magic #
*/
typedef struct tnf_file_header {
/* writer-specific information after this */
/* zero padding to end of block */
/*
* Block header
*/
typedef unsigned char tnf_byte_lock_t;
typedef struct tnf_block_header {
/*
* TNF type names
*/
/*
* Reserved names for block and file header information
*/
/*
* Reserved names for schedule record information
*/
/* XXX TODO: kernel type names */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_TNF_COM_H */