]> rtime.felk.cvut.cz Git - jailhouse.git/blobdiff - hypervisor/arch/arm/include/asm/jailhouse_hypercall.h
driver: ioremap the hypervisor firmware to any kernel address
[jailhouse.git] / hypervisor / arch / arm / include / asm / jailhouse_hypercall.h
index 918791e91ad4f6bf6938ea92f9c6c3ad1863c18b..45e7a3d9ceaecc1d454bc6c1108381adf4ba6b3e 100644 (file)
@@ -1,16 +1,43 @@
 /*
  * Jailhouse, a Linux-based partitioning hypervisor
  *
- * Copyright (c) Siemens AG, 2013
+ * Copyright (c) Siemens AG, 2013-2015
  *
  * Authors:
  *  Jan Kiszka <jan.kiszka@siemens.com>
  *
  * This work is licensed under the terms of the GNU GPL, version 2.  See
  * the COPYING file in the top-level directory.
+ *
+ * Alternatively, you can use or redistribute this file under the following
+ * BSD license:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #define JAILHOUSE_BASE                 0xf0000000
+#define JAILHOUSE_BORROW_ROOT_PT       1
 
 #define JAILHOUSE_CALL_INS             ".arch_extension virt\n\t" \
                                        "hvc #0x4a48"
 #define JAILHOUSE_CPU_STAT_VMEXITS_VSGI                JAILHOUSE_GENERIC_CPU_STATS + 2
 #define JAILHOUSE_NUM_CPU_STATS                        JAILHOUSE_GENERIC_CPU_STATS + 3
 
-#ifndef __asmeq
-#define __asmeq(x, y)  ".ifnc " x "," y " ; .err ; .endif\n\t"
-#endif
-
 #ifndef __ASSEMBLY__
 
 struct jailhouse_comm_region {
@@ -39,8 +62,6 @@ static inline __u32 jailhouse_call(__u32 num)
        register __u32 num_result asm(JAILHOUSE_CALL_NUM_RESULT) = num;
 
        asm volatile(
-               __asmeq(JAILHOUSE_CALL_NUM_RESULT, "%0")
-               __asmeq(JAILHOUSE_CALL_NUM_RESULT, "%1")
                JAILHOUSE_CALL_INS
                : "=r" (num_result)
                : "r" (num_result)
@@ -54,9 +75,6 @@ static inline __u32 jailhouse_call_arg1(__u32 num, __u32 arg1)
        register __u32 __arg1 asm(JAILHOUSE_CALL_ARG1) = arg1;
 
        asm volatile(
-               __asmeq(JAILHOUSE_CALL_NUM_RESULT, "%0")
-               __asmeq(JAILHOUSE_CALL_NUM_RESULT, "%1")
-               __asmeq(JAILHOUSE_CALL_ARG1, "%2")
                JAILHOUSE_CALL_INS
                : "=r" (num_result)
                : "r" (num_result), "r" (__arg1)
@@ -71,10 +89,6 @@ static inline __u32 jailhouse_call_arg2(__u32 num, __u32 arg1, __u32 arg2)
        register __u32 __arg2 asm(JAILHOUSE_CALL_ARG2) = arg2;
 
        asm volatile(
-               __asmeq(JAILHOUSE_CALL_NUM_RESULT, "%0")
-               __asmeq(JAILHOUSE_CALL_NUM_RESULT, "%1")
-               __asmeq(JAILHOUSE_CALL_ARG1, "%2")
-               __asmeq(JAILHOUSE_CALL_ARG2, "%3")
                JAILHOUSE_CALL_INS
                : "=r" (num_result)
                : "r" (num_result), "r" (__arg1), "r" (__arg2)