summaryrefslogtreecommitdiff
path: root/device.h
blob: beabe52e2bfd18d9a2cb6adad0c2b2245062d039 (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
/*
 * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>
 * Copyright (C) 2010 chysun2000@gmail.com
 *
 * This file is part of nios2sim-ng.
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License. See the file "COPYING" in the main directory of this archive
 * for more details.
 */

#ifndef _DEVICE_H_
#define _DEVICE_H_

struct device {
	const char *name;

	uint32_t base;
	size_t size;

	int (*init)(struct device *dev);
	bool (*is_dev_addr)(struct device *dev, uint32_t addr);
	void (*simulate)(struct device *dev);

	/* Private data */
	void *priv;
};

extern int device_init_all(void);

#endif /* _DEVICE_H_ */