2 * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
4 * This file is part of libFirm.
6 * This file may be distributed and/or modified under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation and appearing in the file LICENSE.GPL included in the
9 * packaging of this file.
11 * Licensees holding valid libFirm Professional Edition licenses may use
12 * this file in accordance with the libFirm Commercial License.
13 * Agreement provided with the Software.
15 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * @brief Abstract machine interface.
23 * @author Christian Wuerdig
29 #include "bemachine.h"
31 /* We define a generic dummy unit */
32 be_execution_unit_t be_machine_execution_units_DUMMY[1];
34 be_execution_unit_type_t be_machine_execution_unit_types[] = {
35 { 1, 1, "DUMMY", be_machine_execution_units_DUMMY },
39 * Initialize generic dummy unit.
41 void be_machine_init_dummy_unit(void) {
42 be_machine_execution_units_DUMMY[0].name = "GENERIC_DUMMY_UNIT";
43 be_machine_execution_units_DUMMY[0].tp = &be_machine_execution_unit_types[0];
47 * Returns the generic dummy unit.
49 be_execution_unit_t *be_machine_get_dummy_unit(void) {
50 return &be_machine_execution_units_DUMMY[0];
54 * Check if given unit is the generic dummy unit.
56 int be_machine_is_dummy_unit(const be_execution_unit_t *unit) {
57 return unit == &be_machine_execution_units_DUMMY[0];
61 * Check if given unit is the generic dummy unit type.
63 int be_machine_is_dummy_unit_type(const be_execution_unit_type_t *tp) {
64 return tp == &be_machine_execution_unit_types[0];