summaryrefslogtreecommitdiff
path: root/nios2sim-ng.h
blob: 9be1d0dbb7cd417b77a7057bf3f546a7915ef8a2 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 *
 */

#ifndef _NIOS2SIM_NG_H_
#define _NIOS2SIM_NG_H_

#include <stdint.h>
#include <stdbool.h>

#include "bits.h"
#include "compiler.h"
#include "util.h"

extern bool verbose;

#define __round_mask(x, y)	((__typeof__(x))((y) - 1))
#define round_up(x, y)		((((x) - 1) | __round_mask(x, y)) + 1)

#define ARRAY_SIZE(arr)		(sizeof(arr) / sizeof((arr)[0]))

#define err(fmt, args...)	fprintf(stderr, "Error: " fmt, ##args)
#define warn(fmt, args...)	fprintf(stderr, "Warning: " fmt, ##args)
#define info(fmt, args...)	fprintf(stdout, fmt, ##args)
#define vinfo(fmt, args...)	\
	do { if (verbose) fprintf(stdout, fmt, ##args); } while (0)
#ifdef DEBUG
# define dbg(fmt, args...)	fprintf(stdout, fmt, ##args)
#else
# define dbg(fmt, args...)
#endif

static inline size_t size_scale(size_t size)
{
	if (size > 1024 * 1024)
		size /= 1024 * 1024;
	else if (size > 1024)
		size /= 1024;

	return size;
}

static inline char *size_postfix(size_t size)
{
	char *ret = "";

	if (size > 1024 * 1024)
		ret = "M";
	else if (size > 1024)
		ret = "K";

	return ret;
}

#endif /* _NIOS2SIM_NG_H_ */
164ca0d58902&id2=7704c095230e2e9863f3aacd0489a4b4cc00bf45'>diff)
ARM: delete struct sys_timer
Now that the only field in struct sys_timer is .init, delete the struct, and replace the machine descriptor .timer field with the initialization function itself. This will enable moving timer drivers into drivers/clocksource without having to place a public prototype of each struct sys_timer object into include/linux; the intent is to create a single of_clocksource_init() function that determines which timer driver to initialize by scanning the device dtree, much like the proposed irqchip_init() at: http://www.spinics.net/lists/arm-kernel/msg203686.html Includes mach-omap2 fixes from Igor Grinberg. Tested-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-imx/imx31-dt.c')
-rw-r--r--arch/arm/mach-imx/imx31-dt.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/arch/arm/mach-imx/imx31-dt.c b/arch/arm/mach-imx/imx31-dt.c