X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fisdn%2Fhardware%2Feicon%2Fplatform.h;h=2444811e0b3806058c0f3ac57e6cfc898db118e5;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=0457682b0d5b6f808c0e4cd4d2400f0931b229d5;hpb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;p=linux-2.6.git diff --git a/drivers/isdn/hardware/eicon/platform.h b/drivers/isdn/hardware/eicon/platform.h index 0457682b0..2444811e0 100644 --- a/drivers/isdn/hardware/eicon/platform.h +++ b/drivers/isdn/hardware/eicon/platform.h @@ -1,4 +1,4 @@ -/* $Id: platform.h,v 1.37.4.2 2004/08/28 20:03:53 armin Exp $ +/* $Id: platform.h,v 1.37.4.6 2005/01/31 12:22:20 armin Exp $ * * platform.h * @@ -18,7 +18,6 @@ #define DIVA_BUILD "local" #endif -#include #include #include #include @@ -84,14 +83,6 @@ #define NULL ((void *) 0) #endif -#ifndef MIN -#define MIN(a,b) ((a)>(b) ? (b) : (a)) -#endif - -#ifndef MAX -#define MAX(a,b) ((a)>(b) ? (a) : (b)) -#endif - #ifndef far #define far #endif @@ -195,9 +186,7 @@ static __inline__ void* diva_os_malloc (unsigned long flags, unsigned long size) } static __inline__ void diva_os_free (unsigned long flags, void* ptr) { - if (ptr) { - vfree(ptr); - } + vfree(ptr); } /* @@ -235,12 +224,12 @@ int diva_os_register_io_port (void *adapter, int register, unsigned long port, /* ** I/O port access abstraction */ -byte inpp (void*); -word inppw (void*); -void inppw_buffer (void*, void*, int); -void outppw (void*, word); -void outppw_buffer (void* , void*, int); -void outpp (void*, word); +byte inpp (void __iomem *); +word inppw (void __iomem *); +void inppw_buffer (void __iomem *, void*, int); +void outppw (void __iomem *, word); +void outppw_buffer (void __iomem * , void*, int); +void outpp (void __iomem *, word); /* ** IRQ @@ -335,13 +324,35 @@ diva_os_atomic_decrement(diva_os_atomic_t* pv) /* ** endian macros +** +** If only... In some cases we did use them for endianness conversion; +** unfortunately, other uses were real iomem accesses. */ +#define READ_BYTE(addr) readb(addr) #define READ_WORD(addr) readw(addr) #define READ_DWORD(addr) readl(addr) +#define WRITE_BYTE(addr,v) writeb(v,addr) #define WRITE_WORD(addr,v) writew(v,addr) #define WRITE_DWORD(addr,v) writel(v,addr) +static inline __u16 GET_WORD(void *addr) +{ + return le16_to_cpu(*(__le16 *)addr); +} +static inline __u32 GET_DWORD(void *addr) +{ + return le32_to_cpu(*(__le32 *)addr); +} +static inline void PUT_WORD(void *addr, __u16 v) +{ + *(__le16 *)addr = cpu_to_le16(v); +} +static inline void PUT_DWORD(void *addr, __u32 v) +{ + *(__le32 *)addr = cpu_to_le32(v); +} + /* ** 32/64 bit macors */