Changeset bf5742a in rtems


Ignore:
Timestamp:
Dec 10, 2007, 7:06:53 AM (12 years ago)
Author:
Till Straumann <strauman@…>
Branches:
4.10, 4.11, 4.9, master
Children:
c28004f
Parents:
9b4c770
Message:

2007-12-09 Till Straumann <strauman@…>

  • new-exceptions/bspsupport/ppc_exc_test.c, new-exceptions/bspsupport/vectors_init.c, new-exceptions/bspsupport/ppc_exc_bspsupp.h, new-exceptions/bspsupport/README, new-exceptions/bspsupport/irq_supp.h: Added README and some comments; now use TRAP exception in ppc_exc_test.c so that it works on PSIM.
Location:
c/src/lib/libcpu/powerpc
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/powerpc/ChangeLog

    r9b4c770 rbf5742a  
     12007-12-09      Till Straumann <strauman@slac.stanford.edu>
     2
     3        * new-exceptions/bspsupport/ppc_exc_test.c,
     4        new-exceptions/bspsupport/vectors_init.c,
     5        new-exceptions/bspsupport/ppc_exc_bspsupp.h,
     6        new-exceptions/bspsupport/README,
     7        new-exceptions/bspsupport/irq_supp.h:
     8        Added README and some comments; now use TRAP exception
     9        in ppc_exc_test.c so that it works on PSIM.
     10
    1112007-12-08      Till Straumann <strauman@slac.stanford.edu>
    212
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/irq_supp.h

    r9b4c770 rbf5742a  
    4949/*
    5050 * Initialize the PIC.
    51  * Return nonzero on success, zero on failure (which will be treated
    52  * as fatal by the manager).
    5351 */
    5452extern int  BSP_setup_the_pic(rtems_irq_global_settings* config);
     
    7472 * shared handlers for a given interrupt
    7573 * and restores original irq level
     74 *
     75 * Note that _ISR_Get_level() & friends are preferable to
     76 * manipulating MSR directly.
    7677 */
    7778
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_bspsupp.h

    r9b4c770 rbf5742a  
    2121
    2222/* API to be used by middleware,                    */
    23 /* BSP and application code (if necessary           */
     23/* BSP and application code (if necessary)          */
    2424
    2525/****************************************************/
     
    7272/********* Low-level Exception Handlers *************/
    7373
    74 /* This API is used by middleware code              */
     74/* This part of the API is used by middleware code  */
    7575
    7676/****************************************************/
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/ppc_exc_test.c

    r9b4c770 rbf5742a  
    8585                "       stw      0, %5(%0)   ;"
    8686                "       lwz  0, %6(%0)   ;"
    87                 "       sc               ;"
     87                "       trap             ;"
    8888                "       stmw 0, %6(%1)   ;"
    8989                "       mfcr    0                ;"
     
    130130                "       stw 13, %6(2) ;"
    131131                "   lmw 3,  %5(2)  ;"
    132                 "   sc             ;"
     132                "   trap           ;"
    133133                "   stmw 0, %4(2) ;"
    134134                "       mfcr    0          ;"
     
    155155
    156156/* exception handler; adds 1 to all register contents (except r1,r2,r13) */
    157 void
     157int
    158158handle_clobber_exc(BSP_Exception_frame *f, int vector)
    159159{
     
    173173  f->EXC_XER++;
    174174  f->EXC_LR++;
     175  f->EXC_SRR0 += 4;
     176  return 0;
    175177}
    176178
     
    181183 *    (except: r1, r2, r13, non-sticky bits in xer)
    182184 *    R2 is clobbered with the address of the pre area.
    183  *  - issue 'sc' -> SYS exception
     185 *  - issue 'trap' -> PROG exception
    184186 *  - exception handler increments all reg. contents by 1,
    185187 *    stores address of 'pst' area in R2 and returns control
     
    198200                a[i].u = 0xaffe0000 + i;
    199201        }
    200         ppc_exc_set_handler(ASM_SYS_VECTOR, handle_clobber_exc);
     202        ppc_exc_set_handler(ASM_PROG_VECTOR, handle_clobber_exc);
    201203        clobber();
    202         ppc_exc_set_handler(ASM_SYS_VECTOR, 0);
     204        ppc_exc_set_handler(ASM_PROG_VECTOR, 0);
    203205        for ( i=0; i< sizeof(pre)/sizeof(uint32_t); i++ ) {
    204206                switch (i) {
  • c/src/lib/libcpu/powerpc/new-exceptions/bspsupport/vectors_init.c

    r9b4c770 rbf5742a  
    8989        }
    9090        printk("LR: 0x%08x\n",lr);
    91         {
    92                 uint32_t *x = (uint32_t*)sp;
    93                 uint32_t top;
    94                 asm volatile("mfspr %0, %1":"=r"(top):"i"(SPRG1));
    95                 printk("TOS: 0x%08x\n",top);
    96                 while ( x < (uint32_t*)sp->frameLink ) {
    97                         printk("   0x%08x\n",*x++);
    98                 }
    99         }
    10091        for (f=(LRFrame)sp, i=0; f->frameLink && i<STACK_CLAMP; f=f->frameLink) {
    10192                printk("--^ 0x%08x", (long)(f->frameLink->lr));
Note: See TracChangeset for help on using the changeset viewer.