installboot: fix stage2 size check for MBR
[unleashed.git] / usr / src / cmd / pcidr / pcidr.h
blobf23a7971b34b95b00f059fbdd107b64a5e63db34
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _PCIDR_H
28 #define _PCIDR_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #include <libnvpair.h>
33 #include <config_admin.h>
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
39 #define PCIDR_MALLOC_CNT 5
40 #define PCIDR_MALLOC_TIME 1000000
42 /* .._SYM and .._SYMSTR must match */
43 #define PCIDR_PLUGIN_SYM pcidr_event_handler
44 #define PCIDR_PLUGIN_SYMSTR "pcidr_event_handler"
45 #define PCIDR_PLUGIN_NAME "pcidr_plugin.so"
49 * these ATTRNM_* correspond to the built-in sysevent.conf macros
50 * Note that the "publisher" macro used by syseventd is only a subset (third
51 * colon-delimited field) of the full publisher-id string specified in an
52 * event buffer/message.
54 #define ATTRNM_CLASS "class"
55 #define ATTRNM_SUBCLASS "subclass"
56 #define ATTRNM_PUB_NAME "publisher"
58 /* be sure to match with dpritab! */
59 typedef enum {DNONE = 0, DWARN, DINFO, DDEBUG} dlvl_t;
60 #define MIN_DLVL DNONE
61 #define MAX_DLVL DDEBUG
63 /* default set of DR attributes */
64 typedef struct {
65 char *class;
66 char *subclass;
67 char *pub_name;
68 char *dr_req_type;
69 char *dr_ap_id;
70 } pcidr_attrs_t;
73 typedef struct {
74 dlvl_t dlvl;
75 char *prg;
76 FILE *dfp;
77 int dsys;
78 } pcidr_logopt_t;
80 typedef struct {
81 pcidr_logopt_t logopt;
82 } pcidr_opt_t;
84 typedef int(*pcidr_plugin_t)(nvlist_t *, pcidr_opt_t *);
85 #define PCIDR_PLUGIN_PROTO(a, b) \
86 int PCIDR_PLUGIN_SYM(nvlist_t *a, pcidr_opt_t *b)
89 void *pcidr_malloc(size_t);
90 void dprint(dlvl_t, char *, ...);
91 int pcidr_name2type(char *, data_type_t *);
92 void pcidr_print_attrlist(dlvl_t, nvlist_t *, char *);
93 int pcidr_check_string(char *, ...);
94 int pcidr_get_attrs(nvlist_t *, pcidr_attrs_t *);
95 int pcidr_check_attrs(pcidr_attrs_t *);
96 void pcidr_set_logopt(pcidr_logopt_t *);
98 extern dlvl_t dlvl;
99 extern char *prg;
100 extern FILE *dfp;
101 extern int dsys;
102 extern char *prg;
103 extern int dpritab_len;
105 #ifdef __cplusplus
107 #endif
109 #endif /* _PCIDR_H */