mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
Merge branch 'linux-2.6' into for-linus
This commit is contained in:
commit
79acbb3ff2
2661 changed files with 91526 additions and 34697 deletions
|
|
@ -357,7 +357,7 @@ struct device *acpi_get_physical_device(acpi_handle);
|
|||
/* helper */
|
||||
acpi_handle acpi_get_child(acpi_handle, acpi_integer);
|
||||
acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
|
||||
#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->firmware_data))
|
||||
#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle))
|
||||
|
||||
#endif /* CONFIG_ACPI */
|
||||
|
||||
|
|
|
|||
|
|
@ -7,21 +7,20 @@
|
|||
* This is a version of ip_compute_csum() optimized for IP headers,
|
||||
* which always checksum on 4 octet boundaries.
|
||||
*/
|
||||
extern unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl);
|
||||
extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
|
||||
|
||||
/*
|
||||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
extern unsigned short int csum_tcpudp_magic(unsigned long saddr,
|
||||
unsigned long daddr,
|
||||
extern __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
unsigned int sum);
|
||||
__wsum sum);
|
||||
|
||||
unsigned int csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr,
|
||||
__wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
|
||||
unsigned short len, unsigned short proto,
|
||||
unsigned int sum);
|
||||
__wsum sum);
|
||||
|
||||
/*
|
||||
* computes the checksum of a memory block at buff, length len,
|
||||
|
|
@ -35,7 +34,7 @@ unsigned int csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr,
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
|
||||
extern __wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
|
|
@ -44,9 +43,9 @@ extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned i
|
|||
* here even more important to align src and dst on a 32-bit (or even
|
||||
* better 64-bit) boundary
|
||||
*/
|
||||
unsigned int csum_partial_copy_from_user(const char __user *src, char *dst, int len, unsigned int sum, int *errp);
|
||||
__wsum csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *errp);
|
||||
|
||||
unsigned int csum_partial_copy_nocheck(const char *src, char *dst, int len, unsigned int sum);
|
||||
__wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -54,24 +53,23 @@ unsigned int csum_partial_copy_nocheck(const char *src, char *dst, int len, unsi
|
|||
* in icmp.c
|
||||
*/
|
||||
|
||||
extern unsigned short ip_compute_csum(unsigned char * buff, int len);
|
||||
extern __sum16 ip_compute_csum(const void *buff, int len);
|
||||
|
||||
/*
|
||||
* Fold a partial checksum without adding pseudo headers
|
||||
*/
|
||||
|
||||
static inline unsigned short csum_fold(unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum csum)
|
||||
{
|
||||
u32 sum = (__force u32)csum;
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
return ~sum;
|
||||
return (__force __sum16)~sum;
|
||||
}
|
||||
|
||||
#define _HAVE_ARCH_IPV6_CSUM
|
||||
extern unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
|
||||
struct in6_addr *daddr,
|
||||
__u32 len,
|
||||
unsigned short proto,
|
||||
unsigned int sum);
|
||||
|
||||
extern __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||
const struct in6_addr *daddr,
|
||||
__u32 len, unsigned short proto,
|
||||
__wsum sum);
|
||||
#endif
|
||||
|
|
|
|||
7
include/asm-alpha/device.h
Normal file
7
include/asm-alpha/device.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
|
|
@ -27,9 +27,9 @@ void __outw(u16 val, unsigned int port);
|
|||
u32 __inl(unsigned int port);
|
||||
void __outl(u32 val, unsigned int port);
|
||||
|
||||
u8 __readb(void __iomem *addr);
|
||||
u16 __readw(void __iomem *addr);
|
||||
u32 __readl(void __iomem *addr);
|
||||
u8 __readb(const volatile void __iomem *addr);
|
||||
u16 __readw(const volatile void __iomem *addr);
|
||||
u32 __readl(const volatile void __iomem *addr);
|
||||
|
||||
void __writeb(u8 val, void __iomem *addr);
|
||||
void __writew(u16 val, void __iomem *addr);
|
||||
|
|
@ -64,8 +64,14 @@ void __writel(u32 val, void __iomem *addr);
|
|||
#define writew(v,b) __writew(v,b)
|
||||
#define writel(v,b) __writel(v,b)
|
||||
|
||||
#define __arch_ioremap(cookie,sz,c) ((void __iomem *)(cookie))
|
||||
#define __arch_iounmap(cookie) do { } while (0)
|
||||
static inline void __iomem *__arch_ioremap(unsigned long cookie, size_t size,
|
||||
unsigned int flags)
|
||||
{
|
||||
return (void __iomem *)cookie;
|
||||
}
|
||||
|
||||
#define __arch_ioremap __arch_ioremap
|
||||
#define __arch_iounmap(cookie) do { } while (0)
|
||||
|
||||
extern void insb(unsigned int port, void *buf, int sz);
|
||||
extern void insw(unsigned int port, void *buf, int sz);
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
#define IRQ_TO_GPIO(i) (((i) < IRQ_GPIO(2)) ? ((i) - IRQ_GPIO0) : IRQ_TO_GPIO_2_x(i))
|
||||
|
||||
#if defined(CONFIG_PXA25x)
|
||||
#define PXA_LAST_GPIO 80
|
||||
#define PXA_LAST_GPIO 84
|
||||
#elif defined(CONFIG_PXA27x)
|
||||
#define PXA_LAST_GPIO 127
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1681,6 +1681,7 @@
|
|||
#define SSSR_TINT (1 << 19) /* Receiver Time-out Interrupt */
|
||||
#define SSSR_PINT (1 << 18) /* Peripheral Trailing Byte Interrupt */
|
||||
|
||||
#define SSPSP_FSRT (1 << 25) /* Frame Sync Relative Timing */
|
||||
#define SSPSP_DMYSTOP(x) (x << 23) /* Dummy Stop */
|
||||
#define SSPSP_SFRMWDTH(x) (x << 16) /* Serial Frame Width */
|
||||
#define SSPSP_SFRMDLY(x) (x << 9) /* Serial Frame Delay */
|
||||
|
|
@ -2241,7 +2242,7 @@
|
|||
|
||||
#define CICR1_TBIT (1 << 31) /* Transparency bit */
|
||||
#define CICR1_RGBT_CONV (0x3 << 30) /* RGBT conversion mask */
|
||||
#define CICR1_PPL (0x3f << 15) /* Pixels per line mask */
|
||||
#define CICR1_PPL (0x7ff << 15) /* Pixels per line mask */
|
||||
#define CICR1_RGB_CONV (0x7 << 12) /* RGB conversion mask */
|
||||
#define CICR1_RGB_F (1 << 11) /* RGB format */
|
||||
#define CICR1_YCBCR_F (1 << 10) /* YCbCr format */
|
||||
|
|
@ -2267,7 +2268,7 @@
|
|||
#define CICR3_VSW (0x3f << 10) /* Vertical sync pulse width mask */
|
||||
#define CICR3_BFPW (0x3f << 3) /* Beginning-of-frame pixel clock
|
||||
wait count mask */
|
||||
#define CICR3_LPF (0x3ff << 0) /* Lines per frame mask */
|
||||
#define CICR3_LPF (0x7ff << 0) /* Lines per frame mask */
|
||||
|
||||
#define CICR4_MCLK_DLY (0x3 << 24) /* MCLK Data Capture Delay mask */
|
||||
#define CICR4_PCLK_EN (1 << 23) /* Pixel clock enable */
|
||||
|
|
@ -2288,8 +2289,8 @@
|
|||
#define CISR_EOL (1 << 8) /* End of line */
|
||||
#define CISR_PAR_ERR (1 << 7) /* Parity error */
|
||||
#define CISR_CQD (1 << 6) /* Camera interface quick disable */
|
||||
#define CISR_SOF (1 << 5) /* Start of frame */
|
||||
#define CISR_CDD (1 << 4) /* Camera interface disable done */
|
||||
#define CISR_CDD (1 << 5) /* Camera interface disable done */
|
||||
#define CISR_SOF (1 << 4) /* Start of frame */
|
||||
#define CISR_EOF (1 << 3) /* End of frame */
|
||||
#define CISR_IFO_2 (1 << 2) /* FIFO overrun for Channel 2 */
|
||||
#define CISR_IFO_1 (1 << 1) /* FIFO overrun for Channel 1 */
|
||||
|
|
|
|||
|
|
@ -4,23 +4,8 @@
|
|||
* This supports machine-specific differences in how the PXA2xx
|
||||
* USB Device Controller (UDC) is wired.
|
||||
*
|
||||
* It is set in linux/arch/arm/mach-pxa/<machine>.c and used in
|
||||
* the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c
|
||||
*/
|
||||
struct pxa2xx_udc_mach_info {
|
||||
int (*udc_is_connected)(void); /* do we see host? */
|
||||
void (*udc_command)(int cmd);
|
||||
#define PXA2XX_UDC_CMD_CONNECT 0 /* let host see us */
|
||||
#define PXA2XX_UDC_CMD_DISCONNECT 1 /* so host won't see us */
|
||||
|
||||
/* Boards following the design guidelines in the developer's manual,
|
||||
* with on-chip GPIOs not Lubbock's wierd hardware, can have a sane
|
||||
* VBUS IRQ and omit the methods above. Store the GPIO number
|
||||
* here; for GPIO 0, also mask in one of the pxa_gpio_mode() bits.
|
||||
*/
|
||||
u16 gpio_vbus; /* high == vbus present */
|
||||
u16 gpio_pullup; /* high == pullup activated */
|
||||
};
|
||||
#include <asm/mach/udc_pxa2xx.h>
|
||||
|
||||
extern void pxa_set_udc_info(struct pxa2xx_udc_mach_info *info);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,20 @@
|
|||
#define GPIO_JORNADA720_KEYBOARD_IRQ IRQ_GPIO0
|
||||
#define GPIO_JORNADA720_MOUSE_IRQ IRQ_GPIO9
|
||||
|
||||
/* MCU COMMANDS */
|
||||
#define MCU_GetBatteryData 0xc0
|
||||
#define MCU_GetScanKeyCode 0x90
|
||||
#define MCU_GetTouchSamples 0xa0
|
||||
#define MCU_GetContrast 0xD0
|
||||
#define MCU_SetContrast 0xD1
|
||||
#define MCU_GetBrightness 0xD2
|
||||
#define MCU_SetBrightness 0xD3
|
||||
#define MCU_ContrastOff 0xD8
|
||||
#define MCU_BrightnessOff 0xD9
|
||||
#define MCU_PWMOFF 0xDF
|
||||
#define MCU_TxDummy 0x11
|
||||
#define MCU_ErrorCode 0x00
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
void jornada720_mcu_init(void);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
|
||||
__wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
|
|
@ -33,26 +33,18 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
|
|||
* better 64-bit) boundary
|
||||
*/
|
||||
|
||||
unsigned int
|
||||
csum_partial_copy_nocheck(const char *src, char *dst, int len, int sum);
|
||||
__wsum
|
||||
csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
|
||||
|
||||
unsigned int
|
||||
csum_partial_copy_from_user(const char __user *src, char *dst, int len, int sum, int *err_ptr);
|
||||
|
||||
/*
|
||||
* This is the old (and unsafe) way of doing checksums, a warning message will
|
||||
* be printed if it is used and an exception occurs.
|
||||
*
|
||||
* this functions should go away after some time.
|
||||
*/
|
||||
#define csum_partial_copy(src,dst,len,sum) csum_partial_copy_nocheck(src,dst,len,sum)
|
||||
__wsum
|
||||
csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr);
|
||||
|
||||
/*
|
||||
* This is a version of ip_compute_csum() optimized for IP headers,
|
||||
* which always checksum on 4 octet boundaries.
|
||||
*/
|
||||
static inline unsigned short
|
||||
ip_fast_csum(unsigned char * iph, unsigned int ihl)
|
||||
static inline __sum16
|
||||
ip_fast_csum(const void *iph, unsigned int ihl)
|
||||
{
|
||||
unsigned int sum, tmp1;
|
||||
|
||||
|
|
@ -78,14 +70,13 @@ ip_fast_csum(unsigned char * iph, unsigned int ihl)
|
|||
: "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1)
|
||||
: "1" (iph), "2" (ihl)
|
||||
: "cc", "memory");
|
||||
return sum;
|
||||
return (__force __sum16)sum;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fold a partial checksum without adding pseudo headers
|
||||
*/
|
||||
static inline unsigned int
|
||||
csum_fold(unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
"adds %0, %1, %1, lsl #16 @ csum_fold \n\
|
||||
|
|
@ -93,21 +84,25 @@ csum_fold(unsigned int sum)
|
|||
: "=r" (sum)
|
||||
: "r" (sum)
|
||||
: "cc");
|
||||
return (~sum) >> 16;
|
||||
return (__force __sum16)(~(__force u32)sum >> 16);
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
||||
unsigned int proto, unsigned int sum)
|
||||
static inline __wsum
|
||||
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
"adds %0, %1, %2 @ csum_tcpudp_nofold \n\
|
||||
adcs %0, %0, %3 \n\
|
||||
adcs %0, %0, %4 \n\
|
||||
adcs %0, %0, %5 \n\
|
||||
adcs %0, %0, %3 \n"
|
||||
#ifdef __ARMEB__
|
||||
"adcs %0, %0, %4 \n"
|
||||
#else
|
||||
"adcs %0, %0, %4, lsl #8 \n"
|
||||
#endif
|
||||
"adcs %0, %0, %5 \n\
|
||||
adc %0, %0, #0"
|
||||
: "=&r"(sum)
|
||||
: "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto))
|
||||
: "r" (sum), "r" (daddr), "r" (saddr), "r" (len), "Ir" (htons(proto))
|
||||
: "cc");
|
||||
return sum;
|
||||
}
|
||||
|
|
@ -115,23 +110,27 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
static inline unsigned short int
|
||||
csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
||||
unsigned int proto, unsigned int sum)
|
||||
static inline __sum16
|
||||
csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
"adds %0, %1, %2 @ csum_tcpudp_magic \n\
|
||||
adcs %0, %0, %3 \n\
|
||||
adcs %0, %0, %4 \n\
|
||||
adcs %0, %0, %5 \n\
|
||||
adcs %0, %0, %3 \n"
|
||||
#ifdef __ARMEB__
|
||||
"adcs %0, %0, %4 \n"
|
||||
#else
|
||||
"adcs %0, %0, %4, lsl #8 \n"
|
||||
#endif
|
||||
"adcs %0, %0, %5 \n\
|
||||
adc %0, %0, #0 \n\
|
||||
adds %0, %0, %0, lsl #16 \n\
|
||||
addcs %0, %0, #0x10000 \n\
|
||||
mvn %0, %0"
|
||||
: "=&r"(sum)
|
||||
: "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto))
|
||||
: "r" (sum), "r" (daddr), "r" (saddr), "r" (len), "Ir" (htons(proto))
|
||||
: "cc");
|
||||
return sum >> 16;
|
||||
return (__force __sum16)((__force u32)sum >> 16);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -139,20 +138,20 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
* this routine is used for miscellaneous IP-like checksums, mainly
|
||||
* in icmp.c
|
||||
*/
|
||||
static inline unsigned short
|
||||
ip_compute_csum(unsigned char * buff, int len)
|
||||
static inline __sum16
|
||||
ip_compute_csum(const void *buff, int len)
|
||||
{
|
||||
return csum_fold(csum_partial(buff, len, 0));
|
||||
}
|
||||
|
||||
#define _HAVE_ARCH_IPV6_CSUM
|
||||
extern unsigned long
|
||||
__csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u32 len,
|
||||
__u32 proto, unsigned int sum);
|
||||
extern __wsum
|
||||
__csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __be32 len,
|
||||
__be32 proto, __wsum sum);
|
||||
|
||||
static inline unsigned short int
|
||||
csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u32 len,
|
||||
unsigned short proto, unsigned int sum)
|
||||
static inline __sum16
|
||||
csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __u32 len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
return csum_fold(__csum_ipv6_magic(saddr, daddr, htonl(len),
|
||||
htonl(proto), sum));
|
||||
|
|
|
|||
7
include/asm-arm/device.h
Normal file
7
include/asm-arm/device.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
|
|
@ -12,6 +12,10 @@
|
|||
* uncached, unwrite-buffered mapped memory space for use with DMA
|
||||
* devices. This is the "generic" version. The PCI specific version
|
||||
* is in pci.h
|
||||
*
|
||||
* Note: Drivers should NOT use this function directly, as it will break
|
||||
* platforms with CONFIG_DMABOUNCE.
|
||||
* Use the driver DMA support - see dma-mapping.h (dma_sync_*)
|
||||
*/
|
||||
extern void consistent_sync(void *kaddr, size_t size, int rw);
|
||||
|
||||
|
|
|
|||
26
include/asm-arm/mach/udc_pxa2xx.h
Normal file
26
include/asm-arm/mach/udc_pxa2xx.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* linux/include/asm-arm/mach/udc_pxa2xx.h
|
||||
*
|
||||
* This supports machine-specific differences in how the PXA2xx
|
||||
* USB Device Controller (UDC) is wired.
|
||||
*
|
||||
* It is set in linux/arch/arm/mach-pxa/<machine>.c or in
|
||||
* linux/arch/mach-ixp4xx/<machine>.c and used in
|
||||
* the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c
|
||||
*/
|
||||
|
||||
struct pxa2xx_udc_mach_info {
|
||||
int (*udc_is_connected)(void); /* do we see host? */
|
||||
void (*udc_command)(int cmd);
|
||||
#define PXA2XX_UDC_CMD_CONNECT 0 /* let host see us */
|
||||
#define PXA2XX_UDC_CMD_DISCONNECT 1 /* so host won't see us */
|
||||
|
||||
/* Boards following the design guidelines in the developer's manual,
|
||||
* with on-chip GPIOs not Lubbock's wierd hardware, can have a sane
|
||||
* VBUS IRQ and omit the methods above. Store the GPIO number
|
||||
* here; for GPIO 0, also mask in one of the pxa_gpio_mode() bits.
|
||||
*/
|
||||
u16 gpio_vbus; /* high == vbus present */
|
||||
u16 gpio_pullup; /* high == pullup activated */
|
||||
};
|
||||
|
||||
|
|
@ -383,19 +383,19 @@ do { \
|
|||
|
||||
|
||||
#ifdef CONFIG_MMU
|
||||
extern unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n);
|
||||
extern unsigned long __copy_to_user(void __user *to, const void *from, unsigned long n);
|
||||
extern unsigned long __clear_user(void __user *addr, unsigned long n);
|
||||
extern unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n);
|
||||
extern unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n);
|
||||
extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n);
|
||||
#else
|
||||
#define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0)
|
||||
#define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0)
|
||||
#define __clear_user(addr,n) (memset((void __force *)addr, 0, n), 0)
|
||||
#endif
|
||||
|
||||
extern unsigned long __strncpy_from_user(char *to, const char __user *from, unsigned long count);
|
||||
extern unsigned long __strnlen_user(const char __user *s, long n);
|
||||
extern unsigned long __must_check __strncpy_from_user(char *to, const char __user *from, unsigned long count);
|
||||
extern unsigned long __must_check __strnlen_user(const char __user *s, long n);
|
||||
|
||||
static inline unsigned long copy_from_user(void *to, const void __user *from, unsigned long n)
|
||||
static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n)
|
||||
{
|
||||
if (access_ok(VERIFY_READ, from, n))
|
||||
n = __copy_from_user(to, from, n);
|
||||
|
|
@ -404,7 +404,7 @@ static inline unsigned long copy_from_user(void *to, const void __user *from, un
|
|||
return n;
|
||||
}
|
||||
|
||||
static inline unsigned long copy_to_user(void __user *to, const void *from, unsigned long n)
|
||||
static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n)
|
||||
{
|
||||
if (access_ok(VERIFY_WRITE, to, n))
|
||||
n = __copy_to_user(to, from, n);
|
||||
|
|
@ -414,14 +414,14 @@ static inline unsigned long copy_to_user(void __user *to, const void *from, unsi
|
|||
#define __copy_to_user_inatomic __copy_to_user
|
||||
#define __copy_from_user_inatomic __copy_from_user
|
||||
|
||||
static inline unsigned long clear_user(void __user *to, unsigned long n)
|
||||
static inline unsigned long __must_check clear_user(void __user *to, unsigned long n)
|
||||
{
|
||||
if (access_ok(VERIFY_WRITE, to, n))
|
||||
n = __clear_user(to, n);
|
||||
return n;
|
||||
}
|
||||
|
||||
static inline long strncpy_from_user(char *dst, const char __user *src, long count)
|
||||
static inline long __must_check strncpy_from_user(char *dst, const char __user *src, long count)
|
||||
{
|
||||
long res = -EFAULT;
|
||||
if (access_ok(VERIFY_READ, src, 1))
|
||||
|
|
@ -431,7 +431,7 @@ static inline long strncpy_from_user(char *dst, const char __user *src, long cou
|
|||
|
||||
#define strlen_user(s) strnlen_user(s, ~0UL >> 1)
|
||||
|
||||
static inline long strnlen_user(const char __user *s, long n)
|
||||
static inline long __must_check strnlen_user(const char __user *s, long n)
|
||||
{
|
||||
unsigned long res = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
|
||||
__wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
|
|
@ -33,26 +33,18 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
|
|||
* better 64-bit) boundary
|
||||
*/
|
||||
|
||||
unsigned int
|
||||
csum_partial_copy_nocheck(const char *src, char *dst, int len, int sum);
|
||||
__wsum
|
||||
csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
|
||||
|
||||
unsigned int
|
||||
csum_partial_copy_from_user(const char __user *src, char *dst, int len, int sum, int *err_ptr);
|
||||
|
||||
/*
|
||||
* This is the old (and unsafe) way of doing checksums, a warning message will
|
||||
* be printed if it is used and an exception occurs.
|
||||
*
|
||||
* this functions should go away after some time.
|
||||
*/
|
||||
#define csum_partial_copy(src,dst,len,sum) csum_partial_copy_nocheck(src,dst,len,sum)
|
||||
__wsum
|
||||
csum_partial_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr);
|
||||
|
||||
/*
|
||||
* This is a version of ip_compute_csum() optimized for IP headers,
|
||||
* which always checksum on 4 octet boundaries.
|
||||
*/
|
||||
static inline unsigned short
|
||||
ip_fast_csum(unsigned char * iph, unsigned int ihl)
|
||||
static inline __sum16
|
||||
ip_fast_csum(const void *iph, unsigned int ihl)
|
||||
{
|
||||
unsigned int sum, tmp1;
|
||||
|
||||
|
|
@ -78,14 +70,13 @@ ip_fast_csum(unsigned char * iph, unsigned int ihl)
|
|||
: "=r" (sum), "=r" (iph), "=r" (ihl), "=r" (tmp1)
|
||||
: "1" (iph), "2" (ihl)
|
||||
: "cc");
|
||||
return sum;
|
||||
return (__force __sum16)sum;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fold a partial checksum without adding pseudo headers
|
||||
*/
|
||||
static inline unsigned int
|
||||
csum_fold(unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
"adds %0, %1, %1, lsl #16 @ csum_fold \n\
|
||||
|
|
@ -93,12 +84,12 @@ csum_fold(unsigned int sum)
|
|||
: "=r" (sum)
|
||||
: "r" (sum)
|
||||
: "cc");
|
||||
return (~sum) >> 16;
|
||||
return (__force __sum16)(~(__force u32)sum >> 16);
|
||||
}
|
||||
|
||||
static inline unsigned int
|
||||
csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
||||
unsigned int proto, unsigned int sum)
|
||||
static inline __wsum
|
||||
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
"adds %0, %1, %2 @ csum_tcpudp_nofold \n\
|
||||
|
|
@ -107,7 +98,7 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
adcs %0, %0, %5 \n\
|
||||
adc %0, %0, #0"
|
||||
: "=&r"(sum)
|
||||
: "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto))
|
||||
: "r" (sum), "r" (daddr), "r" (saddr), "r" (htons(len)), "Ir" (htons(proto))
|
||||
: "cc");
|
||||
return sum;
|
||||
}
|
||||
|
|
@ -115,9 +106,9 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
static inline unsigned short int
|
||||
csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
||||
unsigned int proto, unsigned int sum)
|
||||
static inline __sum16
|
||||
csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
"adds %0, %1, %2 @ csum_tcpudp_magic \n\
|
||||
|
|
@ -129,9 +120,9 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
addcs %0, %0, #0x10000 \n\
|
||||
mvn %0, %0"
|
||||
: "=&r"(sum)
|
||||
: "r" (sum), "r" (daddr), "r" (saddr), "r" (ntohs(len)), "Ir" (ntohs(proto))
|
||||
: "r" (sum), "r" (daddr), "r" (saddr), "r" (htons(len)), "Ir" (htons(proto))
|
||||
: "cc");
|
||||
return sum >> 16;
|
||||
return (__force __sum16)((__force u32)sum >> 16);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -139,20 +130,20 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
* this routine is used for miscellaneous IP-like checksums, mainly
|
||||
* in icmp.c
|
||||
*/
|
||||
static inline unsigned short
|
||||
ip_compute_csum(unsigned char * buff, int len)
|
||||
static inline __sum16
|
||||
ip_compute_csum(const void *buff, int len)
|
||||
{
|
||||
return csum_fold(csum_partial(buff, len, 0));
|
||||
}
|
||||
|
||||
#define _HAVE_ARCH_IPV6_CSUM
|
||||
extern unsigned long
|
||||
__csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u32 len,
|
||||
__u32 proto, unsigned int sum);
|
||||
extern __wsum
|
||||
__csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __be32 len,
|
||||
__be32 proto, __wsum sum);
|
||||
|
||||
static inline unsigned short int
|
||||
csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u32 len,
|
||||
unsigned short proto, unsigned int sum)
|
||||
static inline __sum16
|
||||
csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr, __u32 len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
return csum_fold(__csum_ipv6_magic(saddr, daddr, htonl(len),
|
||||
htonl(proto), sum));
|
||||
|
|
|
|||
7
include/asm-arm26/device.h
Normal file
7
include/asm-arm26/device.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
|
|||
" stcond %1, %0\n"
|
||||
" brne 1b"
|
||||
: "=&r"(result), "=o"(v->counter)
|
||||
: "m"(v->counter), "ir"(i)
|
||||
: "m"(v->counter), "rKs21"(i)
|
||||
: "cc");
|
||||
|
||||
return result;
|
||||
|
|
@ -58,7 +58,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
|
|||
{
|
||||
int result;
|
||||
|
||||
if (__builtin_constant_p(i))
|
||||
if (__builtin_constant_p(i) && (i >= -1048575) && (i <= 1048576))
|
||||
result = atomic_sub_return(-i, v);
|
||||
else
|
||||
asm volatile(
|
||||
|
|
@ -101,7 +101,7 @@ static inline int atomic_sub_unless(atomic_t *v, int a, int u)
|
|||
" mov %1, 1\n"
|
||||
"1:"
|
||||
: "=&r"(tmp), "=&r"(result), "=o"(v->counter)
|
||||
: "m"(v->counter), "ir"(a), "ir"(u)
|
||||
: "m"(v->counter), "rKs21"(a), "rKs21"(u)
|
||||
: "cc", "memory");
|
||||
|
||||
return result;
|
||||
|
|
@ -121,7 +121,7 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
|
|||
{
|
||||
int tmp, result;
|
||||
|
||||
if (__builtin_constant_p(a))
|
||||
if (__builtin_constant_p(a) && (a >= -1048575) && (a <= 1048576))
|
||||
result = atomic_sub_unless(v, -a, u);
|
||||
else {
|
||||
result = 0;
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
unsigned int csum_partial(const unsigned char * buff, int len,
|
||||
unsigned int sum);
|
||||
__wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
|
|
@ -30,8 +29,8 @@ unsigned int csum_partial(const unsigned char * buff, int len,
|
|||
* here even more important to align src and dst on a 32-bit (or even
|
||||
* better 64-bit) boundary
|
||||
*/
|
||||
unsigned int csum_partial_copy_generic(const char *src, char *dst, int len,
|
||||
int sum, int *src_err_ptr,
|
||||
__wsum csum_partial_copy_generic(const void *src, void *dst, int len,
|
||||
__wsum sum, int *src_err_ptr,
|
||||
int *dst_err_ptr);
|
||||
|
||||
/*
|
||||
|
|
@ -42,17 +41,17 @@ unsigned int csum_partial_copy_generic(const char *src, char *dst, int len,
|
|||
* verify_area().
|
||||
*/
|
||||
static inline
|
||||
unsigned int csum_partial_copy_nocheck(const char *src, char *dst,
|
||||
int len, int sum)
|
||||
__wsum csum_partial_copy_nocheck(const void *src, void *dst,
|
||||
int len, __wsum sum)
|
||||
{
|
||||
return csum_partial_copy_generic(src, dst, len, sum, NULL, NULL);
|
||||
}
|
||||
|
||||
static inline
|
||||
unsigned int csum_partial_copy_from_user (const char __user *src, char *dst,
|
||||
int len, int sum, int *err_ptr)
|
||||
__wsum csum_partial_copy_from_user(const void __user *src, void *dst,
|
||||
int len, __wsum sum, int *err_ptr)
|
||||
{
|
||||
return csum_partial_copy_generic((const char __force *)src, dst, len,
|
||||
return csum_partial_copy_generic((const void __force *)src, dst, len,
|
||||
sum, err_ptr, NULL);
|
||||
}
|
||||
|
||||
|
|
@ -60,8 +59,7 @@ unsigned int csum_partial_copy_from_user (const char __user *src, char *dst,
|
|||
* This is a version of ip_compute_csum() optimized for IP headers,
|
||||
* which always checksum on 4 octet boundaries.
|
||||
*/
|
||||
static inline unsigned short ip_fast_csum(unsigned char *iph,
|
||||
unsigned int ihl)
|
||||
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
|
||||
{
|
||||
unsigned int sum, tmp;
|
||||
|
||||
|
|
@ -90,14 +88,14 @@ static inline unsigned short ip_fast_csum(unsigned char *iph,
|
|||
: "=r"(sum), "=r"(iph), "=r"(ihl), "=r"(tmp)
|
||||
: "1"(iph), "2"(ihl)
|
||||
: "memory", "cc");
|
||||
return sum;
|
||||
return (__force __sum16)sum;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fold a partial checksum
|
||||
*/
|
||||
|
||||
static inline unsigned int csum_fold(unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum sum)
|
||||
{
|
||||
unsigned int tmp;
|
||||
|
||||
|
|
@ -109,21 +107,20 @@ static inline unsigned int csum_fold(unsigned int sum)
|
|||
: "=&r"(sum), "=&r"(tmp)
|
||||
: "0"(sum));
|
||||
|
||||
return ~sum;
|
||||
return (__force __sum16)~sum;
|
||||
}
|
||||
|
||||
static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
|
||||
unsigned long daddr,
|
||||
static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
__wsum sum)
|
||||
{
|
||||
asm(" add %0, %1\n"
|
||||
" adc %0, %0, %2\n"
|
||||
" adc %0, %0, %3\n"
|
||||
" acr %0"
|
||||
: "=r"(sum)
|
||||
: "r"(daddr), "r"(saddr), "r"(ntohs(len) | (proto << 16)),
|
||||
: "r"(daddr), "r"(saddr), "r"(len + proto),
|
||||
"0"(sum)
|
||||
: "cc");
|
||||
|
||||
|
|
@ -134,11 +131,10 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
|
|||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
|
||||
unsigned long daddr,
|
||||
static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
__wsum sum)
|
||||
{
|
||||
return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
|
||||
}
|
||||
|
|
@ -148,7 +144,7 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
|
|||
* in icmp.c
|
||||
*/
|
||||
|
||||
static inline unsigned short ip_compute_csum(unsigned char * buff, int len)
|
||||
static inline __sum16 ip_compute_csum(const void *buff, int len)
|
||||
{
|
||||
return csum_fold(csum_partial(buff, len, 0));
|
||||
}
|
||||
|
|
|
|||
7
include/asm-avr32/device.h
Normal file
7
include/asm-avr32/device.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
|
|
@ -76,6 +76,39 @@ static inline unsigned int readl(const volatile void __iomem *addr)
|
|||
#define readsw(p, d, l) __raw_readsw((unsigned int)p, d, l)
|
||||
#define readsl(p, d, l) __raw_readsl((unsigned int)p, d, l)
|
||||
|
||||
|
||||
/*
|
||||
* io{read,write}{8,16,32} macros in both le (for PCI style consumers) and native be
|
||||
*/
|
||||
#ifndef ioread8
|
||||
|
||||
#define ioread8(p) ({ unsigned int __v = __raw_readb(p); __v; })
|
||||
|
||||
#define ioread16(p) ({ unsigned int __v = le16_to_cpu(__raw_readw(p)); __v; })
|
||||
#define ioread16be(p) ({ unsigned int __v = be16_to_cpu(__raw_readw(p)); __v; })
|
||||
|
||||
#define ioread32(p) ({ unsigned int __v = le32_to_cpu(__raw_readl(p)); __v; })
|
||||
#define ioread32be(p) ({ unsigned int __v = be32_to_cpu(__raw_readl(p)); __v; })
|
||||
|
||||
#define iowrite8(v,p) __raw_writeb(v, p)
|
||||
|
||||
#define iowrite16(v,p) __raw_writew(cpu_to_le16(v), p)
|
||||
#define iowrite16be(v,p) __raw_writew(cpu_to_be16(v), p)
|
||||
|
||||
#define iowrite32(v,p) __raw_writel(cpu_to_le32(v), p)
|
||||
#define iowrite32be(v,p) __raw_writel(cpu_to_be32(v), p)
|
||||
|
||||
#define ioread8_rep(p,d,c) __raw_readsb(p,d,c)
|
||||
#define ioread16_rep(p,d,c) __raw_readsw(p,d,c)
|
||||
#define ioread32_rep(p,d,c) __raw_readsl(p,d,c)
|
||||
|
||||
#define iowrite8_rep(p,s,c) __raw_writesb(p,s,c)
|
||||
#define iowrite16_rep(p,s,c) __raw_writesw(p,s,c)
|
||||
#define iowrite32_rep(p,s,c) __raw_writesl(p,s,c)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* These two are only here because ALSA _thinks_ it needs them...
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -280,9 +280,10 @@
|
|||
#define __NR_sync_file_range 262
|
||||
#define __NR_tee 263
|
||||
#define __NR_vmsplice 264
|
||||
#define __NR_epoll_pwait 265
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define NR_syscalls 265
|
||||
#define NR_syscalls 266
|
||||
|
||||
|
||||
#define __ARCH_WANT_IPC_PARSE_VERSION
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@
|
|||
* to split all of those into 16-bit components, then add.
|
||||
*/
|
||||
|
||||
static inline unsigned int
|
||||
csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
||||
unsigned short proto, unsigned int sum)
|
||||
static inline __wsum
|
||||
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
int res;
|
||||
__wsum res;
|
||||
__asm__ ("add.d %2, %0\n\t"
|
||||
"ax\n\t"
|
||||
"add.d %3, %0\n\t"
|
||||
|
|
@ -21,7 +21,7 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
"ax\n\t"
|
||||
"addq 0, %0\n"
|
||||
: "=r" (res)
|
||||
: "0" (sum), "r" (daddr), "r" (saddr), "r" ((ntohs(len) << 16) + (proto << 8)));
|
||||
: "0" (sum), "r" (daddr), "r" (saddr), "r" ((len + proto) << 8));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@
|
|||
* checksum. Which means it would be necessary to split all those into
|
||||
* 16-bit components and then add.
|
||||
*/
|
||||
static inline unsigned int
|
||||
csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr,
|
||||
unsigned short len, unsigned short proto, unsigned int sum)
|
||||
static inline __wsum
|
||||
csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
|
||||
unsigned short len, unsigned short proto, __wsum sum)
|
||||
{
|
||||
int res;
|
||||
__wsum res;
|
||||
|
||||
__asm__ __volatile__ ("add.d %2, %0\n\t"
|
||||
"addc %3, %0\n\t"
|
||||
|
|
@ -21,7 +21,7 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr,
|
|||
"addc 0, %0\n\t"
|
||||
: "=r" (res)
|
||||
: "0" (sum), "r" (daddr), "r" (saddr), \
|
||||
"r" ((ntohs(len) << 16) + (proto << 8)));
|
||||
"r" ((len + proto) << 8));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
|
||||
__wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
|
|
@ -27,26 +27,23 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
|
|||
* better 64-bit) boundary
|
||||
*/
|
||||
|
||||
unsigned int csum_partial_copy_nocheck(const char *src, char *dst,
|
||||
int len, unsigned int sum);
|
||||
__wsum csum_partial_copy_nocheck(const void *src, void *dst,
|
||||
int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* Fold a partial checksum into a word
|
||||
*/
|
||||
|
||||
static inline unsigned int csum_fold(unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum csum)
|
||||
{
|
||||
/* the while loop is unnecessary really, it's always enough with two
|
||||
iterations */
|
||||
|
||||
while(sum >> 16)
|
||||
sum = (sum & 0xffff) + (sum >> 16); /* add in end-around carry */
|
||||
|
||||
return ~sum;
|
||||
u32 sum = (__force u32)csum;
|
||||
sum = (sum & 0xffff) + (sum >> 16); /* add in end-around carry */
|
||||
sum = (sum & 0xffff) + (sum >> 16); /* add in end-around carry */
|
||||
return (__force __sum16)~sum;
|
||||
}
|
||||
|
||||
extern unsigned int csum_partial_copy_from_user(const char *src, char *dst,
|
||||
int len, unsigned int sum,
|
||||
extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
|
||||
int len, __wsum sum,
|
||||
int *errptr);
|
||||
|
||||
/*
|
||||
|
|
@ -55,8 +52,7 @@ extern unsigned int csum_partial_copy_from_user(const char *src, char *dst,
|
|||
*
|
||||
*/
|
||||
|
||||
static inline unsigned short ip_fast_csum(unsigned char * iph,
|
||||
unsigned int ihl)
|
||||
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
|
||||
{
|
||||
return csum_fold(csum_partial(iph, ihl * 4, 0));
|
||||
}
|
||||
|
|
@ -66,11 +62,10 @@ static inline unsigned short ip_fast_csum(unsigned char * iph,
|
|||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
|
||||
static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
|
||||
unsigned long daddr,
|
||||
static inline __sum16 int csum_tcpudp_magic(__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
__wsum sum)
|
||||
{
|
||||
return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
|
||||
}
|
||||
|
|
@ -80,7 +75,8 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
|
|||
* in icmp.c
|
||||
*/
|
||||
|
||||
static inline unsigned short ip_compute_csum(unsigned char * buff, int len) {
|
||||
static inline __sum16 ip_compute_csum(const void *buff, int len)
|
||||
{
|
||||
return csum_fold (csum_partial(buff, len, 0));
|
||||
}
|
||||
|
||||
|
|
|
|||
7
include/asm-cris/device.h
Normal file
7
include/asm-cris/device.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
|
||||
__wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
|
|
@ -35,7 +35,7 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
|
|||
* here even more important to align src and dst on a 32-bit (or even
|
||||
* better 64-bit) boundary
|
||||
*/
|
||||
unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum);
|
||||
__wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial_copy, but copies from user space.
|
||||
|
|
@ -43,11 +43,8 @@ unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum);
|
|||
* here even more important to align src and dst on a 32-bit (or even
|
||||
* better 64-bit) boundary
|
||||
*/
|
||||
extern unsigned int csum_partial_copy_from_user(const char __user *src, char *dst,
|
||||
int len, int sum, int *csum_err);
|
||||
|
||||
#define csum_partial_copy_nocheck(src, dst, len, sum) \
|
||||
csum_partial_copy((src), (dst), (len), (sum))
|
||||
extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
|
||||
int len, __wsum sum, int *csum_err);
|
||||
|
||||
/*
|
||||
* This is a version of ip_compute_csum() optimized for IP headers,
|
||||
|
|
@ -55,7 +52,7 @@ extern unsigned int csum_partial_copy_from_user(const char __user *src, char *ds
|
|||
*
|
||||
*/
|
||||
static inline
|
||||
unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl)
|
||||
__sum16 ip_fast_csum(const void *iph, unsigned int ihl)
|
||||
{
|
||||
unsigned int tmp, inc, sum = 0;
|
||||
|
||||
|
|
@ -81,13 +78,13 @@ unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl)
|
|||
: "icc0", "icc1"
|
||||
);
|
||||
|
||||
return ~sum;
|
||||
return (__force __sum16)~sum;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fold a partial checksum
|
||||
*/
|
||||
static inline unsigned int csum_fold(unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum sum)
|
||||
{
|
||||
unsigned int tmp;
|
||||
|
||||
|
|
@ -100,16 +97,16 @@ static inline unsigned int csum_fold(unsigned int sum)
|
|||
: "0"(sum)
|
||||
);
|
||||
|
||||
return ~sum;
|
||||
return (__force __sum16)~sum;
|
||||
}
|
||||
|
||||
/*
|
||||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
static inline unsigned int
|
||||
csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
||||
unsigned short proto, unsigned int sum)
|
||||
static inline __wsum
|
||||
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
asm(" addcc %1,%0,%0,icc0 \n"
|
||||
" addxcc %2,%0,%0,icc0 \n"
|
||||
|
|
@ -122,9 +119,9 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
return sum;
|
||||
}
|
||||
|
||||
static inline unsigned short int
|
||||
csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
||||
unsigned short proto, unsigned int sum)
|
||||
static inline __sum16
|
||||
csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
|
||||
}
|
||||
|
|
@ -133,12 +130,12 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
* this routine is used for miscellaneous IP-like checksums, mainly
|
||||
* in icmp.c
|
||||
*/
|
||||
extern unsigned short ip_compute_csum(const unsigned char * buff, int len);
|
||||
extern __sum16 ip_compute_csum(const void *buff, int len);
|
||||
|
||||
#define _HAVE_ARCH_IPV6_CSUM
|
||||
static inline unsigned short int
|
||||
csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr,
|
||||
__u32 len, unsigned short proto, unsigned int sum)
|
||||
static inline __sum16
|
||||
csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr,
|
||||
__u32 len, unsigned short proto, __wsum sum)
|
||||
{
|
||||
unsigned long tmp, tmp2;
|
||||
|
||||
|
|
@ -177,7 +174,7 @@ csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr,
|
|||
: "icc0"
|
||||
);
|
||||
|
||||
return ~sum;
|
||||
return (__force __sum16)~sum;
|
||||
}
|
||||
|
||||
#endif /* _ASM_CHECKSUM_H */
|
||||
|
|
|
|||
7
include/asm-frv/device.h
Normal file
7
include/asm-frv/device.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
|
|
@ -82,11 +82,11 @@ extern struct page *kmap_atomic_to_page(void *ptr);
|
|||
dampr = paddr | xAMPRx_L | xAMPRx_M | xAMPRx_S | xAMPRx_SS_16Kb | xAMPRx_V; \
|
||||
\
|
||||
if (type != __KM_CACHE) \
|
||||
asm volatile("movgs %0,dampr"#ampr :: "r"(dampr)); \
|
||||
asm volatile("movgs %0,dampr"#ampr :: "r"(dampr) : "memory"); \
|
||||
else \
|
||||
asm volatile("movgs %0,iampr"#ampr"\n" \
|
||||
"movgs %0,dampr"#ampr"\n" \
|
||||
:: "r"(dampr) \
|
||||
:: "r"(dampr) : "memory" \
|
||||
); \
|
||||
\
|
||||
asm("movsg damlr"#ampr",%0" : "=r"(damlr)); \
|
||||
|
|
@ -104,7 +104,7 @@ extern struct page *kmap_atomic_to_page(void *ptr);
|
|||
asm volatile("movgs %0,tplr \n" \
|
||||
"movgs %1,tppr \n" \
|
||||
"tlbpr %0,gr0,#2,#1" \
|
||||
: : "r"(damlr), "r"(dampr)); \
|
||||
: : "r"(damlr), "r"(dampr) : "memory"); \
|
||||
\
|
||||
/*printk("TLB: SECN sl=%d L=%08lx P=%08lx\n", slot, damlr, dampr);*/ \
|
||||
\
|
||||
|
|
@ -115,7 +115,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type)
|
|||
{
|
||||
unsigned long paddr;
|
||||
|
||||
preempt_disable();
|
||||
inc_preempt_count();
|
||||
paddr = page_to_phys(page);
|
||||
|
||||
switch (type) {
|
||||
|
|
@ -138,16 +138,16 @@ static inline void *kmap_atomic(struct page *page, enum km_type type)
|
|||
}
|
||||
}
|
||||
|
||||
#define __kunmap_atomic_primary(type, ampr) \
|
||||
do { \
|
||||
asm volatile("movgs gr0,dampr"#ampr"\n"); \
|
||||
if (type == __KM_CACHE) \
|
||||
asm volatile("movgs gr0,iampr"#ampr"\n"); \
|
||||
#define __kunmap_atomic_primary(type, ampr) \
|
||||
do { \
|
||||
asm volatile("movgs gr0,dampr"#ampr"\n" ::: "memory"); \
|
||||
if (type == __KM_CACHE) \
|
||||
asm volatile("movgs gr0,iampr"#ampr"\n" ::: "memory"); \
|
||||
} while(0)
|
||||
|
||||
#define __kunmap_atomic_secondary(slot, vaddr) \
|
||||
do { \
|
||||
asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr)); \
|
||||
#define __kunmap_atomic_secondary(slot, vaddr) \
|
||||
do { \
|
||||
asm volatile("tlbpr %0,gr0,#4,#1" : : "r"(vaddr) : "memory"); \
|
||||
} while(0)
|
||||
|
||||
static inline void kunmap_atomic(void *kvaddr, enum km_type type)
|
||||
|
|
@ -170,7 +170,8 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type)
|
|||
default:
|
||||
BUG();
|
||||
}
|
||||
preempt_enable();
|
||||
dec_preempt_count();
|
||||
preempt_check_resched();
|
||||
}
|
||||
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
|
|
|||
|
|
@ -37,7 +37,10 @@
|
|||
#endif
|
||||
|
||||
#ifndef HAVE_ARCH_WARN_ON
|
||||
#define WARN_ON(condition) unlikely((condition))
|
||||
#define WARN_ON(condition) ({ \
|
||||
typeof(condition) __ret_warn_on = (condition); \
|
||||
unlikely(__ret_warn_on); \
|
||||
})
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
12
include/asm-generic/device.h
Normal file
12
include/asm-generic/device.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#ifndef _ASM_GENERIC_DEVICE_H
|
||||
#define _ASM_GENERIC_DEVICE_H
|
||||
|
||||
struct dev_archdata {
|
||||
};
|
||||
|
||||
#endif /* _ASM_GENERIC_DEVICE_H */
|
||||
|
|
@ -125,6 +125,10 @@
|
|||
*(__param) \
|
||||
VMLINUX_SYMBOL(__stop___param) = .; \
|
||||
} \
|
||||
\
|
||||
/* Unwind data binary search table */ \
|
||||
EH_FRAME_HDR \
|
||||
\
|
||||
__end_rodata = .; \
|
||||
. = ALIGN(4096);
|
||||
|
||||
|
|
@ -157,6 +161,18 @@
|
|||
*(.kprobes.text) \
|
||||
VMLINUX_SYMBOL(__kprobes_text_end) = .;
|
||||
|
||||
#ifdef CONFIG_STACK_UNWIND
|
||||
/* Unwind data binary search table */
|
||||
#define EH_FRAME_HDR \
|
||||
.eh_frame_hdr : AT(ADDR(.eh_frame_hdr) - LOAD_OFFSET) { \
|
||||
VMLINUX_SYMBOL(__start_unwind_hdr) = .; \
|
||||
*(.eh_frame_hdr) \
|
||||
VMLINUX_SYMBOL(__end_unwind_hdr) = .; \
|
||||
}
|
||||
#else
|
||||
#define EH_FRAME_HDR
|
||||
#endif
|
||||
|
||||
/* DWARF debug sections.
|
||||
Symbols in the DWARF debugging sections are relative to
|
||||
the beginning of the section so we begin them at 0. */
|
||||
|
|
@ -197,3 +213,22 @@
|
|||
|
||||
#define NOTES \
|
||||
.notes : { *(.note.*) } :note
|
||||
|
||||
#define INITCALLS \
|
||||
*(.initcall0.init) \
|
||||
*(.initcall0s.init) \
|
||||
*(.initcall1.init) \
|
||||
*(.initcall1s.init) \
|
||||
*(.initcall2.init) \
|
||||
*(.initcall2s.init) \
|
||||
*(.initcall3.init) \
|
||||
*(.initcall3s.init) \
|
||||
*(.initcall4.init) \
|
||||
*(.initcall4s.init) \
|
||||
*(.initcall5.init) \
|
||||
*(.initcall5s.init) \
|
||||
*(.initcall6.init) \
|
||||
*(.initcall6s.init) \
|
||||
*(.initcall7.init) \
|
||||
*(.initcall7s.init)
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
|
||||
__wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
|
|
@ -23,7 +23,7 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
|
|||
* better 64-bit) boundary
|
||||
*/
|
||||
|
||||
unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum);
|
||||
__wsum csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum);
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -33,20 +33,17 @@ unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum);
|
|||
* better 64-bit) boundary
|
||||
*/
|
||||
|
||||
extern unsigned int csum_partial_copy_from_user(const char *src, char *dst,
|
||||
int len, int sum, int *csum_err);
|
||||
extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
|
||||
int len, __wsum sum, int *csum_err);
|
||||
|
||||
#define csum_partial_copy_nocheck(src, dst, len, sum) \
|
||||
csum_partial_copy((src), (dst), (len), (sum))
|
||||
|
||||
unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl);
|
||||
__sum16 ip_fast_csum(const void *iph, unsigned int ihl);
|
||||
|
||||
|
||||
/*
|
||||
* Fold a partial checksum
|
||||
*/
|
||||
|
||||
static inline unsigned int csum_fold(unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum sum)
|
||||
{
|
||||
__asm__("mov.l %0,er0\n\t"
|
||||
"add.w e0,r0\n\t"
|
||||
|
|
@ -58,7 +55,7 @@ static inline unsigned int csum_fold(unsigned int sum)
|
|||
: "=r"(sum)
|
||||
: "0"(sum)
|
||||
: "er0");
|
||||
return ~sum;
|
||||
return (__force __sum16)~sum;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -67,9 +64,9 @@ static inline unsigned int csum_fold(unsigned int sum)
|
|||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
|
||||
static inline unsigned int
|
||||
csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
||||
unsigned short proto, unsigned int sum)
|
||||
static inline __wsum
|
||||
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
__asm__ ("sub.l er0,er0\n\t"
|
||||
"add.l %2,%0\n\t"
|
||||
|
|
@ -88,9 +85,9 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
return sum;
|
||||
}
|
||||
|
||||
static inline unsigned short int
|
||||
csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
||||
unsigned short proto, unsigned int sum)
|
||||
static inline __sum16
|
||||
csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
|
||||
}
|
||||
|
|
@ -100,6 +97,6 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
* in icmp.c
|
||||
*/
|
||||
|
||||
extern unsigned short ip_compute_csum(const unsigned char * buff, int len);
|
||||
extern __sum16 ip_compute_csum(const void *buff, int len);
|
||||
|
||||
#endif /* _H8300_CHECKSUM_H */
|
||||
|
|
|
|||
7
include/asm-h8300/device.h
Normal file
7
include/asm-h8300/device.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
|
|
@ -132,6 +132,7 @@ extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq);
|
|||
|
||||
#ifdef CONFIG_X86_IO_APIC
|
||||
extern int acpi_skip_timer_override;
|
||||
extern int acpi_use_timer_override;
|
||||
#endif
|
||||
|
||||
static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
asmlinkage unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
|
||||
asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
|
|
@ -27,8 +27,8 @@ asmlinkage unsigned int csum_partial(const unsigned char * buff, int len, unsign
|
|||
* better 64-bit) boundary
|
||||
*/
|
||||
|
||||
asmlinkage unsigned int csum_partial_copy_generic(const unsigned char *src, unsigned char *dst,
|
||||
int len, int sum, int *src_err_ptr, int *dst_err_ptr);
|
||||
asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst,
|
||||
int len, __wsum sum, int *src_err_ptr, int *dst_err_ptr);
|
||||
|
||||
/*
|
||||
* Note: when you get a NULL pointer exception here this means someone
|
||||
|
|
@ -38,18 +38,18 @@ asmlinkage unsigned int csum_partial_copy_generic(const unsigned char *src, unsi
|
|||
* access_ok().
|
||||
*/
|
||||
static __inline__
|
||||
unsigned int csum_partial_copy_nocheck (const unsigned char *src, unsigned char *dst,
|
||||
int len, int sum)
|
||||
__wsum csum_partial_copy_nocheck (const void *src, void *dst,
|
||||
int len, __wsum sum)
|
||||
{
|
||||
return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL);
|
||||
}
|
||||
|
||||
static __inline__
|
||||
unsigned int csum_partial_copy_from_user(const unsigned char __user *src, unsigned char *dst,
|
||||
int len, int sum, int *err_ptr)
|
||||
__wsum csum_partial_copy_from_user(const void __user *src, void *dst,
|
||||
int len, __wsum sum, int *err_ptr)
|
||||
{
|
||||
might_sleep();
|
||||
return csum_partial_copy_generic((__force unsigned char *)src, dst,
|
||||
return csum_partial_copy_generic((__force void *)src, dst,
|
||||
len, sum, err_ptr, NULL);
|
||||
}
|
||||
|
||||
|
|
@ -60,8 +60,7 @@ unsigned int csum_partial_copy_from_user(const unsigned char __user *src, unsign
|
|||
* By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by
|
||||
* Arnt Gulbrandsen.
|
||||
*/
|
||||
static inline unsigned short ip_fast_csum(unsigned char * iph,
|
||||
unsigned int ihl)
|
||||
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
|
||||
{
|
||||
unsigned int sum;
|
||||
|
||||
|
|
@ -89,29 +88,29 @@ static inline unsigned short ip_fast_csum(unsigned char * iph,
|
|||
: "=r" (sum), "=r" (iph), "=r" (ihl)
|
||||
: "1" (iph), "2" (ihl)
|
||||
: "memory");
|
||||
return(sum);
|
||||
return (__force __sum16)sum;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fold a partial checksum
|
||||
*/
|
||||
|
||||
static inline unsigned int csum_fold(unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
"addl %1, %0 ;\n"
|
||||
"adcl $0xffff, %0 ;\n"
|
||||
: "=r" (sum)
|
||||
: "r" (sum << 16), "0" (sum & 0xffff0000)
|
||||
: "r" ((__force u32)sum << 16),
|
||||
"0" ((__force u32)sum & 0xffff0000)
|
||||
);
|
||||
return (~sum) >> 16;
|
||||
return (__force __sum16)(~(__force u32)sum >> 16);
|
||||
}
|
||||
|
||||
static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
|
||||
unsigned long daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
__wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
"addl %1, %0 ;\n"
|
||||
|
|
@ -119,7 +118,7 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
|
|||
"adcl %3, %0 ;\n"
|
||||
"adcl $0, %0 ;\n"
|
||||
: "=r" (sum)
|
||||
: "g" (daddr), "g"(saddr), "g"((ntohs(len)<<16)+proto*256), "0"(sum));
|
||||
: "g" (daddr), "g"(saddr), "g"((len + proto) << 8), "0"(sum));
|
||||
return sum;
|
||||
}
|
||||
|
||||
|
|
@ -127,11 +126,10 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
|
|||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
|
||||
unsigned long daddr,
|
||||
static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
__wsum sum)
|
||||
{
|
||||
return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
|
||||
}
|
||||
|
|
@ -141,17 +139,16 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
|
|||
* in icmp.c
|
||||
*/
|
||||
|
||||
static inline unsigned short ip_compute_csum(unsigned char * buff, int len)
|
||||
static inline __sum16 ip_compute_csum(const void *buff, int len)
|
||||
{
|
||||
return csum_fold (csum_partial(buff, len, 0));
|
||||
}
|
||||
|
||||
#define _HAVE_ARCH_IPV6_CSUM
|
||||
static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
|
||||
struct in6_addr *daddr,
|
||||
__u32 len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||
const struct in6_addr *daddr,
|
||||
__u32 len, unsigned short proto,
|
||||
__wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
"addl 0(%1), %0 ;\n"
|
||||
|
|
@ -176,19 +173,19 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
|
|||
* Copy and checksum to user
|
||||
*/
|
||||
#define HAVE_CSUM_COPY_USER
|
||||
static __inline__ unsigned int csum_and_copy_to_user(const unsigned char *src,
|
||||
unsigned char __user *dst,
|
||||
int len, int sum,
|
||||
static __inline__ __wsum csum_and_copy_to_user(const void *src,
|
||||
void __user *dst,
|
||||
int len, __wsum sum,
|
||||
int *err_ptr)
|
||||
{
|
||||
might_sleep();
|
||||
if (access_ok(VERIFY_WRITE, dst, len))
|
||||
return csum_partial_copy_generic(src, (__force unsigned char *)dst, len, sum, NULL, err_ptr);
|
||||
return csum_partial_copy_generic(src, (__force void *)dst, len, sum, NULL, err_ptr);
|
||||
|
||||
if (len)
|
||||
*err_ptr = -EFAULT;
|
||||
|
||||
return -1; /* invalid checksum */
|
||||
return (__force __wsum)-1; /* invalid checksum */
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
15
include/asm-i386/device.h
Normal file
15
include/asm-i386/device.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#ifndef _ASM_I386_DEVICE_H
|
||||
#define _ASM_I386_DEVICE_H
|
||||
|
||||
struct dev_archdata {
|
||||
#ifdef CONFIG_ACPI
|
||||
void *acpi_handle;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* _ASM_I386_DEVICE_H */
|
||||
|
|
@ -12,10 +12,6 @@
|
|||
|
||||
#ifdef CONFIG_X86_IO_APIC
|
||||
|
||||
#define IO_APIC_BASE(idx) \
|
||||
((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) \
|
||||
+ (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK)))
|
||||
|
||||
/*
|
||||
* The structure of the IO-APIC:
|
||||
*/
|
||||
|
|
@ -119,31 +115,8 @@ extern struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES];
|
|||
/* non-0 if default (table-less) MP configuration */
|
||||
extern int mpc_default_type;
|
||||
|
||||
static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
|
||||
{
|
||||
*IO_APIC_BASE(apic) = reg;
|
||||
return *(IO_APIC_BASE(apic)+4);
|
||||
}
|
||||
|
||||
static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
|
||||
{
|
||||
*IO_APIC_BASE(apic) = reg;
|
||||
*(IO_APIC_BASE(apic)+4) = value;
|
||||
}
|
||||
|
||||
/*
|
||||
* Re-write a value: to be used for read-modify-write
|
||||
* cycles where the read already set up the index register.
|
||||
*
|
||||
* Older SiS APIC requires we rewrite the index regiser
|
||||
*/
|
||||
/* Older SiS APIC requires we rewrite the index register */
|
||||
extern int sis_apic_bug;
|
||||
static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
|
||||
{
|
||||
if (sis_apic_bug)
|
||||
*IO_APIC_BASE(apic) = reg;
|
||||
*(IO_APIC_BASE(apic)+4) = value;
|
||||
}
|
||||
|
||||
/* 1 if "noapic" boot option passed */
|
||||
extern int skip_ioapic_setup;
|
||||
|
|
|
|||
|
|
@ -88,7 +88,11 @@ static inline void clustered_apic_check(void)
|
|||
|
||||
static inline int apicid_to_node(int logical_apicid)
|
||||
{
|
||||
#ifdef CONFIG_SMP
|
||||
return apicid_2_node[hard_smp_processor_id()];
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Mapping from cpu number to logical apicid */
|
||||
|
|
|
|||
|
|
@ -1,53 +0,0 @@
|
|||
/* defines for inline arch setup functions */
|
||||
|
||||
#include <asm/fixmap.h>
|
||||
#include <asm/i8259.h>
|
||||
#include "cobalt.h"
|
||||
|
||||
static inline void do_timer_interrupt_hook(void)
|
||||
{
|
||||
/* Clear the interrupt */
|
||||
co_cpu_write(CO_CPU_STAT,co_cpu_read(CO_CPU_STAT) & ~CO_STAT_TIMEINTR);
|
||||
|
||||
do_timer(1);
|
||||
#ifndef CONFIG_SMP
|
||||
update_process_times(user_mode_vm(irq_regs));
|
||||
#endif
|
||||
/*
|
||||
* In the SMP case we use the local APIC timer interrupt to do the
|
||||
* profiling, except when we simulate SMP mode on a uniprocessor
|
||||
* system, in that case we have to call the local interrupt handler.
|
||||
*/
|
||||
#ifndef CONFIG_X86_LOCAL_APIC
|
||||
profile_tick(CPU_PROFILING);
|
||||
#else
|
||||
if (!using_apic_timer)
|
||||
smp_local_timer_interrupt();
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline int do_timer_overflow(int count)
|
||||
{
|
||||
int i;
|
||||
|
||||
spin_lock(&i8259A_lock);
|
||||
/*
|
||||
* This is tricky when I/O APICs are used;
|
||||
* see do_timer_interrupt().
|
||||
*/
|
||||
i = inb(0x20);
|
||||
spin_unlock(&i8259A_lock);
|
||||
|
||||
/* assumption about timer being IRQ0 */
|
||||
if (i & 0x01) {
|
||||
/*
|
||||
* We cannot detect lost timer interrupts ...
|
||||
* well, that's why we call them lost, don't we? :)
|
||||
* [hmm, on the Pentium and Alpha we can ... sort of]
|
||||
*/
|
||||
count -= LATCH;
|
||||
} else {
|
||||
printk("do_slow_gettimeoffset(): hardware timer problem?\n");
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
|
@ -51,6 +51,11 @@ static inline void clustered_apic_check(void)
|
|||
{
|
||||
}
|
||||
|
||||
static inline int apicid_to_node(int logical_apicid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Mapping from cpu number to logical apicid */
|
||||
static inline int cpu_to_logical_apicid(int cpu)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,23 +10,21 @@
|
|||
* This is a version of ip_compute_csum() optimized for IP headers,
|
||||
* which always checksum on 4 octet boundaries.
|
||||
*/
|
||||
extern unsigned short ip_fast_csum (unsigned char * iph, unsigned int ihl);
|
||||
extern __sum16 ip_fast_csum(const void *iph, unsigned int ihl);
|
||||
|
||||
/*
|
||||
* Computes the checksum of the TCP/UDP pseudo-header returns a 16-bit
|
||||
* checksum, already complemented
|
||||
*/
|
||||
extern unsigned short int csum_tcpudp_magic (unsigned long saddr,
|
||||
unsigned long daddr,
|
||||
extern __sum16 csum_tcpudp_magic (__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
unsigned int sum);
|
||||
__wsum sum);
|
||||
|
||||
extern unsigned int csum_tcpudp_nofold (unsigned long saddr,
|
||||
unsigned long daddr,
|
||||
extern __wsum csum_tcpudp_nofold (__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
unsigned int sum);
|
||||
__wsum sum);
|
||||
|
||||
/*
|
||||
* Computes the checksum of a memory block at buff, length len,
|
||||
|
|
@ -40,8 +38,7 @@ extern unsigned int csum_tcpudp_nofold (unsigned long saddr,
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
extern unsigned int csum_partial (const unsigned char * buff, int len,
|
||||
unsigned int sum);
|
||||
extern __wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* Same as csum_partial, but copies from src while it checksums.
|
||||
|
|
@ -49,28 +46,28 @@ extern unsigned int csum_partial (const unsigned char * buff, int len,
|
|||
* Here it is even more important to align src and dst on a 32-bit (or
|
||||
* even better 64-bit) boundary.
|
||||
*/
|
||||
extern unsigned int csum_partial_copy_from_user (const char *src, char *dst,
|
||||
int len, unsigned int sum,
|
||||
extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
|
||||
int len, __wsum sum,
|
||||
int *errp);
|
||||
|
||||
extern unsigned int csum_partial_copy_nocheck (const char *src, char *dst,
|
||||
int len, unsigned int sum);
|
||||
extern __wsum csum_partial_copy_nocheck(const void *src, void *dst,
|
||||
int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* This routine is used for miscellaneous IP-like checksums, mainly in
|
||||
* icmp.c
|
||||
*/
|
||||
extern unsigned short ip_compute_csum (unsigned char *buff, int len);
|
||||
extern __sum16 ip_compute_csum(const void *buff, int len);
|
||||
|
||||
/*
|
||||
* Fold a partial checksum without adding pseudo headers.
|
||||
*/
|
||||
static inline unsigned short
|
||||
csum_fold (unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum csum)
|
||||
{
|
||||
u32 sum = (__force u32)csum;
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
return ~sum;
|
||||
return (__force __sum16)~sum;
|
||||
}
|
||||
|
||||
#endif /* _ASM_IA64_CHECKSUM_H */
|
||||
|
|
|
|||
15
include/asm-ia64/device.h
Normal file
15
include/asm-ia64/device.h
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#ifndef _ASM_IA64_DEVICE_H
|
||||
#define _ASM_IA64_DEVICE_H
|
||||
|
||||
struct dev_archdata {
|
||||
#ifdef CONFIG_ACPI
|
||||
void *acpi_handle;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* _ASM_IA64_DEVICE_H */
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
#define IO_SPACE_LIMIT 0xffffffffffffffffUL
|
||||
|
||||
#define MAX_IO_SPACES_BITS 4
|
||||
#define MAX_IO_SPACES_BITS 8
|
||||
#define MAX_IO_SPACES (1UL << MAX_IO_SPACES_BITS)
|
||||
#define IO_SPACE_BITS 24
|
||||
#define IO_SPACE_SIZE (1UL << IO_SPACE_BITS)
|
||||
|
|
@ -417,6 +417,8 @@ __writeq (unsigned long val, volatile void __iomem *addr)
|
|||
# define outl_p outl
|
||||
#endif
|
||||
|
||||
# ifdef __KERNEL__
|
||||
|
||||
extern void __iomem * ioremap(unsigned long offset, unsigned long size);
|
||||
extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size);
|
||||
|
||||
|
|
@ -430,8 +432,6 @@ iounmap (volatile void __iomem *addr)
|
|||
#define dmi_iounmap(x,l) iounmap(x)
|
||||
#define dmi_alloc(l) kmalloc(l, GFP_ATOMIC)
|
||||
|
||||
# ifdef __KERNEL__
|
||||
|
||||
/*
|
||||
* String version of IO memory access ops:
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ typedef int ia64_mv_pci_legacy_read_t (struct pci_bus *, u16 port, u32 *val,
|
|||
typedef int ia64_mv_pci_legacy_write_t (struct pci_bus *, u16 port, u32 val,
|
||||
u8 size);
|
||||
typedef void ia64_mv_migrate_t(struct task_struct * task);
|
||||
typedef void ia64_mv_pci_fixup_bus_t (struct pci_bus *);
|
||||
|
||||
/* DMA-mapping interface: */
|
||||
typedef void ia64_mv_dma_init (void);
|
||||
|
|
@ -95,6 +96,11 @@ machvec_noop_task (struct task_struct *task)
|
|||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
machvec_noop_bus (struct pci_bus *bus)
|
||||
{
|
||||
}
|
||||
|
||||
extern void machvec_setup (char **);
|
||||
extern void machvec_timer_interrupt (int, void *);
|
||||
extern void machvec_dma_sync_single (struct device *, dma_addr_t, size_t, int);
|
||||
|
|
@ -159,6 +165,7 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *);
|
|||
# define platform_migrate ia64_mv.migrate
|
||||
# define platform_setup_msi_irq ia64_mv.setup_msi_irq
|
||||
# define platform_teardown_msi_irq ia64_mv.teardown_msi_irq
|
||||
# define platform_pci_fixup_bus ia64_mv.pci_fixup_bus
|
||||
# endif
|
||||
|
||||
/* __attribute__((__aligned__(16))) is required to make size of the
|
||||
|
|
@ -210,6 +217,7 @@ struct ia64_machine_vector {
|
|||
ia64_mv_migrate_t *migrate;
|
||||
ia64_mv_setup_msi_irq_t *setup_msi_irq;
|
||||
ia64_mv_teardown_msi_irq_t *teardown_msi_irq;
|
||||
ia64_mv_pci_fixup_bus_t *pci_fixup_bus;
|
||||
} __attribute__((__aligned__(16))); /* align attrib? see above comment */
|
||||
|
||||
#define MACHVEC_INIT(name) \
|
||||
|
|
@ -257,6 +265,7 @@ struct ia64_machine_vector {
|
|||
platform_migrate, \
|
||||
platform_setup_msi_irq, \
|
||||
platform_teardown_msi_irq, \
|
||||
platform_pci_fixup_bus, \
|
||||
}
|
||||
|
||||
extern struct ia64_machine_vector ia64_mv;
|
||||
|
|
@ -416,5 +425,8 @@ extern int ia64_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size
|
|||
#ifndef platform_teardown_msi_irq
|
||||
# define platform_teardown_msi_irq ((ia64_mv_teardown_msi_irq_t*)NULL)
|
||||
#endif
|
||||
#ifndef platform_pci_fixup_bus
|
||||
# define platform_pci_fixup_bus machvec_noop_bus
|
||||
#endif
|
||||
|
||||
#endif /* _ASM_IA64_MACHVEC_H */
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ extern ia64_mv_dma_supported sn_dma_supported;
|
|||
extern ia64_mv_migrate_t sn_migrate;
|
||||
extern ia64_mv_setup_msi_irq_t sn_setup_msi_irq;
|
||||
extern ia64_mv_teardown_msi_irq_t sn_teardown_msi_irq;
|
||||
extern ia64_mv_pci_fixup_bus_t sn_pci_fixup_bus;
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -127,6 +128,7 @@ extern ia64_mv_teardown_msi_irq_t sn_teardown_msi_irq;
|
|||
#define platform_setup_msi_irq ((ia64_mv_setup_msi_irq_t*)NULL)
|
||||
#define platform_teardown_msi_irq ((ia64_mv_teardown_msi_irq_t*)NULL)
|
||||
#endif
|
||||
#define platform_pci_fixup_bus sn_pci_fixup_bus
|
||||
|
||||
#include <asm/sn/io.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -764,7 +764,7 @@ struct ia64_pal_retval {
|
|||
* (generally 0) MUST be passed. Reserved parameters are not optional
|
||||
* parameters.
|
||||
*/
|
||||
extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64, u64);
|
||||
extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64);
|
||||
extern struct ia64_pal_retval ia64_pal_call_stacked (u64, u64, u64, u64);
|
||||
extern struct ia64_pal_retval ia64_pal_call_phys_static (u64, u64, u64, u64);
|
||||
extern struct ia64_pal_retval ia64_pal_call_phys_stacked (u64, u64, u64, u64);
|
||||
|
|
@ -774,14 +774,7 @@ extern void ia64_load_scratch_fpregs (struct ia64_fpreg *);
|
|||
#define PAL_CALL(iprv,a0,a1,a2,a3) do { \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
iprv = ia64_pal_call_static(a0, a1, a2, a3, 0); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
} while (0)
|
||||
|
||||
#define PAL_CALL_IC_OFF(iprv,a0,a1,a2,a3) do { \
|
||||
struct ia64_fpreg fr[6]; \
|
||||
ia64_save_scratch_fpregs(fr); \
|
||||
iprv = ia64_pal_call_static(a0, a1, a2, a3, 1); \
|
||||
iprv = ia64_pal_call_static(a0, a1, a2, a3); \
|
||||
ia64_load_scratch_fpregs(fr); \
|
||||
} while (0)
|
||||
|
||||
|
|
|
|||
|
|
@ -26,16 +26,18 @@ void pcibios_config_init(void);
|
|||
struct pci_dev;
|
||||
|
||||
/*
|
||||
* PCI_DMA_BUS_IS_PHYS should be set to 1 if there is _necessarily_ a direct correspondence
|
||||
* between device bus addresses and CPU physical addresses. Platforms with a hardware I/O
|
||||
* MMU _must_ turn this off to suppress the bounce buffer handling code in the block and
|
||||
* network device layers. Platforms with separate bus address spaces _must_ turn this off
|
||||
* and provide a device DMA mapping implementation that takes care of the necessary
|
||||
* PCI_DMA_BUS_IS_PHYS should be set to 1 if there is _necessarily_ a direct
|
||||
* correspondence between device bus addresses and CPU physical addresses.
|
||||
* Platforms with a hardware I/O MMU _must_ turn this off to suppress the
|
||||
* bounce buffer handling code in the block and network device layers.
|
||||
* Platforms with separate bus address spaces _must_ turn this off and provide
|
||||
* a device DMA mapping implementation that takes care of the necessary
|
||||
* address translation.
|
||||
*
|
||||
* For now, the ia64 platforms which may have separate/multiple bus address spaces all
|
||||
* have I/O MMUs which support the merging of physically discontiguous buffers, so we can
|
||||
* use that as the sole factor to determine the setting of PCI_DMA_BUS_IS_PHYS.
|
||||
* For now, the ia64 platforms which may have separate/multiple bus address
|
||||
* spaces all have I/O MMUs which support the merging of physically
|
||||
* discontiguous buffers, so we can use that as the sole factor to determine
|
||||
* the setting of PCI_DMA_BUS_IS_PHYS.
|
||||
*/
|
||||
extern unsigned long ia64_max_iommu_merge_mask;
|
||||
#define PCI_DMA_BUS_IS_PHYS (ia64_max_iommu_merge_mask == ~0UL)
|
||||
|
|
@ -52,9 +54,6 @@ pcibios_penalize_isa_irq (int irq, int active)
|
|||
/* We don't do dynamic PCI IRQ allocation */
|
||||
}
|
||||
|
||||
#define HAVE_ARCH_PCI_MWI 1
|
||||
extern int pcibios_prep_mwi (struct pci_dev *);
|
||||
|
||||
#include <asm-generic/pci-dma-compat.h>
|
||||
|
||||
/* pci_unmap_{single,page} is not a nop, thus... */
|
||||
|
|
|
|||
|
|
@ -659,6 +659,7 @@ ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
|
|||
}
|
||||
|
||||
extern s64 ia64_sal_cache_flush (u64 cache_type);
|
||||
extern void __init check_sal_cache_flush (void);
|
||||
|
||||
/* Initialize all the processor and platform level instruction and data caches */
|
||||
static inline s64
|
||||
|
|
|
|||
16
include/asm-ia64/sn/acpi.h
Normal file
16
include/asm-ia64/sn/acpi.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* This file is subject to the terms and conditions of the GNU General Public
|
||||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 2006 Silicon Graphics, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef _ASM_IA64_SN_ACPI_H
|
||||
#define _ASM_IA64_SN_ACPI_H
|
||||
|
||||
#include "acpi/acglobal.h"
|
||||
|
||||
#define SN_ACPI_BASE_SUPPORT() (acpi_gbl_DSDT->oem_revision >= 0x20101)
|
||||
|
||||
#endif /* _ASM_IA64_SN_ACPI_H */
|
||||
|
|
@ -136,9 +136,13 @@
|
|||
*/
|
||||
#define TO_PHYS(x) (TO_PHYS_MASK & (x))
|
||||
#define TO_CAC(x) (CAC_BASE | TO_PHYS(x))
|
||||
#ifdef CONFIG_SGI_SN
|
||||
#define TO_AMO(x) (AMO_BASE | TO_PHYS(x))
|
||||
#define TO_GET(x) (GET_BASE | TO_PHYS(x))
|
||||
|
||||
#else
|
||||
#define TO_AMO(x) ({ BUG(); x; })
|
||||
#define TO_GET(x) ({ BUG(); x; })
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Covert from processor physical address to II/TIO physical address:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
|
||||
* Copyright (C) 1992 - 1997, 2000-2006 Silicon Graphics, Inc. All rights reserved.
|
||||
*/
|
||||
#ifndef _ASM_IA64_SN_PCI_PCIDEV_H
|
||||
#define _ASM_IA64_SN_PCI_PCIDEV_H
|
||||
|
|
@ -12,31 +12,29 @@
|
|||
|
||||
/*
|
||||
* In ia64, pci_dev->sysdata must be a *pci_controller. To provide access to
|
||||
* the pcidev_info structs for all devices under a controller, we extend the
|
||||
* definition of pci_controller, via sn_pci_controller, to include a list
|
||||
* of pcidev_info.
|
||||
* the pcidev_info structs for all devices under a controller, we keep a
|
||||
* list of pcidev_info under pci_controller->platform_data.
|
||||
*/
|
||||
struct sn_pci_controller {
|
||||
struct pci_controller pci_controller;
|
||||
struct sn_platform_data {
|
||||
void *provider_soft;
|
||||
struct list_head pcidev_info;
|
||||
};
|
||||
|
||||
#define SN_PCI_CONTROLLER(dev) ((struct sn_pci_controller *) dev->sysdata)
|
||||
#define SN_PLATFORM_DATA(busdev) \
|
||||
((struct sn_platform_data *)(PCI_CONTROLLER(busdev)->platform_data))
|
||||
|
||||
#define SN_PCIDEV_INFO(dev) sn_pcidev_info_get(dev)
|
||||
|
||||
#define SN_PCIBUS_BUSSOFT_INFO(pci_bus) \
|
||||
(struct pcibus_info *)((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data))
|
||||
/*
|
||||
* Given a pci_bus, return the sn pcibus_bussoft struct. Note that
|
||||
* this only works for root busses, not for busses represented by PPB's.
|
||||
*/
|
||||
|
||||
#define SN_PCIBUS_BUSSOFT(pci_bus) \
|
||||
((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data))
|
||||
((struct pcibus_bussoft *)(SN_PLATFORM_DATA(pci_bus)->provider_soft))
|
||||
|
||||
#define SN_PCIBUS_BUSSOFT_INFO(pci_bus) \
|
||||
(struct pcibus_info *)((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data))
|
||||
((struct pcibus_info *)(SN_PLATFORM_DATA(pci_bus)->provider_soft))
|
||||
/*
|
||||
* Given a struct pci_dev, return the sn pcibus_bussoft struct. Note
|
||||
* that this is not equivalent to SN_PCIBUS_BUSSOFT(pci_dev->bus) due
|
||||
|
|
@ -72,8 +70,6 @@ extern void sn_irq_fixup(struct pci_dev *pci_dev,
|
|||
struct sn_irq_info *sn_irq_info);
|
||||
extern void sn_irq_unfixup(struct pci_dev *pci_dev);
|
||||
extern struct pcidev_info * sn_pcidev_info_get(struct pci_dev *);
|
||||
extern void sn_pci_controller_fixup(int segment, int busnum,
|
||||
struct pci_bus *bus);
|
||||
extern void sn_bus_store_sysdata(struct pci_dev *dev);
|
||||
extern void sn_bus_free_sysdata(void);
|
||||
extern void sn_generate_path(struct pci_bus *pci_bus, char *address);
|
||||
|
|
|
|||
|
|
@ -44,8 +44,14 @@ extern int sn_prom_feature_available(int id);
|
|||
* Once enabled, a feature cannot be disabled.
|
||||
*
|
||||
* By default, features are disabled unless explicitly enabled.
|
||||
*
|
||||
* These defines must be kept in sync with the corresponding
|
||||
* PROM definitions in feature_sets.h.
|
||||
*/
|
||||
#define OSF_MCA_SLV_TO_OS_INIT_SLV 0
|
||||
#define OSF_FEAT_LOG_SBES 1
|
||||
#define OSF_ACPI_ENABLE 2
|
||||
#define OSF_PCISEGMENT_ENABLE 3
|
||||
|
||||
|
||||
#endif /* _ASM_IA64_SN_FEATURE_SETS_H */
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@
|
|||
#define SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST 0x02000058 // deprecated
|
||||
#define SN_SAL_IOIF_GET_DEVICE_DMAFLUSH_LIST 0x0200005a
|
||||
|
||||
#define SN_SAL_IOIF_INIT 0x0200005f
|
||||
#define SN_SAL_HUB_ERROR_INTERRUPT 0x02000060
|
||||
#define SN_SAL_BTE_RECOVER 0x02000061
|
||||
#define SN_SAL_RESERVED_DO_NOT_USE 0x02000062
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ xlate_dev_kmem_ptr (char * p)
|
|||
struct page *page;
|
||||
char * ptr;
|
||||
|
||||
page = virt_to_page((unsigned long)p >> PAGE_SHIFT);
|
||||
page = virt_to_page((unsigned long)p);
|
||||
if (PageUncached(page))
|
||||
ptr = (char *)__pa(p) + __IA64_UNCACHED_OFFSET;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
asmlinkage unsigned int csum_partial(const unsigned char *buff,
|
||||
int len, unsigned int sum);
|
||||
asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* The same as csum_partial, but copies from src while it checksums.
|
||||
|
|
@ -40,24 +39,22 @@ asmlinkage unsigned int csum_partial(const unsigned char *buff,
|
|||
* Here even more important to align src and dst on a 32-bit (or even
|
||||
* better 64-bit) boundary
|
||||
*/
|
||||
extern unsigned int csum_partial_copy_nocheck(const unsigned char *src,
|
||||
unsigned char *dst,
|
||||
int len, unsigned int sum);
|
||||
extern __wsum csum_partial_copy_nocheck(const void *src, void *dst,
|
||||
int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* This is a new version of the above that records errors it finds in *errp,
|
||||
* but continues and zeros thre rest of the buffer.
|
||||
*/
|
||||
extern unsigned int csum_partial_copy_from_user(const unsigned char __user *src,
|
||||
unsigned char *dst,
|
||||
int len, unsigned int sum,
|
||||
extern __wsum csum_partial_copy_from_user(const void __user *src, void *dst,
|
||||
int len, __wsum sum,
|
||||
int *err_ptr);
|
||||
|
||||
/*
|
||||
* Fold a partial checksum
|
||||
*/
|
||||
|
||||
static inline unsigned int csum_fold(unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum sum)
|
||||
{
|
||||
unsigned long tmpreg;
|
||||
__asm__(
|
||||
|
|
@ -72,16 +69,17 @@ static inline unsigned int csum_fold(unsigned int sum)
|
|||
: "0" (sum)
|
||||
: "cbit"
|
||||
);
|
||||
return sum;
|
||||
return (__force __sum16)sum;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a version of ip_compute_csum() optimized for IP headers,
|
||||
* which always checksum on 4 octet boundaries.
|
||||
*/
|
||||
static inline unsigned short ip_fast_csum(unsigned char * iph,
|
||||
unsigned int ihl) {
|
||||
unsigned long sum, tmpreg0, tmpreg1;
|
||||
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
|
||||
{
|
||||
unsigned long tmpreg0, tmpreg1;
|
||||
__wsum sum;
|
||||
|
||||
__asm__ __volatile__(
|
||||
" ld %0, @%1+ \n"
|
||||
|
|
@ -115,16 +113,15 @@ static inline unsigned short ip_fast_csum(unsigned char * iph,
|
|||
return csum_fold(sum);
|
||||
}
|
||||
|
||||
static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
|
||||
unsigned long daddr,
|
||||
static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
__wsum sum)
|
||||
{
|
||||
#if defined(__LITTLE_ENDIAN)
|
||||
unsigned long len_proto = (ntohs(len)<<16)+proto*256;
|
||||
unsigned long len_proto = (proto + len) << 8;
|
||||
#else
|
||||
unsigned long len_proto = (proto<<16)+len;
|
||||
unsigned long len_proto = proto + len;
|
||||
#endif
|
||||
unsigned long tmpreg;
|
||||
|
||||
|
|
@ -147,11 +144,10 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
|
|||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
|
||||
unsigned long daddr,
|
||||
static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
__wsum sum)
|
||||
{
|
||||
return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
|
||||
}
|
||||
|
|
@ -161,16 +157,16 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
|
|||
* in icmp.c
|
||||
*/
|
||||
|
||||
static inline unsigned short ip_compute_csum(unsigned char * buff, int len) {
|
||||
static inline __sum16 ip_compute_csum(const void *buff, int len)
|
||||
{
|
||||
return csum_fold (csum_partial(buff, len, 0));
|
||||
}
|
||||
|
||||
#define _HAVE_ARCH_IPV6_CSUM
|
||||
static inline unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
|
||||
struct in6_addr *daddr,
|
||||
__u16 len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||
const struct in6_addr *daddr,
|
||||
__u32 len, unsigned short proto,
|
||||
__wsum sum)
|
||||
{
|
||||
unsigned long tmpreg0, tmpreg1, tmpreg2, tmpreg3;
|
||||
__asm__(
|
||||
|
|
@ -197,7 +193,7 @@ static inline unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
|
|||
: "=&r" (sum), "=&r" (tmpreg0), "=&r" (tmpreg1),
|
||||
"=&r" (tmpreg2), "=&r" (tmpreg3)
|
||||
: "r" (saddr), "r" (daddr),
|
||||
"r" (htonl((__u32) (len))), "r" (htonl(proto)), "0" (sum)
|
||||
"r" (htonl(len)), "r" (htonl(proto)), "0" (sum)
|
||||
: "cbit"
|
||||
);
|
||||
|
||||
|
|
|
|||
7
include/asm-m32r/device.h
Normal file
7
include/asm-m32r/device.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
|
||||
__wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
|
|
@ -25,22 +25,21 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
|
|||
* better 64-bit) boundary
|
||||
*/
|
||||
|
||||
extern unsigned int csum_partial_copy_from_user(const unsigned char __user *src,
|
||||
unsigned char *dst,
|
||||
int len, int sum,
|
||||
extern __wsum csum_partial_copy_from_user(const void __user *src,
|
||||
void *dst,
|
||||
int len, __wsum sum,
|
||||
int *csum_err);
|
||||
|
||||
extern unsigned int csum_partial_copy_nocheck(const unsigned char *src,
|
||||
unsigned char *dst, int len,
|
||||
int sum);
|
||||
extern __wsum csum_partial_copy_nocheck(const void *src,
|
||||
void *dst, int len,
|
||||
__wsum sum);
|
||||
|
||||
/*
|
||||
* This is a version of ip_compute_csum() optimized for IP headers,
|
||||
* which always checksum on 4 octet boundaries.
|
||||
*
|
||||
*/
|
||||
static inline unsigned short
|
||||
ip_fast_csum(unsigned char *iph, unsigned int ihl)
|
||||
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
|
||||
{
|
||||
unsigned int sum = 0;
|
||||
unsigned long tmp;
|
||||
|
|
@ -58,29 +57,29 @@ ip_fast_csum(unsigned char *iph, unsigned int ihl)
|
|||
: "=d" (sum), "=&a" (iph), "=&d" (ihl), "=&d" (tmp)
|
||||
: "0" (sum), "1" (iph), "2" (ihl)
|
||||
: "memory");
|
||||
return ~sum;
|
||||
return (__force __sum16)~sum;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fold a partial checksum
|
||||
*/
|
||||
|
||||
static inline unsigned int csum_fold(unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum sum)
|
||||
{
|
||||
unsigned int tmp = sum;
|
||||
unsigned int tmp = (__force u32)sum;
|
||||
__asm__("swap %1\n\t"
|
||||
"addw %1, %0\n\t"
|
||||
"clrw %1\n\t"
|
||||
"addxw %1, %0"
|
||||
: "=&d" (sum), "=&d" (tmp)
|
||||
: "0" (sum), "1" (tmp));
|
||||
return ~sum;
|
||||
return (__force __sum16)~sum;
|
||||
}
|
||||
|
||||
|
||||
static inline unsigned int
|
||||
csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
||||
unsigned short proto, unsigned int sum)
|
||||
static inline __wsum
|
||||
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
__asm__ ("addl %2,%0\n\t"
|
||||
"addxl %3,%0\n\t"
|
||||
|
|
@ -98,9 +97,9 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
static inline unsigned short int
|
||||
csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
||||
unsigned short proto, unsigned int sum)
|
||||
static inline __sum16
|
||||
csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
|
||||
}
|
||||
|
|
@ -110,16 +109,15 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
* in icmp.c
|
||||
*/
|
||||
|
||||
static inline unsigned short
|
||||
ip_compute_csum(unsigned char * buff, int len)
|
||||
static inline __sum16 ip_compute_csum(const void *buff, int len)
|
||||
{
|
||||
return csum_fold (csum_partial(buff, len, 0));
|
||||
}
|
||||
|
||||
#define _HAVE_ARCH_IPV6_CSUM
|
||||
static __inline__ unsigned short int
|
||||
csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr,
|
||||
__u32 len, unsigned short proto, unsigned int sum)
|
||||
static __inline__ __sum16
|
||||
csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr,
|
||||
__u32 len, unsigned short proto, __wsum sum)
|
||||
{
|
||||
register unsigned long tmp;
|
||||
__asm__("addl %2@,%0\n\t"
|
||||
|
|
|
|||
7
include/asm-m68k/device.h
Normal file
7
include/asm-m68k/device.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
|
||||
__wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* the same as csum_partial, but copies from src while it
|
||||
|
|
@ -25,8 +25,8 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum)
|
|||
* better 64-bit) boundary
|
||||
*/
|
||||
|
||||
unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst,
|
||||
int len, int sum);
|
||||
__wsum csum_partial_copy_nocheck(const void *src, void *dst,
|
||||
int len, __wsum sum);
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -36,33 +36,31 @@ unsigned int csum_partial_copy(const unsigned char *src, unsigned char *dst,
|
|||
* better 64-bit) boundary
|
||||
*/
|
||||
|
||||
extern unsigned int csum_partial_copy_from_user(const unsigned char *src,
|
||||
unsigned char *dst, int len, int sum, int *csum_err);
|
||||
extern __wsum csum_partial_copy_from_user(const void __user *src,
|
||||
void *dst, int len, __wsum sum, int *csum_err);
|
||||
|
||||
#define csum_partial_copy_nocheck(src, dst, len, sum) \
|
||||
csum_partial_copy((src), (dst), (len), (sum))
|
||||
|
||||
unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl);
|
||||
__sum16 ip_fast_csum(const void *iph, unsigned int ihl);
|
||||
|
||||
/*
|
||||
* Fold a partial checksum
|
||||
*/
|
||||
|
||||
static inline unsigned int csum_fold(unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum sum)
|
||||
{
|
||||
unsigned int tmp = (__force u32)sum;
|
||||
#ifdef CONFIG_COLDFIRE
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
sum = (sum & 0xffff) + (sum >> 16);
|
||||
tmp = (tmp & 0xffff) + (tmp >> 16);
|
||||
tmp = (tmp & 0xffff) + (tmp >> 16);
|
||||
return (__force __sum16)~tmp;
|
||||
#else
|
||||
unsigned int tmp = sum;
|
||||
__asm__("swap %1\n\t"
|
||||
"addw %1, %0\n\t"
|
||||
"clrw %1\n\t"
|
||||
"addxw %1, %0"
|
||||
: "=&d" (sum), "=&d" (tmp)
|
||||
: "0" (sum), "1" (sum));
|
||||
return (__force __sum16)~sum;
|
||||
#endif
|
||||
return ~sum;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -71,9 +69,9 @@ static inline unsigned int csum_fold(unsigned int sum)
|
|||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
|
||||
static inline unsigned int
|
||||
csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
||||
unsigned short proto, unsigned int sum)
|
||||
static inline __wsum
|
||||
csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
__asm__ ("addl %1,%0\n\t"
|
||||
"addxl %4,%0\n\t"
|
||||
|
|
@ -86,9 +84,9 @@ csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
return sum;
|
||||
}
|
||||
|
||||
static inline unsigned short int
|
||||
csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
||||
unsigned short proto, unsigned int sum)
|
||||
static inline __sum16
|
||||
csum_tcpudp_magic(__be32 saddr, __be32 daddr, unsigned short len,
|
||||
unsigned short proto, __wsum sum)
|
||||
{
|
||||
return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
|
||||
}
|
||||
|
|
@ -98,12 +96,12 @@ csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len,
|
|||
* in icmp.c
|
||||
*/
|
||||
|
||||
extern unsigned short ip_compute_csum(const unsigned char * buff, int len);
|
||||
extern __sum16 ip_compute_csum(const void *buff, int len);
|
||||
|
||||
#define _HAVE_ARCH_IPV6_CSUM
|
||||
static __inline__ unsigned short int
|
||||
csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr,
|
||||
__u32 len, unsigned short proto, unsigned int sum)
|
||||
static __inline__ __sum16
|
||||
csum_ipv6_magic(const struct in6_addr *saddr, const struct in6_addr *daddr,
|
||||
__u32 len, unsigned short proto, __wsum sum)
|
||||
{
|
||||
register unsigned long tmp;
|
||||
__asm__("addl %2@,%0\n\t"
|
||||
|
|
|
|||
7
include/asm-m68knommu/device.h
Normal file
7
include/asm-m68knommu/device.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
1
include/asm-m68knommu/irq_regs.h
Normal file
1
include/asm-m68knommu/irq_regs.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include <asm-generic/irq_regs.h>
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
* interrupt source (if it supports chaining).
|
||||
*/
|
||||
typedef struct irq_node {
|
||||
irqreturn_t (*handler)(int, void *, struct pt_regs *);
|
||||
irq_handler_t handler;
|
||||
unsigned long flags;
|
||||
void *dev_id;
|
||||
const char *devname;
|
||||
|
|
@ -18,12 +18,12 @@ typedef struct irq_node {
|
|||
/*
|
||||
* This structure has only 4 elements for speed reasons
|
||||
*/
|
||||
typedef struct irq_handler {
|
||||
irqreturn_t (*handler)(int, void *, struct pt_regs *);
|
||||
struct irq_entry {
|
||||
irq_handler_t handler;
|
||||
unsigned long flags;
|
||||
void *dev_id;
|
||||
const char *devname;
|
||||
} irq_handler_t;
|
||||
};
|
||||
|
||||
/* count of spurious interrupts */
|
||||
extern volatile unsigned int num_spurious;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ extern int (*mach_kbdrate) (struct kbd_repeat *);
|
|||
extern void (*mach_kbd_leds) (unsigned int);
|
||||
/* machine dependent irq functions */
|
||||
extern void (*mach_init_IRQ) (void);
|
||||
extern irqreturn_t (*(*mach_default_handler)[]) (int, void *, struct pt_regs *);
|
||||
extern irq_handler_t mach_default_handler;
|
||||
extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
|
||||
unsigned long flags, const char *devname, void *dev_id);
|
||||
extern void (*mach_free_irq) (unsigned int irq, void *dev_id);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
#define MCFMBUS_MFDR_MBC(a) ((a)&0x3F) /*M-Bus Clock*/
|
||||
|
||||
/*
|
||||
* Define bit flags in Controll Register
|
||||
* Define bit flags in Control Register
|
||||
*/
|
||||
|
||||
#define MCFMBUS_MBCR_MEN (0x80) /* M-Bus Enable */
|
||||
|
|
|
|||
|
|
@ -19,12 +19,16 @@
|
|||
#define _ATYPE_
|
||||
#define _ATYPE32_
|
||||
#define _ATYPE64_
|
||||
#define _LLCONST_(x) x
|
||||
#define _CONST64_(x) x
|
||||
#else
|
||||
#define _ATYPE_ __PTRDIFF_TYPE__
|
||||
#define _ATYPE32_ int
|
||||
#define _ATYPE64_ long long
|
||||
#define _LLCONST_(x) x ## LL
|
||||
#define _ATYPE64_ __s64
|
||||
#ifdef CONFIG_64BIT
|
||||
#define _CONST64_(x) x ## L
|
||||
#else
|
||||
#define _CONST64_(x) x ## LL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
@ -48,7 +52,7 @@
|
|||
*/
|
||||
#define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff)
|
||||
#define XPHYSADDR(a) ((_ACAST64_(a)) & \
|
||||
_LLCONST_(0x000000ffffffffff))
|
||||
_CONST64_(0x000000ffffffffff))
|
||||
|
||||
#ifdef CONFIG_64BIT
|
||||
|
||||
|
|
@ -57,14 +61,14 @@
|
|||
* The compatibility segments use the full 64-bit sign extended value. Note
|
||||
* the R8000 doesn't have them so don't reference these in generic MIPS code.
|
||||
*/
|
||||
#define XKUSEG _LLCONST_(0x0000000000000000)
|
||||
#define XKSSEG _LLCONST_(0x4000000000000000)
|
||||
#define XKPHYS _LLCONST_(0x8000000000000000)
|
||||
#define XKSEG _LLCONST_(0xc000000000000000)
|
||||
#define CKSEG0 _LLCONST_(0xffffffff80000000)
|
||||
#define CKSEG1 _LLCONST_(0xffffffffa0000000)
|
||||
#define CKSSEG _LLCONST_(0xffffffffc0000000)
|
||||
#define CKSEG3 _LLCONST_(0xffffffffe0000000)
|
||||
#define XKUSEG _CONST64_(0x0000000000000000)
|
||||
#define XKSSEG _CONST64_(0x4000000000000000)
|
||||
#define XKPHYS _CONST64_(0x8000000000000000)
|
||||
#define XKSEG _CONST64_(0xc000000000000000)
|
||||
#define CKSEG0 _CONST64_(0xffffffff80000000)
|
||||
#define CKSEG1 _CONST64_(0xffffffffa0000000)
|
||||
#define CKSSEG _CONST64_(0xffffffffc0000000)
|
||||
#define CKSEG3 _CONST64_(0xffffffffe0000000)
|
||||
|
||||
#define CKSEG0ADDR(a) (CPHYSADDR(a) | CKSEG0)
|
||||
#define CKSEG1ADDR(a) (CPHYSADDR(a) | CKSEG1)
|
||||
|
|
@ -122,7 +126,7 @@
|
|||
#define PHYS_TO_XKSEG_UNCACHED(p) PHYS_TO_XKPHYS(K_CALG_UNCACHED,(p))
|
||||
#define PHYS_TO_XKSEG_CACHED(p) PHYS_TO_XKPHYS(K_CALG_COH_SHAREABLE,(p))
|
||||
#define XKPHYS_TO_PHYS(p) ((p) & TO_PHYS_MASK)
|
||||
#define PHYS_TO_XKPHYS(cm,a) (_LLCONST_(0x8000000000000000) | \
|
||||
#define PHYS_TO_XKPHYS(cm,a) (_CONST64_(0x8000000000000000) | \
|
||||
((cm)<<59) | (a))
|
||||
|
||||
#if defined (CONFIG_CPU_R4300) \
|
||||
|
|
@ -132,20 +136,20 @@
|
|||
|| defined (CONFIG_CPU_NEVADA) \
|
||||
|| defined (CONFIG_CPU_TX49XX) \
|
||||
|| defined (CONFIG_CPU_MIPS64)
|
||||
#define TO_PHYS_MASK _LLCONST_(0x0000000fffffffff) /* 2^^36 - 1 */
|
||||
#define TO_PHYS_MASK _CONST64_(0x0000000fffffffff) /* 2^^36 - 1 */
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_CPU_R8000)
|
||||
/* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */
|
||||
#define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */
|
||||
#define TO_PHYS_MASK _CONST64_(0x000000ffffffffff) /* 2^^40 - 1 */
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_CPU_R10000)
|
||||
#define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */
|
||||
#define TO_PHYS_MASK _CONST64_(0x000000ffffffffff) /* 2^^40 - 1 */
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_CPU_SB1) || defined(CONFIG_CPU_SB1A)
|
||||
#define TO_PHYS_MASK _LLCONST_(0x00000fffffffffff) /* 2^^44 - 1 */
|
||||
#define TO_PHYS_MASK _CONST64_(0x00000fffffffffff) /* 2^^44 - 1 */
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_CPU_R8000
|
||||
|
|
@ -155,7 +159,7 @@
|
|||
* in order to catch bugs in the source code.
|
||||
*/
|
||||
|
||||
#define COMPAT_K1BASE32 _LLCONST_(0xffffffffa0000000)
|
||||
#define COMPAT_K1BASE32 _CONST64_(0xffffffffa0000000)
|
||||
#define PHYS_TO_COMPATK1(x) ((x) | COMPAT_K1BASE32) /* 32-bit compat k1 */
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -344,6 +344,7 @@ symbol = value
|
|||
#define PTR_L lw
|
||||
#define PTR_S sw
|
||||
#define PTR_LA la
|
||||
#define PTR_LI li
|
||||
#define PTR_SLL sll
|
||||
#define PTR_SLLV sllv
|
||||
#define PTR_SRL srl
|
||||
|
|
@ -368,6 +369,7 @@ symbol = value
|
|||
#define PTR_L ld
|
||||
#define PTR_S sd
|
||||
#define PTR_LA dla
|
||||
#define PTR_LI dli
|
||||
#define PTR_SLL dsll
|
||||
#define PTR_SLLV dsllv
|
||||
#define PTR_SRL dsrl
|
||||
|
|
|
|||
|
|
@ -9,16 +9,8 @@
|
|||
* License. See the file "COPYING" in the main directory of this archive
|
||||
* for more details.
|
||||
*
|
||||
* Copyright (C) 1996, 97, 99, 2000, 03, 04 by Ralf Baechle
|
||||
* Copyright (C) 1996, 97, 99, 2000, 03, 04, 06 by Ralf Baechle
|
||||
*/
|
||||
|
||||
/*
|
||||
* As workaround for the ATOMIC_DEC_AND_LOCK / atomic_dec_and_lock mess in
|
||||
* <linux/spinlock.h> we have to include <linux/spinlock.h> outside the
|
||||
* main big wrapper ...
|
||||
*/
|
||||
#include <linux/spinlock.h>
|
||||
|
||||
#ifndef _ASM_ATOMIC_H
|
||||
#define _ASM_ATOMIC_H
|
||||
|
||||
|
|
|
|||
|
|
@ -10,51 +10,32 @@
|
|||
#define _ASM_BITOPS_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/irqflags.h>
|
||||
#include <linux/types.h>
|
||||
#include <asm/bug.h>
|
||||
#include <asm/byteorder.h> /* sigh ... */
|
||||
#include <asm/cpu-features.h>
|
||||
#include <asm/sgidefs.h>
|
||||
#include <asm/war.h>
|
||||
|
||||
#if (_MIPS_SZLONG == 32)
|
||||
#define SZLONG_LOG 5
|
||||
#define SZLONG_MASK 31UL
|
||||
#define __LL "ll "
|
||||
#define __SC "sc "
|
||||
#define cpu_to_lelongp(x) cpu_to_le32p((__u32 *) (x))
|
||||
#elif (_MIPS_SZLONG == 64)
|
||||
#define SZLONG_LOG 6
|
||||
#define SZLONG_MASK 63UL
|
||||
#define __LL "lld "
|
||||
#define __SC "scd "
|
||||
#define cpu_to_lelongp(x) cpu_to_le64p((__u64 *) (x))
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/irqflags.h>
|
||||
#include <asm/sgidefs.h>
|
||||
#include <asm/war.h>
|
||||
|
||||
/*
|
||||
* clear_bit() doesn't provide any barrier for the compiler.
|
||||
*/
|
||||
#define smp_mb__before_clear_bit() smp_mb()
|
||||
#define smp_mb__after_clear_bit() smp_mb()
|
||||
|
||||
/*
|
||||
* Only disable interrupt for kernel mode stuff to keep usermode stuff
|
||||
* that dares to use kernel include files alive.
|
||||
*/
|
||||
|
||||
#define __bi_flags unsigned long flags
|
||||
#define __bi_local_irq_save(x) local_irq_save(x)
|
||||
#define __bi_local_irq_restore(x) local_irq_restore(x)
|
||||
#else
|
||||
#define __bi_flags
|
||||
#define __bi_local_irq_save(x)
|
||||
#define __bi_local_irq_restore(x)
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
/*
|
||||
* set_bit - Atomically set a bit in memory
|
||||
* @nr: the bit to set
|
||||
|
|
@ -93,13 +74,13 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr)
|
|||
} else {
|
||||
volatile unsigned long *a = addr;
|
||||
unsigned long mask;
|
||||
__bi_flags;
|
||||
unsigned long flags;
|
||||
|
||||
a += nr >> SZLONG_LOG;
|
||||
mask = 1UL << (nr & SZLONG_MASK);
|
||||
__bi_local_irq_save(flags);
|
||||
local_irq_save(flags);
|
||||
*a |= mask;
|
||||
__bi_local_irq_restore(flags);
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -141,13 +122,13 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr)
|
|||
} else {
|
||||
volatile unsigned long *a = addr;
|
||||
unsigned long mask;
|
||||
__bi_flags;
|
||||
unsigned long flags;
|
||||
|
||||
a += nr >> SZLONG_LOG;
|
||||
mask = 1UL << (nr & SZLONG_MASK);
|
||||
__bi_local_irq_save(flags);
|
||||
local_irq_save(flags);
|
||||
*a &= ~mask;
|
||||
__bi_local_irq_restore(flags);
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -191,13 +172,13 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)
|
|||
} else {
|
||||
volatile unsigned long *a = addr;
|
||||
unsigned long mask;
|
||||
__bi_flags;
|
||||
unsigned long flags;
|
||||
|
||||
a += nr >> SZLONG_LOG;
|
||||
mask = 1UL << (nr & SZLONG_MASK);
|
||||
__bi_local_irq_save(flags);
|
||||
local_irq_save(flags);
|
||||
*a ^= mask;
|
||||
__bi_local_irq_restore(flags);
|
||||
local_irq_restore(flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -258,14 +239,14 @@ static inline int test_and_set_bit(unsigned long nr,
|
|||
volatile unsigned long *a = addr;
|
||||
unsigned long mask;
|
||||
int retval;
|
||||
__bi_flags;
|
||||
unsigned long flags;
|
||||
|
||||
a += nr >> SZLONG_LOG;
|
||||
mask = 1UL << (nr & SZLONG_MASK);
|
||||
__bi_local_irq_save(flags);
|
||||
local_irq_save(flags);
|
||||
retval = (mask & *a) != 0;
|
||||
*a |= mask;
|
||||
__bi_local_irq_restore(flags);
|
||||
local_irq_restore(flags);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
|
@ -330,14 +311,14 @@ static inline int test_and_clear_bit(unsigned long nr,
|
|||
volatile unsigned long *a = addr;
|
||||
unsigned long mask;
|
||||
int retval;
|
||||
__bi_flags;
|
||||
unsigned long flags;
|
||||
|
||||
a += nr >> SZLONG_LOG;
|
||||
mask = 1UL << (nr & SZLONG_MASK);
|
||||
__bi_local_irq_save(flags);
|
||||
local_irq_save(flags);
|
||||
retval = (mask & *a) != 0;
|
||||
*a &= ~mask;
|
||||
__bi_local_irq_restore(flags);
|
||||
local_irq_restore(flags);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
|
@ -399,23 +380,19 @@ static inline int test_and_change_bit(unsigned long nr,
|
|||
} else {
|
||||
volatile unsigned long *a = addr;
|
||||
unsigned long mask, retval;
|
||||
__bi_flags;
|
||||
unsigned long flags;
|
||||
|
||||
a += nr >> SZLONG_LOG;
|
||||
mask = 1UL << (nr & SZLONG_MASK);
|
||||
__bi_local_irq_save(flags);
|
||||
local_irq_save(flags);
|
||||
retval = (mask & *a) != 0;
|
||||
*a ^= mask;
|
||||
__bi_local_irq_restore(flags);
|
||||
local_irq_restore(flags);
|
||||
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
#undef __bi_flags
|
||||
#undef __bi_local_irq_save
|
||||
#undef __bi_local_irq_restore
|
||||
|
||||
#include <asm-generic/bitops/non-atomic.h>
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef __ASM_BUG_H
|
||||
#define __ASM_BUG_H
|
||||
|
||||
#include <asm/sgidefs.h>
|
||||
|
||||
#ifdef CONFIG_BUG
|
||||
|
||||
|
|
@ -13,6 +14,17 @@ do { \
|
|||
|
||||
#define HAVE_ARCH_BUG
|
||||
|
||||
#if (_MIPS_ISA > _MIPS_ISA_MIPS1)
|
||||
|
||||
#define BUG_ON(condition) \
|
||||
do { \
|
||||
__asm__ __volatile__("tne $0, %0" : : "r" (condition)); \
|
||||
} while (0)
|
||||
|
||||
#define HAVE_ARCH_BUG_ON
|
||||
|
||||
#endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */
|
||||
|
||||
#endif
|
||||
|
||||
#include <asm-generic/bug.h>
|
||||
|
|
|
|||
|
|
@ -55,24 +55,13 @@ extern void (*flush_icache_range)(unsigned long start, unsigned long end);
|
|||
#define flush_cache_vmap(start, end) flush_cache_all()
|
||||
#define flush_cache_vunmap(start, end) flush_cache_all()
|
||||
|
||||
static inline void copy_to_user_page(struct vm_area_struct *vma,
|
||||
extern void copy_to_user_page(struct vm_area_struct *vma,
|
||||
struct page *page, unsigned long vaddr, void *dst, const void *src,
|
||||
unsigned long len)
|
||||
{
|
||||
if (cpu_has_dc_aliases)
|
||||
flush_cache_page(vma, vaddr, page_to_pfn(page));
|
||||
memcpy(dst, src, len);
|
||||
__flush_icache_page(vma, page);
|
||||
}
|
||||
unsigned long len);
|
||||
|
||||
static inline void copy_from_user_page(struct vm_area_struct *vma,
|
||||
extern void copy_from_user_page(struct vm_area_struct *vma,
|
||||
struct page *page, unsigned long vaddr, void *dst, const void *src,
|
||||
unsigned long len)
|
||||
{
|
||||
if (cpu_has_dc_aliases)
|
||||
flush_cache_page(vma, vaddr, page_to_pfn(page));
|
||||
memcpy(dst, src, len);
|
||||
}
|
||||
unsigned long len);
|
||||
|
||||
extern void (*flush_cache_sigtramp)(unsigned long addr);
|
||||
extern void (*flush_icache_all)(void);
|
||||
|
|
|
|||
|
|
@ -27,23 +27,22 @@
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
unsigned int csum_partial(const unsigned char *buff, int len, unsigned int sum);
|
||||
__wsum csum_partial(const void *buff, int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* this is a new version of the above that records errors it finds in *errp,
|
||||
* but continues and zeros the rest of the buffer.
|
||||
*/
|
||||
unsigned int csum_partial_copy_from_user(const unsigned char __user *src,
|
||||
unsigned char *dst, int len,
|
||||
unsigned int sum, int *errp);
|
||||
__wsum csum_partial_copy_from_user(const void __user *src,
|
||||
void *dst, int len,
|
||||
__wsum sum, int *errp);
|
||||
|
||||
/*
|
||||
* Copy and checksum to user
|
||||
*/
|
||||
#define HAVE_CSUM_COPY_USER
|
||||
static inline unsigned int csum_and_copy_to_user (const unsigned char *src,
|
||||
unsigned char __user *dst,
|
||||
int len, int sum,
|
||||
static inline __wsum csum_and_copy_to_user (const void *src, void __user *dst,
|
||||
int len, __wsum sum,
|
||||
int *err_ptr)
|
||||
{
|
||||
might_sleep();
|
||||
|
|
@ -51,7 +50,7 @@ static inline unsigned int csum_and_copy_to_user (const unsigned char *src,
|
|||
|
||||
if (copy_to_user(dst, src, len)) {
|
||||
*err_ptr = -EFAULT;
|
||||
return -1;
|
||||
return (__force __wsum)-1;
|
||||
}
|
||||
|
||||
return sum;
|
||||
|
|
@ -61,13 +60,13 @@ static inline unsigned int csum_and_copy_to_user (const unsigned char *src,
|
|||
* the same as csum_partial, but copies from user space (but on MIPS
|
||||
* we have just one address space, so this is identical to the above)
|
||||
*/
|
||||
unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *dst,
|
||||
int len, unsigned int sum);
|
||||
__wsum csum_partial_copy_nocheck(const void *src, void *dst,
|
||||
int len, __wsum sum);
|
||||
|
||||
/*
|
||||
* Fold a partial checksum without adding pseudo headers
|
||||
*/
|
||||
static inline unsigned short int csum_fold(unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
" .set push # csum_fold\n"
|
||||
|
|
@ -82,7 +81,7 @@ static inline unsigned short int csum_fold(unsigned int sum)
|
|||
: "=r" (sum)
|
||||
: "0" (sum));
|
||||
|
||||
return sum;
|
||||
return (__force __sum16)sum;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -92,10 +91,10 @@ static inline unsigned short int csum_fold(unsigned int sum)
|
|||
* By Jorge Cwik <jorge@laser.satlink.net>, adapted for linux by
|
||||
* Arnt Gulbrandsen.
|
||||
*/
|
||||
static inline unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl)
|
||||
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
|
||||
{
|
||||
unsigned int *word = (unsigned int *) iph;
|
||||
unsigned int *stop = word + ihl;
|
||||
const unsigned int *word = iph;
|
||||
const unsigned int *stop = word + ihl;
|
||||
unsigned int csum;
|
||||
int carry;
|
||||
|
||||
|
|
@ -123,9 +122,9 @@ static inline unsigned short ip_fast_csum(unsigned char *iph, unsigned int ihl)
|
|||
return csum_fold(csum);
|
||||
}
|
||||
|
||||
static inline unsigned int csum_tcpudp_nofold(unsigned long saddr,
|
||||
unsigned long daddr, unsigned short len, unsigned short proto,
|
||||
unsigned int sum)
|
||||
static inline __wsum csum_tcpudp_nofold(__be32 saddr,
|
||||
__be32 daddr, unsigned short len, unsigned short proto,
|
||||
__wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
" .set push # csum_tcpudp_nofold\n"
|
||||
|
|
@ -155,9 +154,9 @@ static inline unsigned int csum_tcpudp_nofold(unsigned long saddr,
|
|||
: "=r" (sum)
|
||||
: "0" (daddr), "r"(saddr),
|
||||
#ifdef __MIPSEL__
|
||||
"r" (((unsigned long)htons(len)<<16) + proto*256),
|
||||
"r" ((proto + len) << 8),
|
||||
#else
|
||||
"r" (((unsigned long)(proto)<<16) + len),
|
||||
"r" (proto + len),
|
||||
#endif
|
||||
"r" (sum));
|
||||
|
||||
|
|
@ -168,11 +167,10 @@ static inline unsigned int csum_tcpudp_nofold(unsigned long saddr,
|
|||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
|
||||
unsigned long daddr,
|
||||
static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
__wsum sum)
|
||||
{
|
||||
return csum_fold(csum_tcpudp_nofold(saddr, daddr, len, proto, sum));
|
||||
}
|
||||
|
|
@ -181,17 +179,16 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
|
|||
* this routine is used for miscellaneous IP-like checksums, mainly
|
||||
* in icmp.c
|
||||
*/
|
||||
static inline unsigned short ip_compute_csum(unsigned char * buff, int len)
|
||||
static inline __sum16 ip_compute_csum(const void *buff, int len)
|
||||
{
|
||||
return csum_fold(csum_partial(buff, len, 0));
|
||||
}
|
||||
|
||||
#define _HAVE_ARCH_IPV6_CSUM
|
||||
static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
|
||||
struct in6_addr *daddr,
|
||||
__u32 len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||
const struct in6_addr *daddr,
|
||||
__u32 len, unsigned short proto,
|
||||
__wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
" .set push # csum_ipv6_magic\n"
|
||||
|
|
|
|||
|
|
@ -22,12 +22,12 @@
|
|||
* Descriptor for a cache
|
||||
*/
|
||||
struct cache_desc {
|
||||
unsigned short linesz; /* Size of line in bytes */
|
||||
unsigned short ways; /* Number of ways */
|
||||
unsigned short sets; /* Number of lines per set */
|
||||
unsigned int waysize; /* Bytes per way */
|
||||
unsigned int waybit; /* Bits to select in a cache set */
|
||||
unsigned int flags; /* Flags describing cache properties */
|
||||
unsigned short sets; /* Number of lines per set */
|
||||
unsigned char ways; /* Number of ways */
|
||||
unsigned char linesz; /* Size of line in bytes */
|
||||
unsigned char waybit; /* Bits to select in a cache set */
|
||||
unsigned char flags; /* Flags describing cache properties */
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -82,11 +82,9 @@
|
|||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
extern u32 cached_kn02_csr;
|
||||
extern spinlock_t kn02_lock;
|
||||
extern void init_kn02_irqs(int base);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
7
include/asm-mips/device.h
Normal file
7
include/asm-mips/device.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
|
|
@ -82,27 +82,6 @@
|
|||
|
||||
#if (_MIPS_SZLONG == 64)
|
||||
|
||||
/*
|
||||
* Don't use this one in new code
|
||||
*/
|
||||
#define do_div64_32(res, high, low, base) ({ \
|
||||
unsigned int __quot, __mod; \
|
||||
unsigned long __div; \
|
||||
unsigned int __low, __high, __base; \
|
||||
\
|
||||
__high = (high); \
|
||||
__low = (low); \
|
||||
__div = __high; \
|
||||
__div = __div << 32 | __low; \
|
||||
__base = (base); \
|
||||
\
|
||||
__mod = __div % __base; \
|
||||
__div = __div / __base; \
|
||||
\
|
||||
__quot = __div; \
|
||||
(res) = __quot; \
|
||||
__mod; })
|
||||
|
||||
/*
|
||||
* Hey, we're already 64-bit, no
|
||||
* need to play games..
|
||||
|
|
|
|||
|
|
@ -74,7 +74,9 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef GENERIC_ISA_DMA_SUPPORT_BROKEN
|
||||
#define MAX_DMA_CHANNELS 8
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The maximum address in KSEG0 that we can perform a DMA transfer to on this
|
||||
|
|
|
|||
|
|
@ -45,8 +45,16 @@
|
|||
* fix-mapped?
|
||||
*/
|
||||
enum fixed_addresses {
|
||||
#define FIX_N_COLOURS 8
|
||||
FIX_CMAP_BEGIN,
|
||||
#ifdef CONFIG_MIPS_MT_SMTC
|
||||
FIX_CMAP_END = FIX_CMAP_BEGIN + (FIX_N_COLOURS * NR_CPUS),
|
||||
#else
|
||||
FIX_CMAP_END = FIX_CMAP_BEGIN + FIX_N_COLOURS,
|
||||
#endif
|
||||
#ifdef CONFIG_HIGHMEM
|
||||
FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
|
||||
/* reserved pte's for temporary kernel mappings */
|
||||
FIX_KMAP_BEGIN = FIX_CMAP_END + 1,
|
||||
FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
|
||||
#endif
|
||||
__end_of_fixed_addresses
|
||||
|
|
@ -70,9 +78,9 @@ extern void __set_fixmap (enum fixed_addresses idx,
|
|||
* at the top of mem..
|
||||
*/
|
||||
#if defined(CONFIG_CPU_TX39XX) || defined(CONFIG_CPU_TX49XX)
|
||||
#define FIXADDR_TOP (0xff000000UL - 0x2000)
|
||||
#define FIXADDR_TOP ((unsigned long)(long)(int)(0xff000000 - 0x20000))
|
||||
#else
|
||||
#define FIXADDR_TOP (0xffffe000UL)
|
||||
#define FIXADDR_TOP ((unsigned long)(long)(int)0xfffe0000)
|
||||
#endif
|
||||
#define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
|
||||
#define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
|
||||
|
|
|
|||
|
|
@ -451,6 +451,13 @@
|
|||
#define GT_SDRAM_OPMODE_OP_MODE 3
|
||||
#define GT_SDRAM_OPMODE_OP_CBR 4
|
||||
|
||||
#define GT_TC_CONTROL_ENTC0_SHF 0
|
||||
#define GT_TC_CONTROL_ENTC0_MSK (MSK(1) << GT_TC_CONTROL_ENTC0_SHF)
|
||||
#define GT_TC_CONTROL_ENTC0_BIT GT_TC_CONTROL_ENTC0_MSK
|
||||
#define GT_TC_CONTROL_SELTC0_SHF 1
|
||||
#define GT_TC_CONTROL_SELTC0_MSK (MSK(1) << GT_TC_CONTROL_SELTC0_SHF)
|
||||
#define GT_TC_CONTROL_SELTC0_BIT GT_TC_CONTROL_SELTC0_MSK
|
||||
|
||||
|
||||
#define GT_PCI0_BARE_SWSCS3BOOTDIS_SHF 0
|
||||
#define GT_PCI0_BARE_SWSCS3BOOTDIS_MSK (MSK(1) << GT_PCI0_BARE_SWSCS3BOOTDIS_SHF)
|
||||
|
|
@ -523,6 +530,13 @@
|
|||
#define GT_PCI0_CMD_SWORDSWAP_MSK (MSK(1) << GT_PCI0_CMD_SWORDSWAP_SHF)
|
||||
#define GT_PCI0_CMD_SWORDSWAP_BIT GT_PCI0_CMD_SWORDSWAP_MSK
|
||||
|
||||
#define GT_INTR_T0EXP_SHF 8
|
||||
#define GT_INTR_T0EXP_MSK (MSK(1) << GT_INTR_T0EXP_SHF)
|
||||
#define GT_INTR_T0EXP_BIT GT_INTR_T0EXP_MSK
|
||||
#define GT_INTR_RETRYCTR0_SHF 20
|
||||
#define GT_INTR_RETRYCTR0_MSK (MSK(1) << GT_INTR_RETRYCTR0_SHF)
|
||||
#define GT_INTR_RETRYCTR0_BIT GT_INTR_RETRYCTR0_MSK
|
||||
|
||||
/*
|
||||
* Misc
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ static inline void set_io_port_base(unsigned long base)
|
|||
* almost all conceivable cases a device driver should not be using
|
||||
* this function
|
||||
*/
|
||||
static inline unsigned long virt_to_phys(volatile void * address)
|
||||
static inline unsigned long virt_to_phys(volatile const void *address)
|
||||
{
|
||||
return (unsigned long)address - PAGE_OFFSET;
|
||||
}
|
||||
|
|
@ -172,7 +172,7 @@ extern unsigned long isa_slot_offset;
|
|||
#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
|
||||
|
||||
extern void __iomem * __ioremap(phys_t offset, phys_t size, unsigned long flags);
|
||||
extern void __iounmap(volatile void __iomem *addr);
|
||||
extern void __iounmap(const volatile void __iomem *addr);
|
||||
|
||||
static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
|
||||
unsigned long flags)
|
||||
|
|
@ -279,7 +279,7 @@ static inline void __iomem * __ioremap_mode(phys_t offset, unsigned long size,
|
|||
#define ioremap_uncached_accelerated(offset, size) \
|
||||
__ioremap_mode((offset), (size), _CACHE_UNCACHED_ACCELERATED)
|
||||
|
||||
static inline void iounmap(volatile void __iomem *addr)
|
||||
static inline void iounmap(const volatile void __iomem *addr)
|
||||
{
|
||||
#define __IS_KSEG1(addr) (((unsigned long)(addr) & ~0x1fffffffUL) == CKSEG1)
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,6 @@ static inline int irq_canonicalize(int irq)
|
|||
#define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
|
||||
#endif
|
||||
|
||||
extern asmlinkage unsigned int do_IRQ(unsigned int irq);
|
||||
|
||||
#ifdef CONFIG_MIPS_MT_SMTC
|
||||
/*
|
||||
* Clear interrupt mask handling "backstop" if irq_hwmask
|
||||
|
|
@ -43,8 +41,6 @@ do { \
|
|||
#define __DO_IRQ_SMTC_HOOK() do { } while (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PREEMPT
|
||||
|
||||
/*
|
||||
* do_IRQ handles all normal device IRQ's (the special
|
||||
* SMP cross-CPU interrupts have their own specific
|
||||
|
|
@ -57,12 +53,10 @@ do { \
|
|||
do { \
|
||||
irq_enter(); \
|
||||
__DO_IRQ_SMTC_HOOK(); \
|
||||
__do_IRQ((irq)); \
|
||||
generic_handle_irq(irq); \
|
||||
irq_exit(); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
||||
extern void arch_init_irq(void);
|
||||
extern void spurious_interrupt(void);
|
||||
|
||||
|
|
@ -74,4 +68,8 @@ extern int setup_irq_smtc(unsigned int irq, struct irqaction * new,
|
|||
unsigned long hwmask);
|
||||
#endif /* CONFIG_MIPS_MT_SMTC */
|
||||
|
||||
extern int allocate_irqno(void);
|
||||
extern void alloc_legacy_irqno(void);
|
||||
extern void free_irqno(unsigned int irq);
|
||||
|
||||
#endif /* _ASM_IRQ_H */
|
||||
|
|
|
|||
32
include/asm-mips/kexec.h
Normal file
32
include/asm-mips/kexec.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* kexec.h for kexec
|
||||
* Created by <nschichan@corp.free.fr> on Thu Oct 12 14:59:34 2006
|
||||
*
|
||||
* This source code is licensed under the GNU General Public License,
|
||||
* Version 2. See the file COPYING for more details.
|
||||
*/
|
||||
|
||||
#ifndef _MIPS_KEXEC
|
||||
# define _MIPS_KEXEC
|
||||
|
||||
/* Maximum physical address we can use pages from */
|
||||
#define KEXEC_SOURCE_MEMORY_LIMIT (0x20000000)
|
||||
/* Maximum address we can reach in physical address mode */
|
||||
#define KEXEC_DESTINATION_MEMORY_LIMIT (0x20000000)
|
||||
/* Maximum address we can use for the control code buffer */
|
||||
#define KEXEC_CONTROL_MEMORY_LIMIT (0x20000000)
|
||||
|
||||
#define KEXEC_CONTROL_CODE_SIZE 4096
|
||||
|
||||
/* The native architecture */
|
||||
#define KEXEC_ARCH KEXEC_ARCH_MIPS
|
||||
|
||||
#define MAX_NOTE_BYTES 1024
|
||||
|
||||
static inline void crash_setup_regs(struct pt_regs *newregs,
|
||||
struct pt_regs *oldregs)
|
||||
{
|
||||
/* Dummy implementation for now */
|
||||
}
|
||||
|
||||
#endif /* !_MIPS_KEXEC */
|
||||
|
|
@ -170,10 +170,8 @@ int __init auide_probe(void);
|
|||
static int auide_dma_host_on(ide_drive_t *drive);
|
||||
static int auide_dma_lostirq(ide_drive_t *drive);
|
||||
static int auide_dma_on(ide_drive_t *drive);
|
||||
static void auide_ddma_tx_callback(int irq, void *param,
|
||||
struct pt_regs *regs);
|
||||
static void auide_ddma_rx_callback(int irq, void *param,
|
||||
struct pt_regs *regs);
|
||||
static void auide_ddma_tx_callback(int irq, void *param);
|
||||
static void auide_ddma_rx_callback(int irq, void *param);
|
||||
static int auide_dma_off_quietly(ide_drive_t *drive);
|
||||
#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
|
||||
|
||||
|
|
|
|||
|
|
@ -67,34 +67,9 @@
|
|||
#define COBALT_BRD_ID_QUBE2 0x5
|
||||
#define COBALT_BRD_ID_RAQ2 0x6
|
||||
|
||||
/*
|
||||
* Galileo chipset access macros for the Cobalt. The base address for
|
||||
* the GT64111 chip is 0x14000000
|
||||
*
|
||||
* Most of this really should go into a separate GT64111 header file.
|
||||
*/
|
||||
#define GT64111_IO_BASE 0x10000000UL
|
||||
#define GT64111_IO_END 0x11ffffffUL
|
||||
#define GT64111_MEM_BASE 0x12000000UL
|
||||
#define GT64111_MEM_END 0x13ffffffUL
|
||||
#define GT64111_BASE 0x14000000UL
|
||||
#define GALILEO_REG(ofs) CKSEG1ADDR(GT64111_BASE + (unsigned long)(ofs))
|
||||
|
||||
#define GALILEO_INL(port) (*(volatile unsigned int *) GALILEO_REG(port))
|
||||
#define GALILEO_OUTL(val, port) \
|
||||
do { \
|
||||
*(volatile unsigned int *) GALILEO_REG(port) = (val); \
|
||||
} while (0)
|
||||
|
||||
#define GALILEO_INTR_T0EXP (1 << 8)
|
||||
#define GALILEO_INTR_RETRY_CTR (1 << 20)
|
||||
|
||||
#define GALILEO_ENTC0 0x01
|
||||
#define GALILEO_SELTC0 0x02
|
||||
|
||||
#define PCI_CFG_SET(devfn,where) \
|
||||
GALILEO_OUTL((0x80000000 | (PCI_SLOT (devfn) << 11) | \
|
||||
(PCI_FUNC (devfn) << 8) | (where)), GT_PCI0_CFGADDR_OFS)
|
||||
GT_WRITE(GT_PCI0_CFGADDR_OFS, (0x80000000 | (PCI_SLOT (devfn) << 11) | \
|
||||
(PCI_FUNC (devfn) << 8) | (where)))
|
||||
|
||||
#define COBALT_LED_PORT (*(volatile unsigned char *) CKSEG1ADDR(0x1c000000))
|
||||
# define COBALT_LED_BAR_LEFT (1 << 0) /* Qube */
|
||||
|
|
|
|||
|
|
@ -1 +1,27 @@
|
|||
/* there's something here ... in the dark */
|
||||
/*
|
||||
* Copyright (C) 2006 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#ifndef _COBALT_MACH_GT64120_H
|
||||
#define _COBALT_MACH_GT64120_H
|
||||
|
||||
/*
|
||||
* Cobalt uses GT64111. GT64111 is almost the same as GT64120.
|
||||
*/
|
||||
|
||||
#define GT64120_BASE CKSEG1ADDR(GT_DEF_BASE)
|
||||
|
||||
#endif /* _COBALT_MACH_GT64120_H */
|
||||
|
|
|
|||
|
|
@ -352,6 +352,8 @@ do { \
|
|||
#define write_vpe_c0_vpecontrol(val) mttc0(1, 1, val)
|
||||
#define read_vpe_c0_vpeconf0() mftc0(1, 2)
|
||||
#define write_vpe_c0_vpeconf0(val) mttc0(1, 2, val)
|
||||
#define read_vpe_c0_count() mftc0(9, 0)
|
||||
#define write_vpe_c0_count(val) mttc0(9, 0, val)
|
||||
#define read_vpe_c0_status() mftc0(12, 0)
|
||||
#define write_vpe_c0_status(val) mttc0(12, 0, val)
|
||||
#define read_vpe_c0_cause() mftc0(13, 0)
|
||||
|
|
|
|||
|
|
@ -545,62 +545,6 @@
|
|||
#define MIPS_FPIR_L (_ULCAST_(1) << 21)
|
||||
#define MIPS_FPIR_F64 (_ULCAST_(1) << 22)
|
||||
|
||||
/*
|
||||
* R10000 performance counter definitions.
|
||||
*
|
||||
* FIXME: The R10000 performance counter opens a nice way to implement CPU
|
||||
* time accounting with a precission of one cycle. I don't have
|
||||
* R10000 silicon but just a manual, so ...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Events counted by counter #0
|
||||
*/
|
||||
#define CE0_CYCLES 0
|
||||
#define CE0_INSN_ISSUED 1
|
||||
#define CE0_LPSC_ISSUED 2
|
||||
#define CE0_S_ISSUED 3
|
||||
#define CE0_SC_ISSUED 4
|
||||
#define CE0_SC_FAILED 5
|
||||
#define CE0_BRANCH_DECODED 6
|
||||
#define CE0_QW_WB_SECONDARY 7
|
||||
#define CE0_CORRECTED_ECC_ERRORS 8
|
||||
#define CE0_ICACHE_MISSES 9
|
||||
#define CE0_SCACHE_I_MISSES 10
|
||||
#define CE0_SCACHE_I_WAY_MISSPREDICTED 11
|
||||
#define CE0_EXT_INTERVENTIONS_REQ 12
|
||||
#define CE0_EXT_INVALIDATE_REQ 13
|
||||
#define CE0_VIRTUAL_COHERENCY_COND 14
|
||||
#define CE0_INSN_GRADUATED 15
|
||||
|
||||
/*
|
||||
* Events counted by counter #1
|
||||
*/
|
||||
#define CE1_CYCLES 0
|
||||
#define CE1_INSN_GRADUATED 1
|
||||
#define CE1_LPSC_GRADUATED 2
|
||||
#define CE1_S_GRADUATED 3
|
||||
#define CE1_SC_GRADUATED 4
|
||||
#define CE1_FP_INSN_GRADUATED 5
|
||||
#define CE1_QW_WB_PRIMARY 6
|
||||
#define CE1_TLB_REFILL 7
|
||||
#define CE1_BRANCH_MISSPREDICTED 8
|
||||
#define CE1_DCACHE_MISS 9
|
||||
#define CE1_SCACHE_D_MISSES 10
|
||||
#define CE1_SCACHE_D_WAY_MISSPREDICTED 11
|
||||
#define CE1_EXT_INTERVENTION_HITS 12
|
||||
#define CE1_EXT_INVALIDATE_REQ 13
|
||||
#define CE1_SP_HINT_TO_CEXCL_SC_BLOCKS 14
|
||||
#define CE1_SP_HINT_TO_SHARED_SC_BLOCKS 15
|
||||
|
||||
/*
|
||||
* These flags define in which privilege mode the counters count events
|
||||
*/
|
||||
#define CEB_USER 8 /* Count events in user mode, EXL = ERL = 0 */
|
||||
#define CEB_SUPERVISOR 4 /* Count events in supvervisor mode EXL = ERL = 0 */
|
||||
#define CEB_KERNEL 2 /* Count events in kernel mode EXL = ERL = 0 */
|
||||
#define CEB_EXL 1 /* Count events with EXL = 1, ERL = 0 */
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@
|
|||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
#include <linux/pfn.h>
|
||||
#include <asm/cpu-features.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
extern void clear_page(void * page);
|
||||
extern void copy_page(void * to, void * from);
|
||||
|
|
@ -134,8 +136,14 @@ typedef struct { unsigned long pgprot; } pgprot_t;
|
|||
/* to align the pointer to the (next) page boundary */
|
||||
#define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK)
|
||||
|
||||
#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
|
||||
#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
|
||||
#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64)
|
||||
#define __pa_page_offset(x) ((unsigned long)(x) < CKSEG0 ? PAGE_OFFSET : CKSEG0)
|
||||
#else
|
||||
#define __pa_page_offset(x) PAGE_OFFSET
|
||||
#endif
|
||||
#define __pa(x) ((unsigned long)(x) - __pa_page_offset(x))
|
||||
#define __pa_symbol(x) __pa(RELOC_HIDE((unsigned long)(x),0))
|
||||
#define __va(x) ((void *)((unsigned long)(x) + PAGE_OFFSET))
|
||||
|
||||
#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
|
||||
|
||||
|
|
@ -160,8 +168,8 @@ typedef struct { unsigned long pgprot; } pgprot_t;
|
|||
|
||||
#endif
|
||||
|
||||
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
|
||||
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
|
||||
#define virt_to_page(kaddr) pfn_to_page(PFN_DOWN(virt_to_phys(kaddr)))
|
||||
#define virt_addr_valid(kaddr) pfn_valid(PFN_DOWN(virt_to_phys(kaddr)))
|
||||
|
||||
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
|
||||
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
|
|||
|
||||
ret = (pgd_t *) __get_free_pages(GFP_KERNEL, PGD_ORDER);
|
||||
if (ret) {
|
||||
init = pgd_offset(&init_mm, 0);
|
||||
init = pgd_offset(&init_mm, 0UL);
|
||||
pgd_init((unsigned long)ret);
|
||||
memcpy(ret + USER_PTRS_PER_PGD, init + USER_PTRS_PER_PGD,
|
||||
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#include <asm/addrspace.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/cachectl.h>
|
||||
#include <asm/fixmap.h>
|
||||
|
||||
#include <asm-generic/pgtable-nopud.h>
|
||||
|
||||
|
|
@ -103,6 +104,13 @@
|
|||
#define VMALLOC_START MAP_BASE
|
||||
#define VMALLOC_END \
|
||||
(VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE)
|
||||
#if defined(CONFIG_MODULES) && !defined(CONFIG_BUILD_ELF64) && \
|
||||
VMALLOC_START != CKSSEG
|
||||
/* Load modules into 32bit-compatible segment. */
|
||||
#define MODULE_START CKSSEG
|
||||
#define MODULE_END (FIXADDR_START-2*PAGE_SIZE)
|
||||
extern pgd_t module_pg_dir[PTRS_PER_PGD];
|
||||
#endif
|
||||
|
||||
#define pte_ERROR(e) \
|
||||
printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
|
||||
|
|
@ -174,7 +182,12 @@ static inline void pud_clear(pud_t *pudp)
|
|||
#define __pmd_offset(address) pmd_index(address)
|
||||
|
||||
/* to find an entry in a kernel page-table-directory */
|
||||
#define pgd_offset_k(address) pgd_offset(&init_mm, 0)
|
||||
#ifdef MODULE_START
|
||||
#define pgd_offset_k(address) \
|
||||
((address) >= MODULE_START ? module_pg_dir : pgd_offset(&init_mm, 0UL))
|
||||
#else
|
||||
#define pgd_offset_k(address) pgd_offset(&init_mm, 0UL)
|
||||
#endif
|
||||
|
||||
#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
|
||||
#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ extern unsigned long empty_zero_page;
|
|||
extern unsigned long zero_page_mask;
|
||||
|
||||
#define ZERO_PAGE(vaddr) \
|
||||
(virt_to_page(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask)))
|
||||
(virt_to_page((void *)(empty_zero_page + (((unsigned long)(vaddr)) & zero_page_mask))))
|
||||
|
||||
#define __HAVE_ARCH_MOVE_PTE
|
||||
#define move_pte(pte, prot, old_addr, new_addr) \
|
||||
|
|
|
|||
|
|
@ -80,8 +80,6 @@ struct pt_regs {
|
|||
#define instruction_pointer(regs) ((regs)->cp0_epc)
|
||||
#define profile_pc(regs) instruction_pointer(regs)
|
||||
|
||||
extern void show_regs(struct pt_regs *);
|
||||
|
||||
extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ extern void sb1250_mask_irq(int cpu, int irq);
|
|||
extern void sb1250_unmask_irq(int cpu, int irq);
|
||||
extern void sb1250_smp_finish(void);
|
||||
|
||||
extern void bcm1480_hpt_setup(void);
|
||||
extern void bcm1480_time_init(void);
|
||||
extern unsigned long bcm1480_gettimeoffset(void);
|
||||
extern void bcm1480_mask_irq(int cpu, int irq);
|
||||
extern void bcm1480_unmask_irq(int cpu, int irq);
|
||||
extern void bcm1480_smp_finish(void);
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
|
|||
{
|
||||
__u64 retval;
|
||||
|
||||
if (cpu_has_llsc) {
|
||||
if (cpu_has_llsc && R10000_LLSC_WAR) {
|
||||
__asm__ __volatile__(
|
||||
" .set push \n"
|
||||
" .set noat \n"
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include <linux/ptrace.h>
|
||||
#include <linux/rtc.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/clocksource.h>
|
||||
|
||||
extern spinlock_t rtc_lock;
|
||||
|
||||
|
|
@ -44,11 +45,10 @@ extern int (*mips_timer_state)(void);
|
|||
extern void (*mips_timer_ack)(void);
|
||||
|
||||
/*
|
||||
* High precision timer functions.
|
||||
* If mips_hpt_read is NULL, an R4k-compatible timer setup is attempted.
|
||||
* High precision timer clocksource.
|
||||
* If .read is NULL, an R4k-compatible timer setup is attempted.
|
||||
*/
|
||||
extern unsigned int (*mips_hpt_read)(void);
|
||||
extern void (*mips_hpt_init)(unsigned int);
|
||||
extern struct clocksource clocksource_mips;
|
||||
|
||||
/*
|
||||
* to_tm() converts system time back to (year, mon, day, hour, min, sec).
|
||||
|
|
@ -57,13 +57,6 @@ extern void (*mips_hpt_init)(unsigned int);
|
|||
*/
|
||||
extern void to_tm(unsigned long tim, struct rtc_time *tm);
|
||||
|
||||
/*
|
||||
* do_gettimeoffset(). By default, this func pointer points to
|
||||
* do_null_gettimeoffset(), which leads to the same resolution as HZ.
|
||||
* Higher resolution versions are available, which give ~1us resolution.
|
||||
*/
|
||||
extern unsigned long (*do_gettimeoffset)(void);
|
||||
|
||||
/*
|
||||
* high-level timer interrupt routines.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -331,16 +331,19 @@
|
|||
#define __NR_move_pages (__NR_Linux + 308)
|
||||
#define __NR_set_robust_list (__NR_Linux + 309)
|
||||
#define __NR_get_robust_list (__NR_Linux + 310)
|
||||
#define __NR_kexec_load (__NR_Linux + 311)
|
||||
#define __NR_getcpu (__NR_Linux + 312)
|
||||
#define __NR_epoll_pwait (__NR_Linux + 313)
|
||||
|
||||
/*
|
||||
* Offset of the last Linux o32 flavoured syscall
|
||||
*/
|
||||
#define __NR_Linux_syscalls 310
|
||||
#define __NR_Linux_syscalls 313
|
||||
|
||||
#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
|
||||
|
||||
#define __NR_O32_Linux 4000
|
||||
#define __NR_O32_Linux_syscalls 310
|
||||
#define __NR_O32_Linux_syscalls 313
|
||||
|
||||
#if _MIPS_SIM == _MIPS_SIM_ABI64
|
||||
|
||||
|
|
@ -618,16 +621,19 @@
|
|||
#define __NR_move_pages (__NR_Linux + 267)
|
||||
#define __NR_set_robust_list (__NR_Linux + 268)
|
||||
#define __NR_get_robust_list (__NR_Linux + 269)
|
||||
#define __NR_kexec_load (__NR_Linux + 270)
|
||||
#define __NR_getcpu (__NR_Linux + 271)
|
||||
#define __NR_epoll_pwait (__NR_Linux + 272)
|
||||
|
||||
/*
|
||||
* Offset of the last Linux 64-bit flavoured syscall
|
||||
*/
|
||||
#define __NR_Linux_syscalls 269
|
||||
#define __NR_Linux_syscalls 272
|
||||
|
||||
#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
|
||||
|
||||
#define __NR_64_Linux 5000
|
||||
#define __NR_64_Linux_syscalls 269
|
||||
#define __NR_64_Linux_syscalls 272
|
||||
|
||||
#if _MIPS_SIM == _MIPS_SIM_NABI32
|
||||
|
||||
|
|
@ -909,16 +915,19 @@
|
|||
#define __NR_move_pages (__NR_Linux + 271)
|
||||
#define __NR_set_robust_list (__NR_Linux + 272)
|
||||
#define __NR_get_robust_list (__NR_Linux + 273)
|
||||
#define __NR_kexec_load (__NR_Linux + 274)
|
||||
#define __NR_getcpu (__NR_Linux + 275)
|
||||
#define __NR_epoll_pwait (__NR_Linux + 276)
|
||||
|
||||
/*
|
||||
* Offset of the last N32 flavoured syscall
|
||||
*/
|
||||
#define __NR_Linux_syscalls 273
|
||||
#define __NR_Linux_syscalls 276
|
||||
|
||||
#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
|
||||
|
||||
#define __NR_N32_Linux 6000
|
||||
#define __NR_N32_Linux_syscalls 273
|
||||
#define __NR_N32_Linux_syscalls 276
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
|
|
@ -1186,6 +1195,7 @@ type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \
|
|||
#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
|
||||
|
||||
|
||||
#define __ARCH_OMIT_COMPAT_SYS_GETDENTS64
|
||||
#define __ARCH_WANT_IPC_PARSE_VERSION
|
||||
#define __ARCH_WANT_OLD_READDIR
|
||||
#define __ARCH_WANT_SYS_ALARM
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ extern void vr41xx_mask_clock(vr41xx_clock_t clock);
|
|||
* Interrupt Control Unit
|
||||
*/
|
||||
extern int vr41xx_set_intassign(unsigned int irq, unsigned char intassign);
|
||||
extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int, struct pt_regs *));
|
||||
extern int cascade_irq(unsigned int irq, int (*get_irq)(unsigned int));
|
||||
|
||||
#define PIUINT_COMMAND 0x0040
|
||||
#define PIUINT_DATA 0x0020
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* it's best to have buff aligned on a 32-bit boundary
|
||||
*/
|
||||
extern unsigned int csum_partial(const unsigned char *, int, unsigned int);
|
||||
extern __wsum csum_partial(const void *, int, __wsum);
|
||||
|
||||
/*
|
||||
* The same as csum_partial, but copies from src while it checksums.
|
||||
|
|
@ -23,15 +23,14 @@ extern unsigned int csum_partial(const unsigned char *, int, unsigned int);
|
|||
* Here even more important to align src and dst on a 32-bit (or even
|
||||
* better 64-bit) boundary
|
||||
*/
|
||||
extern unsigned int csum_partial_copy_nocheck(const unsigned char *, unsigned char *,
|
||||
int, unsigned int);
|
||||
extern __wsum csum_partial_copy_nocheck(const void *, void *, int, __wsum);
|
||||
|
||||
/*
|
||||
* this is a new version of the above that records errors it finds in *errp,
|
||||
* but continues and zeros the rest of the buffer.
|
||||
*/
|
||||
extern unsigned int csum_partial_copy_from_user(const unsigned char __user *src,
|
||||
unsigned char *dst, int len, unsigned int sum, int *errp);
|
||||
extern __wsum csum_partial_copy_from_user(const void __user *src,
|
||||
void *dst, int len, __wsum sum, int *errp);
|
||||
|
||||
/*
|
||||
* Optimized for IP headers, which always checksum on 4 octet boundaries.
|
||||
|
|
@ -39,11 +38,10 @@ extern unsigned int csum_partial_copy_from_user(const unsigned char __user *src,
|
|||
* Written by Randolph Chung <tausq@debian.org>, and then mucked with by
|
||||
* LaMont Jones <lamont@debian.org>
|
||||
*/
|
||||
static inline unsigned short ip_fast_csum(unsigned char * iph,
|
||||
unsigned int ihl) {
|
||||
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
|
||||
{
|
||||
unsigned int sum;
|
||||
|
||||
|
||||
__asm__ __volatile__ (
|
||||
" ldws,ma 4(%1), %0\n"
|
||||
" addib,<= -4, %2, 2f\n"
|
||||
|
|
@ -69,27 +67,27 @@ static inline unsigned short ip_fast_csum(unsigned char * iph,
|
|||
: "1" (iph), "2" (ihl)
|
||||
: "r19", "r20", "r21" );
|
||||
|
||||
return(sum);
|
||||
return (__force __sum16)sum;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fold a partial checksum
|
||||
*/
|
||||
static inline unsigned int csum_fold(unsigned int sum)
|
||||
static inline __sum16 csum_fold(__wsum csum)
|
||||
{
|
||||
u32 sum = (__force u32)csum;
|
||||
/* add the swapped two 16-bit halves of sum,
|
||||
a possible carry from adding the two 16-bit halves,
|
||||
will carry from the lower half into the upper half,
|
||||
giving us the correct sum in the upper half. */
|
||||
sum += (sum << 16) + (sum >> 16);
|
||||
return (~sum) >> 16;
|
||||
return (__force __sum16)(~sum >> 16);
|
||||
}
|
||||
|
||||
static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
|
||||
unsigned long daddr,
|
||||
static inline __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
__wsum sum)
|
||||
{
|
||||
__asm__(
|
||||
" add %1, %0, %0\n"
|
||||
|
|
@ -97,19 +95,18 @@ static inline unsigned long csum_tcpudp_nofold(unsigned long saddr,
|
|||
" addc %3, %0, %0\n"
|
||||
" addc %%r0, %0, %0\n"
|
||||
: "=r" (sum)
|
||||
: "r" (daddr), "r"(saddr), "r"((proto<<16)+len), "0"(sum));
|
||||
return sum;
|
||||
: "r" (daddr), "r"(saddr), "r"(proto+len), "0"(sum));
|
||||
return sum;
|
||||
}
|
||||
|
||||
/*
|
||||
* computes the checksum of the TCP/UDP pseudo-header
|
||||
* returns a 16-bit checksum, already complemented
|
||||
*/
|
||||
static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
|
||||
unsigned long daddr,
|
||||
static inline __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
|
||||
unsigned short len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
__wsum sum)
|
||||
{
|
||||
return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
|
||||
}
|
||||
|
|
@ -118,17 +115,17 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr,
|
|||
* this routine is used for miscellaneous IP-like checksums, mainly
|
||||
* in icmp.c
|
||||
*/
|
||||
static inline unsigned short ip_compute_csum(unsigned char * buf, int len) {
|
||||
static inline __sum16 ip_compute_csum(const void *buf, int len)
|
||||
{
|
||||
return csum_fold (csum_partial(buf, len, 0));
|
||||
}
|
||||
|
||||
|
||||
#define _HAVE_ARCH_IPV6_CSUM
|
||||
static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
|
||||
struct in6_addr *daddr,
|
||||
__u16 len,
|
||||
unsigned short proto,
|
||||
unsigned int sum)
|
||||
static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
||||
const struct in6_addr *daddr,
|
||||
__u32 len, unsigned short proto,
|
||||
__wsum sum)
|
||||
{
|
||||
__asm__ __volatile__ (
|
||||
|
||||
|
|
@ -193,9 +190,9 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
|
|||
* Copy and checksum to user
|
||||
*/
|
||||
#define HAVE_CSUM_COPY_USER
|
||||
static __inline__ unsigned int csum_and_copy_to_user (const unsigned char *src,
|
||||
unsigned char __user *dst,
|
||||
int len, int sum,
|
||||
static __inline__ __wsum csum_and_copy_to_user(const void *src,
|
||||
void __user *dst,
|
||||
int len, __wsum sum,
|
||||
int *err_ptr)
|
||||
{
|
||||
/* code stolen from include/asm-mips64 */
|
||||
|
|
@ -203,7 +200,7 @@ static __inline__ unsigned int csum_and_copy_to_user (const unsigned char *src,
|
|||
|
||||
if (copy_to_user(dst, src, len)) {
|
||||
*err_ptr = -EFAULT;
|
||||
return -1;
|
||||
return (__force __wsum)-1;
|
||||
}
|
||||
|
||||
return sum;
|
||||
|
|
|
|||
7
include/asm-parisc/device.h
Normal file
7
include/asm-parisc/device.h
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/*
|
||||
* Arch specific extensions to struct device
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
#include <asm-generic/device.h>
|
||||
|
||||
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
/*
|
||||
** DMA_CHUNK_SIZE is used by the SCSI mid-layer to break up
|
||||
** (or rather not merge) DMA's into managable chunks.
|
||||
** (or rather not merge) DMAs into manageable chunks.
|
||||
** On parisc, this is more of the software/tuning constraint
|
||||
** rather than the HW. I/O MMU allocation alogorithms can be
|
||||
** faster with smaller size is (to some degree).
|
||||
** rather than the HW. I/O MMU allocation algorithms can be
|
||||
** faster with smaller sizes (to some degree).
|
||||
*/
|
||||
#define DMA_CHUNK_SIZE (BITS_PER_LONG*PAGE_SIZE)
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ extern int parisc_bus_is_phys; /* in arch/parisc/kernel/setup.c */
|
|||
/*
|
||||
** Most PCI devices (eg Tulip, NCR720) also export the same registers
|
||||
** to both MMIO and I/O port space. Due to poor performance of I/O Port
|
||||
** access under HP PCI bus adapters, strongly reccomend use of MMIO
|
||||
** access under HP PCI bus adapters, strongly recommend the use of MMIO
|
||||
** address space.
|
||||
**
|
||||
** While I'm at it more PA programming notes:
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#endif
|
||||
|
||||
/*
|
||||
** The number of pdir entries to "free" before issueing
|
||||
** The number of pdir entries to "free" before issuing
|
||||
** a read to PCOM register to flush out PCOM writes.
|
||||
** Interacts with allocation granularity (ie 4 or 8 entries
|
||||
** allocated and free'd/purged at a time might make this
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue