tnf_buf.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 _TNF_BUF_H
#define _TNF_BUF_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef _KERNEL
#else /* _KERNEL */
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Size of the file header and forwarding pointer (directory) area combined.
* Tag and data blocks start this many bytes into the file.
*
* The kernel uses a smaller directory area, and uses the saved space
* as block pool reserved for tag allocations.
*/
#ifdef _KERNEL
#define TNFW_B_FW_ZONE 0x4000
#define TNFW_B_TAG_RESERVE 0xc000
#else
#define TNFW_B_FW_ZONE 0x10000
#define TNFW_B_TAG_RESERVE 0x8000
#endif
/*
* CAUTION: do not change integer values of TNF_ALLOC_REUSABLE or
* TNF_ALLOC_FIXED
*/
enum tnf_alloc_mode {
TNF_ALLOC_REUSABLE = 0,
};
typedef struct {
struct {
} next_alloc;
typedef struct tnfw_b_pos TNFW_B_POS;
struct tnfw_b_pos {
short tnfw_w_write_off;
};
typedef struct {
struct tnfw_b_pos tnfw_w_pos;
struct tnfw_b_pos tnfw_w_tag_pos;
int tnfw_w_gen_shift;
int tnfw_w_block_shift;
#ifdef TNFWB_MAY_RELEASE_A_LOCK
#endif
} TNFW_B_WCB;
typedef enum {
typedef enum {
TNFW_B_RUNNING = 0,
} TNFW_B_STATE;
/*
* The STOPPED bit may be or-ed into the state field.
*/
#define TNFW_B_STOPPED 16
typedef struct {
volatile char *tnf_buffer;
int (*tnf_init_callback)(void);
void (*tnf_fork_callback)(void);
extern TNFW_B_CONTROL *_tnfw_b_control;
/*
* structure exported by buffering layer - guaranteed to be filled
* after tnfw_b_init_buffer is called.
*/
typedef struct {
char * fw_file_header;
char * fw_block_header;
char * fw_root;
extern tnf_buf_header_t *_tnf_buf_headers_p;
/*
* External interface
*/
& ~7), *(int *)(new_pos) = 0)
void tnfw_b_release_block(TNFW_B_WCB *);
/* Declare lock routines written in assembly language. */
extern int tnfw_b_get_lock(tnf_byte_lock_t *);
extern void tnfw_b_clear_lock(tnf_byte_lock_t *);
#ifdef __cplusplus
}
#endif
#endif /* _TNF_BUF_H */