ia64/xen-unstable

changeset 4688:0dc81495c135

bitkeeper revision 1.1327.1.8 (4271171bkgG2OW7a1JXLin4JRIi6_Q)

Code cleanup
author djm@kirby.fc.hp.com
date Thu Apr 28 17:02:19 2005 +0000 (2005-04-28)
parents 34c2b5c0ac81
children 065f8708a9e2
files xen/arch/ia64/patch/linux-2.6.11/head.S xen/arch/ia64/tools/mkbuildtree xen/arch/ia64/xenmisc.c xen/arch/ia64/xensetup.c xen/include/asm-ia64/config.h
line diff
     1.1 --- a/xen/arch/ia64/patch/linux-2.6.11/head.S	Tue Apr 26 22:24:29 2005 +0000
     1.2 +++ b/xen/arch/ia64/patch/linux-2.6.11/head.S	Thu Apr 28 17:02:19 2005 +0000
     1.3 @@ -1,20 +1,6 @@
     1.4 - head.S |   34 ++++++++++++++++++++++++++++++++++
     1.5 - 1 files changed, 34 insertions(+)
     1.6 -
     1.7 -Index: linux-2.6.11-xendiffs/arch/ia64/kernel/head.S
     1.8 -===================================================================
     1.9 ---- linux-2.6.11-xendiffs.orig/arch/ia64/kernel/head.S	2005-04-07 10:56:19.225128582 -0500
    1.10 -+++ linux-2.6.11-xendiffs/arch/ia64/kernel/head.S	2005-04-07 11:00:21.718513399 -0500
    1.11 -@@ -1,3 +1,8 @@
    1.12 -+#ifdef XEN
    1.13 -+#define	console_print	printf
    1.14 -+#define kernel_thread_helper 0
    1.15 -+#define sys_exit 0
    1.16 -+#endif
    1.17 - /*
    1.18 -  * Here is where the ball gets rolling as far as the kernel is concerned.
    1.19 -  * When control is transferred to _start, the bootload has already
    1.20 -@@ -187,7 +192,11 @@ start_ap:
    1.21 +--- ../../linux-2.6.11/arch/ia64/kernel/head.S	2005-03-02 00:38:13.000000000 -0700
    1.22 ++++ arch/ia64/head.S	2005-04-28 10:51:19.000000000 -0600
    1.23 +@@ -187,7 +187,11 @@
    1.24   	dep r18=0,r3,0,12
    1.25   	;;
    1.26   	or r18=r17,r18
    1.27 @@ -26,7 +12,7 @@ Index: linux-2.6.11-xendiffs/arch/ia64/k
    1.28   	;;
    1.29   	mov r17=rr[r2]
    1.30   	shr.u r16=r3,IA64_GRANULE_SHIFT
    1.31 -@@ -227,7 +236,11 @@ start_ap:
    1.32 +@@ -227,7 +231,11 @@
    1.33   	;;
    1.34   	mov ar.rsc=0x3		// place RSE in eager mode
    1.35   
    1.36 @@ -38,29 +24,7 @@ Index: linux-2.6.11-xendiffs/arch/ia64/k
    1.37   (isBP)	movl r2=ia64_boot_param
    1.38   	;;
    1.39   (isBP)	st8 [r2]=r28		// save the address of the boot param area passed by the bootloader
    1.40 -@@ -245,7 +258,21 @@ start_ap:
    1.41 - 	br.call.sptk.many rp=sys_fw_init
    1.42 - .ret1:
    1.43 - #endif
    1.44 -+#ifdef XEN
    1.45 -+	alloc r2=ar.pfs,8,0,2,0
    1.46 -+	;;
    1.47 -+#define fake_mbi_magic 0
    1.48 -+#define MULTIBOOT_INFO_SIZE	1024
    1.49 -+	.rodata
    1.50 -+fake_mbi:
    1.51 -+	.skip MULTIBOOT_INFO_SIZE
    1.52 -+	.previous
    1.53 -+	movl out0=fake_mbi
    1.54 -+	;;
    1.55 -+	br.call.sptk.many rp=cmain
    1.56 -+#else
    1.57 - 	br.call.sptk.many rp=start_kernel
    1.58 -+#endif
    1.59 - .ret2:	addl r3=@ltoff(halt_msg),gp
    1.60 - 	;;
    1.61 - 	alloc r2=ar.pfs,8,0,2,0
    1.62 -@@ -254,7 +281,9 @@ start_ap:
    1.63 +@@ -254,7 +262,9 @@
    1.64   	br.call.sptk.many b0=console_print
    1.65   
    1.66   self:	hint @pause
    1.67 @@ -70,13 +34,12 @@ Index: linux-2.6.11-xendiffs/arch/ia64/k
    1.68   END(_start)
    1.69   
    1.70   GLOBAL_ENTRY(ia64_save_debug_regs)
    1.71 -@@ -850,7 +879,12 @@ END(ia64_delay_loop)
    1.72 +@@ -850,7 +860,11 @@
    1.73    * intermediate precision so that we can produce a full 64-bit result.
    1.74    */
    1.75   GLOBAL_ENTRY(sched_clock)
    1.76  +#ifdef XEN
    1.77 -+	break 0;;	// FIX IA64_CPUINFO_NSEC_PER_CYC_OFFSET
    1.78 -+	//movl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET
    1.79 ++	movl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET
    1.80  +#else
    1.81   	addl r8=THIS_CPU(cpu_info) + IA64_CPUINFO_NSEC_PER_CYC_OFFSET,r0
    1.82  +#endif
     2.1 --- a/xen/arch/ia64/tools/mkbuildtree	Tue Apr 26 22:24:29 2005 +0000
     2.2 +++ b/xen/arch/ia64/tools/mkbuildtree	Thu Apr 28 17:02:19 2005 +0000
     2.3 @@ -97,7 +97,8 @@ cp_patch arch/ia64/kernel/vmlinux.lds.S 
     2.4  #cp_patch mm/slab.c arch/ia64/slab.c slab.c
     2.5  
     2.6  # following renamed to avoid conflict
     2.7 -cp_patch kernel/extable.c arch/ia64/linuxextable.c linuxextable.c
     2.8 +#cp_patch kernel/extable.c arch/ia64/linuxextable.c linuxextable.c
     2.9 +softlink kernel/extable.c arch/ia64/linuxextable.c
    2.10  
    2.11  cp_patch arch/ia64/mm/contig.c arch/ia64/mm_contig.c mm_contig.c
    2.12  cp_patch arch/ia64/mm/tlb.c arch/ia64/tlb.c tlb.c
    2.13 @@ -168,7 +169,8 @@ softlink include/asm-generic/vmlinux.lds
    2.14  
    2.15  cp_patch arch/ia64/hp/sim/hpsim_ssc.h include/asm-ia64/hpsim_ssc.h hpsim_ssc.h
    2.16  
    2.17 -cp_patch include/asm-ia64/current.h include/asm-ia64/current.h current.h
    2.18 +#cp_patch include/asm-ia64/current.h include/asm-ia64/current.h current.h
    2.19 +softlink include/asm-ia64/current.h include/asm-ia64/current.h
    2.20  #cp_patch include/asm-ia64/gcc_intrin.h include/asm-ia64/gcc_intrin.h gcc_intrin.h
    2.21  softlink include/asm-ia64/gcc_intrin.h include/asm-ia64/gcc_intrin.h
    2.22  cp_patch include/asm-ia64/hardirq.h include/asm-ia64/hardirq.h hardirq.h
    2.23 @@ -180,7 +182,8 @@ cp_patch include/asm-ia64/irq.h include/
    2.24  cp_patch include/asm-ia64/kregs.h include/asm-ia64/kregs.h kregs.h
    2.25  cp_patch include/asm-ia64/page.h include/asm-ia64/page.h page.h
    2.26  cp_patch include/asm-ia64/processor.h include/asm-ia64/processor.h processor.h
    2.27 -cp_patch include/asm-ia64/sal.h include/asm-ia64/sal.h sal.h
    2.28 +#cp_patch include/asm-ia64/sal.h include/asm-ia64/sal.h sal.h
    2.29 +softlink include/asm-ia64/sal.h include/asm-ia64/sal.h
    2.30  cp_patch include/asm-ia64/system.h include/asm-ia64/system.h system.h
    2.31  cp_patch include/asm-ia64/types.h include/asm-ia64/types.h types.h
    2.32  
    2.33 @@ -268,9 +271,10 @@ cp_patch include/linux/hardirq.h include
    2.34  cp_patch include/linux/interrupt.h include/asm-ia64/linux/interrupt.h interrupt.h
    2.35  cp_patch include/linux/mmzone.h include/asm-ia64/linux/mmzone.h mmzone.h
    2.36  
    2.37 -cp_patch include/linux/wait.h include/asm-ia64/linux/wait.h wait.h
    2.38 +#cp_patch include/linux/wait.h include/asm-ia64/linux/wait.h wait.h
    2.39 +softlink include/linux/wait.h include/asm-ia64/linux/wait.h
    2.40  
    2.41 -cp_patch include/linux/slab.h include/asm-ia64/slab.h slab.h
    2.42 +#cp_patch include/linux/slab.h include/asm-ia64/slab.h slab.h
    2.43  
    2.44  # following renamed to avoid conflict
    2.45  cp_patch include/linux/time.h include/xen/linuxtime.h linuxtime.h
     3.1 --- a/xen/arch/ia64/xenmisc.c	Tue Apr 26 22:24:29 2005 +0000
     3.2 +++ b/xen/arch/ia64/xenmisc.c	Thu Apr 28 17:02:19 2005 +0000
     3.3 @@ -237,17 +237,34 @@ void physdev_destroy_state(struct domain
     3.4  	dummy();
     3.5  }
     3.6  
     3.7 +///////////////////////////////
     3.8 +// called from arch/ia64/head.S
     3.9 +///////////////////////////////
    3.10 +
    3.11 +void console_print(char *msg)
    3.12 +{
    3.13 +	printk("console_print called, how did start_kernel return???\n");
    3.14 +}
    3.15 +
    3.16 +void kernel_thread_helper(void)
    3.17 +{
    3.18 +	printk("kernel_thread_helper not implemented\n");
    3.19 +	dummy();
    3.20 +}
    3.21 +
    3.22 +void sys_exit(void)
    3.23 +{
    3.24 +	printk("sys_exit not implemented\n");
    3.25 +	dummy();
    3.26 +}
    3.27 +
    3.28 +
    3.29 +
    3.30  // accomodate linux extable.c
    3.31  //const struct exception_table_entry *
    3.32 -void *search_module_extables(unsigned long addr)
    3.33 -{
    3.34 -	return NULL;
    3.35 -}
    3.36 -
    3.37 -void *module_text_address(unsigned long addr)
    3.38 -{
    3.39 -	return NULL;
    3.40 -}
    3.41 +void *search_module_extables(unsigned long addr) { return NULL; }
    3.42 +void *__module_text_address(unsigned long addr) { return NULL; }
    3.43 +void *module_text_address(unsigned long addr) { return NULL; }
    3.44  
    3.45  void cs10foo(void) {}
    3.46  void cs01foo(void) {}
     4.1 --- a/xen/arch/ia64/xensetup.c	Tue Apr 26 22:24:29 2005 +0000
     4.2 +++ b/xen/arch/ia64/xensetup.c	Thu Apr 28 17:02:19 2005 +0000
     4.3 @@ -1,13 +1,9 @@
     4.4  /******************************************************************************
     4.5 - * kernel.c
     4.6 - * 
     4.7 - * This file should contain architecture-independent bootstrap and low-level
     4.8 - * help routines. It's a bit x86/PC specific right now!
     4.9 - * 
    4.10 - * Copyright (c) 2002-2003 K A Fraser
    4.11 + * xensetup.c
    4.12 + * Copyright (c) 2004-2005  Hewlett-Packard Co
    4.13 + *         Dan Magenheimer <dan.magenheimer@hp.com>
    4.14   */
    4.15  
    4.16 -//#include <stdarg.h>
    4.17  #include <xen/config.h>
    4.18  #include <xen/lib.h>
    4.19  #include <xen/errno.h>
    4.20 @@ -20,11 +16,6 @@
    4.21  //#include <xen/console.h>
    4.22  //#include <xen/serial.h>
    4.23  #include <xen/trace.h>
    4.24 -//#include <asm/shadow.h>
    4.25 -//#include <asm/io.h>
    4.26 -//#include <asm/uaccess.h>
    4.27 -//#include <asm/domain_page.h>
    4.28 -//#include <public/dom0_ops.h>
    4.29  #include <asm/meminit.h>
    4.30  #include <asm/page.h>
    4.31  
    4.32 @@ -84,7 +75,7 @@ char opt_physdev_dom0_hide[200] = "";
    4.33  char opt_leveltrigger[30] = "", opt_edgetrigger[30] = "";
    4.34  /*
    4.35   * opt_xenheap_megabytes: Size of Xen heap in megabytes, including:
    4.36 - * 	xen image
    4.37 + *	xen image
    4.38   *	bootmap bits
    4.39   *	xen heap
    4.40   * Note: To allow xenheap size configurable, the prerequisite is
    4.41 @@ -147,10 +138,9 @@ static void __init do_initcalls(void)
    4.42          (*call)();
    4.43  }
    4.44  
    4.45 -void cmain(multiboot_info_t *mbi)
    4.46 +void start_kernel(void)
    4.47  {
    4.48      unsigned char *cmdline;
    4.49 -    module_t *mod = (module_t *)__va(mbi->mods_addr);
    4.50      void *heap_start;
    4.51      int i;
    4.52      unsigned long max_mem, nr_pages, firsthole_start;
    4.53 @@ -162,7 +152,8 @@ void cmain(multiboot_info_t *mbi)
    4.54      xen_pstart = ia64_tpa(KERNEL_START);
    4.55  
    4.56      /* Must do this early -- e.g., spinlocks rely on get_current(). */
    4.57 -    set_current(&idle0_exec_domain);
    4.58 +    //set_current(&idle0_exec_domain);
    4.59 +    ia64_r13 = (void *)&idle0_exec_domain;
    4.60      idle0_exec_domain.domain = &idle0_domain;
    4.61  
    4.62      early_setup_arch(&cmdline);
    4.63 @@ -170,7 +161,7 @@ void cmain(multiboot_info_t *mbi)
    4.64      /* We initialise the serial devices very early so we can get debugging. */
    4.65      serial_init_stage1();
    4.66  
    4.67 -    init_console(); 
    4.68 +    init_console();
    4.69      set_printk_prefix("(XEN) ");
    4.70  
    4.71      /* xenheap should be in same TR-covered range with xen image */
    4.72 @@ -201,7 +192,7 @@ void cmain(multiboot_info_t *mbi)
    4.73  	   ia64_boot_param->initrd_size);
    4.74      ia64_boot_param->initrd_start = initial_images_start;
    4.75      printk("Done\n");
    4.76 -    
    4.77 +
    4.78      /* first find highest page frame number */
    4.79      max_page = 0;
    4.80      efi_memmap_walk(find_max_pfn, &max_page);
    4.81 @@ -217,7 +208,7 @@ void cmain(multiboot_info_t *mbi)
    4.82      efi_memmap_walk(filter_rsvd_memory, init_boot_pages);
    4.83      efi_memmap_walk(xen_count_pages, &nr_pages);
    4.84  
    4.85 -    printk("System RAM: %luMB (%lukB)\n", 
    4.86 +    printk("System RAM: %luMB (%lukB)\n",
    4.87  	nr_pages >> (20 - PAGE_SHIFT),
    4.88  	nr_pages << (PAGE_SHIFT - 10));
    4.89  
    4.90 @@ -267,7 +258,7 @@ printk("About to call init_idle_task()\n
    4.91      {
    4.92      int i;
    4.93      for (i = 0; i < CLONE_DOMAIN0; i++) {
    4.94 -    	clones[i] = do_createdomain(i+1, 0);
    4.95 +	clones[i] = do_createdomain(i+1, 0);
    4.96          if ( clones[i] == NULL )
    4.97              panic("Error creating domain0 clone %d\n",i);
    4.98      }
    4.99 @@ -278,9 +269,6 @@ printk("About to call init_idle_task()\n
   4.100  
   4.101      set_bit(DF_PRIVILEGED, &dom0->d_flags);
   4.102  
   4.103 -//printk("About to call shadow_mode_init()\n");
   4.104 -//    shadow_mode_init();
   4.105 -
   4.106      /*
   4.107       * We're going to setup domain0 using the module(s) that we stashed safely
   4.108       * above our heap. The second module, if present, is an initrd ramdisk.
     5.1 --- a/xen/include/asm-ia64/config.h	Tue Apr 26 22:24:29 2005 +0000
     5.2 +++ b/xen/include/asm-ia64/config.h	Thu Apr 28 17:02:19 2005 +0000
     5.3 @@ -116,6 +116,9 @@ struct page;
     5.4  // avoid redefining task_t in asm/thread_info.h
     5.5  #define task_t	struct domain
     5.6  
     5.7 +// avoid redefining task_struct in asm/current.h
     5.8 +#define task_struct exec_domain
     5.9 +
    5.10  // linux/include/asm-ia64/machvec.h (linux/arch/ia64/lib/io.c)
    5.11  #define platform_inb	__ia64_inb
    5.12  #define platform_inw	__ia64_inw
    5.13 @@ -177,8 +180,6 @@ struct pci_bus_region {
    5.14  	unsigned long end;
    5.15  };
    5.16  
    5.17 -// from linux/include/linux/module.h
    5.18 -
    5.19  // warning: unless search_extable is declared, the return value gets
    5.20  // truncated to 32-bits, causing a very strange error in privop handling
    5.21  struct exception_table_entry;
    5.22 @@ -232,7 +233,9 @@ void sort_main_extable(void);
    5.23  
    5.24  #define ARCH_HAS_EXEC_DOMAIN_MM_PTR
    5.25  
    5.26 -// see arch/x86/nmi.c !?!?
    5.27 +// from include/linux/preempt.h (needs including from interrupt.h or smp.h)
    5.28 +#define preempt_enable()	do { } while (0)
    5.29 +#define preempt_disable()	do { } while (0)
    5.30  
    5.31  // these declarations got moved at some point, find a better place for them
    5.32  extern int opt_noht;