1 /* 2 * Type representations for interfaces. 3 * 4 * Copyright (C) 2019 Paul Boddie <paul@boddie.org.uk> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA 20 */ 21 22 #pragma once 23 24 /* General capability type. */ 25 26 #define L4_CAP_TYPE "l4_cap_idx_t" 27 28 /* A flexpage type that can hold extra information (such as the "hot spot"). */ 29 30 #define L4_FPAGE_TYPE "l4_snd_fpage_t" 31 32 /* General word type. */ 33 34 #define L4_WORD_TYPE "l4_umword_t" 35 36 /* Specifier values. */ 37 38 enum specifier 39 { 40 IN_PARAMETER = 1, 41 OUT_PARAMETER = 2, 42 INOUT_PARAMETER = 3, 43 ANY_PARAMETER = 3, 44 }; 45 46 /* Data class of a parameter. */ 47 48 enum parameter_class 49 { 50 WORD_CLASS = 1, 51 CAP_ITEM = 2, 52 FPAGE_ITEM = 4, 53 ITEM_CLASS = 6, /* all item values combined */ 54 ANY_CLASS = 7, /* WORD_CLASS | ITEM_CLASS */ 55 }; 56 57 /* Component roles. */ 58 59 enum component_role 60 { 61 CLIENT_ROLE, 62 SERVER_ROLE, 63 }; 64 65 /* Function roles. */ 66 67 enum function_role 68 { 69 COMPLETION_ROLE, 70 GENERAL_FUNCTION_ROLE, 71 }; 72 73 /* Role of a parameter in output. */ 74 75 enum parameter_role 76 { 77 SIGNATURE_ROLE, 78 STRUCTURE_ROLE, 79 INVOCATION_ROLE, 80 }; 81 82 /* Role of a name or signature. */ 83 84 enum signature_role 85 { 86 ACCESS_ROLE = 1, 87 DECLARATION_ROLE = 2, 88 DEFINITION_ROLE = 4, 89 MEMBER_ROLE = 8, 90 MEMBER_DECLARATION_ROLE = 10, /* DECLARATION_ROLE | MEMBER_ROLE */ 91 }; 92 93 /* Output language. */ 94 95 enum language 96 { 97 C_LANGUAGE, 98 CPP_LANGUAGE, 99 }; 100 101 /* Include declarations. */ 102 103 struct include 104 { 105 char *filename; 106 struct include *tail; 107 }; 108 109 /* An identifier with a link to other identifiers. */ 110 111 struct identifier 112 { 113 char *identifier; 114 struct identifier *tail; 115 }; 116 117 /* A single parameter description linking to other parameters. */ 118 119 struct parameter 120 { 121 enum specifier specifier; 122 enum parameter_class cls; 123 struct identifier *identifiers; 124 struct parameter *tail; 125 }; 126 127 /* A single signature description linking to other signatures. */ 128 129 struct signature 130 { 131 char *qualifier; 132 char *operation; 133 struct parameter *parameters; 134 struct attribute *attributes; 135 struct signature *tail; 136 }; 137 138 /* A single attribute description linking to other attributes. */ 139 140 struct attribute 141 { 142 char *attribute; 143 struct identifier *identifiers; 144 struct attribute *tail; 145 }; 146 147 /* A single interface description linking to other interfaces. */ 148 149 struct interface 150 { 151 char *name; 152 struct signature *signatures; 153 struct attribute *attributes; 154 struct include *includes; 155 struct interface *tail; 156 };