Am Freitag 11 Februar 2011, 22:22:32 schrieb Blue Swirl:
> > +static uint32_t timer_read(void *opaque, target_phys_addr_t addr)
> > +{
> > +    LM32TimerState *s = opaque;
> > +    uint32_t r = 0;
> > +
> > +    addr >>= 2;
> > +    switch (addr) {
> > +    case R_SR:
> > +    case R_CR:
> > +    case R_PERIOD:
> > +        r = s->regs[addr];
> > +        break;
> > +    case R_SNAPSHOT:
> > +        r = (uint32_t)ptimer_get_count(s->ptimer);
> > +        break;
> > +
> > +    default:
> > +        hw_error("lm32_timer: read access to unkown register 0x"
> > +                TARGET_FMT_plx, addr << 2);
> 
> Insecure, please fix also others.
Many devices in hw/ treat memory access to unknown registers in that way. Are 
there any 'good' example models, where i can look at? I guess i should print a 
warning instead?

-- 
Michael

Reply via email to