Changeset 160 for soft/giet_vm/sys
- Timestamp:
- Jun 12, 2012, 4:21:27 PM (13 years ago)
- Location:
- soft/giet_vm/sys
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/sys/common.c
r158 r160 9 9 /////////////////////////////////////////////////////////////////////////////////// 10 10 11 #include <mapping_info.h>12 11 #include <common.h> 13 12 #include <drivers.h> … … 216 215 } 217 216 ///////////////////////////////////////////////////////////////////////////// 218 mapping_ task_t* _get_task_base( mapping_header_t* header )219 { 220 return (mapping_ task_t*)((char*)header +217 mapping_vobj_t* _get_vobj_base( mapping_header_t* header ) 218 { 219 return (mapping_vobj_t*) ((char*)header + 221 220 MAPPING_HEADER_SIZE + 222 221 MAPPING_CLUSTER_SIZE*header->clusters + 223 222 MAPPING_PSEG_SIZE*header->psegs + 224 223 MAPPING_VSPACE_SIZE*header->vspaces + 224 MAPPING_VSEG_SIZE*header->vsegs ); 225 } 226 ///////////////////////////////////////////////////////////////////////////// 227 mapping_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 + 225 235 MAPPING_VSEG_SIZE*header->vsegs); 226 236 } 227 237 238 -
soft/giet_vm/sys/common.h
r158 r160 24 24 extern _ld_symbol_t seg_fb_base; 25 25 extern _ld_symbol_t seg_ioc_base; 26 extern _ld_symbol_t seg_ boot_mapping_base;26 extern _ld_symbol_t seg_mapping_base; 27 27 extern _ld_symbol_t seg_kernel_pt_base; 28 28 … … 49 49 mapping_vspace_t* _get_vspace_base( mapping_header_t* header ); 50 50 mapping_vseg_t* _get_vseg_base( mapping_header_t* header ); 51 mapping_vobj_t* _get_vobj_base( mapping_header_t* header ); 51 52 mapping_task_t* _get_task_base( mapping_header_t* header ); 52 53 -
soft/giet_vm/sys/ctx_handler.c
r158 r160 31 31 32 32 #include <giet_config.h> 33 #include <ctx_handler.h>34 #include <sys_handler.h>35 33 #include <drivers.h> 36 34 #include <common.h> 35 #include <ctx_handler.h> 36 #include <mapping_info.h> 37 #include <sys_handler.h> 37 38 38 39 extern void _task_switch(unsigned int *, unsigned int *); … … 71 72 // return if only one task */ 72 73 if ( tasks <= 1) return; 73 74 74 75 // compute the task context base address for the current task 75 76 curr_task_id = _scheduler[proc_id].current; 76 77 curr_context = &(_scheduler[proc_id].context[curr_task_id][0]); 77 78 78 79 // select the next task using a round-robin scheduling policy 79 80 next_task_id = (curr_task_id + 1) % tasks; -
soft/giet_vm/sys/drivers.c
r158 r160 5 5 // Copyright (c) UPMC-LIP6 6 6 /////////////////////////////////////////////////////////////////////////////////// 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. 8 8 // They contains the drivers for the peripherals available in the SoCLib library: 9 9 // - vci_multi_tty … … 204 204 205 205 proc_id = _procid(); 206 206 207 task_id = _scheduler[proc_id].current; 207 208 tty_id = _scheduler[proc_id].context[task_id][CTX_TTY_ID]; -
soft/giet_vm/sys/irq_handler.c
r158 r160 45 45 int interrupt_index; 46 46 _isr_func_t isr; 47 48 // interrupt vector initialisation 49 47 50 48 51 /* retrieves the highest priority active interrupt index */ -
soft/giet_vm/sys/sys.ld
r158 r160 2 2 * Definition of the base address for all virtual segments 3 3 *****************************************************************************/ 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 */11 4 12 5 /* The vsegs used by the system are replicated in all virtual spaces … … 16 9 seg_kernel_data_base = 0x80010000; /* system cacheable data */ 17 10 seg_kernel_uncdata_base = 0x80020000; /* system uncacheable data */ 18 seg_kernel_ pt_base= 0x80030000; /* system page table */11 seg_kernel_init_base = 0x80030000; /* system page table */ 19 12 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 \ 21 15 must be defined, even if the peripherals are not used in the architecture */ 22 16 … … 29 23 seg_icu_base = 0x9F000000; /* ICU device */ 30 24 25 /*****************************************/ 26 seg_mapping_base = 0xBFC0C000; /* boot mapping_info */ 27 31 28 /* 32 29 * Grouping sections into segments for system code and data … … 35 32 SECTIONS 36 33 { 37 . = seg_boot_code_base;38 seg_boot_code :39 {40 *(.boot)41 }42 34 . = seg_kernel_code_base; 43 35 seg_kernel_code : … … 69 61 *(.unckdata) 70 62 } 71 . = seg_kernel_pt_base; 72 seg_kernel_pt : 63 64 . = seg_kernel_init_base; 65 seg_kernel_init : 73 66 { 74 *(.ptab) 67 *(.kinitentry) 68 *(.kinit) 75 69 } 76 70 } -
soft/giet_vm/sys/sys_handler.c
r158 r160 12 12 13 13 #include <sys_handler.h> 14 #include <boot_handler.h>14 //#include <boot_handler.h> 15 15 #include <drivers.h> 16 16 #include <ctx_handler.h> … … 49 49 &_sys_ukn, /* 0x18 */ 50 50 &_sys_ukn, /* 0x19 */ 51 &_ mwmr_base,/* 0x1A */51 &_vobj_get_vbase, /* 0x1A */ 52 52 &_sys_ukn, /* 0x1B */ 53 53 &_sys_ukn, /* 0x1C */ … … 117 117 unsigned int* buffer) 118 118 { 119 mapping_header_t* header = (mapping_header_t*)&seg_ boot_mapping_base;119 mapping_header_t* header = (mapping_header_t*)&seg_mapping_base; 120 120 mapping_cluster_t* cluster = _get_cluster_base( header ); 121 121 … … 131 131 } 132 132 ///////////////////////////////////////////////////////////////////////////// 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. 136 137 ///////////////////////////////////////////////////////////////////////////// 137 unsigned int _mwmr_base( char* vspace_name, 138 char* channel_name, 139 unsigned int* buffer ) 138 unsigned int _vobj_get_vbase( char* vspace_name, char* vobj_name, 139 unsigned vobj_type, unsigned int* vobj_buffer) 140 140 { 141 mapping_header_t* header = (mapping_header_t*)&seg_ boot_mapping_base;141 mapping_header_t* header = (mapping_header_t*)&seg_mapping_base; 142 142 mapping_vspace_t* vspace = _get_vspace_base( header ); 143 mapping_v seg_t* vseg = _get_vseg_base( header );143 mapping_vobj_t* vobj = _get_vobj_base( header ); 144 144 145 145 unsigned int vspace_id; 146 unsigned int vseg_id; 146 unsigned int vobj_id; 147 147 148 148 149 // scan vspaces … … 151 152 if ( _strncmp( vspace[vspace_id].name, vspace_name, 31) == 0 ) 152 153 { 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++) 157 156 { 158 if ( _strncmp( vseg[vseg_id].name, channel_name, 31) == 0 ) 157 158 if ( _strncmp( vobj[vobj_id].name, vobj_name, 31) == 0 ) 159 159 { 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; 161 164 return 0; 162 165 } … … 165 168 } 166 169 // not found !!! 167 return 1;170 return -2; 168 171 } 169 172 -
soft/giet_vm/sys/sys_handler.h
r158 r160 30 30 unsigned int* buffer ); 31 31 32 unsigned int _mwmr_base( char* vspace_name, 33 char* channel_name, 34 unsigned int* buffer); 35 32 unsigned int _vobj_get_vbase( char* vspace_name, char* vobj_name, 33 unsigned vobj_type, unsigned int* vobj_buffer); 36 34 #endif
Note: See TracChangeset
for help on using the changeset viewer.