From fc6515ef027d94412228875095708b949b801496 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 16 Nov 2010 14:51:59 +0100 Subject: Add basic device handling infrastructure --- device.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 device.h (limited to 'device.h') diff --git a/device.h b/device.h new file mode 100644 index 0000000..beabe52 --- /dev/null +++ b/device.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2010 Tobias Klauser + * 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_ */ -- cgit v1.2.3-54-g00ecf