Back to home page

LXR

 
 

    


0001 /*
0002  * Copyright 2012 Tilera Corporation. All Rights Reserved.
0003  *
0004  *   This program is free software; you can redistribute it and/or
0005  *   modify it under the terms of the GNU General Public License
0006  *   as published by the Free Software Foundation, version 2.
0007  *
0008  *   This program is distributed in the hope that it will be useful, but
0009  *   WITHOUT ANY WARRANTY; without even the implied warranty of
0010  *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
0011  *   NON INFRINGEMENT.  See the GNU General Public License for
0012  *   more details.
0013  */
0014 #ifndef _HV_IORPC_H_
0015 #define _HV_IORPC_H_
0016 
0017 /**
0018  *
0019  * Error codes and struct definitions for the IO RPC library.
0020  *
0021  * The hypervisor's IO RPC component provides a convenient way for
0022  * driver authors to proxy system calls between user space, linux, and
0023  * the hypervisor driver.  The core of the system is a set of Python
0024  * files that take ".idl" files as input and generates the following
0025  * source code:
0026  *
0027  * - _rpc_call() routines for use in userspace IO libraries.  These
0028  * routines take an argument list specified in the .idl file, pack the
0029  * arguments in to a buffer, and read or write that buffer via the
0030  * Linux iorpc driver.
0031  *
0032  * - dispatch_read() and dispatch_write() routines that hypervisor
0033  * drivers can use to implement most of their dev_pread() and
0034  * dev_pwrite() methods.  These routines decode the incoming parameter
0035  * blob, permission check and translate parameters where appropriate,
0036  * and then invoke a callback routine for whichever RPC call has
0037  * arrived.  The driver simply implements the set of callback
0038  * routines.
0039  *
0040  * The IO RPC system also includes the Linux 'iorpc' driver, which
0041  * proxies calls between the userspace library and the hypervisor
0042  * driver.  The Linux driver is almost entirely device agnostic; it
0043  * watches for special flags indicating cases where a memory buffer
0044  * address might need to be translated, etc.  As a result, driver
0045  * writers can avoid many of the problem cases related to registering
0046  * hardware resources like memory pages or interrupts.  However, the
0047  * drivers must be careful to obey the conventions documented below in
0048  * order to work properly with the generic Linux iorpc driver.
0049  *
0050  * @section iorpc_domains Service Domains
0051  *
0052  * All iorpc-based drivers must support a notion of service domains.
0053  * A service domain is basically an application context - state
0054  * indicating resources that are allocated to that particular app
0055  * which it may access and (perhaps) other applications may not
0056  * access.  Drivers can support any number of service domains they
0057  * choose.  In some cases the design is limited by a number of service
0058  * domains supported by the IO hardware; in other cases the service
0059  * domains are a purely software concept and the driver chooses a
0060  * maximum number of domains based on how much state memory it is
0061  * willing to preallocate.
0062  *
0063  * For example, the mPIPE driver only supports as many service domains
0064  * as are supported by the mPIPE hardware.  This limitation is
0065  * required because the hardware implements its own MMIO protection
0066  * scheme to allow large MMIO mappings while still protecting small
0067  * register ranges within the page that should only be accessed by the
0068  * hypervisor.
0069  *
0070  * In contrast, drivers with no hardware service domain limitations
0071  * (for instance the TRIO shim) can implement an arbitrary number of
0072  * service domains.  In these cases, each service domain is limited to
0073  * a carefully restricted set of legal MMIO addresses if necessary to
0074  * keep one application from corrupting another application's state.
0075  *
0076  * @section iorpc_conventions System Call Conventions
0077  *
0078  * The driver's open routine is responsible for allocating a new
0079  * service domain for each hv_dev_open() call.  By convention, the
0080  * return value from open() should be the service domain number on
0081  * success, or GXIO_ERR_NO_SVC_DOM if no more service domains are
0082  * available.
0083  *
0084  * The implementations of hv_dev_pread() and hv_dev_pwrite() are
0085  * responsible for validating the devhdl value passed up by the
0086  * client.  Since the device handle returned by hv_dev_open() should
0087  * embed the positive service domain number, drivers should make sure
0088  * that DRV_HDL2BITS(devhdl) is a legal service domain.  If the client
0089  * passes an illegal service domain number, the routine should return
0090  * GXIO_ERR_INVAL_SVC_DOM.  Once the service domain number has been
0091  * validated, the driver can copy to/from the client buffer and call
0092  * the dispatch_read() or dispatch_write() methods created by the RPC
0093  * generator.
0094  *
0095  * The hv_dev_close() implementation should reset all service domain
0096  * state and put the service domain back on a free list for
0097  * reallocation by a future application.  In most cases, this will
0098  * require executing a hardware reset or drain flow and denying any
0099  * MMIO regions that were created for the service domain.
0100  *
0101  * @section iorpc_data Special Data Types
0102  *
0103  * The .idl file syntax allows the creation of syscalls with special
0104  * parameters that require permission checks or translations as part
0105  * of the system call path.  Because of limitations in the code
0106  * generator, APIs are generally limited to just one of these special
0107  * parameters per system call, and they are sometimes required to be
0108  * the first or last parameter to the call.  Special parameters
0109  * include:
0110  *
0111  * @subsection iorpc_mem_buffer MEM_BUFFER
0112  *
0113  * The MEM_BUFFER() datatype allows user space to "register" memory
0114  * buffers with a device.  Registering memory accomplishes two tasks:
0115  * Linux keeps track of all buffers that might be modified by a
0116  * hardware device, and the hardware device drivers bind registered
0117  * buffers to particular hardware resources like ingress NotifRings.
0118  * The MEM_BUFFER() idl syntax can take extra flags like ALIGN_64KB,
0119  * ALIGN_SELF_SIZE, and FLAGS indicating that memory buffers must have
0120  * certain alignment or that the user should be able to pass a "memory
0121  * flags" word specifying attributes like nt_hint or IO cache pinning.
0122  * The parser will accept multiple MEM_BUFFER() flags.
0123  *
0124  * Implementations must obey the following conventions when
0125  * registering memory buffers via the iorpc flow.  These rules are a
0126  * result of the Linux driver implementation, which needs to keep
0127  * track of how many times a particular page has been registered with
0128  * the hardware so that it can release the page when all those
0129  * registrations are cleared.
0130  *
0131  * - Memory registrations that refer to a resource which has already
0132  * been bound must return GXIO_ERR_ALREADY_INIT.  Thus, it is an
0133  * error to register memory twice without resetting (i.e. closing) the
0134  * resource in between.  This convention keeps the Linux driver from
0135  * having to track which particular devices a page is bound to.
0136  *
0137  * - At present, a memory registration is only cleared when the
0138  * service domain is reset.  In this case, the Linux driver simply
0139  * closes the HV device file handle and then decrements the reference
0140  * counts of all pages that were previously registered with the
0141  * device.
0142  *
0143  * - In the future, we may add a mechanism for unregistering memory.
0144  * One possible implementation would require that the user specify
0145  * which buffer is currently registered.  The HV would then verify
0146  * that that page was actually the one currently mapped and return
0147  * success or failure to Linux, which would then only decrement the
0148  * page reference count if the addresses were mapped.  Another scheme
0149  * might allow Linux to pass a token to the HV to be returned when the
0150  * resource is unmapped.
0151  *
0152  * @subsection iorpc_interrupt INTERRUPT
0153  *
0154  * The INTERRUPT .idl datatype allows the client to bind hardware
0155  * interrupts to a particular combination of IPI parameters - CPU, IPI
0156  * PL, and event bit number.  This data is passed via a special
0157  * datatype so that the Linux driver can validate the CPU and PL and
0158  * the HV generic iorpc code can translate client CPUs to real CPUs.
0159  *
0160  * @subsection iorpc_pollfd_setup POLLFD_SETUP
0161  *
0162  * The POLLFD_SETUP .idl datatype allows the client to set up hardware
0163  * interrupt bindings which are received by Linux but which are made
0164  * visible to user processes as state transitions on a file descriptor;
0165  * this allows user processes to use Linux primitives, such as poll(), to
0166  * await particular hardware events.  This data is passed via a special
0167  * datatype so that the Linux driver may recognize the pollable file
0168  * descriptor and translate it to a set of interrupt target information,
0169  * and so that the HV generic iorpc code can translate client CPUs to real
0170  * CPUs.
0171  *
0172  * @subsection iorpc_pollfd POLLFD
0173  *
0174  * The POLLFD .idl datatype allows manipulation of hardware interrupt
0175  * bindings set up via the POLLFD_SETUP datatype; common operations are
0176  * resetting the state of the requested interrupt events, and unbinding any
0177  * bound interrupts.  This data is passed via a special datatype so that
0178  * the Linux driver may recognize the pollable file descriptor and
0179  * translate it to an interrupt identifier previously supplied by the
0180  * hypervisor as the result of an earlier pollfd_setup operation.
0181  *
0182  * @subsection iorpc_blob BLOB
0183  *
0184  * The BLOB .idl datatype allows the client to write an arbitrary
0185  * length string of bytes up to the hypervisor driver.  This can be
0186  * useful for passing up large, arbitrarily structured data like
0187  * classifier programs.  The iorpc stack takes care of validating the
0188  * buffer VA and CPA as the data passes up to the hypervisor.  Unlike
0189  * MEM_BUFFER(), the buffer is not registered - Linux does not bump
0190  * page refcounts and the HV driver should not reuse the buffer once
0191  * the system call is complete.
0192  *
0193  * @section iorpc_translation Translating User Space Calls
0194  *
0195  * The ::iorpc_offset structure describes the formatting of the offset
0196  * that is passed to pread() or pwrite() as part of the generated RPC code.
0197  * When the user calls up to Linux, the rpc code fills in all the fields of
0198  * the offset, including a 16-bit opcode, a 16 bit format indicator, and 32
0199  * bits of user-specified "sub-offset".  The opcode indicates which syscall
0200  * is being requested.  The format indicates whether there is a "prefix
0201  * struct" at the start of the memory buffer passed to pwrite(), and if so
0202  * what data is in that prefix struct.  These prefix structs are used to
0203  * implement special datatypes like MEM_BUFFER() and INTERRUPT - we arrange
0204  * to put data that needs translation and permission checks at the start of
0205  * the buffer so that the Linux driver and generic portions of the HV iorpc
0206  * code can easily access the data.  The 32 bits of user-specified
0207  * "sub-offset" are most useful for pread() calls where the user needs to
0208  * also pass in a few bits indicating which register to read, etc.
0209  *
0210  * The Linux iorpc driver watches for system calls that contain prefix
0211  * structs so that it can translate parameters and bump reference
0212  * counts as appropriate.  It does not (currently) have any knowledge
0213  * of the per-device opcodes - it doesn't care what operation you're
0214  * doing to mPIPE, so long as it can do all the generic book-keeping.
0215  * The hv/iorpc.h header file defines all of the generic encoding bits
0216  * needed to translate iorpc calls without knowing which particular
0217  * opcode is being issued.
0218  *
0219  * @section iorpc_globals Global iorpc Calls
0220  *
0221  * Implementing mmap() required adding some special iorpc syscalls
0222  * that are only called by the Linux driver, never by userspace.
0223  * These include get_mmio_base() and check_mmio_offset().  These
0224  * routines are described in globals.idl and must be included in every
0225  * iorpc driver.  By providing these routines in every driver, Linux's
0226  * mmap implementation can easily get the PTE bits it needs and
0227  * validate the PA offset without needing to know the per-device
0228  * opcodes to perform those tasks.
0229  *
0230  * @section iorpc_kernel Supporting gxio APIs in the Kernel
0231  *
0232  * The iorpc code generator also supports generation of kernel code
0233  * implementing the gxio APIs.  This capability is currently used by
0234  * the mPIPE network driver, and will likely be used by the TRIO root
0235  * complex and endpoint drivers and perhaps an in-kernel crypto
0236  * driver.  Each driver that wants to instantiate iorpc calls in the
0237  * kernel needs to generate a kernel version of the generate rpc code
0238  * and (probably) copy any related gxio source files into the kernel.
0239  * The mPIPE driver provides a good example of this pattern.
0240  */
0241 
0242 #ifdef __KERNEL__
0243 #include <linux/stddef.h>
0244 #else
0245 #include <stddef.h>
0246 #endif
0247 
0248 #if defined(__HV__)
0249 #include <hv/hypervisor.h>
0250 #elif defined(__KERNEL__)
0251 #include <hv/hypervisor.h>
0252 #include <linux/types.h>
0253 #else
0254 #include <stdint.h>
0255 #endif
0256 
0257 
0258 /** Code indicating translation services required within the RPC path.
0259  * These indicate whether there is a translatable struct at the start
0260  * of the RPC buffer and what information that struct contains.
0261  */
0262 enum iorpc_format_e
0263 {
0264   /** No translation required, no prefix struct. */
0265   IORPC_FORMAT_NONE,
0266 
0267   /** No translation required, no prefix struct, no access to this
0268    *  operation from user space. */
0269   IORPC_FORMAT_NONE_NOUSER,
0270 
0271   /** Prefix struct contains user VA and size. */
0272   IORPC_FORMAT_USER_MEM,
0273 
0274   /** Prefix struct contains CPA, size, and homing bits. */
0275   IORPC_FORMAT_KERNEL_MEM,
0276 
0277   /** Prefix struct contains interrupt. */
0278   IORPC_FORMAT_KERNEL_INTERRUPT,
0279 
0280   /** Prefix struct contains user-level interrupt. */
0281   IORPC_FORMAT_USER_INTERRUPT,
0282 
0283   /** Prefix struct contains pollfd_setup (interrupt information). */
0284   IORPC_FORMAT_KERNEL_POLLFD_SETUP,
0285 
0286   /** Prefix struct contains user-level pollfd_setup (file descriptor). */
0287   IORPC_FORMAT_USER_POLLFD_SETUP,
0288 
0289   /** Prefix struct contains pollfd (interrupt cookie). */
0290   IORPC_FORMAT_KERNEL_POLLFD,
0291 
0292   /** Prefix struct contains user-level pollfd (file descriptor). */
0293   IORPC_FORMAT_USER_POLLFD,
0294 };
0295 
0296 
0297 /** Generate an opcode given format and code. */
0298 #define IORPC_OPCODE(FORMAT, CODE) (((FORMAT) << 16) | (CODE))
0299 
0300 /** The offset passed through the read() and write() system calls
0301     combines an opcode with 32 bits of user-specified offset. */
0302 union iorpc_offset
0303 {
0304 #ifndef __BIG_ENDIAN__
0305   uint64_t offset;              /**< All bits. */
0306 
0307   struct
0308   {
0309     uint16_t code;              /**< RPC code. */
0310     uint16_t format;            /**< iorpc_format_e */
0311     uint32_t sub_offset;        /**< caller-specified offset. */
0312   };
0313 
0314   uint32_t opcode;              /**< Opcode combines code & format. */
0315 #else
0316   uint64_t offset;              /**< All bits. */
0317 
0318   struct
0319   {
0320     uint32_t sub_offset;        /**< caller-specified offset. */
0321     uint16_t format;            /**< iorpc_format_e */
0322     uint16_t code;              /**< RPC code. */
0323   };
0324 
0325   struct
0326   {
0327     uint32_t padding;
0328     uint32_t opcode;              /**< Opcode combines code & format. */
0329   };
0330 #endif
0331 };
0332 
0333 
0334 /** Homing and cache hinting bits that can be used by IO devices. */
0335 struct iorpc_mem_attr
0336 {
0337   unsigned int lotar_x:4;       /**< lotar X bits (or Gx page_mask). */
0338   unsigned int lotar_y:4;       /**< lotar Y bits (or Gx page_offset). */
0339   unsigned int hfh:1;           /**< Uses hash-for-home. */
0340   unsigned int nt_hint:1;       /**< Non-temporal hint. */
0341   unsigned int io_pin:1;        /**< Only fill 'IO' cache ways. */
0342 };
0343 
0344 /** Set the nt_hint bit. */
0345 #define IORPC_MEM_BUFFER_FLAG_NT_HINT (1 << 0)
0346 
0347 /** Set the IO pin bit. */
0348 #define IORPC_MEM_BUFFER_FLAG_IO_PIN (1 << 1)
0349 
0350 
0351 /** A structure used to describe memory registration.  Different
0352     protection levels describe memory differently, so this union
0353     contains all the different possible descriptions.  As a request
0354     moves up the call chain, each layer translates from one
0355     description format to the next.  In particular, the Linux iorpc
0356     driver translates user VAs into CPAs and homing parameters. */
0357 union iorpc_mem_buffer
0358 {
0359   struct
0360   {
0361     uint64_t va;                /**< User virtual address. */
0362     uint64_t size;              /**< Buffer size. */
0363     unsigned int flags;         /**< nt_hint, IO pin. */
0364   }
0365   user;                         /**< Buffer as described by user apps. */
0366 
0367   struct
0368   {
0369     unsigned long long cpa;     /**< Client physical address. */
0370 #if defined(__KERNEL__) || defined(__HV__)
0371     size_t size;                /**< Buffer size. */
0372     HV_PTE pte;                 /**< PTE describing memory homing. */
0373 #else
0374     uint64_t size;
0375     uint64_t pte;
0376 #endif
0377     unsigned int flags;         /**< nt_hint, IO pin. */
0378   }
0379   kernel;                       /**< Buffer as described by kernel. */
0380 
0381   struct
0382   {
0383     unsigned long long pa;      /**< Physical address. */
0384     size_t size;                /**< Buffer size. */
0385     struct iorpc_mem_attr attr;      /**< Homing and locality hint bits. */
0386   }
0387   hv;                           /**< Buffer parameters for HV driver. */
0388 };
0389 
0390 
0391 /** A structure used to describe interrupts.  The format differs slightly
0392  *  for user and kernel interrupts.  As with the mem_buffer_t, translation
0393  *  between the formats is done at each level. */
0394 union iorpc_interrupt
0395 {
0396   struct
0397   {
0398     int cpu;   /**< CPU. */
0399     int event; /**< evt_num */
0400   }
0401   user;        /**< Interrupt as described by user applications. */
0402 
0403   struct
0404   {
0405     int x;     /**< X coord. */
0406     int y;     /**< Y coord. */
0407     int ipi;   /**< int_num */
0408     int event; /**< evt_num */
0409   }
0410   kernel;      /**< Interrupt as described by the kernel. */
0411 
0412 };
0413 
0414 
0415 /** A structure used to describe interrupts used with poll().  The format
0416  *  differs significantly for requests from user to kernel, and kernel to
0417  *  hypervisor.  As with the mem_buffer_t, translation between the formats
0418  *  is done at each level. */
0419 union iorpc_pollfd_setup
0420 {
0421   struct
0422   {
0423     int fd;    /**< Pollable file descriptor. */
0424   }
0425   user;        /**< pollfd_setup as described by user applications. */
0426 
0427   struct
0428   {
0429     int x;     /**< X coord. */
0430     int y;     /**< Y coord. */
0431     int ipi;   /**< int_num */
0432     int event; /**< evt_num */
0433   }
0434   kernel;      /**< pollfd_setup as described by the kernel. */
0435 
0436 };
0437 
0438 
0439 /** A structure used to describe previously set up interrupts used with
0440  *  poll().  The format differs significantly for requests from user to
0441  *  kernel, and kernel to hypervisor.  As with the mem_buffer_t, translation
0442  *  between the formats is done at each level. */
0443 union iorpc_pollfd
0444 {
0445   struct
0446   {
0447     int fd;    /**< Pollable file descriptor. */
0448   }
0449   user;        /**< pollfd as described by user applications. */
0450 
0451   struct
0452   {
0453     int cookie; /**< hv cookie returned by the pollfd_setup operation. */
0454   }
0455   kernel;      /**< pollfd as described by the kernel. */
0456 
0457 };
0458 
0459 
0460 /** The various iorpc devices use error codes from -1100 to -1299.
0461  *
0462  * This range is distinct from netio (-700 to -799), the hypervisor
0463  * (-800 to -899), tilepci (-900 to -999), ilib (-1000 to -1099),
0464  * gxcr (-1300 to -1399) and gxpci (-1400 to -1499).
0465  */
0466 enum gxio_err_e {
0467 
0468   /** Largest iorpc error number. */
0469   GXIO_ERR_MAX = -1101,
0470 
0471 
0472   /********************************************************/
0473   /*                   Generic Error Codes                */
0474   /********************************************************/
0475 
0476   /** Bad RPC opcode - possible version incompatibility. */
0477   GXIO_ERR_OPCODE = -1101,
0478 
0479   /** Invalid parameter. */
0480   GXIO_ERR_INVAL = -1102,
0481 
0482   /** Memory buffer did not meet alignment requirements. */
0483   GXIO_ERR_ALIGNMENT = -1103,
0484 
0485   /** Memory buffers must be coherent and cacheable. */
0486   GXIO_ERR_COHERENCE = -1104,
0487 
0488   /** Resource already initialized. */
0489   GXIO_ERR_ALREADY_INIT = -1105,
0490 
0491   /** No service domains available. */
0492   GXIO_ERR_NO_SVC_DOM = -1106,
0493 
0494   /** Illegal service domain number. */
0495   GXIO_ERR_INVAL_SVC_DOM = -1107,
0496 
0497   /** Illegal MMIO address. */
0498   GXIO_ERR_MMIO_ADDRESS = -1108,
0499 
0500   /** Illegal interrupt binding. */
0501   GXIO_ERR_INTERRUPT = -1109,
0502 
0503   /** Unreasonable client memory. */
0504   GXIO_ERR_CLIENT_MEMORY = -1110,
0505 
0506   /** No more IOTLB entries. */
0507   GXIO_ERR_IOTLB_ENTRY = -1111,
0508 
0509   /** Invalid memory size. */
0510   GXIO_ERR_INVAL_MEMORY_SIZE = -1112,
0511 
0512   /** Unsupported operation. */
0513   GXIO_ERR_UNSUPPORTED_OP = -1113,
0514 
0515   /** Insufficient DMA credits. */
0516   GXIO_ERR_DMA_CREDITS = -1114,
0517 
0518   /** Operation timed out. */
0519   GXIO_ERR_TIMEOUT = -1115,
0520 
0521   /** No such device or object. */
0522   GXIO_ERR_NO_DEVICE = -1116,
0523 
0524   /** Device or resource busy. */
0525   GXIO_ERR_BUSY = -1117,
0526 
0527   /** I/O error. */
0528   GXIO_ERR_IO = -1118,
0529 
0530   /** Permissions error. */
0531   GXIO_ERR_PERM = -1119,
0532 
0533 
0534 
0535   /********************************************************/
0536   /*                 Test Device Error Codes              */
0537   /********************************************************/
0538 
0539   /** Illegal register number. */
0540   GXIO_TEST_ERR_REG_NUMBER = -1120,
0541 
0542   /** Illegal buffer slot. */
0543   GXIO_TEST_ERR_BUFFER_SLOT = -1121,
0544 
0545 
0546   /********************************************************/
0547   /*                    MPIPE Error Codes                 */
0548   /********************************************************/
0549 
0550 
0551   /** Invalid buffer size. */
0552   GXIO_MPIPE_ERR_INVAL_BUFFER_SIZE = -1131,
0553 
0554   /** Cannot allocate buffer stack. */
0555   GXIO_MPIPE_ERR_NO_BUFFER_STACK = -1140,
0556 
0557   /** Invalid buffer stack number. */
0558   GXIO_MPIPE_ERR_BAD_BUFFER_STACK = -1141,
0559 
0560   /** Cannot allocate NotifRing. */
0561   GXIO_MPIPE_ERR_NO_NOTIF_RING = -1142,
0562 
0563   /** Invalid NotifRing number. */
0564   GXIO_MPIPE_ERR_BAD_NOTIF_RING = -1143,
0565 
0566   /** Cannot allocate NotifGroup. */
0567   GXIO_MPIPE_ERR_NO_NOTIF_GROUP = -1144,
0568 
0569   /** Invalid NotifGroup number. */
0570   GXIO_MPIPE_ERR_BAD_NOTIF_GROUP = -1145,
0571 
0572   /** Cannot allocate bucket. */
0573   GXIO_MPIPE_ERR_NO_BUCKET = -1146,
0574 
0575   /** Invalid bucket number. */
0576   GXIO_MPIPE_ERR_BAD_BUCKET = -1147,
0577 
0578   /** Cannot allocate eDMA ring. */
0579   GXIO_MPIPE_ERR_NO_EDMA_RING = -1148,
0580 
0581   /** Invalid eDMA ring number. */
0582   GXIO_MPIPE_ERR_BAD_EDMA_RING = -1149,
0583 
0584   /** Invalid channel number. */
0585   GXIO_MPIPE_ERR_BAD_CHANNEL = -1150,
0586 
0587   /** Bad configuration. */
0588   GXIO_MPIPE_ERR_BAD_CONFIG = -1151,
0589 
0590   /** Empty iqueue. */
0591   GXIO_MPIPE_ERR_IQUEUE_EMPTY = -1152,
0592 
0593   /** Empty rules. */
0594   GXIO_MPIPE_ERR_RULES_EMPTY = -1160,
0595 
0596   /** Full rules. */
0597   GXIO_MPIPE_ERR_RULES_FULL = -1161,
0598 
0599   /** Corrupt rules. */
0600   GXIO_MPIPE_ERR_RULES_CORRUPT = -1162,
0601 
0602   /** Invalid rules. */
0603   GXIO_MPIPE_ERR_RULES_INVALID = -1163,
0604 
0605   /** Classifier is too big. */
0606   GXIO_MPIPE_ERR_CLASSIFIER_TOO_BIG = -1170,
0607 
0608   /** Classifier is too complex. */
0609   GXIO_MPIPE_ERR_CLASSIFIER_TOO_COMPLEX = -1171,
0610 
0611   /** Classifier has bad header. */
0612   GXIO_MPIPE_ERR_CLASSIFIER_BAD_HEADER = -1172,
0613 
0614   /** Classifier has bad contents. */
0615   GXIO_MPIPE_ERR_CLASSIFIER_BAD_CONTENTS = -1173,
0616 
0617   /** Classifier encountered invalid symbol. */
0618   GXIO_MPIPE_ERR_CLASSIFIER_INVAL_SYMBOL = -1174,
0619 
0620   /** Classifier encountered invalid bounds. */
0621   GXIO_MPIPE_ERR_CLASSIFIER_INVAL_BOUNDS = -1175,
0622 
0623   /** Classifier encountered invalid relocation. */
0624   GXIO_MPIPE_ERR_CLASSIFIER_INVAL_RELOCATION = -1176,
0625 
0626   /** Classifier encountered undefined symbol. */
0627   GXIO_MPIPE_ERR_CLASSIFIER_UNDEF_SYMBOL = -1177,
0628 
0629 
0630   /********************************************************/
0631   /*                    TRIO  Error Codes                 */
0632   /********************************************************/
0633 
0634   /** Cannot allocate memory map region. */
0635   GXIO_TRIO_ERR_NO_MEMORY_MAP = -1180,
0636 
0637   /** Invalid memory map region number. */
0638   GXIO_TRIO_ERR_BAD_MEMORY_MAP = -1181,
0639 
0640   /** Cannot allocate scatter queue. */
0641   GXIO_TRIO_ERR_NO_SCATTER_QUEUE = -1182,
0642 
0643   /** Invalid scatter queue number. */
0644   GXIO_TRIO_ERR_BAD_SCATTER_QUEUE = -1183,
0645 
0646   /** Cannot allocate push DMA ring. */
0647   GXIO_TRIO_ERR_NO_PUSH_DMA_RING = -1184,
0648 
0649   /** Invalid push DMA ring index. */
0650   GXIO_TRIO_ERR_BAD_PUSH_DMA_RING = -1185,
0651 
0652   /** Cannot allocate pull DMA ring. */
0653   GXIO_TRIO_ERR_NO_PULL_DMA_RING = -1186,
0654 
0655   /** Invalid pull DMA ring index. */
0656   GXIO_TRIO_ERR_BAD_PULL_DMA_RING = -1187,
0657 
0658   /** Cannot allocate PIO region. */
0659   GXIO_TRIO_ERR_NO_PIO = -1188,
0660 
0661   /** Invalid PIO region index. */
0662   GXIO_TRIO_ERR_BAD_PIO = -1189,
0663 
0664   /** Cannot allocate ASID. */
0665   GXIO_TRIO_ERR_NO_ASID = -1190,
0666 
0667   /** Invalid ASID. */
0668   GXIO_TRIO_ERR_BAD_ASID = -1191,
0669 
0670 
0671   /********************************************************/
0672   /*                    MICA Error Codes                  */
0673   /********************************************************/
0674 
0675   /** No such accelerator type. */
0676   GXIO_MICA_ERR_BAD_ACCEL_TYPE = -1220,
0677 
0678   /** Cannot allocate context. */
0679   GXIO_MICA_ERR_NO_CONTEXT = -1221,
0680 
0681   /** PKA command queue is full, can't add another command. */
0682   GXIO_MICA_ERR_PKA_CMD_QUEUE_FULL = -1222,
0683 
0684   /** PKA result queue is empty, can't get a result from the queue. */
0685   GXIO_MICA_ERR_PKA_RESULT_QUEUE_EMPTY = -1223,
0686 
0687   /********************************************************/
0688   /*                    GPIO Error Codes                  */
0689   /********************************************************/
0690 
0691   /** Pin not available.  Either the physical pin does not exist, or
0692    *  it is reserved by the hypervisor for system usage. */
0693   GXIO_GPIO_ERR_PIN_UNAVAILABLE = -1240,
0694 
0695   /** Pin busy.  The pin exists, and is available for use via GXIO, but
0696    *  it has been attached by some other process or driver. */
0697   GXIO_GPIO_ERR_PIN_BUSY = -1241,
0698 
0699   /** Cannot access unattached pin.  One or more of the pins being
0700    *  manipulated by this call are not attached to the requesting
0701    *  context. */
0702   GXIO_GPIO_ERR_PIN_UNATTACHED = -1242,
0703 
0704   /** Invalid I/O mode for pin.  The wiring of the pin in the system
0705    *  is such that the I/O mode or electrical control parameters
0706    *  requested could cause damage. */
0707   GXIO_GPIO_ERR_PIN_INVALID_MODE = -1243,
0708 
0709   /** Smallest iorpc error number. */
0710   GXIO_ERR_MIN = -1299
0711 };
0712 
0713 
0714 #endif /* !_HV_IORPC_H_ */