Changeset 132ab5d1 in mainline for abi


Ignore:
Timestamp:
2018-01-30T03:20:45Z (7 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

Location:
abi/include
Files:
1 added
4 edited
3 moved

Legend:

Unmodified
Added
Removed
  • abi/include/_bits/errno.h

    r8bfb163 r132ab5d1  
    11/*
    2  * Copyright (c) 2010 Lenka Trochtova
     2 * Copyright (c) 2017 CZ.NIC, z.s.p.o.
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libdrv
     29/* Authors:
     30 *      Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
     31 */
     32
     33/** @addtogroup bits
    3034 * @{
    3135 */
     
    3337 */
    3438
    35 #ifndef LIBDRV_REMOTE_CHAR_DEV_H_
    36 #define LIBDRV_REMOTE_CHAR_DEV_H_
     39#ifndef _BITS_ERRNO_H_
     40#define _BITS_ERRNO_H_
    3741
    38 extern remote_iface_t remote_char_dev_iface;
     42#ifdef __OPAQUE_ERRNO__
     43#include <_bits/opaque_handle.h>
     44
     45opaque_handle(errno_t);
     46typedef errno_t sys_errno_t;
     47#define __errno_t(val) ((errno_t) val)
     48
     49#else
     50
     51#include <_bits/native.h>
     52
     53/**
     54 * The type of <errno.h> constants. Normally, this is an alias for `int`,
     55 * but we support an alternative definition that allows us to verify
     56 * integrity of error handling without using external tools.
     57 */
     58typedef int errno_t;
     59
     60/**
     61 * Same as `errno_t`, except represented as `sysarg_t`. Used in kernel in
     62 * places where error number is always passed, but the type must be `sysarg_t`.
     63 */
     64typedef sysarg_t sys_errno_t;
     65
     66/**
     67 * A C++-style "cast" to `errno_t`.
     68 * Used in <abi/errno.h> to define error constants. Normally, it doesn't do
     69 * anything at all.
     70 */
     71#define __errno_t(val) val
    3972
    4073#endif
    4174
    42 /**
    43  * @}
    44  */
     75#endif
  • abi/include/_bits/opaque_handle.h

    r8bfb163 r132ab5d1  
    11/*
    2  * Copyright (c) 2013 Martin Sucha
     2 * Copyright (c) 2017 CZ.NIC, z.s.p.o.
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup http
     29/* Authors:
     30 *      Jiří Zárevúcky (jzr) <zarevucky.jiri@gmail.com>
     31 */
     32
     33/** @addtogroup bits
    3034 * @{
    3135 */
    32 /**
    33  * @file
    34  */
    3536
    36 #ifndef HTTP_ERRNO_H_
    37 #define HTTP_ERRNO_H_
     37#ifndef _BITS_OPAQUE_HANDLE_H_
     38#define _BITS_OPAQUE_HANDLE_H_
    3839
    39 #include <errno.h>
    40 
    41 #define HTTP_EMULTIPLE_HEADERS -20001
    42 #define HTTP_EMISSING_HEADER -20002
    43 #define HTTP_EPARSE -20003
     40#define opaque_handle(__name) typedef struct __opaque_##__name *__name
    4441
    4542#endif
  • abi/include/abi/cap.h

    r8bfb163 r132ab5d1  
    11/*
    2  * Copyright (c) 2008 Pavel Rimsky
     2 * Copyright (c) 2017 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
     29/** @addtogroup generic
     30 * @{
     31 */
    2932/** @file
    3033 */
    3134
    32 #ifndef OUTPUT_PORT_NIAGARA_H_
    33 #define OUTPUT_PORT_NIAGARA_H_
     35#ifndef ABI_CAP_H_
     36#define ABI_CAP_H_
    3437
    35 extern int niagara_init(void);
     38#define CAP_NIL         0
     39
     40typedef int cap_handle_t;
    3641
    3742#endif
  • abi/include/abi/errno.h

    r8bfb163 r132ab5d1  
    1 /*
    2  * Copyright (c) 2005 Martin Decky
    3  * All rights reserved.
     1/* Generated file. Edit errno.in instead. */
     2#define EOK             __errno_t(      0)
     3#define ENOENT          __errno_t(      1)
     4#define ENOMEM          __errno_t(      2)
     5#define ELIMIT          __errno_t(      3)
     6#define EREFUSED        __errno_t(      4)
     7#define EFORWARD        __errno_t(      5)
     8#define EPERM           __errno_t(      6)
     9#define EHANGUP         __errno_t(      7)
     10#define EPARTY          __errno_t(      8)
     11#define EEXIST          __errno_t(      9)
     12#define EBADMEM         __errno_t(     10)
     13#define ENOTSUP         __errno_t(     11)
     14#define EADDRNOTAVAIL   __errno_t(     12)
     15#define ETIMEOUT        __errno_t(     13)
     16#define EINVAL          __errno_t(     14)
     17#define EBUSY           __errno_t(     15)
     18#define EOVERFLOW       __errno_t(     16)
     19#define EINTR           __errno_t(     17)
     20#define EMFILE          __errno_t(     18)
     21#define ENAMETOOLONG    __errno_t(     19)
     22#define EISDIR          __errno_t(     20)
     23#define ENOTDIR         __errno_t(     21)
     24#define ENOSPC          __errno_t(     22)
     25#define ENOTEMPTY       __errno_t(     23)
     26#define EBADF           __errno_t(     24)
     27#define EDOM            __errno_t(     25)
     28#define ERANGE          __errno_t(     26)
     29#define EXDEV           __errno_t(     27)
     30#define EIO             __errno_t(     28)
     31#define EMLINK          __errno_t(     29)
     32#define ENXIO           __errno_t(     30)
     33#define ENOFS           __errno_t(     31)
     34#define EBADCHECKSUM    __errno_t(     32)
     35#define ESTALL          __errno_t(     33)
     36#define EEMPTY          __errno_t(     34)
     37#define ENAK            __errno_t(     35)
     38#define EAGAIN          __errno_t(     36)
     39
     40/* libhttp error codes. Defining them here is a temporary hack. */
     41
     42#define HTTP_EMULTIPLE_HEADERS  __errno_t(  50)
     43#define HTTP_EMISSING_HEADER    __errno_t(  51)
     44#define HTTP_EPARSE             __errno_t(  52)
     45
     46/* libext4 error codes. Same as above. */
     47
     48#define EXT4_ERR_BAD_DX_DIR     __errno_t(  60)
     49
     50
     51/* POSIX error codes + whatever nonstandard names crop up in third-party
     52 * software. These are not used in HelenOS code, but are defined here in
     53 * order to avoid nasty hacks in libposix.
    454 *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  *
    9  * - Redistributions of source code must retain the above copyright
    10  *   notice, this list of conditions and the following disclaimer.
    11  * - Redistributions in binary form must reproduce the above copyright
    12  *   notice, this list of conditions and the following disclaimer in the
    13  *   documentation and/or other materials provided with the distribution.
    14  * - The name of the author may not be used to endorse or promote products
    15  *   derived from this software without specific prior written permission.
    16  *
    17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    19  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    20  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
    21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     55 * If you decide to use one of these in native HelenOS code,
     56 * move it up to the first group.
    2757 */
    2858
    29 /** @addtogroup generic
    30  * @{
    31  */
    32 /** @file
    33  */
     59/* COMPAT_START -- do not remove or edit this comment */
    3460
    35 #ifndef ABI_ERRNO_H_
    36 #define ABI_ERRNO_H_
    37 
    38 /**
    39  * Values in the range [-1, -255] are kernel error codes,
    40  * values in the range [-256, -512] are user error codes.
    41  */
    42 
    43 #define EOK             0   /* No error */
    44 #define ENOENT         -1   /* No such entry */
    45 #define ENOMEM         -2   /* Not enough memory */
    46 #define ELIMIT         -3   /* Limit exceeded */
    47 #define EREFUSED       -4   /* Connection refused */
    48 #define EFORWARD       -5   /* Forward error */
    49 #define EPERM          -6   /* Permission denied */
    50 
    51 /*
    52  * Answerbox closed connection, call
    53  * sys_ipc_hangup() to close the connection.
    54  * Used by answerbox to close the connection.
    55  */
    56 #define EHANGUP        -7
    57 
    58 /*
    59  * The other party encountered an error when
    60  * receiving the call.
    61  */
    62 #define EPARTY         -8
    63 
    64 #define EEXIST         -9   /* Entry already exists */
    65 #define EBADMEM        -10  /* Bad memory pointer */
    66 #define ENOTSUP        -11  /* Not supported */
    67 #define EADDRNOTAVAIL  -12  /* Address not available. */
    68 #define ETIMEOUT       -13  /* Timeout expired */
    69 #define EINVAL         -14  /* Invalid value */
    70 #define EBUSY          -15  /* Resource is busy */
    71 #define EOVERFLOW      -16  /* The result does not fit its size. */
    72 #define EINTR          -17  /* Operation was interrupted. */
    73 
    74 #endif
    75 
    76 /** @}
    77  */
     61#define E2BIG             __errno_t(  101)
     62#define EACCES            __errno_t(  102)
     63#define EADDRINUSE        __errno_t(  103)
     64#define EAFNOSUPPORT      __errno_t(  105)
     65#define EALREADY          __errno_t(  107)
     66#define EBADMSG           __errno_t(  109)
     67#define ECANCELED         __errno_t(  111)
     68#define ECHILD            __errno_t(  112)
     69#define ECONNABORTED      __errno_t(  113)
     70#define ECONNREFUSED      __errno_t(  114)
     71#define ECONNRESET        __errno_t(  115)
     72#define EDEADLK           __errno_t(  116)
     73#define EDESTADDRREQ      __errno_t(  117)
     74#define EDQUOT            __errno_t(  119)
     75#define EFAULT            __errno_t(  121)
     76#define EFBIG             __errno_t(  122)
     77#define EHOSTUNREACH      __errno_t(  123)
     78#define EIDRM             __errno_t(  124)
     79#define EILSEQ            __errno_t(  125)
     80#define EINPROGRESS       __errno_t(  126)
     81#define EISCONN           __errno_t(  130)
     82#define ELOOP             __errno_t(  132)
     83#define EMSGSIZE          __errno_t(  135)
     84#define EMULTIHOP         __errno_t(  136)
     85#define ENETDOWN          __errno_t(  138)
     86#define ENETRESET         __errno_t(  139)
     87#define ENETUNREACH       __errno_t(  140)
     88#define ENFILE            __errno_t(  141)
     89#define ENOBUFS           __errno_t(  142)
     90#define ENODATA           __errno_t(  143)
     91#define ENODEV            __errno_t(  144)
     92#define ENOEXEC           __errno_t(  146)
     93#define ENOLCK            __errno_t(  147)
     94#define ENOLINK           __errno_t(  148)
     95#define ENOMSG            __errno_t(  150)
     96#define ENOPROTOOPT       __errno_t(  151)
     97#define ENOSR             __errno_t(  153)
     98#define ENOSTR            __errno_t(  154)
     99#define ENOSYS            __errno_t(  155)
     100#define ENOTCONN          __errno_t(  156)
     101#define ENOTRECOVERABLE   __errno_t(  159)
     102#define ENOTSOCK          __errno_t(  160)
     103#define ENOTTY            __errno_t(  162)
     104#define EOPNOTSUPP        __errno_t(  164)
     105#define EOWNERDEAD        __errno_t(  166)
     106#define EPIPE             __errno_t(  168)
     107#define EPROTO            __errno_t(  169)
     108#define EPROTONOSUPPORT   __errno_t(  170)
     109#define EPROTOTYPE        __errno_t(  171)
     110#define EROFS             __errno_t(  173)
     111#define ESPIPE            __errno_t(  174)
     112#define ESRCH             __errno_t(  175)
     113#define ESTALE            __errno_t(  176)
     114#define ETIME             __errno_t(  177)
     115#define ETIMEDOUT         __errno_t(  178)
     116#define ETXTBSY           __errno_t(  179)
     117#define EWOULDBLOCK       __errno_t(  180)
  • abi/include/abi/ipc/ipc.h

    r8bfb163 r132ab5d1  
    3838/** Length of data being transferred with IPC call
    3939 *
    40  * The uspace may not be able to utilize full length
     40 * The uspace may not be able to utilize the full length
    4141 *
    4242 */
     
    4949
    5050/** This is answer to a call */
    51 #define IPC_CALL_ANSWERED  (1 << 0)
     51#define IPC_CALL_ANSWERED        (1 << 0)
    5252
    5353/** Answer will not be passed to userspace, will be discarded */
     
    5555
    5656/** Call was forwarded */
    57 #define IPC_CALL_FORWARDED  (1 << 2)
     57#define IPC_CALL_FORWARDED       (1 << 2)
    5858
    5959/** Interrupt notification */
    60 #define IPC_CALL_NOTIF  (1 << 3)
     60#define IPC_CALL_NOTIF           (1 << 3)
     61
     62/** The call was automatically answered by the kernel due to error */
     63#define IPC_CALL_AUTO_REPLY      (1 << 4)
    6164
    6265/**
     
    6669#define DATA_XFER_LIMIT  (64 * 1024)
    6770
    68 
    69 /** Bits used in call hashes.
    70  *
    71  * The addresses are aligned at least to 4 that is why we can use the 2 least
    72  * significant bits of the call address.
    73  *
    74  */
    75 
    76 /** Type of this call is 'answer' */
    77 #define IPC_CALLID_ANSWERED  1
    78 
    79 /** Type of this call is 'notification' */
    80 #define IPC_CALLID_NOTIFICATION  2
    81 
    82 /* Return values from sys_ipc_call_async(). */
    83 #define IPC_CALLRET_FATAL      -1
    84 
    8571/* Macros for manipulating calling data */
    86 #define IPC_SET_RETVAL(data, retval)  ((data).args[0] = (retval))
     72#define IPC_SET_RETVAL(data, retval)  ((data).args[0] = (sysarg_t) (retval))
    8773#define IPC_SET_IMETHOD(data, val)    ((data).args[0] = (val))
    8874#define IPC_SET_ARG1(data, val)       ((data).args[1] = (val))
     
    9379
    9480#define IPC_GET_IMETHOD(data)  ((data).args[0])
    95 #define IPC_GET_RETVAL(data)   ((data).args[0])
     81#define IPC_GET_RETVAL(data)   ((errno_t) (data).args[0])
    9682
    9783#define IPC_GET_ARG1(data)  ((data).args[1])
  • abi/include/abi/ipc/methods.h

    r8bfb163 r132ab5d1  
    3636#define ABI_IPC_METHODS_H_
    3737
     38#include <abi/cap.h>
     39
    3840/* Well known phone descriptors */
    39 #define PHONE_NS  0
     41#define PHONE_NS  (CAP_NIL + 1)
    4042
    4143/** Kernel IPC interfaces
  • abi/include/abi/synch.h

    r8bfb163 r132ab5d1  
    4646#define SYNCH_FLAGS_INTERRUPTIBLE  (1 << 1)
    4747
    48 /** Could not satisfy the request without going to sleep. */
    49 #define ESYNCH_WOULD_BLOCK  1
    50 /** Timeout occurred. */
    51 #define ESYNCH_TIMEOUT      2
    52 /** Sleep was interrupted. */
    53 #define ESYNCH_INTERRUPTED  4
    54 /** Operation succeeded without sleeping. */
    55 #define ESYNCH_OK_ATOMIC    8
    56 /** Operation succeeded and did sleep. */
    57 #define ESYNCH_OK_BLOCKED   16
    58 
    59 #define SYNCH_FAILED(rc) \
    60         ((rc) & (ESYNCH_WOULD_BLOCK | ESYNCH_TIMEOUT | ESYNCH_INTERRUPTED))
    61 
    62 #define SYNCH_OK(rc) \
    63         ((rc) & (ESYNCH_OK_ATOMIC | ESYNCH_OK_BLOCKED))
    64 
    6548#endif
    6649
Note: See TracChangeset for help on using the changeset viewer.