Ignore:
Timestamp:
Feb 12, 2013, 6:33:31 PM (11 years ago)
Author:
meunier
Message:

Added support for memspaces and const.
Added an interrupt masking to the "giet_context_switch" syscall
Corrected two bugs in boot/boot_init.c (one minor and one regarding barriers initialization)
Reformatted the code in all files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/sys/common.h

    r218 r228  
    3030
    3131///////////////////////////////////////////////////////////////////////////////////
    32 //      Prototypes of common functions
     32//     Prototypes of common functions
    3333///////////////////////////////////////////////////////////////////////////////////
    3434
    35 void                            _puts(char *string);
    36 void                            _putx(unsigned int val);
    37 void                            _putd(unsigned int val);
     35void _puts(char *string);
     36void _putx(unsigned int val);
     37void _putd(unsigned int val);
    3838
    39 unsigned int            _strncmp( const char* s1,
    40                               const char* s2,
    41                               unsigned int n );
     39unsigned int _strncmp(const char * s1, const char * s2, unsigned int n);
     40void _dcache_buf_invalidate(const void * buffer, unsigned int size);
    4241
    43 void                            _dcache_buf_invalidate( const void *buffer,
    44                                             unsigned int size );
     42void _dtlb_off(void);
     43void _dtlb_on(void);
    4544
    46 void                            _dtlb_off(void);
    47 void                            _dtlb_on(void);
     45void _it_mask(void);
     46void _it_restore(void);
    4847
    49 void                            _it_mask(void);
    50 void                            _it_enable(void);
     48unsigned int _get_epc(void);
     49unsigned int _get_ptpr(void);
     50unsigned int _get_bvar(void);
     51unsigned int _get_cr(void);
     52unsigned int _get_sched(void);
    5153
    52 unsigned int            _get_epc(void);
    53 unsigned int            _get_ptpr(void);
    54 unsigned int            _get_bvar(void);
    55 unsigned int            _get_cr(void);
    56 unsigned int            _get_sched(void);
     54unsigned int _get_context_slot(unsigned int task_id, unsigned int slot_id);
     55void _set_context_slot(unsigned int task_id, unsigned int slot_id, unsigned int value);
    5756
    58 unsigned int            _get_context_slot( unsigned int task_id,
    59                                        unsigned int slot_id );
     57unsigned int _get_interrupt_vector_entry(unsigned int index);
    6058
    61 void                            _set_context_slot( unsigned int task_id,
    62                                        unsigned int slot_id,
    63                                        unsigned int value );
     59unsigned int _get_current_task_id(void);
     60void _set_current_task_id(unsigned int value);
    6461
    65 unsigned int            _get_interrupt_vector_entry(unsigned int index);
     62unsigned int _get_tasks_number(void);
    6663
    67 unsigned int            _get_current_task_id( void );
    68 void                            _set_current_task_id( unsigned int value );
     64void _get_lock(unsigned int * lock);
     65void _release_lock(unsigned int * lock);
    6966
    70 unsigned int            _get_tasks_number(void);
    71 
    72 
    73 void                            _get_lock(unsigned int* lock);
    74 void                            _release_lock(unsigned int* lock);
    75 
    76 mapping_cluster_t*  _get_cluster_base( mapping_header_t* header );
    77 mapping_pseg_t*     _get_pseg_base( mapping_header_t* header );
    78 mapping_vspace_t*   _get_vspace_base( mapping_header_t* header );
    79 mapping_vseg_t*     _get_vseg_base( mapping_header_t* header );
    80 mapping_vobj_t*     _get_vobj_base( mapping_header_t* header );
    81 mapping_task_t*     _get_task_base( mapping_header_t* header );
     67mapping_cluster_t * _get_cluster_base(mapping_header_t* header);
     68mapping_pseg_t * _get_pseg_base(mapping_header_t* header);
     69mapping_vspace_t * _get_vspace_base(mapping_header_t* header);
     70mapping_vseg_t * _get_vseg_base(mapping_header_t* header);
     71mapping_vobj_t * _get_vobj_base(mapping_header_t* header);
     72mapping_task_t * _get_task_base(mapping_header_t* header);
    8273
    8374
     
    8980// Code taken from MutekH.
    9081///////////////////////////////////////////////////////////////////////////////////
    91 static inline void *memcpy(void *_dst, const void *_src, unsigned int size)
    92 {
    93     unsigned int *dst = _dst;
    94     const unsigned int *src = _src;
     82static inline void * memcpy(void * _dst, const void * _src, unsigned int size) {
     83    unsigned int * dst = _dst;
     84    const unsigned int * src = _src;
    9585
    9686    /* if source and destination buffer are word-aligned,
    9787     * then copy word-by-word */
    98     if (!((unsigned int)dst & 3) && !((unsigned int)src & 3))
     88    if (!((unsigned int) dst & 3) && !((unsigned int) src & 3)) {
    9989        while (size > 3) {
    10090            *dst++ = *src++;
    10191            size -= 4;
    10292        }
     93    }
    10394
    104     unsigned char *cdst = (unsigned char*)dst;
    105     unsigned char *csrc = (unsigned char*)src;
     95    unsigned char * cdst = (unsigned char *) dst;
     96    unsigned char * csrc = (unsigned char *) src;
    10697
    10798    /* byte-by-byte copy */
     
    113104
    114105#endif
     106
     107// Local Variables:
     108// tab-width: 4
     109// c-basic-offset: 4
     110// c-file-offsets:((innamespace . 0)(inline-open . 0))
     111// indent-tabs-mode: nil
     112// End:
     113// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
     114
Note: See TracChangeset for help on using the changeset viewer.