aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorutil/memregion.h
blob: bb122dbeafbc470ceaa7f328e3df3856aecf6bf1 (plain) (blame)
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
/* memregion.h
 *
 * Copyright � 2010 - 2013 UNISYS CORPORATION
 * All rights reserved.
 *
 * 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, GOOD TITLE or
 * NON INFRINGEMENT.  See the GNU General Public License for more
 * details.
 */

#ifndef __MEMREGION_H__
#define __MEMREGION_H__

#include "timskmod.h"

/* MEMREGION is an opaque structure to users.
 * Fields are declared only in the implementation .c files.
 */
typedef struct MEMREGION_Tag MEMREGION;

MEMREGION *visor_memregion_create(HOSTADDRESS physaddr, ulong nbytes);
MEMREGION *visor_memregion_create_overlapped(MEMREGION *parent,
					     ulong offset, ulong nbytes);
int visor_memregion_resize(MEMREGION *memregion, ulong newsize);
int visor_memregion_read(MEMREGION *memregion,
		   ulong offset, void *dest, ulong nbytes);
int visor_memregion_write(MEMREGION *memregion,
			  ulong offset, void *src, ulong nbytes);
void visor_memregion_destroy(MEMREGION *memregion);
HOSTADDRESS visor_memregion_get_physaddr(MEMREGION *memregion);
ulong visor_memregion_get_nbytes(MEMREGION *memregion);
void memregion_dump(MEMREGION *memregion, char *s,
		    ulong off, ulong len, struct seq_file *seq);
void *visor_memregion_get_pointer(MEMREGION *memregion);

#endif