ia64/xen-unstable

changeset 2977:afd6ea676808

bitkeeper revision 1.1159.1.419 (419882e8qNCf7MR9XuW5PlLPZhj-iw)

Merge freefall.cl.cam.ac.uk:/auto/groups/xeno/BK/xen-unstable.bk
into freefall.cl.cam.ac.uk:/auto/groups/xeno/users/cl349/BK/xen.bk-smp
author cl349@freefall.cl.cam.ac.uk
date Mon Nov 15 10:20:24 2004 +0000 (2004-11-15)
parents 912f55644225 ac9c463cbf78
children 0a6a455dfbd3
files .rootkeys linux-2.6.9-xen-sparse/arch/xen/configs/xen0_defconfig linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/floppy.h xen/Rules.mk xen/arch/x86/Rules.mk
line diff
     1.1 --- a/.rootkeys	Sat Nov 13 20:41:38 2004 +0000
     1.2 +++ b/.rootkeys	Mon Nov 15 10:20:24 2004 +0000
     1.3 @@ -214,6 +214,7 @@ 412f47e4RKD-R5IS5gEXvcT8L4v8gA linux-2.6
     1.4  40f56239YAjS52QG2FIAQpHDZAdGHg linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/desc.h
     1.5  4107adf1E5O4ztGHNGMzCCNhcvqNow linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/dma-mapping.h
     1.6  40f5623akIoBsQ3KxSB2kufkbgONXQ linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/fixmap.h
     1.7 +41979925z1MsKU1SfuuheM1IFDQ_bA linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/floppy.h
     1.8  4118b6a418gnL6AZsTdglC92YGqYTg linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/highmem.h
     1.9  40f5623aJVXQwpJMOLE99XgvGsfQ8Q linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/io.h
    1.10  40f5623aKXkBBxgpLx2NcvkncQ1Yyw linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/irq_vectors.h
     2.1 --- a/linux-2.6.9-xen-sparse/arch/xen/configs/xen0_defconfig	Sat Nov 13 20:41:38 2004 +0000
     2.2 +++ b/linux-2.6.9-xen-sparse/arch/xen/configs/xen0_defconfig	Mon Nov 15 10:20:24 2004 +0000
     2.3 @@ -1,7 +1,7 @@
     2.4  #
     2.5  # Automatically generated make config: don't edit
     2.6  # Linux kernel version: 2.6.9-xen0
     2.7 -# Sun Oct 31 21:30:07 2004
     2.8 +# Sun Nov 14 16:55:05 2004
     2.9  #
    2.10  CONFIG_XEN=y
    2.11  CONFIG_ARCH_XEN=y
    2.12 @@ -200,7 +200,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
    2.13  #
    2.14  # Block devices
    2.15  #
    2.16 -# CONFIG_BLK_DEV_FD is not set
    2.17 +CONFIG_BLK_DEV_FD=y
    2.18  # CONFIG_BLK_DEV_XD is not set
    2.19  # CONFIG_BLK_CPQ_DA is not set
    2.20  CONFIG_BLK_CPQ_CISS_DA=y
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/floppy.h	Mon Nov 15 10:20:24 2004 +0000
     3.3 @@ -0,0 +1,222 @@
     3.4 +/*
     3.5 + * Architecture specific parts of the Floppy driver
     3.6 + *
     3.7 + * This file is subject to the terms and conditions of the GNU General Public
     3.8 + * License.  See the file "COPYING" in the main directory of this archive
     3.9 + * for more details.
    3.10 + *
    3.11 + * Copyright (C) 1995
    3.12 + *
    3.13 + * Modifications for Xen are Copyright (c) 2004, Keir Fraser.
    3.14 + */
    3.15 +#ifndef __ASM_XEN_I386_FLOPPY_H
    3.16 +#define __ASM_XEN_I386_FLOPPY_H
    3.17 +
    3.18 +#include <linux/vmalloc.h>
    3.19 +
    3.20 +/* XEN: Hit DMA paths on the head. This trick from asm-m68k/floppy.h. */
    3.21 +#include <asm/dma.h>
    3.22 +#undef MAX_DMA_ADDRESS
    3.23 +#define MAX_DMA_ADDRESS 0
    3.24 +#define CROSS_64KB(a,s) (0)
    3.25 +
    3.26 +#define fd_inb(port)			inb_p(port)
    3.27 +#define fd_outb(value,port)		outb_p(value,port)
    3.28 +
    3.29 +#define fd_request_dma()        (0)
    3.30 +#define fd_free_dma()           ((void)0)
    3.31 +#define fd_enable_irq()         enable_irq(FLOPPY_IRQ)
    3.32 +#define fd_disable_irq()        disable_irq(FLOPPY_IRQ)
    3.33 +#define fd_free_irq()		free_irq(FLOPPY_IRQ, NULL)
    3.34 +#define fd_get_dma_residue()    vdma_get_dma_residue(FLOPPY_DMA)
    3.35 +#define fd_dma_mem_alloc(size)	vdma_mem_alloc(size)
    3.36 +#define fd_dma_mem_free(addr, size) vdma_mem_free(addr, size) 
    3.37 +#define fd_dma_setup(addr, size, mode, io) vdma_dma_setup(addr, size, mode, io)
    3.38 +
    3.39 +static int virtual_dma_count;
    3.40 +static int virtual_dma_residue;
    3.41 +static char *virtual_dma_addr;
    3.42 +static int virtual_dma_mode;
    3.43 +static int doing_pdma;
    3.44 +
    3.45 +static irqreturn_t floppy_hardint(int irq, void *dev_id, struct pt_regs * regs)
    3.46 +{
    3.47 +	register unsigned char st;
    3.48 +
    3.49 +#undef TRACE_FLPY_INT
    3.50 +#define NO_FLOPPY_ASSEMBLER
    3.51 +
    3.52 +#ifdef TRACE_FLPY_INT
    3.53 +	static int calls=0;
    3.54 +	static int bytes=0;
    3.55 +	static int dma_wait=0;
    3.56 +#endif
    3.57 +	if (!doing_pdma)
    3.58 +		return floppy_interrupt(irq, dev_id, regs);
    3.59 +
    3.60 +#ifdef TRACE_FLPY_INT
    3.61 +	if(!calls)
    3.62 +		bytes = virtual_dma_count;
    3.63 +#endif
    3.64 +
    3.65 +#ifndef NO_FLOPPY_ASSEMBLER
    3.66 +	__asm__ (
    3.67 +       "testl %1,%1"
    3.68 +	"je 3f"
    3.69 +"1:	inb %w4,%b0"
    3.70 +	"andb $160,%b0"
    3.71 +	"cmpb $160,%b0"
    3.72 +	"jne 2f"
    3.73 +	"incw %w4"
    3.74 +	"testl %3,%3"
    3.75 +	"jne 4f"
    3.76 +	"inb %w4,%b0"
    3.77 +	"movb %0,(%2)"
    3.78 +	"jmp 5f"
    3.79 +"4:    	movb (%2),%0"
    3.80 +	"outb %b0,%w4"
    3.81 +"5:	decw %w4"
    3.82 +	"outb %0,$0x80"
    3.83 +	"decl %1"
    3.84 +	"incl %2"
    3.85 +	"testl %1,%1"
    3.86 +	"jne 1b"
    3.87 +"3:	inb %w4,%b0"
    3.88 +"2:	"
    3.89 +       : "=a" ((char) st), 
    3.90 +       "=c" ((long) virtual_dma_count), 
    3.91 +       "=S" ((long) virtual_dma_addr)
    3.92 +       : "b" ((long) virtual_dma_mode),
    3.93 +       "d" ((short) virtual_dma_port+4), 
    3.94 +       "1" ((long) virtual_dma_count),
    3.95 +       "2" ((long) virtual_dma_addr));
    3.96 +#else	
    3.97 +	{
    3.98 +		register int lcount;
    3.99 +		register char *lptr;
   3.100 +
   3.101 +		st = 1;
   3.102 +		for(lcount=virtual_dma_count, lptr=virtual_dma_addr; 
   3.103 +		    lcount; lcount--, lptr++) {
   3.104 +			st=inb(virtual_dma_port+4) & 0xa0 ;
   3.105 +			if(st != 0xa0) 
   3.106 +				break;
   3.107 +			if(virtual_dma_mode)
   3.108 +				outb_p(*lptr, virtual_dma_port+5);
   3.109 +			else
   3.110 +				*lptr = inb_p(virtual_dma_port+5);
   3.111 +		}
   3.112 +		virtual_dma_count = lcount;
   3.113 +		virtual_dma_addr = lptr;
   3.114 +		st = inb(virtual_dma_port+4);
   3.115 +	}
   3.116 +#endif
   3.117 +
   3.118 +#ifdef TRACE_FLPY_INT
   3.119 +	calls++;
   3.120 +#endif
   3.121 +	if(st == 0x20)
   3.122 +		return IRQ_HANDLED;
   3.123 +	if(!(st & 0x20)) {
   3.124 +		virtual_dma_residue += virtual_dma_count;
   3.125 +		virtual_dma_count=0;
   3.126 +#ifdef TRACE_FLPY_INT
   3.127 +		printk("count=%x, residue=%x calls=%d bytes=%d dma_wait=%d\n", 
   3.128 +		       virtual_dma_count, virtual_dma_residue, calls, bytes,
   3.129 +		       dma_wait);
   3.130 +		calls = 0;
   3.131 +		dma_wait=0;
   3.132 +#endif
   3.133 +		doing_pdma = 0;
   3.134 +		floppy_interrupt(irq, dev_id, regs);
   3.135 +		return IRQ_HANDLED;
   3.136 +	}
   3.137 +#ifdef TRACE_FLPY_INT
   3.138 +	if(!virtual_dma_count)
   3.139 +		dma_wait++;
   3.140 +#endif
   3.141 +	return IRQ_HANDLED;
   3.142 +}
   3.143 +
   3.144 +static void fd_disable_dma(void)
   3.145 +{
   3.146 +	doing_pdma = 0;
   3.147 +	virtual_dma_residue += virtual_dma_count;
   3.148 +	virtual_dma_count=0;
   3.149 +}
   3.150 +
   3.151 +static int vdma_get_dma_residue(unsigned int dummy)
   3.152 +{
   3.153 +	return virtual_dma_count + virtual_dma_residue;
   3.154 +}
   3.155 +
   3.156 +static int fd_request_irq(void)
   3.157 +{
   3.158 +	return request_irq(FLOPPY_IRQ, floppy_hardint,SA_INTERRUPT,
   3.159 +					   "floppy", NULL);
   3.160 +}
   3.161 +
   3.162 +static unsigned long vdma_mem_alloc(unsigned long size)
   3.163 +{
   3.164 +	return (unsigned long) vmalloc(size);
   3.165 +
   3.166 +}
   3.167 +
   3.168 +static void vdma_mem_free(unsigned long addr, unsigned long size)
   3.169 +{
   3.170 +	vfree((void *)addr);
   3.171 +}
   3.172 +
   3.173 +static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io)
   3.174 +{
   3.175 +	doing_pdma = 1;
   3.176 +	virtual_dma_port = io;
   3.177 +	virtual_dma_mode = (mode  == DMA_MODE_WRITE);
   3.178 +	virtual_dma_addr = addr;
   3.179 +	virtual_dma_count = size;
   3.180 +	virtual_dma_residue = 0;
   3.181 +	return 0;
   3.182 +}
   3.183 +
   3.184 +/* XEN: This trick to force 'virtual DMA' is from include/asm-m68k/floppy.h. */
   3.185 +#define FDC1 xen_floppy_init()
   3.186 +static int FDC2 = -1;
   3.187 +
   3.188 +static int xen_floppy_init(void)
   3.189 +{
   3.190 +	use_virtual_dma = 1;
   3.191 +	can_use_virtual_dma = 1;
   3.192 +	return 0x340;
   3.193 +}
   3.194 +
   3.195 +/*
   3.196 + * Floppy types are stored in the rtc's CMOS RAM and so rtc_lock
   3.197 + * is needed to prevent corrupted CMOS RAM in case "insmod floppy"
   3.198 + * coincides with another rtc CMOS user.		Paul G.
   3.199 + */
   3.200 +#define FLOPPY0_TYPE	({				\
   3.201 +	unsigned long flags;				\
   3.202 +	unsigned char val;				\
   3.203 +	spin_lock_irqsave(&rtc_lock, flags);		\
   3.204 +	val = (CMOS_READ(0x10) >> 4) & 15;		\
   3.205 +	spin_unlock_irqrestore(&rtc_lock, flags);	\
   3.206 +	val;						\
   3.207 +})
   3.208 +
   3.209 +#define FLOPPY1_TYPE	({				\
   3.210 +	unsigned long flags;				\
   3.211 +	unsigned char val;				\
   3.212 +	spin_lock_irqsave(&rtc_lock, flags);		\
   3.213 +	val = CMOS_READ(0x10) & 15;			\
   3.214 +	spin_unlock_irqrestore(&rtc_lock, flags);	\
   3.215 +	val;						\
   3.216 +})
   3.217 +
   3.218 +#define N_FDC 2
   3.219 +#define N_DRIVE 8
   3.220 +
   3.221 +#define FLOPPY_MOTOR_MASK 0xf0
   3.222 +
   3.223 +#define EXTRA_FLOPPY_PARAMS
   3.224 +
   3.225 +#endif /* __ASM_XEN_I386_FLOPPY_H */
     4.1 --- a/xen/Rules.mk	Sat Nov 13 20:41:38 2004 +0000
     4.2 +++ b/xen/Rules.mk	Mon Nov 15 10:20:24 2004 +0000
     4.3 @@ -39,6 +39,8 @@ ALL_OBJS += $(BASEDIR)/arch/$(TARGET_ARC
     4.4  HOSTCC     = gcc
     4.5  HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 
     4.6  
     4.7 +test-gcc-flag = $(shell gcc -v --help 2>&1 | grep -q " $(1) " && echo $(1))
     4.8 +
     4.9  include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk
    4.10  
    4.11  ifneq ($(debug),y)
    4.12 @@ -62,6 +64,8 @@ ifeq ($(trace),y)
    4.13  CFLAGS += -DTRACE_BUFFER
    4.14  endif
    4.15  
    4.16 +CFLAGS := $(strip $(CFLAGS))
    4.17 +
    4.18  %.o: %.c $(HDRS) Makefile
    4.19  	$(CC) $(CFLAGS) -c $< -o $@
    4.20  
     5.1 --- a/xen/arch/x86/Rules.mk	Sat Nov 13 20:41:38 2004 +0000
     5.2 +++ b/xen/arch/x86/Rules.mk	Mon Nov 15 10:20:24 2004 +0000
     5.3 @@ -14,10 +14,14 @@ else
     5.4  x86_32/usercopy.o: CFLAGS += -O1
     5.5  endif
     5.6  
     5.7 -
     5.8  # Prevent floating-point variables from creeping into Xen.
     5.9  CFLAGS  += -msoft-float
    5.10  
    5.11 +# Disable PIE/SSP if GCC supports them. They can break us.
    5.12 +CFLAGS  += $(call test-gcc-flag,-nopie)
    5.13 +CFLAGS  += $(call test-gcc-flag,-fno-stack-protector)
    5.14 +CFLAGS  += $(call test-gcc-flag,-fno-stack-protector-all)
    5.15 +
    5.16  ifeq ($(TARGET_SUBARCH),x86_32)
    5.17  CFLAGS  += -m32 -march=i686
    5.18  LDFLAGS := --oformat elf32-i386