ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-ia64 / sn / labelcl.h
1 /*
2  * This file is subject to the terms and conditions of the GNU General Public
3  * License.  See the file "COPYING" in the main directory of this archive
4  * for more details.
5  *
6  * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
7  */
8 #ifndef _ASM_IA64_SN_LABELCL_H
9 #define _ASM_IA64_SN_LABELCL_H
10
11 #define LABELCL_MAGIC 0x4857434c        /* 'HWLC' */
12 #define LABEL_LENGTH_MAX 256            /* Includes NULL char */
13 #define INFO_DESC_PRIVATE (-1)          /* default */
14 #define INFO_DESC_EXPORT  0             /* export info itself */
15
16 /*
17  * Description of a label entry.
18  */
19 typedef struct label_info_s {
20         char                    *name;
21         arb_info_desc_t         desc;
22         arbitrary_info_t        info;
23 } label_info_t;
24
25 /*
26  * Definition of the data structure that provides the link to 
27  * the hwgraph fastinfo and the label entries associated with a 
28  * particular hwgraph entry.
29  */
30 typedef struct labelcl_info_s {
31         unsigned long   hwcl_magic;
32         unsigned long   num_labels;
33         void            *label_list;
34         arbitrary_info_t IDX_list[HWGRAPH_NUM_INDEX_INFO];
35 } labelcl_info_t;
36
37 /*
38  * Definitions for the string table that holds the actual names 
39  * of the labels.
40  */
41 struct string_table_item {
42         struct string_table_item        *next;
43         char                            string[1];
44 };
45
46 struct string_table {
47         struct string_table_item        *string_table_head;
48         long                            string_table_generation;
49 };
50
51
52 #define STRTBL_BASIC_SIZE ((size_t)(((struct string_table_item *)0)->string))
53 #define STRTBL_ITEM_SIZE(str_length) (STRTBL_BASIC_SIZE + (str_length) + 1)
54
55 #define STRTBL_ALLOC(str_length) \
56         ((struct string_table_item *)kmalloc(STRTBL_ITEM_SIZE(str_length), GFP_KERNEL))
57
58 #define STRTBL_FREE(ptr) kfree(ptr)
59
60
61 extern labelcl_info_t *labelcl_info_create(void);
62 extern int labelcl_info_destroy(labelcl_info_t *);
63 extern int labelcl_info_add_LBL(vertex_hdl_t, char *, arb_info_desc_t, arbitrary_info_t);
64 extern int labelcl_info_remove_LBL(vertex_hdl_t, char *, arb_info_desc_t *, arbitrary_info_t *);
65 extern int labelcl_info_replace_LBL(vertex_hdl_t, char *, arb_info_desc_t,
66                         arbitrary_info_t, arb_info_desc_t *, arbitrary_info_t *);
67 extern int labelcl_info_get_LBL(vertex_hdl_t, char *, arb_info_desc_t *,
68                       arbitrary_info_t *);
69 extern int labelcl_info_get_next_LBL(vertex_hdl_t, char *, arb_info_desc_t *,
70                            arbitrary_info_t *, labelcl_info_place_t *);
71 extern int labelcl_info_replace_IDX(vertex_hdl_t, int, arbitrary_info_t, 
72                         arbitrary_info_t *);
73 extern int labelcl_info_connectpt_set(vertex_hdl_t, vertex_hdl_t);
74 extern int labelcl_info_get_IDX(vertex_hdl_t, int, arbitrary_info_t *);
75
76 #endif /* _ASM_IA64_SN_LABELCL_H */