/*******************************************************************************
 * Copyright (c) 2018 Renesas Electronics Corporation. All rights reserved.
 *
 * DESCRIPTION   : Memory access driver header
 ******************************************************************************/
#ifndef MEM_IO_H_
#define MEM_IO_H_

#include <stdint.h>

/* Prototype */
void mem_write8(uintptr_t addr, uint8_t data);
uint8_t mem_read8(uintptr_t addr);
void mem_write16(uintptr_t addr, uint16_t data);
uint16_t mem_read16(uintptr_t addr);
void mem_write32(uintptr_t addr, uint32_t data);
uint32_t mem_read32(uintptr_t addr);
void mem_write64(uintptr_t addr, uint64_t data);
uint64_t mem_read64(uintptr_t addr);
void mem_bitclrset32(uintptr_t addr, uint32_t clr, uint32_t set);

#if defined(__RH850G3K__)
#define mmio_write_32(a,b)		mem_write32(a,b)
#define mmio_read_32(a)			mem_read32(a)
#define mmio_clrsetbits_32(a,b,c)	mem_bitclrset32(a,b,c)
#endif


#endif /* MEM_IO_H_ */
