ia64/xen-unstable

view xen/arch/x86/copy_page.S @ 18806:ed8524f4a044

x86: Re-initialise HPET on resume from S3

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Nov 18 15:55:14 2008 +0000 (2008-11-18)
parents 8de4b4e9a435
children
line source
1 #include <xen/config.h>
2 #include <asm/page.h>
4 #ifdef __i386__
5 #define src_reg %esi
6 #define dst_reg %edi
7 #define WORD_SIZE 4
8 #define tmp1_reg %eax
9 #define tmp2_reg %edx
10 #define tmp3_reg %ebx
11 #define tmp4_reg %ebp
12 #else
13 #define src_reg %rsi
14 #define dst_reg %rdi
15 #define WORD_SIZE 8
16 #define tmp1_reg %r8
17 #define tmp2_reg %r9
18 #define tmp3_reg %r10
19 #define tmp4_reg %r11
20 #endif
22 ENTRY(copy_page_sse2)
23 #ifdef __i386__
24 push %ebx
25 push %ebp
26 push %esi
27 push %edi
28 mov 6*4(%esp), src_reg
29 mov 5*4(%esp), dst_reg
30 #endif
31 mov $PAGE_SIZE/(4*WORD_SIZE)-3, %ecx
33 prefetchnta 2*4*WORD_SIZE(src_reg)
34 mov (src_reg), tmp1_reg
35 mov WORD_SIZE(src_reg), tmp2_reg
36 mov 2*WORD_SIZE(src_reg), tmp3_reg
37 mov 3*WORD_SIZE(src_reg), tmp4_reg
39 0: prefetchnta 3*4*WORD_SIZE(src_reg)
40 1: add $4*WORD_SIZE, src_reg
41 movnti tmp1_reg, (dst_reg)
42 mov (src_reg), tmp1_reg
43 dec %ecx
44 movnti tmp2_reg, WORD_SIZE(dst_reg)
45 mov WORD_SIZE(src_reg), tmp2_reg
46 movnti tmp3_reg, 2*WORD_SIZE(dst_reg)
47 mov 2*WORD_SIZE(src_reg), tmp3_reg
48 movnti tmp4_reg, 3*WORD_SIZE(dst_reg)
49 lea 4*WORD_SIZE(dst_reg), dst_reg
50 mov 3*WORD_SIZE(src_reg), tmp4_reg
51 jg 0b
52 jpe 1b
54 movnti tmp1_reg, (dst_reg)
55 movnti tmp2_reg, WORD_SIZE(dst_reg)
56 movnti tmp3_reg, 2*WORD_SIZE(dst_reg)
57 movnti tmp4_reg, 3*WORD_SIZE(dst_reg)
59 #ifdef __i386__
60 pop %edi
61 pop %esi
62 pop %ebp
63 pop %ebx
64 #endif
65 sfence
66 ret