Changeset 2700423 in rtems


Ignore:
Timestamp:
Nov 13, 2000, 10:29:14 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
3eec211
Parents:
7f5213d
Message:

2000-11-13 Jiri Gaisler <jgais@…>

  • Makefile.am, configure.in, gnatsupp/Makefile.am, gnatsupp/gnatsupp.c, include/Makefile.am, include/bsp.h, start/Makefile.am, startup/Makefile.am, startup/setvec.c, wrapup/Makefile.am:
  • erc32sonic: New directory.
  • erc32sonic/Makefile.am, erc32sonic/erc32sonic.c, erc32sonic/.cvsignore: New files.
  • include/erc32.h: New file.
  • startup/boardinit.S: New file. Big update of SPARC support for ERC32 and LEON. Added support for ERC32 without floating point. Added SONIC support as configured on Tharsys ERC32 board. The bsp's share various code in the shared directory:

gnat-support, start-up code, etc.

To decrease the foot-print, I removed the 16 kbyte start-up
stack that was put in .bss and never reused once the system
was up. The stack is now put between the heap and the
workspace. To reclaim it, the user can do a rtems_region_extend
to merge the stack to the heap region once the system is up.

Location:
c/src/lib/libbsp/sparc/erc32
Files:
5 added
3 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/erc32/ChangeLog

    r7f5213d r2700423  
     12000-11-13      Jiri Gaisler <jgais@ws.estec.esa.nl>
     2
     3        * Makefile.am, configure.in, gnatsupp/Makefile.am,
     4        gnatsupp/gnatsupp.c, include/Makefile.am, include/bsp.h,
     5        start/Makefile.am, startup/Makefile.am, startup/setvec.c,
     6        wrapup/Makefile.am:
     7        * erc32sonic: New directory.
     8        * erc32sonic/Makefile.am, erc32sonic/erc32sonic.c,
     9        erc32sonic/.cvsignore: New files.
     10        * include/erc32.h: New file.
     11        * startup/boardinit.S: New file.
     12        Big update of SPARC support for ERC32 and LEON.
     13        Added support for ERC32 without floating point.
     14        Added SONIC support as configured on Tharsys ERC32 board.
     15        The bsp's share various code in the shared directory:
     16           gnat-support, start-up code, etc.
     17        To decrease the foot-print, I removed the 16 kbyte start-up
     18        stack that was put in .bss and never reused once the system
     19        was up. The stack is now put between the heap and the
     20        workspace. To reclaim it, the user can do a rtems_region_extend
     21        to merge the stack to the heap region once the system is up.
     22
    1232000-11-09      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    224
  • c/src/lib/libbsp/sparc/erc32/Makefile.am

    r7f5213d r2700423  
    88# wrapup is the one that actually builds and installs the library
    99#  from the individual .rel files built in other directories
    10 SUBDIRS = . start include startup gnatsupp console clock timer wrapup tools
     10SUBDIRS = . include start startup gnatsupp console clock timer \
     11    erc32sonic wrapup tools
    1112
    1213include $(top_srcdir)/../../bsp.am
  • c/src/lib/libbsp/sparc/erc32/configure.in

    r7f5213d r2700423  
    1818RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP)
    1919RTEMS_CHECK_BSP_CACHE(RTEMS_BSP)
     20RTEMS_CHECK_NETWORKING
    2021RTEMS_CANONICAL_HOST
     22
     23AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes")
    2124
    2225RTEMS_CONFIG_BUILD_SUBDIRS(tools)
     
    2932clock/Makefile
    3033console/Makefile
     34erc32sonic/Makefile
    3135gnatsupp/Makefile
    3236include/Makefile
  • c/src/lib/libbsp/sparc/erc32/gnatsupp/Makefile.am

    r7f5213d r2700423  
    55AUTOMAKE_OPTIONS = foreign 1.4
    66
    7 VPATH = @srcdir@:@srcdir@/../../../shared
     7VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
    88
    99PGM = $(ARCH)/gnatsupp.rel
    1010
    11 C_FILES = gnatsupp.c
     11C_FILES = gnatsupp.c gnatcommon.c
    1212C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
    1313
     
    2929.PRECIOUS: $(PGM)
    3030
    31 EXTRA_DIST = gnatsupp.c
     31EXTRA_DIST = gnatsupp.c gnatcommon.c
    3232
    3333include $(top_srcdir)/../../../../../../automake/local.am
  • c/src/lib/libbsp/sparc/erc32/gnatsupp/gnatsupp.c

    r7f5213d r2700423  
    66 */
    77
    8 #include <bsp.h>
    9 #include <signal.h>
    10 
    11 /*
    12  * Synchronous trap handler. Map the trap number of SIGFPE, SIGSEGV
    13  * or SIGILL to generate the corresponding Ada exception.
    14  */
    15 
    16 rtems_isr __gnat_exception_handler
    17   (rtems_vector_number trap)
    18 {
    19   rtems_unsigned32 real_trap;
    20   rtems_unsigned32 signal;
    21 
    22   real_trap = SPARC_REAL_TRAP_NUMBER (trap);
    23   switch (real_trap)
    24     {
    25     case 0x08:                  /* FPU exception */
    26     case 0x0A:                  /* TAG overflow */
    27     case 0x82:                  /* divide by zero */
    28       signal = SIGFPE;          /* Will cause Constraint_Error */
    29       break;
    30     case 0x01:                  /* Instruction access exception */
    31     case 0x09:                  /* Data access exception */
    32       signal = SIGSEGV;         /* Will cause Storage_Error */
    33       break;
    34     default:                    /* Anything else ... */
    35       signal = SIGILL;          /* Will cause Program_Error */
    36       break;
    37     }
    38   kill (getpid (), signal);
    39 }
    40 
    41 /*
    42  * Asynchronous trap handler. As it happens, the interrupt trap numbers for
    43  * SPARC is 17 - 31, so we just map then directly on the same signal number.
    44  */
    45 
    46 rtems_isr __gnat_interrupt_handler
    47   (rtems_vector_number trap)
    48 {
    49   rtems_unsigned32 real_trap;
    50 
    51   real_trap = SPARC_REAL_TRAP_NUMBER (trap);
    52 
    53   kill (getpid (), real_trap);
    54 
    55 }
    56 
    57 /*
    58  * Default signal handler with error reporting
    59  */
    60 
    61 void
    62 __gnat_signals_Abormal_termination_handler (int signo)
    63 {
    64   switch (signo)
    65     {
    66     case SIGFPE:
    67       DEBUG_puts ("\nConstraint_Error\n");
    68       break;
    69     case SIGSEGV:
    70       DEBUG_puts ("\nStorage_Error\n");
    71       break;
    72     default:
    73       DEBUG_puts ("\nProgram_Error\n");
    74       break;
    75     }
    76   exit (1);
    77 }
    78 
    79 const struct sigaction __gnat_error_vector =
    80 {0, -1,
    81  {__gnat_signals_Abormal_termination_handler}};
    82 
    838void
    849__gnat_install_handler ()
    8510{
    86   rtems_unsigned32 trap;
    87   rtems_isr_entry previous_isr;
    88 
    89   sigaction (SIGSEGV, &__gnat_error_vector, NULL);
    90   sigaction (SIGFPE, &__gnat_error_vector, NULL);
    91   sigaction (SIGILL, &__gnat_error_vector, NULL);
    92 
    93   for (trap = 0; trap < 256; trap++)
    94     {
    95 
    96       /*
    97          *  Skip window overflow, underflow, and flush as well as software
    98          *  trap 0 which we will use as a shutdown. Also avoid trap 0x70 - 0x7f
    99          *  which cannot happen and where some of the space is used to pass
    100          *  paramaters to the program. Trap 0x1d is used by the clock tick,
    101          *  0x80 for system traps and 0x81 - 0x83 by the remote debugging stub.
    102          *  Avoid 0x15 (UART B interrupt) which is also used by the stub
    103          *  to generate a 'break-in' interrupt.
    104        */
    105 
    106       if ((trap >= 0x11) && (trap <= 0x1f))
    107         {
    108           if ((trap != 0x1d) && (trap != 0x15))
    109             rtems_interrupt_catch (__gnat_interrupt_handler, trap, &previous_isr);
    110         }
    111       else if ((trap != 5 && trap != 6) && ((trap < 0x70) || (trap > 0x83)))
    112         set_vector (__gnat_exception_handler, SPARC_SYNCHRONOUS_TRAP (trap), 1);
    113     }
     11  __gnat_install_handler_common (0x1d, 0x15);
    11412}
  • c/src/lib/libbsp/sparc/erc32/include/Makefile.am

    r7f5213d r2700423  
    55AUTOMAKE_OPTIONS = foreign 1.4
    66
    7 H_FILES = bsp.h coverhd.h
     7H_FILES = bsp.h coverhd.h erc32.h
    88
    99$(PROJECT_INCLUDE):
  • c/src/lib/libbsp/sparc/erc32/include/bsp.h

    r7f5213d r2700423  
    4242#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 2
    4343#define CONFIGURE_INTERRUPT_STACK_MEMORY  (16 * 1024)
     44
     45/*
     46 * Network driver configuration
     47 */
     48
     49struct rtems_bsdnet_ifconfig;
     50extern int rtems_erc32_sonic_driver_attach (struct rtems_bsdnet_ifconfig *config);
     51#define RTEMS_BSP_NETWORK_DRIVER_NAME   "sonic1"
     52#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_erc32_sonic_driver_attach
    4453
    4554/*
  • c/src/lib/libbsp/sparc/erc32/start/Makefile.am

    r7f5213d r2700423  
    44
    55AUTOMAKE_OPTIONS = foreign 1.4
     6
     7VPATH = @srcdir@:@srcdir@/../../shared
    68
    79PGM = $(ARCH)/start.o
  • c/src/lib/libbsp/sparc/erc32/startup/Makefile.am

    r7f5213d r2700423  
    55AUTOMAKE_OPTIONS = foreign 1.4
    66
    7 VPATH = @srcdir@:@srcdir@/../../../shared
     7VPATH = @srcdir@:@srcdir@/../../shared:@srcdir@/../../../shared
    88
    99PGM = $(ARCH)/startup.rel
     
    1313C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
    1414
    15 OBJS = $(C_O_FILES)
     15S_FILES = boardinit.S
     16S_O_FILES = $(S_FILES:%.S=$(ARCH)/%.o)
     17
     18OBJS = $(C_O_FILES) $(S_O_FILES)
    1619
    1720include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
     
    3841.PRECIOUS: $(PGM)
    3942
    40 EXTRA_DIST = bspclean.c bspstart.c linkcmds setvec.c spurious.c
     43EXTRA_DIST = linkcmds setvec.c spurious.c boardinit.S
    4144
    4245include $(top_srcdir)/../../../../../../automake/local.am
  • c/src/lib/libbsp/sparc/erc32/startup/setvec.c

    r7f5213d r2700423  
    6161}
    6262
     63/* ERC32 power-down function */
     64
     65void _CPU_Thread_Idle_body( void )
     66{
     67  while (1) {
     68    ERC32_MEC.Power_Down = 0;   /* value is irrelevant */
     69  }
     70}
     71
  • c/src/lib/libbsp/sparc/erc32/wrapup/Makefile.am

    r7f5213d r2700423  
    55AUTOMAKE_OPTIONS = foreign 1.4
    66
    7 BSP_PIECES = startup console clock timer gnatsupp
     7# We only build the networking device driver if HAS_NETWORKING was defined
     8if HAS_NETWORKING
     9NETWORKING_DRIVER = erc32sonic
     10endif
     11
     12BSP_PIECES = startup console clock timer gnatsupp $(NETWORKING_DRIVER)
    813# pieces to pick up out of libcpu/sparc
    914CPU_PIECES = reg_win syscall
Note: See TracChangeset for help on using the changeset viewer.