Commit dd46dbcb authored by Luis Fernando Ruiz's avatar Luis Fernando Ruiz

svec: Makefile upgraded

Rubini's 'check-fmc-bus' script added.
vmebridge local includes removed.
parent 2f76fc7f
#!/bin/sh
cd $(dirname $0)
# If this project _and_ fmc-bus are submodules of ../, pick ../fmc-bus
FMC_SUBDIR=$(/bin/pwd)/fmc-bus/kernel
FMC_DOTDOT=$(/bin/pwd)/../fmc-bus/kernel
THIS=$(basename $(/bin/pwd))
if ! test -f ../.gitmodules; then
echo $FMC_SUBDIR
exit 0
fi
if ! grep "submodule \"$THIS\"" ../.gitmodules > /dev/null; then
echo $FMC_SUBDIR
exit 0
fi
if ! grep "submodule \"fmc-bus\"" ../.gitmodules > /dev/null; then
echo $FMC_SUBDIR
exit 0
fi
echo $FMC_DOTDOT
\ No newline at end of file
/**
* \file libvmebus.h
* \brief VME Bus access user library interface
* \author Sbastien Dugu
* \date 04/02/2009
*
* This library gives userspace applications access to the VME bus
*
* Copyright (c) 2009 \em Sbastien \em Dugu
*
* \par License:
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
*/
#ifndef _LIBVMEBUS_H_INCLUDE_
#define _LIBVMEBUS_H_INCLUDE_
#ifdef __cplusplus
extern "C" {
#endif
#include <vmebus.h>
/**
* \brief Swap a 16-bit halfword bytewise
* \param val The 16-bit halfword to swap
*
* \return The swapped value
*
*/
static inline unsigned short swapbe16(unsigned short val)
{
return (((val & 0xff00) >> 8) | ((val & 0xff) << 8));
}
/**
* \brief Swap a 32-bit word bytewise
* \param val The 32-bit word to swap
*
* \return The swapped value
*
*/
static inline unsigned int swapbe32(unsigned int val)
{
return (((val & 0xff000000) >> 24) | ((val & 0xff0000) >> 8) |
((val & 0xff00) << 8) | ((val & 0xff) << 24));
}
extern int vme_bus_error_check(struct vme_mapping *desc);
extern int vme_bus_error_check_clear(struct vme_mapping *desc, __u64 address);
/* VME address space mapping - CES library emulation */
extern unsigned long find_controller(unsigned long vmeaddr, unsigned long len,
unsigned long am, unsigned long offset,
unsigned long size,
struct pdparam_master *param);
extern unsigned long return_controller(struct vme_mapping *desc);
/* VME address space mapping */
extern void *vme_map(struct vme_mapping *, int);
extern int vme_unmap(struct vme_mapping *, int);
/* DMA access */
extern int vme_dma_read(struct vme_dma *);
extern int vme_dma_write(struct vme_dma *);
#ifdef __cplusplus
}
#endif
#endif /* _LIBVMEBUS_H_INCLUDE_ */
This diff is collapsed.
......@@ -4,8 +4,11 @@ KVER ?= 2.6.24.7-rt27
KVER ?= 3.2.33-rt50
LINUX ?= "/acc/sys/$(CPU)/usr/src/kernels/$(KVER)"
ccflags-y += -I $(M)/../include
ccflags-y += -I $(M)/fmc-bus/kernel/include
FMC_DRV ?= $(shell ../check-fmc-bus)
export FMC_DRV
ccflags-y += -I$(FMC_DRV)/include
ccflags-y += -I/acc/dsc/src/drivers/coht/vmebridge/include
ccflags-y += -DDEBUG
KBUILD_EXTRA_SYMBOLS += $(M)/Module.symvers.vme
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment