aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/target-nios2.c
blob: 05f0926e2df94dd852edd84a00275ccfd6bc4c07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "symbol.h"
#include "target.h"
#include "machine.h"
#include "builtin.h"


static void predefine_nios2(const struct target *self)
{
	predefine("__NIOS2__", 1, "1");
	predefine("__nios2__", 1, "1");

	if (arch_big_endian)
		predefine("__nios2_big_endian__", 1, "1");
	else
		predefine("__nios2_little_endian__", 1, "1");
}

static const struct builtin_fn builtins_nios2[] = {
	{ "__builtin_rdctl", &int_ctype, 0, { &int_ctype }},
	{ "__builtin_wrctl", &void_ctype, 0, { &int_ctype, &int_ctype }},
	{ "__builtin_custom_ini", &int_ctype, 0, { &int_ctype }},
	{ }
};

const struct target target_nios2 = {
	.mach = MACH_NIOS2,
	.bitness = ARCH_LP32,

	.predefine = predefine_nios2,
	.builtins = builtins_nios2,
};