ia64/linux-2.6.18-xen.hg

annotate lib/iomap_copy.c @ 847:ad4d307bf9ce

net sfc: Update sfc and sfc_resource driver to latest release

...and update sfc_netfront, sfc_netback, sfc_netutil for any API changes

sfc_netback: Fix asymmetric use of SFC buffer table alloc and free
sfc_netback: Clean up if no SFC accel device found
sfc_netback: Gracefully handle case where page grant fails
sfc_netback: Disable net acceleration if the physical link goes down
sfc_netfront: Less verbose error messages, more verbose counters for
rx discard errors
sfc_netfront: Gracefully handle case where SFC netfront fails during
initialisation

Signed-off-by: Kieran Mansley <kmansley@solarflare.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 31 11:59:10 2009 +0100 (2009-03-31)
parents 831230e53067
children
rev   line source
ian@0 1 /*
ian@0 2 * Copyright 2006 PathScale, Inc. All Rights Reserved.
ian@0 3 *
ian@0 4 * This file is free software; you can redistribute it and/or modify
ian@0 5 * it under the terms of version 2 of the GNU General Public License
ian@0 6 * as published by the Free Software Foundation.
ian@0 7 *
ian@0 8 * This program is distributed in the hope that it will be useful,
ian@0 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ian@0 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ian@0 11 * GNU General Public License for more details.
ian@0 12 *
ian@0 13 * You should have received a copy of the GNU General Public License
ian@0 14 * along with this program; if not, write to the Free Software Foundation,
ian@0 15 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
ian@0 16 */
ian@0 17
ian@0 18 #include <linux/module.h>
ian@0 19 #include <linux/io.h>
ian@0 20
ian@0 21 /**
ian@0 22 * __iowrite32_copy - copy data to MMIO space, in 32-bit units
ian@0 23 * @to: destination, in MMIO space (must be 32-bit aligned)
ian@0 24 * @from: source (must be 32-bit aligned)
ian@0 25 * @count: number of 32-bit quantities to copy
ian@0 26 *
ian@0 27 * Copy data from kernel space to MMIO space, in units of 32 bits at a
ian@0 28 * time. Order of access is not guaranteed, nor is a memory barrier
ian@0 29 * performed afterwards.
ian@0 30 */
ian@0 31 void __attribute__((weak)) __iowrite32_copy(void __iomem *to,
ian@0 32 const void *from,
ian@0 33 size_t count)
ian@0 34 {
ian@0 35 u32 __iomem *dst = to;
ian@0 36 const u32 *src = from;
ian@0 37 const u32 *end = src + count;
ian@0 38
ian@0 39 while (src < end)
ian@0 40 __raw_writel(*src++, dst++);
ian@0 41 }
ian@0 42 EXPORT_SYMBOL_GPL(__iowrite32_copy);
ian@0 43
ian@0 44 /**
ian@0 45 * __iowrite64_copy - copy data to MMIO space, in 64-bit or 32-bit units
ian@0 46 * @to: destination, in MMIO space (must be 64-bit aligned)
ian@0 47 * @from: source (must be 64-bit aligned)
ian@0 48 * @count: number of 64-bit quantities to copy
ian@0 49 *
ian@0 50 * Copy data from kernel space to MMIO space, in units of 32 or 64 bits at a
ian@0 51 * time. Order of access is not guaranteed, nor is a memory barrier
ian@0 52 * performed afterwards.
ian@0 53 */
ian@0 54 void __attribute__((weak)) __iowrite64_copy(void __iomem *to,
ian@0 55 const void *from,
ian@0 56 size_t count)
ian@0 57 {
ian@0 58 #ifdef CONFIG_64BIT
ian@0 59 u64 __iomem *dst = to;
ian@0 60 const u64 *src = from;
ian@0 61 const u64 *end = src + count;
ian@0 62
ian@0 63 while (src < end)
ian@0 64 __raw_writeq(*src++, dst++);
ian@0 65 #else
ian@0 66 __iowrite32_copy(to, from, count * 2);
ian@0 67 #endif
ian@0 68 }
ian@0 69
ian@0 70 EXPORT_SYMBOL_GPL(__iowrite64_copy);