Changeset 8b6636f9 in rtems
- Timestamp:
- 10/12/14 20:35:52 (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- f95f212a
- Parents:
- a869b37a
- git-author:
- Joel Sherrill <joel.sherrill@…> (10/12/14 20:35:52)
- git-committer:
- Joel Sherrill <joel.sherrill@…> (10/13/14 15:32:38)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libcpu/mips/clock/ckinit.c
ra869b37a r8b6636f9 1 /* ckinit.c 2 * 1 /* 3 2 * This file contains the clock driver initialization for the IDT 4650. 4 * 3 */ 4 5 /* 5 6 * Author: Craig Lebakken <craigl@transition.com> 6 7 * … … 31 32 * Rather than deleting this, it is commented out to (hopefully) help 32 33 * the submitter send updates. 33 *34 * static char _sccsid[] = "@(#)ckinit.c 08/20/96 1.3\n";35 34 */ 36 37 35 38 36 #include <stdlib.h> 39 37 40 38 #include <rtems.h> 41 #include <rtems/ libio.h>39 #include <rtems/clockdrv.h> 42 40 43 41 #define EXT_INT5 0x8000 /* external interrupt 5 */ … … 50 48 mips_isr_entry set_vector( rtems_isr_entry, rtems_vector_number, int ); 51 49 52 void Clock_exit( void );53 rtems_isr Clock_isr( rtems_vector_number vector );54 55 56 50 /* 57 51 * The interrupt vector number associated with the clock tick device 58 52 * driver. 59 53 */ 60 61 54 #define CLOCK_VECTOR_MASK EXT_INT5 62 55 #define CLOCK_VECTOR 0x7 … … 66 59 * number of clock ticks since the driver was initialized. 67 60 */ 68 69 61 volatile uint32_t Clock_driver_ticks; 70 62 … … 76 68 * has passed. 77 69 */ 78 79 70 uint32_t Clock_isrs; /* ISRs until next tick */ 80 81 /*82 * These are set by clock driver during its init83 */84 85 rtems_device_major_number rtems_clock_major = ~0;86 rtems_device_minor_number rtems_clock_minor;87 71 88 72 /* 89 73 * The previous ISR on this clock tick interrupt vector. 90 74 */ 91 92 75 rtems_isr_entry Old_ticker; 93 94 void Clock_exit( void );95 76 96 77 static uint32_t mips_timer_rate = 0; … … 99 80 * Isr Handler 100 81 */ 101 102 rtems_isr Clock_isr( 82 static rtems_isr Clock_isr( 103 83 rtems_vector_number vector 104 84 ) 105 85 { 106 86 /* 107 * bump the number of clock driver ticks since initialization108 *109 * determine if it is time to announce the passing of tick as configured110 * to RTEMS through the rtems_clock_tick directive111 *112 * perform any timer dependent tasks113 */87 * bump the number of clock driver ticks since initialization 88 * 89 * determine if it is time to announce the passing of tick as configured 90 * to RTEMS through the rtems_clock_tick directive 91 * 92 * perform any timer dependent tasks 93 */ 114 94 115 95 /* refresh the internal CPU timer */ … … 141 121 * is used to initially establish the clock tick. 142 122 */ 143 144 void Install_clock( 123 static void Install_clock( 145 124 rtems_isr_entry clock_isr 146 125 ) … … 154 133 155 134 Old_ticker = (rtems_isr_entry) set_vector( clock_isr, CLOCK_VECTOR, 1 ); 135 156 136 /* 157 137 * Hardware specific initialize goes here 158 138 */ 159 160 139 mips_timer_rate = rtems_configuration_get_microseconds_per_tick() * 161 140 bsp_clicks_per_microsecond; … … 166 145 * Schedule the clock cleanup routine to execute if the application exits. 167 146 */ 168 169 147 atexit( Clock_exit ); 170 148 } … … 173 151 * Clean up before the application exits 174 152 */ 175 176 153 void Clock_exit( void ) 177 154 { … … 185 162 * Device driver entry point for clock tick driver initialization. 186 163 */ 187 188 164 rtems_device_driver Clock_initialize( 189 165 rtems_device_major_number major, … … 194 170 Install_clock( Clock_isr ); 195 171 196 /*197 * make major/minor avail to others such as shared memory driver198 */199 200 rtems_clock_major = major;201 rtems_clock_minor = minor;202 203 172 return RTEMS_SUCCESSFUL; 204 173 }
Note: See TracChangeset
for help on using the changeset viewer.