Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 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 1 2 3 4 5 6


fsl_hypervisor.h
001: /*
002:  * Freescale hypervisor ioctl and kernel interface
003:  *
004:  * Copyright (C) 2008-2011 Freescale Semiconductor, Inc.
005:  * Author: Timur Tabi <timur@freescale.com>
006:  *
007:  * Redistribution and use in source and binary forms, with or without
008:  * modification, are permitted provided that the following conditions are met:
009:  *     * Redistributions of source code must retain the above copyright
010:  *       notice, this list of conditions and the following disclaimer.
011:  *     * Redistributions in binary form must reproduce the above copyright
012:  *       notice, this list of conditions and the following disclaimer in the
013:  *       documentation and/or other materials provided with the distribution.
014:  *     * Neither the name of Freescale Semiconductor nor the
015:  *       names of its contributors may be used to endorse or promote products
016:  *       derived from this software without specific prior written permission.
017:  *
018:  *
019:  * ALTERNATIVELY, this software may be distributed under the terms of the
020:  * GNU General Public License ("GPL") as published by the Free Software
021:  * Foundation, either version 2 of that License or (at your option) any
022:  * later version.
023:  *
024:  * This software is provided by Freescale Semiconductor "as is" and any
025:  * express or implied warranties, including, but not limited to, the implied
026:  * warranties of merchantability and fitness for a particular purpose are
027:  * disclaimed. In no event shall Freescale Semiconductor be liable for any
028:  * direct, indirect, incidental, special, exemplary, or consequential damages
029:  * (including, but not limited to, procurement of substitute goods or services;
030:  * loss of use, data, or profits; or business interruption) however caused and
031:  * on any theory of liability, whether in contract, strict liability, or tort
032:  * (including negligence or otherwise) arising in any way out of the use of this
033:  * software, even if advised of the possibility of such damage.
034:  *
035:  * This file is used by the Freescale hypervisor management driver.  It can
036:  * also be included by applications that need to communicate with the driver
037:  * via the ioctl interface.
038:  */
039: 
040: #ifndef FSL_HYPERVISOR_H
041: #define FSL_HYPERVISOR_H
042: 
043: #include <linux/types.h>
044: 
045: /**
046:  * struct fsl_hv_ioctl_restart - restart a partition
047:  * @ret: return error code from the hypervisor
048:  * @partition: the ID of the partition to restart, or -1 for the
049:  *             calling partition
050:  *
051:  * Used by FSL_HV_IOCTL_PARTITION_RESTART
052:  */
053: struct fsl_hv_ioctl_restart {
054:         __u32 ret;
055:         __u32 partition;
056: };
057: 
058: /**
059:  * struct fsl_hv_ioctl_status - get a partition's status
060:  * @ret: return error code from the hypervisor
061:  * @partition: the ID of the partition to query, or -1 for the
062:  *             calling partition
063:  * @status: The returned status of the partition
064:  *
065:  * Used by FSL_HV_IOCTL_PARTITION_GET_STATUS
066:  *
067:  * Values of 'status':
068:  *    0 = Stopped
069:  *    1 = Running
070:  *    2 = Starting
071:  *    3 = Stopping
072:  */
073: struct fsl_hv_ioctl_status {
074:         __u32 ret;
075:         __u32 partition;
076:         __u32 status;
077: };
078: 
079: /**
080:  * struct fsl_hv_ioctl_start - start a partition
081:  * @ret: return error code from the hypervisor
082:  * @partition: the ID of the partition to control
083:  * @entry_point: The offset within the guest IMA to start execution
084:  * @load: If non-zero, reload the partition's images before starting
085:  *
086:  * Used by FSL_HV_IOCTL_PARTITION_START
087:  */
088: struct fsl_hv_ioctl_start {
089:         __u32 ret;
090:         __u32 partition;
091:         __u32 entry_point;
092:         __u32 load;
093: };
094: 
095: /**
096:  * struct fsl_hv_ioctl_stop - stop a partition
097:  * @ret: return error code from the hypervisor
098:  * @partition: the ID of the partition to stop, or -1 for the calling
099:  *             partition
100:  *
101:  * Used by FSL_HV_IOCTL_PARTITION_STOP
102:  */
103: struct fsl_hv_ioctl_stop {
104:         __u32 ret;
105:         __u32 partition;
106: };
107: 
108: /**
109:  * struct fsl_hv_ioctl_memcpy - copy memory between partitions
110:  * @ret: return error code from the hypervisor
111:  * @source: the partition ID of the source partition, or -1 for this
112:  *          partition
113:  * @target: the partition ID of the target partition, or -1 for this
114:  *          partition
115:  * @reserved: reserved, must be set to 0
116:  * @local_addr: user-space virtual address of a buffer in the local
117:  *              partition
118:  * @remote_addr: guest physical address of a buffer in the
119:  *           remote partition
120:  * @count: the number of bytes to copy.  Both the local and remote
121:  *         buffers must be at least 'count' bytes long
122:  *
123:  * Used by FSL_HV_IOCTL_MEMCPY
124:  *
125:  * The 'local' partition is the partition that calls this ioctl.  The
126:  * 'remote' partition is a different partition.  The data is copied from
127:  * the 'source' paritition' to the 'target' partition.
128:  *
129:  * The buffer in the remote partition must be guest physically
130:  * contiguous.
131:  *
132:  * This ioctl does not support copying memory between two remote
133:  * partitions or within the same partition, so either 'source' or
134:  * 'target' (but not both) must be -1.  In other words, either
135:  *
136:  *      source == local and target == remote
137:  * or
138:  *      source == remote and target == local
139:  */
140: struct fsl_hv_ioctl_memcpy {
141:         __u32 ret;
142:         __u32 source;
143:         __u32 target;
144:         __u32 reserved; /* padding to ensure local_vaddr is aligned */
145:         __u64 local_vaddr;
146:         __u64 remote_paddr;
147:         __u64 count;
148: };
149: 
150: /**
151:  * struct fsl_hv_ioctl_doorbell - ring a doorbell
152:  * @ret: return error code from the hypervisor
153:  * @doorbell: the handle of the doorbell to ring doorbell
154:  *
155:  * Used by FSL_HV_IOCTL_DOORBELL
156:  */
157: struct fsl_hv_ioctl_doorbell {
158:         __u32 ret;
159:         __u32 doorbell;
160: };
161: 
162: /**
163:  * struct fsl_hv_ioctl_prop - get/set a device tree property
164:  * @ret: return error code from the hypervisor
165:  * @handle: handle of partition whose tree to access
166:  * @path: virtual address of path name of node to access
167:  * @propname: virtual address of name of property to access
168:  * @propval: virtual address of property data buffer
169:  * @proplen: Size of property data buffer
170:  * @reserved: reserved, must be set to 0
171:  *
172:  * Used by FSL_HV_IOCTL_DOORBELL
173:  */
174: struct fsl_hv_ioctl_prop {
175:         __u32 ret;
176:         __u32 handle;
177:         __u64 path;
178:         __u64 propname;
179:         __u64 propval;
180:         __u32 proplen;
181:         __u32 reserved; /* padding to ensure structure is aligned */
182: };
183: 
184: /* The ioctl type, documented in ioctl-number.txt */
185: #define FSL_HV_IOCTL_TYPE       0xAF
186: 
187: /* Restart another partition */
188: #define FSL_HV_IOCTL_PARTITION_RESTART \
189:         _IOWR(FSL_HV_IOCTL_TYPE, 1, struct fsl_hv_ioctl_restart)
190: 
191: /* Get a partition's status */
192: #define FSL_HV_IOCTL_PARTITION_GET_STATUS \
193:         _IOWR(FSL_HV_IOCTL_TYPE, 2, struct fsl_hv_ioctl_status)
194: 
195: /* Boot another partition */
196: #define FSL_HV_IOCTL_PARTITION_START \
197:         _IOWR(FSL_HV_IOCTL_TYPE, 3, struct fsl_hv_ioctl_start)
198: 
199: /* Stop this or another partition */
200: #define FSL_HV_IOCTL_PARTITION_STOP \
201:         _IOWR(FSL_HV_IOCTL_TYPE, 4, struct fsl_hv_ioctl_stop)
202: 
203: /* Copy data from one partition to another */
204: #define FSL_HV_IOCTL_MEMCPY \
205:         _IOWR(FSL_HV_IOCTL_TYPE, 5, struct fsl_hv_ioctl_memcpy)
206: 
207: /* Ring a doorbell */
208: #define FSL_HV_IOCTL_DOORBELL \
209:         _IOWR(FSL_HV_IOCTL_TYPE, 6, struct fsl_hv_ioctl_doorbell)
210: 
211: /* Get a property from another guest's device tree */
212: #define FSL_HV_IOCTL_GETPROP \
213:         _IOWR(FSL_HV_IOCTL_TYPE, 7, struct fsl_hv_ioctl_prop)
214: 
215: /* Set a property in another guest's device tree */
216: #define FSL_HV_IOCTL_SETPROP \
217:         _IOWR(FSL_HV_IOCTL_TYPE, 8, struct fsl_hv_ioctl_prop)
218: 
219: 
220: #endif
221: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/