aboutsummaryrefslogtreecommitdiffstats
path: root/mm/tiny-shmem.c
Commit message (Expand)AuthorAge
* [PATCH] mm/{,tiny-}shmem.c cleanupsAdrian Bunk2007-03-01
* [PATCH] struct path: convert mmJosef Sipek2006-12-08
* [PATCH] devfs: Remove the devfs_fs_kernel.h file from the treeGreg Kroah-Hartman2006-06-26
* [PATCH] devfs: Remove devfs_mk_dir() function from the kernel treeGreg Kroah-Hartman2006-06-26
* [PATCH] do_truncate() call fix in tiny-shmem.cCatalin Marinas2006-01-12
* [PATCH] NOMMU: Make SYSV IPC SHM use ramfs facilities on NOMMUDavid Howells2006-01-06
* [PATCH] Error checks omitted in init_tmpfs() in mm/tiny-shmem.cMatt Mackall2005-10-30
* Linux-2.6.12-rc2v2.6.12-rc2Linus Torvalds2005-04-16
-17 17:05:31 -0400 committer James Bottomley <jejb@titanic> 2005-04-18 14:50:53 -0400 lpfc: add Emulex FC driver version 8.0.28' href='/cgit/cgit.cgi/litmus-rt.git/commit/drivers/scsi/lpfc/lpfc_compat.h?h=v2.6.31-rc1&id=dea3101e0a5c897d2c9351a7444e139db9f40247'>dea3101e0a5c
44456d37b59d
dea3101e0a5c
44456d37b59d
dea3101e0a5c




























































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

                                                                    


                                                                    


                                                                    









                                                                    


                                                                     










                                                                       
                          
 
                   




























































                                                                         
/*******************************************************************
 * This file is part of the Emulex Linux Device Driver for         *
 * Fibre Channel Host Bus Adapters.                                *
 * Copyright (C) 2004-2005 Emulex.  All rights reserved.           *
 * EMULEX and SLI are trademarks of Emulex.                        *
 * www.emulex.com                                                  *
 *                                                                 *
 * This program is free software; you can redistribute it and/or   *
 * modify it under the terms of version 2 of the GNU General       *
 * Public License as published by the Free Software Foundation.    *
 * This program is distributed in the hope that it will be useful. *
 * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND          *
 * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,  *
 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE      *
 * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
 * TO BE LEGALLY INVALID.  See the GNU General Public License for  *
 * more details, a copy of which can be found in the file COPYING  *
 * included with this package.                                     *
 *******************************************************************/

/*
 * This file provides macros to aid compilation in the Linux 2.4 kernel
 * over various platform architectures.
 */

/*******************************************************************
Note: HBA's SLI memory contains little-endian LW.
Thus to access it from a little-endian host,
memcpy_toio() and memcpy_fromio() can be used.
However on a big-endian host, copy 4 bytes at a time,
using writel() and readl().
 *******************************************************************/
#include <asm/byteorder.h>

#ifdef __BIG_ENDIAN

static inline void
lpfc_memcpy_to_slim(void __iomem *dest, void *src, unsigned int bytes)
{
	uint32_t __iomem *dest32;
	uint32_t *src32;
	unsigned int four_bytes;


	dest32  = (uint32_t __iomem *) dest;
	src32  = (uint32_t *) src;

	/* write input bytes, 4 bytes at a time */
	for (four_bytes = bytes /4; four_bytes > 0; four_bytes--) {
		writel( *src32, dest32);
		readl(dest32); /* flush */
		dest32++;
		src32++;
	}

	return;
}

static inline void
lpfc_memcpy_from_slim( void *dest, void __iomem *src, unsigned int bytes)
{
	uint32_t *dest32;
	uint32_t __iomem *src32;
	unsigned int four_bytes;


	dest32  = (uint32_t *) dest;
	src32  = (uint32_t __iomem *) src;

	/* read input bytes, 4 bytes at a time */
	for (four_bytes = bytes /4; four_bytes > 0; four_bytes--) {
		*dest32 = readl( src32);
		dest32++;
		src32++;
	}

	return;
}

#else

static inline void
lpfc_memcpy_to_slim( void __iomem *dest, void *src, unsigned int bytes)
{
	/* actually returns 1 byte past dest */
	memcpy_toio( dest, src, bytes);
}

static inline void
lpfc_memcpy_from_slim( void *dest, void __iomem *src, unsigned int bytes)
{
	/* actually returns 1 byte past dest */
	memcpy_fromio( dest, src, bytes);
}

#endif	/* __BIG_ENDIAN */