Changeset b9cb6cdf in rtems


Ignore:
Timestamp:
Sep 12, 2008, 9:47:01 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
cdeed304
Parents:
3ab13d5
Message:

2008-09-12 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, configure.ac, startup/bspstart.c: Now support bsp_get_work_area() and used shared implementation of it and bsp_pretasking_hook. Ticker runs.
  • startup/bspgetworkarea.c: New file.
Location:
c/src/lib/libbsp/arm/gba
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/gba/ChangeLog

    r3ab13d5 rb9cb6cdf  
     12008-09-12      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * Makefile.am, configure.ac, startup/bspstart.c: Now support
     4        bsp_get_work_area() and used shared implementation of it and
     5        bsp_pretasking_hook. Ticker runs.
     6        * startup/bspgetworkarea.c: New file.
     7
    182008-09-10      Joel Sherrill <joel.sherrill@oarcorp.com>
    29
  • c/src/lib/libbsp/arm/gba/Makefile.am

    r3ab13d5 rb9cb6cdf  
    3939
    4040startup_SOURCES = ../../shared/bsplibc.c ../../shared/bsppost.c \
     41    startup/bspgetworkarea.c ../../shared/bsppretaskinghook.c \
    4142    ../../shared/bsppredriverhook.c startup/bspclean.c \
    4243    ../../shared/bootcard.c ../../shared/sbrk.c \
  • c/src/lib/libbsp/arm/gba/configure.ac

    r3ab13d5 rb9cb6cdf  
    1919AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
    2020
     21RTEMS_BSP_BOOTCARD_HANDLES_RAM_ALLOCATION
     22
    2123# Explicitly list all Makefiles here
    2224AC_CONFIG_FILES([Makefile])
  • c/src/lib/libbsp/arm/gba/startup/bspstart.c

    r3ab13d5 rb9cb6cdf  
    2727#include <conio.h>
    2828
    29 #define BSP_DEBUG  0
    30 
    31 /* Global Variables, Defined in 'linkcmds' */
    32 extern  void _end;
    33 extern  void _stack_size;
    34 extern  void _irq_max_vector;
    35 extern  void __heap_limit;
    36 extern  void __ro_start;
    37 extern  void __ro_end;
    38 extern  void __data_start;
    39 extern  void __data_end;
    40 extern  void __load_start_data;
    41 extern  void __load_stop_data;
    42 extern  void __ewram_start;
    43 extern  void __ewram_end;
    44 extern  void __load_start_ewram;
    45 extern  void __load_stop_ewram;
    46 extern  void __iwram_start;
    47 extern  void __iwram_end;
    48 extern  void __load_start_iwram;
    49 extern  void __load_stop_iwram;
    50 extern  void __bss_start;
    51 extern  void __bss_end;
    52 
    5329/* External Prototypes */
    5430extern void rtems_irq_mngt_init(void);
    55 extern void bsp_libc_init( void *, uint32_t, int );
    5631
    5732/** Chip registers */
    5833volatile unsigned int *Regs = (unsigned int *)GBA_IO_REGS_ADDR;
    59 
    60 /**
    61  *  Size of heap if it is 0 it will be dynamically defined by memory size,
    62  *  otherwise the value should be changed by binary patch
    63  */
    64 uint32_t   _heap_size = 0;
    65 
    66 /** Address of start of free memory - should be updated after creating new partitions or regions.*/
    67 uint32_t   rtemsFreeMemStart;
    68 
    69 /**
    70  *  @brief BSP pretasking hook.
    71  *
    72  *  Called just before drivers are initialized.
    73  *  Used to setup libc and install any BSP extensions.
    74  *
    75  *  NOTE: Must not use libc (to do io) from here, since drivers are not yet initialized.
    76  *
    77  *  @param  None
    78  *  @return None
    79  */
    80 void bsp_pretasking_hook(void)
    81 {
    82 
    83   if (_heap_size == 0) {
    84      _heap_size = (uint32_t)&__heap_limit - rtemsFreeMemStart;
    85   }
    86 
    87   bsp_libc_init((void *)rtemsFreeMemStart, _heap_size, 0);
    88 
    89   rtemsFreeMemStart += _heap_size;
    90 
    91 #if BSP_DEBUG
    92   /*  The following information is very useful when debugging. */
    93   printk("[bsp_pretasking_hook]\n");
    94   printk("_heap_size  = 0x%x\n", _heap_size);
    95   printk("_stack_size = 0x%x\n", (uint32_t)&_stack_size);
    96   printk("_irq_max_vector = 0x%x\n", (uint32_t)&_irq_max_vector);
    97   printk("__ro_start      = 0x%x : __ro_end     = 0x%x\n", (uint32_t)&__ro_start, (uint32_t)&__ro_end);
    98   printk("__ewram_start   = 0x%x : __ewram_end  = 0x%x\n", (uint32_t)&__ewram_start, (uint32_t)&__ewram_end);
    99   printk("__data_start    = 0x%x : __data_end   = 0x%x\n", (uint32_t)&__data_start, (uint32_t)&__data_end);
    100   printk("__bss_start     = 0x%x : __bss_end    = 0x%x\n", (uint32_t)&__bss_start,(uint32_t)&__bss_end);
    101   printk("__iwram_start   = 0x%x : __iwram_end  = 0x%x\n", (uint32_t)&__iwram_start,(uint32_t)&__iwram_end);
    102   printk("__load_start_iwram = 0x%x\n", (uint32_t)&__load_start_iwram);
    103   printk("__load_stop_iwram  = 0x%x\n", (uint32_t)&__load_stop_iwram);
    104   printk("__load_start_ewram = 0x%x\n", (uint32_t)&__load_start_ewram);
    105   printk("__load_stop_ewram  = 0x%x\n", (uint32_t)&__load_stop_ewram);
    106   printk("__load_start_data  = 0x%x\n", (uint32_t)&__load_start_data);
    107   printk("__load_stop_data   = 0x%x\n", (uint32_t)&__load_stop_data);
    108 #endif
    109 }
    110 
    11134
    11235/**
     
    12043void bsp_start_default( void )
    12144{
    122   /* set the value of start of free memory. */
    123   rtemsFreeMemStart = (uint32_t)&_end;
    124 
    125   /* Place RTEMS workspace at beginning of free memory. */
    126   Configuration.work_space_start = (void *)rtemsFreeMemStart;
    127   rtemsFreeMemStart += rtems_configuration_get_work_space_size();
    128 
    12945  /* Init conio  */
    13046  gba_textmode(CO60);
    13147
    132   /* Init rtems exceptions management  */
    133   /*!!!!!GBA - Can't use exception vectors in GBA because they are already in GBA ROM BIOS */
     48  /* Init rtems exceptions management
     49   *  !!!!!GBA -- Can't use exception vectors in GBA because they are
     50   *  already in GBA ROM BIOS
     51   */
    13452  /* rtems_exception_init_mngt(); */
    13553
    13654  /* Init rtems interrupt management */
    13755  rtems_irq_mngt_init();
    138 
    139 #if BSP_DEBUG
    140   /* The following information is very useful when debugging. */
    141   printk("[bsp_start]\n");
    142   printk("rtemsFreeMemStart= 0x%x\n", rtemsFreeMemStart);
    143   printk("__heap_limit     = 0x%x\n", (uint32_t)&__heap_limit);
    144   printk("work_space_start = 0x%x size = 0x%x\n",
    145           Configuration.work_space_start,
    146           rtems_configuration_get_work_space_size());
    147   printk("microseconds_per_tick = 0x%x\n",
    148           rtems_configuration_get_microseconds_per_tick());
    149   printk("ticks_per_timeslice   = 0x%x\n",
    150           rtems_configuration_get_ticks_per_timeslice());
    151 #endif
    152 
    153   /* Do we have enough memory */
    154   if ((uint32_t)&__heap_limit < rtemsFreeMemStart) {
    155      printk("\nFatal Error: Memory overflow[0x%x]!\n",rtemsFreeMemStart);
    156      bsp_cleanup();
    157   }
    158 
    15956}
    160 
    16157
    16258/**
Note: See TracChangeset for help on using the changeset viewer.