ia64/xen-unstable

view extras/mini-os/head.S @ 922:fc5ae656dd1e

bitkeeper revision 1.582.1.2 (3fafc1a8WtDmHzijhEouIqSThPp1nA)

xen_netwatch.c:
Fixes to xen_netwatch.
author kaf24@scramble.cl.cam.ac.uk
date Mon Nov 10 16:49:44 2003 +0000 (2003-11-10)
parents 4b4252761715
children 109663e1ac8d 369b77bc3884
line source
1 #include <os.h>
3 /* Offsets in start_info structure */
4 #define MOD_START 20
5 #define MOD_LEN 24
7 .globl _start, shared_info
9 _start:
10 cld
12 lss stack_start,%esp
14 /* Copy any module somewhere safe before it's clobbered by BSS. */
15 mov MOD_LEN(%esi),%ecx
16 shr $2,%ecx
17 jz 2f /* bail from copy loop if no module */
19 mov $_end,%edi
20 add MOD_LEN(%esi),%edi
21 mov MOD_START(%esi),%eax
22 add MOD_LEN(%esi),%eax
23 1: sub $4,%eax
24 sub $4,%edi
25 mov (%eax),%ebx
26 mov %ebx,(%edi)
27 loop 1b
28 mov %edi,MOD_START(%esi)
30 /* Clear BSS first so that there are no surprises... */
31 2: xorl %eax,%eax
32 movl $__bss_start,%edi
33 movl $_end,%ecx
34 subl %edi,%ecx
35 rep stosb
37 push %esi
38 call start_kernel
41 stack_start:
42 .long stack+8192, __KERNEL_DS
45 /* Unpleasant -- we actually use this PTE to map shared_info :-) */
46 .org 0x1000
47 shared_info:
48 .org 0x2000