/* * Copyright (C) 2010 Tobias Klauser * * 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 _MEMORY_H_ #define _MEMORY_H_ struct memory { uint32_t *base; size_t size; uint32_t image_base; }; #define IMAGE_BASE_UNINITIALIZED UINT32_MAX extern uint8_t memory_get_byte(struct memory *mem, int32_t addr); extern void memory_set_byte(struct memory *mem, int32_t addr, uint8_t data); extern uint16_t memory_get_halfword(struct memory *mem, int32_t addr); extern void memory_set_halfword(struct memory *mem, int32_t addr, uint16_t data); extern uint32_t memory_get_word(struct memory *mem, int32_t addr); extern void memory_set_word(struct memory *mem, int32_t addr, uint32_t data); extern void memory_dump(struct memory *mem, uint32_t offset, size_t count); #endif /* _MEMORY_H_ */