Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) */
0002 /*
0003  * ePAPR hcall interface
0004  *
0005  * Copyright 2008-2011 Freescale Semiconductor, Inc.
0006  *
0007  * Author: Timur Tabi <timur@freescale.com>
0008  *
0009  * This file is provided under a dual BSD/GPL license.  When using or
0010  * redistributing this file, you may do so under either license.
0011  *
0012  * Redistribution and use in source and binary forms, with or without
0013  * modification, are permitted provided that the following conditions are met:
0014  *     * Redistributions of source code must retain the above copyright
0015  *       notice, this list of conditions and the following disclaimer.
0016  *     * Redistributions in binary form must reproduce the above copyright
0017  *       notice, this list of conditions and the following disclaimer in the
0018  *       documentation and/or other materials provided with the distribution.
0019  *     * Neither the name of Freescale Semiconductor nor the
0020  *       names of its contributors may be used to endorse or promote products
0021  *       derived from this software without specific prior written permission.
0022  *
0023  *
0024  * ALTERNATIVELY, this software may be distributed under the terms of the
0025  * GNU General Public License ("GPL") as published by the Free Software
0026  * Foundation, either version 2 of that License or (at your option) any
0027  * later version.
0028  *
0029  * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
0030  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
0031  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
0032  * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
0033  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
0034  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
0035  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
0036  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0037  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0038  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0039  */
0040 
0041 #ifndef _UAPI_ASM_POWERPC_EPAPR_HCALLS_H
0042 #define _UAPI_ASM_POWERPC_EPAPR_HCALLS_H
0043 
0044 #define EV_BYTE_CHANNEL_SEND        1
0045 #define EV_BYTE_CHANNEL_RECEIVE     2
0046 #define EV_BYTE_CHANNEL_POLL        3
0047 #define EV_INT_SET_CONFIG       4
0048 #define EV_INT_GET_CONFIG       5
0049 #define EV_INT_SET_MASK         6
0050 #define EV_INT_GET_MASK         7
0051 #define EV_INT_IACK         9
0052 #define EV_INT_EOI          10
0053 #define EV_INT_SEND_IPI         11
0054 #define EV_INT_SET_TASK_PRIORITY    12
0055 #define EV_INT_GET_TASK_PRIORITY    13
0056 #define EV_DOORBELL_SEND        14
0057 #define EV_MSGSND           15
0058 #define EV_IDLE             16
0059 
0060 /* vendor ID: epapr */
0061 #define EV_LOCAL_VENDOR_ID      0   /* for private use */
0062 #define EV_EPAPR_VENDOR_ID      1
0063 #define EV_FSL_VENDOR_ID        2   /* Freescale Semiconductor */
0064 #define EV_IBM_VENDOR_ID        3   /* IBM */
0065 #define EV_GHS_VENDOR_ID        4   /* Green Hills Software */
0066 #define EV_ENEA_VENDOR_ID       5   /* Enea */
0067 #define EV_WR_VENDOR_ID         6   /* Wind River Systems */
0068 #define EV_AMCC_VENDOR_ID       7   /* Applied Micro Circuits */
0069 #define EV_KVM_VENDOR_ID        42  /* KVM */
0070 
0071 /* The max number of bytes that a byte channel can send or receive per call */
0072 #define EV_BYTE_CHANNEL_MAX_BYTES   16
0073 
0074 
0075 #define _EV_HCALL_TOKEN(id, num) (((id) << 16) | (num))
0076 #define EV_HCALL_TOKEN(hcall_num) _EV_HCALL_TOKEN(EV_EPAPR_VENDOR_ID, hcall_num)
0077 
0078 /* epapr return codes */
0079 #define EV_SUCCESS      0
0080 #define EV_EPERM        1   /* Operation not permitted */
0081 #define EV_ENOENT       2   /*  Entry Not Found */
0082 #define EV_EIO          3   /* I/O error occurred */
0083 #define EV_EAGAIN       4   /* The operation had insufficient
0084                      * resources to complete and should be
0085                      * retried
0086                      */
0087 #define EV_ENOMEM       5   /* There was insufficient memory to
0088                      * complete the operation */
0089 #define EV_EFAULT       6   /* Bad guest address */
0090 #define EV_ENODEV       7   /* No such device */
0091 #define EV_EINVAL       8   /* An argument supplied to the hcall
0092                        was out of range or invalid */
0093 #define EV_INTERNAL     9   /* An internal error occurred */
0094 #define EV_CONFIG       10  /* A configuration error was detected */
0095 #define EV_INVALID_STATE    11  /* The object is in an invalid state */
0096 #define EV_UNIMPLEMENTED    12  /* Unimplemented hypercall */
0097 #define EV_BUFFER_OVERFLOW  13  /* Caller-supplied buffer too small */
0098 
0099 #endif /* _UAPI_ASM_POWERPC_EPAPR_HCALLS_H */