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 /* Role of a parameter in output. */ 66 67 enum parameter_role 68 { 69 SIGNATURE_ROLE, 70 STRUCTURE_ROLE, 71 }; 72 73 /* Output language. */ 74 75 enum language 76 { 77 C_LANGUAGE, 78 CPP_LANGUAGE, 79 }; 80 81 /* Include declarations. */ 82 83 struct include 84 { 85 char *filename; 86 struct include *tail; 87 }; 88 89 /* An identifier with a link to other identifiers. */ 90 91 struct identifier 92 { 93 char *identifier; 94 struct identifier *tail; 95 }; 96 97 /* A single parameter description linking to other parameters. */ 98 99 struct parameter 100 { 101 enum specifier specifier; 102 enum parameter_class cls; 103 struct identifier *identifiers; 104 struct parameter *tail; 105 }; 106 107 /* A single signature description linking to other signatures. */ 108 109 struct signature 110 { 111 char *qualifier; 112 char *operation; 113 struct parameter *parameters; 114 struct attribute *attributes; 115 struct signature *tail; 116 }; 117 118 /* A single attribute description linking to other attributes. */ 119 120 struct attribute 121 { 122 char *attribute; 123 struct identifier *identifiers; 124 struct attribute *tail; 125 }; 126 127 /* A single interface description linking to other interfaces. */ 128 129 struct interface 130 { 131 char *name; 132 struct signature *signatures; 133 struct attribute *attributes; 134 struct include *includes; 135 struct interface *tail; 136 };