Changeset 88d594a in rtems


Ignore:
Timestamp:
May 24, 1995, 9:39:42 PM (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
5b9d6ddf
Parents:
bf61e45c
Message:

Fully tested on all in-house targets

Files:
93 edited

Legend:

Unmodified
Added
Removed
  • c/UPDATE_HELP

    rbf61e45c r88d594a  
    33#
    44
    5 In the directory "update_tools", there are a set of tools to aid in
    6 making the application source changes necessary to address some
    7 of the changes in the RTEMS API between release 3.1.0 and 3.2.0.
     5Between RTEMS 3.1.0 and 3.2.0, every RTEMS defined symbol made visible
     6was renamed.  This document describes the change and the tools provided
     7to assist you in updating your RTEMS 3.1.0 application. 
    88
    9 The primary change addressed by these tools is the addition of
    10 "rtems_" or "RTEMS_" as a prefix on EVERY user visible RTEMS
    11 provided constant and routine.  The primary factor in the decision
    12 to make such a sweeping change was conflicts between the
    13 the RTEMS and POSIX API's.
     9[NOTE:  This change was not included in snapshots prior to 3.1.15.]
     10
     11DESCRIPTION OF NAME CHANGES:
     12============================
     13
     14The primary change was the addition of the prefix "rtems_" or "RTEMS_" to
     15EVERY user visible RTEMS provided constant and routine.  The primary
     16factor in the decision to make such a sweeping change was conflicts
     17between the the RTEMS and POSIX API's. 
     18
     19
     20TO UPDATE YOUR APPLICATION:
     21===========================
     22
     23The update script requires that Perl be installed on your computer.
     24It has only been tested with Perl 5.x.
     25
     26After RTEMS has been built, in the directory "$r/<BSP>/update_tools", will
     27be a set of tools to aid in making the application source changes necessary
     28to address (hopefully) all of the name changes in the RTEMS API between
     29releases 3.1.0 and 3.2.0.
     30
     31The update shell script is the only executable which is invoked by the
     32user directly.  The word-replace Perl script is invoked by the update
     33shell script.
    1434
    1535WARNING: These tools modify the files IN PLACE!!! Backup your
    16   source before using these tools.
     36         source before using these tools.
    1737
     38To udpate your application, change directories to the top of your application
     39source tree and execute the update script.  It should be something similar
     40to the following:
     41
     42cd MY_APP
     43$r/<BSP>/update-tools/update
     44
     45The update script will ask if you have backed up your source code before
     46beginning the update process.  While operating on files, it will print
     47the name of each file and a dot for each change made to the source file. 
     48
     49NOTE: These scripts do not attempt to address changes in calling
     50      sequences.  After the script has run, you will need to update
     51      calls to rtems_clock_get(), rtems_timer_fire_after(), and
     52      rtems_timer_fire_when() by hand.
  • c/src/exec/libcsupport/src/__brk.c

    rbf61e45c r88d594a  
     1#if !defined(RTEMS_UNIX)
     2
    13/*
    24 *  RTEMS "Broken" __brk/__sbrk Implementation
     
    1315 *  notice must appear in all copies of this file and its derivatives.
    1416 *
    15  *  $Id$
     17 *  __brk.c,v 1.2 1995/05/09 20:24:28 joel Exp
    1618 */
    1719
     
    3941  return -1;
    4042}
     43
     44#endif
  • c/src/exec/libcsupport/src/__gettod.c

    rbf61e45c r88d594a  
    1212 *  notice must appear in all copies of this file and its derivatives.
    1313 *
    14  *  $Id$
     14 *  __gettod.c,v 1.2 1995/05/09 20:24:31 joel Exp
    1515 */
    1616
     
    2020#include <sys/reent.h>
    2121#endif
     22
    2223#include <time.h>
    2324#include <sys/time.h>
     25
    2426#include <errno.h>
    2527#include <assert.h>
     
    3032
    3133int gettimeofday(
    32    struct timeval  *tp,
    33    struct timezone *tzp
     34  struct timeval  *tp,
     35  struct timezone *tzp
    3436)
    3537{
     
    3739  rtems_clock_time_value time;
    3840
    39   if ( !tp || !tzp ) {
     41  if ( !tp ) {
    4042    errno = EFAULT;
    4143    return -1;
     
    5254  tp->tv_usec = time.microseconds;
    5355
    54 #if 0
    55   tzp->minuteswest = timezone / 60; /* from seconds to minutes */
    56   tzp->dsttime = daylight;
    57 #endif
    58 
    5956  /*
    6057   * newlib does not have timezone and daylight savings time
     
    6259   */
    6360
    64   tzp->tz_minuteswest = 0;  /* at UTC */
    65   tzp->tz_dsttime = 0;      /* no daylight savings */
     61  if ( tzp ) {
     62    tzp->tz_minuteswest = 0;  /* at UTC */
     63    tzp->tz_dsttime = 0;      /* no daylight savings */
     64#if 0
     65  tzp->minuteswest = timezone / 60; /* from seconds to minutes */
     66  tzp->dsttime = daylight;
     67#endif
     68  }
    6669  return 0;
    6770}
    6871
     72#if defined(RTEMS_NEWLIB)
     73
     74#if 0
    6975/*
    70  *  "Reentrant" versions of the above routines implemented above.
     76 *  "Reentrant" version
    7177 */
    7278
    73 #if 0
    7479int _gettimeofday_r(
    75    struct _reent   *ignored_reentrancy_stuff,
    76    struct timeval  *tp,
    77    struct timezone *tzp
     80  struct _reent   *ignored_reentrancy_stuff,
     81  struct timeval  *tp,
     82  struct timezone *tzp
    7883)
    7984{
     
    8287#endif
    8388
     89/*
     90 *  "System call" version
     91 */
     92
     93int _gettimeofday(
     94  struct timeval  *tp,
     95  struct timezone *tzp
     96)
     97{
     98  return gettimeofday( tp, tzp );
     99}
     100
     101#endif /* defined(RTEMS_NEWLIB) */
     102
    84103#endif
  • c/src/exec/libcsupport/src/newlibc.c

    rbf61e45c r88d594a  
    11/*
    2  *      @(#)newlibc.c   1.8 - 95/04/25
     2 *      @(#)newlibc.c   1.9 - 95/05/16
    33 *     
    44 */
     
    77
    88/*
    9  *  File:       $RCSfile$
     9 *  File:       newlibc.c,v
    1010 *  Project:    PixelFlow
    1111 *  Created:    94/12/7
    12  *  Revision:   $Revision$
    13  *  Last Mod:   $Date$
     12 *  Revision:   1.2
     13 *  Last Mod:   1995/05/09 20:24:37
    1414 *
    1515 *  COPYRIGHT (c) 1994 by Division Incorporated
     
    3636 *  NOTE:
    3737 *
    38  *  $Id$
     38 *  newlibc.c,v 1.2 1995/05/09 20:24:37 joel Exp
    3939 *
    4040 */
  • c/src/exec/rtems/src/rtemstimer.c

    rbf61e45c r88d594a  
    147147      return( RTEMS_INTERNAL_ERROR );
    148148    case OBJECTS_LOCAL:
    149       if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) {
     149      if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
    150150        (void) _Watchdog_Remove( &the_timer->Ticker );
    151         _Thread_Enable_dispatch();
    152         return( RTEMS_SUCCESSFUL );
    153       }
    154       _Thread_Enable_dispatch();
    155       return( RTEMS_INCORRECT_STATE );
     151      _Thread_Enable_dispatch();
     152      return( RTEMS_SUCCESSFUL );
    156153  }
    157154
  • c/src/exec/rtems/src/timer.c

    rbf61e45c r88d594a  
    147147      return( RTEMS_INTERNAL_ERROR );
    148148    case OBJECTS_LOCAL:
    149       if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) {
     149      if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
    150150        (void) _Watchdog_Remove( &the_timer->Ticker );
    151         _Thread_Enable_dispatch();
    152         return( RTEMS_SUCCESSFUL );
    153       }
    154       _Thread_Enable_dispatch();
    155       return( RTEMS_INCORRECT_STATE );
     151      _Thread_Enable_dispatch();
     152      return( RTEMS_SUCCESSFUL );
    156153  }
    157154
  • c/src/exec/sapi/headers/io.h

    rbf61e45c r88d594a  
    188188
    189189rtems_status_code _IO_Handler_routine(
    190   IO_operations     operation,
    191   rtems_device_major_number  major,
    192   rtems_device_minor_number  minor,
    193   void             *argument,
    194   unsigned32       *return_value
     190  IO_operations              operation,
     191  rtems_device_major_number  major,
     192  rtems_device_minor_number  minor,
     193  void                      *argument,
     194  unsigned32                *return_value
    195195);
    196196
  • c/src/exec/sapi/headers/sptables.h

    rbf61e45c r88d594a  
    4343
    4444const char _RTEMS_version[] =
    45   "RTEMS RELEASE V3.1.15 (" CPU_NAME "/" RTEMS_MODEL_NAME ")";
     45  "RTEMS RELEASE V3.1.16 (" CPU_NAME "/" RTEMS_MODEL_NAME ")";
    4646
    4747
  • c/src/exec/sapi/include/rtems/io.h

    rbf61e45c r88d594a  
    188188
    189189rtems_status_code _IO_Handler_routine(
    190   IO_operations     operation,
    191   rtems_device_major_number  major,
    192   rtems_device_minor_number  minor,
    193   void             *argument,
    194   unsigned32       *return_value
     190  IO_operations              operation,
     191  rtems_device_major_number  major,
     192  rtems_device_minor_number  minor,
     193  void                      *argument,
     194  unsigned32                *return_value
    195195);
    196196
  • c/src/exec/sapi/include/rtems/sptables.h

    rbf61e45c r88d594a  
    4343
    4444const char _RTEMS_version[] =
    45   "RTEMS RELEASE V3.1.15 (" CPU_NAME "/" RTEMS_MODEL_NAME ")";
     45  "RTEMS RELEASE V3.1.16 (" CPU_NAME "/" RTEMS_MODEL_NAME ")";
    4646
    4747
  • c/src/exec/sapi/src/exinit.c

    rbf61e45c r88d594a  
    108108  _CPU_Initialize( cpu_table, _Thread_Dispatch );
    109109
     110  /*
     111   *  Do this as early as possible to insure no debugging output
     112   *  is even attempted to be printed.
     113   */
     114
     115  _Debug_Manager_initialization();
     116
    110117  multiprocessing_table = configuration_table->User_multiprocessing_table;
    111118  if ( multiprocessing_table == NULL )
  • c/src/exec/sapi/src/io.c

    rbf61e45c r88d594a  
    257257
    258258rtems_status_code _IO_Handler_routine(
    259   IO_operations     operation,
    260   rtems_device_major_number  major,
    261   rtems_device_minor_number  minor,
    262   void             *argument,
    263   unsigned32       *return_value
     259  IO_operations              operation,
     260  rtems_device_major_number  major,
     261  rtems_device_minor_number  minor,
     262  void                      *argument,
     263  unsigned32                *return_value
    264264)
    265265{
  • c/src/exec/score/cpu/hppa1.1/cpu.c

    rbf61e45c r88d594a  
    1515 *      suitability of this software for any purpose.
    1616 *
    17  *  $Id$
     17 *  cpu.c,v 1.2 1995/05/09 20:11:35 joel Exp
    1818 */
    1919
  • c/src/exec/score/cpu/hppa1.1/cpu.h

    rbf61e45c r88d594a  
    2121 *      This file is included by both C and assembler code ( -DASM )
    2222 *
    23  *  $Id$
     23 *  cpu.h,v 1.2 1995/05/09 20:11:36 joel Exp
    2424 */
    2525
     
    3131#endif
    3232
    33 #include <hppa.h>                   /* pick up machine definitions */
     33#include <rtems/hppa.h>              /* pick up machine definitions */
     34#ifndef ASM
     35#include <rtems/hppatypes.h>
     36#endif
    3437
    3538/* conditional compilation parameters */
  • c/src/exec/score/cpu/hppa1.1/cpu_asm.h

    rbf61e45c r88d594a  
    2020 *      Utah $Hdr: asm.h 1.6 91/12/03$
    2121 *
    22  *  RTEMS: $Id$
     22 *  RTEMS: cpu_asm.h,v 1.2 1995/05/09 20:11:39 joel Exp
    2323 */
    2424
  • c/src/exec/score/cpu/hppa1.1/cpu_asm.s

    rbf61e45c r88d594a  
    1 #       @(#)cpu_asm.S   1.5 - 95/04/24
     1#       @(#)cpu_asm.S   1.6 - 95/05/16
    22#       
    33#
     
    2525#      suitability of this software for any purpose.
    2626#
    27 $Id$
     27cpu_asm.S,v 1.2 1995/05/09 20:11:37 joel Exp
    2828#
    2929
  • c/src/exec/score/cpu/hppa1.1/hppa.h

    rbf61e45c r88d594a  
    11/*
    2  *      @(#)hppa.h      1.5 - 95/04/25
     2 *      @(#)hppa.h      1.7 - 95/05/16
    33 *     
    4  *
    5  *  File:       $RCSfile$
    6  *  Project:    PixelFlow
    7  *  Created:    94/10/4
    8  *  RespEngr:   tony bennett
    9  *  Revision:   $Revision$
    10  *  Last Mod:   $Date$
    114 *
    125 *  Description:
     
    3225 *      This file is included by both C and assembler code ( -DASM )
    3326 *
    34  *  $Id$
     27 *  hppa.h,v 1.2 1995/05/09 20:11:40 joel Exp
    3528 */
    3629
     
    4942 */
    5043 
     44#ifdef hppa1_1
     45#undef hppa1_1
     46#endif
    5147#define hppa1_1
     48
     49#ifdef REPLACE_THIS_WITH_THE_CPU_MODEL
     50#undef REPLACE_THIS_WITH_THE_CPU_MODEL
     51#endif
    5252#define REPLACE_THIS_WITH_THE_CPU_MODEL
     53
     54#ifdef REPLACE_THIS_WITH_THE_BSP
     55#undef REPLACE_THIS_WITH_THE_BSP
     56#endif
    5357#define REPLACE_THIS_WITH_THE_BSP
    5458
     
    8084
    8185#define CPU_NAME "HP PA-RISC 1.1"
    82 
    83 #ifndef ASM
    84 /*
    85  *  This section defines the basic types for this processor.
    86  */
    87 
    88 typedef unsigned char      unsigned8;  /* 8-bit  unsigned integer */
    89 typedef unsigned short     unsigned16; /* 16-bit unsigned integer */
    90 typedef unsigned int       unsigned32; /* 32-bit unsigned integer */
    91 typedef unsigned long long unsigned64; /* 64-bit unsigned integer */
    92 
    93 typedef unsigned16 Priority_Bit_map_control;
    94 
    95 typedef char      signed8;      /* 8-bit  signed integer */
    96 typedef short     signed16;     /* 16-bit signed integer */
    97 typedef int       signed32;     /* 32-bit signed integer */
    98 typedef long long signed64;     /* 64 bit signed integer */
    99 
    100 typedef unsigned32 boolean;     /* Boolean value   */
    101 
    102 typedef float     single_precision;     /* single precision float */
    103 typedef double    double_precision;     /* double precision float */
    104 
    105 #endif  /* !ASM */
    10686
    10787
     
    231211
    232212/*
     213 * Cache characteristics
     214 */
     215 
     216#define HPPA_CACHELINE_SIZE     32
     217#define HPPA_CACHELINE_MASK     (HPPA_CACHELINE_SIZE - 1)
     218
     219
     220/*
    233221 * Inline macros for misc. interesting opcodes
    234222 */
     
    521509
    522510/* Hardware Space Registers */
    523 #define SR0     0
    524 #define SR1     1
    525 #define SR2     2
    526 #define SR3     3
    527 #define SR4     4
    528 #define SR5     5
    529 #define SR6     6
    530 #define SR7     7
     511#define HPPA_SR0     0
     512#define HPPA_SR1     1
     513#define HPPA_SR2     2
     514#define HPPA_SR3     3
     515#define HPPA_SR4     4
     516#define HPPA_SR5     5
     517#define HPPA_SR6     6
     518#define HPPA_SR7     7
    531519
    532520/* Hardware Control Registers */
    533 #define CR0     0
    534 #define RCTR    0               /* Recovery Counter Register */
    535 
    536 #define CR8     8               /* Protection ID 1 */
    537 #define PIDR1   8
    538 
    539 #define CR9     9               /* Protection ID 2 */
    540 #define PIDR2   9
    541 
    542 #define CR10    10
    543 #define CCR     10              /* Coprocessor Confiquration Register */
    544 
    545 #define CR11    11
    546 #define SAR     11              /* Shift Amount Register */
    547 
    548 #define CR12    12
    549 #define PIDR3   12              /* Protection ID 3 */
    550 
    551 #define CR13    13
    552 #define PIDR4   13              /* Protection ID 4 */
    553 
    554 #define CR14    14
    555 #define IVA     14              /* Interrupt Vector Address */
    556 
    557 #define CR15    15
    558 #define EIEM    15              /* External Interrupt Enable Mask */
    559 
    560 #define CR16    16
    561 #define ITMR    16              /* Interval Timer */
    562 
    563 #define CR17    17
    564 #define PCSQ    17              /* Program Counter Space queue */
    565 
    566 #define CR18    18
    567 #define PCOQ    18              /* Program Counter Offset queue */
    568 
    569 #define CR19    19
    570 #define IIR     19              /* Interruption Instruction Register */
    571 
    572 #define CR20    20
    573 #define ISR     20              /* Interruption Space Register */
    574 
    575 #define CR21    21
    576 #define IOR     21              /* Interruption Offset Register */
    577 
    578 #define CR22    22
    579 #define IPSW    22              /* Interrpution Processor Status Word */
    580 
    581 #define CR23    23
    582 #define EIRR    23              /* External Interrupt Request */
    583 
    584 #define CR24    24
    585 #define PPDA    24              /* Physcial Page Directory Address */
    586 #define TR0     24              /* Temporary register 0 */
    587 
    588 #define CR25    25
    589 #define HTA     25              /* Hash Table Address */
    590 #define TR1     25              /* Temporary register 1 */
    591 
    592 #define CR26    26
    593 #define TR2     26              /* Temporary register 2 */
    594 
    595 #define CR27    27
    596 #define TR3     27              /* Temporary register 3 */
    597 
    598 #define CR28    28
    599 #define TR4     28              /* Temporary register 4 */
    600 
    601 #define CR29    29
    602 #define TR5     29              /* Temporary register 5 */
    603 
    604 #define CR30    30
    605 #define TR6     30              /* Temporary register 6 */
    606 
    607 #define CR31    31
    608 #define CPUID   31              /* MP identifier */
     521#define HPPA_CR0     0
     522#define HPPA_RCTR    0               /* Recovery Counter Register */
     523
     524#define HPPA_CR8     8               /* Protection ID 1 */
     525#define HPPA_PIDR1   8
     526
     527#define HPPA_CR9     9               /* Protection ID 2 */
     528#define HPPA_PIDR2   9
     529
     530#define HPPA_CR10    10
     531#define HPPA_CCR     10              /* Coprocessor Confiquration Register */
     532
     533#define HPPA_CR11    11
     534#define HPPA_SAR     11              /* Shift Amount Register */
     535
     536#define HPPA_CR12    12
     537#define HPPA_PIDR3   12              /* Protection ID 3 */
     538
     539#define HPPA_CR13    13
     540#define HPPA_PIDR4   13              /* Protection ID 4 */
     541
     542#define HPPA_CR14    14
     543#define HPPA_IVA     14              /* Interrupt Vector Address */
     544
     545#define HPPA_CR15    15
     546#define HPPA_EIEM    15              /* External Interrupt Enable Mask */
     547
     548#define HPPA_CR16    16
     549#define HPPA_ITMR    16              /* Interval Timer */
     550
     551#define HPPA_CR17    17
     552#define HPPA_PCSQ    17              /* Program Counter Space queue */
     553
     554#define HPPA_CR18    18
     555#define HPPA_PCOQ    18              /* Program Counter Offset queue */
     556
     557#define HPPA_CR19    19
     558#define HPPA_IIR     19              /* Interruption Instruction Register */
     559
     560#define HPPA_CR20    20
     561#define HPPA_ISR     20              /* Interruption Space Register */
     562
     563#define HPPA_CR21    21
     564#define HPPA_IOR     21              /* Interruption Offset Register */
     565
     566#define HPPA_CR22    22
     567#define HPPA_IPSW    22              /* Interrpution Processor Status Word */
     568
     569#define HPPA_CR23    23
     570#define HPPA_EIRR    23              /* External Interrupt Request */
     571
     572#define HPPA_CR24    24
     573#define HPPA_PPDA    24              /* Physcial Page Directory Address */
     574#define HPPA_TR0     24              /* Temporary register 0 */
     575
     576#define HPPA_CR25    25
     577#define HPPA_HTA     25              /* Hash Table Address */
     578#define HPPA_TR1     25              /* Temporary register 1 */
     579
     580#define HPPA_CR26    26
     581#define HPPA_TR2     26              /* Temporary register 2 */
     582
     583#define HPPA_CR27    27
     584#define HPPA_TR3     27              /* Temporary register 3 */
     585
     586#define HPPA_CR28    28
     587#define HPPA_TR4     28              /* Temporary register 4 */
     588
     589#define HPPA_CR29    29
     590#define HPPA_TR5     29              /* Temporary register 5 */
     591
     592#define HPPA_CR30    30
     593#define HPPA_TR6     30              /* Temporary register 6 */
     594
     595#define HPPA_CR31    31
     596#define HPPA_CPUID   31              /* MP identifier */
    609597
    610598/*
     
    612600 */
    613601
    614 #define DR0      0
    615 #define DR1      1
    616 #define DR8      8
    617 #define DR24    24
    618 #define DR25    25
     602#define HPPA_DR0      0
     603#define HPPA_DR1      1
     604#define HPPA_DR8      8
     605#define HPPA_DR24    24
     606#define HPPA_DR25    25
    619607
    620608/*
     
    654642    EMIT_SET_CONTROL(name, reg)
    655643
    656 EMIT_CONTROLS(recovery, RCTR);          /* CR0  */
    657 EMIT_CONTROLS(pid1, PIDR1);             /* CR8  */
    658 EMIT_CONTROLS(pid2, PIDR2);             /* CR9  */
    659 EMIT_CONTROLS(ccr, CCR);                /* CR10; CCR and SCR share CR10 */
    660 EMIT_CONTROLS(scr, CCR);                /* CR10; CCR and SCR share CR10 */
    661 EMIT_CONTROLS(sar, SAR);                /* CR11 */
    662 EMIT_CONTROLS(pid3, PIDR3);             /* CR12 */
    663 EMIT_CONTROLS(pid4, PIDR4);             /* CR13 */
    664 EMIT_CONTROLS(iva, IVA);                /* CR14 */
    665 EMIT_CONTROLS(eiem, EIEM);              /* CR15 */
    666 EMIT_CONTROLS(itimer, ITMR);            /* CR16 */
    667 EMIT_CONTROLS(pcsq, PCSQ);              /* CR17 */
    668 EMIT_CONTROLS(pcoq, PCOQ);              /* CR18 */
    669 EMIT_CONTROLS(iir, IIR);                /* CR19 */
    670 EMIT_CONTROLS(isr, ISR);                /* CR20 */
    671 EMIT_CONTROLS(ior, IOR);                /* CR21 */
    672 EMIT_CONTROLS(ipsw, IPSW);              /* CR22 */
    673 EMIT_CONTROLS(eirr, EIRR);              /* CR23 */
    674 EMIT_CONTROLS(tr0, TR0);                /* CR24 */
    675 EMIT_CONTROLS(tr1, TR1);                /* CR25 */
    676 EMIT_CONTROLS(tr2, TR2);                /* CR26 */
    677 EMIT_CONTROLS(tr3, TR3);                /* CR27 */
    678 EMIT_CONTROLS(tr4, TR4);                /* CR28 */
    679 EMIT_CONTROLS(tr5, TR5);                /* CR29 */
    680 EMIT_CONTROLS(tr6, TR6);                /* CR30 */
    681 EMIT_CONTROLS(tr7, CR31);               /* CR31 */
     644EMIT_CONTROLS(recovery, HPPA_RCTR);          /* CR0  */
     645EMIT_CONTROLS(pid1, HPPA_PIDR1);             /* CR8  */
     646EMIT_CONTROLS(pid2, HPPA_PIDR2);             /* CR9  */
     647EMIT_CONTROLS(ccr, HPPA_CCR);                /* CR10; CCR and SCR share CR10 */
     648EMIT_CONTROLS(scr, HPPA_CCR);                /* CR10; CCR and SCR share CR10 */
     649EMIT_CONTROLS(sar, HPPA_SAR);                /* CR11 */
     650EMIT_CONTROLS(pid3, HPPA_PIDR3);             /* CR12 */
     651EMIT_CONTROLS(pid4, HPPA_PIDR4);             /* CR13 */
     652EMIT_CONTROLS(iva, HPPA_IVA);                /* CR14 */
     653EMIT_CONTROLS(eiem, HPPA_EIEM);              /* CR15 */
     654EMIT_CONTROLS(itimer, HPPA_ITMR);            /* CR16 */
     655EMIT_CONTROLS(pcsq, HPPA_PCSQ);              /* CR17 */
     656EMIT_CONTROLS(pcoq, HPPA_PCOQ);              /* CR18 */
     657EMIT_CONTROLS(iir, HPPA_IIR);                /* CR19 */
     658EMIT_CONTROLS(isr, HPPA_ISR);                /* CR20 */
     659EMIT_CONTROLS(ior, HPPA_IOR);                /* CR21 */
     660EMIT_CONTROLS(ipsw, HPPA_IPSW);              /* CR22 */
     661EMIT_CONTROLS(eirr, HPPA_EIRR);              /* CR23 */
     662EMIT_CONTROLS(tr0, HPPA_TR0);                /* CR24 */
     663EMIT_CONTROLS(tr1, HPPA_TR1);                /* CR25 */
     664EMIT_CONTROLS(tr2, HPPA_TR2);                /* CR26 */
     665EMIT_CONTROLS(tr3, HPPA_TR3);                /* CR27 */
     666EMIT_CONTROLS(tr4, HPPA_TR4);                /* CR28 */
     667EMIT_CONTROLS(tr5, HPPA_TR5);                /* CR29 */
     668EMIT_CONTROLS(tr6, HPPA_TR6);                /* CR30 */
     669EMIT_CONTROLS(tr7, HPPA_CR31);               /* CR31 */
    682670
    683671/*
  • c/src/exec/score/cpu/hppa1.1/rtems.s

    rbf61e45c r88d594a  
    1212 *  notice must appear in all copies of this file and its derivatives.
    1313 *
    14  *  $Id$
     14 *  rtems.S,v 1.2 1995/05/09 20:11:41 joel Exp
    1515 */
    1616
    17 #include <hppa.h>
     17#include <rtems/hppa.h>
    1818#include <rtems/cpu_asm.h>
    1919
  • c/src/exec/score/cpu/i386/asm.h

    rbf61e45c r88d594a  
    3232
    3333#define ASM
    34 #include <i386.h>
     34#include <rtems/i386.h>
    3535
    3636/*
  • c/src/exec/score/cpu/i386/cpu.h

    rbf61e45c r88d594a  
    2222#endif
    2323
    24 #include <i386.h>
     24#ifndef ASM
     25#include <rtems/i386types.h>
     26#endif
     27#include <rtems/i386.h>
    2528
    2629/* conditional compilation parameters */
  • c/src/exec/score/cpu/i386/i386.h

    rbf61e45c r88d594a  
    2929 */
    3030
     31#ifdef i386
     32#undef i386
     33#endif
    3134#define i386
     35
     36#ifdef REPLACE_THIS_WITH_THE_CPU_MODEL
     37#undef REPLACE_THIS_WITH_THE_CPU_MODEL
     38#endif
    3239#define REPLACE_THIS_WITH_THE_CPU_MODEL
     40
     41#ifdef REPLACE_THIS_WITH_THE_BSP
     42#undef REPLACE_THIS_WITH_THE_BSP
     43#endif
    3344#define REPLACE_THIS_WITH_THE_BSP
    3445
     
    93104
    94105/*
    95  *  This section defines the basic types for this processor.
    96  */
    97 
    98 typedef unsigned char      unsigned8;     /* 8-bit  unsigned integer */
    99 typedef unsigned short     unsigned16;    /* 16-bit unsigned integer */
    100 typedef unsigned int       unsigned32;    /* 32-bit unsigned integer */
    101 typedef unsigned long long unsigned64;    /* 64-bit unsigned integer */
    102 
    103 typedef unsigned16         Priority_Bit_map_control;
    104 
    105 typedef unsigned char      signed8;     /* 8-bit  signed integer */
    106 typedef unsigned short     signed16;    /* 16-bit signed integer */
    107 typedef unsigned int       signed32;    /* 32-bit signed integer */
    108 typedef long long          signed64;    /* 64-bit signed integer */
    109 
    110 typedef unsigned32 boolean;     /* Boolean value   */
    111 
    112 typedef float              single_precision;     /* single precision float */
    113 typedef double             double_precision;     /* double precision float */
    114 
    115 /*
    116106 *  Structure which makes it easier to deal with LxDT and SxDT instructions.
    117107 */
    118 
     108 
    119109typedef struct {
    120110  unsigned short limit;
    121111  unsigned short physical_address[ 2 ];
    122112} i386_DTR_load_save_format;
    123 
     113 
    124114/* See Chapter 5 - Memory Management in i386 manual */
    125 
     115 
    126116typedef struct {
    127117  unsigned short limit_0_15;
     
    132122  unsigned char  base_24_31;
    133123}   i386_GDT_slot;
    134 
     124 
    135125/* See Chapter 9 - Exceptions and Interrupts in i386 manual
    136126 *
    137127 *  NOTE: This is the IDT entry for interrupt gates ONLY.
    138128 */
    139 
     129 
    140130typedef struct {
    141131  unsigned short offset_0_15;
     
    146136}   i386_IDT_slot;
    147137
    148 typedef void ( *i386_isr )( void );
     138/*
     139 *  Interrupt Level Macros
     140 */
    149141
    150142#define i386_disable_interrupts( _level ) \
     
    187179                "rorl  $16,%0;"
    188180                "rorw  $8,%%ax" : "=a" (value) : "0" (value) );
    189 
    190181  return( value );
    191182}
  • c/src/exec/score/cpu/i960/asm.h

    rbf61e45c r88d594a  
    3232
    3333#define ASM
    34 #include <i960.h>
     34#include <rtems/i960.h>
    3535
    3636/*
  • c/src/exec/score/cpu/i960/cpu.h

    rbf61e45c r88d594a  
    2424#pragma align 4            /* for GNU C structure alignment */
    2525
    26 #include <i960.h>
     26#include <rtems/i960.h>
     27#ifndef ASM
     28#include <rtems/i960types.h>
     29#endif
    2730
    2831#define CPU_INLINE_ENABLE_DISPATCH       FALSE
  • c/src/exec/score/cpu/i960/i960.h

    rbf61e45c r88d594a  
    2929 */
    3030 
     31#ifdef i960
     32#undef i960
     33#endif
    3134#define i960
     35
     36#ifdef REPLACE_THIS_WITH_THE_CPU_MODEL
     37#undef REPLACE_THIS_WITH_THE_CPU_MODEL
     38#endif
    3239#define REPLACE_THIS_WITH_THE_CPU_MODEL
     40
     41#ifdef REPLACE_THIS_WITH_THE_BSP
     42#undef REPLACE_THIS_WITH_THE_BSP
     43#endif
    3344#define REPLACE_THIS_WITH_THE_BSP
    3445
     
    6475
    6576/*
    66  *  This section defines the basic types for this processor.
    67  */
    68 
    69 typedef unsigned char      unsigned8;  /* 8-bit  unsigned integer */
    70 typedef unsigned short     unsigned16; /* 16-bit unsigned integer */
    71 typedef unsigned int       unsigned32; /* 32-bit unsigned integer */
    72 typedef unsigned long long unsigned64; /* 64-bit unsigned integer */
    73 
    74 typedef unsigned32         Priority_Bit_map_control;
    75 
    76 typedef char               signed8;      /* 8-bit signed integer  */
    77 typedef short              signed16;     /* 16-bit signed integer */
    78 typedef int                signed32;     /* 32-bit signed integer */
    79 typedef long long          signed64;     /* 64-bit signed integer */
    80 
    81 typedef unsigned32 boolean;     /* Boolean value   */
    82 
    83 typedef float              single_precision; /* single precision float */
    84 typedef double             double_precision; /* double precision float */
    85 
    86 /*
    8777 * XXX    should have an ifdef here and have stuff for the other
    8878 * XXX    family members...
    8979 */
    90 
     80 
    9181#if defined(__i960CA__) || defined(__i960_CA__) || defined(__i960CA)
    92 
     82 
    9383/* i960CA control structures */
    94 
     84 
    9585/* Intel i960CA Control Table */
    96 
     86 
    9787typedef struct {
    9888                            /* Control Group 0 */
     
    132122  unsigned int reserved;          /* reserved */
    133123}   i960ca_control_table;
    134 
     124 
    135125/* Intel i960CA Processor Control Block */
    136 
     126 
    137127typedef struct {
    138128  unsigned int    *fault_tbl;     /* fault table base address */
     
    150140  unsigned int     reg_cache_cfg; /* register cache configuration word */
    151141}   i960ca_PRCB;
    152 
    153 #endif
    154 
    155 typedef void ( *i960_isr )( void );
     142 
     143#endif
     144
     145/*
     146 *  Interrupt Level Routines
     147 */
    156148
    157149#define i960_disable_interrupts( oldlevel ) \
     
    192184
    193185#define i960_enable_tracing() \
    194  { register unsigned32 _pc = 0x1; \
     186 { register unsigned int _pc = 0x1; \
    195187   asm volatile( "modpc 0,%0,%0" : "=d" (_pc) : "0" (_pc) ); \
    196188 }
    197189
    198190#define i960_unmask_intr( xint ) \
    199  { register unsigned32 _mask= (1<<(xint)); \
     191 { register unsigned int _mask= (1<<(xint)); \
    200192   asm volatile( "or sf1,%0,sf1" : "=d" (_mask) : "0" (_mask) ); \
    201193 }
    202194
    203195#define i960_mask_intr( xint ) \
    204  { register unsigned32 _mask= (1<<(xint)); \
     196 { register unsigned int _mask= (1<<(xint)); \
    205197   asm volatile( "andnot %0,sf1,sf1" : "=d" (_mask) : "0" (_mask) ); \
    206198 }
    207199
    208200#define i960_clear_intr( xint ) \
    209  { register unsigned32 _xint=(xint); \
     201 { register unsigned int _xint=(xint); \
    210202   asm volatile( "loop_til_cleared:
    211203                    clrbit %0,sf0,sf0 ; \
     
    226218#define i960_soft_reset( prcb ) \
    227219 { register i960ca_PRCB *_prcb = (prcb); \
    228    register unsigned32         *_next=0; \
    229    register unsigned32          _cmd  = 0x30000; \
     220   register unsigned int         *_next=0; \
     221   register unsigned int          _cmd  = 0x30000; \
    230222   asm volatile( "lda    next,%1; \
    231223                  sysctl %0,%1,%2; \
     
    235227 }
    236228
    237 static inline unsigned32 i960_pend_intrs()
    238 { register unsigned32 _intr=0;
     229static inline unsigned int i960_pend_intrs()
     230{ register unsigned int _intr=0;
    239231  asm volatile( "mov sf0,%0" : "=d" (_intr) : "0" (_intr) );
    240232  return ( _intr );
    241233}
    242234
    243 static inline unsigned32 i960_mask_intrs()
    244 { register unsigned32 _intr=0;
     235static inline unsigned int i960_mask_intrs()
     236{ register unsigned int _intr=0;
    245237  asm volatile( "mov sf1,%0" : "=d" (_intr) : "0" (_intr) );
    246238  return( _intr );
    247239}
    248240
    249 static inline unsigned32 i960_get_fp()
    250 { register unsigned32 _fp=0;
     241static inline unsigned int i960_get_fp()
     242{ register unsigned int _fp=0;
    251243  asm volatile( "mov fp,%0" : "=d" (_fp) : "0" (_fp) );
    252244  return ( _fp );
  • c/src/exec/score/cpu/m68k/asm.h

    rbf61e45c r88d594a  
    3232
    3333#define ASM
    34 #include <m68k.h>
     34#include <rtems/m68k.h>
    3535
    3636/*
  • c/src/exec/score/cpu/m68k/cpu.h

    rbf61e45c r88d594a  
    3131#define NO_UNINITIALIZED_WARNINGS
    3232
    33 #include <m68k.h>
     33#include <rtems/m68k.h>
     34#ifndef ASM
     35#include <rtems/m68ktypes.h>
     36#endif
    3437
    3538/* conditional compilation parameters */
  • c/src/exec/score/cpu/m68k/m68k.h

    rbf61e45c r88d594a  
    2929 */
    3030 
     31#ifdef m68k
     32#undef m68k
     33#endif
    3134#define m68k
     35
     36#ifdef REPLACE_THIS_WITH_THE_CPU_MODEL
     37#undef REPLACE_THIS_WITH_THE_CPU_MODEL
     38#endif
    3239#define REPLACE_THIS_WITH_THE_CPU_MODEL
     40
     41#ifdef REPLACE_THIS_WITH_THE_BSP
     42#undef REPLACE_THIS_WITH_THE_BSP
     43#endif
    3344#define REPLACE_THIS_WITH_THE_BSP
    3445
     
    152163#ifndef ASM
    153164
    154 /*
    155  *  This section defines the basic types for this processor.
    156  */
    157 
    158 typedef unsigned char  unsigned8;      /* unsigned 8-bit  integer */
    159 typedef unsigned short unsigned16;     /* unsigned 16-bit integer */
    160 typedef unsigned int   unsigned32;     /* unsigned 32-bit integer */
    161 typedef unsigned long long unsigned64; /* unsigned 64-bit integer */
    162 
    163 typedef unsigned16     Priority_Bit_map_control;
    164 
    165 typedef char           signed8;       /* signed 8-bit integer  */
    166 typedef short          signed16;      /* signed 16-bit integer */
    167 typedef int            signed32;      /* signed 32-bit integer */
    168 typedef long long      signed64;      /* signed 64-bit integer */
    169 
    170 typedef unsigned32 boolean;     /* Boolean value   */
    171 
    172 typedef float          single_precision;     /* single precision float */
    173 typedef double         double_precision;     /* double precision float */
    174 
    175 /*
    176  *
    177  */
    178 
    179 typedef void ( *m68k_isr )( void );
    180 
    181165#ifdef NO_UNINITIALIZED_WARNINGS
    182166#define m68k_disable_interrupts( _level ) \
  • c/src/exec/score/cpu/no_cpu/asm.h

    rbf61e45c r88d594a  
    3232
    3333#define ASM
    34 #include <no_cpu.h>
     34#include <rtems/no_cpu.h>
    3535
    3636/*
  • c/src/exec/score/cpu/no_cpu/cpu.h

    rbf61e45c r88d594a  
    2222#endif
    2323
    24 #include <no_cpu.h>               /* pick up machine definitions */
     24#include <rtems/no_cpu.h>               /* pick up machine definitions */
     25#ifndef ASM
     26#include <rtems/no_cputypes.h>
     27#endif
    2528
    2629/* conditional compilation parameters */
  • c/src/exec/score/cpu/no_cpu/no_cpu.h

    rbf61e45c r88d594a  
    1 /*
     1/*  no_cpu.h
     2 *
     3 *  This file is an example (i.e. "no CPU") of the file which is
     4 *  created for each CPU family port of RTEMS.
    25 *
    36 *
     
    2730 */
    2831 
     32#ifdef no_cpu
     33#undef no_cpu
     34#endif
    2935#define no_cpu
     36
     37#ifdef REPLACE_THIS_WITH_THE_CPU_MODEL
     38#undef REPLACE_THIS_WITH_THE_CPU_MODEL
     39#endif
    3040#define REPLACE_THIS_WITH_THE_CPU_MODEL
    3141 
     42#ifdef REPLACE_THIS_WITH_THE_BSP
     43#undef REPLACE_THIS_WITH_THE_BSP
     44#endif
     45#define REPLACE_THIS_WITH_THE_BSP
     46
    3247/*
    3348 *  This file contains the information required to build
     
    5671#define CPU_NAME "NO CPU"
    5772
    58 /*
    59  *  This section defines the basic types for this processor.
    60  */
    61 
    62 typedef unsigned char  unsigned8;      /* 8-bit  unsigned integer */
    63 typedef unsigned short unsigned16;     /* 16-bit unsigned integer */
    64 typedef unsigned int   unsigned32;     /* 32-bit unsigned integer */
    65 typedef unsigned long long unsigned64; /* 64-bit unsigned integer */
    66 
    67 typedef unsigned16     Priority_Bit_map_control;
    68 
    69 typedef char           signed8;    /* 8-bit signed integer  */
    70 typedef short          signed16;   /* 16-bit signed integer */
    71 typedef int            signed32;   /* 32-bit signed integer */
    72 typedef long long      signed64;   /* 64-bit signed integer */
    73 
    74 typedef unsigned32 boolean;     /* Boolean value   */
    75 
    76 typedef float          single_precision; /* single precision float */
    77 typedef double         double_precision; /* double precision float */
    78 
    79 typedef void ( *no_cpu_isr_entry )( void );
    80 
    8173#ifdef __cplusplus
    8274}
  • c/src/exec/score/cpu/unix/cpu.c

    rbf61e45c r88d594a  
    3636#include <stdlib.h>
    3737#include <unistd.h>
    38 #include <string.h>
    3938#include <signal.h>
    4039#include <time.h>
     
    226225  unsigned32        _size,
    227226  unsigned32        _new_level,
    228   proc_ptr         *_entry_point
     227  void             *_entry_point
    229228)
    230229{
    231230    unsigned32  *addr;
    232231    unsigned32   jmp_addr;
    233     unsigned32   _stack;
     232    unsigned32   _stack_low;   /* lowest "stack aligned" address */
     233    unsigned32   _stack_high;  /* highest "stack aligned" address */
    234234    unsigned32   _the_size;
    235235
    236236    jmp_addr = (unsigned32) _entry_point;
    237237
    238     _stack = ((unsigned32)(_stack_base) + CPU_STACK_ALIGNMENT);
    239     _stack &= ~(CPU_STACK_ALIGNMENT - 1);
     238    /*
     239     *  On CPUs with stacks which grow down, we build the stack
     240     *  based on the _stack_high address.  On CPUs with stacks which
     241     *  grow up, we build the stack based on the _stack_low address. 
     242     */
     243
     244    _stack_low = ((unsigned32)(_stack_base) + CPU_STACK_ALIGNMENT);
     245    _stack_low &= ~(CPU_STACK_ALIGNMENT - 1);
     246
     247    _stack_high = ((unsigned32)(_stack_base) + _size);
     248    _stack_high &= ~(CPU_STACK_ALIGNMENT - 1);
    240249
    241250    _the_size = _size & ~(CPU_STACK_ALIGNMENT - 1);
     
    251260#if defined(hppa1_1)
    252261    *(addr + RP_OFF) = jmp_addr;
    253     *(addr + SP_OFF) = (unsigned32)(_stack + CPU_FRAME_SIZE);
     262    *(addr + SP_OFF) = (unsigned32)(_stack_low + CPU_FRAME_SIZE);
    254263
    255264    /*
     
    275284
    276285    *(addr + RP_OFF) = jmp_addr + ADDR_ADJ_OFFSET;
    277     *(addr + SP_OFF) = (unsigned32)(_stack +_the_size - CPU_FRAME_SIZE);
    278     *(addr + FP_OFF) = (unsigned32)(_stack +_the_size);
     286    *(addr + SP_OFF) = (unsigned32)(_stack_high - CPU_FRAME_SIZE);
     287    *(addr + FP_OFF) = (unsigned32)(_stack_high);
    279288#else
    280289#error "UNKNOWN CPU!!!"
  • c/src/exec/score/cpu/unix/cpu.h

    rbf61e45c r88d594a  
    2828
    2929#include <setjmp.h>
    30 #include <string.h>
    31 #include <unix.h>
     30#include <rtems/unix.h>
     31#ifndef ASM
     32#include <rtems/unixtypes.h>
     33#endif
    3234
    3335/* conditional compilation parameters */
     
    677679  unsigned32        _size,
    678680  unsigned32        _new_level,
    679   proc_ptr         *_entry_point
     681  void             *_entry_point
    680682);
    681683
  • c/src/exec/score/cpu/unix/unix.h

    rbf61e45c r88d594a  
    11/*  unix.h
    22 *
    3  *  This include file contains the basic type definitions required by RTEMS
     3 *  This include file contains the definitions required by RTEMS
    44 *  which are typical for a modern UNIX computer using GCC.
    55 *
     
    1212 *  notice must appear in all copies of this file and its derivatives.
    1313 *
    14  *  $Id$
     14 *  unix.h,v 1.2 1995/05/09 20:12:28 joel Exp
    1515 */
    1616
     
    2929 */
    3030 
     31#ifdef unix
     32#undef unix
     33#endif
    3134#define unix
     35
     36#ifdef REPLACE_THIS_WITH_THE_CPU_FAMILY
     37#undef REPLACE_THIS_WITH_THE_CPU_FAMILY
     38#endif
    3239#define REPLACE_THIS_WITH_THE_CPU_FAMILY
     40
     41#ifdef REPLACE_THIS_WITH_THE_BSP
     42#undef REPLACE_THIS_WITH_THE_BSP
     43#endif
    3344#define REPLACE_THIS_WITH_THE_BSP
     45
     46#ifdef REPLACE_THIS_WITH_THE_CPU_MODEL
     47#undef REPLACE_THIS_WITH_THE_CPU_MODEL
     48#endif
    3449#define REPLACE_THIS_WITH_THE_CPU_MODEL
     50
     51#ifdef REPLACE_THIS_WITH_THE_UNIX_FLAVOR
     52#undef REPLACE_THIS_WITH_THE_UNIX_FLAVOR
     53#endif
    3554#define REPLACE_THIS_WITH_THE_UNIX_FLAVOR
    36  
     55
    3756/*
    3857 *  This file contains the information required to build
     
    5877#endif
    5978 
    60 #ifndef ASM
    61 
    62 /* type definitions */
    63 
    64 typedef unsigned char  unsigned8;       /* 8-bit  unsigned integer */
    65 typedef unsigned short unsigned16;      /* 16-bit unsigned integer */
    66 typedef unsigned int   unsigned32;      /* 32-bit unsigned integer */
    67 typedef unsigned long long unsigned64;  /* 64-bit unsigned integer */
    68 
    69 typedef unsigned16     Priority_Bit_map_control;
    70 
    71 typedef char           signed8;    /* 8-bit signed integer  */
    72 typedef short          signed16;   /* 16-bit signed integer */
    73 typedef int            signed32;   /* 32-bit signed integer */
    74 typedef long long      signed64;   /* 64-bit signed integer */
    75 
    76 typedef unsigned32 boolean;     /* Boolean value   */
    77 
    78 typedef float          single_precision;     /* single precision float */
    79 typedef double         double_precision;     /* double precision float */
    80 
    81 typedef void ( *unix_isr_entry )( void );
    82 
    8379#ifdef __cplusplus
    8480}
    8581#endif
    8682
    87 #endif /* !ASM */
    8883#endif
    8984/* end of include file */
  • c/src/exec/score/headers/watchdog.h

    rbf61e45c r88d594a  
    101101
    102102/*
    103  *  The following type is used for synchronization purposes
     103 *  The following are used for synchronization purposes
    104104 *  during an insert on a watchdog delta chain.
    105  *
    106  *  NOTE:  Watchdog_Pointer is only used to insure that
    107  *         Watchdog_Synchronization_pointer is a pointer
    108  *         which is volatile rather than a pointer to a
    109  *         volatile block of memory.
    110  */
    111 
    112 typedef Watchdog_Control          *Watchdog_Pointer;
    113 typedef volatile Watchdog_Pointer  Watchdog_Synchronization_pointer;
     105 */
     106
     107volatile unsigned32  _Watchdog_Sync_level;
     108volatile unsigned32  _Watchdog_Sync_count;
    114109
    115110/*
     
    120115EXTERN Chain_Control _Watchdog_Ticks_chain;
    121116EXTERN Chain_Control _Watchdog_Seconds_chain;
    122 
    123 /*
    124  *  The following defines the synchronization variable used to
    125  *  allow interrupts to be enabled while inserting a watchdog
    126  *  on a watchdog chain.
    127  */
    128 
    129 EXTERN Watchdog_Synchronization_pointer _Watchdog_Sync;
    130117
    131118/*
     
    377364
    378365/*
    379  *
    380  *  _Watchdog_Get_sync
    381  *
    382  *  DESCRIPTION:
    383  *
    384  *  This routine returns the current synchronization timer.  This
    385  *  routine is used so that interrupts can be enabled while a
    386  *  watchdog timer is being inserted into a watchdog chain.
    387  */
    388 
    389 STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void );
    390 
    391 /*
    392  *
    393  *  _Watchdog_Set_sync
    394  *
    395  *  DESCRIPTION:
    396  *
    397  *  This routine sets the current synchronization timer.  This
    398  *  routine is used so that interrupts can be enabled while a
    399  *  watchdog timer is being inserted into a watchdog chain.
    400  */
    401 
    402 STATIC INLINE void _Watchdog_Set_sync(
    403   Watchdog_Control *the_watchdog
    404 );
    405 
    406 /*
    407  *
    408  *  _Watchdog_Clear_sync
    409  *
    410  *  DESCRIPTION:
    411  *
    412  *  This routine will set the watchdog synchronization flag to a
    413  *  NULL address indicating synchronization is unnecessary.
    414  */
    415 
    416 STATIC INLINE void _Watchdog_Clear_sync( void );
    417 
    418 /*
    419366 *  _Watchdog_Adjust
    420367 *
     
    428375  Chain_Control              *header,
    429376  Watchdog_Adjust_directions  direction,
    430   rtems_interval           units
     377  rtems_interval              units
    431378);
    432379
  • c/src/exec/score/include/rtems/score/watchdog.h

    rbf61e45c r88d594a  
    101101
    102102/*
    103  *  The following type is used for synchronization purposes
     103 *  The following are used for synchronization purposes
    104104 *  during an insert on a watchdog delta chain.
    105  *
    106  *  NOTE:  Watchdog_Pointer is only used to insure that
    107  *         Watchdog_Synchronization_pointer is a pointer
    108  *         which is volatile rather than a pointer to a
    109  *         volatile block of memory.
    110  */
    111 
    112 typedef Watchdog_Control          *Watchdog_Pointer;
    113 typedef volatile Watchdog_Pointer  Watchdog_Synchronization_pointer;
     105 */
     106
     107volatile unsigned32  _Watchdog_Sync_level;
     108volatile unsigned32  _Watchdog_Sync_count;
    114109
    115110/*
     
    120115EXTERN Chain_Control _Watchdog_Ticks_chain;
    121116EXTERN Chain_Control _Watchdog_Seconds_chain;
    122 
    123 /*
    124  *  The following defines the synchronization variable used to
    125  *  allow interrupts to be enabled while inserting a watchdog
    126  *  on a watchdog chain.
    127  */
    128 
    129 EXTERN Watchdog_Synchronization_pointer _Watchdog_Sync;
    130117
    131118/*
     
    377364
    378365/*
    379  *
    380  *  _Watchdog_Get_sync
    381  *
    382  *  DESCRIPTION:
    383  *
    384  *  This routine returns the current synchronization timer.  This
    385  *  routine is used so that interrupts can be enabled while a
    386  *  watchdog timer is being inserted into a watchdog chain.
    387  */
    388 
    389 STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void );
    390 
    391 /*
    392  *
    393  *  _Watchdog_Set_sync
    394  *
    395  *  DESCRIPTION:
    396  *
    397  *  This routine sets the current synchronization timer.  This
    398  *  routine is used so that interrupts can be enabled while a
    399  *  watchdog timer is being inserted into a watchdog chain.
    400  */
    401 
    402 STATIC INLINE void _Watchdog_Set_sync(
    403   Watchdog_Control *the_watchdog
    404 );
    405 
    406 /*
    407  *
    408  *  _Watchdog_Clear_sync
    409  *
    410  *  DESCRIPTION:
    411  *
    412  *  This routine will set the watchdog synchronization flag to a
    413  *  NULL address indicating synchronization is unnecessary.
    414  */
    415 
    416 STATIC INLINE void _Watchdog_Clear_sync( void );
    417 
    418 /*
    419366 *  _Watchdog_Adjust
    420367 *
     
    428375  Chain_Control              *header,
    429376  Watchdog_Adjust_directions  direction,
    430   rtems_interval           units
     377  rtems_interval              units
    431378);
    432379
  • c/src/exec/score/inline/rtems/score/watchdog.inl

    rbf61e45c r88d594a  
    258258}
    259259
    260 /*PAGE
    261  *
    262  *  _Watchdog_Get_sync
    263  *
    264  */
    265 
    266 STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void )
    267 {
    268   return (Watchdog_Control *) _Watchdog_Sync;
    269 }
    270 
    271 /*PAGE
    272  *
    273  *  _Watchdog_Set_sync
    274  *
    275  */
    276 
    277 STATIC INLINE void _Watchdog_Set_sync(
    278   Watchdog_Control *the_watchdog
    279 )
    280 {
    281   _Watchdog_Sync = (Watchdog_Synchronization_pointer) the_watchdog;
    282 }
    283 
    284 /*PAGE
    285  *
    286  *  _Watchdog_Clear_sync
    287  *
    288  */
    289 
    290 STATIC INLINE void _Watchdog_Clear_sync( void )
    291 {
    292   _Watchdog_Sync = NULL;
    293 }
    294 
    295260#endif
    296261/* end of include file */
  • c/src/exec/score/inline/watchdog.inl

    rbf61e45c r88d594a  
    258258}
    259259
    260 /*PAGE
    261  *
    262  *  _Watchdog_Get_sync
    263  *
    264  */
    265 
    266 STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void )
    267 {
    268   return (Watchdog_Control *) _Watchdog_Sync;
    269 }
    270 
    271 /*PAGE
    272  *
    273  *  _Watchdog_Set_sync
    274  *
    275  */
    276 
    277 STATIC INLINE void _Watchdog_Set_sync(
    278   Watchdog_Control *the_watchdog
    279 )
    280 {
    281   _Watchdog_Sync = (Watchdog_Synchronization_pointer) the_watchdog;
    282 }
    283 
    284 /*PAGE
    285  *
    286  *  _Watchdog_Clear_sync
    287  *
    288  */
    289 
    290 STATIC INLINE void _Watchdog_Clear_sync( void )
    291 {
    292   _Watchdog_Sync = NULL;
    293 }
    294 
    295260#endif
    296261/* end of include file */
  • c/src/exec/score/macros/rtems/score/watchdog.inl

    rbf61e45c r88d594a  
    172172  ((Watchdog_Control *) (_header)->last)
    173173
    174 /*PAGE
    175  *
    176  *  _Watchdog_Get_sync
    177  *
    178  */
    179 
    180 #define _Watchdog_Get_sync() \
    181    ((Watchdog_Control *) _Watchdog_Sync)
    182 
    183 /*PAGE
    184  *
    185  *  _Watchdog_Set_sync
    186  *
    187  */
    188 
    189 #define _Watchdog_Set_sync( _the_watchdog ) \
    190   _Watchdog_Sync = (Watchdog_Synchronization_pointer) (_the_watchdog)
    191 
    192 /*PAGE
    193  *
    194  *  _Watchdog_Clear_sync
    195  *
    196  */
    197 
    198 #define _Watchdog_Clear_sync() \
    199   _Watchdog_Sync = NULL;
    200 
    201174#endif
    202175/* end of include file */
  • c/src/exec/score/macros/watchdog.inl

    rbf61e45c r88d594a  
    172172  ((Watchdog_Control *) (_header)->last)
    173173
    174 /*PAGE
    175  *
    176  *  _Watchdog_Get_sync
    177  *
    178  */
    179 
    180 #define _Watchdog_Get_sync() \
    181    ((Watchdog_Control *) _Watchdog_Sync)
    182 
    183 /*PAGE
    184  *
    185  *  _Watchdog_Set_sync
    186  *
    187  */
    188 
    189 #define _Watchdog_Set_sync( _the_watchdog ) \
    190   _Watchdog_Sync = (Watchdog_Synchronization_pointer) (_the_watchdog)
    191 
    192 /*PAGE
    193  *
    194  *  _Watchdog_Clear_sync
    195  *
    196  */
    197 
    198 #define _Watchdog_Clear_sync() \
    199   _Watchdog_Sync = NULL;
    200 
    201174#endif
    202175/* end of include file */
  • c/src/exec/score/src/heap.c

    rbf61e45c r88d594a  
    117117{
    118118  Heap_Block        *the_block;
    119   Heap_Block        *next_block;
    120   Heap_Block        *previous_block;
     119 
     120  /*
     121   *  The overhead was taken from the original heap memory.
     122   */
     123
     124  Heap_Block  *old_final;
     125  Heap_Block  *new_final;
    121126
    122127  /*
     
    151156  /*
    152157   *  Currently only case 4 should make it to this point.
    153    */
    154 
    155   *amount_extended = size - HEAP_BLOCK_USED_OVERHEAD;
    156 
    157   previous_block = the_heap->last;
    158 
    159   the_block              = (Heap_Block *) starting_address;
    160   the_block->front_flag  = size;
    161   the_block->next        = previous_block->next;
    162   the_block->previous    = previous_block;
    163 
    164   previous_block->next   = the_block;
    165   the_heap->last         = the_block;
    166 
    167   next_block             = _Heap_Next_block( the_block );
    168   next_block->back_flag  = size;
    169   next_block->front_flag = HEAP_DUMMY_FLAG;
    170   the_heap->final        = next_block;
     158   *  The basic trick is to make the extend area look like a used
     159   *  block and free it.
     160   */
     161
     162  *amount_extended = size;
     163
     164  old_final = the_heap->final;
     165  new_final = _Addresses_Add_offset( old_final, size );
     166  /* SAME AS: _Addresses_Add_offset( starting_address, size-HEAP_OVERHEAD ); */
     167
     168  the_heap->final = new_final;
     169
     170  old_final->front_flag =
     171  new_final->back_flag  = _Heap_Build_flag( size, HEAP_BLOCK_USED );
     172  new_final->front_flag = HEAP_DUMMY_FLAG;
     173
     174  /*
     175   *  Must pass in address of "user" area
     176   */
     177
     178  _Heap_Free( the_heap, &old_final->next );
    171179
    172180  return HEAP_EXTEND_SUCCESSFUL;
     
    393401)
    394402{
    395   Heap_Block *the_block;
    396   Heap_Block *next_block;
     403  Heap_Block *the_block  = 0;  /* avoid warnings */
     404  Heap_Block *next_block = 0;  /* avoid warnings */
    397405  int         notdone = 1;
    398406
  • c/src/exec/score/src/watchdog.c

    rbf61e45c r88d594a  
    3131void _Watchdog_Handler_initialization( void )
    3232{
    33   _Watchdog_Clear_sync();
     33  _Watchdog_Sync_count = 0;
     34  _Watchdog_Sync_level = 0;
    3435  _Chain_Initialize_empty( &_Watchdog_Ticks_chain );
    3536  _Chain_Initialize_empty( &_Watchdog_Seconds_chain );
     
    5758    case WATCHDOG_INACTIVE:
    5859      break;
     60
     61    case WATCHDOG_REINSERT: 
     62   
     63      /*
     64       *  It is not actually on the chain so just change the state and
     65       *  the Insert operation we interrupted will be aborted.
     66       */
     67      the_watchdog->state = WATCHDOG_INACTIVE;
     68      break;
     69
    5970    case WATCHDOG_ACTIVE:
    60     case WATCHDOG_REINSERT:
    6171    case WATCHDOG_REMOVE_IT:
    6272
     
    6777        next_watchdog->delta_interval += the_watchdog->delta_interval;
    6878
    69       if ( the_watchdog == _Watchdog_Sync )
    70         _Watchdog_Sync = _Watchdog_Previous( the_watchdog );
     79      if ( _Watchdog_Sync_count )
     80        _Watchdog_Sync_level = _ISR_Nest_level;
    7181
    7282      _Chain_Extract_unprotected( &the_watchdog->Node );
     
    95105  Chain_Control               *header,
    96106  Watchdog_Adjust_directions   direction,
    97   rtems_interval            units
     107  rtems_interval               units
    98108)
    99109{
     
    137147  ISR_Level         level;
    138148  Watchdog_Control *after;
    139 
    140   the_watchdog->state          = WATCHDOG_REINSERT;
    141   the_watchdog->delta_interval = the_watchdog->initial;
     149  unsigned32        insert_isr_nest_level;
     150  rtems_interval    delta_interval;
     151 
     152
     153  insert_isr_nest_level   = _ISR_Nest_level;
     154  the_watchdog->state = WATCHDOG_REINSERT;
     155
     156  _Watchdog_Sync_count++;
     157restart:
     158  delta_interval = the_watchdog->initial;
    142159
    143160  _ISR_Disable( level );
     
    145162  for ( after = _Watchdog_First( header ) ;
    146163        ;
    147         after = _Watchdog_Next( _Watchdog_Get_sync() ) ) {
    148 
    149      if ( the_watchdog->delta_interval == 0 || !_Watchdog_Next( after ) )
     164        after = _Watchdog_Next( after ) ) {
     165
     166     if ( delta_interval == 0 || !_Watchdog_Next( after ) )
    150167       break;
    151168
    152      if ( the_watchdog->delta_interval < after->delta_interval ) {
    153        after->delta_interval -= the_watchdog->delta_interval;
     169     if ( delta_interval < after->delta_interval ) {
     170       after->delta_interval -= delta_interval;
    154171       break;
    155172     }
    156173
    157      the_watchdog->delta_interval -= after->delta_interval;
    158      _Watchdog_Set_sync( after );
     174     delta_interval -= after->delta_interval;
    159175
    160176     /*
    161       *  If you experience problems comment out the _ISR_Flash line.  Under
    162       *  certain circumstances, this flash allows interrupts to execute
    163       *  which violate the design assumptions.  The critical section
    164       *  mechanism used here must be redesigned to address this.
     177      *  If you experience problems comment out the _ISR_Flash line.  This
     178      *  (3.2.0) is the first release with this critical section redesigned.
     179      *  Under certain circumstances, the PREVIOUS critical section algorithm
     180      *  used around this flash point allows interrupts to execute
     181      *  which violated the design assumptions.  The critical section
     182      *  mechanism used here WAS redesigned to address this.
    165183      */
    166184
    167185     _ISR_Flash( level );
     186
     187     if ( the_watchdog->state != WATCHDOG_REINSERT ) {
     188       goto exit_insert;
     189     }
     190
     191     if ( _Watchdog_Sync_level > insert_isr_nest_level ) {
     192       _Watchdog_Sync_level = insert_isr_nest_level;
     193       _ISR_Enable( level );
     194       goto restart;
     195     }
    168196  }
    169197
     
    171199    _Watchdog_Activate( the_watchdog );
    172200
     201  the_watchdog->delta_interval = delta_interval;
     202
    173203  _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node );
    174204
    175   _Watchdog_Clear_sync();
    176 
    177   _ISR_Enable(  level );
     205exit_insert:
     206  _Watchdog_Sync_level = insert_isr_nest_level;
     207  _Watchdog_Sync_count--;
     208  _ISR_Enable( level );
    178209}
    179210
  • c/src/exec/score/tools/hppa1.1/genoffsets.c

    rbf61e45c r88d594a  
    11/*
    2  *      @(#)genoffsets.c        1.3 - 95/03/15
    3  *
     2 *      @(#)genoffsets.c        1.5 - 95/05/16
     3 *     
    44 *
    55 *  genoffsets.c
     
    77 *  This file generates the offsets.h for the HP PA-RISC port of RTEMS.
    88 *
    9  *  NOTE:  It only prints the offset for structures actually used
     9 *  NOTE:  It only prints the offset for structures actually used 
    1010 *         by the assembly code.
    1111 *
     
    1717 *  notice must appear in all copies of this file and its derivatives.
    1818 *
    19  *  $Id$
     19 *  genoffsets.c,v 1.2 1995/05/09 20:16:48 joel Exp
    2020 *
    2121 */
  • c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c

    rbf61e45c r88d594a  
    11/*
    2  *      @(#)bspstart.c  1.13 - 95/04/25
     2 *      @(#)bspstart.c  1.14 - 95/05/16
    33 *     
    44 */
     
    2525 *  notice must appear in all copies of this file and its derivatives.
    2626 *
    27  *  $Id$
     27 *  bspstart.c,v 1.2 1995/05/09 20:17:33 joel Exp
    2828 */
    2929
     
    256256#ifdef hppa7200
    257257    /*
    258      * Use DR0 if supported
     258     * Use HPPA_DR0 if supported
    259259     */
    260260    {
    261261        int dr0;
    262         HPPA_ASM_MFCPU(DR0, dr0);
     262        HPPA_ASM_MFCPU(HPPA_DR0, dr0);
    263263        cpu_number = (dr0 >> 4) & 0x7;
    264264    }
  • c/src/lib/libbsp/i960/cvme961/shmsupp/lock.c

    rbf61e45c r88d594a  
    1919
    2020#include <rtems.h>
    21 #include "cpu.h"
    22 #include "bsp.h"
    23 #include "shm.h"
     21#include <bsp.h>
     22#include <shm.h>
    2423
    2524/*
  • c/src/lib/libbsp/m68k/idp/clock/ckinit.c

    rbf61e45c r88d594a  
    2727#include <stdlib.h>
    2828
    29 #include "rtems.h"
    30 #include "clockdrv.h"
    31 #include "bsp.h"
    32 #include "cpu.h"
     29#include <rtems.h>
     30#include <clockdrv.h>
     31#include <bsp.h>
    3332
    3433rtems_unsigned32 Clock_isrs;        /* ISRs until next tick */
  • c/src/lib/libbsp/m68k/idp/include/bsp.h

    rbf61e45c r88d594a  
    99#define __IDP_BSP_H
    1010
    11 #include "rtems.h"
    12 #include "cpu.h"
    13 #include "console.h"
    14 #include "mc68230.h"
    15 #include "mc68681.h"
     11#include <rtems.h>
     12#include <console.h>
     13#include <mc68230.h>
     14#include <mc68681.h>
    1615
    1716/*
  • c/src/lib/libbsp/m68k/idp/startup/bspstart.c

    rbf61e45c r88d594a  
    2121 */
    2222
    23 #include "rtems.h"
    24 #include "bsp.h"
    25 #include "cpu.h"
    26 #include "libcsupport.h"
     23#include <rtems.h>
     24#include <bsp.h>
     25#include <libcsupport.h>
    2726
    2827unsigned char *duart_base;
  • c/src/lib/libbsp/m68k/idp/timer/timer.c

    rbf61e45c r88d594a  
    2828
    2929
    30 #include "rtems.h"
    31 #include "cpu.h"
    32 #include "bsp.h"
    33 #include "mc68230.h"
     30#include <rtems.h>
     31#include <bsp.h>
     32#include <mc68230.h>
    3433
    3534#define TIMER_VECTOR 0x4D
  • c/src/lib/libbsp/shmdr/poll.c

    rbf61e45c r88d594a  
    1717 *  notice must appear in all copies of this file and its derivatives.
    1818 *
    19  *  $Id$
     19 *  poll.c,v 1.2 1995/05/09 20:22:57 joel Exp
    2020 */
    2121
    2222#include <rtems.h>
     23#include <rtems/sysstate.h>
    2324#include "shm.h"
    2425#include "clockdrv.h"
     
    3031  Clock_isr( 0 );             /* invoke standard clock ISR */
    3132
    32   /* enable_tracing(); */
    33   /* ticks += 1; */
    34   Shm_Lock( Shm_Local_receive_queue );
    35     tmpfront = Shm_Local_receive_queue->front;
    36   Shm_Unlock( Shm_Local_receive_queue );
    37   if ( Shm_Convert(tmpfront) == Shm_Locked_queue_End_of_list ) return;
    38   rtems_multiprocessing_announce();
    39   Shm_Interrupt_count++;
     33
     34  /*
     35   * Check for msgs only if we are "up"
     36   * This avoids a race condition where we may get a clock
     37   * interrupt before MPCI has completed its init
     38   */
     39 
     40  if (_System_state_Is_up(_System_state_Get()))
     41  {
     42      /* enable_tracing(); */
     43      /* ticks += 1; */
     44      Shm_Lock( Shm_Local_receive_queue );
     45      tmpfront = Shm_Local_receive_queue->front;
     46      Shm_Unlock( Shm_Local_receive_queue );
     47      if ( Shm_Convert(tmpfront) == Shm_Locked_queue_End_of_list ) return;
     48      rtems_multiprocessing_announce();
     49      Shm_Interrupt_count++;
     50  }
    4051}
  • c/src/lib/libbsp/shmdr/shm.h

    rbf61e45c r88d594a  
    1515 *  notice must appear in all copies of this file and its derivatives.
    1616 *
    17  *  $Id$
     17 *  shm.h,v 1.2 1995/05/09 20:23:03 joel Exp
    1818 */
    1919
     
    2424extern "C" {
    2525#endif
    26 
    27 #include <cpu.h>
    2826
    2927/*  The information contained in the Node Status, Locked Queue, and
  • c/src/lib/libbsp/shmdr/shm_driver.h

    rbf61e45c r88d594a  
    1515 *  notice must appear in all copies of this file and its derivatives.
    1616 *
    17  *  $Id$
     17 *  shm.h,v 1.2 1995/05/09 20:23:03 joel Exp
    1818 */
    1919
     
    2424extern "C" {
    2525#endif
    26 
    27 #include <cpu.h>
    2826
    2927/*  The information contained in the Node Status, Locked Queue, and
  • c/src/lib/libc/__brk.c

    rbf61e45c r88d594a  
     1#if !defined(RTEMS_UNIX)
     2
    13/*
    24 *  RTEMS "Broken" __brk/__sbrk Implementation
     
    1315 *  notice must appear in all copies of this file and its derivatives.
    1416 *
    15  *  $Id$
     17 *  __brk.c,v 1.2 1995/05/09 20:24:28 joel Exp
    1618 */
    1719
     
    3941  return -1;
    4042}
     43
     44#endif
  • c/src/lib/libc/__gettod.c

    rbf61e45c r88d594a  
    1212 *  notice must appear in all copies of this file and its derivatives.
    1313 *
    14  *  $Id$
     14 *  __gettod.c,v 1.2 1995/05/09 20:24:31 joel Exp
    1515 */
    1616
     
    2020#include <sys/reent.h>
    2121#endif
     22
    2223#include <time.h>
    2324#include <sys/time.h>
     25
    2426#include <errno.h>
    2527#include <assert.h>
     
    3032
    3133int gettimeofday(
    32    struct timeval  *tp,
    33    struct timezone *tzp
     34  struct timeval  *tp,
     35  struct timezone *tzp
    3436)
    3537{
     
    3739  rtems_clock_time_value time;
    3840
    39   if ( !tp || !tzp ) {
     41  if ( !tp ) {
    4042    errno = EFAULT;
    4143    return -1;
     
    5254  tp->tv_usec = time.microseconds;
    5355
    54 #if 0
    55   tzp->minuteswest = timezone / 60; /* from seconds to minutes */
    56   tzp->dsttime = daylight;
    57 #endif
    58 
    5956  /*
    6057   * newlib does not have timezone and daylight savings time
     
    6259   */
    6360
    64   tzp->tz_minuteswest = 0;  /* at UTC */
    65   tzp->tz_dsttime = 0;      /* no daylight savings */
     61  if ( tzp ) {
     62    tzp->tz_minuteswest = 0;  /* at UTC */
     63    tzp->tz_dsttime = 0;      /* no daylight savings */
     64#if 0
     65  tzp->minuteswest = timezone / 60; /* from seconds to minutes */
     66  tzp->dsttime = daylight;
     67#endif
     68  }
    6669  return 0;
    6770}
    6871
     72#if defined(RTEMS_NEWLIB)
     73
     74#if 0
    6975/*
    70  *  "Reentrant" versions of the above routines implemented above.
     76 *  "Reentrant" version
    7177 */
    7278
    73 #if 0
    7479int _gettimeofday_r(
    75    struct _reent   *ignored_reentrancy_stuff,
    76    struct timeval  *tp,
    77    struct timezone *tzp
     80  struct _reent   *ignored_reentrancy_stuff,
     81  struct timeval  *tp,
     82  struct timezone *tzp
    7883)
    7984{
     
    8287#endif
    8388
     89/*
     90 *  "System call" version
     91 */
     92
     93int _gettimeofday(
     94  struct timeval  *tp,
     95  struct timezone *tzp
     96)
     97{
     98  return gettimeofday( tp, tzp );
     99}
     100
     101#endif /* defined(RTEMS_NEWLIB) */
     102
    84103#endif
  • c/src/lib/libc/newlibc.c

    rbf61e45c r88d594a  
    11/*
    2  *      @(#)newlibc.c   1.8 - 95/04/25
     2 *      @(#)newlibc.c   1.9 - 95/05/16
    33 *     
    44 */
     
    77
    88/*
    9  *  File:       $RCSfile$
     9 *  File:       newlibc.c,v
    1010 *  Project:    PixelFlow
    1111 *  Created:    94/12/7
    12  *  Revision:   $Revision$
    13  *  Last Mod:   $Date$
     12 *  Revision:   1.2
     13 *  Last Mod:   1995/05/09 20:24:37
    1414 *
    1515 *  COPYRIGHT (c) 1994 by Division Incorporated
     
    3636 *  NOTE:
    3737 *
    38  *  $Id$
     38 *  newlibc.c,v 1.2 1995/05/09 20:24:37 joel Exp
    3939 *
    4040 */
  • c/src/lib/libmisc/stackchk/check.c

    rbf61e45c r88d594a  
    330330   */
    331331
     332  base += 4;
    332333  for (ebase = base + length; base < ebase; base++)
    333334      if (*base != U32_PATTERN)
  • c/src/libchip/shmdr/poll.c

    rbf61e45c r88d594a  
    1717 *  notice must appear in all copies of this file and its derivatives.
    1818 *
    19  *  $Id$
     19 *  poll.c,v 1.2 1995/05/09 20:22:57 joel Exp
    2020 */
    2121
    2222#include <rtems.h>
     23#include <rtems/sysstate.h>
    2324#include "shm.h"
    2425#include "clockdrv.h"
     
    3031  Clock_isr( 0 );             /* invoke standard clock ISR */
    3132
    32   /* enable_tracing(); */
    33   /* ticks += 1; */
    34   Shm_Lock( Shm_Local_receive_queue );
    35     tmpfront = Shm_Local_receive_queue->front;
    36   Shm_Unlock( Shm_Local_receive_queue );
    37   if ( Shm_Convert(tmpfront) == Shm_Locked_queue_End_of_list ) return;
    38   rtems_multiprocessing_announce();
    39   Shm_Interrupt_count++;
     33
     34  /*
     35   * Check for msgs only if we are "up"
     36   * This avoids a race condition where we may get a clock
     37   * interrupt before MPCI has completed its init
     38   */
     39 
     40  if (_System_state_Is_up(_System_state_Get()))
     41  {
     42      /* enable_tracing(); */
     43      /* ticks += 1; */
     44      Shm_Lock( Shm_Local_receive_queue );
     45      tmpfront = Shm_Local_receive_queue->front;
     46      Shm_Unlock( Shm_Local_receive_queue );
     47      if ( Shm_Convert(tmpfront) == Shm_Locked_queue_End_of_list ) return;
     48      rtems_multiprocessing_announce();
     49      Shm_Interrupt_count++;
     50  }
    4051}
  • c/src/libchip/shmdr/shm_driver.h

    rbf61e45c r88d594a  
    1515 *  notice must appear in all copies of this file and its derivatives.
    1616 *
    17  *  $Id$
     17 *  shm.h,v 1.2 1995/05/09 20:23:03 joel Exp
    1818 */
    1919
     
    2424extern "C" {
    2525#endif
    26 
    27 #include <cpu.h>
    2826
    2927/*  The information contained in the Node Status, Locked Queue, and
  • c/src/libmisc/stackchk/check.c

    rbf61e45c r88d594a  
    330330   */
    331331
     332  base += 4;
    332333  for (ebase = base + length; base < ebase; base++)
    333334      if (*base != U32_PATTERN)
  • c/src/tests/mptests/mp01/task1.c

    rbf61e45c r88d594a  
    2222 *  notice must appear in all copies of this file and its derivatives.
    2323 *
    24  *  $Id$
     24 *  task1.c,v 1.2 1995/05/09 20:26:24 joel Exp
    2525 */
    2626
     
    4444  print_time( " - rtems_clock_get - ", &time, "\n" );
    4545
    46   status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
     46  status = rtems_task_wake_after( task_number( tid ) * 1 * TICKS_PER_SECOND );
    4747  directive_failed( status, "rtems_task_wake_after" );
    4848
  • c/src/tests/sptests/sp04/tswitch.c

    rbf61e45c r88d594a  
    1919 *  notice must appear in all copies of this file and its derivatives.
    2020 *
    21  *  $Id$
     21 *  tswitch.c,v 1.2 1995/05/09 20:32:43 joel Exp
    2222 */
    2323
     
    4545
    4646      put_name( Task_name[ index ], FALSE );
    47       print_time( " - ", &time, "\n" );
     47      print_time( "- ", &time, "\n" );
    4848
    4949      if ( time.second >= 16 ) {
  • c/src/tests/sptests/sp09/screen14.c

    rbf61e45c r88d594a  
    7777  puts( "TA1 - rtems_timer_cancel - RTEMS_INVALID_ID" );
    7878
    79   status = rtems_timer_cancel( Timer_id[ 1 ] );
    80   fatal_directive_status(
    81     status,
    82     RTEMS_INCORRECT_STATE,
    83     "rtems_timer_cancel before initiated"
    84   );
    85   puts( "TA1 - rtems_timer_cancel - RTEMS_INCORRECT_STATE" );
    86 
    8779  status = rtems_timer_reset( 0x010100 );
    8880  fatal_directive_status(
  • c/src/tests/sptests/sp09/sp09.scn

    rbf61e45c r88d594a  
    238238TA1 - rtems_timer_ident - RTEMS_INVALID_NAME
    239239TA1 - rtems_timer_cancel - RTEMS_INVALID_ID
    240 TA1 - rtems_timer_cancel - RTEMS_INCORRECT_STATE
    241240TA1 - rtems_timer_reset - RTEMS_INVALID_ID
    242241TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED
  • c/src/tests/sptests/sp20/sp20.scn

    rbf61e45c r88d594a  
    1414TA5 - rtems_rate_monotonic_create id = 0x00010005
    1515TA5 - rtems_rate_monotonic_ident id = 0x00010005
    16 TA5 - (0x00010005) period 50
     16TA5 - (0x00010005) period 100
    1717TA5 - PERIODS CHECK OK (1)
    1818TA5 - PERIODS CHECK OK (2)
  • c/src/tests/sptests/spsize/size.c

    rbf61e45c r88d594a  
    333333/*watchdog.h*/  (sizeof _Watchdog_Ticks_chain)            +
    334334                (sizeof _Watchdog_Seconds_chain)          +
    335                 (sizeof _Watchdog_Sync)                   +
     335                (sizeof _Watchdog_Sync_count)             +
     336                (sizeof _Watchdog_Sync_level)             +
    336337
    337338/*wkspace.h*/   (sizeof _Workspace_Area);
  • cpukit/libcsupport/src/__brk.c

    rbf61e45c r88d594a  
     1#if !defined(RTEMS_UNIX)
     2
    13/*
    24 *  RTEMS "Broken" __brk/__sbrk Implementation
     
    1315 *  notice must appear in all copies of this file and its derivatives.
    1416 *
    15  *  $Id$
     17 *  __brk.c,v 1.2 1995/05/09 20:24:28 joel Exp
    1618 */
    1719
     
    3941  return -1;
    4042}
     43
     44#endif
  • cpukit/libcsupport/src/__gettod.c

    rbf61e45c r88d594a  
    1212 *  notice must appear in all copies of this file and its derivatives.
    1313 *
    14  *  $Id$
     14 *  __gettod.c,v 1.2 1995/05/09 20:24:31 joel Exp
    1515 */
    1616
     
    2020#include <sys/reent.h>
    2121#endif
     22
    2223#include <time.h>
    2324#include <sys/time.h>
     25
    2426#include <errno.h>
    2527#include <assert.h>
     
    3032
    3133int gettimeofday(
    32    struct timeval  *tp,
    33    struct timezone *tzp
     34  struct timeval  *tp,
     35  struct timezone *tzp
    3436)
    3537{
     
    3739  rtems_clock_time_value time;
    3840
    39   if ( !tp || !tzp ) {
     41  if ( !tp ) {
    4042    errno = EFAULT;
    4143    return -1;
     
    5254  tp->tv_usec = time.microseconds;
    5355
    54 #if 0
    55   tzp->minuteswest = timezone / 60; /* from seconds to minutes */
    56   tzp->dsttime = daylight;
    57 #endif
    58 
    5956  /*
    6057   * newlib does not have timezone and daylight savings time
     
    6259   */
    6360
    64   tzp->tz_minuteswest = 0;  /* at UTC */
    65   tzp->tz_dsttime = 0;      /* no daylight savings */
     61  if ( tzp ) {
     62    tzp->tz_minuteswest = 0;  /* at UTC */
     63    tzp->tz_dsttime = 0;      /* no daylight savings */
     64#if 0
     65  tzp->minuteswest = timezone / 60; /* from seconds to minutes */
     66  tzp->dsttime = daylight;
     67#endif
     68  }
    6669  return 0;
    6770}
    6871
     72#if defined(RTEMS_NEWLIB)
     73
     74#if 0
    6975/*
    70  *  "Reentrant" versions of the above routines implemented above.
     76 *  "Reentrant" version
    7177 */
    7278
    73 #if 0
    7479int _gettimeofday_r(
    75    struct _reent   *ignored_reentrancy_stuff,
    76    struct timeval  *tp,
    77    struct timezone *tzp
     80  struct _reent   *ignored_reentrancy_stuff,
     81  struct timeval  *tp,
     82  struct timezone *tzp
    7883)
    7984{
     
    8287#endif
    8388
     89/*
     90 *  "System call" version
     91 */
     92
     93int _gettimeofday(
     94  struct timeval  *tp,
     95  struct timezone *tzp
     96)
     97{
     98  return gettimeofday( tp, tzp );
     99}
     100
     101#endif /* defined(RTEMS_NEWLIB) */
     102
    84103#endif
  • cpukit/libcsupport/src/newlibc.c

    rbf61e45c r88d594a  
    11/*
    2  *      @(#)newlibc.c   1.8 - 95/04/25
     2 *      @(#)newlibc.c   1.9 - 95/05/16
    33 *     
    44 */
     
    77
    88/*
    9  *  File:       $RCSfile$
     9 *  File:       newlibc.c,v
    1010 *  Project:    PixelFlow
    1111 *  Created:    94/12/7
    12  *  Revision:   $Revision$
    13  *  Last Mod:   $Date$
     12 *  Revision:   1.2
     13 *  Last Mod:   1995/05/09 20:24:37
    1414 *
    1515 *  COPYRIGHT (c) 1994 by Division Incorporated
     
    3636 *  NOTE:
    3737 *
    38  *  $Id$
     38 *  newlibc.c,v 1.2 1995/05/09 20:24:37 joel Exp
    3939 *
    4040 */
  • cpukit/libmisc/stackchk/check.c

    rbf61e45c r88d594a  
    330330   */
    331331
     332  base += 4;
    332333  for (ebase = base + length; base < ebase; base++)
    333334      if (*base != U32_PATTERN)
  • cpukit/rtems/src/rtemstimer.c

    rbf61e45c r88d594a  
    147147      return( RTEMS_INTERNAL_ERROR );
    148148    case OBJECTS_LOCAL:
    149       if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) {
     149      if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
    150150        (void) _Watchdog_Remove( &the_timer->Ticker );
    151         _Thread_Enable_dispatch();
    152         return( RTEMS_SUCCESSFUL );
    153       }
    154       _Thread_Enable_dispatch();
    155       return( RTEMS_INCORRECT_STATE );
     151      _Thread_Enable_dispatch();
     152      return( RTEMS_SUCCESSFUL );
    156153  }
    157154
  • cpukit/sapi/include/rtems/io.h

    rbf61e45c r88d594a  
    188188
    189189rtems_status_code _IO_Handler_routine(
    190   IO_operations     operation,
    191   rtems_device_major_number  major,
    192   rtems_device_minor_number  minor,
    193   void             *argument,
    194   unsigned32       *return_value
     190  IO_operations              operation,
     191  rtems_device_major_number  major,
     192  rtems_device_minor_number  minor,
     193  void                      *argument,
     194  unsigned32                *return_value
    195195);
    196196
  • cpukit/sapi/src/exinit.c

    rbf61e45c r88d594a  
    108108  _CPU_Initialize( cpu_table, _Thread_Dispatch );
    109109
     110  /*
     111   *  Do this as early as possible to insure no debugging output
     112   *  is even attempted to be printed.
     113   */
     114
     115  _Debug_Manager_initialization();
     116
    110117  multiprocessing_table = configuration_table->User_multiprocessing_table;
    111118  if ( multiprocessing_table == NULL )
  • cpukit/sapi/src/io.c

    rbf61e45c r88d594a  
    257257
    258258rtems_status_code _IO_Handler_routine(
    259   IO_operations     operation,
    260   rtems_device_major_number  major,
    261   rtems_device_minor_number  minor,
    262   void             *argument,
    263   unsigned32       *return_value
     259  IO_operations              operation,
     260  rtems_device_major_number  major,
     261  rtems_device_minor_number  minor,
     262  void                      *argument,
     263  unsigned32                *return_value
    264264)
    265265{
  • cpukit/score/cpu/hppa1.1/cpu.c

    rbf61e45c r88d594a  
    1515 *      suitability of this software for any purpose.
    1616 *
    17  *  $Id$
     17 *  cpu.c,v 1.2 1995/05/09 20:11:35 joel Exp
    1818 */
    1919
  • cpukit/score/cpu/i386/asm.h

    rbf61e45c r88d594a  
    3232
    3333#define ASM
    34 #include <i386.h>
     34#include <rtems/i386.h>
    3535
    3636/*
  • cpukit/score/cpu/i386/rtems/asm.h

    rbf61e45c r88d594a  
    3232
    3333#define ASM
    34 #include <i386.h>
     34#include <rtems/i386.h>
    3535
    3636/*
  • cpukit/score/cpu/i960/asm.h

    rbf61e45c r88d594a  
    3232
    3333#define ASM
    34 #include <i960.h>
     34#include <rtems/i960.h>
    3535
    3636/*
  • cpukit/score/cpu/m68k/asm.h

    rbf61e45c r88d594a  
    3232
    3333#define ASM
    34 #include <m68k.h>
     34#include <rtems/m68k.h>
    3535
    3636/*
  • cpukit/score/cpu/m68k/rtems/asm.h

    rbf61e45c r88d594a  
    3232
    3333#define ASM
    34 #include <m68k.h>
     34#include <rtems/m68k.h>
    3535
    3636/*
  • cpukit/score/cpu/no_cpu/asm.h

    rbf61e45c r88d594a  
    3232
    3333#define ASM
    34 #include <no_cpu.h>
     34#include <rtems/no_cpu.h>
    3535
    3636/*
  • cpukit/score/cpu/no_cpu/rtems/asm.h

    rbf61e45c r88d594a  
    3232
    3333#define ASM
    34 #include <no_cpu.h>
     34#include <rtems/no_cpu.h>
    3535
    3636/*
  • cpukit/score/cpu/unix/cpu.c

    rbf61e45c r88d594a  
    3636#include <stdlib.h>
    3737#include <unistd.h>
    38 #include <string.h>
    3938#include <signal.h>
    4039#include <time.h>
     
    226225  unsigned32        _size,
    227226  unsigned32        _new_level,
    228   proc_ptr         *_entry_point
     227  void             *_entry_point
    229228)
    230229{
    231230    unsigned32  *addr;
    232231    unsigned32   jmp_addr;
    233     unsigned32   _stack;
     232    unsigned32   _stack_low;   /* lowest "stack aligned" address */
     233    unsigned32   _stack_high;  /* highest "stack aligned" address */
    234234    unsigned32   _the_size;
    235235
    236236    jmp_addr = (unsigned32) _entry_point;
    237237
    238     _stack = ((unsigned32)(_stack_base) + CPU_STACK_ALIGNMENT);
    239     _stack &= ~(CPU_STACK_ALIGNMENT - 1);
     238    /*
     239     *  On CPUs with stacks which grow down, we build the stack
     240     *  based on the _stack_high address.  On CPUs with stacks which
     241     *  grow up, we build the stack based on the _stack_low address. 
     242     */
     243
     244    _stack_low = ((unsigned32)(_stack_base) + CPU_STACK_ALIGNMENT);
     245    _stack_low &= ~(CPU_STACK_ALIGNMENT - 1);
     246
     247    _stack_high = ((unsigned32)(_stack_base) + _size);
     248    _stack_high &= ~(CPU_STACK_ALIGNMENT - 1);
    240249
    241250    _the_size = _size & ~(CPU_STACK_ALIGNMENT - 1);
     
    251260#if defined(hppa1_1)
    252261    *(addr + RP_OFF) = jmp_addr;
    253     *(addr + SP_OFF) = (unsigned32)(_stack + CPU_FRAME_SIZE);
     262    *(addr + SP_OFF) = (unsigned32)(_stack_low + CPU_FRAME_SIZE);
    254263
    255264    /*
     
    275284
    276285    *(addr + RP_OFF) = jmp_addr + ADDR_ADJ_OFFSET;
    277     *(addr + SP_OFF) = (unsigned32)(_stack +_the_size - CPU_FRAME_SIZE);
    278     *(addr + FP_OFF) = (unsigned32)(_stack +_the_size);
     286    *(addr + SP_OFF) = (unsigned32)(_stack_high - CPU_FRAME_SIZE);
     287    *(addr + FP_OFF) = (unsigned32)(_stack_high);
    279288#else
    280289#error "UNKNOWN CPU!!!"
  • cpukit/score/include/rtems/score/watchdog.h

    rbf61e45c r88d594a  
    101101
    102102/*
    103  *  The following type is used for synchronization purposes
     103 *  The following are used for synchronization purposes
    104104 *  during an insert on a watchdog delta chain.
    105  *
    106  *  NOTE:  Watchdog_Pointer is only used to insure that
    107  *         Watchdog_Synchronization_pointer is a pointer
    108  *         which is volatile rather than a pointer to a
    109  *         volatile block of memory.
    110  */
    111 
    112 typedef Watchdog_Control          *Watchdog_Pointer;
    113 typedef volatile Watchdog_Pointer  Watchdog_Synchronization_pointer;
     105 */
     106
     107volatile unsigned32  _Watchdog_Sync_level;
     108volatile unsigned32  _Watchdog_Sync_count;
    114109
    115110/*
     
    120115EXTERN Chain_Control _Watchdog_Ticks_chain;
    121116EXTERN Chain_Control _Watchdog_Seconds_chain;
    122 
    123 /*
    124  *  The following defines the synchronization variable used to
    125  *  allow interrupts to be enabled while inserting a watchdog
    126  *  on a watchdog chain.
    127  */
    128 
    129 EXTERN Watchdog_Synchronization_pointer _Watchdog_Sync;
    130117
    131118/*
     
    377364
    378365/*
    379  *
    380  *  _Watchdog_Get_sync
    381  *
    382  *  DESCRIPTION:
    383  *
    384  *  This routine returns the current synchronization timer.  This
    385  *  routine is used so that interrupts can be enabled while a
    386  *  watchdog timer is being inserted into a watchdog chain.
    387  */
    388 
    389 STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void );
    390 
    391 /*
    392  *
    393  *  _Watchdog_Set_sync
    394  *
    395  *  DESCRIPTION:
    396  *
    397  *  This routine sets the current synchronization timer.  This
    398  *  routine is used so that interrupts can be enabled while a
    399  *  watchdog timer is being inserted into a watchdog chain.
    400  */
    401 
    402 STATIC INLINE void _Watchdog_Set_sync(
    403   Watchdog_Control *the_watchdog
    404 );
    405 
    406 /*
    407  *
    408  *  _Watchdog_Clear_sync
    409  *
    410  *  DESCRIPTION:
    411  *
    412  *  This routine will set the watchdog synchronization flag to a
    413  *  NULL address indicating synchronization is unnecessary.
    414  */
    415 
    416 STATIC INLINE void _Watchdog_Clear_sync( void );
    417 
    418 /*
    419366 *  _Watchdog_Adjust
    420367 *
     
    428375  Chain_Control              *header,
    429376  Watchdog_Adjust_directions  direction,
    430   rtems_interval           units
     377  rtems_interval              units
    431378);
    432379
  • cpukit/score/inline/rtems/score/watchdog.inl

    rbf61e45c r88d594a  
    258258}
    259259
    260 /*PAGE
    261  *
    262  *  _Watchdog_Get_sync
    263  *
    264  */
    265 
    266 STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void )
    267 {
    268   return (Watchdog_Control *) _Watchdog_Sync;
    269 }
    270 
    271 /*PAGE
    272  *
    273  *  _Watchdog_Set_sync
    274  *
    275  */
    276 
    277 STATIC INLINE void _Watchdog_Set_sync(
    278   Watchdog_Control *the_watchdog
    279 )
    280 {
    281   _Watchdog_Sync = (Watchdog_Synchronization_pointer) the_watchdog;
    282 }
    283 
    284 /*PAGE
    285  *
    286  *  _Watchdog_Clear_sync
    287  *
    288  */
    289 
    290 STATIC INLINE void _Watchdog_Clear_sync( void )
    291 {
    292   _Watchdog_Sync = NULL;
    293 }
    294 
    295260#endif
    296261/* end of include file */
  • cpukit/score/macros/rtems/score/watchdog.inl

    rbf61e45c r88d594a  
    172172  ((Watchdog_Control *) (_header)->last)
    173173
    174 /*PAGE
    175  *
    176  *  _Watchdog_Get_sync
    177  *
    178  */
    179 
    180 #define _Watchdog_Get_sync() \
    181    ((Watchdog_Control *) _Watchdog_Sync)
    182 
    183 /*PAGE
    184  *
    185  *  _Watchdog_Set_sync
    186  *
    187  */
    188 
    189 #define _Watchdog_Set_sync( _the_watchdog ) \
    190   _Watchdog_Sync = (Watchdog_Synchronization_pointer) (_the_watchdog)
    191 
    192 /*PAGE
    193  *
    194  *  _Watchdog_Clear_sync
    195  *
    196  */
    197 
    198 #define _Watchdog_Clear_sync() \
    199   _Watchdog_Sync = NULL;
    200 
    201174#endif
    202175/* end of include file */
  • cpukit/score/src/heap.c

    rbf61e45c r88d594a  
    117117{
    118118  Heap_Block        *the_block;
    119   Heap_Block        *next_block;
    120   Heap_Block        *previous_block;
     119 
     120  /*
     121   *  The overhead was taken from the original heap memory.
     122   */
     123
     124  Heap_Block  *old_final;
     125  Heap_Block  *new_final;
    121126
    122127  /*
     
    151156  /*
    152157   *  Currently only case 4 should make it to this point.
    153    */
    154 
    155   *amount_extended = size - HEAP_BLOCK_USED_OVERHEAD;
    156 
    157   previous_block = the_heap->last;
    158 
    159   the_block              = (Heap_Block *) starting_address;
    160   the_block->front_flag  = size;
    161   the_block->next        = previous_block->next;
    162   the_block->previous    = previous_block;
    163 
    164   previous_block->next   = the_block;
    165   the_heap->last         = the_block;
    166 
    167   next_block             = _Heap_Next_block( the_block );
    168   next_block->back_flag  = size;
    169   next_block->front_flag = HEAP_DUMMY_FLAG;
    170   the_heap->final        = next_block;
     158   *  The basic trick is to make the extend area look like a used
     159   *  block and free it.
     160   */
     161
     162  *amount_extended = size;
     163
     164  old_final = the_heap->final;
     165  new_final = _Addresses_Add_offset( old_final, size );
     166  /* SAME AS: _Addresses_Add_offset( starting_address, size-HEAP_OVERHEAD ); */
     167
     168  the_heap->final = new_final;
     169
     170  old_final->front_flag =
     171  new_final->back_flag  = _Heap_Build_flag( size, HEAP_BLOCK_USED );
     172  new_final->front_flag = HEAP_DUMMY_FLAG;
     173
     174  /*
     175   *  Must pass in address of "user" area
     176   */
     177
     178  _Heap_Free( the_heap, &old_final->next );
    171179
    172180  return HEAP_EXTEND_SUCCESSFUL;
     
    393401)
    394402{
    395   Heap_Block *the_block;
    396   Heap_Block *next_block;
     403  Heap_Block *the_block  = 0;  /* avoid warnings */
     404  Heap_Block *next_block = 0;  /* avoid warnings */
    397405  int         notdone = 1;
    398406
  • cpukit/score/src/watchdog.c

    rbf61e45c r88d594a  
    3131void _Watchdog_Handler_initialization( void )
    3232{
    33   _Watchdog_Clear_sync();
     33  _Watchdog_Sync_count = 0;
     34  _Watchdog_Sync_level = 0;
    3435  _Chain_Initialize_empty( &_Watchdog_Ticks_chain );
    3536  _Chain_Initialize_empty( &_Watchdog_Seconds_chain );
     
    5758    case WATCHDOG_INACTIVE:
    5859      break;
     60
     61    case WATCHDOG_REINSERT: 
     62   
     63      /*
     64       *  It is not actually on the chain so just change the state and
     65       *  the Insert operation we interrupted will be aborted.
     66       */
     67      the_watchdog->state = WATCHDOG_INACTIVE;
     68      break;
     69
    5970    case WATCHDOG_ACTIVE:
    60     case WATCHDOG_REINSERT:
    6171    case WATCHDOG_REMOVE_IT:
    6272
     
    6777        next_watchdog->delta_interval += the_watchdog->delta_interval;
    6878
    69       if ( the_watchdog == _Watchdog_Sync )
    70         _Watchdog_Sync = _Watchdog_Previous( the_watchdog );
     79      if ( _Watchdog_Sync_count )
     80        _Watchdog_Sync_level = _ISR_Nest_level;
    7181
    7282      _Chain_Extract_unprotected( &the_watchdog->Node );
     
    95105  Chain_Control               *header,
    96106  Watchdog_Adjust_directions   direction,
    97   rtems_interval            units
     107  rtems_interval               units
    98108)
    99109{
     
    137147  ISR_Level         level;
    138148  Watchdog_Control *after;
    139 
    140   the_watchdog->state          = WATCHDOG_REINSERT;
    141   the_watchdog->delta_interval = the_watchdog->initial;
     149  unsigned32        insert_isr_nest_level;
     150  rtems_interval    delta_interval;
     151 
     152
     153  insert_isr_nest_level   = _ISR_Nest_level;
     154  the_watchdog->state = WATCHDOG_REINSERT;
     155
     156  _Watchdog_Sync_count++;
     157restart:
     158  delta_interval = the_watchdog->initial;
    142159
    143160  _ISR_Disable( level );
     
    145162  for ( after = _Watchdog_First( header ) ;
    146163        ;
    147         after = _Watchdog_Next( _Watchdog_Get_sync() ) ) {
    148 
    149      if ( the_watchdog->delta_interval == 0 || !_Watchdog_Next( after ) )
     164        after = _Watchdog_Next( after ) ) {
     165
     166     if ( delta_interval == 0 || !_Watchdog_Next( after ) )
    150167       break;
    151168
    152      if ( the_watchdog->delta_interval < after->delta_interval ) {
    153        after->delta_interval -= the_watchdog->delta_interval;
     169     if ( delta_interval < after->delta_interval ) {
     170       after->delta_interval -= delta_interval;
    154171       break;
    155172     }
    156173
    157      the_watchdog->delta_interval -= after->delta_interval;
    158      _Watchdog_Set_sync( after );
     174     delta_interval -= after->delta_interval;
    159175
    160176     /*
    161       *  If you experience problems comment out the _ISR_Flash line.  Under
    162       *  certain circumstances, this flash allows interrupts to execute
    163       *  which violate the design assumptions.  The critical section
    164       *  mechanism used here must be redesigned to address this.
     177      *  If you experience problems comment out the _ISR_Flash line.  This
     178      *  (3.2.0) is the first release with this critical section redesigned.
     179      *  Under certain circumstances, the PREVIOUS critical section algorithm
     180      *  used around this flash point allows interrupts to execute
     181      *  which violated the design assumptions.  The critical section
     182      *  mechanism used here WAS redesigned to address this.
    165183      */
    166184
    167185     _ISR_Flash( level );
     186
     187     if ( the_watchdog->state != WATCHDOG_REINSERT ) {
     188       goto exit_insert;
     189     }
     190
     191     if ( _Watchdog_Sync_level > insert_isr_nest_level ) {
     192       _Watchdog_Sync_level = insert_isr_nest_level;
     193       _ISR_Enable( level );
     194       goto restart;
     195     }
    168196  }
    169197
     
    171199    _Watchdog_Activate( the_watchdog );
    172200
     201  the_watchdog->delta_interval = delta_interval;
     202
    173203  _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node );
    174204
    175   _Watchdog_Clear_sync();
    176 
    177   _ISR_Enable(  level );
     205exit_insert:
     206  _Watchdog_Sync_level = insert_isr_nest_level;
     207  _Watchdog_Sync_count--;
     208  _ISR_Enable( level );
    178209}
    179210
  • testsuites/mptests/mp01/task1.c

    rbf61e45c r88d594a  
    2222 *  notice must appear in all copies of this file and its derivatives.
    2323 *
    24  *  $Id$
     24 *  task1.c,v 1.2 1995/05/09 20:26:24 joel Exp
    2525 */
    2626
     
    4444  print_time( " - rtems_clock_get - ", &time, "\n" );
    4545
    46   status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
     46  status = rtems_task_wake_after( task_number( tid ) * 1 * TICKS_PER_SECOND );
    4747  directive_failed( status, "rtems_task_wake_after" );
    4848
  • testsuites/sptests/sp04/tswitch.c

    rbf61e45c r88d594a  
    1919 *  notice must appear in all copies of this file and its derivatives.
    2020 *
    21  *  $Id$
     21 *  tswitch.c,v 1.2 1995/05/09 20:32:43 joel Exp
    2222 */
    2323
     
    4545
    4646      put_name( Task_name[ index ], FALSE );
    47       print_time( " - ", &time, "\n" );
     47      print_time( "- ", &time, "\n" );
    4848
    4949      if ( time.second >= 16 ) {
  • testsuites/sptests/sp09/screen14.c

    rbf61e45c r88d594a  
    7777  puts( "TA1 - rtems_timer_cancel - RTEMS_INVALID_ID" );
    7878
    79   status = rtems_timer_cancel( Timer_id[ 1 ] );
    80   fatal_directive_status(
    81     status,
    82     RTEMS_INCORRECT_STATE,
    83     "rtems_timer_cancel before initiated"
    84   );
    85   puts( "TA1 - rtems_timer_cancel - RTEMS_INCORRECT_STATE" );
    86 
    8779  status = rtems_timer_reset( 0x010100 );
    8880  fatal_directive_status(
  • testsuites/sptests/sp09/sp09.scn

    rbf61e45c r88d594a  
    238238TA1 - rtems_timer_ident - RTEMS_INVALID_NAME
    239239TA1 - rtems_timer_cancel - RTEMS_INVALID_ID
    240 TA1 - rtems_timer_cancel - RTEMS_INCORRECT_STATE
    241240TA1 - rtems_timer_reset - RTEMS_INVALID_ID
    242241TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED
  • testsuites/sptests/sp20/sp20.scn

    rbf61e45c r88d594a  
    1414TA5 - rtems_rate_monotonic_create id = 0x00010005
    1515TA5 - rtems_rate_monotonic_ident id = 0x00010005
    16 TA5 - (0x00010005) period 50
     16TA5 - (0x00010005) period 100
    1717TA5 - PERIODS CHECK OK (1)
    1818TA5 - PERIODS CHECK OK (2)
  • testsuites/sptests/spsize/size.c

    rbf61e45c r88d594a  
    333333/*watchdog.h*/  (sizeof _Watchdog_Ticks_chain)            +
    334334                (sizeof _Watchdog_Seconds_chain)          +
    335                 (sizeof _Watchdog_Sync)                   +
     335                (sizeof _Watchdog_Sync_count)             +
     336                (sizeof _Watchdog_Sync_level)             +
    336337
    337338/*wkspace.h*/   (sizeof _Workspace_Area);
  • tools/cpu/hppa1.1/genoffsets.c

    rbf61e45c r88d594a  
    11/*
    2  *      @(#)genoffsets.c        1.3 - 95/03/15
    3  *
     2 *      @(#)genoffsets.c        1.5 - 95/05/16
     3 *     
    44 *
    55 *  genoffsets.c
     
    77 *  This file generates the offsets.h for the HP PA-RISC port of RTEMS.
    88 *
    9  *  NOTE:  It only prints the offset for structures actually used
     9 *  NOTE:  It only prints the offset for structures actually used 
    1010 *         by the assembly code.
    1111 *
     
    1717 *  notice must appear in all copies of this file and its derivatives.
    1818 *
    19  *  $Id$
     19 *  genoffsets.c,v 1.2 1995/05/09 20:16:48 joel Exp
    2020 *
    2121 */
Note: See TracChangeset for help on using the changeset viewer.