Replacing timer_t by netbsd's timer_t

* Renamed struct timer to struct minix_timer
 * Renamed timer_t to minix_timer_t
 * Ensured all the code uses the minix_timer_t typedef
 * Removed ifdef around _BSD_TIMER_T
 * Removed include/timers.h and merged it into include/minix/timers.h
 * Resolved prototype conflict by renaming kernel's (re)set_timer
   to (re)set_kernel_timer.

Change-Id: I56f0f30dfed96e1a0575d92492294cf9a06468a5
This commit is contained in:
2013-09-19 10:57:10 +02:00
parent 214c4e152b
commit 9fab85c2de
67 changed files with 256 additions and 278 deletions

View File

@@ -1,7 +1,7 @@
#include "syslib.h"
#include <assert.h>
#include <machine/archtypes.h>
#include <timers.h>
#include <minix/timers.h>
#include "kernel/config.h"
#include "kernel/const.h"

View File

@@ -1,5 +1,5 @@
#include "sysutil.h"
#include <timers.h>
#include <minix/timers.h>
/*===========================================================================*
* tickdelay *

View File

@@ -12,16 +12,16 @@
*/
#include "syslib.h"
#include <timers.h>
#include <minix/timers.h>
#include <minix/sysutil.h>
static timer_t *timers = NULL;
static minix_timer_t *timers = NULL;
static int expiring = 0;
/*===========================================================================*
* init_timer *
*===========================================================================*/
void init_timer(timer_t *tp)
void init_timer(minix_timer_t *tp)
{
tmr_inittimer(tp);
}
@@ -29,7 +29,7 @@ void init_timer(timer_t *tp)
/*===========================================================================*
* set_timer *
*===========================================================================*/
void set_timer(timer_t *tp, int ticks, tmr_func_t watchdog, int arg)
void set_timer(minix_timer_t *tp, int ticks, tmr_func_t watchdog, int arg)
{
int r;
clock_t now, prev_time = 0, next_time;
@@ -51,7 +51,7 @@ void set_timer(timer_t *tp, int ticks, tmr_func_t watchdog, int arg)
/*===========================================================================*
* cancel_timer *
*===========================================================================*/
void cancel_timer(timer_t *tp)
void cancel_timer(minix_timer_t *tp)
{
clock_t next_time, prev_time;
prev_time = tmrs_clrtimer(&timers, tp, &next_time);

View File

@@ -1,6 +1,6 @@
/* This library provides generic watchdog timer management functionality.
* See the comments in <timers.h> for details.
* See the comments in <minix/timers.h> for details.
*/
#include <timers.h> /* definitions and function prototypes */
#include <minix/timers.h> /* definitions and function prototypes */
#include <sys/null.h>

View File

@@ -4,13 +4,13 @@
* tmrs_clrtimer *
*===========================================================================*/
clock_t tmrs_clrtimer(tmrs, tp, next_time)
timer_t **tmrs; /* pointer to timers queue */
timer_t *tp; /* timer to be removed */
minix_timer_t **tmrs; /* pointer to timers queue */
minix_timer_t *tp; /* timer to be removed */
clock_t *next_time;
{
/* Deactivate a timer and remove it from the timers queue.
*/
timer_t **atp;
minix_timer_t **atp;
clock_t prev_time;
if(*tmrs)

View File

@@ -4,7 +4,7 @@
* tmrs_exptimers *
*===========================================================================*/
void tmrs_exptimers(tmrs, now, new_head)
timer_t **tmrs; /* pointer to timers queue */
minix_timer_t **tmrs; /* pointer to timers queue */
clock_t now; /* current time */
clock_t *new_head;
{
@@ -12,7 +12,7 @@ clock_t *new_head;
* Run the watchdog functions for all expired timers and deactivate them.
* The caller is responsible for scheduling a new alarm if needed.
*/
timer_t *tp;
minix_timer_t *tp;
while ((tp = *tmrs) != NULL && tp->tmr_exp_time <= now) {
*tmrs = tp->tmr_next;

View File

@@ -4,8 +4,8 @@
* tmrs_settimer *
*===========================================================================*/
clock_t tmrs_settimer(tmrs, tp, exp_time, watchdog, new_head)
timer_t **tmrs; /* pointer to timers queue */
timer_t *tp; /* the timer to be added */
minix_timer_t **tmrs; /* pointer to timers queue */
minix_timer_t *tp; /* the timer to be added */
clock_t exp_time; /* its expiration time */
tmr_func_t watchdog; /* watchdog function to be run */
clock_t *new_head; /* new earliest timer, if non NULL */
@@ -15,7 +15,7 @@ clock_t *new_head; /* new earliest timer, if non NULL */
* in the list of active timers with the first to expire in front.
* The caller responsible for scheduling a new alarm for the timer if needed.
*/
timer_t **atp;
minix_timer_t **atp;
clock_t old_head = 0;
if(*tmrs)