1
0

make sure HTIF mem_mb doesn't exceed MMIOBase

This commit is contained in:
Howard Mao 2015-09-25 09:02:35 -07:00
parent f200d0947a
commit 5e3f9115d3

View File

@ -25,7 +25,10 @@ class htif_emulator_t : public htif_pthread_t
htif_pthread_t::start(); htif_pthread_t::start();
} }
uint32_t mem_mb() { return _memsz_mb; } uint32_t mem_mb() {
uint32_t scr_mb = htif_pthread_t::mem_mb();
return (_memsz_mb < scr_mb) ? _memsz_mb : scr_mb;
}
private: private:
uint32_t _memsz_mb; uint32_t _memsz_mb;