Deleted Added
full compact
linux_misc.c (33821) linux_misc.c (34961)
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
1/*-
2 * Copyright (c) 1994-1995 S�ren Schmidt
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * $Id: linux_misc.c,v 1.33 1997/11/06 19:28:58 phk Exp $
28 * $Id: linux_misc.c,v 1.34 1998/02/25 05:33:06 bde Exp $
29 */
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/sysproto.h>
34#include <sys/kernel.h>
35#include <sys/mman.h>
36#include <sys/proc.h>

--- 31 unchanged lines hidden (view full) ---

68
69#ifdef DEBUG
70 printf("Linux-emul(%d): alarm(%d)\n", p->p_pid, args->secs);
71#endif
72 it.it_value.tv_sec = (long)args->secs;
73 it.it_value.tv_usec = 0;
74 it.it_interval.tv_sec = 0;
75 it.it_interval.tv_usec = 0;
29 */
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/sysproto.h>
34#include <sys/kernel.h>
35#include <sys/mman.h>
36#include <sys/proc.h>

--- 31 unchanged lines hidden (view full) ---

68
69#ifdef DEBUG
70 printf("Linux-emul(%d): alarm(%d)\n", p->p_pid, args->secs);
71#endif
72 it.it_value.tv_sec = (long)args->secs;
73 it.it_value.tv_usec = 0;
74 it.it_interval.tv_sec = 0;
75 it.it_interval.tv_usec = 0;
76 s = splclock();
76 s = splclock(); /* XXX Still needed ? */
77 old_it = p->p_realtimer;
77 old_it = p->p_realtimer;
78 tv = time;
78 getmicrotime(&tv);
79 if (timerisset(&old_it.it_value))
80 if (timercmp(&old_it.it_value, &tv, <))
81 timerclear(&old_it.it_value);
82 else
83 timevalsub(&old_it.it_value, &tv);
84 splx(s);
85 if (itimerfix(&it.it_value) || itimerfix(&it.it_interval))
86 return EINVAL;
79 if (timerisset(&old_it.it_value))
80 if (timercmp(&old_it.it_value, &tv, <))
81 timerclear(&old_it.it_value);
82 else
83 timevalsub(&old_it.it_value, &tv);
84 splx(s);
85 if (itimerfix(&it.it_value) || itimerfix(&it.it_interval))
86 return EINVAL;
87 s = splclock();
87 s = splclock(); /* XXX Still needed ? */
88 if (timerisset(&p->p_realtimer.it_value))
89 untimeout(realitexpire, (caddr_t)p, p->p_ithandle);
88 if (timerisset(&p->p_realtimer.it_value))
89 untimeout(realitexpire, (caddr_t)p, p->p_ithandle);
90 tv = time;
90 getmicrotime(&tv);
91 if (timerisset(&it.it_value)) {
92 timevaladd(&it.it_value, &tv);
93 p->p_ithandle = timeout(realitexpire, (caddr_t)p, hzto(&it.it_value));
94 }
95 p->p_realtimer = it;
96 splx(s);
97 if (old_it.it_value.tv_usec)
98 old_it.it_value.tv_sec++;

--- 863 unchanged lines hidden ---
91 if (timerisset(&it.it_value)) {
92 timevaladd(&it.it_value, &tv);
93 p->p_ithandle = timeout(realitexpire, (caddr_t)p, hzto(&it.it_value));
94 }
95 p->p_realtimer = it;
96 splx(s);
97 if (old_it.it_value.tv_usec)
98 old_it.it_value.tv_sec++;

--- 863 unchanged lines hidden ---