On Tue, Feb 28, 2012 at 10:07 PM, Paul Brook wrote:
>> > Thinking about that, I realised why I don't like the following line:
>> >> + s->reg_value = (uint32_t)((x + interval) % interval);
>> >
>> > This assumes x > -interval, which is not always true.
>>
>> This would mean you have wrapped twic
> > Thinking about that, I realised why I don't like the following line:
> >> +s->reg_value = (uint32_t)((x + interval) % interval);
> >
> > This assumes x > -interval, which is not always true.
>
> This would mean you have wrapped twice or more in one time step, which
> I am assuming is a fa
Heres the diff for proposed comments:
@@ -129,6 +129,8 @@ static uint64_t
cadence_timer_get_steps(CadenceTimerState *s, uint64_t ns)
return r;
}
+/* determine if x is inbetween a and b, exclusive of a, inclusive of b */
+
static inline int64_t is_between(int64_t x, int64_t a, int64_t b)
{
On Tue, Feb 28, 2012 at 1:45 AM, Paul Brook wrote:
>> On Tue, Feb 21, 2012 at 11:04 PM, Paul Brook wrote:
>> >> > +static inline int64_t is_between(int64_t x, int64_t a, int64_t b)
>> >> > +{
>> >> > + if (a < b) {
>> >> > + return x > a && x <= b;
>> >> > + }
>> >> > + return x <
> On Tue, Feb 21, 2012 at 11:04 PM, Paul Brook wrote:
> >> > +static inline int64_t is_between(int64_t x, int64_t a, int64_t b)
> >> > +{
> >> > +if (a < b) {
> >> > +return x > a && x <= b;
> >> > +}
> >> > +return x < a && x >= b;
> >> > +}
> >>
> >> This looks slightly odd
On Tue, Feb 21, 2012 at 5:32 AM, Peter Maydell wrote:
> On 20 February 2012 01:45, Peter A. G. Crosthwaite
> wrote:
>> Implemented cadence Triple Timer Counter (TCC)
>>
>> Signed-off-by: Peter A. G. Crosthwaite
>> Signed-off-by: John Linn
>> ---
>> changed from v4:
>> fixed FSF addess
>> change
On Tue, Feb 21, 2012 at 11:04 PM, Paul Brook wrote:
>> > +static inline int64_t is_between(int64_t x, int64_t a, int64_t b)
>> > +{
>> > + if (a < b) {
>> > + return x > a && x <= b;
>> > + }
>> > + return x < a && x >= b;
>> > +}
>>
>> This looks slightly odd -- should the boundar
> > +static inline int64_t is_between(int64_t x, int64_t a, int64_t b)
> > +{
> > +if (a < b) {
> > +return x > a && x <= b;
> > +}
> > +return x < a && x >= b;
> > +}
>
> This looks slightly odd -- should the boundary condition for whether
> a value equal to the max/min really
On 20 February 2012 01:45, Peter A. G. Crosthwaite
wrote:
> Implemented cadence Triple Timer Counter (TCC)
>
> Signed-off-by: Peter A. G. Crosthwaite
> Signed-off-by: John Linn
> ---
> changed from v4:
> fixed FSF addess
> changed device_init -> type_init
> changed from v3:
> Fixed race conditio
Implemented cadence Triple Timer Counter (TCC)
Signed-off-by: Peter A. G. Crosthwaite
Signed-off-by: John Linn
---
changed from v4:
fixed FSF addess
changed device_init -> type_init
changed from v3:
Fixed race condition where timer could miss match events on wrap around
changed from v2:
changed
10 matches
Mail list logo