Changeset 162 for soft/giet_vm/boot


Ignore:
Timestamp:
Jun 20, 2012, 5:11:11 PM (12 years ago)
Author:
karaoui
Message:

Cleaning unused files
Simplifying Makefile
adding missing include

Location:
soft/giet_vm/boot
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/boot/boot_handler.c

    r160 r162  
    5252#include <boot_handler.h>
    5353#include <mapping_info.h>
    54 #include <hwr_mapping.h>
    5554#include <mwmr.h>
    5655
     
    8079                         { [0 ... GIET_NB_VSPACE_MAX-1] = 0 };
    8180
    82 // Page table pointer 
     81// Page table pointers
    8382page_table_t* _ptabs[GIET_NB_VSPACE_MAX];
    8483
     
    149148    }
    150149    boot_tty_puts(buf);
    151 }
    152 
    153 unsigned int _tty_puts(const char *buffer, unsigned int length)
    154 {
    155     unsigned int* tty_address = (unsigned int*)&seg_tty_base;
    156     unsigned int n;
    157 
    158     for ( n=0; n<length; n++)
    159     {
    160         if (buffer[n] == 0) break;
    161         tty_address[0] = (unsigned int)buffer[n];
    162     }
    163    
    164     return n;
    165 }
    166 
    167 ////////////////////////////////////////////////////////////////////////////////////
    168 // tty_printf()
    169 // This function is a simplified version of the mutek_printf() function.
    170 // The terminal index must be defined in the calling task context.
    171 // It doesn't use the IRQ_PUT interrupt, and the associated kernel buffer.
    172 // Only a limited number of formats are supported:
    173 //   - %d : signed decimal
    174 //   - %u : unsigned decimal
    175 //   - %x : hexadecimal
    176 //   - %c : char
    177 //   - %s : string
    178 // - Returns 0 if success, > 0 if error.
    179 ////////////////////////////////////////////////////////////////////////////////////
    180 unsigned int _tty_printf(char *format, ...)
    181 {
    182     va_list ap;
    183     va_start(ap, format);
    184     unsigned int ret;
    185 
    186 printf_text:
    187 
    188     while (*format) {
    189         unsigned int i;
    190         for (i = 0; format[i] && format[i] != '%'; i++)
    191             ;
    192         if (i) {
    193             ret = _tty_puts(format,i);
    194             if (ret != i)
    195                 return 1; /* return error */
    196             format += i;
    197         }
    198         if (*format == '%') {
    199             format++;
    200             goto printf_arguments;
    201         }
    202     }
    203 
    204     va_end(ap);
    205     return 0;
    206 
    207 printf_arguments:
    208 
    209     {
    210         int         val = va_arg(ap, long);
    211         char            buf[20];
    212         char*           pbuf;
    213         unsigned int        len = 0;
    214         static const char   HexaTab[] = "0123456789ABCDEF";
    215         unsigned int        i;
    216 
    217         switch (*format++) {
    218             case ('c'):             /* char conversion */
    219                 len = 1;
    220                 buf[0] = val;
    221                 pbuf = buf;
    222                 break;
    223             case ('d'):             /* decimal signed integer */
    224                 if (val < 0) {
    225                     val = -val;
    226                     ret = _tty_puts("-",1);
    227                     if (ret != 1)
    228                         return 1; /* return error */
    229                 }
    230             case ('u'):             /* decimal unsigned integer */
    231                 for( i=0 ; i<10 ; i++) {
    232                     buf[9-i] = HexaTab[val % 10];
    233                     if (!(val /= 10)) break;
    234                 }
    235                 len =  i+1;
    236                 pbuf = &buf[9-i];
    237                 break;
    238             case ('x'):             /* hexadecimal integer */
    239                 ret = _tty_puts("0x",2);
    240                 if (ret != 2)
    241                     return 1; /* return error */
    242                 for( i=0 ; i<8 ; i++) {
    243                     buf[7-i] = HexaTab[val % 16U];
    244                     if (!(val /= 16U)) break;
    245                 }
    246                 len =  i+1;
    247                 pbuf = &buf[7-i];
    248                 break;
    249             case ('s'):             /* string */
    250                 {
    251                     char *str = (char*)val;
    252                     while ( str[len] ) len++;
    253                     pbuf = (char*)val;
    254                 }
    255                 break;
    256             default:
    257                 goto printf_text;
    258         }
    259 
    260         ret = _tty_puts(pbuf, len);
    261         if (ret != len)
    262             return 1;
    263         goto printf_text;
    264     }
    265150}
    266151
     
    718603///////////////////////////////////////////////////////////////////////////
    719604// Initialise vobjs
     605// For now only one type is initialised the: PTAB
     606//
    720607// param:
    721 // vobj: the vobj to initialise
    722 // region_id: the vspace in wich the vobj is located or the global space(-1).
     608//  vobj: the vobj to initialise
     609//  region_id: the vspace in wich the vobj is located or the global space(-1).
    723610///////////////////////////////////////////////////////////////////////////
    724 void initialise_ptabs(mapping_vobj_t* vobj, unsigned int region_id)
     611void initailise_vobj(mapping_vobj_t* vobj, unsigned int region_id)
    725612{
    726613    if(vobj->type == PTAB)
     
    804691    // + to computes the length of the current vseg
    805692    // + Align vobjs
    806     // + Initialise the ptabs if the vobj correspond
     693    // + Initialise the vobj
    807694    cur_vaddr = vseg->vbase;
    808695    cur_paddr = vseg->pbase;
     
    821708        cur_vaddr += vobj[vobj_id].length;
    822709        cur_paddr += vobj[vobj_id].length;
    823         initialise_ptabs(&vobj[vobj_id], region_id);
     710        initailise_vobj(&vobj[vobj_id], region_id);
    824711    }
    825712   
  • soft/giet_vm/boot/reset.S

    r160 r162  
    119119        jal     boot_init
    120120    nop
    121     j app_start
     121    j to_kinit
    122122    nop
    123123
     
    130130    nop
    131131       
    132 app_start:
     132to_kinit:
    133133    /* All processors initialize PTPR / MODE */
    134134    /* and jump to kernel_init code.                                     */
Note: See TracChangeset for help on using the changeset viewer.