Changeset 160 for soft/giet_vm/sys


Ignore:
Timestamp:
Jun 12, 2012, 4:21:27 PM (13 years ago)
Author:
karaoui
Message:

giet-vm new version

Location:
soft/giet_vm/sys
Files:
2 added
8 edited

Legend:

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

    r158 r160  
    99///////////////////////////////////////////////////////////////////////////////////
    1010
    11 #include <mapping_info.h>
    1211#include <common.h>
    1312#include <drivers.h>
     
    216215}
    217216/////////////////////////////////////////////////////////////////////////////
    218 mapping_task_t* _get_task_base( mapping_header_t* header )
    219 {
    220     return   (mapping_task_t*)    ((char*)header +
     217mapping_vobj_t* _get_vobj_base( mapping_header_t* header )
     218{
     219    return   (mapping_vobj_t*)   ((char*)header +
    221220                                  MAPPING_HEADER_SIZE +
    222221                                  MAPPING_CLUSTER_SIZE*header->clusters +
    223222                                  MAPPING_PSEG_SIZE*header->psegs +
    224223                                  MAPPING_VSPACE_SIZE*header->vspaces +
     224                                  MAPPING_VSEG_SIZE*header->vsegs );
     225}
     226/////////////////////////////////////////////////////////////////////////////
     227mapping_task_t* _get_task_base( mapping_header_t* header )
     228{
     229    return   (mapping_task_t*)    ((char*)header +
     230                                  MAPPING_HEADER_SIZE +
     231                                  MAPPING_CLUSTER_SIZE*header->clusters +
     232                                  MAPPING_PSEG_SIZE*header->psegs +
     233                                  MAPPING_VSPACE_SIZE*header->vspaces +
     234                                  MAPPING_VOBJ_SIZE*header->vobjs +
    225235                                  MAPPING_VSEG_SIZE*header->vsegs);
    226236}
    227237
     238
  • soft/giet_vm/sys/common.h

    r158 r160  
    2424extern _ld_symbol_t seg_fb_base;
    2525extern _ld_symbol_t seg_ioc_base;
    26 extern _ld_symbol_t seg_boot_mapping_base;
     26extern _ld_symbol_t seg_mapping_base;
    2727extern _ld_symbol_t seg_kernel_pt_base;
    2828
     
    4949mapping_vspace_t*   _get_vspace_base( mapping_header_t* header );
    5050mapping_vseg_t*     _get_vseg_base( mapping_header_t* header );
     51mapping_vobj_t*     _get_vobj_base( mapping_header_t* header );
    5152mapping_task_t*     _get_task_base( mapping_header_t* header );
    5253
  • soft/giet_vm/sys/ctx_handler.c

    r158 r160  
    3131
    3232#include <giet_config.h>
    33 #include <ctx_handler.h>
    34 #include <sys_handler.h>
    3533#include <drivers.h>
    3634#include <common.h>
     35#include <ctx_handler.h>
     36#include <mapping_info.h>
     37#include <sys_handler.h>
    3738
    3839extern void _task_switch(unsigned int *, unsigned int *);
     
    7172    // return if only one task  */
    7273    if ( tasks <= 1) return;
    73 
     74 
    7475    // compute the task context base address for the current task
    7576    curr_task_id = _scheduler[proc_id].current;
    7677    curr_context = &(_scheduler[proc_id].context[curr_task_id][0]);
    77 
     78   
    7879    // select the next task using a round-robin scheduling policy
    7980    next_task_id = (curr_task_id + 1) % tasks;
  • soft/giet_vm/sys/drivers.c

    r158 r160  
    55// Copyright (c) UPMC-LIP6
    66///////////////////////////////////////////////////////////////////////////////////
    7 // The vers.c and drivers.h files are part ot the GIET nano kernel.
     7// The drivers.c and drivers.h files are part ot the GIET nano kernel.
    88// They contains the drivers for the peripherals available in the SoCLib library:
    99// - vci_multi_tty
     
    204204
    205205    proc_id = _procid();
     206   
    206207    task_id = _scheduler[proc_id].current;
    207208    tty_id  = _scheduler[proc_id].context[task_id][CTX_TTY_ID];
  • soft/giet_vm/sys/irq_handler.c

    r158 r160  
    4545    int interrupt_index;
    4646    _isr_func_t isr;
     47
     48    // interrupt vector initialisation
     49
    4750
    4851    /* retrieves the highest priority active interrupt index */
  • soft/giet_vm/sys/sys.ld

    r158 r160  
    22* Definition of the base address for all virtual segments
    33*****************************************************************************/
    4 
    5 /* The vsegs used in the boot phase must respect identity mapping:
    6    physical address = virtual address */
    7 
    8 seg_boot_code_base      = 0xBFC00000;   /* boot code */
    9 seg_boot_stack_base     = 0xBFC08000;   /* boot temporary stack */
    10 seg_boot_mapping_base   = 0xBFC0C000;   /* boot mapping_info */
    114
    125/* The vsegs used by the system are replicated in all virtual spaces
     
    169seg_kernel_data_base    = 0x80010000;   /* system cacheable data */
    1710seg_kernel_uncdata_base = 0x80020000;   /* system uncacheable data */
    18 seg_kernel_pt_base      = 0x80030000;   /* system page table */
     11seg_kernel_init_base    = 0x80030000;   /* system page table */
    1912
    20 /* The peripherals base addresses are referenced by the software drivers and
     13
     14/* The peripherals base addresses are referenced by the software drivers and    \
    2115   must be defined, even if the peripherals are not used in the architecture */
    2216
     
    2923seg_icu_base            = 0x9F000000;   /* ICU device */
    3024
     25/*****************************************/
     26seg_mapping_base        = 0xBFC0C000;   /* boot mapping_info */
     27
    3128/*
    3229 * Grouping sections into segments for system code and data
     
    3532SECTIONS
    3633{
    37     . = seg_boot_code_base;
    38     seg_boot_code :
    39     {
    40         *(.boot)
    41     }
    4234    . = seg_kernel_code_base;
    4335    seg_kernel_code :
     
    6961        *(.unckdata)
    7062    }
    71     . = seg_kernel_pt_base;
    72     seg_kernel_pt :
     63
     64    . = seg_kernel_init_base;
     65    seg_kernel_init :
    7366    {
    74         *(.ptab)
     67        *(.kinitentry)
     68        *(.kinit)
    7569    }
    7670}
  • soft/giet_vm/sys/sys_handler.c

    r158 r160  
    1212
    1313#include <sys_handler.h>
    14 #include <boot_handler.h>
     14//#include <boot_handler.h>
    1515#include <drivers.h>
    1616#include <ctx_handler.h>
     
    4949    &_sys_ukn,          /* 0x18 */
    5050    &_sys_ukn,          /* 0x19 */
    51     &_mwmr_base,        /* 0x1A */
     51    &_vobj_get_vbase,   /* 0x1A */
    5252    &_sys_ukn,          /* 0x1B */
    5353    &_sys_ukn,          /* 0x1C */
     
    117117                            unsigned int*       buffer)
    118118{
    119     mapping_header_t*   header  = (mapping_header_t*)&seg_boot_mapping_base;
     119    mapping_header_t*   header  = (mapping_header_t*)&seg_mapping_base;
    120120    mapping_cluster_t*  cluster = _get_cluster_base( header );
    121121
     
    131131}
    132132/////////////////////////////////////////////////////////////////////////////
    133 // _mwmr_base()
    134 // returns in buffer argument the base address of the MWMR channel
    135 // identified by the (vspace_name / channel_name) couple.
     133// _vobj_get_base()
     134// returns 0: success, else: failed.
     135// give access to the base address of a vobj identified by the (vspace_name / channel_name ) couple.
     136// The "type" argument is here for checking purpose.
    136137/////////////////////////////////////////////////////////////////////////////
    137 unsigned int _mwmr_base( char* vspace_name,
    138                          char* channel_name,
    139                          unsigned int* buffer )
     138unsigned int _vobj_get_vbase( char* vspace_name, char* vobj_name,
     139                        unsigned vobj_type, unsigned int* vobj_buffer)
    140140{
    141     mapping_header_t* header = (mapping_header_t*)&seg_boot_mapping_base;
     141    mapping_header_t* header = (mapping_header_t*)&seg_mapping_base;
    142142    mapping_vspace_t* vspace = _get_vspace_base( header );
    143     mapping_vseg_t*   vseg   = _get_vseg_base( header );
     143    mapping_vobj_t*    vobj  = _get_vobj_base( header );
    144144
    145145    unsigned int    vspace_id;
    146     unsigned int    vseg_id;
     146    unsigned int    vobj_id;
     147       
    147148
    148149    // scan vspaces
     
    151152        if ( _strncmp( vspace[vspace_id].name, vspace_name, 31) == 0 )
    152153        {
    153             // scan vsegs
    154             for ( vseg_id = vspace[vspace_id].vseg_offset ;
    155                   vseg_id < (vspace[vspace_id].vseg_offset + vspace[vspace_id].vsegs) ;
    156                   vseg_id++ )
     154            // scan vobjs
     155            for(vobj_id= vspace[vspace_id].vobj_offset; vobj_id < (vspace[vspace_id].vobj_offset + vspace[vspace_id].vobjs); vobj_id++)
    157156            {
    158                 if ( _strncmp( vseg[vseg_id].name, channel_name, 31) == 0 )
     157
     158                if ( _strncmp( vobj[vobj_id].name, vobj_name, 31) == 0 )
    159159                {
    160                     *buffer = vseg[vseg_id].vbase;
     160                    if(vobj[vobj_id].type != vobj_type)
     161                        return -1;//wrong type
     162
     163                    *vobj_buffer = (unsigned int)vobj[vobj_id].vaddr;
    161164                    return 0;
    162165                }
     
    165168    }
    166169    // not found !!!
    167     return 1;
     170    return -2;
    168171}
    169172
  • soft/giet_vm/sys/sys_handler.h

    r158 r160  
    3030                               unsigned int* buffer );
    3131
    32 unsigned int    _mwmr_base( char* vspace_name,
    33                             char* channel_name,
    34                             unsigned int* buffer);
    35 
     32unsigned int _vobj_get_vbase( char* vspace_name, char* vobj_name,
     33                        unsigned vobj_type, unsigned int* vobj_buffer);
    3634#endif
Note: See TracChangeset for help on using the changeset viewer.