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

@@ -170,7 +170,7 @@ static struct port_state {
struct device part[DEV_PER_DRIVE]; /* partition bases and sizes */
struct device subpart[SUB_PER_DRIVE]; /* same for subpartitions */
timer_t timer; /* port-specific timeout timer */
minix_timer_t timer; /* port-specific timeout timer */
int left; /* number of tries left before giving up */
/* (only used for signature probing) */
@@ -178,7 +178,7 @@ static struct port_state {
u32_t pend_mask; /* commands not yet complete */
struct {
thread_id_t tid;/* ID of the worker thread */
timer_t timer; /* timer associated with each request */
minix_timer_t timer; /* timer associated with each request */
int result; /* success/failure result of the commands */
} cmd_info[NR_CMDS];
} port_state[NR_PORTS];
@@ -232,7 +232,7 @@ static void port_set_cmd(struct port_state *ps, int cmd, cmd_fis_t *fis,
u8_t packet[ATAPI_PACKET_SIZE], prd_t *prdt, int nr_prds, int write);
static void port_issue(struct port_state *ps, int cmd, clock_t timeout);
static int port_exec(struct port_state *ps, int cmd, clock_t timeout);
static void port_timeout(struct timer *tp);
static void port_timeout(minix_timer_t *tp);
static void port_disconnect(struct port_state *ps);
static char *ahci_portname(struct port_state *ps);
@@ -1712,7 +1712,7 @@ static void port_intr(struct port_state *ps)
/*===========================================================================*
* port_timeout *
*===========================================================================*/
static void port_timeout(struct timer *tp)
static void port_timeout(minix_timer_t *tp)
{
/* A timeout has occurred on this port. Figure out what the timeout is
* for, and take appropriate action.

View File

@@ -13,7 +13,7 @@
#include <machine/pci.h>
#include <minix/ds.h>
#include <minix/vm.h>
#include <timers.h>
#include <minix/timers.h>
#include <sys/mman.h>
#include "assert.h"
#include "e1000.h"

View File

@@ -23,7 +23,7 @@
*/
#include "floppy.h"
#include <timers.h>
#include <minix/timers.h>
#include <machine/diskparm.h>
#include <minix/sysutil.h>
#include <minix/syslib.h>
@@ -212,7 +212,7 @@ static struct floppy { /* main drive struct, one entry per drive */
char fl_calibration; /* CALIBRATED or UNCALIBRATED */
u8_t fl_density; /* NO_DENS = ?, 0 = 360K; 1 = 360K/1.2M; etc.*/
u8_t fl_class; /* bitmap for possible densities */
timer_t fl_tmr_stop; /* timer to stop motor */
minix_timer_t fl_tmr_stop; /* timer to stop motor */
struct device fl_geom; /* Geometry of the drive */
struct device fl_part[NR_PARTITIONS]; /* partition's base & size */
} floppy[NR_DRIVES];
@@ -236,11 +236,11 @@ static u8_t f_results[MAX_RESULTS];/* the controller can give lots of output */
* Besides the 'f_tmr_timeout' timer below, the floppy structure for each
* floppy disk drive contains a 'fl_tmr_stop' timer.
*/
static timer_t f_tmr_timeout; /* timer for various timeouts */
static minix_timer_t f_tmr_timeout; /* timer for various timeouts */
static u32_t system_hz; /* system clock frequency */
static void f_expire_tmrs(clock_t stamp);
static void stop_motor(timer_t *tp);
static void f_timeout(timer_t *tp);
static void stop_motor(minix_timer_t *tp);
static void f_timeout(minix_timer_t *tp);
static struct device *f_prepare(devminor_t device);
static struct device *f_part(devminor_t minor);
@@ -785,7 +785,7 @@ static void start_motor(void)
/*===========================================================================*
* stop_motor *
*===========================================================================*/
static void stop_motor(timer_t *tp)
static void stop_motor(minix_timer_t *tp)
{
/* This routine is called from an alarm timer after several seconds have
* elapsed with no floppy disk activity. It turns the drive motor off.
@@ -1199,7 +1199,7 @@ static int f_intr_wait(void)
/*===========================================================================*
* f_timeout *
*===========================================================================*/
static void f_timeout(timer_t *UNUSED(tp))
static void f_timeout(minix_timer_t *UNUSED(tp))
{
/* This routine is called when a timer expires. Usually to tell that a
* motor has spun up, but also to forge an interrupt when it takes too long

View File

@@ -18,7 +18,7 @@
#include <minix/ds.h>
#include <minix/endpoint.h>
#include <timers.h>
#include <minix/timers.h>
#define debug 0
#define RAND_UPDATE /**/
@@ -141,7 +141,7 @@ static int fxp_instance;
static fxp_t *fxp_state;
static timer_t fxp_watchdog;
static minix_timer_t fxp_watchdog;
static u32_t system_hz;
@@ -170,7 +170,7 @@ static void fxp_restart_ru(fxp_t *fp);
static void fxp_getstat_s(message *mp);
static void fxp_handler(fxp_t *fp);
static void fxp_check_ints(fxp_t *fp);
static void fxp_watchdog_f(timer_t *tp);
static void fxp_watchdog_f(minix_timer_t *tp);
static int fxp_link_changed(fxp_t *fp);
static void fxp_report_link(fxp_t *fp);
static void reply(fxp_t *fp);
@@ -1627,7 +1627,7 @@ static void fxp_check_ints(fxp_t *fp)
* fxp_watchdog_f *
*===========================================================================*/
static void fxp_watchdog_f(tp)
timer_t *tp;
minix_timer_t *tp;
{
fxp_t *fp;

View File

@@ -15,7 +15,7 @@
#include <minix/syslib.h>
#include <minix/type.h>
#include <minix/sysutil.h>
#include <timers.h>
#include <minix/timers.h>
#include <machine/pci.h>
#include <minix/ds.h>
#include <minix/endpoint.h>
@@ -149,7 +149,7 @@ static void or_getstat_s(message * mp);
static void print_linkstatus(t_or * orp, u16_t status);
static int or_get_recvd_packet(t_or *orp, u16_t rxfid, u8_t *databuf);
static void or_reset(void);
static void or_watchdog_f(timer_t *tp);
static void or_watchdog_f(minix_timer_t *tp);
static void setup_wepkey(t_or *orp, char *wepkey0);
static void do_hard_int(void);
static void check_int_events(void);
@@ -1092,7 +1092,7 @@ next:
* Will be called regularly to see whether the driver has crashed. If that *
* condition is detected, reset the driver and card *
*****************************************************************************/
static void or_watchdog_f(timer_t *tp)
static void or_watchdog_f(minix_timer_t *tp)
{
t_or *orp;

View File

@@ -91,7 +91,7 @@ static void rtl8139_dump(message *m);
static void dump_phy(re_t *rep);
#endif
static int rl_handler(re_t *rep);
static void rl_watchdog_f(timer_t *tp);
static void rl_watchdog_f(minix_timer_t *tp);
static void tell_dev(vir_bytes start, size_t size, int pci_bus, int
pci_dev, int pci_func);
@@ -1969,7 +1969,7 @@ static int rl_handler(re_t *rep)
* rl_watchdog_f *
*===========================================================================*/
static void rl_watchdog_f(tp)
timer_t *tp;
minix_timer_t *tp;
{
re_t *rep;
/* Use a synchronous alarm instead of a watchdog timer. */

View File

@@ -18,7 +18,7 @@ Created: Aug 2003 by Philip Homburg <philip@cs.vu.nl>
#include <minix/type.h>
#include <minix/sysutil.h>
#include <minix/endpoint.h>
#include <timers.h>
#include <minix/timers.h>
#include <net/hton.h>
#include <net/gen/ether.h>
#include <net/gen/eth_io.h>

View File

@@ -18,7 +18,7 @@
#include <minix/type.h>
#include <minix/sysutil.h>
#include <minix/endpoint.h>
#include <timers.h>
#include <minix/timers.h>
#include <net/hton.h>
#include <net/gen/ether.h>
#include <net/gen/eth_io.h>
@@ -223,7 +223,7 @@ static void check_int_events(void);
static void do_hard_int(void);
static void dump_phy(const re_t *rep);
static void rl_handler(re_t *rep);
static void rl_watchdog_f(timer_t *tp);
static void rl_watchdog_f(minix_timer_t *tp);
/*
* The message used in the main loop is made global, so that rl_watchdog_f()
@@ -1888,7 +1888,7 @@ static void rl_handler(re_t *rep)
* rl_watchdog_f *
*===========================================================================*/
static void rl_watchdog_f(tp)
timer_t *tp;
minix_timer_t *tp;
{
re_t *rep;
/* Use a synchronous alarm instead of a watchdog timer. */

View File

@@ -123,7 +123,7 @@ static void flush(console_t *cons);
static void parse_escape(console_t *cons, int c);
static void scroll_screen(console_t *cons, int dir);
static void set_6845(int reg, unsigned val);
static void stop_beep(timer_t *tmrp);
static void stop_beep(minix_timer_t *tmrp);
static void cons_org0(void);
static void disable_console(void);
static void reenable_console(void);
@@ -789,7 +789,7 @@ static void beep()
* This routine works by turning on the bits 0 and 1 in port B of the 8255
* chip that drive the speaker.
*/
static timer_t tmr_stop_beep;
static minix_timer_t tmr_stop_beep;
pvb_pair_t char_out[3];
u32_t port_b_val;
@@ -885,7 +885,7 @@ clock_t dur;
* This routine works by turning on the bits 0 and 1 in port B of the 8255
* chip that drive the speaker.
*/
static timer_t tmr_stop_beep;
static minix_timer_t tmr_stop_beep;
pvb_pair_t char_out[3];
u32_t port_b_val;
@@ -914,7 +914,7 @@ clock_t dur;
/*===========================================================================*
* stop_beep *
*===========================================================================*/
static void stop_beep(timer_t *UNUSED(tmrp))
static void stop_beep(minix_timer_t *UNUSED(tmrp))
{
/* Turn off the beeper by turning off bits 0 and 1 in PORT_B. */
u32_t port_b_val;

View File

@@ -151,7 +151,7 @@ static int kbd_watchdog_set= 0;
static int kbd_alive= 1;
static long sticky_alt_mode = 0;
static long debug_fkeys = 1;
static timer_t tmr_kbd_wd;
static minix_timer_t tmr_kbd_wd;
static void kbc_cmd0(int cmd);
static void kbc_cmd1(int cmd, int data);
@@ -166,7 +166,7 @@ static void set_leds(void);
static void show_key_mappings(void);
static int kb_read(struct tty *tp, int try);
static unsigned map_key(int scode);
static void kbd_watchdog(timer_t *tmrp);
static void kbd_watchdog(minix_timer_t *tmrp);
static int kbd_open(devminor_t minor, int access, endpoint_t user_endpt);
static int kbd_close(devminor_t minor);
@@ -1323,7 +1323,7 @@ int *isauxp;
/*===========================================================================*
* kbd_watchdog *
*===========================================================================*/
static void kbd_watchdog(timer_t *UNUSED(tmrp))
static void kbd_watchdog(minix_timer_t *UNUSED(tmrp))
{
kbd_watchdog_set= 0;

View File

@@ -63,7 +63,7 @@ unsigned long rs_irq_set = 0;
struct kmessages kmess;
static void tty_timed_out(timer_t *tp);
static void tty_timed_out(minix_timer_t *tp);
static void settimer(tty_t *tty_ptr, int enable);
static void in_transfer(tty_t *tp);
static int tty_echo(tty_t *tp, int ch);
@@ -1608,7 +1608,7 @@ static void tty_init()
/*===========================================================================*
* tty_timed_out *
*===========================================================================*/
static void tty_timed_out(timer_t *tp)
static void tty_timed_out(minix_timer_t *tp)
{
/* This timer has expired. Set the events flag, to force processing. */
tty_t *tty_ptr;

View File

@@ -1,7 +1,7 @@
/* tty.h - Terminals */
#include <minix/chardriver.h>
#include <timers.h>
#include <minix/timers.h>
#undef lock
#undef unlock
@@ -42,7 +42,7 @@ typedef struct tty {
devfun_t tty_devread; /* routine to read from low level buffers */
devfun_t tty_icancel; /* cancel any device input */
int tty_min; /* minimum requested #chars in input queue */
timer_t tty_tmr; /* the timer for this tty */
minix_timer_t tty_tmr; /* the timer for this tty */
/* Output section. */
devfun_t tty_devwrite; /* routine to start actual device output */