be: remove more unnecessary callbacks
[libfirm] / ir / be / bemachine.c
1 /*
2  * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
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.
10  *
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.
14  *
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
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief       Abstract machine interface.
23  * @author      Christian Wuerdig
24  * @date        01.12.2006
25  * @version     $Id$
26  */
27 #include "config.h"
28
29 #include "bemachine.h"
30
31 /* We define a generic dummy unit */
32 be_execution_unit_t be_machine_execution_units_DUMMY[1];
33
34 static be_execution_unit_type_t be_machine_execution_unit_types[] = {
35         { 1, 1, "DUMMY", be_machine_execution_units_DUMMY },
36 };
37
38 /**
39  * Initialize generic dummy unit.
40  */
41 void be_machine_init_dummy_unit(void)
42 {
43         be_machine_execution_units_DUMMY[0].name = "GENERIC_DUMMY_UNIT";
44         be_machine_execution_units_DUMMY[0].tp   = &be_machine_execution_unit_types[0];
45 }
46
47 /**
48  * Returns the generic dummy unit.
49  */
50 be_execution_unit_t *be_machine_get_dummy_unit(void)
51 {
52         return &be_machine_execution_units_DUMMY[0];
53 }
54
55 /**
56  * Check if given unit is the generic dummy unit.
57  */
58 int be_machine_is_dummy_unit(const be_execution_unit_t *unit)
59 {
60         return unit == &be_machine_execution_units_DUMMY[0];
61 }
62
63 /**
64  * Check if given unit is the generic dummy unit type.
65  */
66 int be_machine_is_dummy_unit_type(const be_execution_unit_type_t *tp)
67 {
68         return tp == &be_machine_execution_unit_types[0];
69 }