aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorchipset/controlvm_direct.c
blob: b911ea85c093add0d7a9c3a7968c79d1608e4ca6 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* controlvm_direct.c
 *
 * 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.
 */

/* This is a controlvm-related code that is dependent upon firmware running
 * on a virtual partition.
 */

#include "globals.h"
#include "uisutils.h"
#include "controlvm.h"
#define CURRENT_FILE_PC VISOR_CHIPSET_PC_controlvm_direct_c


/* We can fill in this code when we learn how to make vmcalls... */



int controlvm_init(void)
{
	return 0;
}



void controlvm_deinit(void)
{
}



HOSTADDRESS controlvm_get_channel_address(void)
{
	static BOOL warned = FALSE;
	U64 addr = 0;

	U32 size = 0;

	if (!VMCALL_SUCCESSFUL(Issue_VMCALL_IO_CONTROLVM_ADDR(&addr, &size))) {
		if (!warned) {
			ERRDRV("%s - vmcall to determine controlvm channel addr failed",
			       __func__);
			warned = TRUE;
		}
		return 0;
	}
	INFODRV("controlvm addr=%Lx", addr);
	return addr;
}