diff options
| -rw-r--r-- | driver/Makefile | 22 | ||||
| -rw-r--r-- | driver/base.c | 2 | 
2 files changed, 22 insertions, 2 deletions
| diff --git a/driver/Makefile b/driver/Makefile index 9eedc1e..ac4a14c 100644 --- a/driver/Makefile +++ b/driver/Makefile @@ -9,7 +9,27 @@ PWD := $(shell pwd)  EXTRA_CFLAGS += -I$(M)/..  default: -	$(MAKE) $(CFLAGS) -C $(KERNELDIR) M=$(PWD) modules +	@KERNEL_GCC_VERSION=`cat /proc/version | head -n1 | cut -d " " -f 7` ;\ +	GCC_VERSION=`$(CC) --version | head -n 1 | awk 'BEGIN { FPAT = "([^[:space:]]*)|(\\\\([^)]+\\\\))" } { print $$3 }'` ;\ +	if [ $$KERNEL_GCC_VERSION != $$GCC_VERSION ]; then \ +	    echo "Kernel is compiled with gcc $$KERNEL_GCC_VERSION, but you are now using $$GCC_VERSION" ;\ +	    GCC_MAJOR=`echo $$KERNEL_GCC_VERSION | cut -d "." -f 1-2` ;\ +	    newCC=gcc-$$GCC_MAJOR ;\ +	    CC=`which $$newCC 2>/dev/null` ;\ +	    if [ $$? -ne 0 ]; then \ +		echo "No compiler of $$GCC_MAJOR series is installed" ;\ +		exit 1 ;\ +	    fi ;\ +	    GCC_VERSION=`$$CC --version | head -n 1 | awk 'BEGIN { FPAT = "([^[:space:]]*)|(\\\\([^)]+\\\\))" } { print $$3 }'` ;\ +	    if [ $$KERNEL_GCC_VERSION != $$GCC_VERSION ]; then \ +		echo "The $$GCC_VERSION of $$GCC_MAJOR series is installed" ;\ +		exit 1 ;\ +	    fi ;\ +	    echo "Setting CC to $$newCC" ;\ +	else \ +	    CC=$(CC) ;\ +	fi ;\ +	$(MAKE) $(CFLAGS) -C $(KERNELDIR) M=$(PWD) CC=$$CC modules  install:  	@mkdir -p $(INSTALLDIR) diff --git a/driver/base.c b/driver/base.c index 8215660..58eb825 100644 --- a/driver/base.c +++ b/driver/base.c @@ -325,7 +325,7 @@ static int __devinit pcidriver_probe(struct pci_dev *pdev, const struct pci_devi  	if ((id->vendor == PCIE_XILINX_VENDOR_ID)&&(id->device == PCIE_IPECAMERA_DEVICE_ID)) {  	    pci_set_master(pdev); -	    err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); +	    err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));  	    if (err < 0) {  		printk(KERN_ERR "pci_set_dma_mask failed\n");  		goto probe_dma_fail; | 
