direct-io.hg

changeset 2514:669a7dd084ec

bitkeeper revision 1.1159.79.14 (41517b25DFZMFi8N_o4qPoyFK7RHNw)

Use HYPERVISOR_set_timer_op and HYPERVISOR_block instead of busy-yielding.
author cl349@freefall.cl.cam.ac.uk
date Wed Sep 22 13:16:21 2004 +0000 (2004-09-22)
parents 8cd5855b0bab
children b3eb75cf942b
files netbsd-2.0-xen-sparse/sys/arch/xen/i386/locore.S netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h netbsd-2.0-xen-sparse/sys/arch/xen/xen/clock.c
line diff
     1.1 --- a/netbsd-2.0-xen-sparse/sys/arch/xen/i386/locore.S	Wed Sep 22 12:47:22 2004 +0000
     1.2 +++ b/netbsd-2.0-xen-sparse/sys/arch/xen/i386/locore.S	Wed Sep 22 13:16:21 2004 +0000
     1.3 @@ -1567,6 +1567,7 @@ idle_zero:
     1.4  	pushl	$IPL_NONE
     1.5  	call	_C_LABEL(Xspllower)
     1.6  	addl	$4,%esp
     1.7 +	jmp	idle_start
     1.8  4:
     1.9  	call	_C_LABEL(uvm_pageidlezero)
    1.10  	CLI(%eax)
    1.11 @@ -1577,6 +1578,9 @@ idle_loop:
    1.12  	movl	_C_LABEL(uvm)+UVM_PAGE_IDLE_ZERO,%ecx
    1.13  	testl	%ecx,%ecx
    1.14  	jnz	idle_zero
    1.15 +	call	_C_LABEL(idle_block)
    1.16 +	cmpl	$0,_C_LABEL(sched_whichqs)
    1.17 +	jnz	idle_exit
    1.18  	STIC(%eax)
    1.19      	jz	4f
    1.20  	call	_C_LABEL(stipending)
     2.1 --- a/netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h	Wed Sep 22 12:47:22 2004 +0000
     2.2 +++ b/netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h	Wed Sep 22 13:16:21 2004 +0000
     2.3 @@ -54,6 +54,8 @@ void	xenmachmem_init(void);
     2.4  void	xenprivcmd_init(void);
     2.5  void	xenvfr_init(void);
     2.6  
     2.7 +void	idle_block(void);
     2.8 +
     2.9  #ifdef XENDEBUG
    2.10  void printk(const char *, ...);
    2.11  void vprintk(const char *, va_list);
     3.1 --- a/netbsd-2.0-xen-sparse/sys/arch/xen/xen/clock.c	Wed Sep 22 12:47:22 2004 +0000
     3.2 +++ b/netbsd-2.0-xen-sparse/sys/arch/xen/xen/clock.c	Wed Sep 22 13:16:21 2004 +0000
     3.3 @@ -257,3 +257,17 @@ void
     3.4  setstatclockrate(int arg)
     3.5  {
     3.6  }
     3.7 +
     3.8 +void
     3.9 +idle_block(void)
    3.10 +{
    3.11 +
    3.12 +	/*
    3.13 +	 * We set the timer to when we expect the next timer
    3.14 +	 * interrupt.  We could set the timer to later if we could
    3.15 +	 * easily find out when we will have more work (callouts) to
    3.16 +	 * process from hardclock.
    3.17 +	 */
    3.18 +	if (HYPERVISOR_set_timer_op(processed_system_time + NS_PER_TICK) == 0)
    3.19 +		HYPERVISOR_block();
    3.20 +}