Don't forget to update `switchticks' in corner cases (except for
the alpha fork_trampoline(), forget it because it I believe it is only necessary for the unsupported SMP case).
This commit is contained in:
parent
5c3d6cdb69
commit
1b0b259ed2
|
@ -30,7 +30,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: exception.s,v 1.54 1998/07/28 17:55:37 bde Exp $
|
||||
* $Id: exception.s,v 1.55 1998/08/10 19:41:07 bde Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
|
@ -317,10 +317,12 @@ ENTRY(fork_trampoline)
|
|||
movl _switchtime,%ecx
|
||||
testl %ecx,%ecx
|
||||
jne 1f
|
||||
/* XXX unreachable? */
|
||||
/* XXX unreachable except in the SMP case? */
|
||||
pushl %eax
|
||||
call _microuptime
|
||||
popl %eax
|
||||
movl _ticks,%eax
|
||||
movl %eax,_switchticks
|
||||
jmp 2f
|
||||
1:
|
||||
movl %ecx,(%eax)
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: exception.s,v 1.54 1998/07/28 17:55:37 bde Exp $
|
||||
* $Id: exception.s,v 1.55 1998/08/10 19:41:07 bde Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
|
@ -317,10 +317,12 @@ ENTRY(fork_trampoline)
|
|||
movl _switchtime,%ecx
|
||||
testl %ecx,%ecx
|
||||
jne 1f
|
||||
/* XXX unreachable? */
|
||||
/* XXX unreachable except in the SMP case? */
|
||||
pushl %eax
|
||||
call _microuptime
|
||||
popl %eax
|
||||
movl _ticks,%eax
|
||||
movl %eax,_switchticks
|
||||
jmp 2f
|
||||
1:
|
||||
movl %ecx,(%eax)
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: exception.s,v 1.54 1998/07/28 17:55:37 bde Exp $
|
||||
* $Id: exception.s,v 1.55 1998/08/10 19:41:07 bde Exp $
|
||||
*/
|
||||
|
||||
#include "npx.h"
|
||||
|
@ -317,10 +317,12 @@ ENTRY(fork_trampoline)
|
|||
movl _switchtime,%ecx
|
||||
testl %ecx,%ecx
|
||||
jne 1f
|
||||
/* XXX unreachable? */
|
||||
/* XXX unreachable except in the SMP case? */
|
||||
pushl %eax
|
||||
call _microuptime
|
||||
popl %eax
|
||||
movl _ticks,%eax
|
||||
movl %eax,_switchticks
|
||||
jmp 2f
|
||||
1:
|
||||
movl %ecx,(%eax)
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
|
||||
* $Id: init_main.c,v 1.108 1999/02/17 21:03:14 luoqi Exp $
|
||||
* $Id: init_main.c,v 1.109 1999/02/19 14:25:34 luoqi Exp $
|
||||
*/
|
||||
|
||||
#include "opt_devfs.h"
|
||||
|
@ -490,14 +490,13 @@ proc0_post(dummy)
|
|||
struct timespec ts;
|
||||
|
||||
/*
|
||||
* Now can look at time, having had a chance to verify the time
|
||||
* from the file system. Reset p->p_runtime as it may have been
|
||||
* munched in mi_switch() after the time got set. Set
|
||||
* p->p_switchtime to be consistent with this unmunching.
|
||||
* Now we can look at the time, having had a chance to verify the
|
||||
* time from the file system. Pretend that proc0 started now.
|
||||
*/
|
||||
microtime(&proc0.p_stats->p_start);
|
||||
proc0.p_runtime = 0;
|
||||
microuptime(&proc0.p_switchtime);
|
||||
switchticks = ticks;
|
||||
|
||||
/*
|
||||
* Give the ``random'' number generator a thump.
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)kern_resource.c 8.5 (Berkeley) 1/21/94
|
||||
* $Id: kern_resource.c,v 1.39 1999/01/30 06:25:00 newton Exp $
|
||||
* $Id: kern_resource.c,v 1.40 1999/01/31 03:15:13 newton Exp $
|
||||
*/
|
||||
|
||||
#include "opt_compat.h"
|
||||
|
@ -532,9 +532,10 @@ calcru(p, up, sp, ip)
|
|||
* mi_switch(), so `switchtime' doesn't get set in the normal
|
||||
* way. We set it here instead of more cleanly in exit1()
|
||||
* to avoid losing track of the time between the calls to
|
||||
* microuptime().
|
||||
* microuptime(). Similarly for `switchticks'.
|
||||
*/
|
||||
switchtime = tv;
|
||||
switchticks = ticks;
|
||||
}
|
||||
if (totusec < 0) {
|
||||
/* XXX no %qd in kernel. Truncate. */
|
||||
|
|
Loading…
Reference in New Issue