ia64/xen-unstable
changeset 3208:5586fdd8ed03
bitkeeper revision 1.1159.200.1 (41ab5283wLmdIWOfwXbjBnwp7bSLKg)
entry.S:
Use macros for loading %esi and for saving the upcall mask.
entry.S:
Use macros for loading %esi and for saving the upcall mask.
author | cl349@arcadians.cl.cam.ac.uk |
---|---|
date | Mon Nov 29 16:46:59 2004 +0000 (2004-11-29) |
parents | b8428734f8c7 |
children | 513e44ca9f64 |
files | linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S |
line diff
1.1 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S Mon Nov 29 15:02:20 2004 +0000 1.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/entry.S Mon Nov 29 16:46:59 2004 +0000 1.3 @@ -80,8 +80,13 @@ VM_MASK = 0x00020000 1.4 #define evtchn_upcall_pending /* 0 */ 1.5 #define evtchn_upcall_mask 1 1.6 1.7 +#define XEN_GET_VCPU_INFO(reg) movl HYPERVISOR_shared_info,reg 1.8 #define XEN_BLOCK_EVENTS(reg) movb $1,evtchn_upcall_mask(reg) 1.9 #define XEN_UNBLOCK_EVENTS(reg) movb $0,evtchn_upcall_mask(reg) 1.10 +#define XEN_SAVE_UPCALL_MASK(reg,tmp,off) \ 1.11 + movb evtchn_upcall_mask(reg), tmp; \ 1.12 + movb tmp, off(%esp) 1.13 + 1.14 #define XEN_TEST_PENDING(reg) testb $0xFF,evtchn_upcall_pending(reg) 1.15 1.16 #ifdef CONFIG_PREEMPT 1.17 @@ -108,9 +113,8 @@ VM_MASK = 0x00020000 1.18 1.19 #define SAVE_ALL \ 1.20 SAVE_ALL_NO_EVENTMASK; \ 1.21 - movl HYPERVISOR_shared_info, %esi; \ 1.22 - movb evtchn_upcall_mask(%esi), %dl; \ 1.23 - movb %dl, EVENT_MASK(%esp) 1.24 + XEN_GET_VCPU_INFO(%esi); \ 1.25 + XEN_SAVE_UPCALL_MASK(%esi,%dl,EVENT_MASK) 1.26 1.27 #define RESTORE_INT_REGS \ 1.28 popl %ebx; \ 1.29 @@ -194,7 +198,7 @@ ENTRY(ret_from_fork) 1.30 call schedule_tail 1.31 GET_THREAD_INFO(%ebp) 1.32 popl %eax 1.33 - movl HYPERVISOR_shared_info, %esi 1.34 + XEN_GET_VCPU_INFO(%esi) 1.35 jmp syscall_exit 1.36 1.37 /* 1.38 @@ -215,7 +219,7 @@ ret_from_intr: 1.39 testl $(VM_MASK | 2), %eax 1.40 jz resume_kernel # returning to kernel or vm86-space 1.41 ENTRY(resume_userspace) 1.42 - movl HYPERVISOR_shared_info, %esi 1.43 + XEN_GET_VCPU_INFO(%esi) 1.44 XEN_BLOCK_EVENTS(%esi) # make sure we don't miss an interrupt 1.45 # setting need_resched or sigpending 1.46 # between sampling and the iret 1.47 @@ -227,7 +231,7 @@ ENTRY(resume_userspace) 1.48 1.49 #ifdef CONFIG_PREEMPT 1.50 ENTRY(resume_kernel) 1.51 - movl HYPERVISOR_shared_info, %esi 1.52 + XEN_GET_VCPU_INFO(%esi) 1.53 cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ? 1.54 jnz restore_all 1.55 need_resched: 1.56 @@ -468,9 +472,8 @@ error_code: 1.57 movl $(__USER_DS), %edx 1.58 movl %edx, %ds 1.59 movl %edx, %es 1.60 - movl HYPERVISOR_shared_info, %esi 1.61 - movb evtchn_upcall_mask(%esi), %dl 1.62 - movb %dl, EVENT_MASK+8(%esp) 1.63 + XEN_GET_VCPU_INFO(%esi) 1.64 + XEN_SAVE_UPCALL_MASK(%esi,%dl,EVENT_MASK+8) 1.65 call *%edi 1.66 addl $8, %esp 1.67 jmp ret_from_exception 1.68 @@ -494,7 +497,7 @@ ENTRY(hypervisor_callback) 1.69 jb 11f 1.70 cmpl $ecrit,%eax 1.71 jb critical_region_fixup 1.72 -11: movl HYPERVISOR_shared_info, %esi 1.73 +11: XEN_GET_VCPU_INFO(%esi) 1.74 movb $0, EVENT_MASK(%esp) 1.75 push %esp 1.76 call evtchn_do_upcall 1.77 @@ -537,7 +540,7 @@ 16: movl %edi,%esp # final %edi is top 1.78 jmp 11b 1.79 1.80 critical_fixup_table: 1.81 - .byte 0x00,0x00,0x00 # testb $0xff,(%esi) 1.82 + .byte 0x00,0x00,0x00 # testb $0xff,(%esi) = XEN_TEST_PENDING 1.83 .byte 0x00,0x00 # jnz 14f 1.84 .byte 0x00 # pop %ebx 1.85 .byte 0x04 # pop %ecx 1.86 @@ -748,7 +751,6 @@ ENTRY(page_fault) 1.87 decl %eax /* eax = -1 */ 1.88 pushl %ecx 1.89 pushl %ebx 1.90 - GET_THREAD_INFO(%ebp) 1.91 cld 1.92 movl %es,%ecx 1.93 movl ORIG_EAX(%esp), %esi /* get the error code */ 1.94 @@ -762,9 +764,8 @@ ENTRY(page_fault) 1.95 movl $(__KERNEL_DS),%edx 1.96 movl %edx,%ds 1.97 movl %edx,%es 1.98 - movl HYPERVISOR_shared_info, %esi 1.99 - movb evtchn_upcall_mask(%esi), %dl 1.100 - movb %dl, EVENT_MASK+12(%esp) 1.101 + XEN_GET_VCPU_INFO(%esi) 1.102 + XEN_SAVE_UPCALL_MASK(%esi,%dl,EVENT_MASK+12) 1.103 call do_page_fault 1.104 addl $12,%esp 1.105 jmp ret_from_exception