More missing config.h
[libfirm] / ir / be / bemachine.c
1 /**
2  * Abstract machine interface.
3  * @author Christian Wuerdig
4  * @date   01.12.2006
5  * @cvs-id $Id$
6  */
7
8 #include "bemachine.h"
9
10 /* We define a generic dummy unit */
11 be_execution_unit_t be_machine_execution_units_DUMMY[1];
12
13 be_execution_unit_type_t be_machine_execution_unit_types[] = {
14         { 1, 1, "DUMMY", be_machine_execution_units_DUMMY },
15 };
16
17 /**
18  * Initialize generic dummy unit.
19  */
20 void be_machine_init_dummy_unit(void) {
21         be_machine_execution_units_DUMMY[0].name = "GENERIC_DUMMY_UNIT";
22         be_machine_execution_units_DUMMY[0].tp   = &be_machine_execution_unit_types[0];
23 }
24
25 /**
26  * Returns the generic dummy unit.
27  */
28 be_execution_unit_t *be_machine_get_dummy_unit(void) {
29         return &be_machine_execution_units_DUMMY[0];
30 }
31
32 /**
33  * Check if given unit is the generic dummy unit.
34  */
35 int be_machine_is_dummy_unit(be_execution_unit_t *unit) {
36         return unit == &be_machine_execution_units_DUMMY[0];
37 }
38
39 /**
40  * Check if given unit is the generic dummy unit type.
41  */
42 int be_machine_is_dummy_unit_type(be_execution_unit_type_t *tp) {
43         return tp == &be_machine_execution_unit_types[0];
44 }