1c99ec973SAlexander Graf /* 2c99ec973SAlexander Graf * ePAPR hcall interface 3c99ec973SAlexander Graf * 4c99ec973SAlexander Graf * Copyright 2008-2011 Freescale Semiconductor, Inc. 5c99ec973SAlexander Graf * 6c99ec973SAlexander Graf * Author: Timur Tabi <timur@freescale.com> 7c99ec973SAlexander Graf * 8c99ec973SAlexander Graf * This file is provided under a dual BSD/GPL license. When using or 9c99ec973SAlexander Graf * redistributing this file, you may do so under either license. 10c99ec973SAlexander Graf * 11c99ec973SAlexander Graf * Redistribution and use in source and binary forms, with or without 12c99ec973SAlexander Graf * modification, are permitted provided that the following conditions are met: 13c99ec973SAlexander Graf * * Redistributions of source code must retain the above copyright 14c99ec973SAlexander Graf * notice, this list of conditions and the following disclaimer. 15c99ec973SAlexander Graf * * Redistributions in binary form must reproduce the above copyright 16c99ec973SAlexander Graf * notice, this list of conditions and the following disclaimer in the 17c99ec973SAlexander Graf * documentation and/or other materials provided with the distribution. 18c99ec973SAlexander Graf * * Neither the name of Freescale Semiconductor nor the 19c99ec973SAlexander Graf * names of its contributors may be used to endorse or promote products 20c99ec973SAlexander Graf * derived from this software without specific prior written permission. 21c99ec973SAlexander Graf * 22c99ec973SAlexander Graf * 23c99ec973SAlexander Graf * ALTERNATIVELY, this software may be distributed under the terms of the 24c99ec973SAlexander Graf * GNU General Public License ("GPL") as published by the Free Software 25c99ec973SAlexander Graf * Foundation, either version 2 of that License or (at your option) any 26c99ec973SAlexander Graf * later version. 27c99ec973SAlexander Graf * 28c99ec973SAlexander Graf * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 29c99ec973SAlexander Graf * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30c99ec973SAlexander Graf * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31c99ec973SAlexander Graf * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 32c99ec973SAlexander Graf * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 33c99ec973SAlexander Graf * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34c99ec973SAlexander Graf * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 35c99ec973SAlexander Graf * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36c99ec973SAlexander Graf * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 37c99ec973SAlexander Graf * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38c99ec973SAlexander Graf */ 39c99ec973SAlexander Graf 4063a19091SAlexander Graf #ifndef _UAPI_ASM_POWERPC_EPAPR_HCALLS_H 4163a19091SAlexander Graf #define _UAPI_ASM_POWERPC_EPAPR_HCALLS_H 4263a19091SAlexander Graf 4363a19091SAlexander Graf #define EV_BYTE_CHANNEL_SEND 1 4463a19091SAlexander Graf #define EV_BYTE_CHANNEL_RECEIVE 2 4563a19091SAlexander Graf #define EV_BYTE_CHANNEL_POLL 3 4663a19091SAlexander Graf #define EV_INT_SET_CONFIG 4 4763a19091SAlexander Graf #define EV_INT_GET_CONFIG 5 4863a19091SAlexander Graf #define EV_INT_SET_MASK 6 4963a19091SAlexander Graf #define EV_INT_GET_MASK 7 5063a19091SAlexander Graf #define EV_INT_IACK 9 5163a19091SAlexander Graf #define EV_INT_EOI 10 5263a19091SAlexander Graf #define EV_INT_SEND_IPI 11 5363a19091SAlexander Graf #define EV_INT_SET_TASK_PRIORITY 12 5463a19091SAlexander Graf #define EV_INT_GET_TASK_PRIORITY 13 5563a19091SAlexander Graf #define EV_DOORBELL_SEND 14 5663a19091SAlexander Graf #define EV_MSGSND 15 5763a19091SAlexander Graf #define EV_IDLE 16 5863a19091SAlexander Graf 5963a19091SAlexander Graf /* vendor ID: epapr */ 6063a19091SAlexander Graf #define EV_LOCAL_VENDOR_ID 0 /* for private use */ 6163a19091SAlexander Graf #define EV_EPAPR_VENDOR_ID 1 6263a19091SAlexander Graf #define EV_FSL_VENDOR_ID 2 /* Freescale Semiconductor */ 6363a19091SAlexander Graf #define EV_IBM_VENDOR_ID 3 /* IBM */ 6463a19091SAlexander Graf #define EV_GHS_VENDOR_ID 4 /* Green Hills Software */ 6563a19091SAlexander Graf #define EV_ENEA_VENDOR_ID 5 /* Enea */ 6663a19091SAlexander Graf #define EV_WR_VENDOR_ID 6 /* Wind River Systems */ 6763a19091SAlexander Graf #define EV_AMCC_VENDOR_ID 7 /* Applied Micro Circuits */ 6863a19091SAlexander Graf #define EV_KVM_VENDOR_ID 42 /* KVM */ 6963a19091SAlexander Graf 7063a19091SAlexander Graf /* The max number of bytes that a byte channel can send or receive per call */ 7163a19091SAlexander Graf #define EV_BYTE_CHANNEL_MAX_BYTES 16 7263a19091SAlexander Graf 7363a19091SAlexander Graf 7463a19091SAlexander Graf #define _EV_HCALL_TOKEN(id, num) (((id) << 16) | (num)) 7563a19091SAlexander Graf #define EV_HCALL_TOKEN(hcall_num) _EV_HCALL_TOKEN(EV_EPAPR_VENDOR_ID, hcall_num) 7663a19091SAlexander Graf 7763a19091SAlexander Graf /* epapr return codes */ 7863a19091SAlexander Graf #define EV_SUCCESS 0 7963a19091SAlexander Graf #define EV_EPERM 1 /* Operation not permitted */ 8063a19091SAlexander Graf #define EV_ENOENT 2 /* Entry Not Found */ 8163a19091SAlexander Graf #define EV_EIO 3 /* I/O error occured */ 8263a19091SAlexander Graf #define EV_EAGAIN 4 /* The operation had insufficient 8363a19091SAlexander Graf * resources to complete and should be 8463a19091SAlexander Graf * retried 85c99ec973SAlexander Graf */ 8663a19091SAlexander Graf #define EV_ENOMEM 5 /* There was insufficient memory to 8763a19091SAlexander Graf * complete the operation */ 8863a19091SAlexander Graf #define EV_EFAULT 6 /* Bad guest address */ 8963a19091SAlexander Graf #define EV_ENODEV 7 /* No such device */ 9063a19091SAlexander Graf #define EV_EINVAL 8 /* An argument supplied to the hcall 9163a19091SAlexander Graf was out of range or invalid */ 9263a19091SAlexander Graf #define EV_INTERNAL 9 /* An internal error occured */ 9363a19091SAlexander Graf #define EV_CONFIG 10 /* A configuration error was detected */ 9463a19091SAlexander Graf #define EV_INVALID_STATE 11 /* The object is in an invalid state */ 9563a19091SAlexander Graf #define EV_UNIMPLEMENTED 12 /* Unimplemented hypercall */ 9663a19091SAlexander Graf #define EV_BUFFER_OVERFLOW 13 /* Caller-supplied buffer too small */ 97c99ec973SAlexander Graf 9863a19091SAlexander Graf #endif /* _UAPI_ASM_POWERPC_EPAPR_HCALLS_H */ 99