Ignore:
Timestamp:
Jul 22, 2012, 12:06:11 PM (12 years ago)
Author:
karaoui
Message:

updating libs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/libs/libsrl/srl_private_types.h

    r160 r178  
    88 */
    99
    10 #include "stdio.h"
    11 #include "srl_barrier.h"
    12 #include "srl_public_types.h"
    1310
    14 #define TTY_INC 16
    15 
    16 /**
    17    A numeric constant holder
    18  */
    19 typedef unsigned int srl_const_t;
    20 #define SRL_CONST_INITIALIZER(x) x
    21 
    22 typedef void srl_task_func_t( void* );
    23 
    24 typedef struct srl_abstract_task_s {
    25         srl_task_func_t *bootstrap;
    26         srl_task_func_t *func;
    27         void *args;
    28         void *stack;
    29         size_t stack_size;
    30         const char *name;
    31 //      uint32_t context[CONTEXT_WSIZE];
    32         sint32_t wait_val;
    33         void *wait_addr;
    34         size_t tty_addr;
    35 }srl_task_s;
    36 
    37 #define SRL_TASK_INITIALIZER(b, f, ss, s, a, n, ttyc, ttyn)     \
    38         {                                                                                                               \
    39                 .bootstrap = (srl_task_func_t *)b,                                      \
    40                 .func = (srl_task_func_t *)f,                                           \
    41                 .args = (void*)a,                                                                       \
    42                 .stack = (void*)s,                                                                      \
    43                 .stack_size = ss,                                                                       \
    44                 .name = n,                                                                                      \
    45                 .tty_addr = (size_t)ttyc + (ttyn * TTY_INC),            \
    46         }
    47 
    48 
    49 typedef struct srl_abstract_cpudesc_s srl_cpudesc_s;
    50 struct srl_abstract_cpudesc_s {
    51         const size_t ntasks;
    52         const srl_task_s * const *task_list;
    53         size_t tty_addr;
    54 };
    55 
    56 #define SRL_CPUDESC_INITIALIZER(nt, tl, ttyc, ttyn)     \
    57         {                                                                                               \
    58                 .ntasks = nt,                                                           \
    59                 .task_list = tl,                                                        \
    60                 .tty_addr = (size_t)ttyc + (ttyn * TTY_INC),\
    61         }
    62 
    63 typedef struct srl_abstract_appdesc_s srl_appdesc_s;
    64 struct srl_abstract_appdesc_s {
    65         const size_t ntasks;
    66         srl_barrier_s *start;
    67         const struct srl_mwmr_s * const *mwmr;
    68         const srl_cpudesc_s * const *cpu;
    69         const srl_task_s * const *task;
    70         size_t tty_addr;
    71 };
    72 
    73 #define SRL_APPDESC_INITIALIZER(nt, cl, ml, tl, sb, ttyc, ttyn) \
    74         {                                                                                                                  \
    75                 .ntasks = nt,                                                                              \
    76                 .cpu = cl,                                                                                     \
    77                 .mwmr = ml,                                                                                    \
    78                 .task = tl,                                                                                    \
    79                 .start = sb,                                                                               \
    80                 .tty_addr = (size_t)ttyc + (ttyn * TTY_INC),                                            \
    81         }
    82 
    83 //needed by gcc
    84 void *memcpy(void *_dst, const void *_src, unsigned int size);
    85 void * memset(void *dst, int data, size_t size);
    86 
    87 
    88 /**
    89  * All function needed by kmain has to be tagged with in_srl_main
    90  * typically: srl_mwmw_sys
    91  */
    92 #define in_srl_main __attribute__((section (".srl_main")))
    9311
    9412/**
     
    9715#define cpu_mem_write_32(addr, data) *((volatile uint32_t*)(addr)) = data
    9816
    99 #define uintptr_t unsigned int
    100 
    10117#endif
Note: See TracChangeset for help on using the changeset viewer.