1251767Sgibbs/****************************************************************************** 2251767Sgibbs * sioemu.h 3251767Sgibbs * 4251767Sgibbs * Copyright (c) 2008 Tristan Gingold <tgingold@free.fr> 5251767Sgibbs * 6251767Sgibbs * Permission is hereby granted, free of charge, to any person obtaining a copy 7251767Sgibbs * of this software and associated documentation files (the "Software"), to 8251767Sgibbs * deal in the Software without restriction, including without limitation the 9251767Sgibbs * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10251767Sgibbs * sell copies of the Software, and to permit persons to whom the Software is 11251767Sgibbs * furnished to do so, subject to the following conditions: 12251767Sgibbs * 13251767Sgibbs * The above copyright notice and this permission notice shall be included in 14251767Sgibbs * all copies or substantial portions of the Software. 15251767Sgibbs * 16251767Sgibbs * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17251767Sgibbs * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18251767Sgibbs * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19251767Sgibbs * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20251767Sgibbs * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21251767Sgibbs * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22251767Sgibbs * DEALINGS IN THE SOFTWARE. 23251767Sgibbs */ 24251767Sgibbs 25251767Sgibbs#ifndef __XEN_PUBLIC_IA64_SIOEMU_H__ 26251767Sgibbs#define __XEN_PUBLIC_IA64_SIOEMU_H__ 27251767Sgibbs 28251767Sgibbs/* SIOEMU specific hypercalls. 29251767Sgibbs The numbers are the minor part of FW_HYPERCALL_SIOEMU. */ 30251767Sgibbs 31251767Sgibbs/* Defines the callback entry point. r8=ip, r9=data. 32251767Sgibbs Must be called per-vcpu. */ 33251767Sgibbs#define SIOEMU_HYPERCALL_SET_CALLBACK 0x01 34251767Sgibbs 35251767Sgibbs/* Finish sioemu fw initialization and start firmware. r8=ip. */ 36251767Sgibbs#define SIOEMU_HYPERCALL_START_FW 0x02 37251767Sgibbs 38251767Sgibbs/* Add IO pages in physmap. */ 39251767Sgibbs#define SIOEMU_HYPERCALL_ADD_IO_PHYSMAP 0x03 40251767Sgibbs 41251767Sgibbs/* Get wallclock time. */ 42251767Sgibbs#define SIOEMU_HYPERCALL_GET_TIME 0x04 43251767Sgibbs 44251767Sgibbs/* Flush cache. */ 45251767Sgibbs#define SIOEMU_HYPERCALL_FLUSH_CACHE 0x07 46251767Sgibbs 47251767Sgibbs/* Get freq base. */ 48251767Sgibbs#define SIOEMU_HYPERCALL_FREQ_BASE 0x08 49251767Sgibbs 50251767Sgibbs/* Return from callback. */ 51251767Sgibbs#define SIOEMU_HYPERCALL_CALLBACK_RETURN 0x09 52251767Sgibbs 53251767Sgibbs/* Deliver an interrupt. */ 54251767Sgibbs#define SIOEMU_HYPERCALL_DELIVER_INT 0x0a 55251767Sgibbs 56251767Sgibbs/* SIOEMU callback reason. */ 57251767Sgibbs 58251767Sgibbs/* An event (from event channel) has to be delivered. */ 59251767Sgibbs#define SIOEMU_CB_EVENT 0x00 60251767Sgibbs 61251767Sgibbs/* Emulate an IO access. */ 62251767Sgibbs#define SIOEMU_CB_IO_EMULATE 0x01 63251767Sgibbs 64251767Sgibbs/* An IPI is sent to a dead vcpu. */ 65251767Sgibbs#define SIOEMU_CB_WAKEUP_VCPU 0x02 66251767Sgibbs 67251767Sgibbs/* A SAL hypercall is executed. */ 68251767Sgibbs#define SIOEMU_CB_SAL_ASSIST 0x03 69251767Sgibbs 70251767Sgibbs#ifndef __ASSEMBLY__ 71251767Sgibbsstruct sioemu_callback_info { 72251767Sgibbs /* Saved registers. */ 73251767Sgibbs unsigned long ip; 74251767Sgibbs unsigned long psr; 75251767Sgibbs unsigned long ifs; 76251767Sgibbs unsigned long nats; 77251767Sgibbs unsigned long r8; 78251767Sgibbs unsigned long r9; 79251767Sgibbs unsigned long r10; 80251767Sgibbs unsigned long r11; 81251767Sgibbs 82251767Sgibbs /* Callback parameters. */ 83251767Sgibbs unsigned long cause; 84251767Sgibbs unsigned long arg0; 85251767Sgibbs unsigned long arg1; 86251767Sgibbs unsigned long arg2; 87251767Sgibbs unsigned long arg3; 88251767Sgibbs unsigned long _pad2[2]; 89251767Sgibbs unsigned long r2; 90251767Sgibbs}; 91251767Sgibbs#endif /* __ASSEMBLY__ */ 92251767Sgibbs#endif /* __XEN_PUBLIC_IA64_SIOEMU_H__ */ 93