diff options
author | cl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk> | 2004-09-22 13:16:21 +0000 |
---|---|---|
committer | cl349@freefall.cl.cam.ac.uk <cl349@freefall.cl.cam.ac.uk> | 2004-09-22 13:16:21 +0000 |
commit | 262c170bd9d8b9f80329abf19154d6852c283777 (patch) | |
tree | 07c152337ed0a80f740d861f8840ea8bd8082894 | |
parent | ca6844e34594e7d671675cae464c4f8da1c80fa4 (diff) | |
download | xen-262c170bd9d8b9f80329abf19154d6852c283777.tar.gz xen-262c170bd9d8b9f80329abf19154d6852c283777.tar.bz2 xen-262c170bd9d8b9f80329abf19154d6852c283777.zip |
bitkeeper revision 1.1159.79.14 (41517b25DFZMFi8N_o4qPoyFK7RHNw)
Use HYPERVISOR_set_timer_op and HYPERVISOR_block instead of busy-yielding.
-rw-r--r-- | netbsd-2.0-xen-sparse/sys/arch/xen/i386/locore.S | 4 | ||||
-rw-r--r-- | netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h | 2 | ||||
-rw-r--r-- | netbsd-2.0-xen-sparse/sys/arch/xen/xen/clock.c | 14 |
3 files changed, 20 insertions, 0 deletions
diff --git a/netbsd-2.0-xen-sparse/sys/arch/xen/i386/locore.S b/netbsd-2.0-xen-sparse/sys/arch/xen/i386/locore.S index 6a1a3e7bd8..ed0946cb9b 100644 --- a/netbsd-2.0-xen-sparse/sys/arch/xen/i386/locore.S +++ b/netbsd-2.0-xen-sparse/sys/arch/xen/i386/locore.S @@ -1567,6 +1567,7 @@ idle_zero: pushl $IPL_NONE call _C_LABEL(Xspllower) addl $4,%esp + jmp idle_start 4: call _C_LABEL(uvm_pageidlezero) CLI(%eax) @@ -1577,6 +1578,9 @@ idle_loop: movl _C_LABEL(uvm)+UVM_PAGE_IDLE_ZERO,%ecx testl %ecx,%ecx jnz idle_zero + call _C_LABEL(idle_block) + cmpl $0,_C_LABEL(sched_whichqs) + jnz idle_exit STIC(%eax) jz 4f call _C_LABEL(stipending) diff --git a/netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h b/netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h index 48bff484b9..274dad8410 100644 --- a/netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h +++ b/netbsd-2.0-xen-sparse/sys/arch/xen/include/xen.h @@ -54,6 +54,8 @@ void xenmachmem_init(void); void xenprivcmd_init(void); void xenvfr_init(void); +void idle_block(void); + #ifdef XENDEBUG void printk(const char *, ...); void vprintk(const char *, va_list); diff --git a/netbsd-2.0-xen-sparse/sys/arch/xen/xen/clock.c b/netbsd-2.0-xen-sparse/sys/arch/xen/xen/clock.c index fa7d986eb9..16add4e591 100644 --- a/netbsd-2.0-xen-sparse/sys/arch/xen/xen/clock.c +++ b/netbsd-2.0-xen-sparse/sys/arch/xen/xen/clock.c @@ -257,3 +257,17 @@ void setstatclockrate(int arg) { } + +void +idle_block(void) +{ + + /* + * We set the timer to when we expect the next timer + * interrupt. We could set the timer to later if we could + * easily find out when we will have more work (callouts) to + * process from hardclock. + */ + if (HYPERVISOR_set_timer_op(processed_system_time + NS_PER_TICK) == 0) + HYPERVISOR_block(); +} |