Changeset e0d71f7 in rtems for cpukit


Ignore:
Timestamp:
Aug 17, 2009, 1:31:20 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
07ed2f87
Parents:
400a04a
Message:

2009-08-17 Joel Sherrill <joel.sherrill@…>

  • rtems/src/clockget.c: Restructure to ease coverage analysis of deprecated routine.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r400a04a re0d71f7  
     12009-08-17      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * rtems/src/clockget.c: Restructure to ease coverage analysis of
     4        deprecated routine.
     5
    162009-08-16      Joel Sherrill <joel.sherrill@oarcorp.com>
    27
  • cpukit/rtems/src/clockget.c

    r400a04a re0d71f7  
    22 *  Clock Manager
    33 *
    4  *  COPYRIGHT (c) 1989-2008.
     4 *  COPYRIGHT (c) 1989-2009.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
     
    2424#include <rtems/score/watchdog.h>
    2525
    26 /*PAGE
    27  *
     26/*
    2827 *  rtems_clock_get
    2928 *
     
    5049    return RTEMS_INVALID_ADDRESS;
    5150
    52   switch ( option ) {
    53     case RTEMS_CLOCK_GET_TOD:
    54       return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer );
     51  if ( option == RTEMS_CLOCK_GET_TOD )
     52    return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer );
    5553
    56     case RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH:
     54  if ( option == RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH )
    5755      return rtems_clock_get_seconds_since_epoch((rtems_interval *)time_buffer);
    5856
    59     case RTEMS_CLOCK_GET_TICKS_SINCE_BOOT: {
    60       rtems_interval *interval = (rtems_interval *)time_buffer;
     57  if ( option == RTEMS_CLOCK_GET_TICKS_SINCE_BOOT ) {
     58    rtems_interval *interval = (rtems_interval *)time_buffer;
     59 
     60    *interval = rtems_clock_get_ticks_since_boot();
     61    return RTEMS_SUCCESSFUL;
     62  }
     63
     64  if ( option == RTEMS_CLOCK_GET_TICKS_PER_SECOND ) {
     65    rtems_interval *interval = (rtems_interval *)time_buffer;
    6166 
    62       *interval = rtems_clock_get_ticks_since_boot();
    63       return RTEMS_SUCCESSFUL;
    64     }
    65     case RTEMS_CLOCK_GET_TICKS_PER_SECOND: {
    66       rtems_interval *interval = (rtems_interval *)time_buffer;
    67  
    68       *interval = rtems_clock_get_ticks_per_second();
    69       return RTEMS_SUCCESSFUL;
    70     }
    71     case RTEMS_CLOCK_GET_TIME_VALUE:
     67    *interval = rtems_clock_get_ticks_per_second();
     68    return RTEMS_SUCCESSFUL;
     69  }
     70
     71  if ( option == RTEMS_CLOCK_GET_TIME_VALUE )
    7272      return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer );
    73 
    74     default:
    75       break;
    76   }
    7773
    7874  return RTEMS_INVALID_NUMBER;
Note: See TracChangeset for help on using the changeset viewer.