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
18 #ifndef __MEMREGION_H__
19 #define __MEMREGION_H__
23 /* struct memregion is an opaque structure to users.
24 * Fields are declared only in the implementation .c files.
28 struct memregion *visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes);
29 struct memregion *visor_memregion_create_overlapped(struct memregion *parent,
30 ulong offset, ulong nbytes);
31 int visor_memregion_resize(struct memregion *memregion, ulong newsize);
32 int visor_memregion_read(struct memregion *memregion,
33 ulong offset, void *dest, ulong nbytes);
34 int visor_memregion_write(struct memregion *memregion,
35 ulong offset, void *src, ulong nbytes);
36 void visor_memregion_destroy(struct memregion *memregion);
37 HOSTADDRESS visor_memregion_get_physaddr(struct memregion *memregion);
38 ulong visor_memregion_get_nbytes(struct memregion *memregion);
39 void memregion_dump(struct memregion *memregion, char *s,
40 ulong off, ulong len, struct seq_file *seq);
41 void __iomem *visor_memregion_get_pointer(struct memregion *memregion);