[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC 0/4] transaction-based ptimer API
From: |
Peter Maydell |
Subject: |
Re: [RFC 0/4] transaction-based ptimer API |
Date: |
Fri, 4 Oct 2019 13:00:58 +0100 |
On Fri, 4 Oct 2019 at 12:57, Paolo Bonzini <address@hidden> wrote:
>
> On 04/10/19 13:48, Peter Maydell wrote:
> > must be between matched calls to ptimer_transaction_begin() and
> > ptimer_transaction_commit(). When ptimer_transaction_commit() is
> > called it will evaluate the state of the timer after all the changes
> > in the transaction, and call the callback if necessary.
>
> Could ptimer_stop/ptimer_run act as the begin and commit functions?
> That is, ptimer_set_* can be called only between ptimer_stop and ptimer_run?
No, because stop/run causes the ptimer to "lose time"
(we stop the underlying timer and restart it). It's
very common for a device to want to change the ptimer
properties without a stop/restart -- "set the ptimer
count value when the guest writes to the device's counter
register" is the common one. Of the three begin/commit
blocks in the arm_timer.c conversion, only one of those
involves calls to stop/run, and even there we only
call stop/run if the write to the control register
modified the enable bit.
thanks
-- PMM
- [RFC 1/4] hw/timer/arm_timer: Add trace events, (continued)
- [RFC 1/4] hw/timer/arm_timer: Add trace events, Peter Maydell, 2019/10/04
- [RFC 2/4] ptimer: Rename ptimer_init() to ptimer_init_with_bh(), Peter Maydell, 2019/10/04
- [RFC 4/4] hw/timer/arm_timer.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/04
- [RFC 3/4] ptimer: Provide new transaction-based API, Peter Maydell, 2019/10/04
- Re: [RFC 0/4] transaction-based ptimer API, Paolo Bonzini, 2019/10/04
- Re: [RFC 0/4] transaction-based ptimer API,
Peter Maydell <=