On Tue, Nov 24, 2015 at 12:04 PM, Barret Rhoden <[email protected]> wrote:
> Hi -
>
> On 2015-11-19 at 18:18 Kevin Klues <[email protected]> wrote:
>> The changes in this request can be viewed online at:
>>
>>     https://github.com/brho/akaros/compare/63c72d8...6b9f50f
>>
>> The following changes since commit
>> 63c72d8a58dc11457604164207075d6351e9c0bb:
>>
>>   Create ak-kill-9pserver.sh that kills ufs server (2015-11-18
>> 10:37:28 -0800)
>>
>> are available in the git repository at:
>>
>>   [email protected]:klueska/akaros sleep-support
>
> One minor thing:
>
>> From 85efbd5dc5142353d8fd824e36f516e99cf76424 Mon Sep 17 00:00:00 2001
>> From: Kevin Klues <[email protected]>
>> Date: Thu, 19 Nov 2015 18:07:45 -0800
>> Subject: Add the nanosleep syscall
>>
>> +static int sys_nanosleep(struct proc *p,
>> +                         const struct timespec *req,
>> +                         struct timespec *rem)
>> +{
>
>> +     usec += kreq.tv_nsec ? (kreq.tv_nsec - 1)/1000 + 1 : 0;
>
> We have a helper for this, which I think does what you want:
>
> #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))

This only works in cases where we don't have to worry about overflow
for (n) (such as this because kreq.tv_nsec is maxed out at 999999999).
If ((n) + (d) -1) were to overflow, this would cause problems.

Either way, i've updated it to make this call and pushed it.

>
> Barret
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Akaros" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/d/optout.



-- 
~Kevin

-- 
You received this message because you are subscribed to the Google Groups 
"Akaros" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to