Re: [RFC 3/4] ptimer: Provide new transaction-based API

2019-10-07 Thread Richard Henderson
On 10/4/19 4:48 AM, Peter Maydell wrote: > Provide the new transaction-based API. If a ptimer is created > using ptimer_init() rather than ptimer_init_with_bh(), then > instead of providing a QEMUBH, it provides a pointer to the > callback function directly, and has opted into the transaction > API

Re: [RFC 3/4] ptimer: Provide new transaction-based API

2019-10-04 Thread Peter Maydell
On Fri, 4 Oct 2019 at 12:48, Peter Maydell wrote: > > Provide the new transaction-based API. > +void ptimer_transaction_begin(ptimer_state *s) > +{ > +assert(!s->in_transaction && s->callback); > +s->in_transaction = true; As I was working on converting the ptimer tests to the new API I

[RFC 3/4] ptimer: Provide new transaction-based API

2019-10-04 Thread Peter Maydell
Provide the new transaction-based API. If a ptimer is created using ptimer_init() rather than ptimer_init_with_bh(), then instead of providing a QEMUBH, it provides a pointer to the callback function directly, and has opted into the transaction API. All calls to functions which modify ptimer state: