Changeset 48816d7 in rtems


Ignore:
Timestamp:
Nov 2, 2007, 1:35:02 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, 5, master
Children:
137c410
Parents:
7cb1d6ea
Message:

2007-11-02 Joel Sherrill <joel.sherrill@…>

  • score/cpu/sparc/cpu.c, score/cpu/sparc/rtems/score/cpu.h, score/include/rtems/score/context.h, score/src/threadhandler.c: Fix stack so gdb backtrace does not print corrupted frame message after _Thread_Handler. Daniel Hellstrom <daniel@…> provided the SPARC implementation and I made it more general.
Location:
cpukit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r7cb1d6ea r48816d7  
     12007-11-02      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * score/cpu/sparc/cpu.c, score/cpu/sparc/rtems/score/cpu.h,
     4        score/include/rtems/score/context.h, score/src/threadhandler.c: Fix
     5        stack so gdb backtrace does not print corrupted frame message after
     6        _Thread_Handler. Daniel Hellstrom <daniel@gaisler.com> provided the
     7        SPARC implementation and I made it more general.
     8
    192007-10-26      Glenn Humphrey <glenn.humphrey@OARcorp.com>
    210
  • cpukit/score/cpu/sparc/cpu.c

    r7cb1d6ea r48816d7  
    22 *  SPARC Dependent Source
    33 *
    4  *  COPYRIGHT (c) 1989-1999.
     4 *  COPYRIGHT (c) 1989-2007.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
     
    302302    the_context->o7    = ((uint32_t  ) entry_point) - 8;
    303303    the_context->o6_sp = stack_high - CPU_MINIMUM_STACK_FRAME_SIZE;
    304     the_context->i6_fp = stack_high;
     304    the_context->i6_fp = 0;
    305305
    306306    /*
  • cpukit/score/cpu/sparc/rtems/score/cpu.h

    r7cb1d6ea r48816d7  
    792792
    793793/*
     794 *  This macro is invoked from _Thread_Handler to do whatever CPU
     795 *  specific magic is required that must be done in the context of
     796 *  the thread when it starts.
     797 *
     798 *  On the SPARC, this is setting the frame pointer so GDB is happy.
     799 *  Make GDB stop unwinding at _Thread_Handler, previous register window
     800 *  Frame pointer is 0 and calling address must be a function with starting
     801 *  with a SAVE instruction. If return address is leaf-function (no SAVE)
     802 *  GDB will not look at prev reg window fp.
     803 *
     804 *  _Thread_Handler is known to start with SAVE.
     805 */
     806
     807#define _CPU_Context_Initialization_at_thread_begin() \
     808  do { \
     809    asm volatile ("set _Thread_Handler,%%i7\n"::); \
     810  } while (0)
     811
     812/*
    794813 *  This routine is responsible for somehow restarting the currently
    795814 *  executing task. 
  • cpukit/score/include/rtems/score/context.h

    r7cb1d6ea r48816d7  
    6868#define _Context_Initialize(_the_context, _stack, _size, _isr, _entry, _is_fp) \
    6969   _CPU_Context_Initialize( _the_context, _stack, _size, _isr, _entry, _is_fp )
     70
     71/**
     72 *  This macro is invoked from _Thread_Handler to do whatever CPU
     73 *  specific magic is required that must be done in the context of
     74 *  the thread when it starts.
     75 *
     76 *  If the CPU architecture does not require any magic, then this
     77 *  macro is empty.
     78 */
     79
     80#if defined(_CPU_Context_Initialization_at_thread_begin)
     81  #define _Context_Initialization_at_thread_begin() \
     82     _CPU_Context_Initialization_at_thread_begin()
     83#else
     84  #define _Context_Initialization_at_thread_begin()
     85#endif
    7086
    7187/**
  • cpukit/score/src/threadhandler.c

    r7cb1d6ea r48816d7  
    7575
    7676  executing = _Thread_Executing;
     77
     78  /*
     79   * Some CPUs need to tinker with the call frame or registers when the
     80   * thread actually begins to execute for the first time.  This is a
     81   * hook point where the port gets a shot at doing whatever it requires.
     82   */
     83  _Context_Initialization_at_thread_begin();
    7784
    7885  /*
Note: See TracChangeset for help on using the changeset viewer.