/*
* 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,1997-1998 by Sun Microsystems, Inc.
* All rights reserved.
*/
#ifndef _TNF_BUF_H
#define _TNF_BUF_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/machlock.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Size of a TNF buffer block
*/
/*
* Size of the file header and forwarding pointer (directory) area combined.
* Tag and data blocks start this many bytes into the file.
* The maximum size of this area is 64KB.
*/
/*
* Reserved space for tag blocks, after directory area.
*/
/*
* Reserved directory entries, and their precomputed tags. These are byte
* offsets from start of file.
*/
#define TNF_FILE_HEADER_TAG \
#define TNF_BLOCK_HEADER_TAG \
#define TNF_ROOT_TAG \
/*
* Allocation type: permanent or reusable
*/
enum tnf_alloc_mode {
TNF_ALLOC_REUSABLE = 0,
};
/*
* Buffer status
*/
typedef enum {
TNFW_B_RUNNING = 0,
} TNFW_B_STATE;
/*
* The STOPPED bit may be or-ed into the state field.
*/
/*
* Layout of the first block of TNF file (file header)
*/
typedef struct {
struct {
} next_alloc;
/* Padding to end of block */
/*
* Per-thread write-control information
*/
typedef struct tnfw_b_pos {
} TNFW_B_POS;
typedef struct tnfw_b_wcb {
} TNFW_B_WCB;
/*
* Global tracing state
*/
extern TNFW_B_STATE tnfw_b_state;
/*
* Global trace buffer
*/
/*
* External interface
*/
/*
* Allocate 'size' data bytes using 'wcb'; store result into 'buf'.
* This inlines the common trace case.
*/
{ \
TNFW_B_POS *xx_pos; \
\
/* Round size up to a multiple of 8. */ \
/* LINTED */ \
} else \
}
/*
* Giveback words after new_pos.
*/
(((char *)(new_pos) \
& ~7), *(int *)(new_pos) = 0)
/*
* Commit transaction bytes allocated via 'pos'
*/
{ \
\
if ((pos)->tnfw_w_dirty) { \
} \
(pos)->tnfw_w_dirty = 0; \
} \
} \
}
/*
* Rollback transaction bytes allocated via 'pos'
*/
{ \
\
if ((pos)->tnfw_w_dirty) { \
} \
(pos)->tnfw_w_dirty = 0; \
} \
} \
}
extern void *tnfw_b_fw_alloc(TNFW_B_WCB *);
#ifdef __cplusplus
}
#endif
#endif /* _TNF_BUF_H */