ia64/xen-unstable

changeset 1713:52ac325f9698

bitkeeper revision 1.1046 (40ec37c8Yw5F8zV1f79LCJsTGx4lsQ)

Merge scramble.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/xeno
author kaf24@scramble.cl.cam.ac.uk
date Wed Jul 07 17:50:00 2004 +0000 (2004-07-07)
parents 0e23f01219c6 15e8dbddd2a9
children e47071c24e23
files xen/arch/x86/Makefile xen/arch/x86/Rules.mk xen/arch/x86/boot/x86_64.S xen/arch/x86/trampoline.S xen/arch/x86/x86_64/xen.lds xen/common/Makefile xen/drivers/acpi/Makefile xen/drivers/char/Makefile xen/drivers/pci/Makefile xen/include/asm-x86/system.h
line diff
     1.1 --- a/xen/arch/x86/Makefile	Wed Jul 07 15:45:43 2004 +0000
     1.2 +++ b/xen/arch/x86/Makefile	Wed Jul 07 17:50:00 2004 +0000
     1.3 @@ -9,8 +9,15 @@ endif
     1.4  OBJS += $(patsubst %.S,%.o,$(wildcard $(TARGET_SUBARCH)/*.S))
     1.5  OBJS += $(patsubst %.c,%.o,$(wildcard $(TARGET_SUBARCH)/*.c))
     1.6  
     1.7 +ifeq ($(TARGET_SUBARCH),x86_32)
     1.8  LINK_BASE := 0xFC500000 # Xen is linked here
     1.9  LOAD_BASE := 0x00100000 # Xen is loaded here
    1.10 +endif
    1.11 +
    1.12 +ifeq ($(TARGET_SUBARCH),x86_64)
    1.13 +LINK_BASE := 0xFFFF830000100000 # Xen is linked here
    1.14 +LOAD_BASE := 0x0000000000100000 # Xen is loaded here
    1.15 +endif
    1.16  
    1.17  # What happens here? We link object files together, starting at LINK_BASE
    1.18  # (a very high address). But the bootloader cannot put things there, so we
    1.19 @@ -19,8 +26,9 @@ LOAD_BASE := 0x00100000 # Xen is loaded 
    1.20  # (NB. Linux gets round this by turning its image into raw binary, then 
    1.21  # wrapping that with a low-memory bootstrapper.)
    1.22  default: boot/$(TARGET_SUBARCH).o $(OBJS)
    1.23 -	$(LD) -r -o arch.o $(OBJS)
    1.24 -	$(LD) $(LDFLAGS) boot/$(TARGET_SUBARCH).o $(ALL_OBJS) -o $(TARGET)-syms
    1.25 +	$(LD) $(LDFLAGS) -r -o arch.o $(OBJS)
    1.26 +	$(LD) $(LDFLAGS) -T $(TARGET_SUBARCH)/xen.lds -N \
    1.27 +	    boot/$(TARGET_SUBARCH).o $(ALL_OBJS) -o $(TARGET)-syms
    1.28  	objcopy -R .note -R .comment -S $(TARGET)-syms $(TARGET)
    1.29  	$(BASEDIR)/tools/elf-reloc $(LINK_BASE) $(LOAD_BASE) $(TARGET)
    1.30  
     2.1 --- a/xen/arch/x86/Rules.mk	Wed Jul 07 15:45:43 2004 +0000
     2.2 +++ b/xen/arch/x86/Rules.mk	Wed Jul 07 17:50:00 2004 +0000
     2.3 @@ -5,17 +5,16 @@ CC := gcc
     2.4  LD := ld
     2.5  
     2.6  CFLAGS  := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing -O3
     2.7 -CFLAGS  += -iwithprefix include -Wall -Werror -fomit-frame-pointer
     2.8 +CFLAGS  += -iwithprefix include -Wall -Werror -fomit-frame-pointer -pipe
     2.9  CFLAGS  += -I$(BASEDIR)/include -Wno-pointer-arith -Wredundant-decls
    2.10  
    2.11 -LDFLAGS := -T $(TARGET_SUBARCH)/xen.lds -N 
    2.12 -
    2.13  ifeq ($(TARGET_SUBARCH),x86_32)
    2.14 -CFLAGS += -m32 -march=i686
    2.15 -LDARCHFLAGS := --oformat elf32-i386 
    2.16 +CFLAGS  += -m32 -march=i686
    2.17 +LDFLAGS := --oformat elf32-i386 
    2.18  endif
    2.19  
    2.20  ifeq ($(TARGET_SUBARCH),x86_64)
    2.21 -CFLAGS += -m64
    2.22 -LDARCHFLAGS := --oformat elf64-x86-64
    2.23 +CFLAGS  += -m64 -mno-red-zone -fpic -fno-reorder-blocks
    2.24 +CFLAGS  += -fno-asynchronous-unwind-tables
    2.25 +LDFLAGS := --oformat elf64-x86-64
    2.26  endif
     3.1 --- a/xen/arch/x86/boot/x86_64.S	Wed Jul 07 15:45:43 2004 +0000
     3.2 +++ b/xen/arch/x86/boot/x86_64.S	Wed Jul 07 17:50:00 2004 +0000
     3.3 @@ -9,9 +9,8 @@
     3.4          
     3.5  ENTRY(start)
     3.6          jmp __start
     3.7 -
     3.8 -        .align	4
     3.9 -
    3.10 +        
    3.11 +        .org    0x004
    3.12  /*** MULTIBOOT HEADER ****/
    3.13          /* Magic number indicating a Multiboot header. */
    3.14  	.long	0x1BADB002
    3.15 @@ -19,11 +18,11 @@ ENTRY(start)
    3.16  	.long	0x00000002
    3.17  	/* Checksum: must be the negated sum of the first two fields. */
    3.18  	.long	-0x1BADB004
    3.19 -        
    3.20 -bad_cpu_msg:
    3.21 +
    3.22 +        .org    0x010
    3.23          .asciz "Bad CPU: does not support 64-bit (long) mode."
    3.24  bad_cpu:
    3.25 -        mov     $SYMBOL_NAME(bad_cpu_msg)-__PAGE_OFFSET,%esi
    3.26 +        mov     $0x100010,%esi # Error message
    3.27          mov     $0xB8000,%edi  # VGA framebuffer
    3.28  1:      mov     (%esi),%bl
    3.29          test    %bl,%bl        # Terminate on '\0' sentinel
    3.30 @@ -41,19 +40,14 @@ 3:      in      %dx,%al
    3.31          jmp     1b
    3.32          
    3.33  __start:
    3.34 +        cld
    3.35 +        cli
    3.36 +
    3.37          /* Set up a few descriptors: on entry only CS is guaranteed good. */
    3.38 -        lgdt    %cs:nopaging_gdt_descr-__PAGE_OFFSET
    3.39 +        lgdt    %cs:0x1001f0
    3.40          mov     $(__HYPERVISOR_DS),%ecx
    3.41          mov     %ecx,%ds
    3.42          mov     %ecx,%es
    3.43 -        mov     %ecx,%fs
    3.44 -        mov     %ecx,%gs
    3.45 -        ljmp    $(__HYPERVISOR_CS32),$(1f)-__PAGE_OFFSET
    3.46 -1:      lss     stack_start-__PAGE_OFFSET,%esp
    3.47 -
    3.48 -        /* Reset EFLAGS (subsumes CLI and CLD). */
    3.49 -	pushl	$0
    3.50 -	popf
    3.51  
    3.52          /* We begin by interrogating the CPU for the presence of long mode. */
    3.53          mov     $0x80000000,%eax
    3.54 @@ -68,74 +62,93 @@ 1:      lss     stack_start-__PAGE_OFFSE
    3.55          /* Set up FPU. */
    3.56          fninit
    3.57          
    3.58 -        /* Set up CR4, except global flag which Intel requires should be     */
    3.59 -        /* left until after paging is enabled (IA32 Manual Vol. 3, Sec. 2.5) */
    3.60 -        mov     mmu_cr4_features-__PAGE_OFFSET,%ecx
    3.61 -        and     $0x7f,%cl   # CR4.PGE (global enable)
    3.62 +        /* Enable PAE in CR4. */
    3.63 +        mov     $0x20,%ecx # X86_CR4_PAE
    3.64          mov     %ecx,%cr4
    3.65 -               
    3.66 +
    3.67          cmp     $(SECONDARY_CPU_FLAG),%ebx
    3.68          je      start_paging
    3.69  
    3.70 -      	add     $__PAGE_OFFSET,%ebx
    3.71 -        push    %ebx /* Multiboot info struct */
    3.72 -        push    %eax /* Multiboot magic value */
    3.73 -
    3.74 -        /* Initialize BSS (no nasty surprises!) */
    3.75 -        mov     $__bss_start-__PAGE_OFFSET,%edi
    3.76 -        mov     $_end-__PAGE_OFFSET,%ecx
    3.77 -        sub     %edi,%ecx
    3.78 -        xor     %eax,%eax
    3.79 -        rep     stosb
    3.80 +        mov     %ebx,0x1001e0 /* Multiboot info struct */
    3.81 +        mov     %eax,0x1001e4 /* Multiboot magic value */
    3.82  
    3.83 -        /* Initialize low and high mappings of all memory with 4MB pages */
    3.84 -        mov     $idle_pg_table-__PAGE_OFFSET,%edi
    3.85 -        mov     $0x1e3,%eax                  /* PRESENT+RW+A+D+4MB+GLOBAL */
    3.86 -1:      mov     %eax,__PAGE_OFFSET>>20(%edi) /* high mapping */
    3.87 -        stosl                                /* low mapping */
    3.88 -        add     $(1<<L2_PAGETABLE_SHIFT),%eax
    3.89 -        cmp     $DIRECTMAP_PHYS_END+0x1e3,%eax
    3.90 -        jne     1b
    3.91 -
    3.92 -        /* Initialise IDT with simple error defaults. */
    3.93 -        lea     ignore_int,%edx
    3.94 -        mov     $(__HYPERVISOR_CS64 << 16),%eax
    3.95 -        mov     %dx,%ax            /* selector = 0x0010 = cs */
    3.96 -        mov     $0x8E00,%dx        /* interrupt gate - dpl=0, present */
    3.97 -        lea     SYMBOL_NAME(idt_table)-__PAGE_OFFSET,%edi
    3.98 -        mov     $256,%ecx
    3.99 -1:      mov     %eax,(%edi)
   3.100 -        mov     %edx,4(%edi)
   3.101 -        add     $8,%edi
   3.102 +        /* Initialize mappings of 1GB of memory. */
   3.103 +        mov     $0x103000,%edi               /* idle_pg_table_l2 */
   3.104 +        mov     $0x1e3,%eax                  /* PRESENT+RW+A+D+PSE+GLOBAL */
   3.105 +        mov     $512,%ecx
   3.106 +1:      stosl
   3.107 +        add     $0x200000,%eax
   3.108          loop    1b
   3.109  
   3.110  start_paging:
   3.111 -        mov     $idle_pg_table-__PAGE_OFFSET,%eax
   3.112 +        mov     $0x101000,%eax   /* idle_pg_table */
   3.113          mov     %eax,%cr3
   3.114          mov     $0x80050033,%eax /* hi-to-lo: PG,AM,WP,NE,ET,MP,PE */
   3.115          mov     %eax,%cr0
   3.116          jmp     1f
   3.117  1:      /* Now in compatibility mode. Long-jump into 64-bit mode. */
   3.118 -        ljmp    $(__HYPERVISOR_CS64),$1f
   3.119 +        ljmp    $(__HYPERVISOR_CS64),$0x1000e0
   3.120  
   3.121          .code64
   3.122 -1:      /* Install relocated selectors (FS/GS unused). */
   3.123 -        lgdt    gdt_descr
   3.124 +        .org    0x00e0
   3.125 +
   3.126 +        /* Jump to high mappings. */
   3.127 +        mov     high_start(%rip),%rax
   3.128 +        push    %rax
   3.129 +        ret
   3.130 +__high_start:
   3.131 +        
   3.132 +        /* Install relocated selectors (FS/GS unused). */
   3.133 +        lgdt    gdt_descr(%rip)
   3.134          mov     $(__HYPERVISOR_DS),%ecx
   3.135          mov     %ecx,%ds
   3.136          mov     %ecx,%es
   3.137          mov     %ecx,%ss
   3.138 -1:      /* Paging enabled, so we can now enable GLOBAL mappings in CR4. */
   3.139 -        mov     mmu_cr4_features,%rcx
   3.140 +
   3.141 +        /* Enable full CR4 features. */
   3.142 +        mov     mmu_cr4_features(%rip),%rcx
   3.143          mov     %rcx,%cr4
   3.144 -        /* Relocate ESP */
   3.145 -        add     $__PAGE_OFFSET,%esp
   3.146  
   3.147 -        lidt    idt_descr
   3.148 +        mov     stack_start(%rip),%rsp
   3.149 +        
   3.150 +        /* Reset EFLAGS (subsumes CLI and CLD). */
   3.151 +	pushq	$0
   3.152 +	popf
   3.153 +
   3.154 +        lidt    idt_descr(%rip)
   3.155                  
   3.156          cmp     $(SECONDARY_CPU_FLAG),%ebx
   3.157          je      start_secondary
   3.158  
   3.159 +        /* Initialize BSS (no nasty surprises!) */
   3.160 +        lea     __bss_start(%rip),%rdi
   3.161 +        lea     _end(%rip),%rcx
   3.162 +        sub     %rdi,%rcx
   3.163 +        xor     %rax,%rax
   3.164 +        rep     stosb
   3.165 +
   3.166 +        /* Initialise IDT with simple error defaults. */
   3.167 +        lea     ignore_int(%rip),%rdx
   3.168 +        mov     $(__HYPERVISOR_CS64 << 16),%eax
   3.169 +        mov     %dx,%ax            /* selector = 0x0010 = cs */
   3.170 +        mov     $0x8E00,%dx        /* interrupt gate - dpl=0, present */
   3.171 +        lea     idt_table(%rip),%rdi
   3.172 +        mov     $256,%rcx
   3.173 +1:      mov     %eax,(%rdi)
   3.174 +        mov     %edx,4(%rdi)
   3.175 +        add     $8,%rdi
   3.176 +        loop    1b
   3.177 +
   3.178 +        xor     %rax,%rax
   3.179 +        mov     0x1001e0,%eax /* Multiboot info struct */
   3.180 +        lea     start(%rip),%rbx
   3.181 +        sub     $0x100000,%rbx
   3.182 +        add     %rbx,%rax
   3.183 +        push    %rax
   3.184 +        xor     %rax,%rax
   3.185 +        mov     0x1001e4,%eax /* Multiboot magic value */
   3.186 +        push    %rax
   3.187 +        
   3.188          /* Call into main C routine. This should never return.*/
   3.189         	call	cmain
   3.190          ud2     /* Force a panic (invalid opcode). */
   3.191 @@ -148,42 +161,23 @@ ignore_int:
   3.192          mov     $(__HYPERVISOR_DS),%eax
   3.193          mov     %eax,%ds
   3.194          mov     %eax,%es
   3.195 -        pushq   $int_msg
   3.196 +        lea     int_msg(%rip),%rax
   3.197 +        push    %rax
   3.198          call    SYMBOL_NAME(printf)
   3.199  1:      jmp     1b
   3.200  
   3.201          .code32
   3.202 -        .align 8
   3.203                  
   3.204 -/*** STACK LOCATION ***/
   3.205 -        
   3.206 -ENTRY(stack_start)
   3.207 -        .long SYMBOL_NAME(cpu0_stack) + 8100 - __PAGE_OFFSET
   3.208 -        .long __HYPERVISOR_DS
   3.209 -        
   3.210  /*** DESCRIPTOR TABLES ***/
   3.211  
   3.212  .globl SYMBOL_NAME(idt)
   3.213  .globl SYMBOL_NAME(gdt)        
   3.214  
   3.215 -        .word   0    
   3.216 -idt_descr:
   3.217 -	.word	256*8-1
   3.218 -SYMBOL_NAME(idt):
   3.219 -        .long	SYMBOL_NAME(idt_table)
   3.220 -
   3.221 -        .word   0
   3.222 -gdt_descr:
   3.223 -	.word	(LAST_RESERVED_GDT_ENTRY*8)+7
   3.224 -SYMBOL_NAME(gdt):       
   3.225 -        .long   SYMBOL_NAME(gdt_table)	/* gdt base */
   3.226 -
   3.227 -        .word   0
   3.228 -nopaging_gdt_descr:
   3.229 +        .org    0x1f0
   3.230          .word   (LAST_RESERVED_GDT_ENTRY*8)+7
   3.231 -        .long   SYMBOL_NAME(gdt_table)-__PAGE_OFFSET
   3.232 +        .long   0x100200 # gdt_table
   3.233          
   3.234 -        .align 64
   3.235 +        .org    0x200
   3.236  ENTRY(gdt_table)
   3.237          .fill FIRST_RESERVED_GDT_ENTRY,8,0
   3.238          .quad 0x0000000000000000     /* unused */
   3.239 @@ -193,13 +187,76 @@ ENTRY(gdt_table)
   3.240          .quad 0x00cffa000000ffff     /* 0x0823 ring 3 code, compatibility */
   3.241          .quad 0x00affa000000ffff     /* 0x082b ring 3 code, 64-bit mode   */
   3.242          .quad 0x00cff2000000ffff     /* 0x0833 ring 3 data                */
   3.243 -        .quad 0x0000000000000000     /* unused                           */
   3.244 -        .fill 2*NR_CPUS,8,0          /* space for TSS and LDT per CPU    */
   3.245 +        .quad 0x0000000000000000     /* unused                            */
   3.246 +        .fill 2*NR_CPUS,8,0          /* space for TSS and LDT per CPU     */
   3.247 +
   3.248 +        .word   0
   3.249 +gdt_descr:
   3.250 +	.word	(LAST_RESERVED_GDT_ENTRY*8)+7
   3.251 +SYMBOL_NAME(gdt):       
   3.252 +        .quad   SYMBOL_NAME(gdt_table)
   3.253  
   3.254 +        .word   0    
   3.255 +idt_descr:
   3.256 +	.word	256*8-1
   3.257 +SYMBOL_NAME(idt):
   3.258 +        .quad	SYMBOL_NAME(idt_table)
   3.259 +
   3.260 +ENTRY(stack_start)
   3.261 +        .quad   SYMBOL_NAME(cpu0_stack) + 8100 - __PAGE_OFFSET
   3.262 +
   3.263 +high_start:
   3.264 +        .quad   __high_start
   3.265 +                
   3.266          .org 0x1000
   3.267 -ENTRY(idle_pg_table) # Initial page directory is 4kB
   3.268 +ENTRY(idle_pg_table)
   3.269 +ENTRY(idle_pg_table_4)
   3.270 +        .quad 0x0000000000102007 # PML4[0]
   3.271 +        .fill 261,8,0
   3.272 +        .quad 0x0000000000102007 # PML4[262]
   3.273          .org 0x2000
   3.274 +ENTRY(idle_pg_table_l3)
   3.275 +        .quad 0x0000000000103007
   3.276 +        .org 0x3000
   3.277 +ENTRY(idle_pg_table_l2)
   3.278 +        .org 0x4000
   3.279  ENTRY(cpu0_stack)    # Initial stack is 8kB
   3.280 -        .org 0x4000
   3.281 +        .org 0x6000
   3.282  ENTRY(stext)
   3.283  ENTRY(_stext)
   3.284 +
   3.285 +.globl map_domain_mem, unmap_domain_mem, ret_from_intr
   3.286 +map_domain_mem:
   3.287 +unmap_domain_mem:
   3.288 +ret_from_intr:
   3.289 +#undef machine_to_phys_mapping
   3.290 +.globl copy_to_user, set_intr_gate, die, machine_to_phys_mapping
   3.291 +copy_to_user:
   3.292 +set_intr_gate:
   3.293 +die:
   3.294 +machine_to_phys_mapping:
   3.295 +.globl copy_from_user, show_registers, __set_fixmap, do_iopl, check_descriptor
   3.296 +copy_from_user: 
   3.297 +show_registers: 
   3.298 +__set_fixmap: 
   3.299 +do_iopl: 
   3.300 +check_descriptor:
   3.301 +.globl set_gdt, idt_table, copy_user_generic, memcmp, idt_tables, new_thread
   3.302 +set_gdt:
   3.303 +idt_table:
   3.304 +copy_user_generic:
   3.305 +memcmp:
   3.306 +idt_tables:
   3.307 +new_thread:
   3.308 +.globl switch_to, continue_nonidle_task, __get_user_1, paging_init, trap_init
   3.309 +switch_to:
   3.310 +continue_nonidle_task:
   3.311 +__get_user_1:
   3.312 +paging_init:
   3.313 +trap_init: 
   3.314 +.globl __get_user_8, zap_low_mappings, set_debugreg
   3.315 +__get_user_8:
   3.316 +zap_low_mappings:
   3.317 +set_debugreg:
   3.318 +        
   3.319 +        
     4.1 --- a/xen/arch/x86/trampoline.S	Wed Jul 07 15:45:43 2004 +0000
     4.2 +++ b/xen/arch/x86/trampoline.S	Wed Jul 07 17:50:00 2004 +0000
     4.3 @@ -55,8 +55,12 @@ idt_48:
     4.4  
     4.5  gdt_48:
     4.6  	.word	(LAST_RESERVED_GDT_ENTRY*8)+7
     4.7 +#ifdef __i386__
     4.8  	.long	gdt_table-__PAGE_OFFSET
     4.9 -
    4.10 +#else
    4.11 +	.long   0x100200 # gdt_table
    4.12 +#endif
    4.13 +        
    4.14  .globl SYMBOL_NAME(trampoline_end)
    4.15  SYMBOL_NAME_LABEL(trampoline_end)
    4.16  
     5.1 --- a/xen/arch/x86/x86_64/xen.lds	Wed Jul 07 15:45:43 2004 +0000
     5.2 +++ b/xen/arch/x86/x86_64/xen.lds	Wed Jul 07 17:50:00 2004 +0000
     5.3 @@ -4,7 +4,7 @@ OUTPUT_ARCH(i386:x86-64)
     5.4  ENTRY(start)
     5.5  SECTIONS
     5.6  {
     5.7 -  . = 0xFFFF840000100000;
     5.8 +  . = 0xFFFF830000100000;
     5.9    _text = .;			/* Text and read-only data */
    5.10    .text : {
    5.11  	*(.text)
     6.1 --- a/xen/common/Makefile	Wed Jul 07 15:45:43 2004 +0000
     6.2 +++ b/xen/common/Makefile	Wed Jul 07 17:50:00 2004 +0000
     6.3 @@ -15,7 +15,7 @@ OBJS := $(subst trace.o,,$(OBJS))
     6.4  endif
     6.5  
     6.6  default: $(OBJS)
     6.7 -	$(LD) $(LDARCHFLAGS) -r -o common.o $(OBJS)
     6.8 +	$(LD) $(LDFLAGS) -r -o common.o $(OBJS)
     6.9  
    6.10  clean:
    6.11  	rm -f *.o *~ core
     7.1 --- a/xen/drivers/acpi/Makefile	Wed Jul 07 15:45:43 2004 +0000
     7.2 +++ b/xen/drivers/acpi/Makefile	Wed Jul 07 17:50:00 2004 +0000
     7.3 @@ -7,7 +7,7 @@ include $(BASEDIR)/Rules.mk
     7.4  OBJS := acpi_ksyms.o tables.o
     7.5  
     7.6  default: $(OBJS)
     7.7 -	$(LD) -r -o driver.o $(OBJS)
     7.8 +	$(LD) $(LDFLAGS) -r -o driver.o $(OBJS)
     7.9  
    7.10  clean:
    7.11  	rm -f *.o *~ core
     8.1 --- a/xen/drivers/char/Makefile	Wed Jul 07 15:45:43 2004 +0000
     8.2 +++ b/xen/drivers/char/Makefile	Wed Jul 07 17:50:00 2004 +0000
     8.3 @@ -2,7 +2,7 @@
     8.4  include $(BASEDIR)/Rules.mk
     8.5  
     8.6  default: $(OBJS)
     8.7 -	$(LD) -r -o driver.o $(OBJS)
     8.8 +	$(LD) $(LDFLAGS) -r -o driver.o $(OBJS)
     8.9  
    8.10  clean:
    8.11  	rm -f *.o *~ core
     9.1 --- a/xen/drivers/pci/Makefile	Wed Jul 07 15:45:43 2004 +0000
     9.2 +++ b/xen/drivers/pci/Makefile	Wed Jul 07 17:50:00 2004 +0000
     9.3 @@ -29,7 +29,7 @@ OBJS := pci.o quirks.o compat.o names.o 
     9.4  #endif
     9.5  
     9.6  default: $(OBJS)
     9.7 -	$(LD) -r -o driver.o $(OBJS)
     9.8 +	$(LD) $(LDFLAGS) -r -o driver.o $(OBJS)
     9.9  
    9.10  clean:
    9.11  	rm -f *.o *~ core gen-devlist classlist.h devlist.h
    10.1 --- a/xen/include/asm-x86/system.h	Wed Jul 07 15:45:43 2004 +0000
    10.2 +++ b/xen/include/asm-x86/system.h	Wed Jul 07 17:50:00 2004 +0000
    10.3 @@ -131,6 +131,7 @@ static inline unsigned long __cmpxchg(vo
    10.4   * If no fault occurs then _o is updated to teh value we saw at _p. If this
    10.5   * is the same as the initial value of _o then _n is written to location _p.
    10.6   */
    10.7 +#ifdef __i386__
    10.8  #define cmpxchg_user(_p,_o,_n)                                          \
    10.9  ({                                                                      \
   10.10      int _rc;                                                            \
   10.11 @@ -150,6 +151,9 @@ static inline unsigned long __cmpxchg(vo
   10.12          : "memory");                                                    \
   10.13      _rc;                                                                \
   10.14  })
   10.15 +#else
   10.16 +#define cmpxchg_user(_p,_o,_n) ({ __asm__ __volatile__ ( "" : : "r" (_p), "r" (_o), "r" (_n) ); BUG(); 0; })
   10.17 +#endif
   10.18  
   10.19  /*
   10.20   * Force strict CPU ordering.