3 * Copyright (C) 2010 - 2013 UNISYS CORPORATION
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
14 * NON INFRINGEMENT. See the GNU General Public License for more
19 * This is an implementation of memory regions that can be used to read/write
20 * channel memory (in main memory of the host system) from code running in
21 * a virtual partition.
24 #include "memregion.h"
26 #define MYDRVNAME "memregion"
29 visor_memregion_read(struct memregion *memregion, ulong offset, void *dest,
32 if (offset + nbytes > memregion->nbytes)
35 memcpy_fromio(dest, memregion->mapped + offset, nbytes);
38 EXPORT_SYMBOL_GPL(visor_memregion_read);
41 visor_memregion_write(struct memregion *memregion, ulong offset, void *src,
44 if (offset + nbytes > memregion->nbytes)
47 memcpy_toio(memregion->mapped + offset, src, nbytes);
50 EXPORT_SYMBOL_GPL(visor_memregion_write);