Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 9a426d1f in mainline


Ignore:
Timestamp:
2011-08-28T18:48:21Z (9 years ago)
Author:
Martin Decky <martin@…>
Branches:
master
Children:
19fc04c
Parents:
dc6b148
Message:

more kernel/uspace ABI unification:
bool, task_id_t, thread_id_t, state_t, SYS_SYSINFO_GET_TAG → SYS_SYSINFO_GET_VAL_TYPE, sysinfo_item_val_type_t

Files:
3 added
14 edited

Legend:

Unmodified
Added
Removed
  • abi/include/syscall.h

    rdc6b148 r9a426d1f  
    8989        SYS_UNREGISTER_IRQ,
    9090       
    91         SYS_SYSINFO_GET_TAG,
     91        SYS_SYSINFO_GET_VAL_TYPE,
    9292        SYS_SYSINFO_GET_VALUE,
    9393        SYS_SYSINFO_GET_DATA_SIZE,
  • abi/include/sysinfo.h

    rdc6b148 r9a426d1f  
    3737#define ABI_SYSINFO_H_
    3838
     39#include <abi/proc/task.h>
     40#include <abi/proc/thread.h>
     41
    3942/** Number of load components */
    4043#define LOAD_STEPS  3
     
    4447#define EXC_NAME_BUFLEN   20
    4548
    46 /** Thread states */
     49/** Item value type
     50 *
     51 */
    4752typedef enum {
    48         /** It is an error, if thread is found in this state. */
    49         Invalid,
    50         /** State of a thread that is currently executing on some CPU. */
    51         Running,
    52         /** Thread in this state is waiting for an event. */
    53         Sleeping,
    54         /** State of threads in a run queue. */
    55         Ready,
    56         /** Threads are in this state before they are first readied. */
    57         Entering,
    58         /** After a thread calls thread_exit(), it is put into Exiting state. */
    59         Exiting,
    60         /** Threads that were not detached but exited are Lingering. */
    61         Lingering
    62 } state_t;
     53        SYSINFO_VAL_UNDEFINED = 0,     /**< Undefined value */
     54        SYSINFO_VAL_VAL = 1,           /**< Constant numeric value */
     55        SYSINFO_VAL_DATA = 2,          /**< Constant binary data */
     56        SYSINFO_VAL_FUNCTION_VAL = 3,  /**< Generated numeric value */
     57        SYSINFO_VAL_FUNCTION_DATA = 4  /**< Generated binary data */
     58} sysinfo_item_val_type_t;
    6359
    6460/** Statistics about a single CPU
  • kernel/generic/include/ipc/ipc.h

    rdc6b148 r9a426d1f  
    3636#define KERN_IPC_H_
    3737
    38 #include <abi/ipc/ipc.h>
    3938#include <synch/spinlock.h>
    4039#include <synch/mutex.h>
    4140#include <synch/waitq.h>
     41#include <abi/ipc/ipc.h>
     42#include <abi/proc/task.h>
    4243#include <typedefs.h>
    4344
  • kernel/generic/include/sysinfo/sysinfo.h

    rdc6b148 r9a426d1f  
    3838#include <typedefs.h>
    3939#include <str.h>
     40#include <abi/sysinfo.h>
    4041
    4142/** Framebuffer info exported flags */
    4243extern bool fb_exported;
    43 
    44 /** Item value type
    45  *
    46  */
    47 typedef enum {
    48         SYSINFO_VAL_UNDEFINED = 0,     /**< Undefined value */
    49         SYSINFO_VAL_VAL = 1,           /**< Constant numeric value */
    50         SYSINFO_VAL_DATA = 2,          /**< Constant binary data */
    51         SYSINFO_VAL_FUNCTION_VAL = 3,  /**< Generated numeric value */
    52         SYSINFO_VAL_FUNCTION_DATA = 4  /**< Generated binary data */
    53 } sysinfo_item_val_type_t;
    5444
    5545/** Subtree type
     
    145135extern void sysinfo_dump(sysinfo_item_t *);
    146136
    147 extern sysarg_t sys_sysinfo_get_tag(void *, size_t);
     137extern sysarg_t sys_sysinfo_get_val_type(void *, size_t);
    148138extern sysarg_t sys_sysinfo_get_value(void *, size_t, void *);
    149139extern sysarg_t sys_sysinfo_get_data_size(void *, size_t, void *);
  • kernel/generic/include/typedefs.h

    rdc6b148 r9a426d1f  
    3939#include <arch/common.h>
    4040#include <arch/types.h>
     41#include <abi/bool.h>
    4142
    4243#define NULL  ((void *) 0)
     
    6162typedef void (* function)();
    6263
    63 typedef uint8_t bool;
    64 typedef uint64_t thread_id_t;
    65 typedef uint64_t task_id_t;
    6664typedef uint32_t container_id_t;
    6765
  • kernel/generic/src/syscall/syscall.c

    rdc6b148 r9a426d1f  
    181181       
    182182        /* Sysinfo syscalls. */
    183         (syshandler_t) sys_sysinfo_get_tag,
     183        (syshandler_t) sys_sysinfo_get_val_type,
    184184        (syshandler_t) sys_sysinfo_get_value,
    185185        (syshandler_t) sys_sysinfo_get_data_size,
  • kernel/generic/src/sysinfo/sysinfo.c

    rdc6b148 r9a426d1f  
    661661 *
    662662 */
    663 sysarg_t sys_sysinfo_get_tag(void *path_ptr, size_t path_size)
     663sysarg_t sys_sysinfo_get_val_type(void *path_ptr, size_t path_size)
    664664{
    665665        /*
  • uspace/app/sysinfo/sysinfo.c

    rdc6b148 r9a426d1f  
    5151        int rc;
    5252        char *ipath;
    53         sysinfo_item_tag_t tag;
     53        sysinfo_item_val_type_t tag;
    5454
    5555        if (argc != 2) {
     
    6060        ipath = argv[1];
    6161
    62         tag = sysinfo_get_tag(ipath);
     62        tag = sysinfo_get_val_type(ipath);
    6363
    6464        /* Silence warning */
     
    7575        case SYSINFO_VAL_DATA:
    7676                rc = print_item_data(ipath);
     77                break;
     78        default:
     79                printf("Error: Sysinfo item '%s' with unknown value type.\n",
     80                    ipath);
     81                rc = 2;
    7782                break;
    7883        }
  • uspace/app/trace/syscalls.c

    rdc6b148 r9a426d1f  
    7575    [SYS_UNREGISTER_IRQ] = { "unregister_irq",  2,      V_ERRNO },
    7676
    77     [SYS_SYSINFO_GET_TAG] = { "sysinfo_get_tag",                2,      V_INTEGER },
     77    [SYS_SYSINFO_GET_VAL_TYPE] = { "sysinfo_get_val_type",              2,      V_INTEGER },
    7878    [SYS_SYSINFO_GET_VALUE] = { "sysinfo_get_value",            3,      V_ERRNO },
    7979    [SYS_SYSINFO_GET_DATA_SIZE] = { "sysinfo_get_data_size",    3,      V_ERRNO },
  • uspace/lib/c/generic/sysinfo.c

    rdc6b148 r9a426d1f  
    4747 *
    4848 */
    49 sysinfo_item_tag_t sysinfo_get_tag(const char *path)
     49sysinfo_item_val_type_t sysinfo_get_val_type(const char *path)
    5050{
    51         return (sysinfo_item_tag_t) __SYSCALL2(SYS_SYSINFO_GET_TAG,
     51        return (sysinfo_item_val_type_t) __SYSCALL2(SYS_SYSINFO_GET_VAL_TYPE,
    5252            (sysarg_t) path, (sysarg_t) str_size(path));
    5353}
  • uspace/lib/c/include/bool.h

    rdc6b148 r9a426d1f  
    3737
    3838#include <libarch/types.h>
     39#include <abi/bool.h>
    3940
    4041#define false  0
    4142#define true   1
    42 
    43 typedef uint8_t bool;
    4443
    4544#endif
  • uspace/lib/c/include/sysinfo.h

    rdc6b148 r9a426d1f  
    3636#define LIBC_SYSINFO_H_
    3737
    38 #include <libc.h>
     38#include <sys/types.h>
     39#include <bool.h>
     40#include <abi/sysinfo.h>
    3941
    40 /** Sysinfo value types
    41  *
    42  */
    43 typedef enum {
    44         SYSINFO_VAL_UNDEFINED = 0,
    45         SYSINFO_VAL_VAL = 1,
    46         SYSINFO_VAL_DATA = 2
    47 } sysinfo_item_tag_t;
    48 
    49 extern sysinfo_item_tag_t sysinfo_get_tag(const char *);
     42extern sysinfo_item_val_type_t sysinfo_get_val_type(const char *);
    5043extern int sysinfo_get_value(const char *, sysarg_t *);
    5144extern void *sysinfo_get_data(const char *, size_t *);
  • uspace/lib/c/include/task.h

    rdc6b148 r9a426d1f  
    3737
    3838#include <sys/types.h>
    39 
    40 typedef uint64_t task_id_t;
     39#include <abi/proc/task.h>
    4140
    4241typedef enum {
  • uspace/lib/c/include/thread.h

    rdc6b148 r9a426d1f  
    3838#include <libarch/thread.h>
    3939#include <sys/types.h>
    40 
    41 typedef uint64_t thread_id_t;
     40#include <abi/proc/thread.h>
    4241
    4342extern int thread_create(void (*)(void *), void *, const char *, thread_id_t *);
Note: See TracChangeset for help on using the changeset viewer.